(function ($, window, undefined) {
    var m_HttpPort = "80";
    if (location.port != "") {
        m_HttpPort = location.port; //获取当前地址样端口
    }
    var defaults = {
        ch: 1, //通道
        m_HttpPort: m_HttpPort,
        baseUrl: location.protocol + "//" + location.hostname + ":" + m_HttpPort, //ajax请求基础路径
        layout_show: false, //是否显示布局配置
        navAsAjax: true, //导航是否使用ajax请求
        $topnavmenu: $("#top-nav-menu"), //顶部导航栏位置
        $sidebarUl: $("#sidebarUl"), //侧边导航栏位置
        openSideFirst: true, //是否默认打开侧边栏第一个url
        homePageFullscreen: true, //首页是否全屏打开
        pageCache: false, //加载页面缓存
        iePlugVersion: "2.1.0.11177", //插件版本 2.1.0.11142
        webVersion: "25.12.09.12845", //web版本 25.10.11.12731
        MacAddress: "", //mac地址
        Network: {}, //网络端口号
        isPush: false, //获取uuid 是否支持联动推送
        deviceCap: {}, //设备能力
        deviceAiCap: {}, //ai能力
        deviceInfo: {}, //设备信息获取
        bitrate: {}, //设备状态分辨率获取
        playMode: [], //播放模式数组获取
        user: "", //用户名
        password: "", //密码
        gs_interval: "1",
        maxTotal: 392192,//转码最大字节数，目前为383kb，后续可能加能力
        Sample: "8000",
        enventInterval: "",
        Bitratetime: "",
        BitratetimeList: [],
        axtivebite: "",
        doloadInterval: "",
        ipcsrc: location.protocol + "//" + location.hostname + ":" + m_HttpPort + "/Snapshot/1/RemoteImageCapture?ImageFormat=2?",
        url: "ws://127.0.0.1:32858/WebSocket/Connect",
        BrowseMenuH: "",
        BrowseMenuW: "",
        enventList: [],
        peopleface_detect_list: [], //抓拍数组
        face_detect_list: [], //识别数组
        car_detect_list: [], //车牌数组
        nums_push_list: [], //记录当前打开声音通道的数组
        bine_push_list: [], //记录当前打开原始比列通道的数组
        play_push_list: [], //记录当前打开预览的通道的数组
        osdname: "",
        stopjs: false,
        enableelectron: true, //是否开启人脸事件
        refreshplayvideo: false, //false为刷新后 true为没有刷新
        devicelose: false, //设备丢失为true
        deviceloseSte: false, //记录状态只针对火狐兼容
        wasmerror: false,
        dzld: false,
        isdown: 1,
        dataId: "",
        inttime: null,
        webplayState: false, //记录webplayer的停止状态
        intelligentState: false, //记录是否在智能检测页面状态
        lastnav: "",
        p2pId: "",
        easyvideodaaress: "",
        p6sURL: "",
        chnelNum: 0, //记录通道号
        currentchannel: 1, //记录当前通道号, 电子围栏
        thoroughfare: 0,
        thoroughfareList: [],
        liveStatus: null, //记录状态适用于nvr预览切换
        IsSuportScend: false, //当前车牌是否支持两框
        IsSuportScendArr: [], //当前获取回来的坐标记录
        isSuportScendNum: 0,
        RemoteplayPosin: null, //当前回放文件信息区域
        RemoteplayposJay: 113, //刻度比例
        begainTimein: null, //开始时刻
        timebarSave: null, //刻度定时器
        SaveCavans: null,
        checkWEB: 1,
        fileWasm: null,
        isSupportMultiChannel: false,
        isShowFaces: true, //是否勾选人脸识别按钮
        assistCommand: "4",//自定义语音的次命令
        srateTy: false,
        oldValue: null,
        dbName: "wasmIndexDB",
        db: null,
        isTraffic: false,
        isSupportV2: false,
        forceEV: false,
        deviceConfigFileResult: "",
        voiceFileResultType: 1,//上传1，试听2
        showAdvPtz: false,
        original: false,
        deviceCapV2: [],
        deviceCapV1:[],
        waveInfoTime: null,
        IsPushFaceFeatures: "false",
        isSupportDeviceCapV2: false,//默认不支持/System/DeviceCapV2
        isSupportUserAuthV2:false,//默认不支持/Security/UserAuthV2
        gs_arrResolution: [{
            Resolution: "352*288",
            ResolutionVal: "CIF(352*288)"
        },
            {
                Resolution: "640*512",
                ResolutionVal: "512P(640*512)"
            },
            {
                Resolution: "704*576",
                ResolutionVal: "D1(704*576)"
            },
            {
                Resolution: "1280*960",
                ResolutionVal: "1280*960"
            },
            {
                Resolution: "1280*1024",
                ResolutionVal: "1280*1024"
            },
            {
                Resolution: "1600*1200",
                ResolutionVal: "1600*1200"
            },
            {
                Resolution: "1280*720",
                ResolutionVal: "720P(1280*720)"
            },
            {
                Resolution: "1920*1080",
                ResolutionVal: "1080P(1920*1080)"
            },
            {
                Resolution: "640*480",
                ResolutionVal: "640*512"
            },
            {
                Resolution: "2048*1536",
                ResolutionVal: "3MP(2048*1536)"
            },
            {
                Resolution: "640*360",
                ResolutionVal: "360P(640*360)"
            },
            {
                Resolution: "320*240",
                ResolutionVal: "320*240"
            },
            {
                Resolution: "2560*1440",
                ResolutionVal: "4MP(2560*1440)"
            },
            {
                Resolution: "2880*1624",
                ResolutionVal: "5MP(2880*1624)"
            },
            {
                Resolution: "2560*1920",
                ResolutionVal: "5MP(2560*1920)"
            },
            {
                Resolution: "3200*1800",
                ResolutionVal: "6MP(3200*1800)"
            },
            {
                Resolution: "800*448",
                ResolutionVal: "448P(800*448)"
            },
            {
                Resolution: "2304*1296",
                ResolutionVal: "3MP(2304*1296)"
            },
            {
                Resolution: "2880*1616",
                ResolutionVal: "5MP(2880*1616)"
            },
            {
                Resolution: "2592*1944",
                ResolutionVal: "5MP(2592*1944)"
            },
            {
                Resolution: "3840*2160",
                ResolutionVal: "4K(3840*2160)"
            },
            {
                Resolution: "960*1080",
                ResolutionVal: "1080N(960*1080)"
            },
            {
                Resolution: "960*576",
                ResolutionVal: "960H(960*1080)"
            },
            {
                Resolution: "2880*1620",
                ResolutionVal: "5MP(2880*1620)"
            }
        ],
        NOTIFY_KEYS: {
            /**网络-IP地址 */
            NETWORK_IP: "network-ip",
            /**网络-端口 */
            NETWORK_PORT: "network-port",
            /**系统设置-用户管理 */
            SYS_SETTING_USER_MANAGEMENT: "sys-setting-user-management",
            /**系统设置-PTZ设置 */
            SYS_SETTING_PTZ_SETTING: "sys-setting-ptz-setting"
        },
        cgiTimeout: 20000,
    };
    var config = function (option) {
        var opt = $.extend(defaults, option);
        return opt;
    };
    window.config = new config();
})(jQuery, this);
