Commit 17540505f2455c9f0cd52d5159a751e67d7d793e

Authored by yiming
1 parent 01d02c94

大客流

Showing 38 changed files with 4111 additions and 53 deletions

Too many changes to show.

To preserve performance only 38 of 45 files are displayed.

src/main/java/com/bsth/data/BasicData.java
... ... @@ -105,6 +105,8 @@ public class BasicData {
105 105 // 线路编码_日期 等级
106 106 public static Map<String, String> lineDate2Level;
107 107  
  108 + public static Map<String, StationRoute> stationCode2StationMap;
  109 +
108 110 static Logger logger = LoggerFactory.getLogger(BasicData.class);
109 111  
110 112 public static String getStationNameByCode(String code, String prefix){
... ... @@ -258,11 +260,13 @@ public class BasicData {
258 260 */
259 261 public void loadStationInfo() {
260 262 Map<String, String> stationCode2Name = new HashMap<>();
  263 + Map<String,StationRoute> stationCode2Station = new HashMap<>();
261 264 Iterator<StationRoute> iterator = stationRouteRepository.findAll().iterator();
262 265 StationRoute sroute;
263 266 while (iterator.hasNext()) {
264 267 sroute = iterator.next();
265 268 stationCode2Name.put(sroute.getLineCode() + "_" + sroute.getDirections() + "_" + sroute.getStationCode(), sroute.getStationName());
  269 + stationCode2Station.put(sroute.getLineCode()+"_"+sroute.getStationCode(),sroute);
266 270 }
267 271  
268 272 //停车场
... ... @@ -279,6 +283,7 @@ public class BasicData {
279 283 }
280 284 parkCodeList = parkCodes;
281 285 stationCode2NameMap = stationCode2Name;
  286 + stationCode2StationMap=stationCode2Station;
282 287 }
283 288  
284 289 /**
... ...
src/main/java/com/bsth/data/zndd/AutomaticSch.java
... ... @@ -435,7 +435,7 @@ public class AutomaticSch {
435 435 return sp;
436 436 }
437 437 //生成唯一id
438   - public String UUID(){
  438 + public static String UUID(){
439 439 String uuid = UUID.randomUUID().toString().replaceAll("-", "");
440 440 uuid=uuid.substring(0,10);
441 441 StringBuilder builder=new StringBuilder();
... ...
src/main/java/com/bsth/data/zndd/OutEntrance.java
1 1 package com.bsth.data.zndd;
  2 +import com.alibaba.fastjson.JSONArray;
  3 +import com.alibaba.fastjson.JSONObject;
2 4 import com.bsth.common.ResponseCode;
  5 +import com.bsth.data.BasicData;
3 6 import com.bsth.data.schedule.DayOfSchedule;
4 7 import com.bsth.data.schedule.ScheduleComparator;
  8 +import com.bsth.entity.StationRoute;
5 9 import com.bsth.entity.realcontrol.ScheduleRealInfo;
6 10 import com.bsth.entity.zndd.StationPeopleLogger;
7 11 import com.bsth.entity.zndd.StationSignsLogger;
  12 +import com.bsth.service.schedule.utils.Md5Util;
  13 +import com.bsth.util.HttpClientUtils;
8 14 import com.bsth.websocket.handler.SendUtils;
9 15 import com.fasterxml.jackson.databind.ObjectMapper;
10 16 import org.slf4j.Logger;
... ... @@ -17,6 +23,9 @@ import java.text.SimpleDateFormat;
17 23 import java.time.LocalTime;
18 24 import java.time.format.DateTimeFormatter;
19 25 import java.util.*;
  26 +import java.util.concurrent.ConcurrentHashMap;
  27 +import java.util.concurrent.ConcurrentMap;
  28 +import java.util.stream.Collectors;
20 29  
21 30 /**
22 31 * 对外接口
... ... @@ -39,65 +48,138 @@ public class OutEntrance {
39 48 @Value("${dc.profile}")
40 49 private String profile; //存储图片地址*/
41 50  
  51 + @Value("${baidu.ak}")
  52 + private String ak; //百度api秘钥*/
  53 +
42 54 static String url= "http://58.34.52.130:9777/xxfb/carMonitor?"; //信息发布地址
43 55 Logger logger = LoggerFactory.getLogger(this.getClass());
44 56 @Autowired
45 57 carMonitor carMonitor;
46 58  
  59 + private static final String PASSWORD="e126853c7f6f43b4857fa8dfe3b28b5d90be9e68";
  60 +
47 61  
48 62  
49 63 //调度屏小程序接口。
50 64 @RequestMapping(value = "/OutCar", method = RequestMethod.POST)
51   - public Map OutCarOutCar(@RequestParam Map m,@RequestBody Map<String, String> map) {
52   -
53   -
54   - Map rtn = new HashMap<>();
55   - try {
56   -
57   - ObjectMapper mapper = new ObjectMapper();
58   - m.put("image", uploadBase64Img(map.get("img").toString()));
59   - //map转换实体类
60   - StationSignsLogger ssLogger = mapper.convertValue(m, StationSignsLogger.class);
61   - //stationSignsLoggerService.save(ssLogger);
62   -
63   - //线调页面推送
64   - sendUtils.stationcf(m);
65   -
66   - //查询班次情况自动回复
67   - //当前日期
68   - //String rq = DateUtils.dqDate();
69   - List<Map> dzList = carMonitor.carMonitor(ssLogger.getLineCode(), ssLogger.getDir(), ssLogger.getStation()); //信息发布接口
70   - if (dzList.size() > 0){
71   - rtn.put("message","车辆还有"+dzList.get(0).get("sj")+"抵达,请耐心等待");
72   - }else {
73   - //筛选方向
74   - List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode());
75   - //排序
76   - Collections.sort(rs,new ScheduleComparator.FCSJ());
77   - SimpleDateFormat sdf= new SimpleDateFormat("HH:ss");
78   - String sjtext = "";
79   - LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm"));
80   - for (ScheduleRealInfo sr:rs) {
81   - LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm"));
82   - //判断上下行
83   - if(t1.isAfter(t2)){
84   - sjtext = sr.getFcsj();
  65 + public Map OutCarOutCar(@RequestParam Map m,@RequestBody StationSignsLogger ssLogger) {
  66 + Map rtn = new HashMap<>();
  67 + try {
  68 + if(!validation(ssLogger.getTimestamp(),ssLogger.getSign())){
  69 + rtn.put("status", "验证失败");
  70 + return rtn;
  71 + }
  72 + m.put("image", uploadBase64Img(ssLogger.getImage()));
  73 + m.put("lineCode", ssLogger.getLineCode());
  74 + m.put("stationName",BasicData.stationCode2NameMap.get(ssLogger.getLineCode()+"_"+ssLogger.getDir()+"_"+ssLogger.getStation()));
  75 + m.put("lineName",BasicData.lineCode2NameMap.get(ssLogger.getLineCode()));
  76 + m.put("num",ssLogger.getNum());
  77 + m.put("dir",ssLogger.getDir());
  78 +
  79 + //线调页面推送
  80 + sendUtils.stationcf(m);
  81 +
  82 + //查询班次情况自动回复
  83 + //当前日期
  84 + List<Map> dzList = carMonitor.carMonitor(ssLogger.getLineCode(), ssLogger.getDir(), ssLogger.getStation()); //信息发布接口
  85 + if (dzList.size() > 0){
  86 + String lon=dzList.get(0).get("lon").toString();
  87 + String lat=dzList.get(0).get("lat").toString();
  88 + String nbbm=dzList.get(0).get("nbbm").toString();
  89 + String road=dzList.get(0).get("road").toString();
  90 + String trafficStatus=getTraffic(nbbm,lon,lat);
  91 + String s="";
  92 + if(!"畅通".equals(trafficStatus)){
  93 + s=road+trafficStatus+",";
  94 + }
  95 + rtn.put("message",s+"车辆预计还有"+dzList.get(0).get("sj")+"抵达,请耐心等待");
  96 + }else {
  97 + //筛选方向
  98 + List<ScheduleRealInfo> rs = dayOfSchedule.findByLineCode(ssLogger.getLineCode());
  99 + //排序
  100 + Collections.sort(rs,new ScheduleComparator.FCSJ());
  101 + SimpleDateFormat sdf= new SimpleDateFormat("HH:ss");
  102 + String sjtext = "";
  103 + LocalTime t1 = LocalTime.parse(sdf.format(new Date()), DateTimeFormatter.ofPattern("HH:mm"));
  104 + for (ScheduleRealInfo sr:rs) {
  105 + LocalTime t2 = LocalTime.parse(sr.getFcsj(), DateTimeFormatter.ofPattern("HH:mm"));
  106 + //判断上下行
  107 + if(t1.isAfter(t2)){
  108 + sjtext = sr.getFcsj();
  109 + }
  110 + }
  111 + rtn.put("message","车辆预计"+sjtext+"发车,请耐心等待");
85 112 }
86   - }
87 113  
88   - rtn.put("message","航津路与杨高北路交叉口拥堵,请耐心等待");
89   - rtn.put("message_els","The intersection of Hangjin Road and Yanggao North Road is congested, please be patient and wait");
  114 + rtn.put("status",ResponseCode.SUCCESS);
  115 + } catch (Exception e) {
  116 + rtn.put("status", ResponseCode.ERROR);
  117 + logger.error("",e);
  118 + }
  119 + return rtn;
90 120 }
91 121  
92   - rtn.put("status",ResponseCode.SUCCESS);
93   - } catch (Exception e) {
94   - rtn.put("status", ResponseCode.ERROR);
95   - logger.info(e.getMessage());
96   - }
97 122  
98   - return rtn;
99   - }
  123 + @RequestMapping(value = "/klyj", method = RequestMethod.POST)
  124 + public void klyj(@RequestBody JSONObject jsonObject) {
  125 + try {
  126 + if(!validation(Long.parseLong(jsonObject.getString("timestamp")),jsonObject.getString("sign"))){
  127 + return ;
  128 + }
  129 + String num=jsonObject.getString("num");
  130 + String image=jsonObject.getString("image");
  131 + String img=uploadBase64Img(image);
  132 + JSONArray jsonArray = jsonObject.getJSONArray("stations");
  133 + LocalTime localTime=LocalTime.now();
  134 + DateTimeFormatter dateTimeFormatter=DateTimeFormatter.ofPattern("HH:mm");
  135 + for (int i = 0; i < jsonArray.size(); i++) {
  136 + JSONObject line=jsonArray.getJSONObject(i);
  137 + String lineCode = line.get("lineCode").toString();
  138 + String stationCode = line.get("stationCode").toString();
  139 + StationRoute stationRoute=BasicData.stationCode2StationMap.get(lineCode+"_"+stationCode);
  140 + Map m = new HashMap();
  141 + m.put("image", img);
  142 + m.put("stationCode", stationCode);
  143 + m.put("lineCode", stationRoute.getLineCode());
  144 + m.put("stationName",BasicData.stationCode2NameMap.get(stationRoute.getLineCode()+"_"+stationRoute.getDirections()+"_"+stationRoute.getStationCode()));
  145 + m.put("lineName",BasicData.lineCode2NameMap.get(stationRoute.getLineCode()));
  146 + m.put("num",num);
  147 + m.put("xlDir",stationRoute.getDirections());
  148 + List<ScheduleRealInfo> srList=dayOfSchedule.findByLineAndUpDown(stationRoute.getLineCode(),stationRoute.getDirections());
  149 + List<ScheduleRealInfo> sl=new ArrayList<>();
  150 + for (ScheduleRealInfo scheduleRealInfo : srList) {//筛选出运营班次
  151 + if((scheduleRealInfo.getBcType().equals("normal")||scheduleRealInfo.getBcType().equals("region"))){
  152 + sl.add(scheduleRealInfo);
  153 + }
  154 + }
  155 + sl.sort(new Comparator<ScheduleRealInfo>() {//按发车时间排序
  156 + @Override
  157 + public int compare(ScheduleRealInfo o1, ScheduleRealInfo o2) {
  158 + return o1.getFcsj().compareTo(o2.getFcsj());
  159 + }
  160 + });
  161 + ScheduleRealInfo schedule = null;
  162 + for (int i1 = 0; i1 < sl.size(); i1++) {//最近的已发车班次
  163 + ScheduleRealInfo scheduleRealInfo=sl.get(i1);
  164 + LocalTime fcsj=LocalTime.parse(scheduleRealInfo.getFcsj(),dateTimeFormatter);
  165 + if((scheduleRealInfo.getBcType().equals("normal")||scheduleRealInfo.getBcType().equals("region")) &&scheduleRealInfo.getXlDir().equals(String.valueOf(stationRoute.getDirections())) && fcsj.isAfter(localTime)){
  166 + schedule =sl.get(i1-1);;
  167 + break;
  168 + }
  169 + }
  170 + //线调页面推送
  171 + if(schedule!=null){
  172 + m.put("sch",schedule);
  173 + m.put("uuid",AutomaticSch.UUID());
  174 + m.put("rq",localTime.format(dateTimeFormatter)); //检测到时间
  175 + sendUtils.klyj(m);
  176 + }
100 177  
  178 + }
  179 + } catch (Exception e) {
  180 + e.printStackTrace();
  181 + }
  182 + }
101 183  
102 184 /*
103 185 智能调度接口--通用测试接口
... ... @@ -155,7 +237,7 @@ public class OutEntrance {
155 237 * @param 上传地址(示例:D:\\1.png)
156 238 * @return
157 239 */
158   - public String uploadBase64Img(String base) {
  240 + public String uploadBase64Img(String base) throws Exception {
159 241  
160 242 //获取年月日
161 243 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
... ... @@ -213,6 +295,40 @@ public class OutEntrance {
213 295 return null;
214 296 }
215 297  
  298 + private static ConcurrentMap<String, Map<String,Object>> trafficMap = new ConcurrentHashMap<>();
  299 + public String getTraffic(String nbbm,String lon,String lat){
  300 + Map<String,Object> traffic=trafficMap.get(nbbm);
  301 + try {
  302 + if(traffic==null||(System.currentTimeMillis()-(long)traffic.get("time")>60*1000)){//无数据或者超过有效期重新查询路况
  303 + String trafficStatus="畅通";
  304 + String url="https://api.map.baidu.com/traffic/v1/around?" +
  305 + "ak="+ak+"&center="+lon+","+lat+"&radius=100&coord_type_input=wgs84";
  306 + String res=HttpClientUtils.get(url).toString();
  307 + JSONObject jsonObject = JSONObject.parseObject(res);
  308 + if((int)jsonObject.get("status")==0){
  309 + JSONObject evaluation= jsonObject.getJSONObject("evaluation");
  310 + trafficStatus=evaluation.getString("status_desc");
  311 + }
  312 + traffic=new HashMap<>();
  313 + traffic.put("trafficStatus",trafficStatus);
  314 + traffic.put("time",System.currentTimeMillis());
  315 + trafficMap.put(nbbm,traffic);
  316 + }
  317 + } catch (Exception e) {
  318 + e.printStackTrace();
  319 + }
  320 + return traffic.get("trafficStatus").toString();
  321 + }
216 322  
  323 + public boolean validation(long timestamp,String sign){
  324 + String md5String=Md5Util.getMd5(timestamp+PASSWORD);
  325 + if(!md5String.equals(sign)){
  326 + return false;
  327 + }
  328 + if(System.currentTimeMillis()-timestamp>60*1000){
  329 + return false;
  330 + }
  331 + return true;
  332 + }
217 333  
218 334 }
... ...
src/main/java/com/bsth/data/zndd/carMonitor.java
... ... @@ -26,7 +26,7 @@ public class carMonitor {
26 26 public List<Map> carMonitor(String lineCode,String directions,String station) {
27 27  
28 28 List<Map> list = new ArrayList<>(); //返回的接口数据
29   - url = "http://58.34.52.130:9777/xxfb/carMonitor?lineid="+lineCode+"&stopid="+station+"&direction="+directions+"&t=";
  29 + url = "http://127.0.0.1:9777/xxfb/jd/carMonitor?lineid="+lineCode+"&stopid="+station+"&direction="+directions;
30 30 InputStream in = null;
31 31 OutputStream out = null;
32 32 try {
... ... @@ -75,9 +75,10 @@ public class carMonitor {
75 75 map.put("distance",responseEle.elementTextTrim("distance"));
76 76 map.put("time",responseEle.elementTextTrim("time"));
77 77 map.put("sj",Gpstime(responseEle.elementTextTrim("time")));
78   - map.put("loc",responseEle.elementTextTrim("loc"));
79   - map.put("gpstime",responseEle.elementTextTrim("gpstime"));
80   - map.put("direction",responseEle.elementTextTrim("direction"));
  78 + map.put("lon",responseEle.elementTextTrim("lon"));
  79 + map.put("lat",responseEle.elementTextTrim("lat"));
  80 + map.put("nbbm",responseEle.elementTextTrim("insidecode"));
  81 + map.put("road",responseEle.elementTextTrim("road"));
81 82 list.add(map);
82 83 }
83 84 }
... ... @@ -92,13 +93,13 @@ public class carMonitor {
92 93 public String Gpstime(String duration){
93 94 Integer seconds = Integer.parseInt(duration);
94 95 Integer hours = seconds / 3600;
95   - Integer minutes = (seconds % 3600) / 60;
  96 + Integer minutes = ((seconds % 3600) / 60)+1;
96 97 Integer remainingSeconds = seconds % 60;
97 98  
98 99 if (hours!= 0){
99   - return hours+"时"+ minutes+"分"+remainingSeconds+"秒";
  100 + return hours+"时"+ minutes+"分钟"/*+remainingSeconds+"秒"*/;
100 101 }else if (minutes != 0){
101   - return minutes+"分"+remainingSeconds+"秒";
  102 + return minutes+"分钟"/*+remainingSeconds+"秒"*/;
102 103 }else {
103 104 return remainingSeconds+"秒";
104 105 }
... ...
src/main/java/com/bsth/entity/zndd/StationSignsLogger.java
... ... @@ -24,6 +24,10 @@ public class StationSignsLogger {
24 24  
25 25 private String image;
26 26  
  27 + private long timestamp;
  28 +
  29 + private String sign;
  30 +
27 31  
28 32  
29 33 public String getLineCode() {
... ... @@ -81,4 +85,20 @@ public class StationSignsLogger {
81 85 public void setImage(String image) {
82 86 this.image = image;
83 87 }
  88 +
  89 + public long getTimestamp() {
  90 + return timestamp;
  91 + }
  92 +
  93 + public void setTimestamp(long timestamp) {
  94 + this.timestamp = timestamp;
  95 + }
  96 +
  97 + public String getSign() {
  98 + return sign;
  99 + }
  100 +
  101 + public void setSign(String sign) {
  102 + this.sign = sign;
  103 + }
84 104 }
... ...
src/main/java/com/bsth/websocket/handler/SendUtils.java
... ... @@ -281,5 +281,19 @@ public class SendUtils{
281 281 logger.error("sendContingencyPlan", e);
282 282 }
283 283 }
  284 +
  285 +
  286 + public void klyj(Map<String, Object> cp) {
  287 + Map<String, Object> map = new HashMap<>();
  288 + map.put("fn", "klyj");
  289 + map.put("data", cp);
  290 + ObjectMapper mapper = new ObjectMapper();
  291 +
  292 + try {
  293 + socketHandler.sendMessageToLine(cp.get("lineCode").toString(), mapper.writeValueAsString(map));
  294 + } catch (JsonProcessingException e) {
  295 + logger.error("sendContingencyPlan", e);
  296 + }
  297 + }
284 298  
285 299 }
... ...
src/main/resources/static/real_control_v2/call/assets/css/bootstrap.min.css 0 → 100644
  1 +/*!
  2 + * Bootstrap v4.5.0 (https://getbootstrap.com/)
  3 + * Copyright 2011-2020 The Bootstrap Authors
  4 + * Copyright 2011-2020 Twitter, Inc.
  5 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  6 + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}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}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[role=button]{cursor:pointer}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color: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-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}.blockquote-footer::before{content:"\2014\00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-wrap:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid,.container-lg,.container-md,.container-sm,.container-xl{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container,.container-sm{max-width:540px}}@media (min-width:768px){.container,.container-md,.container-sm{max-width:720px}}@media (min-width:992px){.container,.container-lg,.container-md,.container-sm{max-width:960px}}@media (min-width:1200px){.container,.container-lg,.container-md,.container-sm,.container-xl{max-width:1140px}}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-sm-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-sm-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-sm-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-sm-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-sm-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-sm-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-md-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-md-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-md-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-md-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-md-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-md-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-lg-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-lg-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-lg-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-lg-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-lg-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-lg-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;min-width:0;max-width:100%}.row-cols-xl-1>*{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.row-cols-xl-2>*{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.row-cols-xl-3>*{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.row-cols-xl-4>*{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.row-cols-xl-5>*{-ms-flex:0 0 20%;flex:0 0 20%;max-width:20%}.row-cols-xl-6>*{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-last{-ms-flex-order:13;order:13}.order-xl-0{-ms-flex-order:0;order:0}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;margin-bottom:1rem;color:#212529}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered td,.table-bordered th{border:1px solid #dee2e6}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-borderless tbody+tbody,.table-borderless td,.table-borderless th,.table-borderless thead th{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{color:#212529;background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-primary tbody+tbody,.table-primary td,.table-primary th,.table-primary thead th{border-color:#7abaff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#d6d8db}.table-secondary tbody+tbody,.table-secondary td,.table-secondary th,.table-secondary thead th{border-color:#b3b7bb}.table-hover .table-secondary:hover{background-color:#c8cbcf}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#c8cbcf}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-success tbody+tbody,.table-success td,.table-success th,.table-success thead th{border-color:#8fd19e}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-info tbody+tbody,.table-info td,.table-info th,.table-info thead th{border-color:#86cfda}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-warning tbody+tbody,.table-warning td,.table-warning th,.table-warning thead th{border-color:#ffdf7e}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-danger tbody+tbody,.table-danger td,.table-danger th,.table-danger thead th{border-color:#ed969e}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-light tbody+tbody,.table-light td,.table-light th,.table-light thead th{border-color:#fbfcfc}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#95999c}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#343a40;border-color:#454d55}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#343a40}.table-dark td,.table-dark th,.table-dark thead th{border-color:#454d55}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{color:#fff;background-color:rgba(255,255,255,.075)}@media (max-width:575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-sm>.table-bordered{border:0}}@media (max-width:767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-md>.table-bordered{border:0}}@media (max-width:991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-lg>.table-bordered{border:0}}@media (max-width:1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.form-control{transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#6c757d;opacity:1}.form-control::-moz-placeholder{color:#6c757d;opacity:1}.form-control:-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::-ms-input-placeholder{color:#6c757d;opacity:1}.form-control::placeholder{color:#6c757d;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{-webkit-appearance:none;-moz-appearance:none;appearance:none}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding:.375rem 0;margin-bottom:0;font-size:1rem;line-height:1.5;color:#212529;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.5em + .5rem + 2px);padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.form-control-lg{height:calc(1.5em + 1rem + 2px);padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}select.form-control[multiple],select.form-control[size]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:.3rem;margin-left:-1.25rem}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{color:#6c757d}.form-check-label{margin-bottom:0}.form-check-inline{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(40,167,69,.9);border-radius:.25rem}.is-valid~.valid-feedback,.is-valid~.valid-tooltip,.was-validated :valid~.valid-feedback,.was-validated :valid~.valid-tooltip{display:block}.form-control.is-valid,.was-validated .form-control:valid{border-color:#28a745;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-valid:focus,.was-validated .form-control:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.was-validated textarea.form-control:valid,textarea.form-control.is-valid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-valid,.was-validated .custom-select:valid{border-color:#28a745;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-valid:focus,.was-validated .custom-select:valid:focus{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.form-check-input.is-valid~.form-check-label,.was-validated .form-check-input:valid~.form-check-label{color:#28a745}.form-check-input.is-valid~.valid-feedback,.form-check-input.is-valid~.valid-tooltip,.was-validated .form-check-input:valid~.valid-feedback,.was-validated .form-check-input:valid~.valid-tooltip{display:block}.custom-control-input.is-valid~.custom-control-label,.was-validated .custom-control-input:valid~.custom-control-label{color:#28a745}.custom-control-input.is-valid~.custom-control-label::before,.was-validated .custom-control-input:valid~.custom-control-label::before{border-color:#28a745}.custom-control-input.is-valid:checked~.custom-control-label::before,.was-validated .custom-control-input:valid:checked~.custom-control-label::before{border-color:#34ce57;background-color:#34ce57}.custom-control-input.is-valid:focus~.custom-control-label::before,.was-validated .custom-control-input:valid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before{border-color:#28a745}.custom-file-input.is-valid~.custom-file-label,.was-validated .custom-file-input:valid~.custom-file-label{border-color:#28a745}.custom-file-input.is-valid:focus~.custom-file-label,.was-validated .custom-file-input:valid:focus~.custom-file-label{border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;width:100%;margin-top:.25rem;font-size:80%;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:.25rem .5rem;margin-top:.1rem;font-size:.875rem;line-height:1.5;color:#fff;background-color:rgba(220,53,69,.9);border-radius:.25rem}.is-invalid~.invalid-feedback,.is-invalid~.invalid-tooltip,.was-validated :invalid~.invalid-feedback,.was-validated :invalid~.invalid-tooltip{display:block}.form-control.is-invalid,.was-validated .form-control:invalid{border-color:#dc3545;padding-right:calc(1.5em + .75rem);background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right calc(.375em + .1875rem) center;background-size:calc(.75em + .375rem) calc(.75em + .375rem)}.form-control.is-invalid:focus,.was-validated .form-control:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.was-validated textarea.form-control:invalid,textarea.form-control.is-invalid{padding-right:calc(1.5em + .75rem);background-position:top calc(.375em + .1875rem) right calc(.375em + .1875rem)}.custom-select.is-invalid,.was-validated .custom-select:invalid{border-color:#dc3545;padding-right:calc(.75em + 2.3125rem);background:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px,url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem)}.custom-select.is-invalid:focus,.was-validated .custom-select:invalid:focus{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-check-input.is-invalid~.form-check-label,.was-validated .form-check-input:invalid~.form-check-label{color:#dc3545}.form-check-input.is-invalid~.invalid-feedback,.form-check-input.is-invalid~.invalid-tooltip,.was-validated .form-check-input:invalid~.invalid-feedback,.was-validated .form-check-input:invalid~.invalid-tooltip{display:block}.custom-control-input.is-invalid~.custom-control-label,.was-validated .custom-control-input:invalid~.custom-control-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-label::before,.was-validated .custom-control-input:invalid~.custom-control-label::before{border-color:#dc3545}.custom-control-input.is-invalid:checked~.custom-control-label::before,.was-validated .custom-control-input:invalid:checked~.custom-control-label::before{border-color:#e4606d;background-color:#e4606d}.custom-control-input.is-invalid:focus~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before,.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-label,.was-validated .custom-file-input:invalid~.custom-file-label{border-color:#dc3545}.custom-file-input.is-invalid:focus~.custom-file-label,.was-validated .custom-file-input:invalid:focus~.custom-file-label{border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .custom-select,.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;-ms-flex-negative:0;flex-shrink:0;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;color:#212529;text-align:center;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.btn{transition:none}}.btn:hover{color:#212529;text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#0069d9;border-color:#0062cc;box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf}.btn-primary:not(:disabled):not(.disabled).active:focus,.btn-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(38,143,255,.5)}.btn-secondary{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:hover{color:#fff;background-color:#5a6268;border-color:#545b62}.btn-secondary.focus,.btn-secondary:focus{color:#fff;background-color:#5a6268;border-color:#545b62;box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#545b62;border-color:#4e555b}.btn-secondary:not(:disabled):not(.disabled).active:focus,.btn-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(130,138,145,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#218838;border-color:#1e7e34;box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430}.btn-success:not(:disabled):not(.disabled).active:focus,.btn-success:not(:disabled):not(.disabled):active:focus,.show>.btn-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(72,180,97,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#138496;border-color:#117a8b;box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:not(:disabled):not(.disabled).active,.btn-info:not(:disabled):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f}.btn-info:not(:disabled):not(.disabled).active:focus,.btn-info:not(:disabled):not(.disabled):active:focus,.show>.btn-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(58,176,195,.5)}.btn-warning{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#212529;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{color:#212529;background-color:#e0a800;border-color:#d39e00;box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-warning.disabled,.btn-warning:disabled{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-warning:not(:disabled):not(.disabled).active,.btn-warning:not(:disabled):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#212529;background-color:#d39e00;border-color:#c69500}.btn-warning:not(:disabled):not(.disabled).active:focus,.btn-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(222,170,12,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c82333;border-color:#bd2130;box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d}.btn-danger:not(:disabled):not(.disabled).active:focus,.btn-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(225,83,97,.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{color:#212529;background-color:#e2e6ea;border-color:#dae0e5;box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled).active:focus,.btn-light:not(:disabled):not(.disabled):active:focus,.show>.btn-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(216,217,219,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{color:#fff;background-color:#23272b;border-color:#1d2124;box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled).active,.btn-dark:not(:disabled):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled).active:focus,.btn-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(82,88,93,.5)}.btn-outline-primary{color:#007bff;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#6c757d;border-color:#6c757d}.btn-outline-secondary:hover{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#6c757d;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled).active,.btn-outline-secondary:not(:disabled):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#6c757d}.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.btn-outline-success{color:#28a745;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled).active,.btn-outline-success:not(:disabled):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-success.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled).active,.btn-outline-info:not(:disabled):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info:not(:disabled):not(.disabled).active:focus,.btn-outline-info:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-info.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;border-color:#ffc107}.btn-outline-warning:hover{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled).active,.btn-outline-warning:not(:disabled):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#212529;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled).active,.btn-outline-danger:not(:disabled):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled).active,.btn-outline-light:not(:disabled):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-light.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled).active,.btn-outline-dark:not(:disabled):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;text-decoration:none}.btn-link:hover{color:#0056b3;text-decoration:underline}.btn-link.focus,.btn-link:focus{text-decoration:underline}.btn-link.disabled,.btn-link:disabled{color:#6c757d;pointer-events:none}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{transition:opacity .15s linear}@media (prefers-reduced-motion:reduce){.fade{transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}@media (prefers-reduced-motion:reduce){.collapsing{transition:none}}.dropdown,.dropleft,.dropright,.dropup{position:relative}.dropdown-toggle{white-space:nowrap}.dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropdown-menu-left{right:auto;left:0}.dropdown-menu-right{right:0;left:auto}@media (min-width:576px){.dropdown-menu-sm-left{right:auto;left:0}.dropdown-menu-sm-right{right:0;left:auto}}@media (min-width:768px){.dropdown-menu-md-left{right:auto;left:0}.dropdown-menu-md-right{right:0;left:auto}}@media (min-width:992px){.dropdown-menu-lg-left{right:auto;left:0}.dropdown-menu-lg-right{right:0;left:auto}}@media (min-width:1200px){.dropdown-menu-xl-left{right:auto;left:0}.dropdown-menu-xl-right{right:0;left:auto}}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:.125rem}.dropright .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:0;border-bottom:.3em solid transparent;border-left:.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:.125rem}.dropleft .dropdown-toggle::after{display:inline-block;margin-left:.255em;vertical-align:.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;margin-right:.255em;vertical-align:.255em;content:"";border-top:.3em solid transparent;border-right:.3em solid;border-bottom:.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^=bottom],.dropdown-menu[x-placement^=left],.dropdown-menu[x-placement^=right],.dropdown-menu[x-placement^=top]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#6c757d;pointer-events:none;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#6c757d;white-space:nowrap}.dropdown-item-text{display:block;padding:.25rem 1.5rem;color:#212529}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:1 1 auto;flex:1 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:1}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:1}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn-group:not(:first-child),.btn-group>.btn:not(:first-child){margin-left:-1px}.btn-group>.btn-group:not(:last-child)>.btn,.btn-group>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:not(:first-child)>.btn,.btn-group>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group{width:100%}.btn-group-vertical>.btn-group:not(:first-child),.btn-group-vertical>.btn:not(:first-child){margin-top:-1px}.btn-group-vertical>.btn-group:not(:last-child)>.btn,.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child)>.btn,.btn-group-vertical>.btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type=checkbox],.btn-group-toggle>.btn input[type=radio],.btn-group-toggle>.btn-group>.btn input[type=checkbox],.btn-group-toggle>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.custom-file,.input-group>.custom-select,.input-group>.form-control,.input-group>.form-control-plaintext{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;min-width:0;margin-bottom:0}.input-group>.custom-file+.custom-file,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.form-control,.input-group>.custom-select+.custom-file,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.form-control,.input-group>.form-control+.custom-file,.input-group>.form-control+.custom-select,.input-group>.form-control+.form-control,.input-group>.form-control-plaintext+.custom-file,.input-group>.form-control-plaintext+.custom-select,.input-group>.form-control-plaintext+.form-control{margin-left:-1px}.input-group>.custom-file .custom-file-input:focus~.custom-file-label,.input-group>.custom-select:focus,.input-group>.form-control:focus{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.custom-select:not(:last-child),.input-group>.form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-select:not(:first-child),.input-group>.form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-append,.input-group-prepend{display:-ms-flexbox;display:flex}.input-group-append .btn,.input-group-prepend .btn{position:relative;z-index:2}.input-group-append .btn:focus,.input-group-prepend .btn:focus{z-index:3}.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.btn,.input-group-append .input-group-text+.input-group-text,.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-prepend .input-group-text+.input-group-text{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-text input[type=checkbox],.input-group-text input[type=radio]{margin-top:0}.input-group-lg>.custom-select,.input-group-lg>.form-control:not(textarea){height:calc(1.5em + 1rem + 2px)}.input-group-lg>.custom-select,.input-group-lg>.form-control,.input-group-lg>.input-group-append>.btn,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-prepend>.input-group-text{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-sm>.custom-select,.input-group-sm>.form-control:not(textarea){height:calc(1.5em + .5rem + 2px)}.input-group-sm>.custom-select,.input-group-sm>.form-control,.input-group-sm>.input-group-append>.btn,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-prepend>.input-group-text{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-lg>.custom-select,.input-group-sm>.custom-select{padding-right:1.75rem}.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child),.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child),.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text{border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;left:0;z-index:-1;width:1rem;height:1.25rem;opacity:0}.custom-control-input:checked~.custom-control-label::before{color:#fff;border-color:#007bff;background-color:#007bff}.custom-control-input:focus~.custom-control-label::before{box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:focus:not(:checked)~.custom-control-label::before{border-color:#80bdff}.custom-control-input:not(:disabled):active~.custom-control-label::before{color:#fff;background-color:#b3d7ff;border-color:#b3d7ff}.custom-control-input:disabled~.custom-control-label,.custom-control-input[disabled]~.custom-control-label{color:#6c757d}.custom-control-input:disabled~.custom-control-label::before,.custom-control-input[disabled]~.custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0;vertical-align:top}.custom-control-label::before{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";background-color:#fff;border:#adb5bd solid 1px}.custom-control-label::after{position:absolute;top:.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background:no-repeat 50%/50% 50%}.custom-checkbox .custom-control-label::before{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before{border-color:#007bff;background-color:#007bff}.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e")}.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-label::after{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e")}.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-switch{padding-left:2.25rem}.custom-switch .custom-control-label::before{left:-2.25rem;width:1.75rem;pointer-events:all;border-radius:.5rem}.custom-switch .custom-control-label::after{top:calc(.25rem + 2px);left:calc(-2.25rem + 2px);width:calc(1rem - 4px);height:calc(1rem - 4px);background-color:#adb5bd;border-radius:.5rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:transform .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out,-webkit-transform .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-switch .custom-control-label::after{transition:none}}.custom-switch .custom-control-input:checked~.custom-control-label::after{background-color:#fff;-webkit-transform:translateX(.75rem);transform:translateX(.75rem)}.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before{background-color:rgba(0,123,255,.5)}.custom-select{display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);padding:.375rem 1.75rem .375rem .75rem;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:.75rem;background-image:none}.custom-select:disabled{color:#6c757d;background-color:#e9ecef}.custom-select::-ms-expand{display:none}.custom-select:-moz-focusring{color:transparent;text-shadow:0 0 0 #495057}.custom-select-sm{height:calc(1.5em + .5rem + 2px);padding-top:.25rem;padding-bottom:.25rem;padding-left:.5rem;font-size:.875rem}.custom-select-lg{height:calc(1.5em + 1rem + 2px);padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;font-size:1.25rem}.custom-file{position:relative;display:inline-block;width:100%;height:calc(1.5em + .75rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(1.5em + .75rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-label{border-color:#80bdff;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.custom-file-input:disabled~.custom-file-label,.custom-file-input[disabled]~.custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en)~.custom-file-label::after{content:"Browse"}.custom-file-input~.custom-file-label[data-browse]::after{content:attr(data-browse)}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(1.5em + .75rem + 2px);padding:.375rem .75rem;font-weight:400;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:calc(1.5em + .75rem);padding:.375rem .75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:inherit;border-radius:0 .25rem .25rem 0}.custom-range{width:100%;height:1.4rem;padding:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:0}.custom-range:focus::-webkit-slider-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-.25rem;background-color:#007bff;border:0;border-radius:1rem;-webkit-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-webkit-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#b3d7ff}.custom-range::-webkit-slider-runnable-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#007bff;border:0;border-radius:1rem;-moz-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;-moz-appearance:none;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-moz-range-thumb{-moz-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#b3d7ff}.custom-range::-moz-range-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:.2rem;margin-left:.2rem;background-color:#007bff;border:0;border-radius:1rem;-ms-transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;appearance:none}@media (prefers-reduced-motion:reduce){.custom-range::-ms-thumb{-ms-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#b3d7ff}.custom-range::-ms-track{width:100%;height:.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-range:disabled::-webkit-slider-thumb{background-color:#adb5bd}.custom-range:disabled::-webkit-slider-runnable-track{cursor:default}.custom-range:disabled::-moz-range-thumb{background-color:#adb5bd}.custom-range:disabled::-moz-range-track{cursor:default}.custom-range:disabled::-ms-thumb{background-color:#adb5bd}.custom-control-label::before,.custom-file-label,.custom-select{transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.custom-control-label::before,.custom-file-label,.custom-select{transition:none}}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#6c757d;pointer-events:none;cursor:default}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#6c757d;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar .container,.navbar .container-fluid,.navbar .container-lg,.navbar .container-md,.navbar .container-sm,.navbar .container-xl{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid,.navbar-expand-sm>.container-lg,.navbar-expand-sm>.container-md,.navbar-expand-sm>.container-sm,.navbar-expand-sm>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width:767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid,.navbar-expand-md>.container-lg,.navbar-expand-md>.container-md,.navbar-expand-md>.container-sm,.navbar-expand-md>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width:991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid,.navbar-expand-lg>.container-lg,.navbar-expand-lg>.container-md,.navbar-expand-lg>.container-sm,.navbar-expand-lg>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width:1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid,.navbar-expand-xl>.container-lg,.navbar-expand-xl>.container-md,.navbar-expand-xl>.container-sm,.navbar-expand-xl>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid,.navbar-expand>.container-lg,.navbar-expand>.container-md,.navbar-expand>.container-sm,.navbar-expand>.container-xl{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.5%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group{border-top:inherit;border-bottom:inherit}.card>.list-group:first-child{border-top-width:0;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card>.list-group:last-child{border-bottom-width:0;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;min-height:1px;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img,.card-img-bottom,.card-img-top{-ms-flex-negative:0;flex-shrink:0;width:100%}.card-img,.card-img-top{border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img,.card-img-bottom{border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{-ms-flex:1 0 0%;flex:1 0 0%;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group>.card{margin-bottom:15px}@media (min-width:576px){.card-group{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:not(:last-child) .card-header,.card-group>.card:not(:last-child) .card-img-top{border-top-right-radius:0}.card-group>.card:not(:last-child) .card-footer,.card-group>.card:not(:last-child) .card-img-bottom{border-bottom-right-radius:0}.card-group>.card:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:not(:first-child) .card-header,.card-group>.card:not(:first-child) .card-img-top{border-top-left-radius:0}.card-group>.card:not(:first-child) .card-footer,.card-group>.card:not(:first-child) .card-img-bottom{border-bottom-left-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;-moz-column-count:3;column-count:3;-webkit-column-gap:1.25rem;-moz-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion>.card{overflow:hidden}.accordion>.card:not(:last-of-type){border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion>.card:not(:first-of-type){border-top-left-radius:0;border-top-right-radius:0}.accordion>.card>.card-header{border-radius:0;margin-bottom:-1px}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item{display:-ms-flexbox;display:flex}.breadcrumb-item+.breadcrumb-item{padding-left:.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;color:#6c757d;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#6c757d}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:3;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:3;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#6c757d;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}@media (prefers-reduced-motion:reduce){.badge{transition:none}}a.badge:focus,a.badge:hover{text-decoration:none}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}a.badge-primary:focus,a.badge-primary:hover{color:#fff;background-color:#0062cc}a.badge-primary.focus,a.badge-primary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.badge-secondary{color:#fff;background-color:#6c757d}a.badge-secondary:focus,a.badge-secondary:hover{color:#fff;background-color:#545b62}a.badge-secondary.focus,a.badge-secondary:focus{outline:0;box-shadow:0 0 0 .2rem rgba(108,117,125,.5)}.badge-success{color:#fff;background-color:#28a745}a.badge-success:focus,a.badge-success:hover{color:#fff;background-color:#1e7e34}a.badge-success.focus,a.badge-success:focus{outline:0;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.badge-info{color:#fff;background-color:#17a2b8}a.badge-info:focus,a.badge-info:hover{color:#fff;background-color:#117a8b}a.badge-info.focus,a.badge-info:focus{outline:0;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.badge-warning{color:#212529;background-color:#ffc107}a.badge-warning:focus,a.badge-warning:hover{color:#212529;background-color:#d39e00}a.badge-warning.focus,a.badge-warning:focus{outline:0;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.badge-danger{color:#fff;background-color:#dc3545}a.badge-danger:focus,a.badge-danger:hover{color:#fff;background-color:#bd2130}a.badge-danger.focus,a.badge-danger:focus{outline:0;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.badge-light{color:#212529;background-color:#f8f9fa}a.badge-light:focus,a.badge-light:hover{color:#212529;background-color:#dae0e5}a.badge-light.focus,a.badge-light:focus{outline:0;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.badge-dark{color:#fff;background-color:#343a40}a.badge-dark:focus,a.badge-dark:hover{color:#fff;background-color:#1d2124}a.badge-dark.focus,a.badge-dark:focus{outline:0;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#383d41;background-color:#e2e3e5;border-color:#d6d8db}.alert-secondary hr{border-top-color:#c8cbcf}.alert-secondary .alert-link{color:#202326}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;line-height:0;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;overflow:hidden;color:#fff;text-align:center;white-space:nowrap;background-color:#007bff;transition:width .6s ease}@media (prefers-reduced-motion:reduce){.progress-bar{transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}@media (prefers-reduced-motion:reduce){.progress-bar-animated{-webkit-animation:none;animation:none}}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;border-radius:.25rem}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{z-index:1;color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.list-group-item:last-child{border-bottom-right-radius:inherit;border-bottom-left-radius:inherit}.list-group-item.disabled,.list-group-item:disabled{color:#6c757d;pointer-events:none;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-item+.list-group-item{border-top-width:0}.list-group-item+.list-group-item.active{margin-top:-1px;border-top-width:1px}.list-group-horizontal{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal>.list-group-item.active{margin-top:0}.list-group-horizontal>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}@media (min-width:576px){.list-group-horizontal-sm{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-sm>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-sm>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-sm>.list-group-item.active{margin-top:0}.list-group-horizontal-sm>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-sm>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:768px){.list-group-horizontal-md{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-md>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-md>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-md>.list-group-item.active{margin-top:0}.list-group-horizontal-md>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-md>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:992px){.list-group-horizontal-lg{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-lg>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-lg>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-lg>.list-group-item.active{margin-top:0}.list-group-horizontal-lg>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-lg>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}@media (min-width:1200px){.list-group-horizontal-xl{-ms-flex-direction:row;flex-direction:row}.list-group-horizontal-xl>.list-group-item:first-child{border-bottom-left-radius:.25rem;border-top-right-radius:0}.list-group-horizontal-xl>.list-group-item:last-child{border-top-right-radius:.25rem;border-bottom-left-radius:0}.list-group-horizontal-xl>.list-group-item.active{margin-top:0}.list-group-horizontal-xl>.list-group-item+.list-group-item{border-top-width:1px;border-left-width:0}.list-group-horizontal-xl>.list-group-item+.list-group-item.active{margin-left:-1px;border-left-width:1px}}.list-group-flush{border-radius:0}.list-group-flush>.list-group-item{border-width:0 0 1px}.list-group-flush>.list-group-item:last-child{border-bottom-width:0}.list-group-item-primary{color:#004085;background-color:#b8daff}.list-group-item-primary.list-group-item-action:focus,.list-group-item-primary.list-group-item-action:hover{color:#004085;background-color:#9fcdff}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#383d41;background-color:#d6d8db}.list-group-item-secondary.list-group-item-action:focus,.list-group-item-secondary.list-group-item-action:hover{color:#383d41;background-color:#c8cbcf}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#383d41;border-color:#383d41}.list-group-item-success{color:#155724;background-color:#c3e6cb}.list-group-item-success.list-group-item-action:focus,.list-group-item-success.list-group-item-action:hover{color:#155724;background-color:#b1dfbb}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}.list-group-item-info.list-group-item-action:focus,.list-group-item-info.list-group-item-action:hover{color:#0c5460;background-color:#abdde5}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}.list-group-item-warning.list-group-item-action:focus,.list-group-item-warning.list-group-item-action:hover{color:#856404;background-color:#ffe8a1}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}.list-group-item-danger.list-group-item-action:focus,.list-group-item-danger.list-group-item-action:hover{color:#721c24;background-color:#f1b0b7}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:focus,.list-group-item-light.list-group-item-action:hover{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:focus,.list-group-item-dark.list-group-item-action:hover{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:hover{color:#000;text-decoration:none}.close:not(:disabled):not(.disabled):focus,.close:not(:disabled):not(.disabled):hover{opacity:.75}button.close{padding:0;background-color:transparent;border:0}a.close.disabled{pointer-events:none}.toast{max-width:350px;overflow:hidden;font-size:.875rem;background-color:rgba(255,255,255,.85);background-clip:padding-box;border:1px solid rgba(0,0,0,.1);box-shadow:0 .25rem .75rem rgba(0,0,0,.1);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);opacity:0;border-radius:.25rem}.toast:not(:last-child){margin-bottom:.75rem}.toast.showing{opacity:1}.toast.show{display:block;opacity:1}.toast.hide{display:none}.toast-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:.25rem .75rem;color:#6c757d;background-color:rgba(255,255,255,.85);background-clip:padding-box;border-bottom:1px solid rgba(0,0,0,.05)}.toast-body{padding:.75rem}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;left:0;z-index:1050;display:none;width:100%;height:100%;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:.5rem;pointer-events:none}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-50px);transform:translate(0,-50px)}@media (prefers-reduced-motion:reduce){.modal.fade .modal-dialog{transition:none}}.modal.show .modal-dialog{-webkit-transform:none;transform:none}.modal.modal-static .modal-dialog{-webkit-transform:scale(1.02);transform:scale(1.02)}.modal-dialog-scrollable{display:-ms-flexbox;display:flex;max-height:calc(100% - 1rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 1rem);overflow:hidden}.modal-dialog-scrollable .modal-footer,.modal-dialog-scrollable .modal-header{-ms-flex-negative:0;flex-shrink:0}.modal-dialog-scrollable .modal-body{overflow-y:auto}.modal-dialog-centered{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:calc(100% - 1rem)}.modal-dialog-centered::before{display:block;height:calc(100vh - 1rem);height:-webkit-min-content;height:-moz-min-content;height:min-content;content:""}.modal-dialog-centered.modal-dialog-scrollable{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.modal-dialog-centered.modal-dialog-scrollable .modal-content{max-height:none}.modal-dialog-centered.modal-dialog-scrollable::before{content:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;left:0;z-index:1040;width:100vw;height:100vh;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:1rem 1rem;border-bottom:1px solid #dee2e6;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.modal-header .close{padding:1rem 1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:.75rem;border-top:1px solid #dee2e6;border-bottom-right-radius:calc(.3rem - 1px);border-bottom-left-radius:calc(.3rem - 1px)}.modal-footer>*{margin:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-scrollable{max-height:calc(100% - 3.5rem)}.modal-dialog-scrollable .modal-content{max-height:calc(100vh - 3.5rem)}.modal-dialog-centered{min-height:calc(100% - 3.5rem)}.modal-dialog-centered::before{height:calc(100vh - 3.5rem);height:-webkit-min-content;height:-moz-min-content;height:min-content}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg,.modal-xl{max-width:800px}}@media (min-width:1200px){.modal-xl{max-width:1140px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-auto[x-placement^=top],.bs-tooltip-top{padding:.4rem 0}.bs-tooltip-auto[x-placement^=top] .arrow,.bs-tooltip-top .arrow{bottom:0}.bs-tooltip-auto[x-placement^=top] .arrow::before,.bs-tooltip-top .arrow::before{top:0;border-width:.4rem .4rem 0;border-top-color:#000}.bs-tooltip-auto[x-placement^=right],.bs-tooltip-right{padding:0 .4rem}.bs-tooltip-auto[x-placement^=right] .arrow,.bs-tooltip-right .arrow{left:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=right] .arrow::before,.bs-tooltip-right .arrow::before{right:0;border-width:.4rem .4rem .4rem 0;border-right-color:#000}.bs-tooltip-auto[x-placement^=bottom],.bs-tooltip-bottom{padding:.4rem 0}.bs-tooltip-auto[x-placement^=bottom] .arrow,.bs-tooltip-bottom .arrow{top:0}.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.bs-tooltip-bottom .arrow::before{bottom:0;border-width:0 .4rem .4rem;border-bottom-color:#000}.bs-tooltip-auto[x-placement^=left],.bs-tooltip-left{padding:0 .4rem}.bs-tooltip-auto[x-placement^=left] .arrow,.bs-tooltip-left .arrow{right:0;width:.4rem;height:.8rem}.bs-tooltip-auto[x-placement^=left] .arrow::before,.bs-tooltip-left .arrow::before{left:0;border-width:.4rem 0 .4rem .4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:.25rem .5rem;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:.5rem;margin:0 .3rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-auto[x-placement^=top],.bs-popover-top{margin-bottom:.5rem}.bs-popover-auto[x-placement^=top]>.arrow,.bs-popover-top>.arrow{bottom:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=top]>.arrow::before,.bs-popover-top>.arrow::before{bottom:0;border-width:.5rem .5rem 0;border-top-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=top]>.arrow::after,.bs-popover-top>.arrow::after{bottom:1px;border-width:.5rem .5rem 0;border-top-color:#fff}.bs-popover-auto[x-placement^=right],.bs-popover-right{margin-left:.5rem}.bs-popover-auto[x-placement^=right]>.arrow,.bs-popover-right>.arrow{left:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=right]>.arrow::before,.bs-popover-right>.arrow::before{left:0;border-width:.5rem .5rem .5rem 0;border-right-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=right]>.arrow::after,.bs-popover-right>.arrow::after{left:1px;border-width:.5rem .5rem .5rem 0;border-right-color:#fff}.bs-popover-auto[x-placement^=bottom],.bs-popover-bottom{margin-top:.5rem}.bs-popover-auto[x-placement^=bottom]>.arrow,.bs-popover-bottom>.arrow{top:calc(-.5rem - 1px)}.bs-popover-auto[x-placement^=bottom]>.arrow::before,.bs-popover-bottom>.arrow::before{top:0;border-width:0 .5rem .5rem .5rem;border-bottom-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=bottom]>.arrow::after,.bs-popover-bottom>.arrow::after{top:1px;border-width:0 .5rem .5rem .5rem;border-bottom-color:#fff}.bs-popover-auto[x-placement^=bottom] .popover-header::before,.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-auto[x-placement^=left],.bs-popover-left{margin-right:.5rem}.bs-popover-auto[x-placement^=left]>.arrow,.bs-popover-left>.arrow{right:calc(-.5rem - 1px);width:.5rem;height:1rem;margin:.3rem 0}.bs-popover-auto[x-placement^=left]>.arrow::before,.bs-popover-left>.arrow::before{right:0;border-width:.5rem 0 .5rem .5rem;border-left-color:rgba(0,0,0,.25)}.bs-popover-auto[x-placement^=left]>.arrow::after,.bs-popover-left>.arrow::after{right:1px;border-width:.5rem 0 .5rem .5rem;border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel.pointer-event{-ms-touch-action:pan-y;touch-action:pan-y}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner::after{display:block;clear:both;content:""}.carousel-item{position:relative;display:none;float:left;width:100%;margin-right:-100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out}@media (prefers-reduced-motion:reduce){.carousel-item{transition:none}}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.active.carousel-item-right,.carousel-item-next:not(.carousel-item-left){-webkit-transform:translateX(100%);transform:translateX(100%)}.active.carousel-item-left,.carousel-item-prev:not(.carousel-item-right){-webkit-transform:translateX(-100%);transform:translateX(-100%)}.carousel-fade .carousel-item{opacity:0;transition-property:opacity;-webkit-transform:none;transform:none}.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right,.carousel-fade .carousel-item.active{z-index:1;opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{z-index:0;opacity:0;transition:opacity 0s .6s}@media (prefers-reduced-motion:reduce){.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{transition:none}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;z-index:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5;transition:opacity .15s ease}@media (prefers-reduced-motion:reduce){.carousel-control-next,.carousel-control-prev{transition:none}}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:no-repeat 50%/100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e")}.carousel-control-next-icon{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e")}.carousel-indicators{position:absolute;right:0;bottom:0;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{box-sizing:content-box;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:#fff;background-clip:padding-box;border-top:10px solid transparent;border-bottom:10px solid transparent;opacity:.5;transition:opacity .6s ease}@media (prefers-reduced-motion:reduce){.carousel-indicators li{transition:none}}.carousel-indicators .active{opacity:1}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}@-webkit-keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-border{to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.spinner-border{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;border:.25em solid currentColor;border-right-color:transparent;border-radius:50%;-webkit-animation:spinner-border .75s linear infinite;animation:spinner-border .75s linear infinite}.spinner-border-sm{width:1rem;height:1rem;border-width:.2em}@-webkit-keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}@keyframes spinner-grow{0%{-webkit-transform:scale(0);transform:scale(0)}50%{opacity:1;-webkit-transform:none;transform:none}}.spinner-grow{display:inline-block;width:2rem;height:2rem;vertical-align:text-bottom;background-color:currentColor;border-radius:50%;opacity:0;-webkit-animation:spinner-grow .75s linear infinite;animation:spinner-grow .75s linear infinite}.spinner-grow-sm{width:1rem;height:1rem}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover,button.bg-primary:focus,button.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#6c757d!important}a.bg-secondary:focus,a.bg-secondary:hover,button.bg-secondary:focus,button.bg-secondary:hover{background-color:#545b62!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover,button.bg-success:focus,button.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover,button.bg-info:focus,button.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover,button.bg-warning:focus,button.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover,button.bg-danger:focus,button.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover,button.bg-light:focus,button.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover,button.bg-dark:focus,button.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #dee2e6!important}.border-top{border-top:1px solid #dee2e6!important}.border-right{border-right:1px solid #dee2e6!important}.border-bottom{border-bottom:1px solid #dee2e6!important}.border-left{border-left:1px solid #dee2e6!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#6c757d!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded-sm{border-radius:.2rem!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-lg{border-radius:.3rem!important}.rounded-circle{border-radius:50%!important}.rounded-pill{border-radius:50rem!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media print{.d-print-none{display:none!important}.d-print-inline{display:inline!important}.d-print-inline-block{display:inline-block!important}.d-print-block{display:block!important}.d-print-table{display:table!important}.d-print-table-row{display:table-row!important}.d-print-table-cell{display:table-cell!important}.d-print-flex{display:-ms-flexbox!important;display:flex!important}.d-print-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-sm-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-sm-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-sm-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-sm-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-sm-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-md-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-md-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-md-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-md-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-md-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-lg-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-lg-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-lg-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-lg-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-lg-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.flex-xl-fill{-ms-flex:1 1 auto!important;flex:1 1 auto!important}.flex-xl-grow-0{-ms-flex-positive:0!important;flex-grow:0!important}.flex-xl-grow-1{-ms-flex-positive:1!important;flex-grow:1!important}.flex-xl-shrink-0{-ms-flex-negative:0!important;flex-shrink:0!important}.flex-xl-shrink-1{-ms-flex-negative:1!important;flex-shrink:1!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.user-select-all{-webkit-user-select:all!important;-moz-user-select:all!important;-ms-user-select:all!important;user-select:all!important}.user-select-auto{-webkit-user-select:auto!important;-moz-user-select:auto!important;-ms-user-select:auto!important;user-select:auto!important}.user-select-none{-webkit-user-select:none!important;-moz-user-select:none!important;-ms-user-select:none!important;user-select:none!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{box-shadow:0 .125rem .25rem rgba(0,0,0,.075)!important}.shadow{box-shadow:0 .5rem 1rem rgba(0,0,0,.15)!important}.shadow-lg{box-shadow:0 1rem 3rem rgba(0,0,0,.175)!important}.shadow-none{box-shadow:none!important}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.w-auto{width:auto!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.h-auto{height:auto!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.min-vw-100{min-width:100vw!important}.min-vh-100{min-height:100vh!important}.vw-100{width:100vw!important}.vh-100{height:100vh!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-n1{margin:-.25rem!important}.mt-n1,.my-n1{margin-top:-.25rem!important}.mr-n1,.mx-n1{margin-right:-.25rem!important}.mb-n1,.my-n1{margin-bottom:-.25rem!important}.ml-n1,.mx-n1{margin-left:-.25rem!important}.m-n2{margin:-.5rem!important}.mt-n2,.my-n2{margin-top:-.5rem!important}.mr-n2,.mx-n2{margin-right:-.5rem!important}.mb-n2,.my-n2{margin-bottom:-.5rem!important}.ml-n2,.mx-n2{margin-left:-.5rem!important}.m-n3{margin:-1rem!important}.mt-n3,.my-n3{margin-top:-1rem!important}.mr-n3,.mx-n3{margin-right:-1rem!important}.mb-n3,.my-n3{margin-bottom:-1rem!important}.ml-n3,.mx-n3{margin-left:-1rem!important}.m-n4{margin:-1.5rem!important}.mt-n4,.my-n4{margin-top:-1.5rem!important}.mr-n4,.mx-n4{margin-right:-1.5rem!important}.mb-n4,.my-n4{margin-bottom:-1.5rem!important}.ml-n4,.mx-n4{margin-left:-1.5rem!important}.m-n5{margin:-3rem!important}.mt-n5,.my-n5{margin-top:-3rem!important}.mr-n5,.mx-n5{margin-right:-3rem!important}.mb-n5,.my-n5{margin-bottom:-3rem!important}.ml-n5,.mx-n5{margin-left:-3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-n1{margin:-.25rem!important}.mt-sm-n1,.my-sm-n1{margin-top:-.25rem!important}.mr-sm-n1,.mx-sm-n1{margin-right:-.25rem!important}.mb-sm-n1,.my-sm-n1{margin-bottom:-.25rem!important}.ml-sm-n1,.mx-sm-n1{margin-left:-.25rem!important}.m-sm-n2{margin:-.5rem!important}.mt-sm-n2,.my-sm-n2{margin-top:-.5rem!important}.mr-sm-n2,.mx-sm-n2{margin-right:-.5rem!important}.mb-sm-n2,.my-sm-n2{margin-bottom:-.5rem!important}.ml-sm-n2,.mx-sm-n2{margin-left:-.5rem!important}.m-sm-n3{margin:-1rem!important}.mt-sm-n3,.my-sm-n3{margin-top:-1rem!important}.mr-sm-n3,.mx-sm-n3{margin-right:-1rem!important}.mb-sm-n3,.my-sm-n3{margin-bottom:-1rem!important}.ml-sm-n3,.mx-sm-n3{margin-left:-1rem!important}.m-sm-n4{margin:-1.5rem!important}.mt-sm-n4,.my-sm-n4{margin-top:-1.5rem!important}.mr-sm-n4,.mx-sm-n4{margin-right:-1.5rem!important}.mb-sm-n4,.my-sm-n4{margin-bottom:-1.5rem!important}.ml-sm-n4,.mx-sm-n4{margin-left:-1.5rem!important}.m-sm-n5{margin:-3rem!important}.mt-sm-n5,.my-sm-n5{margin-top:-3rem!important}.mr-sm-n5,.mx-sm-n5{margin-right:-3rem!important}.mb-sm-n5,.my-sm-n5{margin-bottom:-3rem!important}.ml-sm-n5,.mx-sm-n5{margin-left:-3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-n1{margin:-.25rem!important}.mt-md-n1,.my-md-n1{margin-top:-.25rem!important}.mr-md-n1,.mx-md-n1{margin-right:-.25rem!important}.mb-md-n1,.my-md-n1{margin-bottom:-.25rem!important}.ml-md-n1,.mx-md-n1{margin-left:-.25rem!important}.m-md-n2{margin:-.5rem!important}.mt-md-n2,.my-md-n2{margin-top:-.5rem!important}.mr-md-n2,.mx-md-n2{margin-right:-.5rem!important}.mb-md-n2,.my-md-n2{margin-bottom:-.5rem!important}.ml-md-n2,.mx-md-n2{margin-left:-.5rem!important}.m-md-n3{margin:-1rem!important}.mt-md-n3,.my-md-n3{margin-top:-1rem!important}.mr-md-n3,.mx-md-n3{margin-right:-1rem!important}.mb-md-n3,.my-md-n3{margin-bottom:-1rem!important}.ml-md-n3,.mx-md-n3{margin-left:-1rem!important}.m-md-n4{margin:-1.5rem!important}.mt-md-n4,.my-md-n4{margin-top:-1.5rem!important}.mr-md-n4,.mx-md-n4{margin-right:-1.5rem!important}.mb-md-n4,.my-md-n4{margin-bottom:-1.5rem!important}.ml-md-n4,.mx-md-n4{margin-left:-1.5rem!important}.m-md-n5{margin:-3rem!important}.mt-md-n5,.my-md-n5{margin-top:-3rem!important}.mr-md-n5,.mx-md-n5{margin-right:-3rem!important}.mb-md-n5,.my-md-n5{margin-bottom:-3rem!important}.ml-md-n5,.mx-md-n5{margin-left:-3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-n1{margin:-.25rem!important}.mt-lg-n1,.my-lg-n1{margin-top:-.25rem!important}.mr-lg-n1,.mx-lg-n1{margin-right:-.25rem!important}.mb-lg-n1,.my-lg-n1{margin-bottom:-.25rem!important}.ml-lg-n1,.mx-lg-n1{margin-left:-.25rem!important}.m-lg-n2{margin:-.5rem!important}.mt-lg-n2,.my-lg-n2{margin-top:-.5rem!important}.mr-lg-n2,.mx-lg-n2{margin-right:-.5rem!important}.mb-lg-n2,.my-lg-n2{margin-bottom:-.5rem!important}.ml-lg-n2,.mx-lg-n2{margin-left:-.5rem!important}.m-lg-n3{margin:-1rem!important}.mt-lg-n3,.my-lg-n3{margin-top:-1rem!important}.mr-lg-n3,.mx-lg-n3{margin-right:-1rem!important}.mb-lg-n3,.my-lg-n3{margin-bottom:-1rem!important}.ml-lg-n3,.mx-lg-n3{margin-left:-1rem!important}.m-lg-n4{margin:-1.5rem!important}.mt-lg-n4,.my-lg-n4{margin-top:-1.5rem!important}.mr-lg-n4,.mx-lg-n4{margin-right:-1.5rem!important}.mb-lg-n4,.my-lg-n4{margin-bottom:-1.5rem!important}.ml-lg-n4,.mx-lg-n4{margin-left:-1.5rem!important}.m-lg-n5{margin:-3rem!important}.mt-lg-n5,.my-lg-n5{margin-top:-3rem!important}.mr-lg-n5,.mx-lg-n5{margin-right:-3rem!important}.mb-lg-n5,.my-lg-n5{margin-bottom:-3rem!important}.ml-lg-n5,.mx-lg-n5{margin-left:-3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-n1{margin:-.25rem!important}.mt-xl-n1,.my-xl-n1{margin-top:-.25rem!important}.mr-xl-n1,.mx-xl-n1{margin-right:-.25rem!important}.mb-xl-n1,.my-xl-n1{margin-bottom:-.25rem!important}.ml-xl-n1,.mx-xl-n1{margin-left:-.25rem!important}.m-xl-n2{margin:-.5rem!important}.mt-xl-n2,.my-xl-n2{margin-top:-.5rem!important}.mr-xl-n2,.mx-xl-n2{margin-right:-.5rem!important}.mb-xl-n2,.my-xl-n2{margin-bottom:-.5rem!important}.ml-xl-n2,.mx-xl-n2{margin-left:-.5rem!important}.m-xl-n3{margin:-1rem!important}.mt-xl-n3,.my-xl-n3{margin-top:-1rem!important}.mr-xl-n3,.mx-xl-n3{margin-right:-1rem!important}.mb-xl-n3,.my-xl-n3{margin-bottom:-1rem!important}.ml-xl-n3,.mx-xl-n3{margin-left:-1rem!important}.m-xl-n4{margin:-1.5rem!important}.mt-xl-n4,.my-xl-n4{margin-top:-1.5rem!important}.mr-xl-n4,.mx-xl-n4{margin-right:-1.5rem!important}.mb-xl-n4,.my-xl-n4{margin-bottom:-1.5rem!important}.ml-xl-n4,.mx-xl-n4{margin-left:-1.5rem!important}.m-xl-n5{margin:-3rem!important}.mt-xl-n5,.my-xl-n5{margin-top:-3rem!important}.mr-xl-n5,.mx-xl-n5{margin-right:-3rem!important}.mb-xl-n5,.my-xl-n5{margin-bottom:-3rem!important}.ml-xl-n5,.mx-xl-n5{margin-left:-3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.stretched-link::after{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:auto;content:"";background-color:rgba(0,0,0,0)}.text-monospace{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace!important}.text-justify{text-align:justify!important}.text-wrap{white-space:normal!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-lighter{font-weight:lighter!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-weight-bolder{font-weight:bolder!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0056b3!important}.text-secondary{color:#6c757d!important}a.text-secondary:focus,a.text-secondary:hover{color:#494f54!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#19692c!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#0f6674!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#ba8b00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#a71d2a!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#cbd3da!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#121416!important}.text-body{color:#212529!important}.text-muted{color:#6c757d!important}.text-black-50{color:rgba(0,0,0,.5)!important}.text-white-50{color:rgba(255,255,255,.5)!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.text-decoration-none{text-decoration:none!important}.text-break{word-wrap:break-word!important}.text-reset{color:inherit!important}.visible{visibility:visible!important}.invisible{visibility:hidden!important}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px!important}.container{min-width:992px!important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #dee2e6!important}.table-dark{color:inherit}.table-dark tbody+tbody,.table-dark td,.table-dark th,.table-dark thead th{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}
  7 +/*# sourceMappingURL=bootstrap.min.css.map */
0 8 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/call/assets/css/index.css 0 → 100644
  1 +html,
  2 +body,
  3 +.page {
  4 + position: relative;
  5 + width: 100%;
  6 + height: 100%;
  7 + overflow: hidden;
  8 +}
  9 +
  10 +img {
  11 + user-select: none;
  12 +}
  13 +
  14 +p {
  15 + margin: 0;
  16 +}
  17 +
  18 +.page.d-none {
  19 + display: none !important;
  20 +}
  21 +
  22 +.extend-height {
  23 + height: 100%;
  24 +}
  25 +
  26 +.icon-btn {
  27 + cursor: pointer;
  28 +}
  29 +
  30 +.login {
  31 + width: 800px;
  32 + position: relative;
  33 + box-shadow: 0 0 20px 0px rgba(0, 0, 0, 0.3);
  34 + border-radius: 20px;
  35 + overflow: hidden;
  36 + padding-top: 80%;
  37 +}
  38 +
  39 +.flex-basis-0 {
  40 + flex-basis: 0% !important;
  41 +}
  42 +
  43 +.login-left,
  44 +.login-right {
  45 + position: relative;
  46 + overflow: hidden;
  47 +}
  48 +
  49 +.full-wrap {
  50 + width: 100%;
  51 + height: 100%;
  52 +}
  53 +.home-login-flex {
  54 + display: flex;
  55 +}
  56 +/* login-left */
  57 +.login-left > .img-responsive {
  58 + width: 100%;
  59 +}
  60 +
  61 +/* login-right */
  62 +.login-right > .full-wrap {
  63 + padding: 15px 30px;
  64 +}
  65 +
  66 +.login-form {
  67 + position: absolute;
  68 + top: 0;
  69 + /* left: 0; */
  70 + left: 100%;
  71 + transition: left 0.3s;
  72 + z-index: 1;
  73 + display: block;
  74 + width: 100%;
  75 + height: 100%;
  76 + padding: 15px;
  77 + background-color: #fff;
  78 +}
  79 +
  80 +.login-form.show {
  81 + left: 0;
  82 +}
  83 +
  84 +.login-form_bd {
  85 + padding: 140px 28px 10px;
  86 +}
  87 +
  88 +#userInputs input {
  89 + outline: none;
  90 + border: 4px solid #dddddd;
  91 + border-radius: 10px;
  92 + font-size: 1.5em;
  93 + color: #949494;
  94 +}
  95 +
  96 +#multiUserInputs input {
  97 + outline: none;
  98 + border: 4px solid #dddddd;
  99 + border-radius: 10px;
  100 + font-size: 1.5em;
  101 + color: #949494;
  102 +}
  103 +
  104 +#userMutiModalInputs input {
  105 + outline: none;
  106 + border: 4px solid #dddddd;
  107 + border-radius: 10px;
  108 + font-size: 1.5em;
  109 + color: #949494;
  110 +}
  111 +
  112 +.login-form_bt {
  113 + color: #949494;
  114 +}
  115 +
  116 +.login-form_desc,
  117 +.login-form_submit,
  118 +.login-form_ownid {
  119 + text-align: center;
  120 + color: #949494;
  121 +}
  122 +
  123 +.login-form_submit {
  124 + margin: 60px 0 10px;
  125 +}
  126 +
  127 +.login-form_us > button {
  128 + margin: 5px;
  129 +}
  130 +
  131 +/* .login-form_submit > button:first-child {
  132 + margin-bottom: 30px;
  133 +} */
  134 +
  135 +.container-fluid {
  136 + /* height: 52px; */
  137 + padding: 14px 0;
  138 + border-color: #40a3fc;
  139 + background: #40a3fc;
  140 + /* border-radius: 26px; */
  141 + box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, 0.17);
  142 + font-size: 1.2em;
  143 + display: flex;
  144 + justify-content: center;
  145 + align-items: center;
  146 + margin: 0 10px;
  147 + color: #fff !important;
  148 +}
  149 +
  150 +.login-form_ownid {
  151 + padding-bottom: 60px;
  152 +}
  153 +
  154 +.login_bg {
  155 + position: absolute;
  156 + /* top: 0;
  157 + left: 0; */
  158 + bottom: 0;
  159 + right: -20px;
  160 + /* width: 820px; */
  161 + top: -20px;
  162 + left: -20px;
  163 + z-index: -1;
  164 +}
  165 +
  166 +.login_bg .img-responsive {
  167 + width: 100%;
  168 +}
  169 +
  170 +.warning_box {
  171 + position: absolute;
  172 + left: 25%;
  173 + right: 25%;
  174 + z-index: 10;
  175 + text-align: center;
  176 +}
  177 +
  178 +.warning_box .close {
  179 + outline: none;
  180 + line-height: 20px;
  181 +}
  182 +
  183 +.warning_whole {
  184 + z-index: 1060;
  185 +}
  186 +
  187 +.userid-inputs {
  188 +}
  189 +
  190 +.userid-inputs > input {
  191 + width: 60px;
  192 + height: 60px;
  193 + text-align: center;
  194 + border: 1px solid #ccc;
  195 +}
  196 +
  197 +.login-setting {
  198 + z-index: 2;
  199 +}
  200 +
  201 +.login-setting .setting-video_preview {
  202 + margin: 34px auto 0;
  203 + display: block;
  204 + box-sizing: border-box;
  205 + background: #f7f7f7;
  206 + position: relative;
  207 + align-items: center;
  208 + width: 100%;
  209 + flex: 1;
  210 +}
  211 +
  212 +.setting-video_preview_bg {
  213 + position: absolute;
  214 + padding: 30px;
  215 +}
  216 +
  217 +.setting-hd {
  218 + height: 54px;
  219 + line-height: 50px;
  220 + border-bottom: 1px solid #eeeeee;
  221 +}
  222 +
  223 +.setting-option_title {
  224 + /* margin-top: 5px;
  225 + margin-bottom: 7px; */
  226 + height: 30px;
  227 + line-height: 40px;
  228 + font-size: 0.8em;
  229 + color: #6a6a6a;
  230 +}
  231 +.setting-bd {
  232 + display: flex;
  233 + flex-direction: column;
  234 + overflow: hidden;
  235 + flex: 1;
  236 +}
  237 +.setting-bd > select {
  238 + outline: none;
  239 + border: 0;
  240 + border-bottom: 1px solid #ddd;
  241 + width: 100%;
  242 + height: 40px;
  243 + border-color: #ccc;
  244 + font-size: 1.3em;
  245 +}
  246 +
  247 +.meet-page {
  248 + z-index: 3;
  249 +}
  250 +
  251 +.meet-view {
  252 + width: 100%;
  253 + margin: 0 auto;
  254 +}
  255 +
  256 +.switch-audio-call_item {
  257 + display: none;
  258 +}
  259 +
  260 +/* meet page */
  261 +@media screen and (max-width: 576px) {
  262 + .meet-view {
  263 + width: 100%;
  264 + height: 100%;
  265 + /* width: 400px;
  266 + height: 300px; */
  267 + }
  268 +
  269 + .video-preview_little {
  270 + user-select: none;
  271 + margin: 20px;
  272 + width: 128px;
  273 + height: 96px;
  274 + z-index: 8;
  275 + background: #1c1c1c;
  276 + border: 1px solid #999999;
  277 + position: absolute;
  278 + }
  279 +}
  280 +
  281 +@media (min-width: 576px) and (max-width: 767.98px) {
  282 + .meet-view {
  283 + width: 400px;
  284 + height: 300px;
  285 + }
  286 +
  287 + .video-preview_little {
  288 + user-select: none;
  289 + margin: 20px;
  290 + width: 128px;
  291 + height: 96px;
  292 + z-index: 8;
  293 + background: #1c1c1c;
  294 + border: 1px solid #999999;
  295 + position: absolute;
  296 + }
  297 +}
  298 +
  299 +@media (min-width: 768px) and (max-width: 991.98px) {
  300 + .meet-view {
  301 + width: 800px;
  302 + height: 600px;
  303 + }
  304 +
  305 + .video-preview_little {
  306 + user-select: none;
  307 + margin: 20px;
  308 + width: 173px;
  309 + height: 130px;
  310 + z-index: 8;
  311 + background: #1c1c1c;
  312 + border: 1px solid #999999;
  313 + position: absolute;
  314 + }
  315 +}
  316 +
  317 +@media (min-width: 992px) and (max-width: 1199.98px) {
  318 + .meet-view {
  319 + width: 800px;
  320 + height: 600px;
  321 + }
  322 +
  323 + .video-preview_little {
  324 + user-select: none;
  325 + margin: 20px;
  326 + width: 233px;
  327 + height: 175px;
  328 + z-index: 8;
  329 + background: #1c1c1c;
  330 + border: 1px solid #999999;
  331 + position: absolute;
  332 + }
  333 +}
  334 +
  335 +@media (min-width: 1200px) and (max-width: 1499.98px) {
  336 + .meet-view {
  337 + width: 900px;
  338 + height: 675px;
  339 + }
  340 +
  341 + .video-preview_little {
  342 + user-select: none;
  343 + margin: 20px;
  344 + width: 275px;
  345 + height: 206px;
  346 + z-index: 8;
  347 + background: #1c1c1c;
  348 + border: 1px solid #999999;
  349 + position: absolute;
  350 + }
  351 +}
  352 +
  353 +@media (min-width: 1500px) {
  354 + .meet-view {
  355 + width: 1100px;
  356 + height: 825px;
  357 + }
  358 +
  359 + .video-preview_little {
  360 + user-select: none;
  361 + margin: 20px;
  362 + z-index: 8;
  363 + background: #1c1c1c;
  364 + border: 1px solid #999999;
  365 + width: 300px;
  366 + height: 225px;
  367 + position: absolute;
  368 + }
  369 +}
  370 +
  371 +/* .video-preview_little.audio {
  372 + top: 20%;
  373 + left: 50%;
  374 + transform: translate(-50%, -50%);
  375 + width: 120px;
  376 + height: 120px;
  377 +} */
  378 +
  379 +.video-preview_big {
  380 + width: 100%;
  381 + height: 100%;
  382 + background: #333;
  383 + position: relative;
  384 +}
  385 +.video-preview_big_left_bottom {
  386 + padding: 0 10px;
  387 + background-color: rgba(35, 35, 35, 1);
  388 + position: absolute;
  389 + z-index: 99;
  390 + bottom: 0;
  391 + left: 0;
  392 +}
  393 +.video-preview_big_network {
  394 + background: #000;
  395 +}
  396 +
  397 +.video-preview_box {
  398 + position: relative;
  399 + width: 100%;
  400 + height: 100%;
  401 +}
  402 +
  403 +.video-operate {
  404 + position: absolute;
  405 + bottom: 20px;
  406 + width: 100%;
  407 +}
  408 +
  409 +.derail_voice {
  410 + display: block;
  411 +}
  412 +
  413 +.derail_voice_close {
  414 + display: none;
  415 +}
  416 +
  417 +.derail_video {
  418 + display: block;
  419 +}
  420 +
  421 +.derail_video_close {
  422 + display: none;
  423 +}
  424 +
  425 +.derail {
  426 + cursor: pointer;
  427 +}
  428 +
  429 +/* */
  430 +.invitation {
  431 + padding: 40px 15px;
  432 + width: 420px;
  433 + background-color: #169bd5;
  434 +}
  435 +
  436 +.head_portrait {
  437 + padding: 50px 0 30px;
  438 + /* background-color: #fff; */
  439 +}
  440 +
  441 +.bd-highlight {
  442 + background: url(../images/call_bg.png) no-repeat;
  443 + background-position: center;
  444 + background-size: initial;
  445 + border-radius: 20px;
  446 + box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3);
  447 +}
  448 +
  449 +/* 音频通话 */
  450 +.audio_bg {
  451 + /* height: 100%; */
  452 + width: 100%;
  453 + /* background: url(../images/audio_bg.png) no-repeat;
  454 + background-position: center;
  455 + background-size: 100%; */
  456 + /* box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.3); */
  457 +}
  458 +
  459 +.audio_main {
  460 + position: absolute;
  461 + top: 0;
  462 + right: 0;
  463 + bottom: 0;
  464 + left: 0;
  465 +}
  466 +
  467 +.audio_time {
  468 + font-size: 1.5em;
  469 + font-weight: 400;
  470 + text-align: center;
  471 + color: #ffffff;
  472 + letter-spacing: 1px;
  473 + text-shadow: 0px 2px 1px 0px rgba(0, 0, 0, 0.35);
  474 +}
  475 +
  476 +.audio_option {
  477 + background: #fff;
  478 + width: 175px;
  479 + border-radius: 40px;
  480 + justify-content: space-evenly;
  481 + z-index: 666;
  482 +}
  483 +
  484 +.audio_option > button {
  485 + outline: none;
  486 + border: 0;
  487 + background: #fff;
  488 + color: #515151;
  489 + font-size: 1em;
  490 +}
  491 +
  492 +.meet-control_icon {
  493 + font-size: 1.5em;
  494 +}
  495 +
  496 +.seting-mutil_height {
  497 + padding: 5px 0;
  498 + height: 50px;
  499 + border-bottom: 1px solid #ddd;
  500 +}
  501 +
  502 +/* */
  503 +.prompt_little {
  504 + padding: 0 10px;
  505 + background-color: rgba(35, 35, 35, 1);
  506 + position: absolute;
  507 + z-index: 99;
  508 + bottom: 0;
  509 +}
  510 +
  511 +.prompt_big {
  512 + position: absolute;
  513 + z-index: 99;
  514 + bottom: 0;
  515 + color: #fff;
  516 +}
  517 +#userLocalVideoData {
  518 + position: absolute;
  519 + right: -204px;
  520 + width: 204px;
  521 + /* left: 120px; */
  522 + top: 10px;
  523 + /* width: 100%; */
  524 + padding: 6px 10px;
  525 + /* width: 120px; */
  526 + z-index: 99;
  527 + border-radius: 4px;
  528 + font-size: 12px;
  529 + color: #fff;
  530 + background: rgba(0, 0, 0, 0.5);
  531 +}
  532 +#userRemodeVideoData {
  533 + position: absolute;
  534 + right: 20px;
  535 + bottom: 20px;
  536 + z-index: 99;
  537 + padding: 6px 10px;
  538 + /* width: 240px; */
  539 + border-radius: 4px;
  540 + color: #fff;
  541 + font-size: 12px;
  542 + background: rgba(0, 0, 0, 0.5);
  543 +}
  544 +
  545 +.prompt_little > i,
  546 +.prompt_little > div {
  547 + margin: 0 5px;
  548 + opacity: 1;
  549 +}
  550 +
  551 +.prompt_little > i {
  552 + margin-right: 5px;
  553 +}
  554 +
  555 +.prompt_little > div {
  556 + color: #fff;
  557 +}
  558 +
  559 +.icon_color_blue {
  560 + color: #40a3fc;
  561 +}
  562 +
  563 +.icon_color_red {
  564 + color: #f97171;
  565 +}
  566 +
  567 +.multiple_call_span::after {
  568 + content: ",";
  569 +}
  570 +
  571 +.user_characteristic {
  572 + font-size: 1.5em;
  573 + height: 54px;
  574 +}
  575 +
  576 +/* 多人视频 */
  577 +.video-preview_small {
  578 + flex-wrap: nowrap;
  579 + position: absolute;
  580 + top: 0;
  581 + /* overflow: auto; */
  582 + width: 100%;
  583 + overflow-y: hidden;
  584 + overflow-x: auto;
  585 + z-index: 2;
  586 +}
  587 +
  588 +.video-preview_small_box {
  589 + box-sizing: border-box;
  590 + user-select: none;
  591 + width: 200px;
  592 + height: 168px;
  593 + z-index: 14;
  594 + border: 1px solid #999999;
  595 + position: relative;
  596 +}
  597 +
  598 +.video-preview {
  599 + margin: 0;
  600 + width: 100%;
  601 + height: 100%;
  602 + position: relative;
  603 + background-color: #232323;
  604 +}
  605 +
  606 +.video-preview_state {
  607 + position: absolute;
  608 + top: 0;
  609 + width: 100%;
  610 + height: 100%;
  611 + background-color: #232323;
  612 +}
  613 +
  614 +.video-preview_status {
  615 + color: #fff;
  616 +}
  617 +
  618 +.video-icon_font {
  619 + font-size: 2.5em;
  620 +}
  621 +
  622 +.basicView_img {
  623 + position: absolute;
  624 + left: 0;
  625 + top: 0;
  626 + bottom: 0;
  627 + right: 0;
  628 + background: #333;
  629 + display: flex;
  630 + justify-content: center;
  631 + align-items: center;
  632 +}
  633 +.basicView_img_index {
  634 + z-index: 1;
  635 +}
  636 +/* 模态框 */
  637 +.modal-form_bd {
  638 + padding: 30px;
  639 +}
  640 +
  641 +.user-tag > i {
  642 + margin-left: 8px;
  643 +}
  644 +
  645 +.user-tag > .icon-delete_open {
  646 + display: none;
  647 +}
  648 +
  649 +.user-tag:hover > .icon-delete_close {
  650 + display: none;
  651 +}
  652 +.user-tag:hover > .icon-delete_open {
  653 + display: inline-block;
  654 +}
  655 +
  656 +.invite-btn > .icon-request_opacity {
  657 + display: none;
  658 +}
  659 +.invite-btn:hover > .icon-request_transparent {
  660 + display: none;
  661 +}
  662 +.invite-btn:hover > .icon-request_opacity {
  663 + display: inline-block;
  664 +}
... ...
src/main/resources/static/real_control_v2/call/assets/font/iconfont.css 0 → 100644
  1 +@font-face {font-family: "iconfont";
  2 + src: url('iconfont.eot?t=1598342553725'); /* IE9 */
  3 + src: url('iconfont.eot?t=1598342553725#iefix') format('embedded-opentype'), /* IE6-IE8 */
  4 + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAygAAsAAAAAGOAAAAxTAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFCAqgMJl6ATYCJANYCy4ABCAFhG0HglobshQzo8LGAUAoL0/2f0jQ1hDsetQ1Aw/dik88vopiS8XCd/hpFDHxxOJbYHCO4VzZlI8SzvPK/ZWiX6rhmnig3+/bufpV2m4STTubVBOeyCSaJUKGFCB0QqFkD5l5Q7hpd1zwIFZRqNgcmLFUKFQ0rE0Cqxkyo+YTMX7mndg77atOVNjehAAw6Nw9pnYOiNYAAQTy/W+qOqVhJf12hkVyGb2m7XXVYfQoPsQnny/7PKkzpWSTv2wowkq0bAGnADACSqt93SzZAXxCEhSmcg6MqILohun4TwjN/+33rT5ZU9QHyZsioVDizBOb++XiKyKDmCctadlQTPx0LEMoUAoh0RuhFAyWU66mEELEifuv29AEdK0aDl5/5FOgLaNewCVvo70atF0n5IjEoO2vki6zg6sU7fjHH3zRf374tx8PopJAh/XkTUYdOP9p/fzSrAa/TrN9Li4Zl+5I2ANkwidp6kfJdPd03pWlZo/RXsY1P7+m+amF3liRompdB9/R1dM3MDQyJiOnoKTK9A8vSoQKel4fgrgBC+Cn5qjoYIAqwAK1AA6oDfBAHUAA6gIiUA+QgPqADDQAFKAhoAKNAA1oDOhAE8AAmgIm0AywgOaADb0bcIAy4AIFwAOKgA9g0arLLvYAN5Qh1K9ozLfSrBgvSWMJaUyOPJu8yNx8bSj0tVwaKJGLcXJMp0SKtqmRK2Ji8BidGE84psQxZ2plKaR4MK87mJ8Qq5LgYpiwYVw+fuj7ZmS8538o8ZdW/63yX1nMYyZEnFNkapeUVYPEN2iK415FVco6piJY2oJ+pXGC+xIuKaah6krjAm+2mQekiqJGfQBTy+qTBOsIIkooL1lZnfB86AXGVj7c+UtPKS2ruip+0uIrxX8x8odVJeoxnm5UFBnTKrokMyc4g7KrY7vXI3Nr4zpWqNdUlp6bfXbJaRvCjb1ufzNp6nN6Gq6g5KA7DEniHZStngw5A/dQMkbgmsx73Vh0UHlids+l31Yt9JTsV5t2VtdR05A16lRfUJz9OlT9qKlo2dECMcjWdnbX77rWm5rrplgnPMdkYuoRKYxYVvuIVN816ISbHOZR0bIlsuG+XBRpfygXR9Y/kic/VdfzL11enAv6t59Ao7UArtFxVgchqdeEUErG4FZgkRD0pKLGM9utfR4eDeZ3Q5lSpLQOW3JkOHcVwt6HgprDVfUHZBb0G7uG9qL8sCZxF0HCz3LVXYbEjs6i3o4sewzEX4Fg4LC4amgnHN0bZ908zRVnLjTlzE6NOPLsxU6APSRQtzsMwq3Et4SsHsnUALi7vf3wKkyGMWiVDhWnnk55Ve5am7YufaFpUm+p0I1sZgry7CeqaGjUJH49qXu/uWNgNys7eEbWPdwHCzB03dOlDCJiySh4YbMKQHIqO5pIffOiogGunMMPW4R7ud7ZEEregQbMgbEIpWhIqreNcM/VGIAHKdlO6rJfXQPg4ylpiFqgdWwCNnNqsNFKK6vr0ykzpVlBG4Ldl5iOsx3kkdjsBSDTrbWGyK+HkNSNhAKvrpzNmJ6PF4LaJq16M+apubgJrgabHo4LG/M7V9IDjFCYpgJtufoa5p4+Vxm8Fx7TTtPrHhyz3xc4MYE5hRU9hyco5Qsn85pd1Xc0fxqTP5JR1yySpYiQChuydqtUv9ooqO4/NnopX7sZ1+zK3iPkjlLHkNDQQM+nSXyUChY/ZpeTg1Zpx4bmDLBqaskXMaBnhrB5LF7ABygRTwzOjgWVk0u/jofz86lxZXeRM93lFLgaQnsID5zGB2kAiAxrInfwTigzk2SHE/Wz1naYHTBWKFtxV3pvNeq5hEVEYJcYFUy17TH1wE93a4rQMo4NdNq4pggJoDubyxE+DRVppIsuZU+pyLWXtOZhwPJ77vw94G1brhE4czZ01RVkurQW8N7oyVNootZpqIJXQElPMYOYhpejzmZASyK4pk6rDXKXk78IMvbQ6RXql8vHTIbvaS2uzIIW16QKeOUzHtgzP/d3YMHyWkuspVXAacx1bJ1+gsW+EHsk8uiWpF3Zn+Q51tCDeZ+scQzSJbE1ik7UAbQ1a+dycnLdbn5YQGBOTmPj9XtMjRK/z+eXiPPevZyjI1mfw8kCldacoNcmafUJZu1XEwskh4xetcrVz0S9tnlFARhIHzAeSj/UNKUA0+oSTEm0hMLXkgLwoVH6PRm9IOkP6iHvH5H4Ki9cCr/BimXbwn7+GUlzeA+Kv+rT4bpP7m/3We4CbHvzR+ho2+DjvZGlfyy7if77SvmW+YPYKayhBGtVdKG46ItZ+ibWn2NaPjAD7e31elz/oU6ke/782XMTbhow42YDnz3T3AEntShlIe6HMdp//gxMOD6KltGeeilNEJMIzfU4nUk0l6CljBVJECn1Hia0TqBGM0+zA1TYaeyMoOaWM2yVKoidxtsqPVfdkMZW36pgzdvrnaVIn/GJTBQpkn1i0OsRzTDNVe3+Ci4g/bK63WJY172mFjfXqsmspMpxFeGOml+pdBkg6XSSkFHxJiQd15WSXLPFzDVgbUDyXXKA+yxN9u077mqAj+am/QtuwX9jObF4VPU7jZdlqudWoME4SHNVgziYhrfqg+ZqZW7AN21GiccX6/NIjNDW2mpjhTjaHCFJeZHeyLyYHZCa6aYgQ7dbTaDcM9tLyA7vCM8aC6ZrhTeEdXXkDa3A2LCjrlYR1AHUqOsiFhbGvnjIDgu/iH3V8DbDXHOtcXPn6eeuEPBLsoI3KP9reSX8bc3z9GvjstKd2fKG/dtO7tvWIM/uuzrBGLdmT0Rp/uk5p/O14e2parAHjvTRGobTjMKkP8Cb8AfpuR5NFG8WbxX/O/4q8Qfo4rtz3G3ZQqIUtI+HRSxiTsuToCDSbGCAUZjdOsdNS3PN/jNpzsxi+mpkgNkQRAY9aZ1NsGBR+/hSQAgnLCAS1Z9/v8DQZ5/z4kJNtCm0L1ik+SSym5+sSH7H/3Odmj85TV+P88beZJhFbQukNusimSekbIx34wzThZ05OQOnavHuNbBukp2XtqYkXLD7q7mq/swB35QnzIQdtz+MTKjyuj4trfWO3lZra5YtKC9v9uvfju/4Dc426+YlxL55Ayv7+ipgJRRMdSrAwOz+ZVVEUNRtXzEVEVlc/PoOVTzm9LfBCwLd7sMDGnUA4rPUwcE2ZZsXyap2D9rq75/V36Bq89hV4FSm16t5DcFXN3jale19s/r6EfQ0YOzJab/+MbHG4b3/6Ffh0wm5sgm/9DT1/DJBljvhqfDXR/e9jmvCH+RQkSBEFSLwnBwiEyY+/hWPlk6MnCg9Cv7r46pmfol+VuostS+hRQZjic5S4XMqsDhM4fRVWJxBgzHojignXaRbZr7CWVCR5qQ458PLkHS5pocKpqZaXE77CidhYWdlpqXxCDbWsXFyZibY5rilvgFu+V6ob2nIAG6kGAakuZ+808N+p/eTXDDyZ2/P7BsctCvtwVn9lGnj9rSrQL//XwCAf55/UY//jb8p+VEPAP7+9ArNOgvdNRnNBod6kY71NgD+s1YjNvau8xLNLF2KQe1RibdYH+x95jckOGahv1F3tf7TbqJoWDIz6REAoPOs9XtPEKCK0o2uIAe8m0WaUcbPflPg66Cdv1ZKiN94wj8FCq65ovxM6lrzzebmtEU0LfAjj9UQIf2339bx5HJPxiOaF1AP3Y8ReiX7l3aMiyO6rIAGzZy62RTfIrHxX4ZvYZOoZYUkbWtyDt0jRc8BqdrOSNeurO57ZpokIVOwYz4hwdgxEg19J8nYjxQUoTdIsfSCVOMQ6XoVFH3s2ej6r14ZRjDo7VFHS9kpp0UZl37BT8mw09L3/IFrLNCrbumt+EQGF9FO3fu1iNOOadQfZHhIiXRh2sFKF0TKZrFwsnY7S+NMvTKMiCMHbXtMGi1l93FRvh//BT8lwxH3fCX9A9dYc22ls0wgf/Kc6J5Nubru/Zockp3mNzON2schGYmVklbkje1gpRMyFJeNxeFZLinvqveNa4Gbffeln8UyCAqNweLwBCKJTKHS6I1mq93p9ry8O0SxoTXTEKmnYmyU46PrtwibXIthZLlKZIaYfRO3k2ZAgqC3iSouhG/uLaOCPC/AkOXv4wD7lnvG/4QqFd1yGUz2U1Hl34zcVMtATmc6tMAnH/O7tK/JZHnO6c6adtEYZjr0WxKhUTmuTnByVSHSAlA10XKDm4gSoTKbAQ==') format('woff2'),
  5 + url('iconfont.woff?t=1598342553725') format('woff'),
  6 + url('iconfont.ttf?t=1598342553725') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
  7 + url('iconfont.svg?t=1598342553725#iconfont') format('svg'); /* iOS 4.1- */
  8 +}
  9 +
  10 +.iconfont {
  11 + font-family: "iconfont" !important;
  12 + font-size: 16px;
  13 + font-style: normal;
  14 + -webkit-font-smoothing: antialiased;
  15 + -moz-osx-font-smoothing: grayscale;
  16 +}
  17 +
  18 +.icon-switch-audio_opacity:before {
  19 + content: "\e629";
  20 +}
  21 +
  22 +.icon-audio_transparent:before {
  23 + content: "\e62a";
  24 +}
  25 +
  26 +.icon-loading:before {
  27 + content: "\e62b";
  28 +}
  29 +
  30 +.icon-switch-audio:before {
  31 + content: "\e628";
  32 +}
  33 +
  34 +.icon-delete_close:before {
  35 + content: "\e617";
  36 +}
  37 +
  38 +.icon-close:before {
  39 + content: "\e618";
  40 +}
  41 +
  42 +.icon-delete_open:before {
  43 + content: "\e619";
  44 +}
  45 +
  46 +.icon-audio_close:before {
  47 + content: "\e61a";
  48 +}
  49 +
  50 +.icon-video_close:before {
  51 + content: "\e61b";
  52 +}
  53 +
  54 +.icon-request_opacity:before {
  55 + content: "\e61c";
  56 +}
  57 +
  58 +.icon-hangup:before {
  59 + content: "\e61d";
  60 +}
  61 +
  62 +.icon-audio_open:before {
  63 + content: "\e61e";
  64 +}
  65 +
  66 +.icon-screen_close:before {
  67 + content: "\e61f";
  68 +}
  69 +
  70 +.icon-screen_open:before {
  71 + content: "\e620";
  72 +}
  73 +
  74 +.icon-audio_close_slant:before {
  75 + content: "\e621";
  76 +}
  77 +
  78 +.icon-request_transparent:before {
  79 + content: "\e622";
  80 +}
  81 +
  82 +.icon-arrow_bottom:before {
  83 + content: "\e623";
  84 +}
  85 +
  86 +.icon-arrow_left:before {
  87 + content: "\e624";
  88 +}
  89 +
  90 +.icon-setting:before {
  91 + content: "\e625";
  92 +}
  93 +
  94 +.icon-video_open:before {
  95 + content: "\e626";
  96 +}
  97 +
  98 +.icon-arrow_top:before {
  99 + content: "\e627";
  100 +}
  101 +
... ...
src/main/resources/static/real_control_v2/call/assets/font/iconfont.eot 0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/call/assets/font/iconfont.svg 0 → 100644
  1 +<?xml version="1.0" standalone="no"?>
  2 +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
  3 +<!--
  4 +2013-9-30: Created.
  5 +-->
  6 +<svg>
  7 +<metadata>
  8 +Created by iconfont
  9 +</metadata>
  10 +<defs>
  11 +
  12 +<font id="iconfont" horiz-adv-x="1024" >
  13 + <font-face
  14 + font-family="iconfont"
  15 + font-weight="500"
  16 + font-stretch="normal"
  17 + units-per-em="1024"
  18 + ascent="896"
  19 + descent="-128"
  20 + />
  21 + <missing-glyph />
  22 +
  23 + <glyph glyph-name="switch-audio_opacity" unicode="&#58921;" d="M512 892C231.44 892 4 664.56 4 384s227.44-508 508-508 508 227.44 508 508S792.56 892 512 892z m91.02-519.08l-194.48-163.58a5.5 5.5 0 0 0-9.04 4.2V354c-2.22 0-4.44 0.12-6.7 0.12-116.1 0-211.08-70-218.38-158.38a187.84 187.84 0 0 0-3.14 31c-2 111.82 94.98 204.3 216.68 206.52q5.86 0.1 11.64 0v107.42a5.5 5.5 0 0 0 9.04 4.2l194.4-163.56a5.5 5.5 0 0 0 0-8.4z m92.12-92.44a29.52 29.52 0 0 0-53.46 25.06 190.74 190.74 0 0 1 2.18 156.96 29.48 29.48 0 0 0 15.3 38.78h0.1A29.48 29.48 0 0 0 698 486a249.72 249.72 0 0 0-2.86-205.54z m96.42-101.78a29.5 29.5 0 0 0-49.58 32 324.4 324.4 0 0 1 2.9 347 29.5 29.5 0 0 0 50 31.18 383.42 383.42 0 0 0-3.32-410.18z" horiz-adv-x="1024" />
  24 +
  25 +
  26 + <glyph glyph-name="audio_transparent" unicode="&#58922;" d="M603.02 381.32000000000005l-194.4 163.56a5.5 5.5 0 0 1-9.04-4.2v-107.54q-5.78 0.18-11.64 0c-121.7-2.22-218.7-94.7-216.68-206.52a187.82 187.82 0 0 1 3.14-31C181.72 284.12 276.7 354 392.82 354c2.26 0 4.48 0 6.7-0.12v-140.4a5.5 5.5 0 0 1 9.04-4.2l194.48 163.58a5.5 5.5 0 0 1 0 8.4zM794.96 588.96a29.5 29.5 0 1 1-50-31.18A324.4 324.4 0 0 0 742 210.70000000000005a29.5 29.5 0 0 1 49.58-32 383.42 383.42 0 0 1 3.38 410.26zM659.22 501.38h-0.1a29.48 29.48 0 0 1-15.3-38.78 190.74 190.74 0 0 0-2.18-156.96 29.52 29.52 0 0 1 53.46-25.06A249.72 249.72 0 0 1 698 486a29.48 29.48 0 0 1-38.78 15.38zM512 872a488.14 488.14 0 0 0 190-937.66A488.14 488.14 0 0 0 322 833.66 484.92 484.92 0 0 0 512 872m0 20C231.44 892 4 664.56 4 384s227.44-508 508-508 508 227.44 508 508S792.56 892 512 892z" horiz-adv-x="1024" />
  27 +
  28 +
  29 + <glyph glyph-name="loading" unicode="&#58923;" d="M806.179075 659.402978m-131.44279 0a131.44279 131.44279 0 1 1 262.88558 0 131.44279 131.44279 0 1 1-262.88558 0ZM510.938347 782.756981m-113.243019 0a113.243019 113.243019 0 1 1 226.486038 0 113.243019 113.243019 0 1 1-226.486038 0ZM215.697618 660.414076m-92.434614 0a92.434614 92.434614 0 1 1 184.869229 0 92.434614 92.434614 0 1 1-184.869229 0ZM93.779375 363.81847600000003m-76.762589 0a76.762589 76.762589 0 1 1 153.525179 0 76.762589 76.762589 0 1 1-153.525179 0ZM215.697618 71.28749200000004m-76.762589 0a76.762589 76.762589 0 1 1 153.525179 0 76.762589 76.762589 0 1 1-153.525179 0ZM510.938347-51.23741099999995m-76.76259 0a76.762589 76.762589 0 1 1 153.525179 0 76.762589 76.762589 0 1 1-153.525179 0ZM806.179075 71.28749200000004m-76.762589 0a76.762589 76.762589 0 1 1 153.525178 0 76.762589 76.762589 0 1 1-153.525178 0ZM930.220625 363.81847600000003m-76.76259 0a76.762589 76.762589 0 1 1 153.525179 0 76.762589 76.762589 0 1 1-153.525179 0Z" horiz-adv-x="1024" />
  30 +
  31 +
  32 + <glyph glyph-name="switch-audio" unicode="&#58920;" d="M555.307884 760.326113a12.849764 12.849764 0 0 1-21.123759-9.841038v-251.541963q-13.539263 0.407432-27.235231 0.156705C222.248273 493.897229-4.659752 277.58242399999995 0.072722 16.011378000000036a439.367901 439.367901 0 0 1 7.365108-72.522814c17.080784 206.849857 239.256335 370.48063 510.856466 370.48063 5.265269 0 10.467856-0.156704 15.670443-0.282068v-328.421159a12.849764 12.849764 0 0 1 21.123758-9.841038l454.944322 382.640894a12.849764 12.849764 0 0 1 0 19.650737zM1459.022372 863.280928a69.012634 69.012634 0 1 1-117.183578-72.930245 758.856907 758.856907 0 0 0-6.769631-811.728984 69.015768 69.015768 0 1 1 115.961283-74.87338 896.913516 896.913516 0 0 1 7.960586 959.689314zM1141.225774 658.4682290000001a68.949952 68.949952 0 0 1-35.697271-90.888573 446.168873 446.168873 0 0 0-5.077224-367.158497 69.050243 69.050243 0 1 1 125.050141-58.607459 584.13146 584.13146 0 0 1 6.675609 480.957258 68.949952 68.949952 0 0 1-90.951255 35.697271z" horiz-adv-x="1594" />
  33 +
  34 +
  35 + <glyph glyph-name="delete_close" unicode="&#58903;" d="M813.52 149.10000000000002a15.3 15.3 0 0 0 0-21.62l-43.26-43.26a15.3 15.3 0 0 0-21.62 0l-40.42 40.42-196 196-236.5-236.42a15.3 15.3 0 0 0-21.62 0l-43.26 43.26a15.3 15.3 0 0 0 0 21.62l236.48 236.46L210.84 622a15.3 15.3 0 0 0 0 21.62l43.28 43.26a15.3 15.3 0 0 0 21.62 0L512.2 450.44l236.46 236.46a15.3 15.3 0 0 0 21.62 0l43.26-43.26a15.3 15.3 0 0 0 0-21.62l-40.44-40.42-196-196z" horiz-adv-x="1024" />
  36 +
  37 +
  38 + <glyph glyph-name="close" unicode="&#58904;" d="M906.54 46.879999999999995a20.48 20.48 0 0 0 0-28.92L848.66-40a20.48 20.48 0 0 0-28.92 0l-54.1 54.1-262.36 262.4L186.8-40a20.48 20.48 0 0 0-28.94 0L100 18a20.48 20.48 0 0 0 0 28.92l316.46 316.4L100 679.8a20.48 20.48 0 0 0 0 28.94l58 57.88a20.48 20.48 0 0 0 28.92 0l316.36-316.48L819.72 766.6a20.48 20.48 0 0 0 28.92 0l57.9-57.9a20.48 20.48 0 0 0 0-28.92l-54.1-54.1L590 363.32000000000005z" horiz-adv-x="1024" />
  39 +
  40 +
  41 + <glyph glyph-name="delete_open" unicode="&#58905;" d="M512.18 878.68C239.86 878.68 19.08 658 19.08 385.58s220.78-493.1 493.1-493.1 493.1 220.76 493.1 493.1S784.52 878.68 512.18 878.68z m301.34-729.58a15.3 15.3 0 0 0 0-21.62l-43.26-43.26a15.3 15.3 0 0 0-21.62 0l-40.42 40.42-196 196-236.5-236.42a15.3 15.3 0 0 0-21.62 0l-43.26 43.26a15.3 15.3 0 0 0 0 21.62l236.48 236.46L210.84 622a15.3 15.3 0 0 0 0 21.62l43.28 43.26a15.3 15.3 0 0 0 21.62 0L512.2 450.44l236.46 236.46a15.3 15.3 0 0 0 21.62 0l43.26-43.26a15.3 15.3 0 0 0 0-21.62l-40.44-40.42-196-196z" horiz-adv-x="1024" />
  42 +
  43 +
  44 + <glyph glyph-name="audio_close" unicode="&#58906;" d="M853.86 479.18v-94c0-174.24-130-318.42-297.9-341.46v-66.18h109.76a31.34 31.34 0 0 0 31.36-31.36v-31.36a31.34 31.34 0 0 0-31.36-31.36H352.14a31.34 31.34 0 0 0-31.36 31.36v31.28a31.34 31.34 0 0 0 31.36 31.36h109.76V44.39999999999998C289.38 68.17999999999995 164 224.79999999999995 164 400.48v78.7a31.34 31.34 0 0 0 31.36 31.36h31.36A31.34 31.34 0 0 0 258 479.18v-82.9c0-130.94 95.46-248 225.8-260.82a251.14 251.14 0 0 1 276 249.64v94a31.34 31.34 0 0 0 31.36 31.36h31.36a31.34 31.34 0 0 0 31.34-31.28z m-533.08-94V698.6800000000001a188.14 188.14 0 1 0 376.28 0v-313.56a188.14 188.14 0 1 0-376.28 0z m94 0a94 94 0 0 1 188.14 0V698.6800000000001a94 94 0 1 1-188.14 0z" horiz-adv-x="1024" />
  45 +
  46 +
  47 + <glyph glyph-name="video_close" unicode="&#58907;" d="M990 591v-426.38c0-30.7-25.72-52.28-53.28-52.28a52.28 52.28 0 0 0-30.2 9.46l-182 113.36v-96.76c0-43.82-38.5-79.34-86-79.34H120c-47.46 0-86 35.52-86 79.34V617.06c0 43.82 38.5 79.34 86 79.34h518.48c47.46 0 86-35.52 86-79.34v-96.76l182 113.52a53.14 53.14 0 0 0 30.2 9.46c27.6 0 53.32-21.56 53.32-52.28z m-345.22 24a9.74 9.74 0 0 1-6.3 1.82H120a10.84 10.84 0 0 1-6.3-1.82v-474.44a9.72 9.72 0 0 1 6.3-1.82h518.48a10.86 10.86 0 0 1 6.3 1.82V614.9z m265.56-72.7l-185.88-115.84v-97.42l185.88-115.84z" horiz-adv-x="1024" />
  48 +
  49 +
  50 + <glyph glyph-name="request_opacity" unicode="&#58908;" d="M712.72 119v-64.9a74.9 74.9 0 0 0-74.88-74.88H88.68A74.9 74.9 0 0 0 13.8 54.10000000000002V119a209.72 209.72 0 0 0 209.66 209.68h26a271.58 271.58 0 0 1 227.46 0h26a209.72 209.72 0 0 0 209.8-209.68zM163.56 578.3a199.7 199.7 0 1 0 199.7-199.7 199.68 199.68 0 0 0-199.7 199.7z m848.68-149.76v-50a25.04 25.04 0 0 0-24.96-24.96h-99.84v-99.78a25.04 25.04 0 0 0-24.96-24.96h-50a25.04 25.04 0 0 0-24.88 24.96v99.84h-99.84a25.04 25.04 0 0 0-24.96 24.96v50a25.04 25.04 0 0 0 24.96 24.96h99.84v99.78a25.04 25.04 0 0 0 24.96 24.96h50a25.04 25.04 0 0 0 24.96-24.96v-99.84h99.84a25.04 25.04 0 0 0 24.9-24.98z" horiz-adv-x="1024" />
  51 +
  52 +
  53 + <glyph glyph-name="hangup" unicode="&#58909;" d="M511.86 890.48C232.54 890.48 6.12 664 6.12 384.74S232.54-121 511.86-121 1017.6 105.41999999999996 1017.6 384.74 791.16 890.48 511.86 890.48zM834 241.27999999999997a28.46 28.46 0 0 0-34.46-11.28l-132.58 53.02a28 28 0 0 0-17.48 28.98l9.12 91.3a434.26 434.26 0 0 1-293.64 0L374 312a28 28 0 0 0-17.48-28.92L224 230a28.3 28.3 0 0 0-34.3 11.26l-66.28 106a28 28 0 0 0 4 34.8c212.52 212.52 556.72 212.2 768.9 0a28.12 28.12 0 0 0 4-34.8z" horiz-adv-x="1024" />
  54 +
  55 +
  56 + <glyph glyph-name="audio_open" unicode="&#58910;" d="M853.86 479.18v-94c0-174.24-130-318.42-297.9-341.46v-66.18h109.76a31.34 31.34 0 0 0 31.36-31.36v-31.36a31.34 31.34 0 0 0-31.36-31.36H352.14a31.34 31.34 0 0 0-31.36 31.36v31.28a31.34 31.34 0 0 0 31.36 31.36h109.76V44.39999999999998C289.38 68.17999999999995 164 224.79999999999995 164 400.48v78.7a31.34 31.34 0 0 0 31.36 31.36h31.36A31.34 31.34 0 0 0 258 479.18v-82.9c0-130.94 95.46-248 225.8-260.82a251.14 251.14 0 0 1 276 249.64v94a31.34 31.34 0 0 0 31.36 31.36h31.36a31.34 31.34 0 0 0 31.34-31.28z m-533.08-94V698.6800000000001a188.14 188.14 0 1 0 376.28 0v-313.56a188.14 188.14 0 1 0-376.28 0z" horiz-adv-x="1024" />
  57 +
  58 +
  59 + <glyph glyph-name="screen_close" unicode="&#58911;" d="M790.84 32.5h-163.66l-30.88 92.62a19.84 19.84 0 0 1-18.92 13.62h-130.6a19.84 19.84 0 0 1-18.92-13.62l-30.88-92.62h-163.82a39.84 39.84 0 1 1 0-79.66h557.68a39.84 39.84 0 0 1 0 79.66zM910.34 802.62H113.66A79.68 79.68 0 0 1 34 722.96v-478a79.68 79.68 0 0 1 79.66-79.66h796.68A79.68 79.68 0 0 1 990 244.96000000000004v478a79.68 79.68 0 0 1-79.66 79.66z m0-547.72a10 10 0 0 0-10-10H123.62a10 10 0 0 0-10 10V713a10 10 0 0 0 10 10h776.76a10 10 0 0 0 10-10zM695.12 530.44l-130.78 112.94a17.84 17.84 0 0 1-29.48-13.5v-59.48c-119.36-1.36-214-25.28-214-138.4 0-45.66 29.42-90.88 62-114.52 10.14-7.38 24.6 1.88 20.86 13.84-33.7 107.76 16 136.36 131.22 138V404a17.84 17.84 0 0 1 29.48-13.5l130.78 112.94a17.84 17.84 0 0 1-0.08 27z" horiz-adv-x="1024" />
  60 +
  61 +
  62 + <glyph glyph-name="screen_open" unicode="&#58912;" d="M790.84 32.5h-163.66l-30.88 92.62a19.84 19.84 0 0 1-18.92 13.62h-130.6a19.84 19.84 0 0 1-18.92-13.62l-30.88-92.62h-163.82a39.84 39.84 0 1 1 0-79.66h557.68a39.84 39.84 0 0 1 0 79.66zM910.34 802.62H113.66A79.68 79.68 0 0 1 34 722.96v-478a79.68 79.68 0 0 1 79.66-79.66h796.68A79.68 79.68 0 0 1 990 244.96000000000004v478a79.68 79.68 0 0 1-79.66 79.66zM695.12 503.46l-130.78-112.94a17.84 17.84 0 0 0-29.5 13.48v65.34c-115.24-1.66-164.9-30.26-131.22-138 3.74-12-10.72-21.22-20.86-13.84-32.5 23.64-62 68.88-62 114.52 0 113.12 94.64 137.04 214 138.4v59.46a17.84 17.84 0 0 0 29.48 13.5l130.78-112.94a17.84 17.84 0 0 0 0.1-26.98z" horiz-adv-x="1024" />
  63 +
  64 +
  65 + <glyph glyph-name="audio_close_slant" unicode="&#58913;" d="M508.94 196.96000000000004c2.46 0 4.92 0 7.36 0.16l-195.5 195.5v-7.5a188.14 188.14 0 0 1 188.14-188.16zM853.86 479.18a31.34 31.34 0 0 1-31.36 31.36h-31.36a31.34 31.34 0 0 1-31.36-31.36v-94a249.24 249.24 0 0 0-28-114.96l-47.32 47.32a187.62 187.62 0 0 1 12.54 67.64V698.6800000000001a188.14 188.14 0 0 1-376.28 0v-17.46L235.42 766.6a47.04 47.04 0 0 1-66.52 0 47.04 47.04 0 0 1 0-66.52l599.2-599.22a47.04 47.04 0 1 1 66.52 66.52l-34 34a342.28 342.28 0 0 1 53.24 183.74zM665.72-22.539999999999964H556v66.18a342.72 342.72 0 0 1 89 24.78L571.32 142a252.24 252.24 0 0 0-87.44-6.62C353.54 148.17999999999995 258 265.34000000000003 258 396.28v59.06l-55.2 55.2h-7.44A31.34 31.34 0 0 1 164 479.18v-78.7c0-175.68 125.38-332.3 297.9-356v-66.92h-109.76a31.34 31.34 0 0 1-31.36-31.36v-31.36a31.34 31.34 0 0 1 31.36-31.36h313.58a31.34 31.34 0 0 1 31.36 31.36v31.26a31.34 31.34 0 0 1-31.36 31.36z" horiz-adv-x="1024" />
  66 +
  67 +
  68 + <glyph glyph-name="request_transparent" unicode="&#58914;" d="M712.72 94v-40a74.9 74.9 0 0 0-74.88-74.88H88.68A74.9 74.9 0 0 0 13.8 54.10000000000002V94a209.74 209.74 0 0 0 209.66 209.72c44.94 0 66.3-24.96 139.78-24.96s95 24.96 139.78 24.96A209.74 209.74 0 0 0 712.72 94z m-74.88 0a135.02 135.02 0 0 1-134.8 134.8c-22.94 0-59.12-24.96-139.78-24.96-80 0-117 24.96-139.78 24.96a135.02 135.02 0 0 1-134.8-134.8v-40h549.14zM138.6 553.3399999999999a224.66 224.66 0 1 0 224.66-224.66A224.72 224.72 0 0 0 138.6 553.3399999999999z m74.88 0a149.76 149.76 0 1 1 149.76 149.76 150 150 0 0 1-149.76-149.76zM1012.26 416v-24.96a25.04 25.04 0 0 0-24.96-24.96h-112.34v-112.28A25.04 25.04 0 0 0 850 228.84000000000003h-24.96A25.04 25.04 0 0 0 800 253.79999999999995v112.32h-112.24a25.04 25.04 0 0 0-24.96 24.96V416a25.04 25.04 0 0 0 24.96 24.96H800v112.38a25.04 25.04 0 0 0 24.96 24.96H850a25.04 25.04 0 0 0 24.96-24.96v-112.34h112.32a25.04 25.04 0 0 0 24.98-25z" horiz-adv-x="1024" />
  69 +
  70 +
  71 + <glyph glyph-name="arrow_bottom" unicode="&#58915;" d="M971.68 574.62L527.24 130.20000000000005a25.46 25.46 0 0 0-36 0L46.78 574.62a25.48 25.48 0 0 0 0 36l42 42a25.46 25.46 0 0 0 36 0l384.4-383.5 384.4 383.5a25.46 25.46 0 0 0 36 0l42-42a25.46 25.46 0 0 0 0.1-36z" horiz-adv-x="1024" />
  72 +
  73 +
  74 + <glyph glyph-name="arrow_left" unicode="&#58916;" d="M692.44-71.01999999999998L248 373.41999999999996a25.46 25.46 0 0 0 0 36L692.44 853.88a25.48 25.48 0 0 0 36 0l42-42a25.46 25.46 0 0 0 0-36L386.98 391.42l383.5-384.4a25.46 25.46 0 0 0 0-36l-42-42a25.46 25.46 0 0 0-36.04-0.04z" horiz-adv-x="1024" />
  75 +
  76 +
  77 + <glyph glyph-name="setting" unicode="&#58917;" d="M980.2 244c-22-74.4-61.4-141.2-113.2-196.2-15-15.8-39-19.4-58-8.4l-64.2 37c-21.4-16.2-58.6-37.8-83.4-48.2v-74c0-22-15-41-36.4-46-74.2-17.6-151.8-17.6-226 0-21.4 5-36.4 24-36.4 46v74c-24.8 10.4-62 32-83.4 48.2l-64.2-37c-19-11-43-7.4-58 8.4-52 54.8-91.2 121.8-113.2 196.2-6.2 20.8 2.8 43.2 21.8 54.2l64.2 37c-1.6 13.2-3 34.8-3 48.2 0 13.4 1.4 35 3 48.2l-64.2 37c-18.8 10.8-28 33.2-21.8 54.2 22 74.4 61.4 141.2 113.2 196.2 15 15.8 39 19.4 58 8.4l64.2-37c21.4 16.2 58.6 37.8 83.4 48.2v74c0 22 15 41 36.4 46 74.2 17.6 151.8 17.6 226 0 21.4-5 36.4-24 36.4-46v-74c24.8-10.4 62-32 83.4-48.2l64.2 37c19 11 43 7.4 58-8.4 52-54.8 91.2-121.8 113.2-196.2 6.2-20.8-2.8-43.2-21.8-54.2l-64.2-37c1.6-13.2 3-34.8 3-48.2 0-13.4-1.4-35-3-48.2l64.2-37c19-10.8 28-33.2 21.8-54.2z m-64.2 6l-91.2 52.6c12.8 69.8 12.8 91.8 0 161.6l91.2 52.6c-18.2 55-47.6 106-86.6 149.6l-91.2-52.6c-54 46.2-73 57.2-139.8 80.8V800c-23.6 4.8-62.2 8.8-86.4 8.8-24 0-62.8-4-86.4-8.8v-105.4c-67-23.6-86-34.8-139.8-80.8l-91.2 52.6C155.8 623 126.2 572 108 517l91.2-52.6c-12.8-69.8-12.8-91.8 0-161.6L108 250c18.2-55 47.6-106 86.6-149.6l91.2 52.6c54.6-46.6 73.6-57.4 139.8-80.8v-105.4C449.2-38 488-42 512-42c24 0 62.8 4 86.4 8.8v105.4c67.8 24 86.8 35.4 139.8 80.8l91.2-52.6c39 43.4 68.4 94.4 86.6 149.6z m-214.8 133.4c0-104.2-84.8-189-189-189s-189 84.8-189 189 84.8 189 189 189c104 0 189-84.8 189-189z m-63.2 0c0 69.4-56.6 126-126 126s-126-56.6-126-126 56.6-126 126-126c69.6 0 126 56.6 126 126z" horiz-adv-x="1024" />
  78 +
  79 +
  80 + <glyph glyph-name="video_open" unicode="&#58918;" d="M671.34 617.06V138.39999999999998A79.34 79.34 0 0 0 592 59.059999999999945H113.34A79.34 79.34 0 0 0 34 138.39999999999998V617.06A79.34 79.34 0 0 0 113.34 696.4H592a79.34 79.34 0 0 0 79.34-79.34zM990 591v-426.38c0-42.32-48.46-67.06-83.66-42.82l-182 125.3V508.36l182 125.48C941.7 658 990 633.1600000000001 990 591z" horiz-adv-x="1024" />
  81 +
  82 +
  83 + <glyph glyph-name="arrow_top" unicode="&#58919;" d="M46.78 208.22000000000003l444.44 444.44a25.46 25.46 0 0 0 36 0l444.46-444.44a25.48 25.48 0 0 0 0-36l-42-42a25.46 25.46 0 0 0-36 0L509.24 513.6800000000001 124.82 130.20000000000005a25.46 25.46 0 0 0-36 0l-42 42a25.46 25.46 0 0 0-0.04 36.02z" horiz-adv-x="1024" />
  84 +
  85 +
  86 +
  87 +
  88 + </font>
  89 +</defs></svg>
... ...
src/main/resources/static/real_control_v2/call/assets/font/iconfont.ttf 0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/call/assets/font/iconfont.woff 0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/call/assets/font/iconfont.woff2 0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/call/assets/images/BG.png 0 → 100644

87 KB

src/main/resources/static/real_control_v2/call/assets/images/Dcall.png 0 → 100644

3.09 KB

src/main/resources/static/real_control_v2/call/assets/images/Mcalls.png 0 → 100644

2.55 KB

src/main/resources/static/real_control_v2/call/assets/images/answer.png 0 → 100644

4.07 KB

src/main/resources/static/real_control_v2/call/assets/images/audio_bg.png 0 → 100644

101 KB

src/main/resources/static/real_control_v2/call/assets/images/call_bg.png 0 → 100644

82.3 KB

src/main/resources/static/real_control_v2/call/assets/images/changaudio-hover.png 0 → 100644

4.07 KB

src/main/resources/static/real_control_v2/call/assets/images/chart.png 0 → 100644

6.5 KB

src/main/resources/static/real_control_v2/call/assets/images/favicon.ico 0 → 100644
No preview for this file type
src/main/resources/static/real_control_v2/call/assets/images/hangup.png 0 → 100644

3.87 KB

src/main/resources/static/real_control_v2/call/assets/images/head.png 0 → 100644

9.69 KB

src/main/resources/static/real_control_v2/call/assets/images/logo_big.png 0 → 100644

6.14 KB

src/main/resources/static/real_control_v2/call/assets/images/logo_title.png 0 → 100644

2.37 KB

src/main/resources/static/real_control_v2/call/assets/images/video.png 0 → 100644

2.33 KB

src/main/resources/static/real_control_v2/call/assets/images/video_close.png 0 → 100644

2.76 KB

src/main/resources/static/real_control_v2/call/assets/images/video_hangup.png 0 → 100644

2.59 KB

src/main/resources/static/real_control_v2/call/assets/images/voice.png 0 → 100644

2.57 KB

src/main/resources/static/real_control_v2/call/assets/images/voice_close.png 0 → 100644

2.89 KB

src/main/resources/static/real_control_v2/call/assets/images/yimg.jpg 0 → 100644

60.9 KB

src/main/resources/static/real_control_v2/call/assets/js/ArRTM@latest.js 0 → 100644
  1 +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ArRTM=t():e.ArRTM=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){!function(e){e[e.INVALID_OPERATION=1]="INVALID_OPERATION"}(e.BasicErrorCode||(e.BasicErrorCode={})),function(e){e[e.ATTRIBUTE_OPERATION_ERR_FAILURE=2]="ATTRIBUTE_OPERATION_ERR_FAILURE",e[e.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT=3]="ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT",e[e.ATTRIBUTE_OPERATION_ERR_SIZE_OVERFLOW=4]="ATTRIBUTE_OPERATION_ERR_SIZE_OVERFLOW",e[e.ATTRIBUTE_OPERATION_ERR_TOO_OFTEN=5]="ATTRIBUTE_OPERATION_ERR_TOO_OFTEN",e[e.ATTRIBUTE_OPERATION_ERR_USER_NOT_FOUND=6]="ATTRIBUTE_OPERATION_ERR_USER_NOT_FOUND",e[e.ATTRIBUTE_OPERATION_ERR_TIMEOUT=7]="ATTRIBUTE_OPERATION_ERR_TIMEOUT",e[e.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN=102]="ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN"}(e.AttributeOperationError||(e.AttributeOperationError={})),function(e){e[e.CHANNEL_MESSAGE_ERR_FAILURE=1]="CHANNEL_MESSAGE_ERR_FAILURE",e[e.CHANNEL_MESSAGE_ERR_TIMEOUT=2]="CHANNEL_MESSAGE_ERR_TIMEOUT",e[e.CHANNEL_MESSAGE_ERR_TOO_OFTEN=3]="CHANNEL_MESSAGE_ERR_TOO_OFTEN",e[e.CHANNEL_MESSAGE_ERR_INVALID_MESSAGE=4]="CHANNEL_MESSAGE_ERR_INVALID_MESSAGE",e[e.CHANNEL_MESSAGE_ERR_NOT_IN_CHANNEL=5]="CHANNEL_MESSAGE_ERR_NOT_IN_CHANNEL",e[e.CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN=102]="CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN"}(e.ChannelMessageError||(e.ChannelMessageError={})),function(e){e[e.CREATE_CHANNEL_ERR_INVALID_ARGUMENT=1]="CREATE_CHANNEL_ERR_INVALID_ARGUMENT"}(e.CreateChannelError||(e.CreateChannelError={})),function(e){e[e.CREATE_INSTANCE_ERR_INVALID_ARGUMENT=1]="CREATE_INSTANCE_ERR_INVALID_ARGUMENT"}(e.CreateInstanceError||(e.CreateInstanceError={})),function(e){e[e.GET_CHANNEL_MEMBER_COUNT_ERR_FAILURE=1]="GET_CHANNEL_MEMBER_COUNT_ERR_FAILURE",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_INVALID_ARGUMENT=2]="GET_CHANNEL_MEMBER_COUNT_ERR_INVALID_ARGUMENT",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_TOO_OFTEN=3]="GET_CHANNEL_MEMBER_COUNT_ERR_TOO_OFTEN",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_TIMEOUT=4]="GET_CHANNEL_MEMBER_COUNT_ERR_TIMEOUT",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_EXCEED_LIMIT=5]="GET_CHANNEL_MEMBER_COUNT_ERR_EXCEED_LIMIT",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_NOT_INITIALIZED=101]="GET_CHANNEL_MEMBER_COUNT_ERR_NOT_INITIALIZED",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_USER_NOT_LOGGED_IN=102]="GET_CHANNEL_MEMBER_COUNT_ERR_USER_NOT_LOGGED_IN"}(e.GetChannelMemberCountErrCode||(e.GetChannelMemberCountErrCode={})),function(e){e[e.GET_MEMBERS_ERR_FAILURE=1]="GET_MEMBERS_ERR_FAILURE",e[e.GET_MEMBERS_ERR_REJECTED=2]="GET_MEMBERS_ERR_REJECTED",e[e.GET_MEMBERS_ERR_TIMEOUT=3]="GET_MEMBERS_ERR_TIMEOUT",e[e.GET_MEMBERS_ERR_TOO_OFTEN=4]="GET_MEMBERS_ERR_TOO_OFTEN",e[e.GET_MEMBERS_ERR_NOT_IN_CHANNEL=5]="GET_MEMBERS_ERR_NOT_IN_CHANNEL",e[e.GET_MEMBERS_ERR_USER_NOT_LOGGED_IN=6]="GET_MEMBERS_ERR_USER_NOT_LOGGED_IN"}(e.GetMembersError||(e.GetMembersError={})),function(e){e[e.INVITATION_API_CALL_ERR_INVALID_ARGUMENT=1]="INVITATION_API_CALL_ERR_INVALID_ARGUMENT",e[e.INVITATION_API_CALL_ERR_NOT_STARTED=2]="INVITATION_API_CALL_ERR_NOT_STARTED",e[e.INVITATION_API_CALL_ERR_ALREADY_END=3]="INVITATION_API_CALL_ERR_ALREADY_END",e[e.INVITATION_API_CALL_ERR_ALREADY_ACCEPT=4]="INVITATION_API_CALL_ERR_ALREADY_ACCEPT",e[e.INVITATION_API_CALL_ERR_ALREADY_SENT=5]="INVITATION_API_CALL_ERR_ALREADY_SENT"}(e.InvitationApiCallError||(e.InvitationApiCallError={})),function(e){e[e.JOIN_CHANNEL_ERR_FAILURE=1]="JOIN_CHANNEL_ERR_FAILURE",e[e.JOIN_CHANNEL_ERR_REJECTED=2]="JOIN_CHANNEL_ERR_REJECTED",e[e.JOIN_CHANNEL_ERR_INVALID_ARGUMENT=3]="JOIN_CHANNEL_ERR_INVALID_ARGUMENT",e[e.JOIN_CHANNEL_TIMEOUT=4]="JOIN_CHANNEL_TIMEOUT",e[e.JOIN_CHANNEL_ERR_EXCEED_LIMIT=5]="JOIN_CHANNEL_ERR_EXCEED_LIMIT",e[e.JOIN_CHANNEL_ERR_ALREADY_JOINED=6]="JOIN_CHANNEL_ERR_ALREADY_JOINED",e[e.JOIN_CHANNEL_ERR_TOO_OFTEN=7]="JOIN_CHANNEL_ERR_TOO_OFTEN",e[e.JOIN_CHANNEL_ERR_JOIN_SAME_CHANNEL_TOO_OFTEN=8]="JOIN_CHANNEL_ERR_JOIN_SAME_CHANNEL_TOO_OFTEN",e[e.JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN=102]="JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN",e[e.JOIN_CHANNEL_ERR_ABORTED_BY_LEAVE=210]="JOIN_CHANNEL_ERR_ABORTED_BY_LEAVE",e[e.JOIN_CHANNEL_ERR_ALREADY_JOINED_CHANNEL_OF_SAME_ID=211]="JOIN_CHANNEL_ERR_ALREADY_JOINED_CHANNEL_OF_SAME_ID"}(e.JoinChannelError||(e.JoinChannelError={})),function(e){e[e.LEAVE_CHANNEL_ERR_FAILURE=1]="LEAVE_CHANNEL_ERR_FAILURE",e[e.LEAVE_CHANNEL_ERR_REJECTED=2]="LEAVE_CHANNEL_ERR_REJECTED",e[e.LEAVE_CHANNEL_ERR_NOT_IN_CHANNEL=3]="LEAVE_CHANNEL_ERR_NOT_IN_CHANNEL",e[e.LEAVE_CHANNEL_ERR_USER_NOT_LOGGED_IN=102]="LEAVE_CHANNEL_ERR_USER_NOT_LOGGED_IN"}(e.LeaveChannelError||(e.LeaveChannelError={})),function(e){e[e.LOGIN_ERR_UNKNOWN=1]="LOGIN_ERR_UNKNOWN",e[e.LOGIN_ERR_INVALID_ARGUMENT=2]="LOGIN_ERR_INVALID_ARGUMENT",e[e.LOGIN_ERR_INVALID_APP_ID=3]="LOGIN_ERR_INVALID_APP_ID",e[e.LOGIN_ERR_INVALID_TOKEN=4]="LOGIN_ERR_INVALID_TOKEN",e[e.LOGIN_ERR_TOKEN_EXPIRED=5]="LOGIN_ERR_TOKEN_EXPIRED",e[e.LOGIN_ERR_NOT_AUTHORIZED=6]="LOGIN_ERR_NOT_AUTHORIZED",e[e.LOGIN_ERR_ALREADY_LOGIN=7]="LOGIN_ERR_ALREADY_LOGIN",e[e.LOGIN_ERR_TIMEOUT=8]="LOGIN_ERR_TIMEOUT",e[e.LOGIN_ERR_TOO_OFTEN=9]="LOGIN_ERR_TOO_OFTEN",e[e.LOGIN_ERR_ABORTED_BY_LOGOUT=10]="LOGIN_ERR_ABORTED_BY_LOGOUT",e[e.LOGIN_ERR_GATEWAY_CONNECT_FAILED=11]="LOGIN_ERR_GATEWAY_CONNECT_FAILED"}(e.LoginError||(e.LoginError={})),function(e){e[e.LOGOUT_ERR_USER_NOT_LOGGED_IN=102]="LOGOUT_ERR_USER_NOT_LOGGED_IN"}(e.LogoutError||(e.LogoutError={})),function(e){e[e.PEER_MESSAGE_ERR_FAILURE=1]="PEER_MESSAGE_ERR_FAILURE",e[e.PEER_MESSAGE_ERR_TIMEOUT=2]="PEER_MESSAGE_ERR_TIMEOUT",e[e.PEER_MESSAGE_ERR_TOO_OFTEN=5]="PEER_MESSAGE_ERR_TOO_OFTEN",e[e.PEER_MESSAGE_ERR_INVALID_USERID=6]="PEER_MESSAGE_ERR_INVALID_USERID",e[e.PEER_MESSAGE_ERR_INVALID_MESSAGE=7]="PEER_MESSAGE_ERR_INVALID_MESSAGE",e[e.PEER_MESSAGE_ERR_USER_NOT_LOGGED_IN=102]="PEER_MESSAGE_ERR_USER_NOT_LOGGED_IN"}(e.PeerMessageError||(e.PeerMessageError={})),function(e){e[e.PEER_SUBSCRIPTION_STATUS_ERR_FAILURE=1]="PEER_SUBSCRIPTION_STATUS_ERR_FAILURE",e[e.PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT=2]="PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT",e[e.PEER_SUBSCRIPTION_STATUS_ERR_REJECTED=3]="PEER_SUBSCRIPTION_STATUS_ERR_REJECTED",e[e.PEER_SUBSCRIPTION_STATUS_ERR_TIMEOUT=4]="PEER_SUBSCRIPTION_STATUS_ERR_TIMEOUT",e[e.PEER_SUBSCRIPTION_STATUS_ERR_TOO_OFTEN=5]="PEER_SUBSCRIPTION_STATUS_ERR_TOO_OFTEN",e[e.PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW=6]="PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW",e[e.PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN=102]="PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN"}(e.PeerSubscriptionStatusError||(e.PeerSubscriptionStatusError={})),function(e){e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_FAILURE=1]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_FAILURE",e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TIMEOUT=2]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TIMEOUT",e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TOO_OFTEN=3]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TOO_OFTEN",e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_USER_NOT_LOGGED_IN=102]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_USER_NOT_LOGGED_IN"}(e.QueryPeersBySubscriptionOptionError||(e.QueryPeersBySubscriptionOptionError={})),function(e){e[e.QUERY_PEERS_ONLINE_STATUS_ERR_INVALID_ARGUMENT=0]="QUERY_PEERS_ONLINE_STATUS_ERR_INVALID_ARGUMENT",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_REJECTED=1]="QUERY_PEERS_ONLINE_STATUS_ERR_REJECTED",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_TIMEOUT=2]="QUERY_PEERS_ONLINE_STATUS_ERR_TIMEOUT",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_TOO_OFTEN=3]="QUERY_PEERS_ONLINE_STATUS_ERR_TOO_OFTEN",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_USER_NOT_LOGGED_IN=102]="QUERY_PEERS_ONLINE_STATUS_ERR_USER_NOT_LOGGED_IN"}(e.QueryPeersOnlineStatusError||(e.QueryPeersOnlineStatusError={})),function(e){e[e.RENEW_TOKEN_ERR_FAILURE=1]="RENEW_TOKEN_ERR_FAILURE",e[e.RENEW_TOKEN_ERR_INVALID_ARGUMENT=2]="RENEW_TOKEN_ERR_INVALID_ARGUMENT",e[e.RENEW_TOKEN_ERR_REJECTED=3]="RENEW_TOKEN_ERR_REJECTED",e[e.RENEW_TOKEN_ERR_TOO_OFTEN=4]="RENEW_TOKEN_ERR_TOO_OFTEN",e[e.RENEW_TOKEN_ERR_TOKEN_EXPIRED=5]="RENEW_TOKEN_ERR_TOKEN_EXPIRED",e[e.RENEW_TOKEN_ERR_INVALID_TOKEN=6]="RENEW_TOKEN_ERR_INVALID_TOKEN",e[e.RENEW_TOKEN_ERR_USER_NOT_LOGGED_IN=102]="RENEW_TOKEN_ERR_USER_NOT_LOGGED_IN",e[e.RENEW_TOKEN_ERR_ABORTED_BY_LOGOUT=201]="RENEW_TOKEN_ERR_ABORTED_BY_LOGOUT"}(e.RenewTokenError||(e.RenewTokenError={}))}(r||(r={}))},function(e,t,n){"use strict";var r;n.d(t,"a",(function(){return r})),function(e){!function(e){e.BANNED_BY_SERVER="BANNED_BY_SERVER",e.INTERRUPTED="INTERRUPTED",e.LOGIN="LOGIN",e.LOGIN_FAILURE="LOGIN_FAILURE",e.LOGIN_SUCCESS="LOGIN_SUCCESS",e.LOGIN_TIMEOUT="LOGIN_TIMEOUT",e.LOGOUT="LOGOUT",e.REMOTE_LOGIN="REMOTE_LOGIN"}(e.ConnectionChangeReason||(e.ConnectionChangeReason={})),function(e){e.ABORTED="ABORTED",e.CONNECTED="CONNECTED",e.CONNECTING="CONNECTING",e.DISCONNECTED="DISCONNECTED",e.RECONNECTING="RECONNECTING"}(e.ConnectionState||(e.ConnectionState={})),function(e){e.INVITATION_EXPIRE="INVITATION_EXPIRE",e.NOT_LOGGEDIN="NOT_LOGGEDIN",e.PEER_NO_RESPONSE="PEER_NO_RESPONSE",e.PEER_OFFLINE="PEER_OFFLINE"}(e.LocalInvitationFailureReason||(e.LocalInvitationFailureReason={})),function(e){e.ACCEPTED_BY_REMOTE="ACCEPTED_BY_REMOTE",e.CANCELED="CANCELED",e.FAILURE="FAILURE",e.IDLE="IDLE",e.RECEIVED_BY_REMOTE="RECEIVED_BY_REMOTE",e.REFUSED_BY_REMOTE="REFUSED_BY_REMOTE",e.SENT_TO_REMOTE="SENT_TO_REMOTE"}(e.LocalInvitationState||(e.LocalInvitationState={})),function(e){e.RAW="RAW",e.TEXT="TEXT"}(e.MessageType||(e.MessageType={})),function(e){e.OFFLINE="OFFLINE",e.ONLINE="ONLINE",e.UNREACHABLE="UNREACHABLE"}(e.PeerOnlineState||(e.PeerOnlineState={})),function(e){e.ONLINE_STATUS="ONLINE_STATUS"}(e.PeerSubscriptionOption||(e.PeerSubscriptionOption={})),function(e){e.ACCEPT_FAILURE="ACCEPT_FAILURE",e.INVITATION_EXPIRE="INVITATION_EXPIRE",e.PEER_OFFLINE="PEER_OFFLINE"}(e.RemoteInvitationFailureReason||(e.RemoteInvitationFailureReason={})),function(e){e.ACCEPTED="ACCEPTED",e.ACCEPT_SENT_TO_LOCAL="ACCEPT_SENT_TO_LOCAL",e.CANCELED="CANCELED",e.FAILURE="FAILURE",e.INVITATION_RECEIVED="INVITATION_RECEIVED",e.REFUSED="REFUSED"}(e.RemoteInvitationState||(e.RemoteInvitationState={}))}(r||(r={}))},function(e,t,n){"use strict";n.r(t);var r=n(3);n.d(t,"ArRTM",(function(){return r.a}));var o=n(0);n.d(t,"RtmErrorCode",(function(){return o.a}));var i=n(4);for(var a in i)["ArRTM","RtmErrorCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return i[e]}))}(a);var s=n(1);n.d(t,"RtmStatusCode",(function(){return s.a}));var E=n(5);for(var a in E)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return E[e]}))}(a);var _=n(6);for(var a in _)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return _[e]}))}(a);var c=n(7);for(var a in c)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return c[e]}))}(a);var u=n(8);for(var a in u)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return u[e]}))}(a);var l=n(9);for(var a in l)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return l[e]}))}(a);var R=n(10);for(var a in R)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return R[e]}))}(a);var N=n(11);for(var a in N)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return N[e]}))}(a);var d=n(12);for(var a in d)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return d[e]}))}(a);var f=n(13);for(var a in f)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return f[e]}))}(a);var I=n(14);for(var a in I)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return I[e]}))}(a);var O=n(15);for(var a in O)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return O[e]}))}(a);var T=n(16);for(var a in T)["ArRTM","RtmErrorCode","RtmStatusCode","default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return T[e]}))}(a);t.default=r.a},function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r,o={VERSION:n(17).version,GATEWAY_ADDRESS:"https://rtmgw.agrtc.cn",GATEWAY_CONNECT_TIMEOUT:6e3,GATEWAY_RETRY_TIMEOUT:12e5},i=function(){function e(e){if(this._url="",this._wss=!0,this._port=443,this._timeout=6e4,"[object Object]"===Object.prototype.toString.call(e)){var t=e.url,n=e.wss,r=e.port,o=e.timeout;"string"==typeof t&&(this._url=t),"boolean"==typeof n&&(this._wss=n,this._port=n?443:80),"number"==typeof r&&(this._port=r),"number"==typeof o&&(this._timeout=o)}}return e.prototype.setRequestUrl=function(e){if("[object Object]"===Object.prototype.toString.call(e)){var t=e.url,n=e.wss,r=e.port;"string"==typeof t&&(this._url=t),"boolean"==typeof n&&(this._wss=n,this._port=n?443:80),"number"==typeof r&&(this._port=r)}},e.prototype.request=function(e,t,n){return this._sendUrlRequest(e,t,n)},e.prototype.post=function(e,t){return this.request(e,"POST",t)},e.prototype.get=function(e,t){return this.request(e,"GET",t)},e.prototype._sendUrlRequest=function(e,t,n,r){var o=this;return void 0===r&&(r=!0),new Promise((function(i,a){if(""!==o._url){var s=o._url;e&&(s=o._url+e);try{wx.getSystemInfo(),wx.request({url:s,timeout:o._timeout,method:t,header:{"content-type":"application/json"},data:n,complete:function(e){var t=e.statusCode;i(200===t?e.data:{code:-1,msg:e.errMsg})}})}catch(e){var E=new XMLHttpRequest,_=function(){200===E.status?i(JSON.parse(E.responseText)):a("NETWORK_RESPONSE_ERROR")};r&&(E.onreadystatechange=function(){4===E.readyState&&_()}),E.open(t,s,r),E.onerror=function(e){a("NETWORK_ERROR")},E.ontimeout=function(){a("NETWORK_TIMEOUT")},E.send(JSON.stringify(n)),r||_()}}else a("NO_REQUEST_URL")}))},e}(),a={generateLowCaseString:function(e){var t=e;void 0===t&&(t=7);var n=Math.random().toString(16).substr(2,t).toLowerCase();return n.length===t?n:n+this.generateLowCaseString(t-n.length)},generateUpperCaseString:function(e){return this.generateLowCaseString(e||32).toUpperCase()},getByteLength:function(e){for(var t=0,n=0;n<e.length;n++)e.charCodeAt(n)>255?t+=2:t++;return t}},s=function(e,t){var n="YYYY-MM-DD hh:mm:ss";if("number"!=typeof e)throw new Error("[timesToDate]: timestamp must be number");t&&"string"==typeof t&&(n=t);var r=e||Date.now(),o=new Date(r)||new Date(r),i=o.getFullYear(),a=o.getMonth()+1,s=o.getDate(),E=o.getHours(),_=o.getMinutes(),c=o.getSeconds();return n.indexOf("YYYY")>-1&&(n=n.replace("YYYY",(function(){return""+i}))),n.indexOf("MM")>-1?n=n.replace("MM",(function(){return a<10?"0"+a:""+a})):n.indexOf("M")>-1&&(n=n.replace("M",(function(){return""+a}))),n.indexOf("DD")>-1?n=n.replace("DD",(function(){return s<10?"0"+s:""+s})):n.indexOf("D")>-1&&(n=n.replace("D",(function(){return""+s}))),n.indexOf("hh")>-1?n=n.replace("hh",(function(){return E<10?"0"+E:""+E})):n.indexOf("h")>-1&&(n=n.replace("h",(function(){return""+E}))),n.indexOf("mm")>-1?n=n.replace("mm",(function(){return _<10?"0"+_:""+_})):n.indexOf("m")>-1&&(n=n.replace("m",(function(){return""+_}))),n.indexOf("ss")>-1?n=n.replace("ss",(function(){return c<10?"0"+c:""+c})):n.indexOf("s")>-1&&(n=n.replace("s",(function(){return""+c}))),n};!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE"}(r||(r={}));var E=new(function(){function e(){this.logPrefix="SupLogger",this.logLevel=r.NONE,this.uploadServeTranslators=[],this.DEBUG=r.DEBUG,this.INFO=r.INFO,this.WARNING=r.WARNING,this.ERROR=r.ERROR,this.NONE=r.NONE}return e.prototype.use=function(e){"function"==typeof e&&this.uploadServeTranslators.push((function(t,n){e(t,n)}))},e.prototype.setLogLevel=function(e,t){t&&(this.logPrefix=t),"number"==typeof e&&e>-1&&e<5&&(this.logLevel=e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>r.ERROR&&this.logLevel!==r.NONE||this.logLevel===r.NONE)){var n=e,o=Date.now();n.unshift("["+s(o,"hh:mm:ss:ms")+"] %c"+this.logPrefix+" [ERROR]:%c","color: #b00020; font-weight: bold;","color: #dc3545;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"error",params:n,timestamp:o},(function(){console.error.apply(console,n)}))})):console.error.apply(console,n)}},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>r.WARNING&&this.logLevel!==r.NONE||this.logLevel===r.NONE)){var n=e,o=Date.now();n.unshift("["+s(o,"hh:mm:ss:ms")+"] %c"+this.logPrefix+" [WARNING]:","color: #ffc107; font-weight: bold;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"warning",params:n,timestamp:o},(function(){console.warn.apply(console,n)}))})):console.warn.apply(console,n)}},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>r.INFO&&this.logLevel!==r.NONE||this.logLevel===r.NONE)){var n=e,o=Date.now();n.unshift("["+s(o,"hh:mm:ss:ms")+"] %c"+this.logPrefix+" [INFO]:","color: #007bff; font-weight: bold;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"info",params:n,timestamp:o},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>r.DEBUG&&this.logLevel!==r.NONE||this.logLevel===r.NONE)){var n=e,o=Date.now();n.unshift("["+s(o,"hh:mm:ss.ms")+"] %c"+this.logPrefix+" [DEBUG]:","color:#6facff;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"debug",params:n,timestamp:o},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e}());E.setLogLevel(E.DEBUG,"anyRTM-SDK");var _,c=E,u=function(){return(u=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},l=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{E(r.next(e))}catch(e){i(e)}}function s(e){try{E(r.throw(e))}catch(e){i(e)}}function E(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}E((r=r.apply(e,t||[])).next())}))},R=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e.INVALID_PARAMS="INVALID_PARAMS",e.DEVELOPER_INVALID="DEVELOPER_INVALID",e.UID_BANNED="UID_BANNED",e.IP_BANNED="IP_BANNED",e.CHANNEL_BANNED="CHANNEL_BANNED",e.APPID_INVALID="APPID_INVALID",e.SERVER_NOT_OPEN="SERVER_NOT_OPEN",e.TOKEN_EXPIRED="TOKEN_EXPIRED",e.TOKEN_INVALID="TOKEN_INVALID",e.UNKNOWN="UNKNOWN",e.TIMEOUT="TIMEOUT"}(_||(_={}));var N,d,f,I=function(){function e(){this._urls=[],this._urlSuffix="/arapi/v1?action=",this._appid="",this._sessionId="",this.msgSuffix="/arapi/v1/artmgw/",this._urls=[o.GATEWAY_ADDRESS],this._urlSuffix="/arapi/v1?action="}return e.prototype.joinGateway=function(e){var t=this;void 0===e&&(e={});var n=this;return new Promise((function(r,a){var s=n._urlSuffix.concat("wrtm_gateway"),E=function(){return l(t,void 0,void 0,(function(){var t,l,N,d,f,I;return R(this,(function(R){switch(R.label){case 0:return R.trys.push([0,2,,3]),[4,Promise.race(this._urls.map((function(t){return new i({url:t,timeout:o.GATEWAY_CONNECT_TIMEOUT}).post(s,u({},e))})))];case 1:return(t=R.sent())&&(l=t.code,t.msg,0===l?(N=t.sessionid,d=e.appid,n._sessionId=N,n._appid=d,r(t)):-1===l||1===l?setTimeout((function(){E()}),o.GATEWAY_CONNECT_TIMEOUT):a(-4===l||-7===l?_.INVALID_PARAMS:13===l?_.DEVELOPER_INVALID:14===l?_.UID_BANNED:15===l?_.IP_BANNED:16===l?_.CHANNEL_BANNED:101===l?_.APPID_INVALID:102===l?_.SERVER_NOT_OPEN:109===l?_.TOKEN_EXPIRED:110===l?_.TOKEN_INVALID:"Error Code "+l+".")),[3,3];case 2:return f=R.sent(),"NETWORK_ERROR"===(I=f)||"NETWORK_TIMEOUT"===I||"NETWORK_RESPONSE_ERROR"===I?(c.warning("reconnect gateway server, reason: "+I),setTimeout((function(){E()}),o.GATEWAY_CONNECT_TIMEOUT),[2]):(c.debug("XMLHttpRequest abort error ",I),a(_.UNKNOWN),[3,3]);case 3:return[2]}}))}))};E()}))},e.prototype.getChanHistoryMsg=function(e){return l(this,void 0,void 0,(function(){var t,n=this;return R(this,(function(r){return t=this,[2,new Promise((function(r,a){return l(n,void 0,void 0,(function(){var n,a;return R(this,(function(s){switch(s.label){case 0:return n=t.msgSuffix.concat("getChanHistoryMsg"),[4,new i({url:o.GATEWAY_ADDRESS,timeout:o.GATEWAY_CONNECT_TIMEOUT}).post(n,u(u({},e),{sessId:t._sessionId,appId:t._appid})).then((function(e){return e}))];case 1:return a=s.sent(),r(a),[2]}}))}))}))]}))}))},e.prototype.getOfflineMsg=function(e){return l(this,void 0,void 0,(function(){var t,n=this;return R(this,(function(r){return t=this,[2,new Promise((function(r,a){return l(n,void 0,void 0,(function(){var n,a;return R(this,(function(s){switch(s.label){case 0:return n=t.msgSuffix.concat("getOfflineMsg"),[4,new i({url:o.GATEWAY_ADDRESS,timeout:o.GATEWAY_CONNECT_TIMEOUT}).post(n,u(u({},e),{sessId:t._sessionId,appId:t._appid})).then((function(e){return e}))];case 1:return a=s.sent(),r(a),[2]}}))}))}))]}))}))},e.prototype.getP2PHistoryMsg=function(e){var t=this,n=this;return new Promise((function(r,a){return l(t,void 0,void 0,(function(){var t,a;return R(this,(function(s){switch(s.label){case 0:return t=n.msgSuffix.concat("getP2PHistoryMsg"),[4,new i({url:o.GATEWAY_ADDRESS,timeout:o.GATEWAY_CONNECT_TIMEOUT}).post(t,u(u({},e),{sessId:n._sessionId,appId:n._appid})).then((function(e){return e}))];case 1:return a=s.sent(),r(a),[2]}}))}))}))},e}(),O=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},T=Array.prototype,h=function(){function e(){this._events={},this.addListener=this.on}return e.prototype.getListeners=function(e){return this._events[e]?T.map.call(this._events[e],(function(e){return e.listener})):[]},e.prototype.on=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!1})},e.prototype.once=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!0})},e.prototype.off=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e],r=this._indexOfListener(n,t);-1!==r&&T.splice.call(n,r,1)},e.prototype.removeAllListeners=function(e){e?delete this._events[e]:this._events={}},e.prototype.emit=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];this._events[e]||(this._events[e]=[]);var i=this._events[e];try{for(var a=O(i),s=a.next();!s.done;s=a.next()){var E=s.value;E.once&&this.off(e,E.listener),E.listener.apply(this,r||[])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},e.prototype._indexOfListener=function(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1},e}(),p=(N=function(e,t){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}N(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),v=function(e){function t(t){var n=e.call(this)||this;if(n._websocket=null,n._url="",n._wss=!0,n._port=443,n._listenCallback=[],n.onclose=function(){},n.onerror=function(){},n.onmessage=function(){},t&&"[object Object]"===Object.prototype.toString.call(t)){var r=t.url,o=t.wss,i=t.port;r&&(n._url=r),"boolean"==typeof o&&(n._wss=o),i&&(n._port=i)}return n}return p(t,e),Object.defineProperty(t.prototype,"connectState",{get:function(){return this._websocket?this._websocket.readyState:WebSocket.CLOSED},enumerable:!1,configurable:!0}),t.prototype.open=function(e){var t=this;return new Promise((function(n,r){if(t._websocket&&c.error("ERROR: SignalingChannel has already opened."),e&&"[object Object]"===Object.prototype.toString.call(e)){var o=e.url,i=e.wss,a=e.port;o&&(t._url=o),"boolean"==typeof i&&(t._wss=i),a&&(t._port=a)}var s=(t._wss?"wss":"ws")+"://"+t._url+":"+t._port;c.debug("SignalingChannel start connect, url "+s+".");var E=function(){c.debug("Signaling channel opened."),t._websocket.onerror=function(e){c.debug("Signaling channel error."),t.onerror(e)},t._websocket.onclose=function(e){c.debug("Channel closed with code: "+e.code+" reason: "+e.reason),t._websocket=null,t.onclose(e)},n()},_=function(e){t._listenCallback.forEach((function(t){t(e)})),t.onmessage(e)},u=function(e){r(Error("WebSocket error."))};try{wx.getSystemInfo(),t._websocket=wx.connectSocket({url:s,complete:function(){}}),t._websocket.onOpen(E),t._websocket.onMessage(_),t._websocket.onError(u)}catch(e){t._websocket=new WebSocket(s),t._websocket.onopen=E,t._websocket.onmessage=_,t._websocket.onerror=u}}))},t.prototype.close=function(){this._websocket&&(this._websocket.close(),this._websocket=null)},t.prototype.send=function(e){if("object"!=typeof e)return c.error("signal channel msg must be object."),!1;if(this._websocket)try{return wx.getSystemInfo(),this._websocket.send({data:JSON.stringify(e)})}catch(t){1===this._websocket.readyState&&this._websocket.send(JSON.stringify(e))}},t.prototype.addMessageEventListener=function(e,t){this._websocket&&this._listenCallback.push(e)},t.prototype.removeMessageEventListener=function(e,t){if(this._websocket)for(var n=this._listenCallback.length-1;n>-1;n--)this._listenCallback[n]===e&&this._listenCallback.splice(n,1)},t.prototype.clear=function(){this.close(),this.onerror=function(){},this.onclose=function(){},this.onmessage=function(){},this.addMessageEventListener=function(){},this.removeMessageEventListener=function(){}},t}(h),A=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},C=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(S(arguments[t]));return e},L=function(e){function t(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=e.apply(this,C(n))||this;o.name="RTMException",o.code=t;var i="Error Code "+t+" - ";return o.message=n[0]?i.concat(n[0]):i,o.data=n[1]?n[1]:{},o}return A(t,e),t}(Error),y=function(e){function t(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=e.apply(this,C([t],n))||this;return o.name="RtmInvalidArgumentError",o}return A(t,e),t}(L),m=(function(e){function t(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=e.apply(this,C([t],n))||this;return o.name="RtmUnauthenticatedError",o}A(t,e)}(L),n(2)),g=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),b=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{E(r.next(e))}catch(e){i(e)}}function s(e){try{E(r.throw(e))}catch(e){i(e)}}function E(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}E((r=r.apply(e,t||[])).next())}))},U=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(e){function t(t){var n=e.call(this)||this;n._cmdEncrypt=!1,n._appId="",n._serverIsWss=!0,n._serverUrl="",n._serverPort=0,n._userId=null,n._connectTimeout=0,n._keepAliveTimeout=0,n._keepALiveInterval=0,n._keepALiveIntervalTime=1e4,n._revState="DISCONNECTED",n._curState="DISCONNECTED",n.handleMediaServerEvents=function(){};var r=n;return t&&t.appId&&(r._appId=t.appId),n}return g(t,e),t.prototype.init=function(e){var t=e.appId,n=e.isWss,r=e.url,o=e.port;this._appId=t,"boolean"==typeof n&&(this._serverIsWss=n),r&&(this._serverUrl=r),o&&(this._serverPort=o)},t.prototype.setAppInfo=function(e){var t=e.appId;this._appId=t},t.prototype.configServer=function(e,t,n){this._serverIsWss=e,this._serverUrl=t,this._serverPort=n},t.prototype.connectServer=function(){var e=this,t=this;return new Promise((function(n,r){return b(e,void 0,void 0,(function(){var e,o;return U(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t._emitConnectionState("CONNECTING"),t._setConnectTimeout(),[4,t.open({url:t._serverUrl,wss:t._serverIsWss,port:t._serverPort})];case 1:return i.sent(),e=(t._serverIsWss?"wss":"ws")+"://"+t._serverUrl+":"+t._serverPort,c.debug("[ws-client] websocket opened: "+e),t._clearConnectTimeout(),t._emitConnectionState("CONNECTED"),n(),t.onmessage=function(e){var n=e.data,r=JSON.parse(n),o=r.Cmd,i=(r.Encrypt,r.Content),a=JSON.parse(i);switch(o){case"KeepAlive":t._clearKeepALiveTimeout();break;case"Login":t._startKeepAlive();break;default:t.handleMediaServerEvents&&t.handleMediaServerEvents(o,a)}},t.onerror=function(e){c.error("WebSocket with some error ",e)},t.onclose=function(e){var n=e.code,r=e.reason;switch(c.info("serve disconnected...",n),t._clearConnectTimeout(),t._stopKeepAlive(),t._clearKeepALiveTimeout(),n){case 1e3:case 1005:t._emitConnectionState("DISCONNECTED","LEAVE");break;case 3001:t._emitConnectionState("RECONNECTING","NETWORK_ERROR");break;default:c.debug("media ws serve disconnected with code "+n+", reason "+r),"RECONNECTING"!==t._curState&&t._emitConnectionState("RECONNECTING","SERVER_ERROR")}t.clear()},[3,3];case 2:return o=i.sent(),t._clearConnectTimeout(),r(o),[3,3];case 3:return[2]}}))}))}))},t.prototype.doKeepAlive=function(){var e=this,t={Cmd:"KeepAlive"};t.Encrypt=this._cmdEncrypt,t.Content=JSON.stringify({time:Date.now().toString()}),this.send(t),!e._keepAliveTimeout&&(e._keepAliveTimeout=setTimeout((function(){e._stopKeepAlive(),e._clearKeepALiveTimeout(),e.clear(),e._emitConnectionState("RECONNECTING","KEEP_A_LIVE_TIME_OUT")}),2*e._keepALiveIntervalTime))},t.prototype.doOnline=function(e){var t=this;return new Promise((function(n,r){var o=function(e){var i=e.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("Login"===s){t.removeMessageEventListener(o);var u=_.Code;if(0===u){var l=_.UserId;t._userId=l,n(l)}else c.error("user online failure, code => ",u),r(new L(m.RtmErrorCode.LoginError.LOGIN_ERR_UNKNOWN,"Error Code "+u))}};t.addMessageEventListener(o);var i={Cmd:"Login"};i.AppId=t._appId,i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({},e)),t.send(i)}))},t.prototype.doOffline=function(){var e=this;return new Promise((function(t,n){var r=function(o){var i=o.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("Logout"===s){e.removeMessageEventListener(r);var c=_.Code;0===c?t(c):n(c)}};e.addMessageEventListener(r);var o={Cmd:"Logout"};o.Encrypt=e._cmdEncrypt,o.Content="",e.send(o)}))},t.prototype.doQueryOnlineStatus=function(e){var t=this;return new Promise((function(n,r){var o=function(e){var r=e.data,i=JSON.parse(r),a=i.Cmd,s=(i.Encrypt,i.Content),E=JSON.parse(s);if("QueryOnlineStatus"===a){t.removeMessageEventListener(o);var _=E.Status;n(_)}};t.addMessageEventListener(o);var i={Cmd:"QueryOnlineStatus"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify({MsgId:Date.now(),UserIds:JSON.stringify(e)}),t.send(i)}))},t.prototype.doQueryOnlineSubStatus=function(){var e=this;return new Promise((function(t,n){var r=function(n){var o=n.data,i=JSON.parse(o),a=i.Cmd,s=(i.Encrypt,i.Content),E=JSON.parse(s);if("QueryOnlineSubStatus"===a){e.removeMessageEventListener(r);var _=E.Status;t(_)}};e.addMessageEventListener(r);var o={Cmd:"QueryOnlineSubStatus"};o.Encrypt=e._cmdEncrypt,o.Content=JSON.stringify({MsgId:Date.now()}),e.send(o)}))},t.prototype.doSubscribeOnlineStatus=function(e){var t={Cmd:"SubscribeOnlineStatus"};t.Encrypt=this._cmdEncrypt,t.Content=JSON.stringify({MsgId:Date.now(),UserIds:JSON.stringify(e)}),this.send(t)},t.prototype.doUnSubscribeOnlineStatus=function(e){var t={Cmd:"UnSubscribeOnlineStatus"};t.Encrypt=this._cmdEncrypt,t.Content=JSON.stringify({MsgId:Date.now(),UserIds:JSON.stringify(e)}),this.send(t)},t.prototype.doSendMsgToPeer=function(e,t,n,r,o){void 0===r&&(r=!1),void 0===o&&(o=!1);var i=this;return new Promise((function(a,s){if(i._websocket&&1===i._websocket.readyState){var E=Date.now(),_=function(e){var t=e.data,n=JSON.parse(t),r=n.Cmd,o=(n.Encrypt,n.Content),s=JSON.parse(o),c=0;if("MsgStatus"===r){var u=s.MsgId,l=s.Status;u===E&&(0===l?(i.removeMessageEventListener(_),a(!1)):1===l?c=setTimeout((function(){i.removeMessageEventListener(_),c&&clearTimeout(c),a(!1)}),1e4):2===l&&(i.removeMessageEventListener(_),c&&clearTimeout(c),a(!0)))}};i.addMessageEventListener(_);var c={Cmd:"SendMsgToPeer"};c.Encrypt=i._cmdEncrypt,c.Content=JSON.stringify(Object.assign({MsgId:E,FromUId:i._userId,ToUId:t,MsgType:e,MsgBody:n,OfflineMsg:r,HistoryMsg:o,Desc:""})),i.send(c)}else s()}))},t.prototype.doRecvMsgFromPeerAck=function(e,t){if(!this._websocket||1!==this._websocket.readyState)return!1;var n={Cmd:"RecvMsgFromPeerAck"};n.Encrypt=this._cmdEncrypt,n.Content=JSON.stringify(Object.assign({MsgId:e,FromUId:t})),this.send(n)},t.prototype.doAddOrUpdateUserAttributes=function(e,t){void 0===t&&(t=!1);var n=this;return new Promise((function(r,o){var i=function(e){var t=e.data,a=JSON.parse(t),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("AddOrUpdateUserAttributes"===s){n.removeMessageEventListener(i);var c=_.Code;_.MsgId;0===c?r(!0):o(c)}};n.addMessageEventListener(i);var a={Cmd:"AddOrUpdateUserAttributes"};a.Encrypt=n._cmdEncrypt,a.Content=JSON.stringify(Object.assign({MsgId:Date.now(),SetLocal:t,Attributes:JSON.stringify(e)})),n.send(a)}))},t.prototype.doDeleteUserAttributes=function(e){var t=this;return new Promise((function(n,r){var o=function(e){var i=e.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("DeleteUserAttributes"===s){t.removeMessageEventListener(o);var c=_.Code;_.MsgId;0===c?n(!0):r(c)}};t.addMessageEventListener(o);var i={Cmd:"DeleteUserAttributes"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({MsgId:Date.now(),Keys:JSON.stringify(e)})),t.send(i)}))},t.prototype.doClearUserAttributes=function(){var e=this;return new Promise((function(t,n){var r=function(o){var i=o.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("ClearUserAttributes"===s){e.removeMessageEventListener(r);var c=_.Code;_.MsgId;0===c?t(!0):n(c)}};e.addMessageEventListener(r);var o={Cmd:"ClearUserAttributes"};o.Encrypt=e._cmdEncrypt,o.Content=JSON.stringify(Object.assign({MsgId:Date.now()})),e.send(o)}))},t.prototype.doGetUserAttributes=function(e){var t=this;return new Promise((function(n,r){var o=function(r){var i=r.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("QueryAttribKeys"===s){var c=_.QueryUserId,u=(_.MsgId,_.Attribs);c===e&&(t.removeMessageEventListener(o),n(JSON.parse(""!==u?u:[])))}};t.addMessageEventListener(o);var i={Cmd:"GetUserAttributes"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({MsgId:Date.now(),UserId:e})),t.send(i)}))},t.prototype.doGetUserAttributesByKeys=function(e,t){var n=this;return new Promise((function(r,o){var i=function(t){var o=t.data,a=JSON.parse(o),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("QueryAttribKeys"===s){var c=_.QueryUserId,u=(_.MsgId,_.Attribs);c===e&&(n.removeMessageEventListener(i),r(JSON.parse(u)))}};n.addMessageEventListener(i);var a={Cmd:"GetUserAttributes"};a.Encrypt=n._cmdEncrypt,a.Content=JSON.stringify(Object.assign({MsgId:Date.now(),UserId:e,Keys:t})),n.send(a)}))},t.prototype.doJoinChannel=function(e){var t=this;return new Promise((function(n,r){var o=function(e){var i=e.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("JoinChannel"===s){t.removeMessageEventListener(o);var c=_.Code;_.ChanId;0===c?n():r(c)}};t.addMessageEventListener(o);var i={Cmd:"JoinChannel"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({ChanId:e})),t.send(i)}))},t.prototype.doSendChannelMsg=function(e,t,n,r){void 0===r&&(r=!1);var o=this;return new Promise((function(i,a){var s=Date.now(),E=function(e){var t=e.data,n=JSON.parse(t),r=n.Cmd,_=(n.Encrypt,n.Content),c=JSON.parse(_);if("SendChannelMsg"===r){var u=c.Code,l=(c.ChanId,c.MsgId);s===l&&(o.removeMessageEventListener(E),0===u?i():a(u))}};o.addMessageEventListener(E);var _={Cmd:"SendChannelMsg"};_.Encrypt=o._cmdEncrypt,_.Content=JSON.stringify(Object.assign({ChanId:t,FromUId:o._userId,MsgId:s,MsgType:e,MsgBody:n,HistoryMsg:r,Desc:""})),o.send(_)}))},t.prototype.doLeaveChannel=function(e){var t=this;return new Promise((function(n,r){var o=function(e){var i=e.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("LeaveChannel"===s){t.removeMessageEventListener(o);var c=_.Code;_.ChanId;0===c?n():r(c)}};t.addMessageEventListener(o);var i={Cmd:"LeaveChannel"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({ChanId:e})),t.send(i)}))},t.prototype.doAddOrUpdateChanAttributes=function(e){var t=this,n=e.channelId,r=e.attributes,o=e.notify,i=void 0!==o&&o,a=e.isSet,s=void 0!==a&&a;return new Promise((function(e,o){var a=function(n){var r=n.data,i=JSON.parse(r),s=i.Cmd,E=(i.Encrypt,i.Content),_=JSON.parse(E);if("AddOrUpdateChanAttributes"===s){t.removeMessageEventListener(a);var c=_.Code;_.ChanId;0===c?e():o(c)}};t.addMessageEventListener(a);var E={Cmd:"AddOrUpdateChanAttributes"};E.Encrypt=t._cmdEncrypt,E.Content=JSON.stringify(Object.assign({MsgId:Date.now(),SetChan:s,ChanId:n,Attributes:JSON.stringify(r),Notify:i})),t.send(E)}))},t.prototype.doDeleteChanAttributes=function(e){var t=this,n=e.channelId,r=e.attributeKeys,o=e.notify;return new Promise((function(e,i){var a=function(n){var r=n.data,o=JSON.parse(r),s=o.Cmd,E=(o.Encrypt,o.Content),_=JSON.parse(E);if("DeleteChanAttributes"===s){t.removeMessageEventListener(a);var c=_.Code;_.ChanId;0===c?e():i(c)}};t.addMessageEventListener(a);var s={Cmd:"DeleteChanAttributes"};s.Encrypt=t._cmdEncrypt,s.Content=JSON.stringify(Object.assign({MsgId:Date.now(),ChanId:n,Keys:JSON.stringify(r),Notify:o})),t.send(s)}))},t.prototype.doGetChanAttributes=function(e){var t=this;return new Promise((function(n,r){var o=function(i){var a=i.data,s=JSON.parse(a),E=s.Cmd,_=(s.Encrypt,s.Content),c=JSON.parse(_);if("GetChanAttributes"===E){var u=c.Code,l=c.ChanId,R=c.Attributes;e===l&&(t.removeMessageEventListener(o),0===u?n(JSON.parse(""===R?"[]":R)):r(u))}};t.addMessageEventListener(o);var i={Cmd:"GetChanAttributes"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({MsgId:Date.now(),ChanId:e})),t.send(i)}))},t.prototype.doGetChanAttributesByKeys=function(e,t){var n=this;return new Promise((function(r,o){var i=function(t){var a=t.data,s=JSON.parse(a),E=s.Cmd,_=(s.Encrypt,s.Content),c=JSON.parse(_);if("GetChanAttributesByKeys"===E){var u=c.Code,l=c.ChanId,R=c.Attributes;e===l&&(n.removeMessageEventListener(i),0===u?r(""!==R?JSON.parse(R):[]):o(u))}};n.addMessageEventListener(i);var a={Cmd:"GetChanAttributesByKeys"};a.Encrypt=n._cmdEncrypt,a.Content=JSON.stringify(Object.assign({MsgId:Date.now(),ChanId:e,Keys:JSON.stringify(t)})),n.send(a)}))},t.prototype.doClearChanAttributes=function(e){var t=this,n=e.channelId,r=e.notify;return new Promise((function(e,o){var i=function(n){var r=n.data,a=JSON.parse(r),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("ClearChanAttributes"===s){t.removeMessageEventListener(i);var c=_.Code;_.MsgId;0===c?e(!0):o(c)}};t.addMessageEventListener(i);var a={Cmd:"ClearChanAttributes"};a.Encrypt=t._cmdEncrypt,a.Content=JSON.stringify(Object.assign({MsgId:Date.now(),ChanId:n,Notify:r})),t.send(a)}))},t.prototype.doGetChanMemberSize=function(e){var t=this;return new Promise((function(n,r){var o=function(e){var i=e.data,a=JSON.parse(i),s=a.Cmd,E=(a.Encrypt,a.Content),_=JSON.parse(E);if("GetChanMemberSize"===s){t.removeMessageEventListener(o);var c=_.Code,u=_.ChanMemSize;_.MsgId;0===c?n(u):r(c)}};t.addMessageEventListener(o);var i={Cmd:"GetChanMemberSize"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({MsgId:Date.now(),ChanIds:JSON.stringify(e)})),t.send(i)}))},t.prototype.doGetChanMembers=function(e){var t=this;return new Promise((function(n,r){var o=function(i){var a=i.data,s=JSON.parse(a),E=s.Cmd,_=(s.Encrypt,s.Content),c=JSON.parse(_);if("GetChanMembers"===E){var u=c.Code,l=c.Members,R=c.ChanId;c.MsgId;e===R&&(t.removeMessageEventListener(o),0===u?n(l):r(u))}};t.addMessageEventListener(o);var i={Cmd:"GetChanMembers"};i.Encrypt=t._cmdEncrypt,i.Content=JSON.stringify(Object.assign({MsgId:Date.now(),ChanId:e})),t.send(i)}))},t.prototype.doMakeCall=function(e,t,n){var r={Cmd:"MakeCall"};r.Encrypt=this._cmdEncrypt,r.Content=JSON.stringify(Object.assign({CallId:e,FromUId:this._userId,ToUId:t,Content:n})),this.send(r)},t.prototype.doCancelCall=function(e,t,n){var r={Cmd:"CancelCall"};r.Encrypt=this._cmdEncrypt,r.Content=JSON.stringify(Object.assign({CallId:e,FromUId:this._userId,ToUId:t,Content:n})),this.send(r)},t.prototype.doAcceptCall=function(e,t,n){var r={Cmd:"AcceptCall"};r.Encrypt=this._cmdEncrypt,r.Content=JSON.stringify(Object.assign({CallId:e,FromUId:this._userId,ToUId:t,Response:n})),this.send(r)},t.prototype.doRefuseCall=function(e,t,n){var r={Cmd:"RejectCall"};r.Encrypt=this._cmdEncrypt,r.Content=JSON.stringify(Object.assign({CallId:e,FromUId:this._userId,ToUId:t,Response:n})),this.send(r)},t.prototype.doReNewToken=function(e){var t={Cmd:"RenewAcsToken"};t.Content=JSON.stringify({AcsToken:e}),this.send(t)},t.prototype.disconnectServer=function(e){if(this._stopKeepAlive(),this._clearKeepALiveTimeout(),this.clear(),e)switch(e){case"UID_BANNED":this._emitConnectionState("DISCONNECTED","UID_BANNED");break;case"TOKEN_INVALID":this._emitConnectionState("DISCONNECTED","TOKEN_INVALID")}else this._emitConnectionState("DISCONNECTED","LEAVE")},t.prototype.clearEventEmitter=function(){this.removeAllListeners()},t.prototype._setConnectTimeout=function(){var e=this;e._clearConnectTimeout(),e._connectTimeout=setTimeout((function(){e._emitConnectionState("DISCONNECTING","NETWORK_ERROR")}),1e4)},t.prototype._startKeepAlive=function(){var e=this;e._stopKeepAlive(),e.doKeepAlive(),e._keepALiveInterval=setInterval((function(){e.doKeepAlive()}),e._keepALiveIntervalTime)},t.prototype._stopKeepAlive=function(){this._keepALiveInterval&&clearInterval(this._keepALiveInterval)},t.prototype._clearConnectTimeout=function(){this._connectTimeout&&clearTimeout(this._connectTimeout)},t.prototype._clearKeepALiveTimeout=function(){this._keepAliveTimeout&&(clearTimeout(this._keepAliveTimeout),this._keepAliveTimeout=0)},t.prototype._emitConnectionState=function(e,t){"DISCONNECTED"===e&&c.debug("[signal] media websocket closed, reason: "+t),this._revState=this._curState,this._curState=e,this.handleMediaServerEvents&&this.handleMediaServerEvents("connection-state-change",{curState:this._curState,revState:this._revState,reason:t})},t}(v),w=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},D=Array.prototype,G=function(){function e(){this._events={},this.addListener=this.on}return e.prototype.getListeners=function(e){return this._events[e]?D.map.call(this._events[e],(function(e){return e.listener})):[]},e.prototype.on=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!1})},e.prototype.once=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!0})},e.prototype.off=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e],r=this._indexOfListener(n,t);-1!==r&&D.splice.call(n,r,1)},e.prototype.removeAllListeners=function(e){e?delete this._events[e]:this._events={}},e.prototype.emit=function(e){for(var t,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];this._events[e]||(this._events[e]=[]);var i=this._events[e];try{for(var a=w(i),s=a.next();!s.done;s=a.next()){var E=s.value;E.once&&this.off(e,E.listener),E.listener.apply(this,r||[])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},e.prototype._indexOfListener=function(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1},e}(),P=n(1),B=n(0),F=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),V=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{E(r.next(e))}catch(e){i(e)}}function s(e){try{E(r.throw(e))}catch(e){i(e)}}function E(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}E((r=r.apply(e,t||[])).next())}))},J=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},k=function(e){function t(t,n){var r=e.call(this)||this;return r.memberCount=0,r.attributes={},r.channelId="",r.client=t,r.channelId=n,r.bindChannelEvents=r._handleChannelEvents.bind(r),r}return F(t,e),t.prototype.getMembers=function(){return V(this,void 0,void 0,(function(){var e,t;return J(this,(function(n){switch(n.label){case 0:return t=(e=this).client._rtmServer,""===this.client.uid?[3,2]:[4,t.doGetChanMembers(e.channelId)];case 1:return[2,n.sent()];case 2:throw new y(B.a.GetMembersError.GET_MEMBERS_ERR_USER_NOT_LOGGED_IN,"The client is not logged in. Cannot do the operation.")}}))}))},t.prototype.join=function(){return V(this,void 0,void 0,(function(){var e,t;return J(this,(function(n){switch(n.label){case 0:if(e=this,""===this.client.uid)throw new y(B.a.JoinChannelError.JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN,"The client is not logged in. Cannot do the operation.");return e.client.channels[e.channelId].joined?[3,3]:(t=e.client._rtmServer)?(t.addMessageEventListener(this.bindChannelEvents),[4,t.doJoinChannel(e.channelId)]):[3,2];case 1:return n.sent(),e.client.channels[e.channelId].joined=!0,e.client._gateway.getChanHistoryMsg({chanId:e.channelId}).then((function(t){var n=t.code,r=t.data;0===n&&r.map((function(t){var n=t.msgFrom,r=(t.msgStatus,t.msgType),o=t.msgBody,i={isHistoricalMessage:!0,isOfflineMessage:!1,serverReceivedTs:t.msgTs};if(1===r){var a={text:o};e.emit("ChannelMessage",a,n,i)}else if(2===r){a={rawMessage:Base64.toUint8Array(o)};e.emit("ChannelMessage",a,n,i)}}))})).catch(),[2];case 2:return[3,4];case 3:throw new L(B.a.JoinChannelError.JOIN_CHANNEL_ERR_ALREADY_JOINED,"The channel has joined. Cannot rejoin.");case 4:return[2]}}))}))},t.prototype.leave=function(){return V(this,void 0,void 0,(function(){var e,t,n;return J(this,(function(r){switch(r.label){case 0:if(e=this,""===this.client.uid)throw new y(B.a.JoinChannelError.JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN,"The client is not logged in. Cannot do the operation.");return(t=e.client.channels[e.channelId]).joined?(n=e.client._rtmServer)?[4,n.doLeaveChannel(e.channelId)]:[3,2]:[3,3];case 1:return r.sent(),t.joined=!1,n.removeMessageEventListener(e.bindChannelEvents),[2];case 2:return[3,4];case 3:throw new L(B.a.LeaveChannelError.LEAVE_CHANNEL_ERR_NOT_IN_CHANNEL,"The channel does not join. Cannot do the operation.");case 4:return[2]}}))}))},t.prototype.sendMessage=function(e,t){return V(this,void 0,void 0,(function(){var n,r,o,i;return J(this,(function(a){switch(a.label){case 0:if(n=this,""===this.client.uid)throw new y(B.a.ChannelMessageError.CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN,"The client is not logged in. Cannot do the operation.");return n.client.channels[n.channelId].joined?(r=(t||{enableHistoricalMessaging:!1}).enableHistoricalMessaging,(o=n.client._rtmServer)?(e.messageType,(i=e.text)?(P.a.MessageType.TEXT,[4,o.doSendChannelMsg(1,n.channelId,i,r)]):[3,2]):[3,3]):[3,4];case 1:return a.sent(),[2];case 2:throw new y(B.a.ChannelMessageError.CHANNEL_MESSAGE_ERR_INVALID_MESSAGE,"Message is not valid.");case 3:return[3,5];case 4:throw new L(B.a.ChannelMessageError.CHANNEL_MESSAGE_ERR_NOT_IN_CHANNEL,"The channel does not join. Cannot do the operation.");case 5:return[2]}}))}))},t.prototype._handleChannelEvents=function(e){var t=e.data,n=JSON.parse(t),r=n.Cmd,o=(n.Encrypt,n.Content),i=JSON.parse(o);if(i.ChanId===this.channelId)if("RecvMsgFromChan"===r){i.MsgId;var a=i.FromUId,s=i.MsgType,E=i.MsgBody,_={isHistoricalMessage:!1,isOfflineMessage:!1,serverReceivedTs:i.SvrTS};if(1===s){var c={text:E};this.emit("ChannelMessage",c,a,_)}else if(2===s){c={rawMessage:Base64.toUint8Array(E)};this.emit("ChannelMessage",c,a,_)}}else if("ChanMemberJoin"===r){var u=i.UserId;i.ChanMemSize;this.emit("MemberJoined",u)}else if("ChanMemberLeave"===r){u=i.UserId,i.ChanMemSize;this.emit("MemberLeft",u)}else if("MemSizeChanged"===r){var l=i.MemSize;this.emit("MemberCountUpdated",l)}else if("ChanAttribChanged"===r){var R=i.Attributes,N={};R.map((function(e){var t=e.Key,n=e.Val,r=e.UId,o=e.Time;N[t]={lastUpdateTs:o,lastUpdateUserId:r,value:n}})),this.emit("AttributesUpdated",N)}},t}(G),j=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),H=function(e){function t(t,n,r){var o=e.call(this)||this;return o._callId="",o.calleeId="",o.content="",o.state=P.a.LocalInvitationState.IDLE,o.response="",o.client=t,o._callId=n,o.calleeId=r,o}return j(t,e),t.prototype.cancel=function(){var e=this.client._rtmServer;if(e)if(this.state===P.a.LocalInvitationState.ACCEPTED_BY_REMOTE||this.state===P.a.LocalInvitationState.SENT_TO_REMOTE||this.state===P.a.LocalInvitationState.FAILURE||this.state===P.a.LocalInvitationState.RECEIVED_BY_REMOTE)e.doCancelCall(this._callId,this.calleeId),this.emit("LocalInvitationCanceled");else if(this.state===P.a.LocalInvitationState.IDLE)throw new L(B.a.InvitationApiCallError.INVITATION_API_CALL_ERR_NOT_STARTED,"The call invitation is not send yet.")},t.prototype.send=function(){if(this.state!==P.a.LocalInvitationState.IDLE){if(this.state===P.a.LocalInvitationState.SENT_TO_REMOTE)throw new L(B.a.InvitationApiCallError.INVITATION_API_CALL_ERR_ALREADY_SENT,"The call invitation already sent.");if(this.state===P.a.LocalInvitationState.ACCEPTED_BY_REMOTE||this.state===P.a.LocalInvitationState.REFUSED_BY_REMOTE)throw new L(B.a.InvitationApiCallError.INVITATION_API_CALL_ERR_ALREADY_END,"The call invitation already by accept.")}var e=this.client._rtmServer;e?e.doMakeCall(this._callId,this.calleeId,this.content):this.emit("LocalInvitationFailure",P.a.LocalInvitationFailureReason.NOT_LOGGEDIN)},t}(G),x=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y=function(e){function t(t,n,r){var o=e.call(this)||this;return o._callId="",o.callerId="",o.content="",o.response="",o._callId=t,o.callerId=n,o.content=r,o.state=P.a.RemoteInvitationState.INVITATION_RECEIVED,o}return x(t,e),t.prototype.accept=function(){var e=this.client._rtmServer;if(e)if(this.state===P.a.RemoteInvitationState.INVITATION_RECEIVED)e.doAcceptCall(this._callId,this.callerId,this.response),this.state=P.a.RemoteInvitationState.ACCEPT_SENT_TO_LOCAL;else{if(this.state===P.a.RemoteInvitationState.ACCEPTED)throw new L(B.a.InvitationApiCallError.INVITATION_API_CALL_ERR_ALREADY_ACCEPT,"The call invitation already by accept.");if(this.state===P.a.RemoteInvitationState.REFUSED)throw new L(B.a.InvitationApiCallError.INVITATION_API_CALL_ERR_ALREADY_END,"The call invitation already ended.")}},t.prototype.refuse=function(){var e=this.client._rtmServer;e&&this.state===P.a.RemoteInvitationState.INVITATION_RECEIVED&&(e.doRefuseCall(this._callId,this.callerId,this.response),this.state=P.a.RemoteInvitationState.REFUSED,this.emit("RemoteInvitationRefused"))},t}(G),K=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},W=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{E(r.next(e))}catch(e){i(e)}}function s(e){try{E(r.throw(e))}catch(e){i(e)}}function E(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}E((r=r.apply(e,t||[])).next())}))},z=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},X=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},$=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Z=function(e){function t(t,n){var r=e.call(this)||this;r._useWss=!0,r._userAttributes={},r._localCall={},r._remoteCall={},r._sessionId="",r._joinStartTime=0,r.uid="",r.token=null,r.channels={},r.channelAttributesCacheLru={},r._sid=a.generateLowCaseString(32),r._appId=t;var i=(n||{}).confPriCloudAddr;if(i){var s=i.ServerAdd,E=i.Port,_=i.Wss;r._useWss="boolean"!=typeof _||_,s&&(o.GATEWAY_ADDRESS=(r._useWss?"https://"+s:"http://"+s)+(E?":"+E:""))}return r}return W(t,e),t.prototype.addOrUpdateChannelAttributes=function(e,t,n){var r;return Q(this,void 0,void 0,(function(){var o,i,a;return z(this,(function(s){switch(s.label){case 0:if(o=this,i=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof e||!i.test(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributes in the arguments is invalid.");if("[object Object]"!==Object.prototype.toString.call(t)||"{}"===JSON.stringify(t))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributes in the arguments is invalid.");return Object.keys(t).forEach((function(e){if(null==e||""===e)throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"Invalid attribute key.")})),Object.values(t).map((function(e,t){if(null==e||""===e)throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"Invalid attribute key.")})),""===o.uid?[3,2]:(a=(n||{enableNotificationToChannelMembers:!1}).enableNotificationToChannelMembers,[4,null===(r=o._rtmServer)||void 0===r?void 0:r.doAddOrUpdateChanAttributes({channelId:e,attributes:t,notify:a})]);case 1:return s.sent(),o.channelAttributesCacheLru[e]=t,[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.addOrUpdateLocalUserAttributes=function(e){var t;return Q(this,void 0,void 0,(function(){var n;return z(this,(function(r){switch(r.label){case 0:if(n=this,"[object Object]"!==Object.prototype.toString.call(e)||"{}"===JSON.stringify(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributes in the arguments is invalid.");return Object.keys(e).forEach((function(e){if(null==e||""===e)throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"Invalid attribute value.")})),Object.values(e).map((function(e,t){if(null==e||""===e)throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"Invalid attribute key.")})),""===n.uid?[3,2]:[4,null===(t=n._rtmServer)||void 0===t?void 0:t.doAddOrUpdateUserAttributes(e)];case 1:return r.sent(),n._userAttributes=e,[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.clearChannelAttributes=function(e,t){var n;return Q(this,void 0,void 0,(function(){var r,o,i;return z(this,(function(a){switch(a.label){case 0:if(r=this,o=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof e||!o.test(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributes in the arguments is invalid.");return""===r.uid?[3,2]:(i=(t||{enableNotificationToChannelMembers:!1}).enableNotificationToChannelMembers,[4,null===(n=r._rtmServer)||void 0===n?void 0:n.doClearChanAttributes({channelId:e,notify:i})]);case 1:return a.sent(),r.channelAttributesCacheLru[e]&&delete r.channelAttributesCacheLru[e],[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.clearLocalUserAttributes=function(){var e;return Q(this,void 0,void 0,(function(){var t;return z(this,(function(n){switch(n.label){case 0:return""===(t=this).uid?[3,2]:[4,null===(e=t._rtmServer)||void 0===e?void 0:e.doClearUserAttributes()];case 1:return n.sent(),t._userAttributes={},[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.createChannel=function(e){if("string"!=typeof e||!/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/.test(e))throw new y(B.a.CreateChannelError.CREATE_CHANNEL_ERR_INVALID_ARGUMENT,"The channelId in the arguments is invalid.");var t=new k(this,e);return this.channels[e]={channel:t,joined:!1},t},t.prototype.createLocalInvitation=function(e){if("string"!=typeof e)throw new y(B.a.InvitationApiCallError.INVITATION_API_CALL_ERR_INVALID_ARGUMENT,"The calleeId in the arguments is invalid.");var t=a.generateLowCaseString(32),n=new H(this,t,e);return this._localCall[t]=n,n},t.prototype.deleteChannelAttributesByKeys=function(e,t,n){var r;return Q(this,void 0,void 0,(function(){var o,i,a,s;return z(this,(function(E){switch(E.label){case 0:if(""===(o=this).uid)return[3,2];if(i=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof e||!i.test(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The channelId in the arguments is invalid.");if(!(t instanceof Array))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributeKeys in the arguments is not valid.");return a=(n||{enableNotificationToChannelMembers:!1}).enableNotificationToChannelMembers,[4,null===(r=o._rtmServer)||void 0===r?void 0:r.doDeleteChanAttributes({channelId:e,attributeKeys:t,notify:a})];case 1:return E.sent(),o.channelAttributesCacheLru[e]&&(s=o.channelAttributesCacheLru[e],Object.keys(s).map((function(e){s.hasOwnProperty(e)&&delete s[e]}))),[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.deleteLocalUserAttributesByKeys=function(e){var t;return Q(this,void 0,void 0,(function(){var n;return z(this,(function(r){switch(r.label){case 0:if(n=this,!(e instanceof Array))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributeKeys in the arguments is not valid.");return""===n.uid?[3,2]:[4,null===(t=n._rtmServer)||void 0===t?void 0:t.doDeleteUserAttributes(e)];case 1:return r.sent(),e.map((function(e){n._userAttributes.hasOwnProperty(e)&&delete n._userAttributes[e]})),[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.getChannelAttributes=function(e){var t;return Q(this,void 0,void 0,(function(){var n,r,o,i,a;return z(this,(function(s){switch(s.label){case 0:if(n=this,r=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof e||!r.test(e))throw new y(B.a.CreateChannelError.CREATE_CHANNEL_ERR_INVALID_ARGUMENT,"The channelId in the arguments is invalid.");return""===n.uid?[3,2]:[4,null===(t=n._rtmServer)||void 0===t?void 0:t.doGetChanAttributes(e)];case 1:return o=s.sent(),i={},a={},o.map((function(e){var t=e.Key,n=e.Val,r=e.UId,o=e.Time;i[t]=n,a[t]={lastUpdateTs:o,lastUpdateUserId:r,value:n}})),n.channelAttributesCacheLru[e]=i,[2,a];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.getChannelAttributesByKeys=function(e,t){var n;return Q(this,void 0,void 0,(function(){var r,o,i,a,s;return z(this,(function(E){switch(E.label){case 0:if(r=this,o=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof e||!o.test(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The channelId in the arguments is invalid.");if(!(t instanceof Array))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributeKeys in the arguments is not valid.");return""===r.uid?[3,2]:[4,null===(n=r._rtmServer)||void 0===n?void 0:n.doGetChanAttributesByKeys(e,t)];case 1:return i=E.sent(),a=r.channelAttributesCacheLru[e]||{},s={},i.map((function(e){var t=e.Key,n=e.Val,r=e.UId,o=e.Time;s[t]={lastUpdateTs:o,lastUpdateUserId:r,value:n},a[t]=n})),[2,s];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.getChannelMemberCount=function(e){var t;return Q(this,void 0,void 0,(function(){var n,r;return z(this,(function(o){switch(o.label){case 0:if(n=this,"[object Array]"!==Object.prototype.toString.call(e))throw new y(B.a.GetChannelMemberCountErrCode.GET_CHANNEL_MEMBER_COUNT_ERR_INVALID_ARGUMENT,"The channelIds in the arguments is invalid.");if(e.length>32)throw new y(B.a.GetChannelMemberCountErrCode.GET_CHANNEL_MEMBER_COUNT_ERR_EXCEED_LIMIT,"The channelIds is out of length.");return""===n.uid?[3,4]:n._rtmServer?(r={},[4,null===(t=n._rtmServer)||void 0===t?void 0:t.doGetChanMemberSize(e)]):[3,2];case 1:return o.sent().map((function(e){r[e.ChanId]=e.MemSize})),[2,r];case 2:throw new y(B.a.GetChannelMemberCountErrCode.GET_CHANNEL_MEMBER_COUNT_ERR_NOT_INITIALIZED,"The RTM server is not initialized yet.");case 3:return[3,5];case 4:throw new y(B.a.GetChannelMemberCountErrCode.GET_CHANNEL_MEMBER_COUNT_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.");case 5:return[2]}}))}))},t.prototype.getUserAttributes=function(e){var t;return Q(this,void 0,void 0,(function(){var n;return z(this,(function(r){switch(r.label){case 0:if(n=this,"string"!=typeof e)throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The channelId in the arguments is invalid.");return""===n.uid?[3,2]:[4,null===(t=n._rtmServer)||void 0===t?void 0:t.doGetUserAttributes(e)];case 1:return[2,r.sent()];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.getUserAttributesByKeys=function(e,t){var n=this,r=this;return new Promise((function(o,i){return Q(n,void 0,void 0,(function(){var n,i;return z(this,(function(a){switch(a.label){case 0:if(""===r.uid)return[3,2];if("string"!=typeof e||!(t instanceof Array))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"arguments is not valid.");return[4,null===(i=r._rtmServer)||void 0===i?void 0:i.doGetUserAttributesByKeys(e,t)];case 1:return n=a.sent(),o(n),[3,3];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.");case 3:return[2]}}))}))}))},t.prototype.login=function(e){var t=this,n=this;return new Promise((function(r,o){return Q(t,void 0,void 0,(function(){var t,i,a,s;return z(this,(function(E){switch(E.label){case 0:return""!==n.uid?(o(new L(B.a.LoginError.LOGIN_ERR_ALREADY_LOGIN,"The SDK is either logging in or has logged in the RTM system.")),[2]):(t=e.token,i=e.uid,n._emitConnectionState(P.a.ConnectionState.CONNECTING,P.a.ConnectionChangeReason.LOGIN),a=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,""===i||null==i||a.test(i)&&"string"==typeof i?t&&"string"!=typeof t?(o(new y(B.a.LoginError.LOGIN_ERR_INVALID_ARGUMENT,"The uid length must be string within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,")),[2]):(this._joinStartTime=Date.now(),n._createRtmServerInstance(),[4,n._authGateWay(i,t).catch((function(e){switch(e.code){case B.a.LoginError.LOGIN_ERR_INVALID_ARGUMENT:s=P.a.ConnectionChangeReason.LOGIN_FAILURE;break;case B.a.LoginError.LOGIN_ERR_INVALID_APP_ID:s=P.a.ConnectionChangeReason.BANNED_BY_SERVER;case B.a.LoginError.LOGIN_ERR_TIMEOUT:s=P.a.ConnectionChangeReason.LOGIN_TIMEOUT}n._emitConnectionState(P.a.ConnectionState.DISCONNECTED,s),o(e)}))]):(o(new y(B.a.LoginError.LOGIN_ERR_INVALID_ARGUMENT,"The uid length must be string within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,")),[2]));case 1:return E.sent()?r():o(),[2]}}))}))}))},t.prototype.logout=function(){var e;return Q(this,void 0,void 0,(function(){return z(this,(function(t){switch(t.label){case 0:return""===this.uid?[3,2]:[4,null===(e=this._rtmServer)||void 0===e?void 0:e.doOffline()];case 1:return t.sent(),this._rtmServer.disconnectServer(),this._rtmServer.handleMediaServerEvents=function(){},this._rtmServer=void 0,this.uid="",this.channels={},this._localCall={},this._remoteCall={},this._sessionId="",this.token="",this._joinStartTime=0,this._emitConnectionState(P.a.ConnectionState.DISCONNECTED,P.a.ConnectionChangeReason.LOGOUT),[2];case 2:throw new L(B.a.LogoutError.LOGOUT_ERR_USER_NOT_LOGGED_IN,"Logout failure. The client has already been logged out.")}}))}))},t.prototype.queryPeersBySubscriptionOption=function(e){var t;return Q(this,void 0,void 0,(function(){var n;return z(this,(function(r){switch(r.label){case 0:if(""===this.uid)throw new y(B.a.QueryPeersBySubscriptionOptionError.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in. Cannot do the operation");if(!(e in P.a.PeerSubscriptionOption))throw new y(B.a.QueryPeersBySubscriptionOptionError.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_FAILURE,"");return n=[],P.a.PeerSubscriptionOption.ONLINE_STATUS!==e?[3,2]:[4,null===(t=this._rtmServer)||void 0===t?void 0:t.doQueryOnlineSubStatus()];case 1:r.sent().map((function(e){1===e.Online&&n.push(e.UserId)})),r.label=2;case 2:return[2,n]}}))}))},t.prototype.queryPeersOnlineStatus=function(e){var t;return Q(this,void 0,void 0,(function(){var n;return z(this,(function(r){switch(r.label){case 0:if(n={},""===this.uid)return[3,2];if(!(e instanceof Array&&e))throw new L(B.a.QueryPeersOnlineStatusError.QUERY_PEERS_ONLINE_STATUS_ERR_INVALID_ARGUMENT,"invalid arguments.");return[4,null===(t=this._rtmServer)||void 0===t?void 0:t.doQueryOnlineStatus(e)];case 1:return r.sent().map((function(e){n[e.UserId]=!!e.Online})),[2,n];case 2:throw new L(B.a.QueryPeersOnlineStatusError.QUERY_PEERS_ONLINE_STATUS_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.renewToken=function(e){return Q(this,void 0,void 0,(function(){var t;return z(this,(function(n){return t=this,[2,new Promise((function(n,r){var o;try{if(""===t.uid)throw new L(B.a.RenewTokenError.RENEW_TOKEN_ERR_USER_NOT_LOGGED_IN,"renewToken should not be called before user join");if(e&&"string"!=typeof e)return void r(new y(B.a.RenewTokenError.RENEW_TOKEN_ERR_INVALID_ARGUMENT,"The uid length must be string within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,"));c.info("set new token"),null===(o=t._rtmServer)||void 0===o||o.doReNewToken(e),n()}catch(e){r(e)}}))]}))}))},t.prototype.sendMessageToPeer=function(e,t,n){var r;return Q(this,void 0,void 0,(function(){var o,i,a,s,E,_,c,u;return z(this,(function(l){switch(l.label){case 0:if(i={hasPeerReceived:!1},""===(o=this).uid)return[3,4];if(!t)throw new y(B.a.PeerMessageError.PEER_MESSAGE_ERR_INVALID_USERID,"The send message arguments are not valid.");if(e.messageType,a=e.text,s=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,""!==t&&null!=t&&(!s.test(t)||"string"!=typeof t))throw new y(B.a.PeerMessageError.PEER_MESSAGE_ERR_INVALID_USERID,"The uid length must be string within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,");return _=(E=n||{enableHistoricalMessaging:!1,enableOfflineMessaging:!1}).enableHistoricalMessaging,c=E.enableOfflineMessaging,a?(P.a.MessageType.TEXT,[4,null===(r=o._rtmServer)||void 0===r?void 0:r.doSendMsgToPeer(1,t,a,c,_)]):[3,2];case 1:return u=l.sent(),i.hasPeerReceived=u,[2,i];case 2:throw new L(B.a.PeerMessageError.PEER_MESSAGE_ERR_INVALID_MESSAGE,"Message is not valid.");case 3:return[3,5];case 4:throw new L(B.a.PeerMessageError.PEER_MESSAGE_ERR_USER_NOT_LOGGED_IN,"Failed to send the peer-to-peer message. The client is not logged in.");case 5:return[2]}}))}))},t.prototype.setChannelAttributes=function(e,t,n){return Q(this,void 0,void 0,(function(){var r,o,i;return z(this,(function(a){switch(a.label){case 0:if(r=this,o=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof e||!o.test(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The channelId in the arguments is invalid.");if("[object Object]"!==Object.prototype.toString.call(t))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributes in the arguments is invalid.");return""===r.uid?[3,3]:(i=(n||{enableNotificationToChannelMembers:!1}).enableNotificationToChannelMembers,r._rtmServer?[4,r._rtmServer.doAddOrUpdateChanAttributes({channelId:e,attributes:t,isSet:!0,notify:i})]:[3,2]);case 1:return a.sent(),r.channelAttributesCacheLru[e]=t,[2];case 2:return[3,4];case 3:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.");case 4:return[2]}}))}))},t.prototype.setLocalUserAttributes=function(e){var t;return Q(this,void 0,void 0,(function(){var n;return z(this,(function(r){switch(r.label){case 0:if(n=this,"[object Object]"!==Object.prototype.toString.call(e))throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,"The attributes in the arguments is invalid.");return""===n.uid?[3,2]:(n._userAttributes={},[4,null===(t=n._rtmServer)||void 0===t?void 0:t.doAddOrUpdateUserAttributes(e,!0)]);case 1:return r.sent(),n._userAttributes=e,[2];case 2:throw new y(B.a.AttributeOperationError.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}}))}))},t.prototype.setParameters=function(e){var t=e.confPriCloudAddr,n=e.ConfPriCloudAddr;if(t){var r=t.ServerAdd,i=t.Port,a=t.Wss;this._useWss="boolean"!=typeof a||a,r&&(o.GATEWAY_ADDRESS=(this._useWss?"https://"+r:"http://"+r)+(i?":"+i:""))}if(n){r=n.ServerAdd,i=n.Port,a=n.Wss;this._useWss="boolean"!=typeof a||a,r&&(o.GATEWAY_ADDRESS=(this._useWss?"https://"+r:"http://"+r)+(i?":"+i:""))}},t.prototype.subscribePeersOnlineStatus=function(e){var t;return Q(this,void 0,void 0,(function(){return z(this,(function(n){if(""!==this.uid){if(!(e instanceof Array&&e))throw new L(B.a.PeerSubscriptionStatusError.PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT,"invalid arguments.");if(e.length>512)throw new L(B.a.PeerSubscriptionStatusError.PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW,"Subscribe user out of length 512.");return null===(t=this._rtmServer)||void 0===t||t.doSubscribeOnlineStatus(e),[2]}throw new y(B.a.PeerSubscriptionStatusError.PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}))}))},t.prototype.unsubscribePeersOnlineStatus=function(e){var t;return Q(this,void 0,void 0,(function(){return z(this,(function(n){if(""!==this.uid){if(!(e instanceof Array&&e))throw new L(B.a.PeerSubscriptionStatusError.PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT,"invalid arguments.");return null===(t=this._rtmServer)||void 0===t||t.doUnSubscribeOnlineStatus(e),[2]}throw new y(B.a.PeerSubscriptionStatusError.PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN,"The client is not logged in.")}))}))},t.prototype._emitConnectionState=function(e,t){this.emit("ConnectionStateChanged",e,t)},t.prototype._createRtmServerInstance=function(){var e=this;this._rtmServer||(this._rtmServer=new M),this._rtmServer.handleMediaServerEvents=function(t,n){var r,o,i=e;n.Code;if("connection-state-change"===t){var a=n.curState;n.reason;if("RECONNECTING"===a){i._emitConnectionState(P.a.ConnectionState.RECONNECTING);var s=i._userAttributes;new Set;i._userAttributes={},i._remoteCall={},i._localCall={},i.channelAttributesCacheLru={},Object.keys(i.channels).map((function(e){i.channels[e].joined=!1})),i._rtmServer=void 0,i._createRtmServerInstance(),i._authGateWay(i.uid,i.token).then((function(e){i.setLocalUserAttributes(s),Object.keys(i.channels).map((function(e){i.channels[e].channel.join()}))}))}}else if("ForceOffline"===t||"AcsTokenDidExpire"===t)"ForceOffline"===t?e._emitConnectionState(P.a.ConnectionState.DISCONNECTED,P.a.ConnectionChangeReason.REMOTE_LOGIN):"AcsTokenDidExpire"===t&&(i.emit("TokenDidExpired"),c.debug("[client}] token privilege did expire.")),null===(r=i._rtmServer)||void 0===r||r.doOffline(),e._rtmServer.disconnectServer("TOKEN_INVALID"),e._rtmServer.handleMediaServerEvents=function(){},e._rtmServer=void 0,e.uid="",e.channels={},e._localCall={},e._remoteCall={},e._sessionId="",e.token="";else if("AcsTokenWillExpire"===t)i.emit("TokenWillExpired"),c.debug("[client] token privilege will expire.");else if("RecvMsgFromPeer"===t){var E=n.MsgId,_=n.FromUId,u=n.MsgType,l=n.MsgBody,R={isHistoricalMessage:!1,isOfflineMessage:!1,serverReceivedTs:n.SvrTS};if(1===u){var N={text:l};i.emit("MessageFromPeer",N,_,R)}null===(o=i._rtmServer)||void 0===o||o.doRecvMsgFromPeerAck(E,_)}else if("PeerOnlineStatus"===t){var d=n.Status,f={};d.map((function(e){f[e.UserId]=e.Online?P.a.PeerOnlineState.ONLINE:P.a.PeerOnlineState.OFFLINE})),i.emit("PeersOnlineStatusChanged",f)}else if("MakeCall"===t){var I=n.CallId,O=n.FromUId,T=(n.ToUId,n.Content);(v=new Y(I,O,T)).client=i,i._remoteCall[I]=v,i.emit("RemoteInvitationReceived",v)}else if("CancelCall"===t){I=n.CallId,O=n.FromUId,n.ToUId;var h=n.Reason,p=n.Response;(v=i._remoteCall[I]).state=P.a.RemoteInvitationState.CANCELED,h&&"Offline"===h?v.emit("RemoteInvitationFailure",P.a.RemoteInvitationFailureReason.PEER_OFFLINE):v.emit("RemoteInvitationCanceled",p)}else if("AcceptCallAck"===t){var v;I=n.CallId;(v=i._remoteCall[I]).state=P.a.RemoteInvitationState.ACCEPTED,v.emit("RemoteInvitationAccepted")}else if("AcceptCall"===t){I=n.CallId,O=n.FromUId,n.ToUId;var A=n.Response;(C=i._localCall[I]).state=P.a.LocalInvitationState.ACCEPTED_BY_REMOTE,C.emit("LocalInvitationAccepted",A)}else if("RejectCall"===t){I=n.CallId,O=n.FromUId,n.ToUId;var S=n.Response;(C=i._localCall[I]).state=P.a.LocalInvitationState.REFUSED_BY_REMOTE,C.emit("LocalInvitationRefused",S)}else if("CallStatus"===t){I=n.CallId,d=n.Status;var C=i._localCall[I];if(1===d)C.state=P.a.LocalInvitationState.SENT_TO_REMOTE;else if(2===d)C.state=P.a.LocalInvitationState.RECEIVED_BY_REMOTE,C.emit("LocalInvitationReceivedByPeer");else if(3===d){C.state=P.a.LocalInvitationState.FAILURE;var L=P.a.LocalInvitationFailureReason.PEER_OFFLINE;C.emit("LocalInvitationFailure",L)}else if(4===d){C.state=P.a.LocalInvitationState.FAILURE;var y=P.a.LocalInvitationFailureReason.PEER_NO_RESPONSE;C.emit("LocalInvitationFailure",y),i._localCall[I].cancel()}}}},t.prototype._authGateWay=function(e,t){var n=this,r=this;return new Promise((function(i,a){return Q(n,void 0,void 0,(function(){var n,s,E,u,l,R,N,d,f,O,T,h,p,v,A,S,C,y,m,g,b;return z(this,(function(U){switch(U.label){case 0:return n=new I,this._gateway=n,[4,K(n.joinGateway({appid:r._appId,uid:e,token:t||"",wss:r._useWss}))];case 1:return s=X.apply(void 0,[U.sent(),2]),E=s[0],u=s[1],E?(E===_.INVALID_PARAMS?a(new L(B.a.LoginError.LOGIN_ERR_INVALID_ARGUMENT,"gateway connect failed: ")):E===_.DEVELOPER_INVALID||E===_.UID_BANNED||E===_.IP_BANNED||E===_.CHANNEL_BANNED||E===_.APPID_INVALID||E===_.SERVER_NOT_OPEN?a(new L(B.a.LoginError.LOGIN_ERR_INVALID_APP_ID)):E===_.TOKEN_EXPIRED?a(new L(B.a.LoginError.LOGIN_ERR_TOKEN_EXPIRED,"You must request a new token from your server and call join to use the new token to join the channel")):E===_.TOKEN_INVALID?a(new L(B.a.LoginError.LOGIN_ERR_INVALID_TOKEN,"make sure token is right and try again please")):E===_.UNKNOWN?a(new L(B.a.LoginError.LOGIN_ERR_UNKNOWN)):E===_.TIMEOUT&&a(new L(B.a.LoginError.LOGIN_ERR_TIMEOUT)),[2]):(r.token=t,l=u.addresses,R=u.sessionid,r._sessionId=R,!l||l instanceof Array&&0===l.length?(a(new L(B.a.LoginError.LOGIN_ERR_UNKNOWN,"gateway connect failed: Can not find service list")),[2]):[4,K(r._connectRtmServer(u,e,t))]);case 2:return N=X.apply(void 0,[U.sent(),1]),(d=N[0])?(a(d),[2]):(f={UserId:e,UserSId:r._sid,AcsToken:t||"",SdkVer:o.VERSION,SessionId:r._sessionId},[4,K(r._rtmServer.doOnline(f))]);case 3:return O=X.apply(void 0,[U.sent(),2]),T=O[0],h=O[1],T?(null===(b=r._rtmServer)||void 0===b||b.disconnectServer(),r._emitConnectionState(P.a.ConnectionState.DISCONNECTED,P.a.ConnectionChangeReason.LOGIN_FAILURE),a(T),[2]):(r.uid=h,r._emitConnectionState(P.a.ConnectionState.CONNECTED,P.a.ConnectionChangeReason.LOGIN_SUCCESS),i(r.uid),[4,K(n.getOfflineMsg({uid:r.uid}))]);case 4:return p=X.apply(void 0,[U.sent(),2]),v=p[0],A=p[1],v?(c.error("get offline message failed"),[2]):(A&&(m=A.code,g=A.data,0===m&&g.map((function(e){var t=e.msgFrom,n=(e.msgStatus,e.msgType),o=e.msgBody,i={isHistoricalMessage:!1,isOfflineMessage:!0,serverReceivedTs:e.msgTs};if(1===n){var a={text:o};r.emit("MessageFromPeer",a,t,i)}}))),[4,K(n.getP2PHistoryMsg({fromUId:r.uid}))]);case 5:return S=X.apply(void 0,[U.sent(),2]),C=S[0],y=S[1],C?(c.error("get history message failed"),[2]):(y&&(m=y.code,g=y.data,0===m&&g.map((function(e){var t=e.msgFrom,n=(e.msgStatus,e.msgType),o=e.msgBody,i={isHistoricalMessage:!0,isOfflineMessage:!1,serverReceivedTs:e.msgTs};if(1===n){var a={text:o};r.emit("MessageFromPeer",a,t,i)}}))),[2])}}))}))}))},t.prototype._connectRtmServer=function(e,t,n){var r=this,i=this,a=e.addresses,s=(e.sessionid,a.filter((function(e){return 0===e.type})));return new Promise((function(e,a){return Q(r,void 0,void 0,(function(){var r,a,E,_,u,l,R,N,d,f,I=this;return z(this,(function(O){switch(O.label){case 0:r=!1,O.label=1;case 1:O.trys.push([1,6,7,8]),a=$(s),E=a.next(),O.label=2;case 2:return E.done?[3,5]:(_=E.value,c.info("begin connect rtm server ",_),null===(N=i._rtmServer)||void 0===N||N.setAppInfo({appId:i._appId}),null===(d=i._rtmServer)||void 0===d||d.configServer(i._useWss,_.addr,_.port),[4,null===(f=i._rtmServer)||void 0===f?void 0:f.connectServer()]);case 3:return O.sent(),e(),r=!0,[3,5];case 4:return E=a.next(),[3,2];case 5:return[3,8];case 6:return u=O.sent(),l={error:u},[3,8];case 7:try{E&&!E.done&&(R=a.return)&&R.call(a)}finally{if(l)throw l.error}return[7];case 8:return r||(Date.now()-i._joinStartTime<o.GATEWAY_RETRY_TIMEOUT?setTimeout((function(){I._authGateWay(t,n)}),1e3):i._emitConnectionState(P.a.ConnectionState.DISCONNECTED,P.a.ConnectionChangeReason.LOGIN_FAILURE)),[2]}}))}))}))},t}(G);(f=d||(d={})).BUILD="",f.ConnectionChangeReason=void 0,f.ConnectionState=void 0,f.END_CALL_PREFIX="",f.LOG_FILTER_ERROR="LOG_FILTER_ERROR",f.LOG_FILTER_INFO="LOG_FILTER_INFO",f.LOG_FILTER_OFF="LOG_FILTER_OFF",f.LOG_FILTER_WARNING="LOG_FILTER_WARNING",f.LocalInvitationState=void 0,f.MessageType=void 0,f.PeerOnlineState=void 0,f.PeerSubscriptionOption=void 0,f.RemoteInvitationFailureReason=void 0,f.LocalInvitationFailureReason=void 0,f.RemoteInvitationState=void 0,f.VERSION=o.VERSION,f.createInstance=function(e,t){if(!/^[a-zA-Z0-9]{32}$/.test(e))throw new y(B.a.CreateInstanceError.CREATE_INSTANCE_ERR_INVALID_ARGUMENT,"The appId in the arguments is invalid.");var n=(t||{}).logFilter;if(n){var r=["","LOG_FILTER_INFO","LOG_FILTER_WARNING","LOG_FILTER_ERROR","LOG_FILTER_OFF"],o=4;~r.indexOf(n)&&(o=r.findIndex((function(e){return e===n}))),c.setLogLevel(o,"anyrtc-SDK")}return new Z(e,t)}},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e){e.exports=JSON.parse('{"name":"ar-rtm-sdk","version":"1.0.5","description":"JavaScript SDK for anyRTC RTM","main":"release/ArRTM@latest.js","typings":"release/ar-rtm-sdk.d.ts","scripts":{"build":"webpack --mode=production","dev":"webpack --mode=development","doc":"rm -rf release/ar-rtm-sdk.d.ts && rm -rf lib && tsc && api-extractor run"},"files":["release/*.js","release/ar-rtm-sdk.d.ts","README.md"],"author":"","license":"MIT","devDependencies":{"@types/js-base64":"^2.3.2","@types/wechat-miniprogram":"^3.0.0","awesome-typescript-loader":"^5.2.1","typedoc":"^0.17.7","typedoc-webpack-plugin":"^1.1.4","typescript":"^3.9.3","webpack":"^4.43.0","webpack-cli":"^3.3.11"},"dependencies":{}}')}]).default}));
0 2 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/call/assets/js/bootstrap.min.js 0 → 100644
  1 +/*!
  2 + * Bootstrap v4.5.0 (https://getbootstrap.com/)
  3 + * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4 + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  5 + */
  6 +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,(function(t,e,n){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function o(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;function l(t){var n=this,i=!1;return e(this).one(c.TRANSITION_END,(function(){i=!0})),setTimeout((function(){i||c.triggerTransitionEnd(n)}),t),this}var c={TRANSITION_END:"bsTransitionEnd",getUID:function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var n=e(t).css("transition-duration"),i=e(t).css("transition-delay"),o=parseFloat(n),s=parseFloat(i);return o||s?(n=n.split(",")[0],i=i.split(",")[0],1e3*(parseFloat(n)+parseFloat(i))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){e(t).trigger("transitionend")},supportsTransitionEnd:function(){return Boolean("transitionend")},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],s=e[i],r=s&&c.isElement(s)?"element":null===(a=s)||"undefined"==typeof a?""+a:{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(o).test(r))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+r+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?c.findShadowRoot(t.parentNode):null},jQueryDetection:function(){if("undefined"==typeof e)throw new TypeError("Bootstrap's JavaScript requires jQuery. jQuery must be included before Bootstrap's JavaScript.");var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1===t[0]&&9===t[1]&&t[2]<1||t[0]>=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};c.jQueryDetection(),e.fn.emulateTransitionEnd=l,e.event.special[c.TRANSITION_END]={bindType:"transitionend",delegateType:"transitionend",handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var h="alert",u=e.fn[h],d=function(){function t(t){this._element=t}var n=t.prototype;return n.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},n.dispose=function(){e.removeData(this._element,"bs.alert"),this._element=null},n._getRootElement=function(t){var n=c.getSelectorFromElement(t),i=!1;return n&&(i=document.querySelector(n)),i||(i=e(t).closest(".alert")[0]),i},n._triggerCloseEvent=function(t){var n=e.Event("close.bs.alert");return e(t).trigger(n),n},n._removeElement=function(t){var n=this;if(e(t).removeClass("show"),e(t).hasClass("fade")){var i=c.getTransitionDurationFromElement(t);e(t).one(c.TRANSITION_END,(function(e){return n._destroyElement(t,e)})).emulateTransitionEnd(i)}else this._destroyElement(t)},n._destroyElement=function(t){e(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||(o=new t(this),i.data("bs.alert",o)),"close"===n&&o[n](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',d._handleDismiss(new d)),e.fn[h]=d._jQueryInterface,e.fn[h].Constructor=d,e.fn[h].noConflict=function(){return e.fn[h]=u,d._jQueryInterface};var f=e.fn.button,g=function(){function t(t){this._element=t}var n=t.prototype;return n.toggle=function(){var t=!0,n=!0,i=e(this._element).closest('[data-toggle="buttons"]')[0];if(i){var o=this._element.querySelector('input:not([type="hidden"])');if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains("active"))t=!1;else{var s=i.querySelector(".active");s&&e(s).removeClass("active")}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains("active")),e(o).trigger("change")),o.focus(),n=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(n&&this._element.setAttribute("aria-pressed",!this._element.classList.contains("active")),t&&e(this._element).toggleClass("active"))},n.dispose=function(){e.removeData(this._element,"bs.button"),this._element=null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.button");i||(i=new t(this),e(this).data("bs.button",i)),"toggle"===n&&i[n]()}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=t.target,i=n;if(e(n).hasClass("btn")||(n=e(n).closest(".btn")[0]),!n||n.hasAttribute("disabled")||n.classList.contains("disabled"))t.preventDefault();else{var o=n.querySelector('input:not([type="hidden"])');if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"LABEL"===i.tagName&&o&&"checkbox"===o.type&&t.preventDefault(),g._jQueryInterface.call(e(n),"toggle")}})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){var n=e(t.target).closest(".btn")[0];e(n).toggleClass("focus",/^focus(in)?$/.test(t.type))})),e(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e<n;e++){var i=t[e],o=i.querySelector('input:not([type="hidden"])');o.checked||o.hasAttribute("checked")?i.classList.add("active"):i.classList.remove("active")}for(var s=0,r=(t=[].slice.call(document.querySelectorAll('[data-toggle="button"]'))).length;s<r;s++){var a=t[s];"true"===a.getAttribute("aria-pressed")?a.classList.add("active"):a.classList.remove("active")}})),e.fn.button=g._jQueryInterface,e.fn.button.Constructor=g,e.fn.button.noConflict=function(){return e.fn.button=f,g._jQueryInterface};var m="carousel",p=".bs.carousel",_=e.fn[m],v={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},b={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},y={TOUCH:"touch",PEN:"pen"},E=function(){function t(t,e){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._element=t,this._indicatorsElement=this._element.querySelector(".carousel-indicators"),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var n=t.prototype;return n.next=function(){this._isSliding||this._slide("next")},n.nextWhenVisible=function(){!document.hidden&&e(this._element).is(":visible")&&"hidden"!==e(this._element).css("visibility")&&this.next()},n.prev=function(){this._isSliding||this._slide("prev")},n.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(c.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},n.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},n.to=function(t){var n=this;this._activeElement=this._element.querySelector(".active.carousel-item");var i=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)e(this._element).one("slid.bs.carousel",(function(){return n.to(t)}));else{if(i===t)return this.pause(),void this.cycle();var o=t>i?"next":"prev";this._slide(o,this._items[t])}},n.dispose=function(){e(this._element).off(p),e.removeData(this._element,"bs.carousel"),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},n._getConfig=function(t){return t=a(a({},v),t),c.typeCheckConfig(m,t,b),t},n._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},n._addEventListeners=function(){var t=this;this._config.keyboard&&e(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&e(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},n._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var n=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},i=function(e){t._pointerEvent&&y[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};e(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(e(this._element).on("pointerdown.bs.carousel",(function(t){return n(t)})),e(this._element).on("pointerup.bs.carousel",(function(t){return i(t)})),this._element.classList.add("pointer-event")):(e(this._element).on("touchstart.bs.carousel",(function(t){return n(t)})),e(this._element).on("touchmove.bs.carousel",(function(e){return function(e){e.originalEvent.touches&&e.originalEvent.touches.length>1?t.touchDeltaX=0:t.touchDeltaX=e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),e(this._element).on("touchend.bs.carousel",(function(t){return i(t)})))}},n._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},n._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},n._getItemByDirection=function(t,e){var n="next"===t,i="prev"===t,o=this._getItemIndex(e),s=this._items.length-1;if((i&&0===o||n&&o===s)&&!this._config.wrap)return e;var r=(o+("prev"===t?-1:1))%this._items.length;return-1===r?this._items[this._items.length-1]:this._items[r]},n._triggerSlideEvent=function(t,n){var i=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(".active.carousel-item")),s=e.Event("slide.bs.carousel",{relatedTarget:t,direction:n,from:o,to:i});return e(this._element).trigger(s),s},n._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var n=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));e(n).removeClass("active");var i=this._indicatorsElement.children[this._getItemIndex(t)];i&&e(i).addClass("active")}},n._slide=function(t,n){var i,o,s,r=this,a=this._element.querySelector(".active.carousel-item"),l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(t,a),u=this._getItemIndex(h),d=Boolean(this._interval);if("next"===t?(i="carousel-item-left",o="carousel-item-next",s="left"):(i="carousel-item-right",o="carousel-item-prev",s="right"),h&&e(h).hasClass("active"))this._isSliding=!1;else if(!this._triggerSlideEvent(h,s).isDefaultPrevented()&&a&&h){this._isSliding=!0,d&&this.pause(),this._setActiveIndicatorElement(h);var f=e.Event("slid.bs.carousel",{relatedTarget:h,direction:s,from:l,to:u});if(e(this._element).hasClass("slide")){e(h).addClass(o),c.reflow(h),e(a).addClass(i),e(h).addClass(i);var g=parseInt(h.getAttribute("data-interval"),10);g?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=g):this._config.interval=this._config.defaultInterval||this._config.interval;var m=c.getTransitionDurationFromElement(a);e(a).one(c.TRANSITION_END,(function(){e(h).removeClass(i+" "+o).addClass("active"),e(a).removeClass("active "+o+" "+i),r._isSliding=!1,setTimeout((function(){return e(r._element).trigger(f)}),0)})).emulateTransitionEnd(m)}else e(a).removeClass("active"),e(h).addClass("active"),this._isSliding=!1,e(this._element).trigger(f);d&&this.cycle()}},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.carousel"),o=a(a({},v),e(this).data());"object"==typeof n&&(o=a(a({},o),n));var s="string"==typeof n?n:o.slide;if(i||(i=new t(this,o),e(this).data("bs.carousel",i)),"number"==typeof n)i.to(n);else if("string"==typeof s){if("undefined"==typeof i[s])throw new TypeError('No method named "'+s+'"');i[s]()}else o.interval&&o.ride&&(i.pause(),i.cycle())}))},t._dataApiClickHandler=function(n){var i=c.getSelectorFromElement(this);if(i){var o=e(i)[0];if(o&&e(o).hasClass("carousel")){var s=a(a({},e(o).data()),e(this).data()),r=this.getAttribute("data-slide-to");r&&(s.interval=!1),t._jQueryInterface.call(e(o),s),r&&e(o).data("bs.carousel").to(r),n.preventDefault()}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return v}}]),t}();e(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",E._dataApiClickHandler),e(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),n=0,i=t.length;n<i;n++){var o=e(t[n]);E._jQueryInterface.call(o,o.data())}})),e.fn[m]=E._jQueryInterface,e.fn[m].Constructor=E,e.fn[m].noConflict=function(){return e.fn[m]=_,E._jQueryInterface};var w="collapse",T=e.fn[w],C={toggle:!0,parent:""},S={toggle:"boolean",parent:"(string|element)"},D=function(){function t(t,e){this._isTransitioning=!1,this._element=t,this._config=this._getConfig(e),this._triggerArray=[].slice.call(document.querySelectorAll('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'));for(var n=[].slice.call(document.querySelectorAll('[data-toggle="collapse"]')),i=0,o=n.length;i<o;i++){var s=n[i],r=c.getSelectorFromElement(s),a=[].slice.call(document.querySelectorAll(r)).filter((function(e){return e===t}));null!==r&&a.length>0&&(this._selector=r,this._triggerArray.push(s))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var n=t.prototype;return n.toggle=function(){e(this._element).hasClass("show")?this.hide():this.show()},n.show=function(){var n,i,o=this;if(!this._isTransitioning&&!e(this._element).hasClass("show")&&(this._parent&&0===(n=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains("collapse")}))).length&&(n=null),!(n&&(i=e(n).not(this._selector).data("bs.collapse"))&&i._isTransitioning))){var s=e.Event("show.bs.collapse");if(e(this._element).trigger(s),!s.isDefaultPrevented()){n&&(t._jQueryInterface.call(e(n).not(this._selector),"hide"),i||e(n).data("bs.collapse",null));var r=this._getDimension();e(this._element).removeClass("collapse").addClass("collapsing"),this._element.style[r]=0,this._triggerArray.length&&e(this._triggerArray).removeClass("collapsed").attr("aria-expanded",!0),this.setTransitioning(!0);var a="scroll"+(r[0].toUpperCase()+r.slice(1)),l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){e(o._element).removeClass("collapsing").addClass("collapse show"),o._element.style[r]="",o.setTransitioning(!1),e(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[r]=this._element[a]+"px"}}},n.hide=function(){var t=this;if(!this._isTransitioning&&e(this._element).hasClass("show")){var n=e.Event("hide.bs.collapse");if(e(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",c.reflow(this._element),e(this._element).addClass("collapsing").removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var s=0;s<o;s++){var r=this._triggerArray[s],a=c.getSelectorFromElement(r);if(null!==a)e([].slice.call(document.querySelectorAll(a))).hasClass("show")||e(r).addClass("collapsed").attr("aria-expanded",!1)}this.setTransitioning(!0);this._element.style[i]="";var l=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){t.setTransitioning(!1),e(t._element).removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")})).emulateTransitionEnd(l)}}},n.setTransitioning=function(t){this._isTransitioning=t},n.dispose=function(){e.removeData(this._element,"bs.collapse"),this._config=null,this._parent=null,this._element=null,this._triggerArray=null,this._isTransitioning=null},n._getConfig=function(t){return(t=a(a({},C),t)).toggle=Boolean(t.toggle),c.typeCheckConfig(w,t,S),t},n._getDimension=function(){return e(this._element).hasClass("width")?"width":"height"},n._getParent=function(){var n,i=this;c.isElement(this._config.parent)?(n=this._config.parent,"undefined"!=typeof this._config.parent.jquery&&(n=this._config.parent[0])):n=document.querySelector(this._config.parent);var o='[data-toggle="collapse"][data-parent="'+this._config.parent+'"]',s=[].slice.call(n.querySelectorAll(o));return e(s).each((function(e,n){i._addAriaAndCollapsedClass(t._getTargetFromElement(n),[n])})),n},n._addAriaAndCollapsedClass=function(t,n){var i=e(t).hasClass("show");n.length&&e(n).toggleClass("collapsed",!i).attr("aria-expanded",i)},t._getTargetFromElement=function(t){var e=c.getSelectorFromElement(t);return e?document.querySelector(e):null},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.collapse"),s=a(a(a({},C),i.data()),"object"==typeof n&&n?n:{});if(!o&&s.toggle&&"string"==typeof n&&/show|hide/.test(n)&&(s.toggle=!1),o||(o=new t(this,s),i.data("bs.collapse",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return C}}]),t}();e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){"A"===t.currentTarget.tagName&&t.preventDefault();var n=e(this),i=c.getSelectorFromElement(this),o=[].slice.call(document.querySelectorAll(i));e(o).each((function(){var t=e(this),i=t.data("bs.collapse")?"toggle":n.data();D._jQueryInterface.call(t,i)}))})),e.fn[w]=D._jQueryInterface,e.fn[w].Constructor=D,e.fn[w].noConflict=function(){return e.fn[w]=T,D._jQueryInterface};var k="dropdown",N=e.fn[k],A=new RegExp("38|40|27"),I={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},O={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},j=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var i=t.prototype;return i.toggle=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")){var n=e(this._menu).hasClass("show");t._clearMenus(),n||this.show(!0)}},i.show=function(i){if(void 0===i&&(i=!1),!(this._element.disabled||e(this._element).hasClass("disabled")||e(this._menu).hasClass("show"))){var o={relatedTarget:this._element},s=e.Event("show.bs.dropdown",o),r=t._getParentFromElement(this._element);if(e(r).trigger(s),!s.isDefaultPrevented()){if(!this._inNavbar&&i){if("undefined"==typeof n)throw new TypeError("Bootstrap's dropdowns require Popper.js (https://popper.js.org/)");var a=this._element;"parent"===this._config.reference?a=r:c.isElement(this._config.reference)&&(a=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(a=this._config.reference[0])),"scrollParent"!==this._config.boundary&&e(r).addClass("position-static"),this._popper=new n(a,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===e(r).closest(".navbar-nav").length&&e(document.body).children().on("mouseover",null,e.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),e(this._menu).toggleClass("show"),e(r).toggleClass("show").trigger(e.Event("shown.bs.dropdown",o))}}},i.hide=function(){if(!this._element.disabled&&!e(this._element).hasClass("disabled")&&e(this._menu).hasClass("show")){var n={relatedTarget:this._element},i=e.Event("hide.bs.dropdown",n),o=t._getParentFromElement(this._element);e(o).trigger(i),i.isDefaultPrevented()||(this._popper&&this._popper.destroy(),e(this._menu).toggleClass("show"),e(o).toggleClass("show").trigger(e.Event("hidden.bs.dropdown",n)))}},i.dispose=function(){e.removeData(this._element,"bs.dropdown"),e(this._element).off(".bs.dropdown"),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},i.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},i._addEventListeners=function(){var t=this;e(this._element).on("click.bs.dropdown",(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},i._getConfig=function(t){return t=a(a(a({},this.constructor.Default),e(this._element).data()),t),c.typeCheckConfig(k,t,this.constructor.DefaultType),t},i._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(".dropdown-menu"))}return this._menu},i._getPlacement=function(){var t=e(this._element.parentNode),n="bottom-start";return t.hasClass("dropup")?n=e(this._menu).hasClass("dropdown-menu-right")?"top-end":"top-start":t.hasClass("dropright")?n="right-start":t.hasClass("dropleft")?n="left-start":e(this._menu).hasClass("dropdown-menu-right")&&(n="bottom-end"),n},i._detectNavbar=function(){return e(this._element).closest(".navbar").length>0},i._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t._config.offset(e.offsets,t._element)||{}),e}:e.offset=this._config.offset,e},i._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),a(a({},t),this._config.popperConfig)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.dropdown");if(i||(i=new t(this,"object"==typeof n?n:null),e(this).data("bs.dropdown",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},t._clearMenus=function(n){if(!n||3!==n.which&&("keyup"!==n.type||9===n.which))for(var i=[].slice.call(document.querySelectorAll('[data-toggle="dropdown"]')),o=0,s=i.length;o<s;o++){var r=t._getParentFromElement(i[o]),a=e(i[o]).data("bs.dropdown"),l={relatedTarget:i[o]};if(n&&"click"===n.type&&(l.clickEvent=n),a){var c=a._menu;if(e(r).hasClass("show")&&!(n&&("click"===n.type&&/input|textarea/i.test(n.target.tagName)||"keyup"===n.type&&9===n.which)&&e.contains(r,n.target))){var h=e.Event("hide.bs.dropdown",l);e(r).trigger(h),h.isDefaultPrevented()||("ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),i[o].setAttribute("aria-expanded","false"),a._popper&&a._popper.destroy(),e(c).removeClass("show"),e(r).removeClass("show").trigger(e.Event("hidden.bs.dropdown",l)))}}}},t._getParentFromElement=function(t){var e,n=c.getSelectorFromElement(t);return n&&(e=document.querySelector(n)),e||t.parentNode},t._dataApiKeydownHandler=function(n){if(!(/input|textarea/i.test(n.target.tagName)?32===n.which||27!==n.which&&(40!==n.which&&38!==n.which||e(n.target).closest(".dropdown-menu").length):!A.test(n.which))&&!this.disabled&&!e(this).hasClass("disabled")){var i=t._getParentFromElement(this),o=e(i).hasClass("show");if(o||27!==n.which){if(n.preventDefault(),n.stopPropagation(),!o||o&&(27===n.which||32===n.which))return 27===n.which&&e(i.querySelector('[data-toggle="dropdown"]')).trigger("focus"),void e(this).trigger("click");var s=[].slice.call(i.querySelectorAll(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)")).filter((function(t){return e(t).is(":visible")}));if(0!==s.length){var r=s.indexOf(n.target);38===n.which&&r>0&&r--,40===n.which&&r<s.length-1&&r++,r<0&&(r=0),s[r].focus()}}}},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return I}},{key:"DefaultType",get:function(){return O}}]),t}();e(document).on("keydown.bs.dropdown.data-api",'[data-toggle="dropdown"]',j._dataApiKeydownHandler).on("keydown.bs.dropdown.data-api",".dropdown-menu",j._dataApiKeydownHandler).on("click.bs.dropdown.data-api keyup.bs.dropdown.data-api",j._clearMenus).on("click.bs.dropdown.data-api",'[data-toggle="dropdown"]',(function(t){t.preventDefault(),t.stopPropagation(),j._jQueryInterface.call(e(this),"toggle")})).on("click.bs.dropdown.data-api",".dropdown form",(function(t){t.stopPropagation()})),e.fn[k]=j._jQueryInterface,e.fn[k].Constructor=j,e.fn[k].noConflict=function(){return e.fn[k]=N,j._jQueryInterface};var P=e.fn.modal,x={backdrop:!0,keyboard:!0,focus:!0,show:!0},L={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean",show:"boolean"},R=function(){function t(t,e){this._config=this._getConfig(e),this._element=t,this._dialog=t.querySelector(".modal-dialog"),this._backdrop=null,this._isShown=!1,this._isBodyOverflowing=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollbarWidth=0}var n=t.prototype;return n.toggle=function(t){return this._isShown?this.hide():this.show(t)},n.show=function(t){var n=this;if(!this._isShown&&!this._isTransitioning){e(this._element).hasClass("fade")&&(this._isTransitioning=!0);var i=e.Event("show.bs.modal",{relatedTarget:t});e(this._element).trigger(i),this._isShown||i.isDefaultPrevented()||(this._isShown=!0,this._checkScrollbar(),this._setScrollbar(),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),e(this._element).on("click.dismiss.bs.modal",'[data-dismiss="modal"]',(function(t){return n.hide(t)})),e(this._dialog).on("mousedown.dismiss.bs.modal",(function(){e(n._element).one("mouseup.dismiss.bs.modal",(function(t){e(t.target).is(n._element)&&(n._ignoreBackdropClick=!0)}))})),this._showBackdrop((function(){return n._showElement(t)})))}},n.hide=function(t){var n=this;if(t&&t.preventDefault(),this._isShown&&!this._isTransitioning){var i=e.Event("hide.bs.modal");if(e(this._element).trigger(i),this._isShown&&!i.isDefaultPrevented()){this._isShown=!1;var o=e(this._element).hasClass("fade");if(o&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),e(document).off("focusin.bs.modal"),e(this._element).removeClass("show"),e(this._element).off("click.dismiss.bs.modal"),e(this._dialog).off("mousedown.dismiss.bs.modal"),o){var s=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(t){return n._hideModal(t)})).emulateTransitionEnd(s)}else this._hideModal()}}},n.dispose=function(){[window,this._element,this._dialog].forEach((function(t){return e(t).off(".bs.modal")})),e(document).off("focusin.bs.modal"),e.removeData(this._element,"bs.modal"),this._config=null,this._element=null,this._dialog=null,this._backdrop=null,this._isShown=null,this._isBodyOverflowing=null,this._ignoreBackdropClick=null,this._isTransitioning=null,this._scrollbarWidth=null},n.handleUpdate=function(){this._adjustDialog()},n._getConfig=function(t){return t=a(a({},x),t),c.typeCheckConfig("modal",t,L),t},n._triggerBackdropTransition=function(){var t=this;if("static"===this._config.backdrop){var n=e.Event("hidePrevented.bs.modal");if(e(this._element).trigger(n),n.defaultPrevented)return;this._element.classList.add("modal-static");var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,(function(){t._element.classList.remove("modal-static")})).emulateTransitionEnd(i),this._element.focus()}else this.hide()},n._showElement=function(t){var n=this,i=e(this._element).hasClass("fade"),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),e(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,i&&c.reflow(this._element),e(this._element).addClass("show"),this._config.focus&&this._enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t}),r=function(){n._config.focus&&n._element.focus(),n._isTransitioning=!1,e(n._element).trigger(s)};if(i){var a=c.getTransitionDurationFromElement(this._dialog);e(this._dialog).one(c.TRANSITION_END,r).emulateTransitionEnd(a)}else r()},n._enforceFocus=function(){var t=this;e(document).off("focusin.bs.modal").on("focusin.bs.modal",(function(n){document!==n.target&&t._element!==n.target&&0===e(t._element).has(n.target).length&&t._element.focus()}))},n._setEscapeEvent=function(){var t=this;this._isShown?e(this._element).on("keydown.dismiss.bs.modal",(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||e(this._element).off("keydown.dismiss.bs.modal")},n._setResizeEvent=function(){var t=this;this._isShown?e(window).on("resize.bs.modal",(function(e){return t.handleUpdate(e)})):e(window).off("resize.bs.modal")},n._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._isTransitioning=!1,this._showBackdrop((function(){e(document.body).removeClass("modal-open"),t._resetAdjustments(),t._resetScrollbar(),e(t._element).trigger("hidden.bs.modal")}))},n._removeBackdrop=function(){this._backdrop&&(e(this._backdrop).remove(),this._backdrop=null)},n._showBackdrop=function(t){var n=this,i=e(this._element).hasClass("fade")?"fade":"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",i&&this._backdrop.classList.add(i),e(this._backdrop).appendTo(document.body),e(this._element).on("click.dismiss.bs.modal",(function(t){n._ignoreBackdropClick?n._ignoreBackdropClick=!1:t.target===t.currentTarget&&n._triggerBackdropTransition()})),i&&c.reflow(this._backdrop),e(this._backdrop).addClass("show"),!t)return;if(!i)return void t();var o=c.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(c.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){e(this._backdrop).removeClass("show");var s=function(){n._removeBackdrop(),t&&t()};if(e(this._element).hasClass("fade")){var r=c.getTransitionDurationFromElement(this._backdrop);e(this._backdrop).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s()}else t&&t()},n._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},n._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},n._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)<window.innerWidth,this._scrollbarWidth=this._getScrollbarWidth()},n._setScrollbar=function(){var t=this;if(this._isBodyOverflowing){var n=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top")),i=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(n,i){var o=i.style.paddingRight,s=e(i).css("padding-right");e(i).data("padding-right",o).css("padding-right",parseFloat(s)+t._scrollbarWidth+"px")})),e(i).each((function(n,i){var o=i.style.marginRight,s=e(i).css("margin-right");e(i).data("margin-right",o).css("margin-right",parseFloat(s)-t._scrollbarWidth+"px")}));var o=document.body.style.paddingRight,s=e(document.body).css("padding-right");e(document.body).data("padding-right",o).css("padding-right",parseFloat(s)+this._scrollbarWidth+"px")}e(document.body).addClass("modal-open")},n._resetScrollbar=function(){var t=[].slice.call(document.querySelectorAll(".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"));e(t).each((function(t,n){var i=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=i||""}));var n=[].slice.call(document.querySelectorAll(".sticky-top"));e(n).each((function(t,n){var i=e(n).data("margin-right");"undefined"!=typeof i&&e(n).css("margin-right",i).removeData("margin-right")}));var i=e(document.body).data("padding-right");e(document.body).removeData("padding-right"),document.body.style.paddingRight=i||""},n._getScrollbarWidth=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},t._jQueryInterface=function(n,i){return this.each((function(){var o=e(this).data("bs.modal"),s=a(a(a({},x),e(this).data()),"object"==typeof n&&n?n:{});if(o||(o=new t(this,s),e(this).data("bs.modal",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](i)}else s.show&&o.show(i)}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return x}}]),t}();e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(t){var n,i=this,o=c.getSelectorFromElement(this);o&&(n=document.querySelector(o));var s=e(n).data("bs.modal")?"toggle":a(a({},e(n).data()),e(this).data());"A"!==this.tagName&&"AREA"!==this.tagName||t.preventDefault();var r=e(n).one("show.bs.modal",(function(t){t.isDefaultPrevented()||r.one("hidden.bs.modal",(function(){e(i).is(":visible")&&i.focus()}))}));R._jQueryInterface.call(e(n),s,this)})),e.fn.modal=R._jQueryInterface,e.fn.modal.Constructor=R,e.fn.modal.noConflict=function(){return e.fn.modal=P,R._jQueryInterface};var q=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],F={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Q=/^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi,B=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;function H(t,e,n){if(0===t.length)return t;if(n&&"function"==typeof n)return n(t);for(var i=(new window.DOMParser).parseFromString(t,"text/html"),o=Object.keys(e),s=[].slice.call(i.body.querySelectorAll("*")),r=function(t,n){var i=s[t],r=i.nodeName.toLowerCase();if(-1===o.indexOf(i.nodeName.toLowerCase()))return i.parentNode.removeChild(i),"continue";var a=[].slice.call(i.attributes),l=[].concat(e["*"]||[],e[r]||[]);a.forEach((function(t){(function(t,e){var n=t.nodeName.toLowerCase();if(-1!==e.indexOf(n))return-1===q.indexOf(n)||Boolean(t.nodeValue.match(Q)||t.nodeValue.match(B));for(var i=e.filter((function(t){return t instanceof RegExp})),o=0,s=i.length;o<s;o++)if(n.match(i[o]))return!0;return!1})(t,l)||i.removeAttribute(t.nodeName)}))},a=0,l=s.length;a<l;a++)r(a);return i.body.innerHTML}var U="tooltip",M=e.fn[U],W=new RegExp("(^|\\s)bs-tooltip\\S+","g"),V=["sanitize","whiteList","sanitizeFn"],z={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},K={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"},X={animation:!0,template:'<div class="tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:F,popperConfig:null},Y={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},$=function(){function t(t,e){if("undefined"==typeof n)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var i=t.prototype;return i.enable=function(){this._isEnabled=!0},i.disable=function(){this._isEnabled=!1},i.toggleEnabled=function(){this._isEnabled=!this._isEnabled},i.toggle=function(t){if(this._isEnabled)if(t){var n=this.constructor.DATA_KEY,i=e(t.currentTarget).data(n);i||(i=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(e(this.getTipElement()).hasClass("show"))return void this._leave(null,this);this._enter(null,this)}},i.dispose=function(){clearTimeout(this._timeout),e.removeData(this.element,this.constructor.DATA_KEY),e(this.element).off(this.constructor.EVENT_KEY),e(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&e(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},i.show=function(){var t=this;if("none"===e(this.element).css("display"))throw new Error("Please use show on visible elements");var i=e.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){e(this.element).trigger(i);var o=c.findShadowRoot(this.element),s=e.contains(null!==o?o:this.element.ownerDocument.documentElement,this.element);if(i.isDefaultPrevented()||!s)return;var r=this.getTipElement(),a=c.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&e(r).addClass("fade");var l="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,h=this._getAttachment(l);this.addAttachmentClass(h);var u=this._getContainer();e(r).data(this.constructor.DATA_KEY,this),e.contains(this.element.ownerDocument.documentElement,this.tip)||e(r).appendTo(u),e(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new n(this.element,r,this._getPopperConfig(h)),e(r).addClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().on("mouseover",null,e.noop);var d=function(){t.config.animation&&t._fixTransition();var n=t._hoverState;t._hoverState=null,e(t.element).trigger(t.constructor.Event.SHOWN),"out"===n&&t._leave(null,t)};if(e(this.tip).hasClass("fade")){var f=c.getTransitionDurationFromElement(this.tip);e(this.tip).one(c.TRANSITION_END,d).emulateTransitionEnd(f)}else d()}},i.hide=function(t){var n=this,i=this.getTipElement(),o=e.Event(this.constructor.Event.HIDE),s=function(){"show"!==n._hoverState&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),e(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),t&&t()};if(e(this.element).trigger(o),!o.isDefaultPrevented()){if(e(i).removeClass("show"),"ontouchstart"in document.documentElement&&e(document.body).children().off("mouseover",null,e.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,e(this.tip).hasClass("fade")){var r=c.getTransitionDurationFromElement(i);e(i).one(c.TRANSITION_END,s).emulateTransitionEnd(r)}else s();this._hoverState=""}},i.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},i.isWithContent=function(){return Boolean(this.getTitle())},i.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-tooltip-"+t)},i.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},i.setContent=function(){var t=this.getTipElement();this.setElementContent(e(t.querySelectorAll(".tooltip-inner")),this.getTitle()),e(t).removeClass("fade show")},i.setElementContent=function(t,n){"object"!=typeof n||!n.nodeType&&!n.jquery?this.config.html?(this.config.sanitize&&(n=H(n,this.config.whiteList,this.config.sanitizeFn)),t.html(n)):t.text(n):this.config.html?e(n).parent().is(t)||t.empty().append(n):t.text(e(n).text())},i.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},i._getPopperConfig=function(t){var e=this;return a(a({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),this.config.popperConfig)},i._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=a(a({},e.offsets),t.config.offset(e.offsets,t.element)||{}),e}:e.offset=this.config.offset,e},i._getContainer=function(){return!1===this.config.container?document.body:c.isElement(this.config.container)?e(this.config.container):e(document).find(this.config.container)},i._getAttachment=function(t){return K[t.toUpperCase()]},i._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(n){if("click"===n)e(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==n){var i="hover"===n?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o="hover"===n?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;e(t.element).on(i,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},e(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=a(a({},this.config),{},{trigger:"manual",selector:""}):this._fixTitle()},i._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},i._enter=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusin"===t.type?"focus":"hover"]=!0),e(n.getTipElement()).hasClass("show")||"show"===n._hoverState?n._hoverState="show":(clearTimeout(n._timeout),n._hoverState="show",n.config.delay&&n.config.delay.show?n._timeout=setTimeout((function(){"show"===n._hoverState&&n.show()}),n.config.delay.show):n.show())},i._leave=function(t,n){var i=this.constructor.DATA_KEY;(n=n||e(t.currentTarget).data(i))||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),e(t.currentTarget).data(i,n)),t&&(n._activeTrigger["focusout"===t.type?"focus":"hover"]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState="out",n.config.delay&&n.config.delay.hide?n._timeout=setTimeout((function(){"out"===n._hoverState&&n.hide()}),n.config.delay.hide):n.hide())},i._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},i._getConfig=function(t){var n=e(this.element).data();return Object.keys(n).forEach((function(t){-1!==V.indexOf(t)&&delete n[t]})),"number"==typeof(t=a(a(a({},this.constructor.Default),n),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),c.typeCheckConfig(U,t,this.constructor.DefaultType),t.sanitize&&(t.template=H(t.template,t.whiteList,t.sanitizeFn)),t},i._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},i._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(W);null!==n&&n.length&&t.removeClass(n.join(""))},i._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},i._fixTransition=function(){var t=this.getTipElement(),n=this.config.animation;null===t.getAttribute("x-placement")&&(e(t).removeClass("fade"),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.tooltip"),o="object"==typeof n&&n;if((i||!/dispose|hide/.test(n))&&(i||(i=new t(this,o),e(this).data("bs.tooltip",i)),"string"==typeof n)){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return X}},{key:"NAME",get:function(){return U}},{key:"DATA_KEY",get:function(){return"bs.tooltip"}},{key:"Event",get:function(){return Y}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return z}}]),t}();e.fn[U]=$._jQueryInterface,e.fn[U].Constructor=$,e.fn[U].noConflict=function(){return e.fn[U]=M,$._jQueryInterface};var J="popover",G=e.fn[J],Z=new RegExp("(^|\\s)bs-popover\\S+","g"),tt=a(a({},$.Default),{},{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'}),et=a(a({},$.DefaultType),{},{content:"(string|element|function)"}),nt={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},it=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var r=s.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){e(this.getTipElement()).addClass("bs-popover-"+t)},r.getTipElement=function(){return this.tip=this.tip||e(this.config.template)[0],this.tip},r.setContent=function(){var t=e(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(t.find(".popover-body"),n),t.removeClass("fade show")},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=e(this.getTipElement()),n=t.attr("class").match(Z);null!==n&&n.length>0&&t.removeClass(n.join(""))},s._jQueryInterface=function(t){return this.each((function(){var n=e(this).data("bs.popover"),i="object"==typeof t?t:null;if((n||!/dispose|hide/.test(t))&&(n||(n=new s(this,i),e(this).data("bs.popover",n)),"string"==typeof t)){if("undefined"==typeof n[t])throw new TypeError('No method named "'+t+'"');n[t]()}}))},o(s,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return tt}},{key:"NAME",get:function(){return J}},{key:"DATA_KEY",get:function(){return"bs.popover"}},{key:"Event",get:function(){return nt}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return et}}]),s}($);e.fn[J]=it._jQueryInterface,e.fn[J].Constructor=it,e.fn[J].noConflict=function(){return e.fn[J]=G,it._jQueryInterface};var ot="scrollspy",st=e.fn[ot],rt={offset:10,method:"auto",target:""},at={offset:"number",method:"string",target:"(string|element)"},lt=function(){function t(t,n){var i=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(n),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,e(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return i._process(t)})),this.refresh(),this._process()}var n=t.prototype;return n.refresh=function(){var t=this,n=this._scrollElement===this._scrollElement.window?"offset":"position",i="auto"===this._config.method?n:this._config.method,o="position"===i?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var n,s=c.getSelectorFromElement(t);if(s&&(n=document.querySelector(s)),n){var r=n.getBoundingClientRect();if(r.width||r.height)return[e(n)[i]().top+o,s]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},n.dispose=function(){e.removeData(this._element,"bs.scrollspy"),e(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},n._getConfig=function(t){if("string"!=typeof(t=a(a({},rt),"object"==typeof t&&t?t:{})).target&&c.isElement(t.target)){var n=e(t.target).attr("id");n||(n=c.getUID(ot),e(t.target).attr("id",n)),t.target="#"+n}return c.typeCheckConfig(ot,t,at),t},n._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},n._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},n._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},n._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t<this._offsets[0]&&this._offsets[0]>0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;){this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t<this._offsets[o+1])&&this._activate(this._targets[o])}}},n._activate=function(t){this._activeTarget=t,this._clear();var n=this._selector.split(",").map((function(e){return e+'[data-target="'+t+'"],'+e+'[href="'+t+'"]'})),i=e([].slice.call(document.querySelectorAll(n.join(","))));i.hasClass("dropdown-item")?(i.closest(".dropdown").find(".dropdown-toggle").addClass("active"),i.addClass("active")):(i.addClass("active"),i.parents(".nav, .list-group").prev(".nav-link, .list-group-item").addClass("active"),i.parents(".nav, .list-group").prev(".nav-item").children(".nav-link").addClass("active")),e(this._scrollElement).trigger("activate.bs.scrollspy",{relatedTarget:t})},n._clear=function(){[].slice.call(document.querySelectorAll(this._selector)).filter((function(t){return t.classList.contains("active")})).forEach((function(t){return t.classList.remove("active")}))},t._jQueryInterface=function(n){return this.each((function(){var i=e(this).data("bs.scrollspy");if(i||(i=new t(this,"object"==typeof n&&n),e(this).data("bs.scrollspy",i)),"string"==typeof n){if("undefined"==typeof i[n])throw new TypeError('No method named "'+n+'"');i[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"Default",get:function(){return rt}}]),t}();e(window).on("load.bs.scrollspy.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-spy="scroll"]')),n=t.length;n--;){var i=e(t[n]);lt._jQueryInterface.call(i,i.data())}})),e.fn[ot]=lt._jQueryInterface,e.fn[ot].Constructor=lt,e.fn[ot].noConflict=function(){return e.fn[ot]=st,lt._jQueryInterface};var ct=e.fn.tab,ht=function(){function t(t){this._element=t}var n=t.prototype;return n.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&e(this._element).hasClass("active")||e(this._element).hasClass("disabled"))){var n,i,o=e(this._element).closest(".nav, .list-group")[0],s=c.getSelectorFromElement(this._element);if(o){var r="UL"===o.nodeName||"OL"===o.nodeName?"> li > .active":".active";i=(i=e.makeArray(e(o).find(r)))[i.length-1]}var a=e.Event("hide.bs.tab",{relatedTarget:this._element}),l=e.Event("show.bs.tab",{relatedTarget:i});if(i&&e(i).trigger(a),e(this._element).trigger(l),!l.isDefaultPrevented()&&!a.isDefaultPrevented()){s&&(n=document.querySelector(s)),this._activate(this._element,o);var h=function(){var n=e.Event("hidden.bs.tab",{relatedTarget:t._element}),o=e.Event("shown.bs.tab",{relatedTarget:i});e(i).trigger(n),e(t._element).trigger(o)};n?this._activate(n,n.parentNode,h):h()}}},n.dispose=function(){e.removeData(this._element,"bs.tab"),this._element=null},n._activate=function(t,n,i){var o=this,s=(!n||"UL"!==n.nodeName&&"OL"!==n.nodeName?e(n).children(".active"):e(n).find("> li > .active"))[0],r=i&&s&&e(s).hasClass("fade"),a=function(){return o._transitionComplete(t,s,i)};if(s&&r){var l=c.getTransitionDurationFromElement(s);e(s).removeClass("show").one(c.TRANSITION_END,a).emulateTransitionEnd(l)}else a()},n._transitionComplete=function(t,n,i){if(n){e(n).removeClass("active");var o=e(n.parentNode).find("> .dropdown-menu .active")[0];o&&e(o).removeClass("active"),"tab"===n.getAttribute("role")&&n.setAttribute("aria-selected",!1)}if(e(t).addClass("active"),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),c.reflow(t),t.classList.contains("fade")&&t.classList.add("show"),t.parentNode&&e(t.parentNode).hasClass("dropdown-menu")){var s=e(t).closest(".dropdown")[0];if(s){var r=[].slice.call(s.querySelectorAll(".dropdown-toggle"));e(r).addClass("active")}t.setAttribute("aria-expanded",!0)}i&&i()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.tab");if(o||(o=new t(this),i.data("bs.tab",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n]()}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}}]),t}();e(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),ht._jQueryInterface.call(e(this),"show")})),e.fn.tab=ht._jQueryInterface,e.fn.tab.Constructor=ht,e.fn.tab.noConflict=function(){return e.fn.tab=ct,ht._jQueryInterface};var ut=e.fn.toast,dt={animation:"boolean",autohide:"boolean",delay:"number"},ft={animation:!0,autohide:!0,delay:500},gt=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var n=t.prototype;return n.show=function(){var t=this,n=e.Event("show.bs.toast");if(e(this._element).trigger(n),!n.isDefaultPrevented()){this._config.animation&&this._element.classList.add("fade");var i=function(){t._element.classList.remove("showing"),t._element.classList.add("show"),e(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove("hide"),c.reflow(this._element),this._element.classList.add("showing"),this._config.animation){var o=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,i).emulateTransitionEnd(o)}else i()}},n.hide=function(){if(this._element.classList.contains("show")){var t=e.Event("hide.bs.toast");e(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},n.dispose=function(){clearTimeout(this._timeout),this._timeout=null,this._element.classList.contains("show")&&this._element.classList.remove("show"),e(this._element).off("click.dismiss.bs.toast"),e.removeData(this._element,"bs.toast"),this._element=null,this._config=null},n._getConfig=function(t){return t=a(a(a({},ft),e(this._element).data()),"object"==typeof t&&t?t:{}),c.typeCheckConfig("toast",t,this.constructor.DefaultType),t},n._setListeners=function(){var t=this;e(this._element).on("click.dismiss.bs.toast",'[data-dismiss="toast"]',(function(){return t.hide()}))},n._close=function(){var t=this,n=function(){t._element.classList.add("hide"),e(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove("show"),this._config.animation){var i=c.getTransitionDurationFromElement(this._element);e(this._element).one(c.TRANSITION_END,n).emulateTransitionEnd(i)}else n()},t._jQueryInterface=function(n){return this.each((function(){var i=e(this),o=i.data("bs.toast");if(o||(o=new t(this,"object"==typeof n&&n),i.data("bs.toast",o)),"string"==typeof n){if("undefined"==typeof o[n])throw new TypeError('No method named "'+n+'"');o[n](this)}}))},o(t,null,[{key:"VERSION",get:function(){return"4.5.0"}},{key:"DefaultType",get:function(){return dt}},{key:"Default",get:function(){return ft}}]),t}();e.fn.toast=gt._jQueryInterface,e.fn.toast.Constructor=gt,e.fn.toast.noConflict=function(){return e.fn.toast=ut,gt._jQueryInterface},t.Alert=d,t.Button=g,t.Carousel=E,t.Collapse=D,t.Dropdown=j,t.Modal=R,t.Popover=it,t.Scrollspy=lt,t.Tab=ht,t.Toast=gt,t.Tooltip=$,t.Util=c,Object.defineProperty(t,"__esModule",{value:!0})}));
  7 +//# sourceMappingURL=bootstrap.min.js.map
0 8 \ No newline at end of file
... ...
src/main/resources/static/real_control_v2/call/assets/js/index.js 0 → 100644
  1 +// SDK 配置
  2 +var Config = {
  3 + APPID: "fa58d0ebb1b6668817a698058deb122a", // 应用ID
  4 + RTC_MODE: "live", //RTC 通信模式
  5 + RTC_CODEC: "h264", //RTC 视频编码格式
  6 + SELECT_CAMERA_DEVICE:
  7 + sessionStorage.getItem("defaultCameraDeviceId") || undefined,
  8 + // RTC 私有云配置
  9 + RTC_setParameters: {
  10 + // 是否开启私有云配置
  11 + switch: false,
  12 + // setParameters: {
  13 + // //配置私有云网关
  14 + // ConfPriCloudAddr: {
  15 + // ServerAdd: "",
  16 + // Port: ,
  17 + // Wss: false,
  18 + // },
  19 + // },
  20 + },
  21 + // RTM 私有云配置
  22 + RTM_setParameters: {
  23 + // 是否开启私有云配置
  24 + switch: false,
  25 + // setParameters: {
  26 + // //配置内网网关
  27 + // confPriCloudAddr: {
  28 + // ServerAdd: "",
  29 + // Port: ,
  30 + // Wss: false,
  31 + // },
  32 + // },
  33 + },
  34 +};
  35 +
  36 +// 页面工具类
  37 +var Utils = {
  38 + // 生成uid
  39 + // generateNumber(len) {
  40 + // var numLen = len || 8;
  41 + // var generateNum = Math.ceil(Math.random() * Math.pow(10, numLen));
  42 + // return generateNum < Math.pow(10, numLen - 1)
  43 + // ? Utils.generateNumber(numLen)
  44 + // : generateNum;
  45 + // },
  46 + generateNumber(len) {
  47 + var numLen = len || 8;
  48 + var generateNum = Math.ceil(Math.random() * Math.pow(10, numLen));
  49 + return 9999;
  50 + },
  51 + // 断网处理
  52 + updateOnlineStatus(e) {
  53 + // 仅p2p
  54 + if (!Store.Conference && Store.network.status != 0) {
  55 + const { type } = e;
  56 + Store.localwork = type === "online";
  57 + if (navigator.onLine) {
  58 + Store.networkSet && clearTimeout(Store.networkSet);
  59 + console.log("重连后查询对方状态信息", Store);
  60 + // 重连后查询对方状态信息
  61 + OperationPackge.p2p.networkSendInfo();
  62 + // 连网
  63 + } else {
  64 + Store.networkSet && clearTimeout(Store.networkSet);
  65 + Utils.alertWhole("网络异常");
  66 + // 断网 30s 无网络连接自动挂断
  67 + Store.networkSet = setTimeout(() => {
  68 + console.log("断网 30s 无网络连接自动挂断", Store);
  69 + Store.lineworkRTC = false;
  70 + OperationPackge.p2p.cancelCall(3);
  71 + }, 22000);
  72 + let oTimr = 0;
  73 + let onTimr = setInterval(() => {
  74 + oTimr++;
  75 + if (navigator.onLine || oTimr >= 22) {
  76 + clearInterval(onTimr);
  77 + Store.networkSet && clearTimeout(Store.networkSet);
  78 + }
  79 + }, 1000);
  80 + }
  81 + }
  82 + },
  83 + // 事件打印
  84 + printLog() {
  85 + console.log.apply(this, arguments);
  86 + },
  87 + // 局部警告框
  88 + alertError: function (errorText) {
  89 + var errMsg = $(
  90 + `
  91 + <div class="alert alert-danger" role="alert">
  92 + <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  93 + <span id="errorConten">${errorText}</span>
  94 + </div>
  95 + `
  96 + );
  97 + $("#warningBox").html("").append(errMsg);
  98 + //警告框自动消失
  99 + setTimeout(function () {
  100 + $('[data-dismiss="alert"]').alert("close");
  101 + }, 2000);
  102 + },
  103 + // 全局警告框
  104 + alertWhole: function (text, classStyle) {
  105 + if (!classStyle) {
  106 + classStyle = "alert-danger";
  107 + }
  108 + var oMsg = $(
  109 + `
  110 + <div class="alert ${classStyle}" role="alert">
  111 + <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  112 + <span id="errorConten">${text}</span>
  113 + </div>
  114 + `
  115 + );
  116 + $("#warningWholeBox").html("").append(oMsg);
  117 + //警告框自动消失
  118 + setTimeout(function () {
  119 + $('[data-dismiss="alert"]').alert("close");
  120 + }, 2000);
  121 + },
  122 + //修改标题名称
  123 + setPageTitle: function (title) {
  124 + $("title").html(title);
  125 + },
  126 + // 生成用户标签
  127 + createButtonUser: function (allInputVal) {
  128 + if (Store.invitationUserIds.length <= 5) {
  129 + if (
  130 + !~Store.invitationUserIds.indexOf(allInputVal) &&
  131 + allInputVal != Store.ownUserId
  132 + ) {
  133 + // 并创建新的div存放
  134 + Store.invitationUserIds.push(allInputVal);
  135 + var opt = $(
  136 + '<button type="button" class="btn btn-light user-tag" onclick="Utils.deleteButtonUser(this, ' +
  137 + allInputVal +
  138 + ')">' +
  139 + allInputVal +
  140 + '<i class="iconfont icon-delete_close"></i>' +
  141 + '<i class="iconfont icon-delete_open"></i>' +
  142 + "</button>"
  143 + );
  144 + $("#multiUserBtn").append(opt);
  145 + } else {
  146 + Utils.alertError("该用户重复输入或不能输入自己");
  147 + }
  148 + } else {
  149 + Utils.alertWhole("不能一次邀请超过6个");
  150 + }
  151 + },
  152 + // 删除邀请用户标签
  153 + deleteButtonUser: function (item, userid) {
  154 + if (!!~Store.invitationUserIds.indexOf("" + userid)) {
  155 + item.remove();
  156 + Store.invitationUserIds.splice(
  157 + Store.invitationUserIds.indexOf("" + userid),
  158 + 1
  159 + );
  160 + if (Store.invitationUserIds.length == 0) {
  161 + !$("#MultipleCalls").hasClass("disabled") &&
  162 + $("#MultipleCalls").addClass("disabled");
  163 + } else {
  164 + $("#MultipleCalls").hasClass("disabled") &&
  165 + $("#MultipleCalls").removeClass("disabled");
  166 + }
  167 + }
  168 + },
  169 + // 创建用户视图窗口 - 自定义用户状态: 0/1 等待应答/无人应答
  170 + createUserView: async function (userid, status) {
  171 + if ($(`#${userid}Window`).length == 0) {
  172 + // console.log("创建窗口", userid);
  173 + // 创建窗口
  174 + var box = $(
  175 + '<div class="video-preview_small_box" id="' + userid + 'Window"></div>'
  176 + );
  177 + var basicView = $(
  178 + '<div class="d-flex video-preview justify-content-center align-items-center" id="' +
  179 + userid +
  180 + 'VideoView">' +
  181 + '<div class="basicView_img" id="' +
  182 + userid +
  183 + 'basicView_img"><img draggable="false" class="d-flex img-responsive" src="assets/images/logo_title.png" /></div>' +
  184 + "</div>" +
  185 + "<!-- 左下角小方格 -->" +
  186 + '<div class="prompt_little d-flex" id="' +
  187 + userid +
  188 + "PromptLittle" +
  189 + '">' +
  190 + '<i class="iconfont icon-audio_close_slant icon_color_red" id="' +
  191 + userid +
  192 + 'AudioState"></i>' +
  193 + "<div>" +
  194 + userid +
  195 + "</div>" +
  196 + "</div>"
  197 + );
  198 + var statusView = $(
  199 + "<!-- 用户不在线 无人应答 拒绝 -->" +
  200 + '<div id="' +
  201 + userid +
  202 + 'StatusView" class="video-preview_state d-flex justify-content-center align-items-center">' +
  203 + '<div class="video-preview_status d-flex flex-column align-items-center">' +
  204 + '<span><i class="iconfont icon-loading video-icon_font"></i></span>' +
  205 + '<span id="' +
  206 + userid +
  207 + 'Status">' +
  208 + (status === 1 ? "无人应答" : status === 0 && "等待应答") +
  209 + "</span>" +
  210 + "</div>" +
  211 + "</div>"
  212 + );
  213 + box.append(basicView);
  214 + if (status === 0 || status === 3) {
  215 + box.append(statusView);
  216 + // 创建计时
  217 + Store.invitationClearTimeouts["Timeouts" + userid] = setTimeout(
  218 + function () {
  219 + Utils.alertWhole("用户" + userid + "60s无人接听");
  220 + },
  221 + Store.invitationTimeout
  222 + );
  223 + }
  224 + $("#mineMutiTitleVideoPreview").append(box);
  225 + } else {
  226 + // console.log("已经创建视图");
  227 + Utils.updateUserViewStatus(userid, 1);
  228 + }
  229 + },
  230 + // 大小屏幕切换
  231 + switchover: function (user) {
  232 + $(`#${user.uid}Window`).bind("click", function () {
  233 + Utils.switchoverFnBind(user);
  234 + });
  235 + },
  236 + // 大小屏幕切换方法绑定
  237 + switchoverFnBind: async function (user) {
  238 + if (user.uid != Store.bigMutiUser.uid) {
  239 + // 切换对应左下角
  240 + Utils.switchoverLeftBottom(user.uid);
  241 + // 切换后大屏对应的小屏隐藏
  242 + Utils.switchoverHidden(user.uid, false);
  243 + // 原大屏对应的小屏展示
  244 + Utils.switchoverHidden(Store.bigMutiUser.uid, true);
  245 + // 设置为大流
  246 + if (user.videoTrack) {
  247 + user.videoTrack.stop();
  248 + Store.rtcClient
  249 + .setRemoteVideoStreamType(user.uid, 0)
  250 + .then(() => {
  251 + console.log("切换大流成功", user.uid);
  252 + })
  253 + .catch((err) => {
  254 + console.log("切换大流失败", user.uid, err);
  255 + });
  256 +
  257 + await user.videoTrack.play("peerMutiVideoPreview", {
  258 + fit: "contain",
  259 + });
  260 + }
  261 +
  262 + // 设置为小流
  263 + if (Store.bigMutiUser.videoTrack) {
  264 + Store.bigMutiUser.videoTrack.stop();
  265 + Store.rtcClient
  266 + .setRemoteVideoStreamType(Store.bigMutiUser.uid, 1)
  267 + .then(() => {
  268 + console.log("切换小流成功", Store.bigMutiUser.uid);
  269 + })
  270 + .catch((err) => {
  271 + console.log("切换小流失败", Store.bigMutiUser.uid, err);
  272 + });
  273 +
  274 + await Store.bigMutiUser.videoTrack.play(
  275 + Store.bigMutiUser.uid + "VideoView",
  276 + {
  277 + fit: "contain",
  278 + }
  279 + );
  280 + }
  281 +
  282 + // 本地视频窗口(大屏)
  283 + if (user.uid == Store.ownUserId) {
  284 + Utils.localVideoSwitch(user.uid, Store.setting.enableVideo);
  285 + } else {
  286 + $("#peerMutiVideoPreviewbasicView_img").hasClass(
  287 + "basicView_img_index"
  288 + ) &&
  289 + $("#peerMutiVideoPreviewbasicView_img").removeClass(
  290 + "basicView_img_index"
  291 + );
  292 + // console.log("远端视频为大屏");
  293 + // Utils.localVideoSwitch(user.uid,true);
  294 + }
  295 +
  296 + Store.bigMutiUser = user;
  297 + }
  298 + },
  299 + // 大小屏幕切换后,大小对应左下角切换
  300 + switchoverLeftBottom: function (bigUid) {
  301 + // 获取对应的音频类别
  302 + var oldbigUid = $("#" + bigUid + "AudioState")?.attr("class");
  303 + // 大屏对应左下角展示
  304 + var boxBig = $(
  305 + `
  306 + <i class="${oldbigUid}" id="${bigUid + "BigAudioState"}"></i>
  307 + <div>${bigUid}</div>
  308 + `
  309 + );
  310 + $("#peerMutiVideoPreviewLeftBottom").html("");
  311 + $("#peerMutiVideoPreviewLeftBottom").append(boxBig);
  312 + },
  313 + // 大屏对应的小屏展示隐藏
  314 + switchoverHidden: function (bigUid, state) {
  315 + if (state) {
  316 + // 对应小屏展示
  317 + $("#" + bigUid + "Window").removeClass("d-none");
  318 + } else {
  319 + // 对应小屏隐藏
  320 + $("#" + bigUid + "Window").addClass("d-none");
  321 + }
  322 + },
  323 + // 本地视频开关触发样式
  324 + localVideoSwitch: function (uid, state) {
  325 + if (state) {
  326 + $("#peerMutiVideoPreviewbasicView_img").hasClass("basicView_img_index") &&
  327 + $("#peerMutiVideoPreviewbasicView_img").removeClass(
  328 + "basicView_img_index"
  329 + );
  330 + // 小屏
  331 + $("#" + uid + "basicView_img").hasClass("basicView_img_index") &&
  332 + $("#" + uid + "basicView_img").removeClass("basicView_img_index");
  333 + } else {
  334 + if (Store.bigMutiUser.uid == uid) {
  335 + !$("#peerMutiVideoPreviewbasicView_img").hasClass(
  336 + "basicView_img_index"
  337 + ) &&
  338 + $("#peerMutiVideoPreviewbasicView_img").addClass(
  339 + "basicView_img_index"
  340 + );
  341 + }
  342 + !$("#" + uid + "basicView_img").hasClass("basicView_img_index") &&
  343 + $("#" + uid + "basicView_img").addClass("basicView_img_index");
  344 + }
  345 + },
  346 + // 更新用户在线状态
  347 + updateUserViewStatus: function (userid, status) {
  348 + // console.log("更新用户在线状态");
  349 + Store.invitationUserIds.map(function (item) {
  350 + if (item === userid) {
  351 + if (status === 1 || status === 2) {
  352 + // 自定义用户状态: 0/1/2/3 无人应答/对方同意/对方拒绝/对方不在线
  353 + $("#" + userid + "StatusView").remove();
  354 + // 停止计时
  355 + Store.invitationClearTimeouts["Timeouts" + userid] &&
  356 + clearTimeout(Store.invitationClearTimeouts["Timeouts" + userid]);
  357 + } else {
  358 + $("#" + userid + "Status").html(
  359 + status === 0 ? "等待应答" : status === 2 && "对方拒绝"
  360 + );
  361 + }
  362 + }
  363 + });
  364 + },
  365 + // 删除用户视图窗口
  366 + deleteUserView: async function (userid) {
  367 + // console.log("删除用户视图", userid);
  368 + // 停止计时
  369 + Store.invitationClearTimeouts["Timeouts" + userid] &&
  370 + clearTimeout(Store.invitationClearTimeouts["Timeouts" + userid]);
  371 + Store.invitationUserIds.map(function (item, index) {
  372 + if (item === userid) {
  373 + Store.invitationUserIds.splice(index, 1);
  374 + }
  375 + });
  376 + // 如果删除的视图有大视图,清空大视图存储数据
  377 + if (Store.bigMutiUser && Store.bigMutiUser.uid === userid) {
  378 + Store.bigMutiUser = {};
  379 + }
  380 + $("#" + userid + "Window") && (await $("#" + userid + "Window").remove());
  381 + // 频道内剩余两人时
  382 + var oUserData = await Store.rtmChannel.getMembers();
  383 + if (oUserData.length < 2) {
  384 + // 释放资源
  385 + await SdkPackge.RTC.LocalTracksClose();
  386 + // 恢复默认
  387 + await OperationPackge.public.restoreDefault();
  388 + await PageShow.initSetingMulti(); // 恢复初始
  389 +
  390 + // 显示首页
  391 + await PageShow.showIndex();
  392 + }
  393 + },
  394 + // 更新用户音频状态
  395 + updateUserAudioState: function (userid, haveAudio) {
  396 + if (haveAudio) {
  397 + $("#" + userid + "AudioState").hasClass("icon-audio_close_slant") &&
  398 + $("#" + userid + "AudioState").removeClass("icon-audio_close_slant");
  399 + // 对应大屏
  400 + $("#" + userid + "BigAudioState")?.hasClass("icon-audio_close_slant") &&
  401 + $("#" + userid + "BigAudioState")?.removeClass(
  402 + "icon-audio_close_slant"
  403 + );
  404 + } else {
  405 + !$("#" + userid + "AudioState").hasClass("icon-audio_close_slant") &&
  406 + $("#" + userid + "AudioState").addClass("icon-audio_close_slant");
  407 +
  408 + // 对应大屏
  409 + !$("#" + userid + "BigAudioState")?.hasClass("icon-audio_close_slant") &&
  410 + $("#" + userid + "BigAudioState")?.addClass("icon-audio_close_slant");
  411 + }
  412 + },
  413 + // 用户ID输入 用户删除id (仅能输入一位用户)
  414 + inputChangId: function (oid) {
  415 + //监听用户ID输入
  416 + $(oid).bind("input propertychange", function (event) {
  417 + var inputVal = $(this).val();
  418 + var reg = /^[0-9]+$/;
  419 + if (!reg.test(inputVal)) {
  420 + $(this).val("");
  421 + } else {
  422 + $(this).next("input").select();
  423 + $(this).next("input").focus();
  424 + }
  425 + var oItem = "";
  426 + for (var i = 0; i < $(oid).length; i++) {
  427 + oItem = oItem + $(oid)[i].value;
  428 + }
  429 + if (oItem.length == 4) {
  430 + $("#p2pAudioMakeCall").hasClass("disabled") &&
  431 + $("#p2pAudioMakeCall").removeClass("disabled");
  432 + $("#p2pVideoMakeCall").hasClass("disabled") &&
  433 + $("#p2pVideoMakeCall").removeClass("disabled");
  434 + oItem = "";
  435 + } else {
  436 + !$("#p2pAudioMakeCall").hasClass("disabled") &&
  437 + $("#p2pAudioMakeCall").addClass("disabled");
  438 + !$("#p2pVideoMakeCall").hasClass("disabled") &&
  439 + $("#p2pVideoMakeCall").addClass("disabled");
  440 + }
  441 + });
  442 +
  443 + //监听用户删除id
  444 + $(oid).keydown(function (event) {
  445 + //删除往前 添加往后
  446 + if ($(this).index() < 4) {
  447 + if (event.keyCode == 46 || event.keyCode == 8) {
  448 + if (this.value === "") {
  449 + $(this).prev("input").val("");
  450 + $(this).prev("input").focus();
  451 + } else {
  452 + this.value = "";
  453 + }
  454 + // 按钮变暗
  455 + !$("#p2pAudioMakeCall").hasClass("disabled") &&
  456 + $("#p2pAudioMakeCall").addClass("disabled");
  457 + !$("#p2pVideoMakeCall").hasClass("disabled") &&
  458 + $("#p2pVideoMakeCall").addClass("disabled");
  459 + }
  460 + }
  461 + });
  462 + },
  463 + // 用户ID输入 用户删除id (输入多位用户并输出)
  464 + inputChangIds: function () {
  465 + // 监听用户ID输入 - 创建用户用户标签
  466 + $("#multiUserInputs > input").bind(
  467 + "input propertychange",
  468 + function (event) {
  469 + var inputVal = $(this).val();
  470 + var reg = /^[0-9]+$/;
  471 + if (!reg.test(inputVal)) {
  472 + $(this).val("");
  473 + } else {
  474 + $(this).next("input").select();
  475 + $(this).next("input").focus();
  476 + var allInputVal = "";
  477 + $("#multiUserInputs > input").each(function () {
  478 + allInputVal += this.value;
  479 + });
  480 + // 筛选并创建用户标签
  481 + if (allInputVal.length === 4) {
  482 + // 生成用户标签
  483 + Utils.createButtonUser(allInputVal);
  484 + // 清空所有输入框
  485 + $("#multiUserInputs > input").each(function () {
  486 + this.value = "";
  487 + });
  488 + $("#multiUserInputs > input")[0].focus();
  489 + }
  490 + }
  491 + if (Store.invitationUserIds.length == 0) {
  492 + !$("#MultipleCalls").hasClass("disabled") &&
  493 + $("#MultipleCalls").addClass("disabled");
  494 + } else {
  495 + $("#MultipleCalls").hasClass("disabled") &&
  496 + $("#MultipleCalls").removeClass("disabled");
  497 + }
  498 + }
  499 + );
  500 + // 监听用户删除id
  501 + $("#multiUserInputs > input").keydown(function (event) {
  502 + // 删除往前 添加往后
  503 + if ($(this).index() < 4) {
  504 + if (event.keyCode == 46 || event.keyCode == 8) {
  505 + if (this.value === "") {
  506 + $(this).prev("input").val("");
  507 + $(this).prev("input").focus();
  508 + } else {
  509 + this.value = "";
  510 + }
  511 + }
  512 + }
  513 + });
  514 + },
  515 +};
  516 +
  517 +// 本地数据存储
  518 +var Store = {
  519 + // 麦克风设备记录
  520 + microhonesList: [],
  521 + // 摄像头设备记录
  522 + camerasList: [],
  523 +
  524 + repetitionClick: false, // 按钮重复点击标记
  525 + Conference: false, // 选择的呼叫模式 false: p2p呼叫 true: 多人呼叫
  526 + Calling: false, // 正在通话中(标识)
  527 + JoinRTCChannel: false, // 加入 RTC 频道(标识)
  528 + rtcClient: null, // 存放 RTC 客户端
  529 + rtmClient: null, // 存放 RTM 客户端
  530 + rtmChannel: null, // 存放 RTM 频道实例
  531 + localInvitation: null, // 存放主叫邀请实例
  532 + invitationClearTimeouts: {}, // 存放多个有效期计时(定时器仅多人呼叫使用)
  533 + bigMutiUser: {}, // 大屏展示(仅多人呼叫使用)
  534 + recordUser: [], // 记录页面展示的音视频轨道(仅多人呼叫使用)
  535 + // 大屏展示(仅多人呼叫使用)
  536 + bigMutiUser: {
  537 + uid: "",
  538 + videoTrack: null,
  539 + },
  540 + remoteInvitation: null, // 存放被叫邀请实例
  541 + invitationTimeout: 58 * 1000, // 邀请有效期限
  542 + invitationClearTimeout: null, // 邀请有效期计时(定时器)
  543 + callDurationInterval: 0, // 通话时长
  544 + callDurationClearInterval: null, // 通话时长计时(定时器)
  545 + ownUserId: "" + Utils.generateNumber(4), //自己的用户ID - 这里需要转字符串
  546 + peerUserId: "", // 远端的用户的ID
  547 + // peerUserIdRTM: "", // 远端用户RTM的id
  548 + channelId: "" + Utils.generateNumber(9), // 频道房间
  549 + // RTC 本地采集的音视频轨道
  550 + localTracks: {
  551 + videoTrack: null,
  552 + audioTrack: null,
  553 + },
  554 + // RTC 远端视频轨道
  555 + remoteVideoTracks: null,
  556 + // 设置
  557 + setting: {
  558 + // p2p设置
  559 + // 是否显示视频相关数据
  560 + videoDataShow: false,
  561 + // 数据显示定时器
  562 + videoStatsInterval: null,
  563 +
  564 + videoSize: [1920, 1080], //设置视频采集的分辨率大小
  565 + audioDevice: "default", // 设置音频设备ID
  566 + videoDevice: "default", // 设置视频设备ID
  567 + // 多人设置
  568 + enableAudio: true, // 声音开关
  569 + enableVideo: true, // 视频开关
  570 + },
  571 + invitationUserIds: [], // 存放多人通话的用户id
  572 + // 接听后频道无人
  573 + callChannelPro: null,
  574 + callChannelProTime: 15000,
  575 +
  576 + localwork: true, // 本地网络
  577 + lineworkRTM: true, // RTM网络连接状态
  578 + lineworkRTC: true, // RTC网络连接状态
  579 + // 断网相关(p2p)
  580 + network: {
  581 + // type: "rtm", // 断网时所在页面 rtm rtc
  582 + calltype: 0, // 呼叫类型 0:主叫 1:被叫
  583 + status: 0, // 当前状态 呼叫中:1 已接受:2 挂断:0
  584 + Mode: 0, // 通话类型 语音、视频
  585 + },
  586 + networkSet: null, // 断网定时挂断
  587 + networkTime: 30000, // 断网定时挂断时间
  588 + remodVideoEnd: null, // 远端断网定时器
  589 + remodVideoEndTime: 10000,
  590 + networkReconnection: null, // 断网重连后发送信息无响应
  591 + networkReconnectionTime: 10000,
  592 +};
  593 +// 页面隐藏显示操作类
  594 +var PageShow = {
  595 + // 显示首页
  596 + showIndex: function () {
  597 + !$("#meetPage").hasClass("d-none") && $("#meetPage").addClass("d-none");
  598 + $("#homePage").hasClass("d-none") && $("#homePage").removeClass("d-none");
  599 + !$("#loginForm").hasClass("d-none") && $("#loginForm").addClass("d-none");
  600 + !$("#loginMutiFprm").hasClass("d-none") &&
  601 + $("#loginMutiFprm").addClass("d-none");
  602 + $("#loginHome").hasClass("d-none") && $("#loginHome").removeClass("d-none");
  603 + !$("#makeCallPage").hasClass("d-none") &&
  604 + $("#makeCallPage").addClass("d-none");
  605 + !$("#reciveCallPage").hasClass("d-none") &&
  606 + $("#reciveCallPage").addClass("d-none");
  607 + !$("#audioPage").hasClass("d-none") && $("#audioPage").addClass("d-none");
  608 + !$("#meetMutiPage").hasClass("d-none") &&
  609 + $("#meetMutiPage").addClass("d-none");
  610 + },
  611 + // 初始设置 (P2P)
  612 + initSetingP2P: function () {
  613 + debugger
  614 + // 清空所有输入框 (p2p)
  615 + $("#userInputs > input").each(function () {
  616 + this.value = "";
  617 + });
  618 + // 音频通话计时
  619 + $("#audioDuration").html("00:00");
  620 + // 视频通话计时
  621 + $("#videoDuration").html("00:00");
  622 + $("#mineVideoPreview_bg").css("zIndex", "0");
  623 + $("#audioSwitchBtn > i")
  624 + .removeClass("icon-_yinpinguanbizhong")
  625 + .addClass("icon-_yinpinkaiqizhong icon_color_blue");
  626 + $("#mineVideoPreview").html($("#mineVideoPreview_bg"));
  627 + $("#peerVideoPreview").html($("#peerVideoPreview_bg"));
  628 + !$("#p2pAudioMakeCall").hasClass("disabled") &&
  629 + $("#p2pAudioMakeCall").addClass("disabled");
  630 + !$("#p2pVideoMakeCall").hasClass("disabled") &&
  631 + $("#p2pVideoMakeCall").addClass("disabled");
  632 + !$("#MultipleCalls").hasClass("disabled") &&
  633 + $("#MultipleCalls").addClass("disabled");
  634 + $("#loginMutiSetting").hasClass("show") &&
  635 + $("#loginMutiSetting").removeClass("show");
  636 + },
  637 + // 断网重连(p2p)
  638 + networkP2P: function () {
  639 + $("#peerVideoPreview").html($("#peerVideoPreview_bg"));
  640 + },
  641 + // 断网远端显示/隐藏(p2p)
  642 + networkRemoShow: function (fase = true) {
  643 + $("#peerVideoPreview").html("");
  644 + fase
  645 + ? $("#peerVideoPreview").addClass("video-preview_big_network")
  646 + : $("#peerVideoPreview").removeClass("video-preview_big_network");
  647 + },
  648 + // 初始设置 (多人)
  649 + initSetingMulti: function () {
  650 + $("#mineMutiTitleVideoPreview").html(""); // 清空小窗口
  651 + $("#peerMutiVideoPreview").html(
  652 + $("#peerMutiVideoPreview #peerMutiVideoPreviewbasicView_img")
  653 + ); // 清空大窗口
  654 + $("#callerIdView").html("");
  655 + $("#multiUserBtn").html(""); // 清空生成的标签
  656 + $("#loginMutiSetting").hasClass("show") &&
  657 + $("#loginMutiSetting").removeClass("show");
  658 + },
  659 + // 登录 RTM
  660 + loginRTM: function () {
  661 + $(".own-user-id-view").html(Store.ownUserId);
  662 + $("#openP2PInvite").attr("disabled", false);
  663 + $("#openMultiInvite").attr("disabled", false);
  664 + },
  665 + // 语音呼叫邀请页面
  666 + makeVoiceCall: function () {
  667 + $("#calleeIdView").html(Store.localInvitation.calleeId);
  668 + !$("#homePage").hasClass("d-none") && $("#homePage").addClass("d-none");
  669 + !$("#makeCallPage").hasClass("d-none") &&
  670 + $("#makeCallPage").addClass("d-none");
  671 + $("#audioPage").hasClass("d-none") && $("#audioPage").removeClass("d-none");
  672 + },
  673 + // 视频呼叫邀请页面
  674 + makeVideoCall: function () {
  675 + $("#calleeIdView").html(Store.localInvitation.calleeId);
  676 + !$("#homePage").hasClass("d-none") && $("#homePage").addClass("d-none");
  677 + !$("#audioPage").hasClass("d-none") && $("#audioPage").addClass("d-none");
  678 + $("#makeCallPage").hasClass("d-none") &&
  679 + $("#makeCallPage").removeClass("d-none");
  680 + },
  681 + // 被呼叫页面 是否转语音
  682 + toSpeech: function (params) {
  683 + params === 1
  684 + ? $("#changAudioBtn").addClass("d-none")
  685 + : ($(".switch-audio-call_item").fadeIn(),
  686 + $("#changAudioBtn").removeClass("d-none"));
  687 + },
  688 + // 显示被呼叫页面
  689 + showCalledPage: function () {
  690 + $("#callerIdView").html(Store.remoteInvitation.callerId);
  691 + !$("#homePage").hasClass("d-none") && $("#homePage").addClass("d-none");
  692 + $("#reciveCallPage").hasClass("d-none") &&
  693 + $("#reciveCallPage").removeClass("d-none");
  694 + },
  695 + // 隐藏呼叫邀请页面
  696 + hiddenCallPage: function () {
  697 + !$("#makeCallPage").hasClass("d-none") &&
  698 + $("#makeCallPage").addClass("d-none");
  699 + $("#homePage").hasClass("d-none") && $("#homePage").removeClass("d-none");
  700 + !$("#loginForm").hasClass("d-none") && $("#loginForm").addClass("d-none");
  701 + !$("#loginMutiFprm").hasClass("d-none") &&
  702 + $("#loginMutiFprm").addClass("d-none");
  703 + $("#loginHome").hasClass("d-none") && $("#loginHome").removeClass("d-none");
  704 + $("#calleeIdView").html("");
  705 + // 如果在设置页面 退出设置页面
  706 + $("#closeSettingBtn").click();
  707 + },
  708 + // 隐藏被呼叫页面
  709 + hiddenCalledPage: function () {
  710 + !$("#reciveCallPage").hasClass("d-none") &&
  711 + $("#reciveCallPage").addClass("d-none");
  712 + $("#callerIdView").html("");
  713 + },
  714 + // 显示视频页面
  715 + showVideoPage: function () {
  716 + !$("#homePage").hasClass("d-none") && $("#homePage").addClass("d-none");
  717 + !$("#audioPage").hasClass("d-none") && $("#audioPage").addClass("d-none");
  718 + $("#meetPage").hasClass("d-none") && $("#meetPage").removeClass("d-none");
  719 + },
  720 + // 显示语音页面
  721 + showVoicePage: function () {
  722 + !$("#homePage").hasClass("d-none") && $("#homePage").addClass("d-none");
  723 + !$("#meetPage").hasClass("d-none") && $("#meetPage").addClass("d-none");
  724 + $("#audioPage").hasClass("d-none") && $("#audioPage").removeClass("d-none");
  725 + },
  726 + // 音频开关(p2p)
  727 + audioSwitch: function () {
  728 + if (Store.localTracks.audioTrack) {
  729 + Store.localTracks.audioTrack.isMuted
  730 + ? $("#audioSwitchBtn > i")
  731 + .removeClass("icon-audio_open icon_color_blue")
  732 + .addClass("icon-audio_close")
  733 + : $("#audioSwitchBtn > i")
  734 + .removeClass("icon-audio_close")
  735 + .addClass("icon-audio_open icon_color_blue");
  736 + }
  737 + },
  738 +
  739 + // 显示会议页面 (多人)
  740 + showMeetPage: function () {
  741 + !$("#homePage").hasClass("d-none") && $("#homePage").addClass("d-none");
  742 + !$("#audioPage").hasClass("d-none") && $("#audioPage").addClass("d-none");
  743 + !$("#meetPage").hasClass("d-none") && $("#meetPage").addClass("d-none");
  744 + !$("#reciveCallPage").hasClass("d-none") &&
  745 + $("#reciveCallPage").addClass("d-none");
  746 + $("#meetMutiPage").hasClass("d-none") &&
  747 + $("#meetMutiPage").removeClass("d-none");
  748 + },
  749 + // 本地麦克风状态
  750 + setEnableAudio: function (enable) {
  751 + if (enable) {
  752 + !$("#localAudioEnableIcon").hasClass("icon-audio_open") &&
  753 + $("#localAudioEnableIcon").addClass("icon-audio_open");
  754 + $("#localAudioEnableIcon").hasClass("icon-audio_close") &&
  755 + $("#localAudioEnableIcon").removeClass("icon-audio_close");
  756 + } else {
  757 + $("#localAudioEnableIcon").hasClass("icon-audio_open") &&
  758 + $("#localAudioEnableIcon").removeClass("icon-audio_open");
  759 + !$("#localAudioEnableIcon").hasClass("icon-audio_close") &&
  760 + $("#localAudioEnableIcon").addClass("icon-audio_close");
  761 + }
  762 + },
  763 + // 本地摄像头开关
  764 + setEnableVideo: function (enable) {
  765 + if (enable) {
  766 + !$("#localVideoEnableIcon").hasClass("icon-video_open") &&
  767 + $("#localVideoEnableIcon").addClass("icon-video_open");
  768 + $("#localVideoEnableIcon").hasClass("icon-video_close") &&
  769 + $("#localVideoEnableIcon").removeClass("icon-video_close");
  770 + } else {
  771 + $("#localVideoEnableIcon").hasClass("icon-video_open") &&
  772 + $("#localVideoEnableIcon").removeClass("icon-video_open");
  773 + !$("#localVideoEnableIcon").hasClass("icon-video_close") &&
  774 + $("#localVideoEnableIcon").addClass("icon-video_close");
  775 + }
  776 + Utils.localVideoSwitch(Store.ownUserId, enable);
  777 + },
  778 +};
  779 +
  780 +// SDK 相关封装
  781 +var SdkPackge = {
  782 + // SDK 相关环境匹配
  783 + Support: {
  784 + // 硬件设备支持
  785 + hardwareSupport: async function () {
  786 + const mediaDevices = await ArRTC.getDevices();
  787 + const cameras = [];
  788 + const microhones = [];
  789 + mediaDevices.forEach((deviceInfo) => {
  790 + if (deviceInfo.kind === "audioinput") {
  791 + microhones.push(deviceInfo);
  792 + } else if (deviceInfo.kind === "videoinput") {
  793 + cameras.push(deviceInfo);
  794 + }
  795 + });
  796 + if (cameras.length === 0 && microhones.length === 0) {
  797 + Utils.alertWhole("缺少麦克风和摄像头设备", "alert-danger");
  798 + $("#MultipleCalls").prop("disabled", true);
  799 + return false;
  800 + } else {
  801 + if (cameras.length === 0) {
  802 + Store.setting.enableVideo = false;
  803 + $("#userVideoCameraSetting").prop("disabled", true);
  804 + }
  805 + if (microhones.length === 0) {
  806 + Store.setting.enableAudio = false;
  807 + $("#userMicrophoneSetting").prop("disabled", true);
  808 + }
  809 + }
  810 + // 记录麦克风设备
  811 + Store.microhonesList = microhones;
  812 + // 记录摄像头设备
  813 + Store.camerasList = cameras;
  814 +
  815 + // 视频设备列表
  816 + SdkPackge.Support.camerasList(cameras);
  817 + // 音频设备列表
  818 + SdkPackge.Support.microhonesList(microhones);
  819 + return true;
  820 + },
  821 + // 视频设备状态变化
  822 + cameraChanged: async function (info) {
  823 + Utils.alertWhole("您的视频设备发生变化");
  824 + await SdkPackge.Support.hardwareSupport();
  825 + },
  826 + // 音频设备状态变化
  827 + microphoneChanged: async function (info) {
  828 + Utils.alertWhole("您的音频设备发生变化");
  829 + await SdkPackge.Support.hardwareSupport();
  830 + },
  831 + // 视频设备列表(可选择)
  832 + camerasList: function (cameras) {
  833 + $("#videoInputSelect").html("");
  834 + if (cameras.length > 0) {
  835 + cameras.map(function (camera, index) {
  836 + var label = camera.label !== "" ? camera.label : "Camera " + index;
  837 + var opt = $(
  838 + '<option value="' + camera.deviceId + '">' + label + "</option>"
  839 + );
  840 + $("#videoInputSelect").append(opt);
  841 + });
  842 + Store.setting.videoDevice = cameras[0].deviceId;
  843 + }
  844 + },
  845 + // 音频设备列表(可选择)
  846 + microhonesList: function (microhones) {
  847 + $("#audioInputSelect").html("");
  848 + if (microhones.length > 0) {
  849 + microhones.map(function (camera, index) {
  850 + var label =
  851 + camera.label !== "" ? camera.label : "Microphone " + index;
  852 + var opt = $(
  853 + '<option value="' + camera.deviceId + '">' + label + "</option>"
  854 + );
  855 + $("#audioInputSelect").append(opt);
  856 + });
  857 + Store.setting.audioDevice = microhones[0].deviceId;
  858 + }
  859 + },
  860 + },
  861 + // RTC 相关
  862 + RTC: {
  863 + // RTC 初始化
  864 + init: function () {
  865 + // console.log("初始化RTC");
  866 + // 创建RTC客户端
  867 + Store.rtcClient = ArRTC.createClient({
  868 + mode: Config.RTC_MODE,
  869 + codec: Config.RTC_CODEC,
  870 + });
  871 + // 配置私有云
  872 + Config.RTC_setParameters.switch
  873 + ? Store.rtcClient.setParameters(Config.RTC_setParameters.setParameters)
  874 + : "";
  875 + // RTC SDK 监听用户发布
  876 + Store.rtcClient.on("user-published", SdkPackge.RTC.userPublished);
  877 + // RTC SDK 监听用户取消发布
  878 + Store.rtcClient.on("user-unpublished", SdkPackge.RTC.userUnpublished);
  879 + // RTC SDK 监听用户加入频道成功
  880 + Store.rtcClient.on("user-joined", SdkPackge.RTC.userJoined);
  881 + // RTC SDK 监听用户离开频道
  882 + Store.rtcClient.on("user-left", SdkPackge.RTC.userLeft);
  883 + // RTC SDK 连接状态
  884 + Store.rtcClient.on(
  885 + "connection-state-change",
  886 + SdkPackge.RTC.connectionStateChange
  887 + );
  888 + },
  889 + // 用户发布
  890 + userPublished: async function (user, mediaType) {
  891 + // 订阅用户发布的音视频
  892 + await Store.rtcClient.subscribe(user, mediaType);
  893 + // console.log("用户" + user.uid + "发布" + mediaType);
  894 + Utils.printLog("[info] subscribe success");
  895 + // 模式判断 多人/p2p
  896 + Store.Conference
  897 + ? OperationPackge.multi.userPublished(user, mediaType)
  898 + : OperationPackge.p2p.userPublished(user, mediaType);
  899 + },
  900 + // 用户取消发布
  901 + userUnpublished: async function (user, mediaType) {
  902 + Utils.printLog("[info] user-unpublished success");
  903 + // 模式判断 多人/p2p
  904 + Store.Conference
  905 + ? OperationPackge.multi.userUnpublished(user, mediaType)
  906 + : OperationPackge.p2p.userUnpublished(user, mediaType);
  907 + },
  908 + // 用户加入频道
  909 + userJoined: async function (user) {
  910 + // console.log("用户加入频道" + user.uid);
  911 + // 多人操作
  912 + if (Store.Conference) {
  913 + // 更新视图
  914 + Utils.updateUserViewStatus(user.uid, 1);
  915 + } else {
  916 + OperationPackge.p2p.userJoined(user);
  917 + }
  918 + },
  919 + // 用户离开频道
  920 + userLeft: async function (user, reason) {
  921 + // console.log("用户离开频道", user);
  922 + // 模式判断 多人/p2p
  923 + Store.Conference
  924 + ? OperationPackge.multi.userLeft(user, reason)
  925 + : OperationPackge.p2p.userLeft(user, reason);
  926 + },
  927 + // SDK 与服务器的连接状态发生改变
  928 + connectionStateChange: async function (curState, revState, reason) {
  929 + Store.lineworkRTC =
  930 + curState == "CONNECTED" || curState == "DISCONNECTED" ? true : false;
  931 + if (curState != "DISCONNECTED") {
  932 + Utils.alertWhole(
  933 + Store.lineworkRTC ? "RTC 连接成功" : "RTC 连接中",
  934 + Store.lineworkRTC ? "alert-success" : "alert-info"
  935 + );
  936 + }
  937 + },
  938 +
  939 + // 本地采集用户音视频
  940 + getUserMedia: async function () {
  941 + if (Store.camerasList.length === 0 && Store.microhonesList.length === 0) {
  942 + await SdkPackge.Support.hardwareSupport();
  943 + }
  944 + if (Store.Conference) {
  945 + // 多人模式
  946 + if (Store.camerasList.length > 0 && Store.setting.enableVideo) {
  947 + // 开启双流
  948 + Store.rtcClient
  949 + .enableDualStream()
  950 + .then(() => {
  951 + console.log("开启双流 Enable Dual stream success!");
  952 + })
  953 + .catch((err) => {
  954 + console.log("开启双流失败", err);
  955 + });
  956 + Store.localTracks.videoTrack = await ArRTC.createCameraVideoTrack({
  957 + cameraId: Store.setting.videoDevice,
  958 + encoderConfig: {
  959 + bitrateMax: 1130,
  960 + // bitrateMin: ,
  961 + frameRate: 15,
  962 + height: Store.setting.videoSize[1],
  963 + width: Store.setting.videoSize[0],
  964 + },
  965 + }).catch(function (err) {
  966 + console.log("err => ", err);
  967 + });
  968 + }
  969 + if (Store.microhonesList.length > 0 && Store.setting.enableAudio) {
  970 + Store.localTracks.audioTrack = await ArRTC.createMicrophoneAudioTrack(
  971 + {
  972 + microphoneId: Store.setting.audioDevice,
  973 + }
  974 + ).catch(function (err) {
  975 + console.log("err => ", err);
  976 + });
  977 + }
  978 + } else {
  979 + // p2p 模式
  980 + if (Store.camerasList.length > 0) {
  981 + Store.localTracks.videoTrack = await ArRTC.createCameraVideoTrack({
  982 + cameraId: Store.setting.videoDevice,
  983 + encoderConfig: {
  984 + bitrateMax: 1130,
  985 + // bitrateMin: ,
  986 + frameRate: 15,
  987 + height: Store.setting.videoSize[1],
  988 + width: Store.setting.videoSize[0],
  989 + },
  990 + }).catch(function (err) {
  991 + console.log("err => ", err);
  992 + });
  993 + }
  994 + if (Store.microhonesList.length > 0) {
  995 + Store.localTracks.audioTrack = await ArRTC.createMicrophoneAudioTrack(
  996 + {
  997 + microphoneId: Store.setting.audioDevice,
  998 + }
  999 + ).catch(function (err) {
  1000 + console.log("err => ", err);
  1001 + });
  1002 + }
  1003 + }
  1004 +
  1005 + // 音频展示(p2p)
  1006 + PageShow.audioSwitch();
  1007 + },
  1008 + // 本地采集用户音频并发布(多人默认关闭音频再打开音频时调用)
  1009 + getUserMicrophonesPublish: async function () {
  1010 + var microhones = await ArRTC.getMicrophones();
  1011 + if (microhones.length > 0) {
  1012 + Store.localTracks.audioTrack = await ArRTC.createMicrophoneAudioTrack({
  1013 + microphoneId: Store.setting.audioDevice,
  1014 + }).catch(function (err) {
  1015 + console.log("err => ", err);
  1016 + });
  1017 + // 发布音频
  1018 + Store.rtcClient.publish(Store.localTracks.audioTrack);
  1019 + }
  1020 + },
  1021 + // 发布本地采集的音视频track
  1022 + publishLocalTracks: async function () {
  1023 + // console.log("发布本地采集的音视频track");
  1024 + if (Store.localTracks.videoTrack || Store.localTracks.audioTrack) {
  1025 + // 设置主播身份
  1026 + await Store.rtcClient.setClientRole("host");
  1027 + if (Store.localTracks.videoTrack || Store.localTracks.audioTrack) {
  1028 + Store.rtcClient.publish(Object.values(Store.localTracks));
  1029 + }
  1030 + // Store.localTracks.videoTrack &&
  1031 + // Store.rtcClient.publish(Store.localTracks.videoTrack);
  1032 + // Store.localTracks.audioTrack &&
  1033 + // Store.rtcClient.publish(Store.localTracks.audioTrack);
  1034 + }
  1035 + },
  1036 + // 取消本地发布
  1037 + unpublishLocalTracks: async function () {
  1038 + // 取消本地音频发布
  1039 + Store.localTracks.audioTrack &&
  1040 + Store.localTracks.audioTrack.on("track-ended", () => {
  1041 + Store.rtcClient.unpublish(Store.localTracks.audioTrack);
  1042 + });
  1043 + // 取消本地视频发布
  1044 + Store.localTracks.videoTrack &&
  1045 + Store.localTracks.videoTrack.on("track-ended", () => {
  1046 + Store.rtcClient.unpublish(Store.localTracks.videoTrack);
  1047 + $("#" + Store.ownUserId + "VideoView").html(
  1048 + $("#" + Store.ownUserId + "VideoView" + " " + "img")
  1049 + );
  1050 + });
  1051 + },
  1052 + // 释放采集设备
  1053 + LocalTracksClose: function () {
  1054 + Store.localTracks.videoTrack &&
  1055 + (Store.localTracks.videoTrack.close(),
  1056 + (Store.localTracks.videoTrack = null));
  1057 + Store.localTracks.audioTrack &&
  1058 + (Store.localTracks.audioTrack.close(),
  1059 + (Store.localTracks.audioTrack = null));
  1060 + },
  1061 + },
  1062 + // RTM 相关
  1063 + RTM: {
  1064 + // RTM 初始化
  1065 + init: function () {
  1066 + // 创建 RTM 客户端
  1067 + // console.log("初始化RTM")
  1068 + Store.rtmClient = ArRTM.createInstance(Config.APPID);
  1069 + // 配置私有云
  1070 + Config.RTM_setParameters.switch
  1071 + ? Store.rtmClient.setParameters(Config.RTM_setParameters.setParameters)
  1072 + : "";
  1073 + // 配置私有云
  1074 + // 登录 RTM
  1075 + Store.rtmClient
  1076 + .login({
  1077 + uid: Store.ownUserId,
  1078 + })
  1079 + .then(function () {
  1080 + Store.rtcLogin = true;
  1081 + // 页面操作
  1082 + PageShow.loginRTM();
  1083 + })
  1084 + .catch(function (err) {
  1085 + Store.rtcLogin = false;
  1086 + Utils.alertWhole("RTM 登录失败", "alert-danger");
  1087 + });
  1088 +
  1089 + // 监听收到来自主叫的呼叫邀请
  1090 + Store.rtmClient.on(
  1091 + "RemoteInvitationReceived",
  1092 + SdkPackge.RTM.RemoteInvitationReceived
  1093 + );
  1094 + // 监听收到来自对端的点对点消息
  1095 + Store.rtmClient.on("MessageFromPeer", SdkPackge.RTM.MessageFromPeer);
  1096 + // 通知 SDK 与 RTM 系统的连接状态发生了改变
  1097 + Store.rtmClient.on(
  1098 + "ConnectionStateChanged",
  1099 + SdkPackge.RTM.ConnectionStateChanged
  1100 + );
  1101 + },
  1102 + // 收到来自主叫的呼叫邀请
  1103 + RemoteInvitationReceived: async function (remoteInvitation) {
  1104 + Utils.printLog(
  1105 + "[info]",
  1106 + "You recive an invitation from " + remoteInvitation.callerId
  1107 + );
  1108 + // 是否正在通话
  1109 + if (Store.Calling) {
  1110 + // 正在通话中
  1111 + await OperationPackge.public.callIng(remoteInvitation);
  1112 + } else {
  1113 + // 存放被叫实例
  1114 + Store.remoteInvitation = remoteInvitation;
  1115 + // 解析主叫呼叫信息
  1116 + var invitationContent = JSON.parse(remoteInvitation.content);
  1117 + // 关闭设置
  1118 + await OperationPackge.p2p.closeSeting();
  1119 + // 标识为正在通话中
  1120 + Store.Calling = true;
  1121 + if (
  1122 + !invitationContent.VidCodec ||
  1123 + !invitationContent.AudCodec ||
  1124 + (invitationContent.VidCodec &&
  1125 + invitationContent.VidCodec.indexOf("H264") !== -1) ||
  1126 + (invitationContent.AudCodec &&
  1127 + invitationContent.AudCodec.indexOf("Opus") !== -1)
  1128 + ) {
  1129 + Store.Conference = invitationContent.Conference;
  1130 + // 远端
  1131 + Store.peerUserId = remoteInvitation.callerId;
  1132 + Store.Conference // 多人逻辑操作
  1133 + ? OperationPackge.multi.RemoteInvitationReceived(invitationContent) // p2p逻辑操作
  1134 + : OperationPackge.p2p.RemoteInvitationReceived(invitationContent);
  1135 + } else {
  1136 + // 手表不支持 web 端
  1137 + await OperationPackge.public.watches(remoteInvitation);
  1138 + }
  1139 + }
  1140 + },
  1141 + // 收到来自对端的点对点消息
  1142 + MessageFromPeer: function (message, peerId, messageProps) {
  1143 + message.text = JSON.parse(message.text);
  1144 + // console.log("收到来自对端的点对点消息", message);
  1145 + switch (message.text.Cmd) {
  1146 + case "SwitchAudio":
  1147 + // 视频转语音
  1148 + var oTime = setInterval(async function () {
  1149 + if (Store.localTracks.videoTrack) {
  1150 + clearInterval(oTime);
  1151 + // 语音通话
  1152 + await PageShow.showVoicePage();
  1153 +
  1154 + // 关闭视频并释放
  1155 + (await Store.localTracks.videoTrack) &&
  1156 + (Store.localTracks.videoTrack.close(),
  1157 + (Store.localTracks.videoTrack = null));
  1158 + Store.setting.videoStatsInterval &&
  1159 + clearInterval(Store.setting.videoStatsInterval);
  1160 + // console.log("关闭视频并释放", Store.localTracks.videoTrack);
  1161 + // 显示音频通话时长
  1162 + OperationPackge.public.communicationDuration("audioDuration");
  1163 + Utils.alertWhole("视频通话转为音频通话", "alert-success");
  1164 + }
  1165 + }, 500);
  1166 + break;
  1167 + case "EndCall":
  1168 + if (Store.localTracks.audioTrack || Store.localTracks.videoTrack) {
  1169 + OperationPackge.p2p.hangupInfo();
  1170 + }
  1171 + break;
  1172 + case "CallState":
  1173 + // 收到此信令返回给对方状态
  1174 + if (peerId === Store.peerUserId) {
  1175 + Store.networkReconnection &&
  1176 + clearTimeout(Store.networkReconnection);
  1177 + }
  1178 + // 回复
  1179 + OperationPackge.p2p.replySendInfo(peerId);
  1180 + break;
  1181 + case "CallStateResult":
  1182 + Store.networkReconnection && clearTimeout(Store.networkReconnection);
  1183 + console.log("本地断网重连后对方状态", message, peerId);
  1184 + break;
  1185 + default:
  1186 + break;
  1187 + }
  1188 + },
  1189 + // SDK 与 RTM 系统的连接状态
  1190 + ConnectionStateChanged: async function (newState, reason) {
  1191 + Store.lineworkRTM = newState == "CONNECTED" ? true : false;
  1192 + Utils.alertWhole(
  1193 + Store.lineworkRTM ? "RTM 连接成功" : "RTM 连接中",
  1194 + Store.lineworkRTM ? "alert-success" : "alert-info"
  1195 + );
  1196 + console.log("SDK 与 RTM 系统的连接状态", newState, reason);
  1197 + if (newState === "RECONNECTING" && Store.network.status != 0) {
  1198 + Utils.alertWhole("网络异常");
  1199 + }
  1200 + },
  1201 + },
  1202 + // RTM 频道相关(多人通话使用)
  1203 + RTMChannel: {
  1204 + init: function () {
  1205 + Store.rtmChannel = Store.rtmClient.createChannel(Store.channelId);
  1206 + // 监听频道消息
  1207 + Store.rtmChannel.on(
  1208 + "ChannelMessage",
  1209 + OperationPackge.multi.ChannelMessage
  1210 + );
  1211 + // 监听频道人员加入, 如果人数超过512,该回调失效
  1212 + Store.rtmChannel.on("MemberJoined", OperationPackge.multi.MemberJoined);
  1213 + // 监听频道人员离开
  1214 + Store.rtmChannel.on("MemberLeft", OperationPackge.multi.MemberLeft);
  1215 + },
  1216 + },
  1217 +};
  1218 +// 此应用使用的相关逻辑操作封装
  1219 +var OperationPackge = {
  1220 + // 公共的操作
  1221 + public: {
  1222 + // 回退到首页
  1223 + backToHome: async function () {
  1224 + !$("#loginForm").hasClass("d-none") && $("#loginForm").addClass("d-none");
  1225 + !$("#loginMutiFprm").hasClass("d-none") &&
  1226 + $("#loginMutiFprm").addClass("d-none");
  1227 + $("#loginHome").hasClass("d-none") &&
  1228 + $("#loginHome").removeClass("d-none");
  1229 + Utils.setPageTitle("anyrtc 呼叫邀请DEMO - anyRTC");
  1230 + },
  1231 + // 通讯时长 id 传入要显示的元素id (现仅提供p2p操作)
  1232 + communicationDuration: function (id) {
  1233 + // 清除视频通话时长
  1234 + Store.callDurationClearInterval &&
  1235 + clearInterval(Store.callDurationClearInterval);
  1236 + Store.callDurationClearInterval = setInterval(function () {
  1237 + Store.callDurationInterval++;
  1238 + var oMin = Math.floor(Store.callDurationInterval / 60);
  1239 + var oSec = Math.floor(Store.callDurationInterval % 60);
  1240 + oMin >= 10 ? oMin : (oMin = "0" + oMin);
  1241 + oSec >= 10 ? oSec : (oSec = "0" + oSec);
  1242 + $("#" + id).text(oMin + ":" + oSec);
  1243 + }, 1000);
  1244 + },
  1245 + // 本地存储恢复
  1246 + restoreDefault: function () {
  1247 + // console.log("加入RTC频道", Store.JoinRTCChannel);
  1248 + Store.rtcClient && Store.JoinRTCChannel && Store.rtcClient.leave();
  1249 + Store.rtmChannel && Store.Conference && Store.rtmChannel.leave();
  1250 + // 邀请有效期计时(定时器)
  1251 + Store.invitationClearTimeout &&
  1252 + clearTimeout(Store.invitationClearTimeout);
  1253 + // 清除通话计时
  1254 + Store.callDurationClearInterval &&
  1255 + (clearInterval(Store.callDurationClearInterval),
  1256 + (Store.callDurationClearInterval = null));
  1257 + // 清除视频数据展示
  1258 + Store.setting.videoStatsInterval &&
  1259 + clearInterval(Store.setting.videoStatsInterval);
  1260 +
  1261 + Store.networkSet && clearTimeout(Store.networkSet);
  1262 + Store.remodVideoEnd && clearTimeout(Store.remodVideoEnd);
  1263 + // 恢复
  1264 + Object.assign(Store, {
  1265 + Conference: false, // 选择的呼叫模式 false: p2p呼叫 true: 多人呼叫
  1266 + invitationTimeout: 58 * 1000, // 邀请有效期限
  1267 + invitationClearTimeout: null, // 邀请有效期计时(定时器)
  1268 + callDurationInterval: 0, // 通话时长
  1269 + callDurationClearInterval: null, // 通话时长计时(定时器)
  1270 + localInvitation: null, // 存放主叫邀请实例
  1271 + remoteInvitation: null, // 存放被叫邀请实例
  1272 + rtmChannel: null, // 存放 RTM 频道实例
  1273 + Calling: false, // 正在通话中(标识)
  1274 + JoinRTCChannel: false, // 加入 RTC 频道(标识)
  1275 + // hangupMuti: false, // 主叫挂断(仅多人使用)
  1276 + peerUserId: "", // 远端的用户的ID
  1277 + channelId: "" + Utils.generateNumber(9), // 频道房间
  1278 + invitationUserIds: [],
  1279 + // RTC 本地采集的音视频轨道
  1280 + localTracks: {
  1281 + videoTrack: null,
  1282 + audioTrack: null,
  1283 + },
  1284 + // 断网相关(p2p)
  1285 + network: {
  1286 + // type: "rtm", // 断网时所在页面 rtm rtc
  1287 + calltype: 0, // 呼叫类型 0:主叫 1:被叫
  1288 + status: 0, // 当前状态 呼叫中:1 已接受:2 挂断:0
  1289 + Mode: 0, // 通话类型 语音、视频
  1290 + },
  1291 + networkSet: null,
  1292 + remodVideoEnd: null,
  1293 +
  1294 + recordUser: [], // 记录页面展示的音视频轨道(仅多人呼叫使用)
  1295 + // 大屏展示(仅多人呼叫使用)
  1296 + bigMutiUser: {
  1297 + uid: "",
  1298 + videoTrack: null,
  1299 + },
  1300 + invitationClearTimeouts: {}, // 存放多个有效期计时(定时器仅多人呼叫使用)
  1301 + });
  1302 + },
  1303 + // 正在通话中
  1304 + callIng: async function (remoteInvitation) {
  1305 + // 是否正在通话中
  1306 + // console.log("正在通话中", Store.ownUserId);
  1307 + remoteInvitation.response = await JSON.stringify({
  1308 + // Reason: "Calling",
  1309 + refuseId: Store.ownUserId,
  1310 + Reason: "calling",
  1311 + Cmd: "Calling",
  1312 + });
  1313 + await remoteInvitation.refuse();
  1314 + },
  1315 + // 手表不支持 web 通话
  1316 + watches: async function (remoteInvitation) {
  1317 + remoteInvitation.response = await JSON.stringify({
  1318 + // Reason: "Calling",
  1319 + refuseId: Store.ownUserId,
  1320 + Reason: "calling",
  1321 + Cmd: "platfrom",
  1322 + });
  1323 + await remoteInvitation.refuse();
  1324 + },
  1325 + },
  1326 + p2p: {
  1327 + // 语音呼叫
  1328 + makeVoiceCall: async function () {
  1329 + // 关闭设置
  1330 + await OperationPackge.p2p.closeSeting();
  1331 + // 获取输入的用户
  1332 + var oPeerId = await OperationPackge.p2p.getPeerUserId();
  1333 + // 查询输入用户合法性
  1334 + Store.peerUserId = await OperationPackge.p2p.peerUserVaplidity(oPeerId);
  1335 + if (Store.peerUserId) {
  1336 + Store.repetitionClick = true;
  1337 + Store.network = Object.assign(Store.network, {
  1338 + // type: "rtm",
  1339 + calltype: 0, // 主叫
  1340 + status: 1, // 呼叫中
  1341 + Mode: 1,
  1342 + });
  1343 + await OperationPackge.p2p.createLocalInvitationAndSend(1);
  1344 + // 恢复初始设置
  1345 + await PageShow.initSetingP2P();
  1346 + // 显示呼叫邀请页面
  1347 + await PageShow.makeVideoCall();
  1348 + Store.repetitionClick = false;
  1349 + }
  1350 + },
  1351 + // 视频呼叫
  1352 + makeVideoCall: async function () {
  1353 + // 关闭设置
  1354 + await OperationPackge.p2p.closeSeting();
  1355 + var oPeerId = await OperationPackge.p2p.getPeerUserId();
  1356 + Store.peerUserId = await OperationPackge.p2p.peerUserVaplidity(oPeerId);
  1357 + if (Store.peerUserId) {
  1358 + Store.repetitionClick = true;
  1359 + Store.network = Object.assign(Store.network, {
  1360 + // type: "rtm",
  1361 + calltype: 0, // 主叫
  1362 + status: 1, // 呼叫中
  1363 + Mode: 1,
  1364 + });
  1365 + await OperationPackge.p2p.createLocalInvitationAndSend(0);
  1366 + // 恢复初始设置
  1367 + await PageShow.initSetingP2P();
  1368 + // 显示呼叫邀请页面
  1369 + await PageShow.makeVideoCall();
  1370 + Store.repetitionClick = false;
  1371 +
  1372 + OperationPackge.p2p.videoStats();
  1373 + }
  1374 + },
  1375 + // 接受呼叫
  1376 + acceptCall: async function (type) {
  1377 + // console.log("接受呼叫");
  1378 + var invitationContent = await JSON.parse(Store.remoteInvitation.content);
  1379 + Store.network = await Object.assign(Store.network, {
  1380 + // type: "rtm",
  1381 + calltype: 1, // 被叫
  1382 + status: 2, // 呼叫中
  1383 + Mode: invitationContent.Mode,
  1384 + });
  1385 +
  1386 + if (invitationContent.Mode === 1 || type === "语音呼叫") {
  1387 + // 设置响应模式
  1388 + Store.remoteInvitation.response = await JSON.stringify({
  1389 + Mode: 1,
  1390 + Conference: false,
  1391 + UserData: "",
  1392 + SipData: "",
  1393 + });
  1394 + // 显示语音页面
  1395 + PageShow.showVoicePage();
  1396 + } else if (invitationContent.Mode === 0 && type === "视频呼叫") {
  1397 + Store.remoteInvitation.response = JSON.stringify({
  1398 + Mode: 0,
  1399 + Conference: false,
  1400 + UserData: "",
  1401 + SipData: "",
  1402 + });
  1403 + OperationPackge.p2p.videoStats();
  1404 + // 显示视频页面
  1405 + PageShow.showVideoPage();
  1406 + }
  1407 + // 接受呼叫
  1408 + await Store.remoteInvitation.accept();
  1409 + await PageShow.hiddenCalledPage();
  1410 + },
  1411 + // 取消当前通话
  1412 + cancelCall: async function (type = 0) {
  1413 + Store.invitationClearTimeout &&
  1414 + clearTimeout(Store.invitationClearTimeout);
  1415 + // 隐藏被呼叫页面
  1416 + await PageShow.hiddenCallPage();
  1417 + // 页面恢复初始
  1418 + await PageShow.initSetingP2P();
  1419 + // 回到首页
  1420 + await PageShow.showIndex();
  1421 + switch (type) {
  1422 + case 0:
  1423 + Utils.alertWhole("通话已结束", "alert-success");
  1424 + break;
  1425 + case 1:
  1426 + Utils.alertWhole("网络异常,结束通话", "alert-warning");
  1427 + break;
  1428 + case 2:
  1429 + // Utils.alertWhole("已拒绝邀请", "alert-info");
  1430 + break;
  1431 + case 3:
  1432 + Utils.alertWhole("网络连接断开", "alert-warning");
  1433 + break;
  1434 + default:
  1435 + break;
  1436 + }
  1437 + Store.network = await Object.assign(Store.network, {
  1438 + status: 0,
  1439 + });
  1440 +
  1441 + // 网络正常后
  1442 + let oNormal = setInterval(() => {
  1443 + if (navigator.onLine) {
  1444 + if (Store.lineworkRTC && Store.lineworkRTM) {
  1445 + clearInterval(oNormal);
  1446 + if (Store.JoinRTCChannel) {
  1447 + // 加入 RTC 频道后挂断 发送挂断信息
  1448 + Store.rtmClient &&
  1449 + Store.rtmClient
  1450 + .sendMessageToPeer(
  1451 + {
  1452 + text: JSON.stringify({
  1453 + Cmd: "EndCall",
  1454 + }),
  1455 + },
  1456 + Store.peerUserId // 对端用户的 uid。
  1457 + )
  1458 + .catch((err) => {
  1459 + // 你的代码:点对点消息发送失败。
  1460 + // console.log(err);
  1461 + });
  1462 + /** 设备采集后释放/无设备后4s后自动释放 */
  1463 + let time = 0;
  1464 + const timer = setInterval(async () => {
  1465 + time++;
  1466 + if (
  1467 + time >= 20 ||
  1468 + Store.localTracks.audioTrack ||
  1469 + Store.localTracks.videoTrack
  1470 + ) {
  1471 + clearInterval(timer);
  1472 +
  1473 + // 释放采集设备
  1474 + await SdkPackge.RTC.LocalTracksClose();
  1475 + await OperationPackge.public.restoreDefault();
  1476 + // 隐藏被呼叫页面
  1477 + await PageShow.hiddenCallPage();
  1478 + // 页面恢复初始
  1479 + await PageShow.initSetingP2P();
  1480 + // 回到首页
  1481 + await PageShow.showIndex();
  1482 + }
  1483 + }, 200);
  1484 + } else if (type != 2) {
  1485 + if (Store.network.calltype == 0) {
  1486 + // 挂断
  1487 + Store.localInvitation && Store.localInvitation.cancel();
  1488 + } else {
  1489 + // 拒绝接听
  1490 + Store.remoteInvitation && Store.remoteInvitation.refuse();
  1491 + }
  1492 + } else {
  1493 + OperationPackge.public.restoreDefault();
  1494 + }
  1495 + }
  1496 + }
  1497 + }, 200);
  1498 + },
  1499 +
  1500 + // 音视频设置
  1501 + setOperation: async function (data) {
  1502 + switch (data) {
  1503 + case "分辨率":
  1504 + Store.localTracks.videoTrack.setEncoderConfiguration({
  1505 + height: Store.setting.videoSize[1],
  1506 + width: Store.setting.videoSize[0],
  1507 + });
  1508 + break;
  1509 + case "设置音频设备":
  1510 + Store.localTracks.audioTrack.setDevice(Store.setting.audioDevice);
  1511 + break;
  1512 + case "设置视频设备":
  1513 + Store.localTracks.videoTrack.setDevice(Store.setting.videoDevice);
  1514 + break;
  1515 + default:
  1516 + break;
  1517 + }
  1518 + },
  1519 + // 视频相关数据
  1520 + videoStats: function () {
  1521 + Store.setting.videoStatsInterval &&
  1522 + clearInterval(Store.setting.videoStatsInterval);
  1523 + if (Store.setting.videoDataShow) {
  1524 + // var oa = null;
  1525 + Store.setting.videoStatsInterval = setInterval(async function () {
  1526 + // 通话总数据
  1527 + const oCallAll = await Store.rtcClient.getRTCStats();
  1528 + // 本地音频数据
  1529 + const oLocalAudio = await Store.rtcClient.getLocalAudioStats();
  1530 + // console.log("本地音频数据", oLocalAudio);
  1531 + // 本地视频数据
  1532 + const oLocalVideo = await Store.rtcClient.getLocalVideoStats();
  1533 + // console.log("本地视频数据", oLocalVideo);
  1534 +
  1535 + if (oLocalVideo) {
  1536 + $("#userLocalVideoData").removeClass("d-none");
  1537 + const oLocalVideoList = [
  1538 + {
  1539 + description: "视频采集分辨率(高*宽)",
  1540 + value:
  1541 + (oLocalVideo.captureResolutionHeight || 0) +
  1542 + " * " +
  1543 + (oLocalVideo.captureResolutionWidth || 0),
  1544 + unit: "",
  1545 + },
  1546 + {
  1547 + description: "实际发送分辨率(高*宽)",
  1548 + value:
  1549 + (oLocalVideo.sendResolutionHeight || 0) +
  1550 + " * " +
  1551 + (oLocalVideo.sendResolutionWidth || 0),
  1552 + unit: "",
  1553 + },
  1554 + {
  1555 + description: "视频采集帧率",
  1556 + value: oLocalVideo.captureFrameRate || 0,
  1557 + unit: "fps",
  1558 + },
  1559 + {
  1560 + description: "网络延迟RTT",
  1561 + value: oCallAll.RTT || 0,
  1562 + unit: "ms",
  1563 + },
  1564 + {
  1565 + description: "发送带宽",
  1566 + value: (
  1567 + (Number(oLocalAudio.sendBitrate || 0) +
  1568 + Number(oLocalVideo.sendBitrate || 0)) /
  1569 + 1024 /
  1570 + 8
  1571 + ).toFixed(3),
  1572 + unit: "kB/s",
  1573 + },
  1574 + {
  1575 + description: "接收带宽",
  1576 + value: ((Number(oCallAll.RecvBitrate) || 0) / 1024 / 8).toFixed(
  1577 + 3
  1578 + ),
  1579 + unit: "kB/s",
  1580 + },
  1581 + {
  1582 + description: "音频发送丢包率",
  1583 + value: Number(oLocalAudio.packetLossRate || 0).toFixed(3),
  1584 + unit: "%",
  1585 + },
  1586 + {
  1587 + description: "视频发送丢包率",
  1588 + value: Number(oLocalVideo.packetLossRate || 0).toFixed(3),
  1589 + unit: "%",
  1590 + },
  1591 + // {
  1592 + // description: "视频编码格式",
  1593 + // value: oLocalVideo.codecType || "",
  1594 + // unit: "",
  1595 + // },
  1596 + // {
  1597 + // description: "视频编码延迟",
  1598 + // value: oLocalVideo.encodeDelay || 0,
  1599 + // unit: "ms",
  1600 + // },
  1601 + // {
  1602 + // description: "视频发送码率",
  1603 + // value: oLocalVideo.sendBitrate || 0,
  1604 + // unit: "bps",
  1605 + // },
  1606 + // {
  1607 + // description: "发送的视频总字节数",
  1608 + // value: oLocalVideo.sendBytes || 0,
  1609 + // unit: "bytes",
  1610 + // },
  1611 + // {
  1612 + // description: "发送的视频总包数",
  1613 + // value: oLocalVideo.sendPackets || 0,
  1614 + // unit: "",
  1615 + // },
  1616 + // {
  1617 + // description: "发送的视频总丢包数",
  1618 + // value: oLocalVideo.sendPacketsLost || 0,
  1619 + // unit: "",
  1620 + // },
  1621 + // {
  1622 + // description: "视频目标发送码率",
  1623 + // value: oLocalVideo.targetSendBitrate || 0,
  1624 + // unit: "bps",
  1625 + // },
  1626 + // {
  1627 + // description: "视频总时长",
  1628 + // value: oLocalVideo.totalDuration || 0,
  1629 + // unit: "s",
  1630 + // },
  1631 + // {
  1632 + // description: "视频总卡顿时长",
  1633 + // value: oLocalVideo.totalFreezeTime || 0,
  1634 + // unit: "s",
  1635 + // },
  1636 + ];
  1637 + $("#userLocalVideoData").html(`
  1638 + ${oLocalVideoList
  1639 + .map(
  1640 + (stat) =>
  1641 + `<p class="stats-row">${stat.description}: ${stat.value} ${stat.unit}</p>`
  1642 + )
  1643 + .join("")}`);
  1644 + } else {
  1645 + $("#userLocalVideoData").addClass("d-none");
  1646 + }
  1647 +
  1648 + // 远端视频数据
  1649 + const oRemoVideoData = await Store.rtcClient.getRemoteVideoStats();
  1650 + const oRemoVideo = oRemoVideoData[Store.peerUserId];
  1651 + // console.log("远端视频数据", oRemoVideo);
  1652 + // 远端音频数据
  1653 + const oRemoAudioData = await Store.rtcClient.getRemoteAudioStats();
  1654 + const oRemoAudio = oRemoAudioData[Store.peerUserId];
  1655 + // console.log("远端音频数据", oRemoAudio);
  1656 + if (oRemoVideo && oRemoAudio) {
  1657 + $("#userRemodeVideoData").removeClass("d-none");
  1658 + const oRemoVideoList = [
  1659 + {
  1660 + description: "视频接收分辨率(高*宽)",
  1661 + value:
  1662 + (oRemoVideo.receiveResolutionHeight || 0) +
  1663 + " * " +
  1664 + (oRemoVideo.receiveResolutionWidth || 0),
  1665 + unit: "",
  1666 + },
  1667 + {
  1668 + description: "视频接收帧率",
  1669 + value: oRemoVideo.receiveFrameRate || 0,
  1670 + unit: "fps",
  1671 + },
  1672 + {
  1673 + description: "接收带宽",
  1674 + value: (
  1675 + ((Number(oRemoVideo.receiveBitrate) || 0) +
  1676 + (Number(oRemoAudio.receiveBitrate) || 0)) /
  1677 + 1024 /
  1678 + 8
  1679 + ).toFixed(3),
  1680 + unit: "kB/s",
  1681 + },
  1682 + {
  1683 + description: "视频接收丢包率",
  1684 + value: Number(oRemoVideo.packetLossRate || 0).toFixed(3),
  1685 + unit: "%",
  1686 + },
  1687 + {
  1688 + description: "音频接收丢包率",
  1689 + value: Number(oRemoAudio.packetLossRate || 0).toFixed(3),
  1690 + unit: "%",
  1691 + },
  1692 + // {
  1693 + // description: "视频解码帧率",
  1694 + // value: oRemoVideo.decodeFrameRate || 0,
  1695 + // unit: "fps",
  1696 + // },
  1697 + // {
  1698 + // description: "视频渲染帧率",
  1699 + // value: oRemoVideo.renderFrameRate || 0,
  1700 + // unit: "fps",
  1701 + // },
  1702 + // {
  1703 + // description: "远端视频编码格式",
  1704 + // value: oRemoVideo.codecType || "",
  1705 + // unit: "",
  1706 + // },
  1707 + // {
  1708 + // description: "传输延迟",
  1709 + // value: oRemoVideo.transportDelay || 0,
  1710 + // unit: "ms",
  1711 + // },
  1712 + // {
  1713 + // description: "视频端到端延迟",
  1714 + // value: oRemoVideo.end2EndDelay || 0,
  1715 + // unit: "ms",
  1716 + // },
  1717 + // {
  1718 + // description: "接收视频延迟",
  1719 + // value: oRemoVideo.receiveDelay || 0,
  1720 + // unit: "ms",
  1721 + // },
  1722 + // {
  1723 + // description: "接收的视频卡顿率",
  1724 + // value: oRemoVideo.freezeRate || 0,
  1725 + // unit: "",
  1726 + // },
  1727 +
  1728 + // {
  1729 + // description: "接收的视频总字节数",
  1730 + // value: oRemoVideo.receiveBytes || 0,
  1731 + // unit: "bytes",
  1732 + // },
  1733 + // {
  1734 + // description: "接收的视频总包数",
  1735 + // value: oRemoVideo.receivePackets || 0,
  1736 + // unit: "",
  1737 + // },
  1738 + // {
  1739 + // description: "接收的视频总丢包数",
  1740 + // value: oRemoVideo.receivePacketsLost || 0,
  1741 + // unit: "",
  1742 + // },
  1743 + // {
  1744 + // description: "接收的视频总时长",
  1745 + // value: oRemoVideo.totalDuration || 0,
  1746 + // unit: "s",
  1747 + // },
  1748 + // {
  1749 + // description: "接收的视频总卡顿时长",
  1750 + // value: oRemoVideo.totalFreezeTime || 0,
  1751 + // unit: "s",
  1752 + // },
  1753 + ];
  1754 + $("#userRemodeVideoData").html(`
  1755 + ${oRemoVideoList
  1756 + .map(
  1757 + (stat) =>
  1758 + `<p class="stats-row">${stat.description}: ${stat.value} ${stat.unit}</p>`
  1759 + )
  1760 + .join("")}`);
  1761 + } else {
  1762 + $("#userRemodeVideoData").addClass("d-none");
  1763 + }
  1764 + }, 1000);
  1765 + } else {
  1766 + $("#userLocalVideoData").addClass("d-none");
  1767 + $("#userRemodeVideoData").addClass("d-none");
  1768 + }
  1769 + },
  1770 + // 关闭设置
  1771 + closeSeting: function () {
  1772 + var oTimeTemporary = setInterval(async function () {
  1773 + if (Store.localTracks.videoTrack || Store.localTracks.audioTrack) {
  1774 + clearInterval(oTimeTemporary);
  1775 + $("#loginSetting").hasClass("show") &&
  1776 + ($("#loginSetting").removeClass("show"),
  1777 + $("#loginMutiSetting").hasClass("show") &&
  1778 + $("#loginMutiSetting").removeClass("show"),
  1779 + SdkPackge.RTC.LocalTracksClose());
  1780 + } else {
  1781 + clearInterval(oTimeTemporary);
  1782 + $("#loginSetting").hasClass("show") &&
  1783 + ($("#loginSetting").removeClass("show"),
  1784 + $("#loginMutiSetting").hasClass("show") &&
  1785 + $("#loginMutiSetting").removeClass("show"));
  1786 + }
  1787 + }, 50);
  1788 + },
  1789 + // 获取输入的用户
  1790 + getPeerUserId: function () {
  1791 + var calleeId = "0002";
  1792 + //var calleeId = "9999";
  1793 + /* $("#userInputs > input").each(function (index, el) {
  1794 + var inputVal = el.value;
  1795 + if (inputVal === "") {
  1796 + el.focus();
  1797 + Utils.alertError("请输入完整的用户ID");
  1798 + return false;
  1799 + }
  1800 + calleeId += inputVal;
  1801 + });*/
  1802 + return calleeId;
  1803 + },
  1804 + // 查询输入用户合法性
  1805 + peerUserVaplidity: async function (calleeId) {
  1806 + if (calleeId.length === 4) {
  1807 + //查询状态
  1808 + var userOnlineResults = await Store.rtmClient.queryPeersOnlineStatus([
  1809 + calleeId,
  1810 + ]);
  1811 + if (!userOnlineResults[calleeId] || !userOnlineResults[calleeId]) {
  1812 + Utils.alertError("不允许呼叫,因为对方不在线");
  1813 + return;
  1814 + }
  1815 + if (calleeId == Store.ownUserId) {
  1816 + //清空表单
  1817 + $("#userInputs > input").each(function (index, el) {
  1818 + el.value = "";
  1819 + });
  1820 + Utils.alertError("不能呼叫自己");
  1821 + return;
  1822 + }
  1823 + return calleeId;
  1824 + }
  1825 + },
  1826 +
  1827 + // RTM 主叫: 创建呼叫邀请并发送 (callMode: 视频通话 0 语音通话 1)
  1828 + createLocalInvitationAndSend: async function (callMode) {
  1829 + Store.JoinRTCChannel = true;
  1830 + // 加入实时通讯频道
  1831 + Store.ownUserId = await Store.rtcClient.join(
  1832 + Config.APPID,
  1833 + Store.channelId,
  1834 + null,
  1835 + Store.ownUserId
  1836 + );
  1837 + // 创建呼叫邀请
  1838 + Store.localInvitation = Store.rtmClient.createLocalInvitation(
  1839 + Store.peerUserId
  1840 + );
  1841 + // 这里将呼叫邀请的内容 设置为视频通讯时使用的频道id - 进入同一个频道
  1842 + Store.localInvitation.content = JSON.stringify({
  1843 + Mode: callMode, // 呼叫类型 视频通话 0 语音通话 1
  1844 + Conference: false, // 是否是多人会议
  1845 + ChanId: Store.channelId, // 频道房间
  1846 + UserData: "",
  1847 + SipData: "",
  1848 + VidCodec: ["H264"],
  1849 + AudCodec: ["Opus"],
  1850 + });
  1851 + // 发送呼叫邀请
  1852 + Store.localInvitation.send();
  1853 + Utils.printLog("[info]", "you sent an invitation to " + Store.peerUserId);
  1854 + // 监听被叫已收到呼叫邀请
  1855 + Store.localInvitation.on(
  1856 + "LocalInvitationReceivedByPeer",
  1857 + OperationPackge.p2p.localInvitationReceivedByPeer
  1858 + );
  1859 + // 监听被叫已接受呼叫邀请
  1860 + Store.localInvitation.on(
  1861 + "LocalInvitationAccepted",
  1862 + OperationPackge.p2p.localInvitationAccepted
  1863 + );
  1864 + // 监听被叫拒绝了你的呼叫邀请
  1865 + Store.localInvitation.on(
  1866 + "LocalInvitationRefused",
  1867 + OperationPackge.p2p.localInvitationRefused
  1868 + );
  1869 + // 监听呼叫邀请进程失败
  1870 + Store.localInvitation.on(
  1871 + "LocalInvitationFailure",
  1872 + OperationPackge.p2p.localInvitationFailure
  1873 + );
  1874 + // 监听呼叫邀请已被成功取消
  1875 + Store.localInvitation.on(
  1876 + "LocalInvitationCanceled",
  1877 + OperationPackge.p2p.localInvitationCanceled
  1878 + );
  1879 + },
  1880 + // p2p 本地视频视图渲染
  1881 + createVideoAdd: function () {
  1882 + // console.log("p2p 本地视频视图渲染");
  1883 + $("#UserIdChanel").text(Store.ownUserId);
  1884 + //预览本地图像
  1885 + var videoBox = document.createElement("div");
  1886 + videoBox.id = Store.ownUserId;
  1887 + videoBox.className = "video-preview_box";
  1888 + document.getElementById("mineVideoPreview").appendChild(videoBox);
  1889 + Store.localTracks.videoTrack &&
  1890 + Store.localTracks.videoTrack.play(videoBox.id, {
  1891 + fit: "contain",
  1892 + });
  1893 + },
  1894 + // p2p 远端音视频渲染
  1895 + createPeerVideoAdd: function (peer) {
  1896 + // 清除容器内其他内容
  1897 + $("#peerVideoPreview").html($("#peerVideoPreview_bg"));
  1898 + // console.log("p2p 远端音视频渲染");
  1899 + var videoBox = document.createElement("div");
  1900 + videoBox.id = peer.uid;
  1901 + videoBox.className = "video-preview_box";
  1902 + document.getElementById("peerVideoPreview").appendChild(videoBox);
  1903 + peer.videoTrack &&
  1904 + peer.videoTrack.play(videoBox.id, {
  1905 + fit: "contain",
  1906 + });
  1907 + },
  1908 + // RTM 主叫: 呼叫邀请有效期
  1909 + localInvitationValidity: function () {
  1910 + // 呼叫邀请有效期
  1911 + Store.invitationClearTimeout = setTimeout(function () {
  1912 + Utils.alertWhole("60s无人接听,取消呼叫");
  1913 + }, Store.invitationTimeout);
  1914 + },
  1915 + // RTM 主叫: 被叫已收到呼叫邀请
  1916 + localInvitationReceivedByPeer: async function () {
  1917 + Utils.printLog(
  1918 + "[info]",
  1919 + "Your invitation has been received by " + Store.localInvitation.calleeId
  1920 + );
  1921 + // 标识为正在通话中
  1922 + Store.Calling = true;
  1923 + // 呼叫邀请有效期开始计时
  1924 + OperationPackge.p2p.localInvitationValidity();
  1925 + Store.network = Object.assign(Store.network, {
  1926 + Mode: 0,
  1927 + status: 1,
  1928 + calltype: 0,
  1929 + });
  1930 + },
  1931 + // RTM 主叫: 被叫已接受呼叫邀请
  1932 + localInvitationAccepted: async function (response) {
  1933 + Utils.printLog(
  1934 + "[info]",
  1935 + Store.localInvitation.calleeId + " accepted your invitation"
  1936 + );
  1937 + // console.log("p2p 被叫已接受呼叫邀请");
  1938 + // 呼叫邀请有效期清除计时
  1939 + Store.invitationClearTimeout &&
  1940 + clearTimeout(Store.invitationClearTimeout);
  1941 + Utils.alertWhole("呼叫邀请成功", "alert-success");
  1942 + var invitationResponse = JSON.parse(response);
  1943 + // 采集音视频
  1944 + await SdkPackge.RTC.getUserMedia();
  1945 + // 隐藏邀请页面
  1946 + PageShow.hiddenCallPage();
  1947 + Store.network = Object.assign(Store.network, {
  1948 + Mode: invitationResponse.Mode,
  1949 + status: 2,
  1950 + calltype: 0,
  1951 + });
  1952 + if (invitationResponse.Mode == 1) {
  1953 + // 语音通话
  1954 + PageShow.showVoicePage();
  1955 + // 关闭视频并释放
  1956 + Store.localTracks.videoTrack &&
  1957 + (await Store.localTracks.videoTrack.close(),
  1958 + (Store.localTracks.videoTrack = null));
  1959 + // 发布媒体流
  1960 + await SdkPackge.RTC.publishLocalTracks();
  1961 + // 显示通话时长
  1962 + OperationPackge.public.communicationDuration("audioDuration");
  1963 + } else {
  1964 + // 本地预览
  1965 + await OperationPackge.p2p.createVideoAdd();
  1966 + // 视频通话
  1967 + PageShow.showVideoPage();
  1968 + // 发布媒体流
  1969 + await SdkPackge.RTC.publishLocalTracks();
  1970 + // 显示通话时长
  1971 + OperationPackge.public.communicationDuration("videoDuration");
  1972 + }
  1973 + },
  1974 + // RTM 主叫: 被叫拒绝了你的呼叫邀请
  1975 + localInvitationRefused: async function (response) {
  1976 + if (Store.localInvitation) {
  1977 + Utils.printLog(
  1978 + "danger",
  1979 + "Your invitation has been refused by " +
  1980 + Store.localInvitation.calleeId
  1981 + );
  1982 + // console.log("p2p 被叫拒绝了你的呼叫邀请", response);
  1983 + // 呼叫邀请有效期清除计时
  1984 + Store.invitationClearTimeout &&
  1985 + clearTimeout(Store.invitationClearTimeout);
  1986 + // 字符串转换
  1987 + response ? (response = JSON.parse(response)) : "";
  1988 + response.Cmd == "Calling"
  1989 + ? Utils.alertWhole("呼叫的用户正在通话中", "alert-info")
  1990 + : Utils.alertWhole("用户拒绝了你的呼叫邀请", "alert-info");
  1991 + // 本地存储恢复
  1992 + OperationPackge.public.restoreDefault();
  1993 + // 隐藏呼叫邀请页面
  1994 + PageShow.hiddenCallPage();
  1995 + }
  1996 + },
  1997 + // RTM 主叫: 呼叫邀请进程失败
  1998 + localInvitationFailure: async function (response) {
  1999 + // 呼叫邀请有效期清除计时
  2000 + Store.invitationClearTimeout &&
  2001 + clearTimeout(Store.invitationClearTimeout);
  2002 + },
  2003 + // RTM 主叫: 呼叫邀请已被成功取消 (主动挂断)
  2004 + localInvitationCanceled: async function () {
  2005 + // console.log("p2p 呼叫邀请已被成功取消 主叫主动挂断");
  2006 + // 呼叫邀请有效期清除计时
  2007 + Store.invitationClearTimeout &&
  2008 + clearTimeout(Store.invitationClearTimeout);
  2009 + // 本地存储恢复
  2010 + await OperationPackge.public.restoreDefault();
  2011 + // 隐藏呼叫邀请页面
  2012 + PageShow.hiddenCallPage();
  2013 + },
  2014 +
  2015 + // RTM 被叫: p2p 收到来自主叫的呼叫邀请
  2016 + RemoteInvitationReceived: async function (invitationContent) {
  2017 + Store.channelId = invitationContent.ChanId;
  2018 + Store.network = await Object.assign(Store.network, {
  2019 + // type: "rtm",
  2020 + calltype: 1, // 被叫
  2021 + status: 1, // 呼叫中
  2022 + Mode: invitationContent.Mode,
  2023 + });
  2024 + // console.log("p2p 收到来自主叫的呼叫邀请", Store);
  2025 + // 被呼叫页面 转换语音按钮是否显示
  2026 + PageShow.toSpeech(invitationContent.Mode);
  2027 + // 被呼叫页面展示
  2028 + PageShow.showCalledPage();
  2029 + // 监听接受呼叫邀请
  2030 + Store.remoteInvitation.on(
  2031 + "RemoteInvitationAccepted",
  2032 + OperationPackge.p2p.RemoteInvitationAccepted
  2033 + );
  2034 + // 监听拒绝呼叫邀请
  2035 + Store.remoteInvitation.on(
  2036 + "RemoteInvitationRefused",
  2037 + OperationPackge.p2p.RemoteInvitationRefused
  2038 + );
  2039 + // 监听主叫取消呼叫邀请
  2040 + Store.remoteInvitation.on(
  2041 + "RemoteInvitationCanceled",
  2042 + OperationPackge.p2p.RemoteInvitationCanceled
  2043 + );
  2044 + // 监听呼叫邀请进程失败
  2045 + Store.remoteInvitation.on(
  2046 + "RemoteInvitationFailure",
  2047 + OperationPackge.p2p.RemoteInvitationFailure
  2048 + );
  2049 + },
  2050 + // RTM 被叫: 接受呼叫邀请成功
  2051 + RemoteInvitationAccepted: async function () {
  2052 + Store.JoinRTCChannel = true;
  2053 + var invitationContent = JSON.parse(Store.remoteInvitation.response);
  2054 + // 接受邀请进入计时,如果频道一定时间内无人加入取消
  2055 + Store.callChannelPro = setTimeout(() => {
  2056 + console.log("接受邀请进入计时,如果频道一定时间内无人加入取消");
  2057 + OperationPackge.p2p.cancelCall(1);
  2058 + }, Store.callChannelProTime);
  2059 + // RTC 加入房间
  2060 + Store.ownUserId = await Store.rtcClient.join(
  2061 + Config.APPID,
  2062 + Store.channelId + "",
  2063 + null,
  2064 + Store.ownUserId
  2065 + );
  2066 +
  2067 + // 采集音视频
  2068 + await SdkPackge.RTC.getUserMedia();
  2069 + // 隐藏被呼叫页面
  2070 + await PageShow.hiddenCalledPage();
  2071 + Store.network = Object.assign(Store.network, {
  2072 + Mode: invitationContent.Mode,
  2073 + status: 2,
  2074 + calltype: 1,
  2075 + });
  2076 + if (invitationContent.Mode == 1) {
  2077 + // 语音通话
  2078 + await PageShow.showVoicePage();
  2079 + // 关闭视频并释放
  2080 + Store.localTracks.videoTrack &&
  2081 + (await Store.localTracks.videoTrack.close(),
  2082 + (Store.localTracks.videoTrack = null));
  2083 + // 发布媒体流
  2084 + await SdkPackge.RTC.publishLocalTracks();
  2085 + // 显示通话时长
  2086 + await OperationPackge.public.communicationDuration("audioDuration");
  2087 + } else {
  2088 + // 本地预览
  2089 + await OperationPackge.p2p.createVideoAdd();
  2090 + // 视频通话
  2091 + await PageShow.showVideoPage();
  2092 + // 发布媒体流
  2093 + await SdkPackge.RTC.publishLocalTracks();
  2094 + // 显示通话时长
  2095 + await OperationPackge.public.communicationDuration("videoDuration");
  2096 + }
  2097 + },
  2098 + // RTM 被叫: 拒绝呼叫邀请成功
  2099 + RemoteInvitationRefused: async function () {
  2100 + // console.log("RTM 被叫: 拒绝呼叫邀请成功", Store);
  2101 + Utils.printLog("[info]", "RemoteInvitationRefused");
  2102 + OperationPackge.p2p.cancelCall(2);
  2103 + },
  2104 + // RTM 被叫: 主叫取消呼叫邀请
  2105 + RemoteInvitationCanceled: async function () {
  2106 + // console.log("RTM 被叫: 主叫取消呼叫邀请", Store.network);
  2107 + if (Store.network.status == 1) {
  2108 + Utils.printLog("[info]", "RemoteInvitationCanceled");
  2109 + // 恢复默认
  2110 + await OperationPackge.public.restoreDefault();
  2111 + // 隐藏被呼叫页面
  2112 + await PageShow.hiddenCallPage();
  2113 + // 页面提示
  2114 + Utils.alertWhole("主叫取消呼叫邀请");
  2115 + // 显示首页
  2116 + PageShow.showIndex();
  2117 + }
  2118 + },
  2119 + // RTM 被叫: 呼叫邀请进程失败
  2120 + RemoteInvitationFailure: async function () {
  2121 + if (Store.network.status == 1) {
  2122 + Utils.printLog("[info]", "RemoteInvitationFailure");
  2123 + // 恢复默认
  2124 + await OperationPackge.public.restoreDefault();
  2125 + // 隐藏被呼叫页面
  2126 + await PageShow.hiddenCallPage();
  2127 + // 页面提示
  2128 + Utils.alertWhole("呼叫邀请进程失败");
  2129 + // 显示首页
  2130 + PageShow.showIndex();
  2131 + }
  2132 + },
  2133 +
  2134 + // RTM 收到挂断信息
  2135 + hangupInfo: async function () {
  2136 + await Utils.alertWhole("通话已结束", "alert-success");
  2137 + // 释放采集设备
  2138 + await SdkPackge.RTC.LocalTracksClose();
  2139 + // 本地存储恢复
  2140 + await OperationPackge.public.restoreDefault();
  2141 + // 通话页面恢复初始
  2142 + await PageShow.initSetingP2P();
  2143 + // 回到首页
  2144 + await PageShow.showIndex();
  2145 + },
  2146 +
  2147 + // RTC 用户发布
  2148 + userPublished: async function (user, mediaType) {
  2149 + // console.log("p2p 用户" + user.uid + "发布" + mediaType);
  2150 + Store.peerUserId = user.uid; // 存储远端用户uid
  2151 + if (mediaType === "video") {
  2152 + PageShow.networkRemoShow(false);
  2153 + // 远端用户发布的视频渲染
  2154 + OperationPackge.p2p.createPeerVideoAdd(user);
  2155 + } else {
  2156 + user.audioTrack && user.audioTrack.play();
  2157 + }
  2158 + },
  2159 + // RTC 用户取消发布
  2160 + userUnpublished: async function (user, mediaType) {
  2161 + if (mediaType === "video") {
  2162 + PageShow.networkRemoShow(true);
  2163 + }
  2164 + // console.log("用户" + user.uid + "取消发布" + mediaType);
  2165 + },
  2166 + // RTC 用户加入频道
  2167 + userJoined: function (user) {
  2168 + // console.log("RTC 用户加入频道", user, Store.peerUserId);
  2169 + if (user.uid == Store.peerUserId) {
  2170 + Store.callChannelPro && clearTimeout(Store.callChannelPro);
  2171 + Store.remodVideoEnd && clearTimeout(Store.remodVideoEnd);
  2172 + }
  2173 + },
  2174 + // RTC 用户离开频道
  2175 + userLeft: async function (user, reason) {
  2176 + // console.log("RTC 用户离开频道", user, reason);
  2177 + //因网络断线离开
  2178 + if (reason == "ServerTimeOut") {
  2179 + Utils.alertWhole("对方网络异常", "alert-warning");
  2180 + // await PageShow.networkP2P();
  2181 + // 10s 远端不在加入离开
  2182 + Store.remodVideoEnd = setTimeout(async () => {
  2183 + Utils.alertWhole("通话异常", "alert-warning");
  2184 + // 释放采集设备
  2185 + await SdkPackge.RTC.LocalTracksClose();
  2186 + // 本地存储恢复
  2187 + await OperationPackge.public.restoreDefault();
  2188 + // 页面恢复初始
  2189 + await PageShow.initSetingP2P();
  2190 + // 回到首页
  2191 + await PageShow.showIndex();
  2192 + }, Store.remodVideoEndTime);
  2193 + // 保留页面
  2194 + } else {
  2195 + Utils.alertWhole("通话已结束", "alert-success");
  2196 + // 释放采集设备
  2197 + await SdkPackge.RTC.LocalTracksClose();
  2198 + // 本地存储恢复
  2199 + await OperationPackge.public.restoreDefault();
  2200 + // 页面恢复初始
  2201 + await PageShow.initSetingP2P();
  2202 + // 回到首页
  2203 + await PageShow.showIndex();
  2204 + }
  2205 + },
  2206 +
  2207 + // p2p 断网重连后发送查询信息
  2208 + networkSendInfo: function () {
  2209 + let oSend = setInterval(() => {
  2210 + if (Store.lineworkRTC && Store.lineworkRTM) {
  2211 + clearInterval(oSend);
  2212 + // 发送查询信息
  2213 + Store.rtmClient &&
  2214 + Store.rtmClient
  2215 + .sendMessageToPeer(
  2216 + {
  2217 + text: JSON.stringify({
  2218 + Cmd: "CallState",
  2219 + }),
  2220 + },
  2221 + Store.peerUserId // 对端用户的 uid。
  2222 + )
  2223 + .catch((err) => {
  2224 + // 你的代码:点对点消息发送失败。
  2225 + // console.log(err);
  2226 + });
  2227 + // 一定时间无响应取消
  2228 + Store.networkReconnection = setTimeout(() => {
  2229 + console.log("发送查询信息,一定时间无响应取消");
  2230 + OperationPackge.p2p.cancelCall(1);
  2231 + }, Store.networkReconnectionTime);
  2232 + }
  2233 + }, 500);
  2234 + },
  2235 + // p2p 回复远端断网重连所需信息
  2236 + replySendInfo: function (peerId) {
  2237 + let oSend = setInterval(() => {
  2238 + if (Store.lineworkRTC && Store.lineworkRTM) {
  2239 + clearInterval(oSend);
  2240 + // 发送查询信息
  2241 + Store.rtmClient &&
  2242 + Store.rtmClient
  2243 + .sendMessageToPeer(
  2244 + {
  2245 + text: JSON.stringify({
  2246 + Cmd: "CallStateResult",
  2247 + state:
  2248 + Store.peerUserId !== peerId ? 0 : Store.network.status,
  2249 + Mode: Store.network.Mode,
  2250 + }),
  2251 + },
  2252 + peerId // 对端用户的 uid。
  2253 + )
  2254 + .catch((err) => {
  2255 + // 你的代码:点对点消息发送失败。
  2256 + // console.log(err);
  2257 + });
  2258 + }
  2259 + }, 500);
  2260 + },
  2261 + },
  2262 + multi: {
  2263 + // 频道消息
  2264 + ChannelMessage: function (message) {
  2265 + // console.log("频道消息", message);
  2266 + },
  2267 + // 频道人员加入
  2268 + MemberJoined: function (memberId) {
  2269 + // console.log("频道人员加入", memberId);
  2270 + },
  2271 + // 频道人员离开
  2272 + MemberLeft: async function (memberId) {
  2273 + // console.log("频道人员离开", memberId);
  2274 + await Utils.deleteUserView(memberId);
  2275 + },
  2276 +
  2277 + // 音视频设置
  2278 + setVideoOrAudio: async function () {
  2279 + PageShow.setEnableAudio(Store.setting.enableAudio);
  2280 + PageShow.setEnableVideo(Store.setting.enableVideo);
  2281 + },
  2282 +
  2283 + // 发起呼叫
  2284 + makeCall: async function (userOnlineStatus) {
  2285 + // 在线人员
  2286 + Store.invitationUserIds = userOnlineStatus.oOline;
  2287 + // 标识为正在通话中
  2288 + Store.Calling = true;
  2289 + Store.JoinRTCChannel = true;
  2290 + // 本地用户加入 RTM 频道
  2291 + await OperationPackge.multi.JoinRTMChannel();
  2292 + // 本地用户加入 RTC 实时通讯频道
  2293 + Store.ownUserId = await Store.rtcClient.join(
  2294 + Config.APPID,
  2295 + Store.channelId,
  2296 + null,
  2297 + Store.ownUserId
  2298 + );
  2299 + // 提示用户不在线
  2300 + userOnlineStatus.oNotOline.length > 0 &&
  2301 + Utils.alertWhole("用户" + userOnlineStatus.oNotOline + "不在线");
  2302 + // 创建窗口
  2303 + await Utils.createUserView(Store.ownUserId);
  2304 + // 隐藏本地窗口
  2305 + await Utils.switchoverHidden(Store.ownUserId, false);
  2306 + // 发送呼叫邀请 并创建用户视图
  2307 + await OperationPackge.multi.SendLocalInvitation(userOnlineStatus.oOline);
  2308 + // 本地音视频渲染
  2309 + await OperationPackge.multi.LocalAudioVideoRender();
  2310 + // 显示会议页面
  2311 + await PageShow.showMeetPage();
  2312 + },
  2313 + // 查询呼叫的用户是否在线
  2314 + QueryPeersOnlineStatus: async function () {
  2315 + var userOnlineStatus = await Store.rtmClient.queryPeersOnlineStatus(
  2316 + Store.invitationUserIds
  2317 + );
  2318 + // 分离在线用户和不在线用户
  2319 + var oOline = [];
  2320 + var oNotOline = [];
  2321 + Store.invitationUserIds.map(function (userid, index) {
  2322 + //不在线
  2323 + if (userOnlineStatus[userid]) {
  2324 + oOline.push(userid);
  2325 + } else {
  2326 + oNotOline.push(userid);
  2327 + }
  2328 + });
  2329 + return {
  2330 + oOline, // 在线用户
  2331 + oNotOline, // 不在线用户
  2332 + };
  2333 + },
  2334 + // 加入 RTM 频道
  2335 + JoinRTMChannel: async function () {
  2336 + // 正在通话中
  2337 + Store.Calling = true;
  2338 + // RTM 频道初始化
  2339 + await SdkPackge.RTMChannel.init();
  2340 + // 加入 RTM 频道
  2341 + await Store.rtmChannel.join();
  2342 + },
  2343 + // 发送呼叫邀请
  2344 + SendLocalInvitation: function (Online) {
  2345 + Online.forEach(function (userid) {
  2346 + // 创建呼叫用户视图
  2347 + Utils.createUserView(userid, 0);
  2348 + // 创建呼叫邀请并发送
  2349 + OperationPackge.multi.createLocalInvitationAndSend(userid);
  2350 + });
  2351 + },
  2352 + // 接受呼叫
  2353 + acceptCall: async function () {
  2354 + // 查询频道内在线用户
  2355 + var oUserData = await Store.rtmChannel.getMembers();
  2356 + Store.invitationUserIds = oUserData;
  2357 + Store.remoteInvitation.response = await JSON.stringify({
  2358 + Mode: 0,
  2359 + Conference: true,
  2360 + refuseId: Store.ownUserId,
  2361 + UserData: "",
  2362 + SipData: "",
  2363 + });
  2364 + await Store.remoteInvitation.accept();
  2365 +
  2366 + // 在线的用户创建视图窗口
  2367 + await Store.invitationUserIds.forEach(async function (userid) {
  2368 + // 创建用户视图窗口
  2369 + await Utils.createUserView(userid, 0);
  2370 + if (userid == Store.ownUserId) {
  2371 + Utils.switchoverHidden(userid, false);
  2372 + }
  2373 + });
  2374 + // 隐藏被呼叫页面
  2375 + await PageShow.hiddenCalledPage();
  2376 + // 显示会议页面
  2377 + await PageShow.showMeetPage();
  2378 + },
  2379 + // 本地音视频渲染
  2380 + LocalAudioVideoRender: async function () {
  2381 + // 释放采集设备
  2382 + await SdkPackge.RTC.LocalTracksClose();
  2383 +
  2384 + // 采集本地图像
  2385 + await SdkPackge.RTC.getUserMedia();
  2386 + // 发布音视频
  2387 + await SdkPackge.RTC.publishLocalTracks();
  2388 +
  2389 + // 设置音视频
  2390 + await OperationPackge.multi.setVideoOrAudio();
  2391 +
  2392 + if (!Store.bigMutiUser.uid || Store.bigMutiUser.uid == Store.ownUserId) {
  2393 + // 本地预览(默认渲染大屏)
  2394 + Utils.switchoverLeftBottom(Store.ownUserId);
  2395 +
  2396 + Store.localTracks.videoTrack &&
  2397 + (await Store.localTracks.videoTrack.play("peerMutiVideoPreview", {
  2398 + fit: "contain",
  2399 + }));
  2400 + // 记录大屏数据
  2401 + Store.bigMutiUser = {
  2402 + uid: Store.ownUserId,
  2403 + videoTrack: Store.localTracks.videoTrack,
  2404 + };
  2405 + } else {
  2406 + // 本地预览(渲染小屏)
  2407 + Store.localTracks.videoTrack &&
  2408 + (await Store.localTracks.videoTrack.play(
  2409 + Store.ownUserId + "VideoView",
  2410 + {
  2411 + fit: "contain",
  2412 + }
  2413 + ));
  2414 + }
  2415 +
  2416 + await Utils.updateUserViewStatus(Store.ownUserId, 1);
  2417 + // 更新音频状态
  2418 + await Utils.updateUserAudioState(
  2419 + Store.ownUserId,
  2420 + Store.setting.enableAudio
  2421 + );
  2422 + // 绑定大小屏切换
  2423 + await Utils.switchover({
  2424 + uid: Store.ownUserId,
  2425 + videoTrack: Store.localTracks.videoTrack,
  2426 + });
  2427 + },
  2428 + // 会议邀请 邀请用户
  2429 + MeetingUser: async function () {
  2430 + var userid = "";
  2431 + $("#userMutiModalInputs > input").each(function () {
  2432 + userid += this.value;
  2433 + });
  2434 + // 清空所有输入框
  2435 + $("#userMutiModalInputs > input").each(function () {
  2436 + this.value = "";
  2437 + });
  2438 + // 筛选用户
  2439 + if (userid.length !== 4) {
  2440 + Utils.alertWhole("用户ID不合法", "alert-danger");
  2441 + return;
  2442 + }
  2443 + // 查看用户已存在
  2444 + if (
  2445 + ~Store.invitationUserIds.indexOf(userid) ||
  2446 + userid == Store.ownUserId
  2447 + ) {
  2448 + Utils.alertWhole("邀请的用户已存在", "alert-danger");
  2449 + return;
  2450 + }
  2451 + // 用户是否在线
  2452 + var userOnlineStatus = await Store.rtmClient.queryPeersOnlineStatus([
  2453 + userid,
  2454 + ]);
  2455 + if (!userOnlineStatus[userid]) {
  2456 + Utils.alertWhole("用户不在线,无法邀请", "alert-danger");
  2457 + return;
  2458 + }
  2459 + return userid;
  2460 + },
  2461 + // RTM 主叫: 创建呼叫邀请并发送
  2462 + createLocalInvitationAndSend: async function (userid) {
  2463 + var localInvitation = await Store.rtmClient.createLocalInvitation(userid);
  2464 + var oUserData = await Store.rtmChannel.getMembers();
  2465 + if (
  2466 + [Store.ownUserId].concat(Store.invitationUserIds).length >
  2467 + oUserData.length
  2468 + ) {
  2469 + oUserData = [Store.ownUserId].concat(Store.invitationUserIds);
  2470 + }
  2471 + oUserData = [...new Set(oUserData)];
  2472 + // 设置邀请内容
  2473 + localInvitation.content = await JSON.stringify({
  2474 + Mode: 0, // 呼叫的类型0:视频 1:语音
  2475 + Conference: true,
  2476 + ChanId: Store.channelId,
  2477 + UserData: oUserData, // 邀请的人员添加到UserData [Store.ownUserId].concat(Store.invitationUserIds)
  2478 + SipData: "",
  2479 + VidCodec: ["H264"],
  2480 + AudCodec: ["Opus"],
  2481 + });
  2482 + // 发送
  2483 + await localInvitation.send();
  2484 + Utils.printLog("[info]", "you sent an invitation to " + userid);
  2485 + // 主叫:被叫已收到呼叫邀请。
  2486 + localInvitation.on("LocalInvitationReceivedByPeer", async function () {
  2487 + Utils.printLog(
  2488 + "[info]",
  2489 + "Your invitation has been received by " + localInvitation.calleeId
  2490 + );
  2491 + });
  2492 + // 主叫:被叫已接受呼叫邀请。
  2493 + localInvitation.on(
  2494 + "LocalInvitationAccepted",
  2495 + OperationPackge.multi.LocalInvitationAccepted
  2496 + );
  2497 + // 主叫: 被叫拒绝呼叫邀请
  2498 + localInvitation.on(
  2499 + "LocalInvitationRefused",
  2500 + OperationPackge.multi.LocalInvitationRefused
  2501 + );
  2502 + // 主叫: 呼叫邀请已被成功取消。
  2503 + localInvitation.on("LocalInvitationCanceled", function () {
  2504 + Utils.printLog("[info]", "Local invitation canceled");
  2505 + });
  2506 + // 主叫:呼叫邀请进程失败。
  2507 + localInvitation.on(
  2508 + "LocalInvitationFailure",
  2509 + OperationPackge.multi.LocalInvitationFailure
  2510 + );
  2511 + },
  2512 + // RTM 主叫: 被叫已接受呼叫邀请。
  2513 + LocalInvitationAccepted: async function (response) {
  2514 + // console.log("被叫已接受呼叫邀请。", response);
  2515 + if (response) {
  2516 + response = JSON.parse(response);
  2517 + Utils.printLog(
  2518 + "[info]",
  2519 + response.refuseId + " accepted your invitation"
  2520 + );
  2521 + // 更新用户状态及窗口显示 - 对方已接收
  2522 + Utils.updateUserViewStatus(response.refuseId, 1);
  2523 + }
  2524 + },
  2525 + // RTM 主叫: 被叫拒绝呼叫邀请
  2526 + LocalInvitationRefused: async function (response) {
  2527 + // console.log("被叫拒绝呼叫邀请", response);
  2528 + const responseInfo = response ? JSON.parse(response) : "";
  2529 + if (responseInfo) {
  2530 + // 更新用户状态及窗口显示 - 对方已拒绝
  2531 + await Utils.updateUserViewStatus(responseInfo.refuseId, 2);
  2532 + if (responseInfo.Cmd == "Calling") {
  2533 + await Utils.alertWhole("呼叫的用户正在通话中", "alert-info");
  2534 + } else {
  2535 + await Utils.alertWhole(
  2536 + "用户" + (responseInfo.refuseId || "") + "拒绝呼叫邀请",
  2537 + "alert-info"
  2538 + );
  2539 + }
  2540 + // 移除用户窗口
  2541 + await Utils.deleteUserView(responseInfo.refuseId);
  2542 + }
  2543 + },
  2544 + // RTM 主叫: 呼叫邀请进程失败
  2545 + LocalInvitationFailure: function (reason) {
  2546 + // console.log("呼叫邀请进程失败", reason);
  2547 + },
  2548 + // RTM 被叫: 多人 收到来自主叫的呼叫邀请
  2549 + RemoteInvitationReceived: async function (invitationContent) {
  2550 + Utils.printLog(
  2551 + "[info]",
  2552 + "You recive an invitation from " + Store.remoteInvitation.callerId
  2553 + );
  2554 + // console.log("多人 收到来自主叫的呼叫邀请");
  2555 + // 加入的频道
  2556 + Store.channelId = invitationContent.ChanId;
  2557 + // 加入 RTM 频道
  2558 + await OperationPackge.multi.JoinRTMChannel();
  2559 + // 显示被呼叫页面
  2560 + await PageShow.showCalledPage();
  2561 + // 显示邀请人
  2562 + $("#callerIdView").html(invitationContent.UserData.join(","));
  2563 + // 隐藏转换语音通话按钮
  2564 + PageShow.toSpeech(1);
  2565 + // 被叫: 接受呼叫邀请
  2566 + Store.remoteInvitation.on(
  2567 + "RemoteInvitationAccepted",
  2568 + OperationPackge.multi.RemoteInvitationAccepted
  2569 + );
  2570 + // 被叫: 拒绝呼叫邀请
  2571 + Store.remoteInvitation.on(
  2572 + "RemoteInvitationRefused",
  2573 + OperationPackge.multi.RemoteInvitationRefused
  2574 + );
  2575 + // 被叫: 主叫已取消呼叫邀请
  2576 + Store.remoteInvitation.on(
  2577 + "RemoteInvitationCanceled",
  2578 + OperationPackge.multi.RemoteInvitationCanceled
  2579 + );
  2580 + // 被叫: 呼叫邀请进程失败
  2581 + Store.remoteInvitation.on(
  2582 + "RemoteInvitationFailure",
  2583 + OperationPackge.multi.RemoteInvitationFailure
  2584 + );
  2585 + },
  2586 + // RTM 被叫: 接受呼叫邀请
  2587 + RemoteInvitationAccepted: async function () {
  2588 + // console.log("被叫: 接受呼叫邀请");
  2589 + Store.JoinRTCChannel = true;
  2590 + // 加入 RTC 实时通讯频道
  2591 + Store.ownUserId = await Store.rtcClient.join(
  2592 + Config.APPID,
  2593 + Store.channelId,
  2594 + null,
  2595 + Store.ownUserId
  2596 + );
  2597 + // 更新用户状态及窗口显示 - 对方已接收
  2598 + await Utils.updateUserViewStatus(Store.remoteInvitation.callerId, 1);
  2599 + await OperationPackge.multi.LocalAudioVideoRender();
  2600 + },
  2601 + // RTM 被叫: 拒绝呼叫邀请
  2602 + RemoteInvitationRefused: async function () {
  2603 + Utils.alertWhole("已拒绝呼叫邀请", "alert-info");
  2604 + PageShow.initSetingMulti(); // 恢复初始
  2605 + // 恢复默认
  2606 + await OperationPackge.public.restoreDefault();
  2607 + // 显示首页
  2608 + PageShow.showIndex();
  2609 + },
  2610 + // RTM 被叫: 主叫已取消呼叫邀请
  2611 + RemoteInvitationCanceled: async function () {
  2612 + // console.log("主叫已取消呼叫邀请");
  2613 + // 恢复默认
  2614 + await OperationPackge.public.restoreDefault();
  2615 + // 隐藏被呼叫页面
  2616 + await PageShow.hiddenCallPage();
  2617 + // 页面提示
  2618 + Utils.alertWhole("主叫取消呼叫邀请");
  2619 + // 显示首页
  2620 + PageShow.showIndex();
  2621 + },
  2622 + // RTM 被叫: 呼叫邀请进程失败
  2623 + RemoteInvitationFailure: function () {
  2624 + // console.log("呼叫邀请进程失败");
  2625 + },
  2626 + // RTC 用户发布
  2627 + userPublished: async function (user, mediaType) {
  2628 + console.log("用户" + user.uid + "发布" + mediaType);
  2629 + var oArray = await Store.invitationUserIds.concat([user.uid]);
  2630 + Store.invitationUserIds = Array.from(await new Set(oArray));
  2631 + if ($("#" + user.uid + "Window").length > 0) {
  2632 + // 更新视图
  2633 + Utils.updateUserViewStatus(user.uid, 1);
  2634 + } else {
  2635 + // 创建视图
  2636 + await Utils.createUserView(user.uid);
  2637 + }
  2638 +
  2639 + if (mediaType === "video") {
  2640 + // 默认接收小流
  2641 + await Store.rtcClient
  2642 + .setRemoteVideoStreamType(
  2643 + user.uid,
  2644 + Store.bigMutiUser.uid == user.uid ? 0 : 1
  2645 + )
  2646 + .then(() => {})
  2647 + .catch((err) => {
  2648 + console.log(
  2649 + Store.bigMutiUser.uid == user.uid
  2650 + ? "默认接收大流失败"
  2651 + : "默认接收小流失败",
  2652 + err
  2653 + );
  2654 + });
  2655 + // 绑定大小屏切换
  2656 + await Utils.switchover(user);
  2657 + // 存放用户发布的视频
  2658 + user.videoTrack &&
  2659 + (await user.videoTrack.play(
  2660 + Store.bigMutiUser.uid == user.uid
  2661 + ? "peerMutiVideoPreview"
  2662 + : user.uid + "VideoView",
  2663 + {
  2664 + fit: "contain",
  2665 + }
  2666 + ));
  2667 + } else {
  2668 + user.audioTrack && (await user.audioTrack.play());
  2669 + // 更改用户的音频状态
  2670 + await Utils.updateUserAudioState(user.uid, user.hasAudio);
  2671 + }
  2672 + },
  2673 + // RTC 用户取消发布
  2674 + userUnpublished: async function (user, mediaType) {
  2675 + // console.log("用户" + user.uid + "取消发布" + mediaType);
  2676 + if (mediaType === "audio") {
  2677 + Utils.updateUserAudioState(user.uid, false);
  2678 + }
  2679 + },
  2680 + // RTC 用户离开频道
  2681 + userLeft: async function (user, reason) {
  2682 + // console.log("RTC 用户离开频道", reason);
  2683 + //因网络断线离开
  2684 + if (reason == "ServerTimeOut") {
  2685 + Utils.alertWhole("用户" + user.uid + "网络断线离开");
  2686 + } else {
  2687 + await Utils.alertWhole("用户" + user.uid + "离开", "alert-danger");
  2688 + }
  2689 + },
  2690 + },
  2691 +};
  2692 +
  2693 +// SDK 自检
  2694 +(async function () {
  2695 + //查看sdk版本
  2696 + console.log("RTC SDK 版本", ArRTC.VERSION);
  2697 + console.log("RTM SDK 版本", ArRTM.VERSION);
  2698 + // 视频设备状态变化
  2699 + ArRTC.onCameraChanged = function (info) {
  2700 + SdkPackge.Support.cameraChanged(info);
  2701 + };
  2702 + // 音频设备状态变化
  2703 + ArRTC.onMicrophoneChanged = function (info) {
  2704 + SdkPackge.Support.microphoneChanged(info);
  2705 + };
  2706 + // // SDK 设备支持检测
  2707 + // var fase = await SdkPackge.Support.hardwareSupport();
  2708 + // fase &&
  2709 + // // 初始化RTC
  2710 + // (SdkPackge.RTC.init(),
  2711 + // // 初始化RTM
  2712 + // SdkPackge.RTM.init());
  2713 + // 初始化RTC
  2714 + SdkPackge.RTC.init();
  2715 + // 初始化RTM
  2716 + SdkPackge.RTM.init();
  2717 +})();
  2718 +
  2719 +// p2p点击相关操作4
  2720 +{
  2721 + // 选择p2p呼叫
  2722 + $("#openP2PInvite").click(function () {
  2723 + !$("#loginHome").hasClass("d-none") && $("#loginHome").addClass("d-none");
  2724 + $("#loginForm").hasClass("d-none") && $("#loginForm").removeClass("d-none");
  2725 + Utils.setPageTitle("anyrtc P2P呼叫邀请DEMO - anyRTC");
  2726 + Store.Conference = false;
  2727 + });
  2728 +
  2729 + // 打开设置
  2730 + $("#openSettingBtn").click(async function () {
  2731 + if (!$("#loginSetting").hasClass("show")) {
  2732 + try {
  2733 + $("#loginSetting").addClass("show");
  2734 + // 清空容器
  2735 + await $("#settingVideoPreview").html("");
  2736 + // 释放采集设备
  2737 + await SdkPackge.RTC.LocalTracksClose();
  2738 + // 重新采集视频
  2739 + await SdkPackge.RTC.getUserMedia();
  2740 + // 本地预览
  2741 + Store.localTracks.videoTrack &&
  2742 + Store.localTracks.videoTrack.play("settingVideoPreview");
  2743 + Store.localTracks.audioTrack && Store.localTracks.audioTrack.play();
  2744 + } catch (error) {
  2745 + console.log("==> 设置相关错误", error);
  2746 + if (error.code === "PERMISSION_DENIED") {
  2747 + Utils.alertWhole("设备被禁用");
  2748 + }
  2749 + }
  2750 + }
  2751 + });
  2752 + // 关闭设置
  2753 + $("#closeSettingBtn").click(async function () {
  2754 + await OperationPackge.p2p.closeSeting();
  2755 + });
  2756 +
  2757 + // 监听用户是否开启视频相关数据展示
  2758 + $("#videoDataSwitch").change(function () {
  2759 + var videoEnable = $(this).prop("checked");
  2760 + Store.setting.videoDataShow = videoEnable;
  2761 + });
  2762 +
  2763 + // 监听用户设置视频大小
  2764 + $("#settingVideoResolution").change(async function () {
  2765 + Store.setting.videoSize = await $("#settingVideoResolution")
  2766 + .val()
  2767 + .split("*")
  2768 + .map(Number);
  2769 + await OperationPackge.p2p.setOperation("分辨率");
  2770 + });
  2771 + // 监听用户设置音频设备
  2772 + $("#audioInputSelect").change(async function () {
  2773 + Store.setting.audioDevice = $("#audioInputSelect").val();
  2774 + await OperationPackge.p2p.setOperation("设置音频设备");
  2775 + });
  2776 + // 监听用户设置视频设备
  2777 + $("#videoInputSelect").change(async function () {
  2778 + Store.setting.videoDevice = $("#videoInputSelect").val();
  2779 + await OperationPackge.p2p.setOperation("设置视频设备");
  2780 + });
  2781 +
  2782 + // 监听用户ID输入 监听用户删除id
  2783 + Utils.inputChangId("#userInputs > input");
  2784 + // 语音呼叫
  2785 + $("#p2pAudioMakeCall").click(function () {
  2786 + if (navigator.onLine && Store.lineworkRTC && Store.lineworkRTM) {
  2787 + if (!Store.repetitionClick) {
  2788 + OperationPackge.p2p.makeVoiceCall();
  2789 + }
  2790 + } else {
  2791 + // 页面提示
  2792 + Utils.alertWhole("当前网络不可用");
  2793 + }
  2794 + });
  2795 + // 视频呼叫
  2796 + $("#p2pVideoMakeCall").click(function () {
  2797 + if (navigator.onLine && Store.lineworkRTC && Store.lineworkRTM) {
  2798 + if (!Store.repetitionClick) {
  2799 + OperationPackge.p2p.makeVideoCall();
  2800 + }
  2801 + } else {
  2802 + // 页面提示
  2803 + Utils.alertWhole("当前网络不可用");
  2804 + }
  2805 + });
  2806 + // 主叫-呼叫页面 挂断
  2807 + $("#cancelCallBtn").click(function () {
  2808 + // 挂断
  2809 + Store.localInvitation && Store.localInvitation.cancel();
  2810 + // 隐藏呼叫邀请页面
  2811 + PageShow.hiddenCallPage();
  2812 + // 本地存储恢复
  2813 + OperationPackge.public.restoreDefault();
  2814 + });
  2815 +
  2816 + // 被叫-呼叫页面 转语音通话
  2817 + $("#changAudioBtn").on("click", function () {
  2818 + OperationPackge.p2p.acceptCall("语音呼叫");
  2819 + });
  2820 +
  2821 + // 音视频展示-语音通话页面 音频开关
  2822 + $("#audioSwitchBtn").click(async function () {
  2823 + Store.localTracks.audioTrack.isMuted =
  2824 + !Store.localTracks.audioTrack.isMuted;
  2825 + // Store.localTracks.audioTrack.setEnabled(
  2826 + // !Store.localTracks.audioTrack.isMuted
  2827 + // );
  2828 + Store.localTracks.audioTrack &&
  2829 + (await Store.localTracks.audioTrack.setMuted(
  2830 + Store.localTracks.audioTrack.isMuted
  2831 + ));
  2832 + PageShow.audioSwitch();
  2833 + });
  2834 + // 音视频展示-语音通话页面 音频挂断
  2835 + $("#hangupAudioBtn").click(function () {
  2836 + // 取消当前通话
  2837 + OperationPackge.p2p.cancelCall();
  2838 + });
  2839 + // 音视频展示-视频通话页面 视频挂断
  2840 + $("#hangupBtn").click(function () {
  2841 + // 取消当前通话
  2842 + OperationPackge.p2p.cancelCall();
  2843 + });
  2844 + // 音视频展示-视频通话页面 切换语音通话
  2845 + $("#switchToAudioCall").click(async function () {
  2846 + // console.log("切换语音通话", Store.peerUserId);
  2847 + if (Store.localTracks.videoTrack) {
  2848 + await Store.rtmClient.sendMessageToPeer(
  2849 + {
  2850 + text: JSON.stringify({
  2851 + Cmd: "SwitchAudio",
  2852 + }),
  2853 + },
  2854 + Store.peerUserId // 对端用户的 uid。
  2855 + );
  2856 + // 语音通话
  2857 + await PageShow.showVoicePage();
  2858 + // 关闭视频并释放
  2859 + (await Store.localTracks.videoTrack) &&
  2860 + (Store.localTracks.videoTrack.close(),
  2861 + (Store.localTracks.videoTrack = null));
  2862 + Store.setting.videoStatsInterval &&
  2863 + clearInterval(Store.setting.videoStatsInterval);
  2864 + // 显示音频通话时长
  2865 + await OperationPackge.public.communicationDuration("audioDuration");
  2866 + }
  2867 + });
  2868 +}
  2869 +
  2870 +// 多人点击相关操作
  2871 +{
  2872 + // 选择多人呼叫
  2873 + $("#openMultiInvite").click(function () {
  2874 + !$("#loginHome").hasClass("d-none") && $("#loginHome").addClass("d-none");
  2875 + $("#loginMutiFprm").hasClass("d-none") &&
  2876 + $("#loginMutiFprm").removeClass("d-none");
  2877 + Utils.setPageTitle("anyrtc 多人呼叫邀请DEMO - anyRTC");
  2878 + Store.Conference = true;
  2879 + });
  2880 + // 用户输入
  2881 + Utils.inputChangIds("#multiUserInputs > input");
  2882 + // 监听打开设置按钮点击
  2883 + $("#multiOpenSettingBtn").click(function () {
  2884 + if (!$("#loginMutiSetting").hasClass("show")) {
  2885 + $("#loginMutiSetting").addClass("show");
  2886 + $("#userVideoCameraSetting").prop("checked", Store.setting.enableVideo);
  2887 + $("#userMicrophoneSetting").prop("checked", Store.setting.enableAudio);
  2888 + }
  2889 + });
  2890 + // 监听用户摄像头设置开关
  2891 + $("#userVideoCameraSetting").change(function () {
  2892 + var videoEnable = $(this).prop("checked");
  2893 + Store.setting.enableVideo = videoEnable;
  2894 + });
  2895 + // 监听用户麦克风设置开关
  2896 + $("#userMicrophoneSetting").change(function () {
  2897 + var audioEnable = $(this).prop("checked");
  2898 + Store.setting.enableAudio = audioEnable;
  2899 + });
  2900 + // 监听关闭设置按钮点击
  2901 + $("#closeMutiSettingBtn").click(function () {
  2902 + $("#loginMutiSetting").hasClass("show") &&
  2903 + $("#loginMutiSetting").removeClass("show");
  2904 + });
  2905 + // 发起多人音视频通话
  2906 + $("#MultipleCalls").click(async function () {
  2907 + if (Store.invitationUserIds.length > 0) {
  2908 + // 查询呼叫的用户是否在线
  2909 + var userOnlineStatus =
  2910 + await OperationPackge.multi.QueryPeersOnlineStatus();
  2911 + // 输入的用户中有在线的
  2912 + if (userOnlineStatus.oOline.length > 0) {
  2913 + // 主叫处理
  2914 + await OperationPackge.multi.makeCall(userOnlineStatus);
  2915 + } else {
  2916 + Utils.alertWhole("您输入的用户全都不在线");
  2917 + Store.invitationUserIds = [];
  2918 + $("#multiUserBtn").html("");
  2919 + }
  2920 + } else {
  2921 + Utils.alertWhole("请输入邀请的用户");
  2922 + }
  2923 + });
  2924 + // 音频开关
  2925 + $("#setAudioEnableBtn").click(async function () {
  2926 + Store.setting.enableAudio = !Store.setting.enableAudio;
  2927 +
  2928 + if (Store.setting.enableAudio && !Store.localTracks.audioTrack) {
  2929 + // 默认关闭音频时打开音频
  2930 + await SdkPackge.RTC.getUserMicrophonesPublish();
  2931 + } else {
  2932 + Store.localTracks.audioTrack &&
  2933 + (await Store.localTracks.audioTrack.setMuted(
  2934 + !Store.setting.enableAudio
  2935 + ));
  2936 + }
  2937 +
  2938 + // 更改用户的音频状态
  2939 + Utils.updateUserAudioState(Store.ownUserId, Store.setting.enableAudio);
  2940 + PageShow.setEnableAudio(Store.setting.enableAudio);
  2941 + });
  2942 + // 视频开关
  2943 + $("#setVideoEnableBtn").click(async function () {
  2944 + Store.setting.enableVideo = !Store.setting.enableVideo;
  2945 + if (!Store.localTracks.videoTrack && Store.setting.enableVideo) {
  2946 + // 默认关闭视频时打开视频
  2947 + await OperationPackge.multi.LocalAudioVideoRender();
  2948 + } else {
  2949 + Store.localTracks.videoTrack &&
  2950 + (await Store.localTracks.videoTrack.setMuted(
  2951 + !Store.setting.enableVideo
  2952 + ));
  2953 + }
  2954 + PageShow.setEnableVideo(Store.setting.enableVideo);
  2955 + });
  2956 + // 挂断
  2957 + $("#hangupMutiBtn").click(async function () {
  2958 + Object.keys(Store.invitationClearTimeouts).forEach(function (key) {
  2959 + Store.invitationClearTimeouts[key] &&
  2960 + clearTimeout(Store.invitationClearTimeouts[key]);
  2961 + });
  2962 + // 释放采集设备
  2963 + SdkPackge.RTC.LocalTracksClose();
  2964 +
  2965 + // // 通话页面恢复初始
  2966 + PageShow.initSetingMulti();
  2967 + // // 回到首页
  2968 + PageShow.showIndex();
  2969 + // // 本地存储恢复
  2970 + OperationPackge.public.restoreDefault();
  2971 + });
  2972 + // 输入框 (会议中邀请)
  2973 + Utils.inputChangId("#userMutiModalInputs > input");
  2974 + // 会议中邀请
  2975 + $("#mutiModalBtn").click(async function () {
  2976 + // 获取邀请用户
  2977 + var userid = await OperationPackge.multi.MeetingUser();
  2978 + if (userid) {
  2979 + // 发送邀请
  2980 + await OperationPackge.multi.createLocalInvitationAndSend(userid);
  2981 + // 创建用户视图窗口
  2982 + Utils.createUserView(userid, 0);
  2983 + // 隐藏邀请窗口
  2984 + $("#invitationModal").modal("hide");
  2985 + }
  2986 + });
  2987 +}
  2988 +
  2989 +// 被叫页面P2P与多人公共操作
  2990 +{
  2991 + // 被叫-呼叫页面 接受邀请
  2992 + $("#acceptCallBtn").on("click", function () {
  2993 + Store.Conference
  2994 + ? OperationPackge.multi.acceptCall()
  2995 + : OperationPackge.p2p.acceptCall("视频呼叫");
  2996 + });
  2997 +
  2998 + // 被叫-呼叫页面 拒绝接听
  2999 + $("#refuseCallBtn").on("click", function () {
  3000 + Store.remoteInvitation.response = JSON.stringify({
  3001 + refuseId: Store.ownUserId,
  3002 + });
  3003 + // 拒绝接听
  3004 + Store.remoteInvitation && Store.remoteInvitation.refuse();
  3005 + });
  3006 +}
  3007 +
  3008 +// 断网
  3009 +window.addEventListener("online", Utils.updateOnlineStatus);
  3010 +window.addEventListener("offline", Utils.updateOnlineStatus);
... ...
src/main/resources/static/real_control_v2/call/assets/js/jquery-3.5.1.min.js 0 → 100644
  1 +/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */
  2 +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});
... ...
src/main/resources/static/real_control_v2/call/assets/js/latest.js 0 → 100644
  1 +/*!
  2 + * ar-rtc-sdk v4.2.7
  3 + * (c) 2023 anyRTC SDK
  4 + * @license MIT
  5 + */
  6 +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).self=e.self||{})}(this,(function(e){"use strict";var t,n,r,i,o,a,s,c,d,u,l;e.ChannelMediaRelayError=void 0,(t=e.ChannelMediaRelayError||(e.ChannelMediaRelayError={})).DEST_TOKEN_EXPIRED="DEST_TOKEN_EXPIRED",t.RELAY_OK="RELAY_OK",t.SERVER_CONNECTION_LOST="SERVER_CONNECTION_LOST",t.SRC_TOKEN_EXPIRED="SRC_TOKEN_EXPIRED",e.ChannelMediaRelayEvent=void 0,(n=e.ChannelMediaRelayEvent||(e.ChannelMediaRelayEvent={})).NETWORK_CONNECTED="NETWORK_CONNECTED",n.NETWORK_DISCONNECTED="NETWORK_DISCONNECTED",n.PACKET_JOINED_DEST_CHANNEL="PACKET_JOINED_DEST_CHANNEL",n.PACKET_JOINED_SRC_CHANNEL="PACKET_JOINED_SRC_CHANNEL",n.PACKET_RECEIVED_AUDIO_FROM_SRC="PACKET_RECEIVED_AUDIO_FROM_SRC",n.PACKET_RECEIVED_VIDEO_FROM_SRC="PACKET_RECEIVED_VIDEO_FROM_SRC",n.PACKET_SENT_TO_DEST_CHANNEL="PACKET_SENT_TO_DEST_CHANNEL",n.PACKET_UPDATE_DEST_CHANNEL="PACKET_UPDATE_DEST_CHANNEL",n.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",n.PACKET_UPDATE_DEST_CHANNEL_REFUSED="PACKET_UPDATE_DEST_CHANNEL_REFUSED",e.ChannelMediaRelayState=void 0,(r=e.ChannelMediaRelayState||(e.ChannelMediaRelayState={})).RELAY_STATE_CONNECTING="RELAY_STATE_CONNECTING",r.RELAY_STATE_FAILURE="RELAY_STATE_FAILURE",r.RELAY_STATE_IDLE="RELAY_STATE_IDLE",r.RELAY_STATE_RUNNING="RELAY_STATE_RUNNING",e.ConnectionDisconnectedReason=void 0,(i=e.ConnectionDisconnectedReason||(e.ConnectionDisconnectedReason={})).CHANNEL_BANNED="CHANNEL_BANNED",i.IP_BANNED="IP_BANNED",i.LEAVE="LEAVE",i.NETWORK_OFFLINE="NETWORK_OFFLINE",i.NETWORK_ERROR="NETWORK_ERROR",i.SERVER_ERROR="SERVER_ERROR",i.UID_BANNED="UID_BANNED",i.DEVELOPER_INVALID="DEVELOPER_INVALID",i.TOKEN_INVALID="TOKEN_INVALID",i.CONNECT_TIME_OUT="CONNECT_TIME_OUT",i.KEEP_A_LIVE_TIME_OUT="KEEP_A_LIVE_TIME_OUT",e.RemoteStreamFallbackType=void 0,(o=e.RemoteStreamFallbackType||(e.RemoteStreamFallbackType={}))[o.AUDIO_ONLY=2]="AUDIO_ONLY",o[o.DISABLE=0]="DISABLE",o[o.LOW_STREAM=1]="LOW_STREAM",e.RemoteStreamType=void 0,(a=e.RemoteStreamType||(e.RemoteStreamType={}))[a.HIGH_STREAM=0]="HIGH_STREAM",a[a.LOW_STREAM=1]="LOW_STREAM",function(e){e[e.INJECT_STREAM_STATUS_START_SUCCESS=0]="INJECT_STREAM_STATUS_START_SUCCESS",e[e.INJECT_STREAM_STATUS_START_ALREADY_EXISTS=1]="INJECT_STREAM_STATUS_START_ALREADY_EXISTS",e[e.INJECT_STREAM_STATUS_START_UNAUTHORIZED=2]="INJECT_STREAM_STATUS_START_UNAUTHORIZED",e[e.INJECT_STREAM_STATUS_START_TIMEOUT=3]="INJECT_STREAM_STATUS_START_TIMEOUT",e[e.INJECT_STREAM_STATUS_START_FAILED=4]="INJECT_STREAM_STATUS_START_FAILED",e[e.INJECT_STREAM_STATUS_STOP_SUCCESS=5]="INJECT_STREAM_STATUS_STOP_SUCCESS",e[e.INJECT_STREAM_STATUS_STOP_NOT_FOUND=6]="INJECT_STREAM_STATUS_STOP_NOT_FOUND",e[e.INJECT_STREAM_STATUS_STOP_UNAUTHORIZED=7]="INJECT_STREAM_STATUS_STOP_UNAUTHORIZED",e[e.INJECT_STREAM_STATUS_STOP_TIMEOUT=8]="INJECT_STREAM_STATUS_STOP_TIMEOUT",e[e.INJECT_STREAM_STATUS_STOP_FAILED=9]="INJECT_STREAM_STATUS_STOP_FAILED",e[e.INJECT_STREAM_STATUS_BROKEN=10]="INJECT_STREAM_STATUS_BROKEN"}(s||(s={})),function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.TIMEOUT="TIMEOUT",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_SUPPORT="NOT_SUPPORT",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORT="OPERATION_ABORT",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",e.NETWORK_ERROR="NETWORK_ERROR",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",e.API_INVOKE_TIMEOUT="API_INVOKE_TIMEOUT",e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",e.ELECTRON_IS_NULL="ELECTRON_IS_NULL",e.ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR="ELECTRON_DESKTOP_CAPTURER_GET_SOURCES_ERROR",e.STREAM_ALREADY_INITIALIZED="STREAM_ALREADY_INITIALIZED",e.STREAM_IS_CLOSED="STREAM_IS_CLOSED",e.ABORT_OTHER_INIT="ABORT_OTHER_INIT",e.CHROME_PLUGIN_NO_RESPONSE="CHROME_PLUGIN_NO_RESPONSE",e.CHROME_PLUGIN_NOT_INSTALL="CHROME_PLUGIN_NOT_INSTALL",e.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",e.PERMISSION_DENIED="PERMISSION_DENIED",e.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",e.CAN_NOT_AUTOPLAY="CAN_NOT_AUTOPLAY",e.HIGH_STREAM_NO_VIDEO_TRACK="HIGH_STREAM_NO_VIDEO_TRACK",e.SCREEN_SHARE_CAN_NOT_CREATE_LOW_STREAM="SCREEN_SHARE_CAN_NOT_CREATE_LOW_STREAM",e.TOKEN_GENERATOR_FUNCTION_ERROR="TOKEN_GENERATOR_FUNCTION_ERROR",e.INVALID_UINT_UID_FROM_STRING_UID="INVALID_UINT_UID_FROM_STRING_UID",e.CAN_NOT_GET_PROXY_SERVER="CAN_NOT_GET_PROXY_SERVER",e.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",e.UID_CONFLICT="UID_CONFLICT",e.TRACK_ALREADY_PUBLISHED="TRACK_ALREADY_PUBLISHED",e.TRACK_IS_NOT_PUBLISHED="TRACK_IS_NOT_PUBLISHED",e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.SENDER_NOT_FOUND="SENDER_NOT_FOUND",e.CREATE_OFFER_FAILED="CREATE_OFFER_FAILED",e.SET_ANSWER_FAILED="SET_ANSWER_FAILED",e.ICE_FAILED="ICE_FAILED",e.PC_CLOSED="PC_CLOSED",e.SENDER_REPLACE_FAILED="SENDER_REPLACE_FAILED",e.GATEWAY_P2P_LOST="GATEWAY_P2P_LOST",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.TRACK_IS_NOT_SUBSCRIBED="TRACK_IS_NOT_SUBSCRIBED",e.SUBSCRIPTION_IS_IN_PROGRESS="SUBSCRIPTION_IS_IN_PROGRESS",e.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",e.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",e.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",e.EFFECT_ID_CONFLICTED="EFFECT_ID_CONFLICTED",e.EFFECT_SOUND_ID_NOT_FOUND="EFFECT_SOUND_ID_NOT_FOUND",e.WS_ABORT="WS_ABORT",e.WS_DISCONNECT="WS_DISCONNECT",e.WS_ERR="WS_ERR",e.CAN_NOT_CONNECT_TO_LIVE_STREAMING_WORKER="CAN_NOT_CONNECT_TO_LIVE_STREAMING_WORKER",e.REQUEST_TO_LIVE_STREAMING_WORKER_FAILED="REQUEST_TO_LIVE_STREAMING_WORKER_FAILED",e.PUSH_RTMP_URL_CONFLICT="PUSH_RTMP_URL_CONFLICT",e.PULL_URL_CONFLICT="PULL_URL_CONFLICT",e.WEBGL_INTERNAL_ERROR="WEBGL_INTERNAL_ERROR",e.BEAUTY_PROCESSOR_INTERNAL_ERROR="BEAUTY_PROCESSOR_INTERNAL_ERROR",e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SEC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE"}(c||(c={})),function(e){e[e.QUALITY_UNKNOWN=0]="QUALITY_UNKNOWN",e[e.QUALITY_EXCELLENT=1]="QUALITY_EXCELLENT",e[e.QUALITY_GOOD=2]="QUALITY_GOOD",e[e.QUALITY_POOR=3]="QUALITY_POOR",e[e.QUALITY_BAD=4]="QUALITY_BAD",e[e.QUALITY_VBAD=5]="QUALITY_VBAD",e[e.QUALITY_DOWN=6]="QUALITY_DOWN",e[e.QUALITY_UNSUPPORTED=7]="QUALITY_UNSUPPORTED",e[e.QUALITY_DETECTING=8]="QUALITY_DETECTING"}(d||(d={})),e.AreaCode=void 0,(u=e.AreaCode||(e.AreaCode={}))[u.CHINA=1]="CHINA",u[u.NORTH_AMERICA=2]="NORTH_AMERICA",u[u.EUROPE=4]="EUROPE",u[u.ASIA=8]="ASIA",u[u.JAPAN=16]="JAPAN",u[u.INDIA=32]="INDIA",u[u.GLOBAL=4294967295]="GLOBAL",e.Region=void 0,(l=e.Region||(e.Region={})).HB="HB",l.HD="HD",l.HN="HN",l.XN="XN",l.TW="TW",l.HK="HK";
  7 + /*! *****************************************************************************
  8 + Copyright (c) Microsoft Corporation.
  9 +
  10 + Permission to use, copy, modify, and/or distribute this software for any
  11 + purpose with or without fee is hereby granted.
  12 +
  13 + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  14 + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  15 + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  16 + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  17 + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  18 + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19 + PERFORMANCE OF THIS SOFTWARE.
  20 + ***************************************************************************** */
  21 + var p=function(e,t){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},p(e,t)};function _(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}p(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var h=function(){return h=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},h.apply(this,arguments)};function f(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function m(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function E(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function S(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function T(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}!function(e,t){e.exports=function(){function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(!s&&T)return T(a);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=n[a]={exports:{}};t[a][0].call(d.exports,(function(e){return i(t[a][1][e]||e)}),d,d.exports,e,t,n,r)}return n[a].exports}for(var o=T,a=0;a<r.length;a++)i(r[a]);return i}return e}()({1:[function(e,t,n){var r=(0,e("./adapter_factory.js").adapterFactory)({window:"undefined"==typeof window?void 0:window});t.exports=r},{"./adapter_factory.js":2}],2:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.adapterFactory=u;var r=d(e("./utils")),i=d(e("./chrome/chrome_shim")),o=d(e("./firefox/firefox_shim")),a=d(e("./safari/safari_shim")),s=d(e("./common_shim")),c=d(e("sdp"));function d(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function u(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).window,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0},n=r.log,d=r.detectBrowser(e),u={browserDetails:d,commonShim:s,extractVersion:r.extractVersion,disableLog:r.disableLog,disableWarnings:r.disableWarnings,sdp:c};switch(d.browser){case"chrome":if(!i||!i.shimPeerConnection||!t.shimChrome)return n("Chrome shim is not included in this adapter release."),u;if(null===d.version)return n("Chrome shim can not determine version, not shimming."),u;n("adapter.js shimming chrome."),u.browserShim=i,s.shimAddIceCandidateNullOrEmpty(e,d),i.shimGetUserMedia(e,d),i.shimMediaStream(e,d),i.shimPeerConnection(e,d),i.shimOnTrack(e,d),i.shimAddTrackRemoveTrack(e,d),i.shimGetSendersWithDtmf(e,d),i.shimGetStats(e,d),i.shimSenderReceiverGetStats(e,d),i.fixNegotiationNeeded(e,d),s.shimRTCIceCandidate(e,d),s.shimConnectionState(e,d),s.shimMaxMessageSize(e,d),s.shimSendThrowTypeError(e,d),s.removeExtmapAllowMixed(e,d);break;case"firefox":if(!o||!o.shimPeerConnection||!t.shimFirefox)return n("Firefox shim is not included in this adapter release."),u;n("adapter.js shimming firefox."),u.browserShim=o,s.shimAddIceCandidateNullOrEmpty(e,d),o.shimGetUserMedia(e,d),o.shimPeerConnection(e,d),o.shimOnTrack(e,d),o.shimRemoveStream(e,d),o.shimSenderGetStats(e,d),o.shimReceiverGetStats(e,d),o.shimRTCDataChannel(e,d),o.shimAddTransceiver(e,d),o.shimGetParameters(e,d),o.shimCreateOffer(e,d),o.shimCreateAnswer(e,d),s.shimRTCIceCandidate(e,d),s.shimConnectionState(e,d),s.shimMaxMessageSize(e,d),s.shimSendThrowTypeError(e,d);break;case"safari":if(!a||!t.shimSafari)return n("Safari shim is not included in this adapter release."),u;n("adapter.js shimming safari."),u.browserShim=a,s.shimAddIceCandidateNullOrEmpty(e,d),a.shimRTCIceServerUrls(e,d),a.shimCreateOfferLegacy(e,d),a.shimCallbacksAPI(e,d),a.shimLocalStreamsAPI(e,d),a.shimRemoteStreamsAPI(e,d),a.shimTrackEventTransceiver(e,d),a.shimGetUserMedia(e,d),a.shimAudioContext(e,d),s.shimRTCIceCandidate(e,d),s.shimMaxMessageSize(e,d),s.shimSendThrowTypeError(e,d),s.removeExtmapAllowMixed(e,d);break;default:n("Unsupported browser!")}return u}},{"./chrome/chrome_shim":3,"./common_shim":6,"./firefox/firefox_shim":7,"./safari/safari_shim":10,"./utils":11,sdp:12}],3:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimMediaStream=d,n.shimOnTrack=u,n.shimGetSendersWithDtmf=l,n.shimGetStats=p,n.shimSenderReceiverGetStats=_,n.shimAddTrackRemoveTrackWithNative=h,n.shimAddTrackRemoveTrack=f,n.shimPeerConnection=m,n.fixNegotiationNeeded=v;var a=s(e("../utils.js"));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){e.MediaStream=e.MediaStream||e.webkitMediaStream}function u(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("ontrack"in e.RTCPeerConnection.prototype)){Object.defineProperty(e.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(e){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=e)},enumerable:!0,configurable:!0});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var n=this;return this._ontrackpoly||(this._ontrackpoly=function(t){t.stream.addEventListener("addtrack",(function(r){var i=void 0;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.track.id})):{track:r.track};var o=new Event("track");o.track=r.track,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)})),t.stream.getTracks().forEach((function(r){var i=void 0;i=e.RTCPeerConnection.prototype.getReceivers?n.getReceivers().find((function(e){return e.track&&e.track.id===r.id})):{track:r};var o=new Event("track");o.track=r,o.receiver=i,o.transceiver={receiver:i},o.streams=[t.stream],n.dispatchEvent(o)}))},this.addEventListener("addstream",this._ontrackpoly)),t.apply(this,arguments)}}else a.wrapPeerConnectionEvent(e,"track",(function(e){return e.transceiver||Object.defineProperty(e,"transceiver",{value:{receiver:e.receiver}}),e}))}function l(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&!("getSenders"in e.RTCPeerConnection.prototype)&&"createDTMFSender"in e.RTCPeerConnection.prototype){var t=function(e,t){return{track:t,get dtmf(){return void 0===this._dtmf&&("audio"===t.kind?this._dtmf=e.createDTMFSender(t):this._dtmf=null),this._dtmf},_pc:e}};if(!e.RTCPeerConnection.prototype.getSenders){e.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var n=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,r){var i=n.apply(this,arguments);return i||(i=t(this,e),this._senders.push(i)),i};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){i.apply(this,arguments);var t=this._senders.indexOf(e);-1!==t&&this._senders.splice(t,1)}}var o=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._senders=this._senders||[],o.apply(this,[e]),e.getTracks().forEach((function(e){n._senders.push(t(n,e))}))};var a=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._senders=this._senders||[],a.apply(this,[e]),e.getTracks().forEach((function(e){var n=t._senders.find((function(t){return t.track===e}));n&&t._senders.splice(t._senders.indexOf(n),1)}))}}else if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&"getSenders"in e.RTCPeerConnection.prototype&&"createDTMFSender"in e.RTCPeerConnection.prototype&&e.RTCRtpSender&&!("dtmf"in e.RTCRtpSender.prototype)){var s=e.RTCPeerConnection.prototype.getSenders;e.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=s.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t},Object.defineProperty(e.RTCRtpSender.prototype,"dtmf",{get:function(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function p(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=this,n=Array.prototype.slice.call(arguments),r=n[0],i=n[1],o=n[2];if(arguments.length>0&&"function"==typeof r)return t.apply(this,arguments);if(0===t.length&&(0===arguments.length||"function"!=typeof r))return t.apply(this,[]);var a=function(e){var t={};return e.result().forEach((function(e){var n={id:e.id,timestamp:e.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[e.type]||e.type};e.names().forEach((function(t){n[t]=e.stat(t)})),t[n.id]=n})),t},s=function(e){return new Map(Object.keys(e).map((function(t){return[t,e[t]]})))};if(arguments.length>=2){var c=function(e){i(s(a(e)))};return t.apply(this,[c,r])}return new Promise((function(n,r){t.apply(e,[function(e){n(s(a(e)))},r])})).then(i,o)}}}function _(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&e.RTCRtpReceiver){if(!("getStats"in e.RTCRtpSender.prototype)){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return a.filterStats(t,e.track,!0)}))}}if(!("getStats"in e.RTCRtpReceiver.prototype)){var i=e.RTCPeerConnection.prototype.getReceivers;i&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=i.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),a.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){var e=this;return this._pc.getStats().then((function(t){return a.filterStats(t,e.track,!1)}))}}if("getStats"in e.RTCRtpSender.prototype&&"getStats"in e.RTCRtpReceiver.prototype){var o=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof e.MediaStreamTrack){var t=arguments[0],n=void 0,r=void 0,i=void 0;return this.getSenders().forEach((function(e){e.track===t&&(n?i=!0:n=e)})),this.getReceivers().forEach((function(e){return e.track===t&&(r?i=!0:r=e),e.track===t})),i||n&&r?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):n?n.getStats():r?r.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return o.apply(this,arguments)}}}}function h(e){e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map((function(t){return e._shimmedLocalStreams[t][0]}))};var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addTrack=function(e,n){if(!n)return t.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var r=t.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};var n=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(e){var t=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},e.getTracks().forEach((function(e){if(t.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")}));var r=this.getSenders();n.apply(this,arguments);var i=this.getSenders().filter((function(e){return-1===r.indexOf(e)}));this._shimmedLocalStreams[e.id]=[e].concat(i)};var r=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[e.id],r.apply(this,arguments)};var i=e.RTCPeerConnection.prototype.removeTrack;e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},e&&Object.keys(this._shimmedLocalStreams).forEach((function(n){var r=t._shimmedLocalStreams[n].indexOf(e);-1!==r&&t._shimmedLocalStreams[n].splice(r,1),1===t._shimmedLocalStreams[n].length&&delete t._shimmedLocalStreams[n]})),i.apply(this,arguments)}}function f(e,t){if(e.RTCPeerConnection){if(e.RTCPeerConnection.prototype.addTrack&&t.version>=65)return h(e);var n=e.RTCPeerConnection.prototype.getLocalStreams;e.RTCPeerConnection.prototype.getLocalStreams=function(){var e=this,t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map((function(t){return e._reverseStreams[t.id]}))};var r=e.RTCPeerConnection.prototype.addStream;e.RTCPeerConnection.prototype.addStream=function(t){var n=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},t.getTracks().forEach((function(e){if(n.getSenders().find((function(t){return t.track===e})))throw new DOMException("Track already exists.","InvalidAccessError")})),!this._reverseStreams[t.id]){var i=new e.MediaStream(t.getTracks());this._streams[t.id]=i,this._reverseStreams[i.id]=t,t=i}r.apply(this,[t])};var i=e.RTCPeerConnection.prototype.removeStream;e.RTCPeerConnection.prototype.removeStream=function(e){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[e.id]||e]),delete this._reverseStreams[this._streams[e.id]?this._streams[e.id].id:e.id],delete this._streams[e.id]},e.RTCPeerConnection.prototype.addTrack=function(t,n){var r=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var i=[].slice.call(arguments,1);if(1!==i.length||!i[0].getTracks().find((function(e){return e===t})))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find((function(e){return e.track===t})))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var o=this._streams[n.id];if(o)o.addTrack(t),Promise.resolve().then((function(){r.dispatchEvent(new Event("negotiationneeded"))}));else{var a=new e.MediaStream([t]);this._streams[n.id]=a,this._reverseStreams[a.id]=n,this.addStream(a)}return this.getSenders().find((function(e){return e.track===t}))},["createOffer","createAnswer"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],r=c({},t,(function(){var e=this,t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[function(n){var r=s(e,n);t[0].apply(null,[r])},function(e){t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then((function(t){return s(e,t)}))}));e.RTCPeerConnection.prototype[t]=r[t]}));var o=e.RTCPeerConnection.prototype.setLocalDescription;e.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=d(this,arguments[0]),o.apply(this,arguments)):o.apply(this,arguments)};var a=Object.getOwnPropertyDescriptor(e.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(e.RTCPeerConnection.prototype,"localDescription",{get:function(){var e=a.get.apply(this);return""===e.type?e:s(this,e)}}),e.RTCPeerConnection.prototype.removeTrack=function(e){var t=this;if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!e._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(e._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{};var n=void 0;Object.keys(this._streams).forEach((function(r){t._streams[r].getTracks().find((function(t){return e.track===t}))&&(n=t._streams[r])})),n&&(1===n.getTracks().length?this.removeStream(this._reverseStreams[n.id]):n.removeTrack(e.track),this.dispatchEvent(new Event("negotiationneeded")))}}function s(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)})),new RTCSessionDescription({type:t.type,sdp:n})}function d(e,t){var n=t.sdp;return Object.keys(e._reverseStreams||[]).forEach((function(t){var r=e._reverseStreams[t],i=e._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)})),new RTCSessionDescription({type:t.type,sdp:n})}}function m(e,t){!e.RTCPeerConnection&&e.webkitRTCPeerConnection&&(e.RTCPeerConnection=e.webkitRTCPeerConnection),e.RTCPeerConnection&&t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],r=c({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=r[t]}))}function v(e,t){a.wrapPeerConnectionEvent(e,"negotiationneeded",(function(e){var n=e.target;if(!(t.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return e}))}},{"../utils.js":11,"./getdisplaymedia":4,"./getusermedia":5}],4:[function(e,t,n){function r(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof t?e.navigator.mediaDevices.getDisplayMedia=function(n){return t(n).then((function(t){var r=n.video&&n.video.width,i=n.video&&n.video.height,o=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:t,maxFrameRate:o||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),e.navigator.mediaDevices.getUserMedia(n)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=r},{}],5:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}n.shimGetUserMedia=a;var o=i(e("../utils.js")).log;function a(e,t){var n=e&&e.navigator;if(n.mediaDevices){var i=function(e){if("object"!==(void 0===e?"undefined":r(e))||e.mandatory||e.optional)return e;var t={};return Object.keys(e).forEach((function(n){if("require"!==n&&"advanced"!==n&&"mediaSource"!==n){var i="object"===r(e[n])?e[n]:{ideal:e[n]};void 0!==i.exact&&"number"==typeof i.exact&&(i.min=i.max=i.exact);var o=function(e,t){return e?e+t.charAt(0).toUpperCase()+t.slice(1):"deviceId"===t?"sourceId":t};if(void 0!==i.ideal){t.optional=t.optional||[];var a={};"number"==typeof i.ideal?(a[o("min",n)]=i.ideal,t.optional.push(a),(a={})[o("max",n)]=i.ideal,t.optional.push(a)):(a[o("",n)]=i.ideal,t.optional.push(a))}void 0!==i.exact&&"number"!=typeof i.exact?(t.mandatory=t.mandatory||{},t.mandatory[o("",n)]=i.exact):["min","max"].forEach((function(e){void 0!==i[e]&&(t.mandatory=t.mandatory||{},t.mandatory[o(e,n)]=i[e])}))}})),e.advanced&&(t.optional=(t.optional||[]).concat(e.advanced)),t},a=function(e,a){if(t.version>=61)return a(e);if((e=JSON.parse(JSON.stringify(e)))&&"object"===r(e.audio)){var s=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])};s((e=JSON.parse(JSON.stringify(e))).audio,"autoGainControl","googAutoGainControl"),s(e.audio,"noiseSuppression","googNoiseSuppression"),e.audio=i(e.audio)}if(e&&"object"===r(e.video)){var c=e.video.facingMode;c=c&&("object"===(void 0===c?"undefined":r(c))?c:{ideal:c});var d=t.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||d)){delete e.video.facingMode;var u=void 0;if("environment"===c.exact||"environment"===c.ideal?u=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(u=["front"]),u)return n.mediaDevices.enumerateDevices().then((function(t){var n=(t=t.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return u.some((function(t){return e.label.toLowerCase().includes(t)}))}));return!n&&t.length&&u.includes("back")&&(n=t[t.length-1]),n&&(e.video.deviceId=c.exact?{exact:n.deviceId}:{ideal:n.deviceId}),e.video=i(e.video),o("chrome: "+JSON.stringify(e)),a(e)}))}e.video=i(e.video)}return o("chrome: "+JSON.stringify(e)),a(e)},s=function(e){return t.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},c=function(e,t,r){a(e,(function(e){n.webkitGetUserMedia(e,t,(function(e){r&&r(s(e))}))}))};if(n.getUserMedia=c.bind(n),n.mediaDevices.getUserMedia){var d=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return d(e).then((function(t){if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return t}),(function(e){return Promise.reject(s(e))}))}))}}}}},{"../utils.js":11}],6:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n.shimRTCIceCandidate=c,n.shimMaxMessageSize=d,n.shimSendThrowTypeError=u,n.shimConnectionState=l,n.removeExtmapAllowMixed=p,n.shimAddIceCandidateNullOrEmpty=_;var i=s(e("sdp")),o=a(e("./utils"));function a(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function s(e){return e&&e.__esModule?e:{default:e}}function c(e){if(!(!e.RTCIceCandidate||e.RTCIceCandidate&&"foundation"in e.RTCIceCandidate.prototype)){var t=e.RTCIceCandidate;e.RTCIceCandidate=function(e){if("object"===(void 0===e?"undefined":r(e))&&e.candidate&&0===e.candidate.indexOf("a=")&&((e=JSON.parse(JSON.stringify(e))).candidate=e.candidate.substr(2)),e.candidate&&e.candidate.length){var n=new t(e),o=i.default.parseCandidate(e.candidate),a=Object.assign(n,o);return a.toJSON=function(){return{candidate:a.candidate,sdpMid:a.sdpMid,sdpMLineIndex:a.sdpMLineIndex,usernameFragment:a.usernameFragment}},a}return new t(e)},e.RTCIceCandidate.prototype=t.prototype,o.wrapPeerConnectionEvent(e,"icecandidate",(function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new e.RTCIceCandidate(t.candidate),writable:"false"}),t}))}}function d(e,t){if(e.RTCPeerConnection){"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var n=function(e){if(!e||!e.sdp)return!1;var t=i.default.splitSections(e.sdp);return t.shift(),t.some((function(e){var t=i.default.parseMLine(e);return t&&"application"===t.kind&&-1!==t.protocol.indexOf("SCTP")}))},r=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},o=function(e){var n=65536;return"firefox"===t.browser&&(n=t.version<57?-1===e?16384:2147483637:t.version<60?57===t.version?65535:65536:2147483637),n},a=function(e,n){var r=65536;"firefox"===t.browser&&57===t.version&&(r=65535);var o=i.default.matchPrefix(e.sdp,"a=max-message-size:");return o.length>0?r=parseInt(o[0].substr(19),10):"firefox"===t.browser&&-1!==n&&(r=2147483637),r},s=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===t.browser&&t.version>=76&&"plan-b"===this.getConfiguration().sdpSemantics&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0}),n(arguments[0])){var e=r(arguments[0]),i=o(e),c=a(arguments[0],e),d=void 0;d=0===i&&0===c?Number.POSITIVE_INFINITY:0===i||0===c?Math.max(i,c):Math.min(i,c);var u={};Object.defineProperty(u,"maxMessageSize",{get:function(){return d}}),this._sctp=u}return s.apply(this,arguments)}}}function u(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return n(e,this),e},o.wrapPeerConnectionEvent(e,"datachannel",(function(e){return n(e.channel,e.target),e}))}function n(e,t){var n=e.send;e.send=function(){var r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}}function l(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}}function p(e,t){if(e.RTCPeerConnection&&!("chrome"===t.browser&&t.version>=71||"safari"===t.browser&&t.version>=605)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){var r=t.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:r}):t.sdp=r}return n.apply(this,arguments)}}}function _(e,t){if(e.RTCPeerConnection&&e.RTCPeerConnection.prototype){var n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}}},{"./utils":11,sdp:12}],7:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=n.shimGetUserMedia=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e("./getusermedia");Object.defineProperty(n,"shimGetUserMedia",{enumerable:!0,get:function(){return i.shimGetUserMedia}});var o=e("./getdisplaymedia");Object.defineProperty(n,"shimGetDisplayMedia",{enumerable:!0,get:function(){return o.shimGetDisplayMedia}}),n.shimOnTrack=d,n.shimPeerConnection=u,n.shimSenderGetStats=l,n.shimReceiverGetStats=p,n.shimRemoveStream=_,n.shimRTCDataChannel=h,n.shimAddTransceiver=f,n.shimGetParameters=m,n.shimCreateOffer=v,n.shimCreateAnswer=E;var a=s(e("../utils"));function s(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function u(e,t){if("object"===(void 0===e?"undefined":r(e))&&(e.RTCPeerConnection||e.mozRTCPeerConnection)){!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){var n=e.RTCPeerConnection.prototype[t],r=c({},t,(function(){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));e.RTCPeerConnection.prototype[t]=r[t]}));var n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},i=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),r=e[0],o=e[1],a=e[2];return i.apply(this,[r||null]).then((function(e){if(t.version<53&&!o)try{e.forEach((function(e){e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,r){e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(o,a)}}}function l(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpSender.prototype))){var t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n});var n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function p(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&e.RTCRtpSender&&(!e.RTCRtpSender||!("getStats"in e.RTCRtpReceiver.prototype))){var t=e.RTCPeerConnection.prototype.getReceivers;t&&(e.RTCPeerConnection.prototype.getReceivers=function(){var e=this,n=t.apply(this,[]);return n.forEach((function(t){return t._pc=e})),n}),a.wrapPeerConnectionEvent(e,"track",(function(e){return e.receiver._pc=e.srcElement,e})),e.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function _(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;a.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)}))})}function h(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)}function f(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var e=arguments[1],n=e&&"sendEncodings"in e;n&&e.sendEncodings.forEach((function(e){if("rid"in e&&!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var r=t.apply(this,arguments);if(n){var i=r.sender,o=i.getParameters();(!("encodings"in o)||1===o.encodings.length&&0===Object.keys(o.encodings[0]).length)&&(o.encodings=e.sendEncodings,i.sendEncodings=e.sendEncodings,this.setParametersPromises.push(i.setParameters(o).then((function(){delete i.sendEncodings})).catch((function(){delete i.sendEncodings}))))}return r})}}function m(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCRtpSender){var t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){var e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}}function v(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}function E(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){var e=this,n=arguments;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return t.apply(e,n)})).finally((function(){e.setParametersPromises=[]})):t.apply(this,arguments)}}}},{"../utils":11,"./getdisplaymedia":8,"./getusermedia":9}],8:[function(e,t,n){function r(e,t){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&(e.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){var r=new DOMException("getDisplayMedia without video constraints is undefined");return r.name="NotFoundError",r.code=8,Promise.reject(r)}return!0===n.video?n.video={mediaSource:t}:n.video.mediaSource=t,e.navigator.mediaDevices.getUserMedia(n)})}Object.defineProperty(n,"__esModule",{value:!0}),n.shimGetDisplayMedia=r},{}],9:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n.shimGetUserMedia=a;var i=o(e("../utils"));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e,t){var n=e&&e.navigator,o=e&&e.MediaStreamTrack;if(n.getUserMedia=function(e,t,r){i.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(e).then(t,r)},!(t.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var a=function(e,t,n){t in e&&!(n in e)&&(e[n]=e[t],delete e[t])},s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(e){return"object"===(void 0===e?"undefined":r(e))&&"object"===r(e.audio)&&(e=JSON.parse(JSON.stringify(e)),a(e.audio,"autoGainControl","mozAutoGainControl"),a(e.audio,"noiseSuppression","mozNoiseSuppression")),s(e)},o&&o.prototype.getSettings){var c=o.prototype.getSettings;o.prototype.getSettings=function(){var e=c.apply(this,arguments);return a(e,"mozAutoGainControl","autoGainControl"),a(e,"mozNoiseSuppression","noiseSuppression"),e}}if(o&&o.prototype.applyConstraints){var d=o.prototype.applyConstraints;o.prototype.applyConstraints=function(e){return"audio"===this.kind&&"object"===(void 0===e?"undefined":r(e))&&(e=JSON.parse(JSON.stringify(e)),a(e,"autoGainControl","mozAutoGainControl"),a(e,"noiseSuppression","mozNoiseSuppression")),d.apply(this,[e])}}}}},{"../utils":11}],10:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};n.shimLocalStreamsAPI=a,n.shimRemoteStreamsAPI=s,n.shimCallbacksAPI=c,n.shimGetUserMedia=d,n.shimConstraints=u,n.shimRTCIceServerUrls=l,n.shimTrackEventTransceiver=p,n.shimCreateOfferLegacy=_,n.shimAudioContext=h;var i=o(e("../utils"));function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function a(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){if("getLocalStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype.addTrack;e.RTCPeerConnection.prototype.addStream=function(e){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(e)||this._localStreams.push(e),e.getAudioTracks().forEach((function(r){return t.call(n,r,e)})),e.getVideoTracks().forEach((function(r){return t.call(n,r,e)}))},e.RTCPeerConnection.prototype.addTrack=function(e){for(var n=this,r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i&&i.forEach((function(e){n._localStreams?n._localStreams.includes(e)||n._localStreams.push(e):n._localStreams=[e]})),t.apply(this,arguments)}}"removeStream"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this._localStreams||(this._localStreams=[]);var n=this._localStreams.indexOf(e);if(-1!==n){this._localStreams.splice(n,1);var r=e.getTracks();this.getSenders().forEach((function(e){r.includes(e.track)&&t.removeTrack(e)}))}})}}function s(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection&&("getRemoteStreams"in e.RTCPeerConnection.prototype||(e.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in e.RTCPeerConnection.prototype))){Object.defineProperty(e.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(e){var t=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=e),this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach((function(e){if(t._remoteStreams||(t._remoteStreams=[]),!t._remoteStreams.includes(e)){t._remoteStreams.push(e);var n=new Event("addstream");n.stream=e,t.dispatchEvent(n)}}))})}});var t=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){var e=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(t){t.streams.forEach((function(t){if(e._remoteStreams||(e._remoteStreams=[]),!(e._remoteStreams.indexOf(t)>=0)){e._remoteStreams.push(t);var n=new Event("addstream");n.stream=t,e.dispatchEvent(n)}}))}),t.apply(e,arguments)}}}function c(e){if("object"===(void 0===e?"undefined":r(e))&&e.RTCPeerConnection){var t=e.RTCPeerConnection.prototype,n=t.createOffer,i=t.createAnswer,o=t.setLocalDescription,a=t.setRemoteDescription,s=t.addIceCandidate;t.createOffer=function(e,t){var r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return t?(i.then(e,t),Promise.resolve()):i},t.createAnswer=function(e,t){var n=arguments.length>=2?arguments[2]:arguments[0],r=i.apply(this,[n]);return t?(r.then(e,t),Promise.resolve()):r};var c=function(e,t,n){var r=o.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r};t.setLocalDescription=c,c=function(e,t,n){var r=a.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.setRemoteDescription=c,c=function(e,t,n){var r=s.apply(this,[e]);return n?(r.then(t,n),Promise.resolve()):r},t.addIceCandidate=c}}function d(e){var t=e&&e.navigator;if(t.mediaDevices&&t.mediaDevices.getUserMedia){var n=t.mediaDevices,r=n.getUserMedia.bind(n);t.mediaDevices.getUserMedia=function(e){return r(u(e))}}!t.getUserMedia&&t.mediaDevices&&t.mediaDevices.getUserMedia&&(t.getUserMedia=function(e,n,r){t.mediaDevices.getUserMedia(e).then(n,r)}.bind(t))}function u(e){return e&&void 0!==e.video?Object.assign({},e,{video:i.compactObject(e.video)}):e}function l(e){if(e.RTCPeerConnection){var t=e.RTCPeerConnection;e.RTCPeerConnection=function(e,n){if(e&&e.iceServers){for(var r=[],o=0;o<e.iceServers.length;o++){var a=e.iceServers[o];!a.hasOwnProperty("urls")&&a.hasOwnProperty("url")?(i.deprecated("RTCIceServer.url","RTCIceServer.urls"),(a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,r.push(a)):r.push(e.iceServers[o])}e.iceServers=r}return new t(e,n)},e.RTCPeerConnection.prototype=t.prototype,"generateCertificate"in t&&Object.defineProperty(e.RTCPeerConnection,"generateCertificate",{get:function(){return t.generateCertificate}})}}function p(e){"object"===(void 0===e?"undefined":r(e))&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function _(e){var t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(e){if(e){void 0!==e.offerToReceiveAudio&&(e.offerToReceiveAudio=!!e.offerToReceiveAudio);var n=this.getTransceivers().find((function(e){return"audio"===e.receiver.track.kind}));!1===e.offerToReceiveAudio&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==e.offerToReceiveAudio||n||this.addTransceiver("audio"),void 0!==e.offerToReceiveVideo&&(e.offerToReceiveVideo=!!e.offerToReceiveVideo);var r=this.getTransceivers().find((function(e){return"video"===e.receiver.track.kind}));!1===e.offerToReceiveVideo&&r?"sendrecv"===r.direction?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":"recvonly"===r.direction&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):!0!==e.offerToReceiveVideo||r||this.addTransceiver("video")}return t.apply(this,arguments)}}function h(e){"object"!==(void 0===e?"undefined":r(e))||e.AudioContext||(e.AudioContext=e.webkitAudioContext)}},{"../utils":11}],11:[function(e,t,n){Object.defineProperty(n,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.extractVersion=s,n.wrapPeerConnectionEvent=c,n.disableLog=d,n.disableWarnings=u,n.log=l,n.deprecated=p,n.detectBrowser=_,n.compactObject=f,n.walkStats=m,n.filterStats=v;var o=!0,a=!0;function s(e,t,n){var r=e.match(t);return r&&r.length>=n&&parseInt(r[n],10)}function c(e,t,n){if(e.RTCPeerConnection){var r=e.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(e,r){if(e!==t)return i.apply(this,arguments);var o=function(e){var t=n(e);t&&(r.handleEvent?r.handleEvent(t):r(t))};return this._eventMap=this._eventMap||{},this._eventMap[t]||(this._eventMap[t]=new Map),this._eventMap[t].set(r,o),i.apply(this,[e,o])};var o=r.removeEventListener;r.removeEventListener=function(e,n){if(e!==t||!this._eventMap||!this._eventMap[t])return o.apply(this,arguments);if(!this._eventMap[t].has(n))return o.apply(this,arguments);var r=this._eventMap[t].get(n);return this._eventMap[t].delete(n),0===this._eventMap[t].size&&delete this._eventMap[t],0===Object.keys(this._eventMap).length&&delete this._eventMap,o.apply(this,[e,r])},Object.defineProperty(r,"on"+t,{get:function(){return this["_on"+t]},set:function(e){this["_on"+t]&&(this.removeEventListener(t,this["_on"+t]),delete this["_on"+t]),e&&this.addEventListener(t,this["_on"+t]=e)},enumerable:!0,configurable:!0})}}function d(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":r(e))+". Please use a boolean."):(o=e,e?"adapter.js logging disabled":"adapter.js logging enabled")}function u(e){return"boolean"!=typeof e?new Error("Argument type: "+(void 0===e?"undefined":r(e))+". Please use a boolean."):(a=!e,"adapter.js deprecation warnings "+(e?"disabled":"enabled"))}function l(){if("object"===("undefined"==typeof window?"undefined":r(window))){if(o)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function p(e,t){a&&console.warn(e+" is deprecated, please use "+t+" instead.")}function _(e){var t={browser:null,version:null};if(void 0===e||!e.navigator)return t.browser="Not a browser.",t;var n=e.navigator;if(n.mozGetUserMedia)t.browser="firefox",t.version=s(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===e.isSecureContext&&e.webkitRTCPeerConnection&&!e.RTCIceGatherer)t.browser="chrome",t.version=s(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!e.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return t.browser="Not a supported browser.",t;t.browser="safari",t.version=s(n.userAgent,/AppleWebKit\/(\d+)\./,1),t.supportsUnifiedPlan=e.RTCRtpTransceiver&&"currentDirection"in e.RTCRtpTransceiver.prototype}return t}function h(e){return"[object Object]"===Object.prototype.toString.call(e)}function f(e){return h(e)?Object.keys(e).reduce((function(t,n){var r=h(e[n]),o=r?f(e[n]):e[n],a=r&&!Object.keys(o).length;return void 0===o||a?t:Object.assign(t,i({},n,o))}),{}):e}function m(e,t,n){t&&!n.has(t.id)&&(n.set(t.id,t),Object.keys(t).forEach((function(r){r.endsWith("Id")?m(e,e.get(t[r]),n):r.endsWith("Ids")&&t[r].forEach((function(t){m(e,e.get(t),n)}))})))}function v(e,t,n){var r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===t)return i;var o=[];return e.forEach((function(e){"track"===e.type&&e.trackIdentifier===t.id&&o.push(e)})),o.forEach((function(t){e.forEach((function(n){n.type===r&&n.trackId===t.id&&m(e,n,i)}))})),i}},{}],12:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i={generateIdentifier:function(){return Math.random().toString(36).substr(2,10)}};i.localCName=i.generateIdentifier(),i.splitLines=function(e){return e.trim().split("\n").map((function(e){return e.trim()}))},i.splitSections=function(e){return e.split("\nm=").map((function(e,t){return(t>0?"m="+e:e).trim()+"\r\n"}))},i.getDescription=function(e){var t=i.splitSections(e);return t&&t[0]},i.getMediaSections=function(e){var t=i.splitSections(e);return t.shift(),t},i.matchPrefix=function(e,t){return i.splitLines(e).filter((function(e){return 0===e.indexOf(t)}))},i.parseCandidate=function(e){for(var t=void 0,n={foundation:(t=0===e.indexOf("a=candidate:")?e.substring(12).split(" "):e.substring(10).split(" "))[0],component:{1:"rtp",2:"rtcp"}[t[1]],protocol:t[2].toLowerCase(),priority:parseInt(t[3],10),ip:t[4],address:t[4],port:parseInt(t[5],10),type:t[7]},r=8;r<t.length;r+=2)switch(t[r]){case"raddr":n.relatedAddress=t[r+1];break;case"rport":n.relatedPort=parseInt(t[r+1],10);break;case"tcptype":n.tcpType=t[r+1];break;case"ufrag":n.ufrag=t[r+1],n.usernameFragment=t[r+1];break;default:void 0===n[t[r]]&&(n[t[r]]=t[r+1])}return n},i.writeCandidate=function(e){var t=[];t.push(e.foundation);var n=e.component;"rtp"===n?t.push(1):"rtcp"===n?t.push(2):t.push(n),t.push(e.protocol.toUpperCase()),t.push(e.priority),t.push(e.address||e.ip),t.push(e.port);var r=e.type;return t.push("typ"),t.push(r),"host"!==r&&e.relatedAddress&&e.relatedPort&&(t.push("raddr"),t.push(e.relatedAddress),t.push("rport"),t.push(e.relatedPort)),e.tcpType&&"tcp"===e.protocol.toLowerCase()&&(t.push("tcptype"),t.push(e.tcpType)),(e.usernameFragment||e.ufrag)&&(t.push("ufrag"),t.push(e.usernameFragment||e.ufrag)),"candidate:"+t.join(" ")},i.parseIceOptions=function(e){return e.substr(14).split(" ")},i.parseRtpMap=function(e){var t=e.substr(9).split(" "),n={payloadType:parseInt(t.shift(),10)};return t=t[0].split("/"),n.name=t[0],n.clockRate=parseInt(t[1],10),n.channels=3===t.length?parseInt(t[2],10):1,n.numChannels=n.channels,n},i.writeRtpMap=function(e){var t=e.payloadType;void 0!==e.preferredPayloadType&&(t=e.preferredPayloadType);var n=e.channels||e.numChannels||1;return"a=rtpmap:"+t+" "+e.name+"/"+e.clockRate+(1!==n?"/"+n:"")+"\r\n"},i.parseExtmap=function(e){var t=e.substr(9).split(" ");return{id:parseInt(t[0],10),direction:t[0].indexOf("/")>0?t[0].split("/")[1]:"sendrecv",uri:t[1]}},i.writeExtmap=function(e){return"a=extmap:"+(e.id||e.preferredId)+(e.direction&&"sendrecv"!==e.direction?"/"+e.direction:"")+" "+e.uri+"\r\n"},i.parseFmtp=function(e){for(var t={},n=void 0,r=e.substr(e.indexOf(" ")+1).split(";"),i=0;i<r.length;i++)t[(n=r[i].trim().split("="))[0].trim()]=n[1];return t},i.writeFmtp=function(e){var t="",n=e.payloadType;if(void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.parameters&&Object.keys(e.parameters).length){var r=[];Object.keys(e.parameters).forEach((function(t){e.parameters[t]?r.push(t+"="+e.parameters[t]):r.push(t)})),t+="a=fmtp:"+n+" "+r.join(";")+"\r\n"}return t},i.parseRtcpFb=function(e){var t=e.substr(e.indexOf(" ")+1).split(" ");return{type:t.shift(),parameter:t.join(" ")}},i.writeRtcpFb=function(e){var t="",n=e.payloadType;return void 0!==e.preferredPayloadType&&(n=e.preferredPayloadType),e.rtcpFeedback&&e.rtcpFeedback.length&&e.rtcpFeedback.forEach((function(e){t+="a=rtcp-fb:"+n+" "+e.type+(e.parameter&&e.parameter.length?" "+e.parameter:"")+"\r\n"})),t},i.parseSsrcMedia=function(e){var t=e.indexOf(" "),n={ssrc:parseInt(e.substr(7,t-7),10)},r=e.indexOf(":",t);return r>-1?(n.attribute=e.substr(t+1,r-t-1),n.value=e.substr(r+1)):n.attribute=e.substr(t+1),n},i.parseSsrcGroup=function(e){var t=e.substr(13).split(" ");return{semantics:t.shift(),ssrcs:t.map((function(e){return parseInt(e,10)}))}},i.getMid=function(e){var t=i.matchPrefix(e,"a=mid:")[0];if(t)return t.substr(6)},i.parseFingerprint=function(e){var t=e.substr(14).split(" ");return{algorithm:t[0].toLowerCase(),value:t[1]}},i.getDtlsParameters=function(e,t){return{role:"auto",fingerprints:i.matchPrefix(e+t,"a=fingerprint:").map(i.parseFingerprint)}},i.writeDtlsParameters=function(e,t){var n="a=setup:"+t+"\r\n";return e.fingerprints.forEach((function(e){n+="a=fingerprint:"+e.algorithm+" "+e.value+"\r\n"})),n},i.parseCryptoLine=function(e){var t=e.substr(9).split(" ");return{tag:parseInt(t[0],10),cryptoSuite:t[1],keyParams:t[2],sessionParams:t.slice(3)}},i.writeCryptoLine=function(e){return"a=crypto:"+e.tag+" "+e.cryptoSuite+" "+("object"===r(e.keyParams)?i.writeCryptoKeyParams(e.keyParams):e.keyParams)+(e.sessionParams?" "+e.sessionParams.join(" "):"")+"\r\n"},i.parseCryptoKeyParams=function(e){if(0!==e.indexOf("inline:"))return null;var t=e.substr(7).split("|");return{keyMethod:"inline",keySalt:t[0],lifeTime:t[1],mkiValue:t[2]?t[2].split(":")[0]:void 0,mkiLength:t[2]?t[2].split(":")[1]:void 0}},i.writeCryptoKeyParams=function(e){return e.keyMethod+":"+e.keySalt+(e.lifeTime?"|"+e.lifeTime:"")+(e.mkiValue&&e.mkiLength?"|"+e.mkiValue+":"+e.mkiLength:"")},i.getCryptoParameters=function(e,t){return i.matchPrefix(e+t,"a=crypto:").map(i.parseCryptoLine)},i.getIceParameters=function(e,t){var n=i.matchPrefix(e+t,"a=ice-ufrag:")[0],r=i.matchPrefix(e+t,"a=ice-pwd:")[0];return n&&r?{usernameFragment:n.substr(12),password:r.substr(10)}:null},i.writeIceParameters=function(e){var t="a=ice-ufrag:"+e.usernameFragment+"\r\na=ice-pwd:"+e.password+"\r\n";return e.iceLite&&(t+="a=ice-lite\r\n"),t},i.parseRtpParameters=function(e){for(var t={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},n=i.splitLines(e)[0].split(" "),r=3;r<n.length;r++){var o=n[r],a=i.matchPrefix(e,"a=rtpmap:"+o+" ")[0];if(a){var s=i.parseRtpMap(a),c=i.matchPrefix(e,"a=fmtp:"+o+" ");switch(s.parameters=c.length?i.parseFmtp(c[0]):{},s.rtcpFeedback=i.matchPrefix(e,"a=rtcp-fb:"+o+" ").map(i.parseRtcpFb),t.codecs.push(s),s.name.toUpperCase()){case"RED":case"ULPFEC":t.fecMechanisms.push(s.name.toUpperCase())}}}return i.matchPrefix(e,"a=extmap:").forEach((function(e){t.headerExtensions.push(i.parseExtmap(e))})),t},i.writeRtpDescription=function(e,t){var n="";n+="m="+e+" ",n+=t.codecs.length>0?"9":"0",n+=" UDP/TLS/RTP/SAVPF ",n+=t.codecs.map((function(e){return void 0!==e.preferredPayloadType?e.preferredPayloadType:e.payloadType})).join(" ")+"\r\n",n+="c=IN IP4 0.0.0.0\r\n",n+="a=rtcp:9 IN IP4 0.0.0.0\r\n",t.codecs.forEach((function(e){n+=i.writeRtpMap(e),n+=i.writeFmtp(e),n+=i.writeRtcpFb(e)}));var r=0;return t.codecs.forEach((function(e){e.maxptime>r&&(r=e.maxptime)})),r>0&&(n+="a=maxptime:"+r+"\r\n"),t.headerExtensions&&t.headerExtensions.forEach((function(e){n+=i.writeExtmap(e)})),n},i.parseRtpEncodingParameters=function(e){var t=[],n=i.parseRtpParameters(e),r=-1!==n.fecMechanisms.indexOf("RED"),o=-1!==n.fecMechanisms.indexOf("ULPFEC"),a=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute})),s=a.length>0&&a[0].ssrc,c=void 0,d=i.matchPrefix(e,"a=ssrc-group:FID").map((function(e){return e.substr(17).split(" ").map((function(e){return parseInt(e,10)}))}));d.length>0&&d[0].length>1&&d[0][0]===s&&(c=d[0][1]),n.codecs.forEach((function(e){if("RTX"===e.name.toUpperCase()&&e.parameters.apt){var n={ssrc:s,codecPayloadType:parseInt(e.parameters.apt,10)};s&&c&&(n.rtx={ssrc:c}),t.push(n),r&&((n=JSON.parse(JSON.stringify(n))).fec={ssrc:s,mechanism:o?"red+ulpfec":"red"},t.push(n))}})),0===t.length&&s&&t.push({ssrc:s});var u=i.matchPrefix(e,"b=");return u.length&&(u=0===u[0].indexOf("b=TIAS:")?parseInt(u[0].substr(7),10):0===u[0].indexOf("b=AS:")?1e3*parseInt(u[0].substr(5),10)*.95-16e3:void 0,t.forEach((function(e){e.maxBitrate=u}))),t},i.parseRtcpParameters=function(e){var t={},n=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"cname"===e.attribute}))[0];n&&(t.cname=n.value,t.ssrc=n.ssrc);var r=i.matchPrefix(e,"a=rtcp-rsize");t.reducedSize=r.length>0,t.compound=0===r.length;var o=i.matchPrefix(e,"a=rtcp-mux");return t.mux=o.length>0,t},i.writeRtcpParameters=function(e){var t="";return e.reducedSize&&(t+="a=rtcp-rsize\r\n"),e.mux&&(t+="a=rtcp-mux\r\n"),void 0!==e.ssrc&&e.cname&&(t+="a=ssrc:"+e.ssrc+" cname:"+e.cname+"\r\n"),t},i.parseMsid=function(e){var t=void 0,n=i.matchPrefix(e,"a=msid:");if(1===n.length)return{stream:(t=n[0].substr(7).split(" "))[0],track:t[1]};var r=i.matchPrefix(e,"a=ssrc:").map((function(e){return i.parseSsrcMedia(e)})).filter((function(e){return"msid"===e.attribute}));return r.length>0?{stream:(t=r[0].value.split(" "))[0],track:t[1]}:void 0},i.parseSctpDescription=function(e){var t=i.parseMLine(e),n=i.matchPrefix(e,"a=max-message-size:"),r=void 0;n.length>0&&(r=parseInt(n[0].substr(19),10)),isNaN(r)&&(r=65536);var o=i.matchPrefix(e,"a=sctp-port:");if(o.length>0)return{port:parseInt(o[0].substr(12),10),protocol:t.fmt,maxMessageSize:r};var a=i.matchPrefix(e,"a=sctpmap:");if(a.length>0){var s=a[0].substr(10).split(" ");return{port:parseInt(s[0],10),protocol:s[1],maxMessageSize:r}}},i.writeSctpDescription=function(e,t){var n=[];return n="DTLS/SCTP"!==e.protocol?["m="+e.kind+" 9 "+e.protocol+" "+t.protocol+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctp-port:"+t.port+"\r\n"]:["m="+e.kind+" 9 "+e.protocol+" "+t.port+"\r\n","c=IN IP4 0.0.0.0\r\n","a=sctpmap:"+t.port+" "+t.protocol+" 65535\r\n"],void 0!==t.maxMessageSize&&n.push("a=max-message-size:"+t.maxMessageSize+"\r\n"),n.join("")},i.generateSessionId=function(){return Math.random().toString().substr(2,21)},i.writeSessionBoilerplate=function(e,t,n){var r=void 0!==t?t:2;return"v=0\r\no="+(n||"thisisadapterortc")+" "+(e||i.generateSessionId())+" "+r+" IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n"},i.getDirection=function(e,t){for(var n=i.splitLines(e),r=0;r<n.length;r++)switch(n[r]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return n[r].substr(2)}return t?i.getDirection(t):"sendrecv"},i.getKind=function(e){return i.splitLines(e)[0].split(" ")[0].substr(2)},i.isRejected=function(e){return"0"===e.split(" ",2)[1]},i.parseMLine=function(e){var t=i.splitLines(e)[0].substr(2).split(" ");return{kind:t[0],port:parseInt(t[1],10),protocol:t[2],fmt:t.slice(3).join(" ")}},i.parseOLine=function(e){var t=i.matchPrefix(e,"o=")[0].substr(2).split(" ");return{username:t[0],sessionId:t[1],sessionVersion:parseInt(t[2],10),netType:t[3],addressType:t[4],address:t[5]}},i.isValidSDP=function(e){if("string"!=typeof e||0===e.length)return!1;for(var t=i.splitLines(e),n=0;n<t.length;n++)if(t[n].length<2||"="!==t[n].charAt(1))return!1;return!0},"object"===(void 0===t?"undefined":r(t))&&(t.exports=i)},{}]},{},[1])(1)}({exports:{}});var I,C={SDK_VERSION:"4.2.7",SDK_BUILD:"v4.2.7-8ff4c642(11/09/2023 16:19:09 PM)",PROCESS_ID:"",GATEWAY_ADDRESS:"https://gateway.agrtc.cn",GATEWAY_ADDRESS1:"https://gateway1.agrtc.cn",GATEWAY_ADDRESS_SSL:!0,GATEWAY_CONNECT_TIMEOUT:2e3,TASK_GATEWAY_ADDRESS:"https://mutigw.agrtc.cn",TASK_GATEWAY_ADDRESS_SSL:!0,TASK_GATEWAY_CONNECT_TIMEOUT:1e4,GATEWAY_RETRY_TIMEOUT:12e5,UPLOAD_LOCAL_NETWORK_QUALITY:!1,EVENT_REPORT_DOMAIN:"event.agrtc.cn",EVENT_REPORT_BACKUP_DOMAIN:"event.agrtc.cn",EVENT_REPORT_SEND_INTERVAL:1e3,UPLOAD_LOG:!1,AUDIO_VOLUME_INDICATOR_INTERVAL:2e3,AREA_CODE:e.AreaCode.GLOBAL,Region:void 0},y=function(e){var t=e;void 0===t&&(t=7);var n=Math.random().toString(16).substr(2,t).toLowerCase();return n.length===t?n:n+y(t-n.length)},A=function(e,t){var n="YYYY-MM-DD hh:mm:ss";if("number"!=typeof e)throw new Error("[timesToDate]: timestamp must be number");t&&"string"==typeof t&&(n=t);var r=e||Date.now(),i=new Date(r)||new Date(r),o=i.getFullYear(),a=i.getMonth()+1,s=i.getDate(),c=i.getHours(),d=i.getMinutes(),u=i.getSeconds(),l=i.getMilliseconds();return n.indexOf("YYYY")>-1&&(n=n.replace("YYYY",(function(e){return""+o}))),n.indexOf("MM")>-1?n=n.replace("MM",(function(e){return a<10?"0"+a:""+a})):n.indexOf("M")>-1&&(n=n.replace("M",(function(e){return""+a}))),n.indexOf("DD")>-1?n=n.replace("DD",(function(e){return s<10?"0"+s:""+s})):n.indexOf("D")>-1&&(n=n.replace("D",(function(e){return""+s}))),n.indexOf("hh")>-1?n=n.replace("hh",(function(e){return c<10?"0"+c:""+c})):n.indexOf("h")>-1&&(n=n.replace("h",(function(e){return""+c}))),n.indexOf("mm")>-1?n=n.replace("mm",(function(e){return d<10?"0"+d:""+d})):n.indexOf("m")>-1&&(n=n.replace("m",(function(e){return""+d}))),n.indexOf("ss")>-1?n=n.replace("ss",(function(e){return u<10?"0"+u:""+u})):n.indexOf("s")>-1&&(n=n.replace("s",(function(e){return""+u}))),n.indexOf("ms")>-1&&(n=n.replace("ms",(function(){return""+l}))),n.indexOf("AP")>-1&&(n=n.replace("AP",(function(){return c>12?"PM":"AM"}))),n},R=function(e){return new Promise((function(t){return setTimeout(t,e)}))};!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e[e.NONE=4]="NONE"}(I||(I={}));var g,N=function(){function e(){this.logPrefix="SupLogger",this.logLevel=I.NONE,this.uploadServeTranslators=[],this.DEBUG=I.DEBUG,this.INFO=I.INFO,this.WARNING=I.WARNING,this.ERROR=I.ERROR,this.NONE=I.NONE}return e.prototype.use=function(e){"function"==typeof e&&this.uploadServeTranslators.push((function(t,n){e(t,n)}))},e.prototype.setLogLevel=function(e,t){t&&(this.logPrefix=t),"number"==typeof e&&e>-1&&e<5&&(this.logLevel=e)},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>I.ERROR&&this.logLevel!==I.NONE||this.logLevel===I.NONE)){var n=e,r=Date.now();n.unshift("[".concat(A(r,"hh:mm:ss:ms"),"] %c").concat(this.logPrefix," [ERROR]:%c"),"color: #b00020; font-weight: bold;","color: #dc3545;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"error",params:n,timestamp:r},(function(){console.error.apply(console,n)}))})):console.error.apply(console,n)}},e.prototype.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>I.WARNING&&this.logLevel!==I.NONE||this.logLevel===I.NONE)){var n=e,r=Date.now();n.unshift("[".concat(A(r,"hh:mm:ss:ms"),"] %c").concat(this.logPrefix," [WARNING]:"),"color: #ffc107; font-weight: bold;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"warning",params:n,timestamp:r},(function(){console.warn.apply(console,n)}))})):console.warn.apply(console,n)}},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>I.INFO&&this.logLevel!==I.NONE||this.logLevel===I.NONE)){var n=e,r=Date.now();n.unshift("[".concat(A(r,"hh:mm:ss:ms"),"] %c").concat(this.logPrefix," [INFO]:"),"color: #007bff; font-weight: bold;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"info",params:n,timestamp:r},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(this.logLevel>I.DEBUG&&this.logLevel!==I.NONE||this.logLevel===I.NONE)){var n=e,r=Date.now();n.unshift("[".concat(A(r,"hh:mm:ss.ms"),"] %c").concat(this.logPrefix," [DEBUG]:"),"color:#6facff;"),this.uploadServeTranslators.length>0?this.uploadServeTranslators.map((function(e){e({type:"debug",params:n,timestamp:r},(function(){console.log.apply(console,n)}))})):console.log.apply(console,n)}},e}(),O=new N;O.setLogLevel(O.DEBUG,"ar-rtc-sdk"),function(e){e.CONNECTION_STATE_CHANGE="@connectionStateChange",e.ICE_CONNECTION_STATE_CHANGE="@iceConnectionStateChange",e.ICE_CANDIDATE="@iceCandidate",e.TRACK_ADDED="@trackAdded",e.RTC_NEED_RENEGOTIATE="@need_renegotiate",e.AUDIO_ROUTE_CHANGE="@audio-route-change",e.TRACK_ENDED="track-ended",e.FIRST_FRAME_DECODED="first-frame-decoded",e.UPDATE_MUTE_STATE="@updateMuteState",e.TRACK_ENABLED="@need_add_track",e.TRACK_DISABLED="@need_remove_track",e.TRACK_MUTED="@need_muted_track",e.TRACK_UNMUTED="@need_unmuted_track",e.SET_OPTIMIZATION_MODE="@set_optimization_mode",e.REPLACE_TRACK="@need_replace_track",e.VIDEO_SIZE_CHANGE="video-resize",e.FIRST_VIDEO_DECODE="first-video-decode",e.FIRST_VIDEO_RECEIVED="first-video-received",e.FIRST_AUDIO_DECODE="first-audio-decode",e.FIRST_AUDIO_RECEIVED="first-audio-received",e.AUDIO_SOURCE_STATE_CHANGE="audio_source_state_change",e.SOURCE_STATE_CHANGE="source-state-change",e.ON_KEEP_ALIVE="KeepAlive",e.ON_FORCE_OFFLINE="ForceOffline",e.ON_FORCE_CLOSE="ForceClose",e.ON_SESSION_INIT="SessInit",e.ON_PUBLISH="DoPublish",e.ON_PUBLISH_EX="DoPublishS",e.ON_RE_PUBLISH="DoRePublish",e.ON_SUBSCRIBE="DoSubscribe",e.ON_ICE="Ice",e.ON_PUBLISHER_QUALITY="PubQuality",e.ON_TOKEN_WILL_EXPIRE="AcsTokenWillExpire",e.ON_TOKEN_DID_EXPIRE="AcsTokenDidExpire",e.ON_CHANNEL_MESSAGE="ChanMsg",e.ON_CHANNEL_USER_ONLINE="B_UserOnline",e.ON_CHANNEL_USER_OFFLINE="B_UserOffline",e.ON_CHANNEL_SET_USER_ROLE="SetRole",e.ON_CHANNEL_DUAL_STREAM_ENABLE="DualStream",e.ON_CHANNEL_USER_STREAM_OPEN="B_StreamOpen",e.ON_CHANNEL_USER_STREAM_CLOSE="B_StreamClose",e.ON_CHANNEL_USER_DISABLE_AUDIO="DisableAudio",e.ON_CHANNEL_USER_ENABLE_AUDIO="EnableAudio",e.ON_CHANNEL_USER_DISABLE_VIDEO="DisableVideo",e.ON_CHANNEL_USER_ENABLE_VIDEO="EnableVideo",e.ON_CHANNEL_USER_ENABLE_LOCAL_VIDEO="EnableLocalVideo",e.ON_CHANNEL_USER_ENABLE_LOCAL_AUDIO="EnableLocalAudio",e.ON_CHANNEL_USER_MUTE_VIDEO="MuteLocalVideoStream",e.ON_CHANNEL_USER_MUTE_AUDIO="MuteLocalAudioStream",e.STATE_CHANGE="state_change",e.NETWORK_QUALITY="network-quality",e.RECORDING_DEVICE_CHANGED="recordingDeviceChanged",e.PLAYOUT_DEVICE_CHANGED="playoutDeviceChanged",e.CAMERA_DEVICE_CHANGED="cameraDeviceChanged"}(g||(g={}));var b,D,k,w,L,P,M,U,V,F=g,B=Array.prototype,x=function(){function e(){this._events={},this.addListener=this.on}return e.prototype.getListeners=function(e){return this._events[e]?B.map.call(this._events[e],(function(e){return e.listener})):[]},e.prototype.on=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!1})},e.prototype.once=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e];-1===this._indexOfListener(n,t)&&n.push({listener:t,once:!0})},e.prototype.off=function(e,t){this._events[e]||(this._events[e]=[]);var n=this._events[e],r=this._indexOfListener(n,t);-1!==r&&B.splice.call(n,r,1)},e.prototype.removeAllListeners=function(e){e?delete this._events[e]:this._events={}},e.prototype.emit=function(e){for(var t,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];this._events[e]||(this._events[e]=[]);var o=this._events[e];try{for(var a=v(o),s=a.next();!s.done;s=a.next()){var c=s.value;c.once&&this.off(e,c.listener),c.listener.apply(this,r||[])}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}},e.prototype._indexOfListener=function(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1},e}(),j=function(e){function t(t){var n=e.call(this)||this;if(n._ssid="",n._websocket=null,n._url="",n._wss=!0,n._port=443,n.onclose=function(){},n.onerror=function(){},n.onmessage=function(){},n._ssid="ws-"+y(5),t&&"[object Object]"===Object.prototype.toString.call(t)){var r=t.url,i=t.wss,o=t.port;r&&(n._url=r),"boolean"==typeof i&&(n._wss=i),o&&(n._port=o)}return n}return _(t,e),Object.defineProperty(t.prototype,"connectState",{get:function(){return this._websocket?this._websocket.readyState:WebSocket.CLOSED},enumerable:!1,configurable:!0}),t.prototype.open=function(e){var t=this;return new Promise((function(n,r){if(e&&"[object Object]"===Object.prototype.toString.call(e)){var i=e.url,o=e.wss,a=e.port;i&&(t._url=i),"boolean"==typeof o&&(t._wss=o),a&&(t._port=a)}var s="".concat(t._wss?"wss":"ws","://").concat(t._url,":").concat(t._port);O.debug("SignalingChannel start connect, url ".concat(s,".")),t._websocket=new WebSocket(s),t._websocket.onopen=function(){O.debug("[".concat(t._ssid,"] Signaling channel opened.")),t._websocket.onerror=function(e){O.debug("[".concat(t._ssid,"] Signaling channel error.")),t.onerror(e)},t._websocket.onclose=function(e){O.debug("[".concat(t._ssid,"] Channel ").concat(s," closed with code: ").concat(e.code," reason: ").concat(e.reason)),t._websocket=null,t.onclose(e)},n()},t._websocket.onmessage=function(e){t.onmessage(e)},t._websocket.onerror=function(e){r(Error("WebSocket error."))}}))},t.prototype.close=function(){this._websocket&&(this._websocket.onerror=function(){},this._websocket.onclose=function(){},this._websocket.onmessage=function(){},this._websocket.close(),this._websocket=null)},t.prototype.send=function(e){if("object"!=typeof e)return O.error("signal channel msg must be object."),!1;this._websocket&&1===this._websocket.readyState&&this._websocket.send(JSON.stringify(e))},t.prototype.addMessageEventListener=function(e,t){if(this._websocket)return this._websocket.addEventListener("message",e,t)},t.prototype.removeMessageEventListener=function(e,t){if(this._websocket)return this._websocket.removeEventListener("message",e,t)},t.prototype.clear=function(){this.close(),this.onerror=function(){},this.onclose=function(){},this.onmessage=function(){},this.addMessageEventListener=function(){},this.removeMessageEventListener=function(){}},t}(x),W=function(e){return e.then((function(e){return[null,e]})).catch((function(e){return[e]}))},G=function(e,t){var n=this;this.onFinally=t,this.promise=new Promise((function(t,r){return f(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return this.resolve=t,this.reject=r,e?[4,e(t,r)]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))}))})).finally((function(){var e;return null===(e=n.onFinally)||void 0===e?void 0:e.call(n)}))},H=function(t){function n(e){var n=t.call(this)||this;n._id=y(5),n._appId="",n._serverIsWss=!0,n._serverUrl="",n._serverPort=0,n._revState="DISCONNECTED",n._curState="DISCONNECTED",n._userId=null,n._keepALiveInterval=0,n._keepALiveIntervalTime=1e4,n._connectTimeout=0,n._keepAliveTimeout=0,n._signalSecret="",n.handleMediaServerEvents=function(){};var r=n;return e&&e.appId&&(r._appId=e.appId),n}return _(n,t),n.prototype.setEncryptionSecret=function(e){this._signalSecret=e},n.prototype.init=function(e){var t=this,n=e.appId,r=e.isWss,i=e.url,o=e.port;t._appId=n,"boolean"==typeof r&&(t._serverIsWss=r),i&&(t._serverUrl=i),o&&(t._serverPort=o)},n.prototype.setAppInfo=function(e){var t=e.appId;this._appId=t},n.prototype.configServer=function(e,t,n){var r=this;r._serverIsWss=e,r._serverUrl=t,r._serverPort=n},n.prototype.connectCTS=function(){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s=this;return m(this,(function(c){switch(c.label){case 0:return n._emitConnectionState("CONNECTING"),n._setConnectTimeout(),[4,W(n.open({url:n._serverUrl,wss:n._serverIsWss,port:n._serverPort}))];case 1:return t=E.apply(void 0,[c.sent(),2]),(o=t[0])?(n._clearConnectTimeout(),i(o)):(a="".concat(n._serverIsWss?"wss":"ws","://").concat(n._serverUrl,":").concat(n._serverPort),O.debug("[ws-client-".concat(this._id,"] websocket opened: ").concat(a)),n._clearConnectTimeout(),n._emitConnectionState("CONNECTED"),n.onmessage=function(e){var t=e.data,r=JSON.parse(t),i=r.Cmd;r.Encrypt;var o=r.Content,a=JSON.parse(o);switch(i){case"KeepAlive":n._clearKeepALiveTimeout();break;case"Online":n._startKeepAlive();default:n.handleMediaServerEvents&&n.handleMediaServerEvents(i,a)}},n.onerror=function(e){"CONNECTED"===s._curState&&n._emitConnectionState("RECONNECTING")},n.onclose=function(t){var r=t.code,i=t.reason;switch(n._clearConnectTimeout(),n._stopKeepAlive(),n._clearKeepALiveTimeout(),r){case 1e3:case 1005:n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.LEAVE);break;case 3001:n._emitConnectionState("RECONNECTING",e.ConnectionDisconnectedReason.NETWORK_ERROR);break;default:O.debug("media ws serve disconnected with code ".concat(r,", reason ").concat(i)),"RECONNECTING"!==n._curState&&n._emitConnectionState("RECONNECTING",e.ConnectionDisconnectedReason.SERVER_ERROR)}n.clear()},r()),[2]}}))}))}))},n.prototype.doKeepAlive=function(){var t=this,n={Cmd:"KeepAlive"};n.Content=JSON.stringify({time:Date.now().toString()}),this.send(n),!t._keepAliveTimeout&&(t._keepAliveTimeout=window.setTimeout((function(){t._stopKeepAlive(),t._clearKeepALiveTimeout(),t.clear(),t._emitConnectionState("RECONNECTING",e.ConnectionDisconnectedReason.KEEP_A_LIVE_TIME_OUT)}),2*t._keepALiveIntervalTime))},n.prototype.doOnline=function(e){var t=this;return new Promise((function(n,r){var i=function(e){var o=JSON.parse(e.data),a=o.Cmd;o.Encrypt;var s=o.Content,c=JSON.parse(s);if("Online"===a){t.removeMessageEventListener(i);var d=c.Code;if(0===d){var u=c.UserId;t._userId=u,n(u)}else O.error("user online failure, code => ",d),r(d)}};t.addMessageEventListener(i);var o={Cmd:"Online"};o.AppId=t._appId,o.Content=JSON.stringify(Object.assign({ACodec:"opus",DevType:7},e)),t.send(o)}))},n.prototype.doOffline=function(e){var t={Cmd:"Offline"};t.Content=JSON.stringify({UserId:this._userId,UserSId:e}),this.send(t)},n.prototype.doPublish=function(e,t,n){void 0===t&&(t=!1);var r=this;return new Promise((function(i,o){var a=function(e){var t=e.data,n=JSON.parse(t),o=n.Cmd;n.Encrypt;var s=n.Content,c=JSON.parse(s);o===F.ON_PUBLISH&&(r.removeMessageEventListener(a),i(c))};r.addMessageEventListener(a);var s={Cmd:"DoPublish"},c={StreamId:r._userId,ClientType:"sdk",AudCodecType:t?"PCMA":"Opus",VidCodecType:t?"MJpg":"H264",EncryptSecret:r._signalSecret,EncryptMode:1};if("[object Object]"===Object.prototype.toString.call(e)&&(c.AVSetting=JSON.stringify(Object.assign({HasAudio:!0,HasVideo:!0},e))),n){var d=n.Uri,u=n.Account,l=n.Pwd;s.Content={Uri:d||"",Account:u||"",Pwd:l||""}}s.Content=JSON.stringify(c),r.send(s)}))},n.prototype.doRePublish=function(e){var t=this;return new Promise((function(n,r){var i=function(e){var r=e.data,o=JSON.parse(r),a=o.Cmd;o.Encrypt;var s=o.Content,c=JSON.parse(s);a===F.ON_RE_PUBLISH&&(t.removeMessageEventListener(i),n(c))};t.addMessageEventListener(i);var o={Cmd:"DoRePublish"},a={StreamId:t._userId,ClientType:"sdk"};"[object Object]"===Object.prototype.toString.call(e)&&(a.AVSetting=JSON.stringify(Object.assign({HasAudio:!0,HasVideo:!0},e))),o.Content=JSON.stringify(a),t.send(o)}))},n.prototype.doPublishS=function(e){var t=this;return new Promise((function(n,r){var i=function(e){var r=e.data,o=JSON.parse(r),a=o.Cmd;o.Encrypt;var s=o.Content,c=JSON.parse(s);a===F.ON_PUBLISH_EX&&(t.removeMessageEventListener(i),n(c))};t.addMessageEventListener(i);var o={Cmd:"DoPublishS"},a={StreamId:t._userId};if(e){var s=e.Uri,c=e.Account,d=e.Pwd;o.Content={Uri:s||"",Account:c||"",Pwd:d||""}}o.Content=JSON.stringify(a),t.send(o)}))},n.prototype.doUnPublish=function(){var e={Cmd:"DoUnPublish"};e.Content=JSON.stringify({StreamId:this._userId}),this.send(e)},n.prototype.doUnPublishS=function(){var e={Cmd:"DoUnPublishS"};e.Content=JSON.stringify({StreamId:this._userId}),this.send(e)},n.prototype.doSubscribe=function(e){var t=this;return new Promise((function(n,r){var i=function(r){var o=r.data,a=JSON.parse(o),s=a.Cmd;a.Encrypt;var c=a.Content,d=JSON.parse(c);s===F.ON_SUBSCRIBE&&(d.Code,d.StreamId===e.StreamId&&(t.removeMessageEventListener(i),n(d)))};t.addMessageEventListener(i);var o={Cmd:"DoSubscribe"};o.Content=JSON.stringify(Object.assign({SubSessId:y(32),EncryptSecret:t._signalSecret,EncryptMode:1},e)),t.send(o)}))},n.prototype.doUnSubscribe=function(e){var t={Cmd:"DoUnSubscribe"};t.Content=JSON.stringify(Object.assign({StreamId:e})),this.send(t)},n.prototype.doReNewToken=function(e){var t={Cmd:"RenewAcsToken"};t.Content=JSON.stringify({AcsToken:e}),this.send(t)},n.prototype.sendIotImageData=function(e,t){var n={Cmd:"PriVidData"};n.Content=JSON.stringify({StreamId:e,Data:t}),this.send(n)},n.prototype.sendAnswer=function(e,t,n){var r={Cmd:"Answer"},i={StreamId:e,Sdp:t};void 0!==n&&(i.SubStream=n),r.Content=JSON.stringify(i),this.send(r)},n.prototype.sendIceCandidate=function(e,t,n){var r={Cmd:"Ice"},i={StreamId:e,Sdp:t};void 0!==n&&(i.SubStream=n),r.Content=JSON.stringify(i),this.send(r)},n.prototype.setClientRole=function(e){var t=this;return new Promise((function(n,r){var i=function(e){var o=e.data,a=JSON.parse(o),s=a.Cmd;a.Encrypt;var c=a.Content,d=JSON.parse(c).Cmd;if("ChanMsg"===s&&"SetRole"===d){var u=JSON.parse(c);u.AppId,u.ChanId;var l=u.UserId,p=u.Code;u.Role,l===t._userId?(t.removeMessageEventListener(i),0===p&&n()):r("SetRole failed with Code "+p)}};t.addMessageEventListener(i);var o={Cmd:"ChanMsg"};o.Content=JSON.stringify({Cmd:"SetRole",UserId:t._userId,Role:e,ToSvr:"MNode"}),t.send(o)}))},n.prototype.enableDualStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"DualStream",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this.send(t)},n.prototype.setAVStatus=function(e,t,n){var r={Cmd:"ChanMsg"};r.Content=JSON.stringify({Cmd:"SetAVStatus",StreamId:e,RecvAudio:t,RecvVideo:n,ToSvr:"GNode"}),this.send(r)},n.prototype.setRemoteVideoStreamType=function(e,t){var n={Cmd:"ChanMsg"};n.Content=JSON.stringify({Cmd:"SetRemoteVStrmType",UserId:this._userId,StreamId:e,StrmType:t,ToSvr:"GNode"}),this.send(n)},n.prototype.reportAVStat=function(e){var t=e.TimeUsed,n=e.AudNum,r=e.VidSize,i={Cmd:"ReportAVStat"};i.TimeUsed=t,i.AudNum=n,i.VidSize=r,i.AudBitrate=0,i.VidBitrate=0,i.Content="",this.send(i)},n.prototype.reportArStats=function(e){var t={Cmd:"ReportArStats"};t.Content=JSON.stringify(e),this.send(t)},n.prototype.enableLocalVideo=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"EnableLocalVideo",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this.send(t)},n.prototype.enableLocalAudio=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"EnableLocalAudio",UserId:this._userId,Enable:e,ToSvr:"MNode"}),this.send(t)},n.prototype.muteLocalVideoStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"MuteLocalVideoStream",UserId:this._userId,Mute:e,ToSvr:"MNode"}),this.send(t)},n.prototype.muteLocalAudioStream=function(e){var t={Cmd:"ChanMsg"};t.Content=JSON.stringify({Cmd:"MuteLocalAudioStream",UserId:this._userId,Mute:e,ToSvr:"MNode"}),this.send(t)},n.prototype.uploadUserQuality=function(e,t){var n={Cmd:"ChanMsg"};n.Content=JSON.stringify({Cmd:"UserQuality",UserId:this._userId,TxQ:e,RxQ:t,ToSvr:"MNode"}),this.send(n)},n.prototype.disconnectCTS=function(t){var n=this;if(n._stopKeepAlive(),n._clearKeepALiveTimeout(),n.clear(),t)switch(t){case"UID_BANNED":n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.UID_BANNED);break;case"TOKEN_INVALID":n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.TOKEN_INVALID);break;case"NETWORK_OFFLINE":n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.NETWORK_OFFLINE),R(500).then((function(){n._emitConnectionState("RECONNECTING")}))}else n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.LEAVE)},n.prototype.clearEventEmitter=function(){this.removeAllListeners()},n.prototype._setConnectTimeout=function(){var t=this;t._clearConnectTimeout(),t._connectTimeout=window.setTimeout((function(){t._emitConnectionState("DISCONNECTING",e.ConnectionDisconnectedReason.CONNECT_TIME_OUT)}),1e4)},n.prototype._startKeepAlive=function(){var e=this;e._stopKeepAlive(),e.doKeepAlive(),e._keepALiveInterval=window.setInterval((function(){e.doKeepAlive()}),e._keepALiveIntervalTime)},n.prototype._stopKeepAlive=function(){this._keepALiveInterval&&clearInterval(this._keepALiveInterval)},n.prototype._clearConnectTimeout=function(){this._connectTimeout&&clearTimeout(this._connectTimeout)},n.prototype._clearKeepALiveTimeout=function(){var e=this;e._keepAliveTimeout&&(clearTimeout(e._keepAliveTimeout),e._keepAliveTimeout=0)},n.prototype._emitConnectionState=function(e,t){console.log("_emitConnectionState",e,t),"DISCONNECTED"===e&&O.debug("[signal] media websocket closed, reason: ".concat(t)),this._revState=this._curState,this._curState=e,this.handleMediaServerEvents&&this.handleMediaServerEvents("connection-state-change",{curState:this._curState,revState:this._revState,reason:t})},n}(j);!function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_SUPPORTED="NOT_SUPPORTED",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORTED="OPERATION_ABORTED",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT",e.NO_ACTIVE_STATUS="NO_ACTIVE_STATUS",e.DEVELOPER_INVALID="DEVELOPER_INVALID",e.UID_BANNED="UID_BANNED",e.IP_BANNED="IP_BANNED",e.CHANNEL_BANNED="CHANNEL_BANNED",e.SERVER_NOT_OPEN="SERVER_NOT_OPEN",e.TOKEN_EXPIRED="TOKEN_EXPIRED",e.TOKEN_INVALID="TOKEN_INVALID"}(b||(b={})),function(e){e.UID_CONFLICT="UID_CONFLICT",e.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER"}(D||(D={})),function(e){e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",e.NOT_READABLE="NOT_READABLE"}(k||(k={})),function(e){e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",e.NETWORK_ERROR="NETWORK_ERROR",e.WS_ABORT="WS_ABORT",e.WS_DISCONNECT="WS_DISCONNECT",e.WS_ERR="WS_ERR"}(w||(w={})),function(e){e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS",e.TRACK_IS_DISABLED="TRACK_IS_DISABLED"}(L||(L={})),function(e){e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.REMOTE_USER_IS_NOT_PUBLISHED="REMOTE_USER_IS_NOT_PUBLISHED"}(P||(P={})),function(e){e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SRC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE"}(M||(M={})),function(e){e.LIVE_STREAMING_TASK_CONFLICT="LIVE_STREAMING_TASK_CONFLICT",e.LIVE_STREAMING_INVALID_ARGUMENT="LIVE_STREAMING_INVALID_ARGUMENT",e.LIVE_STREAMING_INTERNAL_SERVER_ERROR="LIVE_STREAMING_INTERNAL_SERVER_ERROR",e.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED="LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED",e.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED="LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED",e.LIVE_STREAMING_CDN_ERROR="LIVE_STREAMING_CDN_ERROR",e.LIVE_STREAMING_INVALID_RAW_STREAM="LIVE_STREAMING_INVALID_RAW_STREAM"}(U||(U={})),function(e){e.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT="LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT",e.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE="LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE",e.LIVE_STREAMING_WARN_FREQUENT_REQUEST="LIVE_STREAMING_WARN_FREQUENT_REQUEST"}(V||(V={}));var K,J=function(){function e(e,t,n){void 0===t&&(t=""),this.name="ArRTCException",this.code=e;var r="ArRTCError".concat(" ").concat(this.code,": ");this.message=t?r.concat(t):r,this.data=n}return e.prototype.toString=function(){return this.data?"".concat(this.message," data: ").concat(JSON.stringify(this.data)):this.message},e}(),Y=function(){function e(e){if(this._url="",this._wss=!0,this._port=443,this._timeout=6e4,"[object Object]"===Object.prototype.toString.call(e)){var t=e.url,n=e.wss,r=e.port,i=e.timeout;"string"==typeof t&&(this._url=t),"boolean"==typeof n&&(this._wss=n,this._port=n?443:80),"number"==typeof r&&(this._port=r),"number"==typeof i&&(this._timeout=i)}}return e.prototype.setRequestUrl=function(e){if("[object Object]"===Object.prototype.toString.call(e)){var t=e.url,n=e.wss,r=e.port;"string"==typeof t&&(this._url=t),"boolean"==typeof n&&(this._wss=n,this._port=n?443:80),"number"==typeof r&&(this._port=r)}},e.prototype.request=function(e,t,n){return this._sendUrlRequest(e,t,n)},e.prototype.post=function(e,t){return this.request(e,"POST",t)},e.prototype.get=function(e,t){return this.request(e,"GET",t)},e.prototype._sendUrlRequest=function(e,t,n,r){var i=this;return void 0===r&&(r=!0),new Promise((function(o,a){if(""!==i._url){var s=i._url;e&&(s=i._url+e);var c=new XMLHttpRequest;c.timeout=6e4;var d=function(){200===c.status?o(JSON.parse(c.responseText)):a("NETWORK_RESPONSE_ERROR")};r&&(c.onreadystatechange=function(e){4===c.readyState&&d()}),c.open(t,s,r),c.onerror=function(e){a("NETWORK_ERROR")},c.ontimeout=function(){a("NETWORK_TIMEOUT")},c.send(JSON.stringify(n)),r||d()}else a("NO_REQUEST_URL")}))},e}();!function(e){e.INVALID_PARAMS="INVALID_PARAMS",e.DEVELOPER_INVALID="DEVELOPER_INVALID",e.UID_BANNED="UID_BANNED",e.IP_BANNED="IP_BANNED",e.CHANNEL_BANNED="CHANNEL_BANNED",e.APPID_INVALID="APPID_INVALID",e.SERVER_NOT_OPEN="SERVER_NOT_OPEN",e.TOKEN_EXPIRED="TOKEN_EXPIRED",e.TOKEN_INVALID="TOKEN_INVALID",e.UNKNOWN="UNKNOWN",e.TIMEOUT="TIMEOUT"}(K||(K={}));var z,Q,q=function(){function e(e){this._urls=[],this._urlSuffix="/arapi/v1?action=",this._joinInfo={},C.GATEWAY_ADDRESS&&this._urls.push(C.GATEWAY_ADDRESS),C.GATEWAY_ADDRESS1&&this._urls.push(C.GATEWAY_ADDRESS1),this._urlSuffix="/arapi/v1?action=",this._joinInfo=e}return e.prototype.joinGateway=function(e){var t=this,n=this;return new Promise((function(r,i){var o=n._urlSuffix.concat("wrtc_gateway"),a={opid:133,ts:Date.now(),sid:t._joinInfo.sid,appId:t._joinInfo.appId,cname:t._joinInfo.cname,uid:t._joinInfo.uid,token:t._joinInfo.token,wss:C.GATEWAY_ADDRESS_SSL,areaCode:C.AREA_CODE,region:C.Region},s=function(){return f(t,void 0,void 0,(function(){var t,n,c,d;return m(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,Promise.race(this._urls.map((function(t){return new Y({url:t,timeout:C.GATEWAY_CONNECT_TIMEOUT}).post(o,h(h({},a),e))})))];case 1:return(t=u.sent())&&(0===(n=t.code)?r(t):-1===n||1===n?setTimeout((function(){s()}),C.GATEWAY_CONNECT_TIMEOUT):i(-4===n||-7===n?K.INVALID_PARAMS:13===n?K.DEVELOPER_INVALID:14===n?K.UID_BANNED:15===n?K.IP_BANNED:16===n?K.CHANNEL_BANNED:101===n?K.APPID_INVALID:102===n?K.SERVER_NOT_OPEN:109===n?K.TOKEN_EXPIRED:110===n?K.TOKEN_INVALID:"Error Code ".concat(n,"."))),[3,3];case 2:return c=u.sent(),"NETWORK_ERROR"===(d=c)||"NETWORK_TIMEOUT"===d||"NETWORK_RESPONSE_ERROR"===d?(O.warning("reconnect gateway server, reason: ".concat(d)),setTimeout((function(){s()}),C.GATEWAY_CONNECT_TIMEOUT),[2]):(O.debug("XMLHttpRequest abort error ",d),i(K.UNKNOWN),[3,3]);case 3:return[2]}}))}))};s()}))},e}(),X=function(e){function t(t,n){var r=e.call(this)||this;return r.peer=void 0,r._ID=n||y(8),r._originMediaStreamTrack=t,r._mediaStreamTrack=t,r}return _(t,e),t.prototype.getTrackId=function(){return this._ID},t.prototype.getMediaStreamTrack=function(){return this._mediaStreamTrack},t}(x),Z={},$=function(){return function(){var e,t,n=void 0,r=navigator.userAgent,i=r.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];"Chrome"===i[1]&&null!=(n=r.match(/(OPR(?=\/))\/?(\d+)/i))&&(i=n),"Safari"===i[1]&&null!=(n=r.match(/version\/(\d+)/i))&&(i[2]=n[1]),~r.toLowerCase().indexOf("qqbrowser")&&null!=(n=r.match(/(qqbrowser(?=\/))\/?(\d+)/i))&&(i=n),~r.toLowerCase().indexOf("micromessenger")&&null!=(n=r.match(/(micromessenger(?=\/))\/?(\d+)/i))&&(i=n),~r.toLowerCase().indexOf("edge")&&null!=(n=r.match(/(edge(?=\/))\/?(\d+)/i))&&(i=n),~r.toLowerCase().indexOf("trident")&&null!=(n=/\brv[ :]+(\d+)/g.exec(r)||[])&&(i=[null,"IE",n[1]]);var o=void 0;try{for(var a=v([{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}]),s=a.next();!s.done;s=a.next()){var c=s.value;if(c.r.test(navigator.userAgent)){o=c.s;break}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}return{name:i[1],version:i[2],os:o}}()},ee=function(){return $().os};Z.getBrowserInfo=$,Z.getBrowserOS=ee,Z.isChrome=function(){var e=$();return e.name&&"Chrome"===e.name},Z.isSafari=function(){var e=$();return e.name&&"Safari"===e.name},Z.isEdge=function(){var e=$();return e.name&&"Edge"===e.name},Z.isFireFox=function(){var e=$();return e.name&&"Firefox"===e.name},Z.isOpera=function(){var e=$();return e.name&&"OPR"===e.name},Z.isQQBrowser=function(){var e=$();return e.name&&"QQBrowser"===e.name},Z.isWeChatBrowser=function(){var e=$();return e.name&&"MicroMessenger"===e.name},Z.isSupportedPC=function(){var e=ee();return"Linux"===e||"Mac OS X"===e||"Mac OS"===e||-1!==e.indexOf("Windows")},Z.isSupportedMobile=function(){var e=ee();return"Android"===e||"iOS"===e},Z.getBrowserVersion=function(){return $().version},Z.isChromeKernel=function(){return!!navigator.userAgent.match(/chrome\/[\d]./i)},Z.isLegacyChrome=function(){return window.navigator.appVersion&&null!==window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)&&window.navigator.appVersion.match(/Chrome\/([\w\W]*?)\./)[1]<=35},function(e){e.WIN_10="Windows 10",e.WIN_81="Windows 8.1",e.WIN_8="Windows 8",e.WIN_7="Windows 7",e.WIN_VISTA="Windows Vista",e.WIN_SERVER_2003="Windows Server 2003",e.WIN_XP="Windows XP",e.WIN_2000="Windows 2000",e.ANDROID="Android",e.OPEN_BSD="Open BSD",e.SUN_OS="Sun OS",e.LINUX="Linux",e.IOS="iOS",e.MAC_OS_X="Mac OS X",e.MAC_OS="Mac OS",e.QNX="QNX",e.UNIX="UNIX",e.BEOS="BeOS",e.OS_2="OS/2",e.SEARCH_BOT="Search Bot"}(z||(z={})),function(e){var t,n,r,i;!function(e){e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.UNEXPECTED_RESPONSE="UNEXPECTED_RESPONSE",e.INVALID_PARAMS="INVALID_PARAMS",e.NOT_SUPPORTED="NOT_SUPPORTED",e.INVALID_OPERATION="INVALID_OPERATION",e.OPERATION_ABORTED="OPERATION_ABORTED",e.WEB_SECURITY_RESTRICT="WEB_SECURITY_RESTRICT"}(e.BasicErrorCode||(e.BasicErrorCode={})),(t=e.HttpErrorCode||(e.HttpErrorCode={})).NETWORK_TIMEOUT="NETWORK_TIMEOUT",t.NETWORK_RESPONSE_ERROR="NETWORK_RESPONSE_ERROR",t.NETWORK_ERROR="NETWORK_ERROR",(n=e.WSErrorCode||(e.WSErrorCode={})).WS_ABORT="WS_ABORT",n.WS_DISCONNECT="WS_DISCONNECT",n.WS_ERR="WS_ERR",function(e){e.ENUMERATE_DEVICES_FAILED="ENUMERATE_DEVICES_FAILED",e.DEVICE_NOT_FOUND="DEVICE_NOT_FOUND",e.NOT_READABLE="NOT_READABLE"}(e.DeviceErrorCode||(e.DeviceErrorCode={})),(r=e.TrackErrorCode||(e.TrackErrorCode={})).TRACK_IS_DISABLED="TRACK_IS_DISABLED",r.SHARE_AUDIO_NOT_ALLOWED="SHARE_AUDIO_NOT_ALLOWED",r.MEDIA_OPTION_INVALID="MEDIA_OPTION_INVALID",r.CONSTRAINT_NOT_SATISFIED="CONSTRAINT_NOT_SATISFIED",r.PERMISSION_DENIED="PERMISSION_DENIED",r.FETCH_AUDIO_FILE_FAILED="FETCH_AUDIO_FILE_FAILED",r.READ_LOCAL_AUDIO_FILE_ERROR="READ_LOCAL_AUDIO_FILE_ERROR",r.DECODE_AUDIO_FILE_FAILED="DECODE_AUDIO_FILE_FAILED",r.TRACK_STATE_UNREACHABLE="TRACK_STATE_UNREACHABLE",(i=e.JoinChannelErrorCode||(e.JoinChannelErrorCode={})).UID_CONFLICT="UID_CONFLICT",i.CAN_NOT_GET_GATEWAY_SERVER="CAN_NOT_GET_GATEWAY_SERVER",function(e){e.INVALID_LOCAL_TRACK="INVALID_LOCAL_TRACK",e.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS="CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS"}(e.PublishErrorCode||(e.PublishErrorCode={})),function(e){e.INVALID_REMOTE_USER="INVALID_REMOTE_USER",e.REMOTE_USER_IS_NOT_PUBLISHED="REMOTE_USER_IS_NOT_PUBLISHED"}(e.SubscribeErrorCode||(e.SubscribeErrorCode={})),function(e){e.LIVE_STREAMING_TASK_CONFLICT="LIVE_STREAMING_TASK_CONFLICT",e.LIVE_STREAMING_INVALID_ARGUMENT="LIVE_STREAMING_INVALID_ARGUMENT",e.LIVE_STREAMING_INTERNAL_SERVER_ERROR="LIVE_STREAMING_INTERNAL_SERVER_ERROR",e.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED="LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED",e.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED="LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED",e.LIVE_STREAMING_CDN_ERROR="LIVE_STREAMING_CDN_ERROR",e.LIVE_STREAMING_INVALID_RAW_STREAM="LIVE_STREAMING_INVALID_RAW_STREAM"}(e.LiveStreamingErrorCode||(e.LiveStreamingErrorCode={})),function(e){e.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT="LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT",e.LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE="LIVE_STREAMING_WARN_FAILED_LOAD_IMAGE",e.LIVE_STREAMING_WARN_FREQUENT_REQUEST="LIVE_STREAMING_WARN_FREQUENT_REQUEST"}(e.LiveStreamingWarningCode||(e.LiveStreamingWarningCode={})),function(e){e.CROSS_CHANNEL_WAIT_STATUS_ERROR="CROSS_CHANNEL_WAIT_STATUS_ERROR",e.CROSS_CHANNEL_FAILED_JOIN_SRC="CROSS_CHANNEL_FAILED_JOIN_SRC",e.CROSS_CHANNEL_FAILED_JOIN_DEST="CROSS_CHANNEL_FAILED_JOIN_DEST",e.CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST="CROSS_CHANNEL_FAILED_PACKET_SENT_TO_DEST",e.CROSS_CHANNEL_SERVER_ERROR_RESPONSE="CROSS_CHANNEL_SERVER_ERROR_RESPONSE"}(e.ChannelRelayErrorCode||(e.ChannelRelayErrorCode={}))}(Q||(Q={}));var te=Q,ne=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._userId=null,r._enabled=!0,r._muted=!1,r._isClosed=!1,r._constraints={},t.addEventListener("ended",r.emit.bind(r,F.TRACK_ENDED)),r}return _(t,e),Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"muted",{get:function(){return this._muted},enumerable:!1,configurable:!0}),t.prototype.getTrackLabel=function(){return this._originMediaStreamTrack.label},t.prototype.setEnabled=function(e){if(this._muted)throw new J(te.TrackErrorCode.TRACK_STATE_UNREACHABLE,"cannot set enabled while the track is muted");"boolean"==typeof e&&(this._enabled=!!e,this._originMediaStreamTrack.enabled=e,this._enabled?this.emit(F.TRACK_ENABLED,this):this.emit(F.TRACK_DISABLED,this))},t.prototype.setMuted=function(e){return f(this,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:if(!this._enabled)throw new J(te.TrackErrorCode.TRACK_STATE_UNREACHABLE,"cannot set muted while the track is disabled");return e===this._muted?[3,3]:(this._muted=e,"Firefox"!==Z.getBrowserInfo().name?[3,2]:(O.debug("[".concat(this.getTrackId(),"] firefox set mute fallback to set enabled")),[4,this.setEnabled(!e)]));case 1:return t.sent(),[2];case 2:this._mediaStreamTrack.enabled=!e,O.debug("[".concat(this.getTrackId(),"] start set muted: ",e.toString())),this._muted?this.emit(F.TRACK_MUTED,this):this.emit(F.TRACK_UNMUTED,this),t.label=3;case 3:return[2]}}))}))},t.prototype.close=function(){this._originMediaStreamTrack.stop(),this._mediaStreamTrack!==this._originMediaStreamTrack&&this._mediaStreamTrack.stop(),this.emit(F.TRACK_ENDED),this._isClosed=!0,O.debug("[track-".concat(this.getTrackId(),"] close"))},t.prototype._setUserId=function(e){this._userId=e},t.prototype._updateOriginMediaStreamTrack=function(e,t){return f(this,void 0,void 0,(function(){return m(this,(function(e){return[2]}))}))},t.prototype._updatePlayerSource=function(){},t.prototype._getDefaultPlayerConfig=function(){return{}},t}(X),re=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.getMediaStreamTrack(),r}return _(t,e),t}(X);function ie(e,t,n){return{sampleRate:e,stereo:t,bitrate:n}}function oe(e,t,n,r,i){return{width:e,height:t,frameRate:n,bitrateMin:r,bitrateMax:i}}function ae(e,t,n,r,i){return{width:{max:e},height:{max:t},frameRate:n,bitrateMin:r,bitrateMax:i}}var se,ce={"90p":oe(160,90),"90p_1":oe(160,90),"120p":oe(160,120,15,30,65),"120p_1":oe(160,120,15,30,65),"120p_3":oe(120,120,15,30,50),"120p_4":oe(212,120),"180p":oe(320,180,15,30,140),"180p_1":oe(320,180,15,30,140),"180p_3":oe(180,180,15,30,100),"180p_4":oe(240,180,15,30,120),"240p":oe(320,240,15,40,200),"240p_1":oe(320,240,15,40,200),"240p_3":oe(240,240,15,40,140),"240p_4":oe(424,240,15,40,220),"360p":oe(640,360,15,80,400),"360p_1":oe(640,360,15,80,400),"360p_3":oe(360,360,15,80,260),"360p_4":oe(640,360,30,80,600),"360p_6":oe(360,360,30,80,400),"360p_7":oe(480,360,15,80,320),"360p_8":oe(480,360,30,80,490),"360p_9":oe(640,360,15,80,800),"360p_10":oe(640,360,24,80,800),"360p_11":oe(640,360,24,80,1e3),"480p":oe(640,480,15,100,500),"480p_1":oe(640,480,15,100,500),"480p_2":oe(640,480,30,100,1e3),"480p_3":oe(480,480,15,100,400),"480p_4":oe(640,480,30,100,750),"480p_6":oe(480,480,30,100,600),"480p_8":oe(848,480,15,100,610),"480p_9":oe(848,480,30,100,930),"480p_10":oe(640,480,10,100,400),"720p":oe(1280,720,15,120,1130),"720p_1":oe(1280,720,15,120,1130),"720p_2":oe(1280,720,30,120,2e3),"720p_3":oe(1280,720,30,120,1710),"720p_5":oe(960,720,15,120,910),"720p_6":oe(960,720,30,120,1380),"1080p":oe(1920,1080,15,120,2080),"1080p_1":oe(1920,1080,15,120,2080),"1080p_2":oe(1920,1080,30,120,3e3),"1080p_3":oe(1920,1080,30,120,3150),"1080p_5":oe(1920,1080,60,120,4780),"1440p":oe(2560,1440,30,120,4850),"1440p_1":oe(2560,1440,30,120,4850),"1440p_2":oe(2560,1440,60,120,7350),"4k":oe(3840,2160,30,120,8910),"4k_1":oe(3840,2160,30,120,8910),"4k_3":oe(3840,2160,60,120,13500)},de={"480p":ae(640,480,5),"480p_1":ae(640,480,5),"480p_2":ae(640,480,30),"480p_3":ae(640,480,15),"720p":ae(1280,720,5),"720p_1":ae(1280,720,5),"720p_2":ae(1280,720,30),"720p_3":ae(1280,720,15),"1080p":ae(1920,1080,5),"1080p_1":ae(1920,1080,5),"1080p_2":ae(1920,1080,30),"1080p_3":ae(1920,1080,15)},ue={speech_low_quality:ie(16e3,!1),speech_standard:ie(32e3,!1,18),music_standard:ie(48e3,!1),standard_stereo:ie(48e3,!0,56),high_quality:ie(48e3,!1,128),high_quality_stereo:ie(48e3,!0,192)},le=window.AudioContext||window.webkitAudioContext,pe=function(){return se||(function(){var e=[],t=["click","contextmenu","auxclick","dblclick","mousedown","mouseup","pointerup","touchend","keydown","keyup"];function n(r){var i=0;e.forEach((function(e){"running"!==e.state?e.resume().then((function(){O.info("resume success")})):i++})),i===e.length&&t.forEach((function(e){document.removeEventListener(e,n)}))}le=new Proxy(le,{construct:function(t,n){var r=new(t.bind.apply(t,S([void 0],E(n),!1)));return e.push(r),r}}),t.forEach((function(e){document.addEventListener(e,n)}))}(),O.info("create audio context"),se=new le)},_e=function(e,t){return void 0===t&&(t=!1),new Promise((function(n,r){if(e instanceof File){var i=new FileReader;i.onload=function(e){a(e.target.result)},i.onerror=function(e){i.abort(),r("readFile ${source.name} error")},i.readAsArrayBuffer(e)}else if("string"==typeof e){var o=new XMLHttpRequest;o.open("GET",e,!0),!t&&o.setRequestHeader("Cache-control","no-cache"),o.responseType="arraybuffer",o.onload=function(){a(o.response)},o.send()}else e instanceof AudioBuffer&&n(e);function a(e){pe().decodeAudioData(e,(function(e){n(e)}),(function(e){throw new Error("Error with decoding audio data"+e.err)}))}}))},he=!0;Z.getBrowserInfo().os!==z.IOS&&"MicroMessenger"!==Z.getBrowserInfo().name||(he=!1);var fe=!1;navigator.userAgent.toLocaleLowerCase().match(/chrome\/?\s*(\d+)/i)||(fe=!0);var me={getDisplayMedia:!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia),getStreamFromExtension:"Chrome"===Z.getBrowserInfo().name&&34<Number(Z.getBrowserInfo().version),supportUnifiedPlan:function(){if(!window.RTCRtpTransceiver)return!1;if(!("currentDirection"in RTCRtpTransceiver.prototype))return!1;if(!window.RTCPeerConnection)return!1;var e=new RTCPeerConnection,t=!1;try{e.addTransceiver("audio"),t=!0}catch(e){}return e.close(),t}(),supportMinBitrate:"Chrome"===Z.getBrowserInfo().name||"Edge"===Z.getBrowserInfo().name,supportMaxBitrateInEncodingParameters:"Chrome"===Z.getBrowserInfo().name&&68<=Number(Z.getBrowserInfo().version)||"Firefox"===Z.getBrowserInfo().name&&64<=Number(Z.getBrowserInfo().version),supportDualStream:he,webAudioMediaStreamDest:function(){return function(){var e=Z.getBrowserInfo();if("Safari"===e.name&&Number(e.version)<12)return!1;var t=pe();return!!t.createMediaStreamDestination&&!!t.createMediaStreamDestination().stream}()},supportReplaceTrack:!!window.RTCRtpSender&&"function"==typeof RTCRtpSender.prototype.replaceTrack,supportWebGL:"undefined"!=typeof WebGLRenderingContext,webAudioWithAEC:fe};"https:"!==location.protocol&&""!==location.hostname&&"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname&&O.error("getUserMedia() does not work on insecure origins. See https://goo.gl/rStTGz for more details. Please upgrade your site to HTTPS."),O.info("browser compatibility ".concat(JSON.stringify(me)));var ve,Ee,Se=null,Te=!1,Ie=!1,Ce=function(){if(Se)return Se;try{return Se=window.require("electron")}catch(e){return null}};function ye(e,t){switch(e){case"Starting video failed":case"OverconstrainedError":case"TrackStartError":return new J(te.TrackErrorCode.MEDIA_OPTION_INVALID,"".concat(e,": ").concat(t));case"NotFoundError":case"DevicesNotFoundError":return new J(te.DeviceErrorCode.DEVICE_NOT_FOUND,"".concat(e,": ").concat(t));case"NotSupportedError":return new J(te.BasicErrorCode.NOT_SUPPORTED,"".concat(e,": ").concat(t));case"NotReadableError":return new J(te.DeviceErrorCode.NOT_READABLE,"".concat(e,": ").concat(t));case"InvalidStateError":case"NotAllowedError":case"PERMISSION_DENIED":case"PermissionDeniedError":return new J(te.TrackErrorCode.PERMISSION_DENIED,"".concat(e,": ").concat(t));case"ConstraintNotSatisfiedError":return new J(te.TrackErrorCode.CONSTRAINT_NOT_SATISFIED,"".concat(e,": ").concat(t));default:return O.error("getUserMedia unexpected error",e),new J(te.BasicErrorCode.UNEXPECTED_ERROR,"".concat(e,": ").concat(t))}}function Ae(e,t){var n=this;return new Promise((function(r,i){return f(n,void 0,void 0,(function(){var n,o,a;return m(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),n={audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxHeight:t.height,maxWidth:t.width}}},t.frameRate&&"number"!=typeof t.frameRate?(n.video.mandatory.maxFrameRate=t.frameRate.max,n.video.mandatory.minFrameRate=t.frameRate.min):"number"==typeof t.frameRate&&(n.video.mandatory.maxFrameRate=t.frameRate),o=r,[4,navigator.mediaDevices.getUserMedia(n)];case 1:return o.apply(void 0,[s.sent()]),[3,3];case 2:return a=s.sent(),i(a),[3,3];case 3:return[2]}}))}))}))}function Re(e){var t=this;return new Promise((function(n,r){return f(t,void 0,void 0,(function(){var t,i,o,a,s;return m(this,(function(d){switch(d.label){case 0:if(d.trys.push([0,2,,3]),t=["window","screen"],"application"!==e&&"window"!==e||(t=["window"]),"screen"===e&&(t=["screen"]),!(i=Ce()))throw new J(c.ELECTRON_IS_NULL);o=null;try{o=i.desktopCapturer.getSources({types:t})}catch(e){o=null}return o instanceof Promise||(o=new Promise((function(e,n){i.desktopCapturer.getSources({types:t},(function(t,r){t?n(t):e(r)}))}))),a=n,[4,o];case 1:return a.apply(void 0,[d.sent()]),[3,3];case 2:return s=d.sent(),r(s),[3,3];case 3:return[2]}}))}))}))}function ge(e,t){var n=this;return void 0===t&&(t=!1),new Promise((function(r,i){return f(n,void 0,void 0,(function(){var n,o,a,s,d,u,l,p,_,h,f,v,E;return m(this,(function(m){switch(m.label){case 0:if(m.trys.push([0,14,,15]),!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw v=new J(c.NOT_SUPPORT+"can not find getUserMedia"),i(v),v;return t&&(e.video&&delete e.video,e.screen&&delete e.screen),n=me,e.audio||e.video||e.screen||e.audioSource||e.videoSource?e.audio||e.video?(p={},e.audio&&(p.audio=e.audio),e.video&&(p.video=e.video),[4,navigator.mediaDevices.getUserMedia(p)]):[3,2]:[3,13];case 1:return o=m.sent(),e.audio&&((a=document.createElement("audio")).autoplay=!0,a.muted=!0,a.setAttribute("muted","muted"),a.setAttribute("autoplay","autoplay"),a.srcObject=new MediaStream([o.getAudioTracks()[0]])),e.audio&&(Ie=!0),e.video&&(Te=!0),r(o),[3,13];case 2:return e.screen?(s=Object.assign({},{width:e.screen.width,height:e.screen.height,frameRate:e.screen.frameRate}),Ce()?e.screen.electronScreenSourceId?[4,Ae(e.screen.electronScreenSourceId,s)]:[3,4]:[3,9]):[3,12];case 3:return l=m.sent(),r(l),[3,8];case 4:return d="window",O.debug("getElectronSources width type ".concat(d)),[4,Re(d)];case 5:return(u=m.sent())?[4,(S=u,new Promise((function(e,t){try{var n=document.createElement("div");n.innerText="share screen",n.setAttribute("style","text-align: center; height: 25px; line-height: 25px; border-radius: 4px 4px 0 0; background: #D4D2D4; border-bottom: solid 1px #B9B8B9;");var r=document.createElement("div");r.setAttribute("style","width: 100%; height: 500px; padding: 15px 25px ; box-sizing: border-box;");var i=document.createElement("div");i.innerText="anyRTC Web Screen-Sharing wants to share the contents of your screen with "+location.host+". Choose what you'd like to share.",i.setAttribute("style","height: 12%;");var o=document.createElement("div");o.setAttribute("style","width: 100%; height: 80%; background: #FFF; border: solid 1px #CBCBCB; display: flex; flex-wrap: wrap; justify-content: space-around; overflow-y: scroll; padding: 0 15px; box-sizing: border-box;");var a=document.createElement("div");a.setAttribute("style","text-align: right; padding: 16px 0;");var s=document.createElement("button");s.innerHTML="cancel",s.setAttribute("style","width: 85px;"),s.onclick=function(){document.body.removeChild(c);var e=new Error("NotAllowedError");e.name="NotAllowedError",t(e)},a.appendChild(s),r.appendChild(i),r.appendChild(o),r.appendChild(a);var c=document.createElement("div");c.setAttribute("style","position: absolute; z-index: 99999999; top: 50%; left: 50%; width: 620px; height: 525px; background: #ECECEC; border-radius: 4px; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);"),c.appendChild(n),c.appendChild(r),document.body.appendChild(c),S.map((function(t){if(t.id){var n=document.createElement("div");n.setAttribute("style","width: 30%; height: 160px; padding: 20px 0; text-align: center;box-sizing: content-box;"),n.innerHTML='<div style="height: 120px; display: table-cell; vertical-align: middle;"><img style="width: 100%; background: #333333; box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.2);" src='+t.thumbnail.toDataURL()+' /></div><span style="\theight: 40px; line-height: 40px; display: inline-block; width: 70%; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">'+t.name+"</span>",n.onclick=function(){document.body.removeChild(c),e(t.id)},o.appendChild(n)}}))}catch(e){t(e)}})))]:[3,8];case 6:return[4,Ae(m.sent(),s)];case 7:l=m.sent(),r(l),m.label=8;case 8:return[3,11];case 9:return n.getDisplayMedia?(e.screen.mediaSource&&~["screen","window","application"].indexOf(e.screen.mediaSource)&&Object.assign(s,{displaySurface:"screen"===e.screen.mediaSource?"monitor":e.screen.mediaSource}),p={video:s,audio:!!e.screenAudio},O.debug("mediaDevices.getDisplayMedia width ".concat(JSON.stringify(p))),[4,navigator.mediaDevices.getDisplayMedia(p)]):[3,11];case 10:_=m.sent(),r(_),m.label=11;case 11:return[3,13];case 12:(e.audioSource||e.videoSource)&&(h=new MediaStream,e.audioSource&&h.addTrack(e.audioSource),e.videoSource&&h.addTrack(e.videoSource),r(h)),m.label=13;case 13:return[3,15];case 14:return f=m.sent(),E=ye((v=f).name||v.code||v,v.message),i(E),[3,15];case 15:return[2]}var S}))}))}))}function Ne(e){return new Promise((function(t,n){try{var r=document.createElement("video");r.setAttribute("autoplay",""),r.setAttribute("muted",""),r.muted=!0,r.autoplay=!0,r.setAttribute("playsinline",""),r.setAttribute("style","position: absolute; top: 0; left: 0; width: 1px; height: 1px"),document.body.appendChild(r),r.addEventListener("playing",(function(){(r.videoWidth||"Firefox"!==Z.getBrowserInfo().name)&&("".concat(r.videoWidth.toString()," x ").concat(r.videoHeight.toString()),t([r.videoWidth,r.videoHeight]),document.body.removeChild(r))})),r.srcObject=new MediaStream([e])}catch(e){n(e)}}))}function Oe(e){return"string"==typeof e?Object.assign({},ce[e]):e&&"[object Object]"===Object.prototype.toString.call(e)&&"{}"!==JSON.stringify(e)?e:Object.assign({},ce["480p_1"])}function be(e){return"string"==typeof e?Object.assign({},ue[e]):e&&"[object Object]"===Object.prototype.toString.call(e)&&"{}"!==JSON.stringify(e)?e:Object.assign({})}function De(e){var t={},n=navigator.mediaDevices.getSupportedConstraints();n.facingMode&&e.facingMode&&(t.facingMode=e.facingMode),n.deviceId&&e.cameraId&&(t.deviceId=e.cameraId);var r=Oe(e.encoderConfig);return n.width&&("number"==typeof r.width?t.width={ideal:r.width}:"[object Object]"===Object.prototype.toString.call(r.width)&&(t.width=r.width)),n.height&&("number"==typeof r.height?t.height={ideal:r.height}:"[object Object]"===Object.prototype.toString.call(r.height)&&(t.height=r.height)),n.frameRate&&(t.frameRate=r.frameRate,Z.isLegacyChrome()&&(t.frameRate=r.frameRate),"Edge"===Z.getBrowserInfo().name&&"object"==typeof t.frameRate&&(t.frameRate.max=60),"Firefox"===Z.getBrowserInfo().name&&(t.frameRate={ideal:30,max:30})),t}function ke(e){var t={};navigator.mediaDevices.getSupportedConstraints().deviceId&&e.microphoneId&&(t.deviceId=e.microphoneId),Z.isLegacyChrome()||(void 0!==e.AGC&&(t.autoGainControl=e.AGC,Z.isChrome&&(t.googAutoGainControl=e.AGC,t.googAutoGainControl2=e.AGC)),void 0!==e.AEC&&(t.echoCancellation=e.AEC),void 0!==e.ANS&&(t.noiseSuppression=e.ANS),Z.isChrome&&void 0!==e.ANS&&(t.googNoiseSuppression=e.ANS));var n=be(e.encoderConfig);return n.stereo&&(t.channelCount=2),t.sampleRate=n.sampleRate,n.sampleSize&&(t.sampleSize=n.sampleSize),t}function we(e){var t={};e.screenSourceType&&"Firefox"===Z.getBrowserInfo().name&&(~["screen","window","application"].indexOf(e.screenSourceType)||(t.mediaSource=e.screenSourceType));var n,r="string"==typeof(n=e.encoderConfig)?Object.assign({},de[n]):n&&"[object Object]"===Object.prototype.toString.call(n)?n:{};return r?(t.width=r.width?r.width:1280,t.height=r.height?r.height:720,t.frameRate=r.frameRate?r.frameRate:5,e.electronScreenSourceId&&(t.electronScreenSourceId=e.electronScreenSourceId),Z.isLegacyChrome()&&(t.frameRate=r.frameRate),"Edge"===Z.getBrowserInfo().name&&"object"===t.frameRate&&(t.frameRate.max=60),"Firefox"===Z.getBrowserInfo().name&&(t.frameRate={ideal:30,max:30}),t):t}var Le,Pe=function(e,t){var n=document.createElement("video");if(n.style.visibility="hidden",n.style.zIndex="-1",n.style.width=t.width?t.width+"px":"100%",n.style.height=t.height?t.height+"px":"100%",n.style.position="absolute",n.style.top="0",n.style.left="0",n.controls=!1,n.setAttribute("playsinline","playsinline"),n.style.objectFit="contain",n.autoplay=!0,n.setAttribute("autoplay","autoplay"),n.setAttribute("muted",""),n.muted=!0,"srcObject"in n)n.srcObject instanceof MediaStream&&n.srcObject.getVideoTracks()[0],n.srcObject=e?new MediaStream([e]):null;else{var r=new MediaStream;r.addTrack(e),n.src=window.URL.createObjectURL(r)}return n},Me=function(e,t,n){var r,i;void 0===t&&(t="image/jpeg"),void 0===n&&(n=.4);var o=new ImageData(2,2);if(e){var a=document.createElement("canvas");a.width=null!==(r=e.offsetWidth)&&void 0!==r?r:e.videoWidth,a.height=null!==(i=e.offsetHeight)&&void 0!==i?i:e.offsetHeight;var s=a.getContext("2d");if(!s)return O.error("create canvas context failed!"),{imgData:o,imgUrl:""};s.drawImage(e,0,0,a.width,a.height);var c=s.getImageData(0,0,a.width,a.height);return a.remove(),{imgData:c,imgUrl:a.toDataURL(t,n)}}return{imgData:o,imgUrl:""}},Ue={timestamp:0,bitrate:{actualEncoded:0,transmit:0},videoRecv:[],videoSend:[],audioRecv:[],audioSend:[]};!function(e){e.CERTIFICATE="certificate",e.CODEC="codec",e.CANDIDATE_PAIR="candidate-pair",e.LOCAL_CANDIDATE="local-candidate",e.REMOTE_CANDIDATE="remote-candidate",e.INBOUND="inbound-rtp",e.TRACK="track",e.OUTBOUND="outbound-rtp",e.PC="peer-connection",e.REMOTE_INBOUND="remote-inbound-rtp",e.REMOTE_OUTBOUND="remote-outbound-rtp",e.TRANSPORT="transport",e.CSRC="csrc",e.DATA_CHANNEL="data-channel",e.STREAM="stream",e.SENDER="sender",e.RECEIVER="receiver"}(Le||(Le={}));var Ve,Fe,Be=function(){function e(e,t){var n=this;this._stats={},this.mediaBytesSent=new Map,this.mediaBytesRetransmit=new Map,this.mediaBytesTargetEncode=new Map,this.lastVideoFramesSent=new Map,this.lastDecodeVideoReceiverStats=new Map,this.lastVideoFramesDecode=new Map,this.lastVideoFramesRecv=new Map,this.onFirstVideoDecoded=void 0,this.onFirstVideoReceived=void 0,this.onFirstAudioReceived=void 0,this.onFirstAudioDecoded=void 0;var r=this;this.stats=Object.assign({},Ue),this.isFirstVideoReceived=!1,this.isFirstVideoDecoded=!1,this.isFirstAudioReceived=!1,this.isFirstAudioDecoded=!1,this.pc=e,this.options=t,this.intervalTimer=window.setInterval((function(){return f(n,void 0,void 0,(function(){return m(this,(function(e){switch(e.label){case 0:return[4,r.updateStats()];case 1:return e.sent(),[2]}}))}))}),this.options.updateInterval)}return e.prototype.updateStats=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e;return m(this,(function(r){switch(r.label){case 0:return"closed"===this.pc.connectionState?(this._stats.timestamp=Date.now(),this.stats={},n(),[2]):[4,this.pc.getStats()];case 1:return e=r.sent(),t.report=e,t._stats=Object.assign({},Ue),e.forEach((function(e){switch(e.type){case Le.OUTBOUND:"audio"===e.mediaType?t.processAudioOutboundStats(e):"video"===e.mediaType&&t.processVideoOutboundStats(e);break;case Le.INBOUND:"audio"===e.mediaType?t.processAudioInboundStats(e):"video"===e.mediaType&&t.processVideoInboundStats(e);break;case Le.TRANSPORT:var n=t.report.get(e.selectedCandidatePairId);n&&t.processCandidatePairStats(n);break;case Le.CANDIDATE_PAIR:e.selected&&t.processCandidatePairStats(e)}})),this._stats.timestamp=Date.now(),this.stats=this._stats,n(),[2]}}))}))}))},e.prototype.processAudioOutboundStats=function(e){var t=this._stats.audioSend.find((function(t){return t.ssrc===e.ssrc}));if(t||(this._stats.audioSend.length>=1&&(this._stats.audioSend=[]),t=Object.assign({},{bytes:0,packets:0,packetsLost:0,ssrc:0,rttMs:0}),this._stats.audioSend.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsSent,t.bytes=e.bytesSent,e.mediaSourceId&&this.processAudioMediaSource(e.mediaSourceId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),this.processAudioTrackSenderStats(e,e.trackId,t),e.remoteId)this.processRemoteInboundStats(e.remoteId,t);else{var n=this.findRemoteStatsId(e.ssrc,Le.REMOTE_INBOUND);n&&this.processRemoteInboundStats(n,t)}},e.prototype.processAudioInboundStats=function(e){var t=this._stats.audioRecv.find((function(t){return t.ssrc===e.ssrc}));t||(this._stats.audioRecv.length>=1&&(this._stats.audioRecv=[]),t=Object.assign({},{jitterBufferMs:0,bytes:0,packetsLost:0,packets:0,ssrc:0,receivedFrames:0,droppedFrames:0}),this._stats.audioRecv.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsReceived,t.packetsLost=e.packetsLost,t.bytes=e.bytesReceived,t.jitterBufferMs=1e3*e.jitter,this.processAudioTrackReceiverStats(e,e.trackId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),t.receivedFrames||(t.receivedFrames=e.packetsReceived),t.droppedFrames||(t.droppedFrames=e.packetsLost),0<t.receivedFrames&&!this.isFirstAudioReceived&&(this.onFirstAudioReceived&&this.onFirstAudioReceived(),this.isFirstAudioReceived=!0),t.outputLevel&&0<t.outputLevel&&!this.isFirstAudioDecoded&&(this.onFirstAudioDecoded&&this.onFirstAudioDecoded(),this.isFirstAudioDecoded=!0)},e.prototype.processAudioMediaSource=function(e,t){var n=this.report.get(e);t&&(t.inputLevel=n.audioLevel)},e.prototype.getCodecFromCodecStats=function(e){var t=this.report.get(e);if(!t)return"";var n=t.mimeType.match(/\/(.*)$/);return n&&n[1]?n[1]:""},e.prototype.processAudioTrackSenderStats=function(e,t,n){var r=this.report.get(t)?this.report.get(t):e;r&&(n.aecReturnLoss=r.echoReturnLoss||0,n.aecReturnLossEnhancement=r.echoReturnLossEnhancement||0)},e.prototype.processRemoteInboundStats=function(e,t){var n=this.report.get(e);n&&(t.packetsLost=n.packetsLost,n.roundTripTime&&(t.rttMs=1e3*n.roundTripTime))},e.prototype.findRemoteStatsId=function(e,t){var n=Array.from(this.report.values()).find((function(n){return n.type===t&&n.ssrc===e}));return n?n.id:null},e.prototype.processVideoOutboundStats=function(e){var t=this._stats.videoSend.find((function(t){return t.ssrc===e.ssrc}));t||(this._stats.videoSend.length>=1&&(this._stats.videoSend=[]),t=Object.assign({},{firsCount:0,nacksCount:0,plisCount:0,frameCount:0,bytes:0,packets:0,packetsLost:0,ssrc:0,rttMs:0}),this._stats.videoSend.push(t));var n=this.mediaBytesSent.get(e.ssrc);if(n?n.current=e.bytesSent:this.mediaBytesSent.set(e.ssrc,{current:e.bytesSent}),void 0!==e.retransmittedBytesSent){var r=this.mediaBytesRetransmit.get(e.ssrc);r?r.current=e.retransmittedBytesSent:this.mediaBytesRetransmit.set(e.ssrc,{current:e.retransmittedBytesSent})}if(e.totalEncodedBytesTarget){var i=this.mediaBytesTargetEncode.get(e.ssrc);i?i.current=e.totalEncodedBytesTarget:this.mediaBytesTargetEncode.set(e.ssrc,{current:e.totalEncodedBytesTarget})}if(t.ssrc=e.ssrc,t.bytes=e.bytesSent,t.packets=e.packetsSent,t.firsCount=e.firCount,t.nacksCount=e.nackCount,t.plisCount=e.pliCount,t.frameCount=e.framesEncoded,e.totalEncodeTime&&e.framesEncoded&&(t.avgEncodeMs=1e3*e.totalEncodeTime/e.framesEncoded),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.mediaSourceId&&this.processVideoMediaSource(e.mediaSourceId,t),this.processVideoTrackSenderStats(e,e.trackId,t),e.remoteId)this.processRemoteInboundStats(e.remoteId,t);else{var o=this.findRemoteStatsId(e.ssrc,Le.REMOTE_INBOUND);o&&this.processRemoteInboundStats(o,t)}},e.prototype.processVideoInboundStats=function(e){var t=this._stats.videoRecv.find((function(t){return t.ssrc===e.ssrc}));t||(this._stats.videoRecv.length>=1&&(this._stats.videoRecv=[]),t=Object.assign({},{firsCount:0,nacksCount:0,plisCount:0,framesDecodeCount:0,framesDecodeInterval:0,framesDecodeFreezeTime:0,decodeFrameRate:0,bytes:0,packetsLost:0,packets:0,ssrc:0}),this._stats.videoRecv.push(t)),t.ssrc=e.ssrc,t.packets=e.packetsReceived,t.packetsLost=e.packetsLost,t.bytes=e.bytesReceived,t.firsCount=e.firCount,t.nacksCount=e.nackCount,t.plisCount=e.pliCount,t.framesDecodeCount=e.framesDecoded;var n=this.lastDecodeVideoReceiverStats.get(e.ssrc),r=this.lastVideoFramesDecode.get(e.ssrc),i=Date.now();if(n){var o=n.stats,a=i-n.lts;t.framesDecodeFreezeTime=o.framesDecodeFreezeTime,t.framesDecodeInterval=o.framesDecodeInterval,t.framesDecodeCount>o.framesDecodeCount?(n.lts=Date.now(),t.framesDecodeInterval=a,500<=t.framesDecodeInterval&&(t.framesDecodeFreezeTime+=t.framesDecodeInterval)):t.framesDecodeCount<o.framesDecodeCount&&(t.framesDecodeInterval=0)}if(r&&800<=i-r.lts?(t.decodeFrameRate=Math.round((t.framesDecodeCount-r.count)/((i-r.lts)/1e3)),this.lastVideoFramesDecode.set(t.ssrc,{count:t.framesDecodeCount,lts:i,rate:t.decodeFrameRate})):r?t.decodeFrameRate=r.rate:this.lastVideoFramesDecode.set(t.ssrc,{count:t.framesDecodeCount,lts:i,rate:0}),e.totalDecodeTime&&(t.decodeMs=1e3*e.totalDecodeTime),this.processVideoTrackReceiverStats(e,e.trackId,t),e.codecId&&(t.codec=this.getCodecFromCodecStats(e.codecId)),e.framerateMean&&(t.framesRateFirefox=e.framerateMean),0<t.packets&&!this.isFirstVideoReceived&&(this.onFirstVideoReceived&&this.onFirstVideoReceived(t.receivedFrame?t.receivedFrame.width:0,t.receivedFrame?t.receivedFrame.height:0),this.isFirstVideoReceived=!0),0<t.framesDecodeCount&&!this.isFirstVideoDecoded){var s=t.decodedFrame?t.decodedFrame.width:0,c=t.decodedFrame?t.decodedFrame.height:0;this.onFirstVideoDecoded&&this.onFirstVideoDecoded(s,c),this.isFirstVideoDecoded=!0}this.lastDecodeVideoReceiverStats.set(t.ssrc,{stats:Object.assign({},t),lts:n?n.lts:Date.now()})},e.prototype.processVideoTrackReceiverStats=function(e,t,n){var r=this.report.get(t)?this.report.get(t):e;if(r){var i=this.lastVideoFramesRecv.get(n.ssrc),o=Date.now();n.framesReceivedCount=r.framesReceived;var a=0;i&&800<=o-i.lts?(a=Math.round((r.framesReceived-i.count)/((o-i.lts)/1e3)),this.lastVideoFramesRecv.set(n.ssrc,{count:r.framesReceived,lts:o,rate:a})):i?a=i.rate:this.lastVideoFramesRecv.set(n.ssrc,{count:r.framesReceived,lts:o,rate:0}),n.receivedFrame={width:r.frameWidth||0,height:r.frameHeight||0,frameRate:a||0},n.decodedFrame={width:r.frameWidth||0,height:r.frameHeight||0,frameRate:n.decodeFrameRate||0},n.outputFrame={width:r.frameWidth||0,height:r.frameHeight||0,frameRate:n.decodeFrameRate||0},r.jitterBufferDelay&&r.jitterBufferEmittedCount&&(n.jitterBufferMs=1e3*r.jitterBufferDelay/r.jitterBufferEmittedCount,n.currentDelayMs=1e3*r.jitterBufferDelay/r.jitterBufferEmittedCount)}},e.prototype.processAudioTrackReceiverStats=function(e,t,n){var r=this.report.get(t)?this.report.get(t):e;if(r){n.accelerateRate=r.removedSamplesForAcceleration/r.totalSamplesReceived,n.jitterBufferMs=1e3*r.jitterBufferDelay/r.jitterBufferEmittedCount,n.outputLevel=r.audioLevel;var i=1920;r.totalSamplesDuration&&r.totalSamplesReceived&&(i=r.totalSamplesReceived/r.totalSamplesDuration/50,n.receivedFrames=Math.round(r.totalSamplesReceived/i)),r.concealedSamples&&(n.droppedFrames=Math.round(r.concealedSamples/i))}},e.prototype.processVideoMediaSource=function(e,t){var n=this.report.get(e);n&&(t.inputFrame={width:n.width,height:n.height,frameRate:n.framesPerSecond})},e.prototype.processVideoTrackSenderStats=function(e,t,n){var r=this.report.get(t)?this.report.get(t):e;if(r){var i=0,o=Date.now(),a=this.lastVideoFramesSent.get(n.ssrc);a&&800<=o-a.lts?(i=Math.round((r.framesSent-a.count)/((o-a.lts)/1e3)),this.lastVideoFramesSent.set(n.ssrc,{count:r.framesSent,lts:o,rate:i})):a?i=a.rate:this.lastVideoFramesSent.set(n.ssrc,{count:r.framesSent,lts:o,rate:0}),n.sentFrame={width:r.frameWidth,height:r.frameHeight,frameRate:i}}},e.prototype.processCandidatePairStats=function(e){this._stats.sendBandwidth=e.availableOutgoingBitrate||0,e.currentRoundTripTime&&(this._stats.rtt=1e3*e.currentRoundTripTime),this._stats.videoSend.forEach((function(t){!t.rttMs&&e.currentRoundTripTime&&(t.rttMs=1e3*e.currentRoundTripTime)})),this._stats.audioSend.forEach((function(t){!t.rttMs&&e.currentRoundTripTime&&(t.rttMs=1e3*e.currentRoundTripTime)}))},e.prototype.getStats=function(){return this.stats},e}(),xe=function(){function e(e){this.queues=[],this.maxNumber=1/0,e&&(this.maxNumber=e)}return e.prototype.enqueue=function(e){var t,n,r=[];Array.isArray(e)?r=e:r.push(e);try{for(var i=v(r),o=i.next();!o.done;o=i.next()){var a=o.value;if(this.size+1>this.maxNumber)break;this.queues.push(a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.dequeue=function(){this.queues.length>0&&this.queues.shift()},e.prototype.peek=function(){return this.queues.length>0?this.queues[0]:void 0},e.prototype.clear=function(){this.queues=[]},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.queues.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this.queues.length},enumerable:!1,configurable:!0}),e}();!function(e){e.SERVER_CONNECTION_STATE="server_connection_state",e.AUDIO_SENDING_STOPPED="audio_sending_stopped",e.FIRST_AUDIO_DECODE="first_local_audio",e.FIRST_AUDIO_RECEIVED="first_remote_audio",e.FIRST_VIDEO_DECODE="first_local_frame",e.FIRST_VIDEO_RECEIVED="first_remote_frame",e.JOIN_CHOOSE_SERVER="join_choose_server",e.JOIN_GATEWAY="join_gateway",e.ON_ADD_AUDIO_STREAM="on_add_audio_stream",e.ON_ADD_VIDEO_STREAM="on_add_video_stream",e.ON_REMOVE_STREAM="on_remove_stream",e.ON_UPDATE_STREAM="on_update_stream",e.PUBLISH_AUDIO="publish_audio",e.PUBLISH_VIDEO="publish_video",e.REQUEST_PROXY_APPCENTER="request_proxy_appcenter",e.REQUEST_PROXY_WORKER_MANAGER="request_proxy_worker_manager",e.REQ_USER_ACCOUNT="req_user_account",e.SESSION_INIT="session_init",e.STREAM_SWITCH="stream_switch",e.SUBSCRIBE_AUDIO="subscribe_audio",e.SUBSCRIBE_VIDEO="subscribe_video",e.UN_SUBSCRIBE_AUDIO="unsubscribe_audio",e.UN_SUBSCRIBE_VIDEO="unsubscribe_video",e.VIDEO_SENDING_STOPPED="video_sending_stopped",e.LEAVE="leave",e.AUDIO_ROUTE_CHANGE="audio_route_change",e.VIDEO_PROFILE_CHANGE="video_profile_change",e.VIDEO_LOCAL_DISABLE="video_local_disable",e.AUDIO_LOCAL_DISABLE="audio_local_disable",e.MUTE_LOCAL_VIDEO="mute_local_video",e.MUTE_LOCAL_AUDIO="mute_local_audio",e.REMOTE_SUBSCRIBE_FALLBACK_TO_AUDIO_ONLY="remote_subscribe_fallback_to_audio_only",e.AUDIO_DEVICE_OPEN_RESULT="audio_device_open_result",e.VIDEO_DEVICE_OPEN_RESULT="video_device_open_result",e.ROLE_CHANGE="role_change",e.DISCONNECT_SERVER="disconnect_server"}(Ve||(Ve={})),function(e){e.API_INVOKE="io.artc.pb.Wrtc.ApiInvoke",e.AUDIO_SENDING_STOPPED="io.artc.pb.Wrtc.AudioSendingStopped",e.FIRST_AUDIO_DECODE="io.artc.pb.Wrtc.FirstAudioDecode",e.FIRST_AUDIO_RECEIVED="io.artc.pb.Wrtc.FirstAudioReceived",e.FIRST_VIDEO_DECODE="io.artc.pb.Wrtc.FirstVideoDecode",e.FIRST_VIDEO_RECEIVED="io.artc.pb.Wrtc.FirstVideoReceived",e.JOIN_CHOOSE_SERVER="io.artc.pb.Wrtc.JoinChooseServer",e.JOIN_GATEWAY="io.artc.pb.Wrtc.JoinGateway",e.ON_ADD_AUDIO_STREAM="io.artc.pb.Wrtc.OnAddAudioStream",e.ON_ADD_VIDEO_STREAM="io.artc.pb.Wrtc.OnAddVideoStream",e.ON_REMOVE_STREAM="io.artc.pb.Wrtc.OnRemoveStream",e.ON_UPDATE_STREAM="io.artc.pb.Wrtc.OnUpdateStream",e.PUBLISH_AUDIO="io.artc.pb.Wrtc.PublishAudio",e.PUBLISH_VIDEO="io.artc.pb.Wrtc.PublishVideo",e.REQUEST_PROXY_APPCENTER="io.artc.pb.Wrtc.RequestProxyAppCenter",e.REQUEST_PROXY_WORKER_MANAGER="io.artc.pb.Wrtc.RequestProxyWorkerManager",e.REQ_USER_ACCOUNT="io.artc.pb.Wrtc.ReqUserAccount",e.SESSION="io.artc.pb.Wrtc.Session",e.STREAM_SWITCH="io.artc.pb.Wrtc.StreamSwitch",e.SUBSCRIBE_AUDIO="io.artc.pb.Wrtc.UnSubscribeAudio",e.SUBSCRIBE_VIDEO="io.artc.pb.Wrtc.UnSubscribeVideo",e.UN_SUBSCRIBE_AUDIO="subscribe_audio",e.UN_SUBSCRIBE_VIDEO="subscribe_video",e.SERVER_CONNECTION_STATE="io.artc.pb.Wrtc.ServerState",e.VIDEO_SENDING_STOPPED="io.artc.pb.Wrtc.VideoSendingStopped",e.LEAVE="io.artc.pb.Wrtc.Leave",e.AUDIO_ROUTE_CHANGE="io.artc.pb.Wrtc.AudioRouteChange",e.VIDEO_PROFILE_CHANGE="io.artc.pb.Wrtc.videoProfileChange",e.VIDEO_LOCAL_DISABLE="io.artc.pb.Wrtc.VideoLocalDisable",e.AUDIO_LOCAL_DISABLE="io.artc.pb.Wrtc.AudioLocalDisable",e.MUTE_LOCAL_VIDEO="io.artc.pb.Wrtc.MuteLocalVideo",e.MUTE_LOCAL_AUDIO="io.artc.pb.Wrtc.MuteLocalAudio",e.REMOTE_SUBSCRIBE_FALLBACK_TO_AUDIO_ONLY="io.artc.pb.Wrtc.RemoteSubscribeFallbackToAudioOnly",e.AUDIO_DEVICE_OPEN_RESULT="io.artc.pb.Wrtc.AudioDeviceOpenResult",e.VIDEO_DEVICE_OPEN_RESULT="io.artc.pb.Wrtc.VideoDeviceOpenResult",e.ROLE_CHANGE="io.artc.pb.Wrtc.RoleChange",e.DISCONNECT_SERVER="io.artc.pb.Wrtc.DisconnectServer"}(Fe||(Fe={}));var je={cid:"",cname:"",elapse:0,extend:"",lts:0,sid:"",errorCode:0,uid:""},We=new(function(e){function t(){var t=e.call(this)||this;return t._reportInterval=0,t._url="https://".concat(C.EVENT_REPORT_DOMAIN,"/arapi/v1/events/message"),t._backupUrl="https://".concat(C.EVENT_REPORT_BACKUP_DOMAIN,"/arapi/v1/events/message"),t._reportBaseInfoMap=new Map,t._reportMutex=!1,t._beginStartTime=0,t._http=new Y({url:t._url}),t}return _(t,e),t.prototype._doReport=function(e,t){var n=this;return new Promise((function(r){n._http.post("?eventType=".concat(t.eventType),t).then((function(i){0===i.code?r():setTimeout((function(){return f(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this._doReport(e,t)];case 1:return n.sent(),r(),[2]}}))}))}),1e3)})).catch((function(){setTimeout((function(){return f(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:return[4,this._doReport(e,t)];case 1:return n.sent(),r(),[2]}}))}))}),1e3)}))}))},t.prototype._initBaseInfo=function(e,t){var n=Object.assign({},je);return n.sid=e,this._reportBaseInfoMap.set(e,{info:n,startTime:t}),n},t.prototype.setBasicUrl=function(e,t){if(""===e)this._url="",this._backupUrl="";else{var n=e.concat("/arapi/v1/events/message");if(this._url=n,t){var r=t.concat("/arapi/v1/events/message");this._backupUrl=r}}},t.prototype.setup=function(){var e=this;this._reportInterval&&clearInterval(this._reportInterval),this._reportInterval=window.setInterval((function(){if(!(e.size<=0||e._reportMutex)){var t=e.peek();if(e._reportMutex=!0,t){var n={};t.data.apiName?n.apiName=t.data.apiName:t.data.eventType&&(n.eventType=t.data.eventType);var r=new URLSearchParams(n).toString(),i=~e._url.indexOf("?")?e._url.concat(r):e._url.concat("?").concat(r);e._doReport(i,t.data).then((function(){e.dequeue(),e._reportMutex=!1}))}}}),1e3)},t.prototype.sessionInit=function(e,t){var n=Date.now(),r=this._initBaseInfo(e,n);r.cname=t.cname,r.cid=t.cid,r.uid=t.uid;var i=Date.now(),o=Object.assign({},{willUploadConsoleLog:C.UPLOAD_LOG},t.extend),a=h(h({},r),{eventType:Ve.SESSION_INIT,appid:t.appid,build:"",lts:i,elapse:i-n,eventElapse:i-n,extend:o?JSON.stringify(o):o,mode:t.mode,role:"host"===t.role?1:2,process:C.PROCESS_ID,errorCode:t.errorCode,os:3,osVersion:"",deviceType:navigator.userAgent,netType:0,netOperator:"",sdkVersion:C.SDK_VERSION,eventBType:1});this.enqueue({type:Fe.SESSION,data:a})},t.prototype.chooseServer=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.JOIN_CHOOSE_SERVER,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:t.errorCode,chooseServerAddr:t.chooseServer?JSON.stringify(t.chooseServer):"",chooseServerAddrList:t.serverList?JSON.stringify(t.serverList):"",eventBType:1});this.enqueue({type:Fe.JOIN_CHOOSE_SERVER,data:a})}},t.prototype.joinGateway=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n.info.uid=t.uid,n.info.cid=t.cid,n.startTime=t.joinStartTime,n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.JOIN_GATEWAY,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:t.errorCode,eventBType:1});this.enqueue({type:Fe.JOIN_GATEWAY,data:a})}},t.prototype.publishAudio=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.PUBLISH_AUDIO,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,audioName:t.microphoneDeviceId,eventBType:1});this.enqueue({type:Fe.PUBLISH_AUDIO,data:a})}},t.prototype.publishVideo=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.PUBLISH_VIDEO,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,videoName:t.cameraDeviceId,eventBType:1});this.enqueue({type:Fe.PUBLISH_VIDEO,data:a})}},t.prototype.subscribeAudio=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.SUBSCRIBE_AUDIO,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,peer:t.peerid,audio:!0,eventBType:1});this.enqueue({type:Fe.SUBSCRIBE_AUDIO,data:a})}},t.prototype.subscribeVideo=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.SUBSCRIBE_VIDEO,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,peer:t.peerid,video:!0,eventBType:1});this.enqueue({type:Fe.SUBSCRIBE_VIDEO,data:a})}},t.prototype.unsubscribeAudio=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.UN_SUBSCRIBE_AUDIO,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,peer:t.peerid,audio:!0,eventBType:1});this.enqueue({type:Fe.UN_SUBSCRIBE_AUDIO,data:a})}},t.prototype.unsubscribeVideo=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.UN_SUBSCRIBE_VIDEO,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,peer:t.peerid,video:!0,eventBType:1});this.enqueue({type:Fe.UN_SUBSCRIBE_VIDEO,data:a})}},t.prototype.serverConnectionState=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.SERVER_CONNECTION_STATE,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o,errorCode:0,eventBType:1});this.enqueue({type:Fe.SERVER_CONNECTION_STATE,data:a})}},t.prototype.firstRemoteFrame=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.FIRST_VIDEO_RECEIVED,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:0,peer:t.peerid,eventBType:1});this.enqueue({type:Fe.FIRST_VIDEO_RECEIVED,data:a})}},t.prototype.firstRemoteAudio=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.FIRST_AUDIO_RECEIVED,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:0,peer:t.peerid,eventBType:1});this.enqueue({type:Fe.FIRST_VIDEO_RECEIVED,data:a})}},t.prototype.firstLocalFrame=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.FIRST_VIDEO_RECEIVED,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:0,peer:t.peerid,eventBType:1});this.enqueue({type:Fe.FIRST_VIDEO_RECEIVED,data:a})}},t.prototype.firstLocalAudio=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.FIRST_AUDIO_DECODE,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:0,peer:t.peerid,eventBType:1});this.enqueue({type:Fe.FIRST_AUDIO_DECODE,data:a})}},t.prototype.firstLocalVideo=function(){},t.prototype.leave=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.LEAVE,lts:i,elapse:i-n.startTime,eventElapse:i-t.startTime,extend:o?JSON.stringify(o):o,errorCode:0,eventBType:1});this.enqueue({type:Fe.LEAVE,data:a})}},t.prototype.audioRouteChange=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.AUDIO_ROUTE_CHANGE,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,errorCode:t.errorCode,eventBType:2});this.enqueue({type:Fe.AUDIO_ROUTE_CHANGE,data:a})}},t.prototype.videoProfileChange=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.VIDEO_PROFILE_CHANGE,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,eventBType:3});this.enqueue({type:Fe.VIDEO_PROFILE_CHANGE,data:a})}},t.prototype.videoLocalDisable=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.VIDEO_LOCAL_DISABLE,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,eventBType:3});this.enqueue({type:Fe.VIDEO_LOCAL_DISABLE,data:a})}},t.prototype.audioLocalDisable=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.AUDIO_LOCAL_DISABLE,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,eventBType:3});this.enqueue({type:Fe.AUDIO_LOCAL_DISABLE,data:a})}},t.prototype.muteLocalVideo=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.MUTE_LOCAL_VIDEO,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,eventBType:3});this.enqueue({type:Fe.MUTE_LOCAL_VIDEO,data:a})}},t.prototype.muteLocalAudio=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.MUTE_LOCAL_AUDIO,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,eventBType:3});this.enqueue({type:Fe.MUTE_LOCAL_AUDIO,data:a})}},t.prototype.remoteSubscribeFallbackToAudioOnly=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.REMOTE_SUBSCRIBE_FALLBACK_TO_AUDIO_ONLY,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,errorCode:0,eventBType:3});this.enqueue({type:Fe.REMOTE_SUBSCRIBE_FALLBACK_TO_AUDIO_ONLY,data:a})}},t.prototype.roleChange=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.ROLE_CHANGE,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,cname:t.cname,errorCode:0,eventBType:3});this.enqueue({type:Fe.ROLE_CHANGE,data:a})}},t.prototype.disconnectServer=function(e,t){var n=this._reportBaseInfoMap.get(e);if(n){var r=n.info,i=Date.now(),o=JSON.stringify(t.extend),a=Object.assign({},r,{eventType:Ve.DISCONNECT_SERVER,lts:i,elapse:i-n.startTime,extend:o?JSON.stringify(o):o,errorCode:0,eventBType:3});this.enqueue({type:Fe.DISCONNECT_SERVER,data:a})}},t}(xe));var Ge,He=function(e){function t(t,n){var r=e.call(this)||this;return r.ID="",r.type="pub",r.videoEncoderConfig={},r.audioEncoderConfig={},r.joinInfo={},r.audioTrack=null,r.videoTrack=null,r.audioSender=null,r.videoSender=null,r.mediaStream=new MediaStream,r.localCandidateCount=0,r.ID=t,r.type=n,r.offerOptions={offerToReceiveAudio:!0,offerToReceiveVideo:!0},r.pc=r.createPeerConnection(),r.statsFilter=function(e,t){void 0===t&&(t=100);var n=navigator.userAgent.toLocaleLowerCase().match(/chrome\/?\s*(\d+)/i),r=n&&n[0]?Number(n[0].split("/")[1]):null;return r?r<76?null:new Be(e,{updateInterval:t}):window.RTCStatsReport&&e.getStats()instanceof Promise?new Be(e,{updateInterval:t}):null}(r.pc,1e3),r.statsFilter&&(r.statsFilter.onFirstVideoDecoded=function(e,t){},r.statsFilter.onFirstVideoReceived=function(e,t){var n=Date.now();We.firstRemoteFrame(r.joinInfo.sid,{startTime:n,extend:{width:e,height:t},peerid:r.ID})},r.statsFilter.onFirstAudioDecoded=function(){},r.statsFilter.onFirstAudioReceived=function(){var e=Date.now();We.firstRemoteAudio(r.joinInfo.sid,{startTime:e,extend:null,peerid:r.ID})}),r}return _(t,e),Object.defineProperty(t.prototype,"audioSenderOk",{get:function(){var e=this.pc.getTransceivers().find((function(e){return"audio"===e.mid}));return this.audioSender&&e&&"inactive"!==e.currentDirection},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoSenderOk",{get:function(){var e=this.pc.getTransceivers().find((function(e){return"video"===e.mid}));return this.videoSender&&e&&"inactive"!==e.currentDirection},enumerable:!1,configurable:!0}),t.prototype.createPeerConnection=function(){var e=this,t=this,n=new RTCPeerConnection({iceServers:[],iceTransportPolicy:"all"});return n.oniceconnectionstatechange=function(r){O.info("[".concat(e.joinInfo.clientId,"-").concat(e.type,"] ice-state: ").concat(e.type," p2p ").concat(n.iceConnectionState)),t.emit(F.ICE_CONNECTION_STATE_CHANGE,n.iceConnectionState)},n.onconnectionstatechange=function(r){O.debug("[".concat(e.joinInfo.clientId,"-").concat(e.type,"] connection-state: ").concat(e.type," p2p ").concat(n.connectionState)),t.emit(F.CONNECTION_STATE_CHANGE,n.connectionState)},n.onicecandidate=function(n){if(n.candidate){var r={candidate:n.candidate.candidate,sdpMLineIndex:n.candidate.sdpMLineIndex,sdpMid:n.candidate.sdpMid};e.localCandidateCount+=1,t.emit(F.ICE_CANDIDATE,JSON.stringify(r))}else O.debug("[pc-".concat(e.type,"-").concat(e.ID,"] local candidate count"),e.localCandidateCount)},n.onicecandidateerror=function(t){t&&O.debug("[pc-".concat(e.type,"-").concat(e.ID,"] ice candidate error ").concat(t.url,", code: ").concat(t.errorCode,", ").concat(t.errorText))},n.ontrack=function(e){t.emit(F.TRACK_ADDED,e.track)},n},t.prototype.close=function(){this.pc&&this.pc.close()},t.prototype.getVideoSender=function(){return this.pc.getSenders().find((function(e){var t;return"video"===(null===(t=null==e?void 0:e.track)||void 0===t?void 0:t.kind)||!e.dtmf}))},t.prototype.getAudioSender=function(){return this.pc.getSenders().find((function(e){var t;return"audio"===(null===(t=null==e?void 0:e.track)||void 0===t?void 0:t.kind)||!!e.dtmf}))},t.prototype.getSenders=function(){return"pub"===this.type||"pubEx"===this.type?this.pc.getSenders():this.pc.getReceivers()},t.prototype.getStats=function(){var e;return null===(e=this.statsFilter)||void 0===e?void 0:e.getStats()},t.prototype.getSendTransceivers=function(){return this.pc.getTransceivers().filter((function(e){return"sendrecv"===e.direction&&"sendonly"===e.currentDirection}))},t.prototype.createAnswer=function(e,t){return void 0===t&&(t=!1),f(this,void 0,void 0,(function(){var n,r,i,o=this;return m(this,(function(a){switch(a.label){case 0:return n=JSON.parse(e),Object.keys(this.videoEncoderConfig).length>0&&(this.videoEncoderConfig.bitrateMax&&(n.sdp=(s=n.sdp,c=this.videoEncoderConfig.bitrateMax,d="AS","firefox"===Z.getBrowserInfo().name&&(c=1e3*(c>>>0),d="TIAS"),-1===s.indexOf("b="+d+":")?s.replace(/c=IN (.*)\r\n/,"c=IN $1\r\nb="+d+":"+c+"\r\n"):s.replace(new RegExp("b="+d+":.*\r\n"),"b="+d+":"+c+"\r\n"))),this.videoEncoderConfig.bitrateMin&&"pub"===this.type&&Z.isChrome&&((r=n.sdp.split("\r\n")).forEach((function(e,t){/^a=fmtp:\d*/.test(e)&&(r[t].includes("x-google-min-bitrate")||(r[t]="".concat(e,";x-google-min-bitrate=").concat(o.videoEncoderConfig.bitrateMin,";")))})),n.sdp=r.join("\r\n"))),[4,this.pc.setRemoteDescription(new RTCSessionDescription(n))];case 1:return a.sent(),[4,this.pc.createAnswer(t?{iceRestart:t}:{})];case 2:return i=a.sent(),this.pc.setLocalDescription(i),O.debug("[".concat(this.type,"] set answer success")),[2,JSON.stringify(i)]}var s,c,d}))}))},t.prototype.setIceCandidate=function(e){if(this.pc){var t=JSON.parse(e),n=t.sdpMLineIndex,r=t.candidate,i=new RTCIceCandidate({sdpMLineIndex:n,candidate:r});this.pc.addIceCandidate(i)}},t.prototype.setRtpSenderParameters=function(e,t){return f(this,void 0,void 0,(function(){var e,n,r,i;return m(this,(function(o){switch(o.label){case 0:if(!(e=this.videoSender).getParameters)return[3,4];(n=e.getParameters()).degradationPreference=t,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,e.setParameters(n)];case 2:return o.sent(),[3,4];case 3:return r=o.sent(),i=r,O.debug("[".concat(this.ID,"] ignore RtpSender.setParameters"),i.toString()),[3,4];case 4:return[2]}}))}))},t.prototype.updateBandWidth=function(e){var t=this;return new Promise((function(e,n){return f(t,void 0,void 0,(function(){return m(this,(function(t){try{e()}catch(e){n(e)}return[2]}))}))}))},t.prototype._mungeSdpForSimulcasting=function(e){for(var t=e.split("\r\n"),n=!1,r=[-1],i=[-1],o=null,a=null,s=null,c=null,d=-1,u=0;u<t.length;u++){if(p=t[u].match(/m=(\w+) */)){if("video"===p[1]){if(!(r[0]<0)){d=u;break}n=!0}else if(r[0]>-1){d=u;break}}else if(n){var l=t[u].match(/a=ssrc-group:FID (\d+) (\d+)/);if(l)r[0]=l[1],i[0]=l[2],t.splice(u,1),u--;else{if(r[0]){if((h=t[u].match("a=ssrc:"+r[0]+" cname:(.+)"))&&(o=h[1]),(h=t[u].match("a=ssrc:"+r[0]+" msid:(.+)"))&&(a=h[1]),(h=t[u].match("a=ssrc:"+r[0]+" mslabel:(.+)"))&&(s=h[1]),(h=t[u].match("a=ssrc:"+r[0]+" label:(.+)"))&&(c=h[1]),0===t[u].indexOf("a=ssrc:"+i[0])){t.splice(u,1),u--;continue}if(0===t[u].indexOf("a=ssrc:"+r[0])){t.splice(u,1),u--;continue}}0!==t[u].length||(t.splice(u,1),u--)}}}if(r[0]<0){d=-1,n=!1;for(u=0;u<t.length;u++){var p;if(p=t[u].match(/m=(\w+) */)){if("video"===p[1]){if(!(r[0]<0)){d=u;break}n=!0}else if(r[0]>-1){d=u;break}}else if(n){if(r[0]<0){var _=t[u].match(/a=ssrc:(\d+)/);if(_){r[0]=_[1],t.splice(u,1),u--;continue}}else{var h;if((h=t[u].match("a=ssrc:"+r[0]+" cname:(.+)"))&&(o=h[1]),(h=t[u].match("a=ssrc:"+r[0]+" msid:(.+)"))&&(a=h[1]),(h=t[u].match("a=ssrc:"+r[0]+" mslabel:(.+)"))&&(s=h[1]),(h=t[u].match("a=ssrc:"+r[0]+" label:(.+)"))&&(c=h[1]),0===t[u].indexOf("a=ssrc:"+i[0])){t.splice(u,1),u--;continue}if(0===t[u].indexOf("a=ssrc:"+r[0])){t.splice(u,1),u--;continue}}0!==t[u].length||(t.splice(u,1),u--)}}}if(r[0]<0)return e;d<0&&(d=t.length),r[1]=Math.floor(4294967295*Math.random()),r[2]=Math.floor(4294967295*Math.random()),i[1]=Math.floor(4294967295*Math.random()),i[2]=Math.floor(4294967295*Math.random());for(u=0;u<r.length;u++)o&&(t.splice(d,0,"a=ssrc:"+r[u]+" cname:"+o),d++),a&&(t.splice(d,0,"a=ssrc:"+r[u]+" msid:"+a),d++),s&&(t.splice(d,0,"a=ssrc:"+r[u]+" mslabel:"+s),d++),c&&(t.splice(d,0,"a=ssrc:"+r[u]+" label:"+c),d++),o&&(t.splice(d,0,"a=ssrc:"+i[u]+" cname:"+o),d++),a&&(t.splice(d,0,"a=ssrc:"+i[u]+" msid:"+a),d++),s&&(t.splice(d,0,"a=ssrc:"+i[u]+" mslabel:"+s),d++),c&&(t.splice(d,0,"a=ssrc:"+i[u]+" label:"+c),d++);return t.splice(d,0,"a=ssrc-group:FID "+r[2]+" "+i[2]),t.splice(d,0,"a=ssrc-group:FID "+r[1]+" "+i[1]),t.splice(d,0,"a=ssrc-group:FID "+r[0]+" "+i[0]),t.splice(d,0,"a=ssrc-group:SIM "+r[0]+" "+r[1]+" "+r[2]),(e=t.join("\r\n")).endsWith("\r\n")||(e+="\r\n"),e},t}(x),Ke=function(){var e,t;if(!ve){var n=document.createElement("canvas");if(n.width=16,n.height=16,null===(t=n.getContext("2d"))||void 0===t||t.fillRect(0,0,n.width,n.height),e=E(n.captureStream().getTracks(),1),!(ve=e[0]))throw Error("Could not get empty media stream video track");ve.enabled=!1}return ve}(),Je=function(){var e;if(!Ee){var t=new AudioContext,n=t.createOscillator(),r=t.createMediaStreamDestination();if(n.connect(r),n.start(),e=E(r.stream.getAudioTracks(),1),!(Ee=e[0]))throw Error("Could not get empty media stream audio track");Ee.enabled=!1}return Ee}(),Ye=function(e){function t(t,n){var r=e.call(this,t,"pub")||this;return r.joinInfo=n,r}return _(t,e),t.prototype.initTracks=function(){this.addTrack(Ke,{}),this.addTrack(Je,{})},t.prototype.getVideoTrack=function(){return this.videoTrack},t.prototype.getAudioTrack=function(){return this.audioTrack},t.prototype.addTrack=function(e,t){var n=this;return new Promise((function(t,r){return f(n,void 0,void 0,(function(){return m(this,(function(n){return e instanceof MediaStreamTrack?(this.mediaStream.getTracks().find((function(t){return t===e}))||(this.mediaStream.addTrack(e),"audio"===e.kind?(this.audioTrack=e,this.audioSender?this.replaceTrack(e):this.audioSender=this.pc.addTrack(e,this.mediaStream)):(this.videoTrack=e,this.videoSender?this.replaceTrack(e):this.videoSender=this.pc.addTrack(e,this.mediaStream))),O.info("[".concat(this.joinInfo.clientId,"-pub] add ").concat(e.kind," track to pc.")),t(),[2]):[2]}))}))}))},t.prototype.removeTrack=function(e){var t=this;this.mediaStream.getTracks().find((function(t){return t===e}))&&("audio"===e.kind?(this.pc.removeTrack(this.audioSender),console.log("this.mediaStream.... audio",this.mediaStream.getTracks()),this.mediaStream.getAudioTracks().forEach((function(e){t.mediaStream.removeTrack(e)})),console.log("this.mediaStream.... audio 1",this.mediaStream.getTracks()),this.addTrack(Je,{})):(this.pc.removeTrack(this.videoSender),this.mediaStream.getVideoTracks().forEach((function(e){t.mediaStream.removeTrack(e)})),this.addTrack(Ke,{})))},t.prototype.replaceTrack=function(e,t){if(me.supportUnifiedPlan){var n=this.pc.getTransceivers().find((function(t){return e.kind===t.mid}));O.info("[".concat(this.joinInfo.clientId,"-pub] replace ").concat(e.kind," to pc.")),null==n||n.sender.replaceTrack(e)}},t}(He),ze=function(e){function t(t,n){var r=e.call(this,t,"pubEx")||this;return r.joinInfo=n,r}return _(t,e),t.prototype.addTrack=function(e,t){e instanceof MediaStreamTrack&&(this.mediaStream.getTracks().find((function(t){return t===e}))||(this.mediaStream.addTrack(e),"video"===e.kind&&(this.videoTrack=e,this.videoSender?this.replaceTrack(e):this.videoSender=this.pc.addTrack(e,this.mediaStream))),"video"===e.kind&&(this.videoEncoderConfig=t))},t.prototype.removeTrack=function(e){this.mediaStream.getTracks().find((function(t){return t===e}))&&("video"===e.kind&&(this.pc.removeTrack(this.videoSender),this.videoTrack=null),this.mediaStream.removeTrack(e))},t.prototype.replaceTrack=function(e,t){if(me.supportUnifiedPlan){var n=this.pc.getTransceivers().find((function(t){return e.kind===t.mid}));null==n||n.sender.replaceTrack(e)}},t}(He),Qe=function(e){function t(t,n){var r=e.call(this,t,"sub")||this;return r.isLowStreamConnection=!1,r.joinInfo=n,r}return _(t,e),t}(He),qe=new(function(){function e(){this.onAutoplayFailed=function(){},this.elementMap=new Map,this.elementsNeedToResume=[],this.autoResumeAudioElement()}return e.prototype.setSinkID=function(e,t){var n=this;return new Promise((function(r,i){return f(n,void 0,void 0,(function(){var n,o;return m(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),(n=this.elementMap.get(e))?[4,n.setSinkId(t)]:[3,2];case 1:return a.sent(),r(),[3,3];case 2:throw new J("UNEXPECTED_ERROR","can not find element to set sink id");case 3:return[3,5];case 4:return o=a.sent(),i(o),[3,5];case 5:return[2]}}))}))}))},e.prototype.play=function(e,t){var n=this,r=this;if(!this.elementMap.has(t)){var i=document.createElement("audio");i.autoplay=!0,i.srcObject=new MediaStream([e]),this.elementMap.set(t,i);var o=i.play();o instanceof Promise&&o.catch((function(e){r.elementMap.has(t)&&"NotAllowedError"===e.name&&(O.warning("detected audio element autoplay failed"),r.elementsNeedToResume.push(i),n.onAutoplayFailed&&n.onAutoplayFailed())}))}},e.prototype.updateTrack=function(e,t){var n=this.elementMap.get(e);n&&(n.srcObject=new MediaStream([t]))},e.prototype.isPlaying=function(e){return this.elementMap.has(e)},e.prototype.setVolume=function(e,t){var n=this.elementMap.get(e);n&&(t=Math.max(0,Math.min(100,t)),n.volume=t/100)},e.prototype.stop=function(e){var t=this.elementMap.get(e);if(t){var n=this.elementsNeedToResume.indexOf(t);this.elementsNeedToResume.splice(n,1),t.srcObject=null,t.remove(),this.elementMap.delete(e)}},e.prototype.autoResumeAudioElement=function(){var e=this;function t(){e.elementsNeedToResume.forEach((function(e){e.play().then((function(e){O.debug("Auto resume audio element success")})).catch((function(e){O.warning("Auto resume audio element failed!",e)}))})),e.elementsNeedToResume=[]}new Promise((function(e){document.body?e():window.addEventListener("load",(function(){return e()}))})).then((function(){document.body.addEventListener("touchstart",t,!0),document.body.addEventListener("mousedown",t,!0)}))},e}()),Xe=function(e){function t(){var t=e.call(this)||this;return t.isPlayed=!1,t.updateAudioOutputLevelInterval=0,t.mediaDestNode=void 0,t.outputTrack=void 0,t.audioBufferNode=void 0,t.isPlayed=!1,t.audioLevelBase=0,t.audioOutputLevel=0,t.audioOutputLevelCache=null,t.audioOutputLevelCacheMaxLength=7.5,t.isDestroyed=!1,t._noAudioInputCount=0,t.context=pe(),t.destNode=t.context.destination,t.gainNode=t.context.createGain(),t.analyserNode=t.context.createAnalyser(),t}return _(t,e),t.prototype.startGetAudioBuffer=function(e){this.audioBufferNode||(this.audioBufferNode=this.context.createScriptProcessor(e),this.gainNode.connect(this.audioBufferNode),this.audioBufferNode.connect(this.context.destination),this.audioBufferNode.onaudioprocess=function(e){})},t.prototype.stopGetAudioBuffer=function(){this.audioBufferNode&&(this.audioBufferNode.onaudioprocess=null,this.gainNode.disconnect(this.audioBufferNode),this.audioBufferNode=void 0)},t.prototype.createOutputTrack=function(){if(!me.webAudioMediaStreamDest)throw new J("NOT_SUPPORT your browser is not support audio processor");return this.mediaDestNode&&this.outputTrack||(this.mediaDestNode=this.context.createMediaStreamDestination(),this.gainNode.connect(this.mediaDestNode),this.outputTrack=this.mediaDestNode.stream.getAudioTracks()[0]),this.outputTrack},t.prototype.play=function(e){"running"!==this.context.state&&qe.onAutoplayFailed&&qe.onAutoplayFailed(),this.isPlayed=!0,this.destNode=e||this.context.destination,this.gainNode.connect(this.destNode)},t.prototype.stop=function(){if(this.isPlayed)try{this.gainNode.disconnect(this.destNode)}catch(e){}this.isPlayed=!1},t.prototype.getAudioLevel=function(){return this.audioOutputLevel},t.prototype.getAudioAvgLevel=function(){var e,t,n;return null===this.audioOutputLevelCache&&(this.audioOutputLevelCache=[this.audioOutputLevel]),(t=e=this.audioOutputLevelCache,n=t.reduce,t===Array.prototype||t instanceof Array&&n===Array.prototype.reduce?{}.ArrayPrototype.reduce:n).call(e,(function(e,t){return e+t}))/this.audioOutputLevelCache.length},t.prototype.getAudioVolume=function(){return this.gainNode.gain.value},t.prototype.setVolume=function(e){this.gainNode.gain.setValueAtTime(e/100,this.context.currentTime)},t.prototype.setMute=function(e){e?(this.disconnect(),this.audioLevelBase=0,this.audioOutputLevel=0):this.connect()},t.prototype.destroy=function(){this.disconnect(),this.stop(),this.isDestroyed=!0,this.onNoAudioInput=void 0},t.prototype.disconnect=function(){this.sourceNode&&this.sourceNode.disconnect(),this.gainNode&&this.gainNode.disconnect(),clearInterval(this.updateAudioOutputLevelInterval)},t.prototype.connect=function(){this.sourceNode&&this.sourceNode.connect(this.gainNode),this.gainNode.connect(this.analyserNode),this.updateAudioOutputLevelInterval=window.setInterval(this.updateAudioOutputLevel.bind(this),400)},t.prototype.updateAudioOutputLevel=function(){var e,t;if(this.analyserNode){var n=void 0;if(this.analyserNode.getFloatTimeDomainData)n=new Float32Array(this.analyserNode.frequencyBinCount),this.analyserNode.getFloatTimeDomainData(n);else{n=new Uint8Array(this.analyserNode.frequencyBinCount),this.analyserNode.getByteTimeDomainData(n);var r=!0,i=Array.from(n).map((function(e){return 128!==e&&(r=!1),.0078125*(e-128)}));n=new Float32Array(i),r?this.noAudioInputCount+=1:this.noAudioInputCount=0}try{for(var o=v(n),a=o.next();!a.done;a=o.next()){var s=a.value;Math.abs(s)>this.audioLevelBase&&(this.audioLevelBase=Math.abs(s),1<this.audioLevelBase&&(this.audioLevelBase=1))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.audioOutputLevel=this.audioLevelBase,this.audioLevelBase=this.audioLevelBase/4,null!==this.audioOutputLevelCache&&(this.audioOutputLevelCache.push(this.audioOutputLevel),this.audioOutputLevelCache.length>this.audioOutputLevelCacheMaxLength&&this.audioOutputLevelCache.shift())}},t.prototype.isNoAudioInput=function(){return 3<=this.noAudioInputCount},Object.defineProperty(t.prototype,"noAudioInputCount",{get:function(){return this._noAudioInputCount},set:function(e){this._noAudioInputCount<3&&3<=e?this.onNoAudioInput&&this.onNoAudioInput():3<=this._noAudioInputCount&&this._noAudioInputCount%10==0&&this.onNoAudioInput&&this.onNoAudioInput(),this._noAudioInputCount=e},enumerable:!1,configurable:!0}),t}(x),Ze=new x,$e=function(e){function t(n,r){var i=e.call(this)||this;if(!(i instanceof t))throw new TypeError("Cannot call a class as a function");if(i.isCurrentTrackCloned=!1,i.isRemoteTrack=!1,i.noSoundTime=0,i.lastNoSoundTime=0,i.rebuildWebAudio=function(){if(!i.isNoAudioInput||i.isDestroyed)return document.body.removeEventListener("click",i.rebuildWebAudio,!0),void O.debug("rebuild web audio success, current volume",i.getAudioLevel());i.context.resume().then((function(){return O.info("context resume success")})),O.debug("rebuild web audio because of ios 12 bugs"),i.disconnect();var e=i.track;i.track=i.track.clone(),i.isCurrentTrackCloned?e.stop():i.isCurrentTrackCloned=!0;var t=new MediaStream([i.track]);i.sourceNode=i.context.createMediaStreamSource(t),i.analyserNode=i.context.createAnalyser();var n=i.gainNode.gain.value;i.gainNode=i.context.createGain(),i.gainNode.gain.setValueAtTime(n,i.context.currentTime),i.connect(),i.audioElement.srcObject=t,i.isPlayed&&i.play(i.destNode)},"audio"!==n.kind)throw new J("UNEXPECTED_ERROR");i.track=n;var o=new MediaStream([i.track]);return i.isRemoteTrack=!!r,i.sourceNode=i.context.createMediaStreamSource(o),i.connect(),i.audioElement=document.createElement("audio"),i.audioElement.srcObject=o,r&&Z.getBrowserInfo().os===z.IOS&&(Ze.on("state-change",i.rebuildWebAudio),i.onNoAudioInput=function(){document.body.addEventListener("click",this.rebuildWebAudio,!0),this.rebuildWebAudio(),document.body.click()}),i}return _(t,e),t.prototype.updateTrack=function(e){this.sourceNode.disconnect(),this.track=e,this.isCurrentTrackCloned=!1;var t=new MediaStream([e]);this.sourceNode=this.context.createMediaStreamSource(t),this.sourceNode.connect(this.gainNode),this.audioElement.srcObject=t},t.prototype.destroy=function(){this.audioElement.remove(),Ze.off("state-change",this.rebuildWebAudio),this.scriptProcessor&&(this.scriptProcessor.onaudioprocess=null,this.scriptProcessor=void 0),this.noSoundTimeResetInterval&&(window.clearInterval(this.noSoundTimeResetInterval),this.noSoundTimeResetInterval=void 0),this.disconnect(),this.stop(),this.isDestroyed=!0,this.onNoAudioInput=void 0},t.prototype.onScriptProcess=function(e){var t=performance.now?performance.now():Date.now();if(function(e){for(var t=0;t<e.outputBuffer.numberOfChannels;t+=1)for(var n=e.outputBuffer.getChannelData(t),r=0;r<n.length;r+=1)n[r]=0;e.inputBuffer}(e),!this.lastBufferTime)return this.emit("receive_track_buffer"),void(this.lastBufferTime=t);var n=1e3*e.inputBuffer.duration,r=t-this.lastBufferTime,i=1e3*function(e){var n,i,o=e.getChannelData(0),a=0,s=0;try{for(var c=v(o),d=c.next();!d.done;d=c.next()){0===d.value?s<(a+=1)&&(s=a):a=0}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}return r/t.length*e.duration}(e.inputBuffer);this.noSoundTime+=r-n+i,this.lastBufferTime=t},Object.defineProperty(t.prototype,"isFreeze",{get:function(){return 100<this.lastNoSoundTime},enumerable:!1,configurable:!0}),t}(Xe);!function(e){e.IDLE="IDLE",e.INITING="INITING",e.INITEND="INITEND"}(Ge||(Ge={}));var et,tt=new(function(e){function t(){var t=e.call(this)||this;t.deviceInfoMap=new Map,t.accessMicrophonePermission=!1,t.accessCameraPermission=!1;var n=t;return n.init().then((function(){navigator.mediaDevices&&navigator.mediaDevices.addEventListener&&navigator.mediaDevices.addEventListener("devicechange",n.updateDevicesInfo.bind(n)),window.setInterval(n.updateDevicesInfo.bind(n),5e3)})),t}return _(t,e),t.prototype._checkMediaDeviceInfoIsOk=function(e){var t,n,r,i,o=e.filter((function(e){return"audioinput"===e.kind})),a=e.filter((function(e){return"videoinput"===e.kind})),s={audio:!1,video:!1};try{for(var c=v(o),d=c.next();!d.done;d=c.next()){var u=d.value;if(u.label&&u.deviceId){s.audio=!0;break}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}try{for(var l=v(a),p=l.next();!p.done;p=l.next()){var _=p.value;if(_.label&&_.deviceId){s.video=!0;break}}}catch(e){r={error:e}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s},t.prototype.enumerateDevices=function(e,t,n){var r=this;return new Promise((function(i,o){return f(r,void 0,void 0,(function(){var r,a,s,d,u,l,p,_,h,f,v,E,S,T;return m(this,(function(m){switch(m.label){case 0:return m.trys.push([0,21,,22]),navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices?[4,navigator.mediaDevices.enumerateDevices()]:[3,19];case 1:if(a=m.sent(),s=this._checkMediaDeviceInfoIsOk(a),d=s.audio,u=s.video,l=!this.accessMicrophonePermission&&e,p=!this.accessCameraPermission&&t,d&&(l=!1),u&&(p=!1),n||!l&&!p)return[3,17];if(O.debug("[device manager] check media permission",e,t,l,p),Te&&(p=!1,this.accessCameraPermission=!0),Ie&&(l=!1,this.accessMicrophonePermission=!0),!l||!p)return[3,6];m.label=2;case 2:return m.trys.push([2,4,,5]),[4,navigator.mediaDevices.getUserMedia({audio:!0,video:!0})];case 3:return r=m.sent(),[3,5];case 4:if(_=m.sent(),(E=ye((v=_).name||v.code||v,v.message)).code===te.TrackErrorCode.PERMISSION_DENIED)throw E;return O.warning("getUserMedia failed in getDevices",E),[3,5];case 5:return this.accessMicrophonePermission=this.accessCameraPermission=!0,[3,16];case 6:if(!l)return[3,11];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,navigator.mediaDevices.getUserMedia({audio:e})];case 8:return r=m.sent(),[3,10];case 9:if(h=m.sent(),(E=ye((v=h).name||v.code||v,v.message)).code===te.TrackErrorCode.PERMISSION_DENIED)throw E;return O.warning("getUserMedia failed in getDevices",E),[3,10];case 10:return this.accessMicrophonePermission=!0,[3,16];case 11:if(!p)return[3,16];m.label=12;case 12:return m.trys.push([12,14,,15]),[4,navigator.mediaDevices.getUserMedia({video:t})];case 13:return r=m.sent(),[3,15];case 14:if(f=m.sent(),(E=ye((v=f).name||v.code||v,v.message)).code===te.TrackErrorCode.PERMISSION_DENIED)throw E;return O.warning("getUserMedia failed in getDevices",E),[3,15];case 15:this.accessCameraPermission=!0,m.label=16;case 16:O.debug("[device manager] mic permission",e,"cam permission",t),m.label=17;case 17:return[4,navigator.mediaDevices.enumerateDevices()];case 18:return S=m.sent(),r&&r.getTracks().map((function(e){e.stop()})),i(S||[]),[3,20];case 19:throw new J(c.NOT_SUPPORT,"enumerateDevices() not supported.");case 20:return[3,22];case 21:return T=m.sent(),r&&r.getTracks().map((function(e){e.stop()})),o(T),[3,22];case 22:return[2]}}))}))}))},t.prototype.getRecordingDevices=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a;return m(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.enumerateDevices(!0,!1,!!e)];case 1:return t=s.sent(),o=t.filter((function(e){return"audioinput"===e.kind})),r(o||[]),[3,3];case 2:throw a=s.sent(),i(a),a;case 3:return[2]}}))}))}))},t.prototype.getPlayOutDevices=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a;return m(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.enumerateDevices(!0,!1,!!e)];case 1:return t=s.sent(),o=t.filter((function(e){return"audiooutput"===e.kind})),r(o||[]),[3,3];case 2:throw a=s.sent(),i(a),a;case 3:return[2]}}))}))}))},t.prototype.getCamerasDevices=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a;return m(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,n.enumerateDevices(!1,!0,!!e)];case 1:return t=s.sent(),o=t.filter((function(e){return"videoinput"===e.kind})),r(o||[]),[3,3];case 2:throw a=s.sent(),i(a),a;case 3:return[2]}}))}))}))},t.prototype.searchDeviceNameById=function(e){var t=this.deviceInfoMap.get(e);return t?t.device.label||t.device.deviceId:null},t.prototype.getDeviceById=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a;return m(this,(function(s){switch(s.label){case 0:return[4,n.enumerateDevices(!0,!0,!0)];case 1:if(t=s.sent(),!(o=t.find((function(t){return t.deviceId===e}))))throw a=new J(c.DEVICE_NOT_FOUND,"deviceId: ".concat(e)),i(a),a;return r(o),[2]}}))}))}))},t.prototype.getVideoCameraIdByLabel=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a;return m(this,(function(s){switch(s.label){case 0:return[4,n.enumerateDevices(!0,!0,!0)];case 1:if(t=s.sent(),!(o=t.find((function(t){return"videoinput"===t.kind&&t.label===e}))))throw a=new J(c.DEVICE_NOT_FOUND,"camera label: ".concat(e)),i(a),a;return r(o.deviceId),[2]}}))}))}))},t.prototype.init=function(){return f(this,void 0,void 0,(function(){var e;return m(this,(function(t){switch(t.label){case 0:return(e=this).state=Ge.INITING,[4,e.updateDevicesInfo().catch((function(t){e.state=Ge.IDLE}))];case 1:return t.sent(),e.state=Ge.INITEND,[2]}}))}))},t.prototype.updateDevicesInfo=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e,i,o,a;return m(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,t.enumerateDevices(!0,!0,!0)];case 1:return e=s.sent(),i=Date.now(),o=[],e.forEach((function(e){if(e.deviceId){var n=t.deviceInfoMap.get("".concat(e.kind,"_").concat(e.deviceId));if("ACTIVE"!==(n?n.state:"INACTIVE")){var r={initAt:i,updateAt:i,device:e,state:"ACTIVE"};t.deviceInfoMap.set("".concat(e.kind,"_").concat(e.deviceId),r),o.push(r)}n&&(n.updateAt=i)}})),t.deviceInfoMap.forEach((function(e){"ACTIVE"===e.state&&e.updateAt!==i&&(e.state="INACTIVE",o.push(e))})),t.state!==Ge.INITEND?(n(),[2]):(o.forEach((function(e){switch(e.device.kind){case"audioinput":t.emit(F.RECORDING_DEVICE_CHANGED,e);break;case"videoinput":t.emit(F.CAMERA_DEVICE_CHANGED,e);break;case"audiooutput":t.emit(F.PLAYOUT_DEVICE_CHANGED,e)}})),n(),[3,3]);case 2:return a=s.sent(),r(a),[3,3];case 3:return[2]}}))}))}))},t}(x)),nt=function(e){function t(t,n,r){var i=e.call(this,t,r)||this;if(i._useAudioElement=!1,i.trackMediaType="audio",i._encoderConfig=n,!le)throw new J(c.NOT_SUPPORT,"can not create audio context");me.webAudioWithAEC||(i._useAudioElement=!0),i._source=new $e(t);try{i._mediaStreamTrack=i._source.createOutputTrack()}catch(e){}return i}return _(t,e),t.prototype.setPlaybackDevice=function(e){var t=this;return new Promise((function(n,r){return f(t,void 0,void 0,(function(){var t,i;return m(this,(function(o){switch(o.label){case 0:t=tt.searchDeviceNameById("audiooutput_"+e),o.label=1;case 1:if(o.trys.push([1,3,,4]),!this._useAudioElement)throw new J(c.NOT_SUPPORT,"your browser does not support setting the audio output device");return O.debug("[track-".concat(this.getTrackId(),"] set local audio track playback device ").concat(e)),[4,qe.setSinkID(this.getTrackId(),e)];case 2:return o.sent(),O.info("[track-".concat(this.getTrackId(),"] set playback device ").concat(e," success")),this.emit("@audio-route-change",this,0,t),n(),[3,4];case 3:throw i=o.sent(),this.emit("@audio-route-change",this,-1,t),r(i),i;case 4:return[2]}}))}))}))},t.prototype.setVolume=function(e){if("number"!=typeof e)throw new J(c.INVALID_PARAMS,"value must be number.");if(e<0||e>1e3)throw new J(c.INVALID_PARAMS,"The value ranges from 0 (mute) to 1000 (maximum).");O.debug("[track-".concat(this.getTrackId(),"] set local audio track volume as ").concat(e)),this._source.setVolume(e)},t.prototype.getVolumeLevel=function(){return this._source&&this._source.getAudioLevel()},t.prototype.getStats=function(){O.warning("[deprecated] LocalAudioTrack.getStats will be removed in the future, use ArRTCClient.getLocalAudioStats instead")},t.prototype.setMuted=function(t){return f(this,void 0,void 0,(function(){return m(this,(function(n){return e.prototype.setMuted.call(this,t),[2]}))}))},t.prototype.play=function(){this._useAudioElement?qe.play(this._mediaStreamTrack,this.getTrackId()):this._source.play()},t.prototype.stop=function(){O.debug("[track-".concat(this.getTrackId(),"] stop audio playback")),this._useAudioElement?qe.stop(this.getTrackId()):this._source.stop()},t.prototype.close=function(){e.prototype.close.call(this),this.stop(),this._source.destroy()},t.prototype._updatePlayerSource=function(){this._source&&this._source.updateTrack(this._originMediaStreamTrack),this._useAudioElement&&qe.updateTrack(this.getTrackId(),this._mediaStreamTrack)},t.prototype._updateOriginMediaStreamTrack=function(e,t){return f(this,void 0,void 0,(function(){return m(this,(function(n){return this._originMediaStreamTrack===e||(this._originMediaStreamTrack.removeEventListener("ended",this._handleTrackEnded),e.addEventListener("ended",this._handleTrackEnded),t&&(this._originMediaStreamTrack.stop(),this._originMediaStreamTrack=e,this._source.updateTrack(this._originMediaStreamTrack),this._mediaStreamTrack!==this._source.outputTrack&&(this._mediaStreamTrack=this._originMediaStreamTrack,this._updatePlayerSource()))),[2]}))}))},Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this._useAudioElement?qe.isPlaying(this.getTrackId()):this._source.isPlayed},enumerable:!1,configurable:!0}),t}(ne),rt=["play","playing","loadeddata","canplay","pause","resize","stalled","suspend","waiting"];!function(e){e.NONE="none",e.INIT="init",e.CANPLAY="canplay",e.PLAYING="playing",e.PAUSED="paused",e.SUSPEND="suspend",e.STALLED="stalled",e.WAITING="waiting",e.ERROR="error",e.DESTROYED="destroyed"}(et||(et={}));var it,ot,at,st=function(){function e(e){var t=this;this._videoElementStatus=et.NONE,this.container=void 0,this.videoElement=void 0,this.slot=void 0,this.trackId="",this.videoTrack=null,this.videoElementCheckInterval=void 0,this.handleVideoEvents=function(){},this.onFirstVideoFrameDecoded=function(){},this.onVideoSizeChange=function(){};var n=this;this.videoElementStatus=et.NONE,this.handleVideoEvents=function(e){switch(e.type){case"play":case"playing":n.videoElementStatus=et.PLAYING;break;case"loadeddata":n.onFirstVideoFrameDecoded&&n.onFirstVideoFrameDecoded();var r=n.videoElement;O.debug("[".concat(t.trackId,"] current video dimensions:"),r.videoWidth,r.videoHeight);break;case"canplay":n.videoElementStatus=et.CANPLAY;break;case"stalled":n.videoElementStatus=et.STALLED;break;case"suspend":n.videoElementStatus=et.SUSPEND;break;case"pause":n.videoElementStatus=et.PAUSED,t.videoElement&&(O.debug("[track-".concat(t.trackId,"] video element paused, auto resume")),t.videoElement.play());break;case"waiting":n.videoElementStatus=et.WAITING}},this.slot=e.element||document.body,this.trackId=e.trackId,this.updateConfig(e)}return Object.defineProperty(e.prototype,"videoElementStatus",{get:function(){return this._videoElementStatus},set:function(e){e!==this._videoElementStatus&&(O.debug("[track-".concat(this.trackId,"] video-element-status change ").concat(this.videoElementStatus," => ").concat(e)),this._videoElementStatus=e)},enumerable:!1,configurable:!0}),e.prototype.updateConfig=function(e){this.config=e,this.trackId=e.trackId;var t=e.element;t!==this.slot&&(this.destroy(),this.slot=t),this.createElements()},e.prototype.createElements=function(){this.container||(this.container=document.createElement("div")),this.container.id="artc-video-player-".concat(this.trackId),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="relative",this.container.style.overflow="hidden",this.videoTrack?(this.container.style.backgroundColor="black",this.createVideoElement(),this.container.appendChild(this.videoElement)):this.removeVideoElement(),this.slot.appendChild(this.container)},e.prototype.createVideoElement=function(){var e=this,t=this;if(t.videoElement||(t.videoElementStatus=et.INIT,t.videoElement=document.createElement("video"),t.videoElement.onerror=function(){return t.videoElementStatus=et.ERROR},t.container&&t.container.appendChild(t.videoElement),rt.forEach((function(e){t.videoElement&&t.videoElement.addEventListener(e,t.handleVideoEvents)})),t.videoElementCheckInterval=window.setInterval((function(){!document.getElementById("video_".concat(t.trackId))&&t.videoElement&&(t.videoElementStatus=et.DESTROYED)}),1e3)),t.videoElement.id="video_".concat(t.trackId),t.videoElement.className="artc_video_player",t.videoElement.style.width="100%",t.videoElement.style.height="100%",t.videoElement.style.position="absolute",t.videoElement.style.top="0",t.videoElement.style.left="0",t.videoElement.controls=!1,t.videoElement.setAttribute("playsinline","playsinline"),t.config.mirror&&(t.videoElement.style.transform="rotateY(180deg)"),t.config.fit?t.videoElement.style.objectFit=t.config.fit:t.videoElement.style.objectFit="cover",t.videoElement.setAttribute("muted",""),t.videoElement.muted=!0,"srcObject"in t.videoElement)t.videoElement.srcObject instanceof MediaStream&&(t.videoElement.srcObject.getVideoTracks()[0],t.videoTrack),t.videoElement.srcObject=t.videoTrack?new MediaStream([t.videoTrack]):null;else{var n=new MediaStream;n.addTrack(t.videoTrack),t.videoElement.src=window.URL.createObjectURL(n)}var r=t.videoElement.play();void 0!==r&&r.catch((function(t){O.debug("[track-".concat(e.trackId,"] playback interrupted"),t.toString())}))},e.prototype.removeVideoElement=function(){var e=this;e.videoElement&&(rt.forEach((function(t){e.videoElement&&e.videoElement.removeEventListener(t,e.handleVideoEvents)})),e.videoElementCheckInterval&&(window.clearInterval(e.videoElementCheckInterval),e.videoElementCheckInterval=void 0),e.container&&e.container.removeChild(e.videoElement),e.videoElement=void 0,e.videoElementStatus=et.NONE)},e.prototype.updateVideoTrack=function(e){this.videoTrack!==e&&(this.videoTrack=e,this.createElements())},e.prototype.getCurrentFrame=function(){if(!this.videoElement)return new ImageData(2,2);var e=document.createElement("canvas");e.width=this.videoElement.videoWidth,e.height=this.videoElement.videoHeight;var t=e.getContext("2d");if(!t)return O.error("create canvas context failed!"),new ImageData(2,2);t.drawImage(this.videoElement,0,0,e.width,e.height);var n=t.getImageData(0,0,e.width,e.height);return e.remove(),n},e.prototype.play=function(){var e=this;if(this.videoElement){var t=this.videoElement.play();t&&t.catch&&t.catch((function(t){O.warning("[track-".concat(e.trackId,"] play warning: "),t)}))}},e.prototype.destroy=function(){var e;if(this.videoElement&&(this.videoElement.srcObject=null,this.videoElement=void 0),this.container){try{this.container.remove(),null===(e=this.slot)||void 0===e||e.removeChild(this.container)}catch(e){}this.container=void 0}},e}(),ct=function(e){function t(t,n,r,i){var o=e.call(this,t,i)||this;o._player=void 0,o._videoWidth=0,o._videoHeight=0,o._optimizationMode=void 0;var a=o;return o.trackMediaType="video",o._encoderConfig=n,o._optimizationMode=r,Ne(t).then((function(e){a._videoHeight=e[0],a._videoWidth=e[1]})),o}return _(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return!!this._player},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optimizationMode",{get:function(){return this._optimizationMode},enumerable:!1,configurable:!0}),t.prototype.getCurrentFrameData=function(){var e;return this._player?null===(e=this._player)||void 0===e?void 0:e.getCurrentFrame():new ImageData(2,2)},Object.defineProperty(t.prototype,"encoderConfig",{get:function(){return this._encoderConfig},enumerable:!1,configurable:!0}),t.prototype.play=function(e,t){var n=this,r=void 0!==t&&"[object Object]"===Object.prototype.toString.call(t)?t:{};if(!(e instanceof HTMLElement)){var i=void 0,o=document.getElementById(e);if(!o)return i="[track-".concat(this.getTrackId(),'] can not find "#'),void O.warning(i.concat(e,'" element, use document.body'));e=o}var a=Object.assign({},this._getDefaultPlayerConfig(),{},r,{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(a):(this._player=new st(a),this._player.updateVideoTrack(this._mediaStreamTrack),this._player.onFirstVideoFrameDecoded=function(){n.emit("first-video-frame")},this._player.onVideoSizeChange=function(e,t){n.emit("video-resize",e,t)}),O.debug("[track-".concat(this.getTrackId(),"] start preview local video")),this._player.play()},t.prototype.stop=function(){this._player&&(this._player.destroy(),this._player=void 0,O.debug("[track-".concat(this.getTrackId(),"] stop video preview")))},t.prototype.close=function(){e.prototype.close.call(this),this.stop()},t.prototype.getStats=function(){O.warning("[deprecated] LocalVideoTrack.getStats will be removed in the future, use ArRTCClient.getLocalVideoStats instead");return{captureResolutionHeight:0,captureResolutionWidth:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,sendResolutionHeight:0,sendResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0,packetLossRate:0}},t.prototype.setOptimizationMode=function(e){var t=this;return new Promise((function(n,r){return f(t,void 0,void 0,(function(){var t,i,o;return m(this,(function(a){switch(a.label){case 0:return a.trys.push([0,4,,5]),"motion"!==e&&"detail"!==e&&"balanced"!==e?[3,2]:(t=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return 0===e.getListeners(t).length?Promise.resolve():new Promise((function(r,i){e.emit.apply(e,S(S([t],E(n),!1),[r,i],!1))}))},[4,t(this,F.SET_OPTIMIZATION_MODE,e)]);case 1:return a.sent(),this._optimizationMode=e,O.info("[track-".concat(this.getTrackId(),"] set optimization mode success (")),n(),[3,3];case 2:O.error(te.BasicErrorCode.INVALID_PARAMS,"optimization mode must be motion, detail or balanced"),a.label=3;case 3:return[3,5];case 4:return i=a.sent(),o=i,O.error("[track-".concat(this.getTrackId(),"] set optimization mode failed"),o.toString()),r(o),[3,5];case 5:return[2]}}))}))}))},t.prototype._updateOriginMediaStreamTrack=function(e,t,n){var r=this,i=this;return new Promise((function(o,a){return f(r,void 0,void 0,(function(){return m(this,(function(r){try{if(i._originMediaStreamTrack===e)return[2];i.peer&&i.peer.removeTrack(i._originMediaStreamTrack),t&&(i._originMediaStreamTrack.removeEventListener("ended",i._handleTrackEnded),e.addEventListener("ended",i._handleTrackEnded),i._originMediaStreamTrack.stop(),i._originMediaStreamTrack=e),i._mediaStreamTrack=i._originMediaStreamTrack,i._updatePlayerSource(),!n&&i.emit("@need_replace_track",i._mediaStreamTrack),o()}catch(e){a(e)}return[2]}))}))}))},t.prototype._updatePlayerSource=function(){this._player&&this._player.updateVideoTrack(this._mediaStreamTrack)},t.prototype._getDefaultPlayerConfig=function(){return{}},t}(ne),dt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._player=void 0,r.trackMediaType="video",r}return _(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return!!this._player},enumerable:!1,configurable:!0}),t.prototype.getCurrentFrameData=function(){var e;return this._player?null===(e=this._player)||void 0===e?void 0:e.getCurrentFrame():new ImageData(2,2)},t.prototype.play=function(e,t){var n=void 0!==t&&"[object Object]"===Object.prototype.toString.call(t)?t:{};if("string"==typeof e){var r=void 0,i=document.getElementById(e);if(!i)return r="[track-".concat(this.getTrackId(),'] can not find "#'),void O.warning(r.concat(e,'" element, use document.body'));e=i}var o=Object.assign({},{},n,{trackId:this.getTrackId(),element:e});this._player?this._player.updateConfig(o):(this._player=new st(o),this._player.updateVideoTrack(this._mediaStreamTrack)),this._player.play(),O.debug("[track-".concat(this.getTrackId(),"] start remote video preview"))},t.prototype.updateMediaStreamTrackResolution=function(e){var t;null===(t=this._player)||void 0===t||t.updateVideoTrack(e),this._originMediaStreamTrack=e,this._mediaStreamTrack=e,O.debug("[track-".concat(this.getTrackId(),"] update remote video track"))},t.prototype.stop=function(){this._player&&(this._player.destroy(),this._player=void 0,O.debug("[track-".concat(this.getTrackId(),"] stop remote video preview")))},t.prototype.getStats=function(){O.warning("[deprecated] RemoteVideoTrack.getStats will be removed in the future, use ArRTCClient.getRemoteVideoStats instead")},t}(re),ut=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._useAudioElement=!1,r.trackMediaType="audio",r._source=new $e(t,!0),me.webAudioWithAEC||(r._useAudioElement=!0),r}return _(t,e),Object.defineProperty(t.prototype,"isPlaying",{get:function(){return this._useAudioElement?qe.isPlaying(this.getTrackId()):this._source.isPlayed},enumerable:!1,configurable:!0}),t.prototype.updateMediaStreamTrackResolution=function(e){this._useAudioElement?qe.updateTrack(this.getTrackId(),e):this._source.updateTrack(e),O.debug("[track-".concat(this.getTrackId(),"] update remote audio track"))},t.prototype.play=function(){this._useAudioElement?qe.play(this._mediaStreamTrack,this.getTrackId()):this._source.play(),O.debug("[track-".concat(this.getTrackId(),"] start remote audio playback"))},t.prototype.stop=function(){this._useAudioElement?qe.stop(this.getTrackId()):this._source.stop(),O.debug("[track-".concat(this.getTrackId(),"] stop remote audio playback"))},t.prototype.setPlaybackDevice=function(e){return f(this,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:if(!this._useAudioElement)throw new J(c.NOT_SUPPORT,"your browser does not support setting the audio output device");t.label=1;case 1:return t.trys.push([1,3,,4]),O.debug("[track-".concat(this.getTrackId(),"] remote audio track set playback device as ").concat(e)),[4,qe.setSinkID(this.getTrackId(),e)];case 2:return t.sent(),[3,4];case 3:throw t.sent();case 4:return[2]}}))}))},t.prototype.setVolume=function(e){if("number"!=typeof e)throw new J(c.INVALID_PARAMS,"value must be number.");if(e<0||e>1e3)throw new J(c.INVALID_PARAMS,"The value ranges from 0 (mute) to 1000 (maximum).");O.debug("[track-".concat(this.getTrackId(),"] set remote audio track volume as ").concat(e)),this._useAudioElement?qe.setVolume(this.getTrackId(),e):this._source.setVolume(e)},t.prototype.getVolumeLevel=function(){return this._source.getAudioLevel()},t.prototype.getStats=function(){O.warning("[deprecated] RemoteAudioTrack.getStats will be removed in the future, use ArRTCClient.getRemoteAudioStats instead")},t.prototype._destroy=function(){this._source.destroy()},t}(re),lt=function(e){function t(t){var n=e.call(this)||this;return n.ID="",n.type="",n.startTime=0,n.connectionId="",n.currentReconnectCount=0,n.joinInfo={},n.videoTrack=void 0,n.audioTrack=void 0,n._audioMediaStreamTrack=void 0,n._videoMediaStreamTrack=void 0,n.ID=t,n}return _(t,e),t.prototype.applyVideoConstraints=function(e){this._videoMediaStreamTrack&&this._videoMediaStreamTrack.applyConstraints(e)},t.prototype.hasOriginVideoTrack=function(){return!!this._videoMediaStreamTrack},t.prototype.hasOriginAudioTrack=function(){return!!this._audioMediaStreamTrack},t.prototype.createPC=function(){var e,t=this,n=this;switch(this.type){case"pub":e=new Ye(this.ID,this.joinInfo);break;case"pubEx":e=new ze(this.ID,this.joinInfo);break;case"sub":e=new Qe(this.ID,this.joinInfo)}return n.peer=e,n.peer.on(F.CONNECTION_STATE_CHANGE,(function(e){n.emit(F.CONNECTION_STATE_CHANGE,n.ID,n.type,e)})),n.peer.on(F.ICE_CANDIDATE,(function(e){n.emit(F.ICE_CANDIDATE,n.ID,n.type,e)})),"sub"===n.type&&n.peer.on(F.TRACK_ADDED,(function(e){if(n.emit(F.TRACK_ADDED,n.ID,e.kind,e),"video"===e.kind){t._videoMediaStreamTrack=e;var r=document.createElement("video");r.srcObject=new MediaStream([e]),r.onloadedmetadata=function(e){n.emit(F.FIRST_FRAME_DECODED,n.ID,n.type,"video"),t.videoTrack&&t.videoTrack.emit(F.FIRST_FRAME_DECODED)},r.onresize=function(e){n.emit(F.VIDEO_SIZE_CHANGE,n.ID,n.type,"video",r.videoWidth*r.videoHeight)}}else"audio"===e.kind&&(t._audioMediaStreamTrack=e)})),n.peer},t.prototype.closePC=function(){this.peer&&this.peer.close()},t.prototype.getPublishedTypes=function(){return this.peer.getSendTransceivers().map((function(e){return e.mid}))},t.prototype.createAnswer=function(e,t){var n=this;return void 0===t&&(t=!1),new Promise((function(r,i){return f(n,void 0,void 0,(function(){var n,o;return m(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.peer.createAnswer(e,t)];case 1:return n=a.sent(),r(n),[3,3];case 2:return o=a.sent(),i(o),[3,3];case 3:return[2]}}))}))}))},t.prototype.setIceCandidate=function(e){try{this.peer.setIceCandidate(e)}catch(e){throw e}},t.prototype.clearOriginTracks=function(){this._videoMediaStreamTrack||(this._videoMediaStreamTrack=void 0),this._audioMediaStreamTrack||(this._audioMediaStreamTrack=void 0)},t.prototype.addTrack=function(e){var t=this;if(this.ID,e instanceof ct||e instanceof dt||e instanceof nt||e instanceof ut){var n=e.trackMediaType,r=e.getMediaStreamTrack();"video"===n?(this.videoTrack=e,this.videoTrack.getStats=function(){return t.videoTrack instanceof re?(O.warning("[deprecated] RemoteVideoTrack.getStats will be removed in the future, use ArRTCClient.getRemoteVideoStats instead"),t.statsCollector.getRemoteVideoTrackStats(t.ID)):(O.warning("[deprecated] LocalVideoTrack.getStats will be removed in the future, use ArRTCClient.getLocalVideoStats instead"),t.statsCollector.getLocalVideoTrackStats(t.ID))},this._videoMediaStreamTrack=r):"audio"===n&&(this.audioTrack=e,this.audioTrack.getStats=function(){return t.videoTrack instanceof re?(O.warning("[deprecated] RemoteAudioTrack.getStats will be removed in the future, use ArRTCClient.getRemoteAudioStats instead"),t.statsCollector.getRemoteAudioTrackStats(t.ID)):(O.warning("[deprecated] LocalAudioTrack.getStats will be removed in the future, use ArRTCClient.getLocalAudioStats instead"),t.statsCollector.getLocalAudioTrackStats(t.ID))},this._audioMediaStreamTrack=r),e.peer=this.peer}},t.prototype.removeTrack=function(e,t){void 0===t&&(t=!0),e?(e===this.videoTrack?(t&&this.videoTrack.stop(),this.videoTrack=void 0):e===this.audioTrack&&(t&&this.audioTrack.stop(),this.audioTrack=void 0),e.peer=void 0):this.removeAllTracks()},t.prototype.removeAllTracks=function(e){void 0===e&&(e=!1),this.videoTrack&&(e&&this.videoTrack.stop(),this.videoTrack=void 0),this.audioTrack&&(e&&this.audioTrack.stop(),this.audioTrack=void 0)},t.prototype.setOptimizationMode=function(e,t,n){this.peer&&this.peer.setRtpSenderParameters({},"detail"===e?"maintain-resolution":"motion"===e?"maintain-framerate":"balanced").then(t).catch(n)},t.prototype._bindTrackEvents=function(e){},t.prototype._unbindTrackEvents=function(e){},t}(x),pt=function(e){function t(t,n,r){var i=e.call(this,t.stream.getAudioTracks()[0],n,r)||this;return i.trackList=[],i.mediaStreamDestination=t,i}return _(t,e),t.prototype.checkTrackExist=function(e){return-1!==this.trackList.findIndex((function(t){return t===e}))},t.prototype.addAudioTrack=function(e){this.checkTrackExist(e)?O.warning("track is already added"):(this.trackList.push(e),e._source.gainNode.connect(this.mediaStreamDestination),this.updateEncoderConfig())},t.prototype.setAudioTrackMuted=function(e,t){this.checkTrackExist(e)&&!e._isClosed&&(e._source.gainNode.gain.value=t?0:1)},t.prototype.removeAudioTrack=function(e){this.checkTrackExist(e)&&(!e._isClosed&&e._source.gainNode.disconnect(this.mediaStreamDestination),this.trackList.splice(this.trackList.findIndex((function(t){return t===e})),1),this.updateEncoderConfig())},t.prototype.removeAllAudioTracks=function(){var e=this;this.trackList&&this.trackList.map((function(t){e.removeAudioTrack(t)}))},t.prototype.updateEncoderConfig=function(){var e={};this.trackList&&this.trackList.forEach((function(t){t._encoderConfig&&((t._encoderConfig.bitrate||0)>(e.bitrate||0)&&(e.bitrate=t._encoderConfig.bitrate),(t._encoderConfig.sampleRate||0)>(e.sampleRate||0)&&(e.sampleRate=t._encoderConfig.sampleRate),(t._encoderConfig.sampleSize||0)>(e.sampleSize||0)&&(e.sampleSize=t._encoderConfig.sampleSize),t._encoderConfig.stereo&&(e.stereo=!0))})),this._encoderConfig=e},t}(nt),_t=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i._handleVideoTrackRenegotiate=void 0,i.type="pub",i.joinInfo=r,i.createPC(),i.statsCollector=n,i.statsCollector.addLocalConnection(i),i}return _(t,e),t.prototype.initTracks=function(){this.peer.initTracks()},t.prototype.getAllTracks=function(){var e=[];return this.videoTrack&&e.push(this.videoTrack),this.audioTrack&&(this.audioTrack instanceof pt?e=e.concat(this.audioTrack.trackList):e.push(this.audioTrack)),e},t.prototype.hasTrack=function(e){if(e instanceof ne){if(this.audioTrack&&"audio"===e.trackMediaType)return this.audioTrack.checkTrackExist(e);if("video"===e.trackMediaType)return e===this.videoTrack}return!1},t.prototype.addTracks=function(e){var t=this,n=this;return new Promise((function(r,i){if(!e)throw new J(Q.PublishErrorCode.INVALID_LOCAL_TRACK);e instanceof Array||(e=[e]);var o=[];e.forEach((function(e){if(!(e&&e instanceof ne))throw new J(L.INVALID_LOCAL_TRACK);if(!e.enabled)throw new J(L.TRACK_IS_DISABLED,"can not publish a disabled track: ".concat(e.getTrackId()));if("video"===e.trackMediaType){if(t.videoTrack)throw new J(Q.PublishErrorCode.CAN_NOT_PUBLISH_MULTIPLE_VIDEO_TRACKS);if(!(e instanceof ct))throw new J(c.INVALID_OPERATION,"Unable to published a non-LocalVideoTrack");n._handleVideoTrackRenegotiate=n._handleRTCNeedRenegotiate.bind(n),e.on(F.RTC_NEED_RENEGOTIATE,n._handleVideoTrackRenegotiate),n.addTrack(e),o.push(e);var r=e.getMediaStreamTrack();n._videoMediaStreamTrack=r,e.peer=n.peer,n.peer.videoEncoderConfig=e.encoderConfig,n.peer.addTrack(r,e._encoderConfig),e.optimizationMode}else if("audio"===e.trackMediaType&&e instanceof nt){if(o.push(e),!n.audioTrack){var i=pe().createMediaStreamDestination(),a=new pt(i,{},y(8));n.addTrack(a),n.peer.addTrack(a.getMediaStreamTrack(),a._encoderConfig)}n.audioTrack.checkTrackExist(e)||n.audioTrack.addAudioTrack(e)}})),r(o)}))},t.prototype.removeTracks=function(e,t){var n=this,r=this;return new Promise((function(i,o){var a=r.getAllTracks(),s=[];e?e instanceof ne?s=[e]:e instanceof Array&&(s=e):s=a,s.length===a.length&&s.every((function(e,t){return e===a[t]}))?(n.audioTrack&&(n.audioTrack.removeAllAudioTracks(),n.peer.removeTrack(n._audioMediaStreamTrack),n.removeTrack(n.audioTrack,t)),n.videoTrack&&(n.videoTrack.off(F.RTC_NEED_RENEGOTIATE,r._handleVideoTrackRenegotiate),n.peer.removeTrack(n._videoMediaStreamTrack),n.removeTrack(n.videoTrack,t))):a.map((function(e){if(~s.indexOf(e))if("video"===e.trackMediaType){if(n.videoTrack!==e)throw new J(c.INVALID_OPERATION,"You haven't published this track ",e);n.videoTrack.off(F.RTC_NEED_RENEGOTIATE,r._handleVideoTrackRenegotiate),n.removeTrack(n.videoTrack,t),n.peer.removeTrack(n._videoMediaStreamTrack)}else if("audio"===e.trackMediaType&&n.audioTrack){var i=n.audioTrack;i.removeAudioTrack(e),0===i.trackList.length&&(n.removeTrack(i,t),n.peer.removeTrack(n._audioMediaStreamTrack))}})),i()}))},t.prototype.replaceTrack=function(e){this.peer.replaceTrack(e)},t.prototype.destroy=function(e){void 0===e&&(e=!0),this.removeTracks(void 0,e),this.removeAllTracks(e),this.closePC(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.ID=""},t.prototype._handleRTCNeedRenegotiate=function(){var e;if("bitrateMax"in this.videoTrack._encoderConfig){var t=null===(e=this.videoTrack._encoderConfig)||void 0===e?void 0:e.bitrateMax;t&&this.peer.updateBandWidth(t)}},t}(lt),ht=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="pubEx",i.joinInfo=r,i.createPC(),i.statsCollector=n,i.statsCollector.addLocalConnection(i),i}return _(t,e),t.prototype.addTrack=function(e){"video"!==e.trackMediaType||this.videoTrack||(this.videoTrack=e,this._videoMediaStreamTrack=e.getMediaStreamTrack(),this.peer.addTrack(this._videoMediaStreamTrack,e._encoderConfig))},t.prototype.removeTrack=function(){this.videoTrack&&(this.videoTrack.close(),this.videoTrack=void 0,this.peer.removeTrack(this._videoMediaStreamTrack))},t.prototype.replaceTrack=function(e){this.peer.replaceTrack(e)},t.prototype.destroy=function(e){void 0===e&&(e=!0),this.removeTrack(),this.removeAllTracks(e),this.clearOriginTracks(),this.closePC(),this.removeAllListeners(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.ID=""},t}(lt),ft=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.type="sub",i.joinInfo=r,i.createPC(),i.statsCollector=n,i.statsCollector.addRemoteConnection(i),i}return _(t,e),t.prototype.addTracks=function(e){if("video"===e){var t=this._videoMediaStreamTrack,n=new dt(t,"track-remote-v-"+y(5));return this.addTrack(n),this.videoTrack}var r=this._audioMediaStreamTrack,i=new ut(r,"track-remote-a-"+y(5));return this.addTrack(i),this.audioTrack},t.prototype.removeTracks=function(e){"video"===e?this.removeTrack(this.videoTrack):this.removeTrack(this.audioTrack)},t.prototype.destroy=function(e){void 0===e&&(e=!0),this.removeAllTracks(e),this.clearOriginTracks(),this.closePC(),this.statsCollector&&this.statsCollector.removeConnection(this.ID),this.ID=""},t}(lt),mt={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveLevel:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0},vt={transportDelay:0,end2EndDelay:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,totalDuration:0,totalFreezeTime:0,freezeRate:0,packetLossRate:0},Et={sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,sendPacketsLostRate:0,rttMs:0},St={sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendPacketsLostRate:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0,rttMs:0},Tt=function(){function e(e){this.clientId="",this.localConnectionsMap=new Map,this.remoteConnectionsMap=new Map,this.clientId=e,this.updateStatsInterval=window.setInterval(this.updateStats.bind(this),1e3)}return e.prototype.updateStats=function(){this.remoteConnectionsMap.forEach((function(e){var t=e.audioStats?e.audioStats:mt,n=e.videoStats?e.videoStats:vt;e.latestAudioStats=t,e.latestVideoStats=n;var r=e.pcStats,i=Object.assign({},mt),o=Object.assign({},vt),a=e.connection.peer.getStats();if(a){var s=a.audioRecv[0],c=a.videoRecv[0];if(r&&r.videoRecv[0],i.rtt=a.rtt||0,o.rtt=a.rtt||0,s){if("opus"!==s.codec&&"aac"!==s.codec||(i.codecType=s.codec),s.outputLevel){var d=Math.round(32767*s.outputLevel);i.receiveLevel=d}else e.connection.audioTrack&&(i.receiveLevel=Math.round(32767*e.connection.audioTrack.getVolumeLevel()));i.receiveBytes=s.bytes,i.receivePackets=s.packets,i.receivePacketsLost=s.packetsLost,i.packetLossRate=i.receivePacketsLost-t.receivePacketsLost==0?0:i.receivePacketsLost/i.receivePacketsLost+i.receivePackets,i.receiveBitrate=t?8*Math.max(0,i.receiveBytes-t.receiveBytes):0,i.totalDuration=t?t.totalDuration+1:1,i.totalFreezeTime=t?t.totalFreezeTime:0,i.freezeRate=i.totalFreezeTime/i.totalDuration,i.receiveDelay=s.jitterBufferMs}c&&("H264"!==c.codec&&"VP8"!==c.codec||(o.codecType=c.codec),o.receiveBytes=c.bytes,o.receiveBitrate=n?8*Math.max(0,o.receiveBytes-n.receiveBytes):0,o.decodeFrameRate=c.decodeFrameRate,o.renderFrameRate=c.decodeFrameRate,c.outputFrame&&(o.renderFrameRate=c.outputFrame.frameRate),c.receivedFrame?(o.receiveFrameRate=c.receivedFrame.frameRate,o.receiveResolutionHeight=c.receivedFrame.height,o.receiveResolutionWidth=c.receivedFrame.width):e.connection.videoTrack&&(o.receiveResolutionHeight=e.connection.videoTrack._videoHeight||0,o.receiveResolutionHeight=e.connection.videoTrack._videoWidth||0),void 0!==c.framesRateFirefox&&(o.receiveFrameRate=Math.round(c.framesRateFirefox)),o.receivePackets=c.packets,o.receivePacketsLost=c.packetsLost,o.packetLossRate=o.receivePacketsLost-n.receivePacketsLost==0?0:o.receivePacketsLost/o.receivePacketsLost+o.receivePackets,o.totalDuration=n?n.totalDuration+1:1,o.totalFreezeTime=n?n.totalFreezeTime:0,o.receiveDelay=c.jitterBufferMs||0,o.freezeRate=o.totalFreezeTime/o.totalDuration),e.audioStats=i,e.videoStats=o,e.pcStats=a}})),this.localConnectionsMap.forEach((function(e){var t=e.audioStats?e.audioStats:Et,n=e.videoStats?e.videoStats:St;e.latestAudioStats=t,e.latestVideoStats=n;var r=Object.assign({},Et),i=Object.assign({},St),o=e.connection.peer.getStats();if(o){var a=o.audioSend[0],s=o.videoSend[0];r.rtt=(null==a?void 0:a.rttMs)?a.rttMs:0,i.rtt=(null==s?void 0:s.rttMs)?s.rttMs:0,a&&("opus"!==a.codec&&"aac"!==a.codec||(r.codecType=a.codec),a.inputLevel?r.sendVolumeLevel=Math.round(32767*a.inputLevel):e.connection.audioTrack&&(r.sendVolumeLevel=Math.round(32767*e.connection.audioTrack.getVolumeLevel())),r.sendBytes=a.bytes,r.sendPackets=a.packets,r.sendPacketsLost=a.packetsLost,r.packetLossRate=r.sendPacketsLost-t.sendPacketsLost==0?0:(r.sendPacketsLost-t.sendPacketsLost)/(r.sendPackets-t.sendPackets),r.sendBitrate=t?8*Math.max(0,r.sendBytes-t.sendBytes):0),s&&("H264"!==s.codec&&"VP8"!==s.codec||(i.codecType=s.codec),i.sendBytes=s.bytes,i.sendBitrate=n?8*Math.max(0,i.sendBytes-n.sendBytes):0,s.inputFrame?(i.captureFrameRate=s.inputFrame.frameRate,i.captureResolutionHeight=s.inputFrame.height,i.captureResolutionWidth=s.inputFrame.width):e.connection.videoTrack&&(i.captureResolutionWidth=e.connection.videoTrack._videoWidth||0,i.captureResolutionHeight=e.connection.videoTrack._videoHeight||0),s.sentFrame?(i.sendFrameRate=s.sentFrame.frameRate,i.sendResolutionHeight=s.sentFrame.height,i.sendResolutionWidth=s.sentFrame.width):e.connection.videoTrack&&(i.sendResolutionWidth=e.connection.videoTrack._videoWidth||0,i.sendResolutionHeight=e.connection.videoTrack._videoHeight||0),s.avgEncodeMs&&(i.encodeDelay=s.avgEncodeMs),e.connection.videoTrack&&e.connection.videoTrack._encoderConfig&&e.connection.videoTrack._encoderConfig.bitrateMax&&(i.targetSendBitrate=1e3*e.connection.videoTrack._encoderConfig.bitrateMax),i.sendPackets=s.packets,i.sendPacketsLost=s.packetsLost,i.packetLossRate=i.sendPacketsLost-n.sendPacketsLost==0?0:(i.sendPacketsLost-n.sendPacketsLost)/(i.sendPackets-n.sendPackets),i.totalDuration=n?n.totalDuration+1:1,i.totalFreezeTime=n?n.totalFreezeTime:0),e.audioStats=r,e.videoStats=i}}))},e.prototype.getLocalAudioTrackStats=function(e){var t=this.localConnectionsMap.get(e);return t&&t.audioStats?t.audioStats:Object.assign({},Et)},e.prototype.getLocalVideoTrackStats=function(e){var t=this.localConnectionsMap.get(e);return t&&t.videoStats?t.videoStats:Object.assign({},St)},e.prototype.getRemoteAudioTrackStats=function(e){var t=this.remoteConnectionsMap.get(e);return t&&t.audioStats?t.audioStats:Object.assign({},mt)},e.prototype.getRemoteVideoTrackStats=function(e){var t=this.remoteConnectionsMap.get(e);return t&&t.videoStats?t.videoStats:Object.assign({},vt)},e.prototype.getRTCStats=function(){var e=0,t=0,n=0,r=0;this.localConnectionsMap.forEach((function(n){n.audioStats&&(e+=n.audioStats.sendBytes,t+=n.audioStats.sendBitrate),n.videoStats&&(e+=n.videoStats.sendBytes,t+=n.videoStats.sendBitrate)})),this.remoteConnectionsMap.forEach((function(e){e.audioStats&&(r+=e.audioStats.receiveBytes,n+=e.audioStats.receiveBitrate),e.videoStats&&(r+=e.videoStats.receiveBytes,n+=e.videoStats.receiveBitrate)}));return{Duration:0,UserCount:1,SendBitrate:t,SendBytes:e,RecvBytes:r,RecvBitrate:n,OutgoingAvailableBandwidth:0,RTT:0}},e.prototype.removeConnection=function(e){this.localConnectionsMap.delete(e),this.remoteConnectionsMap.delete(e)},e.prototype.addLocalConnection=function(e){var t=e.ID;this.localConnectionsMap.has(t)||this.localConnectionsMap.set(t,{connection:e})},e.prototype.addRemoteConnection=function(e){var t=e.ID;this.remoteConnectionsMap.has(t)||this.remoteConnectionsMap.set(t,{connection:e})},e.prototype.updateTrafficStats=function(e){},e.prototype.updateUplinkStats=function(e){},e.prototype.isLocalVideoFreeze=function(e,t){var n=!!t&&e.framesDecodeFreezeTime>t.framesDecodeFreezeTime,r=!t||e.framesDecodeCount>t.framesDecodeCount;return n||!r},e.prototype.isRemoteAudioFreeze=function(e){},e.prototype.clear=function(){clearInterval(this.updateStatsInterval),this.clientId="",this.localConnectionsMap=new Map,this.remoteConnectionsMap=new Map},e}(),It=function(){function e(e){this._urls=[],this._urlSuffix="/arapi/v1?action=",this._joinInfo={},this._urls=[C.TASK_GATEWAY_ADDRESS,C.TASK_GATEWAY_ADDRESS],this._urlSuffix="/arapi/v1?action=",this._joinInfo=e}return e.prototype.joinGateway=function(e){var t=this,n=this;return new Promise((function(r,i){var o=n._urlSuffix.concat("wts_gateway"),a={opid:133,ts:Date.now(),sid:t._joinInfo.sid,appId:t._joinInfo.appId,cname:t._joinInfo.cname,uid:t._joinInfo.uid,token:t._joinInfo.token,wss:C.GATEWAY_ADDRESS_SSL},s=function(){return f(t,void 0,void 0,(function(){var t,n;return m(this,(function(c){switch(c.label){case 0:return[4,Promise.race(this._urls.map((function(t){return new Y({url:t,timeout:C.GATEWAY_CONNECT_TIMEOUT}).post(o,h(h({},a),e))})))];case 1:if(t=c.sent())if(0===(n=t.code))r(t);else if(-1===n)setTimeout((function(){s()}),C.GATEWAY_CONNECT_TIMEOUT);else{if(-4===n||-7===n)throw i("MISSING_PARAMETER"),new Error("MISSING_PARAMETER");if(13===n)throw i("DEVELOPER_INVALID"),new J("DEVELOPER_INVALID");if(14===n)throw i("UID_BANNED"),new J("UID_BANNED");if(15===n)throw i("IP_BANNED"),new J("IP_BANNED");if(16===n)throw i("CHANNEL_BANNED"),new J("CHANNEL_BANNED");if(101===n)throw i("APPID_INVALID"),new J("APPID_INVALID");if(102===n)throw i("SERVER_NOT_OPEN"),new J("SERVER_NOT_OPEN");if(2002===n)throw i("DEVELOPER_INVALID"),new J("DEVELOPER_INVALID");if(109===n)throw i("TOKEN_EXPIRED"),new J("TOKEN_EXPIRED","You must request a new token from your server and call join to use the new token to join the channel");if(110===n)throw i("TOKEN_INVALID"),new J("TOKEN_INVALID","make sure token is right and try angain please");setTimeout((function(){s()}),C.GATEWAY_CONNECT_TIMEOUT)}return[2]}}))}))};s()}))},e}(),Ct=function(t){function n(e){var n=t.call(this)||this;n._appId="",n._serverIsWss=!0,n._serverUrl="",n._serverPort=0,n._connectBeginTime=void 0,n._revState="DISCONNECTED",n._curState="DISCONNECTED",n._userId=null,n._keepALiveInterval=0,n._keepALiveIntervalTime=1e4,n._connectTimeout=0,n._keepAliveTimeout=0,n.handleMediaServerEvents=function(){};var r=n;return e&&e.appId&&(r._appId=e.appId),n}return _(n,t),n.prototype.init=function(e){var t=this,n=e.appId,r=e.isWss,i=e.url,o=e.port;t._appId=n,"boolean"==typeof r&&(t._serverIsWss=r),i&&(t._serverUrl=i),o&&(t._serverPort=o)},n.prototype.setAppInfo=function(e){var t=e.appId;this._appId=t},n.prototype.configServer=function(e,t,n){var r=this;r._serverIsWss=e,r._serverUrl=t,r._serverPort=n},n.prototype.connect=function(){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t;return m(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),!n._connectBeginTime&&(n._connectBeginTime=Date.now()),n._emitConnectionState("CONNECTING"),n._setConnectTimeout(),[4,n.open({url:n._serverUrl,wss:n._serverIsWss,port:n._serverPort})];case 1:return o.sent(),O.info("ws serve connected..."),n._connectBeginTime=void 0,n._clearConnectTimeout(),n._emitConnectionState("CONNECTED"),r(),n.onmessage=function(e){var t=e.data,r=JSON.parse(t),i=r.Cmd;r.Encrypt;var o=r.Content,a=JSON.parse(o);if("KeepAlive"===i)n._clearKeepALiveTimeout();else n.handleMediaServerEvents&&n.handleMediaServerEvents(i,a)},n.onerror=function(e){O.error("WebSocket with some error ",e)},n.onclose=function(t){var r=t.code,i=t.reason;switch(O.info("Media task signal WebSocket close with code ",r,i),n._clearConnectTimeout(),n._stopKeepAlive(),n._clearKeepALiveTimeout(),r){case 1e3:case 1005:n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.LEAVE);break;default:"RECONNECTING"!==n._curState&&n._emitConnectionState("RECONNECTING",e.ConnectionDisconnectedReason.SERVER_ERROR)}n.clear()},[3,3];case 2:return t=o.sent(),n._clearConnectTimeout(),i(t),[3,3];case 3:return[2]}}))}))}))},n.prototype.doKeepAlive=function(){var t=this,n={Cmd:"KeepAlive"};n.Content=JSON.stringify({time:Date.now().toString()}),this.send(n),!t._keepAliveTimeout&&(t._keepAliveTimeout=window.setTimeout((function(){t._stopKeepAlive(),t._clearKeepALiveTimeout(),t.clear(),t._emitConnectionState("RECONNECTING",e.ConnectionDisconnectedReason.KEEP_A_LIVE_TIME_OUT)}),2*t._keepALiveIntervalTime))},n.prototype.doStartTask=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o;return m(this,(function(a){try{t=function(e){var o=JSON.parse(e.data),a=o.Cmd,s=(o.Encrypt,o.Content),c=JSON.parse(s);if("StartTask"===a){n.removeMessageEventListener(t);var d=c.Code;0===d?(n._startKeepAlive(),r()):(O.error("startTask failure, code => ",d),i(d))}},n.addMessageEventListener(t),(o={}).Cmd="StartTask",o.AppId=n._appId,o.Content=JSON.stringify(Object.assign({},e)),n.send(o)}catch(e){i(e)}return[2]}))}))}))},n.prototype.doUpdateTask=function(e){return f(this,void 0,void 0,(function(){var t;return m(this,(function(n){return t=this,[2,new Promise((function(n,r){try{var i=function(e){var o=e.data,a=JSON.parse(o),s=a.Cmd,c=(a.Encrypt,a.Content),d=JSON.parse(c);if("UpdateTranscodConf"===s){t.removeMessageEventListener(i);var u=d.Code;0===u?n():(O.error("Update Transcod Config failure, code => ",u),r(u))}};t.addMessageEventListener(i);var o={Cmd:"UpdateTranscodConf"};o.AppId=t._appId,o.Content=JSON.stringify(Object.assign({},e)),t.send(o)}catch(e){r(e)}}))]}))}))},n.prototype.doStopTask=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e,i;return m(this,(function(o){try{e=function(i){var o=i.data,a=JSON.parse(o),s=a.Cmd,c=(a.Encrypt,a.Content),d=JSON.parse(c);if("StopTask"===s){t.removeMessageEventListener(e);var u=d.Code;0===u?n():(O.error("Stop Task failure, code => ",u),r(u))}},t.addMessageEventListener(e),(i={}).Cmd="StopTask",i.AppId=t._appId,i.Content="",t.send(i)}catch(e){r(e)}return[2]}))}))}))},n.prototype.disconnect=function(t){var n=this;if(n._stopKeepAlive(),n._clearKeepALiveTimeout(),n.clear(),t){if("UID_BANNED"===t)n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.UID_BANNED)}else n._emitConnectionState("DISCONNECTED",e.ConnectionDisconnectedReason.LEAVE)},n.prototype.clearEventEmitter=function(){this.removeAllListeners()},n.prototype._setConnectTimeout=function(){var t=this;t._clearConnectTimeout(),t._connectTimeout=window.setTimeout((function(){t._emitConnectionState("DISCONNECTING",e.ConnectionDisconnectedReason.CONNECT_TIME_OUT)}),1e4)},n.prototype._startKeepAlive=function(){var e=this;e._stopKeepAlive(),e.doKeepAlive(),e._keepALiveInterval=window.setInterval((function(){e.doKeepAlive()}),e._keepALiveIntervalTime)},n.prototype._stopKeepAlive=function(){this._keepALiveInterval&&clearInterval(this._keepALiveInterval)},n.prototype._clearConnectTimeout=function(){this._connectTimeout&&clearTimeout(this._connectTimeout)},n.prototype._clearKeepALiveTimeout=function(){var e=this;e._keepAliveTimeout&&(clearTimeout(e._keepAliveTimeout),e._keepAliveTimeout=0)},n.prototype._emitConnectionState=function(e,t){"DISCONNECTED"===e&&O.debug("[signal] media task websocket closed, reason: ".concat(t)),this._revState=this._curState,this._curState=e,this.handleMediaServerEvents&&this.handleMediaServerEvents("connection-state-change",{curState:this._curState,revState:this._revState,reason:t})},n}(j),yt=function(e){function t(t,n){void 0===n&&(n=!1);var r=e.call(this)||this;return r._joinInfo={},r._taskType=0,r._taskContent={},r._taskServer=null,r._taskStatus=0,r._isTrans=!1,r._joinInfo=t,r._isTrans=n,r}return _(t,e),t.prototype.startTask=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,d,u,l,p,_,h,f,E;return m(this,(function(m){switch(m.label){case 0:if(m.trys.push([0,13,,14]),1===this._taskStatus)throw new J(c.INVALID_OPERATION,"The task is in progress.");return t=e.Type,n._taskType=t,n._taskContent=e,n._taskStatus=0,[4,new It(n._joinInfo).joinGateway({fType:n._taskType,isTrans:n._isTrans})];case 1:if(o=m.sent(),a=o.code,s=o.addresses,0!==a)return[3,11];if(!s||s instanceof Array&&0===s.length)throw i("NO_EX_SERVER"),new J("Can not find service list");m.label=2;case 2:m.trys.push([2,8,9,10]),d=v(s),u=d.next(),m.label=3;case 3:return u.done?[3,7]:(l=u.value,e.AcsToken="",(p=new Ct).init({appId:n._joinInfo.appId,isWss:l.wss,url:l.addr,port:l.port}),n._taskServer=p,[4,p.connect()]);case 4:return m.sent(),O.debug("media task connect success"),p.handleMediaServerEvents=function(e,t){"connection-state-change"===e?n.emit("ConnectionStateChanged",t):"StateChanged"!==e&&"GotEvent"!==e||n.emit(e,t)},[4,p.doStartTask(e)];case 5:return m.sent(),n._taskStatus=1,r(),[3,7];case 6:return u=d.next(),[3,3];case 7:return[3,10];case 8:return _=m.sent(),f={error:_},[3,10];case 9:try{u&&!u.done&&(E=d.return)&&E.call(d)}finally{if(f)throw f.error}return[7];case 10:return 0===n._taskStatus&&i("NEED_RECONNECT"),[3,12];case 11:i("START_TASK_FAILED"),m.label=12;case 12:return[3,14];case 13:return h=m.sent(),n._taskStatus=0,i(h),[3,14];case 14:return[2]}}))}))}))},t.prototype.updateTask=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o;return m(this,(function(a){switch(a.label){case 0:return a.trys.push([0,5,,6]),1!==n._taskStatus?[3,3]:"{}"===JSON.stringify(n._taskContent)?[3,2]:[4,null===(o=n._taskServer)||void 0===o?void 0:o.doUpdateTask(e)];case 1:a.sent(),a.label=2;case 2:return r(),[3,4];case 3:throw new J("The task has not yet begun");case 4:return[3,6];case 5:return t=a.sent(),i(t),[3,6];case 6:return[2]}}))}))}))},t.prototype.stopTask=function(){var e,t,n=this;if(1!==this._taskStatus)throw new J("The task has not yet begun");"{}"!==JSON.stringify(n._taskContent)&&(null===(e=n._taskServer)||void 0===e||e.doStopTask(),null===(t=n._taskServer)||void 0===t||t.disconnect(),n._taskStatus=2)},t}(x),At=function(e){function t(t){var n=e.call(this)||this;return n._joinInfo={},n._startRequestTime=0,n._url="",n._extendConf="",n.injectStreamTask=new Map,n.limitTaskCount=1,n._joinInfo=t,n}return _(t,e),t.prototype.startInjectStream=function(e,t){var n=this;void 0===t&&(t="");var r=this;return new Promise((function(i,o){return f(n,void 0,void 0,(function(){return m(this,(function(n){switch(n.label){case 0:if(r.injectStreamTask.get(e)||r.injectStreamTask.size>=r.limitTaskCount)throw r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_START_ALREADY_EXISTS,e),new J(c.INVALID_OPERATION,"can not addInjectStreamUrl, task already exiting.");return r.injectStreamTask.size<r.limitTaskCount?(r._startRequestTime=Date.now(),r._url=e,r._extendConf=t,[4,r._startInjectStream(r._url,r._extendConf)]):[3,2];case 1:return n.sent(),i(),[3,2];case 2:return[2]}}))}))}))},t.prototype.stopInjectStream=function(){var e=this,t=this;if(0===t.injectStreamTask.size||!t.injectStreamTask.get(t._url)){var n=s.INJECT_STREAM_STATUS_STOP_NOT_FOUND;throw t._emitInjectStreamStatus(n,t._url),new J(c.INVALID_OPERATION,"removeInjectStreamUrl failed, can not find task.")}t.injectStreamTask.forEach((function(n,r){return f(e,void 0,void 0,(function(){var e;return m(this,(function(i){return n.stopTask(),e=s.INJECT_STREAM_STATUS_STOP_SUCCESS,t._emitInjectStreamStatus(e,r),t._url="",[2]}))}))}))},t.prototype._startInjectStream=function(e,t){var n=this;void 0===t&&(t="");var r=this;return new Promise((function(i,o){return f(n,void 0,void 0,(function(){var n,a,c,d;return m(this,(function(u){switch(u.label){case 0:n=new yt(r._joinInfo,!0),a=setTimeout((function(){r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_START_TIMEOUT,e)}),1e4),u.label=1;case 1:return u.trys.push([1,3,,4]),c={Type:0,UserId:r._joinInfo.uid,ChanId:r._joinInfo.cname,Url:e,Conf:t},[4,n.startTask(c)];case 2:return u.sent(),a&&clearTimeout(a),r.injectStreamTask.set(e,n),n.on("StateChanged",(function(e){e.State,e.ErrCode})),r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_START_SUCCESS,e),i(),[3,4];case 3:return d=u.sent(),a&&clearTimeout(a),r._url="","GATEWAY_TIME_OUT"===d?r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_START_TIMEOUT,e):"SERVER_NOT_OPEN"===d?r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_START_UNAUTHORIZED,e):"START_TASK_FAILED"===d||"NO_EX_SERVER"===d?r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_STOP_FAILED,e):"NEED_RECONNECT"===d&&(r._startRequestTime+1e4<Date.now()?r._startInjectStream(r._url,r._extendConf):r._emitInjectStreamStatus(s.INJECT_STREAM_STATUS_STOP_TIMEOUT,e)),o(d),[3,4];case 4:return[2]}}))}))}))},t.prototype._emitInjectStreamStatus=function(e,t){this.emit("stream-inject-status",e,this._joinInfo.uid,t)},t}(x),Rt=function(e){function t(t){var n=e.call(this)||this;return n._joinInfo={},n._liveStreamTranscodeConfig={},n._latestRequestTime=0,n.liveStreamTasks=new Map,n.limitTaskCount=10,n._joinInfo=t,n}return _(t,e),t.prototype.getTranscodingConfig=function(){return this._liveStreamTranscodeConfig},t.prototype.setTranscodingConfig=function(e){this._liveStreamTranscodeConfig=e},t.prototype.updateTranscodingConfig=function(e){var t=this,n=this;return new Promise((function(r,i){try{n._liveStreamTranscodeConfig=e,n.liveStreamTasks.forEach((function(e){return f(t,void 0,void 0,(function(){return m(this,(function(t){switch(t.label){case 0:return[4,e.updateTask(n._liveStreamTranscodeConfig)];case 1:return t.sent(),[2]}}))}))})),r()}catch(e){i(e)}}))},t.prototype.startLiveStreaming=function(e,t){var n=this,r=this;return new Promise((function(i,o){return f(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,p,_;return m(this,(function(h){switch(h.label){case 0:n=setTimeout((function(){var t=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_INVALID_RAW_STREAM);throw r._emitLiveStreamWarning(e,t),t}),1e4),h.label=1;case 1:if(h.trys.push([1,3,,4]),(a=Date.now())-r._latestRequestTime<1e3)throw d=new J(te.LiveStreamingWarningCode.LIVE_STREAMING_WARN_FREQUENT_REQUEST),r._emitLiveStreamWarning(e,d),d;if(r._latestRequestTime=a,"string"!=typeof(s="string"==typeof e?e.toLowerCase():"")||!~s.indexOf("rtmp://")&&!~s.indexOf("http://")&&!~s.indexOf("https://"))throw d=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_INVALID_ARGUMENT,"[LiveStreaming] the url is invalid."),r._emitLiveStreamError(e,d),d;if(r.liveStreamTasks.get(e))throw d=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_TASK_CONFLICT),r._emitLiveStreamError(e,d),d;if(r.liveStreamTasks.size>r.limitTaskCount&&(d=new J(te.LiveStreamingWarningCode.LIVE_STREAMING_WARN_STREAM_NUM_REACH_LIMIT),r._emitLiveStreamWarning(e,d)),c=JSON.stringify(r._liveStreamTranscodeConfig),!t&&"{}"!==c)throw d=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_TRANSCODING_NOT_SUPPORTED),r._emitLiveStreamWarning(e,d),d;return t&&(r._liveStreamTranscodeConfig.Transcode=t),u={Type:2,Transcode:t,UserId:r._joinInfo.uid,ChanId:r._joinInfo.cname,Token:r._joinInfo.token,Url:e,Conf:c},[4,(l=new yt(r._joinInfo,t||!1)).startTask(u)];case 2:return h.sent(),n&&clearTimeout(n),l.on("StateChanged",(function(t){var n=t.State;if(t.ErrCode,0===n)r.liveStreamTasks.set(e,l),i();else if(1===n){var o=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_INTERNAL_SERVER_ERROR);throw r._emitLiveStreamWarning(e,o),o}})),[3,4];case 3:return p=h.sent(),n&&clearTimeout(n),"SERVER_NOT_OPEN"===p?(_=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_PUBLISH_STREAM_NOT_AUTHORIZED),r._emitLiveStreamError(e,_)):"START_TASK_FAILED"!==p&&"NO_EX_SERVER"!==p||(_=new J(te.LiveStreamingErrorCode.LIVE_STREAMING_INTERNAL_SERVER_ERROR),r._emitLiveStreamError(e,_)),o(p),[3,4];case 4:return[2]}}))}))}))},t.prototype.stopLiveStreaming=function(e){var t=this.liveStreamTasks.get(e);if(!t)throw new J(te.BasicErrorCode.INVALID_OPERATION,"can not find live streaming url to stop");t.stopTask()},t.prototype.stopAllLiveStreaming=function(){var e=this;this.liveStreamTasks.forEach((function(t,n){e.stopLiveStreaming(n)}))},t.prototype._emitLiveStreamWarning=function(e,t){this.emit("live-streaming-warning",e,t)},t.prototype._emitLiveStreamError=function(e,t){this.emit("live-streaming-error",e,t)},t}(x);!function(e){e[e.RELAY_STATE_IDLE=0]="RELAY_STATE_IDLE",e[e.RELAY_STATE_CONNECTING=1]="RELAY_STATE_CONNECTING",e[e.RELAY_STATE_RUNNING=2]="RELAY_STATE_RUNNING",e[e.RELAY_STATE_FAILURE=3]="RELAY_STATE_FAILURE"}(it||(it={})),function(e){e[e.NETWORK_DISCONNECTED=0]="NETWORK_DISCONNECTED",e[e.NETWORK_CONNECTED=1]="NETWORK_CONNECTED",e[e.PACKET_JOINED_SRC_CHANNEL=2]="PACKET_JOINED_SRC_CHANNEL",e[e.PACKET_JOINED_DEST_CHANNEL=3]="PACKET_JOINED_DEST_CHANNEL",e[e.PACKET_SENT_TO_DEST_CHANNEL=4]="PACKET_SENT_TO_DEST_CHANNEL",e[e.PACKET_RECEIVED_VIDEO_FROM_SRC=5]="PACKET_RECEIVED_VIDEO_FROM_SRC",e[e.PACKET_RECEIVED_AUDIO_FROM_SRC=6]="PACKET_RECEIVED_AUDIO_FROM_SRC",e[e.PACKET_UPDATE_DEST_CHANNEL=7]="PACKET_UPDATE_DEST_CHANNEL",e[e.PACKET_UPDATE_DEST_CHANNEL_REFUSED=8]="PACKET_UPDATE_DEST_CHANNEL_REFUSED",e[e.PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE=9]="PACKET_UPDATE_DEST_CHANNEL_NOT_CHANGE",e[e.PACKET_UPDATE_DEST_CHANNEL_IS_NULL=10]="PACKET_UPDATE_DEST_CHANNEL_IS_NULL",e[e.VIDEO_PROFILE_UPDATE=11]="VIDEO_PROFILE_UPDATE"}(ot||(ot={})),function(e){e[e.RELAY_OK=0]="RELAY_OK",e[e.SERVER_ERROR_RESPONSE=1]="SERVER_ERROR_RESPONSE",e[e.SERVER_NO_RESPONSE=2]="SERVER_NO_RESPONSE",e[e.NO_RESOURCE_AVAILABLE=3]="NO_RESOURCE_AVAILABLE",e[e.FAILED_JOIN_SRC=4]="FAILED_JOIN_SRC",e[e.FAILED_JOIN_DEST=5]="FAILED_JOIN_DEST",e[e.FAILED_PACKET_RECEIVED_FROM_SRC=6]="FAILED_PACKET_RECEIVED_FROM_SRC",e[e.FAILED_PACKET_SENT_TO_DEST=7]="FAILED_PACKET_SENT_TO_DEST",e[e.SERVER_CONNECTION_LOST=8]="SERVER_CONNECTION_LOST",e[e.INTERNAL_ERROR=9]="INTERNAL_ERROR",e[e.SRC_TOKEN_EXPIRED=10]="SRC_TOKEN_EXPIRED",e[e.DEST_TOKEN_EXPIRED=11]="DEST_TOKEN_EXPIRED"}(at||(at={}));var gt,Nt=function(e){function t(t){var n=e.call(this)||this;return n._joinInfo={},n._state=it.RELAY_STATE_IDLE,n.limitDestChannelCount=4,n._joinInfo=t,n}return _(t,e),t.prototype.startChannelRelay=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,d,u;return m(this,(function(l){switch(l.label){case 0:if(l.trys.push([0,2,,3]),!(t=e.getSrcChannelMediaInfo()))throw new J(c.INVALID_PARAMS,"srcChannelMediaInfo should not be empty");if(0===(o=e.getDestChannelMediaInfo()).size)throw new J(c.INVALID_PARAMS,"destChannelMediaInfo should not be empty");return o.size,n.limitDestChannelCount,n._state=it.RELAY_STATE_CONNECTING,(a={}).SrcChanId=t.channelName,a.SrcUserId=t.uid,a.SrcToken=t.token,a.DstInfos=[],o.forEach((function(e){a.DstInfos.push({ChanId:e.channelName,UserId:e.uid,Token:e.token})})),s={Type:1,Transcode:!1,UserId:n._joinInfo.uid,ChanId:n._joinInfo.cname,Token:n._joinInfo.token,Url:"",Conf:JSON.stringify(a)},[4,(d=new yt(n._joinInfo)).startTask(s)];case 1:return l.sent(),n._state=it.RELAY_STATE_RUNNING,n._emitChannelMediaRelayEvent(ot.NETWORK_CONNECTED),n._emitChannelMediaRelayState(n._state,at.RELAY_OK),n.channelMediaRelayTask=d,d.on("ConnectionStateChanged",(function(e){var t=e.curState;e.revState,e.reason,"DISCONNECTED"===t&&(n._emitChannelMediaRelayEvent(ot.NETWORK_DISCONNECTED),n._state=it.RELAY_STATE_FAILURE)})),d.on("GotEvent",(function(e){var t=e.Event;void 0!==t&&n._emitChannelMediaRelayEvent(t)})),d.on("StateChanged",(function(e){var t=e.State,r=e.ErrCode;r>0&&r<10?n._emitChannelMediaRelayState(t,8):n._emitChannelMediaRelayState(t,r)})),r(),[3,3];case 2:return u=l.sent(),n._state=it.RELAY_STATE_FAILURE,i(u),[3,3];case 3:return[2]}}))}))}))},t.prototype.stopChannelRelay=function(){var e;null===(e=this.channelMediaRelayTask)||void 0===e||e.stopTask()},t.prototype.updateChannelRelay=function(e){var t,n=this,r=e.getSrcChannelMediaInfo();if(!r)throw new J(c.INVALID_PARAMS,"srcChannelMediaInfo should not be empty");var i=e.getDestChannelMediaInfo();if(0===i.size)throw new J(c.INVALID_PARAMS,"destChannelMediaInfo should not be empty");var o={};o.SrcChanId=r.channelName,o.SrcUserId=r.uid,o.SrcToken=r.token,o.DstInfos=[],i.forEach((function(e){o.DstInfos.push({ChanId:e.channelName,UserId:e.uid,Token:e.token})}));var a={Type:1,Transcode:!1,UserId:n._joinInfo.uid,ChanId:n._joinInfo.cname,Token:n._joinInfo.token,Url:"",Conf:JSON.stringify(o)};null===(t=n.channelMediaRelayTask)||void 0===t||t.updateTask(a)},t.prototype._emitChannelMediaRelayEvent=function(e){this.emit("channel-media-relay-event",ot[e])},t.prototype._emitChannelMediaRelayState=function(e,t){this.emit("channel-media-relay-state",it[e],at[t])},t}(x);!function(e){e[e.Idle=0]="Idle",e[e.Subscribing=1]="Subscribing",e[e.Done=2]="Done"}(gt||(gt={}));var Ot=function(){function t(t){this.subAudioState=gt.Idle,this.subVideoState=gt.Idle,this._streamOpen=!1,this._video_added_=!1,this._video_enabled_=!1,this._video_muted_=!1,this._vidCodecType="H264",this._audCodecType="Opus",this._canvasCtx=null,this._audio_added_=!1,this._audio_enabled_=!1,this._audio_muted_=!1,this._videoCache=!1,this._pubSid=!1,this._dualStream=!1,this._subStreamType=e.RemoteStreamType.HIGH_STREAM,this._currentFallbackStreamType=e.RemoteStreamFallbackType.DISABLE,this._fallbackType=e.RemoteStreamFallbackType.DISABLE,this._fallbackRecoverFlagTimes=0,this._fallbackFallbackFlagTimes=0,this._reOnlineTimer=null,this.uid=t}return Object.defineProperty(t.prototype,"hasAudio",{get:function(){return this._audio_enabled_&&this._audio_added_&&!this._audio_muted_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasVideo",{get:function(){return this._video_enabled_&&this._video_added_&&!this._video_muted_},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"audioTrack",{get:function(){var e;return null===(e=this._mediaStream)||void 0===e?void 0:e.audioTrack},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"videoTrack",{get:function(){var e;return null===(e=this._mediaStream)||void 0===e?void 0:e.videoTrack},enumerable:!1,configurable:!0}),t}(),bt=function(){function e(){this.queue=[],this.isProcessing=!1}return e.prototype.enqueue=function(e){var t=this;return new Promise((function(n,r){var i={task:e,resolve:n,reject:r};t.queue.push(i),t.isProcessing||t.processQueue()}))},e.prototype.processQueue=function(){return f(this,void 0,void 0,(function(){var e,t,n,r,i,o;return m(this,(function(a){switch(a.label){case 0:if(this.isProcessing=!0,!(this.queue.length>0))return[3,7];e=this.queue.shift(),t=e.task,n=e.resolve,r=e.reject,a.label=1;case 1:return a.trys.push([1,3,4,7]),[4,t()];case 2:return i=a.sent(),n&&n(i),[3,7];case 3:return o=a.sent(),r&&r(o),[3,7];case 4:return[4,R(50)];case 5:return a.sent(),[4,this.processQueue()];case 6:return a.sent(),[7];case 7:return this.isProcessing=!1,[2]}}))}))},e.prototype.clearQueue=function(){return f(this,void 0,void 0,(function(){return m(this,(function(e){return this.queue.length=0,this.isProcessing=!1,[2]}))}))},e}(),Dt=function(t){function n(n){var r=t.call(this)||this;if(r.channelName=void 0,r.connectionState="DISCONNECTED",r.uid="",r._appId="",r._clientId="",r._sessionId="",r._config={mode:"rtc",codec:"h264",role:"host"},r._joinInfo={},r._iotDevice=!1,r._iotFrametRate=7,r._iotEncoderTimer=null,r._turnServer=void 0,r._latestEventLts={},r._latestRepInfo={},r._AVStatsControls=void 0,r._reportStatsInterval=0,r._statsCollector=void 0,r._subStreamInfo=new Map,r._publishAsyncQueue=new bt,r._pendingTracks=[],r._highStream=void 0,r._lowStream=void 0,r._isDualStreamEnabled=!1,r._lowStreamParameter={},r._liveStreamClient=null,r._injectStreamClient=null,r._channelMediaRelayClient=null,r._AudioVolumeIndicator=!1,r._AudioVolumeIndicatorInterval=0,r._bindEnabledTracks=[],r._handleLocalTrackEnable=function(){},r._handleLocalTrackDisable=function(){},r._handleLocalTrackMuted=function(){},r._handleLocalTrackUnMuted=function(){},r._handelLocalVideoTrackReplace=function(){},r._handleLocalVideoTrackProfileChange=function(){},r._handleLocalAudioTrackRouteChange=function(){},r._handleLocalVideoTrackSetOptimizationMode=function(){},r.remoteUsersQualityInterval=0,r.localNetworkQualityInterval=0,r._remoteUserNetworkQuality={},r._publisherDownloadQuality=0,r._publisherUploadQuality=0,r.handleBrowserOffLine=function(){var t,n;O.info("[network-indicator] network state changed, ONLINE -> OFFLINE"),"CONNECTED"!==r.connectionState&&"CONNECTING"!==r.connectionState&&"RECONNECTING"!==r.connectionState||(null===(t=r._gateway)||void 0===t||t.doOffline(r._joinInfo.sid),r.connectionState="DISCONNECTED",null===(n=r._gateway)||void 0===n||n.disconnectCTS(e.ConnectionDisconnectedReason.NETWORK_OFFLINE))},r._handleLocalNetworkQualityInterval=function(){var e=r;r.localNetworkQualityInterval&&clearInterval(r.localNetworkQualityInterval),r.localNetworkQualityInterval=window.setInterval((function(){var t,n={downlinkNetworkQuality:e._publisherDownloadQuality,uplinkNetworkQuality:e._publisherUploadQuality};e.emit(F.NETWORK_QUALITY,n),C.UPLOAD_LOCAL_NETWORK_QUALITY&&(null===(t=e._gateway)||void 0===t||t.uploadUserQuality(n.uplinkNetworkQuality,n.downlinkNetworkQuality))}),2e3)},r._getRemoteDownlinkNetworkQuality=function(){var e=r,t={},n=e.getRemoteAudioStats(),i=e.getRemoteVideoStats();return Object.keys(n).map((function(e){var r=n[e],o=i[e],a=function(e,t){return e<=3?t<=30?1:t>500?5:t>400?4:t>100?3:2:e<=10?t<=30?1:t<=50?3:4:e<=25?t<=30?3:t<=50?4:5:e<=60?t<=35?4:t<=100?5:6:t<=50?5:6}(Math.round((r.packetLossRate+o.packetLossRate)/2*100),(r.rtt+o.rtt)/2);t[e]=a})),t},r._handleRemoteUserRxQInterval=function(){var t=r;r.remoteUsersQualityInterval&&clearInterval(r.remoteUsersQualityInterval),r.remoteUsersQualityInterval=window.setInterval((function(){var n=0,i=t._getRemoteDownlinkNetworkQuality();Object.keys(i).forEach((function(o){return f(r,void 0,void 0,(function(){var r,a,s,c,d,u,l;return m(this,(function(p){switch(p.label){case 0:return r=i[o],n+=r,(a=t._subStreamInfo.get(o))&&0!==a._fallbackType?(s=a._fallbackType,c=a._currentFallbackStreamType,r>3?(a._fallbackRecoverFlagTimes=0,a._fallbackFallbackFlagTimes+=1,a._fallbackFallbackFlagTimes<10?[2]:c<e.RemoteStreamFallbackType.LOW_STREAM&&a._dualStream&&(a._currentFallbackStreamType=e.RemoteStreamFallbackType.LOW_STREAM,0===a._subStreamType)?((null==a?void 0:a.hasVideo)&&(null===(d=t._gateway)||void 0===d||d.setRemoteVideoStreamType(a.uid,1),t.emit("stream-type-changed",a.uid,1),O.info("[".concat(this._clientId,"] remote user ").concat(o," stream fallback, streamType: 1"))),t.emit("stream-fallback",a.uid,"fallback"),We.remoteSubscribeFallbackToAudioOnly(t._joinInfo.sid,{cname:t.channelName,extend:{isFallbackOrRecover:1}}),a._fallbackFallbackFlagTimes=0,[2]):s===e.RemoteStreamFallbackType.AUDIO_ONLY&&c<e.RemoteStreamFallbackType.AUDIO_ONLY&&a.audioTrack?(t.emit("stream-fallback",a.uid,"fallback"),We.remoteSubscribeFallbackToAudioOnly(t._joinInfo.sid,{cname:t.channelName,extend:{isFallbackOrRecover:1}}),[4,t.unsubscribe(a,"video")]):[3,2]):[3,3]):[2];case 1:p.sent(),t.emit("user-unpublished",a,"video"),a._currentFallbackStreamType=e.RemoteStreamFallbackType.AUDIO_ONLY,p.label=2;case 2:return[3,4];case 3:if(a._fallbackRecoverFlagTimes+=1,a._fallbackFallbackFlagTimes=0,a._fallbackRecoverFlagTimes>=10)if(a._currentFallbackStreamType===e.RemoteStreamFallbackType.AUDIO_ONLY){if(t.emit("stream-fallback",a.uid,"recover"),We.remoteSubscribeFallbackToAudioOnly(t._joinInfo.sid,{cname:t.channelName,extend:{isFallbackOrRecover:0}}),t.emit("user-published",a,"video"),a._dualStream)return(null==a?void 0:a.hasVideo)&&(null===(u=t._gateway)||void 0===u||u.setRemoteVideoStreamType(a.uid,1),t.emit("stream-type-changed",a.uid,1),O.info("[".concat(this._clientId,"] remote user ").concat(o," stream recover, streamType: 1"))),a._currentFallbackStreamType=e.RemoteStreamFallbackType.LOW_STREAM,a._fallbackRecoverFlagTimes=0,[2];a._currentFallbackStreamType=e.RemoteStreamFallbackType.DISABLE}else a._currentFallbackStreamType===e.RemoteStreamFallbackType.LOW_STREAM&&0===a._subStreamType&&((null==a?void 0:a.hasVideo)&&(null===(l=t._gateway)||void 0===l||l.setRemoteVideoStreamType(a.uid,0),t.emit("stream-type-changed",a.uid,0),O.info("[".concat(this._clientId,"] remote user ").concat(o," stream recover, streamType: 0"))),t.emit("stream-fallback",a.uid,"recover"),We.remoteSubscribeFallbackToAudioOnly(t._joinInfo.sid,{cname:t.channelName,extend:{isFallbackOrRecover:0}}),a._currentFallbackStreamType=e.RemoteStreamFallbackType.DISABLE);p.label=4;case 4:return[2]}}))}))})),t._publisherDownloadQuality=0===n?1:Math.round(n/Object.keys(i).length)}),2e3)},n){n.codec;var i=n.mode,o=n.role;"live"!==i||o||(n.role="audience"),r._config=Object.assign(r._config,n),"rtc"===i&&(r._config.role="host"),r._config.codec="h264"}return r._clientId="".concat(y(5)),O.info("[".concat(r._clientId,"] Initializing RTC client ").concat(C.SDK_VERSION," build: ").concat(C.SDK_BUILD,", mode: ").concat(r._config.mode,", codec: ").concat(r._config.codec)),r._handleLocalTrackEnable=function(e){~r._bindEnabledTracks.indexOf(e)&&r._publish([e])},r._handleLocalTrackDisable=function(e){if(~r._bindEnabledTracks.indexOf(e)){var t=r._highStream.audioTrack,n=r._highStream.videoTrack,i=!(n&&n.enabled||0!==(null==t?void 0:t.trackList.length));r._unPublish(i?r.localTracks:[e])}},r._handleLocalTrackMuted=function(e){var t,n,i,o;"video"===e.trackMediaType?null===(t=r._gateway)||void 0===t||t.muteLocalVideoStream(!0):"audio"===e.trackMediaType&&(null===(n=r._gateway)||void 0===n||n.muteLocalAudioStream(!0),(null===(i=r._highStream)||void 0===i?void 0:i.audioTrack)&&(null===(o=r._highStream)||void 0===o?void 0:o.audioTrack).setAudioTrackMuted(e,!0))},r._handleLocalTrackUnMuted=function(e){var t,n,i,o,a,s;!(null===(t=r._highStream)||void 0===t?void 0:t.hasTrack(e))&&(null===(n=r._highStream)||void 0===n||n.addTracks([e])),"video"===e.trackMediaType?null===(i=r._gateway)||void 0===i||i.muteLocalVideoStream(!1):"audio"===e.trackMediaType&&(null===(o=r._gateway)||void 0===o||o.muteLocalAudioStream(!1),(null===(a=r._highStream)||void 0===a?void 0:a.audioTrack)&&(null===(s=r._highStream)||void 0===s?void 0:s.audioTrack).setAudioTrackMuted(e,!1))},r._handelLocalVideoTrackReplace=function(e){if(r._highStream&&(r._highStream.replaceTrack(e),r._lowStream)){var t=e.clone();try{var n=r._highStream.videoTrack.getMediaStreamTrack().getSettings(),i=n.width,o=n.height,a={width:160,height:160,framerate:15,bitrate:68};i>o?9*i==16*o?(a.width=192,a.height=108,a.bitrate=50):3*i==4*o?(a.width=160,a.height=120,a.bitrate=45):(a.width=160,a.height=160*o/i,a.bitrate=68):i<o?16*i==9*o?(a.width=108,a.height=192,a.bitrate=50):4*i==3*o?(a.width=120,a.height=160,a.bitrate=45):(a.width=160,a.height=160*i/o,a.bitrate=68):i==o&&(a.width=160,a.height=160,a.bitrate=68),r._lowStreamParameter=a}catch(e){}t.applyConstraints(h({width:320,height:240,framerate:15},r._lowStreamParameter)),r._lowStream.replaceTrack(t)}},r._handleLocalVideoTrackProfileChange=function(e){We.videoProfileChange(r._joinInfo.sid,{cname:r.channelName})},r._handleLocalAudioTrackRouteChange=function(e,t,n){We.audioRouteChange(r._joinInfo.sid,{errorCode:-1,extend:{route:n}})},r._handleLocalVideoTrackSetOptimizationMode=function(e){r._highStream&&r._highStream.setOptimizationMode(e)},r._setAVStatsRepTimer(),r}return _(n,t),Object.defineProperty(n.prototype,"remoteUsers",{get:function(){var e=[];return this._subStreamInfo.forEach((function(t){e.push({uid:t.uid,hasAudio:t.hasAudio,hasVideo:t.hasVideo,audioTrack:t.audioTrack,videoTrack:t.videoTrack})})),e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localTracks",{get:function(){return this._highStream?this._highStream.getAllTracks():[]},enumerable:!1,configurable:!0}),n.prototype.join=function(t,n,r,i){return f(this,void 0,void 0,(function(){var o,a,s,d,u,l;return m(this,(function(p){switch(p.label){case 0:if(O.info("[".concat(this._clientId,"] start join channel ").concat(n)),(o=this)._latestEventLts.joinStartTime=Date.now(),"DISCONNECTED"!==o.connectionState)throw new J(c.INVALID_PARAMS,"Client already in ".concat(o.connectionState," state"));if("string"!=typeof t)throw new J(c.INVALID_PARAMS,"appid must be string.");if(""===t)throw new J(c.INVALID_PARAMS,"appid can not be empty.");if(o._appId=t,o._joinInfo.appId=t,a=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,"string"!=typeof n)throw new J(c.INVALID_PARAMS,"channel must be string.");if(!a.test(n))throw new J(c.INVALID_PARAMS,"The channel length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,");if(o.channelName=n,o._joinInfo.cname=o.channelName,s=/^[a-zA-Z0-9 \!\#\$\%\&\(\)\+\-\:\;\<\=\.\>\?\@\[\]\^\_\{\}\|\~\,]{1,64}$/,""!==i&&null!=i&&!s.test(i))throw new J(c.INVALID_PARAMS,"The uid length must be within 64 bytes. The supported characters: a-z,A-Z,0-9,space,!, #, $, %, &, (, ), +, -, :, ;, <, =, ., >, ?, @, [, ], ^, _, {, }, |, ~, ,");return o._joinInfo.uid=i,o._createMediaServerInstance(),o._joinInfo.sid=y(32),o._joinInfo.joinStartTime=new Date,o._joinInfo.token=r||"",[4,W(o._authGateWay())];case 1:if(d=E.apply(void 0,[p.sent(),2]),u=d[0],l=d[1],u){switch(o._joinInfo.uid="",o._joinInfo.cname="",o._joinInfo.token="",u.code){case"CHANNEL_BANNED":case"IP_BANNED":case"SERVER_ERROR":case"UID_BANNED":case"DEVELOPER_INVALID":case"APP_INVALID":case"NO_ACTIVE_STATUS":case"TOKEN_INVALID":o.emit("connection-state-change","DISCONNECTING","CONNECTING",e.ConnectionDisconnectedReason[u]);break;case"TOKEN_EXPIRED":o.emit("token-privilege-did-expire"),O.debug("[".concat(this._clientId,"] token privilege did expire."))}return[2,Promise.reject(u)]}return o._registerOffLineListener(),O.info("[".concat(this._clientId,"] join channel ").concat(this.channelName," success")),[2,l]}}))}))},n.prototype.leave=function(){var e,t,n;return f(this,void 0,void 0,(function(){var r,i;return m(this,(function(o){return r=this,O.info("[".concat(this._clientId,"] leaving channel")),this._iotDevice&&this._iotEncoderTimer&&(clearInterval(this._iotEncoderTimer),this._iotEncoderTimer=null),r._stopAllMediaTask(),Object.keys(r._joinInfo).length>0&&("CONNECTED"===r.connectionState&&(null===(e=r._gateway)||void 0===e||e.doOffline(r._joinInfo.sid),null===(t=r._gateway)||void 0===t||t.disconnectCTS(),null===(n=r._gateway)||void 0===n||n.removeAllListeners(),r._gateway=void 0),r.remoteUsersQualityInterval&&clearInterval(r.remoteUsersQualityInterval),this.localNetworkQualityInterval&&clearInterval(this.localNetworkQualityInterval),r._AudioVolumeIndicator&&(r._AudioVolumeIndicator=!1,clearInterval(r._AudioVolumeIndicatorInterval)),r._subStreamInfo.forEach((function(e){e._mediaStream&&e._mediaStream.destroy(),r._unsubscribe(e)})),r._sessionId="",r._subStreamInfo.clear(),r._msSub=[],r.uid="",r._joinInfo={},r._statsCollector&&r._statsCollector.clear(),r._latestRepInfo={},this._isDualStreamEnabled=!1,r._highStream&&(r._highStream.destroy(),r._highStream=void 0),r._lowStream&&(r._lowStream.destroy(),r._lowStream=void 0),i=Date.now(),We.leave(r._joinInfo.sid,{startTime:i,extend:null})),this._deregisterOffLineListener(),[2]}))}))},n.prototype.publish=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,d,u,l,p,_;return m(this,(function(h){switch(h.label){case 0:if(h.trys.push([0,6,,7]),e instanceof Array||(e=[e]),t=e.filter((function(e){if(e instanceof ne){if(e.enabled)return!0;throw new J(L.TRACK_IS_DISABLED,"can not publish a disabled track: ".concat(e.getTrackId()))}})),!n._joinInfo||"CONNECTED"!==n.connectionState)return[3,4];if("live"===n._config.mode&&"audience"===n._config.role)throw new J(b.INVALID_OPERATION,"audience can not publish stream");return t.length>0?[4,W(n._publish(t))]:[3,2];case 1:if(o=E.apply(void 0,[h.sent(),1]),a=o[0])throw a;try{for(s=v(t),d=s.next();!d.done;d=s.next())u=d.value,~n._bindEnabledTracks.indexOf(u)||(u.on(F.TRACK_ENABLED,n._handleLocalTrackEnable),u.on(F.TRACK_DISABLED,n._handleLocalTrackDisable),u.on(F.TRACK_MUTED,n._handleLocalTrackMuted),u.on(F.TRACK_UNMUTED,n._handleLocalTrackUnMuted),"video"===u.trackMediaType&&(u.on(F.REPLACE_TRACK,n._handelLocalVideoTrackReplace),u.on(F.RTC_NEED_RENEGOTIATE,n._handleLocalVideoTrackProfileChange),u.on(F.SET_OPTIMIZATION_MODE,n._handleLocalVideoTrackSetOptimizationMode)),"audio"===u.trackMediaType&&u.on(F.AUDIO_ROUTE_CHANGE,n._handleLocalAudioTrackRouteChange),n._bindEnabledTracks.push(u))}catch(e){p={error:e}}finally{try{d&&!d.done&&(_=s.return)&&_.call(s)}finally{if(p)throw p.error}}return r(),[3,3];case 2:throw new Error(L.INVALID_LOCAL_TRACK);case 3:return[3,5];case 4:throw new J(c.INVALID_OPERATION,"Can't publish stream when connection state is not connected");case 5:return[3,7];case 6:return l=h.sent(),i(l),[3,7];case 7:return[2]}}))}))}))},n.prototype.unpublish=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,c,d=this;return m(this,(function(u){switch(u.label){case 0:return e?!(e instanceof Array)&&(e=[e]):e=this.localTracks,e.some((function(e){return"video"===e.trackMediaType}))&&this._iotDevice&&this._iotEncoderTimer&&(clearInterval(this._iotEncoderTimer),this._iotEncoderTimer=null),t=e.filter((function(e){return e instanceof ne&&d.localTracks.includes(e)})),n._joinInfo&&"CONNECTED"===n.connectionState&&this._highStream&&t.length>0?[4,W(this._unPublish(t))]:[3,2];case 1:if(o=E.apply(void 0,[u.sent(),1]),a=o[0])return[2,i(a)];u.label=2;case 2:for(s=e.length-1;s>-1;s--)c=e[s],this._bindEnabledTracks.includes(c)&&(c.off(F.TRACK_ENABLED,this._handleLocalTrackEnable),c.off(F.TRACK_DISABLED,this._handleLocalTrackDisable),c.off(F.TRACK_MUTED,n._handleLocalTrackMuted),c.off(F.TRACK_UNMUTED,n._handleLocalTrackUnMuted),"video"===c.trackMediaType&&(c.off(F.REPLACE_TRACK,this._handelLocalVideoTrackReplace),c.off(F.RTC_NEED_RENEGOTIATE,this._handleLocalVideoTrackProfileChange)),"audio"===c.trackMediaType&&c.off(F.AUDIO_ROUTE_CHANGE,this._handleLocalAudioTrackRouteChange),n._bindEnabledTracks.splice(s,1));return r(),[2]}}))}))}))},n.prototype._createDoSubscribeFuture=function(e,t,n){var r=this;return new G((function(i){return f(r,void 0,void 0,(function(){var r,o,a,s,c,d;return m(this,(function(u){switch(u.label){case 0:return[4,null===(d=this._gateway)||void 0===d?void 0:d.doSubscribe({StreamId:e.uid,SvrIp:this._msSub[0].ip,SvrPort:this._msSub[0].port,RecvAudio:t,RecvVideo:n,StrmType:e._subStreamType,PubSessId:e._pubSid,VideoCache:e._videoCache,VidCodecType:e._vidCodecType,AudCodecType:e._audCodecType})];case 1:return r=u.sent(),0!==r.Code?[3,2]:(a=(o=r).StreamId,s=o.Offer,i({StreamId:a,Offer:s}),[3,5]);case 2:return[4,(l=1e3,f(void 0,void 0,void 0,(function(){return m(this,(function(e){return[2,new Promise((function(e){return setTimeout((function(){return e}),l)}))]}))})))];case 3:return u.sent(),[4,this._createDoSubscribeFuture(e,t,n)];case 4:c=u.sent(),i(c),u.label=5;case 5:return[2]}var l}))}))}))},n.prototype.subscribe=function(e,t){var n=this,r=this;return O.info("[".concat(this._clientId,"] subscribe user ").concat(e.uid,", mediaType: ").concat(t)),new Promise((function(i,o){return f(n,void 0,void 0,(function(){var n,a,s,d,u,l,p,_,h,f,v,E;return m(this,(function(m){switch(m.label){case 0:if(m.trys.push([0,5,6,7]),!r._gateway)throw new J(c.INVALID_OPERATION,"call this api before join");if(!(n=r._subStreamInfo.get(e.uid)))throw new J(P.INVALID_REMOTE_USER,"can not subscribe ".concat(e.uid,", this user is not in the channel"));if("video"!==t&&"audio"!==t)throw new J(c.INVALID_PARAMS,"mediaType must be 'video' or 'audio'");if(a=n.hasVideo,s=n.hasAudio,d=a&&"video"===t,u=s&&"audio"===t,"video"===t&&!a||"audio"===t&&!s)throw new J(P.REMOTE_USER_IS_NOT_PUBLISHED,"can not subscribe ".concat(e.uid," with mediaType ").concat(t,", remote track is not published"));return l=Date.now(),p={startTime:l,cname:r.channelName,peerid:e.uid},_=this._subStreamInfo.get(e.uid),u?[4,n._waitForSubscribeAudio.promise]:[3,2];case 1:h=m.sent(),_.subAudioState===gt.Idle&&(_.subAudioState=gt.Subscribing,null===(v=r._gateway)||void 0===v||v.setAVStatus(e.uid,"audio"===t?u:s,"video"===t?d:a)),_.subAudioState===gt.Subscribing&&(_.subAudioState=gt.Done,p.errorCode=!0,We.subscribeAudio(this._joinInfo.sid,p)),!n.audioTrack&&n._mediaStream.addTracks("audio"),i(h),m.label=2;case 2:return d?[4,n._waitForSubscribeVideo.promise]:[3,4];case 3:h=m.sent(),_.subVideoState===gt.Idle&&(_.subVideoState=gt.Subscribing,null===(E=r._gateway)||void 0===E||E.setAVStatus(e.uid,"audio"===t?u:s,"video"===t?d:a)),_.subVideoState===gt.Subscribing&&(_.subVideoState=gt.Done,p.errorCode=!0,We.subscribeVideo(this._joinInfo.sid,p)),!n.videoTrack&&n._mediaStream.addTracks("video"),i(h),m.label=4;case 4:return[3,7];case 5:return f=m.sent(),o(f),[3,7];case 6:return[7];case 7:return[2]}}))}))}))},n.prototype.unsubscribe=function(e,t){var n=this,r=this;return new Promise((function(i,o){var a,s;try{var c=r._subStreamInfo.get(e.uid);if(!c)return;if("video"===t&&c.subVideoState===gt.Idle||"audio"===t&&c.subAudioState===gt.Idle){var d=new J(P.INVALID_REMOTE_USER,"can not unsubscribe ".concat(e.uid," with mediaType ").concat(t,", remote track is not subscribed"));O.warning(d),i()}r._unsubscribe(c,t);var u={startTime:Date.now(),cname:r.channelName,peerid:e.uid};O.info("[".concat(n._clientId,"] unsubscribe uid: ").concat(e.uid,", mediaType: ").concat(t)),c.subAudioState===gt.Idle&&c.subVideoState===gt.Idle?null===(a=r._gateway)||void 0===a||a.setAVStatus(e.uid,!1,!1):null===(s=r._gateway)||void 0===s||s.setAVStatus(e.uid,"audio"!==t&&c.hasAudio,"video"!==t&&c.hasVideo),"video"===t&&We.unsubscribeVideo(n._joinInfo.sid,u),"audio"===t&&We.unsubscribeAudio(n._joinInfo.sid,u),O.info("[".concat(n._clientId,"] unsubscribe success uid: ").concat(e.uid,", mediaType: ").concat(t)),i()}catch(d){o(d)}}))},n.prototype.getLocalAudioStats=function(){return this._highStream&&this._highStream.audioTrack?this._statsCollector.getLocalAudioTrackStats(this._highStream.ID):{sendVolumeLevel:0,sendBitrate:0,sendBytes:0,sendPackets:0,sendPacketsLost:0,sendPacketsLostRate:0}},n.prototype.getLocalVideoStats=function(){return this._highStream&&this._highStream.videoTrack?this._statsCollector.getLocalVideoTrackStats(this._highStream.ID):{sendBytes:0,sendBitrate:0,sendPackets:0,sendPacketsLost:0,sendPacketsLostRate:0,sendResolutionHeight:0,sendResolutionWidth:0,captureResolutionHeight:0,captureResolutionWidth:0,targetSendBitrate:0,totalDuration:0,totalFreezeTime:0}},n.prototype.getRemoteAudioStats=function(){var e=this,t={};return this._subStreamInfo.forEach((function(n){var r=n._mediaStream;r&&(t[n.uid]=r.audioTrack?e._statsCollector.getRemoteAudioTrackStats(n.uid):{codecType:"opus",end2EndDelay:0,freezeRate:0,packetLossRate:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receiveLevel:0,receivePackets:0,receivePacketsLost:0,totalDuration:0,totalFreezeTime:0,transportDelay:0,rtt:0})})),t},n.prototype.getRemoteVideoStats=function(){var e=this,t={};return e._subStreamInfo.forEach((function(n){var r=n._mediaStream;if(r){var i=e._statsCollector.getRemoteVideoTrackStats(n.uid);t[n.uid]=r.videoTrack?i:{codecType:"H264",decodeFrameRate:0,end2EndDelay:0,freezeRate:0,packetLossRate:0,receiveBitrate:0,receiveBytes:0,receiveDelay:0,receiveFrameRate:0,receivePackets:0,receivePacketsLost:0,receiveResolutionHeight:0,receiveResolutionWidth:0,renderFrameRate:0,totalDuration:0,totalFreezeTime:0,transportDelay:0,rtt:0}}})),t},n.prototype.setLowStreamParameter=function(e){if(!e)throw new J(c.INVALID_PARAMS,"streamParameter must be object");O.debug("[".concat(this._clientId,"] set low stream parameter as ").concat(JSON.stringify(e)));var t=e.framerate,n=e.height,r=e.width,i=e.bitrate;if(this._isDualStreamEnabled&&this._lowStream){var o={};t&&(o.frameRate=t>15?15:t),n&&(o.height=n),r&&(o.width=r),this._lowStream.applyVideoConstraints(o)}else this._lowStreamParameter={framerate:t,height:n,width:r,bitrate:i}},n.prototype.enableDualStream=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e;return m(this,(function(i){try{if(!0===t._isDualStreamEnabled)return e=new J(c.INVALID_OPERATION,"Dual stream is already enabled."),O.warning(e),r(e),[2];if(t._isDualStreamEnabled=!0,"{}"!==JSON.stringify(t._joinInfo)&&"CONNECTED"===t.connectionState){if(!t._highStream||!t._highStream.videoTrack)return[2];t._publishS()}n()}catch(e){r(e)}return[2]}))}))}))},n.prototype.disableDualStream=function(){var e=this;return new Promise((function(t,n){try{!0===e._isDualStreamEnabled&&(e._unPublishS(),e._isDualStreamEnabled=!1),t()}catch(e){n(e)}}))},n.prototype.setParameters=function(e){var t=e.ConfPriCloudAddr,n=e.ConfPriCloudAddr1,r=e.ConfPriMediaAddr,i=e.SetTurnSvr,o=e.ConfPriEventAddr,a=e.UserQuality,s=e.AudioVolumeInterval,c=e.AreaCode,d=e.Region,u=e.ConfIOT;if(O.debug("[".concat(this._clientId,"] set parameters config as ").concat(JSON.stringify(e))),t){var l=t.ServerAdd,p=t.Port,_=!0;"boolean"==typeof(h=t.Wss)&&(_=h),C.GATEWAY_ADDRESS_SSL!==_&&(C.GATEWAY_ADDRESS_SSL=_),C.GATEWAY_ADDRESS1&&(C.GATEWAY_ADDRESS1=""),l&&(C.GATEWAY_ADDRESS=(_?"https://".concat(l):"http://"+l)+(p?":"+p:""))}if(n){l=n.ServerAdd,p=n.Port,_=!0;"boolean"==typeof(h=n.Wss)&&(_=h),C.GATEWAY_ADDRESS_SSL!==_&&(C.GATEWAY_ADDRESS_SSL=_),l&&(C.GATEWAY_ADDRESS1=(_?"https://".concat(l):"http://"+l)+(p?":"+p:""))}if(~C.GATEWAY_ADDRESS.indexOf(C.EVENT_REPORT_DOMAIN)||We.setBasicUrl("",""),r){l=r.ServerAdd,p=r.Port,_=!0;"boolean"==typeof(h=r.Wss)&&(_=h),C.TASK_GATEWAY_ADDRESS_SSL!==_&&(C.TASK_GATEWAY_ADDRESS_SSL=_),l&&(C.TASK_GATEWAY_ADDRESS=(_?"https://".concat(l):"http://"+l)+(p?":"+p:""))}if(i&&(this._turnServer=i),o){l=o.ServerAdd,p=o.Port;var h=o.Wss;if(l){_=!0;"boolean"==typeof h&&(_=h);var f=(_?"https://".concat(l):"http://"+l)+(p?":"+p:"");We.setBasicUrl(f,f)}}if(a){var m=a.Enable;"boolean"==typeof m&&(C.UPLOAD_LOCAL_NETWORK_QUALITY=m)}if("number"==typeof s&&(C.AUDIO_VOLUME_INDICATOR_INTERVAL=s,this._AudioVolumeIndicator&&(this._AudioVolumeIndicator=!1,clearInterval(this._AudioVolumeIndicatorInterval),this.enableAudioVolumeIndicator())),"number"==typeof c&&(C.AREA_CODE=c),"string"==typeof d&&(C.Region=d),u){var v=u.Enabled,E=u.FrameRate;this._iotDevice=null!=v&&v,this._iotFrametRate=E||7}},n.prototype.setClientRole=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a;return m(this,(function(s){switch(s.label){case 0:return s.trys.push([0,4,,5]),"rtc"===n._config.mode?(t=new J(c.INVALID_OPERATION,"rtc mode can not use setClientRole"),O.warning(t),i(t),[2]):"audience"===e&&n._highStream?(t=new J(c.INVALID_OPERATION,"can not set client role to audience when publishing stream"),O.warning(t),i(t),[2]):e===n._config.role?[3,3]:(n._config.role=e,"{}"===JSON.stringify(n._joinInfo)||"CONNECTED"!==n.connectionState?[3,2]:[4,null===(a=n._gateway)||void 0===a?void 0:a.setClientRole(e)]);case 1:s.sent(),s.label=2;case 2:O.info("[".concat(this._clientId,"] set client role to ").concat(e)),We.roleChange(this._joinInfo.sid,{cname:n.channelName,extend:{role:"host"===this._config.role?1:"audience"===this._config.role?2:0}}),s.label=3;case 3:return r(),[3,5];case 4:return o=s.sent(),i(o),[3,5];case 5:return[2]}}))}))}))},n.prototype.setRemoteVideoStreamType=function(e,t){var n=this,r=this;return new Promise((function(i,o){var a;try{if("number"!=typeof t)throw new J(c.INVALID_PARAMS,"streamType must be number");var s=r._subStreamInfo.get(e);if(s){if(!s._dualStream)throw new J(c.INVALID_OPERATION,"The remote user ".concat(e," did not enable the dual stream"));(null==s?void 0:s.hasVideo)&&(null===(a=r._gateway)||void 0===a||a.setRemoteVideoStreamType(e,t),r.emit("stream-type-changed",e,t),O.info("[".concat(n._clientId,"] set remote user ").concat(e," video streamType as ").concat(t))),s._subStreamType=t}i()}catch(e){o(e)}}))},n.prototype.setStreamFallbackOption=function(e,t){var n=this,r=this;return new Promise((function(i,o){try{if("number"==typeof t){O.debug("[".concat(n._clientId,"] set remote user ").concat(e," stream fallback type as ").concat(t));var a=r._subStreamInfo.get(e);a&&(a._fallbackType=t)}i()}catch(e){o(e)}}))},n.prototype.setEncryptionConfig=function(e,t){"string"==typeof t&&(O.debug("[".concat(this._clientId,"] set encryption config: encryptionMode as ").concat(e)),this._gateway&&this._gateway.setEncryptionSecret(t))},n.prototype.getRemoteNetworkQuality=function(){return this._remoteUserNetworkQuality},n.prototype.renewToken=function(e){var t=this,n=this;return new Promise((function(r,i){var o;try{if("CONNECTED"!==n.connectionState)throw new J(c.INVALID_OPERATION,"renewToken should not be called before user join");O.info("[".concat(t._clientId,"] set new token")),t._joinInfo.token=e,null===(o=n._gateway)||void 0===o||o.doReNewToken(e),r()}catch(e){i(e)}}))},n.prototype.enableAudioVolumeIndicator=function(){var e=this;e._AudioVolumeIndicator||(e._AudioVolumeIndicator=!0,e._AudioVolumeIndicatorInterval=window.setInterval((function(){var t=[],n=e.getLocalAudioStats();t.push({uid:e.uid,level:Math.round(n.sendVolumeLevel/32767*100)});var r=e.getRemoteAudioStats();for(var i in r)i&&t.push({uid:i,level:Math.round(r[i].receiveLevel/32767*100)});e.emit("volume-indicator",t)}),C.AUDIO_VOLUME_INDICATOR_INTERVAL))},n.prototype.getRTCStats=function(){var e;return null===(e=this._statsCollector)||void 0===e?void 0:e.getRTCStats()},n.prototype.setLiveTranscoding=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,d,u,l,p,_,h,f,v,E,S,T,I,C,y,A,R,g,N,O,b,D,k,w;return m(this,(function(m){switch(m.label){case 0:if(m.trys.push([0,4,,5]),"{}"===Object.prototype.toString.call(e))throw k=new J(c.INVALID_PARAMS,"[LiveTranscoding] the config is invalid."),i(k),k;if(t=e.audioBitrate,o=e.audioChannels,a=e.audioSampleRate,s=e.backgroundColor,d=e.backgroundImage,u=e.height,l=e.transcodingUsers,p=e.videoBitrate,_=e.videoCodecProfile,h=e.videoFrameRate,f=e.videoGop,v=e.watermark,E=e.width,(S={}).AudioBitrate="number"==typeof t?t>128?128:t:48,S.AudioChannels="number"==typeof o?o>5?5:o:1,S.AudioSampleRate="number"==typeof a?a>48e3?48e3:a:44100,S.BackgroundColor="number"==typeof s?s:0,"[object Object]"===Object.prototype.toString.call(d)){if(R=(T=d).alpha,I=T.height,N=T.url,C=T.width,b=T.x,D=T.y,"string"!=typeof N||""===N)throw k=new J(c.INVALID_PARAMS,"[LiveTranscoding] the background url can not be empty."),i(k),k;S.BackGround={},S.BackGround.Url=N,S.BackGround.Alpha="number"==typeof R&&R>=0&&R<=1?R:1,S.BackGround.Height="number"==typeof I?I:160,S.BackGround.Width="number"==typeof C?C:160,S.BackGround.X="number"==typeof b?b:0,S.BackGround.Y="number"==typeof D?D:0}if(S.Height="number"==typeof u?0!==u&&u<64?64:u:360,void 0!==l&&"[object Array]"===Object.prototype.toString.call(l)&&(null==l?void 0:l.length)>0&&(y=[],l.map((function(e){var t=e.alpha,n=e.audioChannel,r=e.height,o=e.uid,a=e.width,s=e.x,d=e.y,u=e.zOrder,l={};if("string"!=typeof o||""===o){var p=new J(c.INVALID_PARAMS,"[LiveTranscoding] the transcodingUsers uid can not be empty.");throw i(p),p}l.UserId=o,l.Alpha="number"==typeof t&&t>=0&&t<=1?t:1,l.AudioChannel="number"==typeof n&&n>=0&&n<=5?n:0,l.Height="number"==typeof r?r:640,l.Width="number"==typeof a?a:360,l.X="number"==typeof s?s:0,l.Y="number"==typeof d?d:0,l.ZOrder="number"==typeof u&&u>=0&&u<=100?u:0,y.push(l)})),S.TransUser=y,S.UserCount=y.length),S.VideoBitrate="number"==typeof p?p:400,"number"==typeof _&&~[66,77,100].indexOf(_)?S.VideoCodecProfile=_:S.VideoCodecProfile=100,S.VideoFramerate="number"==typeof h?h>30?30:h:15,S.VideoGop="number"==typeof f?f:30,"[object Object]"===Object.prototype.toString.call(v)){if(R=(A=v).alpha,g=A.height,N=A.url,O=A.width,b=A.x,D=A.y,"string"!=typeof N||""===N)throw k=new J(c.INVALID_PARAMS,"[LiveTranscoding] the watermark url can not be empty."),i(k),k;S.WaterMark={},S.WaterMark.Url=N,S.WaterMark.Alpha="number"==typeof R&&R>=0&&R<=1?R:1,S.WaterMark.Height="number"==typeof g?g:160,S.WaterMark.Width="number"==typeof O?O:160,S.WaterMark.X="number"==typeof b?b:0,S.WaterMark.Y="number"==typeof D?D:0}return S.Width="number"==typeof E?0!==E&&E<64?64:E:640,n._liveStreamClient?[4,n._liveStreamClient.updateTranscodingConfig(S)]:[3,2];case 1:return m.sent(),[3,3];case 2:n._initLiveStreamClient(),n._liveStreamClient.setTranscodingConfig(S),r(),m.label=3;case 3:return[3,5];case 4:return w=m.sent(),i(w),[3,5];case 5:return[2]}}))}))}))},n.prototype.startLiveStreaming=function(e,t){var n=this,r=this;return new Promise((function(i,o){return f(n,void 0,void 0,(function(){var n,a,s;return m(this,(function(d){switch(d.label){case 0:if(d.trys.push([0,2,,3]),r._initLiveStreamClient(),t&&"{}"===Object.prototype.toString.call(null===(a=r._liveStreamClient)||void 0===a?void 0:a.getTranscodingConfig()))throw new J(c.INVALID_OPERATION,"[LiveStreaming] no transcoding config found, can not start transcoding streaming task");return[4,null===(s=r._liveStreamClient)||void 0===s?void 0:s.startLiveStreaming(e,!!t)];case 1:return d.sent(),i(),[3,3];case 2:return n=d.sent(),o(n),[3,3];case 3:return[2]}}))}))}))},n.prototype.stopLiveStreaming=function(e){var t=this;return new Promise((function(n,r){try{if(null===t._liveStreamClient)throw new J(c.INVALID_OPERATION,"ArRTCError INVALID_OPERATION: can not find live streaming url to stop");t._liveStreamClient.stopLiveStreaming(e),t._liveStreamClient=null,n()}catch(e){r(e)}}))},n.prototype.addInjectStreamUrl=function(e,t){var n=this,r=this;return new Promise((function(i,o){return f(n,void 0,void 0,(function(){var n,a,s,d,u,l,p,_,f,v,E,S,T,I;return m(this,(function(m){switch(m.label){case 0:if(m.trys.push([0,2,,3]),""===r.uid)throw new J(c.INVALID_OPERATION,"can not addInjectStreamUrl, no joinInfo");return n={audioBitrate:48,audioChannels:1,audioSampleRate:44100,audioVolume:100,height:0,videoBitrate:400,videoFramerate:15,videoGop:30,width:0},"[object Object]"!==Object.prototype.toString.call(t)&&(t={}),a=h(h({},n),t),s=a.audioBitrate,d=a.audioChannels,u=a.audioSampleRate,l=a.audioVolume,p=a.height,_=a.videoBitrate,f=a.videoFramerate,v=a.videoGop,E=a.width,S={},"number"==typeof s&&(S.AudioBitrate=s),"number"==typeof d&&(S.AudioChannels=d),"number"==typeof u&&(S.AudioSampleRate=u),"number"==typeof l&&(S.AudioVolume=l),"number"==typeof p&&(S.Height=p),"number"==typeof _&&(S.VideoBitrate=_),"number"==typeof f&&(S.VideoFramerate=f),"number"==typeof v&&(S.VideoGop=v),"number"==typeof E&&(S.Width=E),r._initInjectStreamClient(),[4,null===(I=r._injectStreamClient)||void 0===I?void 0:I.startInjectStream(e,JSON.stringify(S))];case 1:return m.sent(),i(),[3,3];case 2:return T=m.sent(),o(T),[3,3];case 3:return[2]}}))}))}))},n.prototype.removeInjectStreamUrl=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){return m(this,(function(e){try{if(null===t._injectStreamClient)throw new J(c.INVALID_OPERATION,"ArRTCError INVALID_OPERATION: can not remove addInjectStreamUrl, no joinInfo or inject task");t._injectStreamClient.stopInjectStream(),t._injectStreamClient=null,n()}catch(e){r(e)}return[2]}))}))}))},n.prototype.startChannelMediaRelay=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t;return m(this,(function(o){try{if(""===n.uid)throw new J(c.INVALID_OPERATION,"can not addInjectStreamUrl, client role must to be host");if("object"!=typeof e)throw new J(c.INVALID_PARAMS,"config is invalid");n._initChannelMediaRelayClient(),null===(t=n._channelMediaRelayClient)||void 0===t||t.startChannelRelay(e),r()}catch(e){i(e)}return[2]}))}))}))},n.prototype.updateChannelMediaRelay=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t;return m(this,(function(o){try{if(""===n.uid)throw new J(c.INVALID_OPERATION,"can not addInjectStreamUrl, client role must to be host");if("object"!=typeof e)throw new J(c.INVALID_PARAMS,"config is invalid");null===(t=n._channelMediaRelayClient)||void 0===t||t.updateChannelRelay(e),r()}catch(e){i(e)}return[2]}))}))}))},n.prototype.stopChannelMediaRelay=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e;return m(this,(function(i){try{t._channelMediaRelayClient&&(null===(e=t._channelMediaRelayClient)||void 0===e||e.stopChannelRelay(),t._channelMediaRelayClient=null),n()}catch(e){r(e)}return[2]}))}))}))},n.prototype._registerOffLineListener=function(){"undefined"!=typeof document&&window.addEventListener("offline",this.handleBrowserOffLine)},n.prototype._deregisterOffLineListener=function(){"undefined"!=typeof document&&window.removeEventListener("offline",this.handleBrowserOffLine)},n.prototype._publish=function(e,t){var n=this;void 0===t&&(t=!1);var r=this;return r._publishAsyncQueue.enqueue((function(){return new Promise((function(i,o){return f(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,p,_,h,f,S,T,I,C,y,A,R,g,N,b,D,k,w,L,P,M,U,V,B,x,j,G,H,K=this;return m(this,(function(m){switch(m.label){case 0:return m.trys.push([0,9,,10]),r._latestEventLts.publishStartLts=Date.now(),n={startTime:r._latestEventLts.publishStartLts,cname:r.channelName},r._highStream||(r._highStream=new _t(r.uid,r._statsCollector,r._joinInfo),r._highStream.on(F.CONNECTION_STATE_CHANGE,(function(e,t,n){"connected"===n&&i(),r._handlePeerConnectionEvent.call(r,F.CONNECTION_STATE_CHANGE,e,t,n)})),r._highStream.on(F.ICE_CANDIDATE,r._handlePeerConnectionEvent.bind(r,F.ICE_CANDIDATE)),r._highStream.on(F.FIRST_FRAME_DECODED,(function(){r._setAVStatsRepTimer()})),r._highStream.on(F.VIDEO_SIZE_CHANGE,(function(){r._setAVStatsRepTimer()}))),a=r.localTracks,s=e.map((function(e){return e.trackMediaType})),0!==a.length?[3,6]:(c=s.includes("audio"),d=s.includes("video"),u=e.filter((function(e){return"video"===e.trackMediaType})),l=e.filter((function(e){return"audio"===e.trackMediaType})),[4,W(r._gateway.doPublish({LocalAudioEnable:c,LocalVideoEnable:d,LocalAudioMute:!!c&&l.every((function(e){return!0===e.muted})),LocalVideoMute:!!d&&u.every((function(e){return!0===e.muted})),DualStream:r._isDualStreamEnabled,AudCodecType:this._iotDevice?"PCMA":"Opus",VidCodecType:this._iotDevice?"MJpg":"H264"},this._iotDevice,r._turnServer))]);case 1:return p=E.apply(void 0,[m.sent(),2]),_=p[0],h=p[1],_?[2,o(_)]:0!==h.Code?[3,4]:(n.errorCode=!0,t&&(this._pendingTracks=[]),this._highStream.initTracks(),f=h.StreamId,S=h.Offer,[4,W(r._highStream.createAnswer(S))]);case 2:return T=E.apply(void 0,[m.sent(),2]),I=T[0],C=T[1],I?[2,o(I)]:(null===(x=r._gateway)||void 0===x||x.sendAnswer(f,C,!1),this._iotDevice&&(N=e.find((function(e){return"video"===e.trackMediaType})))&&(y=Pe(N.getMediaStreamTrack(),{width:240,height:240}),document.body.appendChild(y),this._iotEncoderTimer=setInterval((function(){var e,t=Me(y);t.imgData;var n=t.imgUrl;null===(e=K._gateway)||void 0===e||e.sendIotImageData(f,n)}),1e3/this._iotFrametRate)),D=this._iotDevice?e.filter((function(e){return"video"!==e.trackMediaType})):e,[4,W(this._highStream.addTracks(D))]);case 3:return A=E.apply(void 0,[m.sent(),1]),(w=A[0])?[2,o(w)]:(d&&r._isDualStreamEnabled&&r._publishS(),this._handleLocalNetworkQualityInterval(),R=D.map((function(e){return e.getTrackId()})),O.info("[".concat(this._clientId,"] publish tracks, success id: ").concat(R.join(""))),(g=null===(j=r._highStream.videoTrack)||void 0===j?void 0:j.optimizationMode)&&r._highStream.videoTrack&&r._highStream.setOptimizationMode(g),[3,5]);case 4:n.errorCode=!1,O.error("publish failure, need republish"),m.label=5;case 5:return[3,8];case 6:return this._iotDevice&&(N=e.find((function(e){return"video"===e.trackMediaType})))&&(b=Pe(N.getMediaStreamTrack(),{width:240,height:240}),document.body.appendChild(b),this._iotEncoderTimer=setInterval((function(){var e,t=Me(b);t.imgData;var n=t.imgUrl;null===(e=K._gateway)||void 0===e||e.sendIotImageData(K.uid,n)}),1e3/this._iotFrametRate)),D=this._iotDevice?e.filter((function(e){return"video"!==e.trackMediaType})):e,[4,W(this._highStream.addTracks(D))];case 7:if(k=E.apply(void 0,[m.sent(),1]),w=k[0])return[2,o(w)];try{for(L=v(D),P=L.next();!P.done;P=L.next())(M=P.value)instanceof nt&&(null===(G=r._gateway)||void 0===G||G.enableLocalAudio(!0)),M instanceof ct&&(null===(H=r._gateway)||void 0===H||H.enableLocalVideo(!0),r._isDualStreamEnabled&&r._publishS())}catch(e){V={error:e}}finally{try{P&&!P.done&&(B=L.return)&&B.call(L)}finally{if(V)throw V.error}}i(),m.label=8;case 8:return[3,10];case 9:return U=m.sent(),o(U),[3,10];case 10:return[2]}}))}))}))}))},n.prototype._unPublish=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,d,u=this;return m(this,(function(l){switch(l.label){case 0:if(l.trys.push([0,4,,5]),!n._highStream)throw new J(c.INVALID_OPERATION,"You haven't published track yet");return t=e.map((function(e){return e.getTrackId()})),O.info("[".concat(this._clientId,"] UnPublish tracks, id: ").concat(t.join(""),", isClosePC: ").concat(n.localTracks.every((function(t,n){return t===e[n]})))),e.length===n.localTracks.length&&n.localTracks.every((function(t,n){return t===e[n]}))?(o=e.some((function(e){return"video"===e.trackMediaType})),a=e.some((function(e){return"audio"===e.trackMediaType})),o&&We.videoLocalDisable(n._joinInfo.sid,{cname:n.channelName}),a&&We.audioLocalDisable(n._joinInfo.sid,{cname:n.channelName}),null===(d=n._gateway)||void 0===d||d.doUnPublish(),[4,n._highStream.removeTracks(e)]):[3,2];case 1:return l.sent(),n._highStream.destroy(),n._highStream.clearOriginTracks(),n._highStream=void 0,n._unPublishS(),this.localNetworkQualityInterval&&clearInterval(this.localNetworkQualityInterval),e.map((function(e){"video"===e.trackMediaType&&(e.off(F.REPLACE_TRACK,u._handelLocalVideoTrackReplace),e.off(F.RTC_NEED_RENEGOTIATE,u._handleLocalVideoTrackProfileChange)),"audio"===e.trackMediaType&&e.off(F.AUDIO_ROUTE_CHANGE,u._handleLocalAudioTrackRouteChange)})),[3,3];case 2:e.map((function(e){return f(u,void 0,void 0,(function(){var t,r;return m(this,(function(i){switch(i.label){case 0:return[4,n._highStream.removeTracks(e,!1)];case 1:return i.sent(),e instanceof nt&&(0===n.localTracks.filter((function(e){return e instanceof nt})).length&&(null===(t=n._gateway)||void 0===t||t.enableLocalAudio(!1)),We.audioLocalDisable(n._joinInfo.sid,{cname:n.channelName})),e instanceof ct&&(null===(r=n._gateway)||void 0===r||r.enableLocalVideo(!1),We.videoLocalDisable(n._joinInfo.sid,{cname:n.channelName}),n._unPublishS()),[2]}}))}))})),l.label=3;case 3:return O.info("[".concat(this._clientId,"] unPublish success, id: ").concat(t.join(""))),r(),[3,5];case 4:return s=l.sent(),i(s),[3,5];case 5:return[2]}}))}))}))},n.prototype._publishS=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e,i,o,a,s,c,d,u,l,p,_,f,v,S,T,I;return m(this,(function(m){switch(m.label){case 0:return t._isDualStreamEnabled?(t._lowStream||(t._lowStream=new ht(t.uid,t._statsCollector,t._joinInfo),t._lowStream.on(F.CONNECTION_STATE_CHANGE,t._handlePeerConnectionEvent.bind(t,F.CONNECTION_STATE_CHANGE)),t._lowStream.on(F.ICE_CANDIDATE,t._handlePeerConnectionEvent.bind(t,F.ICE_CANDIDATE))),[4,t._gateway.doPublishS(t._turnServer)]):[3,4];case 1:if(e=m.sent(),0!==(i=e.Code))return[3,3];o=e.StreamId,a=e.Offer,s=t._highStream.videoTrack.getMediaStreamTrack().clone(),c=new ct(s,t._highStream.videoTrack.encoderConfig?t._highStream.videoTrack.encoderConfig:{},t._highStream.videoTrack.optimizationMode,y(5)),t._lowStream.addTrack(c);try{d=t._highStream.videoTrack.getMediaStreamTrack().getSettings(),u=d.width,l=d.height,p={width:160,height:160,framerate:15,bitrate:68},u>l?9*u==16*l?(p.width=192,p.height=108,p.bitrate=50):3*u==4*l?(p.width=160,p.height=120,p.bitrate=45):(p.width=160,p.height=160*l/u,p.bitrate=68):u<l?16*u==9*l?(p.width=108,p.height=192,p.bitrate=50):4*u==3*l?(p.width=120,p.height=160,p.bitrate=45):(p.width=160,p.height=160*u/l,p.bitrate=68):u==l&&(p.width=160,p.height=160,p.bitrate=68),this._lowStreamParameter=p,t.setLowStreamParameter(h({},this._lowStreamParameter))}catch(e){}return[4,W(t._lowStream.createAnswer(a))];case 2:return _=E.apply(void 0,[m.sent(),2]),f=_[0],v=_[1],f?[2,r(f)]:(null===(T=t._gateway)||void 0===T||T.sendAnswer(o,v,!0),null===(I=t._gateway)||void 0===I||I.enableDualStream(!0),O.info("[".concat(this._clientId,"] enable dual stream")),n(),[3,4]);case 3:S="[".concat(this._clientId,"] publish lower stream failed : ").concat(i),O.error(S),r(S),m.label=4;case 4:return[2]}}))}))}))},n.prototype._unPublishS=function(){var e=this,t=this;return new Promise((function(n,r){return f(e,void 0,void 0,(function(){var e,r;return m(this,(function(i){return t._isDualStreamEnabled&&this._lowStream?(t._lowStream.destroy(),t._lowStream=void 0,null===(e=t._gateway)||void 0===e||e.doUnPublishS(),null===(r=t._gateway)||void 0===r||r.enableDualStream(!1),n(),[2]):[2]}))}))}))},n.prototype._initInjectStreamClient=function(){var e,t=this;t._injectStreamClient||(t._injectStreamClient=new At(t._joinInfo),null===(e=t._injectStreamClient)||void 0===e||e.on("stream-inject-status",(function(e,n,r){t.emit("stream-inject-status",e,n,r)})))},n.prototype._initLiveStreamClient=function(){var e=this;e._liveStreamClient||(e._liveStreamClient=new Rt(e._joinInfo),e._liveStreamClient.on("live-streaming-warning",(function(t,n){e.emit("live-streaming-warning",t,n)})),e._liveStreamClient.on("live-streaming-error",(function(t,n){e.emit("live-streaming-error",t,n)})))},n.prototype._initChannelMediaRelayClient=function(){var e=this;e._channelMediaRelayClient||(e._channelMediaRelayClient=new Nt(e._joinInfo),e._channelMediaRelayClient.on("channel-media-relay-event",(function(t){e.emit("channel-media-relay-event",t)})),e._channelMediaRelayClient.on("channel-media-relay-state",(function(t,n){e.emit("channel-media-relay-state",t,n)})))},n.prototype._stopAllMediaTask=function(){this._channelMediaRelayClient&&this.stopChannelMediaRelay(),this._liveStreamClient&&this._liveStreamClient.stopAllLiveStreaming()},n.prototype._authGateWay=function(){return f(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,s,c,d,u,l,p,_,h,f,v,S;return m(this,(function(m){switch(m.label){case 0:return t=new q((e=this)._joinInfo),n=Date.now(),r={},[4,W(t.joinGateway({extend:"",proxyServer:""}))];case 1:if(o=E.apply(void 0,[m.sent(),2]),a=o[0],s=o[1],a)return a===K.DEVELOPER_INVALID||a===K.UID_BANNED||a===K.IP_BANNED||a===K.CHANNEL_BANNED||a===K.SERVER_NOT_OPEN?[2,Promise.reject(new J(b[a]))]:a===K.APPID_INVALID?[2,Promise.reject(new J(b.NO_ACTIVE_STATUS))]:a===K.TOKEN_EXPIRED?[2,Promise.reject(new J(b.TOKEN_EXPIRED,"You must request a new token from your server and call join to use the new token to join the channel"))]:a===K.TOKEN_INVALID?[2,Promise.reject(new J(b.TOKEN_INVALID,"make sure token is right and try again please"))]:a===K.TIMEOUT?[2,Promise.reject(new J(b.UNEXPECTED_RESPONSE))]:[2,Promise.reject(new J(b.UNEXPECTED_ERROR))];if(c=s.uid,d=s.code,u=s.session_id,l=s.addresses,i=u,e._joinInfo.uid=c,Object.assign(r,{apResponse:s,clientId:e._clientId,appId:e._appId,cname:e.channelName,uid:e.uid,turnServer:{},proxyServer:void 0,token:e._joinInfo.token?e._joinInfo.token:"",useProxyServer:!1,startTime:Date.now()}),i&&(e._sessionId=i,We.sessionInit(e._joinInfo.sid,{uid:c,cid:i,cname:e.channelName,appid:e._appId,mode:"rtc"===e._config.mode?0:"live"===e._config.mode?1:"game"===e._config.mode&&2,role:e._config.role,errorCode:d})),!l||l instanceof Array&&0===l.length)throw new J("Can not find service list");return e._msSub=l.filter((function(e){return 1===e.type})),[4,W(e._connectMediaServer(s))];case 2:return p=E.apply(void 0,[m.sent(),1]),(_=p[0])?[2,Promise.reject(_)]:(h={ChanId:e.channelName,ChanSId:e._sessionId,UserId:e._joinInfo.uid,UserSId:e._joinInfo.sid,SdkVer:C.SDK_VERSION,VCodec:e._config.codec,Role:e._config.role,AcsToken:e._joinInfo.token||"",ChanType:"live"===e._config.mode?1:0},[4,W(e._gateway.doOnline(h))]);case 3:return f=E.apply(void 0,[m.sent(),2]),v=f[0],S=f[1],v?[2,Promise.reject(v)]:(S&&(this._statsCollector=new Tt(this._clientId),this._handleRemoteUserRxQInterval()),We.joinGateway(e._joinInfo.sid,{joinStartTime:e._latestEventLts.joinStartTime,startTime:n,uid:S,cid:i,extend:null,errorCode:0}),e.uid=S,r.uid=e.uid,Object.assign(e._joinInfo,r),[2,e.uid])}}))}))},n.prototype._connectMediaServer=function(t){var n=this,r=this,i=t.addresses;t.detail[8];var o=Date.now(),a=i.filter((function(e){return 0===e.type}));return new Promise((function(t,s){return f(n,void 0,void 0,(function(){var n,d,u,l,p,_,h,f,S,T,I=this;return m(this,(function(m){switch(m.label){case 0:if(n=!1,!(a.length>0))return[3,9];m.label=1;case 1:m.trys.push([1,6,7,8]),d=v(a),u=d.next(),m.label=2;case 2:return u.done?[3,5]:(l=u.value,null===(S=r._gateway)||void 0===S||S.init({appId:r._appId,isWss:l.wss,url:l.ip,port:l.port}),[4,W(r._gateway.connectCTS())]);case 3:if(p=E.apply(void 0,[m.sent(),1]),!p[0])return t(),n=!0,We.chooseServer(r._joinInfo.sid,{startTime:o,extend:null,chooseServer:{},serverList:i,errorCode:0}),[3,5];m.label=4;case 4:return u=d.next(),[3,2];case 5:return[3,8];case 6:return _=m.sent(),h={error:_},[3,8];case 7:try{u&&!u.done&&(f=d.return)&&f.call(d)}finally{if(h)throw h.error}return[7];case 8:return n||(Date.now()-r._joinInfo.joinStartTime<C.GATEWAY_RETRY_TIMEOUT?setTimeout((function(){I._authGateWay()}),1e3):r.emit("connection-state-change","DISCONNECTING",null===(T=r._gateway)||void 0===T?void 0:T._revState,e.ConnectionDisconnectedReason.NETWORK_ERROR)),[3,10];case 9:s(c.CAN_NOT_GET_GATEWAY_SERVER),m.label=10;case 10:return[2]}}))}))}))},n.prototype._unsubscribe=function(e,t){var n,r,i,o,a,s,c=this._subStreamInfo.get(e.uid);if(!c)throw new J("user ".concat(e.uid," is not find"));return void 0!==t&&"video"!==t||c.subVideoState===gt.Idle||(null===(n=c._mediaStream)||void 0===n||n.removeTracks("video"),c.subVideoState===gt.Subscribing&&(null===(i=null===(r=c._waitForSubscribeVideo)||void 0===r?void 0:r.reject)||void 0===i||i.call(r)),c.subVideoState=gt.Idle),void 0!==t&&"audio"!==t||c.subAudioState===gt.Idle||(null===(o=c._mediaStream)||void 0===o||o.removeTracks("audio"),c.subAudioState===gt.Subscribing&&(null===(s=null===(a=c._waitForSubscribeAudio)||void 0===a?void 0:a.reject)||void 0===s||s.call(a)),c.subAudioState=gt.Idle),this._setAVStatsRepTimer(),c},n.prototype._republish=function(){var e,t=this;if(t.localTracks.length>0){var n=[];n=n.concat(t.localTracks),this._pendingTracks=n,t._highStream.destroy(!1),t._highStream.createPC(),null===(e=t._gateway)||void 0===e||e.doUnPublish(),t._publish(n,!0),t._lowStream&&(t._lowStream.destroy(),t._lowStream=void 0,t._isDualStreamEnabled?t.enableDualStream():t.disableDualStream())}this._pendingTracks.length>0&&t._publish(this._pendingTracks,!0)},n.prototype._resubscribe=function(e){var t=this,n=this;return O.warning("restart subscribe."),new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,p;return m(this,(function(_){switch(_.label){case 0:return _.trys.push([0,4,,5]),(t=n._subStreamInfo.get(e))?t._streamOpen&&t._mediaStream?(t._waitForDoSubscribe=this._createDoSubscribeFuture(t,t.hasAudio,t.hasVideo),[4,t._waitForDoSubscribe.promise]):[3,3]:[3,3];case 1:return o=_.sent(),a=o.StreamId,s=o.Offer,t._waitForDoSubscribe=void 0,[4,W(t._mediaStream.createAnswer(s,!0))];case 2:if(c=E.apply(void 0,[_.sent(),2]),d=c[0],u=c[1],d)return[2,O.error("[createAnswer]",d)];null===(p=n._gateway)||void 0===p||p.sendAnswer(a,u),_.label=3;case 3:return r(),[3,5];case 4:return l=_.sent(),i(l),[3,5];case 5:return[2]}}))}))}))},n.prototype._calculate=function(){var e=this;if("CONNECTED"===e.connectionState){var t=0,n=0,r=Array.from(this._subStreamInfo.values()).filter((function(e){return e.hasAudio&&e.audioTrack||e.hasVideo&&e.videoTrack}));if(r.length>0)r.map((function(r){var i,o=0;if(r.hasAudio&&r.audioTrack&&t++,r.hasVideo&&r.videoTrack){var a=null===(i=e._statsCollector)||void 0===i?void 0:i.getRemoteVideoTrackStats(r.uid);o=a.receiveResolutionWidth*a.receiveResolutionHeight}n+=o}));else if(e.localTracks.length>0)e.localTracks.find((function(e){return e instanceof nt}))&&(t+=1);e._repRes(t,n)}},n.prototype._repRes=function(e,t){var n=this._latestRepInfo.lts,r={audioNumber:e,videoSize:t,lts:Date.now()};this._gateway&&this._gateway.reportAVStat({TimeUsed:r.lts-n||0,AudNum:r.audioNumber,VidSize:r.videoSize}),this._latestRepInfo=r},n.prototype._setAVStatsRepTimer=function(){var e=this;e._clearAVStatsRepTimer(),e._AVStatsControls=setInterval((function(){e._calculate()}),1e4),e._calculate()},n.prototype._clearAVStatsRepTimer=function(){this._AVStatsControls&&clearInterval(this._AVStatsControls)},n.prototype._checkUserAVStatusAndEmit=function(e,t){var n,r,i,o;return f(this,void 0,void 0,(function(){var a;return m(this,(function(s){switch(s.label){case 0:return(a=this._subStreamInfo.get(e))?"audio"!==t?[3,3]:a.subAudioState!==gt.Subscribing?[3,2]:[4,null===(n=a._waitForSubscribeAudio)||void 0===n?void 0:n.promise]:[3,6];case 1:s.sent(),s.label=2;case 2:return a.subAudioState!==gt.Done||a.hasAudio?a.subAudioState===gt.Idle&&a.hasAudio&&(a._mediaStream&&a._mediaStream.addTracks("audio"),this.emit("user-published",a,"audio"),O.debug("[".concat(this._clientId,"] remote user ").concat(a.uid," set audio track enabled "),a.hasAudio)):(null===(r=this._gateway)||void 0===r||r.setAVStatus(a.uid,a.hasAudio,a.hasVideo),this._unsubscribe(a,"audio"),this.emit("user-unpublished",a,"audio"),O.debug("[".concat(this._clientId,"] remote user ").concat(a.uid," set audio track enabled "),a.hasAudio)),[3,6];case 3:return"video"!==t?[3,6]:a.subVideoState!==gt.Subscribing?[3,5]:[4,null===(i=a._waitForSubscribeVideo)||void 0===i?void 0:i.promise];case 4:s.sent(),s.label=5;case 5:a.subVideoState!==gt.Done||a.hasVideo?a.subVideoState===gt.Idle&&a.hasVideo&&(a._mediaStream&&a._mediaStream.addTracks("video"),this.emit("user-published",a,"video"),O.debug("[".concat(this._clientId,"] remote user ").concat(a.uid," set video track enabled "),a.hasVideo)):(null===(o=this._gateway)||void 0===o||o.setAVStatus(a.uid,a.hasAudio,a.hasVideo),this._unsubscribe(a,"video"),this.emit("user-unpublished",a,"video"),O.debug("[".concat(this._clientId,"] remote user ").concat(a.uid," set audio track enabled "),a.hasVideo)),s.label=6;case 6:return[2]}}))}))},n.prototype._doReconnect=function(){var e,t,n=this;n.remoteUsersQualityInterval&&clearInterval(n.remoteUsersQualityInterval),this.localNetworkQualityInterval&&clearInterval(this.localNetworkQualityInterval),n._latestEventLts={},n._msSub=[],null===(e=n._gateway)||void 0===e||e.removeAllListeners(),n._gateway=void 0,null===(t=n._highStream)||void 0===t||t.destroy(),n._highStream=void 0,n._publishAsyncQueue.clearQueue(),n._joinInfo.sid=y(32),n._createMediaServerInstance(),n._authGateWay().then((function(e){n._subStreamInfo.forEach((function(e){var t,r;null===(t=e._mediaStream)||void 0===t||t.closePC(),null===(r=e._mediaStream)||void 0===r||r.createPC(),e._reOnlineTimer&&clearTimeout(e._reOnlineTimer),e._reOnlineTimer=setTimeout((function(){e._mediaStream&&e._mediaStream.destroy(),e.hasAudio&&e.audioTrack&&n.emit("user-unpublished",e,"audio"),e.hasVideo&&e.videoTrack&&n.emit("user-unpublished",e,"video"),e._reOnlineTimer=null}),1e3)})),n._republish()}))},n.prototype._createMediaServerInstance=function(){var t=this,n=this;n._gateway||(n._gateway=new H),n._gateway.handleMediaServerEvents=function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,p,_,h,v,S,T,I,C,A,R,g,N,b,D,k,w,L,P,M,U,V,B,x,j,H,K,J,Y,z,Q,q,X,Z,$,ee,te,ne,re,ie,oe,ae,se,ce,de,ue,le,pe,_e,he,fe,me,ve,Ee=this;return m(this,(function(Se){switch(Se.label){case 0:if("connection-state-change"!==r)return[3,1];if(t=i.curState,o=i.revState,d=i.reason,O.info("[".concat(this._clientId,"] connection state change: ").concat(o," -> ").concat(t,", reason ").concat(d)),n.connectionState===t)return[2];switch(a=0,t){case"CONNECTING":a=0;break;case"RECONNECTING":a=2;break;case"CONNECTED":a=1;break;case"DISCONNECTING":case"DISCONNECTED":a=4}return s=Date.now(),We.serverConnectionState(n._joinInfo.sid,{startTime:s,extend:{currentState:a}}),"DISCONNECTED"===t||"RECONNECTING"===t&&n._doReconnect(),n.connectionState=t,n.emit("connection-state-change",t,o,d),[3,19];case 1:return"token-privilege-did-expire"!==r?[3,2]:(n.emit("token-privilege-did-expire"),O.debug("[".concat(this._clientId,"] token privilege did expire.")),We.disconnectServer(n._joinInfo.sid,{reason:"token expire"}),[3,19]);case 2:return"token-privilege-will-expire"!==r&&r!==F.ON_TOKEN_WILL_EXPIRE?[3,3]:(n.emit("token-privilege-will-expire"),O.debug("[".concat(this._clientId,"] token privilege will expire.")),[3,19]);case 3:return r!==F.ON_PUBLISHER_QUALITY?[3,4]:(se=i.UserId,c=i.Quality,n._publisherUploadQuality=c,[3,19]);case 4:return r!==F.ON_FORCE_OFFLINE&&r!==F.ON_TOKEN_DID_EXPIRE?[3,5]:(Object.keys(n._joinInfo).length>0&&("CONNECTED"===n.connectionState&&(d="",r===F.ON_TOKEN_DID_EXPIRE?(n.emit("token-privilege-did-expire"),O.debug("[".concat(this._clientId,"] token privilege did expire.")),d=e.ConnectionDisconnectedReason.TOKEN_INVALID):r===F.ON_FORCE_OFFLINE&&(d=e.ConnectionDisconnectedReason.UID_BANNED,We.disconnectServer(n._joinInfo.sid,{reason:"kicked"})),null===(ue=n._gateway)||void 0===ue||ue.disconnectCTS(d),n.connectionState="DISCONNECTED",null===(le=n._gateway)||void 0===le||le.removeAllListeners(),n._gateway=void 0),n._subStreamInfo.forEach((function(e){e._mediaStream&&e._mediaStream.destroy(),n._unsubscribe(e)})),n._highStream&&(n._highStream.destroy(),n._highStream.clearOriginTracks(),n._highStream=void 0),n._lowStream&&(n._lowStream.destroy(),n._lowStream.clearOriginTracks(),n._lowStream=void 0),n.remoteUsersQualityInterval&&clearInterval(n.remoteUsersQualityInterval),this.localNetworkQualityInterval&&clearInterval(this.localNetworkQualityInterval),n._sessionId="",n._subStreamInfo.clear(),n._msSub=[],n.uid="",n._joinInfo={},n._statsCollector&&n._statsCollector.clear()),[3,19]);case 5:if(r!==F.ON_ICE)return[3,6];te=i.StreamId,u=i.Sdp,l=i.SubStream,K=void 0,te===n.uid?(K=n._highStream,l&&(K=n._lowStream)):((de=n._subStreamInfo.get(te))||O.warning("can not find remote user ".concat(te)),K=de._mediaStream);try{K.setIceCandidate(u)}catch(e){O.error(e)}return[3,19];case 6:return r!==F.ON_SESSION_INIT?[3,7]:(p=i.CId,_=i.Interval,n._joinInfo.cid=p,n._startReportStats(p,_),We.setup(),[3,19]);case 7:return"PriVidData"!==r?[3,8]:(te=i.StreamId,h=i.Data,(v=this._subStreamInfo.get(te))&&v._canvasCtx&&((S=new Image(640,480)).src="data:image/jpeg;base64,"+h,S.onload=function(){v._canvasCtx.clearRect(0,0,640,480),v._canvasCtx.drawImage(S,0,0,640,480)}),[3,19]);case 8:return r!==F.ON_CHANNEL_MESSAGE?[3,19]:(T=i.Cmd)!==F.ON_CHANNEL_USER_ONLINE?[3,9]:(se=i.UserId,(de=n._subStreamInfo.get(se))?de._reOnlineTimer&&(clearTimeout(de._reOnlineTimer),de._reOnlineTimer=null):(I=new Ot(se),n._subStreamInfo.set(se,I),O.debug("[".concat(this._clientId,"] user online ").concat(se)),n.emit("user-joined",I)),[3,19]);case 9:if(T!==F.ON_CHANNEL_USER_OFFLINE)return[3,10];if(se=i.UserId,C=i.Reason,A=this._subStreamInfo.get(se)){switch(A._audio_added_=!1,A._audio_enabled_=!0,A._audio_muted_=!1,A._video_added_=!1,A._video_enabled_=!0,A._video_muted_=!1,this._checkUserAVStatusAndEmit(A.uid,"audio"),this._checkUserAVStatusAndEmit(A.uid,"video"),A.subAudioState===gt.Idle&&A.subVideoState===gt.Idle&&(null===(pe=n._gateway)||void 0===pe||pe.doUnSubscribe(se)),null===(_e=n._statsCollector)||void 0===_e||_e.removeConnection(A.uid),A._mediaStream&&(A._mediaStream.destroy(),A._mediaStream=void 0),n._subStreamInfo.delete(se),delete this._remoteUserNetworkQuality[se],R="",C){case"Dropped":R="ServerTimeOut";break;case"Offline":R="Quit";break;case"BecomeAudience":R="BecomeAudience"}O.debug("[".concat(this._clientId,"] user offline ").concat(se,", reason: ").concat(R)),n.emit("user-left",A,R)}return n._setAVStatsRepTimer(),[3,19];case 10:return T!==F.ON_CHANNEL_SET_USER_ROLE?[3,11]:(se=i.UserId,[3,19]);case 11:return T!==F.ON_CHANNEL_DUAL_STREAM_ENABLE?[3,12]:(se=i.UserId,ae=i.Enable,(de=this._subStreamInfo.get(se))&&(1===de._subStreamType&&(ee=de.uid,g=0,g=ae?1:0,(null==de?void 0:de.hasVideo)&&(null===(he=n._gateway)||void 0===he||he.setRemoteVideoStreamType(ee,g),n.emit("stream-type-changed",ee,g),O.info("[".concat(this._clientId,"] set remote user ").concat(ee," streamType as ").concat(g)))),de._dualStream=ae),[3,19]);case 12:return T!==F.ON_CHANNEL_USER_STREAM_OPEN?[3,18]:(se=i.UserId,te=i.StreamId,ne=i.PubSessionId,N=i.DualStream,b=i.HasAudio,D=i.LocalAudioEnable,k=i.LocalAudioMute,w=i.HasVideo,L=i.LocalVideoEnable,P=i.LocalVideoMute,M=i.VidCodecType,U=i.AudCodecType,void 0===(V=n._subStreamInfo.get(se))?[3,17]:(B=!0,w&&L&&!P&&L&&!P||(B=!1),Object.assign(V,{_streamOpen:!0,_video_added_:w,_video_enabled_:L,_video_muted_:P,_audio_added_:b,_audio_enabled_:D,_audio_muted_:k,_videoCache:B,_pubSid:ne,_dualStream:N,_subStreamType:e.RemoteStreamType.HIGH_STREAM,_currentFallbackStreamType:e.RemoteStreamFallbackType.DISABLE,_fallbackType:e.RemoteStreamFallbackType.DISABLE,_fallbackRecoverFlagTimes:0,_fallbackFallbackFlagTimes:0,_vidCodecType:M,_audCodecType:U}),V._streamOpen&&V._mediaStream?[4,n._resubscribe(te)]:[3,14]));case 13:return Se.sent(),this._checkUserAVStatusAndEmit(te,"audio"),this._checkUserAVStatusAndEmit(te,"video"),[2];case 14:return x=new ft(V.uid,n._statsCollector,n._joinInfo),V._mediaStream=x,x.on(F.CONNECTION_STATE_CHANGE,n._handlePeerConnectionEvent.bind(n,F.CONNECTION_STATE_CHANGE)),x.on(F.ICE_CANDIDATE,n._handlePeerConnectionEvent.bind(n,F.ICE_CANDIDATE)),"MJpg"===V._vidCodecType&&((j=document.createElement("canvas")).width=640,j.height=480,H=j.getContext("2d"),V._canvasCtx=H,H.fillRect(0,0,j.width,j.height),document.body.appendChild(j),K=j.captureStream(),J=E(K.getVideoTracks(),1),Y=J[0],V._mediaStream.addTrack(new dt(Y,"track-remote-v-"+y(5))),V._mediaStream.addTracks("video")),V._mediaStream=x,V._waitAddUserVideoTrack=new G((function(e,t){x.on(F.TRACK_ADDED,(function(t,n,r){"video"===n&&(V._videoMediaStreamTrack=r,x.videoTrack&&x.videoTrack.updateMediaStreamTrackResolution(r),O.debug("".concat(Ee._clientId,"] get user ").concat(V.uid," video Track")),e())}))})),V._waitAddUserAudioTrack=new G((function(e,t){x.on(F.TRACK_ADDED,(function(t,n,r){var i;"audio"===n&&(V._audioMediaStreamTrack=r,x.audioTrack&&x.audioTrack.updateMediaStreamTrackResolution(r),null===(i=x.audioTrack)||void 0===i||i.play(),O.debug("".concat(Ee._clientId,"] get user ").concat(V.uid," audio Track")),e())}))})),V._waitForSubscribeAudio=new G((function(e){return f(Ee,void 0,void 0,(function(){var t;return m(this,(function(n){switch(n.label){case 0:return V._mediaStream.hasOriginAudioTrack()?(V.audioTrack||V._mediaStream.addTracks("audio"),e(V.audioTrack),[3,3]):[3,1];case 1:return[4,null===(t=V._waitAddUserAudioTrack)||void 0===t?void 0:t.promise];case 2:n.sent(),V._waitAddUserAudioTrack=void 0,V._mediaStream.addTracks("audio"),e(V.audioTrack),n.label=3;case 3:return[2]}}))}))})),V._waitForSubscribeVideo=new G((function(e,t){return f(Ee,void 0,void 0,(function(){var t,n;return m(this,(function(r){switch(r.label){case 0:return(null===(t=V._mediaStream)||void 0===t?void 0:t.hasOriginVideoTrack())?(V.videoTrack||V._mediaStream.addTracks("video"),e(V.videoTrack),[3,3]):[3,1];case 1:return[4,null===(n=V._waitAddUserVideoTrack)||void 0===n?void 0:n.promise];case 2:r.sent(),V._waitAddUserVideoTrack=void 0,V._mediaStream.addTracks("video"),e(V.videoTrack),r.label=3;case 3:return[2]}}))}))})),V._waitForDoSubscribe=this._createDoSubscribeFuture(V,!1,!1),[4,V._waitForDoSubscribe.promise];case 15:return z=Se.sent(),Q=z.StreamId,q=z.Offer,V._waitForDoSubscribe=void 0,[4,W(x.createAnswer(q))];case 16:if(X=E.apply(void 0,[Se.sent(),2]),Z=X[0],$=X[1],Z)return[2,O.error("[createAnswer]",Z)];null===(fe=n._gateway)||void 0===fe||fe.sendAnswer(Q,$),ee=V.uid,V.hasVideo&&this._checkUserAVStatusAndEmit(ee,"video"),V.hasAudio&&this._checkUserAVStatusAndEmit(ee,"audio"),Se.label=17;case 17:return[3,19];case 18:T===F.ON_CHANNEL_USER_STREAM_CLOSE?(se=i.UserId,te=i.StreamId,ne=i.PubSessionId,(de=n._subStreamInfo.get(se))&&de._pubSid===ne&&(de._waitForDoSubscribe&&(null===(ve=(me=de._waitForDoSubscribe).reject)||void 0===ve||ve.call(me)),de._audio_added_=!1,de._audio_enabled_=!0,de._audio_muted_=!1,de._video_added_=!1,de._video_enabled_=!0,de._video_muted_=!1,this._checkUserAVStatusAndEmit(de.uid,"audio"),this._checkUserAVStatusAndEmit(de.uid,"video"))):"UserQuality"===T?(se=i.UserId,re=i.TxQ,ie=n._getRemoteDownlinkNetworkQuality(),oe={uplinkNetworkQuality:re,downlinkNetworkQuality:ie[se]?ie[se]:0},this._remoteUserNetworkQuality[se]=oe):T===F.ON_CHANNEL_USER_ENABLE_VIDEO||T===F.ON_CHANNEL_USER_DISABLE_VIDEO?(se=i.UserId,(de=n._subStreamInfo.get(se))&&(T===F.ON_CHANNEL_USER_ENABLE_VIDEO?de._video_added_=!0:T===F.ON_CHANNEL_USER_DISABLE_VIDEO&&(de._video_added_=!1),this._checkUserAVStatusAndEmit(se,"video"),n._setAVStatsRepTimer())):T===F.ON_CHANNEL_USER_ENABLE_LOCAL_VIDEO?(se=i.UserId,ae=i.Enable,(de=n._subStreamInfo.get(se))&&(de._video_enabled_=ae,this._checkUserAVStatusAndEmit(se,"video"),n._setAVStatsRepTimer())):T===F.ON_CHANNEL_USER_ENABLE_AUDIO||T===F.ON_CHANNEL_USER_DISABLE_AUDIO?(se=i.UserId,(de=n._subStreamInfo.get(se))&&(T===F.ON_CHANNEL_USER_ENABLE_AUDIO?de._audio_added_=!0:T===F.ON_CHANNEL_USER_DISABLE_AUDIO&&(de._audio_added_=!1),this._checkUserAVStatusAndEmit(se,"audio"),n._setAVStatsRepTimer())):T===F.ON_CHANNEL_USER_ENABLE_LOCAL_AUDIO?(se=i.UserId,ae=i.Enable,(de=n._subStreamInfo.get(se))&&(de._audio_enabled_=ae,this._checkUserAVStatusAndEmit(se,"audio"),n._setAVStatsRepTimer())):T===F.ON_CHANNEL_USER_MUTE_VIDEO?(se=i.UserId,ce=i.Mute,(de=n._subStreamInfo.get(se))&&(de._video_muted_=ce,this._checkUserAVStatusAndEmit(se,"video"),n._setAVStatsRepTimer())):T===F.ON_CHANNEL_USER_MUTE_AUDIO&&(se=i.UserId,ce=i.Mute,(de=n._subStreamInfo.get(se))&&(de._audio_muted_=ce,this._checkUserAVStatusAndEmit(se,"audio"),n._setAVStatsRepTimer())),Se.label=19;case 19:return[2]}}))}))}},n.prototype._handlePeerConnectionEvent=function(e,t,n,r){var i,o,a,s,c,d,u=this;if(e===F.ICE_CONNECTION_STATE_CHANGE);else if(e===F.CONNECTION_STATE_CHANGE)switch(r){case"connected":if("sub"===n)return;var l=void 0;if("pub"===n?l=null===(i=u._highStream)||void 0===i?void 0:i.peer:"pubEx"===n&&(l=null===(o=u._lowStream)||void 0===o?void 0:o.peer),"{}"!==JSON.stringify(null==l?void 0:l.videoEncoderConfig)){var p=null==l?void 0:l.videoEncoderConfig;p.bitrateMax&&(null==l||l.updateBandWidth(p.bitrateMax))}break;case"disconnected":break;case"failed":if("CONNECTED"===u.connectionState)if("pub"===n||"pubEx"===n)this._republish();else if("sub"===n){var _=u._subStreamInfo.get(t);_&&(null===(a=this._gateway)||void 0===a||a.doUnSubscribe(_.uid),null===(s=_._mediaStream)||void 0===s||s.closePC(),null===(c=_._mediaStream)||void 0===c||c.createPC(),this._resubscribe(t))}We.disconnectServer(u._joinInfo.sid,{reason:"rtc failed"})}else e===F.ICE_CANDIDATE&&(null===(d=u._gateway)||void 0===d||d.sendIceCandidate(t,r,"pubEx"===n))},n.prototype._startReportStats=function(e,t){var n=this;n._reportStatsInterval&&clearInterval(n._reportStatsInterval),n._reportStatsInterval=window.setInterval((function(){var t;if(n._highStream){var r={cid:e,lts:Date.now(),type:"local",ver:C.SDK_VERSION};if(n._highStream.videoTrack){var i=n.getLocalVideoStats();i&&(r.lvid={sbr:Math.round(i.sendBitrate/1e3),sfps:i.sendFrameRate,eofps:i.captureFrameRate,rofps:i.captureFrameRate,stbr:i.captureFrameRate,stfps:i.captureFrameRate,ebr:Math.round(i.sendBitrate/1e3),e_w:i.captureResolutionWidth,e_h:i.captureResolutionHeight,efps:i.captureFrameRate,ploss:Math.round(100*i.packetLossRate)})}else r.lvid={};if(n._highStream.audioTrack){var o=n.getLocalAudioStats();o&&(r.laud={nc:1,shz:48e3,sbr:Math.round(o.sendBitrate/1e3),vol:Math.round(100*o.sendVolumeLevel/32767),ploss:0})}else r.laud={};null===(t=n._gateway)||void 0===t||t.reportArStats(r)}if(n._lowStream,n._subStreamInfo.size>0){var a=n.getRemoteAudioStats(),s=n.getRemoteVideoStats();n._subStreamInfo.forEach((function(t){var r,i={cid:e,peer:t.uid,lts:Date.now(),type:"peer",ver:C.SDK_VERSION};if(t.videoTrack){var o=s[t.uid];o&&(i.vif={w:o.receiveResolutionWidth,h:o.receiveResolutionHeight,rbr:Math.round(o.receiveBitrate/1e3),dofps:o.receiveFrameRate,rofps:o.renderFrameRate,ploss:Math.round(100*o.packetLossRate),rst:t._subStreamType,tft:o.totalFreezeTime,ffps:Math.round(100*o.freezeRate)})}else i.vif={};if(t.audioTrack){var c=a[t.uid];c&&(i.aif={ntd:c.end2EndDelay,jbd:c.receiveDelay,aloss:Math.round(100*c.packetLossRate),nc:1,rhz:48e3,rb:Math.round(c.receiveBitrate/1e3),tft:c.totalFreezeTime,ffps:Math.round(100*c.freezeRate),vol:Math.round(t.audioTrack.getVolumeLevel()),ploss:0})}else i.aif={};null===(r=n._gateway)||void 0===r||r.reportArStats(i)}))}}),t)},n}(x),kt=function(e){function t(t,n){var r=e.call(this)||this;return r.startPlayTime=0,r.startPlayOffset=0,r.pausePlayTime=0,r.currentLoopCount=0,r.options={},r.sourceNode=void 0,r._currentState="stopped",r.id=n,r.context=pe(),r.mediaStreamDestination=r.context.createMediaStreamDestination(),r.audioBuffer=t,r.startPlayOffset=r.options.startPlayTime||0,r}return _(t,e),t.prototype.getAudioTrack=function(){return this.mediaStreamDestination.stream.getAudioTracks()[0]},t.prototype.updateOptions=function(e){"stopped"===this.currentState?(this.options=e,this.startPlayOffset=this.options.startPlayTime||0):O.warning("can not set audio source options")},t.prototype.startProcessAudioBuffer=function(){this.sourceNode&&this.stopProcessAudioBuffer(),this.sourceNode=this.createSourceNode(),this.startSourceNode(),this.currentState="playing"},t.prototype.pauseProcessAudioBuffer=function(){this.sourceNode&&"playing"===this.currentState&&(this.pausePlayTime=this.currentTime,this.sourceNode.onended=null,this.sourceNode.stop(),this.sourceNode.buffer=null,this.sourceNode=this.createSourceNode(),this.currentState="paused")},t.prototype.seekAudioBuffer=function(e){this.sourceNode&&(this.sourceNode.onended=null,"playing"===this.currentState&&this.sourceNode.stop(),this.sourceNode=this.createSourceNode(),"playing"===this.currentState?(this.startPlayOffset=e,this.startSourceNode()):"paused"===this.currentState&&(this.pausePlayTime=e))},t.prototype.resumeProcessAudioBuffer=function(){"paused"===this.currentState&&this.sourceNode&&(this.startPlayOffset=this.pausePlayTime,this.pausePlayTime=0,this.startSourceNode(),this.currentState="playing")},t.prototype.stopProcessAudioBuffer=function(){if(this.sourceNode){this.sourceNode.onended=null;try{this.sourceNode.stop()}catch(e){}this.reset()}},t.prototype.startSourceNode=function(){this.sourceNode&&this.sourceNode.buffer&&(this.sourceNode.start(0,this.startPlayOffset),this.startPlayTime=this.context.currentTime,this.sourceNode.onended=this.handleSourceNodeEnded.bind(this))},t.prototype.createSourceNode=function(){var e=this.context.createBufferSource();return e.buffer=this.audioBuffer,e.loop=!!this.options.loop,e.connect(this.mediaStreamDestination),e},t.prototype.handleSourceNodeEnded=function(){if(this.currentLoopCount+=1,this.options.cycle&&this.options.cycle>this.currentLoopCount)return this.startPlayOffset=0,this.sourceNode=void 0,void this.startProcessAudioBuffer();this.reset()},t.prototype.reset=function(){this.startPlayOffset=this.options.startPlayTime||0,this.currentState="stopped",this.sourceNode&&(this.sourceNode.disconnect(),this.sourceNode=void 0),this.currentLoopCount=0},Object.defineProperty(t.prototype,"currentState",{get:function(){return this._currentState},set:function(e){e!==this._currentState&&(this._currentState=e,this.emit(F.AUDIO_SOURCE_STATE_CHANGE,this._currentState))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this.audioBuffer.duration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return"stopped"===this.currentState?0:"paused"===this.currentState?this.pausePlayTime:(this.context.currentTime-this.startPlayTime+this.startPlayOffset)%this.audioBuffer.duration},enumerable:!1,configurable:!0}),t}(x),wt=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n.encoderConfig?Oe(n.encoderConfig):{},i,o)||this;return a._deviceName="default",a._config=n||{},a._constraints=r,a._config&&a._config.cameraId&&(a._deviceName=tt.searchDeviceNameById("videoinput_"+a._config.cameraId)||"default"),a}return _(t,e),t.prototype.getConfig=function(){return this._config},t.prototype.setDevice=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,c;return m(this,(function(d){switch(d.label){case 0:return d.trys.push([0,5,,6]),O.debug("[track-".concat(this.getTrackId(),"] set device ").concat(e)),[4,tt.getDeviceById(e)];case 1:return t=d.sent(),(o={}).video=n._constraints,o.video.deviceId=e,[4,ge(o)];case 2:return a=d.sent(),[4,n._updateOriginMediaStreamTrack(a.getVideoTracks()[0],!0)];case 3:return d.sent(),[4,Ne(n._originMediaStreamTrack)];case 4:return s=d.sent(),n._videoWidth=s[0],n._videoWidth=s[1],n._deviceName=t.label,r(),[3,6];case 5:return c=d.sent(),i(c),[3,6];case 6:return[2]}}))}))}))},t.prototype.setEnabled=function(t){var n=this;return new Promise((function(r,i){return f(n,void 0,void 0,(function(){var n,o,a,s,c,d,u;return m(this,(function(l){switch(l.label){case 0:return l.trys.push([0,6,,7]),e.prototype.setEnabled.call(this,t),this._enabled===t?[3,5]:t?[3,1]:(this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),[3,5]);case 1:return n=Object.assign({},this._constraints),o=this.getMediaStreamTrack(),a="",(a="getSettings"in o?o.getSettings().deviceId:o.id)&&!n.deviceId&&(n.deviceId={exact:a}),[4,ge({video:n})];case 2:return s=l.sent(),c=s.getVideoTracks()[0],[4,this._updateOriginMediaStreamTrack(c,!0,!0)];case 3:return l.sent(),[4,Ne(c)];case 4:d=l.sent(),this._videoHeight=d[0],this._videoWidth=d[1],l.label=5;case 5:return r(),[3,7];case 6:return u=l.sent(),i(u),[3,7];case 7:return[2]}}))}))}))},t.prototype.setEncoderConfiguration=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s;return m(this,(function(c){switch(c.label){case 0:if(c.trys.push([0,4,,5]),!e)throw new J("");return O.debug("[track-".concat(this.getTrackId(),"] set encoder configuration ").concat(JSON.stringify(e))),t=Oe(e),n._config.encoderConfig=t,[4,De(n._config)];case 1:return o=c.sent(),[4,n._originMediaStreamTrack.applyConstraints(o)];case 2:return c.sent(),[4,Ne(n._originMediaStreamTrack)];case 3:return a=c.sent(),n._videoWidth=a[0],n._videoHeight=a[1],n._constraints=o,n._encoderConfig=n._config.encoderConfig,n.emit(F.RTC_NEED_RENEGOTIATE,n),r(),[3,5];case 4:return s=c.sent(),i(s),[3,5];case 5:return[2]}}))}))}))},t}(ct),Lt=function(e){function t(t,n,r,i){var o=e.call(this,n.getAudioTrack(),r,i)||this;return o.source=t,o._bufferSource=n,o._bufferSource.on(F.AUDIO_SOURCE_STATE_CHANGE,(function(e){o.emit(F.SOURCE_STATE_CHANGE,e)})),o}return _(t,e),t.prototype.getCurrentTime=function(){return this._bufferSource.currentTime},t.prototype.startProcessAudioBuffer=function(e){O.debug("[track-".concat(this.getTrackId(),"] start process audio buffer with options ").concat(JSON.stringify(e))),e&&this._bufferSource.updateOptions(e),this._bufferSource.startProcessAudioBuffer()},t.prototype.pauseProcessAudioBuffer=function(){O.debug("[track-".concat(this.getTrackId(),"] pause process audio buffer")),this._bufferSource.pauseProcessAudioBuffer()},t.prototype.seekAudioBuffer=function(e){O.debug("[track-".concat(this.getTrackId(),"] seek audio buffer to ").concat(e,"/").concat(this.duration)),this._bufferSource.seekAudioBuffer(e)},t.prototype.resumeProcessAudioBuffer=function(){O.debug("[track-".concat(this.getTrackId(),"] resume process audio buffer")),this._bufferSource.resumeProcessAudioBuffer()},t.prototype.stopProcessAudioBuffer=function(){O.debug("[track-".concat(this.getTrackId(),"] stop process audio buffer")),this._bufferSource.stopProcessAudioBuffer()},Object.defineProperty(t.prototype,"currentState",{get:function(){return this._bufferSource.currentState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"duration",{get:function(){return this._bufferSource.duration},enumerable:!1,configurable:!0}),t}(nt),Pt=function(e){function t(t,n,r,i){var o=e.call(this,t,n.encoderConfig?be(n.encoderConfig):{},i)||this;return o._deviceName="default",o._config=n,o._constraints=r,n&&n.microphoneId&&(o._deviceName=tt.searchDeviceNameById("audioinput_"+n.microphoneId)||"default"),o}return _(t,e),t.prototype.setDevice=function(e){var t=this,n=this;return new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s;return m(this,(function(c){switch(c.label){case 0:return c.trys.push([0,5,,6]),O.debug("[track-".concat(this.getTrackId(),"] set local audio track device as ").concat(e)),[4,tt.getDeviceById(e)];case 1:return(t=c.sent())?((o={}).audio=n._constraints,o.audio.deviceId={exact:e},n._originMediaStreamTrack.stop(),[4,ge(o)]):[3,4];case 2:return a=c.sent(),[4,n._updateOriginMediaStreamTrack(a.getAudioTracks()[0],!0)];case 3:c.sent(),n._deviceName=t.label,r(),c.label=4;case 4:return[3,6];case 5:return s=c.sent(),i(s),[3,6];case 6:return[2]}}))}))}))},t.prototype.setEnabled=function(t,n){var r=this;return new Promise((function(i,o){return f(r,void 0,void 0,(function(){var r,a,s,c,d,u;return m(this,(function(l){switch(l.label){case 0:if(e.prototype.setEnabled.call(this,t),n)return i(),[2];l.label=1;case 1:return l.trys.push([1,6,,7]),this._enabled===t?[3,5]:t?[3,2]:(this._originMediaStreamTrack.onended=null,this._originMediaStreamTrack.stop(),[3,5]);case 2:return r=Object.assign({},this._constraints),a=this.getMediaStreamTrack(),s="",(s="getSettings"in a?a.getSettings().deviceId:a.id)&&!r.deviceId&&(r.deviceId=s),[4,ge({audio:r})];case 3:return c=l.sent(),d=c.getAudioTracks()[0],[4,this._updateOriginMediaStreamTrack(d,!0)];case 4:l.sent(),l.label=5;case 5:return i(),[3,7];case 6:return u=l.sent(),o(u),[3,7];case 7:return[2]}}))}))}))},t}(nt),Mt=function(e){function t(){var t=e.call(this)||this;return t.limitDestChannelConfigurationCount=4,t.srcChannelMediaInfo=void 0,t.destChannelMediaInfos=new Map,t}return _(t,e),t.prototype.addDestChannelInfo=function(e){if(!e||"{}"===JSON.stringify(e))throw new J(c.INVALID_PARAMS,"Method not implemented.");var t=e.channelName;if("string"!=typeof t||""===t)throw new J(c.INVALID_PARAMS,"invalid channelName in info.");this.destChannelMediaInfos.has(e.channelName)||this.destChannelMediaInfos.set(e.channelName,e)},t.prototype.removeDestChannelInfo=function(e){if("string"!=typeof e||""===e)throw new J(c.INVALID_PARAMS,"Method not implemented.");this.destChannelMediaInfos.has(e)&&this.destChannelMediaInfos.delete(e)},t.prototype.setSrcChannelInfo=function(e){e&&"{}"!==JSON.stringify(e)&&(this.srcChannelMediaInfo=e)},t.prototype.getSrcChannelMediaInfo=function(){return this.srcChannelMediaInfo},t.prototype.getDestChannelMediaInfo=function(){return this.destChannelMediaInfos},t}(x);O.use((function(e,t){t()}));var Ut={VERSION:C.SDK_VERSION,BUILD:C.SDK_BUILD,onPlaybackDeviceChanged:function(e){},onMicrophoneChanged:function(e){},onCameraChanged:function(e){},onAudioAutoplayFailed:function(){},createClient:function(e){void 0===e&&(e={codec:"h264",mode:"rtc"});try{if(["h264"].includes(e.codec)||(O.error(c.INVALID_PARAMS,'config.codec can only be set as ["h264"]'),e.codec="h264"),!["rtc","live"].includes(e.mode))throw new J(c.INVALID_PARAMS,'config.mode can only be set as ["rtc","live"]');return new Dt(e)}catch(e){throw e}},createCameraVideoTrack:function(e){var t=this,n="track-cam-"+y(5);return O.info("start create camera video track(".concat(n,") with config ").concat(JSON.stringify(e))),new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,p;return m(this,(function(_){switch(_.label){case 0:return _.trys.push([0,3,,4]),[4,De(t=e||{})];case 1:return o=_.sent(),a=void 0,s={video:o},c=t.optimizationMode,d=void 0,c&&["balanced","motion","detail"].includes(c)&&(d=c),t.optimizationMode=d,function(e,t,n){if(t.optimizationMode){if(n&&n.width&&n.height){var r=function(e){return"number"==typeof e?e:e.exact||e.ideal||e.max||e.min||0},i=function(){if("motion"===t.optimizationMode)return O.debug("adjust bitrate for motion, (".concat(n.bitrateMax,", ").concat(n.bitrateMin,") -> (").concat(n.bitrateMax,", undefined)")),{max:n.bitrateMax};var e,i=[[[100,.00520833333333333],[66.6666666666666,.00434027777777778],[66.6666666666667,.00173611111111111]],[[233.333333333333,.00347222222222222],[266.666666666667],[.00173611111111111],[183.333333333333,.000217013888888889]],[[700,.001953125],[200,.001953125],[175,.000244140625]],[[899.999999999998,.00173611111111111],[1200,.000868055555555556],[160,.000260416666666667]],[[2666.66666666667,.000884130658436214],[1166.66666666667,.000884130658436214],[600,482253e-10]]],o=r(n.width)*r(n.height),a=Math.max(.25,.1+.03*r(n.frameRate||20));if(19200>o)return{};if(76800>o)e=i[0];else if(307200>o)e=i[1];else if(921600>o)e=i[2];else if(2073600>o)e=i[3];else{if(!(8294400>o))return{min:n.bitrateMin,max:n.bitrateMax};e=i[4]}var s=[Math.round((e[0][0]+e[0][1]*o)*a),Math.round((e[1][0]+e[1][1]*o)*a),Math.round((e[2][0]+e[2][1]*o)*a)];return{min:Math.max(s[2],n.bitrateMin||0),max:Math.max(s[2],n.bitrateMax||s[0])}}();t.encoderConfig=Object.assign({},n,{bitrateMin:i.min,bitrateMax:i.max})}}else O.warning("[".concat(e,"] can not apply optimization mode bitrate config, no encoderConfig"))}(n,t,o),O.debug("[".concat(n,"] GetUserMedia ").concat(JSON.stringify(s))),[4,ge(s)];case 2:return u=_.sent(),a=u.getVideoTracks()[0],l=new wt(a,t,o,d,n),O.debug("create camera video success, trackId: ".concat(n)),r(l),[3,4];case 3:return p=_.sent(),i(p),[3,4];case 4:return[2]}}))}))}))},createMicrophoneAudioTrack:function(e){var t=this,n="track-mic-"+y(5);return O.info("start create microphone audio track(".concat(n,") with config ").concat(JSON.stringify(e))),new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return m(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),o=void 0,a=void 0,o=ke(t=e||{}),a=null,s={audio:o},O.debug("[".concat(n,"] GetUserMedia ").concat(JSON.stringify(s))),[4,ge(s,!0)];case 1:return c=l.sent(),a=c.getAudioTracks()[0],d=new Pt(a,t,o,n),O.debug("create microphone audio success, trackId: ".concat(n)),r(d),[3,3];case 2:return u=l.sent(),i(u),[3,3];case 3:return[2]}}))}))}))},createMicrophoneAndCameraTracks:function(e,t){var n=this,r="track-cam-"+y(5),i="track-mic-"+y(5);return O.info("start create camera video track(".concat(r,") with config ").concat(JSON.stringify(t)," and create microphone auiod track(").concat(i,") with config ").concat(JSON.stringify(e))),new Promise((function(o,a){return f(n,void 0,void 0,(function(){var n,s,c,d,u,l,p,_,h,f,v,E,S;return m(this,(function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),[4,ke(n=e||{})];case 1:return s=m.sent(),[4,De(c=t||{})];case 2:return d=m.sent(),u={video:d,audio:s},O.debug("[".concat(r," and ").concat(i,"] GetUserMedia ").concat(JSON.stringify(u))),[4,ge(u)];case 3:return l=m.sent(),p=l.getAudioTracks()[0],_=l.getVideoTracks()[0],h=c.optimizationMode,f=void 0,h&&["balanced","motion","detail"].includes(h)&&(f=h),v=new wt(_,c,d,f,r),E=new Pt(p,n,s,i),O.debug("create microphone audio track(".concat(i,") and camera video track(").concat(r,") success")),o([E,v]),[3,5];case 4:return S=m.sent(),a(S),[3,5];case 5:return[2]}}))}))}))},createScreenVideoTrack:function(e,t){var n=this,r="track-scr-v-"+y(5),i="track-scr-a-"+y(5);return O.info("start create screen video track(".concat(r,") with config ").concat(JSON.stringify(e),", withAudio ").concat(t)),new Promise((function(o,a){return f(n,void 0,void 0,(function(){var n,s,d,u,l,p,_,h,f,v,E,S,T,I;return m(this,(function(m){switch(m.label){case 0:return m.trys.push([0,2,,3]),s=we(n=e||{}),(d={}).screen=s,u=Z.getBrowserInfo(),"enable"===t||"auto"===t?"Chrome"===u.name&&73<=Number(u.version)?d.screenAudio=!0:(d.screenAudio=!1,O.warning(c.NOT_SUPPORT,"your browser or platform is not support share-screen with audio")):d.screenAudio=!1,[4,ge(d)];case 1:return l=m.sent(),p=null===(T=l)||void 0===T?void 0:T.getVideoTracks()[0],_=null===(I=l)||void 0===I?void 0:I.getAudioTracks()[0],t&&!_&&O.warning("you didn't check share audio in the pop-up window when sharing the screen"),h=n.optimizationMode,f=void 0,h&&["balanced","motion","detail"].includes(h)&&(f=h),v=new ct(p,n.encoderConfig?s:{},f,r),E=null,_&&(E=new nt(_,n,i)),O.debug("create screen video success, trackId: ".concat(r)),o(E?[v,E]:v),[3,3];case 2:return S=m.sent(),a(S),[3,3];case 3:return[2]}}))}))}))},createBufferSourceAudioTrack:function(e){var t=this,n="track-buf-"+y(5);return O.info("start create buffer source audio track(".concat(n,") with config ").concat(JSON.stringify(e))),new Promise((function(r,i){return f(t,void 0,void 0,(function(){var t,o,a,s,d,u,l,p;return m(this,(function(_){switch(_.label){case 0:if(_.trys.push([0,2,,3]),t=e.source,o=e.cacheOnlineFile,a=e.encoderConfig,!t)throw new J(c.INVALID_PARAMS,"Cannot read property 'source' of undefined");return s=!1,o&&(s=o),[4,_e(t,s)];case 1:return d=_.sent(),u=new kt(d,n),l=new Lt(t,u,a||{},n),O.info("create buffer source audio track success, trackId:",n),r(l),[3,3];case 2:return p=_.sent(),i(p),[3,3];case 3:return[2]}}))}))}))},createCustomAudioTrack:function(e){var t="track-cus-a-"+y(5);O.info("start create custom audio track(".concat(t,") with config ").concat(JSON.stringify(e)));var n=e||{},r=n.encoderConfig,i=n.mediaStreamTrack;if(!(i instanceof MediaStreamTrack))throw new J("");var o={};r&&(o.encoderConfig=r);var a=new nt(i,o,t);return O.info("create custom audio track success, trackId:",t),a},createCustomVideoTrack:function(e){var t="track-cus-v-"+y(5);O.info("start create custom video track(".concat(t,") with config ").concat(JSON.stringify(e)));var n=e||{},r=n.bitrateMax,i=n.bitrateMin,o=n.mediaStreamTrack,a=n.optimizationMode;if(!(o instanceof MediaStreamTrack))throw new J("");var s={encoderConfig:{}};r&&(s.encoderConfig.bitrateMax=r),i&&(s.encoderConfig.bitrateMin=i);var c=void 0;a&&["balanced","motion","detail"].includes(a)&&(c=a);var d=new ct(o,s,c,t);return O.info("create custom video track success, trackId:",t),d},disableLogUpload:function(){O.info("disable log upload"),C.UPLOAD_LOG=!1},enableLogUpload:function(){O.info("enable log upload"),C.UPLOAD_LOG=!0},setLogLevel:function(e){O.setLogLevel(e,"ArRTC")},getCameras:function(e){return new Promise((function(t,n){try{t(tt.getCamerasDevices(e))}catch(e){n(e)}}))},getDevices:function(e){return new Promise((function(t,n){try{t(tt.enumerateDevices(!0,!0,e))}catch(e){n(e)}}))},getElectronScreenSources:function(e){return Re(e)},getMicrophones:function(e){return new Promise((function(t,n){try{t(tt.getRecordingDevices(e))}catch(e){n(e)}}))},getPlaybackDevices:function(e){return new Promise((function(t,n){try{t(tt.getPlayOutDevices(e))}catch(e){n(e)}}))},checkSystemRequirements:function(){var e=!!window.RTCPeerConnection,t=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,n=!!window.WebSocket,r=e&&t&&n,i=!1,o=Z.getBrowserInfo();return"Chrome"===o.name&&58<=Number(o.version)&&o.os!==z.IOS&&(i=!0),"Firefox"===o.name&&56<=Number(o.version)&&(i=!0),"OPR"===o.name&&45<=Number(o.version)&&(i=!0),"Safari"===o.name&&11<=Number(o.version)&&(i=!0),"Edge"===o.name&&(i=!0),"MicroMessenger"!==Z.getBrowserInfo().name&&"QQBrowser"!==Z.getBrowserInfo().name||o.os===z.IOS||(i=!0),O.debug("checkSystemRequirements, api:",r,"browser:",i),r&&i},createChannelMediaRelayConfiguration:function(){return new Mt},getSupportedCodec:function(){var e=this;return new Promise((function(t,n){return f(e,void 0,void 0,(function(){var e,r,i,o,a,s;return m(this,(function(c){switch(c.label){case 0:return c.trys.push([0,2,,3]),e=new RTCPeerConnection({iceServers:[]}),r={offerToReceiveAudio:1,offerToReceiveVideo:1},[4,e.createOffer(r)];case 1:return i=c.sent(),e.close(),o={video:[],audio:[]},(a=i.sdp).match(/ VP8/i)&&o.video.push("VP8"),a.match(/ H264/i)&&o.video.push("H264"),a.match(/ opus/i)&&o.audio.push("OPUS"),t(o),[3,3];case 2:return s=c.sent(),n(s),[3,3];case 3:return[2]}}))}))}))}};tt.on(F.PLAYOUT_DEVICE_CHANGED,(function(e){O.info("playout device changed ",JSON.stringify(e)),Ut.onPlaybackDeviceChanged&&Ut.onPlaybackDeviceChanged(e)})),tt.on(F.RECORDING_DEVICE_CHANGED,(function(e){O.info("recording device changed ",JSON.stringify(e)),Ut.onMicrophoneChanged&&Ut.onMicrophoneChanged(e)})),tt.on(F.CAMERA_DEVICE_CHANGED,(function(e){O.info("camera device changed ",JSON.stringify(e)),Ut.onCameraChanged&&Ut.onCameraChanged(e)})),qe.onAutoplayFailed=function(){O.info("detect audio element autoplay failed"),Ut.onAudioAutoplayFailed&&Ut.onAudioAutoplayFailed()},e.ArRTC=Ut,e.default=Ut,Object.defineProperty(e,"__esModule",{value:!0})}));
0 22 \ No newline at end of file
... ...