define("service","underscore jquery set CryptoJS".split(" "),function(cp,cX,aK,bE){function bi(dl,dk){if(cp.isArray(dl)){for(var dm=0;dm<dl.length;dm++){c9(dl[dm])}}else{c9(dl)}cY(dk)}function n(dl,dk){if(cp.isArray(dl)){for(var dm=0;dm<dl.length;dm++){bz(dl[dm])}}else{bz(dl)}C(dk)}function aV(){return a7({}).get_user_mac_addr}function b3(dk,dn){return bH(arguments,{},dl,dm,null,false);function dl(dp,dq){return{multi_data:1,cmd:"DDNS_Enable,DDNS_Mode,DDNSProvider,DDNSAccount,DDNSPassword,DDNS,DDNS_Hash_Value"}}function dm(dp){if(dp){return{DDNS_Enable:dp.DDNS_Enable,DDNS_Mode:dp.DDNS_Mode,DDNSProvider:dp.DDNSProvider,DDNSAccount:dp.DDNSAccount,DDNSPassword:dp.DDNSPassword,DDNS:dp.DDNS,DDNS_Hash_Value:dp.DDNS_Hash_Value}}else{return X}}}function aW(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp=cX.extend({},dm);return dp}function dl(dm){if(dm){return dm}else{return X}}}function cs(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="modem_main_state,puknumber,pinnumber,blc_wan_mode,blc_wan_auto_mode,psw_fail_num_str,login_lock_time,psw_changed";dp.multi_data=1;return dp}function dl(dm){if(dm){if(dm.blc_wan_mode=="AUTO"){dm.blc_wan_mode=dm.blc_wan_auto_mode?dm.blc_wan_auto_mode:"AUTO_PPP"}else{dm.blc_wan_mode=dm.blc_wan_mode?dm.blc_wan_mode:"PPP"}dm.psw_fail_num_str=dm.psw_fail_num_str==""?aK.MAX_LOGIN_COUNT:dm.psw_fail_num_str;dm.login_lock_time=dm.login_lock_time==""?"300":dm.login_lock_time;return dm}else{return X}}}function aR(){return bH(arguments,{},dk,dl,{errorType:"badPassword"},true);function dk(dm,dn){var dp={goformId:"LOGIN",password:aK.PASSWORD_ENCODE?Base64.encode(dm.password):dm.password};return dp}function dl(dm){if(dm&&(dm.result=="0"||dm.result=="4")){bD.isLoggedIn=true;return{result:true}}else{var dn={};switch(dm.result){case"1":dn={errorType:"Login Fail"};break;case"2":dn={errorType:"duplicateUser"};break;case"3":dn={errorType:"badPassword"};break;default:dn={errorType:"Login Fail"};break}bD.isLoggedIn=false;return cX.extend(X,dn)}}}function bV(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="current_Password,admin_Password,root_Password";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.CurrentPasswd=dn.current_Password;dm.AdminPasswd=dn.admin_Password;dm.RootPasswd=dn.root_Password;return dm}else{return X}}}function bk(){if(bD.isLoggedIn!=undefined){return bH(arguments,{status:bD.isLoggedIn?"loggedIn":"loggedOut"})}else{var dm={};if(!aK.HAS_LOGIN){dm.status="loggedIn";dm.errorType="no_login";bD.isLoggedIn=true}return bH(arguments,dm,dk,dl,null,false)}function dk(dn,dp){var dq={};dq.cmd="loginfo";dq.multi_data=1;return dq}function dl(dp){if(dp&&dp.loginfo||dp.loginfo==""){var dn={};switch(dp.loginfo){case"ok":bD.isLoggedIn=true;dn.status="loggedIn";break;default:bD.isLoggedIn=false;dn.status="loggedOut";break}return dn}else{bD.isLoggedIn=undefined;return cX.extend(X,{errorType:"LoginStatusError"})}}}function J(){return bH(arguments,{},dk,dl,{},true);function dk(dm,dn){var dp={};dp.goformId="ENTER_PIN";dp.PinNumber=dm.PinNumber;return dp}function dl(dm){if(dm&&dm.result==="success"){return{result:true}}else{return{result:false}}}}function U(){return bH(arguments,{},dk,dl,{},true);function dk(dm,dn){var dp={};dp.goformId="ENTER_PUK";dp.PUKNumber=dm.PUKNumber;dp.PinNumber=dm.PinNumber;return dp}function dl(dm){if(dm&&dm.result==="success"){return{result:true}}else{return{result:false}}}}function cy(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="get_support_band";return dp}function dl(dn){if(dn){var dm={};dm=dn;return dm}else{return X}}}function O(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="set_band_list";return dp}function dl(dn){if(dn){var dm={};dm=dn;return dm}else{return X}}}function cE(){return bH(arguments,{},dk,dl,null,true);function dk(dm){var dn=cX.extend({goformId:"GOFORM_SET_BAND"},dm);return dn}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function bR(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="GET_RESIDE_BAND";return dp}function dl(dn){if(dn){var dm={reside_band:dn.result};return dm}else{return X}}}function e(){if(bD.isLoggedIn===undefined){var dk=bk();return{networkType:bD.networkType,signalImg:bD.signalImg,networkOperator:bD.networkOperator,spn_b1_flag:bD.spn_b1_flag,spn_name_data:bD.spn_name_data,spn_b2_flag:bD.spn_b2_flag,connectStatus:bD.connectStatus,rj45ConnectStatus:bD.rj45ConnectStatus,ssid1AttachedNum:bD.ssid1AttachedNum,ssid2AttachedNum:bD.ssid2AttachedNum,wirelessDeviceNum:bD.ssid1AttachedNum+bD.ssid2AttachedNum,roamingStatus:bD.roamingStatus,wifiStatus:bD.wifiStatus,simStatus:bD.simStatus,pinStatus:bD.pinStatus,batteryStatus:bD.batteryStatus,batteryLevel:bD.batteryLevel,batteryPers:bD.batteryPers,batteryTime:bD.batteryTime,ssid:bD.ssid,authMode:bD.authMode,data_counter:bD.data_counter,isLoggedIn:dk.status=="loggedIn",newSmsReceived:bD.newSmsReceived,smsReportReceived:bD.smsReportReceived,smsUnreadCount:bD.smsUnreadCount,limitVolumeEnable:bD.limitVolumeEnable,limitVolumeType:bD.limitVolumeType,limitVolumePercent:bD.limitVolumePercent,limitVolumeSize:bD.limitVolumeSize,connectWifiProfile:bD.connectWifiProfile,connectWifiSSID:bD.connectWifiSSID,connectWifiStatus:bD.connectWifiStatus,multi_ssid_enable:bD.multi_ssid_enable,show_ssid_on_lcd:timerInfo.show_ssid_on_lcd,roamMode:bD.roamMode,blc_wan_mode:bD.blc_wan_mode,current_upgrade_state:bD.current_upgrade_state,is_mandatory:bD.is_mandatory,new_version_state:bD.new_version_state,allowRoamingUpdate:bD.allowRoamingUpdate,ap_station_enable:bD.ap_station_enable,ap_station_mode:bD.ap_station_mode,dialMode:bD.dialMode,fota_package_already_download:bD.fota_package_already_download,ethWanMode:bD.ethWanMode,fota_user_selector:bD.fota_user_selector,defaultWanName:bD.defaultWanName,vpn_state:bD.vpn_state,connect_status:bD.connect_status}}return{networkType:bD.networkType,signalImg:bD.signalImg,networkOperator:bD.networkOperator,spn_b1_flag:bD.spn_b1_flag,spn_name_data:bD.spn_name_data,spn_b2_flag:bD.spn_b2_flag,connectStatus:bD.connectStatus,rj45ConnectStatus:bD.rj45ConnectStatus,ssid1AttachedNum:bD.ssid1AttachedNum,ssid2AttachedNum:bD.ssid2AttachedNum,wirelessDeviceNum:bD.ssid1AttachedNum+bD.ssid2AttachedNum,roamingStatus:bD.roamingStatus,wifiStatus:bD.wifiStatus,simStatus:bD.simStatus,pinStatus:bD.pinStatus,batteryStatus:bD.batteryStatus,batteryLevel:bD.batteryLevel,batteryPers:bD.batteryPers,batteryTime:bD.batteryTime,ssid:bD.ssid,authMode:bD.authMode,data_counter:bD.data_counter,isLoggedIn:bD.isLoggedIn,newSmsReceived:bD.newSmsReceived,smsReportReceived:bD.smsReportReceived,smsUnreadCount:bD.smsUnreadCount,limitVolumeEnable:bD.limitVolumeEnable,limitVolumeType:bD.limitVolumeType,limitVolumePercent:bD.limitVolumePercent,limitVolumeSize:bD.limitVolumeSize,connectWifiProfile:bD.connectWifiProfile,connectWifiSSID:bD.connectWifiSSID,connectWifiStatus:bD.connectWifiStatus,multi_ssid_enable:bD.multi_ssid_enable,blc_wan_mode:bD.blc_wan_mode,roamMode:bD.roamMode,current_upgrade_state:bD.current_upgrade_state,is_mandatory:bD.is_mandatory,new_version_state:bD.new_version_state,allowRoamingUpdate:bD.allowRoamingUpdate,ap_station_enable:bD.ap_station_enable,ap_station_mode:bD.ap_station_mode,dialMode:bD.dialMode,fota_package_already_download:bD.fota_package_already_download,ethWanMode:bD.ethWanMode,fota_user_selector:bD.fota_user_selector,defaultWanName:bD.defaultWanName,vpn_state:bD.vpn_state,connect_status:bD.connect_status}}function bG(){var dl=bD.limitVolumeType=="1";var dk={data_counter:bD.data_counter,connectStatus:bD.connectStatus,rj45ConnectStatus:bD.rj45ConnectStatus,limitVolumeEnable:bD.limitVolumeEnable,limitVolumeType:bD.limitVolumeType,limitVolumePercent:bD.limitVolumePercent,networkType:bD.networkType};if(dl){dk.limitDataMonth=bD.limitVolumeSize;dk.limitTimeMonth=0}else{dk.limitTimeMonth=bD.limitVolumeSize;dk.limitDataMonth=0}dk.blc_wan_mode=bD.blc_wan_mode;return dk}function E(){bD.newSmsReceived=false}function cc(){bD.smsReportReceived=false}function b(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="sms_capacity_info";return dp}function dl(dm){return{nvTotal:parseInt(dm.sms_nv_total,10),nvUsed:parseInt(dm.sms_nv_rev_total,10)+parseInt(dm.sms_nv_send_total,10)+parseInt(dm.sms_nv_draftbox_total,10),simTotal:parseInt(dm.sms_sim_total,10),simUsed:parseInt(dm.sms_sim_rev_total,10)+parseInt(dm.sms_sim_send_total,10)+parseInt(dm.sms_sim_draftbox_total,10),nvReceive:parseInt(dm.sms_nv_rev_total,10),nvSend:parseInt(dm.sms_nv_send_total,10),nvDraft:parseInt(dm.sms_nv_draftbox_total,10),simReceive:parseInt(dm.sms_sim_rev_total,10),simSend:parseInt(dm.sms_sim_send_total,10),simDraft:parseInt(dm.sms_sim_draftbox_total,10)}}}function be(){var dp=arguments[1];var dn=0;return bH(arguments,{},dk,dm,null,true);function dk(dq,dr){var ds={};ds.notCallback=true;ds.goformId="CONNECT_NETWORK";return ds}function dm(dq){if(dq.result=="success"){dn=(new Date).getTime();cY(dl)}else{dp({result:false})}}function dl(dq){if(dq.ppp_status=="ppp_connecting"){bD.connectStatus="ppp_connecting"}else{if(dq.ppp_status=="ppp_connected"){C(dl);bD.connectStatus="ppp_connected";dp({result:true,status:bD.connectStatus})}else{if((new Date).getTime()-dn<1e4){bD.connectStatus="ppp_connecting"}else{C(dl);dp({result:false})}}}}}function R(){var dp=arguments[1];var dn=0;return bH(arguments,{},dl,dm,null,true);function dl(dq,dr){var ds={};ds.notCallback=true;ds.goformId="DISCONNECT_NETWORK";return ds}function dm(dq){if(dq.result=="success"){dn=(new Date).getTime();cY(dk)}else{dp({result:false})}}function dk(dq){if(dq.ppp_status=="ppp_disconnecting"){bD.connectStatus="ppp_disconnecting"}else{if(dq.ppp_status=="ppp_disconnected"){C(dk);bD.connectStatus="ppp_disconnected";dp({result:true,status:bD.connectStatus})}else{if((new Date).getTime()-dn<1e4){bD.connectStatus="ppp_disconnecting"}else{C(dk);dp({result:false})}}}}}function m(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="APN_configtmp0,APN_configtmp1,APN_configtmp2,APN_configtmp3,APN_configtmp4,APN_configtmp5,APN_configtmp6,APN_configtmp7,APN_configtmp8,APN_configtmp9,APN_configtmp10,APN_configtmp11,APN_configtmp12,APN_configtmp13,APN_configtmp14,APN_configtmp15,APN_configtmp16,APN_configtmp17,APN_configtmp18,APN_configtmp19,ipv6_APN_configtmp0,ipv6_APN_configtmp1,ipv6_APN_configtmp2,ipv6_APN_configtmp3,ipv6_APN_configtmp4,ipv6_APN_configtmp5,ipv6_APN_configtmp6,ipv6_APN_configtmp7,ipv6_APN_configtmp8,ipv6_APN_configtmp9,ipv6_APN_configtmp10,ipv6_APN_configtmp11,ipv6_APN_configtmp12,ipv6_APN_configtmp13,ipv6_APN_configtmp14,ipv6_APN_configtmp15,ipv6_APN_configtmp16,ipv6_APN_configtmp17,ipv6_APN_configtmp18,ipv6_APN_configtmp19,m_profile_name,profile_name,wan_dial,pdp_type,pdp_select,index,Current_index,apn_auto_config,ipv6_apn_auto_config,apn_mode,wan_apn,ppp_auth_mode,ppp_username,ppp_passtmp,ipv6_wan_apn,ipv6_pdp_type,ipv6_ppp_auth_mode,ipv6_ppp_username,ipv6_ppp_passtmp,apn_num_preset";dp.multi_data=1;return dp}function dl(dm){if(dm){return{APNs:dm.APN_configtmp0+"||"+dm.APN_configtmp1+"||"+dm.APN_configtmp2+"||"+dm.APN_configtmp3+"||"+dm.APN_configtmp4+"||"+dm.APN_configtmp5+"||"+dm.APN_configtmp6+"||"+dm.APN_configtmp7+"||"+dm.APN_configtmp8+"||"+dm.APN_configtmp9+"||"+dm.APN_configtmp10+"||"+dm.APN_configtmp11+"||"+dm.APN_configtmp12+"||"+dm.APN_configtmp13+"||"+dm.APN_configtmp14+"||"+dm.APN_configtmp15+"||"+dm.APN_configtmp16+"||"+dm.APN_configtmp17+"||"+dm.APN_configtmp18+"||"+dm.APN_configtmp19,ipv6APNs:dm.ipv6_APN_configtmp0+"||"+dm.ipv6_APN_configtmp1+"||"+dm.ipv6_APN_configtmp2+"||"+dm.ipv6_APN_configtmp3+"||"+dm.ipv6_APN_configtmp4+"||"+dm.ipv6_APN_configtmp5+"||"+dm.ipv6_APN_configtmp6+"||"+dm.ipv6_APN_configtmp7+"||"+dm.ipv6_APN_configtmp8+"||"+dm.ipv6_APN_configtmp9+"||"+dm.ipv6_APN_configtmp10+"||"+dm.ipv6_APN_configtmp11+"||"+dm.ipv6_APN_configtmp12+"||"+dm.ipv6_APN_configtmp13+"||"+dm.ipv6_APN_configtmp14+"||"+dm.ipv6_APN_configtmp15+"||"+dm.ipv6_APN_configtmp16+"||"+dm.ipv6_APN_configtmp17+"||"+dm.ipv6_APN_configtmp18+"||"+dm.ipv6_APN_configtmp19,apnMode:dm.apn_mode,profileName:dm.m_profile_name||dm.profile_name,wanDial:dm.wan_dial,pdpType:dm.pdp_type=="IP"?"IP":dm.ipv6_pdp_type,pdpSelect:dm.pdp_select,index:dm.index,currIndex:dm.Current_index,autoApns:dm.apn_auto_config,autoApnsV6:dm.ipv6_apn_auto_config,wanApn:dm.wan_apn,authMode:dm.ppp_auth_mode.toLowerCase(),username:dm.ppp_username,password:dm.ppp_passtmp,dnsMode:"",dns1:"",dns2:"",wanApnV6:dm.ipv6_wan_apn,authModeV6:dm.ipv6_ppp_auth_mode.toLowerCase(),usernameV6:dm.ipv6_ppp_username,passwordV6:dm.ipv6_ppp_passtmp,dnsModeV6:"",dns1V6:"",dns2V6:"",apnNumPreset:dm.apn_num_preset}}else{return{result:false}}}}function aA(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={apn_action:"delete",apn_mode:"manual",index:dm.index};dp.goformId="APN_PROC_EX";return dp}function dl(dm){if(dm.result=="success"){return{result:true}}else{return{result:false}}}}function bF(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dp){var dn={goformId:"APN_PROC_EX",apn_mode:dm.apnMode};if(dm.apnMode=="manual"){dn.apn_action="set_default";dn.set_default_flag="1";dn.pdp_type=dm.pdpType;dn.index=dm.index}return dn}function dl(dm){if(dm.result=="success"){return{result:true}}else{return{result:false}}}}function by(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"APN_PROC_EX",apn_action:"save",apn_mode:"manual",profile_name:dm.profileName,wan_dial:"*99#",pdp_type:dm.pdpType,pdp_select:"auto",index:dm.index};if(dm.pdpType=="IP"){cX.extend(dp,{wan_apn:dm.wanApn,ppp_auth_mode:dm.authMode,ppp_username:dm.username,ppp_passtmp:dm.password})}else{if(dm.pdpType=="IPv6"){cX.extend(dp,{ipv6_wan_apn:dm.wanApnV6,ipv6_ppp_auth_mode:dm.authModeV6,ipv6_ppp_username:dm.usernameV6,ipv6_ppp_passtmp:dm.passwordV6})}else{cX.extend(dp,{wan_apn:dm.wanApn,ppp_auth_mode:dm.authMode,ppp_username:dm.username,ppp_passtmp:dm.password,dns_mode:dm.dnsMode,prefer_dns_manual:dm.dns1,standby_dns_manual:dm.dns2,ipv6_wan_apn:dm.wanApnV6,ipv6_ppp_auth_mode:dm.authModeV6,ipv6_ppp_username:dm.usernameV6,ipv6_ppp_passtmp:dm.passwordV6})}}return dp}function dl(dm){if(dm.result=="success"){return{result:true}}else{return{result:false}}}}var c4=["modem_main_state","pin_status","blc_wan_mode","blc_wan_auto_mode","loginfo","fota_new_version_state","fota_current_upgrade_state","fota_upgrade_selector","network_provider_spn","network_provider","is_mandatory","sta_count","m_sta_count"];var ax=["signalbar","network_type","sub_network_type","ppp_status","internet_status","EX_SSID1","sta_ip_status","EX_wifi_profile","m_ssid_enable","wifi_cur_state","SSID1","simcard_roam","lan_ipaddr","battery_charging","battery_vol_percent","battery_pers","spn_name_data","spn_b1_flag","spn_b2_flag","realtime_tx_bytes","realtime_rx_bytes","realtime_time","realtime_tx_thrpt","realtime_rx_thrpt","monthly_rx_bytes","monthly_tx_bytes","traffic_alined_delta","monthly_time","date_month","data_volume_limit_switch","data_volume_limit_size","data_volume_alert_percent","data_volume_limit_unit","roam_setting_option","upg_roam_switch","fota_package_already_download","ssid","show_ssid_on_lcd","dial_mode","ethwan_mode","default_wan_name","vpn_state","connect_status"];if(aK.HAS_SMS){cX.merge(ax,["sms_received_flag","sts_received_flag","sms_unread_num"])}var aX=[];var bU=[bw];function aY(){if(!cW){setTimeout(function(){aY()},5e3);return}var dk=cD();dg(dk,function(dl){for(var dm=0;dm<bU.length;dm++){if(typeof bU[dm]==="function"){bU[dm](dl)}}cX.merge(bU,aX);aX=[];setTimeout(function(){aY()},5e3)},function(){cS();setTimeout(function(){aY()},5e3)},false)}function cD(){var dk={multi_data:1};if(window.location.hash&&window.location.hash!="#entry"&&bD.isLoggedIn){if(aK.HAS_SMS){dk.sms_received_flag_flag=0;dk.sts_received_flag_flag=0}if(ax.length>0&&cp.indexOf(c4,ax[0])==-1){cX.each(ax,function(dl,dm){c4.push(dm)})}}else{if(ax.length>0&&cp.indexOf(c4,ax[0])!=-1){c4=cp.without(c4,ax)}}dk.cmd=c4.join(",");return dk}function cY(dk){if(cp.indexOf(aX,dk)==-1){aX.push(dk)}}function C(dk){bU=cp.without(bU,dk);if(bU.length==0){bU.push(bw)}return aX}function c9(dk){if(cp.indexOf(c4,dk)==-1){c4.push(dk)}}function bz(dk){c4=cp.without(c4,dk);return c4}function bw(dl){bD.defaultWanName=dl.default_wan_name;bD.signalImg=typeof dl.signalbar=="undefined"?"0":dl.signalbar;bD.networkType=dl.sub_network_type?dl.sub_network_type:dl.network_type?dl.network_type:"";if(bD.networkType.toLowerCase().indexOf("limited_service")!=-1||bD.networkType.toLowerCase().indexOf("limited service")!=-1){bD.networkType="limited_service"}else{if(bD.networkType.toLowerCase().indexOf("no_service")!=-1||bD.networkType.toLowerCase().indexOf("no service")!=-1){bD.networkType="no_service"}}bD.networkOperator=dl.network_provider_spn?dl.network_provider_spn:dl.network_provider?dl.network_provider:"";bD.spn_b1_flag=dl.spn_b1_flag;bD.spn_b2_flag=dl.spn_b2_flag;bD.spn_name_data=dl.spn_name_data;bD.connectStatus=typeof dl.ppp_status=="undefined"?"ppp_disconnected":dl.ppp_status;bD.rj45ConnectStatus=dl.internet_status;bD.ethWanMode=dl.ethwan_mode;bD.ssid1AttachedNum=dl.sta_count==""?0:parseInt(dl.sta_count,10);bD.ssid2AttachedNum=dl.m_sta_count==""?0:parseInt(dl.m_sta_count,10);bD.roamingStatus=aF(bD.networkType,dl.modem_main_state,dl.simcard_roam);bD.wifiStatus=dl.wifi_cur_state=="1";bD.simStatus=dl.modem_main_state;bD.pinStatus=dl.pin_status;var dm=3*60*60;var dk=dl.battery_vol_percent&&dl.battery_vol_percent.length>0?dl.battery_vol_percent:100;bD.batteryPers=dl.battery_pers;var dn=Math.round(dm*(1-dk/100));bD.batteryStatus=typeof dl.battery_charging=="undefined"?"0":dl.battery_charging;bD.batteryLevel=dk;bD.batteryTime=dn.toString();bD.data_counter={uploadRate:dl.realtime_tx_thrpt==""?0:dl.realtime_tx_thrpt,downloadRate:dl.realtime_rx_thrpt==""?0:dl.realtime_rx_thrpt,currentSent:dl.realtime_tx_bytes==""?0:dl.realtime_tx_bytes,currentReceived:dl.realtime_rx_bytes==""?0:dl.realtime_rx_bytes,currentConnectedTime:dl.realtime_time==""?0:dl.realtime_time,monthlySent:dl.monthly_tx_bytes==""?0:dl.monthly_tx_bytes,monthlyReceived:dl.monthly_rx_bytes==""?0:dl.monthly_rx_bytes,traffic_alined_delta:dl.traffic_alined_delta==""?0:dl.traffic_alined_delta,monthlyConnectedTime:dl.monthly_time==""?0:dl.monthly_time,month:dl.date_month==""?1:dl.date_month};bD.ssid=dl.SSID1;bD.authMode=dl.AuthMode;bD.isLoggedIn=aK.HAS_LOGIN?dl.loginfo=="ok":true;if(aK.HAS_SMS){if(!bD.newSmsReceived){bD.newSmsReceived=dl.sms_received_flag>0}if(!bD.smsReportReceived){bD.smsReportReceived=dl.sts_received_flag>0}if(typeof dl.sms_dev_unread_num!="undefined"){bD.smsUnreadCount=aK.SMS_UNREAD_NUM_INCLUDE_SIM?parseInt(dl.sms_dev_unread_num|0,10)+parseInt(dl.sms_sim_unread_num|0,10):parseInt(dl.sms_dev_unread_num|0,10)}else{bD.smsUnreadCount=parseInt(dl.sms_unread_num|0,10)}}if(dl.data_volume_limit_switch=="1"){bD.limitVolumeEnable=true;bD.limitVolumeType=dl.data_volume_limit_unit=="data"?"1":"0";bD.limitVolumePercent=dl.data_volume_alert_percent;if(dl.data_volume_limit_unit=="data"){var dp=dl.data_volume_limit_size.split("_");bD.limitVolumeSize=dp[0]*dp[1]*1024*1024}else{bD.limitVolumeSize=dl.data_volume_limit_size*60*60}}else{bD.limitVolumeEnable=false;bD.limitVolumeType="1";bD.limitVolumePercent="100";bD.limitVolumeSize="0"}bD.connectWifiProfile=dl.EX_wifi_profile;bD.connectWifiSSID=dl.EX_SSID1;bD.connectWifiStatus=dl.sta_ip_status;bD.multi_ssid_enable=dl.m_ssid_enable;bD.roamMode=dl.roam_setting_option;if(dl.blc_wan_mode=="AUTO"){bD.blc_wan_mode=dl.blc_wan_auto_mode?dl.blc_wan_auto_mode:"AUTO_PPP"}else{bD.blc_wan_mode=dl.blc_wan_mode?dl.blc_wan_mode:"PPP"}bD.new_version_state=dl.fota_new_version_state=="has_critical"||dl.fota_new_version_state=="has_optional"||dl.fota_new_version_state=="already_has_pkg";bD.current_upgrade_state=dl.fota_current_upgrade_state;if(bD.current_upgrade_state=="verify_failed"){bD.current_upgrade_state="upgrade_pack_error"}bD.fota_user_selector=dl.fota_upgrade_selector;bD.is_mandatory=dl.is_mandatory=="1"||dl.fota_new_version_state=="has_critical";bD.allowRoamingUpdate=dl.upg_roam_switch;bD.dialMode=dl.dial_mode;bD.fota_package_already_download=dl.fota_package_already_download;bD.connect_status=dl.connect_status;bD.vpn_state=dl.vpn_state}function cS(){bD.batteryStatus="0"}function aF(dl,dk,dm){if(""==cX.trim(dl)||"no_service"==dl.toLowerCase()||"limited_service"==dl.toLowerCase()||"modem_sim_undetected"==dk||"modem_waitpin"==dk||"modem_waitpuk"==dk){return false}if("Internal"==dm||"International"==dm){return true}else{return false}}cX(document).ready(function(){setTimeout(function(){aY()},1e3)});function bv(dl,dk,dn,dq){if(typeof dl!=="string"||dl===""||typeof dk!=="number"||isNaN(dk)){if(typeof dq==="function"){dq(false);return}}var dp=-1;if(dk===0){dp=0}else{if(dk===2){dp=2}else{if(dk==7){dp=7}else{dp=-1}}}if(-1===dp){if(typeof dq==="function"){dq(false);return}}var dm;if(dn.toString()=="NaN"){dm=""}else{dm=dn}dg({goformId:"SET_NETWORK",NetworkNumber:dl,Rat:dk,nSubrat:dm},function(dt){if(dt&&dt.result=="success"){var ds;var dr=0;var du=setInterval(function(){var dv=cC({cmd:"m_netselect_result"},false);if(!dv){dq(false);return}if(dv.m_netselect_result=="manual_success"){ds="1";window.clearInterval(du);dq(true)}else{if(dv.m_netselect_result=="manual_fail"){ds="0";window.clearInterval(du);dq(false)}else{if(dr<120){dr++}else{window.clearInterval(du);dq(false)}}}},1e3)}else{dq(false)}},function(dr){dq(false)},true)}function cP(){var dn=arguments[1];return bH(arguments,{},dl,dm,null,true);function dl(dp,dq){var dr={};dr.notCallback=true;dr.goformId="PBM_CONTACT_ADD";dr.location=dp.location;dr.name=encodeMessage(dp.name);dr.mobilephone_num=dp.mobile_phone_number;if(dr.location==1){dr.add_index_pc=dp.index;dr.homephone_num=dp.home_phone_number;dr.officephone_num=dp.office_phone_number;dr.email=encodeMessage(dp.mail);dr.groupchoose=dp.group;if(!dr.groupchoose){dr.groupchoose="common"}}else{dr.edit_index=dp.index}if(dp.delId!=undefined){dr.delId=dp.delId}return dr}function dm(dp){if(dp&&dp.result=="success"){bi("pbm_write_flag",dk)}else{dn(dp)}}function dk(dp){a4(dp,dn,dk)}}function a4(dk,dm,dl){if(dk.pbm_write_flag=="0"){n("pbm_write_flag",dl);dm({result:"success"})}else{if(dk.pbm_write_flag=="6"||dk.pbm_write_flag=="7"||dk.pbm_write_flag=="8"||dk.pbm_write_flag=="9"||dk.pbm_write_flag=="10"||dk.pbm_write_flag=="11"||dk.pbm_write_flag=="14"){n("pbm_write_flag",dl);dm({result:"fail"})}else{}}}function bu(){var dn=arguments[1];return bH(arguments,{},dl,dm,null,true);function dl(dp,dq){var dr={};dr.notCallback=true;dr.goformId="PBM_CONTACT_DEL";dr.del_option="delete_num";dr.delete_id=dp.indexs.join(",");return dr}function dm(dp){if(dp&&dp.result=="success"){bi("pbm_write_flag",dk)}else{dn(dp)}}function dk(dp){a4(dp,dn,dk)}}function aZ(){var dn=arguments[1];return bH(arguments,{},dk,dm,null,true);function dk(dp,dq){var dr={};dr.notCallback=true;dr.goformId="PBM_CONTACT_DEL";dr.del_option="delete_all";dr.del_all_location=dp.location;return dr}function dm(dp){if(dp&&dp.result=="success"){bi("pbm_write_flag",dl)}else{dn(dp)}}function dl(dp){a4(dp,dn,dl)}}function ab(){var dn=arguments[1];return bH(arguments,{},dl,dm,null,true);function dl(dp,dq){var dr={};dr.notCallback=true;dr.goformId="PBM_CONTACT_DEL";dr.del_option="delete_all_by_group";dr.del_all_location=3;dr.del_group=dp.group;return dr}function dm(dp){if(dp&&dp.result=="success"){bi("pbm_write_flag",dk)}else{dn(dp)}}function dk(dp){a4(dp,dn,dk)}}function ah(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SET_CONNECTION_MODE";dp.ConnectionMode=dm.connectionMode;dp.roam_setting_option=dm.isAllowedRoaming;return dp}function dl(dm){if(dm){return dm}else{callback(dm)}}}function K(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="ConnectionMode";return dp}function dl(dn){if(dn){var dm={};dm.connectionMode=dn.connectionMode;dm.isAllowedRoaming=dn.autoConnectWhenRoaming;return dm}else{return X}}}function a(dn,dk){if(dn[0].data_per_page==0){return{pbm_data:[]}}return bH(dn,{},dl,dm,null,false);function dl(dp,dq){var dr={};dr.mem_store=dk;if(dk==2){dr.cmd="pbm_data_total"}else{dr.cmd="pbm_data_info"}dr.page=dp.page;dr.data_per_page=dp.data_per_page;dr.orderBy=dp.orderBy;dr.isAsc=dp.isAsc;return dr}function dm(dp){if(dp&&dp.pbm_data){var dq=[];cX.each(dp.pbm_data,function(dr){dq.push({pbm_id:dp.pbm_data[dr].pbm_id,pbm_location:dp.pbm_data[dr].pbm_location,pbm_number:dp.pbm_data[dr].pbm_number,pbm_anr:dp.pbm_data[dr].pbm_anr,pbm_anr1:dp.pbm_data[dr].pbm_anr1,pbm_group:dp.pbm_data[dr].pbm_group,pbm_name:decodeMessage(dp.pbm_data[dr].pbm_name),pbm_email:decodeMessage(dp.pbm_data[dr].pbm_email)})});return{pbm_data:dq}}else{return X}}}function b5(){if(arguments[0].data_per_page==0){return{pbm_data:[]}}return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="pbm_data_total";dp.mem_store=3;dp.pbm_group=dm.group;dp.page=dm.page;dp.data_per_page=dm.data_per_page;dp.orderBy=dm.orderBy;dp.isAsc=dm.isAsc;return dp}function dl(dm){if(dm&&dm.pbm_data){var dn=[];cX.each(dm.pbm_data,function(dp){dn.push({pbm_id:dm.pbm_data[dp].pbm_id,pbm_location:dm.pbm_data[dp].pbm_location,pbm_number:dm.pbm_data[dp].pbm_number,pbm_anr:dm.pbm_data[dp].pbm_anr,pbm_anr1:dm.pbm_data[dp].pbm_anr1,pbm_group:dm.pbm_data[dp].pbm_group,pbm_name:decodeMessage(dm.pbm_data[dp].pbm_name),pbm_email:decodeMessage(dm.pbm_data[dp].pbm_email)})});return{pbm_data:dn}}else{return X}}}function dd(){return a(arguments,1)}function cQ(){return a(arguments,0)}function T(){return a(arguments,2)}function cq(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="pbm_init_flag";return dp}function dl(dm){if(dm){return dm}else{return X}}}function cn(dn,dm){return bH(dn,{},dk,dl,null,false);function dk(dp,dq){var dr={};dr.cmd="pbm_capacity_info";if(dm){dr.pbm_location="pbm_sim"}else{dr.pbm_location="pbm_native"}return dr}function dl(dp){if(dp){return dp}else{return X}}}function b0(){var dk=cn(arguments,true);return{simPbmTotalCapacity:parseInt(dk.pbm_sim_max_record_num),simPbmUsedCapacity:parseInt(dk.pbm_sim_used_record_num),simType:dk.pbm_sim_type,maxNameLen:parseInt(dk.pbm_sim_max_name_len),maxNumberLen:parseInt(dk.pbm_sim_max_number_len)>40?40:parseInt(dk.pbm_sim_max_number_len)}}function ai(){var dk=cn(arguments,false);return{pcPbmTotalCapacity:parseInt(dk.pbm_dev_max_record_num),pcPbmUsedCapacity:parseInt(dk.pbm_dev_used_record_num)}}function bL(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"lan_station_list"};return dp}function dl(dm){var dq=[];var dr=dm.lan_station_list||dm.station_list;for(var dp=0;dr&&dp<dr.length;dp++){var ds={};ds.macAddress=dr[dp].mac_addr;var dn=dr[dp].hostname;ds.hostName=dn==""?cX.i18n.prop("unknown"):dn;ds.ipAddress=dr[dp].ip_addr;dq.push(ds)}return{attachedDevices:dq}}}function bA(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"station_list"};return dp}function dl(dm){var dq=[];var dr=dm.station_list;for(var dp=0;dr&&dp<dr.length;dp++){var ds={};ds.macAddress=dr[dp].mac_addr;var dn=dr[dp].hostname;ds.hostName=dn==""?cX.i18n.prop("unknown"):dn;ds.ipAddress=dr[dp].ip_addr;ds.timestamp=dr[dp].timestamp;ds.duration=dr[dp].duration;ds.rx=dr[dp].rx;ds.tx=dr[dp].tx;dq.push(ds)}return{attachedDevices:dq}}}function k(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SET_WEB_LANGUAGE";dp.Language=dm.Language;return dp}function dl(dm){if(dm){return dm}else{return X}}}function A(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="Language";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.Language=dn&&dn.Language?dn.Language:"en";return dm}else{return X}}}function df(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="support_languages";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.supLanguages=dn.support_languages.split("+");return dm}else{return X}}}function bP(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SET_BEARER_PREFERENCE";dp.BearerPreference=dm.strBearerPreference;return dp}function dl(dm){if(dm){return dm}else{return X}}}function aG(dm){cX.post("/goform/goform_set_cmd_process",{goformId:"SCAN_NETWORK"},function(dn){if(dn.result=="success"){dk()}else{dm(false,[])}},"json").error(function(){dm(false,[])});function dk(){cX.getJSON("/goform/goform_get_cmd_process",{cmd:"m_netselect_status",_:(new Date).getTime()},function(dn){if(dn.m_netselect_status=="manual_selecting"){setTimeout(dk,1e3)}else{cX.getJSON("/goform/goform_get_cmd_process",{cmd:"m_netselect_contents",_:(new Date).getTime()},function(dp){if(trim(dp.m_netselect_contents)!=""){dl(dp.m_netselect_contents)}else{dm(false,[])}}).error(function(){dm(false,[])})}}).error(function(){dm(false,[])})}function dl(dn){var ds=/([^,;]*),([^,]*),([^,]*),([^,]*),([^,;]*)/g;var dt=[];var du;var dr=dn.split(";");var dp="";for(i=0;i<dr.length;i++){var dq=dr[i].split(",").length;if(dq==4){dp+=dr[i]+",NON;"}else{dp+=dr[i]+";"}}while(du=ds.exec(dp)){if(du!=null){dt.push({strShortName:du[2].replace(/\"/g,""),strNumeric:du[3].replace(/\D/g,""),nRat:parseInt(du[4],10),nState:parseInt(du[1],10),SubAct:parseInt(du[5],10)})}}dm(true,dt)}}function S(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="current_network_mode,m_netselect_save,net_select_mode,m_netselect_contents,net_select,ppp_status,modem_main_state";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.current_network_mode=dn.current_network_mode;dm.net_select_mode=dn.net_select_mode;dm.m_netselect_save=dn.m_netselect_save;dm.m_netselect_contents=dn.m_netselect_contents;dm.net_select=dn.net_select;dm.ppp_status=dn.ppp_status;dm.modem_main_state=dn.modem_main_state;return dm}else{return X}}}function aO(){return bH(arguments,{},dk,dl,{},false);function dk(dm,dn){var dp={cmd:"sms_data_total",page:dm.page,data_per_page:aK.SMS_DATABASE_SORT_SUPPORT?dm.smsCount:500,mem_store:dm.nMessageStoreType,tags:dm.tags,order_by:dm.orderBy};return dp}function dl(dm){if(dm&&dm.messages&&dm.messages.length>0){return{messages:cT(dm.messages)}}else{return{messages:[]}}}}function cT(dm,ds){var dt=[];for(var dn=0;dn<dm.length;dn++){if(!aK.SHOW_UN_COMPLETE_CONCAT_SMS&&typeof dm[dn].received_all_concat_sms!="undefined"&&dm[dn].received_all_concat_sms=="0"){continue}var dq={};dq.id=dm[dn].id;dq.number=dm[dn].number;dq.content=ds?dm[dn].content:a1(dm[dn].content);dq.time=transTime("20"+dm[dn].date);dq.isNew=dm[dn].tag=="1";dq.groupId=dm[dn].draft_group_id;dq.tag=dm[dn].tag;dq.receivedAll=dm[dn].received_all_concat_sms=="1";dt.push(dq)}if(!aK.SMS_DATABASE_SORT_SUPPORT){var dk=[];var dp=[];for(var dn=dt.length;dn--;){var dl=dt[dn];var dr=cX.inArray(dl.id,dk);if(dr==-1){dk.push(dl.id);dp.push(dl)}else{if(dl.content.length>dp[dr].content.length){dp[dr]=dl}}}return cp.sortBy(dp,function(du){return 0-du.id})}else{return dt}}function a1(dk){return decodeMessage(escapeMessage(dk))}function a3(){var dn=arguments[1];var dl=arguments[2]?arguments[2]:dn;return bH(arguments,{},dk,dm,null,true);function dk(dp,dq){var dr={goformId:"SEND_SMS",notCallback:true,Number:dp.number,sms_time:getCurrentTimeString(),MessageBody:escapeMessage(encodeMessage(dp.message)),ID:dp.id,encode_type:getEncodeType(dp.message).encodeType};return dr}function dm(dp){if(!dp){dl(cX.extend(X,{errorType:"sendFail",errorText:"send_fail_try_again"}));return}if(dp.result=="success"){setTimeout(function(){cU({smsCmd:4,errorType:"sendFail",errorText:"send_fail_try_again"},dn,dl)},1e3)}else{dl(cX.extend(X,{errorType:"sendFail",errorText:"send_fail_try_again"}))}}}function aL(){var dn=arguments[1];var dl=arguments[2]?arguments[2]:dn;return bH(arguments,{},dk,dm,null,true);function dk(dp,dq){var dr={notCallback:true,goformId:"SAVE_SMS",SMSMessage:escapeMessage(encodeMessage(dp.message)),SMSNumber:dp.numbers.join(";")+";",Index:dp.index,encode_type:getEncodeType(dp.message).encodeType,sms_time:dp.currentTimeString,draft_group_id:dp.groupId};return dr}function dm(dp){if(!dp){dl(cX.extend(X,{errorType:"saveFail",errorText:"save_fail"}));return}if(dp.result=="success"){cU({smsCmd:5,errorType:"saveFail",errorText:"save_fail"},dn,dl)}else{dl(cX.extend(X,{errorType:"saveFail",errorText:"save_fail"}))}}}function b4(){var dp=arguments[1];var dm=arguments[2]?arguments[2]:dp;return bH(arguments,{},dl,dn,null,true);function dl(dq,dr){var ds={goformId:"ALL_DELETE_SMS",notCallback:true,which_cgi:dq.location};return ds}function dn(dq){if(!dq){dm(cX.extend(X,{errorType:"deleteFail",errorText:"delete_fail_try_again"}));return}if(dq.result=="success"){bi("sms_cmd_status_info",dk)}else{dm(cX.extend(X,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}}function dk(dr){var dq=dr.sms_cmd_status_info;if(dq=="2"){n("sms_cmd_status_info",dk);dm(cX.extend(X,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}else{if(dq=="3"){n("sms_cmd_status_info",dk);dp({result:true})}}}}function cJ(){var dn=arguments[1];var dl=arguments[2]?arguments[2]:dn;return bH(arguments,{},dk,dm,null,true);function dk(dq,dr){var dp=dq.ids.join(";")+";";var ds={goformId:"DELETE_SMS",msg_id:dp,notCallback:true};return ds}function dm(dp){if(!dp){dl(cX.extend(X,{errorType:"deleteFail",errorText:"delete_fail_try_again"}));return}if(dp.result=="success"){cU({smsCmd:6,errorType:"deleteFail",errorText:"delete_fail_try_again"},dn,dl)}else{dl(cX.extend(X,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}}}function cU(dl,dm,dk){dg({cmd:"sms_cmd_status_info",sms_cmd:dl.smsCmd},function(dp){if(dp){var dn=dp.sms_cmd_status_result;if(dn=="2"){dk(cX.extend(X,{errorType:dl.errorType,errorText:dl.errorText}))}else{if(dn=="3"){dm({result:"success"})}else{window.setTimeout(function(){cU(dl,dm,dk)},1e3)}}}else{dk(cX.extend(X,{errorType:dl.errorType,errorText:dl.errorText}))}},function(dn){dk(cX.extend(X,{errorType:dl.errorType,errorText:dl.errorText}))},false)}function aM(){if(aK.smsIsReady){var dm=arguments[1];if(dm){return dm({sms_cmd:"1",sms_cmd_status_result:"3"})}else{return{sms_cmd:"1",sms_cmd_status_result:"3"}}}else{return bH(arguments,{},dk,dl,null,false)}function dk(dn,dp){var dq={};dq.cmd="sms_cmd_status_info";dq.sms_cmd=1;return dq}function dl(dn){if(dn){if(dn.sms_cmd_status_result=="3"){aK.smsIsReady=true}return dn}else{return X}}}function ag(){return bH(arguments,{},dk,dl,null,true);function dk(dn,dp){var dm=dn.ids.join(";");if(dn.ids.length>0){dm+=";"}var dq={goformId:"SET_MSG_READ",msg_id:dm,tag:0};return dq}function dl(dm){if(dm.result=="success"){return{result:true}}else{return{result:false}}}}function L(){return bH(arguments,{},dk,dl,{},false);function dk(dm,dn){var dp={cmd:"sms_status_rpt_data",page:dm.page,data_per_page:dm.smsCount};return dp}function dl(dm){if(dm){return{messages:cT(dm.messages,true)}}else{return X}}}function bC(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp=cX.extend({},dm);dp.goformId="LOGOUT";return dp}function dl(dm){if(dm&&dm.result=="success"){bD.isLoggedIn=false;return{result:true}}else{return cX.extend(X,{errorType:"loggedOutError"})}}}function b7(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.newPassword=aK.PASSWORD_ENCODE?Base64.encode(dm.newValue):dm.newValue;dp.oldPassword=aK.PASSWORD_ENCODE?Base64.encode(dm.oldValue):dm.oldValue;dp.goformId="CHANGE_PASSWORD";return dp}function dl(dm){if(dm&&dm.result==="success"){return{result:true}}else{return cX.extend(X,{errorType:"badPassword"})}}}function c6(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="pinnumber,pin_status,puknumber";dp.multi_data=1;return dp}function dl(dm){if(dm){return dm}else{return X}}}function dj(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="ENABLE_PIN";dp.OldPinNumber=dm.oldPin;return dp}function dl(dm){if(dm&&dm.result==="success"){return{result:true}}else{return{result:false}}}}function b9(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="DISABLE_PIN";dp.OldPinNumber=dm.oldPin;return dp}function dl(dm){if(dm&&dm.result==="success"){return{result:true}}else{return{result:false}}}}function p(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="ENABLE_PIN";dp.OldPinNumber=dm.oldPin;dp.NewPinNumber=dm.newPin;return dp}function dl(dm){if(dm&&dm.result==="success"){return{result:true}}else{return{result:false}}}}function bB(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="lan_ipaddr,lan_netmask,mac_address,dhcpEnabled,dhcpStart,dhcpEnd,dhcpLease_hour";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.ipAddress=dn.lan_ipaddr;dm.subnetMask=dn.lan_netmask;dm.macAddress=dn.mac_address;dm.dhcpServer=dn.dhcpEnabled;dm.dhcpStart=dn.dhcpStart;dm.dhcpEnd=dn.dhcpEnd;dm.dhcpLease=parseInt(dn.dhcpLease_hour,10);return dm}else{return X}}}function bX(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="dns_manual_enable,dhcpDns";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.dnsServerMode=dn.dns_manual_enable;dm.dnsPrimary=dn.dhcpDns;return dm}else{return X}}}function cm(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="DHCP_SETTING";dp.lanIp=dm.ipAddress;dp.lanNetmask=dm.subnetMask;dp.lanDhcpType=dm.dhcpServer=="1"?"SERVER":"DISABLE";if(dp.lanDhcpType=="SERVER"){dp.dhcpStart=dm.dhcpStart;dp.dhcpEnd=dm.dhcpEnd;dp.dhcpLease=dm.dhcpLease}dp.dhcp_reboot_flag=1;return dp}function dl(dm){if(dm){return dm}else{return X}}}function cI(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="DNS_SETTING";dp.dns_manual_enable=dm.dnsServerMode;dp.dhcpDns=dm.dnsPrimary;return dp}function dl(dm){if(dm){return dm}else{return X}}}function au(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="tr069_enable,tr069_acs_username,tr069_acs_password,tr069_acs_url,tr069_inform_enable,tr069_inform_interval,tr069_cpe_auth_enable,tr069_cpe_username,tr069_cpe_password";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.TR069Server=dn.tr069_enable;dm.AcsName=dn.tr069_acs_username;dm.AcsPassword=dn.tr069_acs_password;dm.AcsAddress=dn.tr069_acs_url;dm.InformEnable=dn.tr069_inform_enable;dm.ReportCycle=dn.tr069_inform_interval;dm.AuthEnable=dn.tr069_cpe_auth_enable;dm.CpeName=dn.tr069_cpe_username;dm.CpePassword=dn.tr069_cpe_password;return dm}else{return X}}}function l(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="GORORM_SET_TR069";dp.tr069enanble=dm.tr069Server;dp.tr069AcsName=dm.AcsName;dp.tr069AcsPassword=dm.AcsPassword;dp.tr069AcsAddress=dm.AcsAddress;dp.tr069InformEnable=dm.InformEnable;dp.tr069InformInterval=dm.ReportCycle;dp.tr069AuthEnable=dm.AuthEnable;dp.tr069CpeName=dm.CpeName;dp.tr069CpePassword=dm.CpePassword;return dp}function dl(dm){if(dm){return dm}else{return X}}}function dc(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="vpn_name,vpn_password,vpn_server_ip,vpn_state,vpn_type,vpn_mode,connect_status,vpn_status";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.vpn_name=dn.vpn_name;dm.vpn_password=dn.vpn_password;dm.vpn_server_ip=dn.vpn_server_ip;dm.vpn_state=dn.vpn_state;dm.vpn_type=dn.vpn_type;dm.vpn_mode=dn.vpn_mode;dm.connect_status=dn.connect_status;dm.vpn_status=dn.vpn_status;return dm}else{return X}}}function P(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="GOFORM_OPEN_VPN";dp.vpn_name=dm.vpn_name;dp.vpn_password=dm.vpn_password;dp.vpn_server_ip=dm.vpn_server_ip;dp.vpn_type=dm.vpn_type;return dp}function dl(dm){if(dm){return dm}else{return X}}}function bx(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="GOFORM_OPEN_VPN";return dp}function dl(dm){if(dm){return dm}else{return X}}}function aJ(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="GOFORM_CLOSE_VPN";return dp}function dl(dm){if(dm){return dm}else{return X}}}function bW(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="band_select_enable,ussd_enable,vpn_enable,dns_manual_func_enable,tr069_func_enable";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.bandSelectEnable=dn.band_select_enable=="1";dm.ussdEnable=dn.ussd_enable=="1";dm.vpnEnable=dn.vpn_enable=="1";dm.dnsManualEnable=dn.dns_manual_func_enable=="1";dm.tr069FuncEnable=dn.tr069_func_enable=="1";return dm}else{return X}}}function ca(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="sms_parameter_info";return dp}function dl(dn){if(dn){var dm={};dm.centerNumber=dn.sms_para_sca;dm.memStroe=dn.sms_para_mem_store;dm.deliveryReport=dn.sms_para_status_report;switch(parseInt(dn.sms_para_validity_period,10)){case 143:dm.validity="twelve_hours";break;case 167:dm.validity="one_day";break;case 173:dm.validity="one_week";break;case 244:dm.validity="largest";break;case 255:dm.validity="largest";break;default:dm.validity="twelve_hours";break}return dm}else{return X}}}function aU(){var dn=arguments[1];var dl=arguments[2]?arguments[2]:dn;return bH(arguments,{},dk,dm,null,true);function dk(dp,dq){var dr={};dr.goformId="SET_MESSAGE_CENTER";dr.save_time=dp.validity;dr.MessageCenter=dp.centerNumber;dr.status_save=dp.deliveryReport;dr.save_location="native";dr.notCallback=true;return dr}function dm(dp){if(!dp){dl(cX.extend(X,{errorType:"smsSettingFail",errorText:"error_info"}));return}if(dp.result=="success"){cU({smsCmd:3,errorType:"smsSettingFail",errorText:"error_info"},dn,dl)}else{dl(cX.extend(X,{errorType:"deleteFail",errorText:"delete_fail_try_again"}))}}}function s(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="EXECUTE_AT_COMMAND";dp.at_cmd=cX("#txtAtCmd").val().replace(/\s*/g,"").toUpperCase();return dp}function dl(dm){if(dm){return dm}else{return X}}}function az(){var dl={};if(aK.HAS_PARENTAL_CONTROL&&aK.currentUserInChildGroup!=false){dl={errorType:"no_auth"}}return bH(arguments,dl,dk,dm,null,true);function dk(dn,dp){var dq={};dq.goformId="RESTORE_FACTORY_SETTINGS";return dq}function dm(dn){if(dn){return dn}else{return X}}}function ad(dk){var dl={};dl.cmd="restore_flag";dl.multi_data=1;dg(dl,function(dm){if(dm&&dm.restore_flag==="1"){dk()}else{setTimeout(function(){ad(dk)},5e3)}},function(){setTimeout(function(){ad(dk)},5e3)},false)}function cl(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="wifi_wps_index,WscModeOption,AuthMode,wifi_cur_state,EncrypType,wps_mode,WPS_SSID,m_ssid_enable,SSID1,m_SSID,m_EncrypType,m_AuthMode,wifi_sta_connection";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.wpsFlag=dn.WscModeOption;dm.authMode=dn.AuthMode;dm.wpsType=dn.wps_mode;dm.radioFlag=dn.wifi_cur_state=="1"?"1":"0";dm.encrypType=dn.EncrypType;dm.wpsSSID=dn.WPS_SSID;dm.ssidEnable=dn.m_ssid_enable;dm.ssid=dn.SSID1;dm.multiSSID=dn.m_SSID;dm.m_encrypType=dn.m_EncrypType;dm.wifi_wps_index=dn.wifi_wps_index;dm.AuthMode=dn.AuthMode;dm.m_AuthMode=dn.m_AuthMode;dm.ap_station_enable=dn.wifi_sta_connection;return dm}else{return X}}}function r(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="WIFI_WPS_SET";dp.WPS_SSID=dm.wpsSSID;dp.wps_mode=dm.wpsType;dp.wifi_wps_index=dm.wpsIndex;if(dp.wps_mode=="PIN"){dp.wps_pin=dm.wpsPin}return dp}function dl(dm){if(dm){return dm}else{return X}}}function ae(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="WIFI_M_WPS_SET";dp.m_WPS_SSID=dm.wpsSSID;dp.m_wps_mode=dm.wpsType;dp.m_wifi_wps_index=dm.wpsIndex;if(dp.m_wps_mode=="PIN"){dp.m_wps_pin=dm.wpsPin}return dp}function dl(dm){if(dm){return dm}else{return X}}}function ct(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="Sleep_interval";return dp}function dl(dn){if(dn){var dm={};dm.sleepMode=dn.Sleep_interval;return dm}else{return X}}}function bm(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SET_WIFI_SLEEP_INFO";dp.sysIdleTimeToSleep=dm.sleepMode;return dp}function dl(dm){if(dm){return dm}else{return X}}}function b6(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="RemoteManagement,WANPingFilter";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.remoteFlag=dn.RemoteManagement=="1"?"1":"0";dm.pingFlag=dn.WANPingFilter=="1"?"1":"0";return dm}else{return X}}}function cN(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="FW_SYS";dp.remoteManagementEnabled=dm.remoteFlag;dp.pingFrmWANFilterEnabled=dm.pingFlag;return dp}function dl(dm){if(dm){return dm}else{return X}}}function D(){return bH(arguments,{},dk,dm,null,false);function dk(dn,dp){var dq={};dq.cmd="PortForwardEnable,PortForwardRules_0,PortForwardRules_1,PortForwardRules_2,PortForwardRules_3,PortForwardRules_4,PortForwardRules_5,PortForwardRules_6,PortForwardRules_7,PortForwardRules_8,PortForwardRules_9";dq.multi_data=1;return dq}function dm(dp){if(dp){var dn={};dn.portForwardEnable=dp.PortForwardEnable;var dq=[];if(dp.PortForwardRules_0!=""){dq.push([0,dp.PortForwardRules_0])}if(dp.PortForwardRules_1!=""){dq.push([1,dp.PortForwardRules_1])}if(dp.PortForwardRules_2!=""){dq.push([2,dp.PortForwardRules_2])}if(dp.PortForwardRules_3!=""){dq.push([3,dp.PortForwardRules_3])}if(dp.PortForwardRules_4!=""){dq.push([4,dp.PortForwardRules_4])}if(dp.PortForwardRules_5!=""){dq.push([5,dp.PortForwardRules_5])}if(dp.PortForwardRules_6!=""){dq.push([6,dp.PortForwardRules_6])}if(dp.PortForwardRules_7!=""){dq.push([7,dp.PortForwardRules_7])}if(dp.PortForwardRules_8!=""){dq.push([8,dp.PortForwardRules_8])}if(dp.PortForwardRules_9!=""){dq.push([9,dp.PortForwardRules_9])}dn.portForwardRules=dl(dq);return dn}else{return X}}function dl(dn){var ds=[];if(dn&&dn.length>0){for(var dq=0;dq<dn.length;dq++){var dp={};var dr=dn[dq][1].split(",");dp.index=dn[dq][0];dp.ipAddress=dr[0];dp.portRange=dr[1]+" - "+dr[2];dp.protocol=transProtocol(dr[3]);dp.comment=dr[4];ds.push(dp)}}return ds}}function ar(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="FW_FORWARD_ADD";dp.ipAddress=dm.ipAddress;dp.portStart=dm.portStart;dp.portEnd=dm.portEnd;dp.protocol=dm.protocol;dp.comment=dm.comment;return dp}function dl(dm){if(dm){return dm}else{return X}}}function cM(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="FW_FORWARD_DEL";dp.delete_id=dm.indexs.join(";")+";";return dp}function dl(dm){if(dm){return dm}else{return X}}}function aE(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="VIRTUAL_SERVER";dp.PortForwardEnable=dm.portForwardEnable;return dp}function dl(dm){if(dm){return dm}else{return X}}}function c(dq,dp,dk){var dn=dq+dp+"FFFFFFFFFFFFFFFFFFFFFFFF";var ds;var dr;ds=dn.substring(0,24);dr=dn.substring(0,16);var dm=bE.enc.Latin1.parse(ds);var dl=bE.enc.Latin1.parse(dr);var dt=bE.AES.decrypt(dk,dm,{iv:dl,mode:bE.mode.CBC,padding:bE.pad.ZeroPadding}).toString(bE.enc.Utf8);return dt}function ba(){return bH(arguments,{},dk,dl,null,false);function dk(dn,dp){var dq={};var dm=aK.PASSWORD_ENCODE?",WPAPSK1_encode":",imei,rnum_js,WPAPSK1_enaes";dq.cmd="pdp_type,ipv6_pdp_type,wifi_cur_state,SSID1,HideSSID,AuthMode,WscModeOption,ppp_status,apn_index,ipv6_apn_index,ipv6_APN_index,m_profile_name,apn_mode,EncrypType,DefaultKeyID,Key1Str1,Key2Str1,Key3Str1,Key4Str1"+dm+",APN_configtmp0,APN_configtmp1,APN_configtmp2,APN_configtmp3,APN_configtmp4,APN_configtmp5,APN_configtmp6,APN_configtmp7,APN_configtmp8,APN_configtmp9,APN_configtmp10,APN_configtmp11,APN_configtmp12,APN_configtmp13,APN_configtmp14,APN_configtmp15,APN_configtmp16,APN_configtmp17,APN_configtmp18,APN_configtmp19,ipv6_APN_configtmp0,ipv6_APN_configtmp1,ipv6_APN_configtmp2,ipv6_APN_configtmp3,ipv6_APN_configtmp4,ipv6_APN_configtmp5,ipv6_APN_configtmp6,ipv6_APN_configtmp7,ipv6_APN_configtmp8,ipv6_APN_configtmp9,ipv6_APN_configtmp10,ipv6_APN_configtmp11,ipv6_APN_configtmp12,ipv6_APN_configtmp13,ipv6_APN_configtmp14,ipv6_APN_configtmp15,ipv6_APN_configtmp16,ipv6_APN_configtmp17,ipv6_APN_configtmp18,ipv6_APN_configtmp19";dq.multi_data=1;return dq}function dl(dm){if(dm){if(aK.PASSWORD_ENCODE){dm.WPAPSK1=Base64.decode(dm.WPAPSK1_encode)}else{dm.WPAPSK1=c(dm.rnum_js,dm.imei,dm.WPAPSK1_enaes)}return dm}else{return X}}}function de(){ay(arguments,dk,dl);function dk(dm){var dn={goformId:"QUICK_SETUP_EX",index:dm.apn_index,pdp_type:dm.pdp_type,apn_mode:dm.apnMode,profile_name:dm.profile_name,wan_apn:dm.wan_apn,ppp_auth_mode:dm.ppp_auth_mode,ppp_username:dm.ppp_username,ppp_passtmp:dm.ppp_passtmp,ipv6_wan_apn:dm.ipv6_wan_apn,ipv6_ppp_auth_mode:dm.ipv6_ppp_auth_mode,ipv6_ppp_username:dm.ipv6_ppp_username,ipv6_ppp_passtmp:dm.ipv6_ppp_passtmp,SSID_name:dm.SSID_name,SSID_Broadcast:dm.SSID_Broadcast,Encryption_Mode_hid:dm.Encryption_Mode_hid,security_shared_mode:dm.security_shared_mode,WPA_PreShared_Key:aK.PASSWORD_ENCODE?Base64.encode(dm.WPA_PreShared_Key):dm.WPA_PreShared_Key,wep_default_key:dm.wep_default_key,WPA_ENCRYPTION_hid:dm.WPA_ENCRYPTION_hid};dn.wep_key_1=dm.wep_key_1;dn.wep_key_2=dm.wep_key_2;dn.wep_key_3=dm.wep_key_3;dn.wep_key_4=dm.wep_key_4;if(dm.wep_default_key=="1"){dn.WEP2Select=dm.WEP2Select}else{if(dm.wep_default_key=="2"){dn.WEP3Select=dm.WEP3Select}else{if(dm.wep_default_key=="3"){dn.WEP4Select=dm.WEP4Select}else{dn.WEP1Select=dm.WEP1Select}}}return dn}function dl(dm){if(dm){return dm}else{return cX.extend(X,{errorType:"SetSetUpError"})}}}function ay(du,dp,dm){var dt=false;var dk=false;var dr=dp(du[0]);var ds=du[1];var dl=function(dv){dt=true;if(!dk&&ds){ds(dm(dv))}dk=true};var dq=du[2];var dn=function(){dt=true;if(dq){dq()}};dg(dr,dl,dn,true);addTimeout(function(){if(dt==false){var dv=addInterval(function(){if(dt==false){A({},function(dw){window.clearInterval(dv);dl({result:"success"})})}},1e3)}},5e3)}function b2(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"sdcard_mode_option,sd_card_state,HTTP_SHARE_STATUS,HTTP_SHARE_WR_AUTH,HTTP_SHARE_FILE",multi_data:1};return dp}function dl(dn){if(dn){var dp;if("mmc2"==dn.HTTP_SHARE_FILE||"/mmc2"==dn.HTTP_SHARE_FILE||"/mmc2/"==dn.HTTP_SHARE_FILE){dp="1"}else{dp="0"}var dm={sd_mode:dn.sdcard_mode_option=="1"?"0":"1",sd_status:dn.sd_card_state,share_status:dn.HTTP_SHARE_STATUS=="Enabled"?"1":"0",share_auth:dn.HTTP_SHARE_WR_AUTH=="readOnly"?"0":"1",file_to_share:dp,share_file:dn.HTTP_SHARE_FILE};return dm}else{return X}}}function cF(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"HTTPSHARE_MODE_SET",mode_set:dm.mode=="0"?"http_share_mode":"usb_mode"};return dp}function dl(dm){if(dm&&dm.result=="success"){return{result:"success"}}else{if(dm&&dm.result=="processing"){return{result:"processing"}}else{return{result:false}}}}}function M(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"GOFORM_HTTPSHARE_CHECK_FILE",path_SD_CARD:dm.path};return dp}function dl(dm){if(dm){if(dm.result=="no_sdcard"){return{status:"no_sdcard"}}else{if(dm.result=="noexist"){return{status:"noexist"}}else{if(dm.result=="processing"){return{status:"processing"}}else{return{status:"exist"}}}}}else{return X}}}function af(){return bH(arguments,{},dk,dm,null,true);function dk(dn,dp){var dq={goformId:"HTTPSHARE_ENTERFOLD",path_SD_CARD:dn.path,indexPage:dn.index};return dq}function dm(dn){if(dn){if(dn.result=="failure"){return cX.extend(X,{errorType:"get_file_list_failure"})}else{if(dn.result=="no_sdcard"){return cX.extend(X,{errorType:"no_sdcard"})}else{return dl(dn.result)}}}else{return X}}function dl(dn){var dr={};dr.totalRecord=dn.totalRecord;var dt=[];var dq=dn.fileInfo;for(var dp=0;dq&&dp<dq.length;dp++){if(dq[dp].fileName==""){continue}var ds={};ds.fileName=dq[dp].fileName;ds.attribute=dq[dp].attribute;ds.size=dq[dp].size;ds.lastUpdateTime=dq[dp].lastUpdateTime;dt.push(ds)}dr.details=dt;return dr}}function bJ(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dq=new Date;var dp=dq.getTime();var dr=dq.getTimezoneOffset()*60;return{goformId:"HTTPSHARE_FILE_RENAME",path_SD_CARD:dm.path,OLD_NAME_SD_CARD:dm.oldPath,NEW_NAME_SD_CARD:dm.newPath,path_SD_CARD_time:transUnixTime(dp),path_SD_CARD_time_unix:Math.round((dp-dr*1e3)/1e3)}}function dl(dm){if(dm){if(dm.result=="success"){return{result:true}}else{if(dm.result=="no_sdcard"){return cX.extend(X,{errorType:"no_sdcard"})}else{if(dm.result=="noexist"){return cX.extend(X,{errorType:"no_exist"})}else{if(dm.result=="processing"){return cX.extend(X,{errorType:"sd_file_processing_cant_rename"})}else{return{result:false}}}}}}else{return X}}}function B(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"HTTPSHARE_GETCARD_VALUE"};return dp}function dl(dm){if(!dm||dm.result&&dm.result=="no_sdcard"){return cX.extend(X,{errorType:"no_sdcard"})}else{return{totalMemorySize:dm.sd_card_total_size==""?0:dm.sd_card_total_size*32*1024,availableMemorySize:dm.sd_card_avi_space==""?0:dm.sd_card_avi_space*32*1024}}}}function a0(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp=(new Date).getTime();var dq={goformId:"HTTPSHARE_DEL",path_SD_CARD:dm.path,name_SD_CARD:dm.names,path_SD_CARD_time:transUnixTime(dp),path_SD_CARD_time_unix:Math.round(dp/1e3)};return dq}function dl(dm){if(dm.result&&dm.result=="failure"){return{status:"failure"}}else{if(dm.result&&dm.result=="no_sdcard"){return{status:"no_sdcard"}}else{if(dm.result&&dm.result=="processing"){return{status:"processing"}}else{if(dm.result&&dm.result=="success"){return{status:"success"}}else{return X}}}}}}function I(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dq=new Date;var dp=dq.getTime();var dr=dq.getTimezoneOffset()*60;return{goformId:"HTTPSHARE_NEW",path_SD_CARD:dm.path,path_SD_CARD_time:transUnixTime(dp),path_SD_CARD_time_unix:Math.round((dp-dr*1e3)/1e3)}}function dl(dm){if(dm.result&&dm.result=="failure"){return cX.extend(X,{errorType:"create_folder_failure"})}else{if(dm.result&&dm.result=="no_sdcard"){return cX.extend(X,{errorType:"no_sdcard"})}else{if(dm.result&&dm.result=="success"){return{result:true}}else{return X}}}}}function ck(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"HTTPSHARE_AUTH_SET",HTTP_SHARE_STATUS:dm.share_status=="1"?"Enabled":"Disabled",HTTP_SHARE_WR_AUTH:dm.share_auth=="1"?"readWrite":"readOnly",HTTP_SHARE_FILE:dm.share_file};return dp}function dl(dm){if(dm){if(dm.result=="no_sdcard"){return cX.extend(X,{errorType:"no_sdcard"})}else{return{result:true}}}else{return X}}}function bl(){return bH(arguments,{},dl,dm,null,false);function dl(dn,dp){var dq={};dq.cmd="IPPortFilterEnable,DefaultFirewallPolicy,IPPortFilterRules_0,IPPortFilterRules_1,IPPortFilterRules_2,IPPortFilterRules_3,IPPortFilterRules_4,IPPortFilterRules_5,IPPortFilterRules_6,IPPortFilterRules_7,IPPortFilterRules_8,IPPortFilterRules_9";dq.cmd+=",IPPortFilterRulesv6_0,IPPortFilterRulesv6_1,IPPortFilterRulesv6_2,IPPortFilterRulesv6_3,IPPortFilterRulesv6_4,IPPortFilterRulesv6_5,IPPortFilterRulesv6_6,IPPortFilterRulesv6_7,IPPortFilterRulesv6_8,IPPortFilterRulesv6_9";dq.multi_data=1;return dq}function dm(dp){if(dp){var dn={};dn.portFilterEnable=dp.IPPortFilterEnable;dn.defaultPolicy=dp.DefaultFirewallPolicy;var dr=[];if(dp.IPPortFilterRules_0!=""){dr.push([0,dp.IPPortFilterRules_0])}if(dp.IPPortFilterRules_1!=""){dr.push([1,dp.IPPortFilterRules_1])}if(dp.IPPortFilterRules_2!=""){dr.push([2,dp.IPPortFilterRules_2])}if(dp.IPPortFilterRules_3!=""){dr.push([3,dp.IPPortFilterRules_3])}if(dp.IPPortFilterRules_4!=""){dr.push([4,dp.IPPortFilterRules_4])}if(dp.IPPortFilterRules_5!=""){dr.push([5,dp.IPPortFilterRules_5])}if(dp.IPPortFilterRules_6!=""){dr.push([6,dp.IPPortFilterRules_6])}if(dp.IPPortFilterRules_7!=""){dr.push([7,dp.IPPortFilterRules_7])}if(dp.IPPortFilterRules_8!=""){dr.push([8,dp.IPPortFilterRules_8])}if(dp.IPPortFilterRules_9!=""){dr.push([9,dp.IPPortFilterRules_9])}dn.portFilterRules=dk(dr,"IPv4");var dq=[];if(dp.IPPortFilterRulesv6_0!=""){dq.push([10,dp.IPPortFilterRulesv6_0])}if(dp.IPPortFilterRulesv6_1!=""){dq.push([11,dp.IPPortFilterRulesv6_1])}if(dp.IPPortFilterRulesv6_2!=""){dq.push([12,dp.IPPortFilterRulesv6_2])}if(dp.IPPortFilterRulesv6_3!=""){dq.push([13,dp.IPPortFilterRulesv6_3])}if(dp.IPPortFilterRulesv6_4!=""){dq.push([14,dp.IPPortFilterRulesv6_4])}if(dp.IPPortFilterRulesv6_5!=""){dq.push([15,dp.IPPortFilterRulesv6_5])}if(dp.IPPortFilterRulesv6_6!=""){dq.push([16,dp.IPPortFilterRulesv6_6])}if(dp.IPPortFilterRulesv6_7!=""){dq.push([17,dp.IPPortFilterRulesv6_7])}if(dp.IPPortFilterRulesv6_8!=""){dq.push([18,dp.IPPortFilterRulesv6_8])}if(dp.IPPortFilterRulesv6_9!=""){dq.push([19,dp.IPPortFilterRulesv6_9])}dn.portFilterRules=cp.union(dn.portFilterRules,dk(dq,"IPv6"));return dn}else{return X}}function dk(dn,dt){var ds=[];if(dn&&dn.length>0){for(var dq=0;dq<dn.length;dq++){var dp={};var dr=dn[dq][1].split(",");dp.index=dn[dq][0];dp.macAddress=dr[11];dp.destIpAddress=dr[4]=="any/0"?"":dr[4];dp.sourceIpAddress=dr[0]=="any/0"?"":dr[0];dp.destPortRange=dr[6]=="0"?"":dr[6]+" - "+dr[7];dp.sourcePortRange=dr[2]=="0"?"":dr[2]+" - "+dr[3];dp.action=dr[9]==1?"filter_accept":"filter_drop";dp.protocol=transProtocol(dr[8]);dp.comment=dr[10];dp.ipType=dt;ds.push(dp)}}return ds}}function ak(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="BASIC_SETTING";dp.portFilterEnabled=dm.portFilterEnable;dp.defaultFirewallPolicy=dm.defaultPolicy;return dp}function dl(dm){if(dm){return dm}else{return X}}}function V(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="ADD_IP_PORT_FILETER_V4V6";dp.ip_version=dm.ipType;dp.mac_address=dm.macAddress;dp.dip_address=dm.destIpAddress;dp.sip_address=dm.sourceIpAddress;dp.dFromPort=dm.destPortStart;dp.dToPort=dm.destPortEnd;dp.sFromPort=dm.sourcePortStart;dp.sToPort=dm.sourcePortEnd;dp.action=dm.action;dp.protocol=dm.protocol;dp.comment=dm.comment;return dp}function dl(dm){if(dm){return dm}else{return X}}}function aC(){return bH(arguments,{},dk,dl,null,true);function dk(dn,dp){var dq={};var dr=cp.filter(dn.indexs,function(ds){return ds.length==1});dq.goformId="DEL_IP_PORT_FILETER_V4V6";var dm=[];cp.each(dn.indexs,function(ds){if(ds.length==2){dm.push(ds.substring(1))}});dq.delete_id_v6=dm.length>0?dm.join(";")+";":"";dq.delete_id=dr.length>0?dr.join(";")+";":"";return dq}function dl(dm){if(dm){return dm}else{return X}}}function br(){return bH(arguments,{},dk,dm,null,false);function dk(dq,dn){var dp={};dp.cmd="RateLimitEnable,RateLimitRules_0,RateLimitRules_1,RateLimitRules_2,RateLimitRules_3,RateLimitRules_4,RateLimitRules_5,RateLimitRules_6,RateLimitRules_7,RateLimitRules_8,RateLimitRules_9";dp.multi_data=1;return dp}function dm(dp){if(dp){var dn={};dn.RateLimitEnable=dp.RateLimitEnable;var dq=[];if(dp.RateLimitRules_0!=""){dq.push([0,dp.RateLimitRules_0])}if(dp.RateLimitRules_1!=""){dq.push([1,dp.RateLimitRules_1])}if(dp.RateLimitRules_2!=""){dq.push([2,dp.RateLimitRules_2])}if(dp.RateLimitRules_3!=""){dq.push([3,dp.RateLimitRules_3])}if(dp.RateLimitRules_4!=""){dq.push([4,dp.RateLimitRules_4])}if(dp.RateLimitRules_5!=""){dq.push([5,dp.RateLimitRules_5])}if(dp.RateLimitRules_6!=""){dq.push([6,dp.RateLimitRules_6])}if(dp.RateLimitRules_7!=""){dq.push([7,dp.RateLimitRules_7])}if(dp.RateLimitRules_8!=""){dq.push([8,dp.RateLimitRules_8])}if(dp.RateLimitRules_9!=""){dq.push([9,dp.RateLimitRules_9])}dn.RateLimitRules=dl(dq);return dn}else{return unknownErrorObject}}function dl(dr){var ds=[];if(dr&&dr.length>0){for(var dp=0;dp<dr.length;dp++){var dn={};var dq=dr[dp][1].split(",");dn.index=dr[dp][0];dn.ip_address=dq[0];dn.download_speed=dq[1];dn.upload_speed=dq[2];dn.comment=dq[3];ds.push(dn)}}return ds}}function aH(){return bH(arguments,{},dk,dl,null,true);function dk(dp,dm){var dn={};dn.goformId="ADD_RATE_LIMIT";dn.RateLimitEnable=dp.RateLimitEnable;dn.ip_address=dp.ip_address;dn.download_speed=dp.download_speed;dn.upload_speed=dp.upload_speed;dn.comment=dp.comment;return dn}function dl(dm){if(dm){return dm}else{return unknownErrorObject}}}function bp(){return bH(arguments,{},dk,dl,null,true);function dk(dp,dm){var dn={};dn.goformId="DEL_RATE_LIMIT";dn.delete_id=dp.indexs.join(";")+";";return dn}function dl(dm){if(dm){return dm}else{return unknownErrorObject}}}function aS(){return bH(arguments,{},dk,dl,null,true);function dk(dp,dm){var dn={};dn.goformId="ADD_RATE_LIMIT";dn.RateLimitEnable=dp.RateLimitEnable;return dn}function dl(dm){if(dm){return dm}else{return unknownErrorObject}}}function cx(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="WirelessMode,CountryCode,Channel,HT_MCS,wifi_band,wifi_11n_cap,MAX_Access_num,m_MAX_Access_num,MAX_Station_num,wifi_sta_connection";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={mode:dn.WirelessMode,countryCode:dn.CountryCode,channel:dn.Channel,rate:dn.HT_MCS,wifiBand:dn.wifi_band=="a"?"a":"b",bandwidth:dn.wifi_11n_cap,MAX_Station_num:cX.isNumeric(dn.MAX_Station_num)?dn.MAX_Station_num:aK.MAX_STATION_NUMBER,MAX_Access_num:dn.MAX_Access_num,m_MAX_Access_num:dn.m_MAX_Access_num,ap_station_enable:dn.wifi_sta_connection};return dm}else{return X}}}function c8(){ay(arguments,dk,dl);function dk(dm){var dn={goformId:"SET_WIFI_INFO",wifiMode:dm.mode,countryCode:dm.countryCode,MAX_Access_num:dm.station,m_MAX_Access_num:dm.m_station};if(aK.WIFI_BAND_SUPPORT){dn.wifi_band=dm.wifiBand}if(aK.WIFI_BAND_SUPPORT&&dm.wifiBand=="a"){dn.selectedChannel="auto"}else{dn.selectedChannel=dm.channel;dn.abg_rate=dm.rate}if(aK.WIFI_BANDWIDTH_SUPPORT){dn.wifi_11n_cap=dm.bandwidth}return dn}function dl(dm){if(dm){return dm}else{return X}}}function bg(){return bH(arguments,{},dk,dl,null,false);function dk(dn,dp){var dm=aK.PASSWORD_ENCODE?"WPAPSK1_encode,m_WPAPSK1_encode,":"rnum_js,WPAPSK1_enaes,m_WPAPSK1_enaes,";var dq={cmd:"wifi_coverage,m_ssid_enable,imei,network_type,sub_network_type,rssi,rscp,lte_rsrp,ziccid,imsi,sim_imsi,cr_version,hw_version,MAX_Access_num,"+dm+"SSID1,AuthMode,m_SSID,m_AuthMode,m_HideSSID,m_MAX_Access_num,lan_ipaddr,mac_address,msisdn,LocalDomain,wan_ipaddr,static_wan_ipaddr,ipv6_wan_ipaddr,ipv6_pdp_type,pdp_type,ppp_status,sta_ip_status,rj45_state,ethwan_mode,detail_cell_rsrq,detail_cell_rssi,detail_cell_pci,detail_cell_sinr,detail_cell_id",multi_data:1};return dq}function dl(dm){if(dm){return{ssid:dm.SSID1,authMode:dm.AuthMode,passPhrase:aK.PASSWORD_ENCODE?Base64.decode(dm.WPAPSK1_encode):c(dm.rnum_js,dm.imei,dm.WPAPSK1_enaes),m_ssid:dm.m_SSID,m_AuthMode:dm.m_AuthMode,m_passPhrase:aK.PASSWORD_ENCODE?Base64.decode(dm.m_WPAPSK1_encode):c(dm.rnum_js,dm.imei,dm.m_WPAPSK1_enaes),m_max_access_num:dm.m_MAX_Access_num,multi_ssid_enable:dm.m_ssid_enable,ipAddress:dm.lan_ipaddr,wanIpAddress:dm.wan_ipaddr,staticWanIpAddress:dm.static_wan_ipaddr,ipv6WanIpAddress:dm.ipv6_wan_ipaddr,ipv6PdpType:dm.ipv6_pdp_type,macAddress:dm.mac_address,simSerialNumber:dm.msisdn,iccid:dm.ziccid,lanDomain:dm.LocalDomain,imei:dm.imei,signal:convertSignal(dm),imsi:dm.imsi||dm.sim_imsi,sw_version:dm.cr_version,hw_version:dm.hw_version,max_access_num:dm.MAX_Access_num,wifiRange:dm.wifi_coverage,pdpType:dm.pdp_type,rj45ConnectStatus:typeof dm.rj45_state=="undefined"||dm.rj45_state==""?"dead":dm.rj45_state,blc_wan_mode:bD.blc_wan_mode,connectStatus:dm.ppp_status,wifiConStatus:dm.sta_ip_status,ethwan_mode:dm.ethwan_mode.toUpperCase(),rsrp:dm.lte_rsrp,rsrq:dm.detail_cell_rsrq,rssi:dm.detail_cell_rssi,pci:dm.detail_cell_pci,sinr:dm.detail_cell_sinr,cellid:dm.detail_cell_id}}else{return X}}}function c3(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"imei,rnum_js",multi_data:1};return dp}function dl(dm){if(dm){var dq=dm.rnum_js+dm.imei+"FFFFFFFFFFFFFFFFFFFFFFFF";var dn;var dp;dn=dq.substring(0,24);dp=dq.substring(0,16);return{skey:dn,siv:dp}}else{return{skey:"FFFFFFFFFFFFFFFFFFFFFFFF",siv:"FFFFFFFFFFFFFFFF"}}}}function Y(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="wifi_coverage";return dp}function dl(dn){if(dn){var dm={};dm.wifiRangeMode=dn.wifi_coverage;return dm}else{return X}}}function c5(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SET_WIFI_COVERAGE";dp.wifi_coverage=dm.wifiRangeMode;return dp}function dl(dm){if(dm){return dm}else{return X}}}function am(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="upnpEnabled";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.upnpSetting=dn.upnpEnabled=="1"?"1":"0";return dm}else{return X}}}function a8(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="UPNP_SETTING";dp.upnp_setting_option=dm.upnpSetting;return dp}function dl(dm){if(dm){return dm}else{return X}}}function aB(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="DMZEnable,DMZIPAddress";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.dmzSetting=dn.DMZEnable=="1"?"1":"0";dm.ipAddress=dn.DMZIPAddress;return dm}else{return X}}}function c1(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="DMZ_SETTING";dp.DMZEnabled=dm.dmzSetting;if(dp.DMZEnabled=="1"){dp.DMZIPAddress=dm.ipAddress}return dp}function dl(dm){if(dm){return dm}else{return X}}}function bf(){return bH(arguments,{},dl,dm,null,false);function dl(dn,dp){var dq={};dq.cmd="PortMapEnable,PortMapRules_0,PortMapRules_1,PortMapRules_2,PortMapRules_3,PortMapRules_4,PortMapRules_5,PortMapRules_6,PortMapRules_7,PortMapRules_8,PortMapRules_9",dq.multi_data=1;return dq}function dm(dp){if(dp){var dn={};dn.portMapEnable=dp.PortMapEnable;var dq=[];if(dp.PortMapRules_0!=""){dq.push([0,dp.PortMapRules_0])}if(dp.PortMapRules_1!=""){dq.push([1,dp.PortMapRules_1])}if(dp.PortMapRules_2!=""){dq.push([2,dp.PortMapRules_2])}if(dp.PortMapRules_3!=""){dq.push([3,dp.PortMapRules_3])}if(dp.PortMapRules_4!=""){dq.push([4,dp.PortMapRules_4])}if(dp.PortMapRules_5!=""){dq.push([5,dp.PortMapRules_5])}if(dp.PortMapRules_6!=""){dq.push([6,dp.PortMapRules_6])}if(dp.PortMapRules_7!=""){dq.push([7,dp.PortMapRules_7])}if(dp.PortMapRules_8!=""){dq.push([8,dp.PortMapRules_8])}if(dp.PortMapRules_9!=""){dq.push([9,dp.PortMapRules_9])}dn.portMapRules=dk(dq);return dn}else{return X}}function dk(dn){var ds=[];if(dn&&dn.length>0){for(var dq=0;dq<dn.length;dq++){var dp={};var dr=dn[dq][1].split(",");dp.index=dn[dq][0];dp.sourcePort=dr[1];dp.destIpAddress=dr[0];dp.destPort=dr[2];dp.protocol=transProtocol(dr[3]);dp.comment=dr[4];ds.push(dp)}}return ds}}function bN(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="ADD_PORT_MAP";dp.portMapEnabled=dm.portMapEnable;dp.fromPort=dm.sourcePort;dp.ip_address=dm.destIpAddress;dp.toPort=dm.destPort;dp.protocol=dm.protocol;dp.comment=dm.comment;return dp}function dl(dm){if(dm){return dm}else{return X}}}function bK(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="ADD_PORT_MAP";dp.portMapEnabled=dm.portMapEnable;return dp}function dl(dm){if(dm){return dm}else{return X}}}function a2(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="DEL_PORT_MAP";dp.delete_id=dm.indexs.join(";")+";";return dp}function dl(dm){if(dm){return dm}else{return X}}}function H(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"data_volume_limit_switch,data_volume_limit_unit,data_volume_limit_size,data_volume_alert_percent,monthly_tx_bytes,monthly_rx_bytes,monthly_time,traffic_alined_delta",multi_data:1}}function dl(dn){if(dn){var dp=dn.data_volume_limit_unit=="data";var dm={dataLimitChecked:dn.data_volume_limit_switch,dataLimitTypeChecked:dp?"1":"0",limitDataMonth:dp?dn.data_volume_limit_size:"0",alertDataReach:dp?dn.data_volume_alert_percent:"0",limitTimeMonth:dp?"0":dn.data_volume_limit_size,alertTimeReach:dp?"0":dn.data_volume_alert_percent,monthlySent:dn.monthly_tx_bytes==""?0:dn.monthly_tx_bytes,monthlyReceived:dn.monthly_rx_bytes==""?0:dn.monthly_rx_bytes,monthlyConnectedTime:dn.monthly_time==""?0:dn.monthly_time,traffic_alined_delta:dn.traffic_alined_delta==""?0:dn.traffic_alined_delta};return dm}else{return X}}}function ao(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dq=dm.dataLimitTypeChecked=="1";var dp={goformId:"DATA_LIMIT_SETTING",data_volume_limit_switch:dm.dataLimitChecked};if(dm.dataLimitChecked=="1"){dp.data_volume_limit_unit=dq?"data":"time";dp.data_volume_limit_size=dq?dm.limitDataMonth:dm.limitTimeMonth;dp.data_volume_alert_percent=dq?dm.alertDataReach:dm.alertTimeReach}return dp}function dl(dm){if(dm){return dm}else{return X}}}function cH(){var dm=arguments[1];return bH(arguments,{},dk,dl,null,true);function dk(dn,dp){if(dn.sendOrReply=="send"){return{goformId:"USSD_PROCESS",USSD_operator:dn.operator,USSD_send_number:dn.strUSSDCommand,notCallback:true}}else{if(dn.sendOrReply=="reply"){return{goformId:"USSD_PROCESS",USSD_operator:dn.operator,USSD_reply_number:dn.strUSSDCommand,notCallback:true}}}}function dl(dn){if(!dn){dm(false,"ussd_fail");return}if(dn.result=="success"){callbackTemp=dm;ci()}else{dm(false,"ussd_fail")}}}function ci(){cX.ajax({url:"/goform/goform_get_cmd_process",data:{cmd:"ussd_write_flag"},cache:false,async:true,dataType:"json",success:function(dk){if(dk.ussd_write_flag=="1"){callbackTemp(false,"ussd_no_service")}else{if(dk.ussd_write_flag=="4"||dk.ussd_write_flag=="unknown"||dk.ussd_write_flag=="3"){callbackTemp(false,"ussd_timeout")}else{if(dk.ussd_write_flag=="15"){setTimeout(ci,1e3)}else{if(dk.ussd_write_flag=="10"){callbackTemp(false,"ussd_retry")}else{if(dk.ussd_write_flag=="99"){callbackTemp(false,"ussd_unsupport")}else{if(dk.ussd_write_flag=="41"){callbackTemp(false,"operation_not_supported")}else{if(dk.ussd_write_flag=="2"){callbackTemp(false,"network_terminated")}else{if(dk.ussd_write_flag=="16"){cX.ajax({url:"/goform/goform_get_cmd_process",data:{cmd:"ussd_data_info"},dataType:"json",async:true,cache:false,success:function(dl){var dm={};dm.data=dl.ussd_data;dm.ussd_action=dl.ussd_action;dm.ussd_dcs=dl.ussd_dcs;callbackTemp(true,dm)},error:function(){callbackTemp(false,"ussd_info_error")}})}else{callbackTemp(false,"ussd_fail")}}}}}}}}},error:function(){callbackTemp(false,"ussd_fail")}})}function q(dl){cX.ajax({url:"/goform/goform_set_cmd_process",data:{goformId:"USSD_PROCESS",USSD_operator:"ussd_cancel"},cache:false,dataType:"json",success:function(dm){if(dm.result=="success"){dk()}else{dl(false)}}});function dk(){cX.ajax({url:"/goform/goform_get_cmd_process",data:{cmd:"ussd_write_flag"},cache:false,async:true,dataType:"json",success:function(dm){if(dm.ussd_write_flag=="15"){setTimeout(dk,1e3)}else{if(dm.ussd_write_flag=="13"){dl(true)}else{dl(false)}}},error:function(){dl(false)}})}}function aP(){var dp=arguments[1];var dn=0;return bH(arguments,{},dk,dl,null,true);function dk(dq){return{goformId:"UNLOCK_NETWORK",notCallback:true,unlock_network_code:dq.unlock_network_code}}function dl(dq){if(dq&&dq.result=="success"){dp({result:"success"})}else{dp({result:"fail"})}}function dm(){if(dn>5){C(dm);dp({result:"fail"})}else{if(bD.simStatus!="modem_imsi_waitnck"){C(dm);dp({result:"success"})}}dn++}}function bT(){var dp=arguments[1];var dn=0;return bH(arguments,{},dk,dm,null,true);function dk(dq){return{goformId:"GORORM_UNLOCK_SIM",notCallback:true,sim_unlock_code:dq.sim_unlock_code}}function dm(dq){if(dq&&dq.result=="success"){cY(dl)}else{dp({result:"fail"})}}function dl(){if(dn>5){C(dl);dp({result:"fail"})}else{if(bD.simStatus!="modem_imsi_waitnck"){C(dl);dp({result:"success"})}}dn++}}function cr(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"unlock_nck_time"}}function dl(dm){if(dm){return dm}else{return X}}}function W(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"sim_unlock_nck_time"}}function dl(dm){if(dm){return dm}else{return X}}}function a5(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"lock_network_status"}}function dl(dm){if(dm){return{lock_network_status:dm.lock_network_status}}else{return X}}}function a6(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"sim_lock_status"}}function dl(dm){if(dm){return{sim_lock_status:dm.sim_lock_status}}else{return X}}}function db(){var dm=arguments[1];return bH(arguments,{},dk,dl,null,true);function dk(dn){return{goformId:"SET_UPGRADE_NOTICE",upgrade_notice_flag:dn.upgrade_notice_flag,notCallback:true}}function dl(dn){if(dn.result=="success"){dm(true)}else{dm(false)}}}function cb(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"upgrade_notice_flag"}}function dl(dm){if(dm){return dm}else{return X}}}function aw(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:1,cmd:"wifi_sta_connection,pswan_priority,wifiwan_priority,ethwan_priority"}}function dl(dm){if(dm){return{ap_station_enable:dm.wifi_sta_connection,ap_station_mode:parseInt(dm.wifiwan_priority,10)>parseInt(dm.pswan_priority,10)?"wifi_pref":"dial_pref"}}else{return X}}}function bj(){var dl=arguments[0];return bH(arguments,{},dk,dm,null,true);function dk(dn){return{goformId:"WIFI_STA_CONTROL",wifi_sta_connection:dn.ap_station_enable}}function dm(dn){if(dn&&dn.result=="success"){bD.ap_station_enable=dl.ap_station_enable==1;return dn}else{return X}}}function ac(){return aw({},function(dk){bD.ap_station_enable=dk.ap_station_enable==1;bD.ap_station_mode=dk.ap_station_mode})}function cu(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dp){var dq="wifi_profile_num,wifi_profile";for(var dn=1;dn<aK.AP_STATION_LIST_LENGTH;dn++){dq=dq+",wifi_profile"+dn}return{multi_data:1,cmd:dq}}function dl(dm){if(dm){var ds=[];for(var dr=0;dr<aK.AP_STATION_LIST_LENGTH;dr++){var du="";if(dr==0){du=dm.wifi_profile}else{du=dm["wifi_profile"+dr]}var dq=du.split(";");for(var dp=0;dp<dq.length;dp++){var dt=dq[dp].split(",");if(!dt[0]){break}var dn={profileName:dt[0],fromProvider:dt[1],connectStatus:dt[2],signal:dt[3],ssid:dt[4],authMode:dt[5],encryptType:dt[6],password:dt[7]=="0"?"":dt[7],keyID:dt[8],mac:dt[9]};ds.push(dn)}}return{hotspotList:ds}}else{return X}}}function ap(){return bH(arguments,{},dk,dl,null,true);function dk(dm){return{goformId:"WLAN_SET_STA_REFRESH"}}function dl(dm){if(dm){return dm}else{return X}}}function Z(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:1,cmd:"scan_finish,EX_APLIST,EX_APLIST1"}}function dl(dm){if(dm){if(dm.scan_finish=="0"){return{scan_finish:"0",hotspotList:[]}}if(dm.scan_finish=="2"){return{scan_finish:"2",hotspotList:[]}}var ds=[];for(var dr=0;dr<=1;dr++){var du;if(dr==0){du=dm.EX_APLIST}else{du=dm.EX_APLIST1}var dq=du.split(";");for(var dp=0;dp<dq.length;dp++){var dt=dq[dp].split(",");if(!dt[0]){break}var dn={fromProvider:dt[0],connectStatus:dt[1],ssid:dt[2],signal:dt[3],channel:dt[4],authMode:dt[5],encryptType:dt[6],mac:dt[7]};ds.push(dn)}}return{scan_finish:"1",hotspotList:ds}}else{return X}}}function cV(dl){var dk=[];dk.push(dl.profileName);dk.push(dl.fromProvider||"0");dk.push(dl.connectStatus||"0");dk.push(dl.signal);dk.push(dl.ssid);dk.push(dl.authMode);dk.push(dl.encryptType);dk.push(dl.password||"0");dk.push(dl.keyID);dk.push(dl.mac);return dk.join(",")}function al(){return bH(arguments,{},dk,dl,null,true);function dk(dw){var dx=dw.apList;var dm="modify";if(dw.profileName==""){dm="add";var ds=(jQuery.fn.jquery+Math.random()).replace(/\D/g,"");dw.profileName=ds;dx.push({profileName:ds,fromProvider:"0",connectStatus:"0",signal:dw.signal,ssid:dw.ssid,authMode:dw.authMode,encryptType:dw.encryptType,password:dw.password||"0",keyID:dw.keyID,mac:dw.mac})}var du={profile0:[]};for(var dn=1;dn<aK.AP_STATION_LIST_LENGTH;dn++){du["profile"+dn]=[]}var dp="";for(var dn=0;dn<dx.length;dn++){var dr="";if(dw.profileName==dx[dn].profileName){dr=cV(dw);dp=dr}else{dr=cV(dx[dn])}var dq=parseInt(dn%10);du["profile"+dq].push(dr)}var dt={wifi_profile:du.profile0.join(";")};for(var dn=1;dn<aK.AP_STATION_LIST_LENGTH;dn++){dt["wifi_profile"+dn]=du["profile"+dn].join(";")}var dv=cX.extend({goformId:"WIFI_SPOT_PROFILE_UPDATE",wifi_profile_num:dx.length,wifi_update_profile:dp,action:dm},dt);return dv}function dl(dm){if(dm){return dm}else{return X}}}function c2(){return bH(arguments,{},dk,dl,null,true);function dk(dw){var dy=dw.apList;var du={profile0:[]};for(var dn=1;dn<aK.AP_STATION_LIST_LENGTH;dn++){du["profile"+dn]=[]}var dm=false;var dq="";for(var dn=0;dn<dy.length;dn++){var ds=cV(dy[dn]);if(dy[dn].profileName==dw.profileName){dm=true;dq=ds;continue}var dx=dn;if(dm){dx=dn-1}var dr=parseInt(dx%10);du["profile"+dr].push(ds)}var dp=dm?dy.length-1:dy.length;var dt={wifi_profile:du.profile0.join(";")};for(var dn=1;dn<aK.AP_STATION_LIST_LENGTH;dn++){dt["wifi_profile"+dn]=du["profile"+dn].join(";")}var dv=cX.extend({goformId:"WIFI_SPOT_PROFILE_UPDATE",wifi_profile_num:dp,wifi_update_profile:dq,action:"delete"},dt);return dv}function dl(dm){if(dm){return dm}else{return X}}}function bM(){return bH(arguments,{},dk,dl,null,true);function dk(dm){return{goformId:"WLAN_SET_STA_CON",EX_SSID1:dm.EX_SSID1,EX_AuthMode:dm.EX_AuthMode,EX_EncrypType:dm.EX_EncrypType,EX_DefaultKeyID:dm.EX_DefaultKeyID,EX_WEPKEY:dm.EX_WEPKEY,EX_WPAPSK1:dm.EX_WPAPSK1,EX_wifi_profile:dm.EX_wifi_profile,EX_mac:dm.EX_mac}}function dl(dm){if(dm&&(dm.result=="success"||dm.result=="processing")){return dm}else{return X}}}function aN(){return bH(arguments,{},dk,dl,null,true);function dk(dm){return{goformId:"WLAN_SET_STA_DISCON"}}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function c0(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:1,cmd:"blc_wan_mode,blc_wan_auto_mode,loginfo,ppp_status,rj45_state,ethwan_mode"}}function dl(dn){if(dn){var dm={};if(dn.blc_wan_mode=="AUTO"){dm.blc_wan_mode=dn.blc_wan_auto_mode?dn.blc_wan_auto_mode:"AUTO_PPP"}else{dm.blc_wan_mode=dn.blc_wan_mode?dn.blc_wan_mode:"PPP"}dm.loginfo=dn.loginfo;dm.ppp_status=dn.ppp_status;dm.rj45_state=typeof dn.rj45_state=="undefined"||dn.rj45_state==""?"dead":dn.rj45_state;dm.ethwan_mode=dn.ethwan_mode.toUpperCase();return dm}else{return X}}}function a9(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"rj45_plug"}}function dl(dn){if(dn){var dm={};dm.rj45_plug=dn.rj45_plug==""?"wan_lan_off":dn.rj45_plug;return dm}else{return X}}}function cG(dk,dl){if(aK.RJ45_SUPPORT){if(dl=="dead"||dl==""){return"PPP"}else{if(!dk||dk=="undefined"){if(dl=="working"){return"PPPOE"}else{return"PPP"}}else{return dk}}}else{return"PPP"}}function bq(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({goformId:"OPERATION_MODE"},dp);return dq}function dm(dp){if(dp&&dp.result=="success"){return dp}else{return X}}}function bc(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:1,cmd:"opms_wan_auto_mode,ethwan_mode,pppoe_username,pppoe_cc,ethwan_dialmode,ppp_status,static_wan_ipaddr,static_wan_netmask,static_wan_gateway,static_wan_primary_dns,static_wan_secondary_dns,rj45_state,lan_ipaddr,lan_netmask"}}function dl(dm){if(dm){return{opms_wan_auto_mode:dm.opms_wan_auto_mode,ethwan_mode:dm.ethwan_mode.toUpperCase(),pppoe_username:dm.pppoe_username,pppoe_cc:dm.pppoe_cc,ethwan_dialmode:dm.ethwan_dialmode=="manual"?"manual_dial":"auto_dial",ppp_status:dm.ppp_status,static_wan_ipaddr:dm.static_wan_ipaddr,static_wan_netmask:dm.static_wan_netmask,static_wan_gateway:dm.static_wan_gateway,static_wan_primary_dns:dm.static_wan_primary_dns,static_wan_secondary_dns:dm.static_wan_secondary_dns,rj45_state:typeof dm.rj45_state=="undefined"||dm.rj45_state==""?"dead":dm.rj45_state,lan_ipaddr:dm.lan_ipaddr,lan_netmask:dm.lan_netmask}}else{return X}}}function cK(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({notCallback:true},dp);return dq}function dm(dp){if(dp.result=="success"){dn({result:true})}else{dn({result:false})}}}function dh(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"sim_switch_number,sim_auto_switch_enable,sim_current_type,sim_switch_running_detect,sim_default_type,sim_lock_status",multi_data:"1"};return dp}function dl(dm){if(dm){return{sim_switch_number:dm.sim_switch_number,sim_auto_switch_enable:dm.sim_auto_switch_enable,sim_current_type:dm.sim_current_type,sim_default_type:dm.sim_default_type,sim_lock_status:dm.sim_lock_status,sim_switch_running_detect:dm.sim_switch_running_detect}}else{return X}}}function ch(){return bH(arguments,{},dk,dl,{},true);function dk(dm){var dn={};dn.goformId="SIM_SWITCH";dn.sim_auto_switch_enable=dm.sim_mode;dn.sim_default_type=dm.sim_type;dn.sim_switch_running_detect=dm.sim_running;return dn}function dl(dm){if(dm&&dm.result==="success"){return{result:"success"}}else{if(dm&&dm.result==="processing"){return{result:"processing"}}else{return{result:"failure"}}}}}function at(dk,dp){return bH(arguments,{},dl,dm,null,false);function dl(dq,dr){return{multi_data:1,cmd:"sntp_year,sntp_month,sntp_day,sntp_hour,sntp_minute,sntp_second,sntp_time_set_mode,sntp_static_server0,sntp_static_server1,sntp_static_server2,sntp_server0,sntp_server1,sntp_server2,sntp_server3,sntp_server4,sntp_server5,sntp_server6,sntp_server7,sntp_server8,sntp_server9,sntp_other_server0,sntp_other_server1,sntp_other_server2,sntp_timezone,sntp_timezone_index,sntp_dst_enable,ppp_status,sntp_process_result,rj45_state"}}function dm(dq){if(dq){var dr=dn(dq);return{sntp_year:dq.sntp_year,sntp_month:dq.sntp_month,sntp_day:dq.sntp_day,sntp_hour:dq.sntp_hour,sntp_minute:dq.sntp_minute,sntp_second:dq.sntp_second,sntp_time_set_mode:dq.sntp_time_set_mode,sntp_servers:dr,sntp_server0:dq.sntp_server0,sntp_server1:dq.sntp_server1,sntp_server2:dq.sntp_server2,sntp_static_server0:dq.sntp_static_server0,sntp_static_server1:dq.sntp_static_server1,sntp_static_server2:dq.sntp_static_server2,sntp_other_server0:dq.sntp_other_server0,sntp_other_server1:dq.sntp_other_server1,sntp_other_server2:dq.sntp_other_server2,sntp_timezone:dq.sntp_timezone,sntp_timezone_index:dq.sntp_timezone_index?dq.sntp_timezone_index:"0",sntp_dst_enable:dq.sntp_dst_enable,ppp_status:dq.ppp_status,blc_wan_mode:bD.blc_wan_mode,sntp_process_result:dq.sntp_process_result,rj45_state:typeof dq.rj45_state=="undefined"||dq.rj45_state==""?"dead":dq.rj45_state}}else{return X}}function dn(dq){var du=[];for(var dt=0;dt<3;dt++){var ds="sntp_static_server"+dt.toString();if(dq[ds]!=""){var dw={};dw.name=dq[ds];dw.value=dq[ds];du.push(dw)}}var dv=[{name:"Other",value:"Other"},{name:"NONE",value:""}];for(var dr=0;dr<2;dr++){du.push(dv[dr])}return du}}function cg(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({},dp);return dq}function dm(dp){if(dp&&dp.result=="success"){return dp}else{return X}}}function g(dk,dn){var dm=cX.extend({},dk);cX.post("/goform/goform_set_cmd_process",dm,function(dp){if(dp&&dp.result=="success"){if(dk.manualsettime=="auto"){setTimeout(dl,2e3);dn(dp)}else{dn(true)}}else{if(dp&&dp.result=="processing"){dn(dp)}else{dn(false)}}},"json");function dl(){cX.ajax({url:"/goform/goform_get_cmd_process",dataType:"json",data:{cmd:"sntp_process_result"},cache:false,async:false,success:function(dp){if(dp.sntp_process_result=="failure"){dn(false)}else{if(dp.sntp_process_result=="success"){dn(true)}else{setTimeout(dl,2e3)}}},error:function(){dn(false)}})}}function cj(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({},dp);return dq}function dm(dp){if(dp&&dp.result=="success"){return dp}else{return X}}}function b1(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{cmd:"websURLFilters"}}function dl(dm){var dq=[];if(dm){if(dm.websURLFilters.length==0){return{urlFilterRules:[]}}else{var dr=dm.websURLFilters.split(";");for(var dp=0;dp<dr.length;dp++){var dn={};dn.index=dp;dn.url=dr[dp];dq.push(dn)}return{urlFilterRules:dq}}}else{return X}}}function cw(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({},dp);return dq}function dm(dp){if(dp&&dp.result=="success"){return dp}else{return X}}}function bO(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:"1",cmd:"wifi_wds_mode,wifi_wds_ssid,wifi_wds_AuthMode,wifi_wds_EncrypType,wifi_wds_WPAPSK1,wifi_cur_state "}}function dl(dm){if(dm){return{currentMode:dm.wifi_wds_mode,wdsSSID:dm.wifi_wds_ssid,wdsAuthMode:dm.wifi_wds_AuthMode,wdsEncrypType:dm.wifi_wds_EncrypType,wdsWPAPSK1:dm.wifi_wds_WPAPSK1,RadioOff:dm.wifi_cur_state=="1"?"1":"0"}}else{return X}}}function aq(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({},dp);return dq}function dm(dp){if(dp&&dp.result=="success"){return dp}else{return X}}}function y(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:"1",cmd:"syslog_mode,debug_level"}}function dl(dm){if(dm){return{currentMode:dm.syslog_mode,debugLevel:dm.debug_level}}else{return X}}}function bh(dk,dn){return bH(arguments,{},dl,dm,null,true);function dl(dp){var dq=cX.extend({},dp);return dq}function dm(dp){if(dp&&dp.result=="success"){return dp}else{return X}}}function cf(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:"1",cmd:"ACL_mode,wifi_mac_black_list,wifi_hostname_black_list,wifi_cur_state,user_ip_addr,client_mac_address,wifi_mac_white_list"}}function dl(dm){if(dm){return{ACL_mode:dm.ACL_mode,wifi_mac_black_list:dm.wifi_mac_black_list,wifi_hostname_black_list:dm.wifi_hostname_black_list,RadioOff:dm.wifi_cur_state=="1"?"1":"0",user_ip_addr:dm.user_ip_addr,client_mac_address:dm.client_mac_address,wifi_mac_white_list:dm.wifi_mac_white_list}}else{return X}}}function cB(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){return{multi_data:"1",cmd:"usb_net_mac_addr"}}function dl(dm){if(dm){return dm}else{return unknownErrorObject}}}function bd(){return bH(arguments,{},dk,dl,null,true);function dk(dp,dm){var dn={};dn.goformId="SET_IMEI_NUM";dn.imei=dp.imei;return dn}function dl(dm){if(dm){return dm}else{return unknownErrorObject}}}function c7(){return bH(arguments,{},dk,dl,null,true);function dk(dp,dm){var dn={};dn.goformId="SET_USB_MAC_ADDRESS";dn.mac=dp.mac;return dn}function dl(dm){if(dm){return dm}else{return unknownErrorObject}}}function aD(){return bH(arguments,{},dk,dl,null,true);function dk(dm){var dn=cX.extend({goformId:"WIFI_MAC_FILTER"},dm);return dn}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function av(){return bH(arguments,{},dk,dl,null,false);function dk(dm){return{cmd:"mgmt_quicken_power_on,need_hard_reboot,need_sim_pin",multi_data:1}}function dl(dm){return{fastbootEnabled:dm.mgmt_quicken_power_on=="1"?"1":"0",need_hard_reboot:dm.need_hard_reboot,need_sim_pin:dm.need_sim_pin=="yes"?"yes":"no"}}}function bZ(){return bH(arguments,{},dk,dl,null,true);function dk(dm){return{goformId:"MGMT_CONTROL_POWER_ON_SPEED",mgmt_quicken_power_on:dm.fastbootEnabled}}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function bb(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="TURN_OFF_DEVICE";return dp}function dl(dm){if(dm){return dm}else{return X}}}function aj(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="REBOOT_DEVICE";return dp}function dl(dm){if(dm){return dm}else{return X}}}function aa(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="fota_new_version_state,fota_current_upgrade_state,fota_package_already_download";dp.multi_data=1;return dp}function dl(dm){if(dm){var dn=dm.fota_new_version_state=="has_critical"||dm.fota_new_version_state=="has_optional"||dm.fota_new_version_state=="already_has_pkg";dm.hasNewVersion=dn;return dm}else{return X}}}function bt(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};if(aK.UPGRADE_TYPE=="OTA"){dp.cmd="is_mandatory"}else{dp.cmd="fota_new_version_state"}return dp}function dl(dm){if(dm){if(aK.UPGRADE_TYPE=="OTA"){return{is_mandatory:dm.is_mandatory=="1"}}else{return{is_mandatory:dm.fota_new_version_state=="has_critical"}}}else{return X}}}function cL(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="upgrade_result";return dp}function dl(dm){if(dm){return dm}else{return X}}}function bo(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="fota_current_upgrade_state";return dp}function dl(dm){if(dm){dm.current_upgrade_state=dm.fota_current_upgrade_state;return dm}else{return X}}}function Q(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="fota_pkg_total_size,fota_dl_pkg_size";dp.multi_data=1;return dp}function dl(dm){if(dm){return dm}else{return X}}}function N(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="IF_UPGRADE";dp.select_op=dm.selectOp;if(dp.select_op=="check"){dp.ota_manual_check_roam_state=1}return dp}function dl(dm){if(dm){return dm}else{return X}}}function G(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="fota_updateMode,fota_updateIntervalDay,fota_allowRoamingUpdate";dp.multi_data=1;return dp}function dl(dm){if(dm){return{updateMode:dm.fota_updateMode,updateIntervalDay:dm.fota_updateIntervalDay,allowRoamingUpdate:dm.fota_allowRoamingUpdate}}else{return X}}}function an(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SetUpgAutoSetting";dp.UpgMode=dm.updateMode;dp.UpgIntervalDay=dm.updateIntervalDay;dp.UpgRoamPermission=dm.allowRoamingUpdate;return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function di(){return cv({nv:["dm_last_check_time"]},arguments[1],arguments[2])}function h(){return cv({nv:["network_type","sub_network_type","rssi","rscp","lte_rsrp"]},arguments[1],arguments[2])}function j(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="RESULT_RESTORE";return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function w(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"childGroupList"};return dp}function dl(dm){if(dm&&(dm.childGroupList||dm.devices)){return dm}else{return{devices:[]}}}}function cz(){return bH(arguments,aK.currentUserInChildGroup==false?{}:{errorType:"no_auth"},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"ADD_DEVICE",mac:dm.macAddress};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function cO(){return bH(arguments,aK.currentUserInChildGroup==false?{}:{errorType:"no_auth"},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"DEL_DEVICE",mac:dm.mac};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function t(dk){if(typeof aK.currentUserInChildGroup=="undefined"){var dn=[];if(typeof dk!="undefined"){dn=dk}else{dn=w({}).devices}var dl=a7({}).get_user_mac_addr;var dm=cp.find(dn,function(dp){return dp.mac==dl});aK.currentUserInChildGroup=typeof dm!="undefined";return{result:typeof dm!="undefined"}}return{result:aK.currentUserInChildGroup}}function a7(){return cv({nv:"get_user_mac_addr"},arguments[1],arguments[2])}function v(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"hostNameList"};return dp}function dl(dm){if(dm&&(dm.hostNameList||dm.devices)){return dm}else{return{devices:[]}}}}function bn(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"EDIT_HOSTNAME",mac:dm.mac,hostname:dm.hostname};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function da(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"site_white_list"};return dp}function dl(dm){if(dm&&(dm.site_white_list||dm.siteList)){return dm}else{return{siteList:[]}}}}function F(){return bH(arguments,aK.currentUserInChildGroup==false?{}:{errorType:"no_auth"},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"REMOVE_WHITE_SITE",ids:dm.ids.join(",")};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function bI(){return bH(arguments,aK.currentUserInChildGroup==false?{}:{errorType:"no_auth"},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"ADD_WHITE_SITE",name:dm.name,site:dm.site};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function ce(){var dn={0:[],1:[],2:[],3:[],4:[],5:[],6:[]};return bH(arguments,{},dk,dm,null,false);function dk(dp,dq){var dr={cmd:"time_limited"};return dr}function dm(dp){if(dp){return dl(dp)}else{return dn}}function dl(dp){if(dp.time_limited==""){return{time_limited:[]}}var dq=dp.time_limited.split(";");cp.each(dq,function(dr){var ds=dr.split("+");if(ds.length==2){dn[ds[0]]=ds[1].split(",")}});return dn}}function o(){return bH(arguments,aK.currentUserInChildGroup==false?{}:{errorType:"no_auth"},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"SAVE_TIME_LIMITED",time_limited:dm.time};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function cA(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"openEnable,closeEnable,openTime,closeTime",multi_data:"1"};return dp}function dl(dm){if(dm){if(dm.openTime.indexOf(":")!=-1){var dn=dm.openTime.split(":");dm.openH=leftInsert(dn[0],2,"0");dm.openM=leftInsert(dn[1],2,"0")}else{dm.openH="06";dm.openM="00"}if(dm.closeTime.indexOf(":")!=-1){var dp=dm.closeTime.split(":");dm.closeH=leftInsert(dp[0],2,"0");dm.closeM=leftInsert(dp[1],2,"0")}else{dm.closeH="22";dm.closeM="00"}return dm}else{return X}}}function bY(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"SAVE_TSW",openEnable:dm.openEnable,closeEnable:dm.closeEnable};if(dm.openEnable=="1"){dp.openTime=dm.openTime;dp.closeTime=dm.closeTime}return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{if(dm&&dm.result=="failure"){return dm}else{return X}}}}function aQ(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={goformId:"FLOW_CALIBRATION_MANUAL",calibration_way:dm.way,time:dm.way=="time"?dm.value:0,data:dm.way=="data"?dm.value:0};return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function cv(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};if(cp.isArray(dm.nv)){dp.cmd=dm.nv.join(",");dp.multi_data=1}else{dp.cmd=dm.nv}return dp}function dl(dm){if(dm){return dm}else{return X}}}function aT(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="vwim_mc_state,traffic_overrun,detect_new_version";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.vwim_mc_state=dn.vwim_mc_state;dm.traffic_overrun=dn.traffic_overrun;dm.detect_new_version=dn.detect_new_version;dm.blc_wan_mode=bD.blc_wan_mode;return dm}else{return X}}}function cR(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="CLEAR_REDIRECT_FLAG";dp.flag_id=dm.redirectFlags;return dp}function dl(dm){if(dm){return dm}else{return X}}}function cd(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="lock_zone_enable,pin_interlock_and_V4_lock";dp.multi_data=1;return dp}function dl(dm){if(dm){return dm}else{return X}}}function bS(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="PIN_LOCK_V4_ENCODE";dp.pin_interlock_and_V4_lock=dm.pin_interlock_and_V4_lock;dp.TspLock_key_data=dm.TspLock_key_data;return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function aI(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="cell_id_list,global_cell_id,network_type,sub_network_type,cell_not_correct";dp.multi_data=1;return dp}function dl(dm){if(dm){return dm}else{return X}}}function b8(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="LOCK_ZONE";dp.lock_zone_enable=dm.lock_zone_enable;return dp}function dl(dm){if(dm&&dm.result=="success"){return dm}else{return X}}}function cZ(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={cmd:"update_type"};return dp}function dl(dm){return{update_type:dm.update_type?dm.update_type:"mifi_fota"}}}function f(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dn){var dp={};dp.cmd="AuthMode,passPhrase";dp.multi_data=1;return dp}function dl(dn){if(dn){var dm={};dm.AuthMode=dn.AuthMode;dm.passPhrase=aK.PASSWORD_ENCODE?Base64.decode(dn.passPhrase):dn.passPhrase;return dm}else{return X}}}function z(){return bH(arguments,{},dk,dl,null,true);function dk(dm,dn){var dp={};dp.goformId="SET_WIFI_SECURITY_INFO";dp.AuthMode=dm.AuthMode;if(dp.AuthMode=="WPAPSKWPA2PSK"){dp.passPhrase=aK.PASSWORD_ENCODE?Base64.encode(dm.passPhrase):dm.passPhrase}return dp}function dl(dm){if(dm){return dm}else{return X}}}function co(){ay(arguments,dk,dl);function dk(dm){var dn={goformId:"SET_WIFI_SSID1_SETTINGS",ssid:dm.SSID,broadcastSsidEnabled:dm.broadcast,MAX_Access_num:dm.station,security_mode:dm.AuthMode,cipher:dm.cipher,NoForwarding:dm.NoForwarding,show_qrcode_flag:dm.show_qrcode_flag,show_ssid_on_lcd:dm.show_ssid_on_lcd};if(aK.WIFI_WEP_SUPPORT){dn.wep_default_key=dm.wep_default_key;dn.wep_key_1=dm.wep_key_1;dn.wep_key_2=dm.wep_key_2;dn.wep_key_3=dm.wep_key_3;dn.wep_key_4=dm.wep_key_4;if(dm.wep_default_key=="1"){dn.WEP2Select=dm.WEP2Select}else{if(dm.wep_default_key=="2"){dn.WEP3Select=dm.WEP3Select}else{if(dm.wep_default_key=="3"){dn.WEP4Select=dm.WEP4Select}else{dn.WEP1Select=dm.WEP1Select}}}}if(dm.AuthMode=="WPAPSK"||dm.AuthMode=="WPA2PSK"||dm.AuthMode=="WPAPSKWPA2PSK"||dm.AuthMode=="WPA3Personal"||dm.AuthMode=="WPA2WPA3"){dn.security_shared_mode=dm.cipher;dn.passphrase=aK.PASSWORD_ENCODE?Base64.encode(dm.passPhrase):dm.passPhrase}else{if(dm.AuthMode=="SHARED"){dn.security_shared_mode="WEP";dn.security_mode="SHARED"}else{if(dm.encryptType=="WEP"){dn.security_shared_mode="WEP";dn.security_mode="OPEN"}else{dn.security_shared_mode="NONE"}}}return dn}function dl(dm){if(dm){return dm}else{return X}}}function bQ(){ay(arguments,dk,dl);function dk(dm){var dn={goformId:"SET_WIFI_SSID2_SETTINGS",m_SSID:dm.m_SSID,m_HideSSID:dm.m_broadcast,m_MAX_Access_num:dm.m_station,m_AuthMode:dm.m_AuthMode,cipher:dm.m_cipher,m_NoForwarding:dm.m_NoForwarding,m_show_qrcode_flag:dm.m_show_qrcode_flag};if(aK.WIFI_WEP_SUPPORT){dn.m_DefaultKeyID=dm.m_wep_default_key;dn.m_Key1Str1=dm.m_wep_key_1;dn.m_Key2Str1=dm.m_wep_key_2;dn.m_Key3Str1=dm.m_wep_key_3;dn.m_Key4Str1=dm.m_wep_key_4;if(dm.m_wep_default_key=="1"){dn.m_Key2Type=dm.m_WEP2Select}else{if(dm.m_wep_default_key=="2"){dn.m_Key3Type=dm.m_WEP3Select}else{if(dm.m_wep_default_key=="3"){dn.m_Key4Type=dm.m_WEP4Select}else{dn.m_Key1Type=dm.m_WEP1Select}}}}if(dm.m_AuthMode=="WPAPSK"||dm.m_AuthMode=="WPA2PSK"||dm.m_AuthMode=="WPAPSKWPA2PSK"||dm.m_AuthMode=="WPA3Personal"||dm.m_AuthMode=="WPA2WPA3"){dn.m_EncrypType=dm.m_cipher;dn.m_WPAPSK1=aK.PASSWORD_ENCODE?Base64.encode(dm.m_passPhrase):dm.m_passPhrase}else{if(dm.m_AuthMode=="SHARED"){dn.m_EncrypType="WEP";dn.m_security_mode="SHARED"}else{if(dm.m_encryptType=="WEP"){dn.m_EncrypType="WEP";dn.m_security_mode="OPEN"}else{dn.m_EncrypType="NONE"}}}return dn}function dl(dm){if(dm){return dm}else{return X}}}function d(){return bH(arguments,{},dk,dl,null,false);function dk(dm,dp){var dq={};var dn=aK.PASSWORD_ENCODE?"WPAPSK1_encode,m_WPAPSK1_encode,":"imei,rnum_js,WPAPSK1_enaes,m_WPAPSK1_enaes,";dq.cmd="m_ssid_enable,wifi_cur_state,NoForwarding,m_NoForwarding,"+dn+"MAX_Station_num,SSID1,AuthMode,HideSSID,MAX_Access_num,show_qrcode_flag,show_ssid_on_lcd,EncrypType,Key1Str1,Key2Str1,Key3Str1,Key4Str1,DefaultKeyID,m_SSID,m_AuthMode,m_HideSSID,m_MAX_Access_num,m_EncrypType,m_show_qrcode_flag,m_DefaultKeyID,m_Key1Str1,m_Key2Str1,m_Key3Str1,m_Key4Str1,rotationFlag,wifi_sta_connection";dq.multi_data=1;return dq}function dl(dn){if(dn){var dm={wifi_enable:dn.wifi_cur_state=="1"?"1":"0",show_ssid_on_lcd:dn.show_ssid_on_lcd=="yes"?"1":"0",multi_ssid_enable:dn.m_ssid_enable,MAX_Station_num:cX.isNumeric(dn.MAX_Station_num)?dn.MAX_Station_num:aK.MAX_STATION_NUMBER,AuthMode:dn.AuthMode,SSID:dn.SSID1,broadcast:dn.HideSSID,apIsolation:dn.NoForwarding,passPhrase:aK.PASSWORD_ENCODE?Base64.decode(dn.WPAPSK1_encode):dn.WPAPSK1,MAX_Access_num:dn.MAX_Access_num,cipher:dn.EncrypType=="TKIP"?"0":dn.EncrypType=="AES"?1:2,encryptType:dn.EncrypType,show_qrcode_flag:dn.show_qrcode_flag=="1"?true:false,keyID:dn.DefaultKeyID,Key1Str1:dn.Key1Str1,Key2Str1:dn.Key2Str1,Key3Str1:dn.Key3Str1,Key4Str1:dn.Key4Str1,m_SSID:dn.m_SSID,m_broadcast:dn.m_HideSSID,m_apIsolation:dn.m_NoForwarding,m_MAX_Access_num:dn.m_MAX_Access_num,m_AuthMode:dn.m_AuthMode,m_passPhrase:aK.PASSWORD_ENCODE?Base64.decode(dn.m_WPAPSK1_encode):dn.m_WPAPSK1,m_cipher:dn.m_EncrypType=="TKIP"?"0":dn.m_EncrypType=="AES"?1:2,m_show_qrcode_flag:dn.m_show_qrcode_flag=="1"?true:false,m_encryptType:dn.m_EncrypType,m_keyID:dn.m_DefaultKeyID,m_Key1Str1:dn.m_Key1Str1,m_Key2Str1:dn.m_Key2Str1,m_Key3Str1:dn.m_Key3Str1,m_Key4Str1:dn.m_Key4Str1,rotationFlag:dn.rotationFlag,ap_station_enable:dn.wifi_sta_connection};return dm}else{return X}}}function u(){ay(arguments,dk,dl);function dk(dm){var dp=dm;if(dm.wifiEnabled=="0"){dp={wifiEnabled:dm.wifiEnabled}}var dn=cX.extend({goformId:"SET_WIFI_INFO"},dp);return dn}function dl(dm){if(dm){return dm}else{return X}}}function bH(dq,dx,dr,dm,dl,dn){var du=dq[0],dw=dq[1],dp=dq[2];var ds;if(dx&&typeof dx.errorType==="string"){ds=cX.extend(X,dx);if(!dw){return ds}dv(ds,dw,dp)}else{ds=cX.extend({},dx);var dt;if(dr){dt=dr(du,dn)}else{dt=du}if(!dw){if(dt&&(dt.cmd||dt.goformId)){var dk=cC(dt,dn);if(dm){ds=cX.extend({},dm(dk))}else{ds=dk}}return ds}else{if(dt&&(dt.cmd||dt.goformId)){dg(dt,function(dy){if(dm){ds=cX.extend({},dm(dy))}else{ds=cX.extend({},dy)}if(!dt.notCallback){dv(ds,dw,dp)}},function(){if(dl){ds=cX.extend(X,dl)}else{ds=cX.extend(X,{errorType:"Unknown"})}dv(ds,dw,dp)},dn)}else{dv(ds,dw,dp)}}}function dv(dy,dA,dz){dz=dz?dz:dA;if(isErrorObject(dy)){switch(dy.errorType){case"cellularNetworkError":case"deviceError":case"wifiConnectionError":window.receivedNonSpecificError(dy);break;default:dz(dy)}}else{dA(dy)}}}function cC(dk,dl){return bs(dk,null,null,false,dl)}function dg(dm,dk,dl,dn){bs(dm,dk,dl,true,dn)}function x(dk){var dm=/^[A-z0-9]+$/;var dl=dk.match(dm);if(dl==null){return"error"}else{return dk}}function bs(dn,dl,dm,dq,dp){var dk=null;cX.ajax({type:!!dp?"POST":"GET",url:dp?"/goform/goform_set_cmd_process":dn.cmd?"/goform/goform_get_cmd_process":"/goform/goform_set_cmd_process",data:dn,dataType:"json",async:!!dq,cache:false,error:function(dr){if(dq){dm(dr)}else{if(dr.status==200){console.log(dr.responseText);dk=jQuery.parseJSON(dr.responseText.replace(/\r/g,""))}}},success:function(dr){if(dq){dl(dr)}else{dk=dr}}});if(!dq){return dk}}var bD={networkType:"",signalImg:"0",spn_b1_flag:"1",spn_name_data:"",spn_b2_flag:"1",networkOperator:"China Mobile",connectStatus:"ppp_disconnected",rj45ConnectStatus:"rj45_dead",attachedDevices:[],ssid1AttachedNum:0,ssid2AttachedNum:0,data_counter:{uploadRate:0,downloadRate:0,totalSent:0,totalReceived:0,totalConnectedTime:0,currentSent:0,currentReceived:0,currentConnectedTime:0,monthlySent:0,monthlyReceived:0,monthlyConnectedTime:0,month:""},newSmsReceived:false,smsReportReceived:false,smsUnreadCount:"0",isLoggedIn:undefined,limitVolumeEnable:false,limitVolumeType:"1",limitVolumePercent:"100",limitVolumeSize:"0",allowRoamingUpdate:"0",blc_wan_mode:"",ap_station_enable:undefined,ap_station_mode:undefined,dialMode:"",ethWanMode:"AUTO",fota_user_selector:"",defaultWanName:""};var X={errorType:"UnknownError",errorId:"123",errorText:"UnknownError"};var cW=true;return{clearRedirectFlag:cR,connect:be,disconnect:R,getSIMPhoneBookCapacity:b0,getDevicePhoneBookCapacity:ai,getDevicePhoneBooks:dd,getSIMPhoneBooks:cQ,getPhoneBooks:T,getPhoneBookReady:cq,getPhoneBooksByGroup:b5,deletePhoneBooks:bu,deleteAllPhoneBooks:aZ,deleteAllPhoneBooksByGroup:ab,savePhoneBook:cP,deleteAllMessages:b4,deleteMessage:cJ,setSmsRead:ag,sendSMS:a3,saveSMS:aL,getSMSReady:aM,getSMSMessages:aO,getSMSDeliveryReport:L,getSmsCapability:b,resetNewSmsReceivedVar:E,resetSmsReportReceivedVar:cc,getSmsSetting:ca,setSmsSetting:aU,getBand:cy,getSetband:O,setBandlist:cE,getResideband:bR,getAttachedCableDevices:bL,getCurrentlyAttachedDevicesInfo:bA,getConnectionInfo:bG,getRedirectData:aT,getLanguage:A,setLanguage:k,getNetSelectInfo:S,getSecurityInfo:f,setSecurityInfo:z,getStatusInfo:e,getConnectionMode:K,setConnectionMode:ah,getWifiBasic:d,setWifiBasic:co,setWifiBasic4SSID2:bQ,setWifiBasicMultiSSIDSwitch:u,getWpsInfo:cl,openWps:r,getSleepMode:ct,setSleepMode:bm,getWifiAdvance:cx,setWifiAdvance:c8,getWifiRange:Y,setWifiRange:c5,setImeiNum:bd,getLoginStatus:bk,getLoginData:cs,login:aR,logout:bC,getPassword:bV,changeManageInfo:b7,getPinData:c6,enablePin:dj,disablePin:b9,changePin:p,enterPIN:J,enterPUK:U,getLanInfo:bB,setLanInfo:cm,getDnsInfo:bX,setDnsInfo:cI,getApnSettings:m,deleteApn:aA,setDefaultApn:bF,addOrEditApn:by,getQuickSettingInfo:ba,setQuickSetting4IPv6:de,scanForNetwork:aG,setBearerPreference:bP,editHostName:bn,getSiteWhiteList:da,removeSiteWhite:F,saveSiteWhite:bI,setNetwork:bv,getUpnpSetting:am,setUpnpSetting:a8,getDmzSetting:aB,setDmzSetting:c1,getDeviceInfo:bg,getDeviceInfoLow:c3,getPortForward:D,setPortForward:ar,getPortFilter:bl,setPortFilterBasic:ak,setPortFilter:V,deleteFilterRules:aC,getPortMap:bf,setPortMap:bN,enablePortMap:bK,deleteMapRules:a2,getTrafficAlertInfo:H,setTrafficAlertInfo:ao,getCurrentUpgradeState:bo,setUpgradeSelectOp:N,addTimerThings:bi,removeTimerThings:n,getPackSizeInfo:Q,getMandatory:bt,getOTAUpdateSetting:G,setOTAUpdateSetting:an,getSignalStrength:h,getOTAlastCheckTime:di,clearUpdateResult:j,refreshAPStationStatus:ac,getSIMswitch:dh,setSIMswitch:ch,getSntpParams:at,setSntpSetting:g,setSNTPDate:cg,executeAtCommand:s,restoreFactorySettings:az,checkRestoreStatus:ad,getSysSecurity:b6,setSysSecurity:cN,deleteForwardRules:cM,enableVirtualServer:aE,getSDConfiguration:b2,setSdCardMode:cF,checkFileExists:M,getFileList:af,fileRename:bJ,getSdMemorySizes:B,deleteFilesAndFolders:a0,createFolder:I,setSdCardSharing:ck,setUpdateInfoWarning:db,getUpdateInfoWarning:cb,getAPStationBasic:aw,setAPStationBasic:bj,getWdsInfo:bO,setWDS:aq,addUrlFilterRule:cj,getUrlFilterList:b1,deleteSelectedRules:cw,getMacFilterInfo:cf,setMacFilter:aD,getFastbootSetting:av,setFastbootSetting:bZ,turnOffDevice:bb,restart:aj,updateTimerFlag:cW,childGroupList:w,addChildGroup:cz,removeChildGroup:cO,checkCurrentUserInChildGroup:t,getTimeLimited:ce,saveTimeLimited:o,getHostNameList:v,getHotspotList:cu,searchHotspot:ap,getSearchHotspotList:Z,saveHotspot:al,deleteHotspot:c2,connectHotspot:bM,disconnectHotspot:aN,getOpMode:c0,getRj45PlugState:a9,SetOperationMode:bq,getPppoeParams:bc,setPppoeDialMode:cK,getTsw:cA,saveTsw:bY,trafficCalibration:aQ,getParams:cv,getNewVersionState:aa,getUpgradeResult:cL,getV4Switch:cd,setV4Switch:bS,getCellId:aI,setCellIdSwitch:b8,getDdnsParams:b3,setDDNSForward:aW,getUpdateType:cZ,getCurretnMAC:aV,getUSSDResponse:cH,USSDReplyCancel:q,getNetworkUnlockTimes:cr,getSIMUnlockTimes:W,getLockNetStatus:a5,unlockNetwork:aP,unlockSim:bT,getLockNetStatus:a5,getLockSimStatus:a6,getSyslogInfo:y,setSysLog:bh,getUsbMacAddress:cB,setUsbMacAddress:c7,getTR069Info:au,setTR069Info:l,getVPNInfo:dc,setVPNInfo:P,setVPNOpen:bx,setVPNClose:aJ,getRateLimit:br,setRateLimit:aH,deleteRateLimitRules:bp,enableRateLimit:aS,getExtraFunc:bW,getSupportLanguages:df}});define("adm_lan","jquery knockout set service".split(" "),function(c,b,q,s){var r="";function j(){return s.getLanInfo()}function d(){return s.getDnsInfo()}function f(u){var t=(u-0).toString(16);if(t.length==1){t="0"+t}return t.toUpperCase()}function n(){var w=this;var v=j();var t=d();w.dhcpStart=b.observable(v.dhcpStart);w.dhcpEnd=b.observable(v.dhcpEnd);w.dhcpLease=b.observable(v.dhcpLease);w.ipAddress=b.observable(v.ipAddress);w.subnetMask=b.observable(v.subnetMask);w.dhcpServer=b.observable(v.dhcpServer);w.macAddress=b.observable(v.macAddress);w.showMacAddress=b.observable(q.SHOW_MAC_ADDRESS);w.dnsServerMode=b.observable(t.dnsServerMode);w.dnsPrimary=b.observable(t.dnsPrimary);w.hasWifi=b.observable(q.HAS_WIFI);w.isSupportSD=q.SD_CARD_SUPPORT;w.hasDdns=q.DDNS_SUPPORT;w.hasUpdateCheck=q.HAS_UPDATE_CHECK;var u=checkCableMode(s.getOpMode().blc_wan_mode);var x=s.getExtraFunc();w.hasBandSelect=b.observable(x.bandSelectEnable&&!u);w.hasTr069=x.tr069FuncEnable;w.hasVpn=x.vpnEnable;w.hasManualDns=x.dnsManualEnable;w.clear=function(){clearTimer();m();clearValidateMsg()};w.refreshStatus=function(){var y=s.getConnectionInfo();if(y.connectStatus=="ppp_disconnected"){c("input","#frmLan").each(function(){c(this).attr("disabled",false)})}else{c("input","#frmLan").each(function(){c(this).attr("disabled",true)});clearValidateMsg()}};w.saveAct=function(){showLoading();var y={ipAddress:w.ipAddress(),subnetMask:w.subnetMask(),dhcpServer:w.dhcpServer(),dhcpStart:w.dhcpStart(),dhcpEnd:w.dhcpEnd(),dhcpLease:w.dhcpLease()};s.setLanInfo(y,function(z){if(z.result=="success"){successOverlay();w.clear()}else{errorOverlay()}})};w.save=function(){var y=c("#frmLan").serialize();if(y==r){showAlert("setting_no_change");return false}if(q.RJ45_SUPPORT){var z=s.getPppoeParams();if(a(z.static_wan_ipaddr,w.ipAddress(),w.subnetMask())){showAlert("lan_tip_staticip_notsame");return false}}showConfirm("lan_confirm_reopen",function(){w.saveAct()})};w.refreshStatus();w.dhcpServerHandler=function(){c("#txtIpAddress").parent().find(".error").hide();c("#txtIpAddress").show();return true};w.dnsServerHandler=function(){c("#txtPrimaryDns").parent().find(".error").hide();c("#txtPrimaryDns").show();return true};w.saveDnsPara=function(){showLoading();var y={dnsServerMode:w.dnsServerMode(),dnsPrimary:w.dnsPrimary()};s.setDnsInfo(y,function(z){if(z.result=="success"){successOverlay();w.clear()}else{errorOverlay()}})};w.saveDnsAct=function(){showConfirm("lan_confirm_reopen",function(){w.saveDnsPara()})};addTimeout(function(){r=c("#frmLan").serialize()},500)}function e(y,w){var u;var x=[];var v=[];var t="0x";for(u=2,index_tmp=0;u<10;u+=2,index_tmp++){x[index_tmp]="0x"+y.substring(u,u+2);v[index_tmp]="0x"+w.substring(u,u+2)}for(u=0;u<4;u++){t=t+f(x[u]&v[u])}return t-0}c.validator.addMethod("dhcp_check",function(v,w,x){var u=x=="start"?c("#txtDhcpIpPoolStart").val():c("#txtDhcpIpPoolEnd").val();var t=k(c("#txtIpAddress").val(),c("#txtSubnetMask").val(),u);return this.optional(w)||t});c.validator.addMethod("dhcpCompare",function(u,v,w){var t;if(w=="#txtDhcpIpPoolStart"){t=g(c("#txtIpAddress").val(),c("#txtSubnetMask").val(),c(w).val(),u)}else{t=g(c("#txtIpAddress").val(),c("#txtSubnetMask").val(),u,c(w).val())}return t!=1});c.validator.addMethod("ipRange",function(u,w,x){var v=false;if(c("#dhcpEnable").is(":checked")){v=true}var t=g(u,c("#txtSubnetMask").val(),c("#txtDhcpIpPoolStart").val(),c("#txtDhcpIpPoolEnd").val(),v);return t!=2});c.validator.addMethod("subnetmask_check",function(u,v,w){var t=l(u);return this.optional(v)||t});function a(y,z,u){if(!y||!z||!u){return false}if(y==z){return true}var x=[];var w=[];var t=[];ip_array=y.split(".");lanIp_array=z.split(".");t=u.split(".");for(var v=0;v<ip_array.length;v+=1){x.push(parseInt(t[v])&parseInt(ip_array[v]));w.push(parseInt(t[v])&parseInt(lanIp_array[v]))}if(w.join(".")!=x.join(".")){return false}else{return true}}function h(t){return t==255||t==254||t==252||t==248||t==240||t==224||t==192||t==128||t==0}function o(w){var v=w.indexOf(".");var u=w.indexOf(".",v+1);var t=w.indexOf(".",u+1);o_ip=f(w.substring(0,v))+f(w.substring(v+1,u))+f(w.substring(u+1,t))+f(w.substring(t+1,w.length));o_ip="0x"+o_ip;return o_ip}function p(x){var w=x.indexOf(".");var v=x.indexOf(".",w+1);var u=x.indexOf(".",v+1);var t=x.substring(u+1,x.length)-0;return t}function k(t,D,C){var z=o(t);var x=p(t);var v=o(D);var B=p(D);var y=o(C);var A=p(C);var w;var u;if(e(z,v)!=e(y,v)){return false}w=x&B;u=(x&B)+(255-B);return!(A==w||A==u)}function l(t){var u=t.split(".");if("0.0.0.0"==t||"255.255.255.255"==t){return false}if(u.length!=4){return false}u[0]=parseInt(u[0]);u[1]=parseInt(u[1]);u[2]=parseInt(u[2]);u[3]=parseInt(u[3]);if(u[3]!=0){if(u[0]!=255||u[1]!=255||u[2]!=255){return false}else{if(!h(u[3])){return false}}}if(u[2]!=0){if(u[0]!=255||u[1]!=255){return false}else{if(!h(u[2])){return false}}}if(u[1]!=0){if(u[0]!=255){return false}else{if(!h(u[1])){return false}}}if(u[0]!=255){return false}return true}function g(v,x,t,u,w){s_startIp=o(t);s_endIp=o(u);s_lanIp=o(v);if(s_startIp>s_endIp){return 1}if(s_lanIp>=s_startIp&&s_lanIp<=s_endIp){return 2}return 0}function m(){var t=c("#container");b.cleanNode(t[0]);var u=new n;b.applyBindings(u,t[0]);addInterval(u.refreshStatus,1e3);c("#frmLan").validate({submitHandler:function(){u.save()},rules:{txtIpAddress:{lanip_check:true,ipRange:true},txtSubnetMask:{ipv4:true,subnetmask_check:true},txtDhcpIpPoolStart:{lanip_check:true,dhcp_check:"start",dhcpCompare:"#txtDhcpIpPoolEnd"},txtDhcpIpPoolEnd:{lanip_check:true,dhcp_check:"end",dhcpCompare:"#txtDhcpIpPoolStart"},txtDhcpLease:{range:[1,65535],digits:true}},groups:{lanip_check:"txtDhcpIpPoolStart txtDhcpIpPoolEnd"},errorPlacement:function(v,w){if(w.attr("name")=="txtDhcpLease"){v.insertAfter("#errorHolder")}else{if(w.attr("name")=="txtDhcpIpPoolStart"){v.insertAfter("#txtDhcpIpPoolEnd")}else{v.insertAfter(w)}}}});c("#frmDns").validate({submitHandler:function(){u.saveDnsAct()}})}return{init:m}});define("tr069","jquery knockout set service".split(" "),function(f,c,b,a){function g(){return a.getTR069Info()}function e(k){var j=(k-0).toString(16);if(j.length==1){j="0"+j}return j.toUpperCase()}function d(){var l=this;var k=g();l.tr069Server=c.observable(k.TR069Server);l.AcsName=c.observable(k.AcsName);l.AcsPassword=c.observable(k.AcsPassword);l.AcsAddress=c.observable(k.AcsAddress);l.InformEnable=c.observable(k.InformEnable);l.ReportCycle=c.observable(k.ReportCycle);l.AuthEnable=c.observable(k.AuthEnable);l.CpeName=c.observable(k.CpeName);l.CpePassword=c.observable(k.CpePassword);l.isSupportSD=b.SD_CARD_SUPPORT;l.hasDdns=b.DDNS_SUPPORT;l.hasUpdateCheck=b.HAS_UPDATE_CHECK;var j=checkCableMode(a.getOpMode().blc_wan_mode);var m=a.getExtraFunc();l.hasBandSelect=c.observable(m.bandSelectEnable&&!j);l.showCpePassword=c.observable(false);l.showAcsPassword=c.observable(false);l.hasVpn=m.vpnEnable;l.clear=function(){clearTimer();h();clearValidateMsg()};l.saveAct=function(){showLoading();var n={tr069Server:l.tr069Server(),AcsName:l.AcsName(),AcsPassword:l.AcsPassword(),AcsAddress:l.AcsAddress(),InformEnable:l.InformEnable(),ReportCycle:l.ReportCycle(),AuthEnable:l.AuthEnable(),CpeName:l.CpeName(),CpePassword:l.CpePassword()};a.setTR069Info(n,function(o){if(o.result=="success"){successOverlay();l.clear()}else{errorOverlay()}})};l.save=function(){var n=f("#frmTr069").serialize();if(n==originTr069){showAlert("setting_no_change");return false}showConfirm("lan_confirm_reopen",function(){l.saveAct()})};addTimeout(function(){originTr069=f("#frmTr069").serialize()},500);l.showAcsPasswordHandler=function(){f("#pwdAcsPassword").parent().find(".error").hide();var n=f("#showAcsPassword:checked");if(n&&n.length==0){l.showAcsPassword(true)}else{l.showAcsPassword(false)}};l.showCpePasswordHandler=function(){f("#pwdCpePassword").parent().find(".error").hide();var n=f("#showCpePassword:checked");if(n&&n.length==0){l.showCpePassword(true)}else{l.showCpePassword(false)}}}function h(){var j=f("#container");c.cleanNode(j[0]);var k=new d;c.applyBindings(k,j[0]);f("#frmTr069").validate({submitHandler:function(){k.save()},rules:{AcsName:"tr069_check",AcsPassword:"tr069_check",CpeName:"tr069_check",CpePassword:"tr069_check",AcsAddress:"tr069_check"},errorPlacement:function(l,m){var n=m.attr("id");l.insertAfter(m)}})}return{init:h}});define("vpn","jquery knockout set service".split(" "),function(d,k,b,f){function a(){return f.getVPNInfo()}var e;var g=_.map(b.VPN_TYPES,function(l){return new Option(l.name,l.value)});function h(m,l){if(m=="open"){if(l=="setting"){return"vpn_switch_btn vpn_switch_ing"}else{if(l=="connected"){return"vpn_switch_btn vpn_switch_on"}else{if(l=="disconnect"){return"vpn_switch_btn vpn_switch_failed"}else{return"vpn_switch_btn vpn_switch_failed"}}}}else{return"vpn_switch_btn vpn_switch_off"}}function c(){var n=this;var m=a();n.vpn_name=k.observable(m.vpn_name);n.vpn_password=k.observable(m.vpn_password);n.vpn_server_ip=k.observable(m.vpn_server_ip);n.vpn_state=k.observable(m.vpn_state);n.vpnState=k.observable();n.vpn_switch=k.observable();n.modes=k.observableArray(g);n.vpn_type=k.observable(m.vpn_type);n.connect_status=k.observable(m.connect_status);n.vpn_status=k.observable(m.vpn_status);n.vpnSwitchCssClass=k.observable(h(n.vpn_state,n.connect_status));n.isVpnEnable=k.observable(false);n.showVpnPassword=k.observable(false);n.isSupportSD=b.SD_CARD_SUPPORT;n.hasDdns=b.DDNS_SUPPORT;n.hasUpdateCheck=b.HAS_UPDATE_CHECK;var l=checkCableMode(f.getOpMode().blc_wan_mode);var o=f.getExtraFunc();n.hasBandSelect=k.observable(o.bandSelectEnable&&!l);n.hasTr069=o.tr069FuncEnable;n.hasVpn=o.vpnEnable;n.selectVpnMode=k.observable(m.vpn_type);n.clear=function(){clearTimer();j();clearValidateMsg()};n.saveAct=function(){var p={vpn_name:n.vpn_name(),vpn_password:n.vpn_password(),vpn_server_ip:n.vpn_server_ip(),vpn_type:n.vpn_type()};f.setVPNInfo(p,function(q){})};n.save=function(){showConfirm("vpn_confirm_reopen",function(){n.saveAct()})};n.submitAction=function(){var p=a();if(p.vpn_state=="open"){if(p.connect_status=="setting"){}else{if(p.connect_status=="connected"){f.setVPNClose({},function(q){});e="init"}else{if(p.connect_status=="disconnect"){n.saveAct();e="set_abnormal"}}}}else{n.saveAct();e="set_abnormal"}};n.showVpnPasswordHandler=function(){d("#pwdVpnPassword").parent().find(".error").hide();var p=d("#showVpnPassword:checked");if(p&&p.length==0){n.showVpnPassword(true)}else{n.showVpnPassword(false)}};addTimeout(function(){originVpn=d("#frmVpn").serialize()},500)}function j(){var l=d("#container");k.cleanNode(l[0]);var m=new c;k.applyBindings(m,l[0]);d("#frmVpn").validate({submitHandler:function(){m.save()}});window.setInterval(function(){var n=a();m.vpnSwitchCssClass(h(n.vpn_state,n.connect_status));if(n.connect_status=="connected"||n.connect_status=="setting"){d("#frmVpn :input").each(function(){d(this).prop("disabled",true)})}else{d("#frmVpn :input").each(function(){d(this).prop("disabled",false)})}if(n.connect_status=="connected"){e="con_abnormal"}if(e=="set_abnormal"&&n.connect_status=="disconnect"){d("#vpn_switch_txt").text(d.i18n.prop("vpn_open_error"));d(".vpn_switch_txt").css("color","red")}else{if(e=="con_abnormal"&&n.connect_status=="disconnect"){d("#vpn_switch_txt").text(d.i18n.prop("vpn_net_error"));d(".vpn_switch_txt").css("color","red")}else{if(e!="con_abnormal"&&e!="set_abnormal"&&n.connect_status=="disconnect"){d("#vpn_switch_txt").text(d.i18n.prop("vpn_net_disconnect"));d(".vpn_switch_txt").css("color","#898989")}else{if(n.connect_status=="setting"){d("#vpn_switch_txt").text(d.i18n.prop("vpn_net_connecting"));d(".vpn_switch_txt").css("color","green")}else{if(n.connect_status=="connected"){d("#vpn_switch_txt").text(d.i18n.prop("vpn_net_connect"));d(".vpn_switch_txt").css("color","#1295da")}}}}}},1e3)}return{init:j}});define("adm_others","jquery knockout set service underscore".split(" "),function(d,a,s,u,t){var e=t.map(s.sntpTimeSetMode,function(v){return new Option(v.name,v.value)});var f=t.map(s.timeZone,function(v){return new Option(v.name,v.value)});var j=t.map(s.daylightSave,function(v){return new Option(v.name,v.value)});var l=[];var h=[];var b=[];var n=[];var k=[];var r=[1,3,5,7,8,10,12];var m=[4,6,9,11];function q(z,v,y){var x={};for(var w=z;w<=v;w++){x.name=w;x.value=w;y.push(new Option(x.name,x.value))}}q(2e3,2030,l);q(1,12,h);q(0,23,n);q(0,59,k);function p(){var D=this;var E=false;var J=u.getSIMswitch();D.hasOtherSIM=a.observable(J.sim_switch_number>1?true:false);D.currentSIM0=a.observable(J.sim_current_type==0?true:false);D.currentSIM1=a.observable(J.sim_current_type==1?true:false);D.currentSIM2=a.observable(J.sim_current_type==2?true:false);D.switchRunningDetect=a.observable(J.sim_switch_running_detect);D.SIMislock=a.observable(J.sim_lock_status=="lock"?J.sim_current_type==0?true:false:false);D.enableFlag=a.observable(J.sim_lock_status=="lock"?J.sim_current_type==0?false:true:true);d("#swithMode").val(J.sim_auto_switch_enable);if(J.sim_auto_switch_enable==0){d("#swithCard").val(J.sim_current_type)}else{d("#swithCard").val(J.sim_default_type)}D.fastbootSupport=s.FAST_BOOT_SUPPORT;D.turnOffSupport=s.TURN_OFF_SUPPORT;D.SNTPSupport=s.HAS_SNTP;D.isSupportSD=s.SD_CARD_SUPPORT;D.hasDdns=s.DDNS_SUPPORT;D.hasUpdateCheck=s.HAS_UPDATE_CHECK;var v=checkCableMode(u.getOpMode().blc_wan_mode);var w=u.getExtraFunc();D.hasBandSelect=a.observable(w.bandSelectEnable&&!v);D.hasTr069=w.tr069FuncEnable;D.hasVpn=w.vpnEnable;if(s.HAS_PARENTAL_CONTROL){E=u.checkCurrentUserInChildGroup().result}D.currentUserInChildGroup=a.observable(E);var G=u.getFastbootSetting();D.fastbootEnableFlag=a.observable(s.RJ45_SUPPORT?G.need_sim_pin!="yes"&&u.getRj45PlugState().rj45_plug=="wan_lan_off":G.need_sim_pin!="yes");D.fastbootSetting=a.observable(G.fastbootEnabled);addInterval(function(){D.fastbootEnableFlag(s.RJ45_SUPPORT?G.need_sim_pin!="yes"&&u.getRj45PlugState().rj45_plug=="wan_lan_off":G.need_sim_pin!="yes")},1e3);addTimeout(function(){d("#txtAtCmd").val("AT+ZLTELC?");u.executeAtCommand({},function(M){if(M){d("#txtAtCmd").val("");var b=M.result.match(/(\d+)/gi);if(b[0]==="1"){d("#lock_enable").attr("checked","checked");d("#user_input_arfrcn").val(b[1]);d("#user_input_pci").val(b[2])}else if(b[0]==="0"){d("#lock_disable").attr("checked","checked")}}else{errorOverlay()}})},100);D.lock=function(){if(d("#lock_enable").attr("checked")){if(d("#user_input_arfrcn").val()<1||d("#user_input_arfrcn").val()>65535){alert("锁频频点 wrong");return}if(d("#user_input_pci").val()<1||d("#user_input_pci").val()>65535){alert("小区ID wrong");return}d("#txtAtCmd").val("AT+ZLTELC=1,"+d("#user_input_arfrcn").val()+","+d("#user_input_pci").val())}else if(d("#lock_disable").attr("checked")){d("#txtAtCmd").val("AT+ZLTELC=0,65535,65535");d("#user_input_arfrcn").val("");d("#user_input_pci").val("")}else{alert("please select lock");return}u.executeAtCommand({},function(M){hideLoading();if(M){d("#txtAtCmd").val("AT+CFUN=0");showLoading("waiting");u.executeAtCommand({},function(M){hideLoading();if(M){d("#txtAtCmd").val("AT+CFUN=1");showLoading("waiting");u.executeAtCommand({},function(M){hideLoading();if(M){d("#txtAtCmd").val("")}else{errorOverlay()}})}else{errorOverlay()}})}else{errorOverlay()}})};D.executeAtCmd=function(){var L=d("#txtAtCmd").val().replace(/\s*/g,"").toUpperCase();var K=new RegExp("^AT");if(!K.test(L)){alert("please input the correct at command . \n eg: at+cgsn");d("#txtAtCmd").focus();return}showLoading("waiting");u.executeAtCommand({},function(M){hideLoading();if(M){d("#txtCmdRsp").append("\n"+d("#txtAtCmd").val()+M.result);d("#txtCmdRsp").scrollTop(d("#txtCmdRsp")[0].scrollHeight)}else{errorOverlay()}})};D.cleanCon=function(){d("#txtCmdRsp").text("");d("#atCleanBtn").blur()};D.restore=function(){showConfirm("restore_confirm",function(){showLoading("restoring");u.restoreFactorySettings({},function(K){if(K&&K.result=="success"){successOverlay()}else{errorOverlay()}},function(K){if(isErrorObject(K)&&K.errorType=="no_auth"){errorOverlay()}})})};D.restart=function(){showConfirm("restart_confirm",function(){restartDevice(u)})};D.saveFastBoot=function(){showLoading();var K={fastbootEnabled:D.fastbootSetting(),need_hard_reboot:G.need_hard_reboot};u.setFastbootSetting(K,function(L){if(L.result=="success"){successOverlay()}else{errorOverlay()}})};D.turnoff=function(){showConfirm("turnoff_confirm",function(){showLoading("turnoff");u.turnOffDevice({},function(K){if(K&&K.result=="success"){successOverlay()}else{errorOverlay()}},d.noop)})};D.saveSIMSwitch=function(){var L=d("#swithMode").val();var N=d("#swithCard").val();var K=d("input:radio[name='switch_running']:checked").val();var M={sim_mode:L,sim_type:N,sim_running:K};showLoading();u.setSIMswitch(M,function(O){var P=u.getSIMswitch();if(O.result=="success"){hideLoading();successOverlay();if(P.sim_current_type==0){D.currentSIM0(true);D.currentSIM1(false);D.currentSIM2(false)}else{if(P.sim_current_type==1){D.currentSIM0(false);D.currentSIM1(true);D.currentSIM2(false)}else{D.currentSIM0(false);D.currentSIM1(false);D.currentSIM2(true)}}}else{if(O.result=="processing"){showAlert("sim_executing_try_again")}else{errorOverlay()}}})};D.moitorSelectSIMMode=function(L){var K=u.getSIMswitch();if(L==0||L==1){d("#swithCard").val(K.sim_default_type)}};D.moitorSelectSIMCard=function(K){if(K&&J.sim_lock_status=="lock"){D.SIMislock(true);D.enableFlag(false)}else{D.SIMislock(false);D.enableFlag(true)}};var D=this;var A=u.getSntpParams();globalTime=new Date(parseInt(A.sntp_year,10),parseInt(A.sntp_month,10)-1,parseInt(A.sntp_day,10),parseInt(A.sntp_hour,10),parseInt(A.sntp_minute,10),parseInt(A.sntp_second,10));D.day=a.observable();D.localTime=a.observable();D.timeSetModes=a.observableArray(e);D.isManualSetTime=a.observable(false);D.isAutoSntpTime=a.observable(false);D.currentMode=a.observable(A.sntp_time_set_mode);z();D.changeSetTimeMode=function(){z()};D.currentYear=a.observable(parseInt(A.sntp_year,10));D.currentMonth=a.observable(parseInt(A.sntp_month,10));D.currentDate=a.observable(parseInt(A.sntp_day,10));D.currentHour=a.observable(parseInt(A.sntp_hour,10));D.currentMinute=a.observable(parseInt(A.sntp_minute,10));D.years=a.observableArray(l);D.months=a.observableArray(h);D.initDateList=function(){B();D.dates(b)};B();D.dates=a.observableArray(b);D.hours=a.observableArray(n);D.minutes=a.observableArray(k);var F=t.map(A.sntp_servers,function(K){return new Option(K.name,K.value)});D.serverList=a.observableArray(F);D.currentServer0=a.observable(A.sntp_server0);D.currentServer1=a.observable(A.sntp_server1);D.currentServer2=a.observable(A.sntp_server2);D.customServer0=a.observable(A.sntp_other_server0);D.customServer1=a.observable(A.sntp_other_server1);D.customServer2=a.observable(A.sntp_other_server2);D.isOther0=a.observable(false);D.isOther1=a.observable(false);D.isOther2=a.observable(false);x();D.changeServerSelect=function(){x()};D.timeZones=a.observableArray(f);D.currentTimeZone=a.observable(A.sntp_timezone+"_"+A.sntp_timezone_index);D.daylightSaves=a.observableArray(j);D.currentDaylightSave=a.observable(A.sntp_dst_enable);D.updateCurrentTime=function(){var K=globalTime.getDay();switch(K){case 6:D.day(d.i18n.prop("saturday"));break;case 5:D.day(d.i18n.prop("friday"));break;case 4:D.day(d.i18n.prop("thursday"));break;case 3:D.day(d.i18n.prop("wednesday"));break;case 2:D.day(d.i18n.prop("tuesday"));break;case 1:D.day(d.i18n.prop("monday"));break;case 0:D.day(d.i18n.prop("sunday"));break;default:break}var L=globalTime.getFullYear()+"-"+getTwoDigit(globalTime.getMonth()+1)+"-"+getTwoDigit(globalTime.getDate())+" "+getTwoDigit(globalTime.getHours())+":"+getTwoDigit(globalTime.getMinutes())+":"+getTwoDigit(globalTime.getSeconds());D.localTime(L);globalTime.setTime(globalTime.getTime()+1e3)};D.updateCurrentSim=function(){var L=null;var K=u.getSIMswitch();if(K.sim_current_type!=L){if(K.sim_current_type==0){D.currentSIM0(true);D.currentSIM1(false);D.currentSIM2(false);L=K.sim_current_type}else{if(K.sim_current_type==1){D.currentSIM0(false);D.currentSIM1(true);D.currentSIM2(false);L=K.sim_current_type}else{D.currentSIM0(false);D.currentSIM1(false);D.currentSIM2(true);L=K.sim_current_type}}}};D.apply=function(){var L=[];for(var K=0;K<A.sntp_servers.length;K++){L.push(A.sntp_servers[K].value)}var N=u.getStatusInfo();if(!checkConnectedStatus(N.connectStatus,N.rj45ConnectStatus,N.connectWifiStatus)&&D.currentMode()=="auto"){showAlert("sntp_syn_time_wan_connected");return}showLoading("");var M={goformId:"SNTP",manualsettime:D.currentMode(),sntp_server1_ip:D.currentServer0(),sntp_server2_ip:D.currentServer1(),sntp_server3_ip:D.currentServer2(),sntp_other_server0:D.customServer0(),sntp_other_server1:D.customServer1(),sntp_other_server2:D.customServer2(),timezone:D.currentTimeZone().split("_")[0],sntp_timezone_index:D.currentTimeZone().split("_")[1],DaylightEnabled:D.currentDaylightSave(),time_year:D.currentYear(),time_month:D.currentMonth(),time_day:D.currentDate(),time_hour:D.currentHour(),time_minute:D.currentMinute()};u.setSntpSetting(M,function(O){if(O){if(O.result=="success"&&D.currentMode()=="auto"){successOverlay("sntp_req_success")}else{if(O.result=="processing"&&D.currentMode()=="auto"){successOverlay("sntp_processing")}else{u.setSNTPDate({goformId:"SNTP_Getdatastatic"},function(P){var Q=u.getSntpParams();globalTime=new Date(parseInt(Q.sntp_year,10),parseInt(Q.sntp_month,10)-1,parseInt(Q.sntp_day,10),parseInt(Q.sntp_hour,10),parseInt(Q.sntp_minute,10),parseInt(Q.sntp_second,10));successOverlay()})}}}else{errorOverlay()}})};D.unlock_code=a.observable("");D.netLockStatus=a.observable();var C=u.getLockNetStatus();if(C.lock_network_status=="unlock"){D.netLockStatus=a.observable(false)}else{if(C.lock_network_status=="lock"){D.netLockStatus=a.observable(true)}}var H=u.getNetworkUnlockTimes();D.times=a.observable(H.unlock_nck_time);D.unlock_sim=function(){showConfirm("restart_confirm",function(){u.unlockNetwork({unlock_network_code:D.unlock_code()},function(K){if(K&&K.result=="success"){successOverlay()}else{var L=u.getNetworkUnlockTimes();D.times(L.unlock_nck_time);errorOverlay()}},d.noop)})};D.unlock_sim_code=a.observable("");D.simLockStatus=a.observable();var I=u.getLockSimStatus();if(I.sim_lock_status=="unlock"){D.simLockStatus=a.observable(false)}else{if(I.sim_lock_status=="lock"){D.simLockStatus=a.observable(true)}}var y=u.getSIMUnlockTimes();D.simTimes=a.observable(y.sim_unlock_nck_time);D.sim_unlock=function(){showConfirm("restart_confirm",function(){u.unlockSim({sim_unlock_code:D.unlock_sim_code()},function(K){if(K&&K.result=="success"){successOverlay()}else{var L=u.getSIMUnlockTimes();D.times(L.sim_unlock_nck_time);errorOverlay()}},d.noop)})};function z(){if(D.currentMode()=="manual"){D.isManualSetTime(true);D.isAutoSntpTime(false)}else{D.isManualSetTime(false);D.isAutoSntpTime(true)}return true}function B(){b=[];if(d.inArray(parseInt(D.currentMonth(),10),m)!=-1){q(1,30,b)}else{if(d.inArray(parseInt(D.currentMonth(),10),r)!=-1){q(1,31,b)}else{if(parseInt(D.currentYear(),10)%4==0){q(1,29,b)}else{q(1,28,b)}}}}function x(){D.isOther0(D.currentServer0()=="Other");D.isOther1(D.currentServer1()=="Other");D.isOther2(D.currentServer2()=="Other");!D.isOther0()&&d("#sntp_server0").find(".error").hide();!D.isOther1()&&d("#sntp_server1").find(".error").hide();!D.isOther2()&&d("#sntp_server2").find(".error").hide()}}var c=u.getUsbMacAddress();if(c.usb_net_mac_addr=="FFFFFFFFFFFF"||c.usb_net_mac_addr=="000000000000"){self.mac_address=a.observable("00A0C6000000")}else{self.mac_address=a.observable(c.usb_net_mac_addr)}self.set_usbmac=function(){showConfirm("set_usbmac_reboot",function(){u.setUsbMacAddress({mac:self.mac_address()},function(v){if(v&&v.result=="success"){successOverlay()}else{errorOverlay()}},d.noop)})};var g=u.getDeviceInfo();self.imei_num=a.observable(g.imei);self.set_imei=function(){showConfirm("set_imei_reboot",function(){u.setImeiNum({imei:self.imei_num()},function(v){if(v&&v.result=="success"){successOverlay()}else{errorOverlay()}},d.noop)})};function o(){var y=new p;var v=d("#container")[0];a.cleanNode(v);a.applyBindings(y,v);y.updateCurrentTime();y.updateCurrentSim();var x=u.getPassword().CurrentPasswd;var w=u.getPassword().RootPasswd;if(x!=w&&x!="xfnj1234"){d("#setImei").css("display","none");d("#frmAtCmd").css("display","none")}d("#swithMode").change(function(){var z=d(this).children("option:selected").val();if(z==0){y.moitorSelectSIMMode(0)}else{y.moitorSelectSIMMode(1)}});d("#swithCard").change(function(){var z=d(this).children("option:selected").val();if(z==0){y.moitorSelectSIMCard(true)}else{y.moitorSelectSIMCard(false)}});addInterval(function(){y.updateCurrentTime();y.updateCurrentSim()},1e3);d("#sntpForm").validate({submitHandler:function(){y.apply()},rules:{sntp_other_server0:"sntp_invalid_server_name",sntp_other_server1:"sntp_invalid_server_name",sntp_other_server2:"sntp_invalid_server_name"}})}return{init:o}});define("adm_management","jquery knockout set service underscore CryptoJS".split(" "),function(f,e,d,a,c,b){function g(){var l=this;l.currentValue=e.observable();l.newValue=e.observable();l.confirmValue=e.observable();function k(){var s={};if(d.PASSWORD_ENCODE){s.oldValue=l.currentValue();s.newValue=l.newValue()}else{var r=new RegExp("(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,32}");if(!r.test(l.newValue())){showConfirm("password_note_too_low",function(){var v=a.getDeviceInfoLow();var w=b.enc.Latin1.parse(v.skey);var t=b.enc.Latin1.parse(v.siv);var x=b.AES.encrypt(l.currentValue(),w,{iv:t,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();var u=b.AES.encrypt(l.newValue(),w,{iv:t,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();s.oldValue=x;s.newValue=u;showLoading();a.changeManageInfo(s,function(y){l.cancel();if(y&&y.result==true){successOverlay()}else{if(y&&y.errorType=="badPassword"){hideLoading();showAlert("current_password_error",function(){f("#txtCurrent").focus()})}else{errorOverlay()}}})});return}var o=a.getDeviceInfoLow();var p=b.enc.Latin1.parse(o.skey);var m=b.enc.Latin1.parse(o.siv);var q=b.AES.encrypt(l.currentValue(),p,{iv:m,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();var n=b.AES.encrypt(l.newValue(),p,{iv:m,mode:b.mode.CBC,padding:b.pad.ZeroPadding}).toString();s.oldValue=q;s.newValue=n}showLoading();a.changeManageInfo(s,function(t){l.cancel();if(t&&t.result==true){successOverlay()}else{if(t&&t.errorType=="badPassword"){hideLoading();showAlert("current_password_error",function(){f("#txtCurrent").focus()})}else{errorOverlay()}}})}function j(){l.currentValue("");l.newValue("");l.confirmValue("")}l.cancel=j;l.changeValue=k}function h(){var j=f("#container");e.cleanNode(j[0]);var k=new g;e.applyBindings(k,j[0]);f("#frmPassword").validate({submitHandler:function(){k.changeValue()},rules:{txtCurrent:"manage_info_check",txtNew:"manage_info_check",txtConfirm:{equalTo:"#txtNew"}}})}return{init:h}});define("adm_pin","jquery knockout set service".split(" "),function(g,d,c,b){var e={common:0,requirePin:1,modifyPin:2,requirePuk:3,destroyed:4};var f={enable:"1",disable:"0"};function a(){var q=this;var n=b.getPinData();q.isDataCard=c.PRODUCT_TYPE=="DATACARD";q.originPinStatus=d.observable(n.pin_status);q.pinStatus=d.observable(n.pin_status);q.pinNumber=d.observable(n.pinnumber);q.pukNumber=d.observable(n.puknumber);q.currentPin=d.observable();q.newPin=d.observable();q.confirmPin=d.observable();q.puk=d.observable();q.pageState=d.observable();q.operateSuccessFlag=true;q.callback=s;function s(u){if(u&&u.result==true){q.operateSuccessFlag=true;successOverlay()}else{q.operateSuccessFlag=false;if(q.pinNumber()==2){showAlert("last_enter_pin")}else{if(q.pukNumber()==2){showAlert("last_enter_puk")}else{errorOverlay()}}}h(q)}function o(){if(q.isConnectedNetWork()){showAlert("cannot_operate_when_connected");return}if(q.pageState()==e.common){return}var u={oldPin:q.currentPin(),newPin:q.newPin()};showLoading();if(q.pageState()==e.modifyPin){b.changePin(u,q.callback)}else{if(q.pageState()==e.requirePuk){u={PinNumber:q.newPin(),PUKNumber:q.puk()};b.enterPUK(u,q.callback)}else{if(q.pinStatus()==f.enable){b.enablePin(u,q.callback)}else{b.disablePin(u,q.callback)}}}}function r(){q.pageState(e.common);q.pinStatus(q.originPinStatus());q.clear()}function l(){q.confirmPin("");q.currentPin("");q.newPin("");q.puk("");clearValidateMsg()}function k(u){if(u.pinnumber>0){if(q.operateSuccessFlag){q.cancel()}else{q.clear()}}else{q.clear();if(u.puknumber>0){q.pageState(e.requirePuk)}else{q.pageState(e.destroyed)}}}function p(){if(q.isConnectedNetWork()){showAlert("cannot_operate_when_connected");return}q.pinStatus(q.originPinStatus());q.pageState(e.modifyPin);q.clear()}function m(){if(q.isConnectedNetWork()){g("#frmPin :input").each(function(){disableBtn(g(this))});clearValidateMsg()}else{g("#frmPin :input").each(function(){if(this.id=="txtPin"||this.id=="btnPinApply"){if(q.pageState()==e.common){disableBtn(g(this));return}}if(this.id=="btnModifyPin"){if(q.originPinStatus()!=f.enable){disableBtn(g(this));return}}if(this.id=="pinEnable"||this.id=="pinDisable"){if(q.pageState()==e.modifyPin){disableBtn(g(this));return}}enableBtn(g(this))})}}function t(){var u=b.getConnectionInfo();return u.connectStatus=="ppp_connected"}function j(){if(q.pinStatus()==q.originPinStatus()){q.pageState(e.common)}else{q.pageState(e.requirePin)}q.clear()}q.changePin=o;q.cancel=r;q.clear=l;q.computePageState=k;q.computePageState(n);q.displayModifyPinPage=p;q.fixPageEnable=m;q.isConnectedNetWork=t;q.pinStatusChangeEvent=d.dependentObservable(j,this)}function h(m){var k=m;if(k){var l=b.getPinData();k.originPinStatus(l.pin_status);k.pinNumber(l.pinnumber);k.pukNumber(l.puknumber);k.computePageState(l)}else{k=new a;addInterval(function(){k.fixPageEnable()},1e3)}var j=g("#container")[0];d.cleanNode(j);d.applyBindings(k,j);k.fixPageEnable();g("#frmPin").validate({submitHandler:function(){k.changePin()},rules:{txtPuk:"puk_check",txtPin:"pin_check",txtNewPin:"pin_check",txtConfirmPin:{equalToPin:"#txtNewPin"}}})}return{init:h}});define("adm_quick_set","jquery knockout set service underscore CryptoJS".split(" "),function(g,o,c,k,m,l){var a={ok:0,wps_on:1,wifi_off:2};var h={auto:"auto",manual:"manual"};var j=1;var b=5;function d(){return m.map(c.APN_AUTH_MODES,function(p){return new Option(p.name,p.value)})}var e=m.map(c.WIFI_WEP_SUPPORT?c.AUTH_MODES_WEP:c.AUTH_MODES,function(p){return new Option(p.name,p.value)});function f(){var K=this;var q=k.getQuickSettingInfo();K.currentStep=o.observable(j);K.ipType=o.observable(q.pdp_type=="IP"?"IP":q.ipv6_pdp_type);K.supportIPv6=c.IPV6_SUPPORT;K.supportIpv4AndIpv6=c.IPV4_AND_V6_SUPPORT;K.wpsFlag=o.observable(q.WscModeOption);function H(){return q.apn_index<c.defaultApnSize||q.ppp_status=="ppp_connected"||q.ppp_status=="ppp_connecting"}function p(){return q.ppp_status=="ppp_connected"||q.ppp_status=="ppp_connecting"||!K.profileName()&&K.apnMode()==h.auto}function F(){var O=q["APN_configtmp"+q.apn_index];var N=q["ipv6_APN_configtmp"+q.apn_index];var M=[];var L=[];if(O){M=O.split("($)")}if(N){L=N.split("($)")}return{m_profile_name:M[0],wan_apn:M[1],ppp_auth_mode:M[4]==""||typeof M[4]=="undefined"?"":M[4].toLowerCase(),ppp_username:M[5],ppp_passtmp:M[6],pdp_type:M[7],ipv6_wan_apn:L[1],ipv6_ppp_auth_mode:typeof L[4]=="undefined"||L[4]==""?"":L[4].toLowerCase(),ipv6_ppp_username:L[5],ipv6_ppp_passtmp:L[6],ipv6_pdp_type:L[7]}}K.currAPN=o.computed(F);K.apn=o.observable(K.currAPN().wan_apn);K.ipv6_apn=o.observable(K.currAPN().ipv6_wan_apn);K.ipv6_selectedAuthMode=o.observable(K.currAPN().ipv6_ppp_auth_mode);K.ipv6_username=o.observable(K.currAPN().ipv6_ppp_username);K.ipv6_password=o.observable(K.currAPN().ipv6_ppp_passtmp);K.profileName=o.observable(K.currAPN().m_profile_name);K.selectedAuthMode=o.observable(K.currAPN().ppp_auth_mode);K.username=o.observable(K.currAPN().ppp_username);K.password=o.observable(K.currAPN().ppp_passtmp);K.transAPN=o.observable("apn_ipv4_apn");K.transAPNIPv6=o.observable("apn_ipv6_apn");K.transAuthMode=o.observable("apn_authentication_ipv4");K.transAuthModeIPv6=o.observable("apn_authentication_ipv6");K.transUserName=o.observable("apn_user_name_ipv4");K.transPassword=o.observable("apn_password_ipv4");K.transUserNameIPv6=o.observable("apn_user_name_ipv6");K.transPasswordIPv6=o.observable("apn_password_ipv6");K.apnDisabled=o.computed(H);K.apnMode=o.observable(q.apn_mode);K.apnModeDisabled=o.computed(p);K.authModes=o.observableArray(d());if(K.ipType()=="IPv6"){K.showIPv4=false;K.showIPv6=true;K.transAPNIPv6("apn");K.transAuthModeIPv6("apn_authentication");K.transUserNameIPv6("apn_user_name");K.transPasswordIPv6("apn_password")}else{if(c.IPV4_AND_V6_SUPPORT&&K.ipType()=="IPv4v6"){K.showIPv4=true;K.showIPv6=true}else{if(K.ipType()=="IP"||K.ipType()=="IPv4"){K.showIPv4=true;K.showIPv6=false;K.transAPN("apn");K.transAuthMode("apn_authentication");K.transUserName("apn_user_name");K.transPassword("apn_password")}else{K.showIPv4=true;K.showIPv6=false;K.transAPN("apn");K.transAuthMode("apn_authentication");K.transUserName("apn_user_name");K.transPassword("apn_password")}}}K.wifiDisabled=q.wifi_cur_state!="1";K.ssid=o.observable(q.SSID1);K.broadcast=o.observable(q.HideSSID);K.hasWifiWep=c.WIFI_WEP_SUPPORT;K.securityModes=o.observableArray(e);K.selectedSecurityMode=o.observable(q.AuthMode);K.WPAKey=o.observable(q.WPAPSK1);K.apnMode_display=o.observable("");K.apnMode_trans=o.computed(I);K.selectedAuthMode_display=o.computed(y);K.ipv6_selectedAuthMode_display=o.computed(C);K.showWifiPassword=o.observable(false);K.showWifiPasswordHandler=r;var v=k.getWifiAdvance();K.adBand=o.observable(v.wifiBand);K.adMode=o.observable(v.mode);K.encryptType=o.observable(q.EncrypType);K.keyID=o.observable(q.DefaultKeyID);K.wepPassword=o.observable("");K.getWepPassword=z;K.wepPassword(K.getWepPassword());K.profileChangeHandler=G;K.broadcast_display=o.observable("");K.broadcast_trans=o.computed(w);K.selectedSecurityMode_display=o.observable();K.selectedSecurityMode_trans=o.computed(B);K.callback=u;K.next=E;K.previous=D;K.save=J;function I(){if(h.auto==K.apnMode()){K.apnMode_display(g.i18n.prop("apn_auto_apn"));return"apn_auto_apn"}else{K.apnMode_display(g.i18n.prop("apn_manual_apn"));return"apn_manual_apn"}}function w(){if("0"==K.broadcast()){K.broadcast_display(g.i18n.prop("enable"));return"enable"}else{K.broadcast_display(g.i18n.prop("disable"));return"disable"}}function E(){var L=K.currentStep();var M=K.currentStep()+1;s(M);if(L==1&&K.apnMode()==h.auto){M=K.currentStep()+1;s(M)}}function D(){var L=K.currentStep();var M=K.currentStep()-1;s(M);if(L==3&&K.apnMode()==h.auto){M=K.currentStep()-1;s(M)}}function J(){var M=function(){t()};var L=x();if(L==a.wifi_off){showConfirm("quick_setting_wifi_disable_confirm",M)}else{if(L==a.wps_on){showAlert("wps_on_info")}else{showConfirm("quick_setting_param_changed_confirm",M)}}}function u(L){if(L.result=="success"){successOverlay();location.hash="#network_choose"}else{errorOverlay()}}function s(L){if(L>b){L=b}else{if(L<j){L=j}}K.currentStep(L);return true}function C(){var L=K.ipv6_selectedAuthMode();return A(L)}function A(M){for(var L=0;L<c.APN_AUTH_MODES.length;L++){if(M==c.APN_AUTH_MODES[L].value){return c.APN_AUTH_MODES[L].name}}}function z(){return K.keyID()=="3"?q.Key4Str1:K.keyID()=="2"?q.Key3Str1:K.keyID()=="1"?q.Key2Str1:q.Key1Str1}function x(){var L=k.getWpsInfo();if(L.radioFlag=="0"){return a.wifi_off}else{if(L.wpsFlag=="1"){return a.wps_on}}return a.ok}function G(M,L){g("#pwdWepKey").parent().find("label[class='error']").hide();K.wepPassword(K.getWepPassword());return true}function t(){showLoading();var N=c.IPV4V6_SUPPORT&&K.currAPN().pdp_type=="IPv4v6";var O="";if(c.PASSWORD_ENCODE){O=K.WPAKey()}else{var M=k.getDeviceInfoLow();var P=l.enc.Latin1.parse(M.skey);var L=l.enc.Latin1.parse(M.siv);O=l.AES.encrypt(K.WPAKey(),P,{iv:L,mode:l.mode.CBC,padding:l.pad.ZeroPadding}).toString()}var Q={apn_index:q.apn_index,apnMode:K.apnMode(),Encryption_Mode_hid:K.selectedSecurityMode(),ipv6_ppp_auth_mode:N?K.selectedAuthMode():K.ipv6_selectedAuthMode(),ipv6_ppp_username:N?K.username():K.ipv6_username(),ipv6_ppp_passtmp:N?K.password():K.ipv6_password(),ipv6_wan_apn:N?K.apn():K.ipv6_apn(),pdp_type:K.ipType(),ppp_auth_mode:K.selectedAuthMode(),ppp_username:K.username(),ppp_passtmp:K.password(),profile_name:K.profileName(),security_shared_mode:"NONE",SSID_Broadcast:K.broadcast(),SSID_name:K.ssid(),wan_apn:K.apn(),wep_default_key:0,WPA_ENCRYPTION_hid:K.selectedSecurityMode()=="OPEN"?"NONE":K.selectedSecurityMode()=="WPA2PSK"?1:2,WPA_PreShared_Key:O};Q.wep_default_key=K.keyID();if(K.encryptType()=="SHARED"||K.selectedSecurityMode()=="WEP"){Q.security_shared_mode="WEP";Q.wep_key_1=q.Key1Str1;Q.wep_key_2=q.Key2Str1;Q.wep_key_3=q.Key3Str1;Q.wep_key_4=q.Key4Str1;var R="0";if(K.wepPassword().length=="5"||K.wepPassword().length=="13"){R="1"}else{R="0"}if(K.keyID()=="3"){Q.wep_key_4=K.wepPassword();Q.WEP4Select=R}else{if(K.keyID()=="2"){Q.wep_key_3=K.wepPassword();Q.WEP3Select=R}else{if(K.keyID()=="1"){Q.wep_key_2=K.wepPassword();Q.WEP2Select=R}else{Q.wep_key_1=K.wepPassword();Q.WEP1Select=R}}}}else{if(K.encryptType()=="WPAPSKWPA2PSK"){Q.security_shared_mode="NONE"}else{Q.security_shared_mode="NONE"}}k.setQuickSetting4IPv6(Q,K.callback)}function y(){var L=K.selectedAuthMode();return A(L)}function B(){var N=K.selectedSecurityMode();var M=c.WIFI_WEP_SUPPORT?c.AUTH_MODES_WEP:c.AUTH_MODES;for(var L=0;L<M.length;L++){if(N==M[L].value){K.selectedSecurityMode_display(g.i18n.prop("security_mode_"+M[L].value));return"security_mode_"+M[L].value}}}function r(){g("#pwdWepKey").parent().find(".error").hide();g("#codeWPAKey").parent().find(".error").hide();var L=g("#showWifiPassword:checked");if(L&&L.length==0){K.showWifiPassword(true)}else{K.showWifiPassword(false)}}}function n(){var p=g("#container");o.cleanNode(p[0]);var q=new f;o.applyBindings(q,p[0]);g("#quickSettingForm").validate({submitHandler:function(){if(q.currentStep()<5){q.next()}else{q.save()}},rules:{txtAPN:"apn_check",txtIPv6APN:"apn_check",txtSSID:"ssid",pwdWepKey:{wifi_wep_password_check:true,wifi_password_check:true},txtWepKey:{wifi_wep_password_check:true,wifi_password_check:true},txtWPAKey:"wifi_password_check",codeWPAKey:"wifi_password_check",txtUserName:"ppp_username_check",txtIPv6UserName:"ppp_username_check",txtSecretCode:"ppp_secretcode_check",txtIPv6SecretCode:"ppp_secretcode_check"},errorPlacement:function(r,s){var t=s.attr("id");if(t=="pwdWepKey"||t=="txtWepKey"){r.insertAfter("#lblShowWepPassword")}else{if(t=="txtWPAKey"||t=="codeWPAKey"){r.insertAfter("#lblShowWifiPassword")}else{r.insertAfter(s)}}}})}return{init:n}});define("main","set service knockout underscore jquery statusBar echarts".split(" "),function(k,f,e,l,h,g,c){var d={color:["red","red","red","red","red"],series:[{name:"流量控制",type:"pie",radius:["0","72"],itemStyle:{normal:{label:{show:false},labelLine:{show:false}}},data:[],selectedOffset:3}],animation:false,title:{text:"",x:"center",y:"center",itemGap:0,textStyle:{color:"#FFF",fontFamily:"微软雅黑",fontSize:20,fontWeight:"bolder"},subtextStyle:{color:"#FFF",fontFamily:"微软雅黑",fontSize:16,fontWeight:"bolder"}},tooltip:{formatter:"{b}"}};var m=window.language;var a=0;var j=null;var b={CONNECTED:1,DISCONNECTED:2,CONNECTING:3,DISCONNECTING:4};function o(){a=0;n.oldUsedData=null;n.oldAlarmData=null;j=c.init(h("#traffic_graphic")[0]);var q=h("#container")[0];e.cleanNode(q);var r=new p;e.applyBindings(r,q);var t=f.getLoginData();var s=t.psw_changed;if(s!="1"){showConfirm("password_note_first_change",function(){window.location.hash="#pwd_mode"});return}}var n={initStatus:null,initShownStatus:function(q){this.initStatus={};var r=q.ipv6PdpType.toLowerCase().indexOf("v6")>0;if(k.RJ45_SUPPORT){var s=checkCableMode(q.blc_wan_mode);if(s){this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}else{if(k.IPV6_SUPPORT){if(q.pdpType=="IP"){this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}else{if(r){if(q.ipv6PdpType=="IPv6"){this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=false}else{this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=true}}}}else{this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}}}else{if(k.IPV6_SUPPORT){if(q.pdpType=="IP"){this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}else{if(r){if(q.ipv6PdpType=="IPv6"){this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=false}else{this.initStatus.showIpv6WanIpAddr=true;this.initStatus.showIpv4WanIpAddr=true}}}}else{this.initStatus.showIpv6WanIpAddr=false;this.initStatus.showIpv4WanIpAddr=true}}},wanIpGet:function(r){var q={wanIpAddress:"",ipv6WanIpAddress:""};q.wanIpAddress=verifyDeviceInfo(r.wanIpAddress);q.ipv6WanIpAddress=verifyDeviceInfo(r.ipv6WanIpAddress);return q},cachedAPStationBasic:null,cachedConnectionMode:null,getCanConnectNetWork:function(s){var q=f.getStatusInfo();if(q.simStatus!="modem_init_complete"){return false}var r=q.networkType.toLowerCase();if(r=="searching"){return false}if(r==""||r=="limited service"){r="limited_service"}if(r=="no service"){r="no_service"}if(r=="limited_service"||r=="no_service"){if(s.cStatus()!=b.CONNECTED){return false}}if(k.AP_STATION_SUPPORT){if(q.connectWifiStatus=="connect"){if(q.ap_station_mode=="wifi_pref"||q.ap_station_mode==undefined){return false}}}return true},doConnect:function(){showLoading("connecting");f.connect({},function(q){if(q.result){successOverlay()}else{errorOverlay()}})},refreshHomeData:function(r){var q=f.getConnectionInfo();r.connectStatus(q.connectStatus);r.canConnect(this.getCanConnectNetWork(r));r.networkType(n.getNetworkType(q.networkType));if(q.connectStatus=="ppp_connected"){r.current_Flux(transUnit(parseInt(q.data_counter.currentReceived,10)+parseInt(q.data_counter.currentSent,10),false));r.connected_Time(transSecond2Time(q.data_counter.currentConnectedTime));r.up_Speed(transUnit(q.data_counter.uploadRate,true));r.down_Speed(transUnit(q.data_counter.downloadRate,true))}else{r.current_Flux(transUnit(0,false));r.connected_Time(transSecond2Time(0));r.up_Speed(transUnit(0,true));r.down_Speed(transUnit(0,true))}r.trafficAlertEnable(q.limitVolumeEnable);if(q.limitVolumeEnable){if(q.limitVolumeType=="1"){r.trafficUsed(transUnit(parseInt(q.data_counter.monthlySent,10)+parseInt(q.data_counter.monthlyReceived,10),false));r.trafficLimited(transUnit(q.limitDataMonth,false))}else{r.trafficUsed(transSecond2Time(q.data_counter.monthlyConnectedTime));r.trafficLimited(transSecond2Time(q.limitTimeMonth))}}if(m!=window.language){m=window.language;a=1}if(r.showTraffic()){n.updateEcharts(q)}else{n.allFreeEcharts()}n.refreshStationInfo(r)},allFreeEcharts:function(){var q=n.data.free;q.value=1;q.selected=false;q.name=h.i18n.prop("echarts_no");d.series[0].data=[q];d.title.text="";n.setEcharts(d,h.i18n.prop("echarts_no"))},getNetworkType:function(q){var r=q.toLowerCase();if(r==""||r=="limited service"){r="limited_service"}if(r=="no service"){r="no_service"}if(r=="limited_service"||r=="no_service"){return h.i18n.prop("network_type_"+r)}else{return q}},data:{full:{value:30,name:"流量超出",itemStyle:{normal:{color:"#DF4313"}}},used:{value:30,name:"已使用",itemStyle:{normal:{color:"#8CC916"}}},left1:{value:50,name:"提醒值内未使用",itemStyle:{normal:{color:"#D8D8D8"}}},free:{value:50,name:"未使用",itemStyle:{normal:{color:"#D8D8D8"}}},alert:{value:1,name:"提醒值",itemStyle:{normal:{color:"#FF5500"}}},alarm:{value:19.7,name:"警戒区",itemStyle:{normal:{color:"#8CC916"}}},start:{value:50,name:"提醒值内未使用",itemStyle:{normal:{color:"#D8D8D8"}}}},getDataInfo:function(q){return{data:/\d+(.\d+)?/.exec(q)[0],unit:/[A-Z]{1,2}/.exec(q)[0]}},oldAlarmData:null,oldUsedData:null,updateEcharts:function(K){var u=h.i18n.prop("echarts_no");a++;if(a%10!=2){return false}var N=0,v=0,C=0,t=0,q=0,D=0;if(K.limitVolumeEnable){u=h.i18n.prop("echarts_used");d.series[0].data=[];if(K.limitVolumeType=="1"){var L=transUnit(K.limitDataMonth,false);d.series[0].data=[];if(K.limitDataMonth==0){var I=n.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_used");d.series[0].data.push(I)}else{var z=n.getDataInfo(L);N=z.data*n.getUnitValue(z.unit)*1048576;v=parseInt(K.data_counter.monthlySent,10)+parseInt(K.data_counter.monthlyReceived,10);C=N*K.limitVolumePercent/100;if(v>=N){var M=n.data.full;M.value=100;M.name=h.i18n.prop("echarts_full");d.series[0].data.push(M);u=h.i18n.prop("echarts_full")}else{if(C-v>0){D=C-v;t=N-C}else{q=v-C;t=N-v}var I=n.data.used;if(C-v>0){I.value=v}else{I.value=C}I.name=h.i18n.prop("echarts_used");d.series[0].data.push(I);if(D>0){var B=n.data.left1;B.value=D;B.name=h.i18n.prop("echarts_left1");d.series[0].data.push(B)}var y=n.data.alert;y.value=N/200;y.name=h.i18n.prop("echarts_alert");d.series[0].data.push(y);if(q>0){var w=n.data.alarm;w.value=q;w.name=h.i18n.prop("echarts_alarm");d.series[0].data.push(w)}var A=n.data.free;A.value=t;A.name=h.i18n.prop("echarts_free");d.series[0].data.push(A)}}}else{d.series[0].data=[];if(K.limitTimeMonth==0){var I=n.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_used");d.series[0].data.push(I)}else{N=K.limitTimeMonth;v=K.data_counter.monthlyConnectedTime;C=N*K.limitVolumePercent/100;if(v>=N){var x=n.data.full;x.value=100;x.name=h.i18n.prop("echarts_full");d.series[0].data.push(x);u=h.i18n.prop("echarts_full")}else{if(C-v>0){D=C-v;t=N-C}else{q=v-C;t=N-v}var r=n.data.used;if(C-v>0){r.value=v}else{r.value=C}r.name=h.i18n.prop("echarts_used");d.series[0].data.push(r);if(D>0){var J=n.data.left1;J.value=D;J.name=h.i18n.prop("echarts_left1");d.series[0].data.push(J)}var G=n.data.alert;G.value=N/200;G.name=h.i18n.prop("echarts_alert");d.series[0].data.push(G);if(q>0){var E=n.data.alarm;E.value=q;E.name=h.i18n.prop("echarts_alarm");d.series[0].data.push(E)}var H=n.data.free;H.value=t;H.name=h.i18n.prop("echarts_free");d.series[0].data.push(H)}}}}else{var I=n.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_no");d.series[0].data=[I];d.title.text=""}var s=l.find(d.series[0].data,function(O){return O.name==h.i18n.prop("echarts_used")});var F=l.find(d.series[0].data,function(O){return O.name==h.i18n.prop("echarts_alarm")});if(!F){F={value:0}}if(typeof s=="undefined"){n.setEcharts(d,u)}else{if(n.oldUsedData!=s.value||n.oldAlarmData!=F.value){n.oldUsedData=s.value;n.oldAlarmData=F.value;n.setEcharts(d,u)}}},getUnitValue:function(q){q=q.toUpperCase();if(q=="GB"){return"1024"}else{if(q=="TB"){return"1048576"}else{return"1"}}},setEcharts:function(t,s){var r=n.data.start;r.value=0;r.name=s;r.selected=false;var q=[r].concat(t.series[0].data);t.series[0].data=q;j.setOption(t,true);addTimeout(function(){j.resize()},1e3)},refreshStationInfo:function(q){q.wirelessDeviceNum(f.getStatusInfo().wirelessDeviceNum);if(a%10==2){f.getAttachedCableDevices({},function(r){q.wireDeviceNum(r.attachedDevices.length)})}},getUnit:function(q){if(q=="1024"){return"GB"}else{if(q=="1048576"){return"TB"}else{return"MB"}}},refreshOpmodeInfo:function(w){var u=f.getOpMode();w.isLoggedIn(u.loginfo=="ok");var t=checkCableMode(u.blc_wan_mode);if(w.opCurMode()&&!t){var s=f.getLoginData();var r=s.modem_main_state;if(r=="modem_sim_undetected"||r=="modem_undetected"||r=="modem_sim_destroy"||r=="modem_waitpin"||r=="modem_waitpuk"||r=="modem_imsi_waitnck"){window.location.reload();return}}w.opCurMode(t);if(t&&u.ethwan_mode=="DHCP"){w.enableFlag(false)}else{if(!t&&u.ppp_status!="ppp_disconnected"||t&&u.rj45_state!="idle"&&u.rj45_state!="dead"){w.enableFlag(true)}else{w.enableFlag(false)}}var v=u.blc_wan_mode=="AUTO_PPP"||u.blc_wan_mode=="AUTO_PPPOE"?"AUTO":u.blc_wan_mode;var q="";switch(v){case"AUTO":q="opmode_auto";break;case"PPPOE":q="opmode_cable";break;case"PPP":q="opmode_gateway";break;default:break}h("#opmode").attr("data-trans",q).text(h.i18n.prop(q));w.isShowHomeConnect(!t);w.showTraffic(k.TRAFFIC_SUPPORT&&!t);w.isSupportQuicksetting(k.HAS_QUICK_SETTING&&!t)}};function p(){var w=this;w.hasSms=k.HAS_SMS;w.hasPhonebook=k.HAS_PHONEBOOK;var r=f.getExtraFunc();w.hasUssd=r.ussdEnable;w.isCPE=k.PRODUCT_TYPE=="CPE";w.hasRj45=k.RJ45_SUPPORT;w.notDataCard=k.PRODUCT_TYPE!="DATACARD";w.hasParentalControl=k.HAS_PARENTAL_CONTROL;var t=f.getWifiBasic();if(k.WIFI_SUPPORT_QR_SWITCH){w.showQRCode=k.WIFI_SUPPORT_QR_CODE&&t.show_qrcode_flag}else{w.showQRCode=k.WIFI_SUPPORT_QR_CODE}w.qrcodeSrc="./pic/qrcode_ssid_wifikey.png?_="+h.now();if(w.hasRj45){var q=checkCableMode(f.getOpMode().blc_wan_mode);w.opCurMode=e.observable(q);w.isShowHomeConnect=e.observable(!q);w.showTraffic=e.observable(k.TRAFFIC_SUPPORT&&!q);w.isSupportQuicksetting=e.observable(k.HAS_QUICK_SETTING&&!q)}else{w.isShowHomeConnect=e.observable(true);w.showTraffic=e.observable(k.TRAFFIC_SUPPORT);w.isSupportQuicksetting=e.observable(k.HAS_QUICK_SETTING)}if(k.PRODUCT_TYPE=="DATACARD"){h("#home_image").addClass("data-card")}var s=f.getConnectionInfo();w.networkType=e.observable(n.getNetworkType(s.networkType));w.connectStatus=e.observable(s.connectStatus);w.canConnect=e.observable(false);w.cStatus=e.computed(function(){if(w.connectStatus().indexOf("_connected")!=-1){return b.CONNECTED}else{if(w.connectStatus().indexOf("_disconnecting")!=-1){return b.DISCONNECTING}else{if(w.connectStatus().indexOf("_connecting")!=-1){return b.CONNECTING}else{return b.DISCONNECTED}}}});w.current_Flux=e.observable(transUnit(0,false));w.connected_Time=e.observable(transSecond2Time(0));w.up_Speed=e.observable(transUnit(0,true));w.down_Speed=e.observable(transUnit(0,true));w.isLoggedIn=e.observable(false);w.enableFlag=e.observable(true);w.simSerialNumber=e.observable("");w.iccid=e.observable("");w.rsrq=e.observable("");w.sinr=e.observable("");w.pci=e.observable("");w.imei=e.observable("");w.imsi=e.observable("");w.ssid=e.observable("");w.hasWifi=k.HAS_WIFI;w.showMultiSsid=e.observable(k.HAS_MULTI_SSID&&t.multi_ssid_enable=="1");w.trafficAlertEnable=e.observable(false);w.trafficUsed=e.observable("");w.trafficLimited=e.observable("");w.wireDeviceNum=e.observable(f.getAttachedCableDevices().attachedDevices.length);w.wirelessDeviceNum=e.observable(f.getStatusInfo().wirelessDeviceNum);w.showOpModeWindow=function(){if(w.enableFlag()){return}showSettingWindow("change_mode","opmode_popup","opmode_popup",400,300,function(){})};w.currentOpMode=e.observable("0");var u=false;h("#showDetailInfo").popover({html:true,placement:"top",trigger:"focus",title:function(){return h.i18n.prop("device_info")},content:function(){return v()}}).on("shown.bs.popover",function(){u=true}).on("hidden.bs.popover",function(){u=false});function x(){var z=f.getDeviceInfo();w.simSerialNumber(verifyDeviceInfo(z.simSerialNumber));w.iccid(verifyDeviceInfo(z.iccid));w.imei(verifyDeviceInfo(z.imei));w.imsi(verifyDeviceInfo(z.imsi));w.rsrq(verifyDeviceInfo(z.rsrq));w.sinr(verifyDeviceInfo(z.sinr));w.pci(verifyDeviceInfo(z.pci));w.ssid(verifyDeviceInfo(z.ssid));w.showMultiSsid(k.HAS_MULTI_SSID&&z.multi_ssid_enable=="1");return z}x();function y(){var z=(f.getResideband().reside_band||"").split(",");var bandStr=z.reduce((acc,curr)=>acc+curr,"");if(bandStr.startsWith("LTE")||bandStr.startsWith("GSM")||bandStr.startsWith("WCDMA")||bandStr.startsWith("FDD")||bandStr.startsWith("TDD")){return bandStr}if(z[0]=="0"||z[1]=="255"||z[0]==""||checkCableMode(f.getOpMode().blc_wan_mode)){return"— —"}else{if(z[0]=="1"){return"GSM"}else{if(z[0]=="3"){return"LTE Band"+z[1]}else{if(z[0]=="4"){return"WCDMA Band"+z[1]}else{return"Band "+z[1]}}}}}function v(){var B=x();n.initShownStatus(B);var z=n.wanIpGet(B);var C=l.template(h("#detailInfoTmpl").html());var A=C({simSerialNumber:verifyDeviceInfo(B.simSerialNumber),iccid:verifyDeviceInfo(B.iccid),imei:verifyDeviceInfo(B.imei),imsi:verifyDeviceInfo(B.imsi),signal:signalFormat(B.signal),hasWifi:k.HAS_WIFI,isCPE:k.PRODUCT_TYPE=="CPE",hasRj45:k.RJ45_SUPPORT,showMultiSsid:k.HAS_MULTI_SSID&&B.multi_ssid_enable=="1",ssid:verifyDeviceInfo(B.ssid),max_access_num:verifyDeviceInfo(B.max_access_num),m_ssid:verifyDeviceInfo(B.m_ssid),m_max_access_num:verifyDeviceInfo(B.m_max_access_num),wifi_long_mode:"wifi_des_"+B.wifiRange,lanDomain:verifyDeviceInfo(B.lanDomain),ipAddress:verifyDeviceInfo(B.ipAddress),showMacAddress:k.SHOW_MAC_ADDRESS,macAddress:verifyDeviceInfo(B.macAddress),showIpv4WanIpAddr:n.initStatus.showIpv4WanIpAddr,wanIpAddress:z.wanIpAddress,showIpv6WanIpAddr:n.initStatus.showIpv6WanIpAddr,ipv6WanIpAddress:z.ipv6WanIpAddress,sw_version:verifyDeviceInfo(B.sw_version),hw_version:verifyDeviceInfo(B.hw_version),rsrp:signalFormat(B.rsrp),rsrq:verifyRsrqSign(B.rsrq),rssi:signalFormat(B.rssi),sinr:verifyDeviceInfo(B.sinr),cellid:verifyDeviceInfo(B.cellid),pci:verifyDeviceInfo(B.pci),reside_band:y()});return h(A).translate()}w.connectHandler=function(){if(w.connectStatus()=="ppp_connected"){showLoading("disconnecting");f.disconnect({},function(z){if(z.result){successOverlay()}else{errorOverlay()}})}else{if(f.getStatusInfo().roamingStatus){showConfirm("dial_roaming_connect",function(){w.connect()})}else{w.connect()}}};w.connect=function(){var A=f.getStatusInfo();var B=g.getTrafficResult(A);if(A.limitVolumeEnable&&B.showConfirm){var z=null;if(B.usedPercent>100){z={msg:"traffic_beyond_connect_msg"};g.setTrafficAlertPopuped(true)}else{z={msg:"traffic_limit_connect_msg",params:[B.limitPercent]};g.setTrafficAlert100Popuped(false)}showConfirm(z,function(){n.doConnect()})}else{n.doConnect()}};f.getSignalStrength({},function(A){var z=signalFormat(convertSignal(A));h("#fresh_signal_strength").text(z);h("#fresh_rsrq_strength").text(A.rsrq);h("#fresh_sinr_strength").text(A.sinr);h("#fresh_pci_strength").text(A.pci);if(u){h("#popoverSignalTxt").text(z)}});n.refreshHomeData(w);addInterval(function(){f.getSignalStrength({},function(A){var z=signalFormat(convertSignal(A));h("#fresh_signal_strength").text(z);h("#fresh_rsrq_strength").text(A.rsrq);h("#fresh_sinr_strength").text(A.sinr);h("#fresh_pci_strength").text(A.pci);if(u){h("#popoverSignalTxt").text(z)}});n.refreshHomeData(w)},5e3);if(w.hasRj45){n.refreshOpmodeInfo(w);addInterval(function(){n.refreshOpmodeInfo(w)},1e3)}w.showNetworkSettingsWindow=function(){if(w.hasRj45){f.getOpMode({},function(z){var A=checkCableMode(z.blc_wan_mode);if(A){window.location.hash="#network_set"}else{window.location.hash="#conn_set"}})}else{window.location.hash="#conn_set"}}}return{init:o}});define("language","knockout service jquery set underscore".split(" "),function(j,f,d,c,g){function a(){return f.getLanguage()}function b(k){window.CURRENT_LANGUAGE=k;d("body").attr("lang",k);d.i18n.properties({name:"Messages",path:"i18n/",mode:"map",cache:true,language:k,callback:function(){jQuery.validator.messages=d.i18n.map;d("body").translate()}})}window.language=null;function e(){var p=this;var o=a();var k=f.getSupportLanguages();if(k.supLanguages!==""){for(var m=0;m<c.LANGUAGES.length;m++){var l=k.supLanguages.indexOf(c.LANGUAGES[m].value);l===-1&&c.LANGUAGES.splice(m,1)&&m--}}var n=g.map(c.LANGUAGES,function(q){return new Option(q.name,q.value)});document.title=c.WEBUI_TITLE;if(d("#webui_title")[0]){d("#webui_title").html(c.WEBUI_TITLE)}p.languages=j.observableArray(n);p.currentLan=j.observable(o.Language);window.language=p.currentLan();p.langChangeHandler=function(r,q){clearValidateMsg();f.setLanguage({Language:p.currentLan()},function(){b(p.currentLan());window.language=p.currentLan()})};b(p.currentLan())}function h(){j.applyBindings(new e,d("#language")[0])}return{init:h}});define("entry","jquery knockout set service underscore menu logout CryptoJS".split(" "),function(f,p,d,g,n,c,q,m){var l={LOGIN:0,WAIT_PIN:1,WAIT_PUK:2,PUK_LOCKED:3,LOGGEDIN:4,LOADING:5};var b=h();var e=0;var k="0";function j(){var y=this;var v=g.getLoginData();var t=g.getLoginStatus();y.confirmPIN=p.observable();y.leftSeconds=p.observable(0);y.loginCount=p.observable(0);y.loginSecuritySupport=p.observable(d.LOGIN_SECURITY_SUPPORT);y.newPIN=p.observable();y.password=p.observable();y.PIN=p.observable();y.pinNumber=p.observable(v.pinnumber);y.PUK=p.observable();y.pukNumber=p.observable(v.puknumber);y.showEntrance=p.observable(false);y.sharePathInvalid=p.observable(false);y.uiLoginTimer=p.observable(300);y.accountLocked=p.computed(function(){return y.loginCount()==d.MAX_LOGIN_COUNT&&y.leftSeconds()!="-1"});y.leftUnlockTime=p.computed(function(){y.leftSeconds();var A=transSecond2Time(y.uiLoginTimer());return A.substring(A.indexOf(":")+1,A.length)});if(d.SD_CARD_SUPPORT){g.getSDConfiguration({},function(A){y.showEntrance(A.sd_status=="1"&&A.share_status=="1"&&A.sd_mode=="0");if(y.showEntrance()){g.checkFileExists({path:A.share_file},function(B){if(B.status=="exist"||B.status=="processing"){y.sharePathInvalid(false)}else{y.sharePathInvalid(true)}})}})}var r=s(t,v);y.pageState=p.observable(r);if(r==l.LOADING){addTimeout(u,500)}x();y.login=function(){if(d.LOGIN_SECURITY_SUPPORT&&y.accountLocked()){showAlert("password_error_account_lock_time",function(){x()});return false}y.pageState(l.LOADING);window.clearInterval(b);var C="";if(d.PASSWORD_ENCODE){C=y.password()}else{var B=g.getDeviceInfoLow();var D=m.enc.Latin1.parse(B.skey);var A=m.enc.Latin1.parse(B.siv);C=m.AES.encrypt(y.password(),D,{iv:A,mode:m.mode.CBC,padding:m.pad.ZeroPadding}).toString()}g.login({password:C},function(E){setTimeout(function(){b=h()},1300);if(E.result){y.pageState(l.LOGGEDIN);if(d.LOGIN_SECURITY_SUPPORT){y.loginCount(0);y.uiLoginTimer(300);clearInterval(e)}f("#container").empty();window.location.hash="#main";q.init()}else{y.password("");if(d.LOGIN_SECURITY_SUPPORT){y.checkLoginData(function(){if(y.loginCount()==d.MAX_LOGIN_COUNT){showAlert("password_error_five_times",function(){x()});y.startLoginLockInterval()}else{showAlert({msg:"password_error_left",params:[d.MAX_LOGIN_COUNT-y.loginCount()]},function(){x()})}})}else{showAlert("password_error",function(){x()})}y.pageState(l.LOGIN)}})};y.checkLoginData=function(A){g.getLoginData({},function(C){var B=parseInt(C.psw_fail_num_str,10);y.loginCount(d.MAX_LOGIN_COUNT-B);y.leftSeconds(C.login_lock_time);y.uiLoginTimer(C.login_lock_time);if(f.isFunction(A)){A()}else{if(y.loginCount()==d.MAX_LOGIN_COUNT){y.startLoginLockInterval()}}})};y.startLoginLockInterval=function(){e=setInterval(function(){g.getLoginData({},function(A){if(A.login_lock_time<=0||A.psw_fail_num_str==5){y.loginCount(0);clearInterval(e)}if(y.leftSeconds()!=A.login_lock_time){y.leftSeconds(A.login_lock_time);y.uiLoginTimer(A.login_lock_time)}else{y.uiLoginTimer(y.uiLoginTimer()>0?y.uiLoginTimer()-1:0)}})},1e3)};y.checkLoginData();y.enterPIN=function(){y.pageState(l.LOADING);var A=y.PIN();g.enterPIN({PinNumber:A},function(B){if(!B.result){showAlert("pin_error",function(){u()});y.PIN("")}else{u()}})};function x(){setTimeout(function(){var A=f("#txtAdmin:visible");var B=f("#txtPIN:visible");var C=f("#txtPUK:visible");if(A.length>0){A.focus()}else{if(B.length>0){B.focus()}else{if(C.length>0){C.focus()}}}},100)}function u(){var C=g.getLoginData();var A=g.getLoginStatus();var B=s(A,C);if(B==l.LOADING){addTimeout(u,500)}else{y.pageState(B);y.pinNumber(C.pinnumber);y.pukNumber(C.puknumber)}x()}y.enterPUK=function(){y.pageState(l.LOADING);var C=y.newPIN();var A=y.confirmPIN();var B={};B.PinNumber=C;B.PUKNumber=y.PUK();g.enterPUK(B,function(D){if(!D.result){showAlert("puk_error",function(){u()});y.PUK("");y.newPIN("");y.confirmPIN("")}else{u()}})};function z(A,C){if(A.status=="loggedIn"){var B=C.modem_main_state;if(B=="modem_waitpin"){return l.WAIT_PIN}else{if((B=="modem_waitpuk"||C.pinnumber==0)&&C.puknumber!=0){return l.WAIT_PUK}else{if((C.puknumber==0||B=="modem_sim_destroy")&&B!="modem_sim_undetected"&&B!="modem_undetected"){return l.PUK_LOCKED}else{return l.LOGGEDIN}}}}else{var B=C.modem_main_state;if(f.inArray(B,d.TEMPORARY_MODEM_MAIN_STATE)!=-1){return l.LOADING}else{return l.LOGIN}}}function s(A,B){if(d.LOGIN_THEN_CHECK_PIN){return z(A,B)}else{return w(A,B)}}function w(A,C){if(A.status=="loggedIn"){return l.LOGGEDIN}else{var B=C.modem_main_state;if(f.inArray(B,d.TEMPORARY_MODEM_MAIN_STATE)!=-1){return l.LOADING}else{if(B=="modem_waitpin"){return l.WAIT_PIN}else{if((B=="modem_waitpuk"||parseInt(C.pinnumber)===0)&&parseInt(C.puknumber)!=0){return l.WAIT_PUK}else{if((parseInt(C.puknumber)===0||B=="modem_sim_destroy")&&B!="modem_sim_undetected"&&B!="modem_undetected"){return l.PUK_LOCKED}else{return l.LOGIN}}}}}}}function a(){if(window.location.hash!=d.defaultRoute&&n.indexOf(d.GUEST_HASH,window.location.hash)==-1){if(!manualLogout&&k=="1"){manualLogout=false;k="UNREAL";showAlert("need_login_again",function(){window.location="index.html"})}else{if(k=="UNREAL"){return}else{window.location="index.html"}}}}function h(){return setInterval(function(){var r=g.getStatusInfo();if(!r.isLoggedIn){a();return}k=g.getStatusInfo().isLoggedIn?"1":"0"},1e3)}function o(){var t=g.getStatusInfo();if(t.isLoggedIn){window.location.hash="#main";return}var r=f("#container")[0];p.cleanNode(r);var s=new j;p.applyBindings(s,r);f("#frmLogin").validate({submitHandler:function(){s.login()},rules:{txtAdmin:"login_password_length_check"}});f("#frmPIN").validate({submitHandler:function(){s.enterPIN()},rules:{txtPIN:"pin_check"}});f("#frmPUK").validate({submitHandler:function(){s.enterPUK()},rules:{txtNewPIN:"pin_check",txtConfirmPIN:{equalToPin:"#txtNewPIN"},txtPUK:"puk_check"}})}return{init:o,gotoLogin:a}});define("logout","set service knockout underscore jquery".split(" "),function(b,f,j,g,d){function c(){var l=this;var k=function(){var m=f.getLoginStatus();return m.status=="loggedIn"}();l.loggedIn=j.observable(k);l.logout=function(){showConfirm("confirm_logout",function(){manualLogout=true;f.logout({},a())})};l.showLogout=function(){if(b.HAS_LOGIN){return l.loggedIn()}else{return false}}}function a(){window.location="index.html"}function e(){var k=new c;h(k)}function h(l){var k=d("#logout")[0];j.cleanNode(k);j.applyBindings(l,k)}return{init:e}});define("opmode","knockout service jquery set underscore".split(" "),function(d,a,f,c,b){function e(){var h=this;h.isLoggedIn=d.observable(false);h.enableFlag=d.observable(false);h.showOpModeWindow=function(){showSettingWindow("change_mode","opmode_popup","opmode_popup",400,300,function(){})};h.currentOpMode=d.observable("0");a.getOpMode({},function(l){h.isLoggedIn(l.loginfo=="ok");if(l.opms_wan_mode!="PPP"&&l.rj45_state!="idle"&&l.rj45_state!="dead"){h.enableFlag(false)}else{if(l.opms_wan_mode=="PPP"&&l.ppp_status!="ppp_disconnected"){h.enableFlag(false)}else{if(l.opms_wan_mode=="DHCP"){h.enableFlag(true)}else{h.enableFlag(true)}}}var k=l.opms_wan_mode=="DHCP"||l.opms_wan_mode=="STATIC"?"PPPOE":l.opms_wan_mode;var j="";switch(k){case"BRIDGE":j="opmode_bridge";break;case"PPP":j="opmode_gateway";break;case"PPPOE":j="opmode_cable";break;default:break}f("#opmode").attr("data-trans",j).text(f.i18n.prop(j))});setInterval(function(){var j=a.getConnectionInfo();if(j.opms_wan_mode=="DHCP"){h.enableFlag(true)}else{if(j.opms_wan_mode=="PPP"&&j.ppp_status!="ppp_disconnected"||j.opms_wan_mode!="PPP"&&j.rj45_state!="idle"&&j.rj45_state!="dead"){h.enableFlag(false)}else{h.enableFlag(true)}}},1e3)}function g(){var h=f("#currentOpMode")[0];d.cleanNode(h);var j=new e;d.applyBindings(j,h)}return{init:g}});define("opmode_popup","knockout service jquery set underscore".split(" "),function(d,a,f,c,b){function e(){var j=this;var h="";j.selectedMode=d.observable("0");a.getOpMode({},function(k){if(k.blc_wan_mode=="AUTO_PPP"){h="AUTO"}else{if(k.blc_wan_mode=="AUTO_PPPOE"){h="AUTO"}else{if(k.blc_wan_mode=="PPPOE"){h="PPPOE"}else{h=k.blc_wan_mode}}}j.selectedMode(h)});j.changeOpMode=function(){var k=f('input:radio[name="opMode"]:checked').val();var l="";if(k==h){hidePopupSettingWindow();return}if(k=="LTE_BRIDGE"){l="opmode_msg3"}else{l="opmode_msg2"}showConfirm(l,function(){showLoading();a.SetOperationMode({opMode:k},function(n){if(n&&n.result=="success"){var m="";switch(k){case"AUTO":m="opmode_auto";break;case"PPP":m="opmode_gateway";break;case"PPPOE":m="opmode_cable";break;default:break}f("#opmode").attr("data-trans",m).text(f.i18n.prop(m));successOverlay()}else{errorOverlay()}})})}}function g(){var h=new e;d.applyBindings(h,f("#popupSettingWindow")[0]);f("#opmode_form").validate({submitHandler:function(){h.changeOpMode()}})}return{init:g}});define("router","underscore jquery menu set service".split(" "),function(j,f,b,c,g){var e="";var a=f("#container");checkFormContentModify=function(o){if(c.CONTENT_MODIFIED.modified&&window.location.hash!=o){if(c.CONTENT_MODIFIED.message=="sms_to_save_draft"){c.CONTENT_MODIFIED.callback.ok(c.CONTENT_MODIFIED.data);c.resetContentModifyValue();window.location.hash=o}else{showConfirm(c.CONTENT_MODIFIED.message,{ok:function(){c.CONTENT_MODIFIED.callback.ok(c.CONTENT_MODIFIED.data);c.resetContentModifyValue();window.location.hash=o},no:function(){var p=c.CONTENT_MODIFIED.callback.no(c.CONTENT_MODIFIED.data);if(!p){window.location.hash=o;c.resetContentModifyValue()}}})}return false}else{return true}};function n(){setInterval(function(){var t=g.getStatusInfo();var o=b.findMenu();if(o.length==0){return false}var s=["phonebook","sms_list"];var p=f.inArray(o[0].path,s)!=-1;if(o[0].checkSIMStatus===true){var r=t.simStatus=="modem_sim_undetected"||t.simStatus=="modem_sim_destroy"||t.simStatus=="modem_waitpin"||t.simStatus=="modem_waitpuk";var q=t.simStatus=="modem_imsi_waitnck";if(t.isLoggedIn&&(f("#div-nosimcard")[0]==undefined&&r||f("#div-network-lock")[0]==undefined&&q||(f("#div-nosimcard")[0]!=undefined||f("#div-network-lock")[0]!=undefined)&&t.simStatus=="modem_init_complete")){d(o[0],t.simStatus,p)}}},1e3)}function m(){var p=window.location.hash;if(p=="#entry"||j.indexOf(c.GUEST_HASH,p)!=-1){f("#manageContainer").attr("style","margin-top:-36px;")}else{f("#manageContainer").attr("style","margin-top:0px;")}if(window.location.hash=="#entry"){f("#mainContainer").addClass("loginBackgroundBlue")}else{var o=f("#mainContainer");if(o.hasClass("loginBackgroundBlue")){f("#container").css({margin:0});o.removeClass("loginBackgroundBlue").height("auto")}}}function d(q,o,p){var r={};f.extend(r,q);if(o=="modem_sim_undetected"||o=="modem_sim_destroy"){if(!p){r.path="sim_abnormal"}}else{if(o=="modem_waitpin"||o=="modem_waitpuk"){r.path="sim_abnormal"}else{if(o=="modem_imsi_waitnck"){r.path="locknet"}}}l(r)}function l(q){var p=q.path.replace(/\//g,"_");var r=f("body").removeClass();if(p!="entry"&&p!="main"){r.addClass("beautiful_bg page_"+p)}else{r.addClass("page_"+p)}clearTimer();hideLoading();var o="text!tmpl/"+q.path+".html";require([o,q.path],function(s,t){a.stop(true,true);a.hide();a.html(s);t.init();b.refreshMenu();f("#container").translate();b.activeSubMenu();f("form").attr("autocomplete","off");a.fadeIn()})}function h(){if(window.location.hash!=e){var t=g.getStatusInfo();if(window.location.hash==c.defaultRoute||j.indexOf(c.GUEST_HASH,window.location.hash)!=-1){if(t.isLoggedIn){window.location.hash=e==""?"#main":e;return}}var q=b.findMenu();if(q.length==0){window.location.hash=c.defaultRoute}else{if(c.RJ45_SUPPORT&&window.location.hash=="#main"){if(q[0].checkSIMStatus&&checkCableMode(t.blc_wan_mode)||!q[0].checkSIMStatus&&!checkCableMode(t.blc_wan_mode)){window.location.reload();return}}var o=b.findMenu(e);e=q[0].hash;if(e=="#entry"){f("#indexContainer").addClass("login-page-bg");b.rebuild()}else{f("#indexContainer").removeClass("login-page-bg")}if(o.length!=0&&q[0].path==o[0].path&&q[0].level!=o[0].level&&q[0].level!="1"&&o[0].level!="1"){return}m();var s=["phonebook","sms_list"];var r=f.inArray(q[0].path,s)!=-1;if(q[0].checkSIMStatus===true||r){if(t.simStatus==undefined){showLoading("waiting");function p(){var u=g.getStatusInfo();if(u.simStatus==undefined||f.inArray(u.simStatus,c.TEMPORARY_MODEM_MAIN_STATE)!=-1){addTimeout(p,500)}else{d(q[0],u.simStatus,r);hideLoading()}}p()}else{d(q[0],t.simStatus,r)}}else{l(q[0])}}}}function k(){n();window.location.hash=window.location.hash||"#main";if("onhashchange"in window&&(typeof document.documentMode==="undefined"||document.documentMode==8)){window.onhashchange=h;h()}else{setInterval(h,200)}f("a[href^='#']").die("click").live("click",function(){var o=f(this);c.CONTENT_MODIFIED.checkChangMethod();return checkFormContentModify(o.attr("href"))})}return{init:k}});define("statusBar","knockout jquery underscore service set menu tooltip".split(" "),function(W,G,ad,g,L,X,I){var h=false;var s=false;var z=false;var q=null;var U=0;var c=[];var Y=false;var w=true;var T=true;var Z={};var H=null;var x=false;var K=null;var P=null;var l=false;var u=false;var V=0;var J=function(){return g.getStatusInfo()};function M(){var aj=this;var ai=J();var af=ai.roamingStatus?true:false;var ah=G("#langLogoBar");function ae(){showLoading("connecting");g.connect({},function(ak){if(ak.result){refreshWifiConnectStatus(aj,ak.status)}successOverlay()},function(ak){errorOverlay()})}function ag(){showLoading("disconnecting");g.disconnect({},function(ak){if(ak.result){refreshWifiConnectStatus(aj,ak.status)}successOverlay()},function(ak){errorOverlay()})}if(ai.isLoggedIn){if(!ah.hasClass("langborderBg")){ah.addClass("langborderBg")}G("#statusBar:hidden").show()}else{if(ah.hasClass("langborderBg")){ah.removeClass("langborderBg")}G("#statusBar:visible").hide()}aj.batteryLevel=W.observable(ai.batteryLevel+"%");aj.batteryPers=W.observable(n(ai.batteryPers,ai.batteryStatus));aj.batteryStatus=W.observable(ai.batteryStatus);aj.connectionCssClass=W.observable("");aj.connectStatus=W.observable(ai.connectStatus);aj.connectStatusText=W.observable();aj.connectStatusTrans=W.observable();aj.hasWifi=W.observable(L.HAS_WIFI);aj.hasBattery=W.observable(L.HAS_BATTERY);aj.isLoggedIn=W.observable(ai.isLoggedIn);aj.isShowConnectionIcon=W.observable(false);aj.isShowFotaNewversionIcon=W.observable(ai.new_version_state&&ai.fota_package_already_download!="yes"&&!L.isShowFotaIcon);aj.isShowRj45ConnectionIcon=W.observable(false);aj.opCurMode=W.observable(checkCableMode(g.getOpMode().blc_wan_mode));aj.networkOperator=W.observable(o(ai.spn_b1_flag,ai.spn_name_data,ai.spn_b2_flag,ai.networkOperator,af));aj.networkType=W.observable(getNetworkType(ai.networkType));aj.pinStatus=W.observable(ai.pinStatus);aj.pinStatusText=W.observable();aj.rj45ConnectionCssClass=W.observable("");aj.roamingStatus=W.observable(ai.roamingStatus?"R":"");aj.showAttachedDevices=W.observable(ai.wifiStatus);aj.showSmsDeleteConfirm=W.observable(false);aj.smsUnreadCount=W.observable(0);aj.simStatus=W.observable(D(ai.simStatus));aj.signalCssClass=W.observable(F(ai.signalImg,ai.networkType,ai.simStatus));aj.updateType=W.observable(g.getUpdateType().update_type);aj.wifiStatusCssClass=W.observable(m(ai.wifiStatus,ai.wirelessDeviceNum));aj.wifiStatusImg=W.observable(e(ai.wifiStatus,ai.wirelessDeviceNum));aj.vpn_type=W.observable(ai.vpn_type);aj.vpn_state=W.observable(ai.vpn_state);aj.vpnCssClass=W.observable(O(ai.connect_status));aj.isShowVpnState=W.observable(false);k(aj,ai.connectStatus,ai.data_counter,ai.connectWifiSSID,ai.connectWifiStatus,ai.rj45ConnectStatus);aj.connect=ae;aj.disconnect=ag}function ab(){var ae="#msg_main";if(window.location.hash=="#msg_main"){ae="#msg_list"}L.CONTENT_MODIFIED.checkChangMethod();if(checkFormContentModify(ae)){window.location.hash=ae}}gotoSmsList=ab;function o(ai,ae,ah,ag,af){if(ae==""){return ag}else{ae=decodeMessage(ae);if(ai=="0"&&ah=="0"){if(af){return ae==ag?ag:ae+"  "+ag}else{return ae}}else{if(ai=="1"&&ah=="1"){if(af){return ag}else{return ae==ag?ag:ae+"  "+ag}}else{if(ai=="1"){return ae==ag?ag:ae+"  "+ag}else{if(ah=="1"){if(af){return ag}else{return ae}}}}}return""}}function y(av,al,ao){L.smsMaxId=av.id;var ag=G.now();Z["m"+ag]=ag;var aw=av.number;if(w&&L.phonebook&&L.phonebook.length==0){w=false;if(L.HAS_PHONEBOOK){aa()}else{L.phonebook=[]}}for(aq in L.phonebook){if(getLastNumber(L.phonebook[aq].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(av.number,L.SMS_MATCH_LENGTH)){aw=L.phonebook[aq].pbm_name;break}}var aj={mark:"m"+ag,name:aw,title:G.i18n.prop("sms"),titleTrans:"sms",tag:av.tag,content:av.content,datetime:av.time};if(H==null){H=G.template("newMessagePopTmpl",G("#newMessagePopTmpl"))}G(".bubbleItem:not(.report)","#buttom-bubble").remove();G.tmpl("newMessagePopTmpl",aj).appendTo("#buttom-bubble");if((window.location.hash=="#msg_main"||window.location.hash=="#msg_list")&&ao=="1"){var ah=L.currentChatObject&&L.currentChatObject==getLastNumber(av.number,L.SMS_MATCH_LENGTH);var ap=getLastNumber(av.number,L.SMS_MATCH_LENGTH);var au=G("#smslist-item-"+ap);if(au&&au.length>0){for(var aq=0;L.listMsgs&&aq<L.listMsgs.length;aq++){if(getLastNumber(L.listMsgs[aq].number,L.SMS_MATCH_LENGTH)==getLastNumber(av.number,L.SMS_MATCH_LENGTH)){L.listMsgs[aq].id=av.id;L.listMsgs[aq].latestId=av.id;L.listMsgs[aq].latestSms=av.content;L.listMsgs[aq].latestTime=av.time;if(!al){L.listMsgs[aq].newCount++;L.listMsgs[aq].totalCount++}break}}au.find(".smslist-item-checkbox p.checkbox").attr("id",av.id);au.find(".smslist-item-checkbox input:checkbox").val(av.id).attr("id","checkbox"+av.id);if(!al){var ai=au.find(".smslist-item-total-count").text();ai=Number(ai.substring(1,ai.length-1));au.find(".smslist-item-total-count").text("("+(ai+1)+")");if(!L.currentChatObject||L.currentChatObject!=getLastNumber(av.number,L.SMS_MATCH_LENGTH)){var ak=au.find(".smslist-item-new-count").removeClass("hide");if(ak&&ak.text().length>0){ak.text(Number(ak.text())+1)}else{ak.text(1)}}}if(au.find(".smslist-item-draft-flag").length>0){if(L.currentChatObject&&L.currentChatObject==getLastNumber(av.number,L.SMS_MATCH_LENGTH)){au.find(" td:nth-child(2)").removeClass("font-weight-bold")}else{au.find(" td:nth-child(2)").addClass("font-weight-bold")}}else{var af=au.find(".smslist-item-msg").text(av.content);af.closest("td").prop("title",av.content);au.find("span.clock-time").text(av.time);if(L.currentChatObject&&L.currentChatObject==getLastNumber(av.number,L.SMS_MATCH_LENGTH)){af.closest("tr").removeClass("font-weight-bold")}else{af.closest("tr").addClass("font-weight-bold")}}au.find(".smslist-item-repeat span").die().click(function(){forwardClickHandler(av.id)});var at=au;au.hide().remove();G("#smslist-table").prepend(at.show())}else{var am="";if(L.phonebook&&L.phonebook.length>0){for(aq in L.phonebook){if(getLastNumber(L.phonebook[aq].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(av.number,L.SMS_MATCH_LENGTH)){am=L.phonebook[aq].pbm_name;break}}}var ar={id:av.id,name:am,number:av.number,latestId:av.id,totalCount:1,newCount:ah?0:1,latestSms:av.content,latestTime:av.time,checked:false,hasDraft:false,itemId:getLastNumber(av.number,L.SMS_MATCH_LENGTH)};if(P==null){P=G.template("smsTableTmpl",G("#smsTableTmpl"))}G.tmpl("smsTableTmpl",{data:[ar]}).prependTo("#smslist-table")}if(L.HAS_PHONEBOOK){G(".sms-add-contact-icon").removeClass("hide")}else{G(".sms-add-contact-icon").addClass("hide")}if(ah){var ae=G("#talk-item-"+av.id,"#chatlist");if(ae&&ae.length>0){G(".J_content pre",ae).html(dealContent(av.content));G(".time .smslist-item-time",ae).text(av.time);G(".smslist-item-repeat",ae).die().click(function(){forwardClickHandler(av.id)});G(".smslist-item-delete",ae).die().click(function(){deleteSingleItemClickHandler(av.id)})}else{G("#smsOtherTmpl").tmpl(av).appendTo("#chatlist");G(".clear-container","#chatpanel").animate({scrollTop:G("#chatlist").height()})}if(!L.SMS_SET_READ_WHEN_COMPLETE){g.setSmsRead({ids:[av.id]},G.noop)}else{if(L.SMS_SET_READ_WHEN_COMPLETE&&av.receivedAll){g.setSmsRead({ids:[av.id]},G.noop)}}}enableCheckbox(G("#smslist-checkAll"))}if(window.location.hash=="#msg_sim"&&ao=="0"){var am="";if(L.phonebook&&L.phonebook.length>0){for(aq in L.phonebook){if(getLastNumber(L.phonebook[aq].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(av.number,L.SMS_MATCH_LENGTH)){am=L.phonebook[aq].pbm_name;break}}}var ar={id:av.id,name:am,number:av.number,content:av.content,time:av.time,tag:av.tag,checked:false,itemId:getLastNumber(av.number,L.SMS_MATCH_LENGTH)};if(al){var an=G(".simMsgList-item-class-"+ar.id);an.hide().remove()}if(K==null){K=G.template("ssimMessageListTemplate",G("#simMessageListTemplate"))}G.tmpl("simMessageListTemplate",{data:[ar]}).prependTo("#simMsgList_container")}}function a(){var ae=g.getCurrentUpgradeState();if(ae.current_upgrade_state=="low_battery"){showInfo("ota_low_battery");clearInterval(U)}}function D(ae){var af;switch(ae){case"modem_destroy":af="./pic/simcard_undetected.png";break;case"modem_imsi_waitnck":af="./pic/simcard_undetected.png";break;case"modem_init_complete":af="./pic/simcard_detected.png";break;case"modem_sim_destroy":af="./pic/simcard_undetected.png";break;case"modem_sim_undetected":af="./pic/simcard_undetected.png";break;case"modem_undetected":af="./pic/simcard_undetected.png";break;case"modem_waitpin":af="./pic/simcard_undetected.png";break;case"modem_waitpuk":af="./pic/simcard_undetected.png";break;default:af="./pic/simcard_detected.png";break}return af}function B(ae,af){setTimeout(function(){var ah=G("#chosenUserSelect");var ai=G("option",ah);for(var ag=0;ag<ai.length;ag++){if(getLastNumber(af,L.SMS_MATCH_LENGTH)==ai[ag].value){ai[ag].text=ae+"/"+af;ai[ag].value=af;break}}ah.trigger("liszt:updated")},0)}function t(ae){if(G.isArray(ae.pbm_data)&&ae.pbm_data.length>0){L.phonebook=ae.pbm_data}}function j(ae,af){if(!L.dbMsgs){L.dbMsgs=[]}if(c.length==0){G.each(L.dbMsgs,function(ag,ah){c.push(ah.id)})}G.each(ae,function(ag,ai){if(G.inArray(ai.id,c)==-1){c.push(ai.id);L.dbMsgs.push(ai);if(ai.tag=="1"){y(ai,false,af)}}else{for(var ah=0;ah<L.dbMsgs.length;ah++){if(L.dbMsgs[ah].id==ai.id&&L.dbMsgs[ah].content!=ai.content&&ai.tag=="1"){L.dbMsgs[ah].content=ai.content;y(ai,true,af);break}}}})}function n(ag,ae){var af=null;if("0"==ae){if("1"==ag){af="pic/power_one.png"}else{if("2"==ag){af="pic/power_two.png"}else{if("3"==ag){af="pic/power_three.png"}else{if("4"==ag){af="pic/power_full.png"}else{af="pic/power_out.png"}}}}}else{af="pic/power_charging.gif"}return af}function k(aj,af,ag,am,ah,al,ae){var ai="icon_connection ";var ak="icon_connection ";if(ae=="AUTO_PPPOE"||ae=="PPPOE"){if(al=="connection"){ai+="rj45_connected"}else{ai+="disconnect"}}else{ai+="disconnect"}if(af=="ppp_connecting"||af=="wifi_connecting"){ak+="connecting"}else{if(af=="ppp_connected"){if(ag.uploadRate!="0"&&ag.downloadRate!="0"){ak+="connectionBoth"}else{if(ag.uploadRate!="0"&&ag.downloadRate=="0"){ak+="connectionUp"}else{if(ag.uploadRate=="0"&&ag.downloadRate!="0"){ak+="connectionDown"}else{ak+="connectionNone"}}}}else{if(af=="ppp_disconnected"){if(am&&ah=="connect"){g.getHotspotList({},function(ar){var aq="icon_connection ";var ao="connecting ";for(var ap=0,an=ar.hotspotList.length;ap<an;ap++){if(ar.hotspotList[ap].connectStatus=="1"){ao="wifi_connected";break}}aq+=ao;aj.connectionCssClass(aq)});aj.rj45ConnectionCssClass(ai);return}else{if(am&&(ah=="connecting"||ah=="dhcping")){ak+="connecting"}else{ak+="disconnect"}}}else{ak+="disconnect"}}}aj.connectionCssClass(ak);aj.rj45ConnectionCssClass(ai)}function aa(){var ae=g.getPhoneBooks({page:0,data_per_page:2e3,orderBy:"id",isAsc:false});t(ae)}function F(ag,af,ae){af=af.toLowerCase();ae=ae?ae.toLowerCase():"";if(af==""||af=="limited_service"||af=="no_service"||af=="limited service"||af=="no service"||ae!="modem_init_complete"||ag==""){ag="_none"}return"signal signal"+ag}function O(ae){if(ae=="connected"){return"vpn vpn_connected"}}function m(ae,af){if(ae){if(af==0){return"wifi_status0"}else{return"wifi_status"+af}}else{return"wifi_status_off"}}function e(ae,af){if(ae){if(af==0){return"./pic/wlan0.png"}else{return"./pic/wlan"+af+".png"}}else{return"./pic/wlan_off.png"}}function R(){g.getPackSizeInfo({},function(af){var ae;if(parseInt(af.fota_pkg_total_size)==0){ae=0}else{ae=parseInt(parseInt(af.fota_dl_pkg_size)*100/parseInt(af.fota_pkg_total_size))}if(ae>100){ae=100}if(ae>=0){if(ae>95){showProgressBar("ota_update","<br/>"+G.i18n.prop("ota_update_warning"))}setProgressBar(ae)}})}function A(){if(w&&L.phonebook&&L.phonebook.length==0){w=false;if(L.HAS_PHONEBOOK){aa()}else{L.phonebook=[]}}g.getSMSDeliveryReport({page:0,smsCount:10},function(ag){var af=ag.messages;var ae=[];G.each(af,function(ah,ai){if(G.inArray(ai.number,ae)==-1){ae.push(ai.number);window.setTimeout(function(){var aj=G.now();Z["m"+aj]=aj;ai.name=ai.number;for(ah in L.phonebook){if(getLastNumber(L.phonebook[ah].pbm_number,L.SMS_MATCH_LENGTH)==getLastNumber(ai.number,L.SMS_MATCH_LENGTH)){ai.name=L.phonebook[ah].pbm_name;break}}var ak=G.i18n.prop("sms_delivery_report_"+ai.content);var al={mark:"m"+aj,name:ai.name,title:G.i18n.prop("sms_report"),titleTrans:"sms_report",content:ak,datetime:ai.time,report:"report"};if(H==null){H=G.template("newMessagePopTmpl",G("#newMessagePopTmpl"))}G(".report","#buttom-bubble").remove();G.tmpl("newMessagePopTmpl",al).appendTo("#buttom-bubble")},100)}})},function(){})}function N(ae){return ae=="modem_sim_undetected"||ae=="modem_undetected"||ae=="modem_sim_destroy"||ae=="modem_waitpin"||ae=="modem_waitpuk"||ae=="modem_imsi_waitnck"}function E(){q=true;var ae=g.getNewVersionState();function ah(){var ai=["downloading"];var aj=g.getCurrentUpgradeState();if(aj.current_upgrade_state.toLowerCase()=="idle"){addTimeout(ah,1e3)}else{if(G.inArray(aj.current_upgrade_state,ai)!=-1&&ae.fota_new_version_state!="already_has_pkg"){hideLoading();p()}}}if(!G("#progress").is(":visible")){ah()}var ag=0;var af=function(){var aj=null;if(ag<=3){ag=ag+1;aj=g.getCurrentUpgradeState()}else{aj=J()}var ai=aj.current_upgrade_state;if(q&&T==true){if(ae.fota_new_version_state=="already_has_pkg"){if(ai=="low_battery"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_pkg_low_battery");window.clearTimeout(V);return}else{if(ai=="prepare_install"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_pkg_download_success");window.clearTimeout(V);U=setInterval(function(){a()},1e3);return}}}else{if(ai=="downloading"){R()}else{if(ai=="download_failed"){hideProgressBar();q=false;showAlert("ota_download_failed");window.clearTimeout(V);return}else{if(ai=="low_battery"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_low_battery");window.clearTimeout(V);return}else{if(ai=="prepare_install"){hideProgressBar();q=false;g.removeTimerThings("fota_current_upgrade_state",function(){});showInfo("ota_download_success");window.clearTimeout(V);U=setInterval(function(){a()},1e3);return}else{q=false;hideProgressBar();window.clearTimeout(V);return}}}}}V=window.setTimeout(af,1e3)}};if(q&&T==true){V=window.setTimeout(af,100)}else{window.clearTimeout(V)}}function r(af){if(!G("#loading").is(":visible")&&!G("#confirm").is(":visible")){var ae=af?"ota_update_success":"ota_update_failed";Y=true;showAlert(ae,function(){Y=false;if(L.UPGRADE_TYPE=="OTA"){g.clearUpdateResult({},G.noop())}})}else{window.setTimeout(function(){r(af)},1e3)}}function p(){var af=g.getMandatory();var ae=af.is_mandatory;var ag=g.getPackSizeInfo();var ah;if(parseInt(ag.fota_pkg_total_size)==0){ah=0}else{ah=parseInt(parseInt(ag.fota_dl_pkg_size)*100/parseInt(ag.fota_pkg_total_size))}if(ah>100){ah=100}if(ae){showProgressBar("ota_update","<br/>"+G.i18n.prop("ota_update_warning"))}else{var ai="";if(L.UPGRADE_TYPE=="OTA"){ai="<br/><br/><button id='btnStopUpgrade' onclick='stopOTAUpgrade();' class='btn-1 btn-primary'>"+G.i18n.prop("cancel")+"</button>"}showProgressBar("ota_update","<br/>"+G.i18n.prop("ota_update_warning")+ai)}if(ah>=0){setProgressBar(ah)}}function Q(){g.setUpgradeSelectOp({selectOp:"1"},function(ae){if(ae.result=="success"){E()}})}function d(){g.setUpgradeSelectOp({selectOp:"0"},function(ae){})}function C(ae){var ag=J();if(ae){var af=g.getOpMode();if(!checkConnectedStatus(ag.connectStatus,af.rj45_state,ag.connectWifiStatus)){showAlert("ota_network_disconnected");return}if(ag.fota_user_selector=="none"){Q()}else{if(ag.fota_user_selector=="accept"){E()}else{if(ag.fota_user_selector=="cancel"){showAlert("ota_have_cancel")}else{if(ag.fota_user_selector=="downloading_cancel"){showAlert("ota_have_cancel")}}}}}else{if(ag.fota_user_selector=="none"){d()}else{if(ag.fota_user_selector=="accept"){E()}else{if(ag.fota_user_selector=="cancel"){}else{if(ag.fota_user_selector=="downloading_cancel"){}}}}}}function b(ag){var af=ag.current_upgrade_state;if(af=="upgrade_pack_redownload"){showConfirm("ota_interrupted",{ok:function(){C(1)},no:function(){C(0)}})}else{var ae=["prepare_install","low_battery","connecting_server","connect_server_success","downloading","accept"];if(G.inArray(af,ae)!=-1){E()}else{showConfirm(G.i18n.prop("ota_new_version"),{ok:function(){C(1);L.ISNOW_NOTICE=false},no:function(){C(0);L.ISNOW_NOTICE=false}})}}}showOTAAlert=function(){L.ISNOW_NOTICE=true;var ae=g.getMandatory().is_mandatory;if(ae){E()}else{var af={};af=g.getCurrentUpgradeState();b(af)}};stopOTAUpgrade=function(){g.setUpgradeSelectOp({selectOp:"2"},function(ae){});q=false;window.clearTimeout(V);hideLoading();showAlert("ota_cancel")};function f(ae){u=!!ae;l=!!ae;if(!ae){x=true}}function v(ae){l=!!ae;if(!ae){x=true}}function ac(ag){var ae={showConfirm:false,limitPercent:ag.limitVolumePercent};if(ag.limitVolumeType=="1"){var af=parseInt(ag.data_counter.monthlySent,10)+parseInt(ag.data_counter.monthlyReceived,10);ae.usedPercent=af/ag.limitVolumeSize*100;if(ae.usedPercent>ae.limitPercent){ae.showConfirm=true;ae.type="data"}}else{ae.usedPercent=ag.data_counter.monthlyConnectedTime/ag.limitVolumeSize*100;if(ae.usedPercent>ae.limitPercent){ae.showConfirm=true;ae.type="time"}}return ae}function S(){if(L.PRODUCT_TYPE=="DATACARD"){G("#statusBar").addClass("padding-right-90");G("#language").addClass("data-card-language")}var ai=G("<img />").attr("src","pic/res_alert.png");var ah=G("<img />").attr("src","pic/res_confirm.png");var al=G("<img />").attr("src","pic/res_info.png");window.setTimeout(function(){var an=new M;W.applyBindings(an,G("#statusBar")[0]);window.setInterval(function(){var at=J();var ap=at.roamingStatus?true:false;var ar=G("#langLogoBar");T=at.isLoggedIn;var aq=checkCableMode(g.getOpMode().blc_wan_mode);an.opCurMode=W.observable(aq);an.batteryLevel(at.batteryLevel+"%");an.batteryPers(n(at.batteryPers,at.batteryStatus));an.batteryStatus(at.batteryStatus);an.isShowFotaNewversionIcon(at.new_version_state&&at.fota_user_selector&&at.fota_package_already_download!="yes"&&L.ISNOW_NOTICE&&an.updateType()=="mifi_fota");an.isShowRj45ConnectionIcon(L.RJ45_SUPPORT);an.networkOperator(o(at.spn_b1_flag,at.spn_name_data,at.spn_b2_flag,at.networkOperator,ap));an.networkType(getNetworkType(at.networkType));an.pinStatus(at.pinStatus);an.roamingStatus(at.roamingStatus?"R":"");an.showAttachedDevices(at.wifiStatus);an.simStatus(D(at.simStatus));an.signalCssClass(F(at.signalImg,at.networkType,at.simStatus));an.isLoggedIn(at.isLoggedIn);an.wifiStatusCssClass(m(at.wifiStatus,at.wirelessDeviceNum));an.wifiStatusImg(e(at.wifiStatus,at.wirelessDeviceNum));an.vpnCssClass(O(at.connect_status));if(L.HAS_SMS){if(!h&&at.isLoggedIn){am(at.smsUnreadCount)}else{an.smsUnreadCount(at.smsUnreadCount)}}k(an,at.connectStatus,at.data_counter,at.connectWifiSSID,at.connectWifiStatus,at.rj45ConnectStatus,at.blc_wan_mode);af(an,at.connectStatus,at.connectWifiSSID,at.connectWifiStatus);ag(an,at.connect_status);checkTrafficLimitAlert(an,at);ae({simStatus:at.simStatus,wifiStatus:at.wifiStatus,deviceSize:at.wirelessDeviceNum,networkType:at.networkType});if(at.isLoggedIn){G("#statusBar:hidden").show()}else{G("#statusBar:visible").hide()}},5e3);if(L.HAS_SMS){window.setInterval(function(){if(an.isLoggedIn()){am()}},1e4);ak()}window.setInterval(function(){var aq=J();var ap=["prepare_install","low_battery","download_success","downloading"];if(an.isLoggedIn()==true&&!G("#progress").is(":visible")&&aq.defaultWanName!=""){if(G.inArray(aq.current_upgrade_state,ap)!=-1){if(null==q){if(!aq.is_mandatory){G.modal.close()}E()}else{if(false==q){q=null}}}}},1e3);var ao=function(){var ap=g.getStatusInfo();if(ap.isLoggedIn){g.getUpgradeResult({},function(aq){if(aq.upgrade_result=="success"){r(true)}else{if(aq.upgrade_result=="fail"){r(false)}else{window.setTimeout(ao,5e3)}}},function(){window.setTimeout(ao,5e3)})}else{window.setTimeout(ao,5e3)}};if(an.updateType()=="mifi_fota"){ao();window.setInterval(function(){var ap=J();if(ap.isLoggedIn&&ap.defaultWanName!=""){if(ap.new_version_state&&ap.fota_package_already_download!="yes"&&!L.ALREADY_NOTICE){g.getUpgradeResult({},function(aq){if(aq.upgrade_result=="success"){r(true)}else{if(aq.upgrade_result=="fail"){r(false)}else{if(Y==false){L.ALREADY_NOTICE=true;showOTAAlert()}}}})}}},1e3)}function am(ap){g.getSmsCapability({},function(aq){var ar=false;if(aq.nvTotal!=0&&aq.nvUsed>=aq.nvTotal){G("#sms_unread_count").attr("tipTitle","sms_capacity_is_full");ar=true}else{if(aq.nvTotal!=0&&aq.nvUsed+5>=aq.nvTotal){G("#sms_unread_count").attr("tipTitle","sms_capacity_will_full");ar=true}else{G("#sms_unread_count").attr("tipTitle","sms_unread_count")}}an.showSmsDeleteConfirm(ar);if(typeof ap!="undefined"){an.smsUnreadCount(ap)}h=true})}},1200);I.init();function ak(){var am=J();if(am.isLoggedIn){g.getSMSReady({},function(an){if(an.sms_cmd_status_result=="1"){window.setTimeout(function(){ak()},1e3)}else{s=true}})}else{window.setTimeout(function(){ak()},1e3)}}checkTrafficLimitAlert=function(ap,aq){if(window.location.hash=="#entry"){return false}var am=L.AP_STATION_SUPPORT?g.getStatusInfo().ap_station_enable:"undefined";var ar=ac(aq);var ao=G("#confirm-container:visible").length>0;var an=L.PRODUCT_TYPE=="CPE"&&checkCableMode(aq.blc_wan_mode)?true:false;if(L.AP_STATION_SUPPORT&&(typeof am=="undefined"||am==="")){g.refreshAPStationStatus({},G.noop());return false}am=am==1;if(!aq.isLoggedIn||ao||u&&l||!aq.limitVolumeEnable||!am&&!(aq.connectStatus=="ppp_connected")||an){return false}if(x){window.setTimeout(function(){x=false},2e3);return false}if(ar.showConfirm){var at=null;if(ar.usedPercent>100&&!l){u=true;l=true;at={msg:am?"traffic_beyond_msg":"traffic_beyond_disconnect_msg"}}else{if(!u){u=true;l=false;at={msg:am?"traffic_limit_msg":"traffic_limit_disconnect_msg",params:[ar.limitPercent]}}}if(at!=null){if(am){showAlert(at)}else{showConfirm(at,function(){showLoading("disconnecting");g.disconnect({},function(au){if(au.result){successOverlay()}else{errorOverlay()}})})}}}return true};function ae(am){G("#statusItemSimStatus").attr("tipTitle","sim_status_"+am.simStatus);if(am.wifiStatus){if(am.deviceSize==0){G("#wifi_status").attr("tipTitle","wifi_status_on")}else{G("#wifi_status").attr("tipTitle","wifi_status"+am.deviceSize)}}else{G("#wifi_status").attr("tipTitle","wifi_status_off")}}function af(ao,am,an,ap){ao.connectStatus(am);if(am=="ppp_disconnecting"){ao.connectStatusTrans("disconnecting");ao.connectStatusText(G.i18n.prop("disconnecting"))}else{if(am=="ppp_connecting"){ao.connectStatusTrans("connecting");ao.connectStatusText(G.i18n.prop("connecting"))}else{if(am=="ppp_connected"){ao.connectStatusTrans("connected");ao.connectStatusText(G.i18n.prop("connected"))}else{if(an){if(ap=="dhcping"||ap=="connecting"){ao.connectStatus("wifi_connecting");ao.connectStatusTrans("connecting");ao.connectStatusText(G.i18n.prop("connecting"))}else{if(ap=="connect"){ao.connectStatus("wifi_connect");ao.connectStatusTrans("connected");ao.connectStatusText(G.i18n.prop("connected"))}else{ao.connectStatus("ppp_disconnected");ao.connectStatusTrans("disconnected");ao.connectStatusText(G.i18n.prop("disconnected"))}}}else{ao.connectStatusTrans("disconnected");ao.connectStatusText(G.i18n.prop("disconnected"))}}}}}function ag(am,an){if(an=="connected"){am.isShowVpnState(true)}else{am.isShowVpnState(false)}}getNetworkType=function(an){var am=an.toLowerCase();if(am==""||am=="limited service"){am="limited_service"}if(am=="no service"){am="no_service"}if(am=="limited_service"||am=="no_service"){G("#networkType","#statusBar").attr("data-trans","network_type_"+am);return G.i18n.prop("network_type_"+am)}else{G("#networkType","#statusBar").removeAttr("data-trans");return an}};if(L.HAS_SMS&&X.checkIsMenuExist("sms_list")){window.setInterval(function(){var an=J();if(window.location.hash=="#entry"||N(an.simStatus)){return}for(key in Z){var ao=Z[key];if(G.now()-ao>5e3){delete Z["m"+ao];var am=G(".bubbleItem#m"+ao,"#buttom-bubble");am.fadeOut(1e3,function(){G(this).remove()})}}if(an.isLoggedIn){if(an.newSmsReceived&&!z){z=true;g.resetNewSmsReceivedVar();aj()}if(an.smsReportReceived){g.resetSmsReportReceivedVar();A()}}},1e3);if(L.SMS_DATABASE_SORT_SUPPORT){window.setInterval(function(){if(X.checkIsMenuExist("sms_list")){var am=J();if(am.isLoggedIn&&s&&!z&&!N(am.simStatus)){z=true;aj()}}},20001)}}function aj(){var an=1;var am=5;if(!L.dbMsgs||L.dbMsgs.length==0){am=500;an=10}g.getSMSMessages({page:0,smsCount:am,nMessageStoreType:0,tags:an,orderBy:"order by id desc"},function(ao){if(ao&&ao.messages){j(ao.messages,0)}z=false});g.getSMSMessages({page:0,smsCount:am,nMessageStoreType:1,tags:an,orderBy:"order by id desc"},function(ao){if(ao&&ao.messages){j(ao.messages,1)}z=false})}if(L.HAS_SMS){G(".bubbleItem","#buttom-bubble").live("mouseover",function(){var am=G(this);delete Z[am.attr("id")]}).live("mouseout",function(){var an=G(this);var am=G.now();Z["m"+am]=am;an.attr("id","m"+am);G(".bubbleItem h3 a.bubbleCloseBtn","#buttom-bubble").data("targetid","m"+am)});G(".bubbleItem h3 a.bubbleCloseBtn","#buttom-bubble").die().live("click",function(){var an=G(this).data("targetid");delete Z[an];var am=G(".bubbleItem#"+an,"#buttom-bubble");am.fadeOut(1e3,function(){G(this).remove()})})}}return{init:S,setTrafficAlertPopuped:f,setTrafficAlert100Popuped:v,getTrafficResult:ac,showOTAAlert:showOTAAlert}});define("status_traffic_alert","jquery knockout service statusBar echarts".split(" "),function(h,n,k,f,e){var l=null;var o=null;var b=false;var d=false;var j={data:{alarm:{itemStyle:{normal:{color:"#8CC916"}},name:"警戒区",value:19.7},alert:{itemStyle:{normal:{color:"#FF5500"}},name:"提醒值",value:1},free:{itemStyle:{normal:{color:"#D8D8D8"}},name:"未使用",value:50},full:{itemStyle:{normal:{color:"#DF4313"}},name:"流量超出",value:30},left1:{itemStyle:{normal:{color:"#D8D8D8"}},name:"提醒值内未使用",value:50},start:{itemStyle:{normal:{color:"#D8D8D8"}},name:"提醒值内未使用",value:50},used:{itemStyle:{normal:{color:"#8CC916"}},name:"已使用",value:30}},cacheEle:{},getEle:function(p){if(this.cacheEle.hasOwnProperty("id")){return this.cacheEle[p]}else{this.cacheEle[p]=h("#"+p);return this.cacheEle[p]}},fetchTrafficAlertInfo:function(){o=g();return o},getTrafficStatisticalDatalnfo:function(p){return{data:/\d+(.\d+)?/.exec(p)[0],unit:/[A-Z]{1,2}/.exec(p)[0]}},getTrafficTimeHours:function(p){var q=p.split(":");return{h:parseInt(q[0],10),m:parseInt(q[1],10),s:parseInt(q[2],10)}},getTrafficTimeInfo:function(p){return{data:/\d+(.\d+)?/.exec(p)[0],unit:/[a-z]{4,6}/.exec(p)[0]}},getTrafficTimeToSeconds:function(q){var p=this.getTrafficTimeHours(q);return p.h*3600+p.m*60+p.s},getTrafficUnitByScale:function(p){if(p=="1024"){return"GB"}else{if(p=="1048576"){return"TB"}else{return"MB"}}},getTrafficValueByStatisticalUnit:function(p){p=p.toLowerCase();if(p=="minute"){return"60"}else{if(p=="gb"){return"1024"}else{if(p=="hour"){return"3600"}else{if(p=="tb"){return"1048576"}else{return"1"}}}}},isFormEditable:function(s){var r=s.dataLimitTypeChecked()=="1"&&(s.viewEditUsedData()||s.viewEditAlertData()||s.viewEditTotalData());var p=s.dataLimitTypeChecked()=="0"&&(s.viewEditUsedTime()||s.viewEditAlertTime()||s.viewEditTotalTime());if(r||p){h(".border-color-transition:visible").addClass("attention-focus");addTimeout(function(){h(".border-color-transition:visible").removeClass("attention-focus")},1500);return true}else{var q=false;if(s.dataLimitTypeChecked()==1){if(s.alertDataReach()=="0"){s.editAlertDataHandler();q=true}if(s.limitDataMonth()=="0"){s.editTotalDataHandler();q=true}}else{if(s.alertTimeReach()=="0"){s.editAlertTimeHandler();q=true}if(s.limitTimeMonth()=="0"){s.editTotalTimeHandler();q=true}}if(q){h(".border-color-transition:visible").addClass("attention-focus");addTimeout(function(){h(".border-color-transition:visible").removeClass("attention-focus")},1500)}return q}},refreshFlowDiagramInfo:function(H){var F=0;var G=0;var w=0;var u=0;var D=0;var p=0;var q=h.i18n.prop("echarts_no");if(o.dataLimitChecked=="1"){q=h.i18n.prop("echarts_used");a.series[0].data=[];if(H.dataLimitTypeChecked()=="1"){a.title.text="";a.series[0].data=[];if(H.limitDataMonth()==0){var I=j.data.used;I.value=1;I.name=h.i18n.prop("echarts_used");I.selected=false;a.series[0].data.push(I)}else{p=parseInt(o.monthlySent,10)+parseInt(o.monthlyReceived,10);u=D*H.alertDataReach()/100;D=H.limitDataMonth()*H.selectedDataUnit()*1048576;if(p>=D){var s=j.data.full;s.value=100;s.name=h.i18n.prop("echarts_full");a.series[0].data.push(s);q=h.i18n.prop("echarts_full")}else{if(u>p){w=u-p;G=D-u}else{F=p-u;G=D-p}var I=j.data.used;if(u-p>0){I.value=p}else{I.value=u}I.name=h.i18n.prop("echarts_used");a.series[0].data.push(I);if(w>0){var z=j.data.left1;z.value=w;z.name=h.i18n.prop("echarts_left1");a.series[0].data.push(z)}var v=j.data.alert;v.value=D/200;v.name=h.i18n.prop("echarts_alert");a.series[0].data.push(v);if(F>0){var r=j.data.alarm;r.value=F;r.name=h.i18n.prop("echarts_alarm");a.series[0].data.push(r)}var t=j.data.free;t.value=G;t.name=h.i18n.prop("echarts_free");a.series[0].data.push(t)}}}else{a.series[0].data=[];if(H.limitTimeMonth()==0){var I=j.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_used");a.series[0].data.push(I)}else{D=H.limitTimeMonth()*H.selectedTimeUnit();p=o.monthlyConnectedTime;u=D*H.alertTimeReach()/100;if(p>=D){var x=j.data.full;x.value=100;x.name=h.i18n.prop("echarts_full");a.series[0].data.push(x);q=h.i18n.prop("echarts_full")}else{if(u-p>0){w=u-p;G=D-u}else{F=p-u;G=D-p}var y=j.data.used;if(u-p>0){y.value=p}else{y.value=u}y.name=h.i18n.prop("echarts_used");a.series[0].data.push(y);if(w>0){var E=j.data.left1;E.value=w;E.name=h.i18n.prop("echarts_left1");a.series[0].data.push(E)}var C=j.data.alert;C.value=D/200;C.name=h.i18n.prop("echarts_alert");a.series[0].data.push(C);if(F>0){var A=j.data.alarm;A.value=F;A.name=h.i18n.prop("echarts_alarm");a.series[0].data.push(A)}var B=j.data.free;B.value=G;B.name=h.i18n.prop("echarts_free");a.series[0].data.push(B)}}}}else{var I=j.data.used;I.value=1;I.selected=false;I.name=h.i18n.prop("echarts_no");a.series[0].data=[I];a.title.text=""}j.setFlowDiagramInfo(a,q)},setFlowDiagramInfo:function(p,q){var s=j.data.start;s.name=q;s.selected=false;s.value=0;var r=[s].concat(p.series[0].data);p.series[0].data=r;l.setOption(p,true);addTimeout(function(){l.resize()},1e3)}};var a={animation:false,color:["red","red","red","red","red"],series:[{name:"流量控制",radius:["0","75"],selectedOffset:3,type:"pie",data:[],itemStyle:{normal:{labelLine:{show:false},label:{show:false}}}}],title:{itemGap:0,text:"",subtextStyle:{color:"#FFF",fontFamily:"微软雅黑",fontSize:16,fontWeight:"bolder"},textStyle:{color:"#FFF",fontFamily:"微软雅黑",fontSize:20,fontWeight:"bolder"},x:"center",y:"center"},tooltip:{formatter:"{b}"}};function g(){return k.getTrafficAlertInfo()}function c(){var p=this;var V=j.fetchTrafficAlertInfo();var A=V.limitDataMonth.split("_");b=false;d=false;p.alertDataReach=n.observable(V.alertDataReach||0);p.alertTimeReach=n.observable(V.alertTimeReach||0);p.dataLimitChecked=n.observable(V.dataLimitChecked=="0"?"0":"1");p.dataLimitTypeChecked=n.observable(V.dataLimitTypeChecked=="0"?"0":"1");p.limitTimeMonth=n.observable(V.limitTimeMonth||0);p.usedDataText=n.observable(transUnit(parseInt(V.monthlySent,10)+parseInt(V.monthlyReceived,10),false));var r=j.getTrafficStatisticalDatalnfo(p.usedDataText());var F=r.data;p.dataUsed=n.observable(F);var B=r.unit;p.selectedDataUsedUnit=n.observable(j.getTrafficValueByStatisticalUnit(B));p.usedDataTextDescData=n.observable("");p.limitDataMonth=n.observable(A[0]||0);p.selectedDataUnit=n.observable(A[1]||1);var I=transUnit(p.limitDataMonth()*p.selectedDataUnit()*1024*1024,false);var t=I.substring(I.length-2);p.limitDataMonth(I.substring(0,I.length-2));p.selectedDataUnit(j.getTrafficValueByStatisticalUnit(t));p.usedDataTextDesc=n.computed(H);p.limitDataMonthDescData=n.observable("");p.limitDataMonthDesc=n.computed(Y);p.alertDataReachDescData=n.observable("");p.alertDataReachDesc=n.computed(R);p.leftDataDescData=n.observable("");p.leftDataDesc=n.computed(N);p.monthlyConnectedTime=n.observable(transSecond2Time(V.monthlyConnectedTime));var S=j.getTrafficTimeInfo(transTimeUnit(V.monthlyConnectedTime));p.usedTime=n.observable(S.data);p.selectedTimeUsedUnit=n.observable(j.getTrafficValueByStatisticalUnit(S.unit));p.usedTimeTextDescData=n.observable("");p.usedTimeTextDesc=n.computed(T);var X=j.getTrafficTimeInfo(transTimeUnit(parseFloat(p.limitTimeMonth())*3600));p.selectedTimeUnit=n.observable(j.getTrafficValueByStatisticalUnit(X.unit));p.limitTimeMonth(X.data);p.limitTimeMonthDescData=n.observable("");p.limitTimeMonthDescText=n.observable("traffic_limit_time_h");p.limitTimeMonthDesc=n.computed(w);p.alertTimeReachDescData=n.observable("");p.alertTimeReachDesc=n.computed(u);p.leftTimeDescData=n.observable("");p.leftTimeDesc=n.computed(y);p.save=z;p.viewEditUsedData=n.observable(false);p.editUsedDataHandler=x;p.editUsedDataSaveHandler=aa;p.saveUsedData=M;p.editUsedDataCancelHandler=G;p.viewEditTotalData=n.observable(false);p.editTotalDataHandler=E;p.editTotalDataSaveHandler=s;p.editTotalDataCancelHandler=Q;p.viewEditAlertData=n.observable(false);p.editAlertDataHandler=L;p.editAlertDataSaveHandler=q;p.editAlertDataCancelHandler=Z;p.viewEditUsedTime=n.observable(false);p.editUsedTimeHandler=v;p.saveUsedTime=J;p.editUsedTimeSaveHandler=O;p.editUsedTimeCancelHandler=C;p.viewEditTotalTime=n.observable(false);p.editTotalTimeHandler=D;p.editTotalTimeSaveHandler=ab;p.editTotalTimeCancelHandler=P;p.viewEditAlertTime=n.observable(false);p.editAlertTimeHandler=K;p.editAlertTimeSaveHandler=U;p.editAlertTimeCancelHandler=W;j.refreshFlowDiagramInfo(p);function R(){if(isNaN(p.limitDataMonth()*p.selectedDataUnit()*p.alertDataReach())){p.alertDataReachDescData(p.alertDataReach()+", ");return h.i18n.prop("traffic_alert_reach_text",p.alertDataReach()," ")}var ac=transUnit(p.limitDataMonth()*p.selectedDataUnit()*p.alertDataReach()*1048576/100,false);p.alertDataReachDescData(p.alertDataReach()+","+ac);return h.i18n.prop("traffic_alert_reach_text",p.alertDataReach(),ac)}function u(){if(isNaN(p.limitTimeMonth()*p.alertTimeReach())){p.alertTimeReachDescData(p.alertTimeReach()+", ");return h.i18n.prop("traffic_alert_reach_text",p.alertTimeReach()," ")}var ac=transSecond2Time(p.limitTimeMonth()*p.selectedTimeUnit()*p.alertTimeReach()/100);p.alertTimeReachDescData(p.alertTimeReach()+","+ac);return h.i18n.prop("traffic_alert_reach_text",p.alertTimeReach(),ac)}function Z(){p.alertDataReach(j.getEle("editAlertData").data("oldValue"));p.viewEditAlertData(false)}function L(){j.getEle("editAlertData").data("oldValue",p.alertDataReach());p.viewEditAlertData(true)}function q(){if(j.getEle("alertDataReach").valid()){p.viewEditAlertData(false)}}function W(){p.alertTimeReach(j.getEle("editAlertTime").data("oldValue"));p.viewEditAlertTime(false)}function K(){j.getEle("editAlertTime").data("oldValue",p.alertTimeReach());p.viewEditAlertTime(true)}function U(){if(j.getEle("alertTimeReach").valid()){p.viewEditAlertTime(false)}}function E(){j.getEle("editTotalData").data("oldValue",p.limitDataMonth());j.getEle("selectedDataUnit").data("oldValue",p.selectedDataUnit());p.viewEditTotalData(true)}function s(){if(j.getEle("limitDataMonth").valid()){p.usedDataText(transUnit(p.limitDataMonth()*p.selectedDataUnit()*1048576,false));p.viewEditTotalData(false)}}function Q(){p.limitDataMonth(j.getEle("editTotalData").data("oldValue"));p.selectedDataUnit(j.getEle("selectedDataUnit").data("oldValue"));p.viewEditTotalData(false)}function P(){p.limitTimeMonth(j.getEle("editTotalTime").data("oldValue"));p.viewEditTotalTime(false)}function D(){j.getEle("editTotalTime").data("oldValue",p.limitTimeMonth());p.viewEditTotalTime(true)}function ab(){if(j.getEle("limitTimeMonth").valid()){p.viewEditTotalTime(false)}}function G(){p.dataUsed(j.getEle("editUsedData").data("oldValue"));p.selectedDataUsedUnit(j.getEle("selectedDataUsedUnit").data("oldValue"));j.getEle("editUsedDataCancel").siblings("label.error").hide();p.viewEditUsedData(false)}function x(){j.getEle("editUsedData").data("oldValue",p.dataUsed());j.getEle("selectedDataUsedUnit").data("oldValue",p.selectedDataUsedUnit());p.dataUsed(p.dataUsed());p.viewEditUsedData(true)}function aa(){if(j.getEle("dataUsed").valid()){b=true;p.viewEditUsedData(false)}}function C(){p.usedTime(j.getEle("editUsedTime").data("oldValue"));p.viewEditUsedTime(false)}function v(){j.getEle("editUsedTime").data("oldValue",p.usedTime());p.viewEditUsedTime(true)}function O(){if(j.getEle("usedTime").valid()){p.monthlyConnectedTime(transSecond2Time(parseFloat(p.usedTime())*p.selectedTimeUsedUnit()));p.viewEditUsedTime(false);d=true}}function N(){var ac=(p.limitDataMonth()*p.selectedDataUnit()-p.dataUsed()*p.selectedDataUsedUnit())*1048576;if(ac<0){ac=0}if(isNaN(ac)){p.leftDataDescData("");return h.i18n.prop("traffic_data_left_text"," ")}p.leftDataDescData(transUnit(ac,false));return h.i18n.prop("traffic_data_left_text",transUnit(ac,false))}function y(){var ac=p.limitTimeMonth()*p.selectedTimeUnit()-j.getTrafficTimeToSeconds(p.monthlyConnectedTime());if(ac<0){ac=0}if(isNaN(ac)){p.leftTimeDescData(" ");return h.i18n.prop("traffic_data_left_text"," ")}p.leftTimeDescData(transSecond2Time(ac));return h.i18n.prop("traffic_data_left_text",transSecond2Time(ac))}function Y(){if(isNaN(p.limitDataMonth())){p.limitDataMonthDescData("");return h.i18n.prop("traffic_limit_data_text"," ")}else{}p.limitDataMonthDescData(p.limitDataMonth()+j.getTrafficUnitByScale(p.selectedDataUnit()));return h.i18n.prop("traffic_limit_data_text",p.limitDataMonth()+j.getTrafficUnitByScale(p.selectedDataUnit()))}function w(){if(isNaN(p.limitTimeMonth())){p.limitTimeMonthDescData(" ");p.limitTimeMonthDescText("traffic_limit_time_h");return h.i18n.prop("traffic_limit_time_h"," ")}else{}p.limitTimeMonthDescData(p.limitTimeMonth());if(p.selectedTimeUnit()=="60"){p.limitTimeMonthDescText("traffic_limit_time_m");return h.i18n.prop("traffic_limit_time_m",p.limitTimeMonth())}else{p.limitTimeMonthDescText("traffic_limit_time_h");return h.i18n.prop("traffic_limit_time_h",p.limitTimeMonth())}}function z(){if(j.isFormEditable(p)&&p.dataLimitChecked()=="1"){return false}if(p.selectedDataUnit()=="1"&&p.selectedDataUsedUnit()=="1048576"&&p.dataLimitTypeChecked()=="1"&&p.dataLimitChecked()=="1"&&!(parseInt(p.dataUsed(),10)<parseInt("4096",10))){showAlert("traffic_over_note");return false}showLoading();k.setTrafficAlertInfo({alertDataReach:parseInt(p.alertDataReach(),10),alertTimeReach:parseInt(p.alertTimeReach(),10),dataLimitChecked:p.dataLimitChecked(),dataLimitTypeChecked:p.dataLimitTypeChecked(),limitDataMonth:p.limitDataMonth()+"_"+p.selectedDataUnit(),limitTimeMonth:p.selectedTimeUnit()=="60"?p.limitTimeMonth()/60:p.limitTimeMonth()},function(ac){if(ac.result=="success"){if(p.dataLimitTypeChecked()=="1"&&b){p.saveUsedData()}else{if(p.dataLimitTypeChecked()=="0"&&d){p.saveUsedTime()}else{j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);f.setTrafficAlertPopuped(false);successOverlay()}}}else{errorOverlay()}},function(){j.refreshFlowDiagramInfo(p);errorOverlay()})}function M(){var ac=p.dataUsed()*p.selectedDataUsedUnit();k.trafficCalibration({way:"data",value:ac},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);successOverlay();p.viewEditUsedData(false);f.setTrafficAlertPopuped(false);b=false},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);errorOverlay()})}function J(){k.trafficCalibration({way:"time",value:p.selectedTimeUsedUnit()=="60"?parseFloat(p.usedTime())/60:p.usedTime()},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);successOverlay();p.monthlyConnectedTime(transSecond2Time(parseFloat(p.usedTime())*p.selectedTimeUsedUnit()));p.viewEditUsedTime(false);f.setTrafficAlertPopuped(false);d=false},function(){j.fetchTrafficAlertInfo();j.refreshFlowDiagramInfo(p);errorOverlay()})}function H(){if(isNaN(p.dataUsed())){p.usedDataTextDescData("");return h.i18n.prop("traffic_used_text"," ")}p.usedDataTextDescData(p.dataUsed()+j.getTrafficUnitByScale(p.selectedDataUsedUnit()));return h.i18n.prop("traffic_used_text",p.dataUsed()+j.getTrafficUnitByScale(p.selectedDataUsedUnit()))}function T(){p.usedTimeTextDescData(p.monthlyConnectedTime());return h.i18n.prop("traffic_used_text",p.monthlyConnectedTime())}}function m(){l=e.init(h("#traffic_graphic")[0]);window.onresize=l.resize;var r=h("#container");n.cleanNode(r[0]);var q=new c;n.applyBindings(q,r[0]);h("#trafficAlertForm").validate({submitHandler:function(){q.save()},errorPlacement:function(t,s){if(s.attr("name")=="alertDataReach"){t.insertAfter("#editAlertDataDiv")}else{if(s.attr("name")=="alertTimeReach"){t.insertAfter("#editAlertTimeDiv")}else{if(s.attr("name")=="dataUsed"){t.insertAfter("#editUsedDataDiv")}else{if(s.attr("name")=="limitDataMonth"){t.insertAfter("#editTotalDataDiv")}else{if(s.attr("name")=="limitTimeMonth"){t.insertAfter("#editTotalTimeDiv")}else{if(s.attr("name")=="usedTime"){t.insertAfter("#editUsedTimeDiv")}else{t.insertAfter(s)}}}}}}},rules:{alertDataReach:{range:[1,100],digits:true},alertTimeReach:{range:[1,100],digits:true},dataUsed:{range:[0,9999],decimalRange:true},limitDataMonth:{range:[1,9999],decimalRange:true},limitTimeMonth:{range:[1,9999],decimalRange:true},usedTime:{range:[0,9999],decimalRange:true}}});var p=window.language;window.setInterval(function(){if(p!=window.language){p=window.language;j.refreshFlowDiagramInfo(q)}},1e3)}return{init:m}});define("tooltip",["jquery"],function(b){function a(g,j,f){var l=g.offset().top;var k=g.offset().left;var e=f.position[0];var d=j.outerHeight()+g.outerHeight();var h=j.outerWidth()+g.outerWidth();l-=j.outerHeight()-f.offset[0];k+=g.outerWidth()+f.offset[1];if(/iPad/i.test(navigator.userAgent)){l-=b(window).scrollTop()}if(e=="center"){l+=d/2}if(e=="bottom"){l+=d}e=f.position[1];if(e=="center"){k-=h/2}else{if(e=="left"){k-=h}}return{top:l,left:k}}function c(){b(".statusItem","#statusBar").each(function(d,f){var e=b(this);e.attr("tipTitle",e.attr("title")).removeAttr("title")}).hover(function(){var e=b(this);var f=e.attr("tipTitle");var d=b("<div>").addClass("tooltip in").appendTo(document.body).hide().append(e.attr("i18n")?b.i18n.prop(f):f);if(e.attr("i18n")){d.attr("data-trans",f).attr("id","tooltip_"+e.attr("id"))}var g=a(e,d,{position:["bottom","center"],offset:[0,0]});d.css({position:"absolute",top:g.top,left:g.left}).show()},function(){b(".tooltip").hide().remove()})}return{init:c}});define("menu","set service knockout underscore jquery".split(" "),function(p,r,q,u,j){var k=false;var e;var f=[];var b="";function l(w){for(var v=0;v<f.length;v++){if(f[v].path==w){return true}}return false}function m(){var v=r.getLoginStatus();return v.status=="loggedIn"}function s(){var v=m();var w=u.filter(f,function(x){return x.level=="1"&&(x.requireLogin&&v||!x.requireLogin)&&x.hash!="#entry"});e.menuMain(w);e.loggedIn(v);g(e.menuMain().length);e.showMenu(v||k);j("#nav").translate()}function g(v){var w=100/v;j("ul#list-nav li").each(function(){j(this).css("width",w+"%")})}function n(){var w=window.location.hash;var x=u.find(f,function(y){return y.hash==w});while(x.parent){x=u.find(f,function(y){return y.hash==x.parent})}if(!x.parent){j("#list-nav li").removeClass("active");var v=x.hash.substring(1,x.hash.length);j("#list-nav li[mid="+v+"]").addClass("active")}e.changeMenu(x)}function o(w){w=w||window.location.hash;var v=m();return u.filter(f,function(x){return w==x.hash&&(x.requireLogin&&v||!x.requireLogin)})}function h(x,w){var v=u.find(f,function(y){return y.parent==w.hash&&y.path==w.path});j(".menu-"+x+"-level").removeClass("active");if(v){if(x=="two"){h("three",v);a(v.hash,x)}j(".menu-"+x+"-level."+v.hash.substring(1)).addClass("active")}}function t(){var v=window.location.hash;var w=u.find(f,function(x){return x.hash==v});if(w.level==1){h("two",w)}if(w.level==2){h("three",w);a(w.hash,w.level)}if(w.level==3){a(w.parent,w.level);j(".menu-three-level").removeClass("active");j(".menu-three-level."+w.hash.substring(1)).addClass("active")}}function a(w,x){libjqobj=j(".menu-two-level."+w.substring(1));var v=["3","three","2","two"];if(u.indexOf(v,x)!=-1&&libjqobj.hasClass("active")){return}libjqobj.siblings().removeClass("active");libjqobj.addClass("active");libjqobj.siblings().not(".menu-two-level").slideUp();libjqobj.next().has("ul li").slideDown()}p.blc_wan_mode=r.getOpMode().blc_wan_mode;if(!p.RJ45_SUPPORT){b="menu"}else{switch(p.blc_wan_mode){case"PPPOE":case"AUTO_PPPOE":b="menu_pppoe";break;default:b="menu";break}}require([p.DEVICE+"/"+b],function(v){f=v;if(p.SD_CARD_SUPPORT){f=f.concat([{hash:"#httpshare_guest",path:"sd_httpshare",level:"",requireLogin:false,checkSIMStatus:false},{hash:"#sdcard",path:"sd",level:"",requireLogin:true,checkSIMStatus:false},{hash:"#httpshare",path:"sd_httpshare",level:"",requireLogin:true,checkSIMStatus:false}])}});function d(){e=new c}function c(){var v=m();var x=this;x.loggedIn=q.observable(v);x.showMenu=q.observable(v||k);var y=u.filter(f,function(z){return z.level=="1"&&(z.requireLogin&&x.loggedIn()||!z.requireLogin)&&z.hash!="#entry"});x.menuMain=q.observableArray(y);x.secondMenu=q.observableArray([]);x.changeMenu=function(z){var A=w(z);if(A.length==0){j("#container").addClass("fixContainerWidth")}else{j("#container").removeClass("fixContainerWidth")}x.secondMenu(A);return true};x.thirdMenu=function(){return x.curThirdMenu};x.getThirdMenu=function(z){x.curThirdMenu=w(z)};function w(z){return u.filter(f,function(A){return A.parent&&A.parent==z.hash&&(A.requireLogin&&x.loggedIn()||!A.requireLogin)})}}return{activeSubMenu:t,checkIsMenuExist:l,findMenu:o,rebuild:s,refreshMenu:n,init:d}});