/*! ThunderX BY LUOCHENZHIMU */
/*! Last updated on 2019/03/18 */
/*! https://www.luochenzhimu.com */
module.exports = function (e) {
    var t = {};

    function n(i) {
        if (t[i]) return t[i].exports;
        var a = t[i] = {i, l: !1, exports: {}};
        return e[i].call(a.exports, a, a.exports, n), a.l = !0, a.exports
    }

    return n.m = e, n.c = t, n.d = function (e, t, i) {
        n.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: i})
    }, n.r = function (e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
    }, n.t = function (e, t) {
        if (1 & t && (e = n(e)), 8 & t) return e;
        if (4 & t && "object" == typeof e && e && e.__esModule) return e;
        var i = Object.create(null);
        if (n.r(i), Object.defineProperty(i, "default", {
            enumerable: !0,
            value: e
        }), 2 & t && "string" != typeof e) for (var a in e) n.d(i, a, function (t) {
            return e[t]
        }.bind(null, a));
        return i
    }, n.n = function (e) {
        var t = e && e.__esModule ? function () {
            return e.default
        } : function () {
            return e
        };
        return n.d(t, "a", t), t
    }, n.o = function (e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }, n.p = "", n(n.s = 771)
}([function (e, t, n) {
    "use strict";

    function i(e, t, n, i, a, o, r, s) {
        var l, u = "function" == typeof e ? e.options : e;
        if (t && (u.render = t, u.staticRenderFns = n, u._compiled = !0), i && (u.functional = !0), o && (u._scopeId = "data-v-" + o), r ? (l = function (e) {
            (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), a && a.call(this, e), e && e._registeredComponents && e._registeredComponents.add(r)
        }, u._ssrRegister = l) : a && (l = s ? function () {
            a.call(this, this.$root.$options.shadowRoot)
        } : a), l) if (u.functional) {
            u._injectStyles = l;
            var d = u.render;
            u.render = function (e, t) {
                return l.call(t), d(e, t)
            }
        } else {
            var c = u.beforeCreate;
            u.beforeCreate = c ? [].concat(c, l) : [l]
        }
        return {exports: e, options: u}
    }

    n.d(t, "a", function () {
        return i
    })
}, function (e, t, n) {
    e.exports = n(9)(120)
}, function (e, t) {
    e.exports = require("path")
}, function (e, t) {
    e.exports = require("electron")
}, function (e, t, n) {
    e.exports = n(9)(186)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(6), a = n(18), o = n(19), r = n(26), s = n(27);
    !function (e) {
        let t;
        !function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.Success = 0] = "Success", e[e.FunctionNotExist = 1] = "FunctionNotExist", e[e.ParamaterError = 2] = "ParamaterError", e[e.CallFailed = 3] = "CallFailed"
        }(t = e.NativeCallErrorCode || (e.NativeCallErrorCode = {}));

        class n {
            constructor(e, t, n) {
                this.maxId = e, this.minId = t, this.invalidId = n
            }

            generateId() {
                return this.minId === this.maxId ? this.invalidId : this.minId++
            }

            isInvalidId(e) {
                return e === this.invalidId
            }
        }

        e.IdGenerator = n;
        const l = 0;
        e.idGenerator = new n(1e7, 1, l);

        class u {
            constructor() {
                this.jsCallbacks = new Map, this.eventJsCallbakcs = new Map, this.jsRegisterFunctions = new Map, this.targetCommunitorInfo = s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfoByContext(r.CommonIPCBase.mainRendererContext), this.bindMsgListeners(), this.notifyNativeCallReady()
            }

            CallNativeFunction(t, ...n) {
                do {
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    a.information("funcName = ", t), this.printArgs(n);
                    let r = l;
                    for (let t = 0; t < n.length; ++t) if (i.isFunction(n[t])) {
                        let i = e.idGenerator.generateId(), a = n[t];
                        this.jsCallbacks.set(i, a), t === n.length - 1 ? (r = i, n.pop()) : n[t] = i
                    }
                    s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCallNativeFunction,
                        args: [t, r].concat(n)
                    })
                } while (0)
            }

            AttachNativeEvent(t, n) {
                let o = void 0;
                do {
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(n)) {
                        a.error("callback is empty");
                        break
                    }
                    let r = e.idGenerator.generateId();
                    if (e.idGenerator.isInvalidId(r)) {
                        a.error("id error");
                        break
                    }
                    if (this.eventJsCallbakcs.has(t)) this.eventJsCallbakcs.get(t).set(r, n); else {
                        let e = new Map;
                        e.set(r, n), this.eventJsCallbakcs.set(t, e)
                    }
                    o = r
                } while (0);
                return o
            }

            DetachNativeEvent(e, t) {
                do {
                    if (i.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(t)) {
                        a.error("callback is empty");
                        break
                    }
                    if (!this.eventJsCallbakcs.has(e)) {
                        a.error(`event: ${e} doesnot have listener`);
                        break
                    }
                    if (!this.eventJsCallbakcs.get(e).has(t)) {
                        a.error(`event: ${e} doesnot have the listener of id=${t}`);
                        break
                    }
                    this.eventJsCallbakcs.get(e).delete(t)
                } while (0)
            }

            CheckNativeFunction(t, n) {
                do {
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(n)) {
                        a.error("callback is empty");
                        break
                    }
                    a.information("funcName = ", t);
                    let r = e.idGenerator.generateId();
                    this.jsCallbacks.set(r, n), s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCheckNativeFunction,
                        args: [t, r]
                    })
                } while (0)
            }

            RegisterJSFunction(e, n) {
                let o = t.ParamaterError;
                do {
                    if (i.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(n)) {
                        a.error("jsFunc is empty");
                        break
                    }
                    this.jsRegisterFunctions.set(e, n), o = t.Success
                } while (0);
                return o
            }

            bindMsgListeners() {
                s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallJsFunctionById, e => {
                    this.handleCallJsFunctionById(e.msg.args)
                }), s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallJsFunctionByName, e => {
                    this.handleCallJsFunctionByName(e.msg.args)
                }), s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCNativeFireEvent, e => {
                    this.handleNativeFireEvent(e.msg.args)
                })
            }

            handleCallJsFunctionById(t) {
                do {
                    let n = t[0];
                    if (!i.isNumber(n)) {
                        a.error(`id error id = ${n}`);
                        break
                    }
                    if (e.idGenerator.isInvalidId(n)) {
                        a.error(`id = ${n} invalid`);
                        break
                    }
                    if (!this.jsCallbacks.has(n)) {
                        a.error(`jsCallbacks[${n}] is null`);
                        break
                    }
                    t.splice(0, 1), this.jsCallbacks.get(n).apply(null, t)
                } while (0)
            }

            handleCallJsFunctionByName(e) {
                do {
                    let t = e[0];
                    if (!i.isString(t)) {
                        a.error(`funcName error funcName = ${t}`);
                        break
                    }
                    if (!this.jsRegisterFunctions.has(t)) {
                        a.error(`jsRegisterFunctions[${t}] is null`);
                        break
                    }
                    e.splice(0, 1), this.jsRegisterFunctions.get(t).apply(null, e)
                } while (0)
            }

            handleNativeFireEvent(e) {
                do {
                    let t = e[0];
                    if (!i.isString(t)) {
                        a.warning(`eventName error eventName = ${t}`);
                        break
                    }
                    if (!this.eventJsCallbakcs.has(t)) {
                        a.warning(`eventJsCallbakcs[${t}] is null`);
                        break
                    }
                    e.shift(), this.eventJsCallbakcs.get(t).forEach((t, n, o) => {
                        a.information(`value = ${t}, key = ${n}, map = ${o}`), i.isNullOrUndefined(t) || t.apply(null, e)
                    })
                } while (0)
            }

            notifyNativeCallReady() {
                s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                    name: o.CommonIPCMessage.msgNCNativeCallReady,
                    args: [s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfo()]
                })
            }

            printArgs(e) {
                for (let t in e) a.information(`index ${t} = `, e[t])
            }
        }

        e.NativeCallImpl = u, e.nativeCall = new u
    }(t.NativeCallModule || (t.NativeCallModule = {}))
}, function (e, t) {
    e.exports = require("util")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.default = function (e) {
        return require(e)
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n, i, a, o, r, s, l, u, d, c, h, f, g, p, k, m, T, v;
        !function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Create = 1] = "Create", e[e.InvaldParam = 2] = "InvaldParam", e[e.InvaldLink = 3] = "InvaldLink", e[e.InvaldConfig = 4] = "InvaldConfig", e[e.Timeout = 5] = "Timeout", e[e.VerifyData = 6] = "VerifyData", e[e.Forbidden = 7] = "Forbidden", e[e.RangeDispatch = 8] = "RangeDispatch", e[e.FilePathOverRanging = 9] = "FilePathOverRanging", e[e.FileCreate = 201] = "FileCreate", e[e.FileWrite = 202] = "FileWrite", e[e.FileRead = 203] = "FileRead", e[e.FileRename = 204] = "FileRename", e[e.FileFull = 205] = "FileFull", e[e.BtUploadExist = 601] = "BtUploadExist", e[e.ForbinddenResource = 701] = "ForbinddenResource", e[e.ForbinddenAccount = 702] = "ForbinddenAccount", e[e.ForbinddenArea = 703] = "ForbinddenArea", e[e.ForbinddenCopyright = 704] = "ForbinddenCopyright", e[e.ForbinddenReaction = 705] = "ForbinddenReaction", e[e.ForbinddenPorn = 706] = "ForbinddenPorn", e[e.DownloadSDKCrash = 10001] = "DownloadSDKCrash"
        }(t = e.TaskError || (e.TaskError = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Success = 0] = "Success", e[e.QueryFailed = 1] = "QueryFailed", e[e.ServerError = 2] = "ServerError", e[e.ResourceNotFound = 3] = "ResourceNotFound", e[e.AuthorizingFailed = 4] = "AuthorizingFailed", e[e.ForbidByCopyright = 5] = "ForbidByCopyright", e[e.ForbidByPorNoGraphy = 6] = "ForbidByPorNoGraphy", e[e.ForbidByReactionary = 7] = "ForbidByReactionary", e[e.ForbidByOtherFilter = 8] = "ForbidByOtherFilter"
        }(n = e.DcdnStatusCode || (e.DcdnStatusCode = {})), function (e) {
            e[e.Begin = -1] = "Begin", e[e.Unkown = 0] = "Unkown", e[e.StandBy = 1] = "StandBy", e[e.PreDownloading = 2] = "PreDownloading", e[e.StartWaiting = 3] = "StartWaiting", e[e.StartPending = 4] = "StartPending", e[e.Started = 5] = "Started", e[e.StopPending = 6] = "StopPending", e[e.Stopped = 7] = "Stopped", e[e.Succeeded = 8] = "Succeeded", e[e.Failed = 9] = "Failed", e[e.Seeding = 10] = "Seeding", e[e.DestroyPending = 11] = "DestroyPending", e[e.End = 12] = "End"
        }(i = e.TaskStatus || (e.TaskStatus = {})), function (e) {
            e[e.Begin = -1] = "Begin", e[e.StandBy = 0] = "StandBy", e[e.Stopped = 1] = "Stopped", e[e.Started = 2] = "Started", e[e.Complete = 3] = "Complete", e[e.Forbidden = 4] = "Forbidden", e[e.Error = 5] = "Error", e[e.End = 6] = "End"
        }(a = e.BtFileStatus || (e.BtFileStatus = {})), function (e) {
            e[e.DispatchStrategyNone = 0] = "DispatchStrategyNone", e[e.DispatchStrategyOrigin = 1] = "DispatchStrategyOrigin", e[e.DispatchStrategyP2s = 2] = "DispatchStrategyP2s", e[e.DispatchStrategyP2p = 4] = "DispatchStrategyP2p", e[e.DispatchStrategyAll = -1] = "DispatchStrategyAll"
        }(o = e.DispatchStrategy || (e.DispatchStrategy = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.P2sp = 1] = "P2sp", e[e.Bt = 2] = "Bt", e[e.Emule = 3] = "Emule", e[e.Group = 4] = "Group", e[e.Magnet = 5] = "Magnet"
        }(r = e.TaskType || (e.TaskType = {})), function (e) {
            e.Unkown = "Unkown", e.Downloading = "Downloading", e.Completed = "Completed", e.Recycle = "Recycle"
        }(s = e.CategroyViewID || (e.CategroyViewID = {})), function (e) {
            e[e.Unknow = 0] = "Unknow", e[e.TaskCreated = 1] = "TaskCreated", e[e.InsertToCategoryView = 2] = "InsertToCategoryView", e[e.RemoveFromCategoryView = 3] = "RemoveFromCategoryView", e[e.StatusChanged = 4] = "StatusChanged", e[e.DetailChanged = 5] = "DetailChanged", e[e.ChannelInfoChanged = 6] = "ChannelInfoChanged", e[e.DcdnStatusChanged = 7] = "DcdnStatusChanged", e[e.TaskDescriptionChanged = 8] = "TaskDescriptionChanged", e[e.TaskUserRead = 9] = "TaskUserRead", e[e.TaskRenamed = 10] = "TaskRenamed", e[e.TaskMovedEnd = 11] = "TaskMovedEnd", e[e.TaskMovingStateChange = 12] = "TaskMovingStateChange", e[e.BtSubFileDetailChanged = 13] = "BtSubFileDetailChanged", e[e.BtSubFileLoaded = 14] = "BtSubFileLoaded", e[e.BtSubFileForbidden = 15] = "BtSubFileForbidden", e[e.BtSubFileDcdnStatusChanged = 16] = "BtSubFileDcdnStatusChanged", e[e.TaskCategoryMovedEnd = 17] = "TaskCategoryMovedEnd", e[e.GroupTaskSubFileDetailChanged = 18] = "GroupTaskSubFileDetailChanged", e[e.TaskDestroying = 19] = "TaskDestroying", e[e.TaskDestroyed = 20] = "TaskDestroyed"
        }(l = e.TaskEventType || (e.TaskEventType = {})), function (e) {
            e[e.NumberStrart = 0] = "NumberStrart", e[e.TaskId = 1] = "TaskId", e[e.VirtualId = 2] = "VirtualId", e[e.SrcTotal = 3] = "SrcTotal", e[e.SrcUsing = 4] = "SrcUsing", e[e.FileSize = 5] = "FileSize", e[e.ReceivedSize = 6] = "ReceivedSize", e[e.DownloadSize = 7] = "DownloadSize", e[e.CreateTime = 8] = "CreateTime", e[e.CompletionTime = 9] = "CompletionTime", e[e.DownloadingPeriod = 10] = "DownloadingPeriod", e[e.Progress = 11] = "Progress", e[e.RecycleTime = 12] = "RecycleTime", e[e.FileCreated = 13] = "FileCreated", e[e.Forbidden = 14] = "Forbidden", e[e.CategoryId = 15] = "CategoryId", e[e.UserRead = 16] = "UserRead", e[e.OpenOnComplete = 17] = "OpenOnComplete", e[e.GroupTaskId = 18] = "GroupTaskId", e[e.DownloadSubTask = 19] = "DownloadSubTask", e[e.NameType = 20] = "NameType", e[e.OwnerProduct = 21] = "OwnerProduct", e[e.FileIndex = 22] = "FileIndex", e[e.NumberEnd = 23] = "NumberEnd", e[e.BooleanStart = 24] = "BooleanStart", e[e.Destroyed = 25] = "Destroyed", e[e.Background = 26] = "Background", e[e.Moving = 27] = "Moving", e[e.BooleanEnd = 28] = "BooleanEnd", e[e.StringStart = 29] = "StringStart", e[e.TaskName = 30] = "TaskName", e[e.SavePath = 31] = "SavePath", e[e.RelativePath = 32] = "RelativePath", e[e.TaskUrl = 33] = "TaskUrl", e[e.RefUrl = 34] = "RefUrl", e[e.Cid = 35] = "Cid", e[e.Gcid = 36] = "Gcid", e[e.Cookie = 37] = "Cookie", e[e.ProductInfo = 38] = "ProductInfo", e[e.Origin = 39] = "Origin", e[e.Description = 40] = "Description", e[e.UserData = 41] = "UserData", e[e.StringEnd = 42] = "StringEnd", e[e.ObjectStart = 43] = "ObjectStart", e[e.ObjectEnd = 44] = "ObjectEnd", e[e.CategoryViewId = 45] = "CategoryViewId", e[e.TaskType = 46] = "TaskType", e[e.ErrorCode = 47] = "ErrorCode"
        }(u = e.TaskAttribute || (e.TaskAttribute = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown", e[e.SrcTotal = 1] = "SrcTotal", e[e.SrcUsing = 2] = "SrcUsing", e[e.FileSize = 4] = "FileSize", e[e.ReceivedSize = 8] = "ReceivedSize", e[e.DownloadSize = 16] = "DownloadSize", e[e.CompletionTime = 32] = "CompletionTime", e[e.DownloadingPeriod = 64] = "DownloadingPeriod", e[e.Progress = 128] = "Progress", e[e.RecycleTime = 256] = "RecycleTime", e[e.FileCreated = 512] = "FileCreated", e[e.Forbidden = 1024] = "Forbidden", e[e.UserRead = 2048] = "UserRead", e[e.OpenOnComplete = 4096] = "OpenOnComplete", e[e.DownloadSubTask = 8192] = "DownloadSubTask", e[e.TaskName = 16384] = "TaskName", e[e.SavePath = 32768] = "SavePath", e[e.Cid = 65536] = "Cid", e[e.Gcid = 131072] = "Gcid", e[e.UserData = 262144] = "UserData", e[e.CategoryViewId = 524288] = "CategoryViewId", e[e.ErrorCode = 1048576] = "ErrorCode", e[e.TaskSpeed = 2097152] = "TaskSpeed", e[e.ChannelInfo = 4194304] = "ChannelInfo"
        }(d = e.TaskDetailChangedFlags || (e.TaskDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(c = e.BtSubFileDetailChangedFlags || (e.BtSubFileDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(h = e.GroupTaskSubFileDetailChangedFlags || (e.GroupTaskSubFileDetailChangedFlags = {})), function (e) {
            e[e.NumberStrart = 0] = "NumberStrart", e[e.TaskId = 1] = "TaskId", e[e.FileStatus = 2] = "FileStatus", e[e.DownloadSize = 3] = "DownloadSize", e[e.FileSize = 4] = "FileSize", e[e.EnableDcdn = 5] = "EnableDcdn", e[e.ErrorCode = 6] = "ErrorCode", e[e.DcdnStatus = 7] = "DcdnStatus", e[e.RealIndex = 8] = "RealIndex", e[e.FileOffset = 9] = "FileOffset", e[e.Visible = 10] = "Visible", e[e.Download = 11] = "Download", e[e.NumberEnd = 12] = "NumberEnd", e[e.StringStart = 13] = "StringStart", e[e.FinalName = 14] = "FinalName", e[e.RelativePath = 15] = "RelativePath", e[e.FileName = 16] = "FileName", e[e.FilePath = 17] = "FilePath", e[e.Cid = 18] = "Cid", e[e.Gcid = 19] = "Gcid", e[e.StringEnd = 20] = "StringEnd"
        }(f = e.BtFileAttribute || (e.BtFileAttribute = {})), function (e) {
            e[e.P2spUrl = 0] = "P2spUrl", e[e.BtInfoId = 1] = "BtInfoId", e[e.EmuleFileHash = 2] = "EmuleFileHash", e[e.MagnetUrl = 3] = "MagnetUrl", e[e.GroupTaskName = 4] = "GroupTaskName"
        }(g = e.KeyType || (e.KeyType = {})), function (e) {
            e[e.NameInclude = 1] = "NameInclude", e[e.BtDisplayNameInclude = 2] = "BtDisplayNameInclude"
        }(p = e.SearchKeyType || (e.SearchKeyType = {})), function (e) {
            e[e.ExtEqual = 1] = "ExtEqual", e[e.NameLikeAndExtEqual = 2] = "NameLikeAndExtEqual", e[e.TaskTypeEqual = 4] = "TaskTypeEqual"
        }(k = e.FilterKeyType || (e.FilterKeyType = {})), function (e) {
            e[e.All = 0] = "All", e[e.CommonForeground = 1] = "CommonForeground", e[e.CommonBackground = 2] = "CommonBackground", e[e.Temporary = 3] = "Temporary", e[e.PreDownload = 4] = "PreDownload", e[e.PrivateForeground = 5] = "PrivateForeground"
        }(m = e.KeyFilter || (e.KeyFilter = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.LoadTaskBasic = 0] = "LoadTaskBasic", e[e.Create = 1] = "Create", e[e.Recycle = 2] = "Recycle", e[e.Recover = 3] = "Recover", e[e.ReDownload = 4] = "ReDownload", e[e.MoveThoughCategory = 5] = "MoveThoughCategory"
        }(T = e.TaskInsertReason || (e.TaskInsertReason = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.ContextMenu = 0] = "ContextMenu", e[e.Button = 1] = "Button", e[e.TaskDetail = 2] = "TaskDetail", e[e.DownloadMagnet = 3] = "DownloadMagnet", e[e.ToolbarButton = 4] = "ToolbarButton", e[e.SelectDownloadLists = 5] = "SelectDownloadLists", e[e.DeleteTask = 6] = "DeleteTask"
        }(v = e.TaskStopReason || (e.TaskStopReason = {}))
    }(t.DownloadKernel || (t.DownloadKernel = {}))
}, function (e, t) {
    e.exports = vendor_042b88873303a3c10349
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(17), o = n(2), r = n(6).promisify, s = n(1).default.getLogger("Thunder.base.fs-utilities");
    !function (e) {
        function t(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.access);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.information(e)
                    }
                }
                return t
            })
        }

        function l(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.mkdir);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function u(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.rmdir);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function d(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.unlink);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function c(e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const n = r(a.readdir);
                    try {
                        t = yield n(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function h(e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const n = r(a.lstat);
                    try {
                        t = yield n(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function f(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== e && void 0 !== t) {
                    let i = o.join(e, t), a = yield h(i);
                    n = null !== a && a.isDirectory() ? yield g(i) : yield d(i)
                }
                return n
            })
        }

        function g(e) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== e) {
                    if (yield t(e)) {
                        n = !0;
                        let t = yield c(e);
                        for (let i = 0; i < t.length; i++) n = (yield f(e, t[i])) && n;
                        (n || 0 === t.length) && (n = (yield u(e)) && n)
                    }
                }
                return n
            })
        }

        function p(e) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                return s.information("mkdirsAW", e), void 0 !== e && ((yield t(e)) ? n = !0 : o.dirname(e) === e ? n = !1 : (yield p(o.dirname(e))) && (n = yield l(e))), n
            })
        }

        function k(e, n) {
            return i(this, void 0, void 0, function* () {
                let i;
                if (e.toLowerCase() !== n.toLowerCase() && (yield t(e))) {
                    let t = a.createReadStream(e), o = a.createWriteStream(n);
                    i = new Promise(e => {
                        t.pipe(o).on("finish", () => {
                            e(!0)
                        })
                    })
                } else i = new Promise(e => {
                    e(!1)
                });
                return i
            })
        }

        e.readFileAW = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const n = r(a.readFile);
                    try {
                        t = yield n(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }, e.writeFileAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== e && null !== t) {
                    const i = r(a.writeFile);
                    try {
                        yield i(e, t), n = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return n
            })
        }, e.existsAW = t, e.mkdirAW = l, e.rmdirAW = u, e.unlinkAW = d, e.readdirAW = c, e.lstatAW = h, e.rmdirsAW = g, e.mkdirsAW = p, e.renameAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                if (void 0 !== e && void 0 !== t) {
                    const n = r(a.rename);
                    try {
                        yield n(e, t)
                    } catch (e) {
                        s.warning(e)
                    }
                }
            })
        }, e.copyFileAW = k, e.copyDirsAW = function e(n, a) {
            return i(this, void 0, void 0, function* () {
                let i = !1, r = yield h(n);
                if (r.isDirectory()) {
                    i = yield p(a);
                    let s = yield c(n);
                    for (let l = 0; l < s.length; l++) {
                        let u = o.join(n, s[l]), d = o.join(a, s[l]);
                        (i = yield t(u)) && (i = (r = yield h(u)).isDirectory() ? yield e(u, d) : yield k(u, d))
                    }
                }
                return i
            })
        }, e.mkdtempAW = function () {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                const t = r(a.mkdtemp), i = (yield Promise.resolve().then(() => n(16))).tmpdir();
                try {
                    e = yield t(`${i}${o.sep}`)
                } catch (e) {
                    s.warning(e)
                }
                return e
            })
        }
    }(t.FileSystemAWNS || (t.FileSystemAWNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = n(60), a = n(107), o = Object.prototype.toString;

    function r(e) {
        return "[object Array]" === o.call(e)
    }

    function s(e) {
        return null !== e && "object" == typeof e
    }

    function l(e) {
        return "[object Function]" === o.call(e)
    }

    function u(e, t) {
        if (null !== e && void 0 !== e) if ("object" != typeof e && (e = [e]), r(e)) for (var n = 0, i = e.length; n < i; n++) t.call(null, e[n], n, e); else for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.call(null, e[a], a, e)
    }

    e.exports = {
        isArray: r, isArrayBuffer: function (e) {
            return "[object ArrayBuffer]" === o.call(e)
        }, isBuffer: a, isFormData: function (e) {
            return "undefined" != typeof FormData && e instanceof FormData
        }, isArrayBufferView: function (e) {
            return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer
        }, isString: function (e) {
            return "string" == typeof e
        }, isNumber: function (e) {
            return "number" == typeof e
        }, isObject: s, isUndefined: function (e) {
            return void 0 === e
        }, isDate: function (e) {
            return "[object Date]" === o.call(e)
        }, isFile: function (e) {
            return "[object File]" === o.call(e)
        }, isBlob: function (e) {
            return "[object Blob]" === o.call(e)
        }, isFunction: l, isStream: function (e) {
            return s(e) && l(e.pipe)
        }, isURLSearchParams: function (e) {
            return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams
        }, isStandardBrowserEnv: function () {
            return ("undefined" == typeof navigator || "ReactNative" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document
        }, forEach: u, merge: function e() {
            var t = {};

            function n(n, i) {
                "object" == typeof t[i] && "object" == typeof n ? t[i] = e(t[i], n) : t[i] = n
            }

            for (var i = 0, a = arguments.length; i < a; i++) u(arguments[i], n);
            return t
        }, extend: function (e, t, n) {
            return u(t, function (t, a) {
                e[a] = n && "function" == typeof t ? i(t, n) : t
            }), e
        }, trim: function (e) {
            return e.replace(/^\s*/, "").replace(/\s*$/, "")
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(10), l = n(20), u = r.default.getLogger("Thunder.Util"),
        d = "Thunder Network\\Thunder7.9\\";

    function c(e) {
        let t = e;
        return 0 === e.indexOf('"') && e.lastIndexOf('"') === e.length - 1 ? t = e.substring(1, e.length - 1) : 0 === e.indexOf("'") && e.lastIndexOf("'") === e.length - 1 && (t = e.substring(1, e.length - 1)), t
    }

    !function (e) {
        function t() {
            let e = l.ThunderHelper.getSystemTempPath(), t = l.ThunderHelper.getLogicalDriveStrings(), n = 0;
            for (let i = 0; i < t.length; i++) {
                let a = l.ThunderHelper.getDriveInfo(t[i]);
                3 === a.type && n < a.freeBytes && t[i] !== e && (n = a.freeBytes, e = t[i])
            }
            return e.substring(0, 1) + ":\\迅雷下载"
        }

        e.formatSize = function (e, t) {
            t = t || 2;
            let n = "0B";
            if ("number" == typeof e && e > 0) {
                let i = ["B", "KB", "MB", "GB", "TB"], a = 0, o = e;
                for (; o >= 1e3 && !(a >= 4);) o /= 1024, a += 1;
                n = -1 === String(o).indexOf(".") ? o + i[a] : o.toFixed(t) + i[a]
            }
            return n
        }, e.isDigital = function (e) {
            let t = !1;
            return /^\d+$/.test(e) && (t = !0), t
        }, e.isAlpha = function (e) {
            let t = !1;
            return /[A-Za-z]/.test(e) && (t = !0), t
        }, e.isUpperCase = function (e) {
            let t = !1;
            return /[A-Z]/.test(e) && (t = !0), t
        }, e.isLowerCase = function (e) {
            let t = !1;
            return /[a-z]/.test(e) && (t = !0), t
        }, e.isChinese = function (e) {
            let t = !1;
            return /[\u4E00-\u9FA5]/.test(e) && (t = !0), t
        }, e.replaceNonDigital = function (e) {
            return e.replace(/[^\d]/g, "")
        }, e.replaceNonAlpha = function (e) {
            return e.replace(/[^A-Za-z]/g, "")
        }, e.replaceNonWord = function (e) {
            return e.replace(/[^\W]/g, "")
        }, e.getDefaultDownloadDir = t, e.getMaxFreeDriver = function () {
            return t().substring(0, 1)
        }, e.deepCopy = function (e) {
            let t = JSON.stringify(e), n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                u.warning(e)
            }
            return n
        }, e.swap = function (e, t, n) {
            do {
                if (t < 0 || t >= e.length) break;
                if (n < 0 || n >= e.length) break;
                if (t === n) break;
                e[t] = e.splice(n, 1, e[t])[0]
            } while (0);
            return e
        }, e.compareNocase = function (e, t) {
            let n = !1;
            do {
                if (void 0 === e && void 0 === t) {
                    n = !0;
                    break
                }
                if (void 0 === e || void 0 === t) break;
                if ("string" != typeof e || "string" != typeof t) break;
                n = e.toLowerCase() === t.toLowerCase()
            } while (0);
            return n
        }, e.parseCommandLine = function (e) {
            let t = 0, n = "", i = !1, a = [], o = e.length;
            for (let r = 0; r < o; r++) {
                let s = e[r];
                if ('"' !== s && "'" !== s || ("" === n ? (i = !0, n = s) : n === s && (i = !1, n = "")), " " !== s || i || r === o - 1) {
                    if (r === o - 1) {
                        let n = e.substring(t);
                        "" !== n.trim() && a.push(c(n))
                    }
                } else {
                    let n = e.substring(t, r);
                    "" !== n.trim() && a.push(c(n)), t = r + 1
                }
            }
            return a
        }, e.getThunderTempPath = function (e, t) {
            return i(this, void 0, void 0, function* () {
                const i = yield Promise.resolve().then(() => n(16));
                let a = o.join(i.tmpdir(), d);
                return t && (a = o.join(a, t)), void 0 !== e && e && (yield s.FileSystemAWNS.mkdirsAW(a)), a
            })
        }, e.setQueryString = function (e, t) {
            return Object.keys(t).forEach((n, i) => {
                e += 0 === i ? "?" : "&", e += `${n}=${t[n]}`
            }), e
        }, e.getQueryString = function (e, t) {
            return e && t && e.match(new RegExp(`(^${t}|[?|&]${t})=([^&#]+)`)) ? RegExp.$2 : ""
        }, e.isClipboardTextFormatAvailable = function () {
            let e = !1, t = a.clipboard.availableFormats();
            for (let n of t) if ("text/plain" === n) {
                e = !0;
                break
            }
            return e
        }, e.keywordsHighLight = function (e, t, n) {
            if (!e) return "";
            if (!t) return e;
            if (0 === e.length) return e;
            if (0 === t.length) return e;
            let i = /\\/, a = t.split(" ");
            if (0 === (a = a.filter(e => e.trim().length > 0)).length) return e;
            for (let t = 0; t < a.length; t++) if (a[t].search(i) > 0) return e;
            n = void 0 === n || null === n ? "#FF0000" : n;
            let o = "", r = ["\\[", "\\^", "\\*", "\\(", "\\)", "\\|", "\\?", "\\$", "\\.", "\\+"], s = "", l = "|";
            for (let e = 0; e < a.length; e++) {
                for (let t = 0; t < r.length; t++) {
                    let n = new RegExp(r[t], "g");
                    a[e] = a[e].replace(n, r[t])
                }
                e === a.length - 1 && (l = ""), s = s.concat(a[e], l)
            }
            let u = new RegExp(s, "gi");
            return o = e.replace(u, e => '<span style= "color:' + n + '">' + e + "</span>")
        }, e.isDef = function (e) {
            return void 0 !== e && null !== e
        }, e.isUndef = function (e) {
            return void 0 === e || null === e
        }, e.setStyle = function (e, t) {
            Object.entries(t).forEach(([t, n]) => {
                e.style[t] = n
            })
        }, e.setCSSProperties = function (e, t) {
            Object.entries(t).forEach(([t, n]) => {
                e.style.setProperty(t, n)
            })
        }, e.versionCompare = function (e, t) {
            let n = e.split("."), i = t.split("."), a = 0;
            for (let e = 0; e < n.length; e++) {
                if (Number(n[e]) - Number(i[e]) > 0) {
                    a = 1;
                    break
                }
                if (Number(n[e]) - Number(i[e]) < 0) {
                    a = -1;
                    break
                }
            }
            return a
        }, e.throttle = function (e, t) {
            let n, i = 0;
            return (...a) => {
                const o = Date.now();
                clearTimeout(n), o - i > t ? (e(...a), i = o) : n = setTimeout(() => {
                    e(...a), i = o
                }, t)
            }
        }
    }(t.ThunderUtil || (t.ThunderUtil = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(7), o = n(1).default.getLogger("XLStat");
    let r = a.default(i.join(__rootDir, "../bin/ThunderHelper.node"));

    function s(e = "") {
        let t;
        if ("string" == typeof e) t = e; else if (l(e) && "object" == typeof e) {
            let n = [];
            for (let t in e) l(e[t]) && n.push(t + "=" + encodeURIComponent(e[t]));
            t = n.join(",")
        }
        return t
    }

    function l(e) {
        return void 0 !== e && null !== e
    }

    !function (e) {
        function t(e) {
            do {
                if (void 0 === e) break;
                r.trackClick(e, 0)
            } while (0)
        }

        e.trackEvent = function (e, t = "", n = "", i = 0, a = 0, l = 0, u = 0, d = "", c = 0) {
            let h = 0;
            do {
                if (void 0 === e) {
                    h = 1;
                    break
                }
                let f = s(d);
                h = r.trackEvent(e, t, n, i, a, l, u, f, c), o.information(e, t, n, i, a, l, u, f, c)
            } while (0);
            return h
        }, e.trackClick = t, e.trackShow = function (e) {
            t(e)
        }, e.setUserID = function (e = 0, t = 0) {
            r.setUserID(e, t)
        }
    }(t.XLStatNS || (t.XLStatNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(6), a = n(1), o = n(5), r = a.default.getLogger("Thunder.PromiseNativeCall"), s = i.promisify;
    t.default = function (...e) {
        return r.verbose(...e), s(o.NativeCallModule.nativeCall.CallNativeFunction.bind(o.NativeCallModule.nativeCall))(...e)
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.channelRMNewTaskReadyForSetTaskData = "RM_NEWTASK_READYRORSETTASKDATA", e.channelRMNewTaskSetTaskData = "RM_NEWTASK_SETTASKDATA", e.channelRMPreNewTaskSetTaskData = "RM_PRENEWTASK_SETTASKDATA", e.channelRMNewTaskCreateNewTask = "RM_NEWTASK_CREATENEWTASK", e.channelRMNewTaskSetBTInfo = "RM_NEWTASK_SETBTINFO", e.channelRMNewTaskDownloadTorrent = "RM_NEW_TASK_DOWNLOAD_TORRENT", e.channelRMNewTaskCreateBtTask = "RM_NEWTASK_CRATEBTTASK", e.channelRMNewTaskCancleMagnet = "RM_NEWTASK_CANCLE_MAGNET", e.channelRMImportTorrent = "RM_NEWTASK_IMPORT_TORRENT", e.channelRMGetConfigValueResolve = "RM_GET_CONFIG_VALUE_RESOLVE", e.channelRMGetConfigValueReject = "RM_GET_CONFIG_VALUE_REJECT", e.channelMRTrayMenuClick = "MR_TRAY_MENU_CLICK", e.channelMRNewTaskMagnetTaskCreated = "MR_NEW_TASK_MAGNET_TASK_CREATED", e.channelMRNewTaskDownloadTorrentResult = "MR_NEW_TASK_DOWNLOAD_TORRENT_RESULT", e.channelMRNewTaskCreateNewTaskResult = "MR_NEWTASK_CREATENEWTASK_RESULT", e.channelMRNewTaskCreateBtTaskResult = "RM_NEWTASK_CRATEBTTASK_RESULT", e.channelMRGetConfigValue = "MR_GET_CONFIG_VALUE", e.channelMRSetConfigValue = "MR_SET_CONFIG_VALUE", e.channelRMCommitPlanTask = "RM_PLANTASK_COMMIT", e.channelRMPerformePlanTask = "RM_PLANTASK_PERFORME", e.channelRMProcessSend = "RM_RENDER_PROCESS_INFO", e.channelRMGetPrivateSpaceInfo = "RM_RENDER_GET_PRIVATE_SPACE_INFO", e.channelMRGetPrivateSpaceInfoResult = "MR_RENDER_GET_PRIVATE_SPACE_INFO_RESULT", e.channelRMFileCopy = "RM_FILE_COPY", e.channelRMFileMove = "RM_FILE_MOVE", e.channelMRFileCopyResult = "MR_FILE_COPY_RESULT", e.channelMRFileMoveResult = "MR_FILE_MOVE_RESULT", e.channelRMGetSutitleByCid = "RM_RENDER_GET_SUBTITLE_BY_CID", e.channelMRGetSutitleByCidResult = "MR_RENDER_GET_SUBTITLE_BY_CID_RESULT", e.channelRMGetSutitleByName = "RM_RENDER_GET_SUBTITLE_BY_NAME", e.channelMRGetSutitleByNameResult = "MR_RENDER_GET_SUBTITLE_BY_NAME_RESULT", e.channelRMDownloadSutitle = "RM_RENDER_DOWNLOAD_SUBTITLE", e.channelMRDownloadSutitleSuc = "MR_RENDER_DOWNLOAD_SUBTITLE_SUCCESS", e.channelMRDownloadSutitleFail = "MR_RENDER_DOWNLOAD_SUBTITLE_FAIL", e.channelRMGetDisplayName = "RM_RENDER_GET_SUBTITLE_DISPLAYNAME", e.channelMRGetDisplayNameResult = "MR_RENDER_GET_SUBTITLE_DISPLAYNAME_RESULT", e.channelMRBringWindowToTop = "MR_RENDER_BRING_WINDOW_TO_TOP", e.channelRMDownloadXmp = "RM_RENDER_DOWNLOAD_XMP", e.channelRMXmpFixBoxCreated = "RM_RENDER_XMPFIXBOX_CREATED", e.channelMRFixXmpSuc = "MR_RENDER_FIX_XMP_SUC", e.channelMRFixXMPFail = "MR_RENDER_FIX_XMP_FAIL", e.channelRMDownloadXmpEx = "RM_RENDER_DOWNLOAD_XMP_EX", e.channelRMSetPosition = "RM_SET_POSITION", e.channelRMSetFoucs = "RM_SET_FOCUS", e.channelRMCreateAddressDropWnd = "RM_CREATE_ADDRESS_DROPWND", e.channelRMRefreshAddressDropWnd = "RM_REFRESH_ADDRESS_DROPWND", e.channelRMSelectAddressDropItem = "RM_SELECT_ADDRESS_DROPITEM", e.channelRMCreateSearchWindow = "RM_CREATE_SEARCH_WINDOW", e.channelRMAddressKeyDown = "RM_ADDRESS_BAR_KEYDOWN", e.channelMRFWAddressKeyDown = "MR_ADDRESS_FW_BAR_KEYDOWN", e.channelMRFWSelectAddressDropItem = "MR_FW_SELECT_ADDRESS_DROPITEM", e.channelRMAddressDropWndKeyDown = "RM_ADDRESS_DROPWND_KEYDOWN", e.channelMRSearchWindowVisibleChange = "MR_SEARCH_WINDOW_VISIBLE_CHANGE", e.channelRMShowSearchWindow = "RM_SEARCH_WINDOW_SHOW", e.channelRMHideSearchWindow = "RM_SEARCH_WINDOW_HIDE", e.channelRMClickMouse = "RM_CLICK_MOUSE", e.channelMRSearchBarFocusChange = "MR_SEARCHBAR_FOCUS_CHANGE", e.channelMRFWAddressDropWndKeyDown = "MR_FW_ADDRESS_DROPWND_KEYDOWN", e.channelMRClickAddressDropItem = "MR_CLICK_ADDRESS_DROPITEM", e.channelMRMainWndMax = "MR_MAINWINDOW_MAX", e.channelMRMainWndMin = "MR_MAINWINDOW_MIN", e.channelMRMainWndRestore = "MR_MAINWINDOW_RESTORE", e.channelRMGetBrowserStartType = "RM_GET_BROWSER_START_TYPE", e.channelMRGetBrowserStartTypeResult = "MR_GET_BROWSER_START_TYPE_RESULT", e.channelRMExecute = "RM_SHELL_EXECUTE", e.channelMRExecuteResult = "MR_SHELL_EXECUTE_RESULT", e.channelMRAdTipsClick = "MR_AD_TIPS_CLICK", e.channelMRNotificationMsg = "MR_NOTIFICATION_MSG", e.channelRMSetProgressBar = "RM_SET_PROGRESS_BAR", e.channelRMRoundWindow = "RM_ROUND_WINDOW", e.channelMRShowOrHideWindow = "MR_SHOW_OR_HIDE_WINDOW", e.channelMRSuspensionWindowShowOrHide = "MR_SUSPENSION_WINDOW_SHOW_OR_HIDE"
    }(t.ThunderChannelList || (t.ThunderChannelList = {}))
}, function (e, t) {
    e.exports = require("os")
}, function (e, t) {
    e.exports = require("fs")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.information = function (...e) {
    }, t.error = function (...e) {
    }, t.warning = function (...e) {
    }, t.critical = function (...e) {
    }, t.verbose = function (...e) {
    }, "development" === process.env.LOGGER_ENV && (t.information = function (...e) {
        console.log("information", e)
    }, t.error = function (...e) {
        console.log("error", e)
    }, t.warning = function (...e) {
        console.log("warning", e)
    }, t.critical = function (...e) {
        console.log("critical", e)
    }, t.verbose = function (...e) {
        console.log("verbose", e)
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.msgIPCCommunicatorForward = "ipc_communicator_forward", e.msgIPCSendToMain = "ipc_send_to_main", e.msgIPCSendToRenderer = "ipc_send_to_renderer", e.msgIPCRendererConnect = "ipc_renderer_connect", e.msgIPCRendererDisconnect = "ipc_renderer_disconnect", e.msgNCCallNativeFunction = "nc_call_native_function", e.msgNCCheckNativeFunction = "nc_check_native_function", e.msgNCCallJsFunctionById = "nc_call_js_function_by_id", e.msgNCCallJsFunctionByName = "nc_call_js_function_by_name", e.msgNCNativeFireEvent = "nc_native_fire_event", e.msgNCNativeCallReady = "nc_native_call_ready"
    }(t.CommonIPCMessage || (t.CommonIPCMessage = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(44), o = n(8), r = n(7).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.getDriveInfo = function (e) {
            return r.getDriveInfo(e)
        }, e.getFreePartitionSpace = function (e) {
            return r.getFreePartitionSpace(e)
        }, e.getLogicalDriveStrings = function () {
            return r.getLogicalDriveStrings()
        }, e.getPartitionSpace = function (e) {
            return r.getPartitionSpace(e)
        }, e.getSystemTempPath = function () {
            return r.getSystemTempPath()
        }, e.getTaskTypeFromUrl = function (e) {
            let t = r.getTaskTypeFromUrl(e);
            if (t === o.DownloadKernel.TaskType.Unkown && function (e) {
                e = e.toLowerCase();
                let t = !1;
                do {
                    if ("http://" === e.substr(0, "http://".length)) {
                        t = !0;
                        break
                    }
                    if ("https://" === e.substr(0, "https://".length)) {
                        t = !0;
                        break
                    }
                    if ("ftp://" === e.substr(0, "ftp://".length)) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            }(e)) {
                let n = /:\/\/\[(.+?)\].*/.exec(e);
                n || (n = /^ftp:\/\/.*?\[(.+?)\].*/.exec(e)), n && n[1] && a.isIPv6(n[1]) && (t = o.DownloadKernel.TaskType.P2sp)
            }
            return t
        }, e.extractIcon = function (e, t) {
            return r.extractIcon(e, t)
        }, e.isWindow7 = function () {
            return 1 === r.isWin7()
        }, e.compareStr = function (e, t) {
            return r.compareStr(e, t)
        }, e.getTickCount = function () {
            return r.getTickCount()
        }
    }(t.ThunderHelper || (t.ThunderHelper = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.NONE = 0] = "NONE", e[e.PAGE = 1] = "PAGE", e[e.FRAME = 2] = "FRAME", e[e.LINK = 4] = "LINK", e[e.MEDIA = 8] = "MEDIA", e[e.SELECTION = 16] = "SELECTION", e[e.EDITABLE = 32] = "EDITABLE"
    }(t.MenuNodeType || (t.MenuNodeType = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.UNDO = 1] = "UNDO", e[e.REDO = 2] = "REDO", e[e.CUT = 4] = "CUT", e[e.COPY = 8] = "COPY", e[e.PASTE = 16] = "PASTE", e[e.DELETE = 32] = "DELETE", e[e.SELECT_ALL = 64] = "SELECT_ALL", e[e.TRANSLATE = 128] = "TRANSLATE"
    }(t.MenuEditableState || (t.MenuEditableState = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.IMAGE = 1] = "IMAGE", e[e.VIDEO = 2] = "VIDEO", e[e.AUDIO = 3] = "AUDIO", e[e.FILE = 4] = "FILE", e[e.PLUGIN = 5] = "PLUGIN"
    }(t.MenuMediaType || (t.MenuMediaType = {})), function (e) {
        e[e.HWND_NOTOPMOST = -2] = "HWND_NOTOPMOST", e[e.HWND_TOPMOST = -1] = "HWND_TOPMOST", e[e.HWND_TOP = 0] = "HWND_TOP", e[e.HWND_BOTTOM = 1] = "HWND_BOTTOM"
    }(t.OptionOfhwndInAfter || (t.OptionOfhwndInAfter = {})), function (e) {
        e[e.SWP_ASYNCWINDOWPOS = 16384] = "SWP_ASYNCWINDOWPOS", e[e.SWP_DEFERERASE = 8192] = "SWP_DEFERERASE", e[e.SWP_DRAWFRAME = 32] = "SWP_DRAWFRAME", e[e.SWP_FRAMECHANGED = 32] = "SWP_FRAMECHANGED", e[e.SWP_HIDEWINDOW = 128] = "SWP_HIDEWINDOW", e[e.SWP_NOACTIVATE = 16] = "SWP_NOACTIVATE", e[e.SWP_NOCOPYBITS = 256] = "SWP_NOCOPYBITS", e[e.SWP_NOMOVE = 2] = "SWP_NOMOVE", e[e.SWP_NOOWNERZORDER = 512] = "SWP_NOOWNERZORDER", e[e.SWP_NOREDRAW = 8] = "SWP_NOREDRAW", e[e.SWP_NOREPOSITION = 512] = "SWP_NOREPOSITION", e[e.SWP_NOSENDCHANGING = 1024] = "SWP_NOSENDCHANGING", e[e.SWP_NOSIZE = 1] = "SWP_NOSIZE", e[e.SWP_NOZORDER = 4] = "SWP_NOZORDER", e[e.SWP_SHOWWINDOW = 64] = "SWP_SHOWWINDOW"
    }(t.Uflags || (t.Uflags = {})), function (e) {
        e[e.WS_BORDER = 8388608] = "WS_BORDER", e[e.WS_CAPTION = 12582912] = "WS_CAPTION", e[e.WS_CHILD = 1073741824] = "WS_CHILD", e[e.WS_CHILDWINDOW = 1073741824] = "WS_CHILDWINDOW", e[e.WS_CLIPCHILDREN = 33554432] = "WS_CLIPCHILDREN", e[e.WS_CLIPSIBLINGS = 67108864] = "WS_CLIPSIBLINGS", e[e.WS_THICKFRAME = 262144] = "WS_THICKFRAME"
    }(t.WindowStyle || (t.WindowStyle = {})), function (e) {
        e[e.WS_EX_TOOLWINDOW = 128] = "WS_EX_TOOLWINDOW"
    }(t.ExtendedWindowStyles || (t.ExtendedWindowStyles = {})), function (e) {
        e[e.GWL_EXSTYLE = -20] = "GWL_EXSTYLE", e[e.GWL_HINSTANCE = -6] = "GWL_HINSTANCE", e[e.GWL_ID = -12] = "GWL_ID", e[e.GWL_STYLE = -16] = "GWL_STYLE", e[e.GWL_USERDATA = -21] = "GWL_USERDATA", e[e.GWL_WNDPROC = -4] = "GWL_WNDPROC"
    }(t.SetWindowType || (t.SetWindowType = {})), function (e) {
        e[e.WM_CREATE = 1] = "WM_CREATE", e[e.WM_DESTROY = 2] = "WM_DESTROY", e[e.WM_MOVE = 3] = "WM_MOVE", e[e.WM_SIZE = 5] = "WM_SIZE", e[e.WM_ACTIVATE = 6] = "WM_ACTIVATE", e[e.WM_SETFOCUS = 7] = "WM_SETFOCUS", e[e.WM_KILLFOCUS = 8] = "WM_KILLFOCUS", e[e.WM_ENABLE = 10] = "WM_ENABLE", e[e.WM_DPICHANGED = 736] = "WM_DPICHANGED"
    }(t.WindowMessages || (t.WindowMessages = {})), function (e) {
        e[e.SW_HIDE = 0] = "SW_HIDE", e[e.SW_SHOWMAXIMIZED = 3] = "SW_SHOWMAXIMIZED", e[e.SW_SHOW = 5] = "SW_SHOW"
    }(t.showCmd || (t.showCmd = {})), function (e) {
        e[e.Success = 0] = "Success", e[e.FunctionUnExist = 1] = "FunctionUnExist", e[e.ParamError = 2] = "ParamError", e[e.CallFailed = 3] = "CallFailed"
    }(t.NativeFunctionErrorCode || (t.NativeFunctionErrorCode = {}))
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(61), o = n(63), r = n(47), s = n(64), l = n(65).http, u = n(65).https, d = n(31), c = n(55),
        h = n(118), f = n(37), g = n(62);
    e.exports = function (e) {
        return new Promise(function (t, n) {
            var p, k = e.data, m = e.headers;
            if (m["User-Agent"] || m["user-agent"] || (m["User-Agent"] = "axios/" + h.version), k && !i.isStream(k)) {
                if (Buffer.isBuffer(k)) ; else if (i.isArrayBuffer(k)) k = new Buffer(new Uint8Array(k)); else {
                    if (!i.isString(k)) return n(f("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", e));
                    k = new Buffer(k, "utf-8")
                }
                m["Content-Length"] = k.length
            }
            var T = void 0;
            e.auth && (T = (e.auth.username || "") + ":" + (e.auth.password || ""));
            var v = d.parse(e.url), C = v.protocol || "http:";
            if (!T && v.auth) {
                var S = v.auth.split(":");
                T = (S[0] || "") + ":" + (S[1] || "")
            }
            T && delete m.Authorization;
            var y = "https:" === C, w = y ? e.httpsAgent : e.httpAgent, I = {
                path: o(v.path, e.params, e.paramsSerializer).replace(/^\?/, ""),
                method: e.method,
                headers: m,
                agent: w,
                auth: T
            };
            e.socketPath ? I.socketPath = e.socketPath : (I.hostname = v.hostname, I.port = v.port);
            var b, A = e.proxy;
            if (!A && !1 !== A) {
                var N = C.slice(0, -1) + "_proxy", D = process.env[N] || process.env[N.toUpperCase()];
                if (D) {
                    var _ = d.parse(D);
                    if (A = {host: _.hostname, port: _.port}, _.auth) {
                        var x = _.auth.split(":");
                        A.auth = {username: x[0], password: x[1]}
                    }
                }
            }
            if (A && (I.hostname = A.host, I.host = A.host, I.headers.host = v.hostname + (v.port ? ":" + v.port : ""), I.port = A.port, I.path = C + "//" + v.hostname + (v.port ? ":" + v.port : "") + I.path, A.auth)) {
                var E = new Buffer(A.auth.username + ":" + A.auth.password, "utf8").toString("base64");
                I.headers["Proxy-Authorization"] = "Basic " + E
            }
            e.transport ? b = e.transport : 0 === e.maxRedirects ? b = y ? s : r : (e.maxRedirects && (I.maxRedirects = e.maxRedirects), b = y ? u : l), e.maxContentLength && e.maxContentLength > -1 && (I.maxBodyLength = e.maxContentLength);
            var P = b.request(I, function (i) {
                if (!P.aborted) {
                    clearTimeout(p), p = null;
                    var o = i;
                    switch (i.headers["content-encoding"]) {
                        case"gzip":
                        case"compress":
                        case"deflate":
                            o = o.pipe(c.createUnzip()), delete i.headers["content-encoding"]
                    }
                    var r = i.req || P, s = {
                        status: i.statusCode,
                        statusText: i.statusMessage,
                        headers: i.headers,
                        config: e,
                        request: r
                    };
                    if ("stream" === e.responseType) s.data = o, a(t, n, s); else {
                        var l = [];
                        o.on("data", function (t) {
                            l.push(t), e.maxContentLength > -1 && Buffer.concat(l).length > e.maxContentLength && n(f("maxContentLength size of " + e.maxContentLength + " exceeded", e, null, r))
                        }), o.on("error", function (t) {
                            P.aborted || n(g(t, e, null, r))
                        }), o.on("end", function () {
                            var i = Buffer.concat(l);
                            "arraybuffer" !== e.responseType && (i = i.toString("utf8")), s.data = i, a(t, n, s)
                        })
                    }
                }
            });
            P.on("error", function (t) {
                P.aborted || n(g(t, e, null, P))
            }), e.timeout && !p && (p = setTimeout(function () {
                P.abort(), n(f("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", P))
            }, e.timeout)), e.cancelToken && e.cancelToken.promise.then(function (e) {
                P.aborted || (P.abort(), n(e))
            }), i.isStream(k) ? k.pipe(P) : P.end(k)
        })
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.eventPluginLoderPluginReady = "event_plugin_loader_plugin_ready", e.eventDownloadItemActive = "event_download_item_active", e.eventDetailSwitch2Index = "event_detail_switch_to_index", e.eventDownloadSwitchCategory = "event_download_switch_category", e.eventBringMainWindowToTop = "event_bring_main_window_to_top", e.eventDownloadContextMenuClick = "event_download_context_menu_click", e.eventOnCommand = "event_on_command", e.eventDownloadKernelInitEnd = "event_dk_init_end", e.eventDownloadSDKRecover = "event_sdk_crash_recover", e.eventTaskDataBaseLoadEnd = "event_dk_task_data_base_load_end", e.eventGlobalDownloadSpeedChanged = "event_dk_global_download_speed_changed", e.eventGlobalUploadSpeedChanged = "event_dk_global_upload_speed_changed", e.eventConfigInitFinished = "event_config_init_finished", e.eventConfigValueChanged = "event_config_value_changed", e.eventBHOConfigInitFinished = "event_bho_config_init_finished", e.eventBHOConfigValueChanged = "event_bho_config_value_changed", e.eventShowHomePage = "event_show_home_page", e.eventShowSearchTaskPage = "event_show_searchtask_page", e.eventConfigBrowserInitFinished = "event_config_browser_init_finished", e.eventDownloadContextMenuPopup = "event_download_context_menu_popup", e.eventDownloadContextMenuEnd = "event_download_context_menu_end", e.eventEmbeddedBrowserWndClick = "event_embedded_browser_wnd_click", e.eventLoginWndCreate = "event_login_wnd_create", e.eventLoginWndShow = "event_login_wnd_show", e.eventLoginWndShowResult = "event_login_wnd_show_result", e.eventLoginWndClose = "event_login_wnd_close", e.eventRetryLoginWndCreate = "event_retry_login_wnd_create", e.eventModifierUserinfoWndCreate = "event_modifier-userinfo-wnd-create"
    }(t.NodeEventMesssageNS || (t.NodeEventMesssageNS = {}))
}, function (e, t, n) {
    e.exports = n(106)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(17), o = n(1), r = n(72), s = n(10), l = n(23), u = o.default.getLogger("Config");

    class d {
        constructor() {
            this.isInit = !1, this.configData = {}, this.configPath = void 0, this.eventContainer = new r.default
        }

        init(e) {
            return i(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    if (this.configPath = e, yield s.FileSystemAWNS.existsAW(e)) {
                        let t = yield s.FileSystemAWNS.readFileAW(e);
                        if (t) {
                            let e = null;
                            try {
                                e = JSON.parse(t.toString())
                            } catch (e) {
                                u.warning(e)
                            }
                            this.mergeConfigData(e), this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigInitFinished)
                        }
                    } else this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigInitFinished)
                }
            })
        }

        getValue(e, t, n) {
            let i = n;
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let a = this.configData[e];
                if (!a) {
                    let a = {};
                    a[t] = n, this.configData[e] = a, this.fireValueChangedEvent(e, t, void 0, i);
                    break
                }
                t in a ? i = a[t] : (a[t] = n, this.fireValueChangedEvent(e, t, void 0, i))
            } while (0);
            return i
        }

        setValue(e, t, n) {
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = void 0, a = this.configData[e];
                if (a) i = a[t], a[t] = n; else {
                    let i = {};
                    i[t] = n, this.configData[e] = i
                }
                i !== n && this.fireValueChangedEvent(e, t, i, n)
            } while (0)
        }

        isInitConfigFinished() {
            return this.isInit
        }

        save() {
            return i(this, void 0, void 0, function* () {
                if (this.isInit) {
                    let e = JSON.stringify(this.configData, void 0, 2);
                    yield s.FileSystemAWNS.writeFileAW(this.configPath, e)
                }
            })
        }

        saveSync() {
            if (this.isInit) {
                let e = JSON.stringify(this.configData, void 0, 2);
                a.writeFileSync(this.configPath, e)
            }
        }

        attachListener(e, t) {
            do {
                if (e === l.NodeEventMesssageNS.eventConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        mergeConfigData(e) {
            if (e) if (null === this.configData) this.configData = e; else for (let t in e) {
                let n = e[t];
                if (!n) break;
                for (let e in n) {
                    let i = n[e], a = this.configData[t];
                    if (a) a[e] = i; else {
                        let n = {};
                        n[e] = i, this.configData[t] = n
                    }
                }
            }
        }

        fireValueChangedEvent(e, t, n, i) {
            this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigValueChanged, e, t, n, i)
        }
    }

    t.Config = d;
    const c = new d;
    !function (e) {
        e.init = function (e) {
            return i(this, void 0, void 0, function* () {
                yield c.init(e)
            })
        }, e.isInitConfigFinished = function () {
            return c.isInitConfigFinished()
        }, e.save = function () {
            return i(this, void 0, void 0, function* () {
                yield c.save()
            })
        }, e.saveSync = function () {
            c.saveSync()
        }, e.getValue = function (e, t, n) {
            return c.getValue(e, t, n)
        }, e.setValue = function (e, t, n) {
            c.setValue(e, t, n)
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.ConfigNS || (t.ConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(6), o = n(18), r = n(19);
    !function (e) {
        e.mainProcessContext = "main-process", e.mainRendererContext = "main-renderer", e.mainPageWebviewRendererContext = "main-page-webview-renderer", e.newTaskRendererContext = "new-task-renderer", e.preNewTaskRendererContext = "pre-new-task-renderer", e.loginRendererContext = "login-renderer";

        class t {
            constructor() {
                this.isConnected = !1, this.isOnIPCEvent = !1, this.rendererInfos = [], this.listeners = new Map, t.intervalIPCModuleMsgs = [r.CommonIPCMessage.msgIPCRendererConnect, r.CommonIPCMessage.msgIPCRendererDisconnect]
            }

            onMessage(e, t) {
                do {
                    if (!a.isString(e) || 0 === e.length) {
                        o.error("msgName is null");
                        break
                    }
                    if (a.isNullOrUndefined(t)) {
                        o.error("listener is null");
                        break
                    }
                    this.listeners.has(e) ? this.listeners.get(e).push(t) : this.listeners.set(e, [t])
                } while (0)
            }

            getCommunicatorInfo() {
                return this.currInfo
            }

            getAllRenderer() {
                return this.rendererInfos
            }

            getCommunicatorInfoById(e) {
                for (let t of this.rendererInfos) if (t.id === e) return t;
                return null
            }

            getCommunicatorInfoByContext(e) {
                for (let t of this.rendererInfos) if (t.context === e) return t;
                return null
            }

            startListenIPCMessage(e) {
                this.isOnIPCEvent || (this.isOnIPCEvent = !0, e && this.ListenSendToMainMsg(), this.ListenSendToRendererMsg(e))
            }

            ListenSendToMainMsg() {
                i.ipcMain.on(r.CommonIPCMessage.msgIPCSendToMain, (e, t) => {
                    let n = void 0;
                    do {
                        if (a.isNullOrUndefined(t)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let i = t.msg.name;
                        if (this.isIPCModuleIntervalMsg(i)) {
                            o.information(`IPC module interval msg : ${i}`);
                            let a = this.handleIPCModuleIntervalMsg(e.sender, t);
                            if (n = a[1], !a[0]) break;
                            o.information("need to dispatch msg:" + i)
                        }
                        a.isNullOrUndefined(n) ? n = this.NotifyListener(t) : this.NotifyListener(t)
                    } while (0);
                    a.isNullOrUndefined(n) || (e.returnValue = n)
                })
            }

            ListenSendToRendererMsg(e) {
                (e ? i.ipcMain : i.ipcRenderer).on(r.CommonIPCMessage.msgIPCSendToRenderer, (t, n) => {
                    let i = void 0;
                    do {
                        if (a.isNullOrUndefined(n)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let r = n.msg.name;
                        if (this.isIPCModuleIntervalMsg(r)) {
                            o.information(`IPC module interval msg : ${r}`);
                            let e = this.handleIPCModuleIntervalMsg(t.sender, n);
                            if (i = e[1], !e[0]) break;
                            o.information("need to dispatch msg:" + r)
                        }
                        e ? (o.information("is main, handle forward msg"), this.handleForwardRendererToRendererMsg(n)) : (o.information("is renderer, handle business msg"), a.isNullOrUndefined(i) ? i = this.NotifyListener(n) : this.NotifyListener(n))
                    } while (0);
                    a.isNullOrUndefined(i) || (t.returnValue = i)
                })
            }

            isIPCModuleIntervalMsg(e) {
                for (let n of t.intervalIPCModuleMsgs) if (e === n) return !0;
                return !1
            }

            handleIPCModuleIntervalMsg(e, t) {
                let n = [!1, void 0];
                do {
                    let i = t.msg.name;
                    if (i === r.CommonIPCMessage.msgIPCRendererConnect) {
                        n = [!0, this.handleRendererConnectMsg(e, t)];
                        break
                    }
                    if (i === r.CommonIPCMessage.msgIPCRendererDisconnect) {
                        n = [!0, this.handleRendererDisconnectMsg(e, t)];
                        break
                    }
                } while (0);
                return n
            }

            handleRendererConnectMsg(e, t) {
                o.verbose(e), o.verbose(t)
            }

            handleRendererDisconnectMsg(e, t) {
                o.verbose(e), o.verbose(t)
            }

            handleForwardRendererToRendererMsg(e) {
                this.sendForwardRendererToRendererMsg(e)
            }

            sendForwardRendererToRendererMsg(e) {
                o.verbose(e)
            }

            NotifyListener(e) {
                let t = void 0, n = e.msg.name;
                if (this.listeners.has(n)) {
                    let i = this.listeners.get(n), a = !0;
                    for (let n of i) a ? (a = !1, t = n(e)) : n(e)
                }
                return t
            }
        }

        e.Communicator = t
    }(t.CommonIPCBase || (t.CommonIPCBase = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(6), o = n(18), r = n(19), s = n(26);
    !function (e) {
        class t extends s.CommonIPCBase.Communicator {
            constructor() {
                super()
            }

            initialize(e) {
                this.currInfo = {id: void 0, context: e, isMainCommunicator: !1}
            }

            connect() {
                this.isConnected ? o.warning("has been connected") : (this.sendConnectMsgToMain(), this.isConnected = !0, this.startListenIPCMessage(!1))
            }

            disconnect() {
                this.isConnected ? (this.isConnected = !1, this.sendDisconnectMsgToMain()) : o.warning("hasnot been connected yet")
            }

            sendMessageToMain(e) {
                this.sendIPCMsgToMain(e)
            }

            sendMessageToMainSync(e) {
                return this.sendIPCMsgToMain(e, !0)
            }

            sendMessageToRenderer(e, t) {
                this.sendIPCMsgToRenderer(e, t)
            }

            handleRendererConnectMsg(e, t) {
                do {
                    if (a.isNullOrUndefined(t)) {
                        o.error("msgInfo is null");
                        break
                    }
                    let e = t.msg.args[0];
                    if (a.isNullOrUndefined(e)) {
                        o.error("connectRendererInfo is null");
                        break
                    }
                    o.information(`Renderer: new renderer will connect, id = ${e.id}, context = ${e.context}`), this.rendererInfos.push(e)
                } while (0)
            }

            handleRendererDisconnectMsg(e, t) {
                do {
                    if (a.isNullOrUndefined(t)) {
                        o.error("msgInfo is null");
                        break
                    }
                    let e = t.msg.args[0];
                    if (a.isNullOrUndefined(e)) {
                        o.error("disconnectRendererInfo is null");
                        break
                    }
                    o.information(`renderer will disconnect, id = ${e.id}, context = ${e.context}`);
                    for (let t = 0; t < this.rendererInfos.length; ++t) if (this.rendererInfos[t] === e) {
                        this.rendererInfos.splice(t, 1);
                        break
                    }
                } while (0)
            }

            sendConnectMsgToMain() {
                let e = this.sendMessageToMainSync({name: r.CommonIPCMessage.msgIPCRendererConnect, args: []});
                this.currInfo.id = e[0], this.rendererInfos = e[1]
            }

            sendDisconnectMsgToMain() {
                this.sendMessageToMain({name: r.CommonIPCMessage.msgIPCRendererDisconnect, args: []})
            }

            sendIPCMsgToMain(e, t = !1) {
                let n = void 0;
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("msg is null");
                        break
                    }
                    n = (t ? i.ipcRenderer.sendSync : i.ipcRenderer.send)(r.CommonIPCMessage.msgIPCSendToMain, {
                        msg: e,
                        senderInfo: this.currInfo
                    })
                } while (0);
                return n
            }

            sendIPCMsgToRenderer(e, t) {
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("rendererId is null");
                        break
                    }
                    if (a.isNullOrUndefined(t)) {
                        o.error("msg is null");
                        break
                    }
                    let n = [e].concat(t.args);
                    t.args = n, i.ipcRenderer.send(r.CommonIPCMessage.msgIPCSendToRenderer, {
                        msg: t,
                        senderInfo: this.currInfo
                    })
                } while (0)
            }
        }

        e.RendererCommunicator = t, e.rendererCommunicator = new t
    }(t.CommonIPCRenderer || (t.CommonIPCRenderer = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.OK = 0] = "OK", e[e.Cancel = 1] = "Cancel", e[e.Close = 2] = "Close"
        }(t = e.Action || (e.Action = {}))
    }(t.MessageBoxNS || (t.MessageBoxNS = {}))
}, function (e, t) {
    e.exports = require("crypto")
}, function (e, t, n) {
    e.exports = n(9)(39)
}, function (e, t) {
    e.exports = require("url")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(7), l = n(72), u = n(10), d = n(23), c = n(84), h = n(8), f = n(83),
        g = n(777), p = n(34), k = n(126), m = n(90), T = n(15), v = n(135), C = n(133), S = n(6), y = n(132),
        w = n(33), I = n(28), b = p.DownloadKernelEventManager.getEventManager(),
        A = k.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        N = m.DownloadKernelCategoryManager.getCategoryManager(), D = v.ToastNotifyManagerNS.getToastNotifyManger(),
        _ = r.default.getLogger("DownloadKernel.TaskManager"),
        x = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

    class E {
        constructor() {
            this.isLoadStorageFinish = !1, this.isInitDkFinish = !1, this.isEnableP2pChannel = !0, this.isEnableP2sChannel = !0, this.lastGlobalStat = {
                size: 0,
                recvdBytes: 0,
                sentBytes: 0
            }, this.totalDownloadSpeed = 0, this.totalUploadSpeed = 0, this.eventContainer = new l.default, this.sdkCrash = !1, this.tasks = new Map, this.startTasks = []
        }

        createTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !0, i = !1, a = new g.Task;
                switch (e) {
                    case h.DownloadKernel.TaskType.P2sp: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = n, a.createP2spTask(t.isBackground, t.taskBaseInfo, t.p2spTaskInfo, t.privateSpace), t.taskBaseInfo.groupTaskId && t.taskBaseInfo.groupTaskId > 0 && (i = !0)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Bt: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = n, yield a.createBtTask(t.isBackground, t.taskBaseInfo, t.btTaskInfo, t.privateSpace)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Emule: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = n, a.createEmuleTask(t.isBackground, t.taskBaseInfo, t.emuleTaskInfo, t.privateSpace), t.taskBaseInfo.groupTaskId && t.taskBaseInfo.groupTaskId > 0 && (i = !0)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Group: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        if (n !== t.taskBaseInfo.taskName) {
                            t.taskBaseInfo.taskName = n;
                            let e = o.join(t.taskBaseInfo.savePath, n);
                            for (let n = 0; n < t.groupTaskInfo.subTaskList.length; ++n) t.groupTaskInfo.subTaskList[n].p2spTaskInfo ? t.groupTaskInfo.subTaskList[n].taskBaseInfo.savePath = e : t.groupTaskInfo.subTaskList[n].emuleTaskInfo && (t.groupTaskInfo.subTaskList[n].taskBaseInfo.savePath = e)
                        }
                        yield this.createGroupTask(a, t.taskBaseInfo, t.groupTaskInfo, t.privateSpace)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Magnet:
                        a.createMagnetTask(t.isBackground, t.taskBaseInfo, t.magnetTaskInfo, t.privateSpace);
                        break;
                    default:
                        n = !1
                }
                return n ? (this.addTask(a), t.isBackground || i || this.insertToCategoryView(a, h.DownloadKernel.TaskInsertReason.Create), b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCreated, [a])) : a = null, a
            })
        }

        createBatchTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = f.ThunderKernel.beginTransaction(), i = void 0, a = void 0;
                if (t) {
                    i = t.getId();
                    let e = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                    e && (a = e.length + 1)
                }
                let r = new Map, s = void 0, l = [];
                for (let n = 0; n < e.length; ++n) {
                    let u = !0, d = new g.Task, c = e[n];
                    c.taskBaseInfo.groupTaskId = i;
                    let f = c.taskType, p = o.join(c.taskBaseInfo.savePath, c.taskBaseInfo.taskName);
                    this.setGroupTaskRelativePath(d, c.taskBaseInfo.savePath, a);
                    let k = r.get(p);
                    S.isNumber(k) || (k = 0);
                    let m = yield this.getTaskName(f, c.taskBaseInfo.savePath, c.taskBaseInfo.taskName, k);
                    r.set(p, m.index + 1), c.taskBaseInfo.taskName = m.newName, f === h.DownloadKernel.TaskType.P2sp ? d.createP2spTask(c.isBackground, c.taskBaseInfo, c.p2spTaskInfo, c.privateSpace) : f === h.DownloadKernel.TaskType.Emule ? d.createEmuleTask(c.isBackground, c.taskBaseInfo, c.emuleTaskInfo, c.privateSpace) : u = !1, u ? (void 0 === s && (s = d.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId)), t && t.getExtraObject().addSubTask(d), this.addTask(d), c.isBackground || l.push(d)) : d = null
                }
                if (f.ThunderKernel.commitTransaction(n), !t) {
                    let e = null;
                    (e = void 0 !== s && s > -1 ? N.getCategoryView(s, h.DownloadKernel.CategroyViewID.Downloading) : A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading)) && e.insertTask(l, h.DownloadKernel.TaskInsertReason.Create), b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCreated, l)
                }
                return l
            })
        }

        startTask(e) {
            let t = this.tasks.get(e), n = !1;
            if (t) {
                if (this.sdkCrash) return t.setStatusAndErrorCode(h.DownloadKernel.TaskStatus.Failed, h.DownloadKernel.TaskError.DownloadSDKCrash), b.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, [t]), n;
                this.startTasks.push(e), this.isInitDkFinish ? (n = t.start()) ? this.taskStatusChanage([t]) : (_.error("task start fail! taskId", e), this.removeStartTask(e)) : (n = t.updateTaskStatus(h.DownloadKernel.TaskStatus.StartPending)) && (this.taskStatusChanage([t]), this.downloadSdkInited().then(() => {
                    (n = t.start(!0)) ? this.taskStatusChanage([t]) : (_.error("task start fail! taskId", e), this.removeStartTask(e))
                }).catch())
            } else _.error("task not exist! taskId", e);
            return n
        }

        startWaitingTask(e) {
            let t = !1, n = this.tasks.get(e);
            return n && n.startWaiting() && (this.taskStatusChanage([n]), t = !0), t
        }

        startWaitingTasks(e) {
            let t = !1, n = f.ThunderKernel.beginTransaction(), i = [];
            for (let n of e) {
                let e = this.tasks.get(n);
                e && e.startWaiting() && (i.push(e), t = !0)
            }
            return f.ThunderKernel.commitTransaction(n), i.length > 0 && b.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, i), t
        }

        stopTask(e, t = h.DownloadKernel.TaskStopReason.Unknown) {
            let n = this.tasks.get(e);
            n ? n.stop() ? (n.setStopReason(t), this.taskStatusChanage([n]), n.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && n.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)) : _.error("task stop fail! taskId", e) : _.error("task not exist! taskId", e)
        }

        batchStopTask(e, t = h.DownloadKernel.TaskStopReason.Unknown) {
            let n = [], i = [];
            for (let t = 0; t < e.length; ++t) {
                let a = this.tasks.get(e[t]);
                if (a) {
                    a.getTaskStatus() === h.DownloadKernel.TaskStatus.StartWaiting ? n.push(a) : i.push(a)
                }
            }
            let a = [];
            for (let e = 0; e < n.length; ++e) {
                let i = n[e];
                i.stop() && (i.setStopReason(t), a.push(i))
            }
            for (let e = 0; e < i.length; ++e) {
                let n = i[e];
                n.stop() && (n.setStopReason(t), a.push(n))
            }
            a.length > 0 && this.taskStatusChanage(a);
            for (let e = 0; e < a.length; ++e) {
                let t = a[e];
                t.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && t.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)
            }
        }

        stopTaskAW(e, t = h.DownloadKernel.TaskStopReason.Unknown) {
            return i(this, void 0, void 0, function* () {
                let n = this.tasks.get(e);
                return n ? n.stop() ? (n.setStopReason(t), this.taskStatusChanage([n]), n.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && n.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)) : _.error("task stop fail! taskId", e) : _.error("task not exist! taskId", e), this.attachTaskStopOnce(e)
            })
        }

        deleteTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = this.tasks.get(e);
                if (!n) return !1;
                n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId) === h.DownloadKernel.CategroyViewID.Downloading && (yield this.stopTaskAW(e, h.DownloadKernel.TaskStopReason.DeleteTask)), b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroying, [n]), n.updateTaskStatus(h.DownloadKernel.TaskStatus.DestroyPending) && this.taskStatusChanage([n]);
                let i = this.getTaskCategoryView(n), a = [n];
                null !== i && i.removeTask(a), this.removeTask(e);
                let o = yield n.delete(t);
                return b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroyed, [n], o), o
            })
        }

        deleteBatchTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [], a = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = this.tasks.get(e[t]);
                    if (!i) {
                        _.warning("deleteBatchTask task", i);
                        continue
                    }
                    let o = i.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.StartPending || o === h.DownloadKernel.TaskStatus.Started ? a.push(i) : n.push(i)
                }
                let o = !0;
                if (n.length > 0) {
                    b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroying, n);
                    let e = [];
                    for (let t = 0; t < n.length; ++t) {
                        let i = n[t];
                        i.updateTaskStatus(h.DownloadKernel.TaskStatus.DestroyPending) && e.push(i)
                    }
                    e.length > 0 && b.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, e);
                    let i = this.getTaskCategoryView(n[0]);
                    null !== i && i.removeTask(n);
                    let a = f.ThunderKernel.beginTransaction();
                    for (let e = 0; e < n.length; ++e) {
                        let i = n[e];
                        this.removeTask(i.getId()), o = (yield i.delete(t)) && o
                    }
                    f.ThunderKernel.commitTransaction(a), b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroyed, n, o)
                }
                return a.length > 0 && (yield new Promise(e => {
                    let n = 0;
                    for (let r = 0; r < a.length; ++r) {
                        let s = a[r], l = s.getId();
                        this.stopTaskAW(l, h.DownloadKernel.TaskStopReason.DeleteTask).then(() => i(this, void 0, void 0, function* () {
                            ++n, b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroying, [s]), s.updateTaskStatus(h.DownloadKernel.TaskStatus.DestroyPending) && this.taskStatusChanage([s]);
                            let i = this.getTaskCategoryView(s);
                            null !== i && i.removeTask([s]), this.removeTask(l);
                            let r = f.ThunderKernel.beginTransaction();
                            o = (yield s.delete(t)) && o, f.ThunderKernel.commitTransaction(r), b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroyed, [s], o), n === a.length && e()
                        })).catch()
                    }
                })), o
            })
        }

        removeToRecycle(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.tasks.get(e);
                if (t) {
                    let n = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId);
                    if (n === h.DownloadKernel.CategroyViewID.Completed) {
                        let e = [t];
                        A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).removeTask(e)
                    } else if (yield this.stopTaskAW(e), (n = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId)) === h.DownloadKernel.CategroyViewID.Completed) {
                        let e = [t];
                        A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).removeTask(e)
                    } else {
                        let n = [t];
                        A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).removeTask(n), this.removeStartTask(e)
                    }
                    t.moveToRecycle();
                    let i = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle), a = [];
                    a.push(t), i.insertTask(a, h.DownloadKernel.TaskInsertReason.Recycle)
                }
            })
        }

        batchRemoveToRecycle(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = [];
                for (let i = 0; i < e.length; ++i) {
                    let a = this.tasks.get(e[i]), o = a.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.StartPending || o === h.DownloadKernel.TaskStatus.Started ? n.push(a) : t.push(a)
                }
                if (t.length > 0) {
                    this.getTaskCategoryView(t[0]).removeTask(t);
                    let e = void 0;
                    t.length > 1 && (e = f.ThunderKernel.beginTransaction()), t.forEach(e => {
                        e.moveToRecycle()
                    }), void 0 !== e && f.ThunderKernel.commitTransaction(e), A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).insertTask(t, h.DownloadKernel.TaskInsertReason.Recycle)
                }
                n.length > 0 && n.forEach(e => i(this, void 0, void 0, function* () {
                    let t = e.getId();
                    if (yield this.stopTaskAW(t), e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId) === h.DownloadKernel.CategroyViewID.Completed) {
                        let t = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed), n = [e];
                        t.removeTask(n)
                    } else {
                        A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).removeTask([e]), this.removeStartTask(t)
                    }
                    e.moveToRecycle(), A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).insertTask([e], h.DownloadKernel.TaskInsertReason.Recycle)
                }))
            })
        }

        recoverFromRecycle(e) {
            let t = 0, n = this.tasks.get(e);
            if (n && (t = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime)) > 0) {
                if (n.recover()) {
                    let e = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle), t = [];
                    t.push(n), e.removeTask(t)
                }
                let e = n.getTaskStatus();
                if (e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding) {
                    let e = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed), t = [];
                    t.push(n), e.insertTask(t, h.DownloadKernel.TaskInsertReason.Recover)
                } else {
                    let e = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading), t = [];
                    t.push(n), e.insertTask(t, h.DownloadKernel.TaskInsertReason.Recover)
                }
            }
            return t > 0
        }

        batchRecoverFromRecycle(e) {
            let t = [], n = [], i = [], a = f.ThunderKernel.beginTransaction();
            for (let a of e) {
                let e = this.tasks.get(a);
                if (e) {
                    if (e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                        e.recover() && t.push(e);
                        let a = e.getTaskStatus();
                        a === h.DownloadKernel.TaskStatus.Succeeded || a === h.DownloadKernel.TaskStatus.Seeding ? n.push(e) : i.push(e)
                    }
                }
            }
            if (f.ThunderKernel.commitTransaction(a), t.length > 0) {
                A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).removeTask(t)
            }
            if (n.length > 0) {
                A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).insertTask(n, h.DownloadKernel.TaskInsertReason.Recover)
            }
            if (i.length > 0) {
                A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).insertTask(i, h.DownloadKernel.TaskInsertReason.Recover)
            }
        }

        reDownloadTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                do {
                    let i = this.tasks.get(e);
                    if (!i) break;
                    yield this.deleteTask(e, !0);
                    let a = i.getExtraObject().getAllUserData(),
                        o = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.FileSize);
                    switch (o > 0 && (t.taskBaseInfo.fileSize = o), i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType)) {
                        case h.DownloadKernel.TaskType.P2sp:
                            n = yield this.redownloadP2spTask(i, t);
                            break;
                        case h.DownloadKernel.TaskType.Bt:
                            n = yield this.redownloadBtTask(i, t);
                            break;
                        case h.DownloadKernel.TaskType.Emule:
                            n = yield this.redownloadEmuleTask(i, t);
                            break;
                        case h.DownloadKernel.TaskType.Group:
                            n = yield this.redownloadGroupTask(i, t)
                    }
                    if (n) {
                        n.getExtraObject().setAllUserData(a)
                    }
                } while (0);
                return n
            })
        }

        moveTaskToPath(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1, i = this.getTaskFromTaskId(e);
                do {
                    if (!i) break;
                    let a = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                    if (!t || "" === t || t === a) break;
                    let o = i.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.Started || o === h.DownloadKernel.TaskStatus.StartPending ? (n = yield this.stopTaskAW(e), n = (o = i.getTaskStatus()) === h.DownloadKernel.TaskStatus.Succeeded || o === h.DownloadKernel.TaskStatus.Seeding ? yield this.moveTask(e, t) : yield this.moveTask(e, t, !0)) : n = yield this.moveTask(e, t)
                } while (0);
                let a = [];
                return a[0] = n ? i : null, b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskMovedEnd, a), n
            })
        }

        moveCategoryTask(e, t) {
            let n = this.getTaskFromTaskId(e);
            do {
                if (!n) break;
                let e = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 === t || e === t) break;
                let i = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId), a = null;
                if (!(a = -1 === e ? A.getCategoryViewFromId(i) : N.getCategoryView(e, i))) break;
                let o = null;
                if (!(o = -1 === t ? A.getCategoryViewFromId(i) : N.getCategoryView(t, i))) break;
                let r = [];
                if (r.push(n), a.removeTask(r), n.setCategoryId(t), n.getType() === h.DownloadKernel.TaskType.Group) {
                    let e = n.getExtraObject(), i = e.getSubTaskCount();
                    for (let n = 0; n < i; ++n) {
                        let i = e.getSubTaskByIndex(n);
                        i && i.setCategoryId(t)
                    }
                }
                o.insertTask(r, h.DownloadKernel.TaskInsertReason.MoveThoughCategory)
            } while (0);
            let i = [];
            return i[0] = null, b.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, i), !1
        }

        getTaskCount() {
            return this.tasks.size
        }

        getTaskFromTaskId(e) {
            return this.tasks.get(e)
        }

        batchFindP2spTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindP2spTask(e, n => {
                        let i = [];
                        do {
                            if (_.information("batchFindTaskAsync batchFindBtTask urls:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindEmuleTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindEmuleTask(e, n => {
                        let i = [];
                        do {
                            if (_.information("batchFindTaskAsync batchFindEmuleTask fileHashs:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindBtTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindBtTask(e, n => {
                        let i = [];
                        do {
                            if (_.information("batchFindTaskAsync batchFindBtTask infoIds:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindMagnetTask(e) {
            let t = [];
            do {
                let n = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    c.Common.isThunderPrivateUrl(i) && (i = c.Common.parseThunderPrivateUrl(i));
                    try {
                        i = decodeURI(i)
                    } catch (e) {
                        _.warning(e)
                    }
                    i && n.push(this.splitLastChar(i).toLowerCase())
                }
                if (n.length <= 0) break;
                for (let e = 0; e < n.length; ++e) {
                    let i = n[e];
                    for (let [, e]of this.tasks) if (!this.isOtherPrivateSpaceTask(e)) {
                        if (e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType) === h.DownloadKernel.TaskType.Magnet) {
                            let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl);
                            c.Common.isThunderPrivateUrl(n) && (n = c.Common.parseThunderPrivateUrl(n));
                            try {
                                n = decodeURI(n)
                            } catch (e) {
                                _.warning(e)
                            }
                            if (n && i === this.splitLastChar(n).toLowerCase()) {
                                t.push(e);
                                break
                            }
                        }
                    }
                }
            } while (0);
            return t
        }

        batchFindGroupTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindGroupTask(e, n => {
                        let i = [];
                        do {
                            if (_.information("batchFindTaskAsync batchFindGroupTask taskNames:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindTaskAsync(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = [], i = [], a = [], o = [];
                for (let r = 0; r < e.length; ++r) {
                    let s = e[r], l = s.keyValue;
                    void 0 !== l && (s.keyType === h.DownloadKernel.KeyType.P2spUrl ? t.push(l) : s.keyType === h.DownloadKernel.KeyType.EmuleFileHash ? n.push(l) : s.keyType === h.DownloadKernel.KeyType.BtInfoId ? i.push(l) : s.keyType === h.DownloadKernel.KeyType.MagnetUrl ? a.push(l) : s.keyType === h.DownloadKernel.KeyType.GroupTaskName && o.push(l))
                }
                let r = [];
                if (t.length <= 0 && n.length <= 0 && i.length <= 0 && a.length <= 0 && o.length <= 0) return r;
                if (t.length > 0) {
                    let e = yield this.batchFindP2spTask(t);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (n.length > 0) {
                    let e = yield this.batchFindEmuleTask(n);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (i.length > 0) {
                    let e = yield this.batchFindBtTask(i);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (a.length > 0) {
                    let e = this.batchFindMagnetTask(a);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (o.length > 0) {
                    let e = yield this.batchFindGroupTask(o);
                    e && e.length > 0 && (r = r.concat(e))
                }
                return _.information("batchFindTaskAsync keyInfos:", e, ", ret:", r), r
            })
        }

        isLoadStorageTaskFinish() {
            return this.isLoadStorageFinish
        }

        getTotalDownloadSpeed() {
            return this.totalDownloadSpeed
        }

        getTotalUploadSpeed() {
            return this.totalUploadSpeed
        }

        getTotalDownloadSize() {
            let e = 0;
            return this.lastGlobalStat && this.lastGlobalStat.recvdBytes && (e = this.lastGlobalStat.recvdBytes), e < 0 && (e = 0), e
        }

        getTotalUploadSize() {
            let e = 0;
            return this.lastGlobalStat && this.lastGlobalStat.sentBytes && (e = this.lastGlobalStat.sentBytes), e < 0 && (e = 0), e
        }

        attachListener(e, t) {
            do {
                if (e === d.NodeEventMesssageNS.eventTaskDataBaseLoadEnd) {
                    if (this.isLoadStorageFinish) {
                        t(this.isLoadStorageFinish);
                        break
                    }
                    this.attachOnceListener(e, t);
                    break
                }
                if (e === d.NodeEventMesssageNS.eventDownloadKernelInitEnd) {
                    if (this.isInitDkFinish) {
                        t(this.isInitDkFinish);
                        break
                    }
                    this.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        attachOnceListener(e, t) {
            this.eventContainer.attachOnceListener(e, t)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        queryTaskInfo() {
            let e = 0, t = this.startTasks.length, n = void 0;
            t > 0 && (n = f.ThunderKernel.beginTransaction());
            for (let i = 0; i < this.startTasks.length; ++i) {
                let a = this.startTasks[i], o = this.tasks.get(a), r = !1;
                o && (r = o.queryTaskInfo(e => {
                    this.taskStatusChanage([e])
                }, (e, t) => {
                    this.taskDetailChanage([e], t)
                }, () => {
                    ++e === t && f.ThunderKernel.commitTransaction(n)
                })), r || ++e === t && f.ThunderKernel.commitTransaction(n)
            }
            f.ThunderKernel.queryGlobalInfo(0, e => {
                if (this.lastGlobalStat && e) {
                    if (void 0 !== this.lastGlobalStat.recvdBytes && void 0 !== e.recvdBytes) {
                        let t = e.recvdBytes - this.lastGlobalStat.recvdBytes;
                        t < 0 && (t = 0), this.totalDownloadSpeed !== t && (this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, t), this.totalDownloadSpeed = t)
                    } else this.totalDownloadSpeed = 0;
                    if (void 0 !== this.lastGlobalStat.sentBytes && void 0 !== e.sentBytes) {
                        let t = e.sentBytes - this.lastGlobalStat.sentBytes;
                        t < 0 && (t = 0), this.totalUploadSpeed !== t && (this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, t), this.totalUploadSpeed = t)
                    } else this.totalUploadSpeed = 0;
                    e && (this.lastGlobalStat = e)
                }
            })
        }

        loadTaskBase() {
            f.ThunderKernel.loadTaskBase(e => {
                this.loadTaskBaseCallback(e).catch()
            })
        }

        setGlobalExtInfo(e) {
            return i(this, void 0, void 0, function* () {
                const {LoginHelperNS: t} = yield Promise.resolve().then(() => n(51));
                if (yield t.loginHelper.isLoginedAw()) t.loginHelper.getAllUserInfo(t => {
                    let n = "0", i = "", a = 0, o = "";
                    do {
                        if (!t) break;
                        if (o = t.userID, _.information(`stat dk userId ${t.userID}`, t), !t.vipList) break;
                        if (!t.vipList[0]) break;
                        if (_.information(`stat dk isVip ${t.vipList[0].isVip}`), "0" === (n = "1" === String(t.vipList[0].isVip) ? "1" : "0")) break;
                        _.information(`stat dk vasType ${t.vipList[0].vasType}, vipLevel ${t.vipList[0].vipLevel}`);
                        let e = {2: "normal", 3: "platinum", 5: "super"};
                        t.vipList[0].vasType && e.hasOwnProperty(String(t.vipList[0].vasType)) && (i = e[String(t.vipList[0].vasType)]), t.vipList[0].vipLevel && !isNaN(Number(t.vipList[0].vipLevel)) && (a = t.vipList[0].vipLevel)
                    } while (0);
                    f.ThunderKernel.setUserInfo(o, "");
                    let r = `isvip=${n},viptype=${i},viplevel=${a},userchannel=${e}`;
                    _.information("stat dk extinfo", r), f.ThunderKernel.setGlobalExtInfo(r, !1)
                }); else {
                    f.ThunderKernel.setUserInfo("", "");
                    let t = `isvip=0,viptype=,viplevel=0,userchannel=${e}`;
                    _.information("stat dk extinfo", t), f.ThunderKernel.setGlobalExtInfo(t, !1)
                }
            })
        }

        isDkLoaded() {
            return this.isInitDkFinish
        }

        initDownloadKernelEnd(e) {
            this.isInitDkFinish = 0 === e, this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, e)
        }

        downloadSDKCrashRecover(e) {
            this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventDownloadSDKRecover, e);
            for (let e = 0; e < this.startTasks.length; ++e) {
                let t = this.startTasks[e], n = this.tasks.get(t);
                n && n.createDownloadSdkTask().catch()
            }
        }

        downloadSDKCrash() {
            if (this.sdkCrash = !0, this.startTasks.length > 0) {
                let e = [];
                for (let t = 0; t < this.startTasks.length; ++t) {
                    let n = this.tasks.get(this.startTasks[t]);
                    n && (n.setStatusAndErrorCode(h.DownloadKernel.TaskStatus.Failed, h.DownloadKernel.TaskError.DownloadSDKCrash), e.push(n))
                }
                this.startTasks = [], b.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, e)
            }
            this.notifySDKCrash()
        }

        enableCommonP2pChannel(e) {
            this.isEnableP2pChannel = e
        }

        enableCommonP2sChannel(e) {
            this.isEnableP2sChannel = e
        }

        getTotalTaskDownloadSpeed(e, t) {
            let n = 0;
            for (let i = 0; i < this.startTasks.length; ++i) {
                let a = this.startTasks[i], o = this.getTaskFromTaskId(a);
                if (!o) continue;
                if (void 0 !== t && null !== t || (t = !0), !t && o.getIsPrivate()) continue;
                if (o.getTaskStatus() !== h.DownloadKernel.TaskStatus.Started) continue;
                let r = o.getDownloadSpeed();
                o.getTaskAttribute(h.DownloadKernel.TaskAttribute.Background) ? e && (n += r) : n += r
            }
            return n
        }

        getTotalTaskVipSpeed(e, t) {
            let n = 0;
            for (let i = 0; i < this.startTasks.length; ++i) {
                let a = this.startTasks[i], o = this.getTaskFromTaskId(a);
                if (!o) continue;
                if (void 0 !== t && null !== t || (t = !0), !t && o.getIsPrivate()) continue;
                if (o.getTaskStatus() !== h.DownloadKernel.TaskStatus.Started) continue;
                let r = o.getVipSpeed();
                o.getTaskAttribute(h.DownloadKernel.TaskAttribute.Background) ? e && (n += r) : n += r
            }
            return n
        }

        attachTaskStopOnce(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = this.tasks.get(e);
                    if (n) {
                        let i = n.getTaskStatus();
                        if (i === h.DownloadKernel.TaskStatus.Succeeded || i === h.DownloadKernel.TaskStatus.Seeding || i === h.DownloadKernel.TaskStatus.Stopped || i === h.DownloadKernel.TaskStatus.Failed) t(!0); else {
                            let n = 0;
                            n = b.attachTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, (...i) => {
                                do {
                                    if (!i) break;
                                    if (i[0] !== h.DownloadKernel.TaskEventType.StatusChanged) break;
                                    let a = i[1];
                                    if (!a) break;
                                    for (let i = 0; i < a.length; ++i) {
                                        let o = a[i];
                                        if (!o) continue;
                                        let r = o.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                                        if (e !== r) continue;
                                        let s = o.getTaskStatus();
                                        s !== h.DownloadKernel.TaskStatus.Succeeded && s !== h.DownloadKernel.TaskStatus.Seeding && s !== h.DownloadKernel.TaskStatus.Stopped || (b.detachTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, n), t(!0));
                                        break
                                    }
                                } while (0)
                            })
                        }
                    } else t(!1)
                })
            })
        }

        downloadTaskSelectFiles(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    if (!t) break;
                    let i = null;
                    try {
                        i = JSON.parse(t)
                    } catch (e) {
                        _.warning(e)
                    }
                    if (null == i) break;
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let o = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType);
                    if (o === h.DownloadKernel.TaskType.Bt) {
                        a.getExtraObject().setDownloadFile(i)
                    } else {
                        if (o !== h.DownloadKernel.TaskType.Group) break;
                        a.getExtraObject().setDownloadTask(i)
                    }
                    a.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0 && this.recoverFromRecycle(e);
                    let r = a.getTaskStatus();
                    if (r === h.DownloadKernel.TaskStatus.Started || r === h.DownloadKernel.TaskStatus.StartPending) yield this.stopTaskAW(e, h.DownloadKernel.TaskStopReason.SelectDownloadLists), r = a.getTaskStatus(); else if (r === h.DownloadKernel.TaskStatus.StartWaiting) if (this.taskStatusChanage([a]), o === h.DownloadKernel.TaskType.Group) {
                        a.getExtraObject().updateTaskDetail()
                    } else if (o === h.DownloadKernel.TaskType.Bt) {
                        let t = a.getExtraObject(), n = t.getFileSize();
                        a.internalSetFileSize(n) && this.taskDetailChanage([a], h.DownloadKernel.TaskDetailChangedFlags.FileSize);
                        let i = [], o = t.getBtFileList();
                        for (let [, e]of o) {
                            let t = e.getBtDownloadFileInfo();
                            i.push(t)
                        }
                        b.fireTaskEvent(h.DownloadKernel.TaskEventType.BtSubFileDetailChanged, e, i)
                    }
                    if (r === h.DownloadKernel.TaskStatus.Succeeded || r === h.DownloadKernel.TaskStatus.Seeding) {
                        let e = null, t = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
                        if (e = void 0 !== t && t > -1 ? N.getCategoryView(t, h.DownloadKernel.CategroyViewID.Completed) : A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed)) {
                            let t = [];
                            t.push(a), e.removeTask(t)
                        }
                        let n = null;
                        if (n = void 0 !== t && t > -1 ? N.getCategoryView(t, h.DownloadKernel.CategroyViewID.Downloading) : A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading)) {
                            a.updateTaskStatus(h.DownloadKernel.TaskStatus.Stopped) && (a.setStopReason(h.DownloadKernel.TaskStopReason.SelectDownloadLists), this.taskStatusChanage([a]), a.setStopReason(h.DownloadKernel.TaskStopReason.Unknown));
                            let e = [];
                            e.push(a), n.insertTask(e, h.DownloadKernel.TaskInsertReason.ReDownload)
                        }
                    }
                    n = !0
                } while (0);
                return n
            })
        }

        getTaskCategoryView(e) {
            let t = null, n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId),
                i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId);
            return t = void 0 !== n && -1 !== n ? N.getCategoryView(n, i) : A.getCategoryViewFromId(i)
        }

        loadStorageTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = !0, n = new g.Task;
                if (null !== e) switch (e.taskType) {
                    case h.DownloadKernel.TaskType.P2sp:
                        n.loadStorageP2spTask(e);
                        break;
                    case h.DownloadKernel.TaskType.Bt:
                        n.loadStorageBtTask(e);
                        break;
                    case h.DownloadKernel.TaskType.Emule:
                        n.loadStorageEmuleTask(e);
                        break;
                    case h.DownloadKernel.TaskType.Group:
                        n.loadStorageGroupTask(e);
                        break;
                    default:
                        t = !1
                }
                return t && this.addTask(n) || (n = null), n
            })
        }

        getTaskStrategy(e) {
            let t = h.DownloadKernel.DispatchStrategy.DispatchStrategyOrigin, n = this.tasks.get(e);
            if (n) {
                n.getOriginOnlyStrategy() || (this.isEnableP2pChannel && (t += h.DownloadKernel.DispatchStrategy.DispatchStrategyP2p), this.isEnableP2sChannel && (t += h.DownloadKernel.DispatchStrategy.DispatchStrategyP2s))
            }
            return t
        }

        redownloadP2spTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        o = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl),
                        r = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RefUrl),
                        s = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.Cookie), l = e.getIsPrivate(), u = null;
                    t && t.taskBaseInfo ? ((u = t.taskBaseInfo).taskName && "" !== u.taskName || (u.taskName = i), u.savePath && "" !== u.savePath || (u.savePath = a)) : u = {
                        taskName: i,
                        savePath: a
                    };
                    let d = {url: o, refUrl: r, cookie: s, useOriginResourceOnly: 0};
                    t && t.p2spTaskInfo && (d.useOriginResourceOnly = t.p2spTaskInfo.useOriginResourceOnly ? 1 : 0), n = yield this.createTask(h.DownloadKernel.TaskType.P2sp, {
                        taskBaseInfo: u,
                        p2spTaskInfo: d,
                        privateSpace: l
                    })
                }
                return n
            })
        }

        redownloadBtTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath), o = e.getIsPrivate(),
                        r = e.getExtraObject(), s = r.getSeedFilePath(), l = r.getDisplayName(), u = r.getInfoId(),
                        d = r.getTrackerUrls(), c = r.getDownloadFile(), f = r.getBtFileInfoList(), g = null;
                    t && t.taskBaseInfo ? ((g = t.taskBaseInfo).taskName && "" !== g.taskName || (g.taskName = i), g.savePath && "" !== g.savePath || (g.savePath = a)) : g = {
                        taskName: i,
                        savePath: a
                    };
                    let p = {seedFile: s, displayName: l, fileRealIndexLists: c, fileLists: f, infoId: u, tracker: d};
                    t && t.btTaskInfo && t.btTaskInfo.fileRealIndexLists && t.btTaskInfo.fileRealIndexLists.length > 0 && (p.fileRealIndexLists = t.btTaskInfo.fileRealIndexLists), n = yield this.createTask(h.DownloadKernel.TaskType.Bt, {
                        taskBaseInfo: g,
                        btTaskInfo: p,
                        privateSpace: o
                    })
                }
                return n
            })
        }

        redownloadEmuleTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        o = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl), r = e.getIsPrivate(), s = null;
                    t && t.taskBaseInfo ? ((s = t.taskBaseInfo).taskName && "" !== s.taskName || (s.taskName = i), s.savePath && "" !== s.savePath || (s.savePath = a)) : s = {
                        taskName: i,
                        savePath: a
                    };
                    let l = null;
                    t && t.emuleTaskInfo ? (l = t.emuleTaskInfo).url = o : l = {url: o}, n = yield this.createTask(h.DownloadKernel.TaskType.Emule, {
                        taskBaseInfo: s,
                        emuleTaskInfo: l,
                        privateSpace: r
                    })
                }
                return n
            })
        }

        redownloadGroupTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath), o = e.getIsPrivate(),
                        r = e.getExtraObject(), s = r.getSubTaskCount(), l = [];
                    for (let e = 0; e < s; ++e) {
                        let n = r.getSubTaskByIndex(e);
                        if (n) {
                            let i = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                                a = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                                r = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl),
                                s = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.RefUrl),
                                u = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.Cookie),
                                d = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.DownloadSubTask),
                                c = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType),
                                f = {taskBaseInfo: {taskName: i, savePath: a}, privateSpace: o};
                            if (c === h.DownloadKernel.TaskType.P2sp ? (f.taskType = c, f.p2spTaskInfo = {
                                url: r,
                                refUrl: s,
                                cookie: u,
                                downloadSubTask: d
                            }, l.push(f)) : c === h.DownloadKernel.TaskType.Emule && (f.taskType = c, f.emuleTaskInfo = {
                                url: r,
                                downloadSubTask: d
                            }, l.push(f)), t && t.groupTaskInfo && t.groupTaskInfo.subTaskList && t.groupTaskInfo.subTaskList[e]) {
                                let n = t.groupTaskInfo.subTaskList[e];
                                n.taskBaseInfo && (f.taskBaseInfo = n.taskBaseInfo, f.taskBaseInfo.taskName && "" !== f.taskBaseInfo.taskName || (f.taskBaseInfo.taskName = i), f.taskBaseInfo.savePath && "" !== f.taskBaseInfo.savePath || (f.taskBaseInfo.savePath = a)), c === h.DownloadKernel.TaskType.P2sp ? n.p2spTaskInfo && (f.p2spTaskInfo.useOriginResourceOnly = n.p2spTaskInfo.useOriginResourceOnly ? 1 : 0) : c === h.DownloadKernel.TaskType.Emule && n.emuleTaskInfo && (f.emuleTaskInfo.origin = n.emuleTaskInfo.origin)
                            }
                        }
                    }
                    let u = null;
                    t && t.taskBaseInfo ? ((u = t.taskBaseInfo).taskName && "" !== u.taskName || (u.taskName = i), u.savePath && "" !== u.savePath || (u.savePath = a)) : u = {
                        taskName: i,
                        savePath: a
                    };
                    let d = {subTaskList: l};
                    n = yield this.createTask(h.DownloadKernel.TaskType.Group, {
                        taskBaseInfo: u,
                        groupTaskInfo: d,
                        privateSpace: o
                    })
                }
                return n
            })
        }

        addTask(e) {
            let t = !1;
            if (e) {
                let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                this.tasks.set(n, e);
                let i = this.getTaskStrategy(n);
                e.setDispatchStrategy(i), t = !0
            }
            return t
        }

        removeTask(e) {
            let t = this.getTaskFromTaskId(e);
            if (t) {
                if (t.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType) === h.DownloadKernel.TaskType.Group) {
                    let e = t.getExtraObject(), n = e.getSubTaskCount();
                    for (let t = 0; t < n; ++t) {
                        let n = e.getSubTaskByIndex(t);
                        if (n) {
                            let e = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                            this.tasks.delete(e)
                        }
                    }
                }
            }
            this.tasks.delete(e), this.removeStartTask(e)
        }

        insertToCategoryView(e, t = h.DownloadKernel.TaskInsertReason.Unknown) {
            let n = h.DownloadKernel.CategroyViewID.Downloading;
            if (e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0) n = h.DownloadKernel.CategroyViewID.Recycle; else {
                let t = e.getTaskStatus();
                t !== h.DownloadKernel.TaskStatus.Succeeded && t !== h.DownloadKernel.TaskStatus.Seeding || (n = h.DownloadKernel.CategroyViewID.Completed)
            }
            let i = null, a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
            if (i = void 0 !== a && a > -1 ? N.getCategoryView(a, n) : A.getCategoryViewFromId(n)) {
                let n = [];
                n.push(e), i.insertTask(n, t)
            }
        }

        taskStatusChanage(e) {
            if (this.isInitDkFinish) for (let t = 0; t < e.length; ++t) {
                let n = e[t];
                if (n.getTaskAttribute(h.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                    let e = n, t = n.getTaskStatus();
                    t === h.DownloadKernel.TaskStatus.Succeeded || t === h.DownloadKernel.TaskStatus.Seeding ? e.onFinish() : t === h.DownloadKernel.TaskStatus.Stopped ? e.onStop() : t === h.DownloadKernel.TaskStatus.Failed && e.onFail()
                } else if (n.getType() === h.DownloadKernel.TaskType.Group) do {
                    let e = n.getExtraObject();
                    if (!e) break;
                    let t = e.getTaskStatus();
                    _.information("taskStatusChanage taskExtra.taskStatus:", t), t === h.DownloadKernel.TaskStatus.Succeeded || t === h.DownloadKernel.TaskStatus.Seeding ? this.onTaskFinish(n) : t === h.DownloadKernel.TaskStatus.Stopped ? this.onTaskStop(n) : t === h.DownloadKernel.TaskStatus.Failed && this.onTaskFailed(n)
                } while (0); else {
                    let e = n.getTaskStatus();
                    _.information("taskStatusChanage task.taskStatus:", e), e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding ? this.onTaskFinish(n) : e === h.DownloadKernel.TaskStatus.Stopped ? this.onTaskStop(n) : e === h.DownloadKernel.TaskStatus.Failed && this.onTaskFailed(n)
                }
            }
            b.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, e)
        }

        taskDetailChanage(e, t) {
            let n = new Map, i = [];
            e.forEach(e => {
                let t = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.GroupTaskId);
                if (t < 1) i.push(e); else {
                    let i = n.get(t);
                    i || (i = [], n.set(t, i)), i.push(e)
                }
            }), n.size > 0 && b.fireTaskEvent(h.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, n), i.length > 0 && b.fireTaskEvent(h.DownloadKernel.TaskEventType.DetailChanged, i, t)
        }

        loadTaskBaseCallback(e) {
            return i(this, void 0, void 0, function* () {
                let t = new Map;
                if (e) {
                    let n = [], i = [], a = [], o = new Map, r = new Map;
                    for (let s = 0; s < e.length; ++s) {
                        let l = e[s];
                        if (!l) continue;
                        if (-1 === l.recycleTime) continue;
                        l.taskStatus !== h.DownloadKernel.TaskStatus.Unkown && l.taskStatus !== h.DownloadKernel.TaskStatus.Failed && l.taskStatus !== h.DownloadKernel.TaskStatus.Succeeded && l.taskStatus !== h.DownloadKernel.TaskStatus.Seeding && (l.taskStatus = h.DownloadKernel.TaskStatus.Stopped);
                        let u = l.groupTaskId;
                        if (u > 0) {
                            let e = t.get(u);
                            e || (e = []), e.push(l), t.set(u, e)
                        }
                        let d = yield this.loadStorageTask(l);
                        if (d) {
                            if (d.getTaskAttribute(h.DownloadKernel.TaskAttribute.GroupTaskId) < 1) if (l.categoryId > -1) {
                                let e = d.getTaskStatus();
                                if (e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding) {
                                    let e = r.get(l.categoryId);
                                    e || (e = [], r.set(l.categoryId, e)), e.push(d)
                                } else {
                                    let e = o.get(l.categoryId);
                                    e || (e = [], o.set(l.categoryId, e)), e.push(d)
                                }
                            } else {
                                if (d.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0) a.push(d); else {
                                    let e = d.getTaskStatus();
                                    e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding ? i.push(d) : n.push(d)
                                }
                            }
                        }
                    }
                    if (n.length > 0) {
                        let e = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading);
                        e && e.insertTask(n, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    if (i.length > 0) {
                        let e = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed);
                        e && e.insertTask(i, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    if (a.length > 0) {
                        let e = A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle);
                        e && e.insertTask(a, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    for (let [e, t]of o) {
                        let n = N.getCategoryView(e, h.DownloadKernel.CategroyViewID.Downloading);
                        n ? n.insertTask(t, h.DownloadKernel.TaskInsertReason.LoadTaskBasic) : _.error("getCategoryView failed! categoryId:", e, ", categoryViewId:", h.DownloadKernel.CategroyViewID.Downloading)
                    }
                    for (let [e, t]of r) {
                        let n = N.getCategoryView(e, h.DownloadKernel.CategroyViewID.Completed);
                        n ? n.insertTask(t, h.DownloadKernel.TaskInsertReason.LoadTaskBasic) : _.error("getCategoryView failed! categoryId:", e, ", categoryViewId:", h.DownloadKernel.CategroyViewID.Completed)
                    }
                }
                for (let [e, n]of t) {
                    let t = this.getTaskFromTaskId(e);
                    if (t) {
                        let e = t.getExtraObject();
                        if (e) {
                            let i = void 0, a = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                            a && (i = a.length + 1);
                            for (let t = 0; t < n.length; ++t) {
                                let a = n[t], o = a.taskId, r = this.getTaskFromTaskId(o);
                                r && (this.setGroupTaskRelativePath(r, a.savePath, i), e.addSubTask(r))
                            }
                        }
                    }
                }
                this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventTaskDataBaseLoadEnd), this.isLoadStorageFinish = !0
            })
        }

        setGroupTaskRelativePath(e, t, n) {
            if (e && t && n) {
                let i = t.substr(n, t.length);
                i ? i.length > 0 && (i += "\\") : i = "", e.updateTaskRelativePath(i)
            }
        }

        onTaskFinish(e) {
            let t = e.onFinish();
            if (!e.getTaskAttribute(h.DownloadKernel.TaskAttribute.Background)) {
                let t = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId), n = null;
                if (n = void 0 !== t && -1 !== t ? N.getCategoryView(t, h.DownloadKernel.CategroyViewID.Downloading) : A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading)) {
                    let t = [];
                    t.push(e), n.removeTask(t)
                }
                if (0 === e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime)) {
                    let n = null;
                    if (n = void 0 !== t && -1 !== t ? N.getCategoryView(t, h.DownloadKernel.CategroyViewID.Completed) : A.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed)) {
                        let t = [];
                        t.push(e), n.insertTask(t, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                }
            }
            let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(n), t
        }

        onTaskStop(e) {
            let t = e.onStop(), n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(n), t
        }

        onTaskFailed(e) {
            let t = e.onFail(), n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(n), t
        }

        moveTaskFiles(e, t, n) {
            return a.ipcRenderer.send(T.ThunderChannelList.channelRMFileMove, e, t, n), new Promise(e => {
                a.ipcRenderer.once(T.ThunderChannelList.channelMRFileMoveResult, (t, i, a, o) => {
                    o === n && (i || 2 !== a && 124 !== a || (i = !0), e(i))
                })
            })
        }

        moveTask(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let r = void 0, s = void 0, l = a.getTaskStatus(),
                        d = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType),
                        c = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                    if (yield y.SingleBtTaskNS.isSingleBtTask(a)) {
                        let e = void 0, n = a.getExtraObject(), i = n.getBtFileList();
                        for (let [, t]of i) {
                            e = t.getBtFileAttribute(h.DownloadKernel.BtFileAttribute.FileName);
                            break
                        }
                        let d = o.join(c, e), f = n.getInfoId() + ".torrent", g = o.join(c, f);
                        if (g += "\r\n", l === h.DownloadKernel.TaskStatus.Succeeded || l === h.DownloadKernel.TaskStatus.Seeding) r = (d += "\r\n") + g; else {
                            let e = d + ".bt.xltd";
                            (yield u.FileSystemAWNS.existsAW(e)) || (e = d + ".bt.td"), r = (e += "\r\n") + g
                        }
                        s = t
                    } else {
                        let f = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName), g = o.join(c, f),
                            p = o.join(t, f);
                        if (l === h.DownloadKernel.TaskStatus.Succeeded || l === h.DownloadKernel.TaskStatus.Seeding) d === h.DownloadKernel.TaskType.P2sp || d === h.DownloadKernel.TaskType.Emule ? (r = g, s = p) : d === h.DownloadKernel.TaskType.Bt ? (r = g, s = (yield u.FileSystemAWNS.existsAW(p)) ? t : p) : d === h.DownloadKernel.TaskType.Group && (i = yield this.moveGroupTask(e, t, n)); else if (d === h.DownloadKernel.TaskType.P2sp) {
                            r = g + ".xltd\r\n" + (g + ".xltd.cfg\r\n"), s = t
                        } else if (d === h.DownloadKernel.TaskType.Emule) {
                            r = g + ".emule.xltd\r\n" + (g + ".xlemule.cfg\r\n"), s = t
                        } else d === h.DownloadKernel.TaskType.Bt ? (r = g, s = (yield u.FileSystemAWNS.existsAW(p)) ? t : p) : d === h.DownloadKernel.TaskType.Group && (i = yield this.moveGroupTask(e, t, n))
                    }
                    void 0 !== r && void 0 !== s && (a.setTaskMovingState(!0), i = yield this.moveTaskFiles(r, s, e), a.setTaskMovingState(!1)), i && d !== h.DownloadKernel.TaskType.Group && (a.setSavePath(t), n && this.startTask(e), D.showNotify(v.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, C.ToastNotifyItemType.GreenNotify, "移动成功", 3e3))
                } while (0);
                return i
            })
        }

        moveGroupTask(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    let a = this.tasks.get(e);
                    if (!a) break;
                    if (a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType) !== h.DownloadKernel.TaskType.Group) break;
                    let r = a.getExtraObject();
                    if (!r) break;
                    if (!r.getSubTaskByIndex(0)) break;
                    let s = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        l = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName), d = o.join(s, "*"),
                        c = o.join(t, l);
                    if (a.setTaskMovingState(!0), i = yield this.moveTaskFiles(d, c, e), a.setTaskMovingState(!1), i) {
                        let t = r.getSubTaskCount();
                        for (let e = 0; e < t; ++e) {
                            let t = r.getSubTaskByIndex(e);
                            if (t) {
                                let e = c, n = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                                if (n === s) ; else if (n.length > s.length && n.substr(0, s.length) === s) {
                                    let t = n.slice(s.length);
                                    "\\" === t[0] && (t = t.slice(1), e = o.join(c, t))
                                }
                                t.setSavePath(e)
                            }
                        }
                        yield u.FileSystemAWNS.rmdirAW(s), a.setSavePath(c), n && this.startTask(e), D.showNotify(v.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, C.ToastNotifyItemType.GreenNotify, "移动成功", 3e3)
                    }
                } while (0);
                return i
            })
        }

        splitLastChar(e) {
            let t = e;
            return c.Common.isThunderPrivateUrl(e) && (e.lastIndexOf("==") === e.length - 2 ? t = e.substr(0, e.length - 2) : e.lastIndexOf("=") === e.length - 1 && (t = e.substr(0, e.length - 1))), t
        }

        removeStartTask(e) {
            let t = this.startTasks.indexOf(e);
            t > -1 && this.startTasks.splice(t, 1)
        }

        createGroupTask(e, t, n, a) {
            return i(this, void 0, void 0, function* () {
                let i = !1, o = f.ThunderKernel.beginTransaction();
                do {
                    if (e.createGroupTask(!1, t, n, a), !e.getExtraObject()) break;
                    yield this.createBatchTask(n.subTaskList, e), i = !0
                } while (0);
                return f.ThunderKernel.commitTransaction(o), i
            })
        }

        getTaskName(e, t, n, a) {
            return i(this, void 0, void 0, function* () {
                let i = "";
                for (; ;) {
                    if (e === h.DownloadKernel.TaskType.P2sp || e === h.DownloadKernel.TaskType.Emule) {
                        let e = o.extname(n), t = o.basename(n, e);
                        i = 0 === a ? n : t + "(" + a.toString() + ")" + e
                    } else {
                        i = 0 === a ? n : n + "(" + a.toString() + ")";
                        let e = o.join(t, i), r = yield u.FileSystemAWNS.lstatAW(e);
                        if (r && r.isDirectory()) {
                            i = n;
                            break
                        }
                    }
                    if (!(yield u.FileSystemAWNS.existsAW(o.join(t, i)))) break;
                    ++a
                }
                return {newName: i, index: a}
            })
        }

        isOtherPrivateSpaceTask(e) {
            let t = N.getCurrentPrivateCategory(), n = t ? t.getUserName() : "", i = e.getUserName();
            return !(!i || "" === i || n === i)
        }

        notifySDKCrash() {
            w.MessageBox.confirm({
                title: "迅雷下载引擎发生故障!",
                type: w.MessageBox.ConfirmType.Error,
                content: "迅雷开发者会在最新版本中修复各种故障<br>因此建议您尝试“检查更新”<br>如果您已安装最新版本,请尝试“重启电脑”",
                okText: "检查更新",
                cancelText: "重启电脑"
            }).then(e => {
                e.action === I.MessageBoxNS.Action.OK ? x.startManualUpdateWithUI() : e.action === I.MessageBoxNS.Action.Cancel && x.rebootdMachine()
            }).catch()
        }

        downloadSdkInited() {
            return i(this, void 0, void 0, function* () {
                if (this.isInitDkFinish) return;
                return new Promise(e => i(this, void 0, void 0, function* () {
                    this.eventContainer.attachOnceListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                        e()
                    })
                }))
            })
        }
    }

    t.TaskManager = E, function (e) {
        const t = new E;
        e.getTaskManager = function () {
            return t
        }
    }(t.DownloadKernelTaskManager || (t.DownloadKernelTaskManager = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3);
    !function (e) {
        let t;
        !function (e) {
            e.Info = "info", e.Warning = "warning", e.Error = "error"
        }(t = e.ConfirmType || (e.ConfirmType = {})), e.confirm = function (e, t = {}) {
            let n = String(Math.random()).replace(/\D/, "");
            return i.ipcRenderer.send("message-box-confirm-create", {
                dialogConf: t,
                boxId: n
            }), i.remote.ipcMain.once(`message-box-init-${n}`, t => {
                t.sender.send("message-box-init-reply", {popType: "confirm", options: e})
            }), new Promise(e => {
                i.remote.ipcMain.once(`message-box-resolve-${n}`, (t, n, i) => {
                    e({action: n, checkboxChecked: i})
                })
            })
        }, e.pop = function (e, t = {}) {
            let n = String(Math.random()).replace(/\D/, "");
            return i.ipcRenderer.send("message-box-pop-create", {
                dialogConf: t,
                boxId: n
            }), i.remote.ipcMain.once(`message-box-init-${n}`, t => {
                t.sender.send("message-box-init-reply", {popType: "message-box", options: e})
            }), new Promise(e => {
                i.remote.ipcMain.once(`message-box-resolve-${n}`, (t, n, i) => {
                    e({action: n, formData: i})
                })
            })
        }, e.custom = function (e, t = {}, n = {}) {
            let a = String(Math.random()).replace(/\D/, "");
            return i.ipcRenderer.send("message-box-custom-create", {
                popType: e,
                dialogConf: n,
                boxId: a,
                options: t
            }), i.remote.ipcMain.once(`message-box-init-${a}`, i => {
                i.sender.send("message-box-init-reply", {popType: e, options: t, dialogConf: n})
            }), new Promise(e => {
                i.remote.ipcMain.once(`message-box-resolve-${a}`, (t, n, i) => {
                    e({action: n, args: i})
                })
            })
        }
    }(t.MessageBox || (t.MessageBox = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});

    class i {
        constructor(e, t, n = !1) {
            this.cookie = null, this.once = !1, this.callback = null, this.ref = 0, this.callback = e, this.cookie = t, this.once = n, this.ref = 1
        }

        fire(e, ...t) {
            return "function" == typeof this.callback && this.callback(e, ...t)
        }

        compare(e) {
            return this.cookie === e
        }

        addRef() {
            this.ref++
        }

        release() {
            return this.ref--, this.ref <= 0
        }
    }

    class a {
        constructor() {
            this.cookie = 0, this.listeners = new Map
        }

        attachTaskEvent(e, t) {
            this.cookie++;
            let n = new i(t, this.cookie, !1), a = this.listeners.get(e);
            return a || (a = []), a.push(n), this.listeners.set(e, a), this.cookie
        }

        attachTaskEventOnce(e, t) {
            this.cookie++;
            let n = new i(t, this.cookie, !0), a = this.listeners.get(e);
            return a || (a = []), a.push(n), this.listeners.set(e, a), this.cookie
        }

        detachTaskEvent(e, t) {
            let n = this.listeners.get(e);
            if (n) for (let e = 0; e < n.length; ++e) {
                let i = n[e];
                if (i.compare(t)) {
                    i.release() && n.splice(e, 1);
                    break
                }
            }
        }

        fireTaskEvent(e, ...t) {
            let n = this.listeners.get(e);
            if (n) {
                let i = [], a = n.length, o = 0;
                for (; o < a;) {
                    let r = n[o];
                    r.addRef();
                    let s = r.fire(e, ...t);
                    r.release() ? (n.splice(o, 1), --a) : (++o, r.once && s && i.push(r))
                }
                for (let t = 0; t < i.length; t++) {
                    let n = i[t];
                    this.detachTaskEvent(e, n.cookie)
                }
            }
        }
    }

    t.EventManager = a, function (e) {
        const t = new a;
        e.getEventManager = function () {
            return t
        }
    }(t.DownloadKernelEventManager || (t.DownloadKernelEventManager = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Color = 1] = "Color", e[e.Wallpaper = 2] = "Wallpaper", e[e.Custom = 3] = "Custom"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {type: t.Default, colorID: 0}
    }(t.SkinHelperNS || (t.SkinHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(109), o = {"Content-Type": "application/x-www-form-urlencoded"};

    function r(e, t) {
        !i.isUndefined(e) && i.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t)
    }

    var s, l = {
        adapter: ("undefined" != typeof XMLHttpRequest ? s = n(110) : "undefined" != typeof process && (s = n(22)), s),
        transformRequest: [function (e, t) {
            return a(t, "Content-Type"), i.isFormData(e) || i.isArrayBuffer(e) || i.isBuffer(e) || i.isStream(e) || i.isFile(e) || i.isBlob(e) ? e : i.isArrayBufferView(e) ? e.buffer : i.isURLSearchParams(e) ? (r(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : i.isObject(e) ? (r(t, "application/json;charset=utf-8"), JSON.stringify(e)) : e
        }],
        transformResponse: [function (e) {
            if ("string" == typeof e) try {
                e = JSON.parse(e)
            } catch (e) {
            }
            return e
        }],
        timeout: 0,
        xsrfCookieName: "XSRF-TOKEN",
        xsrfHeaderName: "X-XSRF-TOKEN",
        maxContentLength: -1,
        validateStatus: function (e) {
            return e >= 200 && e < 300
        }
    };
    l.headers = {common: {Accept: "application/json, text/plain, */*"}}, i.forEach(["delete", "get", "head"], function (e) {
        l.headers[e] = {}
    }), i.forEach(["post", "put", "patch"], function (e) {
        l.headers[e] = i.merge(o)
    }), e.exports = l
}, function (e, t, n) {
    "use strict";
    var i = n(62);
    e.exports = function (e, t, n, a, o) {
        var r = new Error(e);
        return i(r, t, n, a, o)
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(29), o = n(17), r = n(10), s = n(1).default.getLogger("Thunder.base.tools-utilities"), l = n(2),
        u = n(7).default(l.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return i(this, void 0, void 0, function* () {
                let t;
                return t = e && (yield r.FileSystemAWNS.existsAW(e)) ? new Promise(t => {
                    u.asyncCalcuteFileMD5(e, (e, n) => {
                        e ? (n = n.toUpperCase(), t(n)) : t(void 0)
                    })
                }) : new Promise(e => {
                    e(void 0)
                })
            })
        }

        e.genarateMd5 = function (e) {
            let t = void 0, n = a.createHash("md5");
            return null !== n && (t = n.update(e).digest("hex")), t
        }, e.matchFileMd5 = function (e, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1, a = yield t(e);
                return void 0 !== a && a === n.toUpperCase() && (s.information("check full md5 sucessful"), i = !0), i
            })
        }, e.calculateFileMd5Ex = function (e) {
            return i(this, void 0, void 0, function* () {
                let t;
                if (e && (yield r.FileSystemAWNS.existsAW(e))) {
                    let n = o.createReadStream(e), i = a.createHash("md5");
                    n.on("data", e => {
                        i.update(e)
                    }), t = new Promise(e => {
                        n.on("end", () => {
                            let t = i.digest("hex");
                            t = t.toUpperCase(), e(t)
                        })
                    })
                } else t = new Promise(e => {
                    e(void 0)
                });
                return t
            })
        }, e.calculateFileMd5 = t, e.encryptBuffer = function (e, t) {
            let n = null;
            try {
                let i = a.createCipheriv("aes-128-ecb", t, ""), o = i.update(e), r = i.final();
                n = Buffer.concat([o, r])
            } catch (e) {
                s.error("encryptBuffer", e)
            }
            return n
        }, e.decryptBuffer = function (e, t) {
            let n = null;
            try {
                let i = a.createDecipheriv("aes-128-ecb", t, ""), o = i.update(e), r = i.final();
                n = Buffer.concat([o, r])
            } catch (e) {
                s.error("decryptBuffer", e)
            }
            return n
        }, e.encryptSha1Buffer = function (e) {
            let t = null;
            try {
                t = a.createHash("sha1").update(e).digest("hex")
            } catch (e) {
                s.error("encryptSha1Buffer", e)
            }
            return t
        }, e.setForegroundWindow = function (e, t) {
            if (null !== e && null !== t) {
                let n = t.getNativeWindowHandle().readUIntLE(0, 4);
                e.setForegroundWindow(n) ? s.information("sucessful") : s.information("failed")
            }
        }
    }(t.ToolsUtilitiesAWNS || (t.ToolsUtilitiesAWNS = {}))
}, , , function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(6), o = n(1), r = n(7).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    process.env.TL_ENABLE = "0", "console" === process.env.TL_OUTPUT ? o.default.outputLogger = o.outputLoggerConsole : o.default.outputLogger = function () {
        function e(e) {
            return function (...t) {
                r.printEtwLog(e, function (...e) {
                    return e.map(e => a.inspect(e)).join(" ").replace(/%/g, "%%")
                }(...t))
            }
        }

        return {
            [o.LogLevel.Critical]: e(o.LogLevel.Critical),
            [o.LogLevel.Error]: e(o.LogLevel.Error),
            [o.LogLevel.Warning]: e(o.LogLevel.Warning),
            [o.LogLevel.Information]: e(o.LogLevel.Information),
            [o.LogLevel.Verbose]: e(o.LogLevel.Verbose)
        }
    }()
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = (n(17), n(2)), r = n(6);
    let s = null;
    const l = n(13), u = n(3), d = n(1), c = n(7), h = n(15), f = "xdas_profile_stat";
    let g = "", p = void 0, k = null, m = void 0, T = null,
        v = c.default(o.join(__rootDir, "../bin/ThunderHelper.node")), C = new Set;

    function S() {
        return i(this, void 0, void 0, function* () {
            return new Promise(e => i(this, void 0, void 0, function* () {
                void 0 === m && (null === T && (T = new Promise(e => {
                    e(m = function (e) {
                        let t = "";
                        if (0 === e.length && "renderer" === process.type) {
                            let e = o.normalize(decodeURIComponent(window.location.href)),
                                n = e.indexOf(process.resourcesPath);
                            n = n > -1 ? n + process.resourcesPath.length + 1 : n;
                            let i = e.length - 1, a = e.indexOf("?"), r = e.indexOf("#");
                            i = a > -1 ? Math.min(a - 1, i) : i, i = r > -1 ? Math.min(r - 1, i) : i, n > -1 && i >= n && (t = e.substr(n, i - n + 1))
                        }
                        return 0 === t.length && (t = 0 !== e.length ? e : process.type), t = t.replace(/\||,|;/g, "_")
                    }(""))
                })), m = yield T), e(m)
            }))
        })
    }

    function y(e) {
        let t = "";
        do {
            if (null === e || void 0 === e) break;
            switch (typeof e) {
                case"string":
                    t = e;
                    break;
                case"object":
                    t = r.inspect(e) || "";
                    break;
                case"number":
                case"boolean":
                    t = e.toString() || ""
            }
        } while (0);
        return t
    }

    function w(e) {
        return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
    }

    function I(e) {
        return i(this, void 0, void 0, function* () {
            return new Promise(t => i(this, void 0, void 0, function* () {
                let i = void 0;
                null === s && (s = yield Promise.resolve().then(() => n(29)));
                let a = s.createHash("md5");
                null !== a && (i = a.update(e).digest("hex")), t(i)
            }))
        })
    }

    function b() {
        return new Promise(e => i(this, void 0, void 0, function* () {
            let t = "";
            t = void 0 === p ? "browser" === process.type ? function () {
                if (void 0 === p) {
                    let e = process.argv.length, t = process.argv;
                    for (let n = 0; n < e; n++) {
                        let e = t[n];
                        if (e.startsWith("-StartType:")) {
                            p = e.substring("-StartType:".length);
                            break
                        }
                    }
                    void 0 === p && (p = "")
                }
                return p
            }() : yield function () {
                return i(this, void 0, void 0, function* () {
                    return null === k && (k = new Promise(e => {
                        u.ipcRenderer.send(h.ThunderChannelList.channelRMGetBrowserStartType), u.ipcRenderer.once(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, (t, n) => {
                            p = n, e(n), k = null
                        })
                    })), k
                })
            }() : p, e(t)
        }))
    }

    function A(e, t, n, a) {
        return i(this, void 0, void 0, function* () {
            let o = y(t), r = y(n), s = yield I(r), u = function (e) {
                let t = new RegExp(w("file:///"), "g"), n = new RegExp(w(process.resourcesPath + "\\"), "g"),
                    i = new RegExp(w(encodeURI(process.resourcesPath.replace(/\\/g, "/") + "/")), "g");
                return e.replace(t, "").replace(n, "").replace(i, "")
            }(y(a)), d = yield I(u), c = `${e}:${s}:${d}`;
            C.has(c) || (C.add(c), l.XLStatNS.trackEvent(f, "uncaught_exception", "", 0, 0, 0, 0, `type=${e},business_name=${yield S()},code=${o},message_hash=${s},message=${encodeURI(r)},stack_hash=${d},stack=${encodeURI(u)}`)), function (e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                })
            }().catch()
        })
    }

    function N(e) {
        console.error(e);
        let t = e || {};
        A("unhandledRejection", t.code, t instanceof Error ? t.message : t, t.stack).catch()
    }

    !function (e) {
        e.init = function (e) {
            g = e
        }, e.trackColdStartUpEvent = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = v.iSColdStartUp() ? 1 : 0, n = a.release(), i = v.performanceMonitorReporter.getProcessUptime(),
                    o = yield b(), r = `key=${e},start_type=${o},cold_start_up=${t},os_version=${n},cost_time=${i}`;
                l.XLStatNS.trackEvent(f, "cold_start_up", "", 0, 0, 0, 0, r)
            })
        }
    }(t.PerformanceMonitorStatNS || (t.PerformanceMonitorStatNS = {})), function () {
        if (process.on("uncaughtException", e => {
            console.error(e);
            let t = e || {};
            A("uncaughtException", t.code, t.message, t.stack).catch()
        }), "browser" === process.type) process.on("unhandledRejection", (e, t) => {
            N(e)
        }), u.ipcMain.on(h.ThunderChannelList.channelRMGetBrowserStartType, function (e) {
            return i(this, void 0, void 0, function* () {
                let t = yield b();
                e.sender.send(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, t)
            })
        }); else if ("browser" !== process.type) {
            window.addEventListener("unhandledrejection", e => {
                N(e && e.reason || {})
            });
            let e = u.remote.getCurrentWebContents();
            null !== e && void 0 !== e && e.once("did-finish-load", () => {
                (function () {
                    return i(this, void 0, void 0, function* () {
                        do {
                            if ("browser" === process.type) break;
                            if (null === window.performance.timing || void 0 === window.performance.timing) break;
                            let e = v.iSColdStartUp() ? 1 : 0, t = a.release(), n = window.performance.timing,
                                i = n.loadEventEnd - n.navigationStart, o = n.fetchStart - n.navigationStart,
                                r = n.domainLookupEnd - n.domainLookupStart, s = n.connectEnd - n.connectStart,
                                u = n.responseStart - n.requestStart, d = n.responseEnd - n.responseStart,
                                c = n.domComplete - n.domLoading, h = yield b();
                            l.XLStatNS.trackEvent(f, "page_load_time", "", 0, 0, 0, 0, `start_type=${h},cold_start_up=${e},os_version=${t},load_time=${i},before_fetch_time=${o},domin_lookup_time=${r},connect_time=${s},first_response_time=${u},responseTime=${d},domTime=${c},process=${g}`)
                        } while (0)
                    })
                })().catch()
            })
        }
        d.default.hook("beforeLog", (e, t, ...n) => {
            e === d.LogLevel.Critical && l.XLStatNS.trackEvent(f, "critical_error", "", 0, 0, 0, 0, `module_name=${t},messages=${n}`)
        })
    }()
}, function (e, t, n) {
    e.exports = n(9)(189)
}, function (e, t) {
    e.exports = require("net")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(10), r = n(5), s = n(2);
    !function (e) {
        function t(e, t) {
            if (null !== e) {
                e.webContents.isDevToolsOpened() ? e.webContents.closeDevTools() : e.webContents.openDevTools(t)
            }
        }

        e.openDevTool = t, e.enableDevTools = function (e) {
            return i(this, void 0, void 0, function* () {
                (yield o.FileSystemAWNS.existsAW(s.resolve(__rootDir, "../../enableDevTools"))) && window.addEventListener("keyup", n => {
                    "F12" === n.key && n.ctrlKey && t(a.remote.getCurrentWindow(), e)
                }, !0)
            })
        }, e.enableDragOpenFile = function (e) {
            void 0 === e && (e = !1), document.addEventListener("dragover", e => {
                e.preventDefault()
            }, !1), document.addEventListener("drop", e => i(this, void 0, void 0, function* () {
                e.preventDefault();
                let t = e.dataTransfer, n = t.files, i = t.items;
                if (void 0 !== i && null !== i && i.length > 0) for (let e = 0; e < i.length; e++) {
                    let t = i[e];
                    "string" === t.kind && "text/uri-list" === t.type ? t.getAsString(e => {
                        r.NativeCallModule.nativeCall.CallNativeFunction("DropOpenUrl", e)
                    }) : t.kind
                }
                if (void 0 !== n && null !== n && n.length > 0) for (let e = 0; e < n.length; e++) {
                    let t = n[e].path;
                    void 0 !== t && null !== t && "" !== t && (yield o.FileSystemAWNS.existsAW(t)) && r.NativeCallModule.nativeCall.CallNativeFunction("DropOpenFile", t)
                }
            }), !1)
        }
    }(t.ThunderToolsNS || (t.ThunderToolsNS = {}))
}, function (e, t, n) {
    e.exports = n(9)(60)
}, function (e, t) {
    e.exports = require("http")
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(49), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(3), r = n(4);
    let s = class extends r.Vue {
        onOptionsChanged() {
            this.appendContent()
        }

        appendContent() {
            this.dropdown || (this.dropdown = new o.remote.DropdownWindow), this.dropdown.clear(), this.options.forEach(e => {
                "separator" === e ? this.dropdown.append(new o.remote.DropdownWindowContent({type: "separator"})) : this.dropdown.append(new o.remote.DropdownWindowContent({
                    label: e.toString(),
                    click: () => {
                        this.$refs.select.menuVisible = !1, this.$emit("input", e, !0)
                    }
                }))
            })
        }

        handleMenuShow() {
            return a(this, void 0, void 0, function* () {
                if (void 0 === this.options || !Array.isArray(this.options) || 0 === this.options.length) return;
                this.dropdown || this.appendContent();
                let e = this.$el.getBoundingClientRect();
                const {DropDownWindowSkinNS: t} = yield Promise.resolve().then(() => n(131));
                t.setStyle(this.dropdown, {
                    windowPreference: {
                        marginLeft: 0,
                        marginRight: 0,
                        stringWidth: Math.round(e.width) - 39
                    }
                }), this.dropdown.popup({
                    window: o.remote.getCurrentWindow(),
                    x: Math.round(e.left),
                    y: Math.round(e.top + e.height + 4)
                })
            })
        }
    };
    i([r.Prop()], s.prototype, "value", void 0), i([r.Prop({default: () => []})], s.prototype, "options", void 0), i([r.Watch("options")], s.prototype, "onOptionsChanged", null), s = i([r.Component], s), t.default = s
}, , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = n(3), r = n(786), s = n(2), l = n(6), u = n(1), d = n(10), c = n(38), h = n(56), f = n(194),
        g = n(7), p = n(23), k = n(787), m = n(563), T = n(14),
        v = g.default(s.join(__rootDir, "../bin/ThunderHelper.node")), C = u.default.getLogger("login-helper");
    !function (e) {
        e.loginUIHelper = new class {
            constructor() {
            }

            createLoginWnd(e, t, n, i, a) {
                o.ipcRenderer.send(p.NodeEventMesssageNS.eventLoginWndCreate, e, t, n, i, a)
            }

            closeLoginWnd(e) {
                o.ipcRenderer.send(p.NodeEventMesssageNS.eventLoginWndClose, e)
            }

            updateLoginWnd(e, t, n, i, a) {
                o.ipcRenderer.send(p.NodeEventMesssageNS.eventLoginWndShow, e, t, n, i, a), o.ipcRenderer.once(p.NodeEventMesssageNS.eventLoginWndShowResult, (e, t) => {
                    t && m.LoginOptionNS.loginOption.attachListenerEvent()
                })
            }

            createPersonalInfoWnd(e, t) {
                return i(this, void 0, void 0, function* () {
                    return new Promise(n => i(this, void 0, void 0, function* () {
                        o.ipcRenderer.once("personal-info-window-created", (e, t) => {
                            n(o.remote.BrowserWindow.fromId(t))
                        });
                        let i = yield T.default("IsLogined");
                        o.ipcRenderer.send("create-personal-info-window", e, t, i)
                    }))
                })
            }

            createRetryLoginWnd(e, t) {
                o.ipcRenderer.send(p.NodeEventMesssageNS.eventRetryLoginWndCreate, e, t)
            }

            createModifierUserInfoWnd(e) {
                o.ipcRenderer.send(p.NodeEventMesssageNS.eventModifierUserinfoWndCreate, e)
            }
        }, e.loginSDKHelper = new class {
            constructor() {
                this.curUserInfo = null, this.key = "XUNLEIACCOUNT123", this.loginInfo = null, this.loginDataDir = s.join(__profilesDir, "xlaccount/"), this.loginDataPath = s.join(__profilesDir, "xlaccount/accountdata.dat"), this.deviceId = "", C.information("loginSDKHelper obj create")
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    let e = yield d.FileSystemAWNS.existsAW(`${this.loginDataPath}`);
                    e || (e = yield d.FileSystemAWNS.mkdirsAW(`${this.loginDataDir}`)) && (yield d.FileSystemAWNS.writeFileAW(`${this.loginDataPath}`, "")), yield this.loadLoginDataFromFile(), yield this.getDeviceID(), yield k.activityObj.getActiveConfig()
                })
            }

            getDeviceID() {
                return i(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (null !== this.deviceId && void 0 !== this.deviceId && "" !== this.deviceId) {
                            e = this.deviceId;
                            break
                        }
                        let t = "", n = "", i = "SYSTEM_CONFIG", a = "DEVICEID", o = v.getPublicUserDataPath(),
                            r = s.join(o, "Thunder Network/Thunder"), l = s.join(r, "/xlconfig.ini");
                        if ("" !== o && ((yield d.FileSystemAWNS.mkdirsAW(r)) && (n = v.readINI(l, i, a)), C.information("得到文件保存 peeridMd5Str:", n)), "" === n) {
                            let e = v.getPeerID();
                            n = c.ToolsUtilitiesAWNS.genarateMd5(e), C.information("重新计算 peeridStr:", e, ";peeridMd5Str:", n), (yield d.FileSystemAWNS.mkdirsAW(r)) && v.writeINI(l, i, a, n)
                        }
                        let u = v.getDmideCode(), h = c.ToolsUtilitiesAWNS.genarateMd5(u);
                        C.information("dmideCodeStr:", u, ";dmideCodeMd5Str:", h), t = h + n, e = c.ToolsUtilitiesAWNS.genarateMd5(t), this.deviceId = e
                    } while (0);
                    return C.information("deviceIDMd5Str:", e), e
                })
            }

            getInitData() {
                let e = s.join(__rootDir, "../../Thunder.exe"), t = v.getFileVersion(e),
                    n = k.activityObj.getActivityInfo(), i = n.activityEnable, o = n.activityCssPath;
                return C.information("getInitData:", n), JSON.stringify({
                    appid: "0",
                    package: "com.xunlei.thunderx",
                    appkey: "4af30ad6c6b0c02c4d8df3ded2cb79b8",
                    platform: "pc-xdas",
                    osversion: a.release(),
                    thunderVersion: t,
                    activityEnable: i,
                    activityCssPath: o
                })
            }

            saveData(e, t, n) {
                return i(this, void 0, void 0, function* () {
                    C.information("SaveData type:", e, ";key:", t, ";data:", n);
                    let i = !1;
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(n) || "" === n) break;
                        if ("memory" === e) {
                            l.isNullOrUndefined(this.curUserInfo) && (this.curUserInfo = {});
                            try {
                                this.curUserInfo[t] = JSON.parse(n)
                            } catch (e) {
                                C.information(e)
                            }
                            i = !0
                        } else if ("file" === e) {
                            l.isNullOrUndefined(this.loginInfo) && (this.loginInfo = {});
                            try {
                                this.loginInfo[t] = JSON.parse(n);
                                let e = JSON.stringify(this.loginInfo);
                                C.information("SaveData bufStr:", e);
                                let a = new Buffer(e), o = c.ToolsUtilitiesAWNS.encryptBuffer(a, this.key);
                                i = yield d.FileSystemAWNS.writeFileAW(this.loginDataPath, o)
                            } catch (e) {
                                C.information(e)
                            }
                        } else i = !0
                    } while (0);
                    return h.NativeCallHostModule.nativeCallHost.fireNativeEvent("onChangeLoginData", e, t, n), i
                })
            }

            loadData(e, t) {
                let n = null;
                do {
                    if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t)) break;
                    if ("memory" === e) {
                        if (l.isNullOrUndefined(this.curUserInfo) || l.isNullOrUndefined(this.curUserInfo[t]) || "" === this.curUserInfo[t]) break;
                        n = JSON.stringify(this.curUserInfo[t])
                    } else {
                        if ("file" !== e) break;
                        if (l.isNullOrUndefined(this.loginInfo) || l.isNullOrUndefined(this.loginInfo[t]) || "" === this.loginInfo[t]) break;
                        n = JSON.stringify(this.loginInfo[t])
                    }
                } while (0);
                return C.information("loadData:data = ", n), n
            }

            loadLoginDataFromFile() {
                return i(this, void 0, void 0, function* () {
                    do {
                        let e = yield d.FileSystemAWNS.readFileAW(`${this.loginDataPath}`);
                        if (l.isNullOrUndefined(e) || "" === e.toString()) {
                            C.information("loadLoginDataFromFile no buf data");
                            break
                        }
                        let t = "";
                        try {
                            if (t = c.ToolsUtilitiesAWNS.decryptBuffer(e, this.key).toString(), l.isNullOrUndefined(t) || "" === t) {
                                C.information("loadLoginDataFromFile decryption bufStr is null");
                                break
                            }
                            this.loginInfo = JSON.parse(t), C.information("loadLoginDataFromFile decryption this.loginInfo:", this.loginInfo)
                        } catch (e) {
                            yield d.FileSystemAWNS.unlinkAW(this.loginDataPath);
                            break
                        }
                    } while (0)
                })
            }
        }, e.loginHelper = new class {
            constructor() {
                this.curUserInfo = null, this.curLoginInfo = null, this.dir = s.join(__profilesDir, "Community/UserImages"), C.information("loginHelper obj create")
            }

            getCurInternetState() {
                return v.getCurInternetState()
            }

            getUserHeaderAw(e) {
                return i(this, void 0, void 0, function* () {
                    C.information("enter getUserHeaderAw");
                    let t = "";
                    do {
                        if (null === e || void 0 === e || "" === e) break;
                        let n = e + ".jpg", i = s.join(this.dir, n);
                        (yield d.FileSystemAWNS.existsAW(i)) && (t = `file:///${i}`)
                    } while (0);
                    return C.information("leave getUserHeaderAw:", t, e), t
                })
            }

            getUserHeader(e) {
                C.information("enter getUserHeader");
                let t = "";
                do {
                    if (null === e || void 0 === e || "" === e) break;
                    let n = e + ".jpg", i = s.join(this.dir, n);
                    v.queryFileExists(i) && (t = `file:///${i}`)
                } while (0);
                return C.information("leave getUserHeader:", t, e), t
            }

            updateHeaderAw(e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = "";
                    do {
                        if (C.information("enter updateHeaderAw:", e, t), null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                        let i = t + ".jpg", a = s.join(this.dir, i);
                        (yield f.AxiosNS.downloadFileAW(e, a)) && (n = `file:///${a}?_=${Date.now()}`)
                    } while (0);
                    return C.information("leave updateHeaderAw:", n), n
                })
            }

            getUserInfo(...e) {
                void 0 !== r.xlQuickLogin && r.xlQuickLogin.getUserInfo(...e)
            }

            getSessionIDAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.getUserInfo("sessionid", t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.getUserInfo(t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoEx(e, t) {
                r.xlQuickLogin.getAllUserInfo(n => {
                    this.curUserInfo = n, null !== this.curUserInfo && void 0 !== this.curUserInfo && "" !== this.curUserInfo ? r.xlQuickLogin.getUserInfo(n => {
                        this.curLoginInfo = n, C.information(this.curLoginInfo);
                        let i = "";
                        if (null === e || 0 === e || 3 === e) {
                            let e = {}, t = this.getUserInfoStr();
                            e[1] = t;
                            let n = this.getVipInfoStr();
                            e[2] = n, i = JSON.stringify(e)
                        } else if (1 === e) {
                            let e = this.getUserInfoStr();
                            i = JSON.stringify(e)
                        } else if (2 === e) {
                            let e = this.getVipInfoStr();
                            i = JSON.stringify(e)
                        }
                        t(i)
                    }) : t("")
                })
            }

            getAllUserInfo(...e) {
                void 0 !== r.xlQuickLogin && r.xlQuickLogin.getAllUserInfo(...e)
            }

            getAllUserInfoAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.getAllUserInfo(t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoByKeyAw(e, t) {
                return i(this, void 0, void 0, function* () {
                    return new Promise(n => {
                        null !== t && void 0 !== t && "vip_xl" === t ? r.xlQuickLogin.getAllUserInfo(t => {
                            let i = "";
                            do {
                                if (null === t || void 0 === t) break;
                                if (null === t.vipList || void 0 === t.vipList) break;
                                if (null === t.vipList[0] || void 0 === t.vipList[0]) break;
                                i = t.vipList[0][e]
                            } while (0);
                            n(i)
                        }) : r.xlQuickLogin.getAllUserInfo(e, e => {
                            n(e)
                        })
                    })
                })
            }

            isLogined(...e) {
                void 0 !== r.xlQuickLogin && void 0 !== e && r.xlQuickLogin.isLogined(...e)
            }

            isLoginedAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.isLogined(t => {
                            e(t)
                        })
                    })
                })
            }

            showLoginDlg(e, t, n) {
                C.information(e), null !== t && void 0 !== t || (t = !0), m.LoginOptionNS.loginOption.setOption(n), h.NativeCallHostModule.nativeCallHost.fireNativeEvent("onShowLoginWnd", e, t)
            }

            logout() {
                void 0 !== r.xlQuickLogin && (C.information("调用 logout 接口"), r.xlQuickLogin.logout())
            }

            logIn(e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.retryLogin && (C.information("enter xlQuickLogin.retryLogin"), r.xlQuickLogin.retryLogin())
            }

            switchAccount(e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.switchAccount && r.xlQuickLogin.switchAccount()
            }

            isAutologin(...e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.isAutologin && r.xlQuickLogin.isAutologin(...e)
            }

            channel(e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.channel && r.xlQuickLogin.channel(e)
            }

            getUserInfoStr() {
                return {
                    username: this.curLoginInfo.userName,
                    usernewno: this.curUserInfo.userNewNo,
                    userid: this.curUserInfo.userID,
                    sessionid: this.curLoginInfo.sessionid,
                    nickName: this.curUserInfo.nickName,
                    account: this.curUserInfo.account,
                    rank: this.curUserInfo.rank,
                    order: this.curUserInfo.order,
                    isSubAccount: this.curUserInfo.isSubAccount,
                    country: this.curUserInfo.country,
                    province: this.curUserInfo.province,
                    city: this.curUserInfo.city,
                    birthday: this.curUserInfo.birthday,
                    sex: this.curUserInfo.sex,
                    mobile: this.curUserInfo.mobile,
                    isSpecialNum: this.curUserInfo.isSpecialNum,
                    role: this.curUserInfo.role,
                    todayScore: this.curUserInfo.todayScore,
                    personalSign: this.curUserInfo.personalSign
                }
            }

            getVipInfoStr() {
                let e = this.curUserInfo.vipList[0];
                return {
                    vasid: e.vasid,
                    isVip: e.isVip,
                    vipLevel: e.vipLevel,
                    expireDate: e.expireDate,
                    vasType: e.vasType,
                    payId: e.payId,
                    payName: e.payName,
                    vipGrow: e.vipGrow,
                    vipDayGrow: e.vipDayGrow,
                    isAutoDeduct: e.isAutoDeduct,
                    isRemind: e.isRemind,
                    isYear: e.isYear,
                    register: e.register
                }
            }
        }
    }(t.LoginHelperNS || (t.LoginHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(68), a = n(143), o = n(567), r = n(575), s = n(145), l = n(129), u = n(57), d = n(203), c = n(829),
        h = n(246), f = n(8), g = n(830), p = n(232), k = n(733), m = n(283), T = n(580);
    n(835), n(836), function (e) {
        const t = u.PluginHelperNS.getHelper(), n = d.ConfigHelperNS.getHelper(), v = i.UserHelperNS.getHelper(),
            C = a.DkHelperNS.getHelper(), S = c.UIHelperNS.getHelper(), y = g.TaskSceneManagerNS.getSceneManager(),
            w = s.TaskEventContainerNS.getEventContainer(), I = o.ErrorCodeHelperNS.getHelper(),
            b = r.DownloadManagerNS.getDownloadManager(), A = h.TaskManagerNS.getTaskManager(),
            N = p.KuainiaoManagerNS.getManager();

        function D(e, t) {
            C.startTask(e), b.enterAcclerate(e, t).catch()
        }

        function _(e, t) {
            let n = "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_hytq_js";
            e && (n = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=supervip&timeType=1006&referfrom=v_pc_xlx_hytq_cjjs"), n = n + "&aidfrom=" + t, S.openTab(n)
        }

        e.init = function () {
            t.init(), n.init().catch(), v.init(), C.init(), S.init(), y.init(), I.init(), b.init(), N.init()
        }, e.clickVipAcclerateBtn = function (e, t, n) {
            n = n || "task", m.VipStatNS.vipButtonClick(e, t, n), t && !v.isSuperVip ? _(t, n) : D(e, l.VipDownloadDefineNS.VipTaskType.Vip)
        }, e.clickTryAcclerateBtn = function (e, t) {
            t = t || "task";
            let n = !1, i = b.getVipTaskInfo(e);
            i && (n = i.isSuper), n ? T.TryStatNS.superTryButtonClick(e, t) : T.TryStatNS.tryButtonClick(e, t), D(e, l.VipDownloadDefineNS.VipTaskType.Try)
        }, e.clickBatchAcclerateBtn = function (e, t, n) {
            n = n || "task";
            let i = !1;
            e.length > 0 && m.VipStatNS.vipButtonClick(e[0], t, n);
            for (let t of e) {
                let e = A.getTask(t);
                if (e) {
                    if (e.getTaskStatus() === f.DownloadKernel.TaskStatus.Failed) continue;
                    let n = e.getTaskExtra();
                    if (n.vipTaskStatus > l.VipDownloadDefineNS.VipTaskStatus.Init) continue;
                    if (n.vipTaskType === l.VipDownloadDefineNS.VipTaskType.Vip && !v.authority) continue;
                    D(t, n.vipTaskType), i = !0
                }
            }
            i || _(t, n)
        }, e.clickScenceText = function (e, t) {
            let n = t.textlink;
            S.openTab(n), y.onClickScene(e), k.SceneStatNS.scenceClick(e, t)
        }, e.clickToolbarVipBtn = function () {
            S.openTab("https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip")
        }, e.clickTryOpenVipBtn = function (e, t, n) {
            let i = void 0;
            if ("Finished" === t) {
                n ? (T.TryStatNS.superTryOpenVipButtonClick(e, "cjjssyend"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=supervip&timeType=1006&referfrom=v_pc_xlx_hytq_cjjs_sy&aidfrom=syend") : (T.TryStatNS.tryOpenVipButtonClick(e, "syend"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_hytq_gs_sy&aidfrom=syend");
                let t = A.getTask(e);
                t && t.getTaskExtra().onTryFinishOpenVipClick()
            } else n ? (T.TryStatNS.superTryOpenVipButtonClick(e, "cjjssying"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=supervip&timeType=1006&referfrom=v_pc_xlx_hytq_cjjs_sy&aidfrom=sying") : (T.TryStatNS.tryOpenVipButtonClick(e, "sying"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_hytq_gs_sy&aidfrom=sying");
            S.openTab(i)
        }, e.openTab = function (e) {
            S.openTab(e)
        }, e.attachTaskEvent = function (e, t) {
            w.attachListener(e, t)
        }, e.detachTaskEvent = function (e, t) {
            w.detachListener(e, t)
        }, e.attachSceneEvent = function (e, t) {
            y.attachListener(e, t)
        }, e.detachSceneEvent = function (e, t) {
            y.detachListener(e, t)
        }, e.attachKuaiNiaoEvent = function (e, t) {
            N.attachListener(e, t)
        }, e.detachKuaiNiaoEvent = function (e, t) {
            N.detachListener(e, t)
        }, e.getVipTaskInfo = function (e) {
            return b.getVipTaskInfo(e)
        }, e.getVipSubTaskInfo = function (e, t) {
            return b.getVipSubTaskInfo(e, t)
        }, e.getSceneItem = function (e) {
            return y.getScene(e)
        }, e.getVipAccelerateMenuState = function (e) {
            let t = !1, n = !1;
            for (let i of e) {
                let e = A.getTask(i);
                if (e) {
                    if (e.getTaskStatus() === f.DownloadKernel.TaskStatus.Failed) continue;
                    if (e.getTaskExtra().vipTaskStatus > l.VipDownloadDefineNS.VipTaskStatus.Init) {
                        n = !0;
                        continue
                    }
                    t = !0
                }
            }
            let i = "会员加速";
            !t && n && (i = "已会员加速");
            let a = {enable: t, text: i};
            return JSON.stringify(a)
        }, e.onItemExpandChanged = function (e, t) {
            t ? (b.onTaskExpand(e).catch(), y.onTaskExpand(e)) : (b.onTaskUnExpand(e), y.onTaskUnExpand(e))
        }
    }(t.VipDownloadPlugin || (t.VipDownloadPlugin = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(70), o = n(1), r = n(12), s = n(71), l = o.default.getLogger("MenuSkinNS");
    !function (e) {
        function t(e, t) {
            if (l.information("setStyle", e, t), null !== e) {
                let n = {windowPreference: a.WindowPreferenceNS.getWindowPreference()};
                l.information("skinOpts", n), e.setStyle(s(n, t))
            }
        }

        e.setStyle = t, e.popEditableDefaultContextMenu = function (e, n, a) {
            let o = i.remote.getCurrentWebContents();
            o.once("context-menu", (a, s) => {
                if (l.verbose(a), s.isEditable) {
                    let a = [{
                        label: "撤销", enabled: s.editFlags.canUndo, click: () => {
                            o.undo()
                        }
                    }, {type: "separator"}, {
                        label: "剪切", enabled: s.editFlags.canCut, click: () => {
                            o.cut()
                        }
                    }, {
                        label: "复制", enabled: s.editFlags.canCopy, click: () => {
                            o.copy()
                        }
                    }, {
                        label: "粘贴",
                        enabled: s.editFlags.canPaste && r.ThunderUtil.isClipboardTextFormatAvailable(),
                        click: () => {
                            o.paste()
                        }
                    }, {
                        label: "删除", enabled: s.editFlags.canDelete, click: () => {
                            o.delete()
                        }
                    }, {type: "separator"}, {
                        label: "全选", enabled: s.editFlags.canSelectAll, click: () => {
                            o.selectAll()
                        }
                    }];
                    if (void 0 !== e && "function" == typeof e) {
                        let t = e(s);
                        void 0 !== t && t.length > 0 && (void 0 === n ? n = a.length : (n < 0 && (n = a.length + 1 + n) < 0 && (n = 0), n > a.length && (n = a.length)), a.splice(n, 0, ...t))
                    }
                    let l = i.remote.Menu.buildFromTemplate(a);
                    t(l, {}), l.popup({window: i.remote.getCurrentWindow()})
                }
            })
        }
    }(t.MenuSkinNS || (t.MenuSkinNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(30), a = n(152), o = n(153), r = n(741), s = n(864), l = n(865), u = n(868), d = n(869), c = n(871),
        h = n(872), f = n(873), g = n(874);
    i.default.use(a.default);
    const p = new a.default.Store({
        modules: {
            Tabs: r.default,
            DownloadListState: l.default,
            WebView: u.default,
            SettingConf: s.default,
            Community: d.default,
            PrivateSpaceState: c.default,
            UpgradeTaskState: h.default,
            BookMarks: f.default,
            Group: g.default
        }, strict: !1
    });
    t.connector = new o.default(p)
}, function (e, t) {
    e.exports = require("zlib")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(6), a = n(18), o = n(19), r = n(27), s = 0;
    !function (e) {
        class t {
            constructor() {
                this.nativeCallInfoList = [], this.webviewInfoId = -1
            }

            initialize() {
                this.bindMsgListeners()
            }

            addDelegate(e) {
                this.delegate = e
            }

            removeDelegate() {
                this.delegate = null
            }

            callJsFunctionById(e, t, ...n) {
                a.information(`funcId = ${t}`);
                do {
                    if (!i.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (!i.isNumber(t)) {
                        a.error(`funcId = ${t} error`);
                        break
                    }
                    if (this.isInvalidId(t)) {
                        a.error(`funcId = ${t} invalid`);
                        break
                    }
                    let r = o.CommonIPCMessage.msgNCCallJsFunctionById, s = [t].concat(n);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

            callJsFunctionByName(e, t, ...n) {
                a.information(`funcName = ${t}`);
                do {
                    if (!i.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let r = o.CommonIPCMessage.msgNCCallJsFunctionByName, s = [t].concat(n);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

            fireNativeEvent(e, ...t) {
                a.information(`eventName = ${e}`);
                do {
                    if (i.isNullOrUndefined(e) || 0 === e.length) {
                        a.error(`eventName = ${e} error`);
                        break
                    }
                    let n = o.CommonIPCMessage.msgNCNativeFireEvent, r = [e].concat(t);
                    this.sendMsgToWebviewNativeCall(n, r);
                    for (let e of this.nativeCallInfoList) this.sendMsgToNativeCall(e.id, n, r)
                } while (0)
            }

            bindMsgListeners() {
                this.bindWebviewMsgListeners(), this.bindIPCMsgListeners()
            }

            bindWebviewMsgListeners() {
                const e = document.querySelector("webview");
                i.isNullOrUndefined(e) ? a.error("webview is null") : e.addEventListener("ipc-message", e => {
                    do {
                        if (e.channel === o.CommonIPCMessage.msgNCCallNativeFunction) {
                            this.handleWebviewCallNativeFunction(e.args[0]);
                            break
                        }
                        if (e.channel === o.CommonIPCMessage.msgNCCheckNativeFunction) {
                            this.handleWebviewCheckNativeFunction(e.args[0]);
                            break
                        }
                    } while (0)
                })
            }

            bindIPCMsgListeners() {
                r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallNativeFunction, e => {
                    this.handleCallNativeFunction(e)
                }), r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCheckNativeFunction, e => {
                    this.handleCheckNativeFunction(e)
                }), r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCNativeCallReady, e => {
                    this.handleNativeCallReady(e.msg.args)
                })
            }

            handleCallNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (i.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let n = e.msg.args;
                    if (i.isNullOrUndefined(n)) {
                        a.error("args is null");
                        break
                    }
                    let o = n[0];
                    if (!i.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = n[1];
                    if (!i.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    n.splice(0, 2), this.appendNativeCallInfoList(t), this.delegate.onJsCallNativeFunction(t.id, o, r, n)
                } while (0)
            }

            handleCheckNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (i.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let n = e.msg.args;
                    if (i.isNullOrUndefined(n)) {
                        a.error("args is null");
                        break
                    }
                    let o = n[0];
                    if (!i.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = n[1];
                    if (!i.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    this.appendNativeCallInfoList(t), n.splice(0, 2), this.delegate.onJsCheckNativeFunction(t.id, o, r)
                } while (0)
            }

            handleNativeCallReady(e) {
                do {
                    if (i.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (i.isNullOrUndefined(t)) {
                        a.error(`info = ${t} error`);
                        break
                    }
                    this.appendNativeCallInfoList(t)
                } while (0)
            }

            handleWebviewCallNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (!i.isString(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let n = e[1];
                    if (!i.isNumber(n)) {
                        a.error(`callbackId = ${n} error`);
                        break
                    }
                    e.splice(0, 2), this.delegate.onJsCallNativeFunction(this.webviewInfoId, t, n, e)
                } while (0)
            }

            handleWebviewCheckNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (!i.isString(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let n = e[1];
                    if (!i.isNumber(n)) {
                        a.error(`callbackId = ${n} error`);
                        break
                    }
                    e.splice(0, 2), this.delegate.onJsCheckNativeFunction(this.webviewInfoId, t, n)
                } while (0)
            }

            appendNativeCallInfoList(e) {
                let t = !0;
                for (let n of this.nativeCallInfoList) if (n.id === e.id) {
                    t = !1;
                    break
                }
                t && this.nativeCallInfoList.push(e)
            }

            findNativeCallInfo(e) {
                for (let t of this.nativeCallInfoList) if (t.id === e) return t;
                return null
            }

            isWebviewInfo(e) {
                return e === this.webviewInfoId
            }

            sendMsgToWebviewNativeCall(e, t) {
                const n = document.querySelector("webview");
                do {
                    if (i.isNullOrUndefined(n)) {
                        a.error("webview is null");
                        break
                    }
                    if (i.isNullOrUndefined(n.send)) {
                        a.error("webview.send is null");
                        break
                    }
                    n.send(e, t)
                } while (0)
            }

            sendMsgToNativeCall(e, t, n) {
                do {
                    let o = this.findNativeCallInfo(e);
                    if (i.isNullOrUndefined(o)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    r.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(o.id, {name: t, args: n})
                } while (0)
            }

            isInvalidId(e) {
                return e === s
            }
        }

        e.NativeCallHost = t, e.nativeCallHost = new t
    }(t.NativeCallHostModule || (t.NativeCallHostModule = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});

    class i {
        constructor() {
            this.mThunderVersionStr = void 0, this.mThunderVersionNumber = void 0, this.mNativeCall = null
        }

        init() {
            global.AsyncGetNativeCallModuleObj && global.AsyncGetNativeCallModuleObj(e => {
                this.mNativeCall = e.nativeCall, this.loadThunderVersion()
            })
        }

        get thunderVersionNumber() {
            return this.mThunderVersionNumber
        }

        get thunderVersionString() {
            return this.mThunderVersionStr
        }

        get clientName() {
            return "xl_pc"
        }

        get pluginVersion() {
            return "1.0"
        }

        get currentTime() {
            return Math.floor((new Date).getTime() / 1e3)
        }

        get nativeCall() {
            return this.mNativeCall
        }

        loadThunderVersion() {
            this.mNativeCall && this.mNativeCall.CallNativeFunction("GetThunderVersion", (e, t) => {
                if (0 === e) {
                    this.mThunderVersionStr = t, this.mThunderVersionNumber = 0;
                    let e = this.mThunderVersionStr.split(".");
                    if (e && 4 === e.length) {
                        let t = Number(e[0]).valueOf(), n = Number(e[1]).valueOf(), i = Number(e[2]).valueOf(), a = 128;
                        this.mThunderVersionNumber = a * Math.pow(2, 24) + t * Math.pow(2, 16) + n * Math.pow(2, 8) + i
                    }
                }
            })
        }
    }

    t.PluginHelper = i, function (e) {
        const t = new i;
        e.getHelper = function () {
            return t
        }
    }(t.PluginHelperNS || (t.PluginHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(8);
    let o = ["apk", "avi", "chm", "doc", "exe", "flv", "ipa", "ipsw", "iso", "mkv", "mov", "mp4"];
    o.push(...["mpg", "pdf", "ppt", "rar", "rm", "rmvb", "txt", "wmv", "xls"]);
    const r = ".xv;.xlmv;.3gp;.3gp2;.3gpp;.3gpp2;.3mm;.3p2;.60d;.787;.aaf;.aep;.aepx;.aet;.aetx;.ajp;.ale;.amv;.amx;.arf;\n  .asf;.asx;.avb;.avd;.avi;.avp;.avs;.avs;.axm;.bdm;.bdmv;.bik;.bix;.bmk;.bnp;.box;.bs4;.bsf;.byu;.camproj;.camrec;.clpi;.cmmp;\n  .cmmtpl;.cmproj; .cmrec;.cpi;.cst;.cvc;.d2v;.d3v;.dat;.dav;.dce;.dck;.ddat;.dif;.dir;.divx;.dlx; .dmb;.dmsm;.dmsm3d;.dmss;.dnc;.dpg;\n  .dream;.dsy;.dv;.dv-avi;.dv4;.dvdmedia; .dvr-ms;.dvx;.dxr;.dzm;.dzp;.dzt;.edl;.evo;.eye;.f4p;.f4v;.fbr;.fbr;.fbz;.fcp; .flc;.flh;\n  .fli;.flv;.flx;.gfp;.gl;.grasp;.gts;.gvi;.gvp;.hdmov;.hkm;.ifo; .imovieproj;.imovieproject;.iva;.ivf;.ivr;.ivs;.izz;.izzy;.jts;.jtv;\n  .k3g;.lrec; .lsf;.lsx;.m15;.m1pg;.m1v;.m21;.m21;.m2a;.m2p;.m2t;.m2ts;.m2v;.m4e;.m4u;.m4v; .m75;.meta;.mgv;.mj2;.mjp;.mjpg;.mkv;.mmv;\n  .mnv;.mod;.modd;.moff;.moi;.moov;.mov;.movie;.mp21;.mp2v;.mp4;.mp4v;.mpe;.mpeg;.mpeg4;.mpf;.mpg;.mpg2;.mpgindex; .mpl;.mpls;\n  .mpsub;.mpv;.mpv2;.mqv;.msdvd;.msh;.mswmm;.mts;.mtv;.mvb;.mvc;.mvd; .mve;.mvp;.mvy;.mxf;.mys;.ncor;.nsv;.nuv;.nvc;.ogm;.ogv;.ogx;.osp;\n  .par;.pds;.pgi; .piv;.pjs;.pmf;.pns;.ppj;.prel;.pro;.prproj;.prtl;.psh;.pssd;.pva;.pvr;.pxv; .qt;.qtch;.qtl;.qtm;.qtz;\n  .r3d;.rcproject;.rdb;.rec;.rm;.rmd;.rmp;.rms;.rmvb;.roq; .rp;.rts;.rts;.rum;.rv;.sbk;.sbt;.scc;.scm;.scn;.screenflow;.sec;.seq;.sfd;\n  .sfvidcap;.smk;.sml;.smv;.spl;.ssm;.stl;.str;.stx;.sub;.svi;.swf;.swi; .swt;.tda3mt;.tivo;.tix;.tod;.tp;.tp0;.tpd;\n  .tpr;.trp;.ts;.tts;.tvs;.vc1;.vcpf;.vcr; .vcv;.vdo;.vdr;.veg;.vem;.vf;.vfw;.vfz;.vgz;.vid;.viewlet;.viv;.vivo;.vlab;.vob; .vp3;.vp6;.vp7;\n  .vro;.vs4;.vse;.vsp;.w32;.wcp;.webm;.wlmp;.wm;.wmd;.wmmp; .wmv;.wmx;.wp3;.wpl;.wtv;.wvx;.xfl;.xvid;.yuv;.zm1;.zm2;.zm3;.zmv;",
        s = ".exe;.com;.bat;.msi;.apk;.ipa;.iso;.mds;.bin;.img;.ipsw;",
        l = ".txt;.html;.htm;.shtml;.xhtml;.chm;.hlp;.inf;.rtf;.tex;.ltx;.doc;.docx;.wps;.ppt;.pptx;.odf;.pdf;.xls;.xlsx;.docm;.\n  dot;.dotm;.dotx;.email;.rp;.pps;.et;.ett;.xlt;.dbf;.prn;.csv;.mht;.mhtml;.xml;.wpt;.dps;.dpt;.pot;.ppsx;.epub;.mobi;.lit;.wdl;.ceb;.abm;\n  .pdg;.umb;.ibooks;",
        u = ".aiff;.cue;.m3u;.au;.cdda;.raw;.wav;.flac;.tak;.mp3;.aac;.wma;.m4a;.mid;.mka;.mp2;.mpa;.mpc;.ape;.ofr;\n  .ogg;.ra;.wv;.tta;.ac3;.dts;.nsf;.mod;.s3m;.xm;.it;.vst;",
        d = ".psd;.tga;.gif;.jpeg;.jpg;.jp2;.bmp;.ico;.pcx;.png;.pbm;.pgm;.ppm;.pnm;.pgf;.arw;.cr2;.crw;.dcr;.dng;.erf;.kdc;.mef;\n  .mos;.mrw;.nef;.nrw;.orf;.pef;.ptx;.r3d;.raf;.raw;.rw2;.srf;.srw;.x3f;.ras;.tiff;.tif;.wbmp;.ilbm;.lbm;.iff;.ico;",
        c = ".zip;.zipx;.rar;.7z;.isz;.cab;.arj;.ace;.alz;.uue;.tar;.gz; .gzip;.tgz;.tpz;.bzip2;.bz2;.bz;.tbz;.tbz2;.xz;.txz;\n  .lzh;.lha;.zt;.az; .xpi;.jar;.wim;.swm;.rpm;.xar;.deb;.dmg;.hfs;.cpio;.lzma;.lzma86;.split;",
        h = ".torrent;",
        f = ".3gp;.asf;.avi;.divx;.f4v;.flv;.mkv;.mov;.movie;.mp4;.mpeg;.mpeg4;.mpg;.mpg2;.rm;.rmvb;.rp;.swf;.tp;.tp0;.ts;.wmv",
        g = ".exe;.com;.bat;.msi", p = ".wav;.flac;.mp3;.aac;.wma;.m4a;.mid;.ape;.ogg;.ra;.mod",
        k = ".psd;.tga;.gif;.jpeg;.jpg;.jp2;.bmp;.ico;.pcx;.pdf;.png;.pbm;.pgm;.ppm;.pnm;.pgf;.arw;.cr2;.crw;.dcr;.dng;.erf;.kdc;\n  .mef;.mos;.mrw;.nef;.nrw;.orf;.pef;.ptx;.r3d;.raf;.raw;.rw2;.srf;.srw;.x3f;.ras;.tiff;.tif;.wbmp;.ilbm;.lbm;.iff;.ico",
        m = ".txt;.html;.htm;.shtml;.xhtml;.chm;.hlp;.inf;.rtf;.tex;.ltx;.doc;.docx;.wps;.ppt;.pptx;.odf;.pdf;.xls;.xlsx;.docm;.dot;.dotm;.dotx;.email;.rp;.pps",
        T = ".rar;.tar;.zip;.gzip;.cab;.uue;.arj;.bz2;.lzh;.jar;.ace;.iso;.7-zip;.7z";
    !function (e) {
        let t;

        function n(e) {
            let n = t.Unkown, a = i.extname(e);
            return null !== a && void 0 !== a && a.length >= 2 && (a = a.toLowerCase()), void 0 === a || "" === a || a.length < 2 ? n = t.Unkown : f.indexOf(a) > -1 ? n = t.Video : g.indexOf(a) > -1 ? n = t.Software : m.indexOf(a) > -1 ? n = t.Doc : p.indexOf(a) > -1 ? n = t.Music : k.indexOf(a) > -1 ? n = t.Pic : T.indexOf(a) > -1 && (n = t.Zip), a.length > 1 && ".z" === a.slice(0, 2) && /[0-9]+/.test(a.substring(2)) && (n = t.Zip), n
        }

        e.getTaskIcon = function (e, t) {
            let n = "";
            do {
                if (t === a.DownloadKernel.TaskType.Bt) {
                    n = "xlx-icon-type-bt-file";
                    break
                }
                if (t === a.DownloadKernel.TaskType.Group) {
                    n = "xlx-icon-type-group";
                    break
                }
                n = "xlx-icon-type-unknown";
                let f = i.extname(e);
                if ("" === f || f.length < 2) break;
                f = f.toLowerCase();
                let g = (f += ";").substring(1);
                if (o.indexOf(g) > -1) {
                    n = "doc" === f ? "xlx-icon-type-word" : "xlx-icon-type-" + g;
                    break
                }
                if (r.indexOf(f) > -1) {
                    n = "xlx-icon-type-video";
                    break
                }
                if (s.indexOf(f) > -1) {
                    n = "xlx-icon-type-install", [".mds", ".bin", ".img"].indexOf(f) > -1 && (n = "xlx-icon-type-iso");
                    break
                }
                if (l.indexOf(f) > -1) {
                    if (n = "xlx-icon-type-doc", [".htm", ".html", ".mht"].indexOf(f) > -1) {
                        n = "xlx-icon-type-link";
                        break
                    }
                    if ("docx" === f) {
                        n = "xlx-icon-type-word";
                        break
                    }
                    if ("xlsx" === f) {
                        n = "xlx-icon-type-xls";
                        break
                    }
                    if ("pptx" === f) {
                        n = "xlx-icon-type-ppt";
                        break
                    }
                    break
                }
                if (u.indexOf(f) > -1) {
                    n = "xlx-icon-type-music";
                    break
                }
                if (d.indexOf(f) > -1) {
                    n = "xlx-icon-type-pic";
                    break
                }
                if (c.indexOf(f) > -1) {
                    n = "xlx-icon-type-rar";
                    break
                }
                if (h.indexOf(f) > -1) {
                    n = "xlx-icon-type-bt-link";
                    break
                }
            } while (0);
            return n
        }, function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Video = 1] = "Video", e[e.Software = 2] = "Software", e[e.Doc = 3] = "Doc", e[e.Music = 4] = "Music", e[e.Pic = 5] = "Pic", e[e.Zip = 6] = "Zip", e[e.Bt = 7] = "Bt"
        }(t = e.FileExtType || (e.FileExtType = {})), e.getTaskFileType = function (e, n) {
            let a = t.Unkown;
            return void 0 === n && void 0 !== e && (n = i.extname(e)), null !== n && void 0 !== n && n.length >= 2 && (n = n.toLowerCase(), n += ";"), void 0 === n || "" === n || n.length < 3 ? a = t.Unkown : r.indexOf(n) > -1 ? a = t.Video : s.indexOf(n) > -1 ? a = t.Software : l.indexOf(n) > -1 ? a = t.Doc : u.indexOf(n) > -1 ? a = t.Music : d.indexOf(n) > -1 ? a = t.Pic : c.indexOf(n) > -1 ? a = t.Zip : h.indexOf(n) > -1 && (a = t.Bt), n.length > 1 && ".z" === n.slice(0, 2) && /[0-9]+/.test(n.substring(2)) && (a = t.Zip), a
        }, e.getGroupFileType = n, e.getDefaultGroupPrefix = function (e) {
            let i = "任务组";
            do {
                if (void 0 === e || null === e || 0 === e.length) break;
                let a = [];
                for (let e = 0; e < 7; e++) a[e] = 0;
                for (let t of e) {
                    let e = n(t);
                    a[e] = a[e] + 1
                }
                let o = t.Unkown;
                for (let e = 1; e < a.length; e++) a[e] > a[o] && (o = e);
                o === t.Video ? i = "视频任务组" : o === t.Software ? i = "程序任务组" : o === t.Music ? i = "音乐任务组" : o === t.Pic ? i = "图片任务组" : o === t.Doc ? i = "文档任务组" : o === t.Zip && (i = "压缩包任务组")
            } while (0);
            return i
        }, e.compareVersion = function (e, t) {
            let n = -2;
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let i = 0, a = 0, o = 0, r = 0, s = 0, l = 0, u = 0, d = 0, c = e.split(/\./);
                if (null === c || void 0 === c || c.length < 3) break;
                if (i = Number(c[0]), a = Number(c[1]), o = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (r = Number(c[3])), null === (c = t.split(/\./)) || void 0 === c || c.length < 3) break;
                if (s = Number(c[0]), l = Number(c[1]), u = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (d = Number(c[3])), s > i) {
                    n = 1;
                    break
                }
                if (s < i) {
                    n = -1;
                    break
                }
                if (l > a) {
                    n = 1;
                    break
                }
                if (l < a) {
                    n = -1;
                    break
                }
                if (u > o) {
                    n = 1;
                    break
                }
                if (u < o) {
                    n = -1;
                    break
                }
                if (0 !== r) {
                    if (d > r) {
                        n = 1;
                        break
                    }
                    if (d < r) {
                        n = -1;
                        break
                    }
                }
                n = 0
            } while (0);
            return n
        }
    }(t.TaskUtilHelper || (t.TaskUtilHelper = {}))
}, function (e, t) {
    e.exports = require("events")
}, function (e, t, n) {
    "use strict";
    e.exports = function (e, t) {
        return function () {
            for (var n = new Array(arguments.length), i = 0; i < n.length; i++) n[i] = arguments[i];
            return e.apply(t, n)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = n(37);
    e.exports = function (e, t, n) {
        var a = n.config.validateStatus;
        n.status && a && !a(n.status) ? t(i("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n)
    }
}, function (e, t, n) {
    "use strict";
    e.exports = function (e, t, n, i, a) {
        return e.config = t, n && (e.code = n), e.request = i, e.response = a, e
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);

    function a(e) {
        return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
    }

    e.exports = function (e, t, n) {
        if (!t) return e;
        var o;
        if (n) o = n(t); else if (i.isURLSearchParams(t)) o = t.toString(); else {
            var r = [];
            i.forEach(t, function (e, t) {
                null !== e && void 0 !== e && (i.isArray(e) ? t += "[]" : e = [e], i.forEach(e, function (e) {
                    i.isDate(e) ? e = e.toISOString() : i.isObject(e) && (e = JSON.stringify(e)), r.push(a(t) + "=" + a(e))
                }))
            }), o = r.join("&")
        }
        return o && (e += (-1 === e.indexOf("?") ? "?" : "&") + o), e
    }
}, function (e, t) {
    e.exports = require("https")
}, function (e, t, n) {
    var i = n(31), a = n(47), o = n(64), r = n(91), s = n(81).Writable, l = n(115)("follow-redirects"),
        u = {GET: !0, HEAD: !0, OPTIONS: !0, TRACE: !0}, d = Object.create(null);

    function c(e, t) {
        s.call(this), e.headers = e.headers || {}, this._options = e, this._redirectCount = 0, this._requestBodyLength = 0, this._requestBodyBuffers = [], t && this.on("response", t);
        var n = this;
        if (this._onNativeResponse = function (e) {
            n._processResponse(e)
        }, !e.pathname && e.path) {
            var i = e.path.indexOf("?");
            i < 0 ? e.pathname = e.path : (e.pathname = e.path.substring(0, i), e.search = e.path.substring(i))
        }
        this._performRequest()
    }

    function h(e) {
        var t = {maxRedirects: 21, maxBodyLength: 10485760}, n = {};
        return Object.keys(e).forEach(function (a) {
            var o = a + ":", s = n[o] = e[a], u = t[a] = Object.create(s);
            u.request = function (e, a) {
                return "string" == typeof e ? (e = i.parse(e)).maxRedirects = t.maxRedirects : e = Object.assign({
                    protocol: o,
                    maxRedirects: t.maxRedirects,
                    maxBodyLength: t.maxBodyLength
                }, e), e.nativeProtocols = n, r.equal(e.protocol, o, "protocol mismatch"), l("options", e), new c(e, a)
            }, u.get = function (e, t) {
                var n = u.request(e, t);
                return n.end(), n
            }
        }), t
    }

    ["abort", "aborted", "error", "socket", "timeout"].forEach(function (e) {
        d[e] = function (t) {
            this._redirectable.emit(e, t)
        }
    }), c.prototype = Object.create(s.prototype), c.prototype.write = function (e, t, n) {
        this._requestBodyLength + e.length <= this._options.maxBodyLength ? (this._requestBodyLength += e.length, this._requestBodyBuffers.push({
            data: e,
            encoding: t
        }), this._currentRequest.write(e, t, n)) : (this.emit("error", new Error("Request body larger than maxBodyLength limit")), this.abort())
    }, c.prototype.end = function (e, t, n) {
        var i = this._currentRequest;
        e ? this.write(e, t, function () {
            i.end(null, null, n)
        }) : i.end(null, null, n)
    }, c.prototype.setHeader = function (e, t) {
        this._options.headers[e] = t, this._currentRequest.setHeader(e, t)
    }, c.prototype.removeHeader = function (e) {
        delete this._options.headers[e], this._currentRequest.removeHeader(e)
    }, ["abort", "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", "setTimeout"].forEach(function (e) {
        c.prototype[e] = function (t, n) {
            return this._currentRequest[e](t, n)
        }
    }), ["aborted", "connection", "socket"].forEach(function (e) {
        Object.defineProperty(c.prototype, e, {
            get: function () {
                return this._currentRequest[e]
            }
        })
    }), c.prototype._performRequest = function () {
        var e = this._options.protocol, t = this._options.nativeProtocols[e];
        if (this._options.agents) {
            var n = e.substr(0, e.length - 1);
            this._options.agent = this._options.agents[n]
        }
        var a = this._currentRequest = t.request(this._options, this._onNativeResponse);
        for (var o in this._currentUrl = i.format(this._options), a._redirectable = this, d) o && a.on(o, d[o]);
        if (this._isRedirect) {
            var r = this._requestBodyBuffers;
            !function e() {
                if (0 !== r.length) {
                    var t = r.pop();
                    a.write(t.data, t.encoding, e)
                } else a.end()
            }()
        }
    }, c.prototype._processResponse = function (e) {
        var t = e.headers.location;
        if (t && !1 !== this._options.followRedirects && e.statusCode >= 300 && e.statusCode < 400) {
            if (++this._redirectCount > this._options.maxRedirects) return void this.emit("error", new Error("Max redirects exceeded."));
            var n, a = this._options.headers;
            if (307 !== e.statusCode && !(this._options.method in u)) for (n in this._options.method = "GET", this._requestBodyBuffers = [], a) /^content-/i.test(n) && delete a[n];
            if (!this._isRedirect) for (n in a) /^host$/i.test(n) && delete a[n];
            var o = i.resolve(this._currentUrl, t);
            l("redirecting to", o), Object.assign(this._options, i.parse(o)), this._isRedirect = !0, this._performRequest()
        } else e.responseUrl = this._currentUrl, this.emit("response", e), this._requestBodyBuffers = []
    }, e.exports = h({http: a, https: o}), e.exports.wrap = h
}, function (e, t, n) {
    "use strict";
    e.exports = function (e) {
        return !(!e || !e.__CANCEL__)
    }
}, function (e, t, n) {
    "use strict";

    function i(e) {
        this.message = e
    }

    i.prototype.toString = function () {
        return "Cancel" + (this.message ? ": " + this.message : "")
    }, i.prototype.__CANCEL__ = !0, e.exports = i
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(789), o = n(72), r = n(57), s = n(1).default.getLogger("Thunder.VipDownload.user-info"),
        l = r.PluginHelperNS.getHelper();
    var u;
    !function (e) {
        e.login = "OnLogin", e.logout = "OnLogout", e.authorityChanged = "OnAuthorityChanged"
    }(u = t.UserEventNS || (t.UserEventNS = {}));

    class d extends o.default {
        constructor() {
            super(...arguments), this.mHasFlux = !1, this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0
        }

        init() {
            this.setMaxListeners(0), l.nativeCall && this.attachUserEvents()
        }

        getPeerId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : l.nativeCall ? l.nativeCall.CallNativeFunction("GetPeerID", (t, n) => {
                        0 === t && n && "" !== n && (this.mPeerId = n), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getSessionId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : l.nativeCall ? l.nativeCall.CallNativeFunction("GetSessionID", (t, n) => {
                        0 === t && (this.mSessionId = n), e(this.mSessionId || "0")
                    }) : e(this.mSessionId || "0")
                })
            })
        }

        get jumpKey() {
            return ""
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPlatinumVip() {
            return this.isVip && this.vasType > 2
        }

        get isSuperVip() {
            return this.isVip && 5 === this.vasType
        }

        get hasFlux() {
            return this.mHasFlux
        }

        get vipLevel() {
            return this.mVipLevel
        }

        get vasType() {
            return this.mVasType
        }

        get userLevel() {
            return 1
        }

        get authority() {
            return this.isVip || this.hasFlux
        }

        get offlineAuthority() {
            return this.isLogin
        }

        queryFlux() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.getPeerId(), t = {userId: this.userId, peerId: e, jumpKey: this.jumpKey},
                    n = yield(new a.UserHttpSession).queryFlux(t);
                n && 0 === n.result && n.capacity > 0 && (this.mHasFlux = !0)
            })
        }

        attachUserEvents() {
            l.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                yield this.onLogin()
            })), l.nativeCall.AttachNativeEvent("onLogout", () => {
                this.onLogout()
            }), l.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => i(this, void 0, void 0, function* () {
                yield this.onUserInfoChange(e, t)
            })), l.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                this.onLoginStatusChange(t)
            })
        }

        onLogin() {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3eonLogin"), this.clear(), this.mIsLogin = !0, yield this.parseUserInfo(), this.fireEvent(u.login), this.isVip || (yield this.queryFlux()), this.fireEvent(u.authorityChanged, this.authority), s.information("<--onLogin")
            })
        }

        onLogout() {
            s.information("--\x3eonLogout"), this.clear(), this.fireEvent(u.logout), this.fireEvent(u.authorityChanged, !1), s.information("<--onLogout")
        }

        onUserInfoChange(e, t) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3eonUserInfoChange"), "vipinfo" === e && (s.information("data", t), yield this.parseUserInfo(), this.mIsVip && this.fireEvent(u.authorityChanged, this.authority, !0)), s.information("<--onUserInfoChange")
            })
        }

        onLoginStatusChange(e) {
            s.information("--\x3eonLoginStatusChange", "newStatus", e), "offline" === e && this.onLogout(), s.information("<--onLoginStatusChange")
        }

        clear() {
            this.mUserId = "0", this.mSessionId = void 0, this.mHasFlux = !1, this.mIsVip = !1, this.mIsLogin = !1, this.mVasType = 0, this.mVipLevel = 0
        }

        parseUserInfo() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (s.information("userinfo", e), e) if (this.mUserId = e.userID || "0", e.vipList && e.vipList[0]) {
                    if (e.vipList[0].isVip) {
                        let t = Number(e.vipList[0].isVip).valueOf();
                        this.mIsVip = t > 0
                    } else this.mIsVip = !1;
                    e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf())
                } else this.mIsVip = !1
            })
        }

        getUserinfo() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetAllUserInfo", (n, i) => {
                        0 === n && (t = i), e(t)
                    }) : e(t)
                })
            })
        }
    }

    t.UserHelper = d, function (e) {
        const t = new d;
        e.getHelper = function () {
            return t
        }
    }(t.UserHelperNS || (t.UserHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(12), o = n(21), r = n(5);
    !function (e) {
        e.getDownloadDir = function () {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    r.NativeCallModule.nativeCall.CallNativeFunction("GetDownloadDir", (t, n) => {
                        t === o.NativeFunctionErrorCode.Success ? e(n) : e(a.ThunderUtil.getDefaultDownloadDir())
                    })
                })
            })
        }, e.getConfigValueAW = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise(i => {
                    r.NativeCallModule.nativeCall.CallNativeFunction("GetConfigValue", e, t, n, (e, t) => {
                        e === o.NativeFunctionErrorCode.Success ? i(t) : i(n)
                    })
                })
            })
        }, e.isSingleBtTask = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    r.NativeCallModule.nativeCall.CallNativeFunction("IsSingleBtTask", e, (e, n) => {
                        e === o.NativeFunctionErrorCode.Success ? t(n) : t(!1)
                    })
                })
            })
        }
    }(t.NativeCallAWNS || (t.NativeCallAWNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(86), a = n(80);
    !function (e) {
        e.getWindowPreference = function (e = !1) {
            let t = a.default(), n = {};
            return t && t.colors && "string" == typeof t.colors.colorPrimaryControl1 && (n.hoverBackgroundColor = e ? parseInt(i.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1), 16) : i.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1)), n
        }
    }(t.WindowPreferenceNS || (t.WindowPreferenceNS = {}))
}, function (e, t, n) {
    (function (e) {
        var n = 200, i = "__lodash_hash_undefined__", a = 800, o = 16, r = 9007199254740991, s = "[object Arguments]",
            l = "[object AsyncFunction]", u = "[object Function]", d = "[object GeneratorFunction]",
            c = "[object Null]", h = "[object Object]", f = "[object Proxy]", g = "[object Undefined]",
            p = /^\[object .+?Constructor\]$/, k = /^(?:0|[1-9]\d*)$/, m = {};
        m["[object Float32Array]"] = m["[object Float64Array]"] = m["[object Int8Array]"] = m["[object Int16Array]"] = m["[object Int32Array]"] = m["[object Uint8Array]"] = m["[object Uint8ClampedArray]"] = m["[object Uint16Array]"] = m["[object Uint32Array]"] = !0, m[s] = m["[object Array]"] = m["[object ArrayBuffer]"] = m["[object Boolean]"] = m["[object DataView]"] = m["[object Date]"] = m["[object Error]"] = m[u] = m["[object Map]"] = m["[object Number]"] = m[h] = m["[object RegExp]"] = m["[object Set]"] = m["[object String]"] = m["[object WeakMap]"] = !1;
        var T = "object" == typeof global && global && global.Object === Object && global,
            v = "object" == typeof self && self && self.Object === Object && self,
            C = T || v || Function("return this")(), S = "object" == typeof t && t && !t.nodeType && t,
            y = S && "object" == typeof e && e && !e.nodeType && e, w = y && y.exports === S, I = w && T.process,
            b = function () {
                try {
                    return I && I.binding && I.binding("util")
                } catch (e) {
                }
            }(), A = b && b.isTypedArray;

        function N(e, t) {
            return "__proto__" == t ? void 0 : e[t]
        }

        var D, _, x, E = Array.prototype, P = Function.prototype, M = Object.prototype, F = C["__core-js_shared__"],
            O = P.toString, U = M.hasOwnProperty,
            L = (D = /[^.]+$/.exec(F && F.keys && F.keys.IE_PROTO || "")) ? "Symbol(src)_1." + D : "", B = M.toString,
            K = O.call(Object),
            V = RegExp("^" + O.call(U).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
            R = w ? C.Buffer : void 0, W = C.Symbol, H = C.Uint8Array, j = R ? R.allocUnsafe : void 0,
            G = (_ = Object.getPrototypeOf, x = Object, function (e) {
                return _(x(e))
            }), z = Object.create, $ = M.propertyIsEnumerable, q = E.splice, X = W ? W.toStringTag : void 0,
            J = function () {
                try {
                    var e = Se(Object, "defineProperty");
                    return e({}, "", {}), e
                } catch (e) {
                }
            }(), Y = R ? R.isBuffer : void 0, Q = Math.max, Z = Date.now, ee = Se(C, "Map"), te = Se(Object, "create"),
            ne = function () {
                function e() {
                }

                return function (t) {
                    if (!Pe(t)) return {};
                    if (z) return z(t);
                    e.prototype = t;
                    var n = new e;
                    return e.prototype = void 0, n
                }
            }();

        function ie(e) {
            var t = -1, n = null == e ? 0 : e.length;
            for (this.clear(); ++t < n;) {
                var i = e[t];
                this.set(i[0], i[1])
            }
        }

        function ae(e) {
            var t = -1, n = null == e ? 0 : e.length;
            for (this.clear(); ++t < n;) {
                var i = e[t];
                this.set(i[0], i[1])
            }
        }

        function oe(e) {
            var t = -1, n = null == e ? 0 : e.length;
            for (this.clear(); ++t < n;) {
                var i = e[t];
                this.set(i[0], i[1])
            }
        }

        function re(e) {
            var t = this.__data__ = new ae(e);
            this.size = t.size
        }

        function se(e, t) {
            var n = Ne(e), i = !n && Ae(e), a = !n && !i && _e(e), o = !n && !i && !a && Fe(e), r = n || i || a || o,
                s = r ? function (e, t) {
                    for (var n = -1, i = Array(e); ++n < e;) i[n] = t(n);
                    return i
                }(e.length, String) : [], l = s.length;
            for (var u in e) !t && !U.call(e, u) || r && ("length" == u || a && ("offset" == u || "parent" == u) || o && ("buffer" == u || "byteLength" == u || "byteOffset" == u) || ye(u, l)) || s.push(u);
            return s
        }

        function le(e, t, n) {
            (void 0 === n || be(e[t], n)) && (void 0 !== n || t in e) || ce(e, t, n)
        }

        function ue(e, t, n) {
            var i = e[t];
            U.call(e, t) && be(i, n) && (void 0 !== n || t in e) || ce(e, t, n)
        }

        function de(e, t) {
            for (var n = e.length; n--;) if (be(e[n][0], t)) return n;
            return -1
        }

        function ce(e, t, n) {
            "__proto__" == t && J ? J(e, t, {configurable: !0, enumerable: !0, value: n, writable: !0}) : e[t] = n
        }

        ie.prototype.clear = function () {
            this.__data__ = te ? te(null) : {}, this.size = 0
        }, ie.prototype.delete = function (e) {
            var t = this.has(e) && delete this.__data__[e];
            return this.size -= t ? 1 : 0, t
        }, ie.prototype.get = function (e) {
            var t = this.__data__;
            if (te) {
                var n = t[e];
                return n === i ? void 0 : n
            }
            return U.call(t, e) ? t[e] : void 0
        }, ie.prototype.has = function (e) {
            var t = this.__data__;
            return te ? void 0 !== t[e] : U.call(t, e)
        }, ie.prototype.set = function (e, t) {
            var n = this.__data__;
            return this.size += this.has(e) ? 0 : 1, n[e] = te && void 0 === t ? i : t, this
        }, ae.prototype.clear = function () {
            this.__data__ = [], this.size = 0
        }, ae.prototype.delete = function (e) {
            var t = this.__data__, n = de(t, e);
            return !(n < 0 || (n == t.length - 1 ? t.pop() : q.call(t, n, 1), --this.size, 0))
        }, ae.prototype.get = function (e) {
            var t = this.__data__, n = de(t, e);
            return n < 0 ? void 0 : t[n][1]
        }, ae.prototype.has = function (e) {
            return de(this.__data__, e) > -1
        }, ae.prototype.set = function (e, t) {
            var n = this.__data__, i = de(n, e);
            return i < 0 ? (++this.size, n.push([e, t])) : n[i][1] = t, this
        }, oe.prototype.clear = function () {
            this.size = 0, this.__data__ = {hash: new ie, map: new (ee || ae), string: new ie}
        }, oe.prototype.delete = function (e) {
            var t = Ce(this, e).delete(e);
            return this.size -= t ? 1 : 0, t
        }, oe.prototype.get = function (e) {
            return Ce(this, e).get(e)
        }, oe.prototype.has = function (e) {
            return Ce(this, e).has(e)
        }, oe.prototype.set = function (e, t) {
            var n = Ce(this, e), i = n.size;
            return n.set(e, t), this.size += n.size == i ? 0 : 1, this
        }, re.prototype.clear = function () {
            this.__data__ = new ae, this.size = 0
        }, re.prototype.delete = function (e) {
            var t = this.__data__, n = t.delete(e);
            return this.size = t.size, n
        }, re.prototype.get = function (e) {
            return this.__data__.get(e)
        }, re.prototype.has = function (e) {
            return this.__data__.has(e)
        }, re.prototype.set = function (e, t) {
            var i = this.__data__;
            if (i instanceof ae) {
                var a = i.__data__;
                if (!ee || a.length < n - 1) return a.push([e, t]), this.size = ++i.size, this;
                i = this.__data__ = new oe(a)
            }
            return i.set(e, t), this.size = i.size, this
        };
        var he, fe = function (e, t, n) {
            for (var i = -1, a = Object(e), o = n(e), r = o.length; r--;) {
                var s = o[he ? r : ++i];
                if (!1 === t(a[s], s, a)) break
            }
            return e
        };

        function ge(e) {
            return null == e ? void 0 === e ? g : c : X && X in Object(e) ? function (e) {
                var t = U.call(e, X), n = e[X];
                try {
                    e[X] = void 0;
                    var i = !0
                } catch (e) {
                }
                var a = B.call(e);
                i && (t ? e[X] = n : delete e[X]);
                return a
            }(e) : function (e) {
                return B.call(e)
            }(e)
        }

        function pe(e) {
            return Me(e) && ge(e) == s
        }

        function ke(e) {
            return !(!Pe(e) || L && L in e) && (xe(e) ? V : p).test(function (e) {
                if (null != e) {
                    try {
                        return O.call(e)
                    } catch (e) {
                    }
                    try {
                        return e + ""
                    } catch (e) {
                    }
                }
                return ""
            }(e))
        }

        function me(e) {
            if (!Pe(e)) return function (e) {
                var t = [];
                if (null != e) for (var n in Object(e)) t.push(n);
                return t
            }(e);
            var t = we(e), n = [];
            for (var i in e) ("constructor" != i || !t && U.call(e, i)) && n.push(i);
            return n
        }

        function Te(e, t, n, i, a) {
            e !== t && fe(t, function (o, r) {
                if (Pe(o)) a || (a = new re), function (e, t, n, i, a, o, r) {
                    var s = N(e, n), l = N(t, n), u = r.get(l);
                    if (u) return void le(e, n, u);
                    var d = o ? o(s, l, n + "", e, t, r) : void 0, c = void 0 === d;
                    if (c) {
                        var f = Ne(l), g = !f && _e(l), p = !f && !g && Fe(l);
                        d = l, f || g || p ? Ne(s) ? d = s : Me(C = s) && De(C) ? d = function (e, t) {
                            var n = -1, i = e.length;
                            t || (t = Array(i));
                            for (; ++n < i;) t[n] = e[n];
                            return t
                        }(s) : g ? (c = !1, d = function (e, t) {
                            if (t) return e.slice();
                            var n = e.length, i = j ? j(n) : new e.constructor(n);
                            return e.copy(i), i
                        }(l, !0)) : p ? (c = !1, k = l, m = !0 ? (T = k.buffer, v = new T.constructor(T.byteLength), new H(v).set(new H(T)), v) : k.buffer, d = new k.constructor(m, k.byteOffset, k.length)) : d = [] : function (e) {
                            if (!Me(e) || ge(e) != h) return !1;
                            var t = G(e);
                            if (null === t) return !0;
                            var n = U.call(t, "constructor") && t.constructor;
                            return "function" == typeof n && n instanceof n && O.call(n) == K
                        }(l) || Ae(l) ? (d = s, Ae(s) ? d = function (e) {
                            return function (e, t, n, i) {
                                var a = !n;
                                n || (n = {});
                                var o = -1, r = t.length;
                                for (; ++o < r;) {
                                    var s = t[o], l = i ? i(n[s], e[s], s, n, e) : void 0;
                                    void 0 === l && (l = e[s]), a ? ce(n, s, l) : ue(n, s, l)
                                }
                                return n
                            }(e, Oe(e))
                        }(s) : (!Pe(s) || i && xe(s)) && (d = function (e) {
                            return "function" != typeof e.constructor || we(e) ? {} : ne(G(e))
                        }(l))) : c = !1
                    }
                    var k, m, T, v;
                    var C;
                    c && (r.set(l, d), a(d, l, i, o, r), r.delete(l));
                    le(e, n, d)
                }(e, t, r, n, Te, i, a); else {
                    var s = i ? i(N(e, r), o, r + "", e, t, a) : void 0;
                    void 0 === s && (s = o), le(e, r, s)
                }
            }, Oe)
        }

        function ve(e, t) {
            return Ie(function (e, t, n) {
                return t = Q(void 0 === t ? e.length - 1 : t, 0), function () {
                    for (var i = arguments, a = -1, o = Q(i.length - t, 0), r = Array(o); ++a < o;) r[a] = i[t + a];
                    a = -1;
                    for (var s = Array(t + 1); ++a < t;) s[a] = i[a];
                    return s[t] = n(r), function (e, t, n) {
                        switch (n.length) {
                            case 0:
                                return e.call(t);
                            case 1:
                                return e.call(t, n[0]);
                            case 2:
                                return e.call(t, n[0], n[1]);
                            case 3:
                                return e.call(t, n[0], n[1], n[2])
                        }
                        return e.apply(t, n)
                    }(e, this, s)
                }
            }(e, t, Be), e + "")
        }

        function Ce(e, t) {
            var n, i, a = e.__data__;
            return ("string" == (i = typeof (n = t)) || "number" == i || "symbol" == i || "boolean" == i ? "__proto__" !== n : null === n) ? a["string" == typeof t ? "string" : "hash"] : a.map
        }

        function Se(e, t) {
            var n = function (e, t) {
                return null == e ? void 0 : e[t]
            }(e, t);
            return ke(n) ? n : void 0
        }

        function ye(e, t) {
            var n = typeof e;
            return !!(t = null == t ? r : t) && ("number" == n || "symbol" != n && k.test(e)) && e > -1 && e % 1 == 0 && e < t
        }

        function we(e) {
            var t = e && e.constructor;
            return e === ("function" == typeof t && t.prototype || M)
        }

        var Ie = function (e) {
            var t = 0, n = 0;
            return function () {
                var i = Z(), r = o - (i - n);
                if (n = i, r > 0) {
                    if (++t >= a) return arguments[0]
                } else t = 0;
                return e.apply(void 0, arguments)
            }
        }(J ? function (e, t) {
            return J(e, "toString", {
                configurable: !0, enumerable: !1, value: (n = t, function () {
                    return n
                }), writable: !0
            });
            var n
        } : Be);

        function be(e, t) {
            return e === t || e != e && t != t
        }

        var Ae = pe(function () {
            return arguments
        }()) ? pe : function (e) {
            return Me(e) && U.call(e, "callee") && !$.call(e, "callee")
        }, Ne = Array.isArray;

        function De(e) {
            return null != e && Ee(e.length) && !xe(e)
        }

        var _e = Y || function () {
            return !1
        };

        function xe(e) {
            if (!Pe(e)) return !1;
            var t = ge(e);
            return t == u || t == d || t == l || t == f
        }

        function Ee(e) {
            return "number" == typeof e && e > -1 && e % 1 == 0 && e <= r
        }

        function Pe(e) {
            var t = typeof e;
            return null != e && ("object" == t || "function" == t)
        }

        function Me(e) {
            return null != e && "object" == typeof e
        }

        var Fe = A ? function (e) {
            return function (t) {
                return e(t)
            }
        }(A) : function (e) {
            return Me(e) && Ee(e.length) && !!m[ge(e)]
        };

        function Oe(e) {
            return De(e) ? se(e, !0) : me(e)
        }

        var Ue, Le = (Ue = function (e, t, n) {
            Te(e, t, n)
        }, ve(function (e, t) {
            var n = -1, i = t.length, a = i > 1 ? t[i - 1] : void 0, o = i > 2 ? t[2] : void 0;
            for (a = Ue.length > 3 && "function" == typeof a ? (i--, a) : void 0, o && function (e, t, n) {
                if (!Pe(n)) return !1;
                var i = typeof t;
                return !!("number" == i ? De(n) && ye(t, n.length) : "string" == i && t in n) && be(n[t], e)
            }(t[0], t[1], o) && (a = i < 3 ? void 0 : a, i = 1), e = Object(e); ++n < i;) {
                var r = t[n];
                r && Ue(e, r, n, a)
            }
            return e
        }));

        function Be(e) {
            return e
        }

        e.exports = Le
    }).call(this, n(87)(e))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(59);
    t.default = class {
        constructor() {
            this.emitter = null, this.emitter = new i.EventEmitter
        }

        attachOnceListener(e, t) {
            this.emitter.once(e, t)
        }

        attachListener(e, t) {
            this.emitter.addListener(e, t)
        }

        detachListener(e, t) {
            this.emitter.removeListener(e, t)
        }

        fireEvent(e, ...t) {
            return this.emitter.emit(e, ...t)
        }

        setMaxListeners(e) {
            this.emitter.setMaxListeners(e)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(7), r = n(1), s = n(10), l = n(83), u = n(32), d = n(90), c = n(59), h = n(717), f = n(5),
        g = n(23);
    !function (e) {
        const t = u.DownloadKernelTaskManager.getTaskManager(),
            n = d.DownloadKernelCategoryManager.getCategoryManager(),
            p = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
            k = r.default.getLogger("DownloadKernelManager");
        let m = void 0, T = !1, v = new c.EventEmitter;
        v.setMaxListeners(0);
        let C = 0;

        function S(e, t) {
            l.ThunderKernel.initDataBase(e, t)
        }

        function y(e, t, n, i) {
            l.ThunderKernel.initDownloadSdk(e, t, n, i)
        }

        function w(e, n) {
            t.attachListener(e, n)
        }

        e.init = function () {
            return i(this, void 0, void 0, function* () {
                let e = a.join(__rootDir, "../../Thunder.exe"), i = p.getFileVersion(e);
                l.ThunderKernel.registerDownloadSDKCrashCallback(() => {
                    ++C < 4 ? y(a.join(__rootDir, "../bin/SDK"), "xzcGMudGh1bmRlclg7MA^^SDK==edee53fd0b15e8d65dbfe7824f5f^a23", i, e => {
                        t.downloadSDKCrashRecover(e)
                    }) : t.downloadSDKCrash()
                }), w(g.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                    y(a.join(__rootDir, "../bin/SDK"), "xzcGMudGh1bmRlclg7MA^^SDK==edee53fd0b15e8d65dbfe7824f5f^a23", i, e => {
                        t.initDownloadKernelEnd(e)
                    })
                }), (yield s.FileSystemAWNS.existsAW(__profilesDir)) || (yield s.FileSystemAWNS.mkdirsAW(__profilesDir)), S(a.join(__profilesDir, "TaskDb.dat"), e => {
                    0 === e && (n.init(), t.loadTaskBase(), setInterval(() => {
                        t.queryTaskInfo()
                    }, 1e3), setTimeout(() => {
                        let e = p.getInstallChannel();
                        t.setGlobalExtInfo(e).catch(), f.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (n, i) => {
                            k.information(`stat dk onLoginStatusChange oldStatus ${n}, newState ${i}`), t.setGlobalExtInfo(e).catch()
                        })
                    }, 3e3))
                }), yield h.BTExtraTrackNS.initBtTaskTrackers()
            })
        }, e.getPeerId = function () {
            return i(this, void 0, void 0, function* () {
                let e = void 0;
                return e = m && "" !== m ? m : new Promise(e => {
                    T ? v.once("OnGetGlobalPeerId", t => {
                        e(t)
                    }) : l.ThunderKernel.queryGlobalInfo(1, (t, n) => {
                        k.information("getPeerId queryGlobalInfo glPeerId:", n), T = !1, m = n, e(n), v.emit("OnGetGlobalPeerId", n)
                    }) ? T = !0 : e("")
                })
            })
        }, e.initDataBase = S, e.initDownloadSdk = y, e.uninitialize = function () {
        }, e.startBatchOperationJournal = function () {
        }, e.endBatchOperationJournal = function () {
        }, e.getDownloadSdkVersion = function () {
            let e = a.join(__rootDir, "../bin/SDK/DownloadSDKServer.exe");
            return p.getFileVersion(e)
        }, e.setDownloadSpeedLimit = function (e) {
            return l.ThunderKernel.setDownloadSpeedLimit(e)
        }, e.setUploadSpeedLimit = function (e) {
            return l.ThunderKernel.setUploadSpeedLimit(e)
        }, e.setCacheSize = function (e) {
            return l.ThunderKernel.setCacheSize(e)
        }, e.enableCommonP2pChannel = function (e) {
            t.enableCommonP2pChannel(e)
        }, e.enableCommonP2sChannel = function (e) {
            t.enableCommonP2pChannel(e)
        }, e.getTotalDownloadSpeed = function () {
            return t.getTotalDownloadSpeed()
        }, e.getTotalUploadSpeed = function () {
            return t.getTotalUploadSpeed()
        }, e.getTotalDownloadSize = function () {
            return t.getTotalDownloadSize()
        }, e.getTotalUploadSize = function () {
            return t.getTotalUploadSize()
        }, e.getTotalTaskDownloadSpeed = function (e, n) {
            return t.getTotalTaskDownloadSpeed(e, n)
        }, e.getTotalTaskVipSpeed = function (e, n) {
            return t.getTotalTaskVipSpeed(e, n)
        }, e.attachListener = w, e.attachOnceListener = function (e, n) {
            t.attachOnceListener(e, n)
        }, e.detachListener = function (e, n) {
            t.detachListener(e, n)
        }, e.importUnfinishedTask = function (e, t, n) {
            l.ThunderKernel.importTask(e, t, n)
        }
    }(t.DownloadKernelManager || (t.DownloadKernelManager = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(72), l = n(8), u = n(34), d = n(73), c = n(23), h = n(15), f = n(564),
        g = n(126), p = n(12), k = n(20), m = n(10), T = r.default.getLogger("DownloadMgr"),
        v = u.DownloadKernelEventManager.getEventManager(),
        C = g.DownloadKernelCategoryViewManager.getCategoryViewManager(), S = [{
            type: "task",
            title: "新建下载任务",
            program: process.execPath,
            args: "-task:newtask -window:bringtotop",
            iconPath: `${__rootDir}/static/icon/jumplist_newtask.ico`,
            iconIndex: 0,
            description: "新建下载任务"
        }, {
            type: "task",
            title: "开始所有任务",
            program: process.execPath,
            args: "-task:startall",
            iconPath: `${__rootDir}/static/icon/jumplist_startalltask.ico`,
            iconIndex: 0,
            description: "开始所有任务"
        }, {
            type: "task",
            program: process.execPath,
            args: "-task:pauseall",
            iconPath: `${__rootDir}/static/icon/jumplist_pausealltask.ico`,
            iconIndex: 0,
            title: "暂停所有任务",
            description: "暂停所有任务"
        }, {
            type: "task",
            program: process.execPath,
            args: "-shell:exit",
            iconPath: `${__rootDir}/static/icon/jumplist_exit.ico`,
            iconIndex: 0,
            title: "退出迅雷",
            description: "退出迅雷"
        }];
    const y = new class extends s.default {
        constructor() {
            super(...arguments), this.completedList = [], this.recentList = [], this.tracked = !1, this.needSelectNext = !1, this.currentCategoryId = -1
        }

        setNeedSelectNext(e) {
            this.needSelectNext = e
        }

        getNeedSelectNext() {
            return this.needSelectNext
        }

        getCurrentCategoryId() {
            return this.currentCategoryId
        }

        setCurrentCategoryId(e) {
            this.currentCategoryId = e
        }

        trackWin7NewTrait() {
            this.trackTaskComplete(), d.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                let t = f.DownloadProgressNS.getDownloadDetails().progress;
                a.ipcRenderer.send(h.ThunderChannelList.channelRMSetProgressBar, t)
            })
        }

        trackTaskComplete() {
            a.remote.app.getJumpListSettings();
            do {
                if (this.tracked) break;
                this.tracked = !0, d.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                    this.initCompeltedList(), this.getJumplistGroup(), this.updateJumpList().catch(), this.attachCompletedCategoryViewChange()
                })
            } while (0)
        }

        updateJumpList() {
            return i(this, void 0, void 0, function* () {
                let e = [];
                e.push({type: "tasks", items: S});
                let t = [];
                if (this.recentList.length > 0) {
                    let e = k.ThunderHelper.isWindow7();
                    for (let n of this.recentList) {
                        let i = n.savePath, a = n.taskName;
                        void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                        let r = "", s = r = n.taskType === l.DownloadKernel.TaskType.Group ? i : o.join(i, a);
                        if (n.taskType === l.DownloadKernel.TaskType.Bt) s = `${__rootDir}/static/icon/jumplist_bttask.ico`; else do {
                            if (!e) break;
                            let t = yield p.ThunderUtil.getThunderTempPath(!0, "JumpIcon"), i = n.cid + ".ico";
                            "" === n.cid && (i = a + ".ico");
                            let l = o.join(t, i);
                            if (yield m.FileSystemAWNS.existsAW(l)) {
                                s = l;
                                break
                            }
                            k.ThunderHelper.extractIcon(r, l) && (s = l)
                        } while (0);
                        t.push({type: "task", title: a, iconPath: s, iconIndex: 0, args: "", program: r})
                    }
                } else t.push({type: "task", title: "最近没有完成任务", program: ""});
                t.length > 0 && (T.information("jumpRecentList", t), e.push({
                    name: "最近完成的任务",
                    items: t,
                    type: "custom"
                })), T.information("categories", e);
                try {
                    a.remote.app.setJumpList(e)
                } catch (e) {
                    T.warning("setJumpList error ", e)
                }
            })
        }

        sortCompletedList() {
            this.completedList.sort((e, t) => {
                let n = e.completionTime;
                return t.completionTime - n
            })
        }

        getJumplistGroup() {
            do {
                this.sortCompletedList();
                let e = a.remote.app.getJumpListSettings();
                T.information("getJumpListSettings", e);
                let t = e.removedItems;
                if (!t || 0 === t.length) {
                    T.information("update jumplist removedItems null");
                    break
                }
                if (0 === this.completedList.length) break;
                T.information("update jumplist removedItems", t);
                for (let e of t) for (let t = 0; t < this.completedList.length; t++) {
                    let n = this.completedList[t], i = n.savePath, a = n.taskName;
                    void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                    let r = "";
                    if (r = n.taskType === l.DownloadKernel.TaskType.Group ? i : o.join(i, a), e.iconPath && r.toLowerCase() === e.iconPath.toLowerCase()) {
                        this.completedList.splice(t, 1);
                        break
                    }
                }
            } while (0);
            let e = this.completedList.length > 4 ? 4 : this.completedList.length;
            this.recentList = this.completedList.slice(0, e), T.information("getJumplistGroup", this.recentList)
        }

        initCompeltedList() {
            let e = C.getCategoryViewFromId(l.DownloadKernel.CategroyViewID.Completed).getTasks();
            for (let [, t]of e) this.completedList.push(t.getTaskBaseInfo())
        }

        attachCompletedCategoryViewChange() {
            v.attachTaskEvent(l.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (!e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== l.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let n = t.map(e => e.getTaskBaseInfo());
                    this.completedList.push(...n), this.getJumplistGroup(), this.updateJumpList().catch()
                } while (0)
            }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== l.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let n = this.completedList.map(e => e.taskId);
                    for (let e of t) {
                        let t = n.indexOf(e.getId());
                        -1 !== t && (this.completedList.splice(t, 1), n.splice(t, 1))
                    }
                    this.getJumplistGroup(), this.updateJumpList().catch()
                } while (0)
            })
        }
    };
    t.default = y
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement;
        return (e._self._c || t)("td-select", e._g(e._b({
            ref: "select",
            attrs: {value: e.value, "custom-menu-enabled": ""},
            on: {"menu-show": e.handleMenuShow}
        }, "td-select", e.$attrs, !1), e.$listeners), [e._t("suffix", null, {slot: "suffix"}), e._v(" "), e._t("append", null, {slot: "append"})], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(136), a = n(6), o = n(1), r = n(59), s = o.default.getLogger("Thunder.MainRenderer.Tabs");
    t.createXDASTab = function (e) {
        let t = new i.Tab;
        return !1 === t.initTab(i.TabType.XDAS, e) && (t = null, s.error("init tab error")), t
    }, t.createNewTab = function (e, t) {
        let n = new i.Tab;
        return !1 === n.initTab(e, t) && (n = null, s.error("init tab error")), n
    }, t.createChromiumTab = function (e) {
        let t = new i.Tab, n = {url: e};
        return !1 === t.initTab(i.TabType.XDAS, n) && (t = null, s.error("init tab error")), t
    }, t.setDefaultListeners = function (e) {
        let t = !1;
        do {
            if (a.isNullOrUndefined(e)) {
                s.error("event listeners error");
                break
            }
            if (0 === e.length) {
                s.error("event listeners length error");
                break
            }
            i.Tab.defaultEventList = e, t = !0
        } while (0);
        return t
    }, t.setDefaultNativeFunctionMap = function (e) {
        let t = !1;
        do {
            if (a.isNullOrUndefined(e)) {
                s.error("event listeners error");
                break
            }
            if (0 === e.length) {
                s.error("event listeners length error");
                break
            }
            i.Tab.nativeFunctionMap = [...i.Tab.nativeFunctionMap, ...e], t = !0
        } while (0);
        return t
    }, function (e) {
        let t;
        !function (e) {
            e.Unknow = "Unknow", e.GotFocus = "GoFocus", e.RemoveTab = "RemoveTab", e.AddTab = "AddTab", e.ChangeTab = "ChangeTab", e.VisibleChange = "VisibleChange"
        }(t = e.EventType || (e.EventType = {}));
        let n = new r.EventEmitter;
        e.getEventEmitter = function () {
            return n
        }
    }(t.TabEventManagerNS || (t.TabEventManagerNS = {}));
    let l = 0;
    t.setCurrentTabID = function (e) {
        l = e
    }, t.getCurrentTabID = function () {
        return l
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(14), r = n(5), s = a.default.getLogger("Thunder.ShouldLogin");
    t.default = function (e = !1, t = !1, n) {
        return i(this, void 0, void 0, function* () {
            let i, a = null;
            try {
                let l = yield o.default("IsLogined"), u = yield o.default("GetUserID");
                l ? (s.information("is logined"), i = Promise.resolve(u)) : (i = new Promise((n, i) => {
                    let o = -1;
                    if (o = r.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => {
                        let t = Date.now();
                        s.information("On UserLogin", e, t, a), a && Math.floor(t - a) > 3e5 ? n("") : n(e), -1 !== o && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1)
                    }), !e) {
                        let e = r.NativeCallModule.nativeCall.AttachNativeEvent("OnLoginWndClose", i => {
                            do {
                                if ("close" === i) {
                                    if (n(""), !t && -1 !== o) {
                                        r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1;
                                        break
                                    }
                                } else if ("suc" === i && -1 !== o) break;
                                t && -1 !== o && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1)
                            } while (0);
                            r.NativeCallModule.nativeCall.DetachNativeEvent("OnLoginWndClose", e)
                        })
                    }
                }), e || (a = Date.now(), o.default("ShowLoginDlg", n).catch(e => {
                    s.warning(e)
                })))
            } catch (e) {
                s.warning(e), i = Promise.resolve("")
            }
            return i
        })
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(15);
    !function (e) {
        e.resizeToFitContent = function (e = 0, t = 0, n) {
            let a = i.remote.getCurrentWindow();
            if (e > 0 && t > 0) a.setSize(e, t); else {
                let e = document.querySelector(".td-dialog");
                a.setSize(e.offsetWidth, e.offsetHeight)
            }
            n && "function" == typeof n && n(), window.requestIdleCallback(() => {
                a.show()
            })
        }, e.autoAdaptScrollIntoView = function (e, t, n) {
            let i = t.scrollTop, a = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = a.bottom;
            void 0 !== n && "number" == typeof n && n > 0 && (r = a.top + n), o.top < a.top ? t.scrollTop = i - (a.top - o.top) : o.bottom > r && (t.scrollTop = i + (o.bottom - r))
        }, e.fitWindowPosInParent = function (e, t) {
            e || (e = i.remote.getCurrentWindow()), t || (t = e.getParentWindow()), i.ipcRenderer.sendSync(a.ThunderChannelList.channelRMSetPosition, e.getNativeWindowHandle(), t.getNativeWindowHandle())
        }, e.getWindowsInParentCenterPos = function (e, t, n) {
            n || (n = i.remote.getCurrentWindow());
            let a = n.getPosition(), o = n.getSize(), r = i.screen.getCursorScreenPoint(),
                s = i.screen.getDisplayNearestPoint(r), l = s.size.width, u = s.size.height, d = o[0], c = o[1];
            a[0] + d > l && (d = l - a[0]), a[1] + c > u && (c = u - a[1]);
            let h = a[0] + (d - e) / 2, f = a[1] + (c - t) / 2;
            return h < 0 ? h = 0 : h > l - e && (h = l - e), f < 0 ? f = 0 : f > u - t && (f = u - t), [Math.round(h), Math.round(f)]
        }, e.centerWnd = function (e, t, n) {
            do {
                if (!e || !t) break;
                let a = e.getNativeWindowHandle().readUIntLE(0, 4);
                if (!a) break;
                let o = t.getPosition(), r = t.getSize(), s = e.getSize(), l = i.screen.getCursorScreenPoint(),
                    u = i.screen.getDisplayNearestPoint(l), d = u.scaleFactor, c = u.size.width, h = u.size.height,
                    f = r[0], g = r[1];
                o[0] + f > c && (f = c - o[0]), o[1] + g > h && (g = h - o[1]);
                let p = o[0] + (f - s[0]) / 2, k = o[1] + (g - s[1]) / 2;
                p < 0 ? p = 0 : p > c - s[0] && (p = c - s[0]), k < 0 ? k = 0 : k > h - s[1] && (k = h - s[1]), n.setWindowPos(a, 0, p * d, k * d, 0, 0, 5)
            } while (0)
        }, e.bringWindowToTop = function (e) {
            e || (e = i.remote.getCurrentWindow().getNativeWindowHandle().readUIntLE(0, 4));
            i.ipcRenderer.send(a.ThunderChannelList.channelMRBringWindowToTop, e)
        }
    }(t.ThunderWindowNS || (t.ThunderWindowNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(8), r = n(20);
    let s = null;
    const l = n(1).default.getLogger("url.helper");
    !function (e) {
        function t(e) {
            let t = !0;
            if ("string" == typeof e) if (40 === e.length || 32 === e.length) {
                for (let n = 0; n < e.length; n++) if (e.charCodeAt(n) > 127) {
                    t = !1;
                    break
                }
            } else t = !1; else t = !1;
            return t
        }

        function u(e, n = !0) {
            n = void 0 === n || n;
            let i = !1;
            do {
                if ("string" != typeof e || "" === e) break;
                let a = e.trim();
                if ("" === a) break;
                if (r.ThunderHelper.getTaskTypeFromUrl(a) === o.DownloadKernel.TaskType.Unkown) {
                    if (!n) break;
                    t(a) && (i = !0)
                } else i = !0;
                i || a.match(/^file:\/\/\//) && (i = !0)
            } while (0);
            return i
        }

        e.isMagnetCode = t, e.fixMagnetUrl = function (e) {
            let n = "";
            do {
                if ("string" != typeof e || "" === e) break;
                if ("" === (n = e.trim())) break;
                r.ThunderHelper.getTaskTypeFromUrl(n) === o.DownloadKernel.TaskType.Unkown && t(n) && (n = "magnet:?xt=urn:btih:" + n)
            } while (0);
            return n
        }, e.isUrlValid = u, e.isBirdKey = function (e) {
            return e ? e.match(/#[Xx]([0-9a-zA-Z])+#/g) : null
        }, e.isCustomProtocol = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                null === s && (s = yield Promise.resolve().then(() => n(31)));
                let i = s.parse(e);
                do {
                    if (null === i || void 0 === i) break;
                    let e = i.protocol;
                    if ("magnet:" === e) {
                        t = !0;
                        break
                    }
                    if ("thunder:" === e) {
                        t = !0;
                        break
                    }
                    if ("ed2k:" === e) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            })
        }, e.isP2spOrEmuleUrl = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = e.trim();
                if ("" === n) break;
                let i = r.ThunderHelper.getTaskTypeFromUrl(n);
                if (i === o.DownloadKernel.TaskType.P2sp || i === o.DownloadKernel.TaskType.Emule) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.isSupportUrl = function (e) {
            e = e.toLowerCase();
            let t = !1;
            do {
                if ("http://" === e.substr(0, "http://".length)) {
                    t = !0;
                    break
                }
                if ("https://" === e.substr(0, "https://".length)) {
                    t = !0;
                    break
                }
                if ("ftp://" === e.substr(0, "ftp://".length)) {
                    t = !0;
                    break
                }
                if ("ed2k://" === e.substr(0, "ed2k://".length)) {
                    t = !0;
                    break
                }
                if ("thunder://" === e.substr(0, "thunder://".length)) {
                    t = !0;
                    break
                }
                if ("magnet:?" === e.substr(0, "magnet:?".length)) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        };
        let d = ".edu;.gov;.mil;.hk;.tw;.com.tw;.com.tw;.aero;.biz;.coop;.info;.museum;.name;.pro;";
        d += ".com;.cn;.xin;.net;.top;.xyz;.wang;.shop;.site;.club;.cc;.fun;.online;.biz;.red;.link;.ltd;.mobi;.info;.org;", d += ".com.cn;.net.cn;.org.cn;.gov.cn;.name;.vip;.work;.tv;.co;.kim;.group;.tech;.store;.ren;.ink;.pub;.live;.wiki;.design;";
        const c = (d += ".me").split(";");

        function h(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                if (-1 !== c.indexOf(e)) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function f(e) {
            let t = null;
            do {
                if (void 0 === e || null === e) break;
                if ("" === (e = e.trim())) break;
                let n = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(e);
                if (null === n) break;
                l.information("url parse result ", n), t = {};
                let i = ["url", "scheme", "slash", "host", "port", "path", "query", "hash"];
                for (let e = 0; e < i.length; e++) t[i[e]] = n[e];
                l.information("url parse", t)
            } while (0);
            return t
        }

        e.isUsualDomainSuffix = h, e.urlParse = f, e.isUrl = function (e) {
            let t = !1, n = e;
            do {
                if (void 0 === e || null === e) break;
                if (u(e, !1)) {
                    t = !0;
                    break
                }
                if (e.trim().match(/^file:\/\/\//)) {
                    t = !0;
                    break
                }
                let i = f(e);
                if (null === i) {
                    l.information("url parse failed");
                    break
                }
                if (void 0 === i.host || null === i.host) break;
                if (void 0 !== i.scheme) {
                    t = !0;
                    break
                }
                let o = i.host.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
                if (o) {
                    if (l.information("url parse is ip", o), Number(o[1]) <= 0 || Number(o[1]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[2]) < 0 || Number(o[2]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[4]) < 0 || Number(o[4]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[4]) < 0 || Number(o[4]) > 255) {
                        t = !1;
                        break
                    }
                    t = !0, void 0 === i.scheme && void 0 !== i.port && (n = `http://${e}`);
                    break
                }
                if (i.host.match(/\.{2,}/)) {
                    l.information("url parse has multi dot"), t = !1;
                    break
                }
                let r = a.extname(i.host);
                if ("" === r) break;
                if (h(r)) {
                    t = !0;
                    break
                }
            } while (0);
            return l.information("url parse isUrl", t), {ret: t, suggest: n}
        }, e.isFileNameValid = function (e) {
            let t = !1;
            do {
                if (void 0 === e) break;
                if (null === e) break;
                if ("" === (e = e.trim())) break;
                if ("." === e[0]) break;
                if (e.match(/[\/\\"<>\?\*|]/)) break;
                t = !0
            } while (0);
            return t
        }, e.isSuffixNeedDownload = function (e) {
            let t = !0;
            do {
                if (void 0 === e) break;
                if ("" === e || "." === e) break;
                if (e = e.toLowerCase(), -1 !== ["txt", "url", "html", "htm", "mht", "nfo"].indexOf(e)) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }
    }(t.URLHelperNS || (t.URLHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(1).default.getLogger("GetSkinInfo");
    let r;
    (function () {
        return i(this, void 0, void 0, function* () {
            if ("renderer" === process.type) {
                o.information("renderer process");
                const e = yield Promise.resolve().then(() => n(14)), t = yield Promise.resolve().then(() => n(5));
                e.default("GetSkinInfo").then(e => {
                    r = e, o.information("send OnChangeSkin", e)
                }).catch(e => {
                    o.warning(e)
                }), t.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", e => {
                    r = e, o.information("send OnChangeSkin", e)
                })
            } else "browser" === process.type && (o.information("main process"), a.ipcMain.on("OnChangeSkin", (e, t) => {
                o.information("OnChangeSkin", t), r = t
            }))
        })
    })().catch(e => {
        o.information(e)
    }), t.default = function () {
        return r
    }
}, function (e, t) {
    e.exports = require("stream")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(1), r = n(59), s = o.default.getLogger("config-modules");
    const l = new class {
        constructor() {
            this.configModulesJsonData = null, this.eventEmitter = new r.EventEmitter, this.inited = !1
        }

        init() {
            return i(this, void 0, void 0, function* () {
                let e = null;
                try {
                    a.default.defaults.adapter = n(22), e = yield a.default.get("http://static-xl9-ssl.xunlei.com/json/modules.json")
                } catch (e) {
                    s.information(e)
                }
                let t = !1;
                null !== e && void 0 !== e.status && 200 === e.status && void 0 !== e.data && null !== e.data && "" !== e.data && (this.configModulesJsonData = e.data, t = !0), this.inited = !0, this.eventEmitter.emit("OnConfigModulesLoaded", t)
            })
        }

        getConfigInfo(e, t) {
            let n = null;
            do {
                if (null === this.configModulesJsonData || void 0 === this.configModulesJsonData) break;
                null === e || void 0 === e || "" === e ? n = this.configModulesJsonData : null === t || void 0 === t || "" === t ? null !== this.configModulesJsonData[e] && void 0 !== this.configModulesJsonData[e] && (n = this.configModulesJsonData[e]) : null !== this.configModulesJsonData[e] && void 0 !== this.configModulesJsonData[e] && null !== this.configModulesJsonData[e][t] && void 0 !== this.configModulesJsonData[e][t] && (n = this.configModulesJsonData[e][t])
            } while (0);
            return n
        }

        getEventEmitter() {
            return this.eventEmitter
        }

        isInited() {
            return this.inited
        }

        isInitedAw() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.inited ? e(!0) : this.eventEmitter.once("OnConfigModulesLoaded", t => {
                        e(!0)
                    })
                })
            })
        }
    };
    t.default = l
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(7), o = n(84);
    !function (e) {
        const t = n(2), r = a.default(t.join(__rootDir, "../bin/ThunderKernel.node")),
            s = i.default.getLogger("DownloadKernel.ThunderKernel");
        let l = 0;
        e.registerDownloadSDKCrashCallback = function (e) {
            return r.registerDownloadSDKCrashCallback(e)
        }, e.initDownloadSdk = function (e, t, n, i) {
            return r.initDownloadSdk(e, t, n, i)
        }, e.createP2spTask = function (e, t, n, i, a) {
            return e && "" !== e || s.error("createP2spTask url:", e), i && "" !== i || s.error("createP2spTask savePath:", i), a && "" !== a || s.error("createP2spTask fileName:", a), e = o.Common.parseThunderPrivateUrl(e), r.createP2spTask(e, void 0 === t ? "" : t, void 0 === n ? "" : n, i, a)
        }, e.createBtTask = function (e, t, n) {
            return e && "" !== e || s.error("createBtTask torrentFilePath:", e), t && "" !== t || s.error("createBtTask savePath:", t), 0 === n.length && s.error("createBtTask fileRealIndexLists:", 0), r.createBtTask(e, t, n)
        }, e.createEmuleTask = function (e, t, n) {
            return e && "" !== e || s.error("createEmuleTask url:", e), t && "" !== t || s.error("createEmuleTask savePath:", t), n && "" !== n || s.error("createEmuleTask fileName:", n), e = o.Common.parseThunderPrivateUrl(e), r.createEmuleTask(e, t, n)
        }, e.createMagnetTask = function (e, t) {
            return e && "" !== e || s.error("createMagnetTask url:", e), t && "" !== t || s.error("createMagnetTask torrentFilePath:", t), e = o.Common.parseThunderPrivateUrl(e), r.createMagnetTask(e, t)
        }, e.startTask = function (e) {
            return s.information("startTask virtualTaskId:", e), r.startTask(e)
        }, e.stopTask = function (e) {
            return s.information("stopTask virtualTaskId:", e), r.stopTask(e)
        }, e.deleteTask = function (e) {
            return s.information("deleteTask virtualTaskId:", e), r.deleteTask(e)
        }, e.renameP2spTaskFile = function (e, t) {
            return r.renameP2spTaskFile(e, t)
        }, e.queryTaskInfo = function (e, t) {
            return 0 === r.queryTaskInfo(e, t)
        }, e.queryBtTaskInfo = function (e, t) {
            return 0 === r.queryBtTaskInfo(e, t)
        }, e.queryPlayInfo = function (e, t, n) {
            return 0 === r.queryPlayInfo(e, t, n)
        }, e.queryGlobalInfo = function (e, t) {
            return 0 === r.queryGlobalInfo(e, t)
        }, e.createTaskId = function () {
            return r.createTaskId()
        }, e.importTask = function (e, t, n) {
            return r.importTask(e, t, n)
        }, e.parserBtFileInfo = function (e, t) {
            return r.parserBtFileInfo(e, t)
        }, e.getFileHashByUrl = function (e) {
            return r.getFileHashByUrl(e)
        }, e.getInfoHashByUrl = function (e) {
            return r.getInfoHashByUrl(e)
        }, e.enableDcdnWithVipCert = function (e, t, n) {
            return r.enableDcdnWithVipCert(e, t, n)
        }, e.updateDcdnWithVipCert = function (e, t, n) {
            return r.updateDcdnWithVipCert(e, t, n)
        }, e.disableDcdnWithVipCert = function (e, t) {
            return r.disableDcdnWithVipCert(e, t)
        }, e.setDownloadSpeedLimit = function (e) {
            return r.setDownloadSpeedLimit(Number(e))
        }, e.setUploadSpeedLimit = function (e) {
            return r.setUploadSpeedLimit(Number(e))
        }, e.setTaskStrategy = function (e, t) {
            return r.setTaskStrategy(e, t)
        }, e.setDownloadStrategy = function (e, t) {
            return r.setDownloadStrategy(e, t)
        }, e.setTaskThreadCount = function (e, t) {
            return r.setTaskThreadCount(e, Number(t))
        }, e.setCacheSize = function (e) {
            return r.setCacheSize(Number(e))
        }, e.setUserInfo = function (e, t) {
            return r.setUserInfo(e, t)
        }, e.setBTExtraTrackers = function (e, t) {
            return r.setBTExtraTrackers(e, t)
        }, e.setGlobalExtInfo = function (e, t) {
            return r.setGlobalExtInfo(e, t)
        }, e.setTaskExtInfo = function (e, t) {
            return r.setTaskExtInfo(e, t)
        }, e.setTaskExtStat = function (e, t, n, i) {
            return r.setTaskExtStat(e, t, n, i)
        }, e.initDataBase = function (e, t) {
            return r.initDataBase(e, t)
        }, e.beginTransaction = function () {
            s.information("beginTransaction transactionId:", l);
            let e = l;
            return r.beginTransaction(e), l >= Number.MAX_SAFE_INTEGER ? l = 0 : l++, e
        }, e.commitTransaction = function (e) {
            return s.information("commitTransaction transactionId:", e), r.commitTransaction(e)
        }, e.rollbackTransaction = function (e) {
            return s.information("rollbackTransaction transactionId:", e), r.rollbackTransaction(e)
        }, e.execSqlite = function (e, t) {
            return r.execSqlite(e, t)
        }, e.querySqlite = function (e, t) {
            return r.querySqlite(e, t)
        }, e.insertTaskBase = function (e) {
            r.insertTaskBase(e)
        }, e.insertP2spTask = function (e, t, n, i, a, o) {
            r.insertP2spTask(e, t, n, i, a, o)
        }, e.insertBtTask = function (e, t, n, i, a) {
            r.insertBtTask(e, t, n, i, a)
        }, e.insertBtFile = function (e, t) {
            r.insertBtFile(e, t)
        }, e.insertEmuleTask = function (e, t, n) {
            r.insertEmuleTask(e, t, n)
        }, e.insertGroupTask = function (e, t, n, i) {
            r.insertGroupTask(e, t, n, i)
        }, e.insertMagnetTask = function (e) {
            r.insertMagnetTask(e)
        }, e.deleteStorageTask = function (e, t) {
            r.deleteStorageTask(e, t)
        }, e.loadTaskBase = function (e) {
            r.loadTaskBase(e)
        }, e.loadStorageTask = function (e, t, n) {
            r.loadStorageTask(e, t, n)
        }, e.saveTaskBaseInfo = function (e, t, n, i) {
            r.saveTaskBaseInfo(e, t, n, i)
        }, e.saveTaskUserData = function (e, t) {
            r.saveTaskUserData(e, t)
        }, e.saveTaskChannelInfo = function (e, t, n, i, a, o) {
            r.saveTaskChannelInfo(e, t, n, i, a, o)
        }, e.setP2spTaskOriginOnly = function (e, t) {
            r.setP2spTaskOriginOnly(e, t)
        }, e.setP2spTaskThreadCount = function (e, t) {
            r.setP2spTaskThreadCount(e, t)
        }, e.saveBtFileInfo = function (e, t, n, i, a) {
            r.saveBtFileInfo(e, t, n, i, a)
        }, e.saveBtFileCid = function (e, t, n, i) {
            r.saveBtFileCid(e, t, n, i)
        }, e.setCategoryId = function (e, t) {
            r.setCategoryId(e, t)
        }, e.loadCategory = function (e) {
            r.loadCategory(e)
        }, e.createCategory = function (e, t, n, i, a, o, s) {
            r.createCategory(e, t, n, i, a, o, s)
        }, e.setCategoryPassword = function (e, t, n, i) {
            r.setCategoryPassword(e, t, n, i)
        }, e.setCategoryAccountPassword = function (e, t) {
            r.setCategoryAccountPassword(e, t)
        }, e.searchTask = function (e, t, n, i, a) {
            r.searchTask(e, t, n, i, a)
        }, e.filterTask = function (e, t, n, i, a, o, s) {
            r.filterTask(e, t, n, i, a, o, s)
        }, e.setTaskPriorityLevel = function (e, t, n) {
            r.setTaskPriorityLevel(e, t, n)
        }, e.setBtFileFailureErrorCode = function (e, t, n) {
            r.setBtFileFailureErrorCode(e, t, n)
        }, e.batchFindP2spTask = function (e, t) {
            return 0 === r.batchFindP2spTask(e, t)
        }, e.batchFindEmuleTask = function (e, t) {
            return 0 === r.batchFindEmuleTask(e, t)
        }, e.batchFindBtTask = function (e, t) {
            return 0 === r.batchFindBtTask(e, t)
        }, e.batchFindGroupTask = function (e, t) {
            return 0 === r.batchFindGroupTask(e, t)
        }, e.verifyProxy = function (e, t, n, i, a, o) {
            return i || (i = ""), n || (n = "", i = ""), t = t ? Number(t) : 0, r.verifyProxy(e, t, n, i, a, o)
        }, e.setProxy = function (e, t, n, i, a) {
            return a || (a = ""), i || (i = "", a = ""), n = n ? Number(n) : 0, 0
        }
    }(t.ThunderKernel || (t.ThunderKernel = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(8), o = n(7), r = Math.pow(2, 38),
        s = o.default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return s.isThunderPrivateUrl(e)
        }

        function n(e) {
            let t = !0;
            for (let n = 0; n < e.length; n++) if (e.charCodeAt(n) > 127) {
                t = !1;
                break
            }
            return t
        }

        e.formatSize = function (e) {
            let t = 0, n = e, i = ["B", "KB", "MB", "GB", "TB", "PB"];
            for (; n >= 1024 && !(t > i.length - 1);) n /= 1024, t++;
            let a = i[t];
            return n.toFixed(2) + a
        }, e.getSavePathFromImportFile = function (e) {
            let t = "";
            return e && "" !== e && (t = i.dirname(e)), t
        }, e.getTaskNameFromImportFile = function (e) {
            let t = "";
            do {
                if (!e || "" === e) break;
                let n = i.basename(e), a = i.extname(e);
                if (!n || "" === n || !a || "" === a) break;
                let o = i.parse(n).name;
                if (!o || "" === o) break;
                let r = i.extname(o);
                if (!r || "" === r) break;
                ".td" === a || ".xltd" === a ? t = ".bt" === r || ".emule" === r ? i.parse(o).name : o : ".cfg" === a && (".td" === r || ".xltd" === r ? t = i.parse(o).name : ".emule" !== r && ".xlemule" !== r && ".bt" !== r && ".xlbt" !== r || (o = i.parse(o).name, t = i.parse(o).name))
            } while (0);
            return t
        }, e.getTaskTypeFromImportingFile = function (e) {
            let t = a.DownloadKernel.TaskType.Unkown;
            do {
                if (!e || "" === e) break;
                let n = i.basename(e), o = i.extname(e);
                if (!n || "" === n || !o || "" === o) break;
                let r = i.parse(n).name;
                if (!r || "" === r) break;
                let s = i.extname(r).toLowerCase();
                if (!s || "" === s) break;
                ".td" === o || ".xltd" === o ? t = ".bt" === s ? a.DownloadKernel.TaskType.Bt : ".emule" === s ? a.DownloadKernel.TaskType.Emule : a.DownloadKernel.TaskType.P2sp : ".cfg" === o && (".td" === s || ".xltd" === s ? t = a.DownloadKernel.TaskType.P2sp : ".emule" === s || ".xlemule" === s || ".part" === s ? t = a.DownloadKernel.TaskType.Emule : ".bt" !== s && ".xlbt" !== s || (t = a.DownloadKernel.TaskType.Bt))
            } while (0);
            return t
        }, e.isThunderPrivateUrl = t, e.parseThunderPrivateUrl = function (e) {
            let n = e;
            if (t(e)) {
                let t = s.parseThunderPrivateUrl(e);
                n = null !== t && void 0 !== t ? t.url : void 0
            }
            return n
        }, e.isAllAsciiChar = n, e.parseEd2kUrl = function (e) {
            let t = null;
            do {
                -1 === e.indexOf("|") && (e = e.replace("%7C", "|"));
                let i = [];
                if ((i = e.split("|")).length < 5) break;
                let a = "ed2k://";
                if (i[0].length < a.length || 0 !== i[0].indexOf(a)) break;
                let o = "file";
                if (i[1].length < o.length || 0 !== i[1].indexOf(o)) break;
                let s = i[2], l = parseInt(i[3], 10);
                if (l <= 0 || l > r) break;
                if (32 !== i[4].length) break;
                let u = i[4];
                if (-1 !== s.indexOf("%") && n(s)) try {
                    s = decodeURI(s)
                } catch (e) {
                }
                t = {
                    fileName: s = (s = (s = (s = (s = (s = (s = (s = (s = s.replace("<", "_")).replace(">", "_")).replace(":", "_")).replace('"', "_")).replace("/", "_")).replace("\\", "_")).replace("|", "_")).replace("?", "_")).replace("*", "_"),
                    fileHash: u,
                    fileSize: l
                }
            } while (0);
            return t
        };
        let o = void 0;

        function l(e) {
            let t = 0, n = -1;
            for (let i = 0; i < e.length; ++i) t += (n = e.charCodeAt(i)) >= 0 && n <= 128 ? 1 : 2;
            return t
        }

        function u(e, t) {
            let n = "", i = 0, a = new String;
            for (let o = 0; o < e.length; o++) {
                let r = e.charAt(o);
                if (i++, escape(r).length > 4 && i++, a = a.concat(r), i >= t) {
                    n = a.toString();
                    break
                }
            }
            return i < t && (n = e), n
        }

        e.getXmpPath = function () {
            if (!o) {
                let e = "HKEY_LOCAL_MACHINE", t = "SOFTWARE\\Thunder Network\\Xmp", n = "Path";
                o = s.readRegString(e, t, n)
            }
            return o
        }, e.getStringLength = l, e.cutString = u, e.getMaxFilePath = function (e) {
            let t = "", n = l(e);
            if (n < 260) t = e; else {
                let a = i.dirname(e), o = i.basename(e), r = i.extname(e), s = 260 - (n = l(a) + 2) - r.length - 2;
                s > 0 && (o = u(o, s), o += r, t = i.join(a, o))
            }
            return t
        }
    }(t.Common || (t.Common = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(3), r = n(1), s = n(7), l = n(10), u = n(8), d = n(73), c = n(32), h = n(126), f = n(90),
        g = n(34), p = n(84), k = n(229), m = n(33), T = n(28), v = n(13), C = n(58), S = n(25), y = n(105), w = n(6),
        I = n(74), b = n(15), A = n(134), N = n(135), D = n(133), _ = n(245), x = n(150), E = n(571), P = n(195),
        M = n(572), F = n(144), O = n(51), U = n(132), L = n(77), B = r.default.getLogger("Thunder.TaskOperator"),
        K = s.default(a.join(__rootDir, "../bin/ThunderHelper.node")), V = c.DownloadKernelTaskManager.getTaskManager(),
        R = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        W = f.DownloadKernelCategoryManager.getCategoryManager(), H = g.DownloadKernelEventManager.getEventManager(),
        j = N.ToastNotifyManagerNS.getToastNotifyManger(), G = o.remote.dialog;

    function z(e) {
        if (void 0 !== e) {
            let t = e + "\\.";
            o.remote.shell.showItemInFolder(t)
        }
    }

    function $(e) {
        e.properties = ["openFile"];
        let t = void 0, n = o.remote.getCurrentWindow(), i = G.showOpenDialog(n, e);
        return void 0 !== i && (t = i[0]), t
    }

    function q() {
        m.MessageBox.pop({
            title: "提示",
            size: "small",
            message: "临时文件无法正常载入，导入任务失败!",
            okText: "确定",
            cancelVisible: !1
        }).catch()
    }

    function X() {
        return i(this, void 0, void 0, function* () {
            return E.DownloadAndPlayNS.getXmpPath()
        })
    }

    function J(e) {
        return i(this, void 0, void 0, function* () {
            let t = 0;
            return new Promise(n => {
                t = H.attachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, (...i) => {
                    do {
                        if (!i) break;
                        if (i[0] !== u.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!i[1]) break;
                        let a = i[1];
                        for (let i = 0; i < a.length; ++i) {
                            let o = a[i];
                            if (!o) continue;
                            let r = o.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                            if (e === r) {
                                o.getTaskStatus() === u.DownloadKernel.TaskStatus.Started && (H.detachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, t), n(!0));
                                break
                            }
                        }
                    } while (0)
                })
            })
        })
    }

    function Y(e) {
        return i(this, void 0, void 0, function* () {
            let t = yield m.MessageBox.pop({
                title: "请选择播放任务",
                schemas: [{
                    name: "playFile",
                    type: "confRadio",
                    outerClass: "xlx-dialog__play-list",
                    ulClasses: "xlx-setting-content__horizontal",
                    option: e.map(e => e.fileName),
                    labels: e.map(e => e.fileName),
                    disableds: e.map(e => !0 === e.isForbidden)
                }],
                formData: {playFile: {value: e[0].fileName}}
            }, {center: !0, width: 400, height: 300});
            return t.action === T.MessageBoxNS.Action.OK ? e.find(e => e.fileName === t.formData.playFile.value) : null
        })
    }

    !function (e) {
        function t(e, t) {
            let n = p.Common.getTaskTypeFromImportingFile(e);
            n === u.DownloadKernel.TaskType.P2sp ? function (e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = {errcode: 0, errinfo: "success"};
                    do {
                        let i = e + ".cfg";
                        if (!(yield l.FileSystemAWNS.existsAW(i))) {
                            n.errcode = 2, n.errinfo = "缺少.cfg文件,无法导入";
                            break
                        }
                        let a = yield k.TaskUtilitiesAWNS.importUnfinishedTaskAW(e, "");
                        if (null !== a && 0 === a.ret) {
                            let i = {taskType: u.DownloadKernel.TaskType.P2sp, value: a.url},
                                o = yield k.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                            if (o && o.length > 0) {
                                n.errcode = 3, n.extra = o[0], y.ThunderNewTask.repeatTasksMsg([o[0]]);
                                break
                            }
                            let r = {
                                taskBaseInfo: {
                                    taskName: p.Common.getTaskNameFromImportFile(e),
                                    savePath: p.Common.getSavePathFromImportFile(e),
                                    origin: t = void 0 === t ? "Unknown" : t
                                }, p2spTaskInfo: {url: a.url, refUrl: "", cookie: ""}
                            }, s = yield V.createTask(u.DownloadKernel.TaskType.P2sp, r);
                            if (null !== s) {
                                let e = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                A.DownloadDispatchNS.startTask(e)
                            } else B.warning("createTask failed")
                        } else n.errcode = 2, n.errinfo = "临时文件无法正常载入，导入任务失败", q()
                    } while (0);
                    return n
                })
            }(e, t).then(e => {
                B.information(e.errcode, e.errinfo)
            }).catch() : n === u.DownloadKernel.TaskType.Emule ? function (e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = {errcode: 0, errinfo: "success"};
                    do {
                        let i = "";
                        if (".PART" === a.extname(e).toUpperCase() && (i = e + ".met", !(yield l.FileSystemAWNS.existsAW(i))) && void 0 === (i = $({
                            title: "导入eMule文件时,需要相应的MET文件,请选择MET文件",
                            filters: [{name: "met文件(*.met)", extensions: ["met"]}]
                        }))) break;
                        let o = yield k.TaskUtilitiesAWNS.importUnfinishedTaskAW(e, i);
                        if (null !== o && 0 === o.ret) {
                            let i = p.Common.parseEd2kUrl(o.url);
                            if (null !== i) {
                                let a = {taskType: u.DownloadKernel.TaskType.Emule, value: i.fileHash},
                                    r = yield k.TaskUtilitiesAWNS.batchFindTaskAW([a]);
                                if (r && r.length > 0) {
                                    n.errcode = 3, n.extra = r[0], y.ThunderNewTask.repeatTasksMsg([r[0]]);
                                    break
                                }
                                let s = {
                                    taskBaseInfo: {
                                        taskName: p.Common.getTaskNameFromImportFile(e),
                                        savePath: p.Common.getSavePathFromImportFile(e),
                                        origin: t = void 0 === t ? "Unknown" : t
                                    }, emuleTaskInfo: {url: o.url}
                                }, l = yield V.createTask(u.DownloadKernel.TaskType.Emule, s);
                                if (null !== l) {
                                    let e = l.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                    A.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else n.errcode = 2, n.errinfo = "导入失败,该任务临时文件无法正常载入", q()
                    } while (0);
                    return n
                })
            }(e, t).then(e => {
                B.information(e.errcode, e.errinfo)
            }).catch() : n === u.DownloadKernel.TaskType.Bt && function (e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = a.dirname(e), i = void 0;
                    if (yield l.FileSystemAWNS.existsAW(n)) {
                        let e = yield l.FileSystemAWNS.readdirAW(n);
                        for (let t = 0; t < e.length; t++) {
                            let n = e[t];
                            if (".torrent" === a.extname(n)) {
                                i = n;
                                break
                            }
                        }
                    }
                    do {
                        if (void 0 === i || null === i || "" === i) break;
                        let e = a.join(__profilesDir, "Torrents"), o = a.join(e, i);
                        if (yield l.FileSystemAWNS.existsAW(o)) {
                            let e = yield k.TaskUtilitiesAWNS.parserBtFileInfoAW(o),
                                i = {taskType: u.DownloadKernel.TaskType.Bt, value: e.infoId},
                                r = yield k.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                            if (r && r.length > 0) {
                                y.ThunderNewTask.repeatTasksMsg([r[0]]);
                                break
                            }
                            let s = a.dirname(n), l = [];
                            for (let t = 0; t < e.fileLists.length; ++t) l.push(e.fileLists[t].realIndex);
                            let d = e.trackerUrls.join("\n"), h = P.TaskCtrlOperatorNS.constructProductInfo("");
                            t = void 0 === t ? "Unknown" : t;
                            let f = {
                                    taskBaseInfo: {savePath: s, taskName: e.title, productInfo: h, origin: t},
                                    btTaskInfo: {
                                        seedFile: o,
                                        displayName: e.title,
                                        fileRealIndexLists: l,
                                        fileLists: e.fileLists,
                                        infoId: e.infoId,
                                        tracker: d
                                    }
                                },
                                g = yield c.DownloadKernelTaskManager.getTaskManager().createTask(u.DownloadKernel.TaskType.Bt, f);
                            if (null !== g) {
                                let e = g.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                A.DownloadDispatchNS.startTask(e)
                            }
                        }
                    } while (0)
                })
            }(e, t).catch()
        }

        function r(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [];
                do {
                    if (void 0 === e || null === e) break;
                    let i = V.getTaskFromTaskId(e);
                    if (null === i) break;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Bt) break;
                    let o = i.getExtraObject();
                    if (0 === o.getDownloadFile().length) break;
                    if (yield U.SingleBtTaskNS.isSingleBtTask(i)) {
                        let e = U.SingleBtTaskNS.getSinleBtTaskFilePath(i), a = o.getBtFileList();
                        for (let [, i]of a) {
                            let a = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                r = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                            if (1 === o) {
                                let i = C.TaskUtilHelper.getTaskFileType(r);
                                if (null !== t && void 0 !== t && -1 !== t) {
                                    if (t === a) {
                                        n.push({fileExtType: i, fullPath: e});
                                        break
                                    }
                                } else n.push({fileExtType: i, fullPath: e})
                            }
                            break
                        }
                    } else {
                        let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            r = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), s = o.getBtFileList();
                        for (let [, i]of s) {
                            let o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                s = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                l = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName),
                                d = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                c = a.join(e, r, d, l);
                            if (1 === s) {
                                let e = C.TaskUtilHelper.getTaskFileType(l);
                                if (null !== t && void 0 !== t && -1 !== t) {
                                    if (t === o) {
                                        n.push({fileExtType: e, fullPath: c});
                                        break
                                    }
                                } else n.push({fileExtType: e, fullPath: c})
                            }
                        }
                    }
                } while (0);
                return n
            })
        }

        function s(e) {
            let t = !1;
            do {
                let n = 0;
                if (null !== e && (n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.ErrorCode)), 7 === n) {
                    t = !0;
                    break
                }
                if (n >= 700 && n <= 799) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function h(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [];
                do {
                    if (void 0 === e || null === e) break;
                    let i = V.getTaskFromTaskId(e);
                    if (null === i) break;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Bt) break;
                    let o = i.getExtraObject();
                    if (0 === o.getDownloadFile().length) break;
                    if (yield U.SingleBtTaskNS.isSingleBtTask(i)) {
                        let e = U.SingleBtTaskNS.getSinleBtTaskFilePath(i), a = o.getBtFileList();
                        for (let [, i]of a) {
                            let a = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                r = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName),
                                s = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Cid),
                                l = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Gcid);
                            if (1 === o) {
                                if (C.TaskUtilHelper.getTaskFileType(r) === C.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                    if (a === t) {
                                        n.push({fileName: r, fullPath: e, index: a, cid: s, gcid: l});
                                        break
                                    }
                                } else n.push({fileName: r, fullPath: e, index: a, cid: s, gcid: l})
                            }
                            break
                        }
                    } else {
                        let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            r = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), s = o.getBtFileList();
                        for (let [, i]of s) {
                            let o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                s = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                l = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName),
                                d = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                c = a.join(e, r, d, l), h = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Cid),
                                f = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Gcid);
                            if (1 === s) {
                                if (C.TaskUtilHelper.getTaskFileType(l) === C.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                    if (o === t) {
                                        n.push({fileName: l, fullPath: c, index: o, cid: h, gcid: f});
                                        break
                                    }
                                } else n.push({fileName: l, fullPath: c, index: o, cid: h, gcid: f})
                            }
                        }
                    }
                } while (0);
                return n
            })
        }

        function f(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [];
                do {
                    if (void 0 === e || null === e) break;
                    let i = V.getTaskFromTaskId(e);
                    if (null === i) break;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                    let o = i.getExtraObject();
                    if (null === o || void 0 === o) break;
                    let r = o.getSubTaskCount();
                    for (let e = 0; e < r; ++e) {
                        let i = o.getSubTaskByIndex(e), r = e,
                            l = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadSubTask),
                            d = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            c = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), h = a.join(d, c),
                            f = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid),
                            g = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid),
                            p = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), k = s(i);
                        if (1 === l) {
                            if (C.TaskUtilHelper.getTaskFileType(c) === C.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                if (r === t) {
                                    n.push({
                                        fileName: c,
                                        fullPath: h,
                                        index: r,
                                        cid: f,
                                        gcid: g,
                                        isForbidden: k,
                                        taskId: i.getId(),
                                        taskUrl: p
                                    });
                                    break
                                }
                            } else n.push({
                                fileName: c,
                                fullPath: h,
                                index: r,
                                cid: f,
                                gcid: g,
                                isForbidden: k,
                                taskId: i.getId(),
                                taskUrl: p
                            })
                        }
                    }
                } while (0);
                return n
            })
        }

        function g(e) {
            let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType),
                n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl);
            if (t === u.DownloadKernel.TaskType.P2sp) {
                let t = e.getExtraObject().getDisplayUrl();
                "" !== t && void 0 !== t && (n = t)
            }
            return n
        }

        function E(e, t, n, o, r, s, c, h, f) {
            return i(this, void 0, void 0, function* () {
                function i(e) {
                    let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadSize);
                    return 0 === t && (t = 1), Math.round(n / t)
                }

                let g = {ret: !1, errcode: 0};
                do {
                    let p = yield X();
                    if (!p || !(yield l.FileSystemAWNS.existsAW(p))) {
                        if (!(yield M.default.installXmp())) break;
                        if (!(p = yield X()) || !(yield l.FileSystemAWNS.existsAW(p))) break
                    }
                    if (!e || "" === e) break;
                    let k = V.getTaskFromTaskId(s), m = "", T = 0, v = "", C = void 0;
                    if (null !== k) {
                        if ((C = k.getType()) === u.DownloadKernel.TaskType.Bt) {
                            v = m = k.getExtraObject().getInfoId()
                        } else if (C === u.DownloadKernel.TaskType.Magnet) {
                            m = k.getExtraObject().getFileHash()
                        } else C !== u.DownloadKernel.TaskType.Emule && C !== u.DownloadKernel.TaskType.P2sp || (m = k.getTaskBaseInfo().gcid);
                        T = i(k)
                    }
                    let S = [], y = '"' + e + '"', w = "/sstartfrom xl10", I = "/sopenfrom xunlei10";
                    S.push(y), S.push(w), S.push(I);
                    let b = '/sname "' + t + '"';
                    S.push(b);
                    let A = "/scid " + o;
                    S.push(A);
                    let N = "/sgcid " + r;
                    S.push(N), "" !== m && S.push("/scommentid " + m), T > 0 && S.push("/thunderdownloadSpeed " + T);
                    let D = "/sfilesize " + c;
                    S.push(D);
                    let _ = '/sshowurl "' + n + '"';
                    if (S.push(_), C === u.DownloadKernel.TaskType.Bt) {
                        let e = '/shashid "' + v + '"';
                        S.push(e);
                        let t = '/ssubid "' + f + '"';
                        S.push(t)
                    }
                    let x = '/sext "' + a.extname(t) + '"';
                    S.push(x);
                    let E = "/staskid " + s;
                    if (S.push(E), null !== h && void 0 !== h && "" !== h) {
                        let e = '/sFilePath "' + h + '"';
                        S.push(e)
                    }
                    let F = "/ssdkver " + d.DownloadKernelManager.getDownloadSdkVersion();
                    S.push(F);
                    let O = yield P.TaskCtrlOperatorNS.getUserLoginInfo();
                    "" !== O && S.push(O);
                    let U = S.join(" "), L = a.dirname(p), R = K.shellExecute(0, "open", p, U, L, "SW_SHOW");
                    R > 32 ? g.ret = !0 : g.errcode = R, B.information("shellExecute:result = ", R)
                } while (0);
                return g
            })
        }

        function H(e, t, n, o, r) {
            return i(this, void 0, void 0, function* () {
                let i;
                var s;
                if (i = "downloading" !== o || (yield new Promise(e => {
                    s = (t => {
                        e(t)
                    }), K.isOpenXmp() ? s(!0) : O.LoginHelperNS.loginHelper.isLogined(e => {
                        e ? s(!0) : (v.XLStatNS.trackEvent("download_leftpanel", "bianxiabianbo_login_tips_show", "", 0, 0, 0, 0), m.MessageBox.confirm({
                            title: "边下边播",
                            type: m.MessageBox.ConfirmType.Info,
                            content: "需要登录后才能使用边下边播功能",
                            okText: "立即登录",
                            cancelVisible: !1
                        }).then(e => {
                            let t = "cancel";
                            e.action === T.MessageBoxNS.Action.OK && (t = "login", O.LoginHelperNS.loginUIHelper.updateLoginWnd(), L.default(!1, !0, "downloadplay").then(e => {
                                e && "" !== e && s(!0)
                            }).catch()), v.XLStatNS.trackEvent("download_leftpanel", "bianxiabianbo_login_tips_click", "", 0, 0, 0, 0, "button=" + t)
                        }).catch())
                    })
                }))) {
                    let i = !1, s = V.getTaskFromTaskId(e);
                    do {
                        if (!s) break;
                        if (!s.isSupportPlay()) break;
                        let d = "", c = "", g = "", p = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl),
                            k = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize), m = "", T = "", C = "",
                            S = e, y = s.getTaskStatus(),
                            w = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType), b = -1;
                        if (y === u.DownloadKernel.TaskStatus.Succeeded || y === u.DownloadKernel.TaskStatus.Seeding) {
                            if (w === u.DownloadKernel.TaskType.Emule || w === u.DownloadKernel.TaskType.P2sp) {
                                let e = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath);
                                if (c = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), d = a.resolve(e, c), !(yield l.FileSystemAWNS.existsAW(d))) break;
                                m = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid), T = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid), g = d
                            } else if (w === u.DownloadKernel.TaskType.Bt || w === u.DownloadKernel.TaskType.Group) {
                                let n = [];
                                if (0 === (n = w === u.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield f(e, t)).length) break;
                                let i = null;
                                if (null !== (i = n.length > 1 ? yield Y(n) : n[0])) {
                                    if (yield l.FileSystemAWNS.existsAW(i.fullPath)) g = i.fullPath; else if (w === u.DownloadKernel.TaskType.Bt) g = yield s.getPlayUrl(i.index); else {
                                        let e = s.getExtraObject().getSubTaskByIndex(i.index);
                                        null !== e && void 0 !== e && (g = yield e.getPlayUrl(-1))
                                    }
                                    c = i.fileName, m = i.cid, T = i.gcid, b = i.index, w === u.DownloadKernel.TaskType.Group && (S = i.taskId, p = i.taskUrl)
                                }
                            }
                        } else {
                            if (y === u.DownloadKernel.TaskStatus.StartWaiting) {
                                B.information("down and play waiting");
                                break
                            }
                            if (y === u.DownloadKernel.TaskStatus.Stopped || y === u.DownloadKernel.TaskStatus.Failed) {
                                if (!A.DownloadDispatchNS.startTask(e)) {
                                    B.information("down and play start waiting");
                                    break
                                }
                                yield J(e)
                            }
                            if (s.setDownloadStrategy(1), w === u.DownloadKernel.TaskType.Bt || w === u.DownloadKernel.TaskType.Group) {
                                let n = [];
                                if (0 === (n = w === u.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield f(e, t)).length) break;
                                let i = null;
                                if (null !== (i = n.length > 1 ? yield Y(n) : n[0])) {
                                    if (yield l.FileSystemAWNS.existsAW(i.fullPath)) g = i.fullPath; else if (w === u.DownloadKernel.TaskType.Bt) g = yield s.getPlayUrl(i.index); else {
                                        let e = s.getExtraObject().getSubTaskByIndex(i.index);
                                        null !== e && void 0 !== e && (g = yield e.getPlayUrl(-1))
                                    }
                                    C = a.dirname(i.fullPath), c = i.fileName, m = i.cid, T = i.gcid, b = i.index, w === u.DownloadKernel.TaskType.Group && (S = i.taskId, p = i.taskUrl), B.information("Thunder.DownloadAndPlayIPC playTaskId:", S, ", taskId:", e)
                                }
                            } else w !== u.DownloadKernel.TaskType.Emule && w !== u.DownloadKernel.TaskType.P2sp || (g = yield s.getPlayUrl(-1), c = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), C = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath), m = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid), T = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid))
                        }
                        let N = yield E(g, c, p, m, T, S, k, C, b);
                        i = N.ret;
                        let D = [];
                        void 0 === r && (r = I.default.getCurrentCategoryId()), -1 === r ? D.push("panel_type=mypc") : D.push("panel_type=private"), void 0 === o && (o = ""), D.push("panel=" + o), D.push("taskid=" + e), D.push("filename=" + encodeURIComponent(c)), void 0 === n && (n = "other"), D.push("click_source=" + n), i ? D.push("result=success") : (D.push("result=fail"), D.push("errorcode=" + N.errcode));
                        let _ = D.join(",");
                        B.information("trackEvent", "download_leftpanel", "play_panel_show", _), v.XLStatNS.trackEvent("download_leftpanel", "play_panel_show", "", 0, 0, 0, 0, _)
                    } while (0);
                    return i
                }
                return !1
            })
        }

        function Q(e) {
            do {
                if (null === e || void 0 === e || void 0 === e.taskId) break;
                let t = V.getTaskFromTaskId(e.taskId);
                if (null === t || void 0 === t) break;
                if (t.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryViewId) !== u.DownloadKernel.CategroyViewID.Downloading) break;
                if ("ThunderUnion" !== t.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin)) break;
                if (t.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                if (e.taskStatus === u.DownloadKernel.TaskStatus.Succeeded) break;
                let n = t.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                    i = `filename=${encodeURIComponent(n)}`;
                B.information("trackEvent js_grouptask_delete_click ", n, i), v.XLStatNS.trackEvent("core_operate", "js_grouptask_delete_click", "", 0, 0, 0, 0, i)
            } while (0)
        }

        e.importUncompletedFromFile = t, e.importUncompleted = function () {
            B.information("import un-finished");
            let e = o.remote.getCurrentWindow();
            G.showOpenDialog(e, {
                properties: ["openFile"],
                filters: [{
                    name: "所有支持的文件类型（*.td;*.bt.td;*.emule.td;*.bc!;*.part;*.xltd）",
                    extensions: ["td", "bt.td", "emule.td", "bc!", "part", "xltd"]
                }, {name: "迅雷专有下载文件（*.td）", extensions: ["td", "xltd"]}, {
                    name: "迅雷BT下载文件（*.bt.td）",
                    extensions: ["bt.td"]
                }, {name: "迅雷eMule下载文件（*.emule.td）", extensions: ["emule.td"]}, {
                    name: "BitComet下载文件（*.bc!）",
                    extensions: ["bc!"]
                }, {name: "eMule0.47数据文件（*.part）", extensions: ["part"]}]
            }, e => {
                void 0 === e ? B.information("import un finished select none") : t(e[0], "TD")
            })
        }, e.removeNonExistingTask = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    if (void 0 === e || null === e) {
                        let t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Completed);
                        if (null === t) break;
                        let n = t.getTasks();
                        e = [...n.values()].map(e => e.getTaskBaseInfo())
                    }
                    if (null === e || void 0 === e || 0 === e.length) break;
                    let n = [];
                    for (let i of e) (yield P.TaskCtrlOperatorNS.isExistTaskFile(i)) || (n.push(i.taskId), t += 1);
                    yield V.deleteBatchTask(n, !0)
                } while (0);
                return t
            })
        }, e.markReadStatus = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let n of e) {
                    let e = V.getTaskFromTaskId(n.taskId);
                    e && e.setUserRead(t)
                }
            } while (0)
        }, e.moveCategoryTask = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let n of e) V.moveCategoryTask(n.taskId, t)
            } while (0)
        }, e.getFileIcon = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    o.remote.app.getFileIcon(e, (e, n) => {
                        B.information(e), t(null === n || void 0 === n ? null : n.toDataURL())
                    })
                })
            })
        }, e.executeInstallFile = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    let a = "", r = "";
                    if (null !== t && void 0 !== t && "" !== t) a = t, null !== n && void 0 !== n && "" !== n && (r = n); else {
                        if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                        let t = e.getExtraObject(),
                            n = t.getUserData(_.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 === n || null === n || "" === n || "0" === n) break;
                        let i = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        if (a = P.TaskCtrlOperatorNS.getSavePathByFileName(i, n), !(yield l.FileSystemAWNS.existsAW(a))) break;
                        r = "", null !== (n = t.getUserData(_.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams")) && void 0 !== n && "" !== n && (r = n)
                    }
                    if (o.ipcRenderer.send("onOpenExecute", a, r), i = !0, "ThunderUnion" === e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin)) {
                        let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                            n = `filename=${encodeURIComponent(t)}`;
                        B.information("trackEvent js_grouptask_install ", t, n), v.XLStatNS.trackEvent("core_operate", "js_grouptask_install", "", 0, 0, 0, 0, n)
                    }
                } while (0);
                return i
            })
        }, e.openTaskFolder = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = e.savePath, i = e.taskName, r = "";
                "" === i ? r = n : (void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1)), r = a.join(n, i));
                do {
                    if (e.taskType === u.DownloadKernel.TaskType.Bt) {
                        let n = V.getTaskFromTaskId(e.taskId), i = n.getExtraObject(), s = i.getDownloadFile();
                        if (1 !== s.length) {
                            t ? z(r) : o.remote.shell.showItemInFolder(r);
                            break
                        }
                        if (yield U.SingleBtTaskNS.isSingleBtTask(n)) r = U.SingleBtTaskNS.getSinleBtTaskFilePath(n); else {
                            let e = i.getBtFileList();
                            for (let [, t]of e) if (t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex) === s[0]) {
                                let e = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                    n = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                                r = a.join(r, e, n);
                                break
                            }
                        }
                    } else {
                        if (e.taskType === u.DownloadKernel.TaskType.Group) {
                            t ? z(n) : o.remote.shell.showItemInFolder(n);
                            break
                        }
                        if (e.taskType === u.DownloadKernel.TaskType.Unkown) break;
                        if (e.taskType === u.DownloadKernel.TaskType.Magnet) break
                    }
                    if (e.taskStatus === u.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === u.DownloadKernel.TaskStatus.Seeding) {
                        (yield l.FileSystemAWNS.existsAW(r)) ? o.remote.shell.showItemInFolder(r) : z(n);
                        break
                    }
                    if (yield l.FileSystemAWNS.existsAW(r)) {
                        o.remote.shell.showItemInFolder(r);
                        break
                    }
                    if (e.taskType === u.DownloadKernel.TaskType.P2sp) {
                        (yield l.FileSystemAWNS.existsAW(r + ".td")) ? o.remote.shell.showItemInFolder(r + ".td") : (yield l.FileSystemAWNS.existsAW(r + ".xltd")) ? o.remote.shell.showItemInFolder(r + ".xltd") : z(n);
                        break
                    }
                    if (e.taskType === u.DownloadKernel.TaskType.Emule) {
                        (yield l.FileSystemAWNS.existsAW(r + ".emule.td")) ? o.remote.shell.showItemInFolder(r + ".emule.td") : (yield l.FileSystemAWNS.existsAW(r + ".xltd")) ? o.remote.shell.showItemInFolder(r + ".xltd") : (yield l.FileSystemAWNS.existsAW(r + ".emule.xltd")) ? o.remote.shell.showItemInFolder(r + ".emule.xltd") : z(n);
                        break
                    }
                    if (e.taskType === u.DownloadKernel.TaskType.Bt) {
                        (yield l.FileSystemAWNS.existsAW(r + ".bt.td")) ? o.remote.shell.showItemInFolder(r + ".bt.td") : (yield l.FileSystemAWNS.existsAW(r + ".xltd")) ? o.remote.shell.showItemInFolder(r + ".xltd") : (yield l.FileSystemAWNS.existsAW(r + ".bt.xltd")) ? o.remote.shell.showItemInFolder(r + ".bt.xltd") : z(n);
                        break
                    }
                    e.taskType === u.DownloadKernel.TaskType.Group && z(n)
                } while (0)
            })
        }, e.openTaskItem = function (e, t, n, s, d) {
            return i(this, void 0, void 0, function* () {
                let i = e.savePath, c = e.taskName, h = "";
                "" === c ? h = i : (void 0 !== c && c.indexOf(".") === c.length - 1 && (c = c.substring(0, c.length - 1)), h = a.join(i, c));
                let f = V.getTaskFromTaskId(e.taskId), g = f.isSupportPlay();
                do {
                    if (e.taskType === u.DownloadKernel.TaskType.P2sp || e.taskType === u.DownloadKernel.TaskType.Emule) {
                        if (e.taskStatus !== u.DownloadKernel.TaskStatus.Succeeded && e.taskStatus !== u.DownloadKernel.TaskStatus.Seeding) break;
                        (yield l.FileSystemAWNS.existsAW(h)) && (g ? yield H(e.taskId, -1, n, s, d) : o.remote.shell.openItem(h))
                    } else if (e.taskType === u.DownloadKernel.TaskType.Bt) {
                        let i = f.getExtraObject(), c = i.getDownloadFile();
                        if (e.taskStatus === u.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === u.DownloadKernel.TaskStatus.Seeding) if (1 === c.length) {
                            if (yield U.SingleBtTaskNS.isSingleBtTask(f)) h = U.SingleBtTaskNS.getSinleBtTaskFilePath(f); else {
                                let e = i.getBtFileList();
                                for (let [, t]of e) if (t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex) === c[0]) {
                                    let e = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                        n = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                                    h = a.join(h, e, n);
                                    break
                                }
                            }
                            g ? yield H(e.taskId, -1, n, s, d) : o.remote.shell.openItem(h)
                        } else if (null !== t && void 0 !== t && -1 !== t) {
                            let i = yield r(e.taskId, t);
                            null === i || void 0 === i || i.length <= 0 ? z(h) : i[0].fileExtType === C.TaskUtilHelper.FileExtType.Video ? yield H(e.taskId, t, n, s, d) : null !== i[0].fullPath && void 0 !== i[0].fullPath && "" !== i[0].fullPath ? o.remote.shell.openItem(i[0].fullPath) : z(h)
                        } else g ? yield H(e.taskId, -1, n, s, d) : z(h); else if (null !== t && void 0 !== t && -1 !== t) {
                            let i = yield r(e.taskId, t);
                            null === i || void 0 === i || i.length <= 0 ? z(h) : i[0].fileExtType === C.TaskUtilHelper.FileExtType.Video ? i[0].fullPath && (yield l.FileSystemAWNS.existsAW(i[0].fullPath)) ? yield E(i[0].fullPath, "", "", "", "", 0, 0) : yield H(e.taskId, t, n, s, d) : null !== i[0].fullPath && void 0 !== i[0].fullPath && "" !== i[0].fullPath ? o.remote.shell.openItem(i[0].fullPath) : z(h)
                        } else z(h)
                    } else if (e.taskType === u.DownloadKernel.TaskType.Group) if (null !== t && void 0 !== t && -1 !== t) {
                        let e = f.getExtraObject();
                        if (null === e || void 0 === e) break;
                        let i = e.getSubTaskByIndex(t), r = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId),
                            c = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            h = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), g = "";
                        "" === h ? g = c : (void 0 !== h && h.indexOf(".") === h.length - 1 && (h = h.substring(0, h.length - 1)), g = a.join(c, h));
                        let p = i.isSupportPlay();
                        (yield l.FileSystemAWNS.existsAW(g)) && (p ? yield H(r, -1, n, s, d) : o.remote.shell.openItem(g))
                    } else {
                        let e = f.getExtraObject();
                        e && z(e.getSubTaskByIndex(0).getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath))
                    }
                } while (0)
            })
        }, e.startTasks = function (e) {
            let t = e.map(e => e.taskId);
            A.DownloadDispatchNS.startTasks(t)
        }, e.pauseTasks = function (e, t) {
            let n = [];
            for (let t of e) n.push(t.taskId);
            n.length > 0 && V.batchStopTask(n, t)
        }, e.deleteTasks = function (e, t) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                if (void 0 === t && (t = !0), t) {
                    let t = !1;
                    for (let n of e) if (n.taskStatus === u.DownloadKernel.TaskStatus.Started) {
                        t = !0;
                        break
                    }
                    if (t) m.MessageBox.confirm({
                        title: "任务正在下载，您确定删除任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !1
                    }).then(t => {
                        if (t.action === T.MessageBoxNS.Action.OK) {
                            let t = [];
                            for (let n of e) Q(n), t.push(n.taskId);
                            V.batchRemoveToRecycle(t).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                        }
                    }).catch(); else {
                        let t = [];
                        for (let n of e) Q(n), t.push(n.taskId);
                        V.batchRemoveToRecycle(t).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                    }
                }
            } while (0)
        }, e.destroyTasks = function (e, t) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                if (void 0 === t && (t = !0), t) {
                    let t = S.ConfigNS.getValue("ConfigMsg", "ConfigMsg_DeleteFile", !0);
                    m.MessageBox.confirm({
                        title: "您确定要删除此任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !0,
                        checkboxChecked: t,
                        checkboxLabel: "同时删除文件"
                    }, {width: 400, height: 174, center: !0}).then(t => {
                        if (t.action === T.MessageBoxNS.Action.OK) {
                            let n = [];
                            for (let t of e) Q(t), n.push(t.taskId);
                            S.ConfigNS.setValue("ConfigMsg", "ConfigMsg_DeleteFile", t.checkboxChecked), V.deleteBatchTask(n, t.checkboxChecked).then(e => {
                                t.checkboxChecked && !e && j.showNotify(N.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, D.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                            }).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                        }
                    }).catch()
                } else {
                    let t = [];
                    for (let n of e) Q(n), t.push(n.taskId);
                    V.deleteBatchTask(t, !0).then(e => {
                        e || j.showNotify(N.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, D.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                    }).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                }
            } while (0)
        }, e.move2Dir = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                if (void 0 === t || "" === t) {
                    let e = o.remote.getCurrentWindow(), n = G.showOpenDialog(e, {properties: ["openDirectory"]});
                    void 0 !== n && (t = n[0])
                }
                if (void 0 !== t && "" !== t) {
                    if (!1 !== n) {
                        let e = S.ConfigNS.getValue("MoveToDir", "LatestSavePath", []), n = e.indexOf(t);
                        -1 !== n && e.splice(n, 1), e.splice(0, 0, t), e = e.slice(0, 3), S.ConfigNS.setValue("MoveToDir", "LatestSavePath", e), S.ConfigNS.save().catch()
                    }
                    for (let n of e) i = yield V.moveTaskToPath(n.taskId, t)
                }
                return i
            })
        }, e.copy2Dir = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = void 0;
                if (void 0 !== t && "" !== t) n = t; else {
                    let e = o.remote.getCurrentWindow(), t = G.showOpenDialog(e, {properties: ["openDirectory"]});
                    void 0 !== t && (n = t[0])
                }
                if (void 0 !== n && "" !== n) {
                    let t = S.ConfigNS.getValue("CopyToDir", "LatestSavePath", []), i = t.indexOf(n);
                    -1 !== i && t.splice(i, 1), t.splice(0, 0, n), t = t.slice(0, 3), S.ConfigNS.setValue("CopyToDir", "LatestSavePath", t), S.ConfigNS.save().catch();
                    for (let t of e) {
                        let e = t.savePath, i = t.taskName, r = e, s = n;
                        if (t.taskType !== u.DownloadKernel.TaskType.Group) {
                            let n = V.getTaskFromTaskId(t.taskId);
                            if (yield U.SingleBtTaskNS.isSingleBtTask(n)) {
                                let e = n.getExtraObject().getBtFileList();
                                for (let [, t]of e) {
                                    i = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                                    break
                                }
                            }
                            r = a.join(e, i)
                        } else r = a.join(r, "*");
                        s = a.join(n, i), r !== n && o.ipcRenderer.send(b.ThunderChannelList.channelRMFileCopy, r, s)
                    }
                }
            })
        }, e.copyLink = function (e) {
            let t = [];
            for (let n of e) {
                let e = V.getTaskFromTaskId(n.taskId);
                if (n.taskType !== u.DownloadKernel.TaskType.P2sp) if (n.taskType !== u.DownloadKernel.TaskType.Emule) if (n.taskType !== u.DownloadKernel.TaskType.Group) ; else {
                    let e = V.getTaskFromTaskId(n.taskId).getExtraObject(), i = e.getSubTaskCount();
                    for (let n = 0; n < i; n++) {
                        let i = g(e.getSubTaskByIndex(n));
                        t.push(i)
                    }
                } else t.push(n.url); else {
                    let i = e.getExtraObject().getDisplayUrl();
                    "" === i && (i = n.url), t.push(i)
                }
            }
            o.clipboard.writeText(t.join("\r\n")), j.showNotify(N.ToastNotifyManagerNS.notifyIdTaskOperatorCopyLink, D.ToastNotifyItemType.GreenNotify, "链接已复制", 3e3)
        }, e.copyMagnetLink = function (e) {
            do {
                if (void 0 === e) break;
                if (e.taskType !== u.DownloadKernel.TaskType.Bt) break;
                let t = "magnet:?xt=urn:btih:" + V.getTaskFromTaskId(e.taskId).getExtraObject().getInfoId();
                o.clipboard.writeText(t), j.showNotify(N.ToastNotifyManagerNS.notifyIdTaskOperatorCopyMagnetLink, D.ToastNotifyItemType.GreenNotify, "磁力链接已复制", 3e3)
            } while (0)
        }, e.saveAsTorrent = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (void 0 === e) break;
                    if (e.taskType !== u.DownloadKernel.TaskType.Bt) break;
                    let n = V.getTaskFromTaskId(e.taskId).getExtraObject(), i = n.getSeedFilePath();
                    if (!(yield l.FileSystemAWNS.existsAW(i))) break;
                    let r = e.taskName;
                    void 0 !== r && "" !== r || "" === (r = n.getDisplayName()) && (r = a.parse(i).name);
                    let s = r, d = a.parse(r);
                    x.ParseUrlFileNameNS.isUsualFileExtName(d.ext) && (s = d.name + ".torrent");
                    let c = o.remote.getCurrentWindow(),
                        h = {defaultPath: s, filters: [{name: "BT种子文件（*.torrent）", extensions: ["torrent"]}]},
                        f = G.showSaveDialog(c, h);
                    if (void 0 === f || "" === f) {
                        t = !0;
                        break
                    }
                    ".torrent" !== a.extname(f).toLowerCase() && (f += ".torrent"), t = yield l.FileSystemAWNS.copyFileAW(i, f)
                } while (0);
                t || j.showNotify(N.ToastNotifyManagerNS.notifyIdTaskOperatorSaveAsTorrent, D.ToastNotifyItemType.RedNotify, "获取此任务种子文件失败", 3e3)
            })
        }, e.renameTask = function (e) {
            B.information("rename", e.taskName, e.taskId);
            let t = e.taskName;
            m.MessageBox.custom("task-rename", {taskBase: e}, {width: 300, height: 194, center: !0}).then(n => {
                if (n.action === T.MessageBoxNS.Action.OK) do {
                    if (w.isNullOrUndefined(n.args)) break;
                    if (void 0 === n.args.fileName || null === n.args.fileName) break;
                    let i = n.args.fileName;
                    if (i === t) break;
                    V.getTaskFromTaskId(e.taskId).reName(i).catch()
                } while (0)
            }).catch()
        }, e.recoverTask = function (e) {
            if (e.length > 1) {
                let t = [];
                for (let n of e) t.push(n.taskId);
                V.batchRecoverFromRecycle(t)
            } else for (let t of e) V.recoverFromRecycle(t.taskId);
            j.showNotify(N.ToastNotifyManagerNS.notifyIdTaskOperatorRecoverTask, D.ToastNotifyItemType.GreenNotify, "已还原任务", 3e3)
        }, e.clearRecycle = function () {
            let e = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Recycle).getTasks();
            e.size > 0 && m.MessageBox.confirm({
                title: "确定清空垃圾箱？",
                type: m.MessageBox.ConfirmType.Warning,
                checkboxEnabled: !0,
                checkboxChecked: !1,
                checkboxLabel: "同时删除文件"
            }, {width: 400, height: 174, center: !0}).then(t => {
                if (t.action === T.MessageBoxNS.Action.OK) {
                    let n = [];
                    e.forEach(e => {
                        n.push(e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId))
                    }), V.deleteBatchTask(n, t.checkboxChecked).catch()
                }
            }).catch()
        }, e.startAllPausedTask = function () {
            let e = [], t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) n.getTaskStatus() === u.DownloadKernel.TaskStatus.Stopped && e.push(n);
            let n = e.map(e => e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId));
            A.DownloadDispatchNS.startTasks(n)
        }, e.startAll = function () {
            let e = [], t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) e.push(n);
            let n = e.map(e => e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId));
            A.DownloadDispatchNS.startTasks(n)
        }, e.pauseAll = function () {
            let e = [], t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) null !== n && (n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background) || e.push(n.getId()));
            e.length > 0 && V.batchStopTask(e)
        }, e.hasCategoryStartTask = function (e) {
            let t = !1, n = W.getCategoryView(e, u.DownloadKernel.CategroyViewID.Downloading);
            if (!n) return t;
            let i = n.getTasks();
            for (let [, e]of i) if (null !== e) {
                let n = e.getTaskStatus();
                if (n === u.DownloadKernel.TaskStatus.StartWaiting || n === u.DownloadKernel.TaskStatus.StartPending || n === u.DownloadKernel.TaskStatus.Started) {
                    t = !0;
                    break
                }
            }
            return t
        }, e.startCategoryAllTask = function (e) {
            let t = W.getCategoryView(e, u.DownloadKernel.CategroyViewID.Downloading);
            if (!t) return;
            let n = t.getTasks();
            for (let [, e]of n) null !== e && (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background) || V.startTask(e.getId()))
        }, e.pauseCategoryAllTask = function (e) {
            let t = W.getCategoryView(e, u.DownloadKernel.CategroyViewID.Downloading);
            if (!t) return;
            let n = [], i = t.getTasks();
            for (let [, e]of i) null !== e && (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background) || n.push(e.getId()));
            n.length > 0 && V.batchStopTask(n)
        }, e.playVedioByXmp = E, e.downloadAndPlay = H, e.vipAcclerate = function (e) {
            return i(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: t} = yield Promise.resolve().then(() => n(52));
                do {
                    if (void 0 === e) break;
                    if (0 === e.length) break;
                    let n = [];
                    for (let t of e) n.push(t.taskId);
                    t.clickBatchAcclerateBtn(n)
                } while (0)
            })
        }, e.statJsSdkDeleteTask = Q, e.createBirdKey = function (e) {
            let t, n, i = V.getTaskFromTaskId(e), a = i.getTaskBaseInfo(), o = i.getType(), r = "";
            if (o === u.DownloadKernel.TaskType.P2sp) r = a.url, n = "p2sp", t = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid); else if (o === u.DownloadKernel.TaskType.Emule) r = a.url, n = "emule", t = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid); else if (o === u.DownloadKernel.TaskType.Bt) {
                n = "bt";
                let e = i.getExtraObject();
                t = e.getInfoId(), r = "magnet:?xt=urn:btih:" + e.getInfoId()
            } else o === u.DownloadKernel.TaskType.Magnet && (n = "magnet");
            if (r.length > 0) {
                B.information("点击任务详情按钮,生成迅雷口令,taskURL:", r);
                let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryViewId), o = new Map;
                o.set(u.DownloadKernel.CategroyViewID.Downloading, "downloading"), o.set(u.DownloadKernel.CategroyViewID.Completed, "complete"), o.set(u.DownloadKernel.CategroyViewID.Recycle, "trash"), o.set(u.DownloadKernel.CategroyViewID.Unkown, "unknown");
                let s = {
                    pannel: o.get(e),
                    gcid: t,
                    taskid: a.taskId.toString(),
                    filename: a.taskName,
                    pannelType: i.getIsPrivate() ? "private" : "mypc",
                    taskType: n
                };
                F.openBirdKeyEncodeDialog(r, s).catch()
            }
        }
    }(t.TaskOperatorNs || (t.TaskOperatorNs = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        function t(e) {
            let t = e.toString(16).toUpperCase();
            return t.length < 2 && (t = "0" + t), t
        }

        function n(e, n, i, a) {
            return "0x" + t(a) + t(e) + t(n) + t(i)
        }

        e.rgbaStringToHexWith0xBegin = function (e) {
            if (void 0 !== e) {
                let t = e.split(",");
                return n(parseInt(t[0] || "0", 10), parseInt(t[1] || "0", 10), parseInt(t[2] || "0", 10), parseInt(t[3] || "255", 10))
            }
        }, e.colorNumberToHex = t, e.rgbaToHexWith0xBegin = n
    }(t.ColorUtilNS || (t.ColorUtilNS = {}))
}, function (e, t) {
    e.exports = function (e) {
        return e.webpackPolyfill || (e.deprecate = function () {
        }, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
            enumerable: !0,
            get: function () {
                return e.l
            }
        }), Object.defineProperty(e, "id", {
            enumerable: !0, get: function () {
                return e.i
            }
        }), e.webpackPolyfill = 1), e
    }
}, , function (e, t, n) {
    e.exports = n(9)(61)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(784), o = n(83), r = n(29), s = i.default.getLogger("DownloadKernel.CategoryManager");

    class l {
        constructor() {
            this.newCategoryId = 0, this.categorys = new Map, this.userId = "", this.accountPassword = ""
        }

        init() {
            o.ThunderKernel.loadCategory(e => {
                e.forEach(e => {
                    if ("Private" === e.name) {
                        let t = a.PrivateCategory.createCategoryFromData(e);
                        t && this.categorys.set(e.categoryId, t)
                    } else s.warning("unkown category name:", e.name);
                    void 0 !== e.categoryId && this.newCategoryId <= e.categoryId && (this.newCategoryId = e.categoryId + 1)
                })
            })
        }

        getCategorys() {
            return this.categorys
        }

        getCategoryCount() {
            return this.categorys.size
        }

        getCategoryFromId(e) {
            return this.categorys.get(e)
        }

        getCategoryView(e, t) {
            let n = null, i = this.getCategoryFromId(e);
            return i && (n = i.getCategoryViewFromId(t)), n
        }

        getPrivateCategoryFromUserId(e) {
            if (!e || "" === e) return null;
            let t = null;
            for (let n of this.categorys.values()) if (n.getUserName() === e) {
                t = n;
                break
            }
            return t || (s.information("create new private category, id:", this.newCategoryId), (t = new a.PrivateCategory(this.newCategoryId)).setName("Private"), t.setDescription("Private Space"), t.setUserName(e), t.setAccountPassword(""), this.categorys.set(this.newCategoryId, t), this.newCategoryId++, o.ThunderKernel.createCategory(t.getId(), -1, -1, t.getName(), t.getDescription(), t.getUserName(), t.getAccountPassword())), t
        }

        getCurrentPrivateCategory() {
            if (!this.userId || "" === this.userId) return null;
            return this.getPrivateCategoryFromUserId(this.userId)
        }

        setUserInfo(e, t) {
            e = e || "", t = t || "";
            let n = !1;
            this.userId !== e && (this.userId = e, n = !0);
            let i = "";
            if ("" === t) i = ""; else {
                let e = r.createHash("md5");
                e.update(this.accountPassword), i = e.digest("hex")
            }
            if (this.accountPassword !== i && (this.accountPassword = i, n = !0), n) {
                let e = null;
                for (let t of this.categorys.values()) if (t.getUserName() === this.userId) {
                    e = t;
                    break
                }
                e && e.setAccountPassword(this.accountPassword)
            }
        }
    }

    t.CategoryManager = l, function (e) {
        const t = new l;
        e.getCategoryManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryManager || (t.DownloadKernelCategoryManager = {}))
}, function (e, t) {
    e.exports = require("assert")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(14), r = a.default.getLogger("FetchRes"), s = {
        mock: "http://easy-mock.com/mock/59f0652c1bd72e7a888988ab/sl",
        test: "http://api-xl9-ssl.xunlei.com/sl_dev",
        pre: "http://api-xl9-ssl.xunlei.com/sl_pre",
        prod: "http://api-xl9-ssl.xunlei.com/sl"
    };

    function l({url: e, data: t, method: a = "get"}) {
        return i(this, arguments, void 0, function* () {
            r.information("fetchFromApiProxy", arguments);
            try {
                const i = yield Promise.all([o.default("GetUserID"), o.default("GetSessionID"), o.default("GetPeerID")]), [s, l, u] = i;
                r.information(i);
                let d = {
                    _sessid: l,
                    _uid: s,
                    _m: a,
                    _h: [`Peer-Id:${u}`, `User-Id:${s}`, `Session-Id:${l}`, "App-Type:pc_xunlei", ...t && t._h || []]
                };
                t && t._h && delete t._h;
                let c = Object.assign({}, d, "get" === a && t);
                r.information("fetchFromApiProxy data", c);
                const h = yield n(24);
                return h.defaults.adapter = n(22), "post" === a && (h.defaults.headers["Content-Type"] = "application/json"), h.request({
                    method: a,
                    url: e,
                    params: c,
                    data: t
                }).then(e => (r.information("fetchFromApiProxy success", e), e)).catch(e => {
                    r.information("fetchFromApiProxy failed", e)
                })
            } catch (e) {
                return {error: e}
            }
        })
    }

    t.fetchFromApiProxy = l, t.fetchSlRes = function ({url: e, data: t, method: n = "get"}, a = "prod") {
        return i(this, void 0, void 0, function* () {
            let i = s[a], u = yield o.default("GetValue", "ConfigFetchInterface", "TestServer", 0);
            return 1 === u ? i = s.test : 2 === u && (i = s.pre), r.information("当前fetchSlRes 是否测试服:", u, " 远程地址:", i), l({
                url: `${i}${e}`,
                data: t,
                method: n
            })
        })
    }, t.fetchPCRes = function ({url: e, data: t, method: n = "get"}, a = "prod", o = !1) {
        return i(this, void 0, void 0, function* () {
            let i = "http://api-xl9-ssl.xunlei.com";
            return o && (i = "http://api-shoulei-ssl.xunlei.com"), l({url: `${i}${e}`, data: t, method: n})
        })
    }, t.fetchRequest = function ({url: e, data: t, method: a = "get"}) {
        return i(this, arguments, void 0, function* () {
            r.information("fetchRequest", arguments);
            try {
                const i = yield n(24);
                return i.defaults.adapter = n(22), "post" === a && (i.defaults.headers["Content-Type"] = "application/json"), i.request({
                    method: a,
                    url: e,
                    params: "get" === a && t ? t : {},
                    data: "post" === a && t ? t : {}
                }).then(e => (r.information("fetchRequest success", e), e))
            } catch (e) {
                return {error: e}
            }
        })
    }
}, function (e, t, n) {
    e.exports = n(9)(24)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(75), a = n(48);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\components\\select-native.vue", t.default = s.exports
}, , , , , , , , , , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(7), l = n(15), u = n(8), d = n(32), c = n(229), h = n(195), f = n(12),
        g = n(69), p = n(150), k = n(33), m = n(74), T = n(23), v = n(25), C = n(10), S = n(84), y = n(31), w = n(82),
        I = n(267), b = n(245), A = n(134), N = n(791), D = n(58), _ = n(20), x = n(13), E = n(151), P = n(135),
        M = n(133), F = P.ToastNotifyManagerNS.getToastNotifyManger(), O = r.default.getLogger("ThunderNewTask"),
        U = d.DownloadKernelTaskManager.getTaskManager(),
        L = s.default(o.join(__rootDir, "../bin/ThunderNewTask.node")),
        B = s.default(o.join(__rootDir, "../bin/ThunderHelper.node")), K = n(28), V = n(3).remote;
    let R = !1;
    !function (e) {
        function t(e, t) {
            let n = U.getTaskFromTaskId(e);
            do {
                if (null === n) break;
                let i = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryId),
                    a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryViewId);
                if (O.information("查看重复任务", a), a === u.DownloadKernel.CategroyViewID.Unkown) break;
                t = void 0 === t || t, m.default.fireEvent(T.NodeEventMesssageNS.eventDownloadSwitchCategory, i, a, e, t)
            } while (0)
        }

        function n(e, n) {
            O.information("重复下载任务：nlen = ", e.length);
            do {
                if (e.length <= 0) break;
                if (e.length <= 1) {
                    let a = !1, o = e[0], r = e[0].getTaskBaseInfo();
                    if (r.taskType === u.DownloadKernel.TaskType.P2sp || r.taskType === u.DownloadKernel.TaskType.Emule) {
                        let t = e[0].getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId);
                        if (t > 0) {
                            let e = U.getTaskFromTaskId(t);
                            null !== e && void 0 !== e && (o = e, a = !0)
                        }
                    }
                    k.MessageBox.confirm({
                        title: "重复下载，该任务已存在列表中",
                        type: k.MessageBox.ConfirmType.Warning,
                        fileName: o.getTaskBaseInfo().taskName,
                        okText: "查看",
                        cancelText: "重新下载",
                        cancelVisible: !a
                    }).then(e => i(this, void 0, void 0, function* () {
                        if (e.action === K.MessageBoxNS.Action.OK) {
                            t(o.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId))
                        } else if (e.action === K.MessageBoxNS.Action.Cancel) if (void 0 === n || null === n || 0 === n.length) h.TaskCtrlOperatorNS.redownloadTask([o.getTaskBaseInfo()], !1).catch(); else {
                            yield U.deleteTask(o.getTaskBaseInfo().taskId, !0), n[0].newTaskInfo.taskBaseInfo.productInfo = h.TaskCtrlOperatorNS.constructProductInfo(""), n[0].newTaskInfo.taskBaseInfo.origin = "re_download";
                            let e = yield U.createTask(n[0].taskType, n[0].newTaskInfo);
                            if (null !== e) {
                                let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                A.DownloadDispatchNS.startTask(t)
                            }
                        }
                    })).catch()
                } else {
                    let t = e.map(e => e.getTaskBaseInfo().url), n = JSON.stringify(t);
                    k.MessageBox.custom("multi-repeat-task", {file: n}).catch()
                }
            } while (0)
        }

        function r(e, t) {
            for (let n of e) {
                let e = t.indexOf(n.index);
                -1 !== e && t.splice(e, 1)
            }
            return t
        }

        function s(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (void 0 === e) break;
                    if (null === e) break;
                    for (let t of e) yield C.FileSystemAWNS.unlinkAW(t.fullPath)
                } while (0)
            })
        }

        function W(e, n, a, l, c, f, g, p, m, T, v) {
            return i(this, void 0, void 0, function* () {
                let i = f;
                const C = d.DownloadKernelTaskManager.getTaskManager();
                do {
                    if (void 0 === p) break;
                    if ("ignore" === p) {
                        if (void 0 === (i = r(m, f)) || null === i) break;
                        if (0 === i.length) {
                            if (void 0 !== T) t(T); else {
                                let t = o.join(e, a.title);
                                k.MessageBox.confirm({
                                    title: "全部文件已存在，位于以下路径：",
                                    type: k.MessageBox.ConfirmType.Warning,
                                    content: t,
                                    okText: "知道了",
                                    cancelText: "打开文件夹"
                                }).then(e => {
                                    e.action === K.MessageBoxNS.Action.Cancel && V.shell.showItemInFolder(t)
                                }).catch()
                            }
                            break
                        }
                        void 0 !== T && (yield C.deleteTask(T, !1))
                    } else if ("delete" === p) yield s(m), void 0 !== T && (yield C.deleteTask(T, !0)); else if ("continue" === p && void 0 !== T) {
                        A.DownloadDispatchNS.startTask(T);
                        break
                    }
                    let d = a.trackerUrls.join("\n"), S = h.TaskCtrlOperatorNS.constructProductInfo(g.browser), y = {
                        taskBaseInfo: {savePath: e, taskName: a.title, productInfo: S, origin: g.source},
                        btTaskInfo: {
                            seedFile: l,
                            displayName: c,
                            fileLists: a.fileLists,
                            infoId: a.infoId,
                            fileRealIndexLists: i,
                            tracker: d
                        },
                        privateSpace: v
                    };
                    O.information("create task bt productinfo", g);
                    let w = yield C.createTask(u.DownloadKernel.TaskType.Bt, y);
                    if (null !== w) {
                        if (1 === n) {
                            let e = w.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                            A.DownloadDispatchNS.startTask(e)
                        }
                    } else O.warning("create bt task null")
                } while (0)
            })
        }

        function H(e, t) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (0 === e.length) break;
                    a.ipcRenderer.send("create-new-task-window", JSON.stringify(e))
                } while (0)
            })
        }

        function j(e, t, n, i, o) {
            a.ipcRenderer.send("create-pre-new-task-window", e ? JSON.stringify(e) : e, t, n, i, o ? JSON.stringify(o) : o)
        }

        function G(e, t) {
            a.ipcRenderer.send("create-bt-task-window", e ? JSON.stringify(e) : e, t ? JSON.stringify(t) : t)
        }

        function z(e) {
            if (void 0 !== e && null !== e && "" !== e) {
                v.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "") !== e && (v.ConfigNS.setValue("PathAndCategory", "LastUsedPath", e), v.ConfigNS.save().catch())
            }
        }

        function $(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (e.length > 1) {
                        H(e).catch();
                        break
                    }
                    let t = e[0];
                    if (void 0 === t.browser || t.browser, t.browser, 0 === (yield g.NativeCallAWNS.getConfigValueAW("TaskDefaultSettings", "OpenSilenceDownload", 0))) {
                        H(e).catch();
                        break
                    }
                    let i = _.ThunderHelper.getTaskTypeFromUrl(t.url), a = p.ParseUrlFileNameNS.getNameFromUrl(t.url),
                        o = yield g.NativeCallAWNS.getDownloadDir(),
                        r = yield g.NativeCallAWNS.getConfigValueAW("TaskDefaultSettings", "NewTaskStartMode", 1),
                        s = [], l = void 0;
                    if (i === u.DownloadKernel.TaskType.P2sp) l = {
                        taskType: u.DownloadKernel.TaskType.P2sp,
                        newTaskInfo: {
                            taskBaseInfo: {taskName: a, savePath: o},
                            p2spTaskInfo: {url: t.url, refUrl: t.referer, cookie: t.cookie}
                        }
                    }, s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                        taskType: u.DownloadKernel.TaskType.P2sp,
                        value: t.url
                    }]); else if (i === u.DownloadKernel.TaskType.Emule) {
                        l = {
                            taskType: u.DownloadKernel.TaskType.Emule,
                            newTaskInfo: {taskBaseInfo: {taskName: a, savePath: o}, emuleTaskInfo: {url: t.url}}
                        };
                        let e = p.ParseUrlFileNameNS.parseEd2kUrl(t.url);
                        s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                            taskType: u.DownloadKernel.TaskType.Emule,
                            value: e.fileHash
                        }])
                    }
                    if (s && s.length > 0) {
                        V.getCurrentWindow().show(), n(s, [l]);
                        break
                    }
                    if (void 0 === l) break;
                    let d = yield U.createTask(l.taskType, l.newTaskInfo);
                    if (null !== d && 1 === r) {
                        let e = d.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        A.DownloadDispatchNS.startTask(e)
                    }
                } while (0)
            })
        }

        function q(e, t) {
            let n = "";
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let i = e;
                if (S.Common.isThunderPrivateUrl(e) && (i = S.Common.parseThunderPrivateUrl(e)), null === i || void 0 === i || "" === i) break;
                let a = i.indexOf(t);
                if (a < 0) break;
                let r = i.substring(a + t.length);
                if (null === r || void 0 === r || "" === r) break;
                n = X(o.dirname(r))
            } while (0);
            return n
        }

        function X(e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = e.split(/\//);
                if (n.length <= 0) break;
                for (let e = 0; e < n.length; ++e) {
                    let i = n[e];
                    if (null !== i && "" !== i) {
                        let e = i.replace(/[*?/:|<>"]/g, "");
                        null !== e && "" !== e && (e = e.trim(), t = "" === t ? e : o.join(t, e))
                    }
                }
            } while (0);
            return t
        }

        function J(e, t, n) {
            let i = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let a = e;
                if (S.Common.isThunderPrivateUrl(e) && (a = S.Common.parseThunderPrivateUrl(e)), null === a || void 0 === a || "" === a) break;
                if (null !== n && void 0 !== n && "" !== n) {
                    n === o.basename(t) && (i = a);
                    break
                }
                o.basename(a) === o.basename(t) && (i = a)
            } while (0);
            return i
        }

        function Y(e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = y.parse(e).hostname;
                if (null === n || void 0 === n || "" === n) break;
                let i = w.default.getConfigInfo("thunderLink", "whiteList");
                if (null === i || void 0 === i || "" === i || i.length <= 0) break;
                for (let e = 0; e < i.length; ++e) if (n.toLowerCase() === i[e].toLowerCase()) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function Q(e) {
            return i(this, void 0, void 0, function* () {
                let t = "您正在使用旧版本迅雷，不支持下载";
                return null !== e && void 0 !== e && "" !== e ? t = t + '"' + e + '"' : t += '"此类文件"', t += "<br>建议您升级到最新版迅雷后，再次进行下载！", new Promise(e => {
                    k.MessageBox.confirm({
                        title: "请使用最新版迅雷",
                        type: k.MessageBox.ConfirmType.Warning,
                        content: t,
                        okText: "升级迅雷",
                        cancelVisible: !1
                    }).then(t => {
                        t.action === K.MessageBoxNS.Action.OK ? e(!0) : e(!1)
                    }).catch()
                })
            })
        }

        function Z(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (void 0 === e || null === e || "" === e) break;
                    let t = null, n = null;
                    try {
                        n = JSON.parse(e)
                    } catch (e) {
                    }
                    if (null === n || void 0 === n || n.length <= 0) break;
                    let i = n.json, a = !1;
                    if (null !== i && void 0 !== i && "" !== i) {
                        a = !0, t = yield E.ThunderNewtaskHelperNS.readThunderUnionConfig(i);
                        let e = "url=" + encodeURIComponent(i);
                        if (O.information("createThunderxTask:需要读取配置信息 jsonUrlStr = ", i), null === t || void 0 === t) {
                            e += ",result=fail,errorcode=pick_up_fail", x.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e);
                            break
                        }
                        if ("" === t || null === t.tasks || void 0 === t.tasks) {
                            e += ",result=fail,errorcode=analysis_fail", x.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e);
                            break
                        }
                        e += ",result=success", x.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e)
                    } else t = n;
                    let r = t.tasks;
                    if (null === r || void 0 === r || r.length <= 0) break;
                    let s = t.taskGroupName;
                    O.information("createThunderxTask:jsonData = ", t);
                    let l = t.minVersion;
                    if (null !== l && void 0 !== l && "" !== l || a && (l = "10.1.2.0"), null !== l && void 0 !== l && "" !== l) {
                        let e = o.join(__rootDir, "../../Thunder.exe"), t = B.getFileVersion(e);
                        if (-1 === D.TaskUtilHelper.compareVersion(l, t)) {
                            if (!R) {
                                x.XLStatNS.trackEvent("core_operate", "newthunder_lowversion_popup", "", 0, 0, 0, 0, ""), R = !0;
                                let e = yield Q(s);
                                R = !1, e && (x.XLStatNS.trackEvent("core_operate", "newthunder_lowversion_download", "", 0, 0, 0, 0, ""), B.startManualUpdateWithUI())
                            }
                            return
                        }
                    }
                    let u = t.downloadDir, d = t.installFile, c = t.excludePath, h = t.runParams, g = t.userAgent,
                        p = null;
                    null !== t.threadCount && void 0 !== t.threadCount && "" !== t.threadCount && (p = Number(t.threadCount));
                    let k = [], m = "";
                    for (let e = 0; e < r.length; ++e) {
                        let t = r[e], n = t.url, i = t.name, a = 0;
                        if (null !== d && void 0 !== d && "" !== d && "" === m) {
                            let e = J(n, d, i);
                            "" !== e && (m = e)
                        }
                        null !== t.size && void 0 !== t.size && (a = t.size);
                        let o = "";
                        null !== t.dir && void 0 !== t.dir && "" !== t.dir ? o = X(t.dir) : null !== c && void 0 !== c && "" !== c && (o = q(n, c));
                        let s = n;
                        if (S.Common.isThunderPrivateUrl(n) && (s = S.Common.parseThunderPrivateUrl(n)), void 0 !== s && null !== s && "" !== s) {
                            let e = {url: n, fileName: i, fileSize: a, subDir: o, statClick: "ThunderUnion"};
                            k.push(e)
                        }
                    }
                    if (k.length >= 1) {
                        let e = {};
                        if (null !== u && void 0 !== u && "" !== u) {
                            let t = f.ThunderUtil.getMaxFreeDriver();
                            null !== t && "" !== t && (t += ":"), u = o.join(t, u), e.isNotSavePath = !0
                        }
                        if (null !== p && void 0 !== p && (p <= 0 ? p = 1 : p >= 10 && (p = 10), e.threadCount = p), null !== g && void 0 !== g && "" !== g && (e.userAgent = g), null !== s && void 0 !== s && "" !== s && null !== d && void 0 !== d && "" !== d && null !== m && void 0 !== m && "" !== m && Y(m)) {
                            let t = d.replace(/[*?:|<>"]/g, "_");
                            e.installFile = t, e.runParams = h
                        }
                        j(k, "ThunderUnion", u, s, e), B.emptyClipBoard()
                    }
                } while (0)
            })
        }

        e.selectTask = t, e.repeatTasksMsg = n, e.createNewTaskWindow = H, e.createPreNewTaskWindow = j, e.createBtTaskWindow = G, e.uninit = function () {
            L.uninitNodeBKWindow()
        }, e.saveLastestDownloadPath = z, e.createTaskByUrl = function (e, t) {
            do {
                if (void 0 === e || null === e || "" === e) break;
                let n = "";
                n = void 0 !== t && "" !== t ? t : p.ParseUrlFileNameNS.getNameFromUrl(e);
                let i = _.ThunderHelper.getTaskTypeFromUrl(e);
                i === u.DownloadKernel.TaskType.Emule || i === u.DownloadKernel.TaskType.P2sp ? $([{
                    url: e,
                    fileName: n
                }]).catch() : i === u.DownloadKernel.TaskType.Bt && G({url: e, type: "url"}, {browser: "xlbrowser.exe"})
            } while (0)
        }, e.createUnionTask = function (e) {
            return i(this, void 0, void 0, function* () {
                do {
                    let t = decodeURIComponent(e);
                    O.information("createUnionTask:urlPath = ", t, e);
                    let n = yield C.FileSystemAWNS.readFileAW(t);
                    if (yield C.FileSystemAWNS.unlinkAW(t), null === n || void 0 === n || "" === n.toString()) {
                        O.information("createUnionTask:读取内容 buf为null");
                        break
                    }
                    let i = n.toString(), a = (i += "\r\n").split("\r\n");
                    if (a.length <= 1) {
                        O.information("createUnionTask:lines.length <= 1");
                        break
                    }
                    let r = !1, s = "", l = [], u = "", d = "", c = "", h = "", g = "", p = "", k = "", m = new Map,
                        T = new Map, v = new Map, y = new Map;
                    for (let e = 0; e < a.length; ++e) {
                        let t = a[e].split("=");
                        if (null !== t && 2 === t.length) {
                            let e = t[0].toLowerCase(), n = t[1];
                            if (null !== e && "" !== e) {
                                if (n = n.replace(/\+/g, "%20"), n = decodeURIComponent(n), "json" === e) {
                                    r = !0, s = n;
                                    break
                                }
                                if ("taskgroupname" === e) u = n; else if ("downloaddir" === e) d = n; else if ("installfile" === e) c = n; else if ("excludepath" === e) h = n; else if ("runparams" === e) g = n; else if ("useragent" === e) p = n; else if ("threadcount" === e) k = n; else {
                                    O.information("createUnionTask:", e, n);
                                    let t = e.match(/^tasks\[\d+\]/), i = "";
                                    null !== t && void 0 !== t && (i = t[0]);
                                    let a = /url/;
                                    a.test(e) ? "" !== i ? m.set(i, n) : l.push(n) : (a = /^tasks\[\d+\]\[name\]/).test(e) ? "" !== i && T.set(i, n) : (a = /^tasks\[\d+\]\[size\]/).test(e) ? "" !== i && v.set(i, n) : (a = /^tasks\[\d+\]\[dir\]/).test(e) && "" !== i && y.set(i, n)
                                }
                            }
                        }
                    }
                    if (r) {
                        O.information("createUnionTask 通过读取配置信息得到数据 jsonUrlStr:", s);
                        let e = {minVersion: "", json: s};
                        yield Z(JSON.stringify(e))
                    } else {
                        let e = [], t = "";
                        if (null !== m && m.size > 0 && m.forEach((n, i) => {
                            let a = n, o = "", r = 0;
                            if (null !== T && T.size > 0 && (o = T.get(i)), null !== c && void 0 !== c && "" !== c && "" === t) {
                                let e = J(a, c, o);
                                "" !== e && (t = e)
                            }
                            if (null !== v && v.size > 0) {
                                let e = v.get(i);
                                null !== e && "" !== e && (r = Number(e))
                            }
                            let s = "", l = y.get(i);
                            null !== l && void 0 !== l && "" !== l ? s = X(l) : null !== h && void 0 !== h && "" !== h && (s = q(a, h));
                            let u = a;
                            if (S.Common.isThunderPrivateUrl(a) && (u = S.Common.parseThunderPrivateUrl(a)), void 0 !== u && null !== u && "" !== u) {
                                let t = {url: a, fileName: o, fileSize: r, subDir: s, statClick: "ThunderUnion"};
                                e.push(t)
                            }
                        }), e.length >= 1) {
                            let n = {};
                            if (null !== d && "" !== d) {
                                let e = f.ThunderUtil.getMaxFreeDriver();
                                null !== e && "" !== e && (e += ":"), d = o.join(e, d), n.isNotSavePath = !0
                            }
                            if (null !== k && void 0 !== k && "" !== k) {
                                let e = Number(k);
                                e <= 0 ? e = 1 : e >= 10 && (e = 10), n.threadCount = e
                            }
                            if (null !== p && void 0 !== p && "" !== p && (n.userAgent = p), null !== u && void 0 !== u && "" !== u && null !== c && void 0 !== c && "" !== c && null !== t && void 0 !== t && "" !== t && Y(t)) {
                                let e = c.replace(/[*?:|<>"]/g, "_");
                                n.installFile = e, n.runParams = g
                            }
                            O.information("createUnionTask：新协议拉起新建面板", n), j(e, "ThunderUnion", d, u, n)
                        }
                        l.length >= 1 && (O.information("createUnionTask：旧协议拉起新建面板"), j(l, "ThunderUnion"))
                    }
                } while (0)
            })
        }, e.sendMessageBox = Q, e.createThunderxTask = Z, e.init = function () {
            O.information("xxxxx init====="), L.setNewTaskCallback(e => i(this, void 0, void 0, function* () {
                if (O.information("setNewTaskCallback", e), e.length > 0) {
                    let t = [], n = [];
                    for (let i of e) {
                        let e = i.url, a = _.ThunderHelper.getTaskTypeFromUrl(e);
                        a === u.DownloadKernel.TaskType.P2sp || a === u.DownloadKernel.TaskType.Emule ? t.push(i) : a !== u.DownloadKernel.TaskType.Magnet && a !== u.DownloadKernel.TaskType.Bt || n.push(i)
                    }
                    if (t.length > 0 && $(t).catch(), n.length > 0) for (let e of n) G({
                        url: e.url,
                        type: "url"
                    }, {browser: e.browser, source: e.statClick})
                }
            })), L.initNodeBKWindow(), V.ipcMain.on(l.ThunderChannelList.channelRMNewTaskCreateNewTask, (e, t, a, r, s, d, f, g) => i(this, void 0, void 0, function* () {
                let i = null;
                try {
                    i = JSON.parse(r)
                } catch (e) {
                    O.warning(e)
                }
                if (null === i) return;
                let p = [...Object.values(i)];
                if (O.information("xxx", p, s), s) {
                    let n = yield h.TaskCtrlOperatorNS.getUsrInfoAw("userid");
                    if (I.PrivateSpaceHelperNS.isPrivateSpaceOpen(n)) {
                        let t = yield I.PrivateSpaceHelperNS.openPrivateCategory(n);
                        if (t < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== t) return;
                        let i = yield I.PrivateSpaceHelperNS.accessPrivateCategory(n);
                        if (i < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== i) return
                    } else {
                        s = !1;
                        let e = v.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                        null !== e && void 0 !== e && "" !== e || (e = v.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), t = e, F.showNotify(P.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, M.ToastNotifyItemType.GreenNotify, "您未开通私人空间，请开通后再移动任务？", 3e3)
                    }
                }
                e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !0), null !== g && void 0 !== g && null !== g.isNotSavePath && void 0 !== g.isNotSavePath && !0 === g.isNotSavePath || s || z(t), O.information(g), O.verbose(e);
                let k = [];
                if (void 0 !== typeof p && null !== p && p.length > 0) {
                    let e = [], i = t;
                    null !== f && void 0 !== f && "" !== f && (i = o.join(t, f));
                    let r = p.map(e => {
                        let t = "";
                        return e.taskType === u.DownloadKernel.TaskType.P2sp ? t = e.data.url : e.taskType === u.DownloadKernel.TaskType.Emule && (t = e.data.fileHash), {
                            taskType: e.taskType,
                            value: t
                        }
                    }), l = yield c.TaskUtilitiesAWNS.batchFindTaskAW(r);
                    for (let t = 0; t < p.length; t++) {
                        let n = p[t], a = i;
                        void 0 !== n.data.subDir && null !== n.data.subDir && "" !== n.data.subDir && (a = o.join(i, n.data.subDir));
                        let r = h.TaskCtrlOperatorNS.constructProductInfo(n.data.browser),
                            d = {taskName: n.data.fileName, savePath: a, productInfo: r, origin: n.data.statClick};
                        n.data.fileSize && n.data.fileSize > 0 && (d.fileSize = n.data.fileSize), n.data.gcid && "" !== n.data.gcid && (d.gcid = n.data.gcid);
                        let c = {taskBaseInfo: d, privateSpace: s};
                        if (void 0 !== n.setting && null !== n.setting) {
                            let e = n.setting;
                            void 0 !== e.note && null !== e.note && "" !== e.note && (d.description = e.note), e.openAfterDownload && (d.openOnComplete = 1)
                        }
                        if (n.taskType === u.DownloadKernel.TaskType.P2sp) {
                            if (c.taskType = u.DownloadKernel.TaskType.P2sp, c.p2spTaskInfo = {
                                url: n.data.url,
                                refUrl: n.data.referer,
                                cookie: n.data.cookie,
                                downloadSubTask: 1
                            }, void 0 !== n.setting && null !== n.setting) {
                                let e = n.setting;
                                e.onlyOrigin && (c.p2spTaskInfo.useOriginResourceOnly = 1), void 0 !== e.thread && "number" == typeof e.thread && (c.p2spTaskInfo.originResourceThreadCount = e.thread)
                            }
                            let t = !1;
                            if (l && l.length > 0) for (let e of l) if (e.getType() === u.DownloadKernel.TaskType.P2sp && e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl).toLowerCase() === n.data.url.toLowerCase()) {
                                t = !0;
                                break
                            }
                            if (t) {
                                e.push({taskType: u.DownloadKernel.TaskType.P2sp, newTaskInfo: c});
                                continue
                            }
                            k.push(c)
                        } else if (n.taskType === u.DownloadKernel.TaskType.Emule) {
                            c.taskType = u.DownloadKernel.TaskType.Emule, c.emuleTaskInfo = {
                                url: n.data.url,
                                downloadSubTask: 1
                            };
                            let t = !1;
                            if (l && l.length > 0) for (let e of l) if (e.getType() === u.DownloadKernel.TaskType.Emule && e.getExtraObject().getFileHash().toLowerCase() === n.data.fileHash.toLowerCase()) {
                                t = !0;
                                break
                            }
                            if (t) {
                                e.push({taskType: u.DownloadKernel.TaskType.Emule, newTaskInfo: c});
                                continue
                            }
                            k.push(c)
                        }
                    }
                    if (null !== f && void 0 !== f && "" !== f && k.length > 0) {
                        let e = {taskName: f, savePath: i, origin: k[0].taskBaseInfo.origin}, t = {subTaskList: k},
                            n = yield U.createTask(u.DownloadKernel.TaskType.Group, {
                                taskBaseInfo: e,
                                groupTaskInfo: t,
                                privateSpace: s
                            });
                        if (null !== n) {
                            if (1 === a) {
                                let e = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                A.DownloadDispatchNS.startTask(e)
                            }
                            if (null !== g && void 0 !== g && null !== g.installFile && void 0 !== g.installFile && "" !== g.installFile) {
                                O.information("setUserData:", g);
                                let e = n.getExtraObject();
                                e.setUserData(b.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile", g.installFile), null !== g.isSelectInstallCheck && void 0 !== g.isSelectInstallCheck && g.isSelectInstallCheck && e.setUserData(b.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall", "1"), null !== g.runParams && void 0 !== g.runParams && "" !== g.runParams && e.setUserData(b.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams", g.runParams)
                            }
                        }
                    } else if (k.length > 0) {
                        let e = yield U.createBatchTask(k);
                        if (1 === a) {
                            let t = [];
                            for (let n of e) t.push(n.getId());
                            O.information("download-dispatch createBatchTask", t), A.DownloadDispatchNS.startTasks(t)
                        }
                    }
                    l.length > 0 && n(l, e)
                }
                if (void 0 !== d && null !== d && d.length > 0) for (let e of d) G({
                    url: e,
                    type: "url"
                }, {source: "newwindow_url"})
            })), V.ipcMain.on(l.ThunderChannelList.channelRMNewTaskDownloadTorrent, (e, t, n) => i(this, void 0, void 0, function* () {
                let a = (t, n) => i(this, void 0, void 0, function* () {
                        do {
                            if (!e.sender) break;
                            if (e.sender.isDestroyed()) {
                                O.information("download torrent back isDestroyed");
                                break
                            }
                            if (n) {
                                let n = U.getTaskFromTaskId(t);
                                if (null === n) {
                                    e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1), O.information("channelRMNewTaskDownloadTorrent error");
                                    break
                                }
                                let i = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                                    a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), r = o.join(i, a),
                                    s = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(r);
                                if (null === s) {
                                    e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1);
                                    break
                                }
                                let d = JSON.stringify(s);
                                e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !0, d, r)
                            } else e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1)
                        } while (0)
                    }), r = {taskType: u.DownloadKernel.TaskType.Magnet, value: t},
                    s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([r]);
                if (s && s.length > 0) {
                    O.information("channelRMNewTaskDownloadTorrent repeat magnet task.url:", t);
                    let n = s[0].getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                    e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, n), N.MagnetListenerNS.addRef(n, a)
                } else {
                    let i = yield f.ThunderUtil.getThunderTempPath(!0),
                        r = p.ParseUrlFileNameNS.parseMagnetUrl(t) + ".torrent", s = o.join(i, r), c = {
                            taskBaseInfo: {
                                taskName: r,
                                savePath: i,
                                productInfo: h.TaskCtrlOperatorNS.constructProductInfo(n.browser),
                                origin: n.source
                            }, magnetTaskInfo: {url: t, torrentFilePath: s}, isBackground: !0
                        };
                    const g = d.DownloadKernelTaskManager.getTaskManager();
                    O.information("create task magnet productinfo", n);
                    let k = yield g.createTask(u.DownloadKernel.TaskType.Magnet, c);
                    if (null !== k) {
                        let t = k.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, t), N.MagnetListenerNS.addRef(t, a), A.DownloadDispatchNS.startTask(t, !0)
                    }
                }
            })), V.ipcMain.on(l.ThunderChannelList.channelRMNewTaskCancleMagnet, (e, t) => {
                N.MagnetListenerNS.release(t)
            }), V.ipcMain.on(l.ThunderChannelList.channelRMNewTaskCreateBtTask, (e, t, a, r, s, d, f, p, m) => i(this, void 0, void 0, function* () {
                O.verbose(e);
                do {
                    if (void 0 === r || null === r) {
                        e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1, "开启私人空间后才能创建任务至私人空间");
                        break
                    }
                    let i = null;
                    try {
                        i = JSON.parse(r)
                    } catch (e) {
                        O.warning(e)
                    }
                    if (null === i) break;
                    if (p) {
                        let n = yield h.TaskCtrlOperatorNS.getUsrInfoAw("userid");
                        if (I.PrivateSpaceHelperNS.isPrivateSpaceOpen(n)) {
                            let t = yield I.PrivateSpaceHelperNS.openPrivateCategory(n);
                            if (t < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== t) break;
                            let i = yield I.PrivateSpaceHelperNS.accessPrivateCategory(n);
                            if (i < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== i) break
                        } else {
                            p = !1;
                            let e = v.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                            null !== e && void 0 !== e && "" !== e || (e = v.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), t = e, F.showNotify(P.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, M.ToastNotifyItemType.GreenNotify, "您未开通私人空间，请开通后再移动任务？", 3e3)
                        }
                    }
                    if (e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !0), p || z(t), void 0 !== typeof t && null !== t || (t = yield g.NativeCallAWNS.getDownloadDir()), void 0 === typeof i || null === i) break;
                    if (i = Object.assign({}, i), void 0 === typeof s || null === s) break;
                    let T = yield h.TaskCtrlOperatorNS.getBtExistFilePathList(t, i, f),
                        C = {taskType: u.DownloadKernel.TaskType.Bt, value: i.infoId},
                        S = yield c.TaskUtilitiesAWNS.batchFindTaskAW([C]), y = i.trackerUrls.join("\n"),
                        w = h.TaskCtrlOperatorNS.constructProductInfo(m.browser),
                        b = {savePath: t, taskName: i.title, productInfo: w, origin: m.source}, N = {
                            seedFile: s,
                            displayName: d,
                            fileLists: i.fileLists,
                            infoId: i.infoId,
                            fileRealIndexLists: f,
                            tracker: y
                        }, D = {
                            taskType: u.DownloadKernel.TaskType.Bt,
                            newTaskInfo: {taskBaseInfo: b, btTaskInfo: N, privateSpace: p}
                        };
                    if (0 !== T.length) {
                        if (S && S.length > 0) {
                            k.MessageBox.custom("bt-repeat-task").then(e => {
                                if (e.action === K.MessageBoxNS.Action.OK) {
                                    let n = e.args.picked,
                                        o = S[0].getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                    "continue" === n ? A.DownloadDispatchNS.startTask(o) : W(t, a, i, s, d, f, m, n, T, o, p).catch()
                                }
                            }).catch();
                            break
                        }
                        {
                            let e = o.join(t, i.title), n = T.map(e => e.relativePath), r = JSON.stringify(n);
                            k.MessageBox.custom("bt-repeat-file", {saveDir: e, file: r}).then(e => {
                                if (e.action === K.MessageBoxNS.Action.OK) {
                                    let n = e.args.picked;
                                    W(t, a, i, s, d, f, m, n, T, void 0, p).catch()
                                }
                            }).catch();
                            break
                        }
                    }
                    if (S && S.length > 0) {
                        n(S, [D]);
                        break
                    }
                    let _ = yield U.createTask(D.taskType, D.newTaskInfo);
                    if (null !== _) {
                        if (1 === a) {
                            let e = _.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                            A.DownloadDispatchNS.startTask(e)
                        }
                    } else O.warning("create bt task null")
                } while (0)
            })), V.ipcMain.on(l.ThunderChannelList.channelRMImportTorrent, (e, t) => i(this, void 0, void 0, function* () {
                O.verbose(e);
                let n = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                G(null === n ? {type: "file", seedFile: t} : {
                    data: JSON.stringify(n),
                    type: "file",
                    seedFile: t
                }, {source: "newwindow_bt"})
            }))
        }
    }(t.ThunderNewTask || (t.ThunderNewTask = {}))
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(60), o = n(108), r = n(36);

    function s(e) {
        var t = new o(e), n = a(o.prototype.request, t);
        return i.extend(n, o.prototype, t), i.extend(n, t), n
    }

    var l = s(r);
    l.Axios = o, l.create = function (e) {
        return s(i.merge(r, e))
    }, l.Cancel = n(67), l.CancelToken = n(124), l.isCancel = n(66), l.all = function (e) {
        return Promise.all(e)
    }, l.spread = n(125), e.exports = l, e.exports.default = l
}, function (e, t) {
    function n(e) {
        return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
    }

    /*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
    e.exports = function (e) {
        return null != e && (n(e) || function (e) {
            return "function" == typeof e.readFloatLE && "function" == typeof e.slice && n(e.slice(0, 0))
        }(e) || !!e._isBuffer)
    }
}, function (e, t, n) {
    "use strict";
    var i = n(36), a = n(11), o = n(119), r = n(120);

    function s(e) {
        this.defaults = e, this.interceptors = {request: new o, response: new o}
    }

    s.prototype.request = function (e) {
        "string" == typeof e && (e = a.merge({url: arguments[0]}, arguments[1])), (e = a.merge(i, {method: "get"}, this.defaults, e)).method = e.method.toLowerCase();
        var t = [r, void 0], n = Promise.resolve(e);
        for (this.interceptors.request.forEach(function (e) {
            t.unshift(e.fulfilled, e.rejected)
        }), this.interceptors.response.forEach(function (e) {
            t.push(e.fulfilled, e.rejected)
        }); t.length;) n = n.then(t.shift(), t.shift());
        return n
    }, a.forEach(["delete", "get", "head", "options"], function (e) {
        s.prototype[e] = function (t, n) {
            return this.request(a.merge(n || {}, {method: e, url: t}))
        }
    }), a.forEach(["post", "put", "patch"], function (e) {
        s.prototype[e] = function (t, n, i) {
            return this.request(a.merge(i || {}, {method: e, url: t, data: n}))
        }
    }), e.exports = s
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = function (e, t) {
        i.forEach(e, function (n, i) {
            i !== t && i.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[i])
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(61), o = n(63), r = n(111), s = n(112), l = n(37),
        u = "undefined" != typeof window && window.btoa && window.btoa.bind(window) || n(113);
    e.exports = function (e) {
        return new Promise(function (t, d) {
            var c = e.data, h = e.headers;
            i.isFormData(c) && delete h["Content-Type"];
            var f = new XMLHttpRequest, g = "onreadystatechange", p = !1;
            if ("undefined" == typeof window || !window.XDomainRequest || "withCredentials" in f || s(e.url) || (f = new window.XDomainRequest, g = "onload", p = !0, f.onprogress = function () {
            }, f.ontimeout = function () {
            }), e.auth) {
                var k = e.auth.username || "", m = e.auth.password || "";
                h.Authorization = "Basic " + u(k + ":" + m)
            }
            if (f.open(e.method.toUpperCase(), o(e.url, e.params, e.paramsSerializer), !0), f.timeout = e.timeout, f[g] = function () {
                if (f && (4 === f.readyState || p) && (0 !== f.status || f.responseURL && 0 === f.responseURL.indexOf("file:"))) {
                    var n = "getAllResponseHeaders" in f ? r(f.getAllResponseHeaders()) : null, i = {
                        data: e.responseType && "text" !== e.responseType ? f.response : f.responseText,
                        status: 1223 === f.status ? 204 : f.status,
                        statusText: 1223 === f.status ? "No Content" : f.statusText,
                        headers: n,
                        config: e,
                        request: f
                    };
                    a(t, d, i), f = null
                }
            }, f.onerror = function () {
                d(l("Network Error", e, null, f)), f = null
            }, f.ontimeout = function () {
                d(l("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", f)), f = null
            }, i.isStandardBrowserEnv()) {
                var T = n(114),
                    v = (e.withCredentials || s(e.url)) && e.xsrfCookieName ? T.read(e.xsrfCookieName) : void 0;
                v && (h[e.xsrfHeaderName] = v)
            }
            if ("setRequestHeader" in f && i.forEach(h, function (e, t) {
                void 0 === c && "content-type" === t.toLowerCase() ? delete h[t] : f.setRequestHeader(t, e)
            }), e.withCredentials && (f.withCredentials = !0), e.responseType) try {
                f.responseType = e.responseType
            } catch (t) {
                if ("json" !== e.responseType) throw t
            }
            "function" == typeof e.onDownloadProgress && f.addEventListener("progress", e.onDownloadProgress), "function" == typeof e.onUploadProgress && f.upload && f.upload.addEventListener("progress", e.onUploadProgress), e.cancelToken && e.cancelToken.promise.then(function (e) {
                f && (f.abort(), d(e), f = null)
            }), void 0 === c && (c = null), f.send(c)
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11),
        a = ["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"];
    e.exports = function (e) {
        var t, n, o, r = {};
        return e ? (i.forEach(e.split("\n"), function (e) {
            if (o = e.indexOf(":"), t = i.trim(e.substr(0, o)).toLowerCase(), n = i.trim(e.substr(o + 1)), t) {
                if (r[t] && a.indexOf(t) >= 0) return;
                r[t] = "set-cookie" === t ? (r[t] ? r[t] : []).concat([n]) : r[t] ? r[t] + ", " + n : n
            }
        }), r) : r
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = i.isStandardBrowserEnv() ? function () {
        var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");

        function a(e) {
            var i = e;
            return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
                href: n.href,
                protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
                host: n.host,
                search: n.search ? n.search.replace(/^\?/, "") : "",
                hash: n.hash ? n.hash.replace(/^#/, "") : "",
                hostname: n.hostname,
                port: n.port,
                pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" + n.pathname
            }
        }

        return e = a(window.location.href), function (t) {
            var n = i.isString(t) ? a(t) : t;
            return n.protocol === e.protocol && n.host === e.host
        }
    }() : function () {
        return !0
    }
}, function (e, t, n) {
    "use strict";
    var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

    function a() {
        this.message = "String contains an invalid character"
    }

    a.prototype = new Error, a.prototype.code = 5, a.prototype.name = "InvalidCharacterError", e.exports = function (e) {
        for (var t, n, o = String(e), r = "", s = 0, l = i; o.charAt(0 | s) || (l = "=", s % 1); r += l.charAt(63 & t >> 8 - s % 1 * 8)) {
            if ((n = o.charCodeAt(s += .75)) > 255) throw new a;
            t = t << 8 | n
        }
        return r
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = i.isStandardBrowserEnv() ? {
        write: function (e, t, n, a, o, r) {
            var s = [];
            s.push(e + "=" + encodeURIComponent(t)), i.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), i.isString(a) && s.push("path=" + a), i.isString(o) && s.push("domain=" + o), !0 === r && s.push("secure"), document.cookie = s.join("; ")
        }, read: function (e) {
            var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
            return t ? decodeURIComponent(t[3]) : null
        }, remove: function (e) {
            this.write(e, "", Date.now() - 864e5)
        }
    } : {
        write: function () {
        }, read: function () {
            return null
        }, remove: function () {
        }
    }
}, function (e, t, n) {
    function i() {
        var e;
        try {
            e = t.storage.debug
        } catch (e) {
        }
        return !e && "undefined" != typeof process && "env" in process && (e = process.env.DEBUG), e
    }

    (t = e.exports = n(116)).log = function () {
        return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments)
    }, t.formatArgs = function (e) {
        var n = this.useColors;
        if (e[0] = (n ? "%c" : "") + this.namespace + (n ? " %c" : " ") + e[0] + (n ? "%c " : " ") + "+" + t.humanize(this.diff), !n) return;
        var i = "color: " + this.color;
        e.splice(1, 0, i, "color: inherit");
        var a = 0, o = 0;
        e[0].replace(/%[a-zA-Z%]/g, function (e) {
            "%%" !== e && "%c" === e && (o = ++a)
        }), e.splice(o, 0, i)
    }, t.save = function (e) {
        try {
            null == e ? t.storage.removeItem("debug") : t.storage.debug = e
        } catch (e) {
        }
    }, t.load = i, t.useColors = function () {
        if ("undefined" != typeof window && window.process && "renderer" === window.process.type) return !0;
        if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
        return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)
    }, t.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function () {
        try {
            return window.localStorage
        } catch (e) {
        }
    }(), t.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t.formatters.j = function (e) {
        try {
            return JSON.stringify(e)
        } catch (e) {
            return "[UnexpectedJSONParseError]: " + e.message
        }
    }, t.enable(i())
}, function (e, t, n) {
    function i(e) {
        var n;

        function i() {
            if (i.enabled) {
                var e = i, a = +new Date, o = a - (n || a);
                e.diff = o, e.prev = n, e.curr = a, n = a;
                for (var r = new Array(arguments.length), s = 0; s < r.length; s++) r[s] = arguments[s];
                r[0] = t.coerce(r[0]), "string" != typeof r[0] && r.unshift("%O");
                var l = 0;
                r[0] = r[0].replace(/%([a-zA-Z%])/g, function (n, i) {
                    if ("%%" === n) return n;
                    l++;
                    var a = t.formatters[i];
                    if ("function" == typeof a) {
                        var o = r[l];
                        n = a.call(e, o), r.splice(l, 1), l--
                    }
                    return n
                }), t.formatArgs.call(e, r), (i.log || t.log || console.log.bind(console)).apply(e, r)
            }
        }

        return i.namespace = e, i.enabled = t.enabled(e), i.useColors = t.useColors(), i.color = function (e) {
            var n, i = 0;
            for (n in e) i = (i << 5) - i + e.charCodeAt(n), i |= 0;
            return t.colors[Math.abs(i) % t.colors.length]
        }(e), i.destroy = a, "function" == typeof t.init && t.init(i), t.instances.push(i), i
    }

    function a() {
        var e = t.instances.indexOf(this);
        return -1 !== e && (t.instances.splice(e, 1), !0)
    }

    (t = e.exports = i.debug = i.default = i).coerce = function (e) {
        return e instanceof Error ? e.stack || e.message : e
    }, t.disable = function () {
        t.enable("")
    }, t.enable = function (e) {
        var n;
        t.save(e), t.names = [], t.skips = [];
        var i = ("string" == typeof e ? e : "").split(/[\s,]+/), a = i.length;
        for (n = 0; n < a; n++) i[n] && ("-" === (e = i[n].replace(/\*/g, ".*?"))[0] ? t.skips.push(new RegExp("^" + e.substr(1) + "$")) : t.names.push(new RegExp("^" + e + "$")));
        for (n = 0; n < t.instances.length; n++) {
            var o = t.instances[n];
            o.enabled = t.enabled(o.namespace)
        }
    }, t.enabled = function (e) {
        if ("*" === e[e.length - 1]) return !0;
        var n, i;
        for (n = 0, i = t.skips.length; n < i; n++) if (t.skips[n].test(e)) return !1;
        for (n = 0, i = t.names.length; n < i; n++) if (t.names[n].test(e)) return !0;
        return !1
    }, t.humanize = n(117), t.instances = [], t.names = [], t.skips = [], t.formatters = {}
}, function (e, t) {
    var n = 1e3, i = 60 * n, a = 60 * i, o = 24 * a, r = 365.25 * o;

    function s(e, t, n) {
        if (!(e < t)) return e < 1.5 * t ? Math.floor(e / t) + " " + n : Math.ceil(e / t) + " " + n + "s"
    }

    e.exports = function (e, t) {
        t = t || {};
        var l, u = typeof e;
        if ("string" === u && e.length > 0) return function (e) {
            if ((e = String(e)).length > 100) return;
            var t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);
            if (!t) return;
            var s = parseFloat(t[1]);
            switch ((t[2] || "ms").toLowerCase()) {
                case"years":
                case"year":
                case"yrs":
                case"yr":
                case"y":
                    return s * r;
                case"days":
                case"day":
                case"d":
                    return s * o;
                case"hours":
                case"hour":
                case"hrs":
                case"hr":
                case"h":
                    return s * a;
                case"minutes":
                case"minute":
                case"mins":
                case"min":
                case"m":
                    return s * i;
                case"seconds":
                case"second":
                case"secs":
                case"sec":
                case"s":
                    return s * n;
                case"milliseconds":
                case"millisecond":
                case"msecs":
                case"msec":
                case"ms":
                    return s;
                default:
                    return
            }
        }(e);
        if ("number" === u && !1 === isNaN(e)) return t.long ? s(l = e, o, "day") || s(l, a, "hour") || s(l, i, "minute") || s(l, n, "second") || l + " ms" : function (e) {
            if (e >= o) return Math.round(e / o) + "d";
            if (e >= a) return Math.round(e / a) + "h";
            if (e >= i) return Math.round(e / i) + "m";
            if (e >= n) return Math.round(e / n) + "s";
            return e + "ms"
        }(e);
        throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e))
    }
}, function (e) {
    e.exports = {
        _args: [["axios@0.18.0", "D:\\thunderx_bin\\trunk\\build\\app"]],
        _from: "axios@0.18.0",
        _id: "axios@0.18.0",
        _inBundle: !1,
        _integrity: "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
        _location: "/axios",
        _phantomChildren: {},
        _requested: {
            type: "version",
            registry: !0,
            raw: "axios@0.18.0",
            name: "axios",
            escapedName: "axios",
            rawSpec: "0.18.0",
            saveSpec: null,
            fetchSpec: "0.18.0"
        },
        _requiredBy: ["/", "/@types/axios", "/@xunlei/thunderx-login-main"],
        _resolved: "http://xnpm.repo.xunlei.cn/axios/-/axios-0.18.0.tgz",
        _spec: "0.18.0",
        _where: "D:\\thunderx_bin\\trunk\\build\\app",
        author: {name: "Matt Zabriskie"},
        browser: {"./lib/adapters/http.js": "./lib/adapters/xhr.js"},
        bugs: {url: "https://github.com/axios/axios/issues"},
        bundlesize: [{path: "./dist/axios.min.js", threshold: "5kB"}],
        dependencies: {"follow-redirects": "^1.3.0", "is-buffer": "^1.1.5"},
        description: "Promise based HTTP client for the browser and node.js",
        devDependencies: {
            bundlesize: "^0.5.7",
            coveralls: "^2.11.9",
            "es6-promise": "^4.0.5",
            grunt: "^1.0.1",
            "grunt-banner": "^0.6.0",
            "grunt-cli": "^1.2.0",
            "grunt-contrib-clean": "^1.0.0",
            "grunt-contrib-nodeunit": "^1.0.0",
            "grunt-contrib-watch": "^1.0.0",
            "grunt-eslint": "^19.0.0",
            "grunt-karma": "^2.0.0",
            "grunt-ts": "^6.0.0-beta.3",
            "grunt-webpack": "^1.0.18",
            "istanbul-instrumenter-loader": "^1.0.0",
            "jasmine-core": "^2.4.1",
            karma: "^1.3.0",
            "karma-chrome-launcher": "^2.0.0",
            "karma-coverage": "^1.0.0",
            "karma-firefox-launcher": "^1.0.0",
            "karma-jasmine": "^1.0.2",
            "karma-jasmine-ajax": "^0.1.13",
            "karma-opera-launcher": "^1.0.0",
            "karma-safari-launcher": "^1.0.0",
            "karma-sauce-launcher": "^1.1.0",
            "karma-sinon": "^1.0.5",
            "karma-sourcemap-loader": "^0.3.7",
            "karma-webpack": "^1.7.0",
            "load-grunt-tasks": "^3.5.2",
            minimist: "^1.2.0",
            sinon: "^1.17.4",
            typescript: "^2.0.3",
            "url-search-params": "^0.6.1",
            webpack: "^1.13.1",
            "webpack-dev-server": "^1.14.1"
        },
        homepage: "https://github.com/axios/axios",
        keywords: ["xhr", "http", "ajax", "promise", "node"],
        license: "MIT",
        main: "index.js",
        name: "axios",
        repository: {type: "git", url: "git+https://github.com/axios/axios.git"},
        scripts: {
            build: "NODE_ENV=production grunt build",
            coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
            examples: "node ./examples/server.js",
            postversion: "git push && git push --tags",
            preversion: "npm test",
            start: "node ./sandbox/server.js",
            test: "grunt test && bundlesize",
            version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"
        },
        typings: "./index.d.ts",
        version: "0.18.0"
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);

    function a() {
        this.handlers = []
    }

    a.prototype.use = function (e, t) {
        return this.handlers.push({fulfilled: e, rejected: t}), this.handlers.length - 1
    }, a.prototype.eject = function (e) {
        this.handlers[e] && (this.handlers[e] = null)
    }, a.prototype.forEach = function (e) {
        i.forEach(this.handlers, function (t) {
            null !== t && e(t)
        })
    }, e.exports = a
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(121), o = n(66), r = n(36), s = n(122), l = n(123);

    function u(e) {
        e.cancelToken && e.cancelToken.throwIfRequested()
    }

    e.exports = function (e) {
        return u(e), e.baseURL && !s(e.url) && (e.url = l(e.baseURL, e.url)), e.headers = e.headers || {}, e.data = a(e.data, e.headers, e.transformRequest), e.headers = i.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {}), i.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
            delete e.headers[t]
        }), (e.adapter || r.adapter)(e).then(function (t) {
            return u(e), t.data = a(t.data, t.headers, e.transformResponse), t
        }, function (t) {
            return o(t) || (u(e), t && t.response && (t.response.data = a(t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = function (e, t, n) {
        return i.forEach(n, function (n) {
            e = n(e, t)
        }), e
    }
}, function (e, t, n) {
    "use strict";
    e.exports = function (e) {
        return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
    }
}, function (e, t, n) {
    "use strict";
    e.exports = function (e, t) {
        return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
    }
}, function (e, t, n) {
    "use strict";
    var i = n(67);

    function a(e) {
        if ("function" != typeof e) throw new TypeError("executor must be a function.");
        var t;
        this.promise = new Promise(function (e) {
            t = e
        });
        var n = this;
        e(function (e) {
            n.reason || (n.reason = new i(e), t(n.reason))
        })
    }

    a.prototype.throwIfRequested = function () {
        if (this.reason) throw this.reason
    }, a.source = function () {
        var e;
        return {
            token: new a(function (t) {
                e = t
            }), cancel: e
        }
    }, e.exports = a
}, function (e, t, n) {
    "use strict";
    e.exports = function (e) {
        return function (t) {
            return e.apply(null, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(716);
    !function (e) {
        const t = new class {
            constructor() {
                this.categoryViews = [];
                let e = new a.CategoryView(-1, i.DownloadKernel.CategroyViewID.Downloading),
                    t = new a.CategoryView(-1, i.DownloadKernel.CategroyViewID.Completed),
                    n = new a.CategoryView(-1, i.DownloadKernel.CategroyViewID.Recycle);
                this.categoryViews.push(e), this.categoryViews.push(t), this.categoryViews.push(n)
            }

            getCategoryViews() {
                return this.categoryViews
            }

            getCategoryViewCount() {
                return this.categoryViews.length
            }

            getCategoryViewFromId(e) {
                let t = null;
                for (let n = 0; n < this.categoryViews.length; ++n) {
                    let i = this.categoryViews[n];
                    if (i && e === i.getCategoryViewId()) {
                        t = i;
                        break
                    }
                }
                return t
            }
        };
        e.getCategoryViewManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryViewManager || (t.DownloadKernelCategoryViewManager = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(47), a = n(1).default.getLogger("Thunder.shub-http.http-session");
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = 80, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mTimeout = void 0, this.mCurRetries = 0
        }

        set host(e) {
            this.mHost = e
        }

        get host() {
            return this.mHost
        }

        set port(e) {
            this.mPort = e
        }

        get port() {
            return this.mPort
        }

        set path(e) {
            this.mPath = e
        }

        get path() {
            return this.mPath
        }

        set url(e) {
            this.mUrl = e
        }

        get url() {
            return this.mUrl
        }

        set auth(e) {
            this.mAuth = e
        }

        get auth() {
            return this.mAuth
        }

        set accept(e) {
            this.mAccept = e
        }

        get accept() {
            return this.mAccept
        }

        set body(e) {
            this.mBody = e
        }

        get body() {
            return this.mBody
        }

        set retries(e) {
            this.mRetries = e
        }

        get retries() {
            return this.mRetries
        }

        set timeout(e) {
            this.mTimeout = e
        }

        get timeout() {
            return this.mTimeout
        }

        post(e, t) {
            let n = this.body;
            if (!n) return a.information("body is empty"), void t(null);
            let i = this.auth, o = this.accept, r = {
                hostname: this.host,
                port: this.port,
                path: this.path || "/",
                method: "POST",
                auth: i || void 0,
                headers: {"Content-Length": n ? n.length : 0, Accept: o || "*/*"}
            };
            a.information("option", r), this.postImpl(n, r, e, n => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, a.information("mCurRetries", this.mCurRetries), this.post(e, t)) : t(n)
            })
        }

        get(e, t) {
            let n = this.url;
            n || (n = {
                hostname: this.host,
                port: this.port,
                path: this.path || "/",
                method: "GET"
            }), a.information("option", n), this.getImpl(n, e, n => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, a.information("mCurRetries", this.mCurRetries), this.get(e, t)) : t(n)
            })
        }

        postImpl(e, t, n, o) {
            let r = i.request(t, e => {
                let t = null;
                e.on("data", e => {
                    t = t ? Buffer.concat([t, e]) : e
                }), e.on("end", () => {
                    a.information("statusCode", e.statusCode), a.information("headers", e.headers), n({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: t
                    })
                })
            });
            r.on("error", e => {
                o(e)
            }), r.on("timeout", () => {
                r.abort()
            }), this.timeout && r.setTimeout(this.timeout), r.write(e), r.end()
        }

        getImpl(e, t, n) {
            i.get(e, e => {
                let n = null;
                e.on("data", e => {
                    n = n ? Buffer.concat([n, e]) : e
                }), e.on("end", () => {
                    a.information("statusCode", e.statusCode), a.information("headers", e.headers), t({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: n
                    })
                })
            }).on("error", e => {
                n(e)
            })
        }
    }
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, g = {}.hasOwnProperty;
        f = n(196), h = f.isObject, c = f.isFunction, d = f.isEmpty, r = null, t = null, i = null, a = null, o = null, l = null, u = null, s = null, e.exports = function () {
            function e(e) {
                this.parent = e, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), this.children = [], r || (r = n(268), t = n(269), i = n(270), a = n(271), o = n(272), l = n(277), u = n(278), s = n(279))
            }

            return e.prototype.element = function (e, t, n) {
                var i, a, o, r, s, l, u, f, p, k;
                if (l = null, null == t && (t = {}), t = t.valueOf(), h(t) || (n = (p = [t, n])[0], t = p[1]), null != e && (e = e.valueOf()), Array.isArray(e)) for (o = 0, u = e.length; o < u; o++) a = e[o], l = this.element(a); else if (c(e)) l = this.element(e.apply()); else if (h(e)) {
                    for (s in e) if (g.call(e, s)) if (k = e[s], c(k) && (k = k.apply()), h(k) && d(k) && (k = null), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === s.indexOf(this.stringify.convertAttKey)) l = this.attribute(s.substr(this.stringify.convertAttKey.length), k); else if (!this.options.separateArrayItems && Array.isArray(k)) for (r = 0, f = k.length; r < f; r++) a = k[r], (i = {})[s] = a, l = this.element(i); else h(k) ? (l = this.element(s)).element(k) : l = this.element(s, k)
                } else l = !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === e.indexOf(this.stringify.convertTextKey) ? this.text(n) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === e.indexOf(this.stringify.convertCDataKey) ? this.cdata(n) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === e.indexOf(this.stringify.convertCommentKey) ? this.comment(n) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === e.indexOf(this.stringify.convertRawKey) ? this.raw(n) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === e.indexOf(this.stringify.convertPIKey) ? this.instruction(e.substr(this.stringify.convertPIKey.length), n) : this.node(e, t, n);
                if (null == l) throw new Error("Could not create any elements with: " + e);
                return l
            }, e.prototype.insertBefore = function (e, t, n) {
                var i, a, o;
                if (this.isRoot) throw new Error("Cannot insert elements at root level");
                return a = this.parent.children.indexOf(this), o = this.parent.children.splice(a), i = this.parent.element(e, t, n), Array.prototype.push.apply(this.parent.children, o), i
            }, e.prototype.insertAfter = function (e, t, n) {
                var i, a, o;
                if (this.isRoot) throw new Error("Cannot insert elements at root level");
                return a = this.parent.children.indexOf(this), o = this.parent.children.splice(a + 1), i = this.parent.element(e, t, n), Array.prototype.push.apply(this.parent.children, o), i
            }, e.prototype.remove = function () {
                var e;
                if (this.isRoot) throw new Error("Cannot remove the root element");
                return e = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [e, e - e + 1].concat([])), this.parent
            }, e.prototype.node = function (e, t, n) {
                var i, a;
                return null != e && (e = e.valueOf()), t || (t = {}), t = t.valueOf(), h(t) || (n = (a = [t, n])[0], t = a[1]), i = new r(this, e, t), null != n && i.text(n), this.children.push(i), i
            }, e.prototype.text = function (e) {
                var t;
                return t = new u(this, e), this.children.push(t), this
            }, e.prototype.cdata = function (e) {
                var n;
                return n = new t(this, e), this.children.push(n), this
            }, e.prototype.comment = function (e) {
                var t;
                return t = new i(this, e), this.children.push(t), this
            }, e.prototype.commentBefore = function (e) {
                var t, n;
                return t = this.parent.children.indexOf(this), n = this.parent.children.splice(t), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.commentAfter = function (e) {
                var t, n;
                return t = this.parent.children.indexOf(this), n = this.parent.children.splice(t + 1), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.raw = function (e) {
                var t;
                return t = new l(this, e), this.children.push(t), this
            }, e.prototype.instruction = function (e, t) {
                var n, i, a, o, r;
                if (null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (o = 0, r = e.length; o < r; o++) n = e[o], this.instruction(n); else if (h(e)) for (n in e) g.call(e, n) && (i = e[n], this.instruction(n, i)); else c(t) && (t = t.apply()), a = new s(this, e, t), this.children.push(a);
                return this
            }, e.prototype.instructionBefore = function (e, t) {
                var n, i;
                return n = this.parent.children.indexOf(this), i = this.parent.children.splice(n), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.instructionAfter = function (e, t) {
                var n, i;
                return n = this.parent.children.indexOf(this), i = this.parent.children.splice(n + 1), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.declaration = function (e, t, n) {
                var i, o;
                return i = this.document(), o = new a(i, e, t, n), i.children[0] instanceof a ? i.children[0] = o : i.children.unshift(o), i.root() || i
            }, e.prototype.doctype = function (e, t) {
                var n, i, a, r, s, l, u, d, c;
                for (n = this.document(), i = new o(n, e, t), a = r = 0, l = (d = n.children).length; r < l; a = ++r) if (d[a] instanceof o) return n.children[a] = i, i;
                for (a = s = 0, u = (c = n.children).length; s < u; a = ++s) if (c[a].isRoot) return n.children.splice(a, 0, i), i;
                return n.children.push(i), i
            }, e.prototype.up = function () {
                if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
                return this.parent
            }, e.prototype.root = function () {
                var e;
                for (e = this; e;) {
                    if (e.isDocument) return e.rootObject;
                    if (e.isRoot) return e;
                    e = e.parent
                }
            }, e.prototype.document = function () {
                var e;
                for (e = this; e;) {
                    if (e.isDocument) return e;
                    e = e.parent
                }
            }, e.prototype.end = function (e) {
                return this.document().end(e)
            }, e.prototype.prev = function () {
                var e;
                if ((e = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node");
                return this.parent.children[e - 1]
            }, e.prototype.next = function () {
                var e;
                if (-1 === (e = this.parent.children.indexOf(this)) || e === this.parent.children.length - 1) throw new Error("Already at the last node");
                return this.parent.children[e + 1]
            }, e.prototype.importDocument = function (e) {
                var t;
                return (t = e.root().clone()).parent = this, t.isRoot = !1, this.children.push(t), this
            }, e.prototype.ele = function (e, t, n) {
                return this.element(e, t, n)
            }, e.prototype.nod = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.txt = function (e) {
                return this.text(e)
            }, e.prototype.dat = function (e) {
                return this.cdata(e)
            }, e.prototype.com = function (e) {
                return this.comment(e)
            }, e.prototype.ins = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.doc = function () {
                return this.document()
            }, e.prototype.dec = function (e, t, n) {
                return this.declaration(e, t, n)
            }, e.prototype.dtd = function (e, t) {
                return this.doctype(e, t)
            }, e.prototype.e = function (e, t, n) {
                return this.element(e, t, n)
            }, e.prototype.n = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.t = function (e) {
                return this.text(e)
            }, e.prototype.d = function (e) {
                return this.cdata(e)
            }, e.prototype.c = function (e) {
                return this.comment(e)
            }, e.prototype.r = function (e) {
                return this.raw(e)
            }, e.prototype.i = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.u = function () {
                return this.up()
            }, e.prototype.importXMLBuilder = function (e) {
                return this.importDocument(e)
            }, e
        }()
    }).call(this)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n, i;
        !function (e) {
            e[e.Vip = 0] = "Vip", e[e.Try = 1] = "Try"
        }(t = e.VipTaskType || (e.VipTaskType = {})), function (e) {
            e[e.PlatinumVip = 0] = "PlatinumVip", e[e.SuperVip = 1] = "SuperVip"
        }(n = e.TryType || (e.TryType = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Init = 0] = "Init", e[e.CommitWait = 1] = "CommitWait", e[e.Commiting = 2] = "Commiting", e[e.CommitFailed = 3] = "CommitFailed", e[e.CommitSuccess = 4] = "CommitSuccess", e[e.AcclerateWait = 5] = "AcclerateWait", e[e.SearchResource = 6] = "SearchResource", e[e.AcclerateFailed = 7] = "AcclerateFailed", e[e.AcclerateStoped = 8] = "AcclerateStoped", e[e.Acclerating = 9] = "Acclerating", e[e.Finished = 10] = "Finished"
        }(i = e.VipTaskStatus || (e.VipTaskStatus = {}))
    }(t.VipDownloadDefineNS || (t.VipDownloadDefineNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(212), a = n(166);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(591);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-select.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(71), a = n(70);
    !function (e) {
        e.setStyle = function (e, t) {
            if (null !== e) {
                let n = {windowPreference: a.WindowPreferenceNS.getWindowPreference()};
                e.setStyle(i(n, t))
            }
        }
    }(t.DropDownWindowSkinNS || (t.DropDownWindowSkinNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(10), r = n(8);
    !function (e) {
        e.isSingleBtTask = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (!e) break;
                    if (e.getType() !== r.DownloadKernel.TaskType.Bt) break;
                    let n = e.getExtraObject();
                    if (!n) break;
                    if (1 !== n.getFileCount()) break;
                    let i = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), l = a.join(i, s);
                    if (yield o.FileSystemAWNS.existsAW(l)) {
                        let e = yield o.FileSystemAWNS.lstatAW(l);
                        if (e && e.isDirectory()) {
                            let e = void 0, i = n.getBtFileList();
                            for (let [, t]of i) {
                                e = t.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName);
                                break
                            }
                            if (!e) break;
                            let s = a.join(l, e);
                            if (yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            let u = e + ".bt.xltd";
                            if (s = a.join(l, u), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            if (u = e + ".bt.td", s = a.join(l, u), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            break
                        }
                    }
                    t = !0
                } while (0);
                return t
            })
        }, e.getSinleBtTaskFilePath = function (e) {
            let t = void 0;
            {
                let n = void 0, i = e.getExtraObject().getBtFileList();
                for (let [, e]of i) {
                    n = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName);
                    break
                }
                let o = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                t = a.join(o, n)
            }
            return t
        }
    }(t.SingleBtTaskNS || (t.SingleBtTaskNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(72);
    var a;
    !function (e) {
        e[e.GreenNotify = 0] = "GreenNotify", e[e.RedNotify = 1] = "RedNotify", e[e.RedCancelNotify = 2] = "RedCancelNotify"
    }(a = t.ToastNotifyItemType || (t.ToastNotifyItemType = {}));

    class o extends i.default {
        constructor(e, t, n) {
            super(), this.id = "", this.message = "", this.duration = 0, this.id = e, this.message = t, this.duration = n
        }

        setMessage(e) {
            this.message = e
        }

        getMessage() {
            return this.message
        }

        setDuration(e) {
            this.duration = e
        }

        getDuration() {
            return this.duration
        }

        getId() {
            return this.id
        }

        getType() {
            return a.GreenNotify
        }

        getCancel() {
            return !1
        }
    }

    t.ToastNotifyItem = o;
    t.RedToastNotifyItem = class extends o {
        constructor(e, t, n) {
            super(e, t, n)
        }

        getType() {
            return a.RedNotify
        }
    };

    class r extends o {
        constructor(e, t, n) {
            super(e, t, n)
        }

        getCancel() {
            return !0
        }

        onCancel(e) {
            this.attachOnceListener("OnCancel", e)
        }

        cancel() {
            this.fireEvent("OnCancel")
        }
    }

    t.CancelToastNotifyItem = r;
    t.RedCancelToastNotifyItem = class extends r {
        constructor(e, t, n) {
            super(e, t, n)
        }

        getType() {
            return a.RedCancelNotify
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(23), s = n(133), l = n(135), u = n(565), d = n(32), c = n(34), h = n(73),
        f = n(126), g = n(566), p = n(20), k = a.default.getLogger("download-dispatch"),
        m = d.DownloadKernelTaskManager.getTaskManager(), T = c.DownloadKernelEventManager.getEventManager(),
        v = l.ToastNotifyManagerNS.getToastNotifyManger(),
        C = f.DownloadKernelCategoryViewManager.getCategoryViewManager(), S = 50;
    const y = new class {
        constructor() {
            this.maxStartCount = 5, this.tasks = [], this.downloadingTasks = [], this.freeDownloadingTasks = [], this.waitingTasks = [], this.isFreeOpened = !1, this.noLimitSize = 30, this.autoAddTimerId = void 0, this.autoAddRate = void 0, this.speedArray = [], this.autoAddAvailable = !1
        }

        init() {
            this.attachTaskEvent()
        }

        setAutoAddTask(e, t) {
            e ? this.startAutoAddTask(t) : (this.autoAddRate = void 0, this.stopAutoAddTask())
        }

        setFreeFromScheduleOpen(e, t) {
            if (this.isFreeOpened = e, this.noLimitSize = t, k.information("setFreeFromScheduleOpen", this.isFreeOpened, this.noLimitSize, this.tasks.length), e) {
                for (let e of this.tasks) {
                    let n = m.getTaskFromTaskId(e), i = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                    k.information("setFreeFromSchedule", i, t), i <= 1024 * t * 1024 && i > 0 ? n.setFreeFromSchedule(!0) : n.setFreeFromSchedule(!1)
                }
                for (let e of this.waitingTasks) m.getTaskFromTaskId(e).isFreeFromSchedule() && this.startNoWaiting(e, !0)
            } else for (let e of this.tasks) m.getTaskFromTaskId(e).setFreeFromSchedule(!1)
        }

        setAutoAddTaskAvailable(e) {
            k.information("auto add available", e), this.autoAddAvailable = e, e ? this.switchAutoAddTask() : this.stopAutoAddTask()
        }

        updateTasks(e) {
            this.tasks = [...e]
        }

        startTask(e, t) {
            let n = !0;
            do {
                if (this.downloadingTasks.includes(e) || this.freeDownloadingTasks.includes(e)) {
                    k.information("startTask is downloading", e);
                    break
                }
                let i = m.getTaskFromTaskId(e);
                if (null === i) break;
                if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) {
                    k.information("startTask is background", e), m.startTask(e);
                    break
                }
                let a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                if (-1 !== a) {
                    k.information("startTask is private", e, a), m.startTask(e);
                    break
                }
                let r = i.isFreeFromSchedule();
                if (r) {
                    k.information("startTask isFreeFromSchedule"), this.startNoWaiting(e, !0), this.showSmallFileAdvancedNotify();
                    break
                }
                if (void 0 === r && this.isFreeOpened && !isNaN(this.noLimitSize) && this.noLimitSize > 0) {
                    let t = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                    if (t <= 1024 * this.noLimitSize * 1024 && t > 0) {
                        i.setFreeFromSchedule(!0), k.information("startTask isFreeFromSchedule"), this.startNoWaiting(e, !0), this.showSmallFileAdvancedNotify();
                        break
                    }
                    i.setFreeFromSchedule(!1)
                }
                if (t) {
                    k.information("startTask force no waiting", e), this.startNoWaiting(e);
                    break
                }
                if (this.downloadingTasks.length < this.maxStartCount) {
                    k.information("startTask no waiting", e), this.startNoWaiting(e);
                    break
                }
                k.information("startTask waiting", e), this.startWaiting(e), n = !1
            } while (0);
            return n
        }

        startTasks(e) {
            do {
                if (null === e || void 0 === e || 0 === e.length) break;
                let t = m.getTaskFromTaskId(e[0]).getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 !== t && -1 !== t) {
                    for (let t = 0; t < e.length; ++t) m.startTask(e[t]);
                    break
                }
                0 === this.tasks.length && (k.information("try to start multi task but tasks not inited"), this.initTasksOrderFromConfig());
                let n = [];
                for (let t of e) {
                    let e = this.tasks.indexOf(t);
                    -1 !== e && n.push(e)
                }
                if (n.length !== e.length) {
                    this.batchStartTasks(e);
                    break
                }
                n.sort((e, t) => e - t);
                let i = [];
                for (let e of n) {
                    let t = this.tasks[e];
                    i.push(t)
                }
                this.batchStartTasks(i)
            } while (0)
        }

        setMaxStartTaskCount(e) {
            return i(this, void 0, void 0, function* () {
                if (this.maxStartCount !== e && e > 0) {
                    this.maxStartCount = e;
                    let t = this.downloadingTasks.length;
                    if (this.isFreeOpened || (t = this.downloadingTasks.length + this.freeDownloadingTasks.length), t > this.maxStartCount) {
                        let e = 0;
                        for (let t = 0; t < this.tasks.length; t++) {
                            let n = this.tasks[t], i = m.getTaskFromTaskId(n), a = i.getTaskStatus(),
                                r = i.isFreeFromSchedule();
                            a !== o.DownloadKernel.TaskStatus.StartPending && a !== o.DownloadKernel.TaskStatus.Started || r || (e += 1) > this.maxStartCount && (k.information("to stop", n), m.stopTaskAW(n).then(e => {
                                e ? (k.information("stoptask and startwaiting", n), this.startWaiting(n)) : k.information("stopTaskAW fail", n)
                            }).catch())
                        }
                    } else if (this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount) {
                        k.information("setMaxStartTaskCount to add start task", this.waitingTasks.length, this.downloadingTasks.length, this.maxStartCount);
                        for (let e = 0; e < this.tasks.length; e++) {
                            let t = this.tasks[e];
                            if (m.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting && (this.startNoWaiting(t), k.information("setMaxStartTaskCount add start task", t, this.waitingTasks.length, this.downloadingTasks.length), 0 === this.waitingTasks.length || this.downloadingTasks.length === this.maxStartCount)) break
                        }
                    }
                }
            })
        }

        showSmallFileAdvancedNotify() {
            this.downloadingTasks.length >= this.maxStartCount ? v.showNotify(l.ToastNotifyManagerNS.notifyIdTaskDispatchSmallFileAdvanced, s.ToastNotifyItemType.GreenNotify, `正在优先下载小于${this.noLimitSize}MB的任务`, 3e3) : k.information("showSmallFileAdvancedNotify no waiting ")
        }

        batchStartTasks(e) {
            let t = [];
            for (let n = 0; n < e.length; n++) {
                let i = e[n];
                if (!this.startTask(i)) {
                    if (!this.isFreeOpened) {
                        n + 1 < e.length && (t = e.slice(n + 1));
                        break
                    }
                    t.push(i)
                }
            }
            t.length > 0 && this.startBatchWaiting(t)
        }

        initTasksOrderFromConfig() {
            let e = [], t = C.getCategoryViewFromId(o.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) e.push(n.getTaskBaseInfo());
            e.sort(g.SortNS.getSortFuncByConfig(o.DownloadKernel.CategroyViewID.Downloading, -1)), this.tasks = e.map(e => e.taskId)
        }

        startNoWaiting(e, t = !1) {
            if (m.startTask(e)) {
                t ? this.freeDownloadingTasks.includes(e) || this.freeDownloadingTasks.push(e) : this.downloadingTasks.includes(e) || this.downloadingTasks.push(e);
                let n = this.waitingTasks.indexOf(e);
                -1 !== n && (this.waitingTasks.splice(n, 1), this.switchAutoAddTask())
            }
        }

        startWaiting(e) {
            if (m.startWaitingTask(e)) {
                this.waitingTasks.includes(e) || (this.waitingTasks.push(e), this.switchAutoAddTask());
                let t = this.downloadingTasks.indexOf(e);
                -1 !== t && this.downloadingTasks.splice(t, 1)
            }
        }

        startBatchWaiting(e) {
            for (let t of e) {
                let e = m.getTaskFromTaskId(t).getTaskStatus();
                if (e === o.DownloadKernel.TaskStatus.Stopped || e === o.DownloadKernel.TaskStatus.Failed || e === o.DownloadKernel.TaskStatus.Unkown) {
                    this.waitingTasks.includes(t) || (this.waitingTasks.push(t), this.switchAutoAddTask());
                    let e = this.downloadingTasks.indexOf(t);
                    -1 !== e && this.downloadingTasks.splice(e, 1)
                }
            }
            m.startWaitingTasks(e)
        }

        convertWaiting2Start() {
            for (let e = 0; e < this.tasks.length; e++) {
                let t = this.tasks[e];
                if (this.waitingTasks.includes(t) && m.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting) {
                    k.information("convertWaiting2Start", t), this.startNoWaiting(t);
                    break
                }
            }
        }

        getAverageSpeed(e = 10) {
            let t = 0;
            do {
                if (isNaN(e)) break;
                if (e < 0) break;
                if (0 === this.speedArray.length) break;
                let n = p.ThunderHelper.getTickCount(), i = this.speedArray.filter(t => t.tickCount + 1e3 * e >= n);
                if (0 === i.length) break;
                let a = i.map(e => e.speed);
                t = a.reduce((e, t) => e + t, 0) / a.length
            } while (0);
            return t
        }

        onGlobalDownloadSpeedChanged() {
            do {
                if (void 0 === this.autoAddTimerId) break;
                let e = h.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1);
                this.speedArray.length >= 10 && (this.speedArray = this.speedArray.slice(0, 9));
                let t = {speed: e, tickCount: p.ThunderHelper.getTickCount()};
                this.speedArray.push(t)
            } while (0)
        }

        startAutoAddTask(e) {
            do {
                if (isNaN(e)) {
                    this.stopAutoAddTask();
                    break
                }
                if (this.autoAddRate = e, !this.autoAddAvailable) break;
                if (0 === this.waitingTasks.length) break;
                void 0 === this.autoAddTimerId && (h.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, this.onGlobalDownloadSpeedChanged.bind(this)), k.information("start auto add timer"), this.autoAddTimerId = setInterval(() => {
                    do {
                        if (this.downloadingTasks.length + this.freeDownloadingTasks.length >= S) {
                            k.information("auto add task upper limit");
                            break
                        }
                        if (0 === this.waitingTasks.length) break;
                        this.isAutoAddTask() && this.convertWaiting2Start()
                    } while (0)
                }, 3e4))
            } while (0)
        }

        stopAutoAddTask() {
            k.information("stopAutoAddTask"), void 0 !== this.autoAddTimerId && (clearInterval(this.autoAddTimerId), this.autoAddTimerId = void 0, this.speedArray = [], k.information("detachListener"), h.DownloadKernelManager.detachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, this.onGlobalDownloadSpeedChanged.bind(this)))
        }

        isAutoAddTask() {
            let e = !1, t = this.getAverageSpeed();
            return t < 1024 * this.autoAddRate && (e = !0), k.information("isAutoAddTask", t, 1024 * this.autoAddRate, e), e
        }

        switchAutoAddTask() {
            do {
                if (!this.autoAddAvailable) break;
                if (void 0 === this.autoAddRate) break;
                this.waitingTasks.length > 0 ? this.startAutoAddTask(this.autoAddRate) : (k.information("no waiting task to stopAutoAdd"), this.stopAutoAddTask())
            } while (0)
        }

        attachTaskEvent() {
            T.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        if (n.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        let i = n.getTaskStatus(), a = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        if (n.getTaskAttribute(o.DownloadKernel.TaskAttribute.GroupTaskId) > 0) continue;
                        if (-1 !== n.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) continue;
                        if (i === o.DownloadKernel.TaskStatus.StartPending || i === o.DownloadKernel.TaskStatus.Started) continue;
                        if ((i === o.DownloadKernel.TaskStatus.StopPending || i === o.DownloadKernel.TaskStatus.Stopped) && u.DownloadJammedNS.isStopPending(a)) {
                            k.information("ignore status change download jammed stop", i);
                            continue
                        }
                        let r = this.downloadingTasks.indexOf(a);
                        if (-1 !== r) this.downloadingTasks.splice(r, 1); else {
                            let e = this.freeDownloadingTasks.indexOf(a);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        if (i === o.DownloadKernel.TaskStatus.StartWaiting) continue;
                        let s = this.waitingTasks.indexOf(a);
                        -1 !== s && (this.waitingTasks.splice(s, 1), this.switchAutoAddTask()), i !== o.DownloadKernel.TaskStatus.Succeeded && i !== o.DownloadKernel.TaskStatus.Failed && i !== o.DownloadKernel.TaskStatus.StopPending && i !== o.DownloadKernel.TaskStatus.Stopped || this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount && this.convertWaiting2Start()
                    }
                } while (0)
            }), T.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== o.DownloadKernel.CategroyViewID.Downloading) break;
                    let t = e[3];
                    for (let e of t) {
                        let t = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId),
                            n = this.downloadingTasks.indexOf(t);
                        if (-1 !== n) this.downloadingTasks.splice(n, 1); else {
                            let e = this.freeDownloadingTasks.indexOf(t);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        let i = this.waitingTasks.indexOf(t);
                        -1 !== i && (this.waitingTasks.splice(i, 1), this.switchAutoAddTask())
                    }
                } while (0)
            })
        }
    };
    !function (e) {
        e.init = function () {
            y.init()
        }, e.updateTasksOrder = function (e) {
            y.updateTasks(e)
        }, e.startTask = function (e, t) {
            let n = m.getTaskFromTaskId(e).getTaskStatus();
            return n !== o.DownloadKernel.TaskStatus.Succeeded && n !== o.DownloadKernel.TaskStatus.Seeding && y.startTask(e, t)
        }, e.startTasks = function (e) {
            y.startTasks(e)
        }, e.setStartTaskCount = function (e) {
            do {
                if ("number" != typeof e && (e = Number(e)), isNaN(e)) break;
                if (e <= 0) break;
                y.setMaxStartTaskCount(e).catch()
            } while (0)
        }, e.setFreeFromScheduleOpen = function (e, t) {
            y.setFreeFromScheduleOpen(e, t)
        }, e.setAutoAddTaskAvailable = function (e) {
            y.setAutoAddTaskAvailable(e)
        }, e.setAutoAddTask = function (e, t) {
            y.setAutoAddTask(e, t)
        }
    }(t.DownloadDispatchNS || (t.DownloadDispatchNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(72), o = n(133), r = i.default.getLogger("ToastNotifyManager");
    !function (e) {
        e.notifyIdAutoDeleteNonExistTasks = "auto_delete_nonexsit_tasks", e.notifyIdScheduleTaskComplete = "schedule_task_complete", e.notifyIdTaskOperatorDestroyTask = "task_operator_destroy_task", e.notifyIdTaskOperatorCopyLink = "task_operator_copy_link", e.notifyIdTaskOperatorCopyMagnetLink = "task_operator_copy_magnet_link", e.notifyIdTaskOperatorSaveAsTorrent = "task_operator_save_as_torrent", e.notifyIdTaskOperatorRecoverTask = "task_operator_recover_task", e.notifyIdScheduleTaskDownloadMode = "schedule_task_download_mode", e.notifyIdTaskOperatorMoveTask = "task_operator_move_task", e.notifyIdTaskDispatchSmallFileAdvanced = "task_dispatch_small_file_advanced";

        class t extends a.default {
            constructor() {
                super(...arguments), this.notifyList = []
            }

            getTopNotify() {
                return this.notifyList.length < 1 ? null : this.notifyList[this.notifyList.length - 1]
            }

            closeNotify(e) {
                r.information("closeNotify notifyId:", e);
                for (let t = 0; t < this.notifyList.length; t++) if (this.notifyList[t].getId() === e) {
                    let n = this.notifyList[t];
                    this.notifyList.splice(t, 1), this.fireEvent("OnCloseNotify", e, n);
                    break
                }
            }

            updateNotify(e, t, n) {
                r.information("updateNotify notifyId:", e, ", msg:", t, ", duration:", n);
                for (let i = 0; i < this.notifyList.length; i++) {
                    let a = this.notifyList[i];
                    if (a.getId() === e) return a.setMessage(t), a.setDuration(n), this.fireEvent("OnUpdateNotify", e, a), !0
                }
                return !1
            }

            showNotify(e, t, n, i) {
                r.information("showNotify notifyId:", e, ", notifyType:", o.ToastNotifyItemType, ", message:", n, ", duration:", i);
                let a = null;
                switch (t) {
                    case o.ToastNotifyItemType.GreenNotify:
                        a = new o.ToastNotifyItem(e, n, i);
                        break;
                    case o.ToastNotifyItemType.RedCancelNotify:
                        a = new o.RedCancelToastNotifyItem(e, n, i);
                        break;
                    case o.ToastNotifyItemType.RedNotify:
                        a = new o.RedToastNotifyItem(e, n, i)
                }
                return a ? (this.notifyList.push(a), this.fireEvent("OnShowNotify", e, a), a) : a
            }
        }

        e.ToastNotifyManager = t;
        const n = new t;
        e.getToastNotifyManger = function () {
            return n
        }
    }(t.ToastNotifyManagerNS || (t.ToastNotifyManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(231), o = n(1), r = n(6), s = n(56),
        l = o.default.getLogger("Thunder.MainRenderer.TabsBrowser"), u = 0;
    var d;
    !function (e) {
        e[e.XDAS = 0] = "XDAS", e[e.Chromium = 1] = "Chromium", e[e.IE = 2] = "IE", e[e.Other = 3] = "Other"
    }(d = t.TabType || (t.TabType = {}));

    class c {
        constructor() {
            this.canGoForward = !1, this.canGoBack = !1, this.url = "", this.iconUrl = "", this.originalUrl = "", this.isErrorPage = !1, this.pinned = !1, l.information("tab construct")
        }

        initTab(e, t) {
            let n = !1;
            do {
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                this.type = e, this.originalUrl = t.url, this.name = t.name, this.index = t.index, this.showUrl = !("showUrl" in t) || t.showUrl, void 0 !== t.pinned && "boolean" == typeof t.pinned && (this.pinned = t.pinned), e === d.XDAS ? n = this.xdasTabInit(t) : e === d.Chromium ? n = this.chromiumTabInit(t) : e === d.IE && (n = this.ieTabInit(t))
            } while (0);
            return n
        }

        navigate(e) {
            let t = !1;
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.navigate(e, "", "", !1), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                this.browser.refresh(e)
            } while (0);
            return !1
        }

        stop() {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.stop()
            } while (0);
            return !1
        }

        goForward() {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.goForward()
            } while (0);
            return !1
        }

        goBack() {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.goBack()
            } while (0);
            return !1
        }

        showDevTool(e) {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(a.browserSupport.browserManager)) {
                    l.error(a.browserSupport.browserManager);
                    break
                }
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                a.browserSupport.browserManager.destroyBrowser(this.browser, e)
            } while (0);
            return !1
        }

        viewSource() {
            do {
                if (this.type !== d.Chromium) break;
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.viewSource()
            } while (0);
            return !1
        }

        attachListener(e) {
            let t = 0;
            do {
                if (this.type !== d.Chromium) break;
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(e) || r.isNullOrUndefined(e.eventName) || r.isNullOrUndefined(e.listener)) {
                    l.error(e);
                    break
                }
                t = this.browser.attachEventListener(e.eventName, e.listener)
            } while (0);
            return t
        }

        detachListener(e, t) {
            let n = !1;
            do {
                if (t === u) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (this.type !== d.Chromium) break;
                n = this.browser.detachEventListener(e, t)
            } while (0);
            return n
        }

        getTabType() {
            return this.type
        }

        getTitle() {
            return this.title
        }

        getOriginalUrl() {
            return this.originalUrl
        }

        getPinned() {
            return this.pinned
        }

        setTitle(e) {
            return !r.isNullOrUndefined(e) && (this.title = e, !0)
        }

        setIconUrl(e) {
            return !r.isNullOrUndefined(e) && (this.iconUrl = e, !0)
        }

        getBrowser() {
            return this.browser
        }

        attachListeners(e) {
            do {
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (this.type === d.Chromium) for (let t of e) {
                    if (r.isNullOrUndefined(t) || r.isNullOrUndefined(t.eventName) || r.isNullOrUndefined(t.listener)) continue;
                    let e = this.browser.attachEventListener(t.eventName, t.listener);
                    e === u && l.error(e)
                }
            } while (0)
        }

        registerNativeFunction(e, t) {
            let n = !1;
            do {
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (r.isNullOrUndefined(t)) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(t);
                    break
                }
                let i = c.nativeFunctionMap.filter(t => e === t.functionName);
                if (r.isNullOrUndefined(i)) {
                    let i = {functionName: e, nativeFunc: t};
                    c.nativeFunctionMap.push(i), n = !0
                }
            } while (0);
            return n
        }

        unRegisterNativeFunction(e) {
            let t = !1;
            do {
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(c.nativeFunctionMap);
                    break
                }
                for (let n in c.nativeFunctionMap) if (c.nativeFunctionMap[Number(n)].functionName === e) {
                    c.nativeFunctionMap.splice(Number(n), 1), t = !0;
                    break
                }
            } while (0);
            return t
        }

        callNativeFunctionCallback(e, t, ...n) {
            let i = !1;
            do {
                if (r.isNullOrUndefined(t)) {
                    l.error(t);
                    break
                }
                if (this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(s.NativeCallHostModule.nativeCallHost, [e].concat(t, n)), i = !0
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.callNativeFunctionCallback(t, n), i = !0
                }
            } while (0);
            return i
        }

        callJSFunction(e, t, ...n) {
            let i = !1;
            do {
                if (r.isNullOrUndefined(t) || "" === t) {
                    l.error(t);
                    break
                }
                if (this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.callJsFunctionByName(e, t, n), i = !0
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.callJSFunction(t, n), i = !0
                }
            } while (0);
            return i
        }

        fireEvent(e, ...t) {
            let n = !1;
            do {
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent.apply(s.NativeCallHostModule.nativeCallHost, [e].concat(t)), n = !0
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.fireEvent(e, t), n = !0
                }
            } while (0);
            return n
        }

        onJsCallNativeFunction(e, t, n, a) {
            let o = !1;
            do {
                if (r.isNullOrUndefined(e) && l.error(e), r.isNullOrUndefined(t) || "" === t) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(c.nativeFunctionMap);
                    break
                }
                let u = c.nativeFunctionMap.filter(e => t === e.functionName), h = void 0,
                    f = i.NativeFunctionErrorCode.Success;
                if (r.isNullOrUndefined(u) || 0 === u.length || r.isNullOrUndefined(u[0].nativeFunc)) {
                    if (f = i.NativeFunctionErrorCode.FunctionUnExist, r.isNullOrUndefined(n)) {
                        o = !0;
                        break
                    }
                    if (this.type === d.XDAS) {
                        if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                            l.error(s.NativeCallHostModule.nativeCallHost);
                            break
                        }
                        s.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(s.NativeCallHostModule.nativeCallHost, [e].concat(n, f, h))
                    } else if (this.type === d.Chromium) {
                        if (r.isNullOrUndefined(this.browser)) {
                            l.error(this.browser);
                            break
                        }
                        this.browser.callNativeFunctionCallback(n, [f].concat(h))
                    }
                } else u[0].nativeFunc(this, e, n, a)
            } while (0);
            return o
        }

        onJsCheckNativeFunction(e, t, n) {
            do {
                if (r.isNullOrUndefined(e) && l.error(e), r.isNullOrUndefined(n)) break;
                if (r.isNullOrUndefined(t) || "" === t) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(c.nativeFunctionMap);
                    break
                }
                let a = c.nativeFunctionMap.filter(e => t === e.functionName), o = i.NativeFunctionErrorCode.Success;
                if ((r.isNullOrUndefined(a) || r.isNullOrUndefined(a[0]) || r.isNullOrUndefined(a[0].nativeFunc)) && (o = i.NativeFunctionErrorCode.FunctionUnExist, l.error(a)), this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.callJsFunctionById(e, n, o)
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.callNativeFunctionCallback(n, [].concat(o))
                }
            } while (0);
            return !1
        }

        isDefaultTab() {
            return this.url.split("#")[0] === c.defaultBrowserUrl
        }

        xdasTabInit(e) {
            return r.isNullOrUndefined(e) && (e = {}), void 0 === e.title ? this.title = c.defaultXDASTitle : this.title = e.title, !0
        }

        chromiumTabInit(e) {
            let t = !1;
            r.isNullOrUndefined(e) && (e = {});
            do {
                if (r.isNullOrUndefined(a.browserSupport.browserManager)) {
                    l.error(a.browserSupport.browserManager);
                    break
                }
                r.isNullOrUndefined(e.url) && (e.url = c.defaultBrowserUrl), void 0 === e.parentHwnd && (e.parentHwnd = a.browserSupport.browserParentWndHandle), void 0 === e.title ? this.title = c.defaultBrowserTitle : this.title = e.title, void 0 === e.isFromPopup && (e.isFromPopup = !1), void 0 === e.eventListeners ? e.eventListeners = c.defaultEventList : e.eventListeners = e.eventListeners.concat(c.defaultEventList), void 0 === e.rect && (e.rect = {
                    x: 0,
                    y: 0,
                    width: 0,
                    height: 0
                });
                let n = a.browserSupport.browserManager.createChromiumBrowser(e.parentHwnd, e.url, e.isFromPopup, e.rect);
                if (r.isNullOrUndefined(n)) {
                    l.error(n);
                    break
                }
                if (this.browser = n, n.addCustomProtocol("ed2k://"), n.addCustomProtocol("thunder://"), n.addCustomProtocol("magnet:?"), n.registerHotKey(116, 4), n.registerHotKey(116, 0), n.registerHotKey(84, 4), n.registerHotKey(82, 4), n.registerHotKey(87, 4), this.attachListeners(e.eventListeners), e.isFromPopup) {
                    this.browser.navigate(e.url, "", "", !1), t = !0;
                    break
                }
                r.isNullOrUndefined(c.tempBrowser) && (c.tempBrowser = a.browserSupport.browserManager.createChromiumBrowser(e.parentHwnd, c.defaultBrowserUrl, e.isFromPopup, {
                    x: 0,
                    y: 0,
                    width: 0,
                    height: 0
                })), t = !0
            } while (0);
            return t
        }

        ieTabInit(e) {
            return void 0 === e.title ? this.title = c.defaultBrowserTitle : this.title = e.title, !0
        }
    }

    c.defaultXDASTitle = "下载", c.defaultBrowserTitle = "正在加载...", c.defaultBrowserUrl = "http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", c.defaultEventList = [], c.nativeFunctionMap = [], c.tempBrowser = null, t.Tab = c
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(225), a = n(162);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-tip.vue", t.default = s.exports
}, , , , , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(72), o = n(8), r = n(57), s = n(1).default.getLogger("Thunder.VipDownload.download-kernel-helper"),
        l = r.PluginHelperNS.getHelper();
    var u;
    !function (e) {
        e.taskInserted = "OnTaskInserted", e.taskCompleted = "OnTaskCompleted", e.taskRemoved = "OnTaskRemoved", e.taskStatusChanged = "OnTaskStatusChanged", e.taskDetailChanged = "OnTaskDetailChanged", e.taskDcdnStatusChanged = "OnTaskDcdnStatusChanged", e.btSubFileDcdnStatusChanged = "OnBtSubFileDcdnStatusChanged", e.btSubFileDetailChanged = "OnBtSubFileDetailChanged", e.btSubFileForbidden = "OnBtSubFileForbidden"
    }(u = t.DkEventNS || (t.DkEventNS = {}));

    class d extends a.default {
        constructor() {
            super(...arguments), this.mPeerId = void 0
        }

        init() {
            this.setMaxListeners(0), l.nativeCall && this.attachDkEvents()
        }

        getTpPeerId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : l.nativeCall ? l.nativeCall.CallNativeFunction("GetTpPeerId", (t, n) => {
                        s.information("GetTpPeerId", "errorCode", t, "returnValue", n), 0 === t && n && "" !== n && (this.mPeerId = n), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getCurrentCategoryId() {
            return new Promise(e => {
                let t = void 0;
                l.nativeCall ? l.nativeCall.CallNativeFunction("GetCurrentCategoryId", (n, i) => {
                    0 === n && i && (t = i), e(t)
                }) : e(t)
            })
        }

        getTaskBaseInfo(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = null;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetTaskBaseInfo", e, (e, i) => {
                        if (0 === e && i) try {
                            n = JSON.parse(i)
                        } catch (e) {
                            s.warning(e)
                        }
                        t(n)
                    }) : t(n)
                })
            })
        }

        getTaskStatus(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = void 0;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetTaskStatus", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        IsTaskExist(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = !1;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("IsTaskExist", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        getTaskDetail(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = null;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetTaskInfo", e, void 0, "taskDetail", (e, i) => {
                        do {
                            if (s.information("getTaskDetail", e, i), 0 !== e || !i) break;
                            let t = null;
                            try {
                                t = JSON.parse(i)
                            } catch (e) {
                                s.warning(e)
                            }
                            if (!t || !t.fileList) break;
                            let a = t.infoId, r = t.type;
                            n = {infoId: a, files: new Map};
                            for (let e of t.fileList) {
                                let t = -1, i = e.url;
                                r === o.DownloadKernel.TaskType.Bt ? (t = e.index, i = this.createBtFileUrl(e.index, a)) : r === o.DownloadKernel.TaskType.Group && (t = e.taskId);
                                let s = {
                                    subId: t,
                                    taskStatus: e.status,
                                    filePath: e.filePath,
                                    fileName: e.fileName,
                                    gcid: e.gcid,
                                    cid: e.cid,
                                    url: i,
                                    refUrl: e.refUrl || "",
                                    fileSize: e.fileSize,
                                    downloadSize: e.downloadSize,
                                    errCode: e.errCode,
                                    isNeedDownload: e.isNeedDownload,
                                    dcdnStatus: e.dcdnStatus
                                };
                                n.files.set(t, s)
                            }
                        } while (0);
                        t(n)
                    }) : t(n)
                })
            })
        }

        createBtTaskUrl(e) {
            return "bt://" + e
        }

        createBtFileUrl(e, t) {
            let n = this.createBtTaskUrl(t);
            return n = n + "/" + e
        }

        startTask(e) {
            this.operateTask(e, "continue")
        }

        stopTask(e) {
            this.operateTask(e, "pause")
        }

        enableDcdnWithVipCert(e, t) {
            s.information("enableDcdnWithVipCert", "taskId", e, "vipCert", t), l.nativeCall && l.nativeCall.CallNativeFunction("EnableDcdnWithVipCert", e, t, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        updateDcdnWithVipCert(e, t) {
            s.information("updateDcdnWithVipCert", "taskId", e, "vipCert", t), l.nativeCall && l.nativeCall.CallNativeFunction("UpdateDcdnWithVipCert", e, t, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        disableDcdnWithVipCert(e) {
            s.information("disableDcdnWithVipCert", "taskId", e), l.nativeCall && l.nativeCall.CallNativeFunction("DisableDcdnWithVipCert", e, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        selectCategoryView(e, t, n, i) {
            l.nativeCall && l.nativeCall.CallNativeFunction("SelectCategoryView", e, t, n, i, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        attachDkEvents() {
            l.nativeCall.AttachNativeEvent("OnTaskInserted", (e, t, n) => {
                this.onTaskInserted(e, t, n)
            }), l.nativeCall.AttachNativeEvent("OnTaskRemoved", (e, t, n) => {
                this.onTaskRemoved(e, t, n)
            }), l.nativeCall.AttachNativeEvent("OnTaskStatusChanged", e => {
                {
                    let t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== t) for (let e in t) {
                        let n = t[e];
                        this.onTaskStatusChanged(Number(e), n)
                    }
                }
            }), l.nativeCall.AttachNativeEvent("OnTaskDetailChanged", e => {
                {
                    let t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== t) for (let e in t) {
                        let n = t[e];
                        this.onTaskDetailChanged(Number(e), n)
                    }
                }
            }), l.nativeCall.AttachNativeEvent("OnTaskDcdnStatusChanged", e => {
                {
                    let t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== t) for (let e in t) {
                        let n = t[e];
                        this.onTaskDcdnStatusChanged(Number(e), n)
                    }
                }
            }), l.nativeCall.AttachNativeEvent("OnBtSubFileDcdnStatusChanged", (e, t, n) => {
                this.onBtSubFileDcdnStatusChanged(e, t, n)
            }), l.nativeCall.AttachNativeEvent("OnBtSubFileDetailChanged", (e, t) => {
                {
                    let n = null;
                    try {
                        n = JSON.parse(t)
                    } catch (e) {
                        s.warning(e)
                    }
                    null !== n && this.onBtSubFileDetailChanged(e, n)
                }
            }), l.nativeCall.AttachNativeEvent("OnBtSubFileForbidden", (e, t) => {
                this.onBtSubFileForbidden(e, t)
            })
        }

        operateTask(e, t, n) {
            l.nativeCall && l.nativeCall.CallNativeFunction("OperateTask", e, t, n, e => {
                s.information("operateTask errorCode", e)
            })
        }

        onTaskInserted(e, t, n) {
            s.information("onTaskInserted categoryId:", e, ", categoryViewId:", t);
            let i = null;
            if (n) {
                try {
                    i = JSON.parse(n)
                } catch (e) {
                    s.warning(e)
                }
                if (null !== i) switch (t) {
                    case o.DownloadKernel.CategroyViewID.Downloading:
                        for (let e of i) this.fireEvent(u.taskInserted, e);
                        break;
                    case o.DownloadKernel.CategroyViewID.Completed:
                        for (let e of i) this.fireEvent(u.taskCompleted, e)
                }
            }
        }

        onTaskRemoved(e, t, n) {
            s.information("onTaskRemoved categoryId:", e, ", categoryViewId:", t);
            let i = [];
            if (n) switch (i = JSON.parse(n), t) {
                case o.DownloadKernel.CategroyViewID.Downloading:
                case o.DownloadKernel.CategroyViewID.Completed:
                    for (let e of i) this.fireEvent(u.taskRemoved, e)
            }
        }

        onTaskStatusChanged(e, t) {
            this.fireEvent(u.taskStatusChanged, e, t)
        }

        onTaskDetailChanged(e, t) {
            this.fireEvent(u.taskDetailChanged, e, t)
        }

        onTaskDcdnStatusChanged(e, t) {
            this.fireEvent(u.taskDcdnStatusChanged, e, t)
        }

        onBtSubFileDcdnStatusChanged(e, t, n) {
            this.fireEvent(u.btSubFileDcdnStatusChanged, e, t, n)
        }

        onBtSubFileDetailChanged(e, t) {
            this.fireEvent(u.btSubFileDetailChanged, e, t)
        }

        onBtSubFileForbidden(e, t) {
            this.fireEvent(u.btSubFileForbidden, e, t)
        }
    }

    t.DkHelper = d, function (e) {
        const t = new d;
        e.getHelper = function () {
            return t
        }
    }(t.DkHelperNS || (t.DkHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(92), o = n(33), r = n(5), s = n(14), l = n(77), u = n(1).default.getLogger("ThunderBirdKey");
    var d;
    !function (e) {
        e[e.ShowUI_Decoding = 0] = "ShowUI_Decoding", e[e.ShowUI_Creating = 1] = "ShowUI_Creating", e[e.ShowUI_DecodeFailed = 2] = "ShowUI_DecodeFailed", e[e.ShowUI_CreateFailed = 3] = "ShowUI_CreateFailed", e[e.ShowUI_CreateSucc = 4] = "ShowUI_CreateSucc", e[e.ShowUI_CreateSuccDis = 5] = "ShowUI_CreateSuccDis"
    }(d = t.ShowType || (t.ShowType = {}));

    class c {
        constructor() {
            this.lastBirdKey = []
        }

        static GetInstance() {
            return c.instance || (c.instance = new c), c.instance
        }

        setLastBirdKey(e) {
            if (e && 0 !== e.length) {
                this.lastBirdKey = [];
                for (let t = 0; t < e.length; t++) this.lastBirdKey.push(e[t])
            }
        }

        getLastBirdKey() {
            return this.lastBirdKey
        }

        isSameBirdKey(e) {
            if (!this.lastBirdKey) return !1;
            if (e.length !== this.lastBirdKey.length) return !1;
            let t = 0;
            for (let n = 0; n < e.length; n++) e[n] === this.lastBirdKey[n] && t++;
            return t === e.length
        }
    }

    function h(e) {
        return a.fetchSlRes({url: "/xlppc.dljgo.api/url", data: {url: e, "Chat-Version": 2}, method: "post"})
    }

    c.instance = null, t.encodeBirdKey = function (e, t, n, i) {
        let o = {url: "/dlj_create", data: {url: t, uid: e, "Chat-Version": 2, type: n}, method: "post"};
        return "string" == typeof n && (o.data.type = n), "string" == typeof i && (o.data.passwd = i), a.fetchSlRes(o)
    }, t.setBirdKeyPriority = function (e, t, n = !1) {
        return a.fetchSlRes({url: "/dlj/option", data: {url: e, priority: n, "Chat-Version": 2}, method: "put"})
    }, t.queryBirdKeyInfo = h, t.getUserNameByID = function (e) {
        return a.fetchSlRes({url: "/user_info/pc_info", data: {uid: e}})
    }, t.decodeBirdKey = function (e) {
        return i(this, void 0, void 0, function* () {
            let t = yield new Promise(e => {
                r.NativeCallModule.nativeCall.CallNativeFunction("GetThunderVersion", (t, n) => {
                    e(0 === t ? n : "")
                })
            });
            return a.fetchSlRes({
                url: "/dlj/bird_key?key=" + e.toLowerCase(),
                data: {_h: ["Chat-Version:2", "Version-Name:" + t]},
                method: "get"
            })
        })
    }, t.openBirdKeyEncodeDialog = function (e, t) {
        return i(this, void 0, void 0, function* () {
            let n = function (e, t) {
                u.information("弹出生成迅雷口令面板,begin,url=", e), o.MessageBox.custom("BirdKeyShow", {
                    showType: d.ShowUI_Creating,
                    url: e,
                    statData: t
                }, {modal: !1}).catch(e => {
                    u.information("弹出生成迅雷口令面板,error=", e)
                }), u.information("弹出生成迅雷口令面板,end")
            };
            u.information("调用promise IsLogined 函数 Begin");
            let a = yield s.default("IsLogined");
            u.information("调用promise IsLogined 函数 End, isLogined=", a), a ? n(e, t) : h(e).then(a => i(this, void 0, void 0, function* () {
                if ("object" != typeof a) return Promise.resolve();
                if (!a.data) return Promise.resolve();
                if ("encrypted" === a.data.type) {
                    let i = yield l.default(!1, !0, "birdkey");
                    if (!i || "" === i) return;
                    n(e, t)
                } else n(e, t);
                return Promise.resolve()
            })).catch(e => {
                u.information("调用queryBirdKeyInfo 接口异常 error=", e)
            })
        })
    }, t.openBirdKeyDecodeDialog = function (e, t, n) {
        o.MessageBox.custom("BirdKeyShow", {
            showType: d.ShowUI_Decoding,
            birdkeyChars: e,
            statData: t,
            helperobj: n
        }, {modal: !1}).catch()
    }, t.saveVestUrlToConfig = function (e, t) {
        let n = t ? "vestURL" : "commonUrl";
        r.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "BirdKeyVest", n, [], (t, i) => {
            let a = [];
            0 === t && (a = i), "" !== e && -1 === a.join().indexOf(e) && (a.push(e), r.NativeCallModule.nativeCall.CallNativeFunction("SetValue", "BirdKeyVest", n, a, e => e))
        })
    }, t.isVestUrl = function (e, t) {
        return i(this, void 0, void 0, function* () {
            return new Promise(n => {
                r.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "BirdKeyVest", t, [], (t, i) => {
                    let a = [];
                    0 === t && (a = i), "" !== e && -1 !== a.join().indexOf(e) ? n(!0) : n(!1)
                })
            })
        })
    }, t.getBirdKeyMgr = function () {
        return c.GetInstance()
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(72);
    !function (e) {
        e.taskExpand = "OnTaskExpand", e.subTaskStatusChanged = "OnSubTaskStatusChanged", e.btSubFileForbidden = "OnBtSubFileForbidden", e.taskAcclerateStatusChanged = "OnTaskAcclerateStatusChanged", e.subTaskAcclerateStatusChanged = "OnSubTaskAcclerateStatusChanged", e.vipTaskInfoChanged = "OnVipTaskInfoChanged", e.totalAcclerateStatusChanged = "OnTotalAcclerateStatusChanged", e.taskTryDetailChanged = "OnTaskTryDetailChanged", e.taskTokenQueryResult = "OnTaskTokenQueryResult"
    }(t.TaskEventNS || (t.TaskEventNS = {}));

    class a extends i.default {
        constructor() {
            super(), this.setMaxListeners(0)
        }

        onEvent(e, ...t) {
            this.fireEvent(e, ...t)
        }
    }

    t.TaskEventContainer = a, function (e) {
        const t = new a;
        e.getEventContainer = function () {
            return t
        }
    }(t.TaskEventContainerNS || (t.TaskEventContainerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.formatDate = function (e, t) {
            /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
            let n = {
                "M+": e.getMonth() + 1,
                "d+": e.getDate(),
                "h+": e.getHours(),
                "m+": e.getMinutes(),
                "s+": e.getSeconds()
            };
            for (let e in n) {
                let i = n[e] + "";
                new RegExp(`(${e})`).test(t) && (t = t.replace(RegExp.$1, 1 === RegExp.$1.length ? i : ("00" + (i = i)).substr(i.length)))
            }
            var i;
            if (/(f+)/.test(t)) {
                let n = e.getMilliseconds() + "";
                t = t.replace(RegExp.$1, ("000" + n).substr(n.length))
            }
            return t
        }, e.formatSeconds = function (e) {
            let t = "";
            do {
                if (e <= 0) {
                    t = "00:00:00";
                    break
                }
                let n = Math.floor(e / 3600), i = Math.floor(e / 60) % 60, a = Math.floor(e % 60);
                t = n < 10 ? "0" + n + ":" : n + ":", t += i < 10 ? "0" + i + ":" : i + ":", t += a < 10 ? "0" + a : "" + a
            } while (0);
            return t
        }, e.convertTimeToMinutes = function (e, t, n) {
            return 3600 * e + 60 * t + n
        }, e.convertMinuteToTime = function (e) {
            return [Math.floor(e / 3600), Math.floor(e / 60 % 60), Math.floor(e % 60)]
        }
    }(t.TimeHelperNS || (t.TimeHelperNS = {}))
}, , function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(567), o = n(565);
    !function (e) {
        let t, n, r;

        function s(e) {
            let a = null, o = e.receiveSize, s = e.srcUsing;
            do {
                if (e.taskType === i.DownloadKernel.TaskType.P2sp) {
                    if (o > 0) {
                        a = t.Stared;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending) {
                        a = t.Starting;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.Started && 0 === o) {
                        a = t.Connect;
                        break
                    }
                } else if (e.taskType === i.DownloadKernel.TaskType.Bt) {
                    if (o > 0) {
                        a = n.Stared;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending) {
                        a = n.Analy;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.Started) {
                        a = s > 0 ? n.Connect : n.Search;
                        break
                    }
                } else if (e.taskType === i.DownloadKernel.TaskType.Emule) {
                    if (o > 0) {
                        a = r.Stared;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending) {
                        a = r.Starting;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.Started) {
                        a = s > 0 ? r.Connect : r.Search;
                        break
                    }
                }
            } while (0);
            return a
        }

        function l(e) {
            let t = "未知错误，无法继续下载";
            e > 704 && e <= 799 && (e = 701);
            let n = a.ErrorCodeHelperNS.getHelper().getMessage(a.ErrorCodeHelperNS.ErrorType.Download, e);
            if (n) t = n; else switch (e) {
                case 1:
                    t = "任务创建失败，无法继续下载";
                    break;
                case 2:
                    t = "任务参数错误，无法继续下载";
                    break;
                case 3:
                    t = "链接失效，无法继续下载";
                    break;
                case 4:
                    t = "任务配置文件错误，无法继续下载";
                    break;
                case 5:
                    t = "任务连接超时，无法继续下载";
                    break;
                case 6:
                    t = "文件校验失败，无法继续下载";
                    break;
                case 7:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 8:
                    t = "下载引擎加速出错，无法继续下载";
                    break;
                case 9:
                    t = "文件路径超出系统限制，无法继续下载";
                    break;
                case 201:
                    t = "文件创建失败，无法继续下载";
                    break;
                case 202:
                    t = "文件写入失败，无法继续下载";
                    break;
                case 203:
                    t = "文件读取失败，无法继续下载";
                    break;
                case 204:
                    t = "文件重命名失败，无法继续下载";
                    break;
                case 205:
                    t = "磁盘空间不足，无法继续下载";
                    break;
                case 601:
                    t = "BT任务已存在，无法继续下载";
                    break;
                case 701:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 702:
                    t = "帐号存在异常，无法继续下载";
                    break;
                case 703:
                    t = "根据当地法律法规，文件无法下载";
                    break;
                case 704:
                    t = "应版权方要求，文件无法下载";
                    break;
                case 10001:
                    t = "下载引擎未启动，无法继续下载";
                    break;
                case 10002:
                    t = "种子文件不存在，无法继续下载"
            }
            return t
        }

        e.canStartSelectedTask = function (e, t) {
            let n = !1;
            if (e === i.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                if (e.isMoving) {
                    n = !1;
                    break
                }
                let t = e.taskStatus;
                t !== i.DownloadKernel.TaskStatus.StandBy && t !== i.DownloadKernel.TaskStatus.Stopped && t !== i.DownloadKernel.TaskStatus.Failed && t !== i.DownloadKernel.TaskStatus.Unkown || (n = !0)
            }
            return n
        }, e.canMoveSelectedTask = function (e, t) {
            let n = !0;
            for (let e of t) if (e.isMoving) {
                n = !1;
                break
            }
            return n
        }, e.canStopSelectedTask = function (e, t) {
            let n = !1;
            if (e === i.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                let t = e.taskStatus;
                if (t === i.DownloadKernel.TaskStatus.Started || t === i.DownloadKernel.TaskStatus.StartWaiting) {
                    n = !0;
                    break
                }
            }
            return n
        }, e.canDeleteSelectedTask = function (e, t) {
            let n = !1;
            if (t.length > 0) for (let e of t) {
                if (e.isMoving) {
                    n = !1;
                    break
                }
                let t = e.taskStatus;
                t === i.DownloadKernel.TaskStatus.StartPending || t === i.DownloadKernel.TaskStatus.StopPending || t === i.DownloadKernel.TaskStatus.DestroyPending || (n = !0)
            }
            return n
        }, e.canMarkAsOpened = function (e) {
            let t = !1;
            do {
                if (null === e || 0 === e.length) break;
                for (let n of e) if (0 === n.userRead) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.canCopySelectTaskLink = function (e) {
            let t = !1;
            do {
                if (void 0 === e) break;
                if (0 === e.length) break;
                for (let n of e) if (n.taskType === i.DownloadKernel.TaskType.P2sp || n.taskType === i.DownloadKernel.TaskType.Emule || n.taskType === i.DownloadKernel.TaskType.Group) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.canMergeSelectedTaskIntoGroup = function (e) {
            let t = !0;
            do {
                if (void 0 === e || null === e) {
                    t = !1;
                    break
                }
                if (e.length <= 1) {
                    t = !1;
                    break
                }
                for (let n of e) if (n.taskType === i.DownloadKernel.TaskType.Bt || n.taskType === i.DownloadKernel.TaskType.Group) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }, function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Starting = 1] = "Starting", e[e.Connect = 2] = "Connect", e[e.Stared = 3] = "Stared"
        }(t = e.P2spStartStatus || (e.P2spStartStatus = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Analy = 1] = "Analy", e[e.Search = 2] = "Search", e[e.Connect = 3] = "Connect", e[e.Stared = 4] = "Stared"
        }(n = e.BtStartStatus || (e.BtStartStatus = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Starting = 1] = "Starting", e[e.Search = 2] = "Search", e[e.Connect = 3] = "Connect", e[e.Stared = 4] = "Stared"
        }(r = e.EmuleStartStatus || (e.EmuleStartStatus = {})), e.getTaskStartStatus = s, e.getTaskStartStatusPrompt = function (e) {
            let a = void 0;
            do {
                if (null === e) break;
                if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending || e.taskStatus === i.DownloadKernel.TaskStatus.Started) {
                    if (e.taskType === i.DownloadKernel.TaskType.P2sp) {
                        let n = s(e);
                        if (null === n) break;
                        n === t.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === i.DownloadKernel.TaskType.Bt) {
                        let t = s(e);
                        if (null === t) break;
                        t === n.Analy ? a = "解析种子" : t === n.Search ? a = "寻找资源" : t === n.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === i.DownloadKernel.TaskType.Emule) {
                        let t = s(e);
                        if (null === t) break;
                        t === r.Search ? a = "寻找资源" : t === r.Connect && (a = "连接资源")
                    }
                }
            } while (0);
            return a
        }, e.getTaskStatusPrompt = function (e) {
            let t = void 0;
            do {
                if (null === e) break;
                let n = e.taskStatus;
                if (n === i.DownloadKernel.TaskStatus.Unkown) {
                    t = "未知错误";
                    break
                }
                if (n !== i.DownloadKernel.TaskStatus.Started && o.DownloadJammedNS.isStopPending(e.taskId)) {
                    t = "0B/s";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StandBy) {
                    t = "准备开始";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.PreDownloading) {
                    t = "等待中";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StartWaiting) {
                    t = "排队等待";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StartPending) {
                    t = "正在开始";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StopPending) {
                    t = "正在停止";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.Stopped) {
                    t = "暂停", e.isMoving && (t = "移动文件中");
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.Failed) {
                    t = "任务出错", t = l(e.errorCode);
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.Succeeded || n === i.DownloadKernel.TaskStatus.Seeding) {
                    t = "完成";
                    break
                }
            } while (0);
            return t
        }, e.getValueForSort = function (e) {
            let t = 0, n = e.taskStatus;
            if (n === i.DownloadKernel.TaskStatus.PreDownloading ? t = 11 : n === i.DownloadKernel.TaskStatus.Started ? t = 10 : n === i.DownloadKernel.TaskStatus.StartPending ? t = 9 : n === i.DownloadKernel.TaskStatus.StartWaiting ? t = 8 : n === i.DownloadKernel.TaskStatus.StopPending ? t = 7 : n === i.DownloadKernel.TaskStatus.DestroyPending ? t = 6 : n === i.DownloadKernel.TaskStatus.Unkown ? t = 5 : n === i.DownloadKernel.TaskStatus.StandBy ? t = 4 : n === i.DownloadKernel.TaskStatus.Stopped ? t = 3 : n === i.DownloadKernel.TaskStatus.Failed ? t = 2 : n === i.DownloadKernel.TaskStatus.Seeding ? t = 1 : n === i.DownloadKernel.TaskStatus.Succeeded && (t = 0), n === i.DownloadKernel.TaskStatus.Started) {
                let n = s(e);
                t = null === n || 4 === n ? t + .9 - 1 / (e.downloadSpeed + 1.2) : t + n / 10 - .4
            }
            return n === i.DownloadKernel.TaskStatus.StartPending && e.taskType === i.DownloadKernel.TaskType.Bt && (t += .1), t
        }, e.getTaskErrorInfoByCode = l
    }(t.TaskStatusHelper || (t.TaskStatusHelper = {}))
}, function (e, t) {
    e.exports = require("buffer")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(1), o = n(8), r = n(58), s = n(20), l = n(7), u = a.default.getLogger("ThunderNewTask"),
        d = l.default(i.join(__rootDir, "../bin/ThunderHelper.node")),
        c = ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;\n  .mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;\n  .pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;\n  .deb;.sisx;.cab;.pxl;",
        h = ".a;.a3m;.a3w;.a4m;.a4p;.a4w;.a5w;.aam;.aas;.abf;.abk;.abs;.ace;.acm;.acp;.act;.ad;\n  .ada;.adb;.adf;.adi;.adm;.adp;.adr;.ads;.af2;.af3;.afm;.ai;.aif;.aifc;.aiff;.aim;.ais;.akw;.alb;.all;.ams;.anc;.ani;\n  .ans;.ant;.api;.aps;.ari;.arj;.art;.asa;.asc;.asd;.ase;.asf;.asm;.aso;.asp;.asv;.asx;.atw;.au;.avb;.avi;.avr;.avs;\n  .awd;.awr;.axx;.bak;.bas;.bat;.bdf;.bgl;.bi;.bif;.biff;.bin;.bk;.bk$;.bks;.bmk;.bmp;.book;.brx;.bsp;.btm;.bud;.bun;\n  .bw;.bwv;.c;.cab;.cad;.cal;.cap;.cas;.cb;.cc;.ccb;.cch;.cco;.cct;.cda;.cdf;.cdi;.cdm;.cdr;.cdt;.cdx;.cfg;.cgi;.cgm;\n  .chk;.chm;.chr;.cif;.cil;.class;.cll;.clp;.cls;.cmf;.cmv;.cmx;.cnf;.cnm;.cnt;.cod;.com;.cpl;.cpo;.cpp;.cpr;.cpt;.cpx;\n  .crd;.crp;.crt;.csc;.csp;.cst;.csv;.ctl;.cur;.cv;.cxx;.dat;.db;.dbc;.dbf;.dbx;.dcm;.dcs;.dct;.dcu;.dcx;.dem;.der;.dewf;\n  .dib;.dic;.dif;.dig;.dir;.diz;.dlg;.dll;.dls;.dmd;.dmf;.doc;.dot;.draw;.drv;.drw;.dsf;.dsg;.dsm;.dsp;.dsq;.dsw;.dtd;\n  .dun;.dv;.dxf;.dxr;.eda;.edd;.emd;.emf;.eml;.ephtml;.eps;.exe;.fav;.fax;.fcd;.fdf;.ffa;.ffk;.ffl;.ffo;.fif;.fla;.flc;\n  .fm;.fml;.fng;.fnk;.fon;.fot;.frt;.frx;.ftg;.fts;.gal;.gdb;.gdm;.gem;.gen;.getright;.gfi;.gfx;.gho;.gif;.gim;.gix;.gkh;\n  .gks;.gl;.gna;.gnt;.gnx;.gra;.grf;.grp;.hcom;.hgl;.hlp;.hpj;.hpp;.hst;.ht;.htm;.html;.htt;.htx;.icb;.icc;.icl;.icm;.ico;\n  .idd;.idf;.idq;.idx;.iff;.iges;.igf;.ilbm;.ima;.inf;.ini;.inrs;.ins;.int;.iqy;.iso;.ist;.isu;.iwc;.j62;.jar;.java;.jbf;\n  .jff;.jfif;.jif;.jmp;.jpe;.jpeg;.jpg;.js;.jsp;.jtf;.k25;.kar;.kdc;.key;.kfx;.kiz;.kkw;.kmp;.kqp;.lab;.lbm;.lbt;.lbx;.ldb;\n  .ldl;.leg;.lft;.lgo;.lha;.lib;.lin;.lis;.llx;.lnk;.log;.lst;.lu;.lyr;.lzh;.lzs;.m1v;.m3u;.mad;.maf;.mam;.map;.maq;.mar;.mat;\n  .mb1;.mbx;.mcr;.mdb;.mde;.mdl;.mdn;.mdw;.mdz;.mic;.mid;.mim;.mime;.mli;.mme;.mng;.mnu;.mod;.mov;.mp2;.mp3;.mpa;.mpe;.mpeg;\n  .mpg;.mpp;.mpr;.msg;.msi;.msn;.msp;.mst;.mtm;.nan;.nap;.ncb;.ncd;.ncf;.nff;.nft;.nil;.nist;.nls;.nlu;.ntx;.nwc;.nws;.obj;\n  .ocx;.ods;.ofn;.oft;.olb;.ole;.oogl;.opo;.p65;.pab;.part;.pas;.pbd;.pbl;.pbm;.pbr;.pcd;.pcl;.pcm;.pdd;.pdf;.pfm;.pgl;.pgm;\n  .ph;.php;.php3;.phtml;.pic;.pjt;.pjx;.pkg;.pli;.png;.pot;.ppa;.ppf;.ppm;.pps;.ppt;.prf;.prg;.prj;.prn;.prt;.psd;.psp;.pst;\n  .pwz;.qic;.qif;.qlb;.qry;.qtp;.qtx;.qw;.ra;.ram;.rar;.rdf;.reg;.rep;.res;.rft;.rgb;.rm;.rmd;.rpt;.rtf;.rul;.rvp;.s;.sav;.sbl;\n  .scc;.scf;.scp;.scr;.sct;.scx;.sdt;.sdv;.sdx;.sep;.sfd;.sfi;.sfr;.sfx;.sgi;.sgml;.shg;.shtml;.shw;.sig;.ska;.skl;.sl;.spl;\n  .sqc;.sqr;.str;.swa;.swf;.sys;.syw;.taz;.tga;.theme;.thn;.tif;.tiff;.tig;.tlb;.tmp;.tol;.tpl;.trm;.trn;.ttf;.txt;.txw;.udf;\n  .ult;.url;.use;.uwf;.vbp;.vbp;.vbw;.vbw;.vbx;.vbx;.vct;.vcx;.vda;.vda;.vir;.vir;.viv;.vqf;.vsd;.vsd;.vsl;.vsl;.vss;.vss;.vst;\n  .vst;.vsw;.vsw;.vxd;.vxd;.w3l;.wab;.wad;.wav;.wbk;.wcm;.wdb;.wfm;.wfn;.wil;.wiz;.wll;.wmf;.wow;.wp;.wpd;.wpf;.wpg;.wps;.wpt;.wr1;\n  .wrk;.wrl;.wrz;.x;.x16;.x32;.xar;.xbm;.xi;.xla;.xlb;.xlc;.xld;.xlk;.xll;.xlm;.xls;.xlt;.xlv;.xlw;.xnk;.xpm;.xwd;.xwf;.yal;.z;.zap;.zip;";
    !function (e) {
        function t(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                if (c.indexOf(e) > -1) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function n(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e) break;
                if (e.match(/[\/\\"<>\?\*|]/)) break;
                t = !0
            } while (0);
            return t
        }

        function a(e) {
            let n = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                let i = r.TaskUtilHelper.getTaskFileType(void 0, e);
                if (i === r.TaskUtilHelper.FileExtType.Video || i === r.TaskUtilHelper.FileExtType.Music || i === r.TaskUtilHelper.FileExtType.Pic) {
                    n = !0;
                    break
                }
                n = t(e)
            } while (0);
            return n
        }

        function l(e) {
            let t = !1, o = i.parse(e);
            return t = n(o.name) && a(o.ext)
        }

        function f(e) {
            let t = {};
            do {
                if (void 0 === e || null === e) break;
                u.information("parseDynamicUrlArgs");
                let n = /([^&=?]+)=([^&]*)/g;
                for (; n.exec(e);) t[RegExp.$1] = RegExp.$2;
                u.information("parseDynamicUrlArgs ret ", t)
            } while (0);
            return t
        }

        function g(e) {
            let t = {pageFileName: void 0, args: void 0};
            do {
                if (void 0 === e || null === e) break;
                u.information("parseDynamicUrlPath"), e.match(/[\/]?([^?]*)\?([^\s]*)/) && (t.pageFileName = RegExp.$1, t.args = RegExp.$2), u.information("parseDynamicUrlPath ret", t)
            } while (0);
            return t
        }

        function p(e) {
            let t = "";
            do {
                if (void 0 === e || null === e) break;
                let n = g(e);
                if (void 0 !== n.args) {
                    let e = f(n.args);
                    for (let n in e) {
                        let i = e[n];
                        if (l(i)) {
                            t = i;
                            break
                        }
                    }
                }
                void 0 !== n.pageFileName && l(n.pageFileName) && (t = n.pageFileName)
            } while (0);
            return t
        }

        function k(e) {
            let t = [];
            do {
                if (void 0 === e || null === e) break;
                let n = p(e);
                if ("" !== n && !t.includes(n)) {
                    let e = m(n);
                    t.push(e)
                }
                let i = m(e);
                t.includes(i) || t.push(i)
            } while (0);
            return t
        }

        function m(e) {
            return d.parseFileNameFromP2spUrlPath(e)
        }

        function T(e) {
            return d.isThunderPrivateUrl(e)
        }

        function v(e) {
            return d.parseEd2kUrl(e)
        }

        function C(e) {
            return d.parseUrl(e)
        }

        e.isDownloadFileExtName = t, e.isIllegalFileName = n, e.isGoodFileExtName = a, e.isUsualFileExtName = function (e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                if (a(e)) {
                    t = !0;
                    break
                }
                if (h.indexOf(e) > -1) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.isGoodFileName = l, e.parseDynamicUrlArgs = f, e.parseDynamicUrlPath = g, e.parseFileNameFromDynamicUrlPath = p, e.getFileNameListFromUrlPath = k, e.getNameFromUrl = function (e) {
            let t = "index.html", n = s.ThunderHelper.getTaskTypeFromUrl(e);
            if (n === o.DownloadKernel.TaskType.P2sp) {
                let n = C(e);
                if (n) {
                    let e = k(n.fullPath);
                    e.length > 0 && (t = e[0])
                } else {
                    let n = /:\/\/.*?\[.+?\].*(\/.+)/.exec(e);
                    if (n && n[1]) {
                        let e = k(n[1]);
                        e.length > 0 && (t = e[0])
                    }
                }
            } else n === o.DownloadKernel.TaskType.Emule && (t = v(e).fileName);
            return t.replace(/[*?/\\:|<>\"]/g, "_")
        }, e.parseFileNameFromP2spUrlPath = m, e.isThunderPrivateUrl = T, e.parseThunderPrivateUrl = function (e) {
            let t = {url: e, codePage: -1};
            return T(e) && (t = d.parseThunderPrivateUrl(e)), t
        }, e.parseEd2kUrl = v, e.parseUrl = C, e.parseMagnetUrl = function (e) {
            return d.parseMagnetUrl(e)
        }, e.makeUrl = function (e) {
            return d.makeUrl(e)
        }
    }(t.ParseUrlFileNameNS || (t.ParseUrlFileNameNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(7), r = n(1), s = n(3), l = n(15), u = n(10), d = n(8), c = n(20), h = n(150),
        f = r.default.getLogger("ThunderNewTask"), g = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let p = 5;
    !function (e) {
        let t;

        function o(e, t, n) {
            void 0 === n && (n = c.ThunderHelper.getTaskTypeFromUrl(e));
            let i = void 0, o = -1, r = "", s = "";
            do {
                if (n !== d.DownloadKernel.TaskType.Emule && n !== d.DownloadKernel.TaskType.P2sp) break;
                let l = h.ParseUrlFileNameNS.getNameFromUrl(e), u = a.extname(l);
                if ("" !== u && (r = u.substring(1)), n === d.DownloadKernel.TaskType.Emule) {
                    let t = h.ParseUrlFileNameNS.parseEd2kUrl(e);
                    o = t.fileSize, s = t.fileHash
                }
                i = {
                    url: e,
                    cookie: "",
                    referer: "",
                    fileName: l,
                    browser: "",
                    statClick: t = void 0 === t ? "" : t,
                    fileSize: o,
                    fileHash: s,
                    fileType: r
                };
                break
            } while (0);
            return i
        }

        !function (e) {
            e.PreNewTask = "PreNewTaskCtrl", e.NewTask = "NewTaskCtrl", e.UrlFilter = "UrlFilterCtrl", e.Magnet = "BtCtrl"
        }(t = e.TaskCtrlType || (e.TaskCtrlType = {})), e.updateThreadCount = function (e) {
            do {
                if (isNaN(e)) break;
                if (e <= 0 || e > 10) break;
                p = e
            } while (0)
        }, e.contructTaskByUrl = function (e, t, n) {
            let i = o(e, t, n);
            f.verbose(e);
            let a = 5;
            return {
                taskType: n,
                data: i,
                setting: {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: a = null !== i.thread && void 0 !== i.thread ? i.thread : p,
                    note: "",
                    openAfterDownload: !1
                },
                selected: !0
            }
        }, e.contructTaskByUrlData = function (e, t) {
            let n = void 0, i = c.ThunderHelper.getTaskTypeFromUrl(e.url);
            if (i === d.DownloadKernel.TaskType.Emule && (void 0 === e.fileHash || "" === e.fileHash)) {
                let t = h.ParseUrlFileNameNS.parseEd2kUrl(e.url);
                e.fileSize = t.fileSize, e.fileHash = t.fileHash
            }
            if (void 0 !== e.fileSize && null !== e.fileSize && 0 !== e.fileSize || (e.fileSize = -1), void 0 !== e.fileName && "" !== e.fileName || (e.fileName = h.ParseUrlFileNameNS.getNameFromUrl(e.url)), e.fileName = e.fileName.replace(/[*?/\\:|<>\"]/g, "_"), void 0 === e.fileType || "" === e.fileType) {
                let t = a.extname(e.fileName);
                "" !== t && (e.fileType = t.substring(1))
            }
            if (void 0 === t || null === t) {
                let n = 5;
                t = {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: n = null !== e.thread && void 0 !== e.thread ? e.thread : p,
                    note: "",
                    openAfterDownload: !1
                }
            }
            return n = {taskType: i, data: e, setting: t, selected: !0}
        }, e.getDesktopPath = function () {
            return g.getDesktopPath()
        }, e.getDocumentPath = function () {
            return g.getDocumentPath()
        }, e.queryFileExists = function (e) {
            return g.queryFileExists(e)
        }, e.isFilePathValid = function (e) {
            return g.isFilePathValid(e)
        }, e.getNewTaskDataByUrl = o, e.getDownloadResult = function (e, ...t) {
            return i(this, void 0, void 0, function* () {
                let n = {result: !1};
                do {
                    if (e.length < 3) {
                        n.message = "不合法的存储路径";
                        break
                    }
                    if (!(yield u.FileSystemAWNS.mkdirsAW(e))) {
                        n.message = "不合法的存储路径";
                        break
                    }
                    s.ipcRenderer.send(l.ThunderChannelList.channelRMNewTaskCreateNewTask, e, ...t), n = yield new Promise(e => {
                        s.ipcRenderer.once(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, (t, n, i) => {
                            e({result: n, message: i})
                        })
                    })
                } while (0);
                return n
            })
        }, e.readThunderUnionConfig = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = null, i = null;
                try {
                    const i = yield n(24);
                    i.defaults.adapter = n(22), t = yield i.get(e)
                } catch (e) {
                    f.information(e)
                }
                return null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && (i = t.data), i
            })
        }
    }(t.ThunderNewtaskHelperNS || (t.ThunderNewtaskHelperNS = {}))
}, function (e, t, n) {
    e.exports = n(9)(188)
}, function (e, t, n) {
    e.exports = n(9)(167)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(5), o = n(21);
    !function (e) {
        e.getValue = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise(i => {
                    a.NativeCallModule.nativeCall.CallNativeFunction("GetConfigValue", e, t, n, (e, t) => {
                        e === o.NativeFunctionErrorCode.Success ? i(t) : i(n)
                    })
                })
            })
        }, e.setValue = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise((i, r) => {
                    a.NativeCallModule.nativeCall.CallNativeFunction("SetConfigValue", e, t, n, e => {
                        e === o.NativeFunctionErrorCode.Success ? i() : r(new Error("SetConfigValue error"))
                    })
                })
            })
        }
    }(t.ConfigHelperNS || (t.ConfigHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(218), a = n(164);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(213), a = n(168);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-input.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(216), a = n(174);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-text.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(159), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(590), o = n(594), r = n(130), s = n(157), l = n(596), u = n(597), d = n(156), c = n(598), h = n(599),
        f = n(155), g = n(600), p = n(4);
    let k = class extends p.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([p.Prop({})], k.prototype, "item", void 0), i([p.Prop({})], k.prototype, "formData", void 0), i([p.Prop()], k.prototype, "value", void 0), k = i([p.Component({
        components: {
            confCheckbox: a.default,
            confRadio: o.default,
            confSelect: r.default,
            confText: s.default,
            confCheckboxInput: l.default,
            confCheckboxSelect: u.default,
            confInput: d.default,
            confSpeedText: h.default,
            confTextarea: c.default,
            confBtn: f.default,
            confProxyList: g.default
        }
    })], k), t.default = k
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(161), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(154), s = n(137), l = n(155), u = n(130), d = n(156), c = n(592), h = n(593), f = n(157);
    let g = class extends o.Vue {
        handleInput(e, t = "") {
            return a(this, void 0, void 0, function* () {
                if ("" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t), void 0 !== this.item.linkItem && e) {
                    let t = yield r.ConfigHelperNS.getValue(this.formData[this.item.linkItem.name].section, this.formData[this.item.linkItem.name].key, "");
                    "" !== e && this.$emit("input", t, this.item.linkItem.name)
                }
            })
        }
    };
    i([o.Prop({})], g.prototype, "item", void 0), i([o.Prop({})], g.prototype, "formData", void 0), i([o.Prop()], g.prototype, "value", void 0), i([o.Prop()], g.prototype, "label", void 0), g = i([o.Component({
        components: {
            confTip: s.default,
            confBtn: l.default,
            confSelect: u.default,
            confInput: d.default,
            confSpeed: c.default,
            confSpeedTime: h.default,
            confText: f.default
        }
    })], g), t.default = g
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(163), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4);
    let o = class extends a.Vue {
    };
    i([a.Prop()], o.prototype, "classes", void 0), i([a.Prop()], o.prototype, "text", void 0), o = i([a.Component({})], o), t.default = o
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(165), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(154), s = n(33), l = n(28), u = n(12), d = n(5), c = n(137);
    let h = class extends o.Vue {
        popDialog() {
            switch (this.item.boxType) {
                case"speedConfBox":
                    d.NativeCallModule.nativeCall.CallNativeFunction("ShowCustomDownloadModeDlg", () => {
                    });
                    break;
                case"browserGuideConfBox":
                    d.NativeCallModule.nativeCall.CallNativeFunction("ShowBrowserGuideDlg", () => {
                    });
                    break;
                case"function":
                    this.item.handle();
                    break;
                case"pop":
                    this.messagePop()
            }
        }

        messagePop() {
            return a(this, void 0, void 0, function* () {
                let e = u.ThunderUtil.deepCopy(this.item.pop.formData);
                for (let t in e) e[t].value = yield r.ConfigHelperNS.getValue(this.item.pop.formData[t].section, this.item.pop.formData[t].key, this.item.pop.formData[t].value);
                s.MessageBox.pop({
                    title: this.item.pop.title,
                    size: this.item.pop.size,
                    schemas: this.item.pop.schema,
                    formData: e
                }, this.item.pop.dialogOption).then(e => {
                    if (e.action === l.MessageBoxNS.Action.OK) for (let t in e.formData) r.ConfigHelperNS.setValue(e.formData[t].section, e.formData[t].key, e.formData[t].value)
                }).catch()
            })
        }
    };
    i([o.Prop({})], h.prototype, "item", void 0), i([o.Prop()], h.prototype, "classes", void 0), i([o.Prop()], h.prototype, "text", void 0), i([o.Prop()], h.prototype, "disabled", void 0), i([o.Prop({})], h.prototype, "formData", void 0), h = i([o.Component({components: {confTip: c.default}})], h), t.default = h
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(167), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(3), r = n(199), s = n(94), l = n(1).default.getLogger("conf-select");
    let u = class extends a.Vue {
        constructor() {
            super(...arguments), this.schema = null, this.tooltipVisible = !1, this.tipContent = "", this.dyNamicOptions = [], this.valueData = ""
        }

        onFormDataChange(e) {
            this.item.updateByDataChange && e && e[this.name] && (this.valueData = e[this.name].value)
        }

        handleInput(e) {
            void 0 === this.item.hasDeleteOption || e !== this.item.deleteOptionText ? (this.tooltipVisible || this.item.blurUpdate || this.$emit("input", e, this.item.name), this.valueData = e) : this.$emit("input", [], this.item.optionByName)
        }

        handleOutFocus() {
            this.item.blurUpdate && !this.tooltipVisible && this.$emit("input", this.valueData, this.item.name)
        }

        selectPath() {
            let e = o.remote.dialog.showOpenDialog({defaultPath: this.valueData, properties: [this.fileType]});
            void 0 !== e && (void 0 !== this.name ? this.$emit("input", e[0], this.name) : this.$emit("input", e[0], this.item.name), this.valueData = e[0])
        }

        get optionList() {
            if (this.item.optionByName && this.formData[this.item.optionByName] && this.formData[this.item.optionByName].value) {
                let e = this.formData[this.item.optionByName].value,
                    t = [...e].reverse().slice(0, this.item.maxOptionLen || e.length);
                return this.item.deleteOptionText && t.push(this.item.deleteOptionText), t
            }
            return this.options
        }

        get fileType() {
            return this.item.slotOption
        }

        get rules() {
            let e;
            do {
                if (!this.item.rules) break;
                e = this.item.rules.map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
            } while (0);
            return e
        }

        validate(e) {
            l.information("value....", e), this.handleInput(e), void 0 !== this.item.hasDeleteOption && e === this.item.deleteOptionText || this.item.rules && this.schema.validate({[this.item.name]: e}, (e, t) => {
                l.information("errors", e), null === e ? this.tooltipVisible = !1 : (l.information("路径有误", e), this.tipContent = e[0].message, this.tooltipVisible = !0)
            })
        }

        created() {
            this.item.rules && (this.schema = new r.default({[this.item.name]: this.rules})), void 0 !== this.value ? this.valueData = this.value.value.toString() : this.valueData = this.formData[this.item.name].value.toString()
        }
    };
    i([a.Prop({})], u.prototype, "item", void 0), i([a.Prop()], u.prototype, "label", void 0), i([a.Prop({})], u.prototype, "formData", void 0), i([a.Prop()], u.prototype, "options", void 0), i([a.Prop()], u.prototype, "value", void 0), i([a.Prop()], u.prototype, "disabled", void 0), i([a.Prop()], u.prototype, "classes", void 0), i([a.Prop()], u.prototype, "name", void 0), i([a.Prop()], u.prototype, "placeHolder", void 0), i([a.Watch("formData", {deep: !0})], u.prototype, "onFormDataChange", null), u = i([a.Component({components: {SelectNative: s.default}})], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(169), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(199), o = n(4), r = n(155);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.shortcutKey = "", this.funKey = !0, this.valueData = " ", this.canRegister = !1, this.schema = null, this.tooltip = "", this.tooltipVisible = !1
        }

        get rules() {
            let e;
            do {
                if (!this.item.rules) break;
                e = this.item.rules.map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
            } while (0);
            return e
        }

        handleInput(e) {
            this.valueData = e, this.$emit("input", e, this.name)
        }

        handleChange(e) {
            let t = e.target;
            this.valueData = t.value, void 0 !== this.item.ShortcutKey && this.canRegister ? this.$emit("input", t.value, this.name) : void 0 === this.item.ShortcutKey && this.$emit("input", t.value, this.name)
        }

        handleKeyDown(e) {
            if (void 0 !== this.item.ShortcutKey) {
                let t = /Digit\d/.test(e.code) || e.keyCode >= 65 && e.keyCode <= 90;
                if (this.shortcutKey = "", this.funKey = !1, this.canRegister = !1, this.valueData = "", "Backspace" === e.key) return this.valueData = "无", void this.$emit("input", "", this.name);
                e.altKey && (this.shortcutKey = "Alt+"), e.ctrlKey && (this.shortcutKey = "" === this.shortcutKey ? "Crtl+" : `${this.shortcutKey}Crtl+`), e.shiftKey && (this.shortcutKey = "" === this.shortcutKey ? "Shift+" : `${this.shortcutKey}Shift+`);
                let n = "Alt" === e.key || "Shift" === e.key || "Control" === e.key ? "" : t ? e.code[e.code.length - 1] : e.key;
                this.valueData = this.shortcutKey + n, "" !== n && (this.funKey = !0), this.shortcutKey + n !== n && "" !== n && (this.canRegister = !0, this.valueData = this.shortcutKey + n, this.$emit("input", this.valueData, this.name))
            }
        }

        handleKeyup() {
            this.funKey || void 0 === this.item.ShortcutKey || (this.valueData = "无", this.$emit("input", "", this.name))
        }

        mounted() {
            this.valueData = this.value.value
        }

        validate(e) {
            this.item.rules && this.schema.validate({[this.item.name]: e}, (e, t) => {
                this.tooltipVisible = null !== e
            })
        }

        outFocus() {
            this.tooltipVisible = !1
        }

        created() {
            this.item.rules && (this.schema = new a.default({[this.item.name]: this.rules}))
        }
    };
    i([o.Prop()], s.prototype, "item", void 0), i([o.Prop({})], s.prototype, "formData", void 0), i([o.Prop()], s.prototype, "disabled", void 0), i([o.Prop()], s.prototype, "value", void 0), i([o.Prop()], s.prototype, "name", void 0), i([o.Prop()], s.prototype, "label", void 0), s = i([o.Component({components: {confBtn: r.default}})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(171), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(199), o = n(4);
    let r = class extends o.Vue {
        constructor() {
            super(...arguments), this.schema = null, this.tooltip = "", this.tooltipVisible = !1, this.timeout = null
        }

        get rules() {
            return (this.item.rules || []).map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
        }

        get doEmit() {
            return this.item.doEmit ? new Function(this.item.doEmit[0], this.item.doEmit[1]) : null
        }

        get doBlur() {
            return this.item.doBlur ? new Function(this.item.doBlur[0], this.item.doBlur[1]) : null
        }

        get sliderValue() {
            let e;
            return e = "number" == typeof this.value ? this.value : "object" == typeof this.value ? Number(this.value.value) : Number(this.value), this.item.scales && this.item.scales.length ? Math.min(Math.max(this.item.scales[0], e), this.item.scales[this.item.scales.length - 1]) : e
        }

        handleSliderUpdate(e) {
            this.handleInput(e.toString())
        }

        handleInput(e) {
            this.doEmit ? this.doEmit(this.item.name, e, this.value.value) : this.$emit("input", e, this.item.name), this.doValidate(e)
        }

        doValidate(e) {
            this.schema && this.schema.validate({[this.item.name]: e}, (e, t) => {
                null === e ? this.hideTooltip() : this.showTooltip(e[0].message)
            })
        }

        handleBlur() {
            let e;
            e = "object" == typeof this.value ? this.value.value : this.value, this.doBlur && this.doBlur(this.item.name, e), this.$nextTick(() => {
                let e;
                e = "object" == typeof this.value ? this.value.value : this.value, this.doValidate(e)
            })
        }

        showTooltip(e) {
            this.tooltip = e, this.$refs.tooltip.show(this.$refs.input.$el)
        }

        hideTooltip() {
            this.$refs.tooltip.hide()
        }

        created() {
            this.item.rules && (this.schema = new a.default({[this.item.name]: this.rules}))
        }
    };
    i([o.Prop({})], r.prototype, "item", void 0), i([o.Prop()], r.prototype, "value", void 0), i([o.Prop()], r.prototype, "disabled", void 0), r = i([o.Component], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(173), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(94);
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.data = [{
                label: "开始限速时间",
                options: [{index: 0, type: "hour"}, {index: 1, type: "minute"}]
            }, {
                label: "结束限速时间",
                options: [{index: 2, type: "hour"}, {index: 3, type: "minute"}]
            }], this.hours = Array.from({length: 24}, (e, t) => t), this.minutes = Array.from({length: 60}, (e, t) => t)
        }

        handleInput(e, t) {
            let n = this.value.slice(0), i = Object.assign({}, n[t]);
            i.value = e, n[t] = i, this.$emit("input", n, this.item.name)
        }
    };
    i([a.Prop({})], r.prototype, "item", void 0), i([a.Prop()], r.prototype, "value", void 0), i([a.Prop()], r.prototype, "disabled", void 0), r = i([a.Component({components: {SelectNative: o.default}})], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(175), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(5);
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.userId = ""
        }

        get clas() {
            return void 0 !== this.classes ? this.classes : this.item.classes
        }

        get textContent() {
            return void 0 !== this.item.text ? this.item.text : this.text
        }

        mounted() {
            void 0 !== this.item.isReleventUser && this.item.isReleventUser && (o.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.userId = e
            }), o.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.userId = ""
            }))
        }
    };
    i([a.Prop({})], r.prototype, "item", void 0), i([a.Prop()], r.prototype, "classes", void 0), i([a.Prop()], r.prototype, "extIndex", void 0), i([a.Prop()], r.prototype, "text", void 0), r = i([a.Component({})], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(177), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(137), s = n(155), l = n(156), u = n(130), d = n(595), c = n(5), h = n(14);
    let f = class extends o.Vue {
        constructor() {
            super(...arguments), this.userId = ""
        }

        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }

        setUserId() {
            return a(this, void 0, void 0, function* () {
                let e = yield h.default("GetUserID");
                this.userId = e
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                void 0 !== this.item.isReleventUser && this.item.isReleventUser && (this.setUserId(), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    this.userId = e
                }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                    this.userId = ""
                }))
            })
        }
    };
    i([o.Prop({})], f.prototype, "item", void 0), i([o.Prop({})], f.prototype, "formData", void 0), i([o.Prop()], f.prototype, "value", void 0), f = i([o.Component({
        components: {
            confTip: r.default,
            confBtn: s.default,
            confInput: l.default,
            confSelect: u.default,
            confContainer: d.default
        }
    })], f), t.default = f
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(179), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(130);
    let r = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([a.Prop({})], r.prototype, "item", void 0), i([a.Prop({})], r.prototype, "formData", void 0), i([a.Prop()], r.prototype, "value", void 0), i([a.Prop()], r.prototype, "disabled", void 0), r = i([a.Component({components: {confSelect: o.default}})], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(181), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(137), r = n(156), s = n(157), l = n(130);
    let u = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([a.Prop({})], u.prototype, "item", void 0), i([a.Prop({})], u.prototype, "formData", void 0), u = i([a.Component({
        components: {
            confTip: o.default,
            confInput: r.default,
            confText: s.default,
            confSelect: l.default
        }
    })], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(183), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(137), r = n(157), s = n(130);
    let l = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([a.Prop({})], l.prototype, "item", void 0), i([a.Prop({})], l.prototype, "formData", void 0), l = i([a.Component({
        components: {
            confTip: o.default,
            confText: r.default,
            confSelect: s.default
        }
    })], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(185), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4);
    let o = class extends a.Vue {
        handleChange(e) {
            let t = e.target;
            this.$emit("input", t.value, this.item.name)
        }
    };
    i([a.Prop({})], o.prototype, "item", void 0), i([a.Prop({})], o.prototype, "formData", void 0), i([a.Prop()], o.prototype, "value", void 0), i([a.Prop()], o.prototype, "label", void 0), o = i([a.Component({components: {}})], o), t.default = o
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(187), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(154);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.maxDownloadSpeed = "", this.maxUploadSpeed = ""
        }

        onFormDataChange(e) {
            this.updateMaxDownloadSpeed(), this.updateMaxUploadSpeed()
        }

        standardNumber(e) {
            let t = parseInt(e + "", 10);
            return t > 9 ? t + "" : "0" + t
        }

        updateMaxDownloadSpeed() {
            return a(this, void 0, void 0, function* () {
                let e = "不限速";
                this.formData["ConfigNet-ConfigNet_Custom_DownloadSpeedChk"].value && (e = (yield r.ConfigHelperNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", 1024)) + "KB/S"), this.maxDownloadSpeed = e
            })
        }

        updateMaxUploadSpeed() {
            return a(this, void 0, void 0, function* () {
                let e = "不限速";
                this.formData["ConfigNet-ConfigNet_Custom_UploadSpeedChk"].value && (e = (yield r.ConfigHelperNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", 1024)) + "KB/S"), this.maxUploadSpeed = e
            })
        }
    };
    i([o.Prop({})], s.prototype, "item", void 0), i([o.Prop({})], s.prototype, "formData", void 0), i([o.Watch("formData", {
        immediate: !0,
        deep: !0
    })], s.prototype, "onFormDataChange", null), s = i([o.Component], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(189), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(154), s = n(33), l = n(28), u = n(235);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.selectedItem = null, this.proxyList = []
        }

        handleInput(e, t) {
            let n = this.value.slice(0), i = Object.assign({}, n[t]);
            i.value = e, n[t] = i, this.$emit("input", n, this.item.name)
        }

        handleAddProxyResult(e, t, n, i, a, o) {
            let r = !1, s = {name: e, host: t, port: n, type: i, userName: a, passWord: o};
            if (this.proxyList.length > 0) for (let t = 0; t < this.proxyList.length; ++t) if (this.proxyList[t].name === e) {
                r = !0;
                break
            }
            r || (this.proxyList.push(s), this.saveProxys())
        }

        handleAddProxy() {
            s.MessageBox.custom("AddProxy").then(e => {
                if (e.action === l.MessageBoxNS.Action.OK) {
                    let t = e.args.name, n = e.args.host, i = e.args.port, a = e.args.type, o = e.args.userName,
                        r = e.args.passWord;
                    this.handleAddProxyResult(t, n, i, a, o, r)
                }
            }).catch()
        }

        handleModifyProxy() {
            s.MessageBox.custom("AddProxy", this.selectedItem).then(e => a(this, void 0, void 0, function* () {
                if (e.action === l.MessageBoxNS.Action.OK) for (let t = 0; t < this.proxyList.length; ++t) if (this.proxyList[t].name === this.selectedItem.name) {
                    let n = this.selectedItem.name;
                    if (this.proxyList[t].name = e.args.name, this.proxyList[t].host = e.args.host, this.proxyList[t].port = e.args.port, this.proxyList[t].type = e.args.type, this.proxyList[t].userName = e.args.userName, this.proxyList[t].passWord = e.args.passWord, this.selectedItem = this.proxyList[t], this.saveProxys(), "2" === (yield r.ConfigHelperNS.getValue("ProxySetting", "ConfigProxy_Type", "0")) && (this.handleApplyProxy(), n === this.selectedItem.name)) {
                        let e = u.ProxyNS.ProxyType.Http;
                        "SOCKS5" === this.selectedItem.type && (e = u.ProxyNS.ProxyType.Sock5), u.ProxyNS.setProxy(e, this.selectedItem.host, this.selectedItem.port, this.selectedItem.userName, this.selectedItem.passWord)
                    }
                    break
                }
            })).catch()
        }

        handleDeleteProxy() {
            s.MessageBox.confirm({title: "您确定删除此代理吗？", type: s.MessageBox.ConfirmType.Warning}, {
                width: 400,
                height: 174,
                center: !0
            }).then(e => a(this, void 0, void 0, function* () {
                if (e.action === l.MessageBoxNS.Action.OK) for (let e = 0; e < this.proxyList.length; ++e) if (this.proxyList[e].name === this.selectedItem.name) {
                    let t = this.selectedItem.name;
                    this.proxyList.splice(e, 1), this.selectedItem = null, this.saveProxys();
                    let n = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Http", "直接连接");
                    t === n && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Http"), t === (n = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Hub", "直接连接")) && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Hub"), t === (n = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Ftp", "直接连接")) && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Ftp");
                    break
                }
            })).catch()
        }

        handleApplyProxy() {
            this.$emit("input", "2", "ProxySetting-ConfigProxy_Type"), this.$emit("input", this.selectedItem.name, "ProxySetting-ConnectType_Hub"), this.$emit("input", this.selectedItem.name, "ProxySetting-ConnectType_Http"), this.$emit("input", this.selectedItem.name, "ProxySetting-ConnectType_Ftp")
        }

        formatProxys() {
            let e = [];
            if (this.proxyList.length > 0) for (let t = 0; t < this.proxyList.length; ++t) {
                let n = this.proxyList[t].name;
                n = (n = (n = (n = (n = n + ";" + this.proxyList[t].host) + ";" + this.proxyList[t].port) + ";" + this.proxyList[t].type) + ";" + this.proxyList[t].userName) + ";" + this.proxyList[t].passWord, e.push(n)
            }
            return e
        }

        getProxyNames() {
            let e = ["直接连接"];
            if (this.proxyList.length > 0) for (let t = 0; t < this.proxyList.length; ++t) this.proxyList[t].name && this.proxyList[t].name.length > 0 && e.push(this.proxyList[t].name);
            return e
        }

        saveProxys() {
            r.ConfigHelperNS.setValue("ProxyList", "proxys", this.formatProxys()).catch(), r.ConfigHelperNS.setValue("ConnectType", "ProxyName", this.getProxyNames()).catch()
        }

        initProxys() {
            return a(this, void 0, void 0, function* () {
                let e = yield r.ConfigHelperNS.getValue("ProxyList", "proxys", []);
                if (e.length > 0) for (let t = 0; t < e.length; ++t) {
                    let n = e[t].split(";"), i = {};
                    i.name = n[0], i.host = n[1], i.type = n[3], i.userName = void 0 !== n[4] ? n[4] : "", i.passWord = void 0 !== n[5] ? n[5] : "", n[2] ? i.port = Number(n[2]) ? Number(n[2]) : 80 : i.port = 80, this.proxyList.push(i)
                }
            })
        }

        mounted() {
            this.initProxys().catch()
        }
    };
    i([o.Prop({})], d.prototype, "item", void 0), i([o.Prop()], d.prototype, "value", void 0), i([o.Prop()], d.prototype, "disabled", void 0), d = i([o.Component({components: {}})], d), t.default = d
}, , , , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(31), o = n(24), r = n(2), s = n(10), l = n(1).default.getLogger("Axios.Helper");
    !function (e) {
        e.getFileSizeWithUrlAW = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    let n = a.parse(e);
                    if ("https:" !== n.protocol && "http:" !== n.protocol) break;
                    let i = null;
                    try {
                        i = yield o.default.get(e, {responseType: "arraybuffer"})
                    } catch (e) {
                        l.warning(e)
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status) {
                        let e = i.headers["content-length"];
                        void 0 !== e && (t = parseInt(e, 10))
                    }
                } while (0);
                return t
            })
        }, e.downloadFileAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let i = null;
                    try {
                        i = yield o.default.get(e, {responseType: "arraybuffer"})
                    } catch (e) {
                        l.information(e);
                        break
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data && "" !== i.data) {
                        let e = r.dirname(t), a = yield s.FileSystemAWNS.mkdirsAW(e);
                        a && (a = yield s.FileSystemAWNS.writeFileAW(t, i.data)) && (n = !0)
                    }
                } while (0);
                return n
            })
        }
    }(t.AxiosNS || (t.AxiosNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(7), s = n(10), l = n(8), u = n(32), d = n(33), c = n(28), h = n(13), f = n(5),
        g = n(6), p = n(74), k = n(134), m = n(132), T = o.default.getLogger("Thunder.TaskOperator"),
        v = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")), C = u.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        function t(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (n, i) => {
                        T.verbose(n), i ? "sessionid" === e ? f.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (e, n) => {
                            T.verbose(e), t(n)
                        }) : "userid" === e && f.NativeCallModule.nativeCall.CallNativeFunction("GetUserID", (e, n) => {
                            T.verbose(e), t(n)
                        }) : t("")
                    })
                })
            })
        }

        function n(e) {
            let t = v.getInstallChannel();
            e = void 0 === e ? "" : e;
            let n = a.join(__rootDir, "../../Thunder.exe");
            return `xl_thunder_pc|${v.getFileVersion(n)}|${t}|${e}`
        }

        function o(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (g.isNullOrUndefined(e)) break;
                    let n = e.savePath, i = e.taskName;
                    void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1));
                    let o = a.join(n, i);
                    if (e.taskType === l.DownloadKernel.TaskType.P2sp || e.taskType === l.DownloadKernel.TaskType.Emule) ; else if (e.taskType === l.DownloadKernel.TaskType.Bt) {
                        let t = C.getTaskFromTaskId(e.taskId), n = t.getExtraObject(), i = n.getDownloadFile();
                        if (1 === i.length) {
                            if (yield m.SingleBtTaskNS.isSingleBtTask(t)) o = m.SingleBtTaskNS.getSinleBtTaskFilePath(t); else {
                                let e = n.getBtFileList();
                                for (let [, t]of e) {
                                    if (t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex) === i[0]) {
                                        let e = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FilePath),
                                            n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                                        o = a.join(o, e, n);
                                        break
                                    }
                                }
                            }
                        }
                    } else if (e.taskType === l.DownloadKernel.TaskType.Group) {
                        o = n;
                        let i = C.getTaskFromTaskId(e.taskId).getExtraObject(), r = i.getSubTaskCount();
                        for (let e = 0; e < r; ++e) {
                            let n = i.getSubTaskByIndex(e);
                            if (1 === n.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                                let e = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                                    i = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), o = a.join(e, i);
                                if (yield s.FileSystemAWNS.existsAW(o)) {
                                    t = !0;
                                    break
                                }
                            }
                        }
                        break
                    }
                    t = yield s.FileSystemAWNS.existsAW(o)
                } while (0);
                return t
            })
        }

        function r(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = e.taskStatus;
                    if (n === l.DownloadKernel.TaskStatus.StartPending || n === l.DownloadKernel.TaskStatus.StopPending || n === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let i = C.getTaskFromTaskId(e.taskId);
                    if (yield m.SingleBtTaskNS.isSingleBtTask(i)) {
                        let e = m.SingleBtTaskNS.getSinleBtTaskFilePath(i);
                        t = yield s.FileSystemAWNS.existsAW(e)
                    } else {
                        let n = e.savePath, i = e.taskName;
                        void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1));
                        let r = a.join(n, i), u = e.taskType;
                        if (u === l.DownloadKernel.TaskType.Bt) {
                            if ("" === i) {
                                t = yield s.FileSystemAWNS.existsAW(n);
                                break
                            }
                            t = yield s.FileSystemAWNS.existsAW(r)
                        } else u === l.DownloadKernel.TaskType.Group ? (t = yield s.FileSystemAWNS.existsAW(n)) && (t = yield o(e)) : t = yield s.FileSystemAWNS.existsAW(r)
                    }
                } while (0);
                return t
            })
        }

        e.getUsrInfoAw = t, e.getUserLoginInfo = function () {
            return i(this, void 0, void 0, function* () {
                let e = yield t("sessionid"), n = yield t("userid");
                return null === e || void 0 === e || "" === e ? "" : "/ssessionid " + e + " /suserid " + n
            })
        }, e.redownloadTask = function (e, t, a) {
            return i(this, void 0, void 0, function* () {
                if (void 0 === t) if (1 === e.length) {
                    let n = e[0].taskStatus;
                    t = n === l.DownloadKernel.TaskStatus.Succeeded || n === l.DownloadKernel.TaskStatus.Seeding ? yield r(e[0]) : n !== l.DownloadKernel.TaskStatus.Failed
                } else t = !0;
                let o = "mypc";
                if (-1 !== p.default.getCurrentCategoryId() && (o = "private"), t) {
                    let t = !1;
                    1 === e.length && e[0].taskType === l.DownloadKernel.TaskType.P2sp && (t = !0), d.MessageBox.confirm({
                        title: "重新下载会删除本地的文件，确定要重新下载吗？",
                        type: d.MessageBox.ConfirmType.Info,
                        checkboxEnabled: t,
                        checkboxChecked: !1,
                        checkboxLabel: "从原始地址重新下载"
                    }).then(t => i(this, void 0, void 0, function* () {
                        if (t.action === c.MessageBoxNS.Action.OK) {
                            if (void 0 !== a) {
                                let e = "";
                                e = void 0 !== t.checkboxChecked && t.checkboxChecked ? `panel_type=${o},button=origin` : `panel_type=${o},button=reload`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                            }
                            for (let i of e) {
                                let e = {
                                    taskBaseInfo: {
                                        savePath: void 0,
                                        taskName: void 0,
                                        productInfo: n(""),
                                        origin: "re_download"
                                    }, p2spTaskInfo: {url: void 0, useOriginResourceOnly: t.checkboxChecked ? 1 : 0}
                                }, a = yield C.reDownloadTask(i.taskId, e);
                                if (null !== a) {
                                    let e = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                                    k.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else if (void 0 !== a) {
                            let e = "";
                            e = t.action === c.MessageBoxNS.Action.Cancel ? `panel_type=${o},button=cancel` : `panel_type=${o},button=close`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                        }
                    })).catch()
                } else for (let t of e) {
                    if (void 0 !== a) {
                        let e = `panel_type=${o}`;
                        h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                    }
                    let e = {
                        taskBaseInfo: {
                            savePath: void 0,
                            taskName: void 0,
                            productInfo: n(""),
                            origin: "re_download"
                        }, p2spTaskInfo: {url: void 0, useOriginResourceOnly: 0}
                    }, i = yield C.reDownloadTask(t.taskId, e);
                    if (null !== i) {
                        let e = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        k.DownloadDispatchNS.startTask(e)
                    }
                }
            })
        }, e.constructProductInfo = n, e.isExistTaskFile = o, e.canOpenSelectedTaskFolder = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = e.taskStatus;
                    if (n === l.DownloadKernel.TaskStatus.StartPending || n === l.DownloadKernel.TaskStatus.StopPending || n === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let i = C.getTaskFromTaskId(e.taskId);
                    if (yield m.SingleBtTaskNS.isSingleBtTask(i)) t = yield s.FileSystemAWNS.existsAW(e.savePath); else {
                        let n = e.savePath, i = e.taskName, o = e.taskType, r = a.join(n, i);
                        if (o === l.DownloadKernel.TaskType.Bt) {
                            if ("" === i) {
                                t = yield s.FileSystemAWNS.existsAW(n);
                                break
                            }
                            t = yield s.FileSystemAWNS.existsAW(r)
                        } else l.DownloadKernel.TaskType.Group, t = yield s.FileSystemAWNS.existsAW(n)
                    }
                } while (0);
                return t
            })
        }, e.canOpenSelectedTaskFile = r, e.getBtExistFilePathList = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = [];
                do {
                    let o = a.join(e, t.title);
                    if (!(yield s.FileSystemAWNS.existsAW(o))) break;
                    let r = t.fileLists;
                    for (let e = 0; e < r.length; e++) {
                        let t = r[e];
                        if (-1 !== n.indexOf(t.realIndex)) {
                            let e = a.join(t.filePath, t.fileName), n = a.join(o, e);
                            (yield s.FileSystemAWNS.existsAW(n)) && i.push({
                                fullPath: n,
                                index: t.realIndex,
                                relativePath: e
                            })
                        }
                    }
                } while (0);
                return i
            })
        }, e.getSavePathByFileName = function (e, t) {
            let n = "";
            do {
                if (void 0 === e || null === e) break;
                let i = C.getTaskFromTaskId(e);
                i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Group && (n = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), n = a.join(n, t), T.information("getSavePathByFileName:", n, t))
            } while (0);
            return n
        }
    }(t.TaskCtrlOperatorNS || (t.TaskCtrlOperatorNS = {}))
}, function (e, t) {
    (function () {
        var t, n, i, a, o, r, s = [].slice, l = {}.hasOwnProperty;
        t = function () {
            var e, t, n, i, o, r;
            if (r = arguments[0], o = 2 <= arguments.length ? s.call(arguments, 1) : [], a(Object.assign)) Object.assign.apply(null, arguments); else for (e = 0, n = o.length; e < n; e++) if (null != (i = o[e])) for (t in i) l.call(i, t) && (r[t] = i[t]);
            return r
        }, a = function (e) {
            return !!e && "[object Function]" === Object.prototype.toString.call(e)
        }, o = function (e) {
            var t;
            return !!e && ("function" == (t = typeof e) || "object" === t)
        }, n = function (e) {
            return a(Array.isArray) ? Array.isArray(e) : "[object Array]" === Object.prototype.toString.call(e)
        }, i = function (e) {
            var t;
            if (n(e)) return !e.length;
            for (t in e) if (l.call(e, t)) return !1;
            return !0
        }, r = function (e) {
            var t, n;
            return o(e) && (n = Object.getPrototypeOf(e)) && (t = n.constructor) && "function" == typeof t && t instanceof t && Function.prototype.toString.call(t) === Function.prototype.toString.call(Object)
        }, e.exports.assign = t, e.exports.isFunction = a, e.exports.isObject = o, e.exports.isArray = n, e.exports.isEmpty = i, e.exports.isPlainObject = r
    }).call(this)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(803);
    t.quitPromises = new class {
        constructor() {
            this.promiseFuncArray = []
        }

        add(e) {
            this.promiseFuncArray.push(e)
        }

        run() {
            a.HistoryDataNS.setExitType("normal");
            let e = [];
            for (let t of this.promiseFuncArray) "function" == typeof t && e.push(t());
            Promise.all(e).then(() => {
                i.remote.app.quit()
            }).catch(() => {
                i.remote.app.quit()
            })
        }
    }
}, , function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(89), a = n.n(i), o = n(46), r = n.n(o), s = /%[sdj%]/g, l = function () {
    };

    function u() {
        for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
        var i = 1, a = t[0], o = t.length;
        if ("function" == typeof a) return a.apply(null, t.slice(1));
        if ("string" == typeof a) {
            for (var r = String(a).replace(s, function (e) {
                if ("%%" === e) return "%";
                if (i >= o) return e;
                switch (e) {
                    case"%s":
                        return String(t[i++]);
                    case"%d":
                        return Number(t[i++]);
                    case"%j":
                        try {
                            return JSON.stringify(t[i++])
                        } catch (e) {
                            return "[Circular]"
                        }
                        break;
                    default:
                        return e
                }
            }), l = t[i]; i < o; l = t[++i]) r += " " + l;
            return r
        }
        return a
    }

    function d(e, t) {
        return void 0 === e || null === e || (!("array" !== t || !Array.isArray(e) || e.length) || !(!function (e) {
            return "string" === e || "url" === e || "hex" === e || "email" === e || "pattern" === e
        }(t) || "string" != typeof e || e))
    }

    function c(e, t, n) {
        var i = 0, a = e.length;
        !function o(r) {
            if (r && r.length) n(r); else {
                var s = i;
                i += 1, s < a ? t(e[s], o) : n([])
            }
        }([])
    }

    function h(e, t, n, i) {
        if (t.first) return c(function (e) {
            var t = [];
            return Object.keys(e).forEach(function (n) {
                t.push.apply(t, e[n])
            }), t
        }(e), n, i);
        var a = t.firstFields || [];
        !0 === a && (a = Object.keys(e));
        var o = Object.keys(e), r = o.length, s = 0, l = [], u = function (e) {
            l.push.apply(l, e), ++s === r && i(l)
        };
        o.forEach(function (t) {
            var i = e[t];
            -1 !== a.indexOf(t) ? c(i, n, u) : function (e, t, n) {
                var i = [], a = 0, o = e.length;

                function r(e) {
                    i.push.apply(i, e), ++a === o && n(i)
                }

                e.forEach(function (e) {
                    t(e, r)
                })
            }(i, n, u)
        })
    }

    function f(e) {
        return function (t) {
            return t && t.message ? (t.field = t.field || e.fullField, t) : {message: t, field: t.field || e.fullField}
        }
    }

    function g(e, t) {
        if (t) for (var n in t) if (t.hasOwnProperty(n)) {
            var i = t[n];
            "object" === (void 0 === i ? "undefined" : r()(i)) && "object" === r()(e[n]) ? e[n] = a()({}, e[n], i) : e[n] = i
        }
        return e
    }

    var p = function (e, t, n, i, a, o) {
        !e.required || n.hasOwnProperty(e.field) && !d(t, o || e.type) || i.push(u(a.messages.required, e.fullField))
    };
    var k = function (e, t, n, i, a) {
        (/^\s+$/.test(t) || "" === t) && i.push(u(a.messages.whitespace, e.fullField))
    }, m = {
        email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
        url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
        hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
    }, T = {
        integer: function (e) {
            return T.number(e) && parseInt(e, 10) === e
        }, float: function (e) {
            return T.number(e) && !T.integer(e)
        }, array: function (e) {
            return Array.isArray(e)
        }, regexp: function (e) {
            if (e instanceof RegExp) return !0;
            try {
                return !!new RegExp(e)
            } catch (e) {
                return !1
            }
        }, date: function (e) {
            return "function" == typeof e.getTime && "function" == typeof e.getMonth && "function" == typeof e.getYear
        }, number: function (e) {
            return !isNaN(e) && "number" == typeof e
        }, object: function (e) {
            return "object" === (void 0 === e ? "undefined" : r()(e)) && !T.array(e)
        }, method: function (e) {
            return "function" == typeof e
        }, email: function (e) {
            return "string" == typeof e && !!e.match(m.email) && e.length < 255
        }, url: function (e) {
            return "string" == typeof e && !!e.match(m.url)
        }, hex: function (e) {
            return "string" == typeof e && !!e.match(m.hex)
        }
    };
    var v = "enum";
    var C = {
        required: p, whitespace: k, type: function (e, t, n, i, a) {
            if (e.required && void 0 === t) p(e, t, n, i, a); else {
                var o = e.type;
                ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"].indexOf(o) > -1 ? T[o](t) || i.push(u(a.messages.types[o], e.fullField, e.type)) : o && (void 0 === t ? "undefined" : r()(t)) !== e.type && i.push(u(a.messages.types[o], e.fullField, e.type))
            }
        }, range: function (e, t, n, i, a) {
            var o = "number" == typeof e.len, r = "number" == typeof e.min, s = "number" == typeof e.max, l = t,
                d = null, c = "number" == typeof t, h = "string" == typeof t, f = Array.isArray(t);
            if (c ? d = "number" : h ? d = "string" : f && (d = "array"), !d) return !1;
            f && (l = t.length), h && (l = t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length), o ? l !== e.len && i.push(u(a.messages[d].len, e.fullField, e.len)) : r && !s && l < e.min ? i.push(u(a.messages[d].min, e.fullField, e.min)) : s && !r && l > e.max ? i.push(u(a.messages[d].max, e.fullField, e.max)) : r && s && (l < e.min || l > e.max) && i.push(u(a.messages[d].range, e.fullField, e.min, e.max))
        }, enum: function (e, t, n, i, a) {
            e[v] = Array.isArray(e[v]) ? e[v] : [], -1 === e[v].indexOf(t) && i.push(u(a.messages[v], e.fullField, e[v].join(", ")))
        }, pattern: function (e, t, n, i, a) {
            e.pattern && (e.pattern instanceof RegExp ? (e.pattern.lastIndex = 0, e.pattern.test(t) || i.push(u(a.messages.pattern.mismatch, e.fullField, t, e.pattern))) : "string" == typeof e.pattern && (new RegExp(e.pattern).test(t) || i.push(u(a.messages.pattern.mismatch, e.fullField, t, e.pattern))))
        }
    };
    var S = "enum";
    var y = function (e, t, n, i, a) {
        var o = e.type, r = [];
        if (e.required || !e.required && i.hasOwnProperty(e.field)) {
            if (d(t, o) && !e.required) return n();
            C.required(e, t, i, r, a, o), d(t, o) || C.type(e, t, i, r, a)
        }
        n(r)
    }, w = {
        string: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t, "string") && !e.required) return n();
                C.required(e, t, i, o, a, "string"), d(t, "string") || (C.type(e, t, i, o, a), C.range(e, t, i, o, a), C.pattern(e, t, i, o, a), !0 === e.whitespace && C.whitespace(e, t, i, o, a))
            }
            n(o)
        }, method: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), void 0 !== t && C.type(e, t, i, o, a)
            }
            n(o)
        }, number: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), void 0 !== t && (C.type(e, t, i, o, a), C.range(e, t, i, o, a))
            }
            n(o)
        }, boolean: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), void 0 !== t && C.type(e, t, i, o, a)
            }
            n(o)
        }, regexp: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), d(t) || C.type(e, t, i, o, a)
            }
            n(o)
        }, integer: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), void 0 !== t && (C.type(e, t, i, o, a), C.range(e, t, i, o, a))
            }
            n(o)
        }, float: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), void 0 !== t && (C.type(e, t, i, o, a), C.range(e, t, i, o, a))
            }
            n(o)
        }, array: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t, "array") && !e.required) return n();
                C.required(e, t, i, o, a, "array"), d(t, "array") || (C.type(e, t, i, o, a), C.range(e, t, i, o, a))
            }
            n(o)
        }, object: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), void 0 !== t && C.type(e, t, i, o, a)
            }
            n(o)
        }, enum: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                C.required(e, t, i, o, a), t && C[S](e, t, i, o, a)
            }
            n(o)
        }, pattern: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t, "string") && !e.required) return n();
                C.required(e, t, i, o, a), d(t, "string") || C.pattern(e, t, i, o, a)
            }
            n(o)
        }, date: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                if (C.required(e, t, i, o, a), !d(t)) {
                    var r = void 0;
                    r = "number" == typeof t ? new Date(t) : t, C.type(e, r, i, o, a), r && C.range(e, r.getTime(), i, o, a)
                }
            }
            n(o)
        }, url: y, hex: y, email: y, required: function (e, t, n, i, a) {
            var o = [], s = Array.isArray(t) ? "array" : void 0 === t ? "undefined" : r()(t);
            C.required(e, t, i, o, a, s), n(o)
        }
    };

    function I() {
        return {
            default: "Validation error on field %s",
            required: "%s is required",
            enum: "%s must be one of %s",
            whitespace: "%s cannot be empty",
            date: {
                format: "%s date %s is invalid for format %s",
                parse: "%s date could not be parsed, %s is invalid ",
                invalid: "%s date %s is invalid"
            },
            types: {
                string: "%s is not a %s",
                method: "%s is not a %s (function)",
                array: "%s is not an %s",
                object: "%s is not an %s",
                number: "%s is not a %s",
                date: "%s is not a %s",
                boolean: "%s is not a %s",
                integer: "%s is not an %s",
                float: "%s is not a %s",
                regexp: "%s is not a valid %s",
                email: "%s is not a valid %s",
                url: "%s is not a valid %s",
                hex: "%s is not a valid %s"
            },
            string: {
                len: "%s must be exactly %s characters",
                min: "%s must be at least %s characters",
                max: "%s cannot be longer than %s characters",
                range: "%s must be between %s and %s characters"
            },
            number: {
                len: "%s must equal %s",
                min: "%s cannot be less than %s",
                max: "%s cannot be greater than %s",
                range: "%s must be between %s and %s"
            },
            array: {
                len: "%s must be exactly %s in length",
                min: "%s cannot be less than %s in length",
                max: "%s cannot be greater than %s in length",
                range: "%s must be between %s and %s in length"
            },
            pattern: {mismatch: "%s value %s does not match pattern %s"},
            clone: function () {
                var e = JSON.parse(JSON.stringify(this));
                return e.clone = this.clone, e
            }
        }
    }

    var b = I();

    function A(e) {
        this.rules = null, this._messages = b, this.define(e)
    }

    A.prototype = {
        messages: function (e) {
            return e && (this._messages = g(I(), e)), this._messages
        }, define: function (e) {
            if (!e) throw new Error("Cannot configure a schema with no rules");
            if ("object" !== (void 0 === e ? "undefined" : r()(e)) || Array.isArray(e)) throw new Error("Rules must be an object");
            this.rules = {};
            var t = void 0, n = void 0;
            for (t in e) e.hasOwnProperty(t) && (n = e[t], this.rules[t] = Array.isArray(n) ? n : [n])
        }, validate: function (e) {
            var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = arguments[2],
                o = e, s = n, d = i;
            if ("function" == typeof s && (d = s, s = {}), this.rules && 0 !== Object.keys(this.rules).length) {
                if (s.messages) {
                    var c = this.messages();
                    c === b && (c = I()), g(c, s.messages), s.messages = c
                } else s.messages = this.messages();
                var p = void 0, k = void 0, m = {};
                (s.keys || Object.keys(this.rules)).forEach(function (n) {
                    p = t.rules[n], k = o[n], p.forEach(function (i) {
                        var r = i;
                        "function" == typeof r.transform && (o === e && (o = a()({}, o)), k = o[n] = r.transform(k)), (r = "function" == typeof r ? {validator: r} : a()({}, r)).validator = t.getValidationMethod(r), r.field = n, r.fullField = r.fullField || n, r.type = t.getType(r), r.validator && (m[n] = m[n] || [], m[n].push({
                            rule: r,
                            value: k,
                            source: o,
                            field: n
                        }))
                    })
                });
                var T = {};
                h(m, s, function (e, t) {
                    var n = e.rule,
                        i = !("object" !== n.type && "array" !== n.type || "object" !== r()(n.fields) && "object" !== r()(n.defaultField));

                    function o(e, t) {
                        return a()({}, t, {fullField: n.fullField + "." + e})
                    }

                    function d() {
                        var r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
                        if (Array.isArray(r) || (r = [r]), r.length && l("async-validator:", r), r.length && n.message && (r = [].concat(n.message)), r = r.map(f(n)), s.first && r.length) return T[n.field] = 1, t(r);
                        if (i) {
                            if (n.required && !e.value) return r = n.message ? [].concat(n.message).map(f(n)) : s.error ? [s.error(n, u(s.messages.required, n.field))] : [], t(r);
                            var d = {};
                            if (n.defaultField) for (var c in e.value) e.value.hasOwnProperty(c) && (d[c] = n.defaultField);
                            for (var h in d = a()({}, d, e.rule.fields)) if (d.hasOwnProperty(h)) {
                                var g = Array.isArray(d[h]) ? d[h] : [d[h]];
                                d[h] = g.map(o.bind(null, h))
                            }
                            var p = new A(d);
                            p.messages(s.messages), e.rule.options && (e.rule.options.messages = s.messages, e.rule.options.error = s.error), p.validate(e.value, e.rule.options || s, function (e) {
                                t(e && e.length ? r.concat(e) : e)
                            })
                        } else t(r)
                    }

                    i = i && (n.required || !n.required && e.value), n.field = e.field;
                    var c = n.validator(n, e.value, d, e.source, s);
                    c && c.then && c.then(function () {
                        return d()
                    }, function (e) {
                        return d(e)
                    })
                }, function (e) {
                    !function (e) {
                        var t, n = void 0, i = void 0, a = [], o = {};
                        for (n = 0; n < e.length; n++) t = e[n], Array.isArray(t) ? a = a.concat.apply(a, t) : a.push(t);
                        if (a.length) for (n = 0; n < a.length; n++) o[i = a[n].field] = o[i] || [], o[i].push(a[n]); else a = null, o = null;
                        d(a, o)
                    }(e)
                })
            } else d && d()
        }, getType: function (e) {
            if (void 0 === e.type && e.pattern instanceof RegExp && (e.type = "pattern"), "function" != typeof e.validator && e.type && !w.hasOwnProperty(e.type)) throw new Error(u("Unknown rule type %s", e.type));
            return e.type || "string"
        }, getValidationMethod: function (e) {
            if ("function" == typeof e.validator) return e.validator;
            var t = Object.keys(e), n = t.indexOf("message");
            return -1 !== n && t.splice(n, 1), 1 === t.length && "required" === t[0] ? w.required : w[this.getType(e)] || !1
        }
    }, A.register = function (e, t) {
        if ("function" != typeof t) throw new Error("Cannot register a validator by type, validator is not a function");
        w[e] = t
    }, A.messages = b;
    t.default = A
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(149), a = n(55), o = n(29), r = n(38), s = n(1).default.getLogger("Thunder.shub-http.shub-crypto");
    !function (e) {
        function t(e) {
            let t = o.createHash("md5");
            return t.update(e), t.digest()
        }

        e.encryptHttpBuffer = function (e) {
            if (0 !== e.readUInt16LE(16)) {
                let t = i.Buffer.alloc(20);
                e.copy(t, 0, 0, 20);
                let n = i.Buffer.alloc(e.length - 20);
                e.copy(n, 0, 20);
                let o = a.deflateSync(n);
                e = i.Buffer.concat([t, o])
            }
            let n = i.Buffer.alloc(8);
            e.copy(n, 0, 0, 7), n = t(n);
            let o = i.Buffer.alloc(12);
            e.copy(o, 0, 0, 11);
            let s = i.Buffer.alloc(e.length - 12);
            e.copy(s, 0, 12), s = r.ToolsUtilitiesAWNS.encryptBuffer(s, n);
            let l = i.Buffer.concat([o, s]);
            return l.writeUInt32LE(s.length, 8), l
        }, e.decryptHttpBuffer = function (e) {
            let n = null;
            try {
                let o = i.Buffer.alloc(8);
                e.copy(o, 0, 0, 7), o = t(o);
                let l = i.Buffer.alloc(12);
                e.copy(l, 0, 0, 11);
                let u = i.Buffer.alloc(e.length - 12);
                if (e.copy(u, 0, 12), u = r.ToolsUtilitiesAWNS.decryptBuffer(u, o), 0 !== (n = i.Buffer.concat([l, u])).readUInt16LE(16)) {
                    let e = i.Buffer.alloc(20);
                    n.copy(e, 0, 0, 20);
                    let t = i.Buffer.alloc(n.length - 20);
                    n.copy(t, 0, 20);
                    let o = a.inflateSync(t);
                    n = i.Buffer.concat([e, o])
                }
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return n
        }
    }(t.ShubCryptoNS || (t.ShubCryptoNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(7).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.writeUInt64LE = function (e, t, n) {
            const i = ~~(t / 4294967295), a = t % 4294967295 - i;
            return n = e.writeUInt32LE(a, n), n = e.writeUInt32LE(i, n)
        }, e.writeString = function (e, t, n, i) {
            let o = null;
            if ("gbk" === i) {
                let e = 936, n = a.utf8StringEncodeToBinary(t, e);
                o = Buffer.from(n, "binary")
            } else o = Buffer.from(t, i);
            return (n = e.writeUInt32LE(o.byteLength, n)) + o.copy(e, n, 0)
        }, e.readUInt64LE = function (e, t) {
            let n = e.readUInt32LE(t);
            t += 4;
            let i = e.readUInt32LE(t);
            return [t += 4, i * Math.pow(2, 32) + n]
        }, e.readString = function (e, t, n) {
            let i = e.readUInt32LE(t);
            t += 4;
            let o = void 0;
            if ("gbk" === n) {
                let n = 936, r = e.toString("binary", t, t + i);
                o = a.utf8StringDecodeFromBinary(r, n)
            } else o = e.toString(n, t, t + i);
            return [t += i, o]
        }
    }(t.BufferUtilitiesNS || (t.BufferUtilitiesNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(7).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.uncompressZipFile = function (e, t) {
            return i(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.asyncUnZipFile(t, e, e => {
                        n(e)
                    })
                })
            })
        }
    }(t.UnzipUtilitiesAWNS || (t.UnzipUtilitiesAWNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(72), r = n(10), s = n(822), l = n(823),
        u = n(1).default.getLogger("Thunder.VipDownload.config");
    var d;
    !function (e) {
        e.configGet = "OnConfigGet"
    }(d = t.ConfigEventNS || (t.ConfigEventNS = {}));

    class c extends o.default {
        constructor() {
            super(...arguments), this.mSavePath = void 0, this.mConfig = new l.Config
        }

        init() {
            return i(this, void 0, void 0, function* () {
                this.setMaxListeners(0), this.config.init();
                let e = yield this.downloadConfig();
                e && (e = yield this.config.loadFile(this.savePath)), u.information("config init", "result", e), this.config.printConfigData(), this.fireEvent(d.configGet), yield r.FileSystemAWNS.unlinkAW(this.savePath)
            })
        }

        getValue(e, t) {
            return this.config.getValue(e, t)
        }

        downloadConfig() {
            return i(this, void 0, void 0, function* () {
                let e = yield r.FileSystemAWNS.existsAW(this.saveDir);
                return e || (e = yield r.FileSystemAWNS.mkdirsAW(this.saveDir)), e && (e = yield s.FileDownloadNS.downloadFile("http://media.info.client.xunlei.com/VipDownloadConfig.json", this.savePath)), e
            })
        }

        get config() {
            return this.mConfig
        }

        get savePath() {
            return this.mSavePath || (this.mSavePath = a.join(this.saveDir, "config.json")), this.mSavePath
        }

        get saveDir() {
            return a.join(__profilesDir, "VipDownload/")
        }
    }

    t.ConfigHelper = c, function (e) {
        const t = new c;
        e.getHelper = function () {
            return t
        }
    }(t.ConfigHelperNS || (t.ConfigHelperNS = {}))
}, , , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)(this.item.type, {
            tag: "component",
            attrs: {item: this.item, label: this.item.label, formData: this.formData, value: this.value},
            on: {input: this.handleInput}
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            class: e.item.outerClass,
            style: e.item.style
        }, ["" !== e.label ? n("span", [e._v(e._s(e.label))]) : e._e(), e._v(" "), n("td-tooltip", {
            attrs: {
                content: e.tipContent,
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [n("select-native", {
            class: e.classes || e.item.classes,
            attrs: {
                value: e.valueData,
                options: e.optionList || e.item.option,
                placeholder: e.placeHolder || e.formData[e.item.name].value + "",
                editable: e.item.editable,
                type: e.item.selectType,
                disabled: e.disabled
            },
            on: {input: e.validate, blur: e.handleOutFocus, "choose-file": e.selectPath}
        })], 1)], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            class: e.item.outClasses,
            style: e.item.style
        }, [n("td-tooltip", {
            attrs: {
                content: e.item.toolTipsContent || "",
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [n("td-input", {
            ref: "input",
            class: e.item.classes,
            attrs: {
                label: e.label || e.item.label,
                value: e.valueData,
                placeholder: e.item.placeholder,
                disabled: e.disabled
            },
            on: {
                input: e.validate,
                change: e.handleChange,
                keydown: e.handleKeyDown,
                keyup: e.handleKeyup,
                blur: e.outFocus
            }
        })], 1), e._v(" "), e._l(e.item.extEles, function (t) {
            return [n(t.type, {
                key: t.name,
                tag: "component",
                attrs: {
                    item: t,
                    classes: t.classes,
                    text: t.text,
                    formData: e.formData,
                    disabled: e.disabled || !e.formData[e.item.name].value,
                    value: e.formData[t.name]
                },
                on: {input: e.handleInput}
            })]
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {class: this.item.outerClass}, [t("label", {staticClass: "td-textarea"}, [t("textarea", {
            staticClass: "td-textarea__inner",
            class: this.item.classes,
            attrs: {placeholder: this.item.placeholder},
            domProps: {value: this.formData[this.item.name].value},
            on: {change: this.handleChange}
        })])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t) {
            return [n(t.type, {
                key: t.name,
                tag: "component",
                attrs: {
                    item: t,
                    classes: t.classes,
                    text: t.text,
                    formData: e.formData,
                    name: t.name,
                    disabled: !e.formData[e.item.name].value,
                    value: e.formData[t.name]
                },
                on: {input: e.handleInput}
            })]
        }), e._v(" "), e.item.tip ? n("p", {class: e.item.tipClass}, [e._v("\n    " + e._s(e.item.tip) + "\n  ")]) : e._e()], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement;
        return (e._self._c || t)("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
            }], class: e.clas, style: e.item.style || ""
        }, [e._v("\n   " + e._s(e.textContent) + "\n ")])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("ul", {class: e.item.ulClasses}, e._l(e.item.option, function (t, i) {
            return n("li", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                    expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
                }], key: i, class: e.item.classes
            }, [n("td-radio", {
                attrs: {
                    name: e.item.key,
                    value: "" + e.formData[e.item.name].value,
                    label: t,
                    disabled: e.item.disableds && e.item.disableds[i]
                }, on: {input: e.handleInput}
            }, [e._v(e._s(e.item.labels[i] || e.lable))]), e._v(" "), e.item.extEles ? n(e.item.extEles[i].type, {
                tag: "component",
                attrs: {
                    text: e.item.extEles[i].text,
                    item: e.item.extEles[i],
                    label: e.item.extEles[i] && e.item.extEles[i].label,
                    classes: e.item.extEles[i].classes,
                    disabled: e.formData[e.item.name].value !== e.item.extActiveValue,
                    name: e.item.extEles[i].name,
                    value: e.formData[e.item.extEles[i].name],
                    formData: e.formData
                },
                on: {input: e.handleInput}
            }) : e._e()], 1)
        })), e._v(" "), e.item.tip ? n("p", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("td-button", {
            class: e.classes || e.item.classes,
            style: e.item.style || "",
            attrs: {disabled: e.disabled || e.item.bindName && !e.formData[e.item.bindName].value},
            on: {click: e.popDialog}
        }, [e._v(e._s(e.text || e.item.text))]), e._v(" "), e._l(e.item.extEles, function (e) {
            return [n(e.type, {
                key: e.name,
                tag: "component",
                style: e.style || "",
                attrs: {item: e, classes: e.classes, text: e.text}
            })]
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", [n("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t, i) {
            return e.item.extEles ? n(t.type, {
                key: i,
                tag: "component",
                attrs: {
                    formData: e.formData,
                    placeHolder: e.formData[t.name] && e.formData[t.name].value,
                    item: t,
                    value: e.formData[t.name],
                    disabled: !(e.formData[e.item.name] && e.formData[e.item.name].value),
                    name: t.name,
                    label: t.label,
                    classes: t.classes,
                    text: t.text
                },
                on: {input: e.handleInput}
            }) : e._e()
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.classes}, [n("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t, i) {
            return e.item.extEles ? n(t.type, {
                key: i,
                tag: "component",
                attrs: {
                    formData: e.formData,
                    item: t,
                    placeHolder: e.formData[t.name] && e.formData[t.name].value,
                    disabled: !e.formData[e.item.name].value
                },
                on: {input: e.handleInput}
            }) : e._e()
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.classes}, [n("p", [e._v("\n    限速时间段：\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_Begin_Hour"].value)) + ":\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_Begin_Minute"].value)) + "-" + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_End_Hour"].value)) + ":\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_End_Minute"].value)) + "\n  ")]), e._v(" "), n("p", [e._v("\n    最大下载速度: " + e._s(e.maxDownloadSpeed) + "   \n    最大上传速度: " + e._s(e.maxUploadSpeed))])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-setting-content__part"}, [n("p", {staticClass: "xlx-setting-content__text"}, [e._v("代理管理")]), e._v(" "), n("div", {staticClass: "td-table td-table--border"}, [e._m(0), e._v(" "), n("div", {staticClass: "td-table__body-wrapper"}, [n("table", {staticClass: "td-table__body"}, [e._m(1), e._v(" "), n("tbody", e._l(e.proxyList, function (t, i) {
            return t.name && t.name.length > 0 ? n("tr", {
                key: i,
                class: {"is-chosen": t === e.selectedItem},
                on: {
                    click: function (n) {
                        e.selectedItem = t
                    }
                }
            }, [n("td", [n("p", {staticClass: "td-table__text"}, [e._v(e._s(t.name))])]), e._v(" "), n("td", [n("p", {staticClass: "td-table__text"}, [e._v(e._s(t.host))])]), e._v(" "), n("td", [n("p", {staticClass: "td-table__text"}, [e._v(e._s(t.port))])]), e._v(" "), n("td", [n("p", {staticClass: "td-table__text"}, [e._v(e._s(t.type))])])]) : e._e()
        }))])])]), e._v(" "), n("div", {staticClass: "xlx-setting-content__button"}, [n("a", {
            staticClass: "td-button td-button--small",
            attrs: {href: "javascript:;"},
            on: {click: e.handleAddProxy}
        }, [e._v("添加")]), e._v(" "), n("a", {
            staticClass: "td-button td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleModifyProxy}
        }, [e._v("修改")]), e._v(" "), n("a", {
            staticClass: "td-button td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleDeleteProxy}
        }, [e._v("删除")]), e._v(" "), n("a", {
            staticClass: "td-button td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleApplyProxy}
        }, [e._v("应用代理")])])])
    }, a = [function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "td-table__header-wrapper"}, [n("table", {staticClass: "td-table__header"}, [n("colgroup", [n("col", {staticClass: "xlx-setting__column-1"}), e._v(" "), n("col", {staticClass: "xlx-setting__column-2"}), e._v(" "), n("col", {staticClass: "xlx-setting__column-3"}), e._v(" "), n("col")]), e._v(" "), n("thead", [n("tr", [n("th", [n("p", {staticClass: "td-table__text"}, [e._v("名称")])]), e._v(" "), n("th", [n("p", {staticClass: "td-table__text"}, [e._v("服务器")])]), e._v(" "), n("th", [n("p", {staticClass: "td-table__text"}, [e._v("端口")])]), e._v(" "), n("th", [n("p", {staticClass: "td-table__text"}, [e._v("类型")])])])])])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("colgroup", [t("col", {staticClass: "xlx-setting__column-1"}), this._v(" "), t("col", {staticClass: "xlx-setting__column-2"}), this._v(" "), t("col", {staticClass: "xlx-setting__column-3"}), this._v(" "), t("col")])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-dialog-setting__speed-time"}, [n("ul", e._l(e.data, function (t) {
            return n("li", {
                key: t.label,
                staticClass: "xlx-dialog-setting__item"
            }, [n("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s(t.label))]), e._v(" "), e._l(t.options, function (t) {
                return n("div", {
                    key: t.index,
                    staticClass: "xlx-dialog-setting__option"
                }, [n("select-native", {
                    staticClass: "xlx-select-size-1",
                    attrs: {
                        value: e.value[t.index].value.toString(),
                        options: "hour" === t.type ? e.hours : e.minutes,
                        disabled: e.disabled
                    },
                    on: {
                        input: function (n) {
                            return e.handleInput(n, t.index)
                        }
                    }
                }), e._v(" "), n("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s("hour" === t.type ? "时" : "分"))])], 1)
            })], 2)
        }))])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("ul", {class: e.item.ulClasses}, e._l(e.item.extEles, function (t, i) {
            return n("li", {key: i, class: e.item.classes}, [t ? n(t.type, {
                tag: "component",
                attrs: {
                    text: t.text,
                    item: t,
                    label: t && t.label,
                    classes: t.classes,
                    disabled: e.disabled,
                    name: t.name,
                    value: e.formData[t.name],
                    formData: e.formData
                },
                on: {input: e.handleInput}
            }) : e._e()], 1)
        })), e._v(" "), e.item.tip ? n("p", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)("i", {class: this.classes, attrs: {title: this.text}})
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("td-slider", {
            attrs: {
                value: e.sliderValue,
                marks: e.item.marks,
                scales: e.item.scales,
                disabled: e.disabled
            }, on: {input: e.handleSliderUpdate}
        }), e._v(" "), n("div", {staticClass: "xlx-dialog-setting__speed-input"}, [n("td-input", {
            ref: "input",
            staticClass: "xlx-setting__input-3",
            attrs: {value: e.value.value, disabled: e.disabled},
            on: {input: e.handleInput, blur: e.handleBlur}
        }), e._v(" "), n("popup", {
            ref: "tooltip",
            staticClass: "td-tooltip",
            attrs: {direction: "top", display: e.tooltipVisible, padding: 10},
            on: {
                "update:display": function (t) {
                    e.tooltipVisible = t
                }
            }
        }, [n("p", {staticClass: "td-tooltip__inner"}, [e._v(e._s(e.tooltip))])]), e._v(" "), n("span", {staticClass: "xlx-setting__text"}, [e._v("KB/s")])], 1)], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(8), o = n(73), r = n(32), s = n(83), l = n(10), u = r.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        e.batchFindTaskAW = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = [];
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n], o = null;
                    i.taskType === a.DownloadKernel.TaskType.P2sp ? o = {
                        keyType: a.DownloadKernel.KeyType.P2spUrl,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : i.taskType === a.DownloadKernel.TaskType.Emule ? o = {
                        keyType: a.DownloadKernel.KeyType.EmuleFileHash,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : i.taskType === a.DownloadKernel.TaskType.Bt ? o = {
                        keyType: a.DownloadKernel.KeyType.BtInfoId,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : i.taskType === a.DownloadKernel.TaskType.Magnet && (o = {
                        keyType: a.DownloadKernel.KeyType.MagnetUrl,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    }), o && t.push(o)
                }
                return u.batchFindTaskAsync(t)
            })
        }, e.importUnfinishedTaskAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.DownloadKernelManager.importUnfinishedTask(e, t, (e, t, i) => {
                        n({ret: e, url: t, torrentPath: i})
                    })
                })
            })
        }, e.parserBtFileInfoAW = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    (yield l.FileSystemAWNS.existsAW(e)) ? s.ThunderKernel.parserBtFileInfo(e, (e, n) => {
                        t(0 === e && n ? n : null)
                    }) : t(null)
                }))
            })
        }
    }(t.TaskUtilitiesAWNS || (t.TaskUtilitiesAWNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Commit = 0] = "Commit", e[e.Token = 1] = "Token", e[e.Acclerate = 2] = "Acclerate"
        }(t = e.ErrorStep || (e.ErrorStep = {}))
    }(t.HttpDefineNS || (t.HttpDefineNS = {})), function (e) {
        let t = new Map;
        e.getMessage = function (e) {
            return t.get(e)
        }, e.errorOk = 0, t.set(e.errorOk, "成功"), e.errorConnect = -1, t.set(e.errorConnect, "服务器响应超时"), e.errorStatusCode = -2, t.set(e.errorStatusCode, "服务器响应超时"), e.errorData = -3, t.set(e.errorData, "服务器响应超时"), e.errorPrase = -4, t.set(e.errorPrase, "服务器响应超时")
    }(t.HttpErrorNS || (t.HttpErrorNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(21), o = n(2), r = i.remote.require(o.join(__rootDir, "../bin/ThunderHelper.node")), s = 2,
        l = 2, u = 2;
    t.browserSupport = new class {
        constructor() {
            this.browserComponent = void 0, this.browserManager = void 0, this.dpiAwareSupport = !1, this.systemDpiFactor = 0, this.browserParentWndHandle = 0, this.d3dHwnd = 0, this.browserParentWnd = void 0
        }
    };
    let d = n(3).remote.getCurrentWindow();

    function c() {
        let e = 1;
        return e = t.browserSupport.dpiAwareSupport ? r.getMonitorDPIFactor(t.browserSupport.browserParentWndHandle) : t.browserSupport.systemDpiFactor
    }

    function h() {
        return window.document.querySelector(".xlx-client__header").getBoundingClientRect().height
    }

    d.on("ready-to-show", () => {
        do {
            r.setDllDirectory(o.join(__rootDir, "../bin/TBC"));
            const e = i.remote.require(o.join(__rootDir, "../bin/ThunderBrowserSupport.node"));
            let n = r.getPeerID(), s = o.join(__rootDir, "../../Thunder.exe"), l = r.getFileVersion(s),
                u = e.TsBrowserComponent(), c = u.getUserAgent();
            if (n = n || "", l = l || "", c = c || "", !0 !== u.init({
                dataPath: o.join(__rootDir, "../bin/TBC/Data"),
                userAgent: c + " Thunder/" + l,
                enableSandbox: !1,
                productVersion: l,
                peerId: n
            })) break;
            t.browserSupport.browserComponent = u;
            let h = e.TsBrowserManager();
            t.browserSupport.browserManager = h;
            let f = r.getDPIAwareSupport(), g = r.getSysDPIFactor();
            t.browserSupport.dpiAwareSupport = f, t.browserSupport.systemDpiFactor = g;
            let p = d.getNativeWindowHandle().readUIntLE(0, 4);
            t.browserSupport.browserParentWndHandle = p, t.browserSupport.browserParentWnd = d;
            let k = t.browserSupport.browserParentWndHandle, m = r.findChildWindow(k, "Intermediate D3D Window");
            m && (t.browserSupport.d3dHwnd = m, r.setWindowLong(m, a.SetWindowType.GWL_STYLE, a.WindowStyle.WS_CLIPSIBLINGS)), r.setWindowLong(p, a.SetWindowType.GWL_STYLE, a.WindowStyle.WS_CLIPCHILDREN)
        } while (0)
    }), t.resizeBrowserWindow = function (e) {
        let n = !1;
        {
            let i = h(), o = t.browserSupport.browserParentWnd.getContentSize(), d = c();
            r.setWindowPos(e, a.OptionOfhwndInAfter.HWND_TOP, s * d, i * d, (o[0] - s - l) * d, (o[1] - i - u) * d, a.Uflags.SWP_SHOWWINDOW), n = !0
        }
        return n
    }, t.getBrowserWindowRect = function () {
        let e = {x: 0, y: 0, width: 0, height: 0}, n = t.browserSupport.browserParentWnd.getContentSize(), i = h(),
            a = c();
        return e.x = s * a, e.y = i * a, e.width = (n[0] - s - l) * a, e.height = (n[1] - i - u) * a, e
    }, t.getHeaderHeight = h
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(827), o = n(578), r = n(72), s = n(68), l = n(203), u = n(1).default.getLogger("Thunder.KuaiNiao"),
        d = s.UserHelperNS.getHelper(), c = l.ConfigHelperNS.getHelper();
    var h;
    !function (e) {
        e.statusChanged = "OnStatusChanged"
    }(h = t.KuainiaoEventNS || (t.KuainiaoEventNS = {}));

    class f extends r.default {
        constructor() {
            super(...arguments), this.mServerIp = void 0, this.mServerPort = void 0, this.mCanUpgrade = void 0, this.mDialAccount = void 0, this.mSession = new a.KuainiaoHttpSession, this.mHeartBeatTimer = null, this.mLoseHeartBeatCount = 0, this.mRetrySpeedUpCount = 0, this.mType = o.KuaiNiaoDefineNS.KuaiNiaoType.Try, this.mStatus = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Unkown, this.mAlived = !1, this.mTriggerTry = !1, this.mTryTimer = null, this.mDuration = void 0, this.mUserId = "0", this.mSessionId = "0"
        }

        init() {
            this.setMaxListeners(0), this.query().then(e => i(this, void 0, void 0, function* () {
                this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Init, yield this.checkAcclerate()
            })).catch(), d.attachListener(s.UserEventNS.login, () => i(this, void 0, void 0, function* () {
                yield this.onLogin()
            })), d.attachListener(s.UserEventNS.logout, () => i(this, void 0, void 0, function* () {
                yield this.onLogout()
            }))
        }

        clear() {
            this.mLoseHeartBeatCount = 0, this.mRetrySpeedUpCount = 0, this.mAlived = !1, this.mTriggerTry = !1, this.mDuration = void 0
        }

        enter() {
            return i(this, void 0, void 0, function* () {
                u.information("enter");
                let e = !1;
                return this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Commiting, e = yield this.commit(), this.isEnter && (this.status = e ? o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive : o.KuaiNiaoDefineNS.KuaiNiaoStatus.Failed), e
            })
        }

        exit() {
            return i(this, void 0, void 0, function* () {
                u.information("exit"), this.killHeartBeatTimer(), this.killTryTimer(), this.status !== o.KuaiNiaoDefineNS.KuaiNiaoStatus.Commiting && this.status !== o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive || (yield this.unAcclerate()), this.clear(), this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Init
            })
        }

        triggerTry() {
            return i(this, void 0, void 0, function* () {
                if (!this.mCanUpgrade) return u.information("can not upgrade!"), !1;
                if (this.mTriggerTry) return u.information("already trigger try!"), !1;
                u.information("triggerTry"), this.mTriggerTry = !0;
                let e = yield this.queryTry();
                return e ? (this.isEnter || (this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Enable, e = yield this.enter()), e) : (u.information("can not try!"), this.mTriggerTry = !1, !1)
            })
        }

        get status() {
            return this.mStatus
        }

        set status(e) {
            this.mStatus !== e && (this.mStatus = e, u.information(h.statusChanged, "status", e), this.fireEvent(h.statusChanged, e))
        }

        get isTry() {
            return this.mType === o.KuaiNiaoDefineNS.KuaiNiaoType.Try
        }

        get bandWidth() {
            return this.mBandWidth
        }

        get downstreamString() {
            let e = 0;
            return this.bandWidth && (e = Math.floor(this.bandWidth.downstream / 1024)), e + "M"
        }

        get authority() {
            return d.isSuperVip
        }

        get isEnter() {
            return this.status > o.KuaiNiaoDefineNS.KuaiNiaoStatus.Enable
        }

        get host() {
            return {ip: this.mServerIp, port: this.mServerPort}
        }

        query() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.queryPortal();
                return e ? (e = yield this.queryBand()) || (u.information("can not get band!"), !1) : (u.information("can not get portal!"), !1)
            })
        }

        commit() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.acclerate();
                return this.isEnter && e ? (this.isTry ? this.createTryTimer() : this.keepAlive(), !0) : (u.information("can not acclerate!"), !1)
            })
        }

        queryPortal() {
            return i(this, void 0, void 0, function* () {
                u.information("queryPortal");
                let e = yield this.mSession.queryPortal();
                return u.information("queryPortal", "response", e), e && (0 === e.result ? (this.mServerIp = e.serverIp, this.mServerPort = e.serverPort) : this.mServerIp = ""), this.mServerIp && "" !== this.mServerIp
            })
        }

        queryBand() {
            return i(this, void 0, void 0, function* () {
                u.information("queryBand");
                let e = yield this.mSession.queryBand(this.host);
                if (u.information("queryBand", "response", e), e) switch (e.result) {
                    case 0:
                        this.mCanUpgrade = 1 === e.canUpgrade, this.mDialAccount = e.dialAccount;
                        break;
                    default:
                        this.mCanUpgrade = !1
                }
                return !0 === this.mCanUpgrade
            })
        }

        acclerate() {
            return i(this, void 0, void 0, function* () {
                u.information("acclerate");
                let e = {
                    host: this.host,
                    dialAccount: this.mDialAccount,
                    speedType: this.mType,
                    userId: this.mUserId,
                    sessionId: this.mSessionId
                }, t = !1, n = yield this.mSession.speedUp(e);
                if (u.information("acclerate", "response", n), n) switch (n.result) {
                    case 0:
                        t = !0, this.mBandWidth = n.bandWidth;
                        break;
                    case 812:
                        this.mAlived = !0, t = !0, this.mBandWidth = n.bandWidth
                }
                return t
            })
        }

        unAcclerate() {
            return i(this, void 0, void 0, function* () {
                u.information("unAcclerate");
                let e = {
                    host: this.host,
                    dialAccount: this.mDialAccount,
                    speedType: this.mType,
                    userId: this.mUserId,
                    sessionId: this.mSessionId
                }, t = yield this.mSession.speedDown(e);
                return u.information("unAcclerate", "response", t), !0
            })
        }

        heartBeat() {
            return i(this, void 0, void 0, function* () {
                u.information("heartBeat");
                let e = {host: this.host, dialAccount: this.mDialAccount}, t = yield this.mSession.heartBeat(e);
                if (u.information("heartBeat", "response", t), t) switch (t.result) {
                    case 0:
                        break;
                    case 513:
                        this.onHeartBeatError(!0);
                        break;
                    case 520:
                        this.onHeartBeatError();
                        break;
                    default:
                        this.onHeartBeatLose()
                } else this.onHeartBeatLose()
            })
        }

        queryTry() {
            return i(this, void 0, void 0, function* () {
                u.information("queryTry");
                let e = {host: this.host, dialAccount: this.mDialAccount}, t = yield this.mSession.queryTry(e);
                return u.information("queryTry", "response", t), 0 === t.result && (this.mDuration = t.duration || 0, this.mDuration *= 60), 0 === t.result && t.leftCount > 0
            })
        }

        onHeartBeatError(e) {
            this.status === o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive && (u.information("onHeartBeatError"), this.killHeartBeatTimer(), e && this.mRetrySpeedUpCount < 3 ? (this.mRetrySpeedUpCount++, this.enter().catch()) : this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Failed)
        }

        onHeartBeatLose() {
            if (this.status === o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive) {
                u.information("onHeartBeatLose");
                let e = c.getValue("KuaiNiao", "KuaiNiaoHeartBeatLoseMaxCount");
                ++this.mLoseHeartBeatCount >= e && this.onHeartBeatError(!0)
            }
        }

        createHeartBeatTimer() {
            if (!this.mHeartBeatTimer) {
                let e = c.getValue("KuaiNiao", "KuaiNiaoHeartBeatInterval");
                u.information("createHeartBeatTimer", "interval", e), this.mHeartBeatTimer = setInterval(() => i(this, void 0, void 0, function* () {
                    yield this.heartBeat()
                }), 1e3 * e)
            }
        }

        killHeartBeatTimer() {
            this.mHeartBeatTimer && (u.information("killHeartBeatTimer"), clearInterval(this.mHeartBeatTimer), this.mHeartBeatTimer = void 0)
        }

        keepAlive() {
            u.information("keepAlive"), this.mLoseHeartBeatCount = 0, this.mAlived && this.heartBeat().catch(), this.createHeartBeatTimer()
        }

        checkAcclerate() {
            return i(this, void 0, void 0, function* () {
                this.authority ? (this.mType = o.KuaiNiaoDefineNS.KuaiNiaoType.Vip, this.mCanUpgrade && (this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Enable, yield this.enter())) : this.mType = o.KuaiNiaoDefineNS.KuaiNiaoType.Try
            })
        }

        onLogin() {
            return i(this, void 0, void 0, function* () {
                this.mUserId = d.userId, this.mSessionId = yield d.getSessionId(), this.authority && this.isEnter && (yield this.exit()), yield this.checkAcclerate()
            })
        }

        onLogout() {
            return i(this, void 0, void 0, function* () {
                this.status > o.KuaiNiaoDefineNS.KuaiNiaoStatus.Init && (yield this.exit()), yield this.checkAcclerate(), this.mUserId = "0", this.mSessionId = "0"
            })
        }

        createTryTimer() {
            !this.mTryTimer && this.mDuration && (u.information("createTryTimer"), this.mTryTimer = setTimeout(() => i(this, void 0, void 0, function* () {
                this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Finish, yield this.exit()
            }), 1e3 * this.mDuration))
        }

        killTryTimer() {
            this.mTryTimer && (u.information("killTryTimer"), clearTimeout(this.mTryTimer), this.mTryTimer = void 0)
        }
    }

    t.KuainiaoManager = f, function (e) {
        const t = new f;
        e.getManager = function () {
            return t
        }
    }(t.KuainiaoManagerNS || (t.KuainiaoManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Normal = 1] = "Normal", e[e.Vip = 2] = "Vip", e[e.SuperVip = 3] = "SuperVip"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {
            type: t.Default,
            id: 1
        }, e.cacheDir = `${__profilesDir}/speedcurve-skin`
    }(t.SpeedCurveSkinHelperNS || (t.SpeedCurveSkinHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(59), o = n(76), r = n(21), s = n(838), l = n(74), u = n(23),
        d = i.default.getLogger("CommunityNaviteFunction"), c = s.CommunityTaskManagerNS.getTaskManager();
    !function (e) {
        class t extends a.EventEmitter {
            constructor() {
                super(), this.isRegisted = !1, d.verbose("construct")
            }

            static getNativeModule() {
                return t.instance || (t.instance = new t), t.instance
            }

            registerNativeFunction() {
                if (!this.isRegisted) {
                    this.isRegisted = !0;
                    let e = [{
                        functionName: "GetTaskSpeedByGcid",
                        nativeFunc: this.getTaskSpeedByGcid
                    }, {
                        functionName: "GetTaskNameByGcid",
                        nativeFunc: this.getTaskNameByGcid
                    }, {functionName: "SwitchToTask", nativeFunc: this.switchToTask}, {
                        functionName: "NotifyUnreadNum",
                        nativeFunc: this.notifyUnreadNum
                    }, {functionName: "ShowChatPanel", nativeFunc: this.showChatPanel}, {
                        functionName: "NewMessage",
                        nativeFunc: this.newMessage
                    }, {functionName: "OpenCommunityGroup", nativeFunc: this.openCommunityGroup}];
                    o.setDefaultNativeFunctionMap(e), c.init()
                }
            }

            sendOpenCommunityEvent(e, t) {
                void 0 !== t && (d.information("sendOpenCommunityEvent", e), t.fireEvent("OnShowCommunity", e.type, e.entry, JSON.stringify(e.extra)))
            }

            showChatPanel(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (d.verbose(a), !a || !a[0]) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = {type: "chat", extra: {userId: a[0]}};
                    t.getNativeModule().emit("openComunityGroup", o), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            newMessage(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (d.information("newMessage", a), d.verbose(a), !a || !a[0]) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const o = a[0];
                    try {
                        let a = JSON.parse(o);
                        t.getNativeModule().emit("newMessage", a), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                    } catch (e) {
                        d.information("newMessage parse data error")
                    }
                } while (0)
            }

            getTaskSpeedByGcid(e, t, n, i) {
                do {
                    if (!e || !n || void 0 === t) break;
                    if (d.verbose(i), !i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = i[0];
                    let o = c.getTaskAverageSpeedByTaskUniqueID(a);
                    d.information("getTaskSpeedByGcid gcid:", a, ", taskAverageSpeed:", o), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, "" + o)
                } while (0)
            }

            getTaskNameByGcid(e, t, n, i) {
                do {
                    if (!e || !n || void 0 === t) break;
                    if (d.verbose(i), !i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = i[0];
                    let o = c.getTaskNameByTaskUniqueID(a);
                    d.information("getTaskSpeedByGcid gcid:", a, ", taskName:", o), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            switchToTask(e, t, n, i) {
                do {
                    if (!e || !n || void 0 === t) break;
                    if (d.verbose(i), !i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = i[0];
                    d.information("switchToTask", a);
                    let o = c.getTaskInfoByTaskUniqueID(a);
                    if (!o) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    d.information("switchToTask gcid:", a, ", taskInfo:", o), l.default.fireEvent(u.NodeEventMesssageNS.eventDownloadSwitchCategory, o.categoryId, o.categoryViewId, o.taskId), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            notifyUnreadNum(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (d.verbose(a), !a || !Array.isArray(a) || a.length < 2) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const o = a[0];
                    let s = null;
                    try {
                        s = JSON.parse(a[1])
                    } catch (e) {
                        break
                    }
                    t.getNativeModule().emit("NotifyUnreadNum", {
                        totalNum: a[0],
                        detail: s
                    }), d.information("notifyUnreadNum", o), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openCommunityGroup(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (!a || !Array.isArray(a)) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = null;
                    try {
                        o = JSON.parse(a[0])
                    } catch (e) {
                        break
                    }
                    t.getNativeModule().emit("openComunityGroup", o), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }
        }

        t.instance = null, e.CommunityNaviteFunction = t
    }(t.CommunityNaviteFunctionNS || (t.CommunityNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(21), o = n(5);
    !function (e) {
        let t, n;
        !function (e) {
            e[e.None = 0] = "None", e[e.Sock5 = 1] = "Sock5", e[e.Http = 2] = "Http"
        }(t = e.ProxyType || (e.ProxyType = {})), function (e) {
            e[e.Sucess = 0] = "Sucess", e[e.Fall = 1] = "Fall", e[e.AuthFall = 2] = "AuthFall", e[e.ConnectFall = 3] = "ConnectFall", e[e.Timeout = 4] = "Timeout", e[e.ParamError = 5] = "ParamError"
        }(n = e.ProxyVerifyResult || (e.ProxyVerifyResult = {})), e.verifyProxy = function (e, t, r, s, l) {
            return i(this, void 0, void 0, function* () {
                return new Promise(i => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("VerifyProxy", e, t, r, s, l, (e, t) => {
                        e === a.NativeFunctionErrorCode.Success ? i(t) : i(n.Fall)
                    })
                })
            })
        }, e.setProxy = function (e, t, n, r, s) {
            return i(this, void 0, void 0, function* () {
                return new Promise(i => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("SetProxy", e, t, n, r, s, (e, t) => {
                        e === a.NativeFunctionErrorCode.Success ? i(t) : i(1)
                    })
                })
            })
        }
    }(t.ProxyNS || (t.ProxyNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(1), r = n(12), s = n(10), l = n(14);
    let {isDef: u} = r.ThunderUtil;
    const d = o.default.getLogger("WallpaperManager");
    t.default = new class {
        constructor() {
            this.wallpapersURL = "https://api-xl9-ssl.xunlei.com/sl/xlppc.personalizedcenter.api/api/xskin/list", this.testPapersURL = "http://test.api-shoulei-ssl.xunlei.com/xlppc.personalizedcenter.api/api/xskin/list"
        }

        getWallpapers() {
            return i(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = n(22);
                    let e = 1 === (yield l.default("GetValue", "ConfigFetchInterface", "TestServer", 0)) ? this.testPapersURL : this.wallpapersURL;
                    try {
                        let t = yield a.default.get(e, {params: {page: 0, per_page: 30}});
                        if (200 === t.status && "ok" === t.data.result) {
                            this.wallpapers = t.data.list;
                            try {
                                localStorage.setItem("wallpapers", JSON.stringify(this.wallpapers))
                            } catch (e) {
                                d.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        d.warning(e)
                    }
                    if (u(this.wallpapers)) break;
                    this.wallpapers = JSON.parse(localStorage.getItem("wallpapers"))
                } while (0);
                let e = this.wallpapers || [], t = yield this.getSpringFestivalWallpaper();
                return t && (e = [...e, t]), e
            })
        }

        getImage(e) {
            return i(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/skins/${e.id}/wallpaper.jpg`;
                return (yield s.FileSystemAWNS.existsAW(t)) ? (this.updateImage(e).catch(e => {
                    d.information("update skin preview error", e)
                }), t) : (yield this.updateImage(e), t)
            })
        }

        updateImage(e) {
            return i(this, void 0, void 0, function* () {
                a.default.defaults.adapter = n(22);
                let t = yield a.default.get(e.skin_link, {responseType: "arraybuffer"});
                if (u(t) && 200 === t.status && u(t.data) && (yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/skins`), yield s.FileSystemAWNS.writeFileAW(`${__profilesDir}/skins/${e.id}.zip`, t.data))) {
                    const {UnzipUtilitiesAWNS: t} = yield Promise.resolve().then(() => n(202));
                    yield t.uncompressZipFile(`${__profilesDir}/skins/${e.id}/`, `${__profilesDir}/skins/${e.id}.zip`)
                }
            })
        }

        getSpringFestivalWallpaper() {
            return i(this, void 0, void 0, function* () {
                let e = null;
                try {
                    let t = JSON.parse(localStorage.getItem("springFestivalSkinData"));
                    t && "on" === t.skinsiwtch && (e = {
                        id: 9999,
                        operator: "",
                        manual_order: 0,
                        name: "春节皮肤",
                        is_vip: !1,
                        is_dynamic: !1,
                        preview: t.skin_thumb,
                        skin_link: t.skin_link,
                        artist: "",
                        color: 11,
                        is_4k: !1,
                        transparency: 80,
                        created_at: 1546599635159,
                        updated_at: 1546654241407,
                        showNew: !1
                    })
                } catch (e) {
                }
                return e
            })
        }
    }
}, , , , , function (e, t, n) {
    e.exports = n(9)(121)
}, function (e, t, n) {
    e.exports = function (e) {
        function t(i) {
            if (n[i]) return n[i].exports;
            var a = n[i] = {i, l: !1, exports: {}};
            return e[i].call(a.exports, a, a.exports, t), a.l = !0, a.exports
        }

        var n = {};
        return t.m = e, t.c = n, t.i = function (e) {
            return e
        }, t.d = function (e, n, i) {
            t.o(e, n) || Object.defineProperty(e, n, {configurable: !1, enumerable: !0, get: i})
        }, t.n = function (e) {
            var n = e && e.__esModule ? function () {
                return e.default
            } : function () {
                return e
            };
            return t.d(n, "a", n), n
        }, t.o = function (e, t) {
            return Object.prototype.hasOwnProperty.call(e, t)
        }, t.p = "/dist/", t(t.s = 4)
    }([function (e, t) {
        e.exports = {
            inserted: function (e, t, n) {
                var i = n.context.$refs[t.arg];
                i && i.addItem({el: e, value: t.value})
            }, unbind: function (e, t, n) {
                var i = n.context.$refs[t.arg];
                i && i.removeItem({el: e, value: t.value})
            }
        }
    }, function (e, t, n) {
        var i = n(5)(n(2), n(6), null, null, null);
        e.exports = i.exports
    }, function (e, t, n) {
        "use strict";
        Object.defineProperty(t, "__esModule", {value: !0});
        var i = n(3);
        t.default = {
            name: "Popup",
            props: {
                appendToBody: {type: Boolean, default: !0},
                arrowClass: String,
                direction: {type: String, default: "bottom"},
                display: {type: Boolean, default: !1},
                padding: {type: Number, default: 0},
                trigger: {type: String, default: "hover"},
                scrollShow: {type: Boolean, default: !0}
            },
            data: function () {
                return {
                    arrowStyle: {},
                    delay: 100,
                    directionMap: {top: "height", left: "width"},
                    secondDirection: "",
                    left: 0,
                    top: 0,
                    currentElement: null,
                    willHide: !1
                }
            },
            computed: {
                directionClass: function () {
                    var e = /(top)|(bottom)|(left)|(right)/i, t = e.exec(this.direction) || [],
                        n = this.secondDirection ? e.exec(this.secondDirection)[0] : "", i = t[0] || "";
                    return "" === n ? "popup-" + i : "popup-" + n
                }, triggerEvent: function () {
                    switch (this.trigger) {
                        case"hover":
                            return "mouseenter";
                        case"focus":
                            return "focus";
                        case"click":
                            return "click"
                    }
                }, unTriggerEl: function () {
                    return "click" === this.trigger ? document : this.$el
                }, unTriggerEvent: function () {
                    switch (this.trigger) {
                        case"hover":
                            return "mouseleave";
                        case"focus":
                            return "blur";
                        case"click":
                            return "click"
                    }
                }
            },
            mounted: function () {
                this.appendToBody && document.body.appendChild(this.$el), this.$el.addEventListener(this.triggerEvent, this.handlePopupVisible), this.unTriggerEl.addEventListener(this.unTriggerEvent, this.handlePopupInvisible), this.handleResizeThrottle = n.i(i.a)(this.handleResize, 16), window.addEventListener("resize", this.handleResizeThrottle)
            },
            beforeDestroy: function () {
                this.$el.removeEventListener(this.triggerEvent, this.handlePopupVisible), this.unTriggerEl.removeEventListener(this.unTriggerEvent, this.handlePopupInvisible), window.removeEventListener("resize", this.handleResizeThrottle)
            },
            destroyed: function () {
                this.appendToBody && this.$el && document.body.hasChildNodes(this.$el) && document.body.removeChild(this.$el)
            },
            methods: {
                addItem: function (e) {
                    e.el.handleVisible = this.handleVisible.bind(this, e.value, e.el), e.el.addEventListener(this.triggerEvent, e.el.handleVisible), "click" !== this.trigger && (e.el.handleInvisible = this.handleInvisible.bind(this, e.value), e.el.addEventListener(this.unTriggerEvent, e.el.handleInvisible)), this.bindScroll(e.el)
                }, removeItem: function (e) {
                    e.el.removeEventListener(this.triggerEvent, e.el.handleVisible), "click" !== this.trigger && e.el.removeEventListener(this.unTriggerEvent, e.el.handleInvisible), this.unbindScroll(e.el)
                }, bindScroll: function (e) {
                    for (e = e.parentNode; e;) e.addEventListener("scroll", this.handleScroll), e = e.parentNode
                }, unbindScroll: function (e) {
                    for (e = e.parentNode; e;) e.removeEventListener("scroll", this.handleScroll), e = e.parentNode
                }, computePosition: function (e, t) {
                    e = e.getBoundingClientRect();
                    var n = 0, i = 0, a = (t = t.getBoundingClientRect()).top - e.height - this.padding,
                        o = t.left + t.width + this.padding, r = t.top + t.height + this.padding,
                        s = t.left - e.width - this.padding;
                    /(top)|(bottom)/i.test(this.direction) ? (n = t.left + (t.width - e.width) / 2, "bottomStart" !== this.direction && "topStart" !== this.direction || (n = t.left), "bottomEnd" !== this.direction && "topEnd" !== this.direction || (n = t.left - e.width + t.width), n < 0 ? (n = 0, this.arrowStyle = {left: (t.left + t.right) / 2 + "px"}) : n + e.width > window.innerWidth ? (n = window.innerWidth - e.width, this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}) : this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}, "top" === this.direction || "topStart" === this.direction || "topEnd" === this.direction ? a < 0 && r + e.height <= window.innerHeight ? (i = r, this.secondDirection = "bottom", "topStart" === this.direction && (this.secondDirection = "bottomStart", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}), "topEnd" === this.direction && (this.secondDirection = "bottomEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"})) : (i = a, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}) : r + e.height > window.innerHeight && a >= 0 ? (i = a, this.secondDirection = "top", "bottomStart" === this.direction && (this.secondDirection = "topStart", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}), "bottomEnd" === this.direction && (this.secondDirection = "topEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"})) : (i = r, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"})) : /(left)|(right)/i.test(this.direction) && (i = t.top + (t.height - e.height) / 2, "leftStart" !== this.direction && "rightStart" !== this.direction || (i = t.top), "leftEnd" !== this.direction && "rightEnd" !== this.direction || (i = t.top - e.height + t.height), i < 0 ? (i = 0, this.arrowStyle = {top: (t.top + t.bottom) / 2 + "px"}) : i + e.height > window.innerHeight ? (i = window.innerHeight - e.height, this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}) : this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}, "left" === this.direction || "leftStart" === this.direction || "leftEnd" === this.direction ? s < 0 && o + e.width <= window.innerWidth ? (n = o, this.secondDirection = "right", "leftStart" === this.direction && (this.secondDirection = "rightStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}), "leftEnd" === this.direction && (this.secondDirection = "rightEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"})) : (n = s, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}) : o + e.width > window.innerWidth && s >= 0 ? (n = s, this.secondDirection = "left", "rightStart" === this.direction && (this.secondDirection = "leftStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}), "rightEnd" === this.direction && (this.secondDirection = "leftEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"})) : (n = o, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"})), this.top = i, this.left = n
                }, handleVisible: function (e, t, n) {
                    var i = this;
                    if ("click" === this.trigger && this.display && !0 !== n) return this.handleInvisible(e);
                    this.willHide = !1, this.currentElement = t, this.currentValue = e, this.$emit("update:display", !0), this.$emit("show", e), this.$nextTick(function () {
                        setTimeout(function () {
                            i.computePosition(i.$el, i.currentElement)
                        })
                    })
                }, handleInvisible: function (e) {
                    var t = this;
                    "click" === this.trigger ? (this.$emit("update:display", !1), this.$emit("hide", e)) : (this.willHide = !0, setTimeout(function () {
                        t.willHide && (t.$emit("update:display", !1), t.$emit("hide", e))
                    }, this.delay))
                }, handleScroll: function () {
                    this.scrollShow ? this.display && this.computePosition(this.$el, this.currentElement) : (this.$emit("update:display", !1), this.$emit("hide"))
                }, handlePopupVisible: function (e) {
                    e.stopPropagation(), this.willHide = !1, this.$emit("update:display", !0), this.$emit("show", this.value)
                }, handlePopupInvisible: function (e) {
                    var t = this;
                    "click" === this.trigger && this.isClosest(e.target, this.currentElement) || ("click" === this.trigger ? (this.$emit("update:display", !1), this.$emit("hide", this.value)) : (this.willHide = !0, setTimeout(function () {
                        t.willHide && (t.$emit("update:display", !1), t.$emit("hide", t.value))
                    }, this.delay)))
                }, handleResize: function () {
                    this.display && this.handleVisible(this.value, this.currentElement, !0)
                }, show: function (e, t) {
                    this.handleVisible(t, e)
                }, hide: function () {
                    this.handleInvisible()
                }, isDirectionLine: function (e) {
                    return "top" === e || "bottom" === e ? "top" === this.direction || "bottom" === this.direction : "left" === this.direction || "right" === this.direction
                }, isClosest: function (e, t) {
                    return e !== document && (e === t || this.isClosest(e.parentNode, t))
                }
            }
        }
    }, function (e, t, n) {
        "use strict";
        t.a = function (e, t) {
            var n = this, i = 0;
            return function () {
                for (var a = arguments.length, o = Array(a), r = 0; r < a; r++) o[r] = arguments[r];
                var s = +new Date;
                s - i > t && (e.apply(n, o), i = s)
            }
        }
    }, function (e, t, n) {
        var i = n(0), a = n(1);
        a.install = function (e) {
            e.directive("popup", i), e.component(a.name, a)
        }, e.exports = a
    }, function (e, t) {
        e.exports = function (e, t, n, i, a) {
            var o, r = e = e || {}, s = typeof e.default;
            "object" !== s && "function" !== s || (o = e, r = e.default);
            var l, u = "function" == typeof r ? r.options : r;
            if (t && (u.render = t.render, u.staticRenderFns = t.staticRenderFns), i && (u._scopeId = i), a ? (l = function (e) {
                (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), n && n.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
            }, u._ssrRegister = l) : n && (l = n), l) {
                var d = u.functional, c = d ? u.render : u.beforeCreate;
                d ? u.render = function (e, t) {
                    return l.call(t), c(e, t)
                } : u.beforeCreate = c ? [].concat(c, l) : [l]
            }
            return {esModule: o, exports: r, options: u}
        }
    }, function (e, t) {
        e.exports = {
            render: function () {
                var e = this, t = e.$createElement, n = e._self._c || t;
                return n("div", {
                    class: e.directionClass,
                    style: {display: e.display ? "block" : "none", left: e.left + "px", top: e.top + "px"},
                    attrs: {tabindex: "999"}
                }, [e._t("default"), e._v(" "), n("span", {
                    staticClass: "popup-arrow",
                    class: e.arrowClass,
                    style: e.arrowStyle
                })], 2)
            }, staticRenderFns: []
        }
    }])
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.ValueNull = 0] = "ValueNull", e[e.ValueInt = 1] = "ValueInt", e[e.ValueBigint = 2] = "ValueBigint", e[e.ValueDouble = 3] = "ValueDouble", e[e.ValueString = 4] = "ValueString", e[e.ValueBlob = 5] = "ValueBlob"
    }(t.ValueType || (t.ValueType = {})), function (e) {
        e[e.StatementBengin = -1] = "StatementBengin", e[e.CreateTaskBase = 0] = "CreateTaskBase", e[e.CreateP2spTask = 1] = "CreateP2spTask", e[e.CreateBtTask = 2] = "CreateBtTask", e[e.CreateBtFile = 3] = "CreateBtFile", e[e.CreateEmuleTask = 4] = "CreateEmuleTask", e[e.CreateGroupTask = 5] = "CreateGroupTask", e[e.CreateMagnetTask = 6] = "CreateMagnetTask", e[e.DestroyTaskBase = 7] = "DestroyTaskBase", e[e.DestroyP2spTask = 8] = "DestroyP2spTask", e[e.DestroyBtTask = 9] = "DestroyBtTask", e[e.DestroyBtFile = 10] = "DestroyBtFile", e[e.DestroyEmuleTask = 11] = "DestroyEmuleTask", e[e.DestroyGroupTask = 12] = "DestroyGroupTask", e[e.DestroyMagnetTask = 13] = "DestroyMagnetTask", e[e.LoadTaskBase = 14] = "LoadTaskBase", e[e.LoadP2spTask = 15] = "LoadP2spTask", e[e.LoadBtTask = 16] = "LoadBtTask", e[e.LoadBtFile = 17] = "LoadBtFile", e[e.LoadEmuleTask = 18] = "LoadEmuleTask", e[e.LoadGroupTask = 19] = "LoadGroupTask", e[e.SetTaskSavePath = 20] = "SetTaskSavePath", e[e.SetTaskName = 21] = "SetTaskName", e[e.SetTaskNamingType = 22] = "SetTaskNamingType", e[e.SetTaskDescription = 23] = "SetTaskDescription", e[e.SetTaskCid = 24] = "SetTaskCid", e[e.SetTaskGcid = 25] = "SetTaskGcid", e[e.SetTaskStatus = 26] = "SetTaskStatus", e[e.SetTaskFileCreated = 27] = "SetTaskFileCreated", e[e.SetTaskFileSize = 28] = "SetTaskFileSize", e[e.SetTaskReceiveSize = 29] = "SetTaskReceiveSize", e[e.SetTaskDownloadSize = 30] = "SetTaskDownloadSize", e[e.SetTaskCompletionTime = 31] = "SetTaskCompletionTime", e[e.SetTaskDownloadingPeriod = 32] = "SetTaskDownloadingPeriod", e[e.SetTaskRemovingToRecycleTime = 33] = "SetTaskRemovingToRecycleTime", e[e.SetTaskFailureErrorCode = 34] = "SetTaskFailureErrorCode", e[e.SetTaskUserRead = 35] = "SetTaskUserRead", e[e.SetTaskOpenOnCompelete = 36] = "SetTaskOpenOnCompelete", e[e.SetTaskForbidden = 37] = "SetTaskForbidden", e[e.SetTaskUserData = 38] = "SetTaskUserData", e[e.SetTaskDownload = 39] = "SetTaskDownload", e[e.SetTaskOrigin = 40] = "SetTaskOrigin", e[e.SetTaskChannelInfo = 41] = "SetTaskChannelInfo", e[e.SetP2spTaskUseOriginOnly = 42] = "SetP2spTaskUseOriginOnly", e[e.SetP2spTaskThreadCount = 43] = "SetP2spTaskThreadCount", e[e.SetBtFileInfo = 44] = "SetBtFileInfo", e[e.SetBtFileCid = 45] = "SetBtFileCid", e[e.SetCategoryId = 46] = "SetCategoryId", e[e.LoadCategory = 47] = "LoadCategory", e[e.CreateCategory = 48] = "CreateCategory", e[e.SetCategoryPassword = 49] = "SetCategoryPassword", e[e.SetCategoryAccountPassword = 50] = "SetCategoryAccountPassword", e[e.SearchTaskByName = 51] = "SearchTaskByName", e[e.SearchTaskByBtDisplayName = 52] = "SearchTaskByBtDisplayName", e[e.BatchFindP2spTask = 53] = "BatchFindP2spTask", e[e.BatchFindEmuleTask = 54] = "BatchFindEmuleTask", e[e.BatchFindBtTask = 55] = "BatchFindBtTask", e[e.BatchFindGroupTask = 56] = "BatchFindGroupTask", e[e.StatementEnd = 57] = "StatementEnd"
    }(t.StatementType || (t.StatementType = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(149), a = n(38), o = n(57), r = n(1).default.getLogger("Thunder.VipDownload.json-crypto");
    !function (e) {
        e.getAuthorization = function (e, t) {
            return e + ":" + t
        }, e.getAccept = function () {
            return "application/json; version=1.0"
        }, e.getUriParam = function (e, t, n) {
            const i = o.PluginHelperNS.getHelper();
            let a = "client_name=" + i.clientName + "&client_version=" + i.thunderVersionNumber + "&client_sequence=" + e + "&r=" + t;
            return void 0 !== n && (a = a + "&verify_type=" + n), a
        }, e.getKey = function (e, t) {
            const n = o.PluginHelperNS.getHelper();
            let i = n.clientName + n.thunderVersionNumber + e + t;
            return (i = a.ToolsUtilitiesAWNS.genarateMd5(i)).substr(0, 16).toUpperCase()
        }, e.encryptHttpBuffer = function (e, t) {
            r.information("key", t);
            let n = JSON.stringify(e);
            r.information("jsonStr", n);
            let o = i.Buffer.from(n);
            return a.ToolsUtilitiesAWNS.encryptBuffer(o, t)
        }, e.decryptHttpBuffer = function (e, t) {
            r.information("key", t);
            let n = null;
            if (e = a.ToolsUtilitiesAWNS.decryptBuffer(e, t)) {
                let t = e.toString();
                r.information("jsonStr", t);
                try {
                    n = JSON.parse(t)
                } catch (e) {
                    r.warning(e)
                }
            }
            return n
        }
    }(t.HttpJsonCryptoNS || (t.HttpJsonCryptoNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.guidDownloadAndPlay = "{6B0A52BF-FDC5-4dfd-A20E-597CCD50CB8F}", e.guidTaskRequest = "{D30770E1-0A7F-4879-A103-AC738CB477C6}", e.guidUnzip = "{C60B84A8-6D18-475d-989D-965ADBECF135}", e.guidDownloadCompleteInstall = "{66F815D6-ADE3-4c85-A6B2-E48D50C096A7}", e.guidDownloadCompleteRunParams = "{D30770E1-0A7F-4879-A103-AC738CB477C6}"
    }(t.TaskUserDataGUID || (t.TaskUserDataGUID = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(143), o = n(812);

    class r {
        constructor() {
            this.mTasks = new Map
        }

        deleteTask(e) {
            this.mTasks.delete(e)
        }

        getTask(e) {
            return this.mTasks.get(e)
        }

        getTaskMap() {
            return this.mTasks
        }

        createTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.mTasks.get(e);
                if (!t) {
                    let n = yield a.DkHelperNS.getHelper().getTaskBaseInfo(e);
                    n && n.groupTaskId <= 0 && (t = new o.Task(e, n), this.mTasks.set(e, t))
                }
                return t
            })
        }
    }

    t.TaskManager = r, function (e) {
        const t = new r;
        e.getTaskManager = function () {
            return t
        }
    }(t.TaskManagerNS || (t.TaskManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(1), r = n(12);
    let {isDef: s} = r.ThunderUtil;
    const l = o.default.getLogger("Thunder.speedcurve-skin.skin-storage");
    t.default = new class {
        constructor() {
            this.skinURL = "http://static-xl9-ssl.xunlei.com/json/thunderx_speedcurve_skin.json"
        }

        getSkins() {
            return i(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = n(22);
                    try {
                        let e = yield a.default.get(this.skinURL);
                        if (200 === e.status && e.data) {
                            this.skins = e.data, l.information("skins", this.skins), localStorage.setItem("speedcurveSkins", JSON.stringify(this.skins));
                            break
                        }
                    } catch (e) {
                        l.warning(e)
                    }
                    if (s(this.skins)) break;
                    this.skins = JSON.parse(localStorage.getItem("speedcurveSkins"))
                } while (0);
                return this.skins
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(7), s = n(79), l = n(12), u = n(72), d = n(23), c = n(10), h = n(105), f = n(229),
        g = n(85), p = n(73), k = n(197), m = n(13), T = n(1), v = n(38), C = n(32),
        S = T.default.getLogger("command_line"), y = C.DownloadKernelTaskManager.getTaskManager(),
        w = r.default(o.join(__rootDir, "../bin/ThunderNewTask.node")),
        I = r.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    const b = new class extends u.default {
        constructor() {
            super(...arguments), this.readyToShow = !1, this.startArgs = ""
        }

        init() {
            a.remote.getCurrentWindow().isVisible() ? this.readyToShow = !0 : a.remote.getCurrentWindow().on("ready-to-show", () => {
                this.readyToShow = !0
            }), w.setCommandLineCallback(e => {
                if (S.information("on command ", e), this.readyToShow && this.needBringToTop(e) && this.bringMainWindowToTop(), void 0 !== e && "" !== e.trim()) {
                    let t = l.ThunderUtil.parseCommandLine(e);
                    t.length > 0 && this.executeCmdLine(t).catch()
                }
            })
        }

        setStartArgs(e) {
            this.startArgs = e
        }

        onCommand(e, t, a) {
            return i(this, void 0, void 0, function* () {
                if (S.information(e, t), "path" === e) {
                    let e = o.extname(t);
                    ".torrent" === (e = e.toLowerCase()) ? (this.readyToShow && this.bringMainWindowToTop(), a = "command" === a ? "Torrent" : a, this.ensureDkLoaded(e => i(this, void 0, void 0, function* () {
                        if (e) {
                            let e = yield f.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                            if (null === e) h.ThunderNewTask.createBtTaskWindow({
                                type: "file",
                                seedFile: t
                            }, {source: a}); else {
                                let n = JSON.stringify(e);
                                h.ThunderNewTask.createBtTaskWindow({data: n, type: "file", seedFile: t}, {source: a})
                            }
                        }
                    }))) : ".td" !== e && ".bc!" !== e && ".part" !== e && ".xltd" !== e || (a = "command" === a ? "TD" : a, this.ensureDkLoaded(e => {
                        e && g.TaskOperatorNs.importUncompletedFromFile(t, a)
                    }))
                } else if ("task" === e) {
                    if ("newtask" === t) {
                        let e = "button=create";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), m.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=taskbar"), S.information("trackEvent", "core_event", "create_task_click", "click_source=taskbar"), h.ThunderNewTask.createPreNewTaskWindow(null)
                    } else if ("startall" === t) {
                        let e = "button=start";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), p.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                            g.TaskOperatorNs.startAll()
                        })
                    } else if ("pauseall" === t) {
                        let e = "button=pause";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), g.TaskOperatorNs.pauseAll()
                    }
                } else if ("shell" === e) {
                    if ("exit" === t) {
                        let e = "button=exit";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), k.quitPromises.run()
                    }
                } else if ("speedMode" === e) ; else if ("unionfile" === e) {
                    let e = t;
                    h.ThunderNewTask.createUnionTask(e).catch()
                } else if ("-autotestinjectfile" === e && (yield c.FileSystemAWNS.existsAW(t))) {
                    let e = require(t);
                    const {DownloadKernelTestNS: i} = yield Promise.resolve().then(() => n(837));
                    e.init(i)
                }
            })
        }

        bringMainWindowToTop() {
            if (this.readyToShow) {
                let e = a.remote.getCurrentWindow();
                null !== e && (e.isMinimized() && e.restore(), v.ToolsUtilitiesAWNS.setForegroundWindow(I, e), e.isVisible() ? e.focus() : e.show())
            }
        }

        ensureDkLoaded(e) {
            y.isDkLoaded() ? e(!0) : p.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, t => {
                e(0 === t)
            })
        }

        needBringToTop(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if (-1 !== e.indexOf("-window:bringtotop")) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        executeCmdLine(e) {
            return i(this, void 0, void 0, function* () {
                for (let t of e) {
                    if ("" === t) continue;
                    let e = "", n = "";
                    if (yield c.FileSystemAWNS.existsAW(t)) e = "path", n = t; else if (s.URLHelperNS.isSupportUrl(t)) e = "url", n = t; else {
                        let i = t.indexOf(":");
                        -1 === i ? e = t : i > 1 && (e = t.substring(1, i), i !== t.length - 1 && (n = t.substring(i + 1)))
                    }
                    this.onCommand(e, n, "command").catch(), this.fireEvent(d.NodeEventMesssageNS.eventOnCommand, e, n)
                }
            })
        }
    };
    t.default = b
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(10), r = n(7), s = n(568), l = n(72), u = n(6), d = n(23), c = n(25), h = n(250),
        f = u.promisify, g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        p = n(1).default.getLogger("SettingConfigHelper");
    !function (e) {
        e.configBrowserHelper = new class {
            constructor() {
                this.browserconfig = null, this.installWatchBrowsers = [], this.configShowBrowsers = [], this.eventContainer = new l.default, this.isInit = !1
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    p.information("ConfigBrowserHelper enter init ");
                    let e = yield this.onConfigInit(), t = yield this.onBhoConfigInit();
                    p.information("ConfigBrowserHelper init isConfigInit:", e, ";isBhoConfigInit:", t), e && t && (yield this.readBrowserConfigXml(), yield this.writeNewBrowserToConfigINI(), this.isInit = !0, p.information("ConfigBrowserHelper init Finished"), this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventConfigBrowserInitFinished))
                })
            }

            attachListener(e, t) {
                do {
                    if (e === d.NodeEventMesssageNS.eventConfigBrowserInitFinished) {
                        if (this.isInit) {
                            t(this.isInit);
                            break
                        }
                        this.eventContainer.attachOnceListener(e, t);
                        break
                    }
                    this.eventContainer.attachListener(e, t)
                } while (0)
            }

            detachListener(e, t) {
                this.eventContainer.detachListener(e, t)
            }

            getConfigShowBrowsers() {
                let e = [];
                do {
                    if (null === this.configShowBrowsers || void 0 === this.configShowBrowsers || this.configShowBrowsers.length <= 0) break;
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let n = this.configShowBrowsers[t], i = n.browserName, a = "Motitor" + i, o = !1;
                        0 !== c.ConfigNS.getValue("Motitor", a, 2) && (o = !0);
                        let r = {content: i, name: n.name, key: a, isSelect: o};
                        e.push(r)
                    }
                } while (0);
                return p.information("getConfigShowBrowsers:", e), e
            }

            getWriteIniConfigShowBrowsers() {
                let e = "||";
                do {
                    let t = this.getConfigShowBrowsers();
                    if (null === t || void 0 === t || t.length <= 0) break;
                    for (let n = 0; n < t.length; ++n) {
                        let i = t[n], a = i.name;
                        "IE浏览器" !== i.content && i.isSelect && (void 0 !== e && null !== e && "" !== e ? "edge" === a || "edgecp" === a ? e += "edge||edgecp||" : e = e + a + "||" : e = "edge" === a || "edgecp" === a ? "edge||edgecp||" : a + "||")
                    }
                } while (0);
                return e
            }

            getWatchBrowerByName(e) {
                let t = null;
                do {
                    if (null === this.installWatchBrowsers || void 0 === this.installWatchBrowsers || this.installWatchBrowsers.length <= 0) break;
                    for (let n = 0; n < this.installWatchBrowsers.length; ++n) {
                        let i = this.installWatchBrowsers[n];
                        if (i.browserName.toLowerCase() === e.toLowerCase()) {
                            t = i;
                            break
                        }
                    }
                } while (0);
                return t
            }

            savaMotiorBrowserToConfig() {
                do {
                    let e = this.getConfigShowBrowsers();
                    if (null === e || void 0 === e || e.length <= 0) break;
                    let t = !1;
                    for (let n = 0; n < e.length; ++n) {
                        let i = e[n];
                        i.isSelect && (t = !0), "IE浏览器" === i.content && (i.isSelect ? (h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 1), h.BHOConfigNS.setValue("Monitor", "MonitorIE", 1)) : (h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 0), h.BHOConfigNS.setValue("Monitor", "MonitorIE", 0)))
                    }
                    t || h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 0)
                } while (0)
            }

            onConfigInit() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            onBhoConfigInit() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        h.BHOConfigNS.attachListener(d.NodeEventMesssageNS.eventBHOConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            readBrowserConfigXml() {
                return i(this, void 0, void 0, function* () {
                    p.information("enter readBrowserConfigXml");
                    do {
                        if (null !== this.browserconfig && void 0 !== this.browserconfig) break;
                        let e = this.getShortThunderVersion();
                        if (null === e || void 0 === e || "" === e) break;
                        let t = g.getCommonFilesPath(),
                            n = "XLWFPDOWNLOAD-SSID-{DB09E578-4ECF-486e-90A5-505A33219F71}_" + e + ".xml",
                            i = a.join(t, "Thunder Network\\ServicePlatform\\"), r = a.join(i, n),
                            l = yield o.FileSystemAWNS.readFileAW(r);
                        if (!l || "" === l.toString()) break;
                        try {
                            let e = {explicitArray: !1}, t = yield f(s.parseString)(l, e);
                            null !== t && void 0 !== t && (this.browserconfig = t.browserconfig, yield this.setInstallWatchBrowserList())
                        } catch (e) {
                            p.information(e)
                        }
                    } while (0);
                    this.setConfigShowBrowsers(), p.information("leave readBrowserConfigXml")
                })
            }

            writeNewBrowserToConfigINI() {
                return i(this, void 0, void 0, function* () {
                    p.information("enter writeNewBrowserToConfigINI");
                    let e = "||";
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let n = this.configShowBrowsers[t], i = "Motitor" + n.browserName,
                            a = c.ConfigNS.getValue("Motitor", i, 2);
                        2 === a && c.ConfigNS.setValue("Motitor", i, 1);
                        let o = n.name;
                        void 0 !== o && null !== o && "" !== o && 0 !== a && (void 0 !== e && null !== e && "" !== e ? "edge" === o || "edgecp" === o ? e += "edge||edgecp||" : e = e + o + "||" : e = "edge" === o || "edgecp" === o ? "edge||edgecp||" : o + "||")
                    }
                    h.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", e), p.information("leave writeNewBrowserToConfigINI", e)
                })
            }

            getShortThunderVersion() {
                let e = "";
                do {
                    let t = a.join(__rootDir, "../../Thunder.exe"), n = g.getFileVersion(t);
                    if (null === n || void 0 === n || "" === n) break;
                    let i = n.split(/\./);
                    null !== i && void 0 !== i && i.length >= 3 && (e = i[0] + "." + i[1] + "." + i[2])
                } while (0);
                return e
            }

            setInstallWatchBrowserList() {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (null === this.browserconfig || void 0 === this.browserconfig) break;
                        if (null === this.browserconfig.browsers || void 0 === this.browserconfig.browsers) break;
                        let e = this.browserconfig.browsers;
                        if (null === e || void 0 === e || e.browser.length <= 0) break;
                        for (let t = 0; t < e.browser.length; ++t) {
                            let n = e.browser[t], i = !1;
                            "appReg" === n.type ? i = yield this.checkInstallByappReg(n) : "appPath" === n.type && (i = this.checkInstallByappPath(n)), i && this.installWatchBrowsers.push(n)
                        }
                        p.information("配置初始化时,安装的浏览器:", this.installWatchBrowsers)
                    } while (0)
                })
            }

            checkInstallByappReg(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (null === e || void 0 === e) break;
                        if (null === e.reg || void 0 === e.reg) break;
                        let n = e.reg.regRoot;
                        if (null === n || void 0 === n || "" === n) break;
                        let i = e.reg.regKey;
                        if (null === i || void 0 === i || "" === i) break;
                        let r = e.reg.regName, s = g.queryRegValue(n, i, r);
                        if (p.information("checkInstallByappReg:", s, n, i, r), null === s || void 0 === s || "" === s) break;
                        s = this.getPathFromRegString(s);
                        let l = g.getLongPathName(s);
                        null !== l && void 0 !== l && "" !== l && (s = l);
                        let u = e.proName, d = u.toLowerCase();
                        if (s.toLowerCase().search(d) < 0) {
                            let e = a.extname(s);
                            if (void 0 === e || null === e || "" === e) s = a.join(s, u); else {
                                let e = a.dirname(s);
                                s = a.join(e, u)
                            }
                            if (!(t = yield o.FileSystemAWNS.existsAW(s))) {
                                let e = a.dirname(s);
                                s = this.getFilePathByDir(e, u)
                            }
                        }
                        t || (t = yield o.FileSystemAWNS.existsAW(s))
                    } while (0);
                    return t
                })
            }

            getPathFromRegString(e) {
                let t = e, n = t.search(/\,/);
                return n >= 0 && (t = t.substring(0, n)), t = t.replace(/\"/g, "")
            }

            getFilePathByDir(e, t) {
                return p.information("getFilePathByDir:", e, t), ""
            }

            checkInstallByappPath(e) {
                let t = !1;
                do {
                    if (null === e || void 0 === e) break;
                    if (null === e.filePath || void 0 === e.filePath || "" === e.filePath) break;
                    let n = g.getSystemTempPath();
                    if (null === n || void 0 === n || "" === n) break;
                    let i = n.substring(0, 1);
                    if (null === i || void 0 === i || "" === i) break;
                    i += ":\\";
                    let o = a.join(i, e.filePath);
                    t = g.queryFileExists(o)
                } while (0);
                return t
            }

            setConfigShowBrowsers() {
                do {
                    let e = {browserName: "IE浏览器", icoUrl: ""};
                    if (this.configShowBrowsers.push(e), void 0 === this.installWatchBrowsers || null === this.installWatchBrowsers || this.installWatchBrowsers.length <= 0) break;
                    for (let e = 0; e < this.installWatchBrowsers.length; ++e) {
                        let t = this.installWatchBrowsers[e], n = !1;
                        for (let e = 0; e < this.configShowBrowsers.length; ++e) {
                            let i = this.configShowBrowsers[e];
                            if (i.browserName.toLowerCase() === t.browserName.toLowerCase()) {
                                null !== i.icoUrl && void 0 !== i.icoUrl && "" !== i.icoUrl || (this.configShowBrowsers[e].icoUrl = t.icoUrl), n = !0;
                                break
                            }
                        }
                        n || this.configShowBrowsers.push(t)
                    }
                } while (0)
            }
        }
    }(t.SettingConfigHelperNS || (t.SettingConfigHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(17), o = n(2), r = n(1), s = n(7), l = n(10), u = n(23), d = n(25), c = n(839),
        h = r.default.getLogger("Config"), f = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

    class g extends d.Config {
        init(e) {
            return i(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    if (this.configPath = e, yield l.FileSystemAWNS.existsAW(e)) {
                        let t = yield l.FileSystemAWNS.readFileAW(e);
                        if (t) {
                            let e = null;
                            try {
                                e = c.IniNS.parse(t.toString())
                            } catch (e) {
                                h.warning(e)
                            }
                            this.isInit = !0, this.mergeConfigData(e), this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventBHOConfigInitFinished)
                        }
                    } else {
                        let t = o.dirname(e);
                        yield l.FileSystemAWNS.mkdirsAW(t), this.isInit = !0, this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventBHOConfigInitFinished)
                    }
                }
            })
        }

        save() {
            return i(this, void 0, void 0, function* () {
                if (null !== this.configPath && void 0 !== this.configPath && "" !== this.configPath && this.isInit) {
                    let e = c.IniNS.stringify(this.configData);
                    yield l.FileSystemAWNS.writeFileAW(this.configPath, e)
                }
            })
        }

        saveSync() {
            let e = c.IniNS.stringify(this.configData);
            null !== this.configPath && void 0 !== this.configPath && "" !== this.configPath && this.isInit && a.writeFileSync(this.configPath, e)
        }

        fireValueChangedEvent(e, t, n, i) {
            this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventBHOConfigValueChanged, e, t, n, i)
        }

        attachListener(e, t) {
            do {
                if (e === u.NodeEventMesssageNS.eventBHOConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }
    }

    t.BHOConfig = g;
    const p = new g;
    !function (e) {
        e.init = function () {
            return i(this, void 0, void 0, function* () {
                let e = f.getAppDataLocalLowPath();
                if (null !== e && void 0 !== e && "" !== e) {
                    let t = o.join(e, "Thunder Network\\Thunder\\BHO\\config.ini");
                    yield p.init(t)
                }
            })
        }, e.getDefaultExtendNames = function () {
            return ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;.pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;.deb;.sisx;.cab;.pxl;.xlb;"
        }, e.save = function () {
            return i(this, void 0, void 0, function* () {
                yield p.save()
            })
        }, e.saveSync = function () {
            p.saveSync()
        }, e.getValue = function (e, t, n) {
            return p.getValue(e, t, n)
        }, e.setValue = function (e, t, n) {
            p.setValue(e, t, n)
        }, e.attachListener = function (e, t) {
            p.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            p.detachListener(e, t)
        }
    }(t.BHOConfigNS || (t.BHOConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1).default.getLogger("msg-queue");
    !function (e) {
        let t;
        !function (e) {
            e[e.Community = 0] = "Community", e[e.AdvertisementMarket = 1] = "AdvertisementMarket", e[e.AdvertisementFunctional = 2] = "AdvertisementFunctional", e[e.Download = 3] = "Download"
        }(t = e.MsgPriority || (e.MsgPriority = {}));
        e.Queue = class {
            constructor() {
                this.queue = [], this.priority = 0
            }

            enQueue(e) {
                let t = !1;
                i.information("消息队列增加消息", this.queue);
                for (let n = 0; n < this.queue.length; n++) if (this.queue[n].priority >= e.priority) {
                    t = !0, this.queue.splice(n, 0, e);
                    break
                }
                t || this.queue.push(e)
            }

            deQueue() {
                if (0 !== this.queue.length) {
                    let e = this.queue.pop();
                    this.priority = e.priority, void 0 !== e.callback && "function" == typeof e.callback && (i.information("消息队列弹出消息", this.queue), e.callback())
                }
            }

            clearQueuesByName(e) {
                let t = [];
                for (let n = 0; n < this.queue.length; n++) this.queue[n].name !== e && t.push(this.queue[n]);
                this.queue = t
            }

            isEmpty() {
                return 0 === this.queue.length
            }

            getCurrentProperty() {
                return this.priority
            }
        }
    }(t.MsgQueueNS || (t.MsgQueueNS = {}))
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(59), r = n(1), s = n(8), l = n(148), u = n(32), d = n(867), c = n(195), h = n(85), f = n(23),
        g = n(13), p = n(132), k = n(136), m = n(25), T = n(33), v = n(566), C = n(90), S = n(14), y = n(267),
        w = n(77), I = n(286), b = n(588), A = n(105), N = n(74), D = n(6), _ = n(2), x = n(581), E = n(28), P = n(53),
        M = n(82), F = n(734), O = r.default.getLogger("Thunder.ContextMenu"),
        U = C.DownloadKernelCategoryManager.getCategoryManager(), L = u.DownloadKernelTaskManager.getTaskManager(),
        B = I.GroupAccelerateManagerNS.getManager(), K = b.GroupAccelerateWebManagerNS.getManager(),
        V = x.SubtitleManagerNS.getSubtitleManger();
    var R;
    !function (e) {
        e[e.Unknown = 0] = "Unknown", e[e.DownloadingCategory = 1] = "DownloadingCategory", e[e.DownloadingBlank = 2] = "DownloadingBlank", e[e.DownloadingItem = 3] = "DownloadingItem", e[e.CompletedCategory = 4] = "CompletedCategory", e[e.CompletedItem = 5] = "CompletedItem", e[e.RecycleCategory = 6] = "RecycleCategory", e[e.RecycleBlank = 7] = "RecycleBlank", e[e.RecycleItem = 8] = "RecycleItem", e[e.ToolbarMore = 9] = "ToolbarMore", e[e.ChangeCategory = 10] = "ChangeCategory", e[e.PrivateSpaceHome = 11] = "PrivateSpaceHome", e[e.SearchMultiSel = 12] = "SearchMultiSel", e[e.Upper = 13] = "Upper"
    }(R = t.DownloadMenuType || (t.DownloadMenuType = {}));
    t.downloadContextMenu = new class {
        constructor() {
            this.contextInfo = [], this.count = 0, this.categoryId = -1, this.emitter = null, this.searchMode = !1, this.shouleiDownloadEnable = !0, this.emitter = new o.EventEmitter
        }

        setContextInfo(e, t, n, i) {
            this.contextInfo = e, D.isNullOrUndefined(n) || (this.count = n), D.isNullOrUndefined(t) || (this.categoryId = t), D.isNullOrUndefined(i) ? this.searchMode = !1 : this.searchMode = i
        }

        canDownloadByShoulei() {
            let e = !0;
            do {
                if (0 === M.default.getConfigInfo("shouleiDownload", "enable") && (this.shouleiDownloadEnable = !1), !this.shouleiDownloadEnable) {
                    e = !1;
                    break
                }
                if (null === this.contextInfo || 0 === this.contextInfo.length || this.contextInfo.length > 1) {
                    e = !1;
                    break
                }
                if (this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Group) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        getShouleiDownloadUrl() {
            let e = "";
            do {
                if (!this.canDownloadByShoulei()) break;
                let t = this.contextInfo[0];
                if (t.taskType === s.DownloadKernel.TaskType.Emule || t.taskType === s.DownloadKernel.TaskType.P2sp) {
                    e = t.url;
                    break
                }
                if (t.taskType === s.DownloadKernel.TaskType.Bt) {
                    e = "magnet:?xt=urn:btih:" + L.getTaskFromTaskId(t.taskId).getExtraObject().getInfoId();
                    break
                }
            } while (0);
            return e
        }

        statShouleiDownload(e) {
            O.information("statShouleiDownload categoryName, categoryId = ", e, this.categoryId), -1 !== this.categoryId ? g.XLStatNS.trackEvent("download_leftpanel", "tasklist_rk", "", 0, 0, 0, 0, "panel_type=private,tab=" + e) : g.XLStatNS.trackEvent("download_leftpanel", "tasklist_rk", "", 0, 0, 0, 0, "panel_type=mypc,tab=" + e)
        }

        attachListener(e, t) {
            this.emitter.addListener(e, t)
        }

        detachListener(e, t) {
            this.emitter.removeListener(e, t)
        }

        popMenu(e) {
            return i(this, void 0, void 0, function* () {
                switch (e) {
                    case R.DownloadingCategory: {
                        let e = this.contextInfo.canStartAll, t = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadSelectAll
                        }, {
                            type: "normal",
                            label: "全部开始",
                            enabled: e,
                            id: d.ContextMenuIdsNS.contextMenuDownloadStartAll
                        }, {type: "normal", label: "全部暂停", id: d.ContextMenuIdsNS.contextMenuDownloadPauseAll}];
                        this.popMenuInternal(t)
                    }
                        break;
                    case R.CompletedCategory: {
                        let e = this.contextInfo.currentCategoryId,
                            t = l.TaskStatusHelper.canMarkAsOpened(this.contextInfo.completedTaskBaseList), n = [{
                                type: "submenu",
                                label: "排序",
                                submenu: this.getSortSubMenuOptions(this.contextInfo)
                            }, {
                                type: "normal",
                                label: "全选(&A)",
                                id: d.ContextMenuIdsNS.contextMenuDownloadSelectAll
                            }, {
                                type: "normal",
                                label: "删除不存在任务",
                                id: d.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting
                            }, {
                                type: "normal",
                                label: "全部标记为已打开",
                                id: d.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                                enabled: t
                            }];
                        -1 !== e && (n = [{
                            type: "normal",
                            label: "全部标记为已打开",
                            id: d.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                            enabled: t
                        }]), this.popMenuInternal(n)
                    }
                        break;
                    case R.RecycleCategory: {
                        let e = !0;
                        null !== this.contextInfo && 0 !== this.contextInfo.length || (e = !1);
                        let t = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadSelectAll
                        }, {
                            type: "normal",
                            label: "清空垃圾箱",
                            id: d.ContextMenuIdsNS.contextMenuDownloadClear,
                            enabled: e
                        }];
                        this.popMenuInternal(t)
                    }
                        break;
                    case R.DownloadingBlank: {
                        let e = [{
                            type: "normal",
                            label: "导入未完成任务(&I)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadImportUncomplete
                        }];
                        this.popMenuInternal(e)
                    }
                        break;
                    case R.DownloadingItem:
                        if (null !== this.contextInfo && this.contextInfo.length > 0) {
                            let e = [], t = l.TaskStatusHelper.canMoveSelectedTask(void 0, this.contextInfo);
                            -1 === this.categoryId ? ((e = yield this.getLastestSavePathsOptions(t, "MoveToDir", "LatestSavePath")).push({
                                type: "normal",
                                label: "私人空间",
                                enabled: t,
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), e.push({
                                type: "normal",
                                label: "其他目录",
                                enabled: t,
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "downloading_rk_move_click",
                                extData: "button=other"
                            })) : e.push({
                                type: "normal",
                                label: "移出私人空间",
                                enabled: t,
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            });
                            let n = yield this.canSelectTaskAcc(this.contextInfo),
                                i = l.TaskStatusHelper.canDeleteSelectedTask(void 0, this.contextInfo), a = [];
                            if (this.canDownloadByShoulei() && (this.statShouleiDownload("downloading"), a.push({
                                type: "normal",
                                label: "用手机下载",
                                icon: `${__rootDir}/static/icon/phone.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadByShoulei,
                                statId: "downloading_rk_send2phone_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            })), -1 === this.categoryId ? a.push({
                                type: "normal",
                                label: "删除(&D)",
                                enabled: i,
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "downloading_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                enabled: i,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {type: "submenu", label: "移动文件到", submenu: e}) : a.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                enabled: i,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {
                                type: "submenu",
                                label: "移动文件到",
                                submenu: e
                            }), !this.searchMode && this.count > 3 && this.contextInfo.length !== this.count && a.splice(4, 0, {
                                type: "normal",
                                label: "上移到顶部",
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveTop
                            }, {
                                type: "normal",
                                label: "下移到底部",
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveBottom
                            }, {type: "separator"}), 1 === this.contextInfo.length) {
                                if (l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo)) a.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadPause,
                                    statId: "downloading_rk_pause_click"
                                }); else {
                                    let e = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo);
                                    a.unshift({
                                        type: "normal",
                                        label: "开始(&S)",
                                        enabled: e,
                                        icon: `${__rootDir}/static/icon/startalltask.png`,
                                        id: d.ContextMenuIdsNS.contextMenuDownloadStart,
                                        statId: "downloading_rk_start_click"
                                    })
                                }
                                let e = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(this.contextInfo[0]);
                                a.splice(0, 0, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "downloading_rk_openfolders_click",
                                    enabled: e,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), this.searchMode && a.splice(1, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: d.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                });
                                let t = 2;
                                L.getTaskFromTaskId(this.contextInfo[0].taskId).isSupportPlay() ? a.splice(t, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: d.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "downloading_rk_subtitlesearch_click"
                                }, {type: "separator"}) : a.splice(t, 0, {type: "separator"}), this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt ? a.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "downloading_rk_torrentsave_click"
                                }, {
                                    type: "normal",
                                    label: "复制磁力链接",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "downloading_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }) : a.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            } else {
                                let e = l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo),
                                    t = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo);
                                e && a.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadPause
                                }), t && a.unshift({
                                    type: "normal",
                                    label: "开始(&S)",
                                    icon: `${__rootDir}/static/icon/startalltask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadStart
                                });
                                let n = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo);
                                a.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    enabled: n,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            }
                            this.popMenuInternal(a)
                        }
                        break;
                    case R.CompletedItem:
                        if (null !== this.contextInfo && this.contextInfo.length > 0) {
                            let e = [], t = l.TaskStatusHelper.canDeleteSelectedTask(void 0, this.contextInfo),
                                n = l.TaskStatusHelper.canMoveSelectedTask(void 0, this.contextInfo);
                            if (this.canDownloadByShoulei() && (this.statShouleiDownload("finished"), e.push({
                                type: "normal",
                                label: "用手机下载",
                                icon: `${__rootDir}/static/icon/phone.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadByShoulei,
                                statId: "finished_rk_send2phone_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            })), -1 === this.categoryId ? e.push({
                                type: "normal",
                                label: "删除(&D)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "finished_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "finished_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }) : e.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), e.push({
                                type: "normal",
                                label: "重新下载(&T)",
                                icon: `${__rootDir}/static/icon/redownload.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadRedownload,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), -1 === this.categoryId) {
                                let t = yield this.getLastestSavePathsOptions(!0, "CopyToDir", "LatestSavePath", !0);
                                t.push({
                                    type: "normal",
                                    label: "其他目录",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyFileOther,
                                    statId: "finished_rk_copyfiles_click",
                                    extData: "button=other"
                                }), e.splice(2, 0, {type: "submenu", label: "复制文件到", submenu: t})
                            }
                            let i = [];
                            if (-1 === this.categoryId ? ((i = yield this.getLastestSavePathsOptions(n, "MoveToDir", "LatestSavePath")).push({
                                type: "normal",
                                label: "私人空间",
                                enabled: n,
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), i.push({
                                type: "normal",
                                label: "其他目录",
                                enabled: n,
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "finished_rk_move_click",
                                extData: "button=other"
                            })) : i.push({
                                type: "normal",
                                label: "移出私人空间",
                                enabled: n,
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), e.splice(2, 0, {type: "separator"}, {
                                type: "submenu",
                                label: "移动文件到",
                                submenu: i
                            }), 1 === this.contextInfo.length) {
                                e.splice(2, 0, {
                                    type: "normal",
                                    label: "重命名(&R)",
                                    enabled: !this.contextInfo[0].isMoving,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadRename,
                                    statId: "finished_rk_rename_click"
                                });
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(this.contextInfo[0]),
                                    n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.contextInfo[0]);
                                e.splice(0, 0, {
                                    type: "normal",
                                    label: "打开文件(&O)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFile,
                                    statId: "finished_rk_openfiles_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    enabled: n,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "finished_rk_openfolders_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    enabled: t,
                                    userData: this.searchMode
                                }), this.searchMode && e.splice(2, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: d.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                });
                                let i = 2;
                                B.canEnterGroupAccelerate(this.contextInfo[0].taskId) && (e.splice(i, 0, {
                                    type: "normal",
                                    label: "组队加速",
                                    icon: `${__rootDir}/static/icon/groupaccelerate.png`,
                                    id: d.ContextMenuIdsNS.contextMenuGroupAccelerate,
                                    statId: "finished_rk_groupspeedup_click"
                                }), i += 1), L.getTaskFromTaskId(this.contextInfo[0].taskId).isSupportPlay() ? e.splice(i, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: d.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "finished_rk_subtitlesearch_click"
                                }, {type: "separator"}) : e.splice(i, 0, {type: "separator"}), this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt ? e.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "finished_rk_torrent_click"
                                }, {
                                    type: "normal",
                                    label: "复制磁力链接",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "finished_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                }) : e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            } else {
                                let t = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo);
                                e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            }
                            this.popMenuInternal(e)
                        }
                        break;
                    case R.RecycleBlank: {
                        let e = !0;
                        null !== this.contextInfo && 0 === this.contextInfo.length && (e = !1);
                        let t = [{
                            type: "normal",
                            label: "清空(&B)",
                            enabled: e,
                            id: d.ContextMenuIdsNS.contextMenuDownloadClear
                        }];
                        this.popMenuInternal(t)
                    }
                        break;
                    case R.RecycleItem:
                        if (null !== this.contextInfo && this.contextInfo.length > 0) {
                            let e = [{
                                type: "normal",
                                label: "打开任务位置(&G)",
                                id: d.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                statId: "openfile_position_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }, {
                                type: "normal",
                                label: "还原(&R)",
                                id: d.ContextMenuIdsNS.contextMenuDownloadRecover,
                                statId: "dustbin_rk_undo_click"
                            }, {
                                type: "normal",
                                label: "清空(&B)",
                                id: d.ContextMenuIdsNS.contextMenuDownloadClear,
                                statId: "dustbin_rk_clear_click"
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "dustbin_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }, {type: "separator"}, {
                                type: "normal",
                                label: "重新下载(&T)",
                                icon: `${__rootDir}/static/icon/redownload.png`,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                id: d.ContextMenuIdsNS.contextMenuDownloadRedownload
                            }];
                            if (this.searchMode || e.shift(), 1 === this.contextInfo.length) {
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(this.contextInfo[0]),
                                    n = this.contextInfo[0].taskStatus;
                                if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                                    let n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.contextInfo[0]);
                                    e.splice(2, 0, {type: "separator"}, {
                                        type: "normal",
                                        label: "打开文件(&O)",
                                        id: d.ContextMenuIdsNS.contextMenuDownloadFile,
                                        categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                        statId: "dustbin_rk_openfiles_click",
                                        enabled: n,
                                        userData: this.searchMode
                                    }, {
                                        type: "normal",
                                        label: "打开文件夹(&F)",
                                        id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                        statId: "dustbin_rk_openfolders_click",
                                        enabled: t,
                                        userData: this.searchMode,
                                        categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                    })
                                } else e.splice(2, 0, {type: "separator"}, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "dustbin_rk_openfolders_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                });
                                this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt ? e.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs
                                }, {
                                    type: "normal",
                                    label: "复制磁力链接",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                }) : e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "dustbin_rk_copyurl_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                }), this.canDownloadByShoulei() && (this.statShouleiDownload("dustbin"), e.splice(2, 0, {type: "separator"}, {
                                    type: "normal",
                                    label: "用手机下载",
                                    icon: `${__rootDir}/static/icon/phone.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadByShoulei,
                                    statId: "dustbin_rk_send2phone_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                }))
                            } else {
                                e.splice(1, 0, {type: "separator"});
                                let t = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo);
                                e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "dustbin_rk_copyurl_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                })
                            }
                            this.popMenuInternal(e)
                        }
                        break;
                    case R.ToolbarMore:
                        if (null !== this.contextInfo) {
                            let e = this.contextInfo.currentSelectdTaskInfos,
                                t = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e), n = [{
                                    type: "normal",
                                    label: "彻底删除任务",
                                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreDestroy,
                                    icon: `${__rootDir}/static/icon/destroytask.png`,
                                    enabled: t,
                                    statId: "top_morelist_click",
                                    extData: "button=completedelete"
                                }, {
                                    type: "submenu",
                                    label: "排序",
                                    submenu: this.getSortSubMenuOptions(this.contextInfo)
                                }, {
                                    type: "normal",
                                    label: "设置中心",
                                    icon: `${__rootDir}/static/icon/config.png`,
                                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreConfig,
                                    statId: "top_morelist_click",
                                    extData: "button=setting"
                                }, {
                                    type: "normal",
                                    label: "搜索下载记录",
                                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch,
                                    statId: "top_morelist_click",
                                    extData: "button=searchtask"
                                }];
                            this.popMenuInternal(n), g.XLStatNS.trackEvent("download_detail", "help_tips_entry_show", "", 0, 0, 0, 0, "position=dl_page")
                        }
                        break;
                    case R.ChangeCategory: {
                        let e = [{
                            type: "checkbox",
                            label: "我的电脑",
                            id: d.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer,
                            checked: -1 === this.contextInfo,
                            statId: "top_dropdownlist_click",
                            extData: "button=computer"
                        }, {
                            type: "checkbox",
                            label: "私人空间",
                            id: d.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace,
                            checked: -1 !== this.contextInfo,
                            statId: "top_dropdownlist_click",
                            extData: "button=private"
                        }];
                        this.popMenuInternal(e)
                    }
                        break;
                    case R.PrivateSpaceHome: {
                        let e = [{
                            type: "normal",
                            label: "全选",
                            id: d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll
                        }, {
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {type: "separator"}, {
                            type: "normal",
                            label: "私人空间下载设置",
                            id: d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting
                        }, {
                            type: "normal",
                            label: "修改私人空间密码",
                            id: d.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange
                        }];
                        this.popMenuInternal(e)
                    }
                        break;
                    case R.SearchMultiSel: {
                        let e = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo), t = [{
                            type: "normal",
                            label: "删除(&D)",
                            icon: `${__rootDir}/static/icon/deletetask.png`,
                            id: d.ContextMenuIdsNS.contextMenuDownloadDelete,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "彻底删除(&Q)",
                            icon: `${__rootDir}/static/icon/destroytask.png`,
                            id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "复制下载链接(&C)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                            enabled: e,
                            userData: this.searchMode
                        }];
                        this.popMenuInternal(t)
                    }
                }
            })
        }

        getSortConfig(e) {
            let t = {sortBy: v.SortNS.SortType.Default, asce: !0};
            do {
                if (null === e || void 0 === e) break;
                let n = e.currentCategoryViewId;
                if (null === n || void 0 === n) break;
                let i = e.currentCategoryId;
                t = v.SortNS.getSortConfig(n, i)
            } while (0);
            return t
        }

        getSortSubMenuOptions(e) {
            let t = [];
            do {
                if (null === e || void 0 === e) break;
                let n = e.currentCategoryViewId;
                if (null === n || void 0 === n) break;
                let i = this.getSortConfig(e);
                O.information("sort_by", i);
                let a = i.sortBy === v.SortNS.SortType.ByTime_Remain || i.sortBy === v.SortNS.SortType.ByTime_Creation || i.sortBy === v.SortNS.SortType.ByTime_Completion,
                    o = "按时间", r = "";
                n === s.DownloadKernel.CategroyViewID.Downloading ? (o = "按创建时间", r = "downloading_rk_rank_click") : n === s.DownloadKernel.CategroyViewID.Completed ? (o = "按完成时间", r = "finished_rk_rank_click") : n === s.DownloadKernel.CategroyViewID.Recycle && (o = "按删除时间", r = "dustbin_rk_rank_click"), t = [{
                    type: "checkbox",
                    label: "默认",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault,
                    statId: r,
                    extData: "rank_type=default",
                    checked: i.sortBy === v.SortNS.SortType.Default
                }, {
                    type: "checkbox",
                    label: o,
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime,
                    checked: a,
                    statId: r,
                    extData: "rank_type=create_time",
                    userData: a ? i.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件名 A-Z",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByName,
                    checked: i.sortBy === v.SortNS.SortType.ByName,
                    statId: r,
                    extData: "rank_type=file_name",
                    userData: i.sortBy === v.SortNS.SortType.ByName ? i.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件大小",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize,
                    checked: i.sortBy === v.SortNS.SortType.BySize,
                    statId: r,
                    extData: "rank_type=file_size",
                    userData: i.sortBy === v.SortNS.SortType.BySize ? i.asce : void 0
                }], n === s.DownloadKernel.CategroyViewID.Downloading && t.splice(2, 0, {
                    type: "checkbox",
                    label: "按当前进度",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress,
                    checked: i.sortBy === v.SortNS.SortType.ByProgress,
                    statId: r,
                    extData: "rank_type=progress_speed",
                    userData: i.sortBy === v.SortNS.SortType.ByProgress ? i.asce : void 0
                })
            } while (0);
            return t
        }

        getLastestSavePathsOptions(e, t, n, a) {
            return i(this, void 0, void 0, function* () {
                let i = m.ConfigNS.getValue(t, n, []), o = [],
                    r = d.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest;
                a && (r = d.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest);
                for (let t of i) {
                    let n = /&/gi;
                    t = t.replace(n, "&&"), o.push({type: "normal", label: t, enabled: e, id: r})
                }
                return o
            })
        }

        handleMenuClick(e) {
            let t = e.id, n = e.label, a = e.categoryView;
            switch (t) {
                case d.ContextMenuIdsNS.contextMenuDownloadSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.completedTaskBaseList || null === this.contextInfo.completedTaskBaseList) break;
                        if (0 === this.contextInfo.completedTaskBaseList.length) break;
                        h.TaskOperatorNs.removeNonExistingTask(this.contextInfo.completedTaskBaseList).catch(e => {
                            O.warning(e)
                        })
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadAsReadedAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.completedTaskBaseList || null === this.contextInfo.completedTaskBaseList) break;
                        if (0 === this.contextInfo.completedTaskBaseList.length) break;
                        h.TaskOperatorNs.markReadStatus(this.contextInfo.completedTaskBaseList, 1)
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadImportUncomplete:
                    h.TaskOperatorNs.importUncompleted();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadFolder:
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfolders_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && (h.TaskOperatorNs.openTaskFolder(this.contextInfo[0]).catch(e => {
                        O.warning(e)
                    }), void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(this.contextInfo, 1));
                    break;
                case d.ContextMenuIdsNS.contextMenuGroupAccelerate:
                    a === s.DownloadKernel.CategroyViewID.Downloading ? K.openGroupAccelerateTabByTaskId(this.contextInfo[0].taskId, "menu", "downloading", void 0).catch() : K.openGroupAccelerateTabByTaskId(this.contextInfo[0].taskId, "menu", "complete", void 0).catch();
                    break;
                case d.ContextMenuIdsNS.contxtMenuSubtitleSearch: {
                    let e = this.contextInfo[0].taskId, t = L.getTaskFromTaskId(e), n = t.getTaskName(),
                        i = t.getType(), a = "";
                    t && (a = t.getSavePath()), i === s.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (a = _.join(a, n));
                    let o = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId), r = V.getDisaplayName(e),
                        l = 0;
                    (l = r.length) > 1 ? T.MessageBox.custom("SubtitleTaskFilelist", {
                        size: "large",
                        taskId: e,
                        taskName: n,
                        taskType: i,
                        fileList: r,
                        saveDir: a,
                        categoryViewId: o
                    }, {
                        center: !0,
                        width: 460,
                        height: 358
                    }).catch() : T.MessageBox.custom("SubtitleSearch", {
                        size: "large",
                        taskId: e,
                        taskName: r[0].fileName,
                        cid: r[0].cid,
                        saveDir: a,
                        from: "taskList",
                        categoryViewId: o
                    }, {center: !0, width: 460, height: 358}).catch()
                }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadStartAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.downloadingTaskBaseList || null === this.contextInfo.downloadingTaskBaseList) break;
                        if (0 === this.contextInfo.downloadingTaskBaseList.length) break;
                        h.TaskOperatorNs.startAll()
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadStart:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.startTasks(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadPauseAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.downloadingTaskBaseList || null === this.contextInfo.downloadingTaskBaseList) break;
                        if (0 === this.contextInfo.downloadingTaskBaseList.length) break;
                        h.TaskOperatorNs.pauseTasks(this.contextInfo.downloadingTaskBaseList, s.DownloadKernel.TaskStopReason.ContextMenu)
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadPause:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.pauseTasks(this.contextInfo, s.DownloadKernel.TaskStopReason.ContextMenu);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadDelete:
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_delete_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.deleteTasks(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadDestroy:
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_completedelete_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.destroyTasks(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace:
                    this.contextInfo.length > 0 && w.default(!1, !0, "privatespace").then(e => i(this, void 0, void 0, function* () {
                        if (e && "" !== e) {
                            let t = 0;
                            if (!1 === y.PrivateSpaceHelperNS.isPrivateSpaceOpen(e) && 0 !== (t = yield y.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(e))) return;
                            if (0 === (t = yield y.PrivateSpaceHelperNS.openPrivateCategory(e)) && 0 === (t = yield y.PrivateSpaceHelperNS.accessPrivateCategory(e))) {
                                let t = yield y.PrivateSpaceHelperNS.getPrivateSavePath(e);
                                if (t = _.join(t, e), yield h.TaskOperatorNs.move2Dir(this.contextInfo, t, !1)) {
                                    let t = U.getPrivateCategoryFromUserId(e);
                                    t && h.TaskOperatorNs.moveCategoryTask(this.contextInfo, t.getId())
                                }
                            }
                        }
                    })).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace:
                    if (this.contextInfo.length > 0) {
                        let e = m.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                        null !== e && void 0 !== e && "" !== e || (e = m.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), h.TaskOperatorNs.move2Dir(this.contextInfo, e, !1).then(e => {
                            e && U.getCurrentPrivateCategory() && h.TaskOperatorNs.moveCategoryTask(this.contextInfo, -1)
                        }).catch()
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFileOther:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.move2Dir(this.contextInfo).catch(e => {
                        O.warning(e)
                    });
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest:
                    if (this.contextInfo.length > 0) {
                        let e = /&&/gi, t = n.replace(e, "&");
                        h.TaskOperatorNs.move2Dir(this.contextInfo, t).catch(e => {
                            O.warning(e)
                        })
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveTop:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_up");
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveBottom:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_down");
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMerge:
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadVipAcc:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.vipAcclerate(this.contextInfo).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyLink:
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_copylink_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.copyLink(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet:
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_copylink_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.copyMagnetLink(this.contextInfo[0]);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.saveAsTorrent(this.contextInfo[0]).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadFile: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfiles_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = "";
                    if (e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? t = "finished" : e.categoryView === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin"), this.contextInfo.length > 0) {
                        if (this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt) {
                            let e = L.getTaskFromTaskId(this.contextInfo[0].taskId);
                            p.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                                e ? h.TaskOperatorNs.openTaskItem(this.contextInfo[0]).catch() : h.TaskOperatorNs.openTaskFolder(this.contextInfo[0], !0).catch()
                            }).catch()
                        } else if (this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Group) {
                            let e = L.getTaskFromTaskId(this.contextInfo[0].taskId);
                            h.TaskOperatorNs.executeInstallFile(e).then(e => {
                                e || h.TaskOperatorNs.openTaskFolder(this.contextInfo[0], !0).catch()
                            }).catch()
                        } else h.TaskOperatorNs.openTaskItem(this.contextInfo[0], void 0, void 0, t, this.categoryId).catch(e => {
                            O.warning(e)
                        });
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(this.contextInfo, 1)
                    }
                }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadRename:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.renameTask(this.contextInfo[0]);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyFileOther:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.copy2Dir(this.contextInfo).catch(e => {
                        O.warning(e)
                    });
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest:
                    if (this.contextInfo.length > 0) {
                        let e = /&&/gi, t = n.replace(e, "&");
                        h.TaskOperatorNs.copy2Dir(this.contextInfo, t).catch(e => {
                            O.warning(e)
                        })
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadRedownload:
                    if (this.contextInfo.length > 0) {
                        let e = "";
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed ? e = "finished_rk_reload_click" : a === s.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin_rk_reload_click"), c.TaskCtrlOperatorNS.redownloadTask(this.contextInfo, void 0, e).catch()
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadRecover:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.recoverTask(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadClear:
                    h.TaskOperatorNs.clearRecycle();
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreConfig:
                    if (null !== this.contextInfo) {
                        let e = {tabType: k.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                        g.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=download_panel"), this.contextInfo.CREATE_NEW_TAB(e)
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreOpenHelp:
                    if (null !== this.contextInfo) {
                        let e = {
                            tabType: k.TabType.Chromium,
                            tabParam: {
                                title: "下载帮助",
                                url: "http://pc.xunlei.com/pages/#/help",
                                name: "下载帮助",
                                showUrl: !0
                            }
                        };
                        g.XLStatNS.trackEvent("download_detai", "help_tips_entry_show", "", 0, 0, 0, 0, "position=dl_panel"), this.contextInfo.CREATE_NEW_TAB(e)
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch:
                    N.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !0);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.Default, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByTime, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByType:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByType, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByName:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByName, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.BySize, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByStatus:
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByProgress, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreDestroy:
                    if (null !== this.contextInfo) {
                        let e = this.contextInfo.currentSelectdTaskInfos;
                        null !== e && void 0 !== e && e.length > 0 && h.TaskOperatorNs.destroyTasks(e)
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "my_computer");
                    break;
                case d.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "private_space");
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting:
                    S.default("GetUserID").then(e => i(this, void 0, void 0, function* () {
                        if (e && "" !== e) {
                            let t = m.ConfigNS.getValue("PrivateSpaceDefaultPath", e, ""),
                                n = m.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1);
                            T.MessageBox.custom("private-space-download-setting", {
                                savePath: t,
                                hideLocalDir: 1 === n
                            }).then(t => i(this, void 0, void 0, function* () {
                                t.action === E.MessageBoxNS.Action.OK && (m.ConfigNS.setValue("PrivateSpaceDefaultPath", e, t.args.savePath), m.ConfigNS.setValue("PrivateSpaceLockUserTask", e, t.args.hideLocalDir), y.PrivateSpaceHelperNS.setPrivateSavePath(e, t.args.savePath).then().catch(), y.PrivateSpaceHelperNS.setAllTaskFileHidden(e, 1 === t.args.hideLocalDir))
                            })).catch()
                        }
                    })).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange:
                    S.default("GetUserID").then(e => i(this, void 0, void 0, function* () {
                        e && "" !== e && 0 === (yield y.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(e)) && y.PrivateSpaceHelperNS.changePrivateSpacePassword(e).catch()
                    })).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceTaskManager:
                    T.MessageBox.custom("private-space-task-manager", {}).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuOpenTaskPosition:
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openlocation_click", "", 0, 0, 0, 0, this.getStatExtData(a)), N.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !1), A.ThunderNewTask.selectTask(this.contextInfo[0].taskId);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadByShoulei: {
                    let e = this.getShouleiDownloadUrl();
                    e = "https://mobile.xunlei.com/m/channel.html?from=xunlei10daoliang&taskDownload=" + e + "&scheme=xunleiapp://xunlei.com/sharePage?shareH5=share_H5", F.getBaiduDWZ(e).then(e => {
                        O.information("dwz result = ", e), "" === e && (e = "https://mobile.xunlei.com/m/channel.html?from=xunlei10daoliang"), T.MessageBox.custom("ShouleiQRCode", {data: e}).catch()
                    }).catch(() => {
                        T.MessageBox.custom("ShouleiQRCode", {data: "https://mobile.xunlei.com/m/channel.html?from=xunlei10daoliang"}).catch()
                    })
                }
            }
        }

        getStatExtData(e) {
            let t = "mypc";
            -1 !== N.default.getCurrentCategoryId() && (t = "private");
            let n = "unknown";
            switch (e) {
                case s.DownloadKernel.CategroyViewID.Completed:
                    n = "finished";
                    break;
                case s.DownloadKernel.CategroyViewID.Downloading:
                    n = "downloading";
                    break;
                case s.DownloadKernel.CategroyViewID.Recycle:
                    n = "dustbin"
            }
            return "panel_type=" + t + ",panel=" + n
        }

        popMenuInternal(e) {
            let t = this.buildMenuTemplate(e);
            if (t.length > 0) {
                const e = a.remote.getCurrentWindow();
                this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuPopup, t);
                const n = a.remote.Menu.buildFromTemplate(t);
                P.MenuSkinNS.setStyle(n, {}), n.popup({
                    window: e,
                    async: !1
                }), this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuEnd)
            }
        }

        canSelectTaskAcc(e) {
            return i(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: t} = yield Promise.resolve().then(() => n(52));
                let i = {enable: !1, text: "会员加速"};
                do {
                    if (void 0 === e) break;
                    if (0 === e.length) break;
                    let n = [];
                    for (let t of e) n.push(t.taskId);
                    let a = t.getVipAccelerateMenuState(n);
                    if (a) {
                        let e = JSON.parse(a);
                        e && (i.enable = e.enable, e.text && (i.text = e.text))
                    }
                } while (0);
                return i
            })
        }

        statExtData(e) {
            let t = "panel_type=mypc";
            return -1 !== this.categoryId && (t = "panel_type=private"), void 0 !== e && "" !== e && (t = t + "," + e), t
        }

        buildMenuTemplate(e) {
            let t = [];
            for (let n = 0; n < e.length; n++) {
                let i = null, a = e[n];
                if ("submenu" === a.type) {
                    let e = this.buildMenuTemplate(a.submenu);
                    i = {type: a.type, label: a.label, submenu: e}
                } else i = "separator" === a.type ? {type: a.type} : {
                    type: a.type,
                    label: a.label,
                    enabled: a.enabled,
                    icon: a.icon,
                    id: a.id,
                    checked: a.checked,
                    click: (e, t, n) => {
                        if (O.verbose(e, t, n), void 0 !== a.statId && "" !== a.statId) {
                            void 0 === a.extData && (a.extData = "");
                            let e = this.statExtData(a.extData);
                            O.information("trackEvent", "download_leftpanel", a.statId, e), g.XLStatNS.trackEvent("download_leftpanel", a.statId, "", 0, 0, 0, 0, e)
                        }
                        this.handleMenuClick(a)
                    }
                };
                null !== i && t.push(i)
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(2), r = n(38), s = n(10), l = n(7), u = n(25), d = n(23), c = n(287), h = n(1), f = n(5),
        g = n(51), p = n(105), k = n(82), m = h.default.getLogger("AdHelperNS"),
        T = l.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    a.default.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
    const v = "1.0", C = "14", S = "1b301990901c336d84fbdd8bc8dda35c";
    !function (e) {
        let t;

        function n(e) {
            let t = "";
            do {
                if (null === e || void 0 === e) break;
                Object.keys(e).forEach(n => {
                    let i = e[n];
                    t = `${t}${n}=${i}`
                }), t = `${t}${S}`, t = r.ToolsUtilitiesAWNS.genarateMd5(t)
            } while (0);
            return t
        }

        function l(e, a, o) {
            return i(this, void 0, void 0, function* () {
                let r = "", s = "";
                s = void 0 === o || null === o || !1 === o ? "" : yield function () {
                    return i(this, void 0, void 0, function* () {
                        let e = t.unLogin;
                        if (yield g.LoginHelperNS.loginHelper.isLoginedAw()) {
                            let n = yield g.LoginHelperNS.loginHelper.getAllUserInfoAw();
                            if (null === n || void 0 === n || null === n.vipList || void 0 === n.vipList || n.vipList.length <= 0) e = t.noVip; else {
                                let i = n.vipList[0], a = Number(i.isVip), o = Number(i.vasType), r = Number(i.isYear);
                                0 === a ? e = t.noVip : 3 === o ? e = 0 !== r ? t.bjN : t.bjVip : 5 === o && (e = 0 !== r ? t.cjN : t.cjVip)
                            }
                        }
                        return e
                    })
                }();
                let l = {
                    appId: C,
                    callId: Date.now(),
                    devicId: T.getPeerID(),
                    identity: s,
                    isAll: 1,
                    positionId: e,
                    shownOrderId: a,
                    v
                };
                return l.sig = n(l), Object.keys(l).forEach(e => {
                    let t = l[e];
                    r = "" === r ? `${e}=${encodeURIComponent(t)}` : `${r}&${e}=${encodeURIComponent(t)}`
                }), r
            })
        }

        function h() {
            let e = "", t = k.default.getConfigInfo("ad", "url");
            return null !== t && void 0 !== t && "" !== t && ("/" === t.slice(t.length - 1) && (t = t.slice(0, t.length - 1)), e = t), 1 === u.ConfigNS.getValue("Ad", "AdServer", 0) && (e = "http://test.api-shoulei-ssl.xunlei.com"), e
        }

        !function (e) {
            e.unLogin = "1", e.noVip = "2", e.bjVip = "21", e.cjVip = "22", e.bjN = "23", e.cjN = "24", e.knVip = "41", e.knN = "42"
        }(t || (t = {})), e.getAdDataAw = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return i
            })
        }, e.statServer = function (e, t, o) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (null === e || void 0 === e || null === t || void 0 === t || null === o || void 0 === o) break;
                    let i = {positionId: e, orderId: t, statType: o, statValue: 1}, r = [];
                    r.push(i);
                    let s = {
                        appId: C,
                        callId: Date.now(),
                        guid: T.getPeerID(),
                        identity: "",
                        items: JSON.stringify(r),
                        positionId: e,
                        v
                    };
                    s.sig = n(s);
                    let l = "";
                    Object.keys(s).forEach(e => {
                        let t = s[e];
                        l = "" === l ? `${e}=${encodeURIComponent(t)}` : `${l}&${e}=${encodeURIComponent(t)}`
                    });
                    let u = `${h()}/api/adp/addStat`, d = null;
                    m.information("statServer:", u, l);
                    try {
                        null !== (d = yield a.default({
                            method: "post",
                            url: u,
                            data: l
                        })) && void 0 !== d && 200 === d.status && void 0 !== d.data && null !== d.data && "" !== d.data && m.information(d.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0)
            })
        }, e.getCurDate = function () {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }, e.onConfigInitAw = function () {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    u.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e(!0)
                    })
                })
            })
        }, e.loadScene = function (e) {
            return i(this, void 0, void 0, function* () {
                m.information("loadScene enter");
                let t = null, n = o.join(e, "index.js");
                return (yield s.FileSystemAWNS.existsAW(n)) && (t = require(n)), m.information("loadScene leave ", t), t
            })
        }, e.execute = function (e, t, n) {
            let i = 0;
            do {
                let a = t;
                if (null !== a && void 0 !== a && "" !== a || (a = n), null === a || void 0 === a || "" === a) break;
                if (e === c.AdCommonNS.OpenType.tab) {
                    f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", a);
                    break
                }
                if (e === c.AdCommonNS.OpenType.app) {
                    let t = "file://";
                    if (a.indexOf(t) < 0) null !== n && void 0 !== n && "" !== n && f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n); else {
                        let r = a.substring(t.length);
                        r = o.join(__rootDir, `../../../${r}`), i = T.shellExecute(0, "open", r, "", "", "SW_SHOW"), m.information("execute:", e, r, i), i <= 32 && null !== n && void 0 !== n && "" !== n && f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
                    }
                    break
                }
                if (e === c.AdCommonNS.OpenType.download) {
                    let e = [];
                    e.push(a), p.ThunderNewTask.createPreNewTaskWindow(e);
                    break
                }
                e === c.AdCommonNS.OpenType.defaultBrowser ? i = T.openURLByDefault(a) : e === c.AdCommonNS.OpenType.ieBrowser && (i = T.openURLByIEorDefault(a))
            } while (0);
            return i
        }
    }(t.AdHelperNS || (t.AdHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(127), o = n(256), r = n(1), s = n(84), l = n(92), u = r.default.getLogger("Thunder.QueryTaskInfo");
    const d = new class extends a.HttpSession {
        constructor() {
            super(), this.lastActiveTaskId = -1, this.curBatchQueryId = void 0, this.timerId = null
        }

        queryP2spTaskInfo(e) {
            return i(this, void 0, void 0, function* () {
                return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), new Promise(t => {
                    this.queryResInfo("url", e).then(e => {
                        let n = {result: 0, gcid: "", fileSize: 0, errCode: 0};
                        e && 200 === e.status && null !== e.data && null !== e.data.code && 0 === e.data.code && "" !== e.data.gcid ? (n.result = e.data.code, n.fileSize = e.data.file_size, n.gcid = e.data.gcid, t(n)) : t(null)
                    }).catch(() => {
                        t(null)
                    })
                })
            })
        }

        asyncBatchQueryP2spTaskInfoByUrl(e, t, n) {
            return i(this, void 0, void 0, function* () {
                if (!e || 0 === e.length) return 0;
                void 0 === this.curBatchQueryId ? this.curBatchQueryId = 1 : this.curBatchQueryId += 1;
                let i = 0;
                for (; i < e.length; ++i) {
                    let n = yield this.queryP2spTaskInfo(e[i]);
                    n && t(e[i], n, i), yield this.delay(200)
                }
                return i >= e.length && n && "function" == typeof n && n(this.curBatchQueryId), this.curBatchQueryId
            })
        }

        postRequestEd2kTaskInfoByEd2kLink(e) {
            return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), new Promise(t => {
                this.host = "hub5idx.shub.sandai.net", this.port = 80, this.retries = 1, this.timeout = 15e3, this.body = o.QueryTaskInfoPackageNS.createQueryEd2kTaskInfoBuffer(e), this.post(e => {
                    let n = null;
                    200 === e.statusCode && e.body && e.body.length > 12 && (n = o.QueryTaskInfoPackageNS.praseEd2kTaskInfoBuffer(e.body)), u.information("postRequestEd2kTaskInfoByEd2kLink", n), t(n)
                }, e => {
                    u.error("postRequestEd2kTaskInfoByEd2kLink", e), t(null)
                })
            })
        }

        delay(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    setTimeout(t, e)
                })
            })
        }

        queryResInfo(e, t) {
            return i(this, void 0, void 0, function* () {
                return l.fetchPCRes({url: "/xlppc.resinfo.api/v1/queryresinfo", data: {type: e, res: t}}, "prod", !0)
            })
        }
    };
    !function (e) {
        e.postRequestEd2kTaskInfoByEd2kLink = function (e) {
            return i(this, void 0, void 0, function* () {
                return d.postRequestEd2kTaskInfoByEd2kLink(e)
            })
        }, e.asyncBatchQueryP2spTaskInfoByUrl = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return d.asyncBatchQueryP2spTaskInfoByUrl(e, t, n)
            })
        }, e.queryResInfo = function (e, t) {
            return i(this, void 0, void 0, function* () {
                return d.queryResInfo(e, t)
            })
        }
    }(t.QueryTaskInfoHelperNS || (t.QueryTaskInfoHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(7), o = n(200), r = n(201), s = n(1).default.getLogger("Thunder.QueryTaskInfoPackage"),
        l = a.default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = 0;

        function n() {
            let e = 0, t = i.join(__rootDir, "../../Thunder.exe"), n = l.getFileVersion(t).split(".");
            if (n && 4 === n.length) {
                e = 26 * Number(n[0]).valueOf() + 18 * Number(n[1]).valueOf() + Number(n[3]).valueOf()
            }
            return e
        }

        function a() {
            return l.getPeerID()
        }

        e.createQueryP2spTaskInfoBuffer = function (e) {
            let i = 0, l = Buffer.alloc(10240);
            return s.information("createQueryP2spTaskInfoBuffer protocolVersion", 61, i), i = l.writeUInt32LE(61, i), s.information("createQueryP2spTaskInfoBuffer sequence", t, i), i = l.writeUInt32LE(++t, i), s.information("createQueryP2spTaskInfoBuffer command length", "0", i), i = l.writeUInt32LE(0, i), s.information("createQueryP2spTaskInfoBuffer thunder ver", n(), i), i = l.writeUInt32LE(n(), i), s.information("createQueryP2spTaskInfoBuffer compress flag", "0", i), i = l.writeUInt16LE(0, i), s.information("createQueryP2spTaskInfoBuffer reserved", "0", i), i = r.BufferUtilitiesNS.writeString(l, "", i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer command", "2021", i), i = l.writeUInt16LE(2021, i), s.information("createQueryP2spTaskInfoBuffer by what", "2", i), i = l.writeUInt8(2, i), s.information("createQueryP2spTaskInfoBuffer body length", "0", i), i = l.writeUInt32LE(0, i), s.information("createQueryP2spTaskInfoBuffer url", e, i), i = r.BufferUtilitiesNS.writeString(l, e, i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", "origin url", i), i = r.BufferUtilitiesNS.writeString(l, "", i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", "refurl", i), i = r.BufferUtilitiesNS.writeString(l, "", i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", a(), i), i = r.BufferUtilitiesNS.writeString(l, a(), i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer", "ip", i), i = l.writeInt32LE(0, i), i = l.writeInt32LE(0, i), i = l.writeInt32LE(-1, i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", "length", i), l = l.slice(0, i), s.information("createQueryP2spTaskInfoBuffer", l), l = o.ShubCryptoNS.encryptHttpBuffer(l)
        }, e.praseP2spTaskInfoBuffer = function (e) {
            let t = {result: 0, gcid: "", fileSize: 0, errCode: 0};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e);
                let n = 0, i = e.readUInt32LE(n);
                s.information("protocolVersion:", i), n += 4;
                let a = e.readUInt32LE(n);
                s.information("sequence:", a), n += 4;
                let l = e.readUInt32LE(n);
                s.information("commandLegth:", l), n += 4;
                let u = e.readUInt32LE(n);
                s.information("thunderVersion:", u), n += 4;
                let d = e.readUInt16LE(n);
                s.information("compressFlag:", d), n += 2, n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0];
                let c = e.readUInt16LE(n);
                if (s.information("commandType:", c), n += 2, t.result = e.readUInt8(n), n += 1, 1 === t.result) {
                    n = r.BufferUtilitiesNS.readString(e, n, "hex")[0];
                    let i = r.BufferUtilitiesNS.readUInt64LE(e, n);
                    n = i[0], t.fileSize = i[1];
                    let a = r.BufferUtilitiesNS.readString(e, n, "hex");
                    n = a[0], t.gcid = a[1].toUpperCase(), s.information("gcid", a[1])
                } else t.errCode = e.readUInt32LE(n);
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return t
        }, e.createQueryEd2kTaskInfoBuffer = function (e) {
            let i = 0, u = Buffer.alloc(4096);
            s.information("createQueryEd2kTaskInfoBuffer protocolVersion", 60, i), i = u.writeUInt32LE(60, i), s.information("createQueryEd2kTaskInfoBuffer sequence", t, i), i = u.writeUInt32LE(++t, i), s.information("createQueryEd2kTaskInfoBuffer command length", "0", i), i = u.writeUInt32LE(0, i), s.information("createQueryEd2kTaskInfoBuffer thunder ver", n(), i), i = u.writeUInt32LE(n(), i), s.information("createQueryEd2kTaskInfoBuffer compress flag", "0", i), i = u.writeUInt16LE(0, i), s.information("createQueryEd2kTaskInfoBuffer reserved", "0", i), i = r.BufferUtilitiesNS.writeString(u, "", i, "utf-8"), s.information("createQueryEd2kTaskInfoBuffer command", "5001", i), i = u.writeUInt16LE(5001, i), s.information("createQueryEd2kTaskInfoBuffer", a(), i), i = r.BufferUtilitiesNS.writeString(u, a(), i, "utf-8");
            let d = l.parseEd2kUrl(e), c = d.fileHash;
            i = u.writeInt32LE(c.length / 2, i);
            let h = 0, f = 0;
            for (let e = 0; e < c.length; e += 2) h = parseInt(c.charAt(e), 16), f = parseInt(c.charAt(e + 1), 16), i = u.writeUInt8(h << 4 | f, i);
            return i = r.BufferUtilitiesNS.writeUInt64LE(u, d.fileSize, i), i = u.writeInt32LE(0, i), i = r.BufferUtilitiesNS.writeString(u, "", i, "utf-8"), i = u.writeInt32LE(0, i), i = r.BufferUtilitiesNS.writeString(u, e, i, "utf-8"), u = u.slice(0, i), s.information("createQueryEd2kTaskInfoBuffer before encrypt", u, i), u = o.ShubCryptoNS.encryptHttpBuffer(u)
        }, e.praseEd2kTaskInfoBuffer = function (e) {
            let t = {result: 0, hasRecord: 0, gcid: ""};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e), s.information("praseEd2kTaskInfoBuffer buffer", e);
                let n = 0, i = e.readUInt32LE(n);
                s.information("protocolVersion:", i), n += 4;
                let a = e.readUInt32LE(n);
                s.information("sequence:", a), n += 4;
                let l = e.readUInt32LE(n);
                s.information("commandLegth:", l), n += 4;
                let u = e.readUInt32LE(n);
                s.information("thunderVersion:", u), n += 4;
                let d = e.readUInt16LE(n);
                s.information("compressFlag:", d), n += 2, n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0];
                let c = e.readUInt16LE(n);
                if (s.information("commandType:", c), n += 2, t.result = e.readUInt8(n), n += 1, 1 === t.result && (t.hasRecord = e.readInt32LE(n), n += 4, 1 === t.hasRecord)) {
                    n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0], n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0], n = r.BufferUtilitiesNS.readString(e, n, "hex")[0];
                    let i = r.BufferUtilitiesNS.readString(e, n, "hex");
                    n = i[0], t.gcid = i[1].toUpperCase()
                }
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return s.information("praseEd2kTaskInfoBuffer response", t), t
        }
    }(t.QueryTaskInfoPackageNS || (t.QueryTaskInfoPackageNS = {}))
}, , , , , , , , , , function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(779), o = n(6), r = n(83), s = i.default.getLogger("DownloadKernel.TaskUserData");
    t.TaskUserData = class {
        constructor(e, t) {
            this.userData = new a.BencodeMap.BencodeMap, s.information("new TaskUserData userData:", t), this.task = e, this.userData.decode(t)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            r.ThunderKernel.setTaskPriorityLevel(this.task.getId(), e, t)
        }

        setUserData(e, t, n) {
            let i = !1;
            if (!e || 38 !== e.length) return s.warning("setUserData invalid userGuid:", e), i;
            let a = this.userData.addMapItem("UserData").addMapItem(e);
            if (o.isNumber(n) ? (i = a.addItem(t, n), s.information("addItem number key:", t, ", value:", n)) : o.isString(n) ? (i = a.addItem(t, n), s.information("addItem string key:", t, ", value:", n)) : s.information("addItem not support value type. key:", t, ", value:", n), i) {
                let e = "";
                e = this.userData.encode(e), s.information("bencodingUserData:", e), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, e)
            }
            return i
        }

        getUserData(e, t) {
            if (!e || 38 !== e.length) return void s.warning("getUserData invalid userGuid:", e);
            let n = this.userData.getItem("UserData");
            if (!n) return;
            let i = n.getItem(e);
            if (!i) return;
            let o = i.getItem(t);
            if (o) switch (o.getType()) {
                case a.BencodeMap.BencodeDataType.Integer:
                case a.BencodeMap.BencodeDataType.String:
                    return o.getValue()
            }
        }

        getAllUserData() {
            return this.userData.encode("")
        }

        setAllUserData(e) {
            this.userData.decode(e);
            let t = "";
            t = this.userData.encode(t), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(3), r = n(5), s = n(8), l = n(90), u = n(25), d = n(10), c = n(12), h = n(69), f = n(1),
        g = n(33), p = n(34), k = n(74), m = n(15), T = n(7), v = n(59), C = n(28), S = n(132), y = n(14), w = n(51),
        I = n(135), b = n(133), A = T.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        N = p.DownloadKernelEventManager.getEventManager(), D = l.DownloadKernelCategoryManager.getCategoryManager(),
        _ = f.default.getLogger("Thunder.PrivateSpaceHelper"), x = I.ToastNotifyManagerNS.getToastNotifyManger();
    !function (e) {
        let t = void 0, n = void 0, l = "", f = !0, p = void 0, T = void 0;
        const E = new v.EventEmitter;
        let P;

        function M(e, t, n) {
            _.information("onInsertToCategoryView categoryId:", e, ", categoryViewId:", t);
            for (let t = 0; t < n.length; t++) {
                let i = n[t];
                if (i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) return;
                let a = i.getTaskStatus();
                _.information("onInsertToCategoryView taskStatus:", a), a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding || O(i, -1 !== e).then().catch()
            }
        }

        function F(e) {
            for (let t = 0; t < e.length; t++) {
                let n = e[t];
                if (n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                let i = n.getTaskStatus();
                i !== s.DownloadKernel.TaskStatus.Succeeded && i !== s.DownloadKernel.TaskStatus.Seeding || n.getIsPrivate() && O(n, !0).then().catch()
            }
        }

        function O(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = e.getTaskStatus(), o = e.getTaskBaseInfo().taskType;
                if (_.information("moveTaskFileToPrivateSpace taskType:", o, ", taskStatus:", n, ", moveIn:", t), n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0) return;
                    let n = "";
                    if (t ? (n = yield L(l), n = a.join(n, l)) : n = yield h.NativeCallAWNS.getDownloadDir(), _.information("moveTaskFileToPrivateSpace newSrcPath:", n), o === s.DownloadKernel.TaskType.Group) return function (e, t, n) {
                        return i(this, void 0, void 0, function* () {
                            let i = e.getSavePath(), o = e.getTaskName();
                            if (!(yield d.FileSystemAWNS.existsAW(i))) return;
                            let r = a.join(i, o);
                            if (_.information("destPath:", r), i !== r) {
                                yield d.FileSystemAWNS.mkdirsAW(n);
                                let a = yield U(i, r);
                                if (a) {
                                    e.setSavePath(n), K(e, !!t && B());
                                    let i = e.getExtraObject(), a = i.getSubTaskCount();
                                    if (a && a > 0) for (let e = 0; e < a; e++) {
                                        let t = i.getSubTaskByIndex(e);
                                        t && t.setSavePath(r)
                                    }
                                    N.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e])
                                }
                            } else K(e, !!t && B())
                        })
                    }(e, t, n);
                    if (o === s.DownloadKernel.TaskType.Bt) return function (e, t, n) {
                        return i(this, void 0, void 0, function* () {
                            let i = e.getExtraObject(), o = i.getDownloadFile();
                            if (1 !== o.length) return;
                            let r = i.getBtFileList(), l = r.get(o[0]);
                            if (!l) return;
                            let u = void 0, c = e.getSavePath(),
                                h = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName),
                                f = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath),
                                g = yield S.SingleBtTaskNS.isSingleBtTask(e);
                            if (g) u = S.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                if (!h || "" === h) return;
                                c = a.join(c, f), u = a.join(c, h)
                            }
                            if (yield d.FileSystemAWNS.existsAW(u)) if (c !== n) {
                                yield d.FileSystemAWNS.mkdirsAW(n);
                                let i = a.join(n, h), o = yield U(u, i);
                                o && (e.setSavePath(n), N.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), K(e, !!t && B()))
                            } else K(e, !!t && B())
                        })
                    }(e, t, n);
                    if (o === s.DownloadKernel.TaskType.P2sp || o === s.DownloadKernel.TaskType.Emule) return function (e, t, n) {
                        return i(this, void 0, void 0, function* () {
                            let i = e.getSavePath(), o = e.getTaskName(), r = a.join(i, o);
                            if (yield d.FileSystemAWNS.existsAW(r)) if (i !== n) {
                                yield d.FileSystemAWNS.mkdirsAW(n);
                                let i = a.join(n, o), l = yield U(r, i);
                                l && (e.setSavePath(n), N.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), K(e, !!t && B()))
                            } else K(e, !!t && B())
                        })
                    }(e, t, n)
                }
            })
        }

        function U(e, t) {
            return i(this, void 0, void 0, function* () {
                return _.information("moveFile srcParh:", e, ", destPath:", t), new Promise(n => i(this, void 0, void 0, function* () {
                    if (e[0] === t[0]) {
                        yield d.FileSystemAWNS.renameAW(e, t);
                        let i = yield d.FileSystemAWNS.existsAW(t);
                        _.information("moveFile existsAW success:", i), n(i)
                    } else {
                        let i = !1;
                        (yield d.FileSystemAWNS.lstatAW(e)).isDirectory() ? (i = yield d.FileSystemAWNS.copyDirsAW(e, t), _.information("moveFile copyDirsAW success:", i), i && (i = yield d.FileSystemAWNS.rmdirsAW(e), _.information("moveFile rmdirsAW success:", i))) : (i = yield d.FileSystemAWNS.copyFileAW(e, t), _.information("moveFile copyFileAW success:", i), i && (i = yield d.FileSystemAWNS.unlinkAW(e), _.information("moveFile unlinkAW success:", i))), n(i)
                    }
                }))
            })
        }

        function L(e) {
            return i(this, void 0, void 0, function* () {
                let t = u.ConfigNS.getValue("PrivateSpaceDefaultPath", e, "");
                if (t && "" !== t) {
                    let n = a.join(t, e);
                    if (yield d.FileSystemAWNS.existsAW(n)) return t;
                    if (yield d.FileSystemAWNS.mkdirAW(n)) return t
                }
                let n = u.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                return void 0 !== n && "" !== n || (n = c.ThunderUtil.getDefaultDownloadDir()), void 0 !== n && "" !== n ? (u.ConfigNS.setValue("PrivateSpaceDefaultPath", e, n), n) : ""
            })
        }

        function B(e) {
            return e && "" === e || (e = l), 1 === u.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1)
        }

        function K(e, t) {
            let n = e.getSavePath(), i = e.getTaskName();
            _.information("setTaskHidden path:", n, ", name:", i, ", hidden:", t), t && !function (e) {
                if (!e || "" === e) return !1;
                let t = l;
                "" !== l && "0" !== l || (t = "私人空间");
                if (_.information("userId:", t), _.information("filePath:", e), new RegExp(t).test(e)) return !0;
                return !1
            }(n) || (V(n, t), V(a.join(n, i), t))
        }

        function V(e, t) {
            let n = t ? 2 : 128, i = A.setFileAttributes(e, n);
            _.information("setPathHidden ret:", i, ", path:", e, ", hidden:", t)
        }

        function R(e, t) {
            e && "" === e || (e = l), u.ConfigNS.setValue("PrivateSpacePasswordErrorCount", e, t)
        }

        function W(e, t) {
            return i(this, void 0, void 0, function* () {
                if (!t || "" === t) return;
                if (t = a.join(t, e), !(yield d.FileSystemAWNS.existsAW(t))) {
                    yield d.FileSystemAWNS.mkdirAW(t)
                }
                1 === u.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1) && V(t, !0)
            })
        }

        function H(e, t) {
            let n = D.getPrivateCategoryFromUserId(e);
            if (!n) return;
            let i = n.getCategoryViews();
            if (i && !(i.length <= 0)) for (let e = 0; e < i.length; e++) {
                let n = i[e].getTasks();
                for (let e of n.values()) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                    let n = e.getTaskStatus();
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || e.getIsPrivate() && K(e, t)
                }
            }
        }

        function j(e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise((a, o) => i(this, void 0, void 0, function* () {
                    let i = null;
                    if (i = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) {
                        let e = yield w.LoginHelperNS.loginHelper.getUserInfoByKeyAw("mobile");
                        null === e || void 0 === e || "" === e ? (!1 !== n && (yield y.default("OpenNewTab", "https://i.xunlei.com/xluser/validate/enter/bindphone_enter.html")), a(1)) : function (e, t) {
                            return g.MessageBox.custom("private-space-phone-verify", {
                                mobile: e,
                                methodType: t
                            }, {webPreferences: {webSecurity: !1}})
                        }(e, t).then(e => {
                            e.action === C.MessageBoxNS.Action.OK ? a(0) : a(-1)
                        }).catch()
                    } else a(-1)
                }))
            })
        }

        function G(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = B(e);
                return new Promise((a, o) => {
                    (function (e, t) {
                        return g.MessageBox.custom("private-space-set-password", {isSetHide: e, showType: t})
                    })(n, t).then(t => {
                        if (t.action === C.MessageBoxNS.Action.OK) {
                            if (null !== t.args.isSetHide && void 0 !== t.args.isSetHide && "boolean" == typeof t.args.isSetHide && t.args.isSetHide !== n) {
                                let n = t.args.isSetHide ? 1 : 0;
                                u.ConfigNS.setValue("PrivateSpaceLockUserTask", e, n), H(e, t.args.isSetHide)
                            }
                            let o = D.getCurrentPrivateCategory();
                            o && o.setPassword(t.args.password, "", !0, (t, n) => i(this, void 0, void 0, function* () {
                                t && ($(!1), E.emit(P.SetPassword, !0), x.showNotify(I.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, b.ToastNotifyItemType.GreenNotify, "私人空间密码设置成功", 3e3), R(e, 0), a(0));
                                let n = yield L(e);
                                n && "" !== n && W(e, n).then().catch()
                            }))
                        } else a(-1)
                    }).catch()
                })
            })
        }

        function z(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise((t, n) => {
                    let i = null;
                    (i = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) ? G(e, "change").then(e => {
                        t(e)
                    }).catch() : t(-1)
                })
            })
        }

        function $(e) {
            f = e
        }

        function q() {
            return f
        }

        !function (e) {
            e.Unknow = "Unknow", e.SetPassword = "SetPassword"
        }(P = e.EventType || (e.EventType = {})), e.getEventEmitter = function () {
            return E
        }, e.getPrivateSavePath = L, e.isPrivateSpaceOpen = function (e) {
            let t = !1, n = D.getPrivateCategoryFromUserId(e);
            if (n) {
                let e = n.getPassword();
                e && "" !== e && (t = !0)
            }
            return t
        }, e.setPrivateSavePath = W, e.setAllTaskFileHidden = H, e.phoneVerifyPrivateCategory = j, e.changePrivateSpacePassword = z, e.openPrivateCategory = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise((t, n) => {
                    let i = null;
                    if (i = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) {
                        let n = i.getPassword();
                        n && "" !== n ? t(0) : G(e, "open").then(e => {
                            t(e)
                        }).catch()
                    } else t(-1)
                })
            })
        }, e.accessPrivateCategory = function (e) {
            return i(this, void 0, void 0, function* () {
                var t, n;
                return new Promise((t, n) => {
                    let a = null;
                    if (a = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) if (q()) {
                        let n = a.getPassword();
                        if (n && "" !== n) {
                            let a = function (e) {
                                return e && "" === e || (e = l), u.ConfigNS.getValue("PrivateSpacePasswordErrorCount", e, 0)
                            }(e);
                            a >= 5 ? j(e, "more").then(n => i(this, void 0, void 0, function* () {
                                0 === n ? (n = yield z(e), t(0 === n ? 0 : -1)) : t(-1)
                            })).catch(() => {
                                t(-1)
                            }) : (n = n, a = a, g.MessageBox.custom("private-space-verify-password", {
                                password: n,
                                errorCount: a
                            })).then(n => i(this, void 0, void 0, function* () {
                                if (n.action === C.MessageBoxNS.Action.OK) n.args && n.args.success && ($(!1), R(e, 0), t(0)); else if (n.action === C.MessageBoxNS.Action.Close && n.args) {
                                    a = n.args.errorCount, R(e, a);
                                    let i = n.args.from;
                                    if ("forget" === i || "more" === i) {
                                        let n = yield j(e, i);
                                        0 === n && 0 === (n = yield z(e)) && t(0)
                                    }
                                }
                            })).catch(() => {
                                t(-1)
                            })
                        } else G(e, "open").then(e => {
                            _.information("accessPrivateCategory executeSetPasswordWindow result = ", e), t(0 === e ? 0 : -1)
                        }).catch(() => {
                            t(-1)
                        })
                    } else t(0); else t(-1)
                })
            })
        }, e.setNeedPassword = $, e.getNeedPassword = q, e.init = function () {
            return i(this, void 0, void 0, function* () {
                (function () {
                    return i(this, void 0, void 0, function* () {
                        t = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => i(this, void 0, void 0, function* () {
                            _.information("OnUserLogin userId:", e), l = e, D.setUserInfo(e, "")
                        })), n = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                            _.information("OnUserLogout currentUserId:", l), l = "", f = !0, D.setUserInfo("", "")
                        })
                    })
                })().then().catch(), p = N.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!e[1]) break;
                        let t = e[1];
                        t.length > 0 && F(t)
                    } while (0)
                }), T = N.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                        if (void 0 === e[1] || !e[2] || !e[3]) break;
                        let t = e[1], n = e[2];
                        _.information("insertTaskCallback categoryId:", t, ", categoryViewId:", n);
                        let i = e[3], a = e[4];
                        i.length > 0 && a === s.DownloadKernel.TaskInsertReason.MoveThoughCategory && M(t, n, i)
                    } while (0)
                }), o.remote.ipcMain.on(m.ThunderChannelList.channelRMGetPrivateSpaceInfo, e => {
                    do {
                        if (!e) break;
                        if (e.sender.isDestroyed()) break;
                        let t = !0, n = D.getCurrentPrivateCategory();
                        if (n) {
                            let e = n.getPassword();
                            e && "" !== e && (t = !0)
                        }
                        let i = k.default.getCurrentCategoryId();
                        e.sender.send(m.ThunderChannelList.channelMRGetPrivateSpaceInfoResult, t, i)
                    } while (0)
                })
            })
        }, e.uninit = function () {
            r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", t), r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", n), N.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, p), N.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, T)
        }
    }(t.PrivateSpaceHelperNS || (t.PrivateSpaceHelperNS = {}))
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s = {}.hasOwnProperty;
        r = n(196), o = r.isObject, a = r.isFunction, i = n(128), t = n(720), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing element name");
                this.name = this.stringify.eleName(t), this.attributes = {}, null != i && this.attribute(i), e.isDocument && (this.isRoot = !0, this.documentObject = e, e.rootObject = this)
            }

            return function (e, t) {
                for (var n in t) s.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, i), n.prototype.clone = function () {
                var e, t, n, i;
                for (t in(n = Object.create(this)).isRoot && (n.documentObject = null), n.attributes = {}, i = this.attributes) s.call(i, t) && (e = i[t], n.attributes[t] = e.clone());
                return n.children = [], this.children.forEach(function (e) {
                    var t;
                    return (t = e.clone()).parent = n, n.children.push(t)
                }), n
            }, n.prototype.attribute = function (e, n) {
                var i, r;
                if (null != e && (e = e.valueOf()), o(e)) for (i in e) s.call(e, i) && (r = e[i], this.attribute(i, r)); else a(n) && (n = n.apply()), this.options.skipNullAttributes && null == n || (this.attributes[e] = new t(this, e, n));
                return this
            }, n.prototype.removeAttribute = function (e) {
                var t, n, i;
                if (null == e) throw new Error("Missing attribute name");
                if (e = e.valueOf(), Array.isArray(e)) for (n = 0, i = e.length; n < i; n++) t = e[n], delete this.attributes[t]; else delete this.attributes[e];
                return this
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).element(this)
            }, n.prototype.att = function (e, t) {
                return this.attribute(e, t)
            }, n.prototype.a = function (e, t) {
                return this.attribute(e, t)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing CDATA text");
                this.text = this.stringify.cdata(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).cdata(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing comment text");
                this.text = this.stringify.comment(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).comment(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a = {}.hasOwnProperty;
        i = n(196).isObject, t = n(128), e.exports = function (e) {
            function n(e, t, a, o) {
                var r;
                n.__super__.constructor.call(this, e), i(t) && (t = (r = t).version, a = r.encoding, o = r.standalone), t || (t = "1.0"), this.version = this.stringify.xmlVersion(t), null != a && (this.encoding = this.stringify.xmlEncoding(a)), null != o && (this.standalone = this.stringify.xmlStandalone(o))
            }

            return function (e, t) {
                for (var n in t) a.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).declaration(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l = {}.hasOwnProperty;
        s = n(196).isObject, r = n(128), t = n(273), a = n(274), i = n(275), o = n(276), e.exports = function (e) {
            function n(e, t, i) {
                var a, o;
                n.__super__.constructor.call(this, e), this.documentObject = e, s(t) && (t = (a = t).pubID, i = a.sysID), null == i && (i = (o = [t, i])[0], t = o[1]), null != t && (this.pubID = this.stringify.dtdPubID(t)), null != i && (this.sysID = this.stringify.dtdSysID(i))
            }

            return function (e, t) {
                for (var n in t) l.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, r), n.prototype.element = function (e, t) {
                var n;
                return n = new i(this, e, t), this.children.push(n), this
            }, n.prototype.attList = function (e, n, i, a, o) {
                var r;
                return r = new t(this, e, n, i, a, o), this.children.push(r), this
            }, n.prototype.entity = function (e, t) {
                var n;
                return n = new a(this, !1, e, t), this.children.push(n), this
            }, n.prototype.pEntity = function (e, t) {
                var n;
                return n = new a(this, !0, e, t), this.children.push(n), this
            }, n.prototype.notation = function (e, t) {
                var n;
                return n = new o(this, e, t), this.children.push(n), this
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).docType(this)
            }, n.prototype.ele = function (e, t) {
                return this.element(e, t)
            }, n.prototype.att = function (e, t, n, i, a) {
                return this.attList(e, t, n, i, a)
            }, n.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, n.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, n.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, n.prototype.up = function () {
                return this.root() || this.documentObject
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t, i, a, o, r) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                if (null == i) throw new Error("Missing DTD attribute name");
                if (!a) throw new Error("Missing DTD attribute type");
                if (!o) throw new Error("Missing DTD attribute default");
                if (0 !== o.indexOf("#") && (o = "#" + o), !o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
                if (r && !o.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT");
                this.elementName = this.stringify.eleName(t), this.attributeName = this.stringify.attName(i), this.attributeType = this.stringify.dtdAttType(a), this.defaultValue = this.stringify.dtdAttDefault(r), this.defaultValueType = o
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdAttList(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a = {}.hasOwnProperty;
        i = n(196).isObject, t = n(128), e.exports = function (e) {
            function n(e, t, a, o) {
                if (n.__super__.constructor.call(this, e), null == a) throw new Error("Missing entity name");
                if (null == o) throw new Error("Missing entity value");
                if (this.pe = !!t, this.name = this.stringify.eleName(a), i(o)) {
                    if (!o.pubID && !o.sysID) throw new Error("Public and/or system identifiers are required for an external entity");
                    if (o.pubID && !o.sysID) throw new Error("System identifier is required for a public external entity");
                    if (null != o.pubID && (this.pubID = this.stringify.dtdPubID(o.pubID)), null != o.sysID && (this.sysID = this.stringify.dtdSysID(o.sysID)), null != o.nData && (this.nData = this.stringify.dtdNData(o.nData)), this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity")
                } else this.value = this.stringify.dtdEntityValue(o)
            }

            return function (e, t) {
                for (var n in t) a.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdEntity(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                i || (i = "(#PCDATA)"), Array.isArray(i) && (i = "(" + i.join(",") + ")"), this.name = this.stringify.eleName(t), this.value = this.stringify.dtdElementValue(i)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdElement(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing notation name");
                if (!i.pubID && !i.sysID) throw new Error("Public or system identifiers are required for an external entity");
                this.name = this.stringify.eleName(t), null != i.pubID && (this.pubID = this.stringify.dtdPubID(i.pubID)), null != i.sysID && (this.sysID = this.stringify.dtdSysID(i.sysID))
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdNotation(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing raw text");
                this.value = this.stringify.raw(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).raw(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing element text");
                this.value = this.stringify.eleText(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).text(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(128), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing instruction target");
                this.target = this.stringify.insTarget(t), i && (this.value = this.stringify.insValue(i))
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).processingInstruction(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(56), o = n(724), r = n(76), s = n(21), l = n(8), u = n(34), d = n(32), c = n(23), h = n(74),
        f = i.default.getLogger("TaskDetail.TaskDetail"), g = o.TaskInfoManagerNS.getTaskInfoManager(),
        p = u.DownloadKernelEventManager.getEventManager(), k = d.DownloadKernelTaskManager.getTaskManager();
    var m;
    !function (e) {
        e.Comments = "comments", e.FileList = "files", e.Attribute = "detail"
    }(m = t.DetailIndex || (t.DetailIndex = {}));
    !function (e) {
        const t = new class {
            constructor() {
                this.isPageReady = !1, this.unFireTaskId = 0, this.unFireTaskData = "", this.unFireIndex = m.Comments, this.curTaskId = 0, this.curPannel = "", this.select = !1
            }

            init() {
                p.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.ChannelInfoChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskDescriptionChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskMovingStateChange, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    this.onGroupTaskSubFileDetailChanged(...e)
                }), h.default.attachListener(c.NodeEventMesssageNS.eventDownloadItemActive, (e, t, n, i, a, o) => {
                    t ? (this.curTaskId = n, this.select = !0, this.onTaskSelectChanged(e, o)) : (a || n === this.curTaskId) && (this.curTaskId = 0, this.curPannel = "", this.select = !1, setTimeout(() => {
                        this.select || this.onTaskSelectChanged(e)
                    }, 100))
                }), h.default.attachListener(c.NodeEventMesssageNS.eventDetailSwitch2Index, (e, t) => {
                    this.switch2DetailIndex(e, t)
                });
                let e = [{functionName: "GetCurTask", nativeFunc: this.getCurTask.bind(this)}];
                r.setDefaultNativeFunctionMap(e)
            }

            pageReady() {
                this.isPageReady = !0, f.information("pageReady"), 0 !== this.unFireTaskId && (this.onCurTaskChange(this.unFireTaskId, this.unFireTaskData, this.unFireIndex), this.unFireTaskId = 0, this.unFireTaskData = "")
            }

            switch2DetailIndex(e, t) {
                this.isPageReady ? a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", e, t) : this.unFireTaskId === e && (this.unFireIndex = t)
            }

            updateTaskInfo(...e) {
                do {
                    if (!e) break;
                    if (!e[1]) break;
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        i === this.curTaskId && (n.getTaskAttribute(l.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || g.getTaskInfoString(i).then(e => {
                            this.onTaskInfoChange(i, e)
                        }).catch())
                    }
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1];
                    if (t !== this.curTaskId) break;
                    let n = e[2], i = g.getBtSubFileListString(t, n);
                    this.onSubFileInfoChange(t, i)
                } while (0)
            }

            onGroupTaskSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                    if (!e[1]) break;
                    e[1].forEach((e, t) => {
                        if (t === this.curTaskId) {
                            let n = g.getGroupTaskSubFileListString(e);
                            this.onSubFileInfoChange(t, n)
                        }
                    })
                } while (0)
            }

            onTaskSelectChanged(e, t) {
                let n = "";
                switch (e) {
                    case l.DownloadKernel.CategroyViewID.Downloading:
                        n = "downloading";
                        break;
                    case l.DownloadKernel.CategroyViewID.Completed:
                        n = "complete";
                        break;
                    case l.DownloadKernel.CategroyViewID.Recycle:
                        n = "trash"
                }
                this.curPannel = n;
                let i = {};
                i.pannel = n;
                let a = JSON.stringify(i);
                this.onCurTaskChange(this.curTaskId, a, t);
                let o = this.curTaskId;
                do {
                    let e = k.getTaskFromTaskId(this.curTaskId);
                    if (!e) break;
                    if (e.getType() !== l.DownloadKernel.TaskType.Bt) break;
                    let n = e.getExtraObject();
                    if (!n) break;
                    if (n.isBtFileLoadEnd()) break;
                    e.loadStorageBtTaskAW(e.getTaskBaseInfo()).then(() => {
                        o === this.curTaskId && this.onCurTaskChange(this.curTaskId, a, t)
                    }).catch()
                } while (0)
            }

            onCurTaskChange(e, t, n) {
                this.isPageReady ? (f.information("OnCurTaskChange", e, t, n), a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnCurTaskChange", e, t, n)) : (this.unFireTaskId = e, this.unFireTaskData = t, this.unFireIndex = n)
            }

            onTaskInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInfoChange", e, t)
            }

            onSubFileInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubFileInfoChange", e, t)
            }

            getCurTask(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    let i = {};
                    i.taskID = this.curTaskId, i.pannel = this.curPannel;
                    let a = JSON.stringify(i);
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, a)
                } while (0)
            }
        };
        e.init = function () {
            t.init()
        }, e.pageReady = function () {
            t.pageReady()
        }
    }(t.TaskDetailNS || (t.TaskDetailNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(573), r = n(5), s = n(51), l = n(1).default.getLogger("PhoneAuth");
    t.phoneAuthObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "迅雷提示", this.url = "http://misc-xl9-ssl.xunlei.com/bindphone/dist/index.html", this.width = 346, this.height = 468, this.lefttMargin = 8, this.rigthMargin = 8, this.topMargin = 38, this.bootomMargin = 8, this.isType = !1, this.embeddedBrowserObj = new o.EmbeddedBrowser
        }

        createPhoneAuthDlg(e, t) {
            return i(this, void 0, void 0, function* () {
                this.isType = !1, this.embeddedBrowserObj.createWnd(this.url, this.title, !0, "phoneAuth", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, null, this.onWndCloseResult.bind(this))
            })
        }

        onWndCloseResult() {
            return i(this, void 0, void 0, function* () {
                this.isType || r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", 0)
            })
        }

        closeDialog(e, t) {
            this.isType = !0;
            let n = e;
            null !== e && void 0 !== e || (n = 0), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", n), this.embeddedBrowserObj.closeWnd()
        }

        isPhoneAuthAw() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = yield s.LoginHelperNS.loginHelper.isLoginedAw();
                    if (!0 !== t) {
                        l.information("isPhoneAuthAw 没有登陆 isLogin：", t);
                        break
                    }
                    let n = yield s.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === n || void 0 === n) {
                        l.information("isPhoneAuthAw userInfo有问题 userInfo:", n);
                        break
                    }
                    let i = n.sessionid;
                    if (null === i || void 0 === i || "" === i) {
                        l.information("isPhoneAuthAw sessionid有问题 sessionid:", i);
                        break
                    }
                    let o = n.deviceid, r = n.userid, u = n.usernewno, d = n.usrname, c = n.usernick,
                        h = s.LoginHelperNS.loginSDKHelper.getInitData(), f = JSON.parse(h), g = f.platform,
                        p = f.appid, k = "PC-" + f.package, m = f.thunderVersion, T = null,
                        v = "https://xluser-ssl.xunlei.com/certification/v1/isauth?";
                    v = `${v}${`auth.deviceid=${encodeURIComponent(o)}&auth.sessionid=${encodeURIComponent(i)}&auth.userid=${encodeURIComponent(r)}&auth.usernewno=${encodeURIComponent(u)}&auth.usrname=${encodeURIComponent(d)}&auth.usernick=${encodeURIComponent(c)}&auth.platformVersion=${encodeURIComponent(g)}&auth.appid=${encodeURIComponent(p)}&auth.appName=${encodeURIComponent(k)}&auth.clientVersion=${encodeURIComponent(m)}&authType==${encodeURIComponent("phone")}&userid ==${encodeURIComponent("userid")}`}`;
                    try {
                        if (null !== (T = yield a.default.get(v)) && void 0 !== T.status && 200 === T.status && void 0 !== T.data && null !== T.data && "" !== T.data) {
                            let t = T.data;
                            "ISAUTH" === t.result ? e = !0 : l.information("isPhoneAuthAw:data=", t)
                        }
                    } catch (e) {
                        l.information("isPhoneAuthAw:error=", e);
                        break
                    }
                } while (0);
                return e
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(826), a = n(577), o = n(25), r = n(57), s = a.TryTaskDataBaseNS.getTable();

    class l {
        constructor() {
            this.mTryTaskId = void 0, this.mLeftCount = 100, this.mTasks = new Map
        }

        get taskId() {
            return this.mTryTaskId
        }

        get chances() {
            return this.mLeftCount
        }

        setQueryData(e, t, n) {
            let i = this.createTask(e);
            void 0 !== n.leftCount && (this.mLeftCount = n.leftCount), 0 === n.result && (i.subId = t, i.trialKey = n.trialKey, i.createTime = r.PluginHelperNS.getHelper().currentTime, i.expireTime = n.expireTime, i.type = n.type)
        }

        setTaskId(e) {
            this.mTryTaskId = e
        }

        removeTaskId(e) {
            this.mTryTaskId === e && (this.mTryTaskId = void 0)
        }

        setCommitData(e, t) {
            let n = this.getTask(e);
            if (n) if (n.commited = !0, 0 !== t.result) n.error = t; else {
                n.error = null, n.trialVerify = t.verify, this.mLeftCount -= 1;
                let e = {tryDate: (new Date).toDateString()};
                s.setUserData(this.taskId, -1, e).catch();
                let i = r.PluginHelperNS.getHelper().currentTime;
                o.ConfigNS.setValue("VipDownload", "LastTryEnterTime", i)
            }
        }

        setTokenData(e, t) {
            let n = this.getTask(e);
            n && (0 !== t.result ? n.error = t : (n.error = null, n.token = t.token, n.tokenExpire = t.expire, n.maxTime = t.maxTime))
        }

        createTask(e) {
            let t = new i.TaskCache;
            return this.mTasks.set(e, t), t
        }

        getTask(e) {
            return this.mTasks.get(e)
        }

        removeTask(e, t) {
            t && s.removeTask(e, -2).catch(), this.mTasks.delete(e)
        }
    }

    t.TryCacheManager = l, function (e) {
        const t = new l;
        e.getCacheManager = function () {
            return t
        }
    }(t.TryTaskCacheNS || (t.TryTaskCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(579), a = n(8), o = n(68), r = n(246), s = n(1).default.getLogger("Thunder.VipDownload.vip-task"),
        l = o.UserHelperNS.getHelper();
    !function (e) {
        function t() {
            let e = 0;
            return l.isLogin && (e = 1), e
        }

        function n() {
            let e = 0;
            return l.isVip && (e = 1), e
        }

        function o() {
            let e = 0;
            return l.isSuperVip ? e = 5 : l.isPlatinumVip ? e = 3 : l.isVip && (e = 2), e
        }

        function u(e) {
            const t = r.TaskManagerNS.getTaskManager().getTask(e);
            let n = "";
            if (t) {
                const e = t.getTaskBase();
                !e || e.taskType !== a.DownloadKernel.TaskType.P2sp && e.taskType !== a.DownloadKernel.TaskType.Emule || (n = e.gcid)
            }
            return n
        }

        e.vipButtonShow = function (e, a, r) {
            s.information("vipButtonShow");
            let l = new Map, d = t(), c = n(), h = o(), f = a ? 1 : 0, g = u(e);
            l.set("is_login", d), l.set("is_vip", c), l.set("vip_type", h), l.set("is_cj_speed", f), l.set("taskid", e), l.set("gcid", g), l.set("btn_type", r);
            let p = {attribute1: "hyjs_show", extData: l};
            i.StatUtilitiesNS.trackEvent("xlx_vip_event", p)
        }, e.vipButtonClick = function (e, a, r) {
            s.information("vipButtonClick");
            let l = new Map, d = t(), c = n(), h = o(), f = a ? 1 : 0, g = u(e);
            l.set("is_login", d), l.set("is_vip", c), l.set("vip_type", h), l.set("is_cj_speed", f), l.set("taskid", e), l.set("gcid", g), l.set("clickid", r);
            let p = {attribute1: "hyjs_click", extData: l};
            i.StatUtilitiesNS.trackEvent("xlx_vip_event", p)
        }
    }(t.VipStatNS || (t.VipStatNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(25), o = n(73), r = n(33), s = n(28), l = n(1).default.getLogger("DownloadMode");
    !function (e) {
        let t = void 0, n = void 0;

        function u() {
            void 0 !== t && (clearTimeout(t), t = void 0), void 0 !== n && (clearTimeout(n), n = void 0)
        }

        function d(e, t) {
            l.information("setSpeedLimit Enter maxDownloadSpeed = ", e, "maxUploadSpeed = ", t), o.DownloadKernelManager.setDownloadSpeedLimit(e), o.DownloadKernelManager.setUploadSpeedLimit(t)
        }

        function c() {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1")
        }

        function h(e) {
            l.information("setCustomDownloadMode Enter"), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", e.maxDownloadSpeedEnabled.value), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_UploadSpeedChk", e.maxUploadSpeedEnabled.value);
            let t = 51200, n = 2048;
            if (t = Number(e.maxDownloadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", t), n = Number(e.maxUploadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", n), e.maxDownloadSpeedEnabled.value ? a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", t) : a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", -1), e.maxUploadSpeedEnabled.value ? a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", n) : a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", -1), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Switch", e.limitTimeEnabled.value), e.limitTimeEnabled.value) {
                let t = e.limitTime[0].value, n = e.limitTime[1].value, i = e.limitTime[2].value,
                    o = e.limitTime[3].value;
                a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", t), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", n), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", i), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", o)
            }
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "0")
        }

        e.handleCustomDownloadMode = function () {
            if ("1" === c()) return;
            u();
            let e = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024),
                i = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024),
                o = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1);
            if (l.information("handleCustomDownloadMode Enter maxDownloadSpeed = ", e, ", maxUploadSpeed = ", i, ", timeSwitch = ", o), o) {
                let o = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)),
                    r = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)),
                    s = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)),
                    l = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)), u = new Date,
                    c = u.getHours(), h = u.getMinutes();
                (o > s || o === s && r > l) && (s += 24), (c > s || c === s && h > l) && (o += 24, s += 24);
                let f = 60 * c + h, g = 60 * o + r, p = 60 * s + l;
                g <= f && f < p ? (d(e, i), n = setTimeout(() => {
                    d(-1, -1), n = void 0
                }, 6e4 * (p - f))) : (d(-1, -1), t = setTimeout(() => {
                    d(e, i), t = void 0
                }, 6e4 * (g - f)), n = setTimeout(() => {
                    d(-1, -1), n = void 0
                }, 6e4 * (p - f)))
            } else d(e, i)
        }, e.getFreeDownLoad = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1)
        }, e.getCurrentDownloadMode = c, e.getCustomModeDownloadSpeed = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024)
        }, e.getCustomModeUploadSpeed = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024)
        }, e.setFullDownloadMode = function () {
            l.information("setFullDownloadMode Enter"), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "1"), o.DownloadKernelManager.setDownloadSpeedLimit(-1), o.DownloadKernelManager.setUploadSpeedLimit(-1), u()
        }, e.setFreeDownLoadConfig = function (e) {
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_IdleDownload", e)
        }, e.setCustomDownloadMode = h, e.showCustomDownloadModeDlg = function () {
            return i(this, void 0, void 0, function* () {
                let e = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", 1024),
                    t = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", 1024),
                    n = r.MessageBox.pop({
                        title: "限制我的下载速度",
                        size: "large",
                        schemas: [{
                            name: "maxDownloadSpeedEnabled",
                            type: "confCheckbox",
                            label: "最大下载速度",
                            outerClass: "xlx-dialog-setting__item",
                            extEles: [{
                                name: "maxDownloadSpeed",
                                type: "confSpeed",
                                outerClass: "xlx-dialog-setting__speed-content",
                                rules: [["rule, value, callback", "let errors = [];\n\n                value = Number(value);\n\n                if (value < 60) {\n                  errors.push(new Error('输入值必须≥60'));\n                } else if (value > 51200) {\n                  errors.push(new Error('输入值必须≤51200'));\n                }\n\n                callback(errors);"]],
                                doEmit: ["key, newValue, oldValue", "\n              newValue = Number(newValue)\n              if (isNaN(newValue)) {\n                this.$emit('input', Number(oldValue), key);\n              } else if (newValue > 51200) {\n                this.$emit('input', Number(oldValue), key);\n              } else {\n                this.$emit('input', newValue, key)\n              }\n              "],
                                doBlur: ["key, value", "\n              value = Number(value)\n              if (value < 60) {\n                this.$emit('input', 60, key)\n              }\n              "],
                                scales: [60, 500, 1024, 5120, 51200],
                                marks: ["60KB", "500KB", "1MB", "5MB", "50MB"]
                            }]
                        }, {
                            name: "maxUploadSpeedEnabled",
                            type: "confCheckbox",
                            label: "最大上传速度",
                            outerClass: "xlx-dialog-setting__item",
                            extEles: [{
                                name: "maxUploadSpeed",
                                type: "confSpeed",
                                outerClass: "xlx-dialog-setting__speed-content",
                                rules: [["rule, value, callback", "let errors = [];\n\n                value = Number(value);\n\n                if (value < 30) {\n                  errors.push(new Error('输入值必须≥30'));\n                } else if (value > 2048) {\n                  errors.push(new Error('输入值必须≤2048'));\n                }\n\n                callback(errors);"]],
                                doEmit: ["key, newValue, oldValue", "\n              newValue = Number(newValue)\n              if (isNaN(newValue)) {\n                this.$emit('input', Number(oldValue), key);\n              } else if (newValue > 2048) {\n                this.$emit('input', Number(oldValue), key);\n              } else {\n                this.$emit('input', newValue, key)\n              }\n              "],
                                doBlur: ["key, value", "\n              value = Number(value)\n              if (value < 30) {\n                this.$emit('input', 30, key)\n              }\n              "],
                                scales: [30, 100, 200, 1024, 2048],
                                marks: ["30KB", "100KB", "200KB", "1MB", "2MB"]
                            }]
                        }, {
                            name: "limitTimeEnabled",
                            type: "confCheckbox",
                            label: "限速下载时间段",
                            outerClass: "xlx-dialog-setting__item",
                            extEles: [{
                                name: "limitTime",
                                type: "confSpeedTime",
                                outerClass: "xlx-dialog-setting__speed-content"
                            }]
                        }],
                        formData: {
                            maxDownloadSpeedEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0)},
                            maxDownloadSpeed: {value: e},
                            maxUploadSpeedEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_UploadSpeedChk", !0)},
                            maxUploadSpeed: {value: t},
                            limitTimeEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1)},
                            limitTime: [{value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)}]
                        }
                    }, {width: 460, height: 428, maxHeight: 428, center: !0});
                return new Promise(e => {
                    n.then(t => {
                        t.action === s.MessageBoxNS.Action.OK ? (h(t.formData), e(!0)) : e(!1)
                    }).catch()
                })
            })
        }
    }(t.DownloadModeNS || (t.DownloadModeNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(251);
    !function (e) {
        class t {
            constructor() {
            }

            static getInstance() {
                return null === t.instance ? new t : t.instance
            }

            getQueue(e) {
                return null === t.queueMap && (t.queueMap = new Map), t.queueMap.has(e) || t.queueMap.set(e, new i.MsgQueueNS.Queue), t.queueMap.get(e)
            }
        }

        t.queueMap = null, t.instance = null, e.MsgQueue = t
    }(t.MsgQueueManagerNS || (t.MsgQueueManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(13), r = n(2), s = n(10), l = n(5), u = n(92), d = n(23), c = n(8), h = n(73), f = n(34),
        g = n(32), p = n(126), k = n(90), m = n(587), T = n(51), v = n(6),
        C = m.GroupAccelerateEventManagerNS.getEventManager(), S = g.DownloadKernelTaskManager.getTaskManager(),
        y = f.DownloadKernelEventManager.getEventManager(),
        w = p.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        I = k.DownloadKernelCategoryManager.getCategoryManager(), b = a.default.getLogger("GroupAccelerate.Manager");
    !function (e) {
        class t {
            constructor() {
                this.reportInterval = 120, this.currentUserId = 0, this.currentUserLicensed = !1, this.enterGroupAccelerateTimeStamp = 0, this.enterGroupAccelerateUploadSize = 0, this.groupAcceleratingTaskNum = 0, this.insertToCategoryViewEventId = void 0, this.removeFromCategoryViewEventId = void 0, this.detailChangedEventId = void 0, this.taskStatusChangedEventId = void 0, this.taskGroupInfoMap = new Map, this.taskIdMap = new Map, this.insertToCategoryViewEventId = 0, this.removeFromCategoryViewEventId = 0, this.detailChangedEventId = 0, this.taskStatusChangedEventId = 0
            }

            init() {
                b.information("init"), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    let t = Number(e);
                    isNaN(t) || (this.currentUserId = t), this.updatePrivateSpaceCategoryViewTaskIdMap(), S.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                        b.information("init login getUserGroupAccelerateInfo")
                    }).catch(() => {
                        b.information("init login getUserGroupAccelerateInfo failed")
                    })
                }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    this.exitAllTeam(this.currentUserId, !1), this.currentUserId = 0, this.currentUserLicensed = !1
                }), T.LoginHelperNS.loginHelper.getUserInfo("userid", e => {
                    if (b.information("getUserID:userid = ", e), e && "" !== e) {
                        let t = Number(e);
                        isNaN(t) || (this.currentUserId = t), S.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                            b.information("init getUserGroupAccelerateInfo")
                        }).catch(() => {
                            b.information("init getUserGroupAccelerateInfo failed")
                        })
                    }
                }), this.insertToCategoryViewEventId = y.attachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.removeFromCategoryViewEventId = y.attachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.RemoveFromCategoryView && this.onRemoveFromCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = y.attachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1])
                }), this.taskStatusChangedEventId = y.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                }), setInterval(() => {
                    this.reportGroupAccelerateTaskInfo()
                }, 1e3 * this.reportInterval), h.DownloadKernelManager.attachOnceListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                    this.updateTaskIdMap(), this.checkTaskGroupAccelerateStatus()
                })
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (y.detachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), this.insertToCategoryViewEventId = void 0), void 0 !== this.removeFromCategoryViewEventId && (y.detachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), this.removeFromCategoryViewEventId = void 0), void 0 !== this.detailChangedEventId && (y.detachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId), this.detailChangedEventId = void 0), void 0 !== this.taskStatusChangedEventId && (y.detachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId), this.taskStatusChangedEventId = void 0), this.taskGroupInfoMap.clear(), this.taskIdMap.clear()
            }

            canEnterGroupAccelerate(e) {
                b.information("canEnterGroupAccelerate", " taskId: ", e);
                let t = !1;
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTask(n);
                    if (!i || "" === i) break;
                    let a = n.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    t = !0
                } while (0);
                return t
            }

            isEnterGroupAccelerate(e) {
                b.information("canEnterGroupAccelerate", " taskId: ", e);
                let t = !1;
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTask(n);
                    if (!i || "" === i) break;
                    let a = n.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    let o = this.getTaskGroupInfo(i);
                    o && o.taskId === e && (t = !0)
                } while (0);
                return t
            }

            joinTeam(e, t, n, a, o) {
                return i(this, void 0, void 0, function* () {
                    b.information("joinTeam", " taskId: ", e, " groupId:", t, " groupName:", n, " memberCount: ", a, " taskUniqueId: ", o);
                    let i = 0;
                    i = "" !== o ? this.taskIdMap.get(o) : e || 0, b.information("joinTeam", " realTaskId: ", i);
                    do {
                        let e = this.taskGroupInfoMap.get(o);
                        if (e && e.taskId) {
                            b.information("joinTeam Alert! taskGroupInfo.taskId:", e.taskId);
                            break
                        }
                        if ((e = {}).groupId = Number(t), e.memberCount = a, e.groupName = n, e.taskId = i, e.currentIncreaseSize = 0, S.getTaskFromTaskId(i)) {
                            e.previousSpeed = this.getTaskAverageSpeed(i), (yield this.getIsVip()) ? this.setTaskPriority(i, 999) : this.setTaskPriority(i, 700), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, i, o), 0 === this.groupAcceleratingTaskNum && (this.enterGroupAccelerateTimeStamp = (new Date).getTime(), this.enterGroupAccelerateUploadSize = h.DownloadKernelManager.getTotalUploadSize()), this.groupAcceleratingTaskNum += 1, b.information("joinTeam", " this.enterGroupAccelerateTimeStamp: ", this.enterGroupAccelerateTimeStamp), b.information("joinTeam", " this.enterGroupAccelerateUploadSize: ", this.enterGroupAccelerateUploadSize), b.information("joinTeam", " this.groupAcceleratingTaskNum: ", this.groupAcceleratingTaskNum)
                        } else e.previousSpeed = 0;
                        this.taskGroupInfoMap.set(o, e), b.information("joinTeam", " this.taskGroupInfoMap.size: ", this.taskGroupInfoMap.size), this.saveGroupAccelerateInfo().then(e => {
                            b.information("joinTeam saveGroupAccelerateInfo")
                        }).catch(() => {
                            b.information("joinTeam saveGroupAccelerateInfo failed")
                        })
                    } while (0)
                })
            }

            exitTeam(e, t, n) {
                if (b.information("exitTeam", " taskId: ", e, " groupId: ", t, " taskUniqueId: ", n), "" !== n) {
                    let e = this.taskGroupInfoMap.get(n);
                    if (e) {
                        b.information("exitTeam", " taskGroupInfo.taskId: ", e.taskId);
                        let t = e.taskId;
                        this.taskGroupInfoMap.delete(n), this.setTaskPriority(t, 0), this.saveGroupAccelerateInfo().then(e => {
                            b.information("exitTeam saveGroupAccelerateInfo")
                        }).catch(() => {
                            b.information("exitTeam saveGroupAccelerateInfo failed")
                        }), this.groupAcceleratingTaskNum -= 1, 0 === this.groupAcceleratingTaskNum && (this.enterGroupAccelerateTimeStamp = 0, this.enterGroupAccelerateUploadSize = 0), b.information("exitTeam", " this.enterGroupAccelerateTimeStamp: ", this.enterGroupAccelerateTimeStamp), b.information("exitTeam", " this.enterGroupAccelerateUploadSize: ", this.enterGroupAccelerateUploadSize), b.information("exitTeam", " this.groupAcceleratingTaskNum: ", this.groupAcceleratingTaskNum), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, t, n)
                    } else b.information("exitTeam bad taskGroupInfo")
                } else b.information("exitTeam bad taskUniqueId")
            }

            getTaskGroupInfo(e) {
                b.information("getTaskGroupInfo", " taskUniqueId: ", e);
                let t = null;
                return "" !== e && (t = this.taskGroupInfoMap.get(e)), t
            }

            exitAllTeamNoTask() {
                b.information("exitAllTeamNoTask"), this.taskGroupInfoMap.forEach((e, t) => {
                    e.taskId || (this.sendExitTeamCommand("" + e.groupId), this.taskGroupInfoMap.delete(t))
                }), this.saveGroupAccelerateInfo().then(e => {
                    b.information("exitAllTeamNoTask saveGroupAccelerateInfo")
                }).catch(() => {
                    b.information("exitAllTeamNoTask saveGroupAccelerateInfo failed")
                })
            }

            sendExitTeamCommand(e) {
                do {
                    b.information("sendExitTeamCommand", " taskUniqueId: ", e);
                    let t = this.taskGroupInfoMap.get(e);
                    if (!t) break;
                    u.fetchSlRes({
                        url: "/group_accel/exit",
                        data: {uid: this.currentUserId, group_id: t.groupId},
                        method: "post"
                    }).then(t => {
                        this.taskGroupInfoMap.delete(e), this.saveGroupAccelerateInfo().then(e => {
                            b.information("sendExitTeamCommand saveGroupAccelerateInfo")
                        }).catch(() => {
                            b.information("sendExitTeamCommand saveGroupAccelerateInfo failed")
                        })
                    }).catch(() => {
                    })
                } while (0)
            }

            isUserLicensed() {
                return this.currentUserLicensed
            }

            getTaskInfoJson(e, t) {
                b.information("getTaskInfoJson", " taskId: ", e, " taskUniqueId: ", t);
                let n = void 0;
                "" !== t && (n = this.taskIdMap.get(t)), b.information("getTaskInfoJson", " realTaskId: ", n), void 0 !== n && (e = n), b.information("getTaskInfoJson now", " taskId: ", e);
                let i = "null";
                do {
                    if (!e) {
                        i = "null";
                        break
                    }
                    let a = S.getTaskFromTaskId(n);
                    if (a) {
                        let e = {};
                        e.status = "" + a.getTaskBaseInfo().taskStatus, e.taskID = "" + n, e.type = "" + a.getTaskBaseInfo().taskType, e.name = a.getTaskBaseInfo().taskName, e.gcid = t;
                        let o = "", s = a.getTaskBaseInfo().taskType, l = e.name;
                        s !== c.DownloadKernel.TaskType.P2sp && s !== c.DownloadKernel.TaskType.Emule || (o = r.extname(l)) && (o = o.substring(1)), e.suffix = o, e.url = a.getTaskBaseInfo().url, e.size = a.getTaskBaseInfo().fileSize, e.progress = e.size > 0 ? 100 * a.getTaskBaseInfo().downloadSize / e.size : 0, b.information("taskInfoTable.progress:", e.progress), e.progress > 100 && (e.progress = 100);
                        let u = this.taskGroupInfoMap.get(t);
                        e.uploaded = u ? this.getUploadedSize() : 0, i = JSON.stringify(e)
                    } else i = "null"
                } while (0);
                return b.information("getTaskInfoJson", " taskInfoJson: ", i), i
            }

            updateTaskAccelerateInfo(e) {
                b.information("updateTaskAccelerateInfo", " taskId: ", e);
                do {
                    if (!e) break;
                    let t = this.getTaskUniqueIdByTaskId(e);
                    if (b.information("updateTaskAccelerateInfo", " taskUniqueId: ", t), !t || "" === t) break;
                    u.fetchSlRes({
                        url: "/group_accel/belong_batch",
                        data: {uid: this.currentUserId, tasks: [t]},
                        method: "post"
                    }).then(e => {
                        if (b.information("updateTaskAccelerateInfo fetchSlRes success res.data: ", e.data), "ok" === e.data.result && e.data.data) {
                            let t = e.data.data;
                            for (let e = 0; e < t.length; e++) {
                                let n = t[e].group_id, i = t[e].member_count, a = t[e].group_name, o = t[e].task,
                                    r = t[e].belong_status;
                                b.information("updateTaskAccelerateInfo data[", e, "]:", t[e]);
                                let s = this.taskGroupInfoMap.get(o);
                                s && (b.information("updateTaskAccelerateInfo has group"), 0 !== r ? (s.memberCount = i, s.groupName = a) : setTimeout(() => {
                                    this.exitTeam(s.taskId, n, o)
                                }, 100))
                            }
                            C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated)
                        }
                    }).catch(() => {
                    })
                } while (0)
            }

            requestTaskTeamInfo(e) {
                do {
                    if (!e || "" === e) break;
                    b.information("requestTaskTeamInfo", " taskUniqueId: ", e), u.fetchSlRes({
                        url: "/group_accel/motorcade_list",
                        data: {task: e},
                        method: "get"
                    }).then(t => {
                        t && C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfoSuccess, e, t.data)
                    }).catch(() => {
                        C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfofailed, e)
                    })
                } while (0)
            }

            getTaskUniqueIdByTaskId(e) {
                b.information("getTaskUniqueIdByTaskId", " taskId: ", e);
                let t = "";
                if (e) {
                    let n = S.getTaskFromTaskId(e);
                    n && (t = this.getTaskUniqueIdByTask(n))
                }
                return b.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskUniqueIdByTask(e) {
                let t = "";
                if (e) {
                    switch (e.getTaskBaseInfo().taskType) {
                        case c.DownloadKernel.TaskType.Bt:
                            let n = e.getExtraObject().getInfoId();
                            b.information("getTaskUniqueIdByTaskBase bt task infoId:", n), t = n;
                            break;
                        case c.DownloadKernel.TaskType.P2sp:
                        case c.DownloadKernel.TaskType.Emule:
                            let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid);
                            b.information("getTaskUniqueIdByTaskBase p2sp or emule task gcid: ", i), t = i
                    }
                }
                return b.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskStatus(e) {
                b.information("getTaskStatus", " taskId: ", e);
                let t = c.DownloadKernel.TaskStatus.Unkown;
                if (e) {
                    let n = S.getTaskFromTaskId(e);
                    n && (t = n.getTaskStatus())
                }
                return b.information("getTaskStatus", " taskStatus: ", t), t
            }

            getTaskIdByTaskUniqueId(e) {
                b.information("getTaskIdByTaskUniqueId", " taskUniqueId: ", e);
                let t = 0;
                return e && "" !== e && ((t = this.taskIdMap.get(e)) || (t = 0)), b.information("getTaskIdByTaskUniqueId", " taskId: ", t), t
            }

            addTaskToExistingTeam(e) {
                do {
                    if (!e) break;
                    let t = e.getTaskBaseInfo().taskId;
                    if (!t) break;
                    b.information("addTaskToExistingTeam", " taskId: ", t);
                    let n = this.getTaskUniqueIdByTask(e);
                    if ("" !== n) {
                        b.information("addTaskToExistingTeam", " taskUniqueId: ", n), this.taskIdMap.set(n, t);
                        let e = this.taskGroupInfoMap.get(n);
                        e && (b.information("addTaskToExistingTeam has taskGroupInfo, taskGroupInfo.taskId:", e.taskId), e.taskId || (b.information("addTaskToExistingTeam do joinTeam"), this.joinTeam(t, "" + e.groupId, e.groupName, e.memberCount, n).catch()))
                    }
                    let i = e.getTaskStatus();
                    C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, t, i, n)
                } while (0)
            }

            exitAllTeam(e, t = !0) {
                if (b.information("exitAllTeam", " userId: ", e), !e) return;
                let n = new Map;
                for (let [e, t]of this.taskGroupInfoMap) this.setTaskPriority(t.taskId, 0), n.set(e, t);
                this.groupAcceleratingTaskNum = 0, this.enterGroupAccelerateTimeStamp = 0, t ? this.sendExitAllTeamCommand(e).then(e => {
                    b.information("exitAllTeam success"), this.saveGroupAccelerateInfo().then(e => {
                        b.information("exitAllTeam saveGroupAccelerateInfo")
                    }).catch(() => {
                        b.information("exitAllTeam saveGroupAccelerateInfo failed")
                    }), n.forEach((e, t) => {
                        C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                    })
                }).catch(() => {
                    b.information("exitAllTeam failed")
                }) : n.forEach((e, t) => {
                    C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                }), this.taskGroupInfoMap.clear()
            }

            updateCategoryViewTaskIdMap(e) {
                let t = e.getTasks();
                if (t) {
                    b.information("updateCategoryViewTaskIdMap tasks.size:", t.size);
                    for (let [, e]of t) if (e) {
                        let t = e.getTaskBaseInfo().taskId, n = this.getTaskUniqueIdByTask(e);
                        b.information("updateCategoryViewTaskIdMap", " taskId: ", t, " taskUniqueId: ", n), t && "" !== n && this.taskIdMap.set(n, t)
                    } else b.information("updateCategoryViewTaskIdMap bad task")
                }
            }

            updatePrivateSpaceCategoryViewTaskIdMap() {
                let e = [c.DownloadKernel.CategroyViewID.Downloading, c.DownloadKernel.CategroyViewID.Completed];
                for (let t of e) {
                    let e = I.getCurrentPrivateCategory();
                    if (e) {
                        let n = e.getCategoryViewFromId(t);
                        this.updateCategoryViewTaskIdMap(n)
                    }
                }
            }

            updateTaskIdMap() {
                b.information("updateTaskIdMap enter");
                let e = [c.DownloadKernel.CategroyViewID.Downloading, c.DownloadKernel.CategroyViewID.Completed];
                for (let t of e) {
                    b.information("updateTaskIdMap categroyViewID", t);
                    let e = w.getCategoryViewFromId(t);
                    this.updateCategoryViewTaskIdMap(e)
                }
                this.updatePrivateSpaceCategoryViewTaskIdMap()
            }

            onDetailChanged(e) {
                do {
                    if (!e) break;
                    b.information("onDetailChanged number of taskList:", e.length);
                    for (let t = 0; t < e.length; ++t) {
                        let n = e[t];
                        if (!n) continue;
                        let i = n.getTaskBaseInfo(), a = i.taskId;
                        if (!a) continue;
                        let o = this.getTaskUniqueIdByTask(n);
                        if (!o || "" === o) continue;
                        b.information("onDetailChanged", " taskId: ", a);
                        let r = this.taskIdMap.get(o);
                        b.information("onDetailChanged", " taskUniqueId: ", o, ", taskIdRecord:", r), r || (this.addTaskToExistingTeam(n), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, a, o));
                        let s = n.getDownloadSpeed(), l = this.getIncreaseSpeedInfo(a), u = l.increaseSpeed, d = {};
                        d.uploaded = this.getUploadedSize(), d.progress = i.fileSize > 0 ? 100 * i.downloadSize / i.fileSize : 0, d.progress > 100 && (d.progress = 100), d.increased = l.increaseSize;
                        let c = JSON.stringify(d);
                        b.information("onDetailChanged", " taskSpeed: ", s, " increaseSpeed: ", u, " extraInfoStr: ", c), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, a, s, u, c, o)
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    if (!n) continue;
                    let i = n.getId(), a = n.getTaskStatus();
                    n.getTaskPreStatus() === c.DownloadKernel.TaskStatus.StartPending && a === c.DownloadKernel.TaskStatus.Started && this.addTaskToExistingTeam(n);
                    let o = this.getTaskUniqueIdByTask(n);
                    if (!o || "" === o) continue;
                    let r = a;
                    if (b.information("onTaskStatusChanged", " taskId: ", i), b.information("onTaskStatusChanged", " taskUniqueId: ", o), b.information("onTaskStatusChanged", " status: ", r), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, i, r, o), a === c.DownloadKernel.TaskStatus.DestroyPending) {
                        b.information("onTaskStatusChanged delete taskInfoMap taskUniqueId:", o), this.taskIdMap.delete(o);
                        let e = this.taskGroupInfoMap.get(o);
                        e && e.taskId === i && (e.taskId = 0)
                    }
                    a !== c.DownloadKernel.TaskStatus.Succeeded && a !== c.DownloadKernel.TaskStatus.Seeding || this.sendFileCompleteStat(i)
                }
            }

            onInsertToCategoryView(e, t, n) {
                if (n) if (t === c.DownloadKernel.CategroyViewID.Downloading) {
                    b.information("onInsertToCategoryView Downloading number of taskList:", n.length);
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e];
                        if (!t) continue;
                        let i = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (b.information("onInsertToCategoryView taskId: ", i, "taskUniqueId: ", a), this.taskIdMap.get(a) || this.addTaskToExistingTeam(t))
                    }
                } else if (t === c.DownloadKernel.CategroyViewID.Recycle) {
                    b.information("onInsertToCategoryView Recycle number of taskList:", n.length);
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e];
                        if (!t) continue;
                        let i = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (b.information("onInsertToCategoryView", " taskId: ", i), b.information("onInsertToCategoryView", " taskUniqueId: ", a), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, i, 20, a))
                    }
                }
            }

            onRemoveFromCategoryView(e, t, n) {
                if (t === c.DownloadKernel.CategroyViewID.Recycle) do {
                    if (!n) break;
                    b.information("onRemoveFromCategoryView number of taskList:", n.length);
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e];
                        if (!t) continue;
                        let i = t.getId(), a = t.getTaskStatus(), o = this.getTaskUniqueIdByTask(t);
                        if (!o || "" === o) continue;
                        let r = a;
                        b.information("onRemoveFromCategoryView", " taskId: ", i), b.information("onRemoveFromCategoryView", " taskUniqueId: ", o), b.information("onRemoveFromCategoryView", " status: ", r), C.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, i, r, o)
                    }
                } while (0)
            }

            reportGroupAccelerateTaskInfo() {
                do {
                    if (!this.currentUserId || 0 === this.currentUserId) break;
                    b.information("reportGroupAccelerateTaskInfo", " currentUserId: ", this.currentUserId);
                    let e = new Array;
                    if (this.taskGroupInfoMap.forEach((t, n) => {
                        let i = {};
                        i.group_id = t.groupId, b.information("reportGroupAccelerateTaskInfo", " groupId: ", t.groupId), i.uid = this.currentUserId;
                        let a = t.taskId;
                        if (a) {
                            let e = S.getTaskFromTaskId(a);
                            if (e) {
                                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize),
                                    n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                                i.rate = Math.round(1e3 * t / n) / 10, i.ul_total = this.getUploadedSize(), i.ul_time = (new Date).getTime() - this.enterGroupAccelerateTimeStamp, i.dl_speed = this.getTaskAverageSpeed(a)
                            } else i.rate = 0, i.ul_total = 0, i.ul_time = 0, i.dl_speed = 0
                        } else i.rate = 0, i.ul_total = 0, i.ul_time = 0, i.dl_speed = 0;
                        b.information("reportGroupAccelerateTaskInfo", " group_id: ", i.group_id), b.information("reportGroupAccelerateTaskInfo", " rate: ", i.rate), b.information("reportGroupAccelerateTaskInfo", " ul_total: ", i.ul_total), b.information("reportGroupAccelerateTaskInfo", " ul_time: ", i.ul_time), b.information("reportGroupAccelerateTaskInfo", " dl_speed: ", i.dl_speed), e.push(i)
                    }), e.length <= 0) break;
                    u.fetchSlRes({url: "/group_accel/report_batch", data: {data: e}, method: "post"}).then(e => {
                    }).catch(() => {
                    })
                } while (0)
            }

            checkTaskGroupAccelerateStatus() {
                b.information("checkTaskGroupAccelerateStatus this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && this.loadGroupAccelerateInfo().then(e => {
                    do {
                        if (!e || e.size <= 0) {
                            b.information("checkTaskGroupAccelerateStatus bad taskGroupInfoMapTemp");
                            break
                        }
                        let t = [];
                        if (e.forEach((e, n) => {
                            let i = e.taskId;
                            if (b.information("checkTaskGroupAccelerateStatus", " taskUniqueId: ", n, " taskId: ", i), i) {
                                S.getTaskFromTaskId(i) && n && "" !== n && (b.information("checkTaskGroupAccelerateStatus has task"), t.push(n))
                            }
                        }), t.length <= 0) break;
                        u.fetchSlRes({
                            url: "/group_accel/belong_batch",
                            data: {uid: this.currentUserId, tasks: t},
                            method: "post"
                        }).then(t => {
                            if (b.information("checkTaskGroupAccelerateStatus fetchSlRes success res.data: ", t.data), "ok" === t.data.result && t.data.data) {
                                let n = t.data.data;
                                for (let t = 0; t < n.length; t++) if (b.information("checkTaskGroupAccelerateStatus data[", t, "]:", n[t]), 1 === n[t].belong_status) {
                                    let i = n[t].group_id, a = n[t].member_count, o = n[t].group_name, r = n[t].task;
                                    e.forEach((e, t) => {
                                        if (e.groupId === i && t === r) {
                                            this.joinTeam(e.taskId, "" + i, o, a, t).catch();
                                            let n = this.taskGroupInfoMap.get(t);
                                            n && (n.memberCount = a, n.groupName = o)
                                        }
                                    })
                                }
                            }
                        }).catch(() => {
                            b.information("checkTaskGroupAccelerateStatus", " fetchSlRes failed")
                        })
                    } while (0)
                }).catch(() => {
                })
            }

            sendExitAllTeamCommand(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (!e) break;
                        let n = new Array;
                        this.taskGroupInfoMap.forEach((e, t) => {
                            n.push(e.groupId), b.information("sendExitAllTeamCommand", " groupId: ", e.groupId)
                        }), 0 === n.length && (b.information("sendExitAllTeamCommand no group"), t = !0), u.fetchSlRes({
                            url: "/group_accel/exit_batch",
                            data: {uid: this.currentUserId, group_ids: n},
                            method: "post"
                        }).then(e => {
                            b.information("sendExitAllTeamCommand success"), t = !0
                        }).catch(() => {
                            b.information("sendExitAllTeamCommand failed"), t = !1
                        })
                    } while (0);
                    return t
                })
            }

            getUserGroupAccelerateInfo() {
                return i(this, void 0, void 0, function* () {
                    b.information("getUserGroupAccelerateInfo this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && u.fetchSlRes({
                        url: "/group_accel/user_info",
                        data: {uid: this.currentUserId},
                        method: "get"
                    }).then(e => {
                        do {
                            if (b.information("getUserGroupAccelerateInfo success ", e), !e) {
                                b.information("getUserGroupAccelerateInfo bad res"), this.currentUserLicensed = !1;
                                break
                            }
                            if (!e.data) {
                                b.information("getUserGroupAccelerateInfo bad res.data"), this.currentUserLicensed = !1;
                                break
                            }
                            if (!e.data.data) {
                                b.information("getUserGroupAccelerateInfo bad res.data"), this.currentUserLicensed = !1;
                                break
                            }
                            e.data.data.have_licence && 1 === e.data.data.have_licence ? (b.information("getUserGroupAccelerateInfo licensed"), this.currentUserLicensed = !0) : (b.information("getUserGroupAccelerateInfo not licensed"), this.currentUserLicensed = !1)
                        } while (0)
                    }).catch(() => {
                        b.information("getUserGroupAccelerateInfo fail"), this.currentUserLicensed = !1
                    })
                })
            }

            getNewPercent(e, t) {
                b.information("getNewPercent", " currentPercent: ", e, " taskType: ", t);
                let n = 0, i = 0, a = 5, o = 0;
                do {
                    if (t === c.DownloadKernel.TaskType.P2sp) n = 10, i = 40, a = 5; else if (t === c.DownloadKernel.TaskType.Bt) n = 30, i = 80, a = 10; else {
                        if (t !== c.DownloadKernel.TaskType.Emule) {
                            o = e;
                            break
                        }
                        n = 20, i = 60, a = 10
                    }
                    if (e) if (e < n || e > i) o = n + (i - n) * Math.random(); else {
                        let t = e - a;
                        t < n && (t = n);
                        let r = e + a;
                        r > i && (r = i), o = t + (r - t) * Math.random()
                    } else o = n + (i - n) * Math.random()
                } while (0);
                return b.information("getNewPercent", " newPercent: ", o), o
            }

            setTaskPriority(e, t) {
                do {
                    if (!e) break;
                    if (!t || 0 !== t && 700 !== t && 999 !== t) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    n.getExtraObject().setTaskPriorityLevel(-1, t), b.information("taskExtra.setTaskPriorityLevel taskId: ", e, ", index: -1, priority: ", t)
                } while (0)
            }

            getTaskAverageSpeed(e) {
                let t = S.getTaskFromTaskId(e);
                if (!t) return 0;
                let n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    i = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize);
                0 === n && (n = 1);
                let a = Math.round(i / n);
                return b.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", a), b.information("getTaskAverageSpeed downloadSize:", i, ", downloadingPeriod:", n), a
            }

            getIncreaseSpeedInfo(e) {
                let t = {increaseSpeed: 0, increaseSize: 0};
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTaskId(e);
                    if (!i || "" === i) break;
                    let a = this.taskGroupInfoMap.get(i);
                    if (!a) break;
                    let o = n.getTaskBaseInfo().taskType, r = a.currentPercent, s = this.getNewPercent(r, o);
                    a.currentPercent = s;
                    let l = this.getTaskP2PSpeedInfo(e), u = Math.round(s * l.p2pSpeed / 100),
                        d = Math.round(s * l.p2pSize / 100), c = a.currentIncreaseSize;
                    c += d, a.currentIncreaseSpeed = u, a.currentIncreaseSize = c, t.increaseSpeed = u, t.increaseSize = c
                } while (0);
                return t
            }

            getTaskP2PSpeedInfo(e) {
                let t = {p2pSpeed: 0, p2pSize: 0};
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTask(n);
                    if (!i || "" === i) break;
                    let a = this.taskGroupInfoMap.get(i);
                    if (!a) break;
                    let o = n.getTaskBaseInfo().downloadingPeriod;
                    if (!o) break;
                    let r = n.getTaskChannelInfo();
                    if (!r) break;
                    let s = r.p2pSize - r.dcdnSize;
                    if (s < 0 && (s = 0), !a.lastDownloadingPeriod || !a.lastP2PSize) {
                        a.lastDownloadingPeriod = o, a.lastP2PSize = s;
                        break
                    }
                    let l = s - a.lastP2PSize;
                    l < 0 && (l = 0), a.lastP2PSize = s;
                    let u = o - a.lastDownloadingPeriod;
                    u < 0 && (u = 0), a.lastDownloadingPeriod = o;
                    let d = 0;
                    0 !== u && (d = Math.round(l / u));
                    let c = n.getTaskBaseInfo().downloadSpeed;
                    d > c && (d = c), t.p2pSpeed = d, t.p2pSize = l
                } while (0);
                return t
            }

            getUploadedSize() {
                let e = 0, t = h.DownloadKernelManager.getTotalUploadSize();
                return t && (e = t, this.enterGroupAccelerateUploadSize && (e -= this.enterGroupAccelerateUploadSize)), e
            }

            saveGroupAccelerateInfo() {
                return i(this, void 0, void 0, function* () {
                    if (b.information("saveGroupAccelerateInfo", " currentUserId: ", this.currentUserId), !this.currentUserId) return;
                    let e = r.join(__profilesDir, "GroupAccelerate");
                    (yield s.FileSystemAWNS.existsAW(e)) || (yield s.FileSystemAWNS.mkdirsAW(e));
                    let t = r.join(__profilesDir, "GroupAccelerate\\TaskInfoEx_" + this.currentUserId + ".txt");
                    b.information("saveGroupAccelerateInfo", " filePath: ", t), b.information("saveGroupAccelerateInfo", " this.taskGroupInfoMap.size: ", this.taskGroupInfoMap.size);
                    let n = JSON.stringify([...this.taskGroupInfoMap]);
                    b.information("saveGroupAccelerateInfo", " strData: ", n), yield s.FileSystemAWNS.writeFileAW(t, n)
                })
            }

            loadGroupAccelerateInfo() {
                return i(this, void 0, void 0, function* () {
                    if (b.information("loadGroupAccelerateInfo", " currentUserId: ", this.currentUserId), !this.currentUserId) return null;
                    let e = r.join(__profilesDir, "GroupAccelerate\\TaskInfoEx_" + this.currentUserId + ".txt");
                    b.information("loadGroupAccelerateInfo", " filePath: ", e);
                    let t = yield s.FileSystemAWNS.readFileAW(e), n = null;
                    try {
                        let e = t.toString();
                        return b.information("loadGroupAccelerateInfo", " fileStr: ", e), n = new Map(JSON.parse(e))
                    } catch (e) {
                        return null
                    }
                })
            }

            sendFileCompleteStat(e) {
                do {
                    if (!e) break;
                    let t = S.getTaskFromTaskId(e);
                    if (!t) break;
                    let n = this.getTaskUniqueIdByTask(t);
                    if (!n || "" === n) break;
                    let i = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                    if (!i || i < 104857600) break;
                    let a = this.taskGroupInfoMap.get(n);
                    if (!a) break;
                    let r = a.previousSpeed;
                    if (!r) break;
                    let s = "pannel=complete,taskid=" + e + ",gcid=" + n + ",previos_speed=" + r + ",stop_speed=" + this.getTaskAverageSpeed(e);
                    b.information("SendFileCompleteStat", " strExtData: ", s), o.XLStatNS.trackEvent("download_pannel", "groupspeed", "", 0, 0, 0, 0, s)
                } while (0)
            }

            getIsVip() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        T.LoginHelperNS.loginHelper.getUserInfo("vipList", function (t) {
                            v.isArray(t) && t[0] ? e("1" === t[0].isVip) : e(!1)
                        })
                    })
                })
            }
        }

        e.Manager = t;
        const n = new t;
        e.getManager = function () {
            return n
        }
    }(t.GroupAccelerateManagerNS || (t.GroupAccelerateManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n;
        !function (e) {
            e[e.tab = 1] = "tab", e[e.app = 2] = "app", e[e.download = 3] = "download", e[e.defaultBrowser = 5] = "defaultBrowser", e[e.ieBrowser = 6] = "ieBrowser"
        }(t = e.OpenType || (e.OpenType = {})), function (e) {
            e.AdPlatform = "AdPlatform"
        }(n = e.AdName || (e.AdName = {})), e.eventAdShow = "event_ad_show"
    }(t.AdCommonNS || (t.AdCommonNS = {}))
}, , , function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(291), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(850), r = n(892), s = n(940);
    let l = class extends a.Vue {
    };
    l = i([a.Component({
        components: {
            MainTop: o.default,
            MainBottom: r.default,
            MainBackground: s.default
        }
    })], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(293), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(851), r = n(860), s = n(875), l = n(880), u = n(886), d = n(888);
    let c = class extends a.Vue {
        constructor() {
            super(...arguments), this.dragable = !0
        }
    };
    c = i([a.Component({
        components: {
            LoginArea: o.default,
            AddressBarContainer: r.default,
            SystemButtonsContainer: s.default,
            TabsContainer: l.default,
            MessageTips: u.default,
            BookMarks: d.default
        }
    })], c), t.default = c
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(295), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(3), r = n(4), s = n(2), l = n(5), u = n(38), d = n(51), c = n(1), h = n(13), f = n(12), g = n(7),
        p = n(852), k = n(854), m = n(21);
    let {isDef: T} = f.ThunderUtil;
    const v = g.default(s.join(__rootDir, "../bin/ThunderHelper.node")), C = n(252), S = n(859),
        y = c.default.getLogger("Thunder.Main");
    let w = class extends r.Vue {
        constructor() {
            super(...arguments), this.userNick = "点击登录", this.curLoginStatus = "unlogin", this.oldLoginStatus = "unlogin", this.isLogin = !1, this.isShowPersonalInfoWnd = !1, this.curUserid = "", this.isVip = 0, this.isYear = 0, this.vipLevel = 0, this.vipType = 2, this.headerUrl = "", this.curLoginHeaderUrl = C, this.yearIcon = "vip-icon-nian is-large is-disabled", this.rectDatas = "", this.bShowUserInfoPanle = !1, this.yearTipsText = "", this.strOpenVip = "", this.isShowYearTip = !1, this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1, this.curIconUrl = null, this.curIconText = "", this.cashTipTrigger = null, this.promptData = null, this.promptTextClicked = !1, this.personalInfoWnd = null, this.nVipGrow = 0, this.vipData = null
        }

        onHeaderChange(e, t) {
            y.information("curLoginHeaderUrl cur=", e, ";old=", t)
        }

        get strNickCss() {
            let e = "";
            return this.isLogin && 0 !== this.isVip && (e = "is-vip"), e
        }

        get userYearIcon() {
            return 0 !== this.isYear && 0 !== this.isVip ? (this.yearIcon = "vip-icon-nian", this.yearTipsText = "迅雷年费会员", this.strOpenVip = "") : (this.yearIcon = "vip-icon-nian is-disabled", this.yearTipsText = "年费会员"), this.yearIcon
        }

        get strIsOffline() {
            let e = "";
            return "offline" === this.curLoginStatus && (e = "is-offline"), y.information("strIsOffline:", e), e
        }

        closePersonalInfoWnd() {
            null !== this.personalInfoWnd && (this.personalInfoWnd.close(), this.personalInfoWnd = null)
        }

        setDefaultHeader() {
            y.information("setDefaultHeader"), this.curLoginHeaderUrl = C
        }

        setDefaultIcon() {
            y.information("setDefaultIcon"), this.curIconUrl = S
        }

        showPersonalInfoWnd(e) {
            return a(this, void 0, void 0, function* () {
                let t = this.getClientRectsEx(), n = this.isLoginInfoRect(t);
                y.information("datastr", t, n), n && (this.personalInfoWnd = yield d.LoginHelperNS.loginUIHelper.createPersonalInfoWnd(e, t), null !== this.personalInfoWnd && (this.personalInfoWnd.once("ready-to-show", () => {
                    if (t = this.getClientRectsEx(), n = this.isLoginInfoRect(t)) {
                        let e = this.personalInfoWnd.getNativeWindowHandle().readUIntLE(0, 4);
                        v.modifyStyle(e, m.WindowStyle.WS_THICKFRAME, 0), v.modifyStyleEx(e, 0, m.ExtendedWindowStyles.WS_EX_TOOLWINDOW), this.personalInfoWnd.show(), u.ToolsUtilitiesAWNS.setForegroundWindow(v, this.personalInfoWnd), this.isLogin && this.stat("userinfo_show")
                    } else this.closePersonalInfoWnd()
                }), this.personalInfoWnd.once("closed", () => {
                    this.personalInfoWnd = null
                })))
            })
        }

        onPromptTitleShow(e) {
            if (y.information("onPromptTitleShow", e), e) {
                let e = "";
                e = "is_ad=1";
                let t = encodeURIComponent(e);
                y.information(e, t), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_show", "", 0, 0, 0, 0, t)
            }
        }

        onToolYearTip(e) {
            if (e) {
                if (this.$emit("tooltip-show"), "开通会员" === this.strOpenVip) {
                    let e = "";
                    e = "is_vip=" + this.isVip + ",vip_type=" + this.vipType, 0 === this.isVip && 0 === this.nVipGrow ? e += ",show_type=1" : 0 === this.isVip && 0 !== this.nVipGrow && (e += ",show_type=2");
                    let t = encodeURIComponent(e);
                    y.information(e, t), h.XLStatNS.trackEvent("clienttop", "xufei_botton_show", "", 0, 0, 0, 0, t)
                }
            } else this.$emit("tooltip-hide");
            this.isShowYearTip = e
        }

        onIconClick() {
            k.VipRenewIconManagerNS.getIconManager().onIconClick()
        }

        getClientRectsEx() {
            let e = null, t = 10, n = 40;
            T(this.$refs.userAvatar) && null !== (e = this.$refs.userAvatar.getClientRects()) && void 0 !== e && e.length > 0 && null !== e[0] && void 0 !== e[0] && (t = e[0].left, n = e[0].right), this.isLogin ? T(this.$refs.userVip) && (e = this.$refs.userVip.$el.getClientRects(), T(e) && e.length > 0 && null !== e[0] && void 0 !== e[0] ? n = e[0].right : T(this.$refs.userNick) && (e = this.$refs.userNick.getClientRects(), T(e) && e.length > 0 && null !== e[0] && void 0 !== e[0] && (n = e[0].right))) : T(this.$refs.login) && (e = this.$refs.login.getClientRects(), T(e) && e.length > 0 && null !== e[0] && void 0 !== e[0] && (n = e[0].right));
            let i = n - t + 5;
            return JSON.stringify({width: i, height: 40})
        }

        isLoginInfoRect(e) {
            let t = !1;
            do {
                let n = o.screen.getCursorScreenPoint(), i = null;
                try {
                    i = JSON.parse(e)
                } catch (e) {
                    y.warning(e)
                }
                if (null === i) break;
                let a = o.remote.getCurrentWindow().getBounds(), r = a.x + 10, s = a.y + 3,
                    l = a.x + 10 + Number(i.width), u = a.y + 10 + Number(i.height);
                n.x >= r && n.x <= l && n.y >= s && n.y <= u && (t = !0)
            } while (0);
            return t
        }

        getUserAvatarRect() {
            let e = o.remote.getCurrentWindow().getBounds(), t = this.$refs.userAvatar.getClientRects(),
                n = e.x + t[0].left, i = e.y + t[0].top, a = t[0].right - t[0].left, r = t[0].bottom - t[0].top;
            return JSON.stringify({x: n, y: i, width: a, height: r})
        }

        enter(e) {
            if (y.information("enter:", e, this.isLogin, this.personalInfoWnd), "offline" !== this.curLoginStatus && null === this.personalInfoWnd) this.showPersonalInfoWnd(e).catch(); else if ("offline" === this.curLoginStatus && "head" === e) {
                let e = this.getUserAvatarRect();
                this.closePersonalInfoWnd(), d.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
            }
        }

        clickPromptTitle(e) {
            if (y.information("点击促销文案", this.promptData.title), y.information("islogin", this.isLogin), y.information("curLoginStatus", this.curLoginStatus), !this.isLogin) {
                let t = `button=${e}`;
                t += ",is_ad=1", y.information("extData", t);
                let n = encodeURIComponent(t);
                y.information(t, n), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_click", "", 0, 0, 0, 0, n), this.promptTextClicked = !0, y.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl), d.LoginHelperNS.loginHelper.showLoginDlg("clienthead", !0), y.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl)
            }
        }

        clickUserHeader(e) {
            if (y.information("点击登录", this.curLoginStatus), this.isLogin && "online" === this.curLoginStatus) {
                let t = "http://pc.xunlei.com/d#/users/" + this.curUserid + "?entrypage=client_leftright_login&entry=client_leftright_login_head";
                l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t);
                let n = `button=${e}`;
                n = n + ",is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=v_pc_xlx_ggong_head_nickname";
                let i = encodeURIComponent(n);
                y.information(n, i), h.XLStatNS.trackEvent("clienttop", "head_nickname_click", "", 0, 0, 0, 0, i)
            } else "unlogin" === this.curLoginStatus && d.LoginHelperNS.loginHelper.showLoginDlg("clienthead", !0);
            let t = `button=${e}`, n = "no";
            this.isLogin && (n = "yes"), t = `${t},is_login=${n}`, !this.isLogin && this.promptData && this.clickPromptTitle("head"), h.XLStatNS.trackEvent("clienttop", "clienttop_userinfo_click", "", 0, 0, 0, 0, t)
        }

        onClick(e) {
            let t = "", n = "", i = "";
            if ("nian" === e ? (t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_yearicon", n = "nf_icon_click", i = "v_pc_xlx_ggong_yearicon") : "vip" === e ? (t = 0 !== this.isVip ? "https://vip.xunlei.com/vip_service/rule/?referfrom=v_pc_xlx_ggong_vipicon" : "https://pay.xunlei.com/pay.html?bizNo=baijin?referfrom=v_pc_xlx_ggong_vipicon", n = "vip_icon_click", i = "v_pc_xlx_ggong_vipicon") : "nian_tip" === e && (this.isShowYearTip = !1, t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_pay_top", n = "xufei_botton_click", i = "v_pc_xlx_ggong_pay_top"), "" !== t) {
                l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t);
                let a = "";
                a = "is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=" + i, "vip" === e ? 0 === this.isVip && 0 === this.nVipGrow ? a += ",show_type=1,aidfrom=ktnovip" : 0 === this.isVip && 0 !== this.nVipGrow && (a += ",show_type=2,aidfrom=ktnovip1") : "nian_tip" === e && (0 === this.isVip && 0 === this.nVipGrow ? a += ",show_type=1,aidfrom=xfbtn_exp7_kt" : 0 === this.isVip && 0 !== this.nVipGrow && (a += ",show_type=2,aidfrom=xfbtn_exp7_kt"));
                let o = encodeURIComponent(a);
                y.information(e, a, o), h.XLStatNS.trackEvent("clienttop", n, "", 0, 0, 0, 0, o)
            }
        }

        switchAccount() {
            this.isLogin = !1, this.curUserid = "", this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = C, this.rectDatas = "", this.updateLoginStatus(), d.LoginHelperNS.loginHelper.switchAccount("changeaccount")
        }

        personalCenter() {
            l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "http://i.xunlei.com/login.html")
        }

        updateLoginStatus() {
            if (y.information(this.oldLoginStatus, this.curLoginStatus), this.oldLoginStatus === this.curLoginStatus) ; else {
                let e = this.oldLoginStatus;
                this.oldLoginStatus = this.curLoginStatus, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onLoginStatusChange", e, this.curLoginStatus, function (e) {
                })
            }
            this.checkPromptState()
        }

        updateUserInfo(e) {
            return a(this, void 0, void 0, function* () {
                return new Promise(t => {
                    d.LoginHelperNS.loginHelper.getAllUserInfo(n => {
                        do {
                            if (y.information("收到 getAllUserInfo 返回数据"), null === n || void 0 === n) {
                                y.information("getAllUserInfo 得到数据是 null");
                                break
                            }
                            "login" === e && (this.isLogin = !0, this.curLoginStatus = "online", this.updateLoginStatus()), this.curUserid = n.userID, this.userNick = n.nickName, this.rectDatas = "", "login" === e && h.XLStatNS.setUserID(Number(this.curUserid));
                            let t = n.imgURL;
                            if (null !== t && void 0 !== t && "" !== t || (t = "http://img2.user.kanimg.com/usrimg/" + this.curUserid + "/%s"), t = t.replace("%s", "100*100"), this.headerUrl = t, null === n.vipList || void 0 === n.vipList) break;
                            if (null === n.vipList[0] || void 0 === n.vipList[0]) break;
                            let i = n.vipList[0];
							if (i.isVip == 0) {
								i.vipLevel = 10;
								i.isVip = 1;
								i.isYear = 1;							
								i.vasType = 5;
								}
                            if (this.vipData = [{
                                VIPLevel: i.vipLevel,
                                isVIP: i.isVip,
                                isYear: i.isYear,
                                uid: n.userID,
                                vasID: 2,
                                vasType: i.vasType
                            }], "update" === e) {
                                let e = {isVip: Number(i.isVip), vasType: Number(i.vasType), expireDate: i.expireDate};
                                k.VipRenewIconManagerNS.getIconManager().updateUserVipData(e)
                            }
                            this.isYear = Number(i.isYear), this.isVip = Number(i.isVip), this.vipLevel = Number(i.vipLevel), this.vipType = Number(i.vasType), "" !== i.vipGrow && (this.nVipGrow = Number(i.vipGrow))
                        } while (0);
                        t()
                    })
                })
            })
        }

        setChangeData(e, t) {
            if (y.information("onLoginFailed:getCurInternetState: setChangeData: ", e, t), 0 === e && 2 === t) {
                this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                let e = this.getUserAvatarRect();
                this.closePersonalInfoWnd(), d.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
            } else this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = C, this.updateLoginStatus()
        }

        checkPromptState() {
            if (y.information("islogin", this.isLogin, "currentloginstatus", this.curLoginStatus, "nickname", this.userNick), this.isLogin || "unlogin" !== this.curLoginStatus) "online" === this.curLoginStatus && (this.promptData = null); else {
                let e = p.LoginPromptManagerNS.getPromptData();
                e && (null != this.promptData && this.promptData.id === e.id || this.onPromptTitleShow(!0), this.promptData = e, this.curLoginHeaderUrl = this.promptData.imgLocalPath, y.information("prompt data", this.promptData))
            }
        }

        stat(e) {
            let t = `is_login=${this.isLogin ? 1 : 0},is_vip=${this.isVip}`;
            y.information(e, t), h.XLStatNS.trackEvent("user_info", e, "", 0, 0, 0, 0, t)
        }

        mounted() {
            l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginBefore", (e, t) => {
                if (y.information("收到onLoginBefore事件：this.oldLoginStatus = ", this.oldLoginStatus, e, t), "unlogin" === this.oldLoginStatus) if (this.rectDatas = "", this.curLoginStatus = "loging", this.updateLoginStatus(), null !== t && void 0 !== t && "" !== t && null !== e && void 0 !== e && "" !== e) {
                    this.userNick = e, this.curLoginHeaderUrl = C;
                    let n = d.LoginHelperNS.loginHelper.getUserHeader(t);
                    y.information("onLoginBefore:getUserHeader = ", n, "this.curLoginStatus:", this.curLoginStatus), "loging" === this.curLoginStatus && null !== n && void 0 !== n && "" !== n && (this.curLoginHeaderUrl = n)
                } else this.userNick = "正在登录...", this.curLoginHeaderUrl = C
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => a(this, void 0, void 0, function* () {
                if (y.information("收到 onLoginSuc 事件"), this.promptTextClicked && this.promptData && this.promptData.url) {
                    this.promptTextClicked = !1;
                    let e = this.promptData.url;
                    y.information("prompt url", e), l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", e)
                }
                yield this.updateUserInfo("login"), this.enter("onLoginSuc")
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onGetUserInfoFinished", () => a(this, void 0, void 0, function* () {
                y.information("收到 onGetUserInfoFinished 事件"), yield this.updateUserInfo("update");
                let e = yield d.LoginHelperNS.loginHelper.updateHeaderAw(this.headerUrl, this.curUserid);
                y.information("下载头像成功：", e, this.curLoginStatus), "online" === this.curLoginStatus && null !== e && void 0 !== e && "" !== e && (this.curLoginHeaderUrl = e, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onUserHeaderChange", e, e => {
                }))
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginFailed", (e, t) => {
                y.information("收到 onLoginFailed 事件, this.oldLoginStatus:", this.oldLoginStatus, ";erro:", e, ";code:", t);
                let n = Number(e), i = d.LoginHelperNS.loginHelper.getCurInternetState();
                "offline" !== this.oldLoginStatus ? 0 === i ? setTimeout(() => {
                    let e = d.LoginHelperNS.loginHelper.getCurInternetState();
                    this.setChangeData(n, e)
                }, 3e3) : this.setChangeData(n, i) : 1 === n && (this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = C, this.updateLoginStatus())
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                y.information("收到 onLogout 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = C, this.rectDatas = "", this.updateLoginStatus(), this.closePersonalInfoWnd(), k.VipRenewIconManagerNS.getIconManager().onLogout(), h.XLStatNS.setUserID(0)
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onSwitchAccount", () => {
                this.switchAccount(), this.closePersonalInfoWnd()
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onInternetConnectChange", (e, t) => {
                if (2 === t) {
                    if ("online" === this.curLoginStatus) {
                        this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                        let e = this.getUserAvatarRect();
                        this.closePersonalInfoWnd(), d.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
                    }
                } else 1 === t && (y.information("onInternetConnectChange:", this.curLoginStatus), "offline" === this.curLoginStatus && setTimeout(() => {
                    d.LoginHelperNS.loginHelper.logIn("RetryLogin")
                }, 3e3))
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onUserDetailInfoChange", e => {
                if (null !== e && void 0 !== e && "" !== e) try {
                    let t = JSON.parse(e);
                    this.userNick = t.nickName
                } catch (e) {
                    y.warning(e)
                }
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginUpdate", (e, t) => {
                y.information("收到事件 onLoginUpdate:", e, t), "vipinfo" !== e && "userinfo" !== e || this.updateUserInfo("update").catch(), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "onUserInfoChange", e, t, e => {
                    y.information("fire onUserInfoChange:", e)
                })
            }), o.remote.ipcMain.on("onCancelRetry", () => {
                y.information("收到 onCancelRetry 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = C, this.rectDatas = "", this.updateLoginStatus(), d.LoginHelperNS.loginHelper.logout()
            });
            let e = p.LoginPromptManagerNS.getManager();
            e.attachListener(p.LoginPromptManagerEventNS.promptDataGet, e => {
                y.information("prompt data event result", e), e && this.checkPromptState()
            }), e.init(), y.information("attach prompt data event");
            let t = k.VipRenewIconManagerNS.getIconManager();
            t.attachListener(k.UserEventNS.userTypeChanged, e => {
                if (t.$hasCash ? this.cashTipTrigger = "hover" : this.cashTipTrigger = null, 7 === e || 6 === e || 8 === e ? (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1, this.curIconText = "开通会员") : 9 === e || 10 === e || 11 === e || 12 === e || 13 === e || 14 === e ? (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1, this.curIconText = "续费会员") : (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1), t.$iconData && (this.curIconUrl = t.$iconData.iconUrl, this.curIconText = t.$iconData.iconText, y.information("curIconUrl", this.curIconUrl), y.information("curIconText", this.curIconText)), this.isCanShowOpenVipBtn || this.isCanShowXufeiBtn) {
                    k.VipRenewIconManagerNS.getIconManager().onIconShow()
                }
            })
        }
    };
    i([r.Watch("curLoginHeaderUrl", {immediate: !0})], w.prototype, "onHeaderChange", null), w = i([r.Component({})], w), t.default = w
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(297), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(861), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentTabIndex: e => e.Tabs.current,
            bookMarks: e => e.BookMarks.bookMarks,
            allNetGroups: e => e.Group.all
        },
        mapGettersToProps: {
            currentTab: e => e.currentTab,
            currentSelectdTaskIds: e => e.currentSelectdTaskInfos.map(e => e.taskId)
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            onOriginalUrlChange: "ON_ORIGINAL_URL_CHANGE",
            addBookMarksItem: "ADD_BOOK_MARKS_ITEM",
            deleteBookMarksItem: "REMOVE_BOOK_MARKS_ITEM"
        },
        mapDispatchToProps: {getGroupData: "getGroupData"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(299), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(301), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(876), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {bookMarks: e => e.BookMarks.bookMarks},
        mapCommitToProps: {createNewTab: "CREATE_NEW_TAB"},
        mapGettersToProps: {currentTab: e => e.currentTab}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(303), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(3), s = n(136), l = n(877), u = n(25), d = n(743), c = n(744), h = n(33), f = n(2), g = n(7),
        p = n(5), k = n(24), m = n(13), T = n(234), v = n(1), C = n(56), S = n(15), y = n(82), w = n(53), I = n(14),
        b = n(77), A = n(23), N = n(236), D = g.default(f.join(__rootDir, "../bin/ThunderHelper.node")),
        _ = v.default.getLogger("system-buttons"),
        x = T.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(), E = n(93);
    let P = class extends o.Vue {
        constructor() {
            super(...arguments), this.bSelectAutoRun = !0, this.maximized = !1, this.disableHover = !1, this.showNewIcon = !1, this.communityName = "community", this.blankPage = "http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", this.bSelectShowBookmark = !1, this.isShowNewTag = !1
        }

        onMaximizedChange(e, t) {
        }

        get curUrl() {
            return E(this.currentTab, "tab", "url")
        }

        get hideCollectIcon() {
            return _.information("cur url", this.curUrl), E(this.currentTab, "tab", "type") === s.TabType.XDAS || E(this.currentTab, "tab", "name") === this.communityName || E(this.currentTab, "tab", "url") === this.blankPage || !1 === E(this.currentTab, "tab", "showUrl")
        }

        closeMainWindow() {
            m.XLStatNS.trackEvent("clienttop", "clienttop_close_click"), this.disableHover = !0, this.$nextTick(() => {
                r.ipcRenderer.send("closeMainWindow")
            })
        }

        minizeMainWindow(e) {
            this.disableHover = !0;
            let t = encodeURIComponent("button=small_get");
            m.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                r.ipcRenderer.send("minizeMainWindow")
            })
        }

        toggleMaximizeMainWindow() {
            this.disableHover = !0;
            let e = `button=${this.maximized ? "get_back" : "big_get"}`, t = encodeURIComponent(e);
            m.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                this.maximized ? r.ipcRenderer.send("restoreMainWindow") : r.ipcRenderer.send("maximizeMainWindow")
            })
        }

        showNewTag() {
            return a(this, void 0, void 0, function* () {
                let e = yield N.default.getWallpapers();
                do {
                    if (null === e) break;
                    let t = u.ConfigNS.getValue("Skin", "ClickTag", 0);
                    for (let n of e) {
                        if ((new Date).getTime() - n.updated_at < 6048e5 && t < n.updated_at) {
                            this.isShowNewTag = !0;
                            break
                        }
                    }
                } while (0)
            })
        }

        showMenu(e) {
            m.XLStatNS.trackEvent("clienttop", "clienttop_dropdown_click"), this.showNewIcon = !1, u.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1);
            let t = D.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
            this.bSelectAutoRun = "" !== t, u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0) !== this.bSelectAutoRun && u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun), this.bSelectShowBookmark = u.ConfigNS.getValue("Bookmark", "ShowBookmarkBar", 0) && !0;
            let n = [];
            n.push({
                type: "normal",
                label: "新建下载任务(&N)",
                accelerator: "CmdOrCtrl+N",
                role: "",
                icon: `${__rootDir}/static/icon/newtask.png`,
                click: () => {
                    this.menuItemClick("newtask", !0)
                }
            }, {
                type: "normal", label: "导入未完成下载", click: () => {
                    this.menuItemClick("unfinished", !0)
                }
            }, {
                type: "normal", label: "设置中心", icon: `${__rootDir}/static/icon/config.png`, click: () => {
                    this.menuItemClick("setting", !0)
                }
            }, {
                type: "normal",
                label: "离线空间",
                icon: `${__rootDir}/static/icon/address.png`,
                enabled: !0,
                click: () => {
                    this.menuItemClick("offline", !0)
                }
            }, {type: "separator"}), n.push({
                label: "更多",
                enabled: !0,
                    type: "normal", label: "关于迅雷", click: () => {
                        this.menuItemClick("more_about", !0)
                    }
            }, {type: "separator"}, {
                type: "normal",
                label: "退出(&X)",
                icon: `${__rootDir}/static/icon/exit.png`,
                click: () => {
                    this.menuItemClick("quit")
                }
            });
            let i = r.remote.Menu.buildFromTemplate(n), a = r.remote.getCurrentWindow();
            w.MenuSkinNS.setStyle(i, {}), c.ContextMenuNS.popupAt(i, {window: a}, e.target)
        }

        menuItemClick(e, t) {
            if (t) {
                let t = "button=" + e;
                m.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_click", "", 0, 0, 0, 0, t)
            }
            if ("quit" === e) d.default.exitThunderX("system-menu"); else if ("newtask" === e) d.default.showNewTaskPanel("system-menu"); else if ("setting" === e) {
                let e = {tabType: s.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                m.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=menu"), this.createNewTab(e)
            } else if ("autorun" === e) this.bSelectAutoRun ? this.bSelectAutoRun = !1 : this.bSelectAutoRun = !0, u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun); else if ("unfinished" === e) d.default.importUncompleted("system-menu"); else if ("check" === e) u.ConfigNS.getValue("XLUpdate", "ShowMenuUpdateIcon", !1) && u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1), D.startManualUpdateWithUI(); else if ("personal" === e) this.showPersonalManagerPlatform(); else if ("more_about" === e) {
                let e = f.join(__rootDir, "../../Thunder.exe"), t = D.getFileVersion(e);
                h.MessageBox.custom("about", {version: t, size: "large"})
            } else if ("offline" === e) p.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "http://lixian.xunlei.com/"); else if ("privacy" === e) p.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "https://i.xunlei.com/xluser/privacy.html"); else if ("feedback" === e) {
                let e = D.getPeerID(), t = f.join(__rootDir, "../../Thunder.exe"),
                    n = "http://misc-xl9-ssl.xunlei.com/client/view/dist/1.0/feedback.html?version=" + D.getFileVersion(t) + "&pid=" + e;
                p.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
            } else "addBookmark" === e && (this.hideCollectIcon || (_.information("send handleCollent"), x.emit("handleCollent")))
        }

        bookMarkClick(e) {
            let t = `button=${e}`;
            m.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_bookmarks_click", "", 0, 0, 0, 0, t)
        }

        loadUpgradeConfig(e) {
            if (0 === e.code && e.data) if (e.data.md5 && e.data.t) {
                u.ConfigNS.getValue("XLUpdate", "UpdateMd5", "") !== e.data.md5 && 2 === parseInt(e.data.t, 10) && (u.ConfigNS.setValue("XLUpdate", "UpdateMd5", e.data.md5), u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !0), u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !0)), u.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && (this.showNewIcon = !0)
            } else u.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1); else u.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1)
        }

        checkUpgrade() {
        }

        showIndividuation() {
            return a(this, void 0, void 0, function* () {
                let e = 0, t = 0;
                try {
                    e = Number(yield I.default("IsLogined"))
                } catch (e) {
                    _.warning(e)
                }
                try {
                    t = JSON.parse(yield I.default("GetUserInfo", 2)).isVip
                } catch (e) {
                    _.warning(e)
                }
                if (this.isShowNewTag) {
                    let e = new Date;
                    u.ConfigNS.setValue("Skin", "ClickTag", e.getTime()), this.isShowNewTag = !1
                }
                m.XLStatNS.trackEvent("user_info", "personalized_center_entrance", "", 0, 0, 0, 0, `is_login=${e},is_vip=${t},source=right_corner`), I.default("ShowIndividuation")
            })
        }

        showPersonalManagerPlatform() {
            return a(this, void 0, void 0, function* () {
                let e = yield b.default(!1, !0);
                e && "" !== e && p.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "https://vip.xunlei.com/thunder-x-custom-editon/")
            })
        }

        mounted() {
            const e = r.remote.getCurrentWindow();
            e.on("maximize", () => {
                this.maximized = !0
            }), e.on("minimize", () => {
                this.maximized = !1
            }), e.on("unmaximize", () => {
                this.maximized = !1
            }), r.ipcRenderer.on(S.ThunderChannelList.channelMRMainWndMax, function () {
                C.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0)
            }), r.ipcRenderer.on(S.ThunderChannelList.channelMRMainWndMin, function () {
                C.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !1)
            }), r.ipcRenderer.on(S.ThunderChannelList.channelMRMainWndRestore, function () {
                C.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0)
            }), setTimeout(() => {
                this.checkUpgrade()
            }, 3e3), u.ConfigNS.attachListener(A.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.showNewTag()
            })
        }
    };
    i([o.Prop({})], P.prototype, "createNewTab", void 0), i([o.Prop({})], P.prototype, "currentTab", void 0), i([o.Prop({})], P.prototype, "bookMarks", void 0), i([o.Watch("maximized")], P.prototype, "onMaximizedChange", null), P = i([o.Component({components: {MessageButtonContainer: l.default}})], P), t.default = P
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(305), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(878), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            showMessageButton: e => e.Community.showMessageButton,
            unReadNums: e => e.Community.unreadNums,
            messages: e => e.Community.messages,
            chatMsgs: e => e.Community.chatMsgs,
            stars: e => e.Community.stars,
            chatUserId: e => e.Community.chatUserId,
            tabs: e => e.Tabs.tabs
        },
        mapGettersToProps: {
            currentTab: e => e.currentTab,
            unreadCount: e => e.totalUnread,
            unreadMsgsLen: e => e.UnreadMsgsLen
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            setUnreadNums: "SET_UNREAD_NUMS",
            setShowMessageButton: "SET_SHOW_MESSAGE_BUTTON",
            setUnreadMsgs: "SET_UNREAD_MESSAGES",
            setChatMsgs: "SET_CHAT_MSGS",
            setUnreadStars: "SET_UNREAD_STARS",
            selectTab: "SELECT_TAB",
            resetChatsNum: "RESET_CHATS_NUM",
            setMineId: "SET_MINE_ID"
        },
        mapDispatchToProps: {
            getUnreadNums: "getUnreadNums",
            getUnreadNoticeNum: "getUnreadNoticeNum",
            getUnreadMessages: "getUnreadMessages",
            getUnreadStars: "getUnreadStars",
            getUserSessionList: "getUserSessionList"
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(307), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(1), s = n(742), l = n(136), u = n(77), d = n(5), c = n(234), h = n(586), f = n(3), g = n(25),
        p = n(251), k = n(285), m = n(13), T = n(82), v = n(93),
        C = c.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(),
        S = r.default.getLogger("MessageButton"), y = f.remote.getGlobal("mainRendererWindow"),
        w = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification");
    C.registerNativeFunction();
    let I = class extends o.Vue {
        constructor() {
            super(...arguments), this.communityTabDistance = {
                x: 0,
                y: 0
            }, this.timer = null, this.userId = "", this.notifyDuration = 5e3, this.mesgLogoutkey = "mesgLogoutkey", this.previousLogoutTime = 0, this.settingNotifyFlag = "", this.canNotifyFlag = "1", this.communityMsgProperty = p.MsgQueueNS.MsgPriority.Community, this.communityShow = !1, this.isMsgTipsShowing = !1, this.width = 300, this.height = 107, this.chatMsgType = 100, this.otherUserId = "", this.communSection = "community", this.communityKey = "entry_page", this.communityDefaultPage = "http://misc.xl9.xunlei.com/community/dist/", this.isStartLogin = !1, this.communityUpdate = !1, this.entry = "clienttop_envelope", this.groupType = "", this.groupData = {}, this.loginTimer = null, this.communityData = {type: ""}
        }

        onshowMessageButtonChange(e) {
            e || null === this.timer ? "" !== this.userId && this.setGetMessageTimer(this.userId) : (clearInterval(this.timer), this.timer = null)
        }

        onunreadMsgsLenChange(e) {
            S.information("onunreadMsgsLenChange", e), (0 !== e || "" === this.userId || this.communityShow) && (this.communityUpdate = !0, this.isStartLogin && null === this.loginTimer ? this.loginTimer = setTimeout(() => {
                this.handleOpenTips(), this.isStartLogin = !1, clearTimeout(this.loginTimer), this.loginTimer = null
            }, 1500) : this.handleOpenTips())
        }

        onunreadCountChange(e) {
            if (S.information("onunreadCountChange"), 0 !== e) {
                let e = "type=envelope";
                m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e)
            }
        }

        get showBadge() {
            return this.unreadCount > 0
        }

        get style() {
            if (S.information(this.showMessageButton, this.communityTabDistance), this.showMessageButton) return "";
            {
                let {x: e, y: t} = this.communityTabDistance;
                return `transform: translate3d(${e}px, ${t}px, 0px); opacity: 0; pointer-events: none;`
            }
        }

        created() {
            return a(this, void 0, void 0, function* () {
                this.initUI();
                let e = yield u.default(!0);
                this.initUser(e), null === this.timer && e && this.setGetMessageTimer(e)
            })
        }

        initUI() {
            this.$root.$on("community.show", () => {
                S.information("community.show"), this.getCommunityTabDistance(), this.setShowMessageButton(!1)
            }), this.$root.$on("tab.closeTab", ({tabInfo: e}) => {
                S.information("On tab.closeTab", e), "community" === v(e, "tab", "name") && (this.setShowMessageButton(!0), this.communityShow = !1, m.XLStatNS.trackEvent("community", "comtab_close"))
            }), this.$root.$on("tab.click", e => {
                S.information("On tab.click", e), "community" === v(e, "tab", "name") && m.XLStatNS.trackEvent("community", "comtab_click")
            })
        }

        getUserAllMsg(e) {
            this.getUnreadNums(e), this.getUnreadNoticeNum(e), this.getUnreadStars(e)
        }

        initUser(e) {
            "" !== e && void 0 !== e && (this.userId = e, this.getUserAllMsg(e))
        }

        clickHandler() {
            return a(this, void 0, void 0, function* () {
                let e = "is_red=no";
                this.showBadge && (e = "is_red=yes"), m.XLStatNS.trackEvent("clienttop", "clienttop_envelope_click", "", 0, 0, 0, 0, e);
                let t = "";
                if (("group" === v(this.communityData, "type") || (t = yield u.default(!1, !0, "msgcenter")) !== v(this.communityData, "extra", "userId")) && (this.userId = t, t || "group" === v(this.communityData, "type"))) {
                    let e = {
                        tabType: l.TabType.Chromium,
                        tabParam: {
                            title: "社区",
                            url: T.default.getConfigInfo(this.communSection, this.communityKey) || this.communityDefaultPage,
                            name: "community",
                            index: 1,
                            showUrl: !1
                        }
                    };
                    this.createNewTab(e), this.$nextTick(() => {
                        S.information("NotifyUnreadNum emit community show"), this.$root.$emit("community.show")
                    })
                }
            })
        }

        getCommunityTabDistance() {
            let e = this.$el.getBoundingClientRect(),
                t = document.querySelectorAll(".td-browser-tab__item")[1].getBoundingClientRect();
            S.information(e, t), this.communityTabDistance = {
                x: t.left + .5 * t.width - e.left - .5 * e.width,
                y: t.top + .5 * t.height - e.top - .5 * e.height
            }
        }

        setGetMessageTimer(e) {
            let t = T.default.getConfigInfo(this.communSection, "loop_duration") || 300;
            this.timer = setInterval(() => {
                this.getUserAllMsg(e)
            }, 1e3 * t)
        }

        getOpenCommunityType() {
            return "" !== v(this.communityData, "type") ? v(this.communityData, "type") : this.unReadNums.notice > 0 ? "notice" : this.unReadNums.comment > 0 ? "comment" : this.unReadNums.star > 0 ? "praise" : ""
        }

        openMessageTab() {
            if (this.communityShow = !0, this.communityData.type = this.getOpenCommunityType(), "" !== v(this.communityData, "extra", "userId") && this.unreadCount > 0) {
                let e = "type=comtab";
                m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e)
            }
            this.setUnreadMsgs([]), this.setUnreadStars([]), this.resetChatsNum();
            let e = this.getTabIndexByTitleAndName({name: "community", title: "社区"});
            void 0 !== v(this.communityData, "entry") && "" !== v(this.communityData, "entry") || (this.communityData.entry = "clienttop_envelope"), w.clearQueuesByName("community"), C.sendOpenCommunityEvent(Object.assign({}, this.communityData), v(this.tabs, e, "tab")), this.communityData = {type: ""}
        }

        setItemNotify(e, t) {
            let n = 0;
            for (let t = 0; t < e.length; t++) void 0 !== e[t] && e[t].createTime > n && (n = e[t].createTime);
            n > 0 && window.localStorage.setItem(`${t}${this.userId}`, `${n}`)
        }

        mainWindowVisiable() {
            return y.isVisible()
        }

        showMainWindow() {
            const e = y.isMinimized(), t = y.isVisible();
            !e && (e || t) && t || (y.restore(), y.show())
        }

        getUnnotifyMsgs(e, t) {
            let n = Number(window.localStorage.getItem(`${t}${this.userId}`)) || 0;
            return e.filter(e => e.createTime > n && e.createTime > this.previousLogoutTime)
        }

        setConfNotifyFlag() {
            this.settingNotifyFlag = g.ConfigNS.getValue("UserCommunitySet", `radio_id_${this.userId}`, "1")
        }

        getTabIndexByTitleAndName(e) {
            let t = -1;
            if (void 0 === this.tabs) return t;
            for (let n = 0; n < this.tabs.length; n++) if (this.tabs[n].title === e.title && this.tabs[n].tab.name === e.name) {
                t = n;
                break
            }
            return t
        }

        openCommunityTab() {
            this.showMainWindow();
            let e = this.getTabIndexByTitleAndName({name: "community", title: "社区"});
            -1 === e ? this.clickHandler() : (this.selectTab(e), "" !== this.communityData.type && this.openMessageTab())
        }

        handleOpenTips() {
            let e = this.getUnnotifyMsgs(this.stars, "community-stars"),
                t = this.getUnnotifyMsgs(this.messages, "community-messages"),
                n = this.getUnnotifyMsgs(this.chatMsgs, "community-chatMsgs");
            if (S.information("消息数列表", [...t, ...n]), S.information("点赞列表", e), S.information("上次社区通知客户端消息时间", this.previousLogoutTime), this.setItemNotify(e, "community-stars"), this.setItemNotify(t, "community-messages"), this.setItemNotify(n, "community-chatMsgs"), this.settingNotifyFlag !== this.canNotifyFlag || this.communityShow) return;
            [...e, ...t, ...n].length > 0 && w.enQueue({
                callback: () => {
                    h.Notification.notify({
                        type: "CommunityTips",
                        duration: this.notifyDuration,
                        data: {communityMsgs: [...e, ...t, ...n], msgType: [...t, ...n].length > 0 ? 0 : 1},
                        width: this.width,
                        height: this.height
                    })
                }, name: "community", priority: this.communityMsgProperty
            });
            let i = !h.Notification.getCurrentWindow();
            if (i && !this.isMsgTipsShowing) {
                S.information("deQueue", i), w.deQueue();
                let e = "type=xltips";
                m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e), this.isMsgTipsShowing = !0, setTimeout(() => {
                    this.isMsgTipsShowing = !1
                }, this.notifyDuration)
            }
        }

        mounted() {
            C.on("NotifyUnreadNum", e => {
                if (S.information("NotifyUnreadNum NotifyUnreadNum", e), this.setUnreadNums({
                    star: e.detail.star,
                    comment: e.detail.comment,
                    notice: e.detail.notice,
                    chat: e.detail.chat
                }), e.detail.star + e.detail.comment + e.detail.notice + e.detail.chat > 0) {
                    let e = "type=comtab";
                    m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e);
                    let t = (new Date).getTime() + "";
                    window.localStorage.setItem(`${this.mesgLogoutkey}${this.userId}`, t.substring(0, t.length - 3))
                }
            }), C.on("openComunityGroup", e => {
                this.communityData = e, this.openCommunityTab()
            }), f.remote.ipcMain.on("openSettingTab", e => {
                this.showMainWindow();
                let t = this.getTabIndexByTitleAndName({name: "conf-setting", title: "设置中心"});
                if (-1 === t) {
                    let e = {tabType: l.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                    this.createNewTab(e), this.$nextTick(() => {
                        C.emit("selectMsgNotice")
                    })
                } else this.selectTab(t)
            }), C.on("community.pageReady", () => {
                this.communityShow || (S.information("sendOpenCommunityEvent community.pageReady"), this.openMessageTab())
            }), d.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.setMineId(0), w.clearQueuesByName("community"), this.userId = "", null !== this.timer && (clearInterval(this.timer), this.timer = null), this.setUnreadNums({
                    star: 0,
                    comment: 0,
                    notice: 0,
                    chat: 0
                }), this.setUnreadMsgs([]), this.setUnreadStars([]), this.resetChatsNum()
            }), d.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.previousLogoutTime = Number(window.localStorage.getItem(`${this.mesgLogoutkey}${e}`)) || 0, this.isStartLogin = !0, this.setMineId(Number(e) || 0), null === this.timer && void 0 !== e && this.showMessageButton && (this.initUser(e), this.setGetMessageTimer(e), this.setConfNotifyFlag()), setTimeout(() => {
                    this.getUserSessionList(e), this.getUnreadMessages(e)
                }, 1e3)
            }), d.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, n, i) => {
                "radio_id_" === t && (this.settingNotifyFlag = i)
            }), y.on("hide", e => {
                void 0 !== this.userId && this.communityShow && null === this.timer && this.setGetMessageTimer(this.userId)
            }), y.on("show", e => {
                void 0 !== this.userId && this.communityShow && null !== this.timer && (clearInterval(this.timer), this.timer = null)
            })
        }
    };
    i([o.Prop({})], I.prototype, "showMessageButton", void 0), i([o.Prop({})], I.prototype, "unreadCount", void 0), i([o.Prop({})], I.prototype, "unReadNums", void 0), i([o.Prop({})], I.prototype, "currentTab", void 0), i([o.Prop({})], I.prototype, "messages", void 0), i([o.Prop({})], I.prototype, "chatMsgs", void 0), i([o.Prop({})], I.prototype, "stars", void 0), i([o.Prop({})], I.prototype, "unreadMsgsLen", void 0), i([o.Prop({})], I.prototype, "tabs", void 0), i([o.Prop({})], I.prototype, "chatUserId", void 0), i([o.Prop({})], I.prototype, "getUnreadNums", void 0), i([o.Prop({})], I.prototype, "getUnreadNoticeNum", void 0), i([o.Prop({})], I.prototype, "getUnreadMessages", void 0), i([o.Prop({})], I.prototype, "getUnreadStars", void 0), i([o.Prop({})], I.prototype, "getUserSessionList", void 0), i([o.Prop({})], I.prototype, "createNewTab", void 0), i([o.Prop({})], I.prototype, "selectTab", void 0), i([o.Prop({})], I.prototype, "setUnreadNums", void 0), i([o.Prop({})], I.prototype, "setShowMessageButton", void 0), i([o.Prop({})], I.prototype, "setUnreadMsgs", void 0), i([o.Prop({})], I.prototype, "setChatMsgs", void 0), i([o.Prop({})], I.prototype, "setMineId", void 0), i([o.Prop({})], I.prototype, "resetChatsNum", void 0), i([o.Prop({})], I.prototype, "setUnreadStars", void 0), i([o.Watch("showMessageButton")], I.prototype, "onshowMessageButtonChange", null), i([o.Watch("unreadMsgsLen")], I.prototype, "onunreadMsgsLenChange", null), i([o.Watch("unreadCount")], I.prototype, "onunreadCountChange", null), I = i([o.Component({filters: {unread: s.unread}})], I), t.default = I
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(309), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(881), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            tabs: e => e.Tabs.tabs,
            current: e => e.Tabs.current
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            onBrowserBindWindowHandle: "ON_BIND_WND_HANDLE",
            onBrowserTitleChange: "ON_TITLE_CHANGE",
            onBrowserLoadStatusChange: "ON_LOAD_STATUS_CHANGE",
            onBrowserAddressChange: "ON_ADDRESS_CHANGE",
            onBrowserNewBrowserPopupCompleted: "ON_NEW_BROWSER_POPUP_COMPLETED",
            onBrowserLoadStart: "ON_LOAD_START",
            onBrowserLoadError: "ON_LOAD_ERROR",
            onBrowserFavIconChange: "ON_FAV_ICON_GET",
            onAppQuit: "ON_APP_QUIT",
            updateTabs: "UPDATE_TABS",
            updateCurrent: "UPDATE_CURRENT",
            updateBookMarksIconUrl: "UPDATE_BOOK_MARKS_ICONURL"
        },
        mapDispatchToProps: {
            closeTab: "closeTab",
            selectTab: "selectTab",
            onJsCallNativeFunction: "onChromiumCallNativeFunction",
            onJsCheckNativeFunction: "onChromiumCheckNativeFunction",
            onBrowserNewBrowserPopup: "onNewBrowserPopup",
            removeTabCtrl: "removeTabCtrl"
        },
        mapGettersToProps: {unread: e => e.totalUnread}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(311), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(21), s = n(76), l = n(136), u = n(231), d = n(3), c = n(5), h = n(197), f = n(742), g = n(6),
        p = n(2), k = n(1), m = n(7), T = n(105), v = n(882), C = n(13), S = n(253), y = n(15), w = n(78), I = n(33),
        b = n(53), A = n(883), N = n(38), D = n(24), _ = n(10), x = n(740), E = n(12), P = n(14),
        M = k.default.getLogger("Thunder.Main.Renderer.view.tabs"),
        F = m.default(p.join(__rootDir, "../bin/ThunderHelper.node")), O = s.TabEventManagerNS.getEventEmitter(),
        U = n(93), {isDef: L} = E.ThunderUtil;
    let B = class extends o.Vue {
        constructor() {
            super(...arguments), this.finished = !1, this.finishCount = 0, this.fail = !1, this.percent = 0, this.speed = "", this.titleCue = "下载", this.isLoading = !1, this.hasDownloading = !1, this.hasNewTask = !1, this.newCount = 0, this.totalTabsOpened = !1, this.totalTabsCreated = !1, this.appendChild = null, this.tabsCount = 1, this.isSpringFestivalSkin = !1
        }

        onTabsUpdated(e) {
            this.tabsCount = e.length, d.ipcRenderer.send("total-tabs-update", {tabs: e, current: this.current})
        }

        onCurrentUpdated(e) {
            d.ipcRenderer.send("total-tabs-update", {
                tabs: this.tabs,
                current: e
            }), L(x.default.currentGuideOptions) && "downloadTab" === x.default.currentGuideOptions.name && (0 === e ? (x.default.currentElement.style.display = "block", this.$nextTick(() => {
                x.default.position()
            })) : x.default.currentElement.style.display = "none")
        }

        onDownloadingTabSelect(e) {
            v.DownloadingTabCueNS.enableTrack(!e), e ? (this.fail = !1, this.hasNewTask = !1, this.finished = !1, this.finishCount = 0, this.titleCue = "下载") : this.$nextTick(() => {
                v.DownloadingTabCueNS.getCurTasksStatus(this.onDownloadingCue);
                let e = document.querySelector(".xlx-browser-tab__progress-inner");
                M.information("get element", null !== e), e && (e.addEventListener("animationend", e => {
                    M.information("animationend", e), this.hasNewTask && (this.hasNewTask = !1), this.finished && (this.finished = !1, this.finishCount = 0, this.titleCue = "下载")
                }), e.addEventListener("webkitAnimationEnd", e => {
                    M.information("webkitAnimationEnd", e)
                }))
            })
        }

        get isDownloadingTab() {
            return 0 === this.current
        }

        get progressStyle() {
            let e = "";
            do {
                if (this.hasNewTask) break;
                if (this.finished) break;
                if (this.fail) break;
                this.hasDownloading && (e = `clip-path: polygon(0px 0px, ${this.percent}% 0px, ${this.percent}% 100%, 0% 100%)`)
            } while (0);
            return e
        }

        handleAdd() {
            C.XLStatNS.trackEvent("clienttop", "clienttop_newtab_add");
            let e = {tabType: l.TabType.Chromium, tabParam: {showUrl: !1}};
            this.createNewTab(e), this.$root.$emit("tab.createTab", e)
        }

        handleRemove({tab: e, index: t}) {
            C.XLStatNS.trackEvent("clienttop", "clienttop_newtab_close");
            let n = {tabInfo: e, index: t};
            this.closeTab(n), this.$root.$emit("tab.closeTab", n)
        }

        handleChange({tab: e, index: t}) {
            M.verbose(e), this.selectTab(t)
        }

        handleClick() {
            M.information("tab.click", U(this.tabs, `${this.current}`)), this.$root.$emit("tab.click", U(this.tabs, `${this.current}`))
        }

        tabListeners(e, t) {
            return {
                contextmenu: () => {
                    this.handlePopInputMenu(e, t)
                }
            }
        }

        handlePopInputMenu(e, t) {
            let n = e.getTitle();
            0 !== t && "设置中心" !== n && this.popEditableDefaultContextMenu(t)
        }

        handleOpenCopyTab(e) {
            let t = {tabType: l.TabType.Chromium, tabParam: {url: e}};
            this.createNewTab(t)
        }

        handleCloseTab(e) {
            if (e > 0) {
                let t = {tabInfo: this.tabs[e], index: e};
                this.closeTab(t), this.$root.$emit("tab.closeTab", t)
            }
        }

        handleMiddleDown(e) {
            e.index > 0 && this.handleCloseTab(e.index)
        }

        popEditableDefaultContextMenu(e) {
            d.remote.getCurrentWebContents().once("context-menu", (t, n) => {
                let i = this.tabs.length > 2, a = e !== this.tabs.length - 1, o = [{
                    label: "打开新的标签页", accelerator: "CmdOrCtrl+T", click: () => {
                        this.menuItemClick("add")
                    }
                }, {type: "separator"}, {
                    label: "重新加载", accelerator: "CmdOrCtrl+R", click: () => {
                        this.menuItemClick("reload", e)
                    }
                }, {
                    label: "复制", enabled: "社区" !== this.tabs[e].tab.getTitle(), click: () => {
                        this.menuItemClick("copy", e)
                    }
                }, {
                    label: "关闭标签页", accelerator: "CmdOrCtrl+W", click: () => {
                        this.menuItemClick("close", e)
                    }
                }, {
                    label: "关闭其他标签页", enabled: i, click: () => {
                        this.menuItemClick("close-other-tabs", e)
                    }
                }, {
                    label: "关闭右侧标签页", enabled: a, click: () => {
                        this.menuItemClick("close-tabs-to-the-right", e)
                    }
                }], r = d.remote.Menu.buildFromTemplate(o), s = d.remote.getCurrentWindow();
                b.MenuSkinNS.setStyle(r, {}), r.popup({window: s})
            })
        }

        menuItemClick(e, t, n) {
            if ("add" === e) this.handleAdd(); else if ("close" === e) this.handleCloseTab(t); else if ("reload" === e) this.tabs[t].tab.refresh(!1); else if ("copy" === e) this.handleOpenCopyTab(this.tabs[t].tab.url); else if ("close-other-tabs" === e) {
                let e = t;
                for (let t = this.tabs.length - 1; t > 0; t--) t !== e && this.handleCloseTab(t)
            } else if ("close-tabs-to-the-right" === e) {
                let e = t;
                for (let t = this.tabs.length - 1; t > 0; t--) t > e && this.handleCloseTab(t)
            }
        }

        showChangeCategoryMenu() {
            0 === this.current && (C.XLStatNS.trackEvent("download_leftpanel", "top_dropdown_click"), S.downloadContextMenu.setContextInfo(this.currentCategoryId, this.currentCategoryId), S.downloadContextMenu.popMenu(S.DownloadMenuType.ChangeCategory).catch())
        }

        getTabIndexByTitleAndName(e, t, n, i) {
            do {
                if (M.information(e), g.isNullOrUndefined(e)) {
                    M.error(e);
                    break
                }
                if (g.isNullOrUndefined(t) || g.isNullOrUndefined(n)) {
                    M.error(t, n);
                    break
                }
                if (g.isNullOrUndefined(i) || g.isNullOrUndefined(i[0])) {
                    let i = e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    !0 !== i && M.error(i);
                    break
                }
                let a = null;
                try {
                    a = JSON.parse(i[0])
                } catch (e) {
                    M.warning(e)
                }
                let o = -1;
                if (!a) break;
                if (void 0 !== this.tabs) for (let e = 0; e < this.tabs.length; e++) if (this.tabs[e].title === a.title && this.tabs[e].tab.name === a.name) {
                    o = e;
                    break
                }
                e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, o)
            } while (0)
        }

        onDownloadingCue(e, t, n) {
            do {
                if (this.isDownloadingTab) break;
                if (t < 0) {
                    this.hasDownloading = !1;
                    break
                }
                if (this.hasDownloading = !0, e) {
                    this.isLoading = !0;
                    break
                }
                this.isLoading = !1, this.percent = 100 * t, this.speed = n
            } while (0)
        }

        onNewTaskCue(e) {
            do {
                if (this.isDownloadingTab) break;
                e > 0 && (this.fail ? (this.$refs.progress.classList.remove("is-fail"), setTimeout(() => {
                    this.hasNewTask = !0, this.newCount = e
                }, 0)) : (this.hasNewTask = !0, this.newCount = e))
            } while (0)
        }

        onFinishCue() {
            do {
                if (this.isDownloadingTab) break;
                this.finished ? this.finishCount = this.finishCount + 1 : this.fail ? (this.$refs.progress.classList.remove("is-fail"), setTimeout(() => {
                    this.finished = !0
                }, 0), this.finishCount = 1) : (this.finished = !0, this.finishCount = 1), this.titleCue = `${this.finishCount}个下载任务已完成`
            } while (0);
            v.DownloadingTabCueNS.getCurTasksStatus(this.onDownloadingCue)
        }

        onFailCue() {
            do {
                if (this.isDownloadingTab) break;
                this.finished || this.hasNewTask || this.fail ? (this.$refs.progress.classList.remove("is-finished"), this.$refs.progress.classList.remove("is-fail"), this.finished = !1, this.hasNewTask = !1, this.fail = !1, this.finishCount = 0, this.titleCue = "下载", setTimeout(() => {
                    this.fail = !0
                }, 0)) : this.fail = !0
            } while (0);
            v.DownloadingTabCueNS.getCurTasksStatus(this.onDownloadingCue)
        }

        handleKeydownHotkey(e) {
            do {
                if (!e.ctrlKey) break;
                if ("t" === e.key || "T" === e.key) {
                    this.handleAdd();
                    break
                }
                if ("r" !== e.key && "R" !== e.key || this.tabs[this.current].tab.refresh(!1), "w" === e.key || "W" === e.key) {
                    this.handleCloseTab(this.current);
                    break
                }
            } while (0)
        }

        mounted() {
            d.remote.globalShortcut.register("ctrl+shift+f12", () => {
                this.tabs[this.current].tab.showDevTool(!0)
            }), window.addEventListener("keydown", this.handleKeydownHotkey, !0), v.DownloadingTabCueNS.track(this.onNewTaskCue, this.onDownloadingCue, this.onFinishCue, this.onFailCue), window.addEventListener("keyup", e => {
                "F5" === e.key && this.tabs[this.current].tab.refresh(!1)
            }, !0);
            let e = [{
                eventName: "OnBindWindowHandle",
                listener: this.onBindWindowHandle
            }, {eventName: "OnBeforeNavigate", listener: this.onBeforeNavigate}, {
                eventName: "OnTitleChange",
                listener: this.onTitleChange
            }, {eventName: "OnFaviconURLChange", listener: this.onFaviconURLChange}, {
                eventName: "OnAddressChange",
                listener: this.onAddressChange
            }, {
                eventName: "OnNewBrowserPopup",
                listener: this.onNewBrowserPopup
            }, {
                eventName: "OnNewBrowserPopupCompleted",
                listener: this.onNewBrowserPopupCompleted
            }, {eventName: "OnOpenURLFromTab", listener: this.onOpenURLFromTab}, {
                eventName: "OnBrowserDestroy",
                listener: this.onBrowserDestroy
            }, {eventName: "OnAfterBrowserDestroy", listener: this.onAfterBrowserDestroy}, {
                eventName: "OnLoadStart",
                listener: this.onLoadStart
            }, {eventName: "OnLoadEnd", listener: this.onLoadEnd}, {
                eventName: "OnLoadingStateChange",
                listener: this.onLoadingStateChange
            }, {eventName: "OnLoadError", listener: this.onLoadError}, {
                eventName: "OnGotFocus",
                listener: this.onGotFocus
            }, {
                eventName: "OnBeforeDownload",
                listener: this.onBeforeDownload
            }, {
                eventName: "OnCustomProtocalExecution",
                listener: this.onCustomProtocalExecution
            }, {
                eventName: "OnJsCallNativeFunction",
                listener: this.onChromiumJsCallNativeFunction
            }, {
                eventName: "OnJsCheckNativeFunction",
                listener: this.onChromiumCheckNativeFunction
            }, {eventName: "OnCloseBrowser", listener: this.onClose}, {eventName: "OnHotKey", listener: this.onHotKey}];
            s.setDefaultListeners(e);
            let t, n = [{functionName: "openNewTab", nativeFunc: this.openNewTab.bind(this)}, {
                functionName: "OpenNewTab",
                nativeFunc: this.openNewTab.bind(this)
            }, {
                functionName: "GetTabIndexByTitleAndName",
                nativeFunc: this.getTabIndexByTitleAndName.bind(this)
            }, {
                functionName: "SelectTab",
                nativeFunc: this.selectTabByIndex.bind(this)
            }, {
                functionName: "IsTabSelected",
                nativeFunc: this.isTabSelected.bind(this)
            }, {
                functionName: "CloseCurrentTab",
                nativeFunc: this.closeCurrentTab.bind(this)
            }, {functionName: "CloseTabByIndex", nativeFunc: this.closeTabByIndex.bind(this)}];
            s.setDefaultNativeFunctionMap(n), (t = g.isNullOrUndefined(u.browserSupport.browserParentWnd) ? d.remote.getCurrentWindow() : u.browserSupport.browserParentWnd).on("resize", () => {
                this.resizeCurrentBrowserWindow()
            }), t.on("move", () => {
                this.resizeCurrentBrowserWindow()
            }), t.on("show", () => {
                this.resizeCurrentBrowserWindow()
            }), h.quitPromises.add(this.quitBrowser), c.NativeCallModule.nativeCall.AttachNativeEvent("onWebEvent", (...e) => {
                if (0 === this.tabs.length) return;
                if (g.isNullOrUndefined(e) || g.isNullOrUndefined(e[0])) return;
                let t = e[0];
                e.splice(0, 1);
                for (let n = 0; n < this.tabs.length; n++) this.tabs[n].tab.fireEvent(t, ...e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                if (0 !== this.tabs.length) for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogin", e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                if (0 !== this.tabs.length) {
                    M.information("监听到了退出事件！onLogout");
                    for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogout", e)
                }
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginWndClose", e => {
                if (0 !== this.tabs.length) {
                    M.information("监听到了关闭事件：onLoginWndClose：", e);
                    for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnLoginWndClose", e)
                }
            }), t.on("hide", this.fireTabVisibleChangeEvent), t.on("minimize", this.fireTabVisibleChangeEvent), t.on("show", this.fireTabVisibleChangeEvent), t.on("restore", this.fireTabVisibleChangeEvent), t.on("maximize", this.fireTabVisibleChangeEvent), t.on("unmaximize", this.fireTabVisibleChangeEvent), O.on(s.TabEventManagerNS.EventType.RemoveTab, this.onTabEvent), O.on(s.TabEventManagerNS.EventType.AddTab, this.onTabEvent), O.on(s.TabEventManagerNS.EventType.ChangeTab, this.onTabEvent), O.on(s.TabEventManagerNS.EventType.VisibleChange, this.onTabVisibleChange), P.default("GetSkinInfo").then(e => {
                this.isSpringFestivalSkin = e.is_spring_festival
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", e => {
                this.isSpringFestivalSkin = e.is_spring_festival
            })
        }

        fireTabVisibleChangeEvent() {
            let e,
                t = (e = g.isNullOrUndefined(u.browserSupport.browserParentWnd) ? d.remote.getCurrentWindow() : u.browserSupport.browserParentWnd).isVisible(),
                n = e.isMinimized();
            M.information("发送tab状态和主窗口状态改变事件 visible:", t, ", minimized:", n, ", current:", this.current);
            for (let e = 0; e < this.tabs.length; e++) this.tabs[e].tab.fireEvent("OnTabVisibleChange", t && !n, this.current === e), O.emit(s.TabEventManagerNS.EventType.VisibleChange, this.tabs[e].tab, t && !n, this.current === e)
        }

        onTabEvent() {
            this.$nextTick(() => {
                this.fireTabVisibleChangeEvent()
            })
        }

        onTabVisibleChange(e, t, n) {
            if (M.information("onTabVisibleChange", e, t, n), t && n && e.getTabType() === l.TabType.Chromium) do {
                let t = e.getBrowser();
                if (g.isNullOrUndefined(t)) {
                    M.error(t);
                    break
                }
                let n = t.getWindowHandle();
                if (!1 === F.isWindowHandle(n)) break;
                F.setWindowFocus(n, !0)
            } while (0)
        }

        quitBrowser() {
            return d.remote.globalShortcut.unregister("ctrl+shift+f12"), new Promise(e => {
                this.onAppQuit(), e(!0)
            })
        }

        onBindWindowHandle(e, t) {
            let n = {hwnd: e, browser: t};
            this.onBrowserBindWindowHandle(n)
        }

        onTitleChange(e, t) {
            let n = {title: e, browser: t};
            this.onBrowserTitleChange(n)
        }

        onBeforeNavigate(e, t, n) {
            M.information("beforenavigate"), M.information(e), M.information(t), M.information(n)
        }

        onFaviconURLChange(e, t) {
            M.information("icon"), M.information(e);
            let n = "";
            for (let e = 0; e < this.tabs.length; e++) this.tabs[e].tab.getBrowser() === t && (n = this.tabs[e].tab.url);
            let i = {iconUrl: e, browser: t};
            do {
                if (!n) break;
                if ("" === n) break;
                this.getIcon(n, e).catch(), this.onBrowserFavIconChange(i)
            } while (0)
        }

        onAddressChange(e, t, n) {
            M.information(e), M.information(t);
            let i = {isMainFrame: e, url: t, browser: n};
            this.onBrowserAddressChange(i)
        }

        onNewBrowserPopup(e, t, n) {
            let i = {url: e, refUrl: t, browser: n};
            this.onBrowserNewBrowserPopup(i)
        }

        onNewBrowserPopupCompleted(e, t) {
            M.information(e);
            let n = {url: e, browser: t};
            this.onBrowserNewBrowserPopupCompleted(n)
        }

        onOpenURLFromTab(e, t) {
            M.information(e), M.information(t)
        }

        onBrowserDestroy(e) {
            if (M.information("onBrowserDestroy"), !g.isNullOrUndefined(u.browserSupport.browserManager)) {
                let t = void 0;
                for (let n = 0; n < this.tabs.length; n++) if (!g.isNullOrUndefined(this.tabs[n]) && !g.isNullOrUndefined(this.tabs[n].tab) && (t = this.tabs[n].tab.getBrowser(), !g.isNullOrUndefined(t) && e === t)) {
                    let e = {tabInfo: this.tabs[n], index: n};
                    this.removeTabCtrl(e);
                    break
                }
                u.browserSupport.browserManager.deleteBrowser(e)
            }
            d.ipcRenderer.send(y.ThunderChannelList.channelRMSetFoucs)
        }

        onAfterBrowserDestroy(e) {
            M.information(e)
        }

        onLoadStart(e, t, n, i) {
            M.information("OnLoadStart"), M.information(e), M.information(t), M.information(n);
            let a = {isMainFrame: e, url: t, transitionType: n, browser: i};
            this.onBrowserLoadStart(a)
        }

        onLoadEnd(e, t, n) {
            M.information("onLoadEnd"), M.information(e), M.information(t), M.information(n)
        }

        onLoadingStateChange(e, t, n, i) {
            M.information("onLoadingStateChange"), M.information(e), M.information(t), M.information(n);
            let a = {isLoading: e, canGoBack: t, canGoForward: n, browser: i};
            this.onBrowserLoadStatusChange(a)
        }

        onLoadError(e, t, n, i, a, o) {
            M.information("OnLoadError"), M.information(e), M.information(n), M.information(i), M.information(a), M.information(t);
            let r = {isMainFrame: e, url: t, errorCode: n, errorText: i, failedUrl: a, browser: o};
            this.onBrowserLoadError(r)
        }

        onGotFocus(e) {
            let t = void 0;
            for (let n = 0; n < this.tabs.length; n++) g.isNullOrUndefined(this.tabs[n]) || g.isNullOrUndefined(this.tabs[n].tab) || (t = this.tabs[n].tab.getBrowser(), g.isNullOrUndefined(t) || e === t && O.emit(s.TabEventManagerNS.EventType.GotFocus, this.tabs[n].tab));
            w.ThunderWindowNS.bringWindowToTop(u.browserSupport.browserParentWndHandle)
        }

        onBeforeDownload(e, t, n, i) {
            M.information("onBeforeDownload", e, t, "suggestName:", n, "mimeType", i), T.ThunderNewTask.createTaskByUrl(e, n)
        }

        onCustomProtocalExecution(e, t) {
            T.ThunderNewTask.createTaskByUrl(e)
        }

        onChromiumJsCallNativeFunction(e, t, n, i) {
            let a = {nativeCallId: 0, functionName: e, callBackId: t, browser: n, args: i};
            this.onJsCallNativeFunction(a)
        }

        onChromiumCheckNativeFunction(e, t, n) {
            let i = {nativeCallId: 0, functionName: e, callBackId: t, browser: n};
            this.onJsCheckNativeFunction(i)
        }

        onClose(e) {
            let t = void 0;
            for (let n = 0; n < this.tabs.length; n++) if (!g.isNullOrUndefined(this.tabs[n]) && !g.isNullOrUndefined(this.tabs[n].tab) && (t = this.tabs[n].tab.getBrowser(), !g.isNullOrUndefined(t) && e === t)) {
                let e = {tabInfo: this.tabs[n], index: n};
                this.closeTab(e);
                break
            }
        }

        onHotKey(e, t, n) {
            M.information("onHotKey", t, e);
            let i = void 0;
            for (let a = 0; a < this.tabs.length; a++) if (!g.isNullOrUndefined(this.tabs[a]) && !g.isNullOrUndefined(this.tabs[a].tab) && (i = this.tabs[a].tab.getBrowser(), !g.isNullOrUndefined(i) && n === i)) {
                if (116 === e) {
                    let e = 4 === t;
                    n.refresh(e)
                }
                do {
                    if (4 !== t) break;
                    84 === e && this.handleAdd(), 82 === e && this.tabs[this.current].tab.refresh(!1), 87 === e && this.handleCloseTab(this.current)
                } while (0);
                break
            }
        }

        getIcon(e, t) {
            return a(this, void 0, void 0, function* () {
                let n = new URL(e).host, i = N.ToolsUtilitiesAWNS.genarateMd5(n),
                    a = __profilesDir + "/BookMarksIcon/" + i + ".png";
                return yield this.downloadIcon(e, t, a)
            })
        }

        downloadIcon(e, t, n) {
            return a(this, void 0, void 0, function* () {
                let i = null, a = !1;
                try {
                    i = yield D.default.get(t, {responseType: "arraybuffer"})
                } catch (e) {
                    M.error("error " + e)
                }
                if (null !== i && void 0 !== i.status && 200 === i.status && null !== i.data && (a = yield _.FileSystemAWNS.writeFileAW(n, i.data))) {
                    let t = {url: e, iconUrl: n};
                    this.updateBookMarksIconUrl(t)
                }
                return a
            })
        }

        openNewTab(e, t, n, i) {
            do {
                if (M.information(e), g.isNullOrUndefined(e)) {
                    M.error(e);
                    break
                }
                if (g.isNullOrUndefined(t) || g.isNullOrUndefined(n)) {
                    M.error(t, n);
                    break
                }
                if (g.isNullOrUndefined(i) || g.isNullOrUndefined(i[0])) {
                    let i = e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    !0 !== i && M.error(i);
                    break
                }
                let a = i[0], o = i[1], s = {url: a};
                if (o) try {
                    s = Object.assign(s, JSON.parse(o))
                } catch (e) {
                    M.warning(e)
                }
                let u = {tabType: l.TabType.Chromium, tabParam: s};
                M.information("tabParam:", s), this.createNewTab(u), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        closeCurrentTab(e, t, n, i) {
            do {
                if (M.information("closeCurrentTab", e), g.isNullOrUndefined(e)) {
                    M.error(e);
                    break
                }
                if (g.isNullOrUndefined(t) || g.isNullOrUndefined(n)) {
                    M.error(t, n);
                    break
                }
                if (e === this.tabs[this.current].tab) {
                    let e = {tabInfo: this.tabs[this.current], index: this.current};
                    this.closeTab(e)
                }
            } while (0)
        }

        closeTabByIndex(e, t, n, i) {
            if (g.isNullOrUndefined(e)) return void M.error(e);
            if (g.isNullOrUndefined(t) || g.isNullOrUndefined(n)) return void M.error(t, n);
            const a = i[0];
            if (g.isNullOrUndefined(a)) return;
            let o = {tabInfo: this.tabs[a], index: a};
            this.closeTab(o), this.$root.$emit("tab.closeTab", o), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, {
                tabs: this.tabs,
                current: this.current
            })
        }

        isTabSelected(e, t, n, i) {
            let a = !1;
            do {
                if (M.information("isTabSelected tab:", e), g.isNullOrUndefined(e)) {
                    M.error(e);
                    break
                }
                if (g.isNullOrUndefined(t) || g.isNullOrUndefined(n)) {
                    M.error(t, n);
                    break
                }
                e === this.tabs[this.current].tab && (a = !0)
            } while (0);
            return a
        }

        selectTabByIndex(e, t, n, i) {
            do {
                if (M.information("selectTabByIndex", e), g.isNullOrUndefined(e)) {
                    M.error(e);
                    break
                }
                if (g.isNullOrUndefined(t) || g.isNullOrUndefined(n)) {
                    M.error(t, n);
                    break
                }
                let a = i[0];
                this.selectTab(a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        resizeCurrentBrowserWindow() {
            do {
                if (0 === this.tabs.length) break;
                let e = this.tabs[this.current].tab;
                if (g.isNullOrUndefined(e)) break;
                if (e.getTabType() === l.TabType.Chromium) {
                    let t = e.getBrowser();
                    if (g.isNullOrUndefined(t)) break;
                    if (!0 === e.isErrorPage) break;
                    let n = t.getWindowHandle();
                    if (!1 === F.isWindowHandle(n)) {
                        M.error(n);
                        break
                    }
                    u.resizeBrowserWindow(n)
                }
            } while (0)
        }

        handleTotalClick(e) {
            if (this.totalTabsOpened) return;
            const t = e.currentTarget.getBoundingClientRect(), n = e.currentTarget.cloneNode();
            n.style.position = "fixed", n.style.zIndex = "100", n.style.opacity = "0", n.style.top = t.top + "px", n.style.left = t.left + "px", n.style.marginTop = "0", this.totalTabsCreated ? (document.body.appendChild(n), this.appendChild = n, d.ipcRenderer.send("message-box-open", {
                name: "TotalTabs",
                position: {
                    x: Math.floor(window.screenX + t.left - 147 + 28),
                    y: Math.floor(window.screenY + t.top + 28)
                }
            })) : (this.totalTabsOpened = this.totalTabsCreated = !0, document.body.appendChild(n), this.appendChild = n, I.MessageBox.custom("TotalTabs", {
                tabs: this.tabs,
                current: this.current
            }, {
                width: 147,
                height: 395,
                x: Math.floor(window.screenX + t.left - 147 + 28),
                y: Math.floor(window.screenY + t.top + 28),
                modal: !1,
                transparent: !1
            }), d.remote.ipcMain.on("total-tabs-hide", () => {
                this.totalTabsOpened = !1, this.appendChild && (document.body.removeChild(this.appendChild), this.appendChild = null)
            }))
        }
    };
    i([o.Prop({})], B.prototype, "bookMarks", void 0), i([o.Prop({})], B.prototype, "currentCategoryId", void 0), i([o.Prop({})], B.prototype, "tabs", void 0), i([o.Prop({})], B.prototype, "unread", void 0), i([o.Prop({})], B.prototype, "updateBookMarksIconUrl", void 0), i([o.Prop({})], B.prototype, "createNewTab", void 0), i([o.Prop({})], B.prototype, "onBrowserBindWindowHandle", void 0), i([o.Prop({})], B.prototype, "onBrowserTitleChange", void 0), i([o.Prop({})], B.prototype, "onBrowserFavIconChange", void 0), i([o.Prop({})], B.prototype, "onBrowserLoadStatusChange", void 0), i([o.Prop({})], B.prototype, "onBrowserAddressChange", void 0), i([o.Prop({})], B.prototype, "onBrowserNewBrowserPopup", void 0), i([o.Prop({})], B.prototype, "onBrowserNewBrowserPopupCompleted", void 0), i([o.Prop({})], B.prototype, "onBrowserLoadStart", void 0), i([o.Prop({})], B.prototype, "onBrowserLoadError", void 0), i([o.Prop({})], B.prototype, "onBrowserClose", void 0), i([o.Prop({})], B.prototype, "selectTab", void 0), i([o.Prop({})], B.prototype, "closeTab", void 0), i([o.Prop({})], B.prototype, "removeTabCtrl", void 0), i([o.Prop({})], B.prototype, "onAppQuit", void 0), i([o.Prop({})], B.prototype, "onJsCallNativeFunction", void 0), i([o.Prop({})], B.prototype, "onJsCheckNativeFunction", void 0), i([o.Prop({default: "transparent"})], B.prototype, "background", void 0), i([o.Prop({default: 0})], B.prototype, "current", void 0), i([o.Prop({})], B.prototype, "updateCurrent", void 0), i([o.Prop({})], B.prototype, "updateTabs", void 0), i([o.Watch("tabs", {deep: !0})], B.prototype, "onTabsUpdated", null), i([o.Watch("current")], B.prototype, "onCurrentUpdated", null), i([o.Watch("isDownloadingTab")], B.prototype, "onDownloadingTabSelect", null), B = i([o.Component({
        filters: {unread: f.unread},
        components: {TabsSpringFestival: A.default}
    })], B), t.default = B
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(313), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(5), s = n(1), l = n(585), u = n(737), d = n(14), c = n(13),
        h = s.default.getLogger("Thunder.Main.Renderer.view.tabs-spring-festival");
    let f = class extends o.Vue {
        constructor() {
            super(...arguments), this.redPaperVisible = !1, this.recoverSkinVisible = !1, this.isLogin = !1, this.isVip = !1, this.vasType = 0, this.textLink = null, this.text = "过年好！拆红包有惊喜>", this.timer = null, this.index = 0, this.onLoginSucCookie = 0, this.onLogoutCookie = 0
        }

        onTabsUpdated(e) {
            this.update()
        }

        onRecoverSkinUpdated(e = !1) {
            e && c.XLStatNS.trackEvent("xlx_vip_event", "newyear_skin_back_button_show", "", 0, 0, 0, 0, {
                is_login: Number(this.isLogin),
                is_vip: Number(this.isVip),
                vip_type: this.vasType
            })
        }

        onRedPaperUpdated(e = !1) {
            e && c.XLStatNS.trackEvent("xlx_vip_event", "newyear_skin_wzl_show", "", 0, 0, 0, 0, {
                is_login: Number(this.isLogin),
                is_vip: Number(this.isVip),
                vip_type: this.vasType
            })
        }

        update() {
            return a(this, void 0, void 0, function* () {
                h.information("tabsCount", this.tabsCount), this.textLink = l.SpringFestivalSkinNS.getTextLink(this.isLogin), this.killLinkTimer(), yield this.updateIsVip(), this.redPaperVisible = this.tabsCount < 2 && (yield l.SpringFestivalSkinNS.canShowLink()), this.recoverSkinVisible = this.tabsCount < 3 && (yield l.SpringFestivalSkinNS.canShowSkin()), this.redPaperVisible ? this.createLinkTimer() : this.killLinkTimer()
            })
        }

        clickRedPaper() {
            if (h.information("clickRedPaper"), l.SpringFestivalSkinNS.onClickLink(), this.redPaperVisible = !1, this.killLinkTimer(), this.textLink && this.textLink.link) {
                let e = this.textLink.link;
                d.default("openNewTab", e).catch()
            }
            c.XLStatNS.trackEvent("xlx_vip_event", "newyear_skin_wzl_click", "", 0, 0, 0, 0, {
                is_login: Number(this.isLogin),
                is_vip: Number(this.isVip),
                vip_type: this.vasType
            })
        }

        clickRecoverSkin() {
            h.information("clickRecoverSkin"), u.default.recoverSkin(), this.recoverSkinVisible = !1, c.XLStatNS.trackEvent("xlx_vip_event", "newyear_skin_back_button_click", "", 0, 0, 0, 0, {
                is_login: Number(this.isLogin),
                is_vip: Number(this.isVip),
                vip_type: this.vasType
            })
        }

        createLinkTimer() {
            this.timer || (h.information("createLinkTimer"), this.index = 0, this.changeText(), this.timer = setInterval(() => {
                this.changeText()
            }, 15e3))
        }

        killLinkTimer() {
            this.timer && (h.information("killLinkTimer"), clearInterval(this.timer), this.timer = null)
        }

        changeText() {
            if (this.textLink && this.textLink.text) {
                let e = this.index++ % 2;
                this.text = this.textLink.text[e], h.information("change link text", "index", e, "text", this.text)
            }
        }

        updateIsVip() {
            return a(this, void 0, void 0, function* () {
                try {
                    if (this.isLogin) {
                        let e = JSON.parse(yield d.default("GetUserInfo", 2));
                        e && (this.vasType = Number(e.vasType).valueOf(), this.isVip = Boolean("1" === e.isVip))
                    } else this.isVip = !1, this.vasType = 0
                } catch (e) {
                    h.warning(e)
                }
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.isLogin = yield d.default("IsLogined"), this.update(), this.onLoginSucCookie = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    this.isLogin = !0, this.update()
                }), this.onLogoutCookie = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    this.isLogin = !1, this.update()
                })
            })
        }

        destroyed() {
            r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginSucCookie), r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.onLogoutCookie)
        }
    };
    i([o.Prop({})], f.prototype, "tabsCount", void 0), i([o.Watch("tabsCount")], f.prototype, "onTabsUpdated", null), i([o.Watch("recoverSkinVisible")], f.prototype, "onRecoverSkinUpdated", null), i([o.Watch("redPaperVisible")], f.prototype, "onRedPaperUpdated", null), f = i([o.Component({components: {}})], f), t.default = f
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(315), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(887), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            chatUsersInfo: e => e.Community.chatUsersInfo,
            showMessageButton: e => e.Community.showMessageButton,
            unReadNums: e => e.Community.unreadNums
        },
        mapCommitToProps: {setChatMsgs: "SET_CHAT_MSGS", setUserInfo: "SET_USERS_INFO", setChatsNum: "SET_CHATS_NUM"},
        mapDispatchToProps: {getUserInfo: "getUserInfo", getUnreadMessages: "getUnreadMessages"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(317), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(5), s = n(14), l = n(93), u = n(1).default.getLogger("MessageTips");
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.privateServiceType = "10007", this.msgCenterServeiceType = "10010", this.chatMsgType = 100, this.msgWayType = 2, this.avatarLinkProtocol = "http", this.newMsgChatType = 1, this.isStartLogin = !1, this.msgImageType = 2, this.msgFileType = 4
        }

        getUserAvatar(e) {
            let t = e || 0;
            return `${this.avatarLinkProtocol}://img.user.kanimg.com/usrimg/${t}/300x300`
        }

        onPrivateMessage(e) {
            let t = JSON.parse(e), n = [];
            for (let e = 0; e < t.length; e++) {
                let i = t[e];
                try {
                    let e = JSON.parse(i.data);
                    u.information("getUserInfo data", e);
                    let a = "";
                    if (a = l(e, "record", "class") === this.msgImageType ? "[图片]" : l(e, "record", "class") === this.msgFileType ? "[文件]" : l(e, "record", "content"), l(e, "message_type") === this.msgWayType) {
                        let i = !1, o = {
                            msgType: this.chatMsgType,
                            userId: l(e, "record", "sender") || 0,
                            userAvatar: this.getUserAvatar(l(e, "record", "sender")),
                            msgid: l(e, "record", "id"),
                            messageContent: a,
                            userName: "",
                            createTime: l(e, "record", "created_at")
                        };
                        this.getUserInfo(l(e, "record", "sender")).then(e => {
                            if (!e.error && "ok" === e.data.result && !i) {
                                let t = e.data.user_info || {};
                                o.userName = l(t, "nick_name") || l(this.chatUsersInfo[o.userId], "nick_name"), n.push(o), i = !0
                            }
                            u.information("私信未读数-getUserInfo chatMsgs", n), n.length === t.length && 0 !== n.length && (this.setChatMsgs(n), u.information("isStartLogin", !this.isStartLogin), !this.isStartLogin && this.showMessageButton && this.setChatsNum(this.unReadNums.chat + n.length))
                        })
                    }
                } catch (e) {
                    u.information("json parse community error", e)
                }
            }
        }

        onMsgCenterServiceType(e) {
            return a(this, void 0, void 0, function* () {
                let t = 0, n = JSON.parse(e);
                for (let e = 0; e < n.length; e++) {
                    let i = n[e];
                    try {
                        let e = JSON.parse(i.data);
                        if (u.information("onMsgCenterServiceType data", e), "msgcenter" === l(e, "svc") && "msg_unread" === l(e, "business")) {
                            let n = l(e, "content");
                            if (n && "" !== n) {
                                let e = JSON.parse(n), i = l(e, "comment_update_type"),
                                    a = l(e, "comment_unread_updated_count");
                                u.information("onMsgCenterServiceType commentUpdateType:", i, ", commentUnreadUpdatedCount:", a);
                                let o = parseInt(a, 10);
                                o > 0 && ("cinecism_reply_comment" !== i && "video_reply_comments" !== i && "task_comments" !== i && "video_comments" !== i || (t += o))
                            }
                        }
                    } catch (e) {
                        u.information("json parse community error", e)
                    }
                    if (t > 0 && !this.isStartLogin && this.showMessageButton) {
                        let e = yield s.default("GetUserID");
                        u.information("onMsgCenterServiceType getUnreadMessages userId:", e), e && "" !== e && this.getUnreadMessages(e)
                    }
                }
            })
        }

        mounted() {
            r.NativeCallModule.nativeCall.AttachNativeEvent("OnMessageChannelUserLogin", () => {
                u.information("用户登录消息通道成功"), r.NativeCallModule.nativeCall.CallNativeFunction("MessageChannelRegisterService", this.privateServiceType), r.NativeCallModule.nativeCall.CallNativeFunction("MessageChannelRegisterService", this.msgCenterServeiceType)
            }), r.NativeCallModule.nativeCall.AttachNativeEvent("OnMessageChannelServiceCallback", (e, t) => {
                u.information("收到私信,msgServiceArray", t), u.information("收到私信,serviceType", e);
                try {
                    e === this.privateServiceType ? this.onPrivateMessage(t) : e === this.msgCenterServeiceType && this.onMsgCenterServiceType(t)
                } catch (e) {
                    u.information("json parse community error", e)
                }
            }), r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.isStartLogin = !0, setTimeout(() => {
                    this.isStartLogin = !1
                }, 1e3)
            }), r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                u.information("OnLogout"), this.isStartLogin = !1
            })
        }
    };
    i([o.Prop({})], d.prototype, "setChatMsgs", void 0), i([o.Prop({})], d.prototype, "getUnreadMessages", void 0), i([o.Prop({})], d.prototype, "setUserInfo", void 0), i([o.Prop({})], d.prototype, "setChatsNum", void 0), i([o.Prop({})], d.prototype, "getUserInfo", void 0), i([o.Prop({})], d.prototype, "chatUsersInfo", void 0), i([o.Prop({})], d.prototype, "showMessageButton", void 0), i([o.Prop({})], d.prototype, "unReadNums", void 0), d = i([o.Component({components: {}})], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(319), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(889), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            formData: e => e.SettingConf.formData
        },
        mapGettersToProps: {currentTab: e => e.currentTab},
        mapDispatchToProps: {initBookMarks: "initBookMarks"},
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            deleteBookMarksItem: "REMOVE_BOOK_MARKS_ITEM",
            setConfigValue: "SET_CONFIG_VALUE",
            updateBookMarksIconUrl: "UPDATE_BOOK_MARKS_ICONURL"
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(321), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(3), r = n(136), s = n(25), l = n(23), u = n(234), d = n(33), c = n(231), h = n(5), f = n(53),
        g = n(13), p = n(93), k = n(1), m = n(890), T = k.default.getLogger("book-marks"),
        v = o.remote.getGlobal("mainRendererWindow"),
        C = u.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    let S = class extends a.Vue {
        constructor() {
            super(...arguments), this.bookMarksWidth = 128, this.moreBookMarkMenuWidth = 294, this.winWidth = 1, this.curWnd = null, this.bookMarkMenuUrl = "", this.bookMarkMenuTitle = "", this.bookMarkConf = !1, this.indexPageTitle = "下载", this.settingPageTitle = "设置中心", this.communityName = "community", this.blankPageTitle = "新标签页", this.headerHeight = 107, this.bookMarkBarHeight = 33, this.arrowWidth = 22, this.iconAndPaddingWidth = 32, this.fontSize = 12, this.bookMarkStrLen = 8, this.hoverMenuContext = null, this.moreBookMarkItemHeight = 28, this.moreBookMarkMaxHeight = 440, this.itemsPadding = 8, this.itemsWarpperPadding = 12
        }

        get bookMarksList() {
            return Object.values(this.bookMarks) || []
        }

        get showMarksList() {
            return this.bookMarksList.slice(0, this.barMarkEnd)
        }

        get barMarkEnd() {
            let e = 0, t = 0;
            for (let n = 0; n < this.bookMarksList.length; n++) {
                if (this.bookMarksList[n].name.length >= this.bookMarkStrLen ? t += this.bookMarksWidth : t = t + this.bookMarksList[n].name.length * this.fontSize + this.iconAndPaddingWidth, t >= this.winWidth - this.bookMarksWidth - this.arrowWidth) {
                    e = n;
                    break
                }
                e = n
            }
            return e + 1
        }

        get hideBookMarksList() {
            return this.bookMarksList.slice(this.barMarkEnd)
        }

        get isShowBookMarkBar() {
            let e = this.bookMarkConf && !this.pageHideBookMarks && 0 !== this.bookMarksList.length,
                t = p(this.currentTab, "tab", "browser");
            if (t) {
                let e = t.getWindowHandle();
                this.$nextTick(() => {
                    c.resizeBrowserWindow(e)
                })
            }
            return e
        }

        get bookMarkTemplate() {
            return [{
                label: "在新标签页中打开", click: () => {
                    this.bookMarkRightClick("open_new"), this.openNewTab(this.bookMarkMenuUrl, this.bookMarkMenuTitle, "new")
                }
            }, {
                label: "删除", click: () => {
                    this.deleteBookMarksItem(this.bookMarkMenuUrl), g.XLStatNS.trackEvent("clienttop", "bookmarks_delete")
                }
            }]
        }

        get blankBookMarkMenu() {
            return [{
                label: "将此页添加书签",
                enabled: void 0 === this.bookMarks[p(this.currentTab, "tab", "url")] && p(this.currentTab, "tab", "title") !== this.blankPageTitle,
                click: () => {
                    C.emit("handleCollent")
                }
            }, {
                label: "隐藏书签栏", click: () => {
                    s.ConfigNS.setValue("Bookmark", "ShowBookmarkBar", 0)
                }
            }]
        }

        get pageHideBookMarks() {
            return p(this.currentTab, "tab", "type") === r.TabType.XDAS || p(this.currentTab, "tab", "name") === this.communityName
        }

        showBookMarkMenu(e, t, n = {}) {
            this.bookMarkMenuUrl = e, this.bookMarkMenuTitle = t;
            let i = o.remote.Menu.buildFromTemplate(this.bookMarkTemplate);
            f.MenuSkinNS.setStyle(i, {}), i.popup(Object.assign({}, {window: this.curWnd}, n)), g.XLStatNS.trackEvent("clienttop", "bookmarks_top_right_click")
        }

        created() {
            s.ConfigNS.attachListener(l.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.initBookMarks()
            }), this.setWinWidth()
        }

        setWinWidth() {
            if (void 0 === v) return;
            let e = v.getContentSize();
            this.winWidth = e[0]
        }

        showMenu(e) {
            let t = o.remote.getCurrentWindow().getBounds(), n = {
                x: t.x + e.x - this.moreBookMarkMenuWidth,
                y: t.y + e.y + 12,
                modal: !1,
                width: this.moreBookMarkMenuWidth + 2,
                height: this.hideBookMarksList.length * this.moreBookMarkItemHeight + this.itemsPadding + this.itemsWarpperPadding > this.moreBookMarkMaxHeight ? this.moreBookMarkMaxHeight : this.hideBookMarksList.length * this.moreBookMarkItemHeight + this.itemsPadding + this.itemsWarpperPadding + 2,
                maxHeight: this.moreBookMarkMaxHeight
            };
            d.MessageBox.custom("BookList", this.hideBookMarksList, n)
        }

        openNewTab(e, t, n = "") {
            if (p(this.currentTab, "tab", "title") === this.blankPageTitle && "new" !== n) return void p(this.currentTab, "tab").navigate(e);
            let i = {tabType: r.TabType.Chromium, tabParam: {title: t, url: e, name: "", showUrl: !0}};
            this.createNewTab(i), g.XLStatNS.trackEvent("clienttop", "bookmarks_bowser_open")
        }

        showAddBookMarkMenu(e) {
            let t = o.remote.Menu.buildFromTemplate(this.blankBookMarkMenu);
            g.XLStatNS.trackEvent("clienttop", "bookmarks_bar_blank_rihgt_click"), f.MenuSkinNS.setStyle(t, {}), t.popup({window: this.curWnd})
        }

        bookMarkRightClick(e) {
            let t = `button=${e}`;
            g.XLStatNS.trackEvent("clienttop", "bookmarks_top_right_click_menu", "", 0, 0, 0, 0, t)
        }

        mounted() {
            this.curWnd = o.remote.getCurrentWindow(), v.on("resize", e => {
                this.setWinWidth()
            }), o.remote.ipcMain.on("openNewTab-book-list", (e, t) => {
                T.information("openNewTab-book-list", t), this.openNewTab(t.url, t.title)
            }), o.remote.ipcMain.on("delete-book-list", (e, t) => {
                T.information("delete-book-list", t), this.deleteBookMarksItem(t.url)
            }), s.ConfigNS.attachListener(l.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.bookMarkConf = s.ConfigNS.getValue("Bookmark", "ShowBookmarkBar", !1)
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, n, i) => {
                "Bookmark" === e && (this.bookMarkConf = i)
            })
        }
    };
    i([a.Prop({})], S.prototype, "initBookMarks", void 0), i([a.Prop({})], S.prototype, "createNewTab", void 0), i([a.Prop({})], S.prototype, "deleteBookMarksItem", void 0), i([a.Prop({})], S.prototype, "setConfigValue", void 0), i([a.Prop({})], S.prototype, "currentTab", void 0), i([a.Prop({})], S.prototype, "bookMarks", void 0), i([a.Prop({})], S.prototype, "formData", void 0), i([a.Prop({})], S.prototype, "updateBookMarksIconUrl", void 0), S = i([a.Component({components: {BookMarksItem: m.default}})], S), t.default = S
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(323), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(10), s = n(38), l = n(24), u = n(1).default.getLogger("book-marks");
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.iconExist = !1, this.existUrl = ""
        }

        onIconUrlChange(e) {
            return a(this, void 0, void 0, function* () {
                do {
                    if ("" === this.url || void 0 === this.url || -1 !== this.url.indexOf("ftp://")) {
                        this.iconExist = !1;
                        break
                    }
                    let e = new URL(this.url).host, t = s.ToolsUtilitiesAWNS.genarateMd5(e),
                        n = __profilesDir + "/BookMarksIcon/" + t + ".png";
                    if (this.iconExist = yield r.FileSystemAWNS.existsAW(n), this.existUrl = n, !this.iconExist) {
                        n = "movie.xunlei.com" !== e ? "https://" + e + "/favicon.ico" : "https://" + e + "/fav.ico";
                        let t = null;
                        try {
                            t = yield l.default.get(n, {responseType: "arraybuffer"})
                        } catch (e) {
                            u.information("error " + e), this.iconExist = !1;
                            break
                        }
                        if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data && (this.iconExist = yield r.FileSystemAWNS.writeFileAW(this.existUrl, t.data), this.iconExist)) {
                            let e = {url: this.url, iconUrl: n};
                            this.updateBookMarksIconUrl(e)
                        }
                    }
                } while (0)
            })
        }
    };
    i([o.Prop({})], d.prototype, "url", void 0), i([o.Prop({})], d.prototype, "iconUrl", void 0), i([o.Prop({})], d.prototype, "updateBookMarksIconUrl", void 0), i([o.Watch("iconUrl", {immediate: !0})], d.prototype, "onIconUrlChange", null), d = i([o.Component({})], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(325), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(893), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {tabs: e => e.Tabs.tabs},
        mapDispatchToProps: {initSettingData: "initSettingData"},
        mapGettersToProps: {currentTab: e => e.currentTab}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(327), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(894), r = n(934), s = n(136), l = n(93);
    let u = class extends a.Vue {
        get downloadShow() {
            return "" === l(this.currentTab, "tab", "url") && "下载" === l(this.currentTab, "title")
        }

        get settingViewShow() {
            return "conf-setting" === l(this.currentTab, "tab", "name") && "设置中心" === l(this.currentTab, "title")
        }

        get webviewShow() {
            return l(this.currentTab, "tab", "type") === s.TabType.Chromium
        }

        get hadSettingTab() {
            return -1 !== this.getTabIndexByTitleAndName({name: "conf-setting", title: "设置中心"})
        }

        getTabIndexByTitleAndName(e) {
            let t = -1;
            if (void 0 === this.tabs) return t;
            for (let n = 0; n < this.tabs.length; n++) if (this.tabs[n].title === e.title && this.tabs[n].tab.name === e.name) {
                t = n;
                break
            }
            return t
        }
    };
    i([a.Prop({})], u.prototype, "currentTab", void 0), i([a.Prop({})], u.prototype, "initSettingData", void 0), i([a.Prop({})], u.prototype, "tabs", void 0), u = i([a.Component({
        components: {
            HomeTabView: o.default,
            BrowserViewContainer: r.default,
            SettingViewContainer: () => Promise.resolve().then(() => n(937))
        }
    })], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(329), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(895), r = n(931);
    let s = class extends a.Vue {
    };
    s = i([a.Component({components: {HomePage: r.default, DownloadPanel: o.default}})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(331), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(896), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage,
            showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            SHOW_PRIVATE_SPACE_OPEN_PAGE: "SHOW_PRIVATE_SPACE_OPEN_PAGE",
            SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK"
        },
        mapDispatchToProps: {selectTab: "selectTab"},
        mapGettersToProps: {downloadingOrder: e => e.downloadingOrder, canStartAll: e => e.canStartAll}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(333), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(3), r = n(4), s = n(897), l = n(904), u = n(908), d = n(911), c = n(912), h = n(913), f = n(927),
        g = n(8), p = n(90), k = n(267), m = n(23), T = n(253), v = n(77), C = n(5), S = n(85), y = n(74), w = n(14),
        I = n(134), b = n(73), A = n(745), N = n(32), D = n(929), _ = n(746), x = n(68), E = n(76),
        P = x.UserHelperNS.getHelper(), M = N.DownloadKernelTaskManager.getTaskManager(),
        F = p.DownloadKernelCategoryManager.getCategoryManager(), O = A.DownloadKernelUpgradeNS.getUpgrade();
    let U = !1;
    const L = n(13), B = n(82);
    let K = class extends r.Vue {
        constructor() {
            super(...arguments), this.adShow = !1, this.isFengxingAdShow = !1, this.isFengxingAsEnable = !0, this.isSearch = !1
        }

        onTabSelectChange(e) {
            E.setCurrentTabID(e), this.tryRestorePrivate(), 0 == e ? P.isVip ? _.FengxingAdHelperNS.showFengxingAd(!1) : _.FengxingAdHelperNS.showFengxingAd(!0) : _.FengxingAdHelperNS.showFengxingAd(!1)
        }

        onCategoryChange(e, t) {
            if (-1 !== e) {
                let t = F.getCategoryFromId(e);
                if (t) {
                    L.XLStatNS.trackEvent("download_leftpanel", "private_page_show", "", 0, 0, 0, 0, "");
                    let n = F.getCategoryView(e, g.DownloadKernel.CategroyViewID.Downloading), i = n.getTaskCount();
                    i += (n = F.getCategoryView(e, g.DownloadKernel.CategroyViewID.Completed)).getTaskCount();
                    let a = t.getPassword();
                    if ((!a || "" === a) && 0 === i) return void this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!0)
                }
            }
            this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
        }

        onDownloadingOrderChange(e) {
            M.isLoadStorageTaskFinish() && I.DownloadDispatchNS.updateTasksOrder(e)
        }

        onCanStartAll(e) {
            o.ipcRenderer.send("can-start-all-task", e)
        }

        handleAdShow(e) {
            this.adShow = e
        }

        get isShowPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        myComputer() {
            -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1)
        }

        closeSearchUI() {
            this.isSearch = !1
        }

        keyOpenSearchUI() {
            L.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.openSearchUI()
        }

        openSearchUI() {
            this.isShowPrivateSpace || (this.isSearch = !0)
        }

        privateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield v.default(!1, !0, "privatespace");
                if (e && "" !== e) {
                    let t = F.getPrivateCategoryFromUserId(e);
                    if (t && this.currentCategoryId !== t.getId()) {
                        0 === (yield k.PrivateSpaceHelperNS.accessPrivateCategory(e)) && this.UPDATE_CATEGORY(t.getId())
                    }
                }
            })
        }

        handleMenuClick(e) {
            switch (e) {
                case"my_computer":
                    this.myComputer();
                    break;
                case"private_space":
                    this.privateSpace()
            }
        }

        onUpgradeProgress(e, t) {
            e > t ? this.SHOW_UPGRADE_TASK(!0) : setTimeout(() => {
                this.SHOW_UPGRADE_TASK(!1)
            }, 10)
        }

        handleSwitchCategory(e, t, n, i) {
            return a(this, void 0, void 0, function* () {
                this.isSearch = !1;
                let a = o.remote.getCurrentWindow();
                if (i && (a.isMinimized() && a.restore(), a.show(), 0 !== this.currentTabId && this.selectTab(0)), this.currentCategoryId !== e) if (-1 !== e) {
                    let t = yield w.default("GetUserID");
                    if (0 !== (yield k.PrivateSpaceHelperNS.accessPrivateCategory(t))) return;
                    this.UPDATE_CATEGORY(e)
                } else this.UPDATE_CATEGORY(e);
                this.$nextTick(() => {
                    this.currentCategoryViewId !== t && this.UPDATE_CATEGORYVIEW(t), this.$refs.downloadlist.selectTask(t, n)
                })
            })
        }

        handleOpenSearchPage(e) {
            if (e) {
                let e = "entry=morelist";
                L.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, e), this.openSearchUI()
            } else this.closeSearchUI()
        }

        needUpgradeTask() {
            let e = "", t = 0;
            for (let n = 0; n < o.remote.process.argv.length; n++) {
                if (0 === o.remote.process.argv[n].indexOf("-StartType:")) e = o.remote.process.argv[n].substr("-StartType:".length); else {
                    if (0 === o.remote.process.argv[n].indexOf("-PreVersion:")) {
                        let e = o.remote.process.argv[n].substr("-PreVersion:".length), i = e.indexOf(".");
                        i && (e = e.substr(0, i)) && (t = parseInt(e, 10))
                    }
                }
            }
            let n = !1;
            return ("Install" === e && t < 9 || "LiveUD" === e && (0 === t || t < 9)) && (n = !0), n
        }

        protectPrivate() {
            this.UPDATE_CATEGORY(-1), k.PrivateSpaceHelperNS.setNeedPassword(!0), -1 !== this.currentCategoryId && (U = !0)
        }

        tryRestorePrivate() {
            U && 0 === this.currentTabId && (U = !1, this.handleMenuClick("private_space"))
        }

        created() {
            k.PrivateSpaceHelperNS.init(), this.onLogoutEventId = C.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1);
                let t = F.getPrivateCategoryFromUserId(e);
                t && S.TaskOperatorNs.pauseCategoryAllTask(t.getId())
            });
            let e = o.remote.getCurrentWindow();
            e.on("hide", () => {
                this.protectPrivate()
            }), e.on("minimize", () => {
                this.protectPrivate()
            }), o.ipcRenderer.on("main-window-state-active-show", () => {
                this.tryRestorePrivate()
            }), T.downloadContextMenu.attachListener(m.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), y.default.attachListener(m.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), y.default.attachListener(m.NodeEventMesssageNS.eventShowSearchTaskPage, this.handleOpenSearchPage), b.DownloadKernelManager.attachListener(m.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => a(this, void 0, void 0, function* () {
                this.needUpgradeTask() && O.init() && (O.attachListener(O.eventUpgradeProgress, this.onUpgradeProgress), O.startUpgrade()), this.onLoginEventId = C.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    O.init() && O.upgradePrivateSpace(e)
                });
                const {LoginHelperNS: e} = yield Promise.resolve().then(() => n(51));
                (yield e.loginHelper.isLoginedAw()) && e.loginHelper.getAllUserInfo(e => {
                    O.init() && O.upgradePrivateSpace(e.userID)
                })
            })), setTimeout(() => {
                0 === B.default.getConfigInfo("cooperateAd", "fengxingAdEnable") && (this.isFengxingAsEnable = !1), this.isFengxingAsEnable && (_.FengxingAdHelperNS.createFengxingAd(), _.FengxingAdHelperNS.attachListener(_.FengxingAdHelperNS.eventFengxingAdShow, e => {
                    this.isFengxingAdShow = e
                }))
            }, 1e4)
        }

        destroyed() {
            k.PrivateSpaceHelperNS.uninit(), void 0 !== this.onLogoutEventId && (C.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.onLogoutEventId), this.onLogoutEventId = void 0), void 0 !== this.onLoginEventId && (C.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginEventId), this.onLoginEventId = void 0), T.downloadContextMenu.detachListener(m.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), y.default.detachListener(m.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), O.detachListener(O.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    i([r.Prop({})], K.prototype, "currentTabId", void 0), i([r.Prop({})], K.prototype, "currentCategoryId", void 0), i([r.Prop({})], K.prototype, "currentCategoryViewId", void 0), i([r.Prop({})], K.prototype, "showPrivateSpaceOpenPage", void 0), i([r.Prop({})], K.prototype, "showUpgradeTask", void 0), i([r.Prop({})], K.prototype, "downloadingOrder", void 0), i([r.Prop({})], K.prototype, "canStartAll", void 0), i([r.Prop({})], K.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), i([r.Prop({})], K.prototype, "SHOW_UPGRADE_TASK", void 0), i([r.Prop({})], K.prototype, "selectTab", void 0), i([r.Prop({})], K.prototype, "UPDATE_CATEGORY", void 0), i([r.Prop({})], K.prototype, "UPDATE_CATEGORYVIEW", void 0), i([r.Watch("currentTabId")], K.prototype, "onTabSelectChange", null), i([r.Watch("currentCategoryId", {immediate: !0})], K.prototype, "onCategoryChange", null), i([r.Watch("downloadingOrder", {immediate: !0})], K.prototype, "onDownloadingOrderChange", null), i([r.Watch("canStartAll")], K.prototype, "onCanStartAll", null), K = i([r.Component({
        components: {
            ToolBarContainer: s.default,
            DownloadListContainer: h.default,
            PrivateSpaceOpenPageContainer: f.default,
            DownloadSearchContainer: D.default,
            UpgradeTaskContainer: u.default,
            ToastNotify: d.default,
            StatusBarContainer: l.default,
            AdPlatformCtrl: c.default
        }
    })], K), t.default = K
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(335), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(898), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {},
        mapGettersToProps: {toolbarButtons: e => e.toolbarButtons}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(337), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(899), r = n(901);
    let s = class extends a.Vue {
    };
    i([a.Prop({})], s.prototype, "toolbarButtons", void 0), s = i([a.Component({
        components: {
            ToolBarButtonContainer: o.default,
            ToolBarVipButtonContainer: r.default
        }
    })], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(339), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(900), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage
        },
        mapCommitToProps: {CREATE_NEW_TAB: "CREATE_NEW_TAB", SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION"},
        mapGettersToProps: {currentSelectdTaskInfos: e => e.currentSelectdTaskInfos}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(341), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4);
    let r = class extends o.Vue {
        constructor() {
            super(...arguments), this.disabled = !1, this.disableClass = ""
        }

        onSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                "xlx-icon-nav-file" !== this.id && "xlx-icon-nav-folder" !== this.id || (this.disableClass = yield this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, e, this.showPrivateSpaceOpenPage), "" === this.disableClass ? this.disabled = !1 : this.disabled = !0)
            })
        }

        handleClick(e) {
            this.disabled || this.click(e, this)
        }

        get filterClass() {
            let e = this.disableClass;
            do {
                if ("" !== e) break;
                "string" == typeof (e = this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, this.currentSelectdTaskInfos, this.showPrivateSpaceOpenPage)) && (this.disabled = "" !== e)
            } while (0);
            return e
        }
    };
    i([o.Prop({})], r.prototype, "title", void 0), i([o.Prop({})], r.prototype, "id", void 0), i([o.Prop({})], r.prototype, "currentCategoryId", void 0), i([o.Prop({})], r.prototype, "currentCategoryViewId", void 0), i([o.Prop({})], r.prototype, "showPrivateSpaceOpenPage", void 0), i([o.Prop({})], r.prototype, "currentSelectdTaskInfos", void 0), i([o.Prop({})], r.prototype, "buttonClassFilter", void 0), i([o.Prop({})], r.prototype, "click", void 0), i([o.Prop({})], r.prototype, "CREATE_NEW_TAB", void 0), i([o.Prop({})], r.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), i([o.Watch("currentSelectdTaskInfos", {immediate: !0})], r.prototype, "onSelectChange", null), r = i([o.Component], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(343), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(902), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage
        },
        mapCommitToProps: {CREATE_NEW_TAB: "CREATE_NEW_TAB", SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION"},
        mapGettersToProps: {currentSelectdTaskInfos: e => e.currentSelectdTaskInfos}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(345), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(5), s = n(1).default.getLogger("DownloadPanel.ToolBarVipButton"), l = n(903);
    let u = class extends o.Vue {
        constructor() {
            super(...arguments), this.disabled = !1, this.disableClass = "", this.vipIcon = "", this.hoverTitle = "", this.newClick = null, this.hasRedPoint = !1, this.clickUrl = "https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip", this.cfgType = "", this.iconMgr = null
        }

        onSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                "xlx-icon-nav-file" !== this.id && "xlx-icon-nav-folder" !== this.id || (this.disableClass = yield this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, e, this.showPrivateSpaceOpenPage), "" === this.disableClass ? this.disabled = !1 : this.disabled = !0)
            })
        }

        handleClick(e) {
            this.disabled || (s.information("handleClick, clickUrl=", this.clickUrl), "" !== this.cfgType && r.NativeCallModule.nativeCall.CallNativeFunction("SetValue", "ToolBarButtonVipIcon", this.cfgType, this.clickUrl, () => {
            }), r.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", this.clickUrl, e => {
                s.information("errorCode", e)
            }), this.iconMgr.sendStat("download_leftpanel", "top_vipicon_click"), this.hasRedPoint && (this.hasRedPoint = !1))
        }

        handleError(e) {
            this.vipIcon = ""
        }

        get handleTitle() {
            return "" == this.hoverTitle ? this.title : this.hoverTitle
        }

        handleEnter(e) {
            this.iconMgr.sendStat("download_leftpanel", "top_vipicon_hover_show")
        }

        get filterClass() {
            let e = this.disableClass;
            do {
                if ("" !== e) break;
                "string" == typeof (e = this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, this.currentSelectdTaskInfos, this.showPrivateSpaceOpenPage)) && (this.disabled = "" !== e), this.hasRedPoint && (e = "is-new")
            } while (0);
            return e
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.iconMgr = new l.VipIconMgr(this), this.iconMgr.init()
            })
        }
    };
    i([o.Prop({})], u.prototype, "title", void 0), i([o.Prop({})], u.prototype, "id", void 0), i([o.Prop({})], u.prototype, "currentCategoryId", void 0), i([o.Prop({})], u.prototype, "currentCategoryViewId", void 0), i([o.Prop({})], u.prototype, "showPrivateSpaceOpenPage", void 0), i([o.Prop({})], u.prototype, "currentSelectdTaskInfos", void 0), i([o.Prop({})], u.prototype, "buttonClassFilter", void 0), i([o.Prop({})], u.prototype, "click", void 0), i([o.Prop({})], u.prototype, "CREATE_NEW_TAB", void 0), i([o.Prop({})], u.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), i([o.Watch("currentSelectdTaskInfos", {immediate: !0})], u.prototype, "onSelectChange", null), u = i([o.Component], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(347), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(905), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {tabs: e => e.Tabs.tabs, current: e => e.Tabs.current},
        mapCommitToProps: {},
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(349), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1186), n(1188);
    const a = n(4), o = n(12), r = n(23), s = n(284), l = n(73), u = n(739), d = n(906), c = n(5), h = n(51), f = n(25),
        g = n(135), p = n(133), k = n(13), m = n(56), T = n(31), v = n(2), C = n(7), S = n(8), y = n(34), w = n(82),
        I = n(1).default.getLogger("ThunderxKuaiNiao"), b = y.DownloadKernelEventManager.getEventManager(),
        A = C.default(v.join(__rootDir, "../bin/ThunderHelper.node")), N = n(907).urls,
        D = g.ToastNotifyManagerNS.getToastNotifyManger();

    function _(...e) {
        I.information(...e)
    }

    var x;
    !function (e) {
        e[e.StatusInit = 0] = "StatusInit", e[e.StatusQueryPortal = 1] = "StatusQueryPortal", e[e.StatusQueryPortalFailed = 2] = "StatusQueryPortalFailed", e[e.StatusQueryPortalSuccess = 3] = "StatusQueryPortalSuccess", e[e.StatusQueryBand = 4] = "StatusQueryBand", e[e.StatusQueryBandFailed = 5] = "StatusQueryBandFailed", e[e.StatusQueryBandSuccess = 6] = "StatusQueryBandSuccess", e[e.StatusWaitTry = 7] = "StatusWaitTry", e[e.StatusWaitAcc = 8] = "StatusWaitAcc", e[e.StatusQueryTry = 9] = "StatusQueryTry", e[e.StatusNoTryNum = 10] = "StatusNoTryNum", e[e.StatusQueryTryFailed = 11] = "StatusQueryTryFailed", e[e.StatusQueryTrySuccess = 12] = "StatusQueryTrySuccess", e[e.StatusTrySpeedup = 13] = "StatusTrySpeedup", e[e.StatusSpeedup = 14] = "StatusSpeedup", e[e.StatusSpeedupFailed = 15] = "StatusSpeedupFailed", e[e.StatusSpeedupSuccess = 16] = "StatusSpeedupSuccess", e[e.StatusKeepAlive = 17] = "StatusKeepAlive", e[e.StatusKeepAliveFailed = 18] = "StatusKeepAliveFailed", e[e.StatusSpeeddown = 19] = "StatusSpeeddown", e[e.StatusSpeeddownFailed = 20] = "StatusSpeeddownFailed", e[e.StatusTrying = 21] = "StatusTrying", e[e.StatusTryDone = 22] = "StatusTryDone", e[e.StatusAlreadySpeedup = 23] = "StatusAlreadySpeedup"
    }(x = t.KuaiNiaoStatusEnum || (t.KuaiNiaoStatusEnum = {}));
    let E = class extends a.Vue {
        constructor() {
            super(...arguments), this.totalDownloadSpeed = 0, this.totalUploadSpeed = 0, this.todayDownSize = 0, this.todayUpSize = 0, this.downloadVipSpeed = 0, this.downloadCompleteTaskType = u.ScheduleCompleteTaskType.UnKnown, this.canShowVipSpeed = !1, this.canShowDiskBusy = !1, this.showVipText = "会员登录", this.bDisplay = "none", this.isFreeDownload = !1, this.vipType = void 0, this.isLimit = !1, this.popUp = !1, this.limitSpeetMenuText = "限速下载", this.entryText = "下载计划", this.scheduleTaskCount = 0, this.diskIdleInfo = [{
                name: "",
                percent: "0",
                percentBase: "0"
            }], this.diskInfo = [], this.index = 0, this.everySecondDiskInfo = {}, this.timeDiskIdleId = -1, this.taskId = [], this.taskPath = [], this.showTime = 0, this.hideTime = 0, this.canShowKuainiaoTip = !1, this.canShowKuainiaoInterface = !1, this.kuaiNiaoText = "", this.kuaiNiaoTipText = "", this.band = void 0, this.maxband = void 0, this.bCanUpgrade = !1, this.leftTryTimes = 0, this.oldStatus = void 0, this.newStatus = void 0, this.tipTimerCookie = null
        }

        onIsDiskInfoChange(e) {
            if (e) k.XLStatNS.trackEvent("download_leftpanel", "disk_overload_icon_show"), this.showTime = (new Date).getTime(); else {
                this.hideTime = (new Date).getTime();
                let e = "dur=" + ((this.hideTime - this.showTime) / 1e3).toString();
                k.XLStatNS.trackEvent("download_leftpanel", "disk_overload_icon_show_dur", "", 0, 0, 0, 0, e)
            }
        }

        onIsLimtChanged(e) {
            e ? (this.limitSpeetMenuText = "限速下载中", this.entryText = "限速下载中") : (this.limitSpeetMenuText = "限速下载", this.entryText = "下载计划")
        }

        get vipText() {
            return this.showVipText
        }

        get curHoverSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s"
        }

        get curSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s"
        }

        get curUpSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.totalUploadSpeed, 1) + "/s"
        }

        get curVipSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.downloadVipSpeed, 1) + "/s"
        }

        get downSize() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.todayDownSize)
        }

        get upSize() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.todayUpSize)
        }

        showPop() {
            k.XLStatNS.trackEvent("download_leftpanel", "bottom_speed_hover"), this.bDisplay = "block", this.popUpScheduleMenu(!1)
        }

        hidePop() {
            this.bDisplay = "none"
        }

        onKuainiaoTextClick() {
            _("onKuainiaoTextClick enter"), m.NativeCallHostModule.nativeCallHost.fireNativeEvent("KuaiNiaoUIAction", "speedpage")
        }

        onKuainiaoTipClick() {
            _("onKuainiaoTipClick enter"), this.canShowKuainiaoTip = !1, m.NativeCallHostModule.nativeCallHost.fireNativeEvent("KuaiNiaoUIAction", "tip")
        }

        handClickleVipText() {
            if ("会员登录" === this.showVipText) h.LoginHelperNS.loginHelper.showLoginDlg("vip", !0); else if ("会员加速" === this.showVipText) {
                let e = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=baijin&timeType=1001&referfrom=v_pc_xlx_hytq_js&aidfrom=bottom";
                c.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", e);
                let t = `clickid=bottom,vip_type=${this.vipType}`;
                k.XLStatNS.trackEvent("xlx_vip_event", "hyjs_click", "", 0, 0, 0, 0, t)
            }
        }

        openTab() {
            c.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "http://yangtai.xunlei.com/?p=11111")
        }

        hover() {
            k.XLStatNS.trackEvent("download_leftpanel", "disk_overload_popup_show")
        }

        onConfigInitFinished() {
            let e = s.DownloadModeNS.getCurrentDownloadMode();
            this.isLimit = "1" !== e, this.isFreeDownload = s.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), d.FlowMonitorNS.startMonitor(), u.ScheduleTaskNS.init(), l.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, e => {
                this.totalDownloadSpeed = d.FlowMonitorNS.getCurrentDownloadSpeed(), this.downloadVipSpeed = d.FlowMonitorNS.getCurrentVipSpeed(), this.todayDownSize = d.FlowMonitorNS.getTodayDownloadSize()
            }), l.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, e => {
                this.totalUploadSpeed = e, this.todayUpSize = d.FlowMonitorNS.getTodayUploadSize()
            })
        }

        onGetUserInfo() {
            h.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                do {
                    if (null === e || void 0 === e) break;
                    let t = e.vipList[0], n = Number(t.isVip);
                    if (this.vipType = Number(t.vasType), 0 !== n) this.canShowVipSpeed = !0; else {
                        this.showVipText = "会员加速";
                        let e = `btn_type=bottom,vip_type=${this.vipType}`;
						this.vipType = 5;
						this.canShowVipSpeed = 1;	
                        k.XLStatNS.trackEvent("xlx_vip_event", "hyjs_show", "", 0, 0, 0, 0, e)
                    }
                } while (0)
            })
        }

        created() {
            f.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            }), f.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                switch (e) {
                    case"ConfigNet":
                        "ConfigNet_Type" === t && ("1" === String(i) ? this.isLimit = !1 : this.isLimit = !0)
                }
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                this.onGetUserInfo()
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => {
                "vipinfo" === e && this.onGetUserInfo()
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("KuaiNiaoBandWidthChanged", (e, t) => {
                this.band = e, this.maxband = t, _("KuaiNiaoBandWidthChanged", e, t)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("KuaiNiaoCanUpgradeChanged", e => {
                this.bCanUpgrade = e, _("KuaiNiaoCanUpgradeChanged", e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("KuaiNiaoLeftTryTimesChanged", e => {
                this.leftTryTimes = e, _("KuaiNiaoLeftTryTimesChanged", e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("KuaiNiaoLeftTryTimeChanged", e => {
                this.kuaiNiaoText = "快鸟试用中 " + e, _("KuaiNiaoLeftTryTime", e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("KuaiNiaoStatusChanged", (e, t) => {
                if (this.oldStatus = e, this.newStatus = t, _("KuaiNiaoStatusChanged", e, t), _("bCanUpgrade = ", this.bCanUpgrade), !0 === this.bCanUpgrade ? (this.canShowKuainiaoTip = !0, this.canShowKuainiaoInterface = !0) : (this.canShowKuainiaoTip = !1, this.canShowKuainiaoInterface = !1), t === x.StatusWaitTry) {
                    let e = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "试用快鸟 宽带翻倍", this.kuaiNiaoTipText = "试用快鸟 享" + e + " M宽带！", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "String类型定时器参数")
                } else if (t === x.StatusWaitAcc) {
                    let e = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "使用快鸟 宽带翻倍", this.kuaiNiaoTipText = "使用快鸟 享" + e + " M宽带！", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "定时器参数")
                } else if (t === x.StatusNoTryNum) {
                    let e = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "开通快鸟 宽带翻倍", this.kuaiNiaoTipText = "开通快鸟 享" + e + " M宽带！", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "定时器参数")
                } else if (t === x.StatusSpeedupSuccess) {
                    let e = String(this.band.downstream / 1024), t = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "快鸟提速成功！", this.kuaiNiaoTipText = "快鸟已将宽带从" + e + "M提至" + t + "M", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "定时器参数")
                } else if (t === x.StatusAlreadySpeedup) {
                    let e = String(this.band.downstream / 1024), t = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "快鸟提速成功！", this.kuaiNiaoTipText = "快鸟已将宽带从" + e + "M提至" + t + "M", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "定时器参数")
                } else if (t === x.StatusSpeedupFailed) _("StatusSpeedupFailed"); else if (t === x.StatusTrySpeedup) {
                    let e = String(this.band.downstream / 1024), t = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "快鸟试用中 ", this.kuaiNiaoTipText = "快鸟已将宽带从" + e + "M提至" + t + "M", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "定时器参数")
                } else if (t === x.StatusTryDone) {
                    let e = String(this.band.downstream / 1024), t = String(this.maxband.downstream / 1024);
                    this.kuaiNiaoText = "快鸟试用结束 ", this.kuaiNiaoTipText = "您的宽带已从" + t + "M降至" + e + "M", this.tipTimerCookie && (clearTimeout(this.tipTimerCookie), this.tipTimerCookie = null), this.tipTimerCookie = setTimeout(e => {
                        _("定时器触发${this.kuaiNiaoTipText} args = ", e), this.canShowKuainiaoTip = !1
                    }, 1e4, "定时器参数")
                } else _("other status")
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("getCurrentTabUrl", e => {
                let t = !1, n = T.parse(this.tabs[this.current].tab.url).hostname;
                do {
                    if ("" === n) break;
                    for (let e = 0; e < N.length; e++) if (N[e].url === n) {
                        t = !0;
                        break
                    }
                } while (0);
                m.NativeCallHostModule.nativeCallHost.fireNativeEvent(e, t)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.canShowVipSpeed = !1, this.showVipText = "会员登录", this.vipType = void 0
            })
        }

        updateDiskInfo(e) {
            if (this.everySecondDiskInfo.hasOwnProperty(e.name) || (this.everySecondDiskInfo[e.name] = []), this.everySecondDiskInfo[e.name].length >= 3 && this.everySecondDiskInfo[e.name].splice(0, 1), this.everySecondDiskInfo[e.name].push(e.percent), 3 === this.everySecondDiskInfo[e.name].length) {
                let t = (this.everySecondDiskInfo[e.name][0] + this.everySecondDiskInfo[e.name][1] + this.everySecondDiskInfo[e.name][2]) / 3;
                if ((t = Math.floor(t)) >= 90) for (let n of this.taskPath) if (-1 !== e.name.indexOf(n)) {
                    let n = e.name, i = e.name, a = !1;
                    i = e.name.slice(0, 2) + "(" + n.slice(2);
                    for (let e of this.diskInfo) e.name === i && (a = !0);
                    a || (this.diskInfo.push({name: i, percent: t.toString()}), this.canShowDiskBusy = !0)
                }
            }
        }

        startAttchDiskIdleInfo() {
            let e = w.default.getConfigInfo("diskIdleInfo", "enable");
            do {
                if (0 === e) break;
                this.timeDiskIdleId = setInterval(() => {
                    A.asyncDiskIdleInfo(e => {
                        if (null !== e && void 0 !== e) {
                            if (this.index++, 2 === this.index) {
                                this.diskInfo.splice(0, this.diskInfo.length), this.canShowDiskBusy = !1;
                                for (let t in this.diskIdleInfo) if (void 0 !== this.diskIdleInfo[t].name && e[t].name === this.diskIdleInfo[t].name) {
                                    let n = (Number(e[t].percent) - Number(this.diskIdleInfo[t].percent)) / (Number(e[t].percentBase) - Number(this.diskIdleInfo[t].percentBase));
                                    n = Math.floor(100 * (1 - n));
                                    let i = {name: e[t].name, percent: n};
                                    "_Total" !== e[t].name && this.updateDiskInfo(i)
                                }
                                this.index = 0
                            }
                            this.diskIdleInfo = e
                        }
                    })
                }, 1e3)
            } while (0)
        }

        mounted() {
            this.scheduleTaskCount = u.ScheduleTaskNS.getScheduleTaskCount(), u.ScheduleTaskNS.getEventEmitter().on(u.ScheduleTaskEventType.ScheduleTaskCountChange, e => {
                this.scheduleTaskCount = e
            }), b.attachTaskEvent(S.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== S.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    let n = "";
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        if (i.getTaskAttribute(S.DownloadKernel.TaskAttribute.Background)) continue;
                        let a = i.getTaskStatus();
                        n = i.getTaskAttribute(S.DownloadKernel.TaskAttribute.SavePath).slice(0, 2);
                        let o = i.getTaskAttribute(S.DownloadKernel.TaskAttribute.TaskId), r = this.taskId.indexOf(o),
                            s = this.taskPath.indexOf(n);
                        a === S.DownloadKernel.TaskStatus.StartWaiting || a === S.DownloadKernel.TaskStatus.StartPending || a === S.DownloadKernel.TaskStatus.Started ? -1 === r && (this.taskId.push(o), -1 === s && this.taskPath.push(n)) : -1 !== r && (this.taskId.splice(r, 1), -1 !== s && this.taskPath.splice(s, 1))
                    }
                    0 !== this.taskId.length ? -1 === this.timeDiskIdleId && this.startAttchDiskIdleInfo() : (this.canShowDiskBusy = !1, clearInterval(this.timeDiskIdleId), this.timeDiskIdleId = -1)
                } while (0)
            })
        }

        onPopUpBlur() {
            this.popUpScheduleMenu(!1)
        }

        popUpScheduleMenu(e) {
            this.popUp = e
        }

        handleClick(e) {
            let t = "";
            switch (this.isFreeDownload = s.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), e) {
                case"entry":
                    k.XLStatNS.trackEvent("download_leftpanel", "bottom_plan_click"), this.popUpScheduleMenu(!0);
                    break;
                case"totalSpeed":
                    t = "button=fullspeed", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), s.DownloadModeNS.setFullDownloadMode(), D.showNotify(g.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, p.ToastNotifyItemType.GreenNotify, "已为您切换至全速下载模式", 3e3), this.popUpScheduleMenu(!1);
                    break;
                case"limitSpeed":
                    t = "button=limitspeed", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), s.DownloadModeNS.showCustomDownloadModeDlg().then(e => {
                        e && D.showNotify(g.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, p.ToastNotifyItemType.GreenNotify, "已为您切换至限速下载模式", 3e3)
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"freeDownload":
                    this.isFreeDownload ? (t = "button=freedom,status=off", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.closeFreeDownLoad(), s.DownloadModeNS.setFreeDownLoadConfig(!1)) : u.ScheduleTaskNS.popMessageBox(() => {
                        t = "button=freedom,status=on", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), s.DownloadModeNS.setFreeDownLoadConfig(!0), u.ScheduleTaskNS.startFreeDownLoad()
                    }), this.popUpScheduleMenu(!1);
                    break;
                case"scheduleTask":
                    t = "button=plan", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.showPlanTaskDlg(), this.popUpScheduleMenu(!1);
                    break;
                case"shutdown":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.ShutDown ? (t = "button=finished_close", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.ShutDown)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                case"sleep":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.Sleep ? (t = "button=finished_sleep", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.Sleep)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                case"exit":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.Exit ? (t = "button=finished_exit", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.Exit)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                default:
                    this.popUpScheduleMenu(!1)
            }
        }
    };
    i([a.Prop({})], E.prototype, "current", void 0), i([a.Prop({})], E.prototype, "tabs", void 0), i([a.Watch("canShowDiskBusy")], E.prototype, "onIsDiskInfoChange", null), i([a.Watch("isLimit")], E.prototype, "onIsLimtChanged", null), E = i([a.Component], E), t.default = E
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(351), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(909), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask},
        mapCommitToProps: {SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK"},
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(353), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1197);
    const a = n(4), o = n(745).DownloadKernelUpgradeNS.getUpgrade();
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.progress = 0
        }

        onUpgradeProgress(e, t) {
            this.progress = e > 0 ? Math.floor(100 * t / e) : 0
        }

        created() {
            o.attachListener(o.eventUpgradeProgress, this.onUpgradeProgress)
        }

        destroyed() {
            o.detachListener(o.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    r = i([a.Component], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(355), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1199);
    const a = n(4), o = n(135), r = n(133), s = n(746), l = o.ToastNotifyManagerNS.getToastNotifyManger();
    let u = class extends a.Vue {
        constructor() {
            super(...arguments), this.show = !1, this.showNotifyItem = null, this.message = "", this.type = "send", this.durationTimer = void 0, this.isUp = !1
        }

        get cancel() {
            return !!this.showNotifyItem && this.showNotifyItem.getCancel()
        }

        handleClose() {
            this.showNotifyItem && l.closeNotify(this.showNotifyItem.getId())
        }

        handleCancel() {
            if (this.showNotifyItem) {
                if (this.showNotifyItem.getCancel()) {
                    this.showNotifyItem.cancel()
                }
                l.closeNotify(this.showNotifyItem.getId())
            }
        }

        handleMouseMove() {
            void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0)
        }

        handleMouseOut() {
            if (this.showNotifyItem) {
                let e = this.showNotifyItem.getDuration();
                e && e > 0 && (this.durationTimer = setTimeout(() => {
                    this.durationTimer = void 0, l.closeNotify(this.showNotifyItem.getId())
                }, e))
            }
        }

        onShowNotify(e, t) {
            switch (void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0), this.showNotifyItem = t, this.message = t.getMessage(), t.getType()) {
                case r.ToastNotifyItemType.GreenNotify:
                    this.type = "send";
                    break;
                case r.ToastNotifyItemType.RedNotify:
                case r.ToastNotifyItemType.RedCancelNotify:
                    this.type = "fail"
            }
            this.show = !0;
            let n = t.getDuration();
            n && n > 0 && (this.durationTimer = setTimeout(() => {
                this.durationTimer = void 0, l.closeNotify(e)
            }, n))
        }

        onCloseNotify(e, t) {
            this.showNotifyItem && e === this.showNotifyItem.getId() && (this.show = !1, this.showNotifyItem = null), void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0)
        }

        onUpdateNotify(e, t) {
            this.onShowNotify(e, t)
        }

        created() {
            l.attachListener("OnShowNotify", this.onShowNotify), l.attachListener("OnUpdateNotify", this.onUpdateNotify), l.attachListener("OnCloseNotify", this.onCloseNotify), this.fengxingAdEnable && s.FengxingAdHelperNS.attachListener(s.FengxingAdHelperNS.eventFengxingAdShow, e => {
                this.isUp = e
            })
        }

        destroyed() {
            l.detachListener("OnShowNotify", this.onShowNotify), l.detachListener("OnUpdateNotify", this.onUpdateNotify), l.detachListener("OnCloseNotify", this.onCloseNotify)
        }
    };
    i([a.Prop({})], u.prototype, "fengxingAdEnable", void 0), u = i([a.Component], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(357), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(747), r = n(254), s = n(287);
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.cookie = null, this.content = "", this.btnText = "", this.iconUrl = "", this.sceneData = {}, this.orderData = {}
        }

        onClick(e) {
            if (this.$emit("ad-show", !1), "btn" === e || "content" === e) {
                let e = this.orderData.openType, t = this.orderData.targetUrl, n = this.orderData.targetSubUrl;
                r.AdHelperNS.execute(e, t, n)
            }
            o.adPlatform.handleEvent(e)
        }

        created() {
            this.cookie = o.adPlatform.attachListener(s.AdCommonNS.eventAdShow, (e, t, n) => {
                e === s.AdCommonNS.AdName.AdPlatform && (this.sceneData = t, this.orderData = n, this.content = n.content, this.btnText = n.btnText, this.iconUrl = n.iconUrl, this.$emit("ad-show", !0), o.adPlatform.handleEvent("ad_show"))
            })
        }

        destroyed() {
            null !== this.cookie && (o.adPlatform.detachListener(s.AdCommonNS.eventAdShow, this.cookie), this.cookie = null)
        }
    };
    l = i([a.Component], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(359), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(914), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            INIT_CATEGORY_TASKLIST: "INIT_CATEGORY_TASKLIST",
            UPDATE_DOWNLOADING_SELECTED_TASKS: "UPDATE_DOWNLOADING_SELECTED_TASKS",
            UPDATE_COMPLETED_SELECTED_TASKS: "UPDATE_COMPLETED_SELECTED_TASKS",
            UPDATE_RECYCLE_SELECTED_TASKS: "UPDATE_RECYCLE_SELECTED_TASKS",
            MOVE_TO_TOP: "MOVE_TO_TOP",
            MOVE_TO_BOTTOM: "MOVE_TO_BOTTOM",
            INSERT_TO_CATEGORY_VIEW: "INSERT_TO_CATEGORY_VIEW",
            UPDATE_TASK_STATUS: "UPDATE_TASK_STATUS",
            SORT_CATEGORY_HISTORY: "SORT_CATEGORY_HISTORY",
            SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION",
            UPDATE_DOWNLOADING_TASKLIST: "UPDATE_DOWNLOADING_TASKLIST",
            UPDATE_COMPLETED_TASKLIST: "UPDATE_COMPLETED_TASKLIST",
            UPDATE_RECYCLE_TASKLIST: "UPDATE_RECYCLE_TASKLIST"
        },
        mapDispatchToProps: {attachTaskEvent: "attachTaskEvent", selectTab: "selectTab"},
        mapGettersToProps: {
            downloadingTaskList: e => e.downloadingTaskList,
            completedTaskList: e => e.completedTaskList,
            recycleTaskList: e => e.recycleTaskList,
            downloadingTaskBaseList: e => e.downloadingTaskBaseList,
            completedTaskBaseList: e => e.completedTaskBaseList,
            recycleTaskBaseList: e => e.recycleTaskBaseList,
            currentSelectdTaskInfos: e => e.currentSelectdTaskInfos,
            downloadingSelectedIndexs: e => e.downloadingSelectedIndexs,
            completedSelectedTaskIndexs: e => e.completedSelectedTaskIndexs,
            recycleSelectedTaskIndexs: e => e.recycleSelectedTaskIndexs,
            canStartAll: e => e.canStartAll
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(361), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(1), r = n(8), s = n(148), l = n(748), u = n(85), d = n(253), c = n(23), h = n(74), f = n(13),
        g = n(73), p = n(34), k = n(32), m = n(926), T = n(132), v = p.DownloadKernelEventManager.getEventManager(),
        C = k.DownloadKernelTaskManager.getTaskManager(), S = o.default.getLogger("DownloadList");
    let y = class extends a.Vue {
        constructor() {
            super(...arguments), this.categoryLastSelectList = [{
                category: r.DownloadKernel.CategroyViewID.Downloading,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Completed,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Recycle,
                lastIndex: 0
            }], this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.isHoverClass = !1, this.completedFilterTaskList = this.completedTaskList, this.completedFilter = "全部"
        }

        onCategoryChange(e) {
            h.default.fireEvent(c.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.INIT_CATEGORY_TASKLIST(), this.$nextTick(() => {
                S.information("onCategoryChange nextTick"), this.completedListRestore()
            }), this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading)
        }

        onCategoryViewChange(e, t) {
            t === r.DownloadKernel.CategroyViewID.Completed && this.completedListRestore()
        }

        onCompletedTaskListChange(e) {
            if (S.information("onCompletedTaskListChange"), "全部" === this.completedFilter) this.completedFilterTaskList = e; else {
                let t = e.filter(e => -1 !== this.completedFilterTaskList.indexOf(e));
                this.completedFilterTaskList = t
            }
        }

        onCompletedFilterChange() {
            this.UPDATE_COMPLETED_SELECTED_TASKS([])
        }

        completedListRestore() {
            m.CompletedFilterNS.reset(), this.completedFilter = "全部", this.completedFilterTaskList = this.completedTaskList
        }

        showFilterMenu(e) {
            m.CompletedFilterNS.showMenu(this.$refs.filterMenu, this.currentCategoryId, (e, t) => {
                if (this.completedFilter = e.label, t) {
                    let e = this.completedTaskList.filter(e => -1 !== t.indexOf(e));
                    this.completedFilterTaskList = e
                } else this.completedFilterTaskList = this.completedTaskList
            })
        }

        handleCollapseChange(e) {
            let t = e, n = "";
            t === r.DownloadKernel.CategroyViewID.Downloading ? n = "downloading_click" : t === r.DownloadKernel.CategroyViewID.Completed ? n = "finished_click" : t === r.DownloadKernel.CategroyViewID.Recycle && (n = "dustbin_click"), f.XLStatNS.trackEvent("download_leftpanel", n), this.UPDATE_CATEGORYVIEW(t)
        }

        handleDelete(e, t) {
            do {
                if ("Delete" !== e.key) break;
                if (!s.TaskStatusHelper.canMoveSelectedTask(void 0, this.currentSelectdTaskInfos)) break;
                void 0 === t && e.shiftKey && (t = !0), t ? u.TaskOperatorNs.destroyTasks(this.currentSelectdTaskInfos) : u.TaskOperatorNs.deleteTasks(this.currentSelectdTaskInfos)
            } while (0)
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingTaskList.length && (e = e + "(" + this.downloadingTaskList.length + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completedFilterTaskList.length && (e = e + "(" + this.completedFilterTaskList.length + ")"), e
        }

        get recycleCategoryTitle() {
            let e = "垃圾箱";
            return 0 !== this.recycleTaskList.length && (e = e + "(" + this.recycleTaskList.length + ")"), e
        }

        downloadingItemDbClick() {
            s.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos) : s.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos) : S.information("downloaditem dbclick do nothing")
        }

        handleDownloadingItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelectdTaskInfos, this.currentCategoryId, this.downloadingTaskList.length), d.downloadContextMenu.popMenu(d.DownloadMenuType.DownloadingItem)
        }

        handleCompletedItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelectdTaskInfos, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.CompletedItem)
        }

        handleRecycleItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelectdTaskInfos, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.RecycleItem)
        }

        handleDownloadingBlankMenu() {
            -1 === this.currentCategoryId && (0 === this.currentSelectdTaskInfos.length ? (d.downloadContextMenu.setContextInfo(null, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.DownloadingBlank)) : this.handleDownloadingItemMenu())
        }

        handleRecycleBlankMenu() {
            0 === this.currentSelectdTaskInfos.length ? (d.downloadContextMenu.setContextInfo(this.recycleTaskBaseList, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.RecycleBlank)) : this.handleRecycleItemMenu()
        }

        handleDownloadingCategoryMenu() {
            this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading ? -1 === this.currentCategoryId && (d.downloadContextMenu.setContextInfo(this, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.DownloadingCategory)) : this.handleCollapseChange(r.DownloadKernel.CategroyViewID.Downloading)
        }

        handleCompletedCategoryMenu() {
            this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Completed ? (d.downloadContextMenu.setContextInfo(this, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.CompletedCategory)) : this.handleCollapseChange(r.DownloadKernel.CategroyViewID.Completed)
        }

        handleRecycleCategoryMenu() {
            this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle ? (d.downloadContextMenu.setContextInfo(this, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.RecycleCategory)) : this.handleCollapseChange(r.DownloadKernel.CategroyViewID.Recycle)
        }

        selectAll() {
            let e = [], t = null;
            switch (this.currentCategoryViewId) {
                case r.DownloadKernel.CategroyViewID.Downloading:
                    t = this.UPDATE_DOWNLOADING_SELECTED_TASKS, e = [...this.downloadingTaskList];
                    break;
                case r.DownloadKernel.CategroyViewID.Completed:
                    t = this.UPDATE_COMPLETED_SELECTED_TASKS, e = [...this.completedFilterTaskList];
                    break;
                case r.DownloadKernel.CategroyViewID.Recycle:
                    t = this.UPDATE_RECYCLE_SELECTED_TASKS, e = [...this.recycleTaskList]
            }
            e.length > 0 && null !== t && t(e)
        }

        moveUp() {
            this.MOVE_TO_TOP(this.downloadingSelectedIndexs)
        }

        moveDown() {
            this.MOVE_TO_BOTTOM(this.downloadingSelectedIndexs)
        }

        handleMenuClick(e, ...t) {
            switch (e) {
                case"select_all":
                    this.selectAll();
                    break;
                case"move_up":
                    this.moveUp();
                    break;
                case"move_down":
                    this.moveDown()
            }
        }

        handleMenuPopup() {
        }

        handleMenuEnd() {
        }

        scrollToSpecified(e, t, n, i, a) {
            let o = n.indexOf(e);
            -1 !== o && (1 === i.length && i[0] === e ? this.$refs[t].scrollTo(o) : o <= this.$refs[t].getLoadedCount() - 1 ? a([e]) : (this.$refs[t].setLoadedCount(o + 1), this.$nextTick(() => {
                a([e])
            })))
        }

        selectTask(e, t) {
            void 0 !== t && (e === r.DownloadKernel.CategroyViewID.Downloading ? this.scrollToSpecified(t, "downloading", this.downloadingTaskList, this.downloadingSelectedIndexs, this.UPDATE_DOWNLOADING_SELECTED_TASKS) : e === r.DownloadKernel.CategroyViewID.Completed ? "全部" !== this.completedFilter ? (this.completedListRestore(), this.$nextTick(() => {
                this.scrollToSpecified(t, "completed", this.completedTaskList, this.completedSelectedTaskIndexs, this.UPDATE_COMPLETED_SELECTED_TASKS)
            })) : this.scrollToSpecified(t, "completed", this.completedTaskList, this.completedSelectedTaskIndexs, this.UPDATE_COMPLETED_SELECTED_TASKS) : e === r.DownloadKernel.CategroyViewID.Recycle && this.scrollToSpecified(t, "dustbin", this.recycleTaskList, this.recycleSelectedTaskIndexs, this.UPDATE_RECYCLE_SELECTED_TASKS))
        }

        created() {
            this.attachTaskEvent(), d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd)
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) {
                    e = !0;
                    break
                }
                if (this.downloadingSelectedIndexs.length > 0) {
                    e = !1;
                    break
                }
                e = !0;
                for (let t of this.downloadingTaskBaseList) if (t.taskStatus === r.DownloadKernel.TaskStatus.StartPending || t.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                this.SORT_CATEGORY_HISTORY(), 0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed)
            })
        }

        handleKeyDown(e) {
            if (e.ctrlKey && 68 === e.keyCode) this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos); else if (e.ctrlKey && 83 === e.keyCode) this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos, r.DownloadKernel.TaskStopReason.ContextMenu); else if (e.ctrlKey && 69 === e.keyCode) 1 === this.currentSelectdTaskInfos.length && (u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0]).catch(e => {
                S.warning(e)
            }), this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(this.currentSelectdTaskInfos, 1)); else if (e.ctrlKey && 82 === e.keyCode) this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.recoverTask(this.currentSelectdTaskInfos); else if (e.ctrlKey && 13 === e.keyCode && (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle || this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Completed) && 1 === this.currentSelectdTaskInfos.length) {
                let e = this.currentSelectdTaskInfos[0].taskStatus;
                if (e === r.DownloadKernel.TaskStatus.Succeeded || e === r.DownloadKernel.TaskStatus.Seeding) {
                    let e = "";
                    if (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Completed ? e = "finished" : this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), this.currentSelectdTaskInfos[0].taskType === r.DownloadKernel.TaskType.Bt) {
                        let e = C.getTaskFromTaskId(this.currentSelectdTaskInfos[0].taskId);
                        T.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                            e ? u.TaskOperatorNs.openTaskItem(this.currentSelectdTaskInfos[0]).catch() : u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0], !0).catch()
                        }).catch()
                    } else if (this.currentSelectdTaskInfos[0].taskType === r.DownloadKernel.TaskType.Group) {
                        let e = C.getTaskFromTaskId(this.currentSelectdTaskInfos[0].taskId);
                        u.TaskOperatorNs.executeInstallFile(e).then(e => {
                            e || u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0], !0).catch()
                        }).catch()
                    } else u.TaskOperatorNs.openTaskItem(this.currentSelectdTaskInfos[0], void 0, void 0, e, this.currentCategoryId).catch(e => {
                        S.warning(e)
                    });
                    this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(this.currentSelectdTaskInfos, 1)
                }
            }
        }

        mounted() {
            this.statusChangedEventId = v.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (S.error("StatusChanged groupId:", t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId), ", status:", t[0].getTaskStatus()), t.length > 0) {
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            let e = this.shouldChange2Complete(), t = this.shouldChangeCompleteSelect();
                            e && setTimeout(() => {
                                this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed), t && this.UPDATE_COMPLETED_SELECTED_TASKS([this.completedTaskList[0]])
                            }, 0)
                        })
                    }
                } while (0)
            }), C.isLoadStorageTaskFinish() ? (this.bLoadDbFinish = !0, this.INIT_CATEGORY_TASKLIST()) : (this.dataBaseLoadCookie = 0, g.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.insertToCategoryViewEventId = v.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], a = e[4], o = i.map(e => e.getTaskBaseInfo());
                    this.INSERT_TO_CATEGORY_VIEW({
                        id: n,
                        categoryId: t,
                        tasks: o
                    }), this.bLoadDbFinish && n === r.DownloadKernel.CategroyViewID.Downloading && (a === r.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                        if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), this.$nextTick(() => {
                            setTimeout(() => {
                                let e = this.downloadingTaskList[0];
                                this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                            }, 0)
                        }); else {
                            let e = this.downloadingTaskList[0];
                            this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                        }
                    }))
                } while (0)
            })
        }

        destroyed() {
            d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd), void 0 !== this.insertToCategoryViewEventId && v.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.statusChangedEventId && v.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, g.DownloadKernelManager.detachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd))
        }
    };
    i([a.Prop({})], y.prototype, "currentTabId", void 0), i([a.Prop({})], y.prototype, "currentCategoryId", void 0), i([a.Prop({})], y.prototype, "currentCategoryViewId", void 0), i([a.Prop({})], y.prototype, "downloadingTaskList", void 0), i([a.Prop({})], y.prototype, "downloadingTaskBaseList", void 0), i([a.Prop({})], y.prototype, "completedTaskList", void 0), i([a.Prop({})], y.prototype, "completedTaskBaseList", void 0), i([a.Prop({})], y.prototype, "recycleTaskList", void 0), i([a.Prop({})], y.prototype, "recycleTaskBaseList", void 0), i([a.Prop({})], y.prototype, "downloadingSelectedIndexs", void 0), i([a.Prop({})], y.prototype, "completedSelectedTaskIndexs", void 0), i([a.Prop({})], y.prototype, "recycleSelectedTaskIndexs", void 0), i([a.Prop({})], y.prototype, "currentSelectdTaskInfos", void 0), i([a.Prop({})], y.prototype, "canStartAll", void 0), i([a.Prop({})], y.prototype, "UPDATE_CATEGORY", void 0), i([a.Prop({})], y.prototype, "UPDATE_CATEGORYVIEW", void 0), i([a.Prop({})], y.prototype, "SORT_CATEGORY_HISTORY", void 0), i([a.Prop({})], y.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), i([a.Prop({})], y.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), i([a.Prop({})], y.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), i([a.Prop({})], y.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), i([a.Prop({})], y.prototype, "MOVE_TO_TOP", void 0), i([a.Prop({})], y.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), i([a.Prop({})], y.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), i([a.Prop({})], y.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), i([a.Prop({})], y.prototype, "MOVE_TO_BOTTOM", void 0), i([a.Prop({})], y.prototype, "INIT_CATEGORY_TASKLIST", void 0), i([a.Prop({})], y.prototype, "INSERT_TO_CATEGORY_VIEW", void 0), i([a.Prop({})], y.prototype, "UPDATE_TASK_STATUS", void 0), i([a.Prop({})], y.prototype, "attachTaskEvent", void 0), i([a.Prop({})], y.prototype, "selectTab", void 0), i([a.Watch("currentCategoryId")], y.prototype, "onCategoryChange", null), i([a.Watch("currentCategoryViewId")], y.prototype, "onCategoryViewChange", null), i([a.Watch("completedTaskList")], y.prototype, "onCompletedTaskListChange", null), i([a.Watch("completedFilter")], y.prototype, "onCompletedFilterChange", null), y = i([a.Component({components: {DownloadCategory: l.default}})], y), t.default = y
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(363), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(1), r = n(8), s = n(915), l = n(921), u = n(923), d = n(74), c = n(23), h = n(32), f = n(78),
        g = o.default.getLogger("DownloadCategory"), p = h.DownloadKernelTaskManager.getTaskManager();
    let k = class extends a.Vue {
        constructor() {
            super(...arguments), this.loadedIndex = 0, this.deleted = {}, this.opened = {}
        }

        get taskCount() {
            return this.tasklist.length
        }

        get loadedList() {
            let e = this.loadedIndex + 20;
            return e > this.taskCount && (e = this.taskCount), g.information("load more", e), this.tasklist.slice(0, e)
        }

        get loadedListWithKey() {
            return this.loadedList.map(e => Object.assign({
                key: e,
                template: {class: {"is-deleted": this.deleted[e], "is-opened": this.opened[e]}}
            }))
        }

        onLoadedListChanged(e) {
            e.forEach(e => {
                this.$set(this.deleted, String(e), e in this.deleted && this.deleted[e]), this.$set(this.opened, String(e), e in this.opened && this.opened[e])
            })
        }

        getLoadedCount() {
            return this.loadedIndex
        }

        setLoadedCount(e) {
            e > this.taskCount && (e = this.taskCount), this.loadedIndex = e
        }

        loadMore(e) {
            this.loadedIndex + 20 > this.taskCount ? this.loadedIndex = this.taskCount : this.loadedIndex += 20, e()
        }

        handleSelectChange(e) {
            this.COMMIT_SELECT(e)
        }

        handleListChange(e) {
            const t = e.map(e => {
                let t = Object.assign({}, e);
                return delete t.template, t.key
            });
            this.COMMIT_UPDATE_TASKLIST(t)
        }

        handleItemDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleContextMenu(e) {
            this.$emit("contextmenu", e)
        }

        handleCancleActive(e) {
            g.information("receive eventShowHomePage", e);
            let t = p.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId);
                e !== r.DownloadKernel.CategroyViewID.Unkown && e === this.currentCategoryViewId && this.COMMIT_SELECT([])
            }
        }

        handleActiveChange(e, t) {
            e && this.$nextTick(() => {
                this.scrollTo(t)
            })
        }

        handleActiveNearby(e) {
            do {
                if (0 === this.taskCount) break;
                if (e > this.taskCount) break;
                e <= this.taskCount - 1 ? this.COMMIT_SELECT([this.tasklist[e]]) : this.COMMIT_SELECT([this.tasklist[e - 1]])
            } while (0)
        }

        scrollTo(e) {
            let t = this.$el, n = t.querySelectorAll(".td-draglist-item"), i = void 0,
                a = document.querySelector("#app");
            void 0 !== a && null !== a && (i = -1 === this.currentCategoryId ? a.clientHeight - 249 : a.clientHeight - 224);
            do {
                if (null === n || void 0 === n || 0 === n.length) break;
                if (e < 0) break;
                if (e > n.length - 1) break;
                let a = 0, o = 0;
                for (let t of n) {
                    if (o === e) break;
                    a += 1, t.classList.contains("v-leave") || (o += 1)
                }
                a === n.length && (a -= 1);
                let r = n[a];
                g.information("scroll index & realIndex", e, a), f.ThunderWindowNS.autoAdaptScrollIntoView(r, t, i)
            } while (0)
        }

        mounted() {
            d.default.attachListener(c.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive)
        }

        destroyed() {
            d.default.detachListener(c.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive)
        }
    };
    i([a.Prop({})], k.prototype, "pulseForRename", void 0), i([a.Prop({default: ""})], k.prototype, "sharedKeyWords", void 0), i([a.Prop({})], k.prototype, "itemType", void 0), i([a.Prop({})], k.prototype, "currentCategoryId", void 0), i([a.Prop({})], k.prototype, "currentCategoryViewId", void 0), i([a.Prop({})], k.prototype, "componentName", void 0), i([a.Prop({})], k.prototype, "tasklist", void 0), i([a.Prop({})], k.prototype, "selectedTaskIds", void 0), i([a.Prop({default: !0})], k.prototype, "sortable", void 0), i([a.Prop({})], k.prototype, "COMMIT_SELECT", void 0), i([a.Prop({})], k.prototype, "COMMIT_UPDATE_TASKLIST", void 0), i([a.Watch("loadedList", {immediate: !0})], k.prototype, "onLoadedListChanged", null), k = i([a.Component({
        components: {
            DownloadingItemContainer: s.default,
            CompletedItemContainer: l.default,
            RecycleItemContainer: u.default
        }
    })], k), t.default = k
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(365), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(916), a = n(54), o = n(8);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let n = null, i = t.taskId;
                if (-1 === t.currentCategoryId) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Downloading) {
                        n = e.DownloadListState.taskList[t].tasksMap[i];
                        break
                    }
                } else for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Downloading && (n = e.DownloadListState.taskListPrivate[t].tasksMap[i]);
                return n
            }
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(367), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1201);
    const o = n(4), r = n(8), s = n(32), l = n(12), u = n(146), d = n(58), c = n(148), h = n(23), f = n(85), g = n(74),
        p = n(13), k = n(280), m = n(34), T = n(134), v = n(6), C = n(286), S = n(588), y = n(587), w = n(1),
        I = n(749), b = m.DownloadKernelEventManager.getEventManager(),
        A = s.DownloadKernelTaskManager.getTaskManager(), N = C.GroupAccelerateManagerNS.getManager(),
        D = S.GroupAccelerateWebManagerNS.getManager(), _ = y.GroupAccelerateEventManagerNS.getEventManager(),
        x = w.default.getLogger("DownloadPanel.DownloadingItem");
    let E = class extends o.Vue {
        constructor() {
            super(...arguments), this.btSubDetailCookie = -1, this.groupTaskStatusCookie = -1, this.vipTaskInfo = null, this.hover = !1, this.titleOverFlow = "", this.subTaskCount = 0, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.percentVisible = !1, this.isShowGroupAccelerate = !1, this.isAccelerated = !1, this.groupAccelerateIconTitle = "组队加速", this.checkGroupAccelerateTimer = void 0, this.isQuerying = !1, this.startStatusPrompt = void 0, this.groupAccelerateJoinTeamListener = null, this.groupAccelerateExitTeamListener = null, this.groupAccelerateReceiveGcidListener = null, this.groupAccelerateTaskSpeedChangeListener = null, this.groupAccelerateTeamInfoUpdatedListener = null
        }

        onChosenChanged(e) {
            e && (this.percentVisible = !1)
        }

        onOptionsChanged(e, t) {
            this.active && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, e === r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, this.$el)
        }

        onKeyWordsChange(e, t) {
            this.highLight = l.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = l.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        get subTaskCountDesc() {
            return this.subTaskCount > 999 ? "999+文件" : this.subTaskCount + "个文件"
        }

        onActiveChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                if ("search" !== this.itemType && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, this.active, this.taskBase.taskId, this.$el), e && (this.percentVisible = !1), this.$emit("active-change", e), e) {
                    let e = !1;
                    do {
                        if (this.taskStatus === r.DownloadKernel.TaskStatus.Failed) break;
                        if (this.active) {
                            let t = N.getTaskUniqueIdByTaskId(this.taskId);
                            e = t && "" !== t
                        }
                    } while (0);
                    this.isShowGroupAccelerate = e;
                    let t = !1;
                    if (this.attachGroupAccelerateEvent(), this.isShowGroupAccelerate) {
                        let e = N.getTaskUniqueIdByTaskId(this.taskId);
                        e && "" !== e && (t = N.isEnterGroupAccelerate(this.taskId))
                    }
                    this.isAccelerated = t
                } else this.isShowGroupAccelerate = !1, this.detachGroupAccelerateEvent()
            })
        }

        onShowGroupAccelerate(e, t) {
            e && this.isAccelerated ? this.checkGroupAccelerateTimer = setInterval(() => {
                N.updateTaskAccelerateInfo(this.taskId)
            }, 6e4) : this.checkGroupAccelerateTimer && (clearTimeout(this.checkGroupAccelerateTimer), this.checkGroupAccelerateTimer = void 0)
        }

        updateGroupAccelerateIconTitle() {
            let e = "组队加速";
            do {
                let t = N.getTaskUniqueIdByTaskId(this.taskId);
                if (!t || "" === t) break;
                let n = N.getTaskGroupInfo(t);
                if (!n) break;
                let i = 0;
                e = "共" + (i = v.isNumber(n.memberCount) ? n.memberCount : 1) + "个队友";
                let a = n.currentIncreaseSpeed;
                v.isNumber(a) || (a = 0);
                let o = "0B";
                a > 0 && (o = l.ThunderUtil.formatSize(a)), e = e + "，加速" + o + "/s", x.information("updateGroupAccelerateIconTitle currentIncreaseSpeed:", a, ", title: ", e)
            } while (0);
            this.groupAccelerateIconTitle = e
        }

        onTaskIdChanged(e, t) {
            void 0 !== t && (this.unInitialize(), this.initialize())
        }

        get taskError() {
            return this.taskBase.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        get isForbidden() {
            let e = !1;
            do {
                if (this.taskError) {
                    let t = 0, n = A.getTaskFromTaskId(this.taskBase.taskId);
                    if (null !== n && (t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), 7 === t) {
                        e = !0;
                        break
                    }
                    if (t >= 700 && t <= 799) {
                        e = !0;
                        break
                    }
                }
            } while (0);
            return e
        }

        get errInfo() {
            let e = "";
            if (this.taskError) {
                let t = 0, n = A.getTaskFromTaskId(this.taskBase.taskId);
                null !== n && (t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), e = c.TaskStatusHelper.getTaskErrorInfoByCode(t)
            }
            return e
        }

        handleFileCountClick() {
            this.active ? g.default.fireEvent(h.NodeEventMesssageNS.eventDetailSwitch2Index, this.taskBase.taskId, k.DetailIndex.FileList) : g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, !0, this.taskBase.taskId, this.$el, void 0, k.DetailIndex.FileList)
        }

        handleItemMouseOut() {
            this.percentVisible = !1, this.hover = !1
        }

        handleItemMouseHover() {
            this.hover = !0;
            do {
                if (this.chosen) {
                    this.percentVisible = !1;
                    break
                }
                if (this.active) {
                    this.percentVisible = !1;
                    break
                }
                this.percentVisible = !0;
                break
            } while (0)
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, n = t.scrollHeight, i = t.offsetHeight;
            this.titleOverFlow = n > i ? this.taskBase.taskName : ""
        }

        get fileTypeClass() {
            return d.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType)
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.taskError) break;
                if (this.taskBase.isMoving) break;
                let t = A.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSize() {
            return this.taskBase.fileSize
        }

        get fileSizeFormat() {
            return l.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get downloadSize() {
            return this.taskBase.downloadSize
        }

        get downloadSizeFormat() {
            return l.ThunderUtil.formatSize(this.taskBase.downloadSize)
        }

        get progress() {
            let e = 0;
            return 0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), 100 * e
        }

        get progressPercent() {
            let e = 0;
            0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), e >= 1 && (e = .9999);
            let t = (100 * e).toFixed(2) + "%";
            return "100.00%" === t && (t = "99.99%"), t
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get taskStatusSpeedInfo() {
            let e = "", t = c.TaskStatusHelper.getTaskStatusPrompt(this.taskBase);
            if (this.startStatusPrompt = c.TaskStatusHelper.getTaskStartStatusPrompt(this.taskBase), void 0 !== t || void 0 !== this.startStatusPrompt) "完成" === (e = void 0 !== this.startStatusPrompt ? this.startStatusPrompt : t) && (e = ""), "暂停" === e && (e = "已暂停"); else {
                let t = this.taskBase.downloadSpeed;
                e = l.ThunderUtil.formatSize(t, 1) + "/s"
            }
            return e
        }

        get taskType() {
            return this.taskBase.taskType
        }

        get showStartTemplate() {
            let e = !1;
            return this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StopPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.Started || (e = !0), e
        }

        get canStart() {
            let e = !1;
            do {
                if (this.taskBase.isMoving) break;
                e = !this.canPause
            } while (0);
            return e
        }

        get canPause() {
            let e = !1;
            return this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartWaiting && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.Started || (e = !0), e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === r.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === r.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get vipSpeed() {
            return "+" + l.ThunderUtil.formatSize(this.taskBase.vipSpeed, 1) + "/s"
        }

        get remain() {
            let e = "--:--:--";
            if (!this.hover || this.chosen || this.active) {
                if (this.taskBase.downloadSpeed > 0 && this.taskBase.fileSize > 0) {
                    let t = this.taskBase.fileSize - this.taskBase.downloadSize;
                    if (t > 0) {
                        let n = t / this.taskBase.downloadSpeed;
                        e = u.TimeHelperNS.formatSeconds(n)
                    }
                }
            } else e = this.progressPercent;
            return e
        }

        get isShowExpand() {
            return this.taskStatus !== r.DownloadKernel.TaskStatus.Failed && this.active
        }

        get isSuperVip() {
            return !!this.vipTaskInfo && (this.vipTaskInfo.isShowSuperSpeed && this.vipTaskInfo.isAcclerated)
        }

        onShowQueryTip(e) {
            if (e) {
                let e = I.QueryTaskInfoNS.getQueryTaskId();
                this.isQuerying = e === this.taskBase.taskId
            } else this.isQuerying = !1
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handlePlayTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "bianxiabianbo_click", "", 0, 0, 0, 0, this.statExtData()), A.getTaskFromTaskId(this.taskBase.taskId) && f.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "bianxiabianbo", "downloading", this.currentCategoryId).catch()
        }

        handleStartTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_continue_click", "", 0, 0, 0, 0, this.statExtData()), T.DownloadDispatchNS.startTask(this.taskBase.taskId)
        }

        handlePauseTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_pause_click", "", 0, 0, 0, 0, this.statExtData()), A.stopTask(this.taskBase.taskId, r.DownloadKernel.TaskStopReason.Button)
        }

        handleDestroyTask() {
            f.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleVipTaskInfo(e) {
            this.vipTaskInfo = e
        }

        handleGroupAccelerateClick() {
            D.openGroupAccelerateTabByTaskId(this.taskId, "icon", "downloading", void 0).catch()
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                if (e[1] === this.taskBase.taskId) {
                    let e = A.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile();
                    e.length !== this.subTaskCount && (this.subTaskCount = e.length)
                }
            } while (0)
        }

        onGroupTaskStatusChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                let t = e[1];
                if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                for (let e = 0; e < t.length; e++) {
                    let n = t[e];
                    if (n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId) === this.taskId) {
                        let e = n.getExtraObject();
                        this.subTaskCount = e.getDownloadTaskCount();
                        break
                    }
                }
            } while (0)
        }

        attachGroupAccelerateEvent() {
            x.information("attachGroupAccelerateEvent"), this.groupAccelerateJoinTeamListener || (this.groupAccelerateJoinTeamListener = ((e, t) => {
                x.information("OnJoinTeam taskId:", e, ", this.taskId", this.taskId, ", taskUniqueId:", t), e === this.taskId && (this.isAccelerated = !0)
            }), _.on(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, this.groupAccelerateJoinTeamListener)), this.groupAccelerateExitTeamListener || (this.groupAccelerateExitTeamListener = ((e, t) => {
                x.information("OnExitTeam taskId:", e, ", this.taskId", this.taskId, ", taskUniqueId:", t), e === this.taskId && (this.isAccelerated = !1)
            }), _.on(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, this.groupAccelerateExitTeamListener)), this.groupAccelerateReceiveGcidListener || (this.groupAccelerateReceiveGcidListener = ((e, t) => {
                x.information("OnGroupAccelerateReceiveGcid taskId:", e, ", this.taskId", this.taskId, ", taskUniqueId:", t), e === this.taskId && (this.isShowGroupAccelerate = !0)
            }), _.on(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, this.groupAccelerateReceiveGcidListener)), this.groupAccelerateTaskSpeedChangeListener || (this.groupAccelerateTaskSpeedChangeListener = ((e, t, n, i, a) => {
                x.information("OnGroupAccelerateTaskSpeedChange taskId:", e, ", this.taskId", this.taskId, ", increaseSpeed:", n), this.taskId
            }), _.on(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, this.groupAccelerateTaskSpeedChangeListener)), this.groupAccelerateTeamInfoUpdatedListener || (this.groupAccelerateTeamInfoUpdatedListener = (() => {
            }), _.on(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated, this.groupAccelerateTeamInfoUpdatedListener))
        }

        detachGroupAccelerateEvent() {
            x.information("detachGroupAccelerateEvent"), this.groupAccelerateJoinTeamListener && (_.removeListener(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, this.groupAccelerateJoinTeamListener), this.groupAccelerateJoinTeamListener = null), this.groupAccelerateExitTeamListener && (_.removeListener(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, this.groupAccelerateExitTeamListener), this.groupAccelerateExitTeamListener = null), this.groupAccelerateReceiveGcidListener && (_.removeListener(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, this.groupAccelerateReceiveGcidListener), this.groupAccelerateReceiveGcidListener = null), this.groupAccelerateTaskSpeedChangeListener && (_.removeListener(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, this.groupAccelerateTaskSpeedChangeListener), this.groupAccelerateTaskSpeedChangeListener = null), this.groupAccelerateTeamInfoUpdatedListener && (_.removeListener(y.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated, this.groupAccelerateTeamInfoUpdatedListener), this.groupAccelerateTeamInfoUpdatedListener = null)
        }

        initialize() {
            return a(this, void 0, void 0, function* () {
                if (this.taskBase.taskType === r.DownloadKernel.TaskType.Bt) {
                    this.btSubDetailCookie = b.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.onBtSubFileDetailChanged);
                    let e = A.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile();
                    this.subTaskCount = e.length
                } else if (this.taskBase.taskType === r.DownloadKernel.TaskType.Group) {
                    this.groupTaskStatusCookie = b.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.onGroupTaskStatusChanged);
                    let e = A.getTaskFromTaskId(this.taskBase.taskId).getExtraObject();
                    this.subTaskCount = e.getDownloadTaskCount()
                }
            })
        }

        unInitialize() {
            return a(this, void 0, void 0, function* () {
                -1 !== this.btSubDetailCookie && (b.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.btSubDetailCookie), this.btSubDetailCookie = -1), -1 !== this.groupTaskStatusCookie && (b.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.groupTaskStatusCookie), this.groupTaskStatusCookie = -1), this.detachGroupAccelerateEvent(), this.checkGroupAccelerateTimer && (clearTimeout(this.checkGroupAccelerateTimer), this.checkGroupAccelerateTimer = void 0)
            })
        }

        created() {
            this.initialize()
        }

        destroyed() {
            this.unInitialize(), this.active && (g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, !1, this.taskBase.taskId, this.$el), g.default.getNeedSelectNext() && (g.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index)))
        }
    };
    i([o.Prop({})], E.prototype, "pulseForRename", void 0), i([o.Prop({default: ""})], E.prototype, "sharedKeyWords", void 0), i([o.Prop({})], E.prototype, "itemType", void 0), i([o.Prop({})], E.prototype, "index", void 0), i([o.Prop({})], E.prototype, "taskId", void 0), i([o.Prop({})], E.prototype, "taskBase", void 0), i([o.Prop({})], E.prototype, "currentCategoryId", void 0), i([o.Prop({})], E.prototype, "currentCategoryViewId", void 0), i([o.Prop()], E.prototype, "chosen", void 0), i([o.Prop()], E.prototype, "active", void 0), i([o.Watch("chosen")], E.prototype, "onChosenChanged", null), i([o.Watch("currentCategoryViewId")], E.prototype, "onOptionsChanged", null), i([o.Watch("sharedKeyWords", {immediate: !0})], E.prototype, "onKeyWordsChange", null), i([o.Watch("pulseForRename", {immediate: !0})], E.prototype, "onRenamePulse", null), i([o.Watch("active")], E.prototype, "onActiveChanged", null), i([o.Watch("isShowGroupAccelerate", {immediate: !0})], E.prototype, "onShowGroupAccelerate", null), i([o.Watch("taskId", {immediate: !0})], E.prototype, "onTaskIdChanged", null), E = i([o.Component({
        components: {
            ItemVipExpand: () => Promise.resolve().then(() => n(917)),
            ItemVipSpeed: () => Promise.resolve().then(() => n(920))
        }, watch: {}
    })], E), t.default = E
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(369), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(129), s = n(68), l = n(918), u = n(919);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.isVip = !1, this.authority = !1, this.taskUIStatus = "Init", this.btErrorType = "", this.taskInfo = null
        }

        onTaskIdChanged(e) {
            this.loadTaskInfo()
        }

        get isTry() {
            return !!this.taskInfo && this.taskInfo.taskType === r.VipDownloadDefineNS.VipTaskType.Try
        }

        transTaskUIStatus(e) {
            let t = "Init";
            switch (e) {
                case r.VipDownloadDefineNS.VipTaskStatus.Init:
                    t = "Init";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.CommitWait:
                case r.VipDownloadDefineNS.VipTaskStatus.Commiting:
                case r.VipDownloadDefineNS.VipTaskStatus.CommitSuccess:
                case r.VipDownloadDefineNS.VipTaskStatus.AcclerateWait:
                    t = "Wait";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped:
                    t = "Stoped";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    t = "Started";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.SearchResource:
                    t = "Search";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                case r.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    t = "Failed";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.Finished:
                    t = "Finished"
            }
            return t
        }

        loadTaskInfo() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                let t = e.getVipTaskInfo(this.taskId);
                this.onVipTaskInfoChanged(this.taskId, t)
            })
        }

        loadUserInfo() {
            this.onUserAuthorityChanged()
        }

        onVipTaskInfoChanged(e, t) {
            if (e === this.taskId) {
                let e = t ? t.taskStatus : void 0;
                this.taskUIStatus = this.transTaskUIStatus(e), this.taskInfo = t
            }
        }

        onBtSubFileForbidden(e, t) {
            e === this.taskId && (this.btErrorType = t || "Error")
        }

        onUserAuthorityChanged(e) {
            this.isVip = s.UserHelperNS.getHelper().isVip, this.authority = s.UserHelperNS.getHelper().authority
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.attachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), e.attachTaskEvent("OnBtSubFileForbidden", this.onBtSubFileForbidden), s.UserHelperNS.getHelper().attachListener(s.UserEventNS.authorityChanged, this.onUserAuthorityChanged), this.loadTaskInfo(), this.loadUserInfo()
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.detachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), e.detachTaskEvent("OnBtSubFileForbidden", this.onBtSubFileForbidden), s.UserHelperNS.getHelper().detachListener(s.UserEventNS.authorityChanged, this.onUserAuthorityChanged)
            })
        }
    };
    i([o.Prop({})], d.prototype, "taskId", void 0), i([o.Prop({})], d.prototype, "visible", void 0), i([o.Watch("taskId")], d.prototype, "onTaskIdChanged", null), d = i([o.Component({
        components: {
            ItemVipStatus: l.default,
            ItemTryStatus: u.default
        }
    })], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(371), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(56);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.sceneItem = null, this.vipBtnType = -1
        }

        onAuthorityChange() {
            this.updateVipBtn().catch()
        }

        onTaskUIStatusChange() {
            this.updateVipBtn().catch()
        }

        onVisibleChange() {
            this.updateVipBtn().catch()
        }

        updateVipBtn() {
            return a(this, void 0, void 0, function* () {
                if (!this.visible) return;
                let e = !1;
                if (this.isVip || (e = "Init" === this.taskUIStatus), e) {
                    this.vipBtnType = this.authority ? 0 : 1;
                    const {VipStatNS: e} = yield Promise.resolve().then(() => n(283));
                    e.vipButtonShow(this.taskId, 1 === this.vipBtnType, "task")
                } else this.vipBtnType = -1
            })
        }

        clickErrorScenceText() {
            r.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", this.taskId, "files")
        }

        clickVipButton() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.clickVipAcclerateBtn(this.taskId, !1, "task")
            })
        }

        clickSuperVipButton() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.clickVipAcclerateBtn(this.taskId, !0, "task")
            })
        }

        get isSuper() {
            return !!this.taskInfo && this.taskInfo.isSuper
        }

        get isSuperStarted() {
            return !(!this.isSuper || "Started" !== this.taskUIStatus)
        }

        get errorSceneText() {
            let e = "部分文件无法下载，点击查看";
            return "Forbidden" === this.btErrorType && (e = "含有敏感资源，部分文件无法下载"), e
        }

        get isErrorScene() {
            return !(!this.btErrorType || "" === this.btErrorType)
        }

        get taskStatusText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Wait":
                    e = "加速准备中";
                    break;
                case"Started":
                    e = this.isSuper ? "超级加速已开启" : "会员已加速";
                    break;
                case"Stoped":
                    this.taskInfo && this.taskInfo.isAcclerated && (e = "加速暂停中");
                    break;
                case"Search":
                    e = "正在查找资源";
                    break;
                case"Failed":
                    e = this.taskErrorText
            }
            return e
        }

        get taskErrorText() {
            let e = "文件无法加速";
            return this.taskInfo && this.taskInfo.error && this.taskInfo.error.message && (e = this.taskInfo.error.message), e
        }

        get showFailed() {
            return "Failed" === this.taskUIStatus
        }

        loadTaskScene() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                let t = e.getSceneItem(this.taskId);
                yield this.onTaskSceneChanged(this.taskId, t)
            })
        }

        onTaskSceneChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                if (e === this.taskId && (this.sceneItem = t, t)) {
                    const {SceneStatNS: i} = yield Promise.resolve().then(() => n(733));
                    i.scenceShow(e, t)
                }
            })
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                this.loadTaskScene(), e.attachSceneEvent("OnTaskSceneChanged", this.onTaskSceneChanged), yield this.updateVipBtn()
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.detachSceneEvent("OnTaskSceneChanged", this.onTaskSceneChanged)
            })
        }
    };
    i([o.Prop({})], s.prototype, "taskId", void 0), i([o.Prop({})], s.prototype, "taskUIStatus", void 0), i([o.Prop({})], s.prototype, "isVip", void 0), i([o.Prop({})], s.prototype, "authority", void 0), i([o.Prop({})], s.prototype, "btErrorType", void 0), i([o.Prop({})], s.prototype, "taskInfo", void 0), i([o.Prop({})], s.prototype, "visible", void 0), i([o.Watch("authority")], s.prototype, "onAuthorityChange", null), i([o.Watch("taskUIStatus")], s.prototype, "onTaskUIStatusChange", null), i([o.Watch("visible")], s.prototype, "onVisibleChange", null), s = i([o.Component({})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(373), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(232);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.progress = 0, this.remainSize = 0
        }

        clickVipButton() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                switch (this.taskUIStatus) {
                    case"Init":
                        e.clickTryAcclerateBtn(this.taskId, "task");
                        break;
                    default:
                        e.clickTryOpenVipBtn(this.taskId, this.taskUIStatus, this.isSuper)
                }
            })
        }

        get isSuper() {
            return !!this.taskInfo && this.taskInfo.isSuper
        }

        get pluginVipClass() {
            return this.isSuper ? "xlx-plugin-vip--super" : "xlx-plugin-vip--ordinary"
        }

        get taskStatusText() {
            return this.isSuper ? this.superStatusText : this.normalStatusText
        }

        get normalStatusText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "恭喜获得一次免费会员试用资格";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                    e = "剩余试用加速流量：" + this.remainSizeFormat;
                    break;
                case"Failed":
                    e = "对不起，进入试用失败";
                    break;
                case"Finished":
                    e = "试用结束，开通会员加速不限时"
            }
            return e
        }

        get superStatusText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "试用超级会员，享用超级加速";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                    if (this.taskInfo && this.taskInfo.careKuaiNiao) if (this.taskInfo.showKuaiNiao) {
                        e = `快鸟已帮您将宽带提升至${r.KuainiaoManagerNS.getManager().downstreamString}`
                    } else e = "超级加速等待中"; else e = "超级加速中，剩余流量：" + this.remainSizeFormat;
                    break;
                case"Failed":
                    e = "超级加速失败";
                    break;
                case"Finished":
                    e = this.isVip ? "试用结束，立即升级为超级会员" : "试用结束，立即开通为超级会员"
            }
            return e
        }

        get buttonText() {
            return this.isSuper ? this.superButtonText : this.normalButtonText
        }

        get normalButtonText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "试用加速";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                    e = "会员无限加速";
                    break;
                case"Failed":
                case"Finished":
                    e = "开通会员"
            }
            return e
        }

        get superButtonText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "试用超会";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                case"Failed":
                case"Finished":
                    e = this.isVip ? "升级超会" : "开通超会"
            }
            return e
        }

        get showTrying() {
            return (!this.taskInfo || !this.taskInfo.careKuaiNiao) && ("Wait" === this.taskUIStatus || "Stoped" === this.taskUIStatus || "Started" === this.taskUIStatus)
        }

        get isNormal() {
            let e = !1;
            return this.isSuper && (e = "Finished" === this.taskUIStatus || "Failed" === this.taskUIStatus), e
        }

        get isError() {
            return "Failed" === this.taskUIStatus
        }

        get remainSizeFormat() {
            return this.formatSize(this.remainSize)
        }

        get progressPercent() {
            return (100 * (1 - this.progress)).toFixed(2) + "%"
        }

        formatSize(e) {
            let t = "0B";
            if ("number" == typeof e && e > 0) {
                let n = ["B", "K", "M", "G", "T"], i = 0, a = e;
                for (; a >= 1024 && !(i >= 4);) a /= 1024, i += 1;
                t = a.toFixed(2) + n[i]
            }
            return t
        }

        onTaskTryDetailChanged(e, t) {
            e === this.taskId && (this.remainSize = t.remainSize, this.progress = t.progress)
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.attachTaskEvent("OnTaskTryDetailChanged", this.onTaskTryDetailChanged)
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.detachTaskEvent("OnTaskTryDetailChanged", this.onTaskTryDetailChanged)
            })
        }
    };
    i([o.Prop({})], s.prototype, "taskId", void 0), i([o.Prop({})], s.prototype, "taskUIStatus", void 0), i([o.Prop({})], s.prototype, "isVip", void 0), i([o.Prop({})], s.prototype, "taskInfo", void 0), s = i([o.Component({})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(375), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(8), s = n(12), l = n(129), u = n(68);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.isVip = !1, this.authority = !1, this.taskInfo = null
        }

        onActiveChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.onItemExpandChanged(this.taskId, this.active)
            })
        }

        onHoverChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                if ("Vip" === this.hoverType) {
                    const {VipStatNS: e} = yield Promise.resolve().then(() => n(283));
                    e.vipButtonShow(this.taskId, !1, "hover")
                } else if ("SuperVip" === this.hoverType) {
                    const {VipStatNS: e} = yield Promise.resolve().then(() => n(283));
                    e.vipButtonShow(this.taskId, !0, "hover")
                } else if ("Try" === this.hoverType) {
                    const {TryStatNS: e} = yield Promise.resolve().then(() => n(580));
                    e.tryButtonShow(this.taskId, "hover")
                } else if ("SuperTry" === this.hoverType) {
                    const {TryStatNS: e} = yield Promise.resolve().then(() => n(580));
                    e.superTryButtonShow(this.taskId, "hover")
                }
            })
        }

        clickVipLink() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                "Vip" === this.hoverType ? e.clickVipAcclerateBtn(this.taskId, !1, "hover") : "SuperVip" === this.hoverType ? e.clickVipAcclerateBtn(this.taskId, !0, "hover") : "Try" !== this.hoverType && "SuperTry" !== this.hoverType || e.clickTryAcclerateBtn(this.taskId, "hover")
            })
        }

        get taskId() {
            let e = void 0;
            return this.taskBase && (e = this.taskBase.taskId), e
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get isShowVipSpeed() {
            if (this.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                if (this.startStatusPrompt) return !1;
                if (this.taskInfo) return this.taskInfo.isShowVipSpeed
            }
            return !1
        }

        get isShowSuperSpeed() {
            return !this.taskInfo || this.taskInfo.isShowSuperSpeed
        }

        get vipSpeed() {
            return "+" + s.ThunderUtil.formatSize(this.taskBase.vipSpeed, 1) + "/s"
        }

        get isShowVipHover() {
            return void 0 !== this.hoverType
        }

        get isShowSuperHover() {
            return "SuperVip" === this.hoverType || "SuperTry" === this.hoverType
        }

        get hoverText() {
            let e = "";
            return "Vip" === this.hoverType ? e = "会员加速" : "Try" === this.hoverType ? e = "试用加速" : "SuperTry" === this.hoverType && (e = "超级试用"), e
        }

        get hoverType() {
            let e = void 0;
            if (this.active || !this.hover) return;
            let t = l.VipDownloadDefineNS.VipTaskStatus.Init;
            return this.taskInfo && (t = this.taskInfo.taskStatus), t === l.VipDownloadDefineNS.VipTaskStatus.Init ? e = this.taskInfo && this.taskInfo.taskType === l.VipDownloadDefineNS.VipTaskType.Try ? this.taskInfo.isSuper ? "SuperTry" : "Try" : !this.isVip && this.authority ? "Vip" : "SuperVip" : void 0
        }

        loadTaskInfo() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                let t = e.getVipTaskInfo(this.taskId);
                this.onVipTaskInfoChanged(this.taskId, t)
            })
        }

        loadUserInfo() {
            this.onUserAuthorityChanged()
        }

        onVipTaskInfoChanged(e, t) {
            e === this.taskId && (this.taskInfo = t, this.$emit("vip-taskinfo", t))
        }

        onUserAuthorityChanged(e) {
            this.isVip = u.UserHelperNS.getHelper().isVip, this.authority = e
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.attachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), u.UserHelperNS.getHelper().attachListener(u.UserEventNS.authorityChanged, this.onUserAuthorityChanged), this.loadTaskInfo(), this.loadUserInfo()
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
                e.detachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), u.UserHelperNS.getHelper().detachListener(u.UserEventNS.authorityChanged, this.onUserAuthorityChanged)
            })
        }
    };
    i([o.Prop({})], d.prototype, "taskBase", void 0), i([o.Prop({})], d.prototype, "startStatusPrompt", void 0), i([o.Prop({})], d.prototype, "active", void 0), i([o.Prop({})], d.prototype, "hover", void 0), i([o.Watch("active")], d.prototype, "onActiveChanged", null), i([o.Watch("hover")], d.prototype, "onHoverChanged", null), d = i([o.Component({components: {}})], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(377), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(922), a = n(54), o = n(8);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let n = null, i = t.taskId;
                if (-1 === t.currentCategoryId) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Completed) {
                        n = e.DownloadListState.taskList[t].tasksMap[i];
                        break
                    }
                } else for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Completed && (n = e.DownloadListState.taskListPrivate[t].tasksMap[i]);
                return n
            }
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(379), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(2), r = n(17), s = n(4), l = n(1), u = n(8), d = n(32), c = n(146), h = n(12), f = n(58), g = n(195),
        p = n(85), k = n(23), m = n(13), T = n(280), v = n(74), C = n(33), S = n(28), y = n(245), w = n(10), I = n(132),
        b = l.default.getLogger("Thunder.Download.Completed"), A = d.DownloadKernelTaskManager.getTaskManager();
    let N = class extends s.Vue {
        constructor() {
            super(...arguments), this.titleOverFlow = "", this.lastFullFileName = void 0, this.fileTypeClass = "", this.isInstallFileIcon = !1, this.installFileIcon = "", this.highLight = "", this.fileNameDefaultCursor = "cursor:default"
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onOptionsChanged(e, t) {
            this.active && v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, e === u.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, this.$el)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== t && r.unwatchFile(t, this.handleWatchFile), this.handleWatchFile(), r.watchFile(e, this.handleWatchFile), this.fileTypeClass = yield this.getFileTypeClass().catch()
            })
        }

        onOpenedChange(e) {
            this.$emit("update:opened", e)
        }

        onKeyWordsChange(e, t) {
            this.highLight = h.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = h.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        get opened() {
            return 1 === this.taskBase.userRead
        }

        get markTitle() {
            let e = "标记为未打开";
            return e = this.opened ? "标记为未打开" : "标记为已打开"
        }

        get fullFileName() {
            let e = this.taskBase.savePath, t = this.taskBase.taskName;
            void 0 !== t && t.indexOf(".") === t.length - 1 && (t = t.substring(0, t.length - 1));
            let n = "";
            return n = this.taskBase.taskType === u.DownloadKernel.TaskType.Group ? e : o.join(e, t)
        }

        handleWatchFile(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== e && void 0 !== t && b.information("fs watchFile", e.mtime, t.mtime, this.fullFileName), (yield g.TaskCtrlOperatorNS.isExistTaskFile(this.taskBase)) ? this.$emit("update:deleted", !1) : this.$emit("update:deleted", !0)
            })
        }

        destroyed() {
            b.information("item destroyed"), r.unwatchFile(this.fullFileName, this.handleWatchFile), this.active && (v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, !1, this.taskBase.taskId, this.$el), v.default.getNeedSelectNext() && (v.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index)))
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskType !== u.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== u.DownloadKernel.TaskType.P2sp) break;
                let t = o.extname(this.taskBase.taskName);
                if (null === t || void 0 === t) break;
                if (".exe" === t.toLowerCase()) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        getFileTypeClass() {
            return a(this, void 0, void 0, function* () {
                let e = "xlx-icon-type";
                if (e = e + " " + f.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType), this.isGroup) {
                    let t = A.getTaskFromTaskId(this.taskBase.taskId), n = this.getInstallFileName(t);
                    if (null !== n && void 0 !== n && "" !== n) {
                        let t = g.TaskCtrlOperatorNS.getSavePathByFileName(this.taskBase.taskId, n);
                        if (null !== t && void 0 !== t && "" !== t) {
                            if (yield w.FileSystemAWNS.existsAW(t)) {
                                let n = yield p.TaskOperatorNs.getFileIcon(t).catch();
                                null !== n && void 0 !== n && "" !== n && (this.isInstallFileIcon = !0, this.installFileIcon = n, e = "xlx-icon-type")
                            }
                        }
                    }
                } else if (this.isExe && (yield w.FileSystemAWNS.existsAW(this.fullFileName))) {
                    let t = yield p.TaskOperatorNs.getFileIcon(this.fullFileName).catch();
                    null !== t && void 0 !== t && "" !== t && (this.isInstallFileIcon = !0, this.installFileIcon = t, e = "xlx-icon-type")
                }
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.deleted) break;
                if (this.taskBase.isMoving) break;
                let t = A.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        get fileSizeFormat() {
            return h.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get completeTime() {
            let e = "", t = this.taskBase.completionTime;
            if (t > 0) {
                let n = new Date(t);
                e = c.TimeHelperNS.formatDate(n, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === u.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === u.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get subTaskCount() {
            let e = "0个文件", t = 0;
            if (this.isBt) {
                t = A.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile().length
            } else if (this.isGroup) {
                t = A.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadTaskCount()
            }
            return e = t < 1e3 ? t + "个文件" : "999+文件"
        }

        getInstallFileName(e) {
            let t = "";
            do {
                if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                let n = e.getExtraObject().getUserData(y.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                if (void 0 === n || null === n || "" === n || "0" === n) break;
                t = n
            } while (0);
            return t
        }

        handleMark() {
            this.opened ? (m.XLStatNS.trackEvent("download_leftpanel", "finished_left_markcancel_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.markReadStatus([this.taskBase], 0)) : (m.XLStatNS.trackEvent("download_leftpanel", "finished_left_mark_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.markReadStatus([this.taskBase], 1))
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, n = t.scrollHeight, i = t.offsetHeight;
            this.titleOverFlow = n > i ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handlePlayTask() {
            let e = this.statExtData();
            e = `${e},panel=finished,click_source=play`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, e), A.getTaskFromTaskId(this.taskBase.taskId) && (p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "play", "finished", this.currentCategoryId).catch(), p.TaskOperatorNs.markReadStatus([this.taskBase], 1))
        }

        handleOpenFile() {
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_openfiles_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.markReadStatus([this.taskBase], 1), p.TaskOperatorNs.openTaskFolder(this.taskBase)
        }

        handleDestroyTask() {
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_delete_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.destroyTasks([this.taskBase], !1)
        }

        handleDbClick() {
            p.TaskOperatorNs.markReadStatus([this.taskBase], 1);
            do {
                if (this.deleted) {
                    C.MessageBox.confirm({
                        title: "此文件已经被删除，是否需要重新下载？",
                        type: C.MessageBox.ConfirmType.Warning,
                        okText: "重新下载",
                        cancelText: "删除任务"
                    }).then(e => {
                        e.action === S.MessageBoxNS.Action.OK ? g.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === S.MessageBoxNS.Action.Cancel && p.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                    });
                    break
                }
                if (this.taskBase.taskType === u.DownloadKernel.TaskType.Bt) {
                    let e = A.getTaskFromTaskId(this.taskBase.taskId);
                    I.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                        e ? p.TaskOperatorNs.openTaskItem(this.taskBase) : p.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.taskBase.taskType === u.DownloadKernel.TaskType.Group) {
                    let e = A.getTaskFromTaskId(this.taskBase.taskId);
                    p.TaskOperatorNs.executeInstallFile(e).then(e => {
                        e || p.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.canPlay) {
                    let e = "double_click", t = this.statExtData();
                    t = `${t},panel=finished,click_source=${e}`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, t), A.getTaskFromTaskId(this.taskBase.taskId) && p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "finished", this.currentCategoryId).catch()
                } else p.TaskOperatorNs.openTaskItem(this.taskBase)
            } while (0)
        }

        handleFileCountClick() {
            this.active ? v.default.fireEvent(k.NodeEventMesssageNS.eventDetailSwitch2Index, this.taskBase.taskId, T.DetailIndex.FileList) : v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, !0, this.taskBase.taskId, this.$el, void 0, T.DetailIndex.FileList)
        }
    };
    i([s.Prop({})], N.prototype, "pulseForRename", void 0), i([s.Prop({})], N.prototype, "sharedKeyWords", void 0), i([s.Prop({})], N.prototype, "itemType", void 0), i([s.Prop({})], N.prototype, "index", void 0), i([s.Prop({})], N.prototype, "taskId", void 0), i([s.Prop({})], N.prototype, "taskBase", void 0), i([s.Prop({})], N.prototype, "currentCategoryId", void 0), i([s.Prop({})], N.prototype, "currentCategoryViewId", void 0), i([s.Prop()], N.prototype, "deleted", void 0), i([s.Prop()], N.prototype, "chosen", void 0), i([s.Prop()], N.prototype, "active", void 0), i([s.Watch("active")], N.prototype, "onActiveChanged", null), i([s.Watch("currentCategoryViewId")], N.prototype, "onOptionsChanged", null), i([s.Watch("fullFileName", {immediate: !0})], N.prototype, "onFullFileNameChange", null), i([s.Watch("opened", {immediate: !0})], N.prototype, "onOpenedChange", null), i([s.Watch("sharedKeyWords", {immediate: !0})], N.prototype, "onKeyWordsChange", null), i([s.Watch("pulseForRename", {immediate: !0})], N.prototype, "onRenamePulse", null), N = i([s.Component], N), t.default = N
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(381), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(924), a = n(54), o = n(8);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let n = null, i = t.taskId;
                if (-1 === t.currentCategoryId) for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Recycle) {
                    n = e.DownloadListState.taskList[t].tasksMap[i];
                    break
                }
                return n
            }
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(383), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(2), r = n(17), s = n(4), l = n(8), u = n(32), d = n(146), c = n(12), h = n(58), f = n(195), g = n(85),
        p = n(23), k = n(74), m = n(13), T = n(33), v = n(28), C = n(10), S = n(132),
        y = u.DownloadKernelTaskManager.getTaskManager();
    let w = class extends s.Vue {
        constructor() {
            super(...arguments), this.titleOverFlow = "", this.bAttachFile = !1, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.fileIcon = "", this.isFileIcon = !1, this.fileTypeClass = ""
        }

        onOptionsChanged(e, t) {
            this.active && k.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e === l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, this.$el)
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && k.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onTaskIdChanged(e, t) {
            this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Seeding || (this.bAttachFile = !0, this.handleWatchFile(), r.watchFile(this.fullFileName, this.handleWatchFile))
        }

        onKeyWordsChange(e, t) {
            this.highLight = c.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = c.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                this.fileTypeClass = yield this.getFileTypeClass().catch()
            })
        }

        get fullFileName() {
            let e = this.taskBase.savePath, t = this.taskBase.taskName;
            void 0 !== t && t.indexOf(".") === t.length - 1 && (t = t.substring(0, t.length - 1));
            let n = "";
            return n = this.taskBase.taskType === l.DownloadKernel.TaskType.Group ? e : o.join(e, t)
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Seeding) break;
                if (this.taskBase.taskType !== l.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== l.DownloadKernel.TaskType.P2sp) break;
                let t = o.extname(this.taskBase.taskName);
                if (null === t || void 0 === t) break;
                if (".exe" === t.toLowerCase()) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        getFileTypeClass() {
            return a(this, void 0, void 0, function* () {
                let e = "";
                if (this.isExe) {
                    if (yield C.FileSystemAWNS.existsAW(this.fullFileName)) {
                        let e = yield g.TaskOperatorNs.getFileIcon(this.fullFileName).catch();
                        e && "" !== e && (this.isFileIcon = !0, this.fileIcon = e)
                    }
                } else e = h.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType);
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSizeFormat() {
            return c.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get creationTime() {
            let e = "", t = this.taskBase.createTime;
            if (t > 0) {
                let n = new Date(t);
                e = d.TimeHelperNS.formatDate(n, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get canPlay() {
            let e = !1, t = y.getTaskFromTaskId(this.taskBase.taskId);
            return t && (e = t.isSupportPlay()), e
        }

        get isSingleTask() {
            let e = !0;
            if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                y.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile().length > 1 && (e = !1)
            }
            return e
        }

        handleWatchFile() {
            return a(this, void 0, void 0, function* () {
                (yield f.TaskCtrlOperatorNS.isExistTaskFile(this.taskBase)) ? this.$emit("update:deleted", !1) : this.$emit("update:deleted", !0)
            })
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, n = t.scrollHeight, i = t.offsetHeight;
            this.titleOverFlow = n > i ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handleRestore() {
            m.XLStatNS.trackEvent("download_leftpanel", "dustbin_right_uno_click", "", 0, 0, 0, 0, this.statExtData()), y.recoverFromRecycle(this.taskBase.taskId)
        }

        handleClear() {
            m.XLStatNS.trackEvent("download_leftpanel", "dustbin_right_completedelete_click", "", 0, 0, 0, 0, this.statExtData()), g.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick() {
            return a(this, void 0, void 0, function* () {
                do {
                    if (this.taskBase.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskBase.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                        if (!(yield f.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.taskBase))) {
                            T.MessageBox.confirm({
                                title: "此文件已经被删除，是否需要重新下载？",
                                type: T.MessageBox.ConfirmType.Warning,
                                okText: "重新下载",
                                cancelText: "删除任务"
                            }).then(e => {
                                e.action === v.MessageBoxNS.Action.OK ? f.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === v.MessageBoxNS.Action.Cancel && g.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                            });
                            break
                        }
                        if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                            let e = y.getTaskFromTaskId(this.taskBase.taskId);
                            S.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                                e ? g.TaskOperatorNs.openTaskItem(this.taskBase) : g.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                            }).catch()
                        } else if (this.taskBase.taskType === l.DownloadKernel.TaskType.Group) g.TaskOperatorNs.openTaskFolder(this.taskBase, !0); else if (this.canPlay && this.isSingleTask) {
                            let e = "double_click", t = "panel=dustbin,click_source=" + e;
                            m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, t), y.getTaskFromTaskId(this.taskBase.taskId) && g.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "dustbin", this.currentCategoryId).catch()
                        } else g.TaskOperatorNs.openTaskItem(this.taskBase)
                    }
                } while (0)
            })
        }

        destroyed() {
            this.bAttachFile && (this.bAttachFile = !1, r.unwatchFile(this.fullFileName, this.handleWatchFile)), this.active && (k.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, !1, this.taskBase.taskId, this.$el), k.default.getNeedSelectNext() && (k.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index)))
        }
    };
    i([s.Prop({})], w.prototype, "pulseForRename", void 0), i([s.Prop({})], w.prototype, "sharedKeyWords", void 0), i([s.Prop({})], w.prototype, "itemType", void 0), i([s.Prop({})], w.prototype, "index", void 0), i([s.Prop({})], w.prototype, "taskId", void 0), i([s.Prop({})], w.prototype, "taskBase", void 0), i([s.Prop({})], w.prototype, "currentCategoryId", void 0), i([s.Prop({})], w.prototype, "currentCategoryViewId", void 0), i([s.Prop()], w.prototype, "active", void 0), i([s.Prop()], w.prototype, "deleted", void 0), i([s.Watch("currentCategoryViewId")], w.prototype, "onOptionsChanged", null), i([s.Watch("active")], w.prototype, "onActiveChanged", null), i([s.Watch("taskId", {immediate: !0})], w.prototype, "onTaskIdChanged", null), i([s.Watch("sharedKeyWords", {immediate: !0})], w.prototype, "onKeyWordsChange", null), i([s.Watch("pulseForRename", {immediate: !0})], w.prototype, "onRenamePulse", null), i([s.Watch("fullFileName", {immediate: !0})], w.prototype, "onFullFileNameChange", null), w = i([s.Component], w), t.default = w
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(385), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(928), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage},
        mapCommitToProps: {
            SHOW_PRIVATE_SPACE_OPEN_PAGE: "SHOW_PRIVATE_SPACE_OPEN_PAGE",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW"
        },
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(387), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(267), s = n(14), l = n(13);
    let u = class extends o.Vue {
        constructor() {
            super(...arguments), this.privateSpaceSetPasswordListener = null
        }

        stat(e) {
            let t = `button=${e}`;
            l.XLStatNS.trackEvent("download_leftpanel", "top_private_page_click", "", 0, 0, 0, 0, t)
        }

        openPrivateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield s.default("GetUserID");
                if (e && "" !== e) {
                    this.stat("open"), 0 === (yield r.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(e)) && r.PrivateSpaceHelperNS.openPrivateCategory(e)
                }
            })
        }

        created() {
            let e = r.PrivateSpaceHelperNS.getEventEmitter();
            this.privateSpaceSetPasswordListener || (this.privateSpaceSetPasswordListener = (e => {
                e && this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
            }), e.on(r.PrivateSpaceHelperNS.EventType.SetPassword, this.privateSpaceSetPasswordListener))
        }

        destroyed() {
            if (this.privateSpaceSetPasswordListener) {
                r.PrivateSpaceHelperNS.getEventEmitter().removeListener(r.PrivateSpaceHelperNS.EventType.SetPassword, this.privateSpaceSetPasswordListener), this.privateSpaceSetPasswordListener = null
            }
        }
    };
    i([o.Prop({})], u.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), i([o.Prop({})], u.prototype, "UPDATE_CATEGORYVIEW", void 0), u = i([o.Component], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(389), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(930), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            UPDATE_DOWNLOADING_SELECTED_TASKS: "UPDATE_DOWNLOADING_SELECTED_TASKS",
            UPDATE_COMPLETED_SELECTED_TASKS: "UPDATE_COMPLETED_SELECTED_TASKS",
            UPDATE_RECYCLE_SELECTED_TASKS: "UPDATE_RECYCLE_SELECTED_TASKS",
            UPDATE_TASK_STATUS: "UPDATE_TASK_STATUS",
            UPDATE_DOWNLOADING_TASKLIST: "UPDATE_DOWNLOADING_TASKLIST",
            UPDATE_COMPLETED_TASKLIST: "UPDATE_COMPLETED_TASKLIST",
            UPDATE_RECYCLE_TASKLIST: "UPDATE_RECYCLE_TASKLIST"
        },
        mapDispatchToProps: {attachTaskEvent: "attachTaskEvent", selectTab: "selectTab"},
        mapGettersToProps: {
            downloadingTaskList: e => e.downloadingTaskList,
            completedTaskList: e => e.completedTaskList,
            recycleTaskList: e => e.recycleTaskList,
            downloadingTaskBaseList: e => e.downloadingTaskBaseList,
            completedTaskBaseList: e => e.completedTaskBaseList,
            recycleTaskBaseList: e => e.recycleTaskBaseList,
            currentSelectdTaskInfos: e => e.currentSelectdTaskInfos,
            downloadingSelectedIndexs: e => e.downloadingSelectedIndexs,
            completedSelectedTaskIndexs: e => e.completedSelectedTaskIndexs,
            recycleSelectedTaskIndexs: e => e.recycleSelectedTaskIndexs
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(391), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(1), r = n(8), s = n(148), l = n(748), u = n(85), d = n(253), c = n(23), h = n(74), f = n(13),
        g = n(73), p = n(34), k = n(32), m = n(6), T = n(53), v = n(83),
        C = p.DownloadKernelEventManager.getEventManager(), S = k.DownloadKernelTaskManager.getTaskManager(),
        y = o.default.getLogger("DownloadList");
    let w = class extends a.Vue {
        constructor() {
            super(...arguments), this.categoryLastSelectList = [{
                category: r.DownloadKernel.CategroyViewID.Downloading,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Completed,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Recycle,
                lastIndex: 0
            }], this.showNoResultTip = !1, this.showResultCountTip = !1, this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.removeFromCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.inputFlag = !0, this.resultCount = 0, this.escapeCode = "", this.pulseEventFlag = !1, this.downloadingSearchArray = [], this.completeSearchArray = [], this.recycleSearchArray = [], this.downloadingSearchSelIndexs = [], this.completeSearchSelIndexs = [], this.recycleSearchSelIndexs = [], this.currentSelSearchTaskIds = [], this.searchListPanel = "Downloading", this.holderTextTip = "", this.searchType = "search", this.curSearchKey = "", this.inputFocus = !1
        }

        get recycleSearchList() {
            return void 0 === this.recycleSearchArray ? [] : this.recycleSearchArray
        }

        get completeSearchList() {
            return void 0 === this.completeSearchArray ? [] : this.completeSearchArray
        }

        get downloadingSearchList() {
            return void 0 !== this.downloadingSearchArray ? this.downloadingSearchArray : []
        }

        onInputFocus(e) {
            this.holderTextTip = "", this.inputFocus = !0
        }

        onInputBlur(e) {
            this.inputFocus = !1, this.curSearchKey.length < 1 && (this.holderTextTip = "搜索下载记录", this.showResultCountTip = !1)
        }

        preHandleSearchKey() {
            let e = this.curSearchKey.split(" "), t = [];
            if (e) for (let n = 0; n < e.length; n++) e[n].trim().length > 0 && t.push(e[n].trim());
            return t
        }

        getArrayIntersection(e, t) {
            let n = [], i = new Set(t);
            return n = Array.from(new Set(e.filter(e => i.has(e))))
        }

        replaceSpecialKeyForDB(e) {
            return e !== (e = e.replace(/\/|'|\[|]|%|&|_|\(|\)/g, function (e) {
                return "/" + e
            })) && (this.escapeCode = "/"), e
        }

        internalSearch(e) {
            y.information("多关键字数组:", e);
            let t = [], n = [];
            for (let i = 0; i < e.length; i++) {
                let a = r.DownloadKernel.SearchKeyType.NameInclude;
                this.escapeCode = "";
                let o = this.replaceSpecialKeyForDB(e[i]);
                v.ThunderKernel.searchTask(a, o, -1, this.escapeCode, i => {
                    let a, o;
                    if (this.clearSearch(), n = i, t[t.length] = n, t.length === e.length) {
                        let e;
                        t.length > 0 && (e = t[0]);
                        for (let n = 1; n < t.length; n++) e = this.getArrayIntersection(e, t[n]);
                        this.resultCount = e.length;
                        for (let t = 0; t < e.length; t++) (a = S.getTaskFromTaskId(e[t])) && (o = a.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId)), o && (o === r.DownloadKernel.CategroyViewID.Downloading ? this.downloadingSearchArray.push(e[t]) : o === r.DownloadKernel.CategroyViewID.Completed ? this.completeSearchArray.push(e[t]) : o === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSearchArray.push(e[t]))
                    }
                })
            }
        }

        startSearch() {
            this.inputFlag && (m.isNullOrUndefined(this.curSearchKey) || (this.curSearchKey.trim().length < 1 ? this.clearSearch() : (this.showNoResultTip = !0, this.showResultCountTip = !0, this.internalSearch(this.preHandleSearchKey()))))
        }

        onDownloadTaskSelect(e) {
            if (!e) return;
            if (!e.length) return;
            let t, n;
            this.currentSelSearchTaskIds = e, this.currentSelSearchTaskInfos = [];
            for (let i = 0; i < e.length; i++) t = (n = S.getTaskFromTaskId(e[i])).getTaskBaseInfo(), this.currentSelSearchTaskInfos.push(t)
        }

        handlePopInputMenu() {
            T.MenuSkinNS.popEditableDefaultContextMenu(void 0, -4)
        }

        onCategoryChange(e) {
            h.default.fireEvent(c.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), -1 !== this.currentCategoryId && this.closeSearch()
        }

        clearSearch() {
            this.downloadingSearchArray = [], this.completeSearchArray = [], this.recycleSearchArray = [], this.resultCount = 0, this.showResultCountTip = !1, this.showNoResultTip = !1
        }

        clickCloseSearch() {
            f.XLStatNS.trackEvent("download_leftpanel", "search_close_click", "", 0, 0, 0, 0, "entry=close"), this.closeSearch()
        }

        keyCloseSearch() {
            f.XLStatNS.trackEvent("download_leftpanel", "search_close_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.closeSearch()
        }

        closeSearch() {
            this.$emit("close:keysearch"), this.clearSearch(), this.curSearchKey = ""
        }

        handleDelete(e = !1) {
            e ? u.TaskOperatorNs.destroyTasks(this.currentSelSearchTaskInfos) : u.TaskOperatorNs.deleteTasks(this.currentSelSearchTaskInfos)
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingSearchArray.length && (e = e + "(" + this.downloadingSearchArray.length + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completeSearchArray.length && (e = e + "(" + this.completeSearchArray.length + ")"), e
        }

        get recycleCategoryTitle() {
            let e = "垃圾箱";
            return 0 !== this.recycleSearchArray.length && (e = e + "(" + this.recycleSearchArray.length + ")"), e
        }

        downloadingItemDbClick() {
            s.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? u.TaskOperatorNs.pauseTasks(this.currentSelSearchTaskInfos) : s.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? u.TaskOperatorNs.startTasks(this.currentSelSearchTaskInfos) : y.information("downloaditem dbclick do nothing")
        }

        recycleItemDbClick() {
            y.information("垃圾箱双击")
        }

        handleDownloadingItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelSearchTaskInfos, this.currentCategoryId, this.downloadingTaskList.length, !0);
            let e = d.DownloadMenuType.DownloadingItem;
            this.currentSelSearchTaskInfos.length > 1 && (e = d.DownloadMenuType.SearchMultiSel), d.downloadContextMenu.popMenu(e)
        }

        handleCompletedItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelSearchTaskInfos, this.currentCategoryId, null, !0);
            let e = d.DownloadMenuType.CompletedItem;
            this.currentSelSearchTaskInfos.length > 1 && (e = d.DownloadMenuType.SearchMultiSel), d.downloadContextMenu.popMenu(e)
        }

        handleRecycleItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelSearchTaskInfos, this.currentCategoryId, null, !0);
            let e = d.DownloadMenuType.RecycleItem;
            this.currentSelSearchTaskInfos.length > 1 && (e = d.DownloadMenuType.SearchMultiSel), d.downloadContextMenu.popMenu(e)
        }

        handleMenuClick(e, ...t) {
            e
        }

        compositionStart(e) {
            this.inputFocus && (this.inputFlag = !1)
        }

        compositionEnd(e) {
            this.inputFocus && (this.inputFlag = !0, this.$nextTick(() => {
                this.startSearch()
            }))
        }

        created() {
            this.attachTaskEvent(), this.holderTextTip = "搜索下载记录", d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), this.currentSelSearchTaskInfos = [], document.addEventListener("compositionstart", this.compositionStart), document.addEventListener("compositionend", this.compositionEnd)
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) {
                    e = !0;
                    break
                }
                if (this.downloadingSelectedIndexs.length > 0) {
                    e = !1;
                    break
                }
                e = !0;
                for (let t of this.downloadingTaskBaseList) if (t.taskStatus === r.DownloadKernel.TaskStatus.StartPending || t.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed)
            })
        }

        mounted() {
            this.statusChangedEventId = C.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (t.length > 0) {
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            this.startSearch()
                        })
                    }
                } while (0)
            }), S.isLoadStorageTaskFinish() ? this.bLoadDbFinish = !0 : (this.dataBaseLoadCookie = 0, g.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.removeFromCategoryViewEventId = C.attachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (e[1] !== this.currentCategoryId) break;
                    let t = e[2], n = e[3];
                    if (t === r.DownloadKernel.CategroyViewID.Downloading) {
                        if (!this.downloadingSearchArray) break;
                        for (let e of n) {
                            let t = e.getId(), n = this.downloadingSearchArray.indexOf(t);
                            -1 !== n && this.downloadingSearchArray.splice(n, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Completed) {
                        if (!this.completeSearchArray) break;
                        for (let e of n) {
                            let t = e.getId(), n = this.completeSearchArray.indexOf(t);
                            -1 !== n && this.completeSearchArray.splice(n, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Recycle) {
                        if (!this.recycleSearchArray) break;
                        for (let e of n) {
                            let t = e.getId(), n = this.recycleSearchArray.indexOf(t);
                            -1 !== n && this.recycleSearchArray.splice(n, 1)
                        }
                        break
                    }
                } while (0)
            }), this.insertToCategoryViewEventId = C.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], a = e[4];
                    i.map(e => e.getTaskBaseInfo()), this.$nextTick(() => {
                        this.startSearch()
                    }), this.bLoadDbFinish && n === r.DownloadKernel.CategroyViewID.Downloading && (a === r.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                        if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), this.$nextTick(() => {
                            setTimeout(() => {
                                let e = this.downloadingTaskList[0];
                                this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                            }, 0)
                        }); else {
                            let e = this.downloadingTaskList[0];
                            this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                        }
                    }))
                } while (0)
            }), this.cookieOfTaskRenamed = C.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.TaskRenamed) break;
                    this.pulseEventFlag = !this.pulseEventFlag, this.$nextTick(() => {
                        this.startSearch()
                    })
                } while (0)
            }), this.cookieOfTaskDestroyed = C.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.TaskDestroyed) break;
                    this.pulseEventFlag = !this.pulseEventFlag, this.$nextTick(() => {
                        this.startSearch()
                    })
                } while (0)
            })
        }

        destroyed() {
            d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), document.removeEventListener("compositionstart", this.compositionStart), document.removeEventListener("compositionend", this.compositionEnd), this.clearSearch(), void 0 !== this.insertToCategoryViewEventId && C.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.removeFromCategoryViewEventId && C.detachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), void 0 !== this.statusChangedEventId && C.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, g.DownloadKernelManager.detachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.cookieOfTaskRenamed && (this.cookieOfTaskRenamed = void 0, C.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, this.cookieOfTaskRenamed)), this.cookieOfTaskDestroyed && (this.cookieOfTaskDestroyed = void 0, C.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, this.cookieOfTaskDestroyed))
        }
    };
    i([a.Prop({})], w.prototype, "isFengxingAdShow", void 0), i([a.Prop({})], w.prototype, "currentTabId", void 0), i([a.Prop({})], w.prototype, "currentCategoryId", void 0), i([a.Prop({})], w.prototype, "currentCategoryViewId", void 0), i([a.Prop({})], w.prototype, "downloadingTaskList", void 0), i([a.Prop({})], w.prototype, "downloadingTaskBaseList", void 0), i([a.Prop({})], w.prototype, "completedTaskList", void 0), i([a.Prop({})], w.prototype, "completedTaskBaseList", void 0), i([a.Prop({})], w.prototype, "recycleTaskList", void 0), i([a.Prop({})], w.prototype, "recycleTaskBaseList", void 0), i([a.Prop({})], w.prototype, "downloadingSelectedIndexs", void 0), i([a.Prop({})], w.prototype, "completedSelectedTaskIndexs", void 0), i([a.Prop({})], w.prototype, "recycleSelectedTaskIndexs", void 0), i([a.Prop({})], w.prototype, "currentSelectdTaskInfos", void 0), i([a.Prop({})], w.prototype, "downloadingResultCount", void 0), i([a.Prop({})], w.prototype, "completedResultCount", void 0), i([a.Prop({})], w.prototype, "recycleResultCount", void 0), i([a.Prop({})], w.prototype, "UPDATE_CATEGORY", void 0), i([a.Prop({})], w.prototype, "UPDATE_CATEGORYVIEW", void 0), i([a.Prop({})], w.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), i([a.Prop({})], w.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), i([a.Prop({})], w.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), i([a.Prop({})], w.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), i([a.Prop({})], w.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), i([a.Prop({})], w.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), i([a.Prop({})], w.prototype, "UPDATE_TASK_STATUS", void 0), i([a.Prop({})], w.prototype, "attachTaskEvent", void 0), i([a.Prop({})], w.prototype, "selectTab", void 0), i([a.Watch("currentCategoryId")], w.prototype, "onCategoryChange", null), w = i([a.Component({components: {DownloadCategory: l.default}})], w), t.default = w
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(393), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(932), a = n(54);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            homePageUrl: e => e.WebView.homePageUrl,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {onMounted: "ON_MOUNTED", createNewTab: "CREATE_NEW_TAB"},
        mapDispatchToProps: {selectTab: "selectTab"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(395), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(2), r = n(4), s = n(136), l = n(750), u = n(1).default.getLogger("home-page"), d = n(741), c = n(56),
        h = n(744);
    let f = class extends r.Vue {
        indexOfTab(e) {
            let t = -1;
            for (let n = 0; n < this.tabs.length; n++) if (this.tabs[n].tab.getTabType() === s.TabType.Chromium && this.tabs[n].tab.getOriginalUrl() === e) {
                t = n;
                break
            }
            return t
        }

        mounted() {
            this.enableDevTools(), this.initNativeCall()
        }

        enableDevTools() {
            window.addEventListener("keyup", e => {
                "F12" === e.key && e.shiftKey && this.$refs.webview.openDevTools()
            }, !0)
        }

        initNativeCall() {
            return a(this, void 0, void 0, function* () {
                let e = l.default.getPluginUpdater(o.join(__rootDir, "plugins/ThunderXWebXDAS"));
                c.NativeCallHostModule.nativeCallHost.initialize();
                let t = {
                    onJsCallNativeFunction: d.onJsCallNativeFunction,
                    onJsCheckNativeFunction: d.onJsCheckNativeFunction
                };
                c.NativeCallHostModule.nativeCallHost.addDelegate(t);
                let i = yield e.getCurFilePath();
                u.information("url", i), this.onMounted(`file:///${o.join(i, "index.html")}#/home`), e.active();
                const a = document.querySelector("webview");
                a.addEventListener("new-window", e => {
                    let t = e.url;
                    const i = n(31).parse(t).protocol;
                    if ("http:" === i || "https:" === i) {
                        let e = {tabType: s.TabType.Chromium, tabParam: {url: t}};
                        this.createNewTab(e)
                    }
                });
                let r = void 0;
                a.addEventListener("dom-ready", e => {
                    r || (r = a.getWebContents()), r.on("context-menu", (e, t) => {
                        h.ContextMenuNS.popContextMenu(e, t)
                    })
                })
            })
        }
    };
    i([r.Prop({})], f.prototype, "tabs", void 0), i([r.Prop({})], f.prototype, "homePageUrl", void 0), i([r.Prop({})], f.prototype, "preloadPath", void 0), i([r.Prop({})], f.prototype, "onMounted", void 0), i([r.Prop({})], f.prototype, "createNewTab", void 0), i([r.Prop({})], f.prototype, "selectTab", void 0), f = i([r.Component], f), t.default = f
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(397), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(935), a = n(54);
    t.default = a.connector.connect({mapGettersToProps: {currentTab: e => e.currentTab}})(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(399), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(6), r = n(93);
    let s = class extends a.Vue {
        get canGoBack() {
            let e = !1;
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoBack
            } while (0);
            return e
        }

        goBack() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.goBack()
            } while (0)
        }

        refresh() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.refresh(!1)
            } while (0)
        }

        get isError() {
            return r(this.currentTab, "tab", "isErrorPage")
        }
    };
    i([a.Prop({})], s.prototype, "currentTab", void 0), s = i([a.Component], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(401), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(938), a = n(54);
    t.default = a.connector.connect({
        mapDispatchToProps: {initSettingData: "initSettingData"},
        mapStateToProps: {formData: e => e.SettingConf.formData, confSchema: e => e.SettingConf.confSchema},
        mapCommitToProps: {
            removeConfigData: "REMOVE_CONFIG_DATA",
            setConfigValue: "SET_CONFIG_VALUE",
            setFormData: "SET_FOMR_DATA",
            addFormdataItem: "ADD_FORMDATA_ITEM",
            addSchemaItem: "ADD_SCHEMA_ITEM",
            addSelectItem: "ADD_SELECT_ITEM"
        },
        mapGettersToProps: {baseSetting: "baseSetting"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(403), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(589), o = n(4), r = n(5), s = n(25), l = n(23), u = n(234), d = n(249), c = n(583),
        h = n(1).default.getLogger("setting-center-view"),
        f = u.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.userId = "", this.currenIndex = 0, this.scrollSumHeight = 0, this.autoScroll = !1, this.browserSettingPosition = [1, 0], this.browsersConfSection = "Motitor", this.browserSettingItemType = "confCheckbox", this.browserSelectAll = "Motitor-MotitorAll"
        }

        handleScroll() {
            if (this.autoScroll) return void (this.autoScroll = !1);
            0 === this.getScrollTop() && (this.scrollSumHeight = 0, this.currenIndex = 0);
            let e = document.querySelectorAll(".contain-tab")[this.currenIndex];
            if (e.offsetHeight + this.scrollSumHeight <= this.getScrollTop()) this.scrollSumHeight += e.offsetHeight, this.currenIndex++; else if (this.scrollSumHeight - this.getScrollTop() >= e.offsetHeight || 0 === this.getScrollTop()) {
                if (0 === this.currenIndex) return;
                0 === this.getScrollTop() ? this.scrollSumHeight = 0 : this.scrollSumHeight -= e.offsetHeight, this.currenIndex--
            }
        }

        getScrollTop() {
            return this.$refs.settinContain.scrollTop
        }

        setScrollTop(e) {
            this.$refs.settinContain.scrollTop = e
        }

        clickTab(e) {
            this.scrollSumHeight = 0, this.currenIndex = e;
            let t = document.querySelectorAll(".contain-tab");
            for (let n = 0; n < e; n++) this.scrollSumHeight += t[n].offsetHeight;
            this.autoScroll = !0, this.setScrollTop(this.scrollSumHeight)
        }

        handleConfChange(e, t = "") {
            if ("" === t || void 0 === this.formData[t]) return;
            let n = void 0 !== this.formData[t].isReleventUser ? this.userId : "",
                i = {section: this.formData[t].section, key: this.formData[t].key, value: e, name: t, userId: n};
            this.setConfigValue(i)
        }

        created() {
            s.ConfigNS.attachListener(l.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.initSettingData()
            })
        }

        mounted() {
            this.confChangeEventId = r.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, n, i) => {
                void 0 !== this.formData[`${e}-${t}`] && this.setFormData({section: e, key: t, value: i})
            }), this.loginEventId = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.userId = e;
                let t = s.ConfigNS.getValue("UserCommunitySet", `radio_id_${e}`, "1");
                h.information("setting-center:handleConfChange", t), this.handleConfChange(t, "UserCommunitySet-radio_id_")
            }), this.logoutEventId = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.userId = ""
            }), f.on("selectMsgNotice", () => {
                this.clickTab(3)
            }), d.SettingConfigHelperNS.configBrowserHelper.attachListener(l.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                let e = d.SettingConfigHelperNS.configBrowserHelper.getConfigShowBrowsers();
                h.information("browsers", e);
                for (let t = 0; t < e.length; t++) void 0 === this.formData[`${this.browsersConfSection}-${e[t].key}`] && (this.addFormdataItem({
                    section: this.browsersConfSection,
                    key: e[t].key,
                    type: "number",
                    value: e[t].isSelect ? 1 : 0,
                    selectAllName: this.browserSelectAll
                }), this.addSchemaItem({
                    position: this.browserSettingPosition,
                    schemaItem: {
                        name: `${this.browsersConfSection}-${e[t].key}`,
                        type: this.browserSettingItemType,
                        label: e[t].content,
                        liClasses: "inline"
                    },
                    direction: 3
                }), this.addSelectItem({
                    target: this.browserSelectAll,
                    from: `${this.browsersConfSection}-${e[t].key}`
                }));
                if (e.length > 0) {
                    let t = e[e.length - 1];
                    this.handleConfChange(t.isSelect ? 1 : 0, `${this.browsersConfSection}-${t.key}`)
                }
                if (!this.formData[`${this.browsersConfSection}-browserConfigGuideButton`]) {
                    let e = {
                        type: "confBtn",
                        text: "手动更改浏览器默认下载方式",
                        classes: "td-button--small noMargin",
                        boxType: "browserGuideConfBox",
                        style: c.default().whetherShowEntry() ? "margin-left: 0" : "display: none",
                        extEles: [{
                            type: "confTip",
                            text: "由于技术原理的限制，迅雷默认提供的“接管浏览器”功能，未能有效接管HTTPS\n协议的下载请求。建议您手动更改浏览器默认下载方式，可以完美接管浏览器的\n所有下载请求！目前支持“360安全浏览器、搜狗浏览器、QQ浏览器”",
                            classes: "td-icon-info",
                            style: c.default().whetherShowEntry() ? "margin-left: 0" : "display: none"
                        }]
                    };
                    this.addFormdataItem({
                        section: this.browsersConfSection,
                        key: "browserConfigGuideButton",
                        type: "number",
                        value: ""
                    }), this.addSchemaItem({position: this.browserSettingPosition, schemaItem: e, direction: -1})
                }
            })
        }

        beforeDestroy() {
            this.confChangeEventId && r.NativeCallModule.nativeCall.DetachNativeEvent("OnConfigValueChanaged", this.confChangeEventId), this.loginEventId && r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.loginEventId), this.logoutEventId && r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.logoutEventId), f.removeAllListeners("selectMsgNotice"), this.removeConfigData()
        }
    };
    i([o.Prop({})], g.prototype, "initSettingData", void 0), i([o.Prop({})], g.prototype, "formData", void 0), i([o.Prop({})], g.prototype, "confSchema", void 0), i([o.Prop({})], g.prototype, "removeConfigData", void 0), i([o.Prop({})], g.prototype, "setConfigValue", void 0), i([o.Prop({})], g.prototype, "setFormData", void 0), i([o.Prop({})], g.prototype, "addFormdataItem", void 0), i([o.Prop({})], g.prototype, "addSchemaItem", void 0), i([o.Prop({})], g.prototype, "addSelectItem", void 0), g = i([o.Component({components: {generatorView: a.default}})], g), t.default = g
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(405), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4);
    let o = class extends a.Vue {
    };
    o = i([a.Component], o), t.default = o
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (e, t, n) {
    var i;
    i = function () {
        return function (e) {
            var t = {};

            function n(i) {
                if (t[i]) return t[i].exports;
                var a = t[i] = {i, l: !1, exports: {}};
                return e[i].call(a.exports, a, a.exports, n), a.l = !0, a.exports
            }

            return n.m = e, n.c = t, n.i = function (e) {
                return e
            }, n.d = function (e, t, i) {
                n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: i})
            }, n.n = function (e) {
                var t = e && e.__esModule ? function () {
                    return e.default
                } : function () {
                    return e
                };
                return n.d(t, "a", t), t
            }, n.o = function (e, t) {
                return Object.prototype.hasOwnProperty.call(e, t)
            }, n.p = "", n(n.s = 3)
        }([function (e, t, n) {
            "use strict";
            t.a = function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = "", n = "";
                if (!e || 0 === e.length) return {isVip: !1};
                var i = e.filter(function (e) {
                    return e && 2 === (e.vasId || e.vasID)
                })[0];
                if (n = i.vIPLevel || i.VIPLevel || 0, i) {
                    var a = {2: "", 3: "p", 5: "s"}[i.vasType] || "";
                    return t = "vip-icon-" + a + "vip" + n, {
                        isVip: "1" === i.isVIP,
                        isStop: "2" === i.isVIP,
                        isYear: "1" === i.isYear,
                        type: i.vasType,
                        level: n,
                        vipClass: t
                    }
                }
                return {isVip: !1}
            }
        }, function (e, t, n) {
            "use strict";
            var i = n(4), a = n.n(i);
            a.a.install = function (e) {
                e.component(a.a.name, a.a)
            }, t.a = a.a
        }, function (e, t, n) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var i = n(0);
            t.default = {
                name: "vip-icon",
                props: {
                    vipData: {type: Array, required: !0},
                    size: {type: String, default: "normal"},
                    disabled: {type: Boolean, default: !1}
                },
                computed: {
                    vipInfo: function () {
                        return n.i(i.a)(this.vipData)
                    }, vipClass: function () {
                        var e = this.vipInfo.vipClass;
                        return "small" === this.size && (e += " is-small"), (this.vipInfo.isStop || "0" === this.vipInfo.level || this.disabled) && (e += " is-disabled"), e
                    }
                }
            }
        }, function (e, t, n) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var i = n(1), a = n(0);
            n.d(t, "vipInfo", function () {
                return a.a
            });
            /**
             * vip
             * (c) 2018 shijianan
             * @license MIT
             */
            var o = {
                install: function (e, t) {
                    e.use(i.a), e.prototype.$vipInfo = function (e) {
                        return n.i(a.a)(e)
                    }
                }
            };
            t.default = o
        }, function (e, t, n) {
            var i = n(5)(n(2), n(6), null, null, null);
            i.options.__file = "/Users/nancy/Desktop/work/@xunlei/vip/src/vip-icon/VipIcon.vue", i.esModule && Object.keys(i.esModule).some(function (e) {
                return "default" !== e && "__" !== e.substr(0, 2)
            }) && console.error("named exports are not supported in *.vue files."), i.options.functional && console.error("[vue-loader] VipIcon.vue: functional components are not supported with templates, they should use render functions."), e.exports = i.exports
        }, function (e, t) {
            e.exports = function (e, t, n, i, a) {
                var o, r = e = e || {}, s = typeof e.default;
                "object" !== s && "function" !== s || (o = e, r = e.default);
                var l, u = "function" == typeof r ? r.options : r;
                if (t && (u.render = t.render, u.staticRenderFns = t.staticRenderFns), i && (u._scopeId = i), a ? (l = function (e) {
                    (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), n && n.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
                }, u._ssrRegister = l) : n && (l = n), l) {
                    var d = u.functional, c = d ? u.render : u.beforeCreate;
                    d ? u.render = function (e, t) {
                        return l.call(t), c(e, t)
                    } : u.beforeCreate = c ? [].concat(c, l) : [l]
                }
                return {esModule: o, exports: r, options: u}
            }
        }, function (e, t, n) {
            e.exports = {
                render: function () {
                    var e = this.$createElement;
                    return (this._self._c || e)("i", {class: this.vipClass})
                }, staticRenderFns: []
            }, e.exports.render._withStripped = !0
        }])
    }, e.exports = i()
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(5), a = n(12), o = n(13), r = n(1);
    let {isDef: s, isUndef: l} = a.ThunderUtil;
    const u = r.default.getLogger("login-option");
    !function (e) {
        let t;
        !function (e) {
            e[e.Low = 0] = "Low", e[e.High = 1] = "High"
        }(t = e.Priority || (e.Priority = {}));
        e.loginOption = new class {
            constructor() {
                this.eventListener = !1, this.onLoginSucCookie = 0, this.onLoginFailedCookie = 0, this.option = null
            }

            setOption(e) {
                u.information("option", e);
                do {
                    if (l(e)) break;
                    if (e.priority = e.priority || t.Low, s(this.option) && e.priority <= this.option.priority) break;
                    this.option = e
                } while (0)
            }

            getOption() {
                return this.option
            }

            attachListenerEvent() {
                do {
                    if (l(this.option)) break;
                    if (!1 === this.eventListener) {
                        this.eventListener = !0;
                        let e = "logtype=client";
                        s(this.option.stat) && s(this.option.stat.logfrom) && (e = e + ",logfrom=" + this.option.stat.logfrom), o.XLStatNS.trackEvent("user_info", "loginpanel_show", "", 0, 0, 0, 0, e), this.onLoginSucCookie = i.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                            this.eventListener = !1, this.detachListenerEvent(), s(this.option.tabUrl) && "" !== this.option.tabUrl && i.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", this.option.tabUrl)
                        }), this.onLoginFailedCookie = i.NativeCallModule.nativeCall.AttachNativeEvent("onLoginFailed", (t, n) => {
                            "close" === n && (this.option.perpetual || (this.option = null), o.XLStatNS.trackEvent("user_info", "loginpanel_close", "", 0, 0, 0, 0, e)), this.eventListener = !1, this.detachListenerEvent()
                        })
                    }
                } while (0)
            }

            detachListenerEvent() {
                i.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginSucCookie), i.NativeCallModule.nativeCall.DetachNativeEvent("onLoginFailed", this.onLoginFailedCookie)
            }
        }
    }(t.LoginOptionNS || (t.LoginOptionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(126).DownloadKernelCategoryViewManager.getCategoryViewManager(),
        o = n(1).default.getLogger("TaskCtrlHelper.DownloadProgress");
    !function (e) {
        function t() {
            let e = -1, t = 0, n = 0, r = [], s = a.getCategoryViewFromId(i.DownloadKernel.CategroyViewID.Downloading);
            if (s) {
                let a = s.getTasks(), o = void 0, l = void 0;
                for (let [, e]of a) null !== e && ((o = e.getTaskStatus()) !== i.DownloadKernel.TaskStatus.PreDownloading && o !== i.DownloadKernel.TaskStatus.StartWaiting && o !== i.DownloadKernel.TaskStatus.StartPending && o !== i.DownloadKernel.TaskStatus.Started || (t += (l = e.getTaskBaseInfo()).fileSize, n += l.downloadSize, r.push(e.getId())));
                t > 0 && (e = n / t)
            }
            return r.length > 0 && -1 === e && (e = 0), e >= 1 && (e = 1), o.information("progress:", e), {
                progress: e,
                downloadingTaskIds: r
            }
        }

        e.getDownloadDetails = t, e.getDownloadProgressPercent = function () {
            let e = t().progress, n = "0.01%";
            return n = (100 * (e = e < 0 ? 0 : e)).toFixed(2) + "%"
        }, e.getDownloadProgress = function () {
            let e = t().progress;
            return e = e < 0 ? 0 : e
        }
    }(t.DownloadProgressNS || (t.DownloadProgressNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(32), r = n(34), s = i.default.getLogger("download-jammed"),
        l = o.DownloadKernelTaskManager.getTaskManager(), u = r.DownloadKernelEventManager.getEventManager(), d = 3,
        c = 10;
    const h = new class {
        constructor() {
            this.taskListInfo = {}, this.removeTaskIdList = {}, this.recordTaskRestartList = {}, this.stopPendingTaskList = {}, this.refreshInfoTimerId = void 0
        }

        isStopPending(e) {
            let t = !1;
            return this.stopPendingTaskList.hasOwnProperty(String(e)) && (t = this.stopPendingTaskList[e]), t
        }

        attach() {
            this.startRefreshTaskListInfoTimer(), this.attachTaskEvent()
        }

        isJammed(e) {
            let t = !1;
            do {
                let n = e.taskTotalSize;
                if (n <= 0) break;
                let i = e.receiveValidDataSize;
                if (i <= 0) break;
                let a = 100 * i / n;
                if (a >= 99.9 && a < 100) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        constructJammedTaskInfo(e) {
            let t = null;
            do {
                let n = l.getTaskFromTaskId(e);
                if (!n) break;
                if (n.getTaskStatus() !== a.DownloadKernel.TaskStatus.Started) break;
                let i = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.FileSize),
                    o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadSize);
                t = {
                    taskId: e,
                    taskTotalSize: i,
                    receiveDataSize: n.getTaskAttribute(a.DownloadKernel.TaskAttribute.ReceivedSize),
                    receiveValidDataSize: o,
                    addReceiveDataSize: 0,
                    time: 0,
                    peering: n.getTaskAttribute(a.DownloadKernel.TaskAttribute.SrcUsing)
                }
            } while (0);
            return t
        }

        getExistJammedTaskInfo(e) {
            let t = null;
            do {
                if (!e) break;
                let n = e.getId();
                this.taskListInfo.hasOwnProperty(String(n)) && (t = this.taskListInfo[n])
            } while (0);
            return t
        }

        getNewJammedTaskInfo(e) {
            let t = null;
            do {
                if (!e) break;
                let n = e.taskId, i = this.constructJammedTaskInfo(n);
                if (!i) break;
                let a = e.time;
                if (i.receiveValidDataSize > e.receiveValidDataSize) {
                    t = i;
                    break
                }
                let o = i.receiveDataSize - e.receiveDataSize;
                o > e.addReceiveDataSize ? a = 0 : 0 === i.peering ? a = 0 : a += 1, t = {
                    taskId: n,
                    taskTotalSize: i.taskTotalSize,
                    peering: i.peering,
                    time: a,
                    receiveValidDataSize: e.receiveValidDataSize,
                    receiveDataSize: e.receiveDataSize,
                    addReceiveDataSize: o
                }
            } while (0);
            return t
        }

        handleTaskByNewInfo(e) {
            let t = !1;
            do {
                if (!e) break;
                if (!this.isJammed(e)) {
                    s.information("jammed false", e.taskId, e.taskTotalSize);
                    break
                }
                if (e.time === c && e.receiveValidDataSize >= e.taskTotalSize) {
                    s.information("already 10 seconds but still no speed", e.taskId, e.taskTotalSize), this.restartTask(e.taskId);
                    break
                }
                let n = .05 * e.taskTotalSize;
                if (e.addReceiveDataSize > n) {
                    s.information("addReceiveDataSize over %5", e.addReceiveDataSize, e.taskTotalSize), this.restartTask(e.taskId);
                    break
                }
                t = !0
            } while (0);
            return t
        }

        addJammedTaskInfo(e, t) {
            this.taskListInfo[e] = t
        }

        removeTaskListInfoById(e) {
            this.taskListInfo.hasOwnProperty(String(e)) && (delete this.taskListInfo[e], this.setIsRemoveTaskId(e))
        }

        removeTaskListInfoByTask(e) {
            let t = e.getId();
            this.taskListInfo.hasOwnProperty(String(t)) && delete this.taskListInfo[t]
        }

        setIsRemoveTaskId(e) {
            this.removeTaskIdList.hasOwnProperty(String(e)) || (this.removeTaskIdList[e] = 0)
        }

        getIsRemoveTaskId(e) {
            let t = 0;
            return this.removeTaskIdList.hasOwnProperty(String(e)) && (t = this.removeTaskIdList[e], this.removeTaskIdList[e] = t + 1), t
        }

        getRestartCountById(e) {
            let t = 0;
            return this.recordTaskRestartList.hasOwnProperty(String(e)) && (t = this.recordTaskRestartList[e]), t
        }

        addRestartCountById(e) {
            this.recordTaskRestartList.hasOwnProperty(String(e)) || (this.recordTaskRestartList[e] = 0), this.recordTaskRestartList[e] = this.recordTaskRestartList[e] + 1
        }

        restartTask(e) {
            do {
                if (this.getRestartCountById(e) >= d) {
                    s.information("restart break beacause reach max restart");
                    break
                }
                this.addRestartCountById(e), this.addStopPending(e), l.stopTaskAW(e).then(t => {
                    t && l.startTask(e)
                }).catch()
            } while (0)
        }

        addStopPending(e) {
            this.stopPendingTaskList[e] = !0
        }

        removeStopPending(e) {
            this.isStopPending(e) && delete this.stopPendingTaskList[e]
        }

        startRefreshTaskListInfoTimer() {
            void 0 !== this.refreshInfoTimerId && (clearInterval(this.refreshInfoTimerId), this.refreshInfoTimerId = void 0), this.refreshInfoTimerId = setInterval(() => {
                do {
                    if (!this.taskListInfo) break;
                    if (0 === Object.keys(this.taskListInfo).length) break;
                    let e = [];
                    for (let t in this.taskListInfo) {
                        let n = this.taskListInfo[t];
                        if (!n) continue;
                        let i = this.getNewJammedTaskInfo(n);
                        this.handleTaskByNewInfo(i) ? this.addJammedTaskInfo(n.taskId, i) : e.push(n.taskId)
                    }
                    for (let t of e) this.removeTaskListInfoById(t)
                } while (0)
            }, 1e3)
        }

        attachTaskEvent() {
            u.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    if (0 === t.length) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        if (n.getTaskAttribute(a.DownloadKernel.TaskAttribute.Background)) continue;
                        let i = n.getTaskStatus();
                        i !== a.DownloadKernel.TaskStatus.StopPending && i !== a.DownloadKernel.TaskStatus.Stopped || this.removeTaskListInfoByTask(n), i === a.DownloadKernel.TaskStatus.Started && this.removeStopPending(n.getId())
                    }
                } while (0)
            }), u.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e of t) {
                        let t = e.getId(), n = this.constructJammedTaskInfo(t);
                        if (!n) continue;
                        if (!this.isJammed(n)) continue;
                        if (this.getExistJammedTaskInfo(e)) continue;
                        let i = this.getIsRemoveTaskId(t);
                        i && (i > 15 || i % 5 != 0) || (s.information("detailchange to add"), this.addJammedTaskInfo(t, n))
                    }
                } while (0)
            })
        }
    };
    !function (e) {
        e.init = function () {
            h.attach()
        }, e.isStopPending = function (e) {
            return h.isStopPending(e)
        }
    }(t.DownloadJammedNS || (t.DownloadJammedNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(20), o = n(8), r = n(25), s = n(148);
    !function (e) {
        let t;

        function n(e, n) {
            let i = {sortBy: t.Default, asce: !0};
            do {
                if (void 0 === e || null === e) break;
                let a = "", s = "";
                if (e === o.DownloadKernel.CategroyViewID.Downloading) -1 === n ? (a = "CategoryViewId1_SortAttr", s = "CategoryViewId1_SortState") : (a = "CategoryViewId4_SortAttr", s = "CategoryViewId4_SortState"); else if (e === o.DownloadKernel.CategroyViewID.Completed) -1 === n ? (a = "CategoryViewId2_SortAttr", s = "CategoryViewId2_SortState") : (a = "CategoryViewId5_SortAttr", s = "CategoryViewId5_SortState"); else {
                    if (e !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    a = "CategoryViewId3_SortAttr", s = "CategoryViewId3_SortState"
                }
                let l = r.ConfigNS.getValue("TaskList", a, t.Default);
                e !== o.DownloadKernel.CategroyViewID.Downloading && (l !== t.ByProgress && l !== t.ByState || (l = t.Default));
                let u = 0 === r.ConfigNS.getValue("TaskList", s, -1);
                i.sortBy = l, i.asce = u
            } while (0);
            return i
        }

        function l(e, t, n) {
            do {
                if (void 0 === t || null === t) break;
                let i = "", a = "";
                if (t === o.DownloadKernel.CategroyViewID.Downloading) -1 === n ? (i = "CategoryViewId1_SortAttr", a = "CategoryViewId1_SortState") : (i = "CategoryViewId4_SortAttr", a = "CategoryViewId4_SortState"); else if (t === o.DownloadKernel.CategroyViewID.Completed) -1 === n ? (i = "CategoryViewId2_SortAttr", a = "CategoryViewId2_SortState") : (i = "CategoryViewId5_SortAttr", a = "CategoryViewId5_SortState"); else {
                    if (t !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    i = "CategoryViewId3_SortAttr", a = "CategoryViewId3_SortState"
                }
                r.ConfigNS.setValue("TaskList", i, e.sortBy);
                let s = e.asce ? 0 : -1;
                r.ConfigNS.setValue("TaskList", a, s)
            } while (0)
        }

        function u(e, t) {
            let n = null;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? n = ((e, n) => {
                let i = e.createTime, a = n.createTime;
                return t ? i - a : a - i
            }) : e === o.DownloadKernel.CategroyViewID.Completed ? n = ((e, n) => {
                let i = e.completionTime, a = n.completionTime;
                return t ? i - a : a - i
            }) : e === o.DownloadKernel.CategroyViewID.Recycle && (n = ((e, n) => {
                let i = e.recycleTime, a = n.recycleTime;
                return t ? i - a : a - i
            })), n
        }

        function d(e) {
            return (t, n) => {
                let a = t.taskType, o = n.taskType;
                if (e) {
                    if (a === o) {
                        let e = i.extname(t.taskName).toLowerCase(), a = i.extname(n.taskName).toLowerCase();
                        return e === a ? 0 : e < a ? -1 : 1
                    }
                    return a - o
                }
                if (a === o) {
                    let e = i.extname(t.taskName).toLowerCase(), a = i.extname(n.taskName).toLowerCase();
                    return e === a ? 0 : e < a ? 1 : -1
                }
                return o - a
            }
        }

        function c(e) {
            return (t, n) => {
                let i = t.fileSize, a = n.fileSize;
                return e ? i - a : a - i
            }
        }

        function h(e) {
            return (t, n) => {
                let i = t.taskName, o = n.taskName;
                return e ? a.ThunderHelper.compareStr(o, i) : a.ThunderHelper.compareStr(i, o)
            }
        }

        function f(e) {
            return (t, n) => {
                let i = s.TaskStatusHelper.getValueForSort(t), a = s.TaskStatusHelper.getValueForSort(n);
                return e ? i - a : a - i
            }
        }

        function g(e) {
            return (t, n) => {
                if (0 === t.fileSize && n.fileSize > 0) return e ? -1 : 1;
                if (t.fileSize > 0 && 0 === n.fileSize) return e ? 1 : -1;
                if (0 === t.fileSize && 0 === n.fileSize) return 0;
                {
                    let i = t.downloadSize / t.fileSize, a = n.downloadSize / n.fileSize;
                    return e ? i - a : a - i
                }
            }
        }

        function p(e, i, a) {
            let o = null;
            void 0 !== a && null !== a || (a = n(e, i));
            do {
                if (a.asce = !1, a.sortBy === t.Default) {
                    o = u(e, !1);
                    break
                }
                if (a.sortBy === t.ByTime_Creation || a.sortBy === t.ByTime_Completion || a.sortBy === t.ByTime_Remain) {
                    o = u(e, a.asce);
                    break
                }
                if (a.sortBy === t.BySize) {
                    o = c(a.asce);
                    break
                }
                if (a.sortBy === t.ByType) {
                    o = d(a.asce);
                    break
                }
                if (a.sortBy === t.ByName) {
                    o = h(a.asce);
                    break
                }
                if (a.sortBy === t.ByProgress) {
                    o = g(a.asce);
                    break
                }
                if (a.sortBy === t.ByState) {
                    o = f(a.asce);
                    break
                }
            } while (0);
            return null === o && (o = u(e, !1)), o
        }

        function k(e, t, n) {
            let i = void 0, a = void 0;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? a = 0 : e === o.DownloadKernel.CategroyViewID.Completed ? a = 1 : e === o.DownloadKernel.CategroyViewID.Recycle && (a = 2), void 0 !== a && (i = {
                compareFn: p(e, t, n),
                index: a,
                categoryId: t
            }), i
        }

        !function (e) {
            e[e.Default = -10] = "Default", e[e.ByTime_Remain = 14] = "ByTime_Remain", e[e.ByTime_Creation = 17] = "ByTime_Creation", e[e.ByTime_Completion = 19] = "ByTime_Completion", e[e.ByType = 16] = "ByType", e[e.ByName = 1] = "ByName", e[e.BySize = 9] = "BySize", e[e.ByProgress = 18] = "ByProgress", e[e.ByState = 10] = "ByState", e[e.ByTime = 99] = "ByTime"
        }(t = e.SortType || (e.SortType = {})), e.getSortConfig = n, e.setSortConfig = l, e.getSortFuncByConfig = p, e.getSortCommitParamByConfig = k, e.handleSortMenuClick = function (e, n, i, a, r) {
            let s = !1;
            n === t.ByTime && (n = a === o.DownloadKernel.CategroyViewID.Downloading ? t.ByTime_Creation : a === o.DownloadKernel.CategroyViewID.Completed ? t.ByTime_Completion : a === o.DownloadKernel.CategroyViewID.Recycle ? t.ByTime_Remain : t.Default), n !== t.Default && (s = void 0 === i || i), l({
                sortBy: n,
                asce: !s
            }, a, r), e(k(a, r))
        }
    }(t.SortNS || (t.SortNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(718), a = n(1).default.getLogger("Thunder.VipDownload.download-manager");
    !function (e) {
        let t;
        !function (e) {
            e[e.Download = 0] = "Download", e[e.Speed = 1] = "Speed", e[e.Dcdn = 2] = "Dcdn"
        }(t = e.ErrorType || (e.ErrorType = {}));

        class n {
            constructor() {
                this.codeMap = new Map
            }

            init() {
                (new i.VipTaskHttpSession).queryErrorCode().then(e => {
                    this.onErrorCodeCallback(e)
                }).catch()
            }

            getMessage(e, t) {
                let n = void 0, i = this.codeMap.get(e);
                return i && (n = i.get(t)), n
            }

            onErrorCodeCallback(e) {
                if (a.information("onErrorCodeCallback--\x3e"), e && 0 === e.result && e.task_info && e.task_info.pc_client) {
                    let n = e.task_info.pc_client;
                    n.speed_code && this.setCodeMap(t.Speed, n.speed_code), n.download_code && this.setCodeMap(t.Download, n.download_code), n.dcdn_code && this.setCodeMap(t.Dcdn, n.dcdn_code)
                }
                a.information("<--onErrorCodeCallback")
            }

            setCodeMap(e, t) {
                let n = new Map;
                for (let e of t) if (e.code) {
                    let t = e.code.length, i = e.code.search(/\-/);
                    if (i > 0 && i < t - 1) {
                        let a = Number(e.code.substring(0, i)), o = Number(e.code.substring(i + 1, t));
                        for (let t = a; t <= o; t++) n.set(t, e.message)
                    } else {
                        let t = Number(e.code);
                        n.set(t, e.message)
                    }
                }
                this.codeMap.set(e, n)
            }
        }

        e.ErrorCodeHelper = n;
        const o = new n;
        e.getHelper = function () {
            return o
        }
    }(t.ErrorCodeHelperNS || (t.ErrorCodeHelperNS = {}))
}, function (e, t, n) {
    (function () {
        "use strict";
        var e, i, a, o, r = {}.hasOwnProperty;
        i = n(569), e = n(793), a = n(798), o = n(723), t.defaults = i.defaults, t.processors = o, t.ValidationError = function (e) {
            function t(e) {
                this.message = e
            }

            return function (e, t) {
                for (var n in t) r.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(t, Error), t
        }(), t.Builder = e.Builder, t.Parser = a.Parser, t.parseString = a.parseString
    }).call(this)
}, function (e, t) {
    (function () {
        t.defaults = {
            .1: {
                explicitCharkey: !1,
                trim: !0,
                normalize: !0,
                normalizeTags: !1,
                attrkey: "@",
                charkey: "#",
                explicitArray: !1,
                ignoreAttrs: !1,
                mergeAttrs: !1,
                explicitRoot: !1,
                validator: null,
                xmlns: !1,
                explicitChildren: !1,
                childkey: "@@",
                charsAsChildren: !1,
                includeWhiteChars: !1,
                async: !1,
                strict: !0,
                attrNameProcessors: null,
                attrValueProcessors: null,
                tagNameProcessors: null,
                valueProcessors: null,
                emptyTag: ""
            },
            .2: {
                explicitCharkey: !1,
                trim: !1,
                normalize: !1,
                normalizeTags: !1,
                attrkey: "$",
                charkey: "_",
                explicitArray: !0,
                ignoreAttrs: !1,
                mergeAttrs: !1,
                explicitRoot: !0,
                validator: null,
                xmlns: !1,
                explicitChildren: !1,
                preserveChildrenOrder: !1,
                childkey: "$$",
                charsAsChildren: !1,
                includeWhiteChars: !1,
                async: !1,
                strict: !0,
                attrNameProcessors: null,
                attrValueProcessors: null,
                tagNameProcessors: null,
                valueProcessors: null,
                rootName: "root",
                xmldec: {version: "1.0", encoding: "UTF-8", standalone: !0},
                doctype: null,
                renderOpts: {pretty: !0, indent: "  ", newline: "\n"},
                headless: !1,
                chunkSize: 1e4,
                emptyTag: "",
                cdata: !1
            }
        }
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, g, p = {}.hasOwnProperty;
        l = n(271), u = n(272), t = n(269), i = n(270), d = n(268), h = n(277), f = n(278), c = n(279), a = n(273), o = n(275), r = n(274), s = n(276), g = n(722), e.exports = function (e) {
            function n(e) {
                n.__super__.constructor.call(this, e)
            }

            return function (e, t) {
                for (var n in t) p.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, g), n.prototype.document = function (e) {
                var t, n, a, o, r;
                for (this.textispresent = !1, o = "", n = 0, a = (r = e.children).length; n < a; n++) t = r[n], o += function () {
                    switch (!1) {
                        case!(t instanceof l):
                            return this.declaration(t);
                        case!(t instanceof u):
                            return this.docType(t);
                        case!(t instanceof i):
                            return this.comment(t);
                        case!(t instanceof c):
                            return this.processingInstruction(t);
                        default:
                            return this.element(t, 0)
                    }
                }.call(this);
                return this.pretty && o.slice(-this.newline.length) === this.newline && (o = o.slice(0, -this.newline.length)), o
            }, n.prototype.attribute = function (e) {
                return " " + e.name + '="' + e.value + '"'
            }, n.prototype.cdata = function (e, t) {
                return this.space(t) + "<![CDATA[" + e.text + "]]>" + this.newline
            }, n.prototype.comment = function (e, t) {
                return this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.newline
            }, n.prototype.declaration = function (e, t) {
                var n;
                return n = this.space(t), n += '<?xml version="' + e.version + '"', null != e.encoding && (n += ' encoding="' + e.encoding + '"'), null != e.standalone && (n += ' standalone="' + e.standalone + '"'), n += this.spacebeforeslash + "?>", n += this.newline
            }, n.prototype.docType = function (e, n) {
                var l, u, d, h, f;
                if (n || (n = 0), h = this.space(n), h += "<!DOCTYPE " + e.root().name, e.pubID && e.sysID ? h += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (h += ' SYSTEM "' + e.sysID + '"'), e.children.length > 0) {
                    for (h += " [", h += this.newline, u = 0, d = (f = e.children).length; u < d; u++) l = f[u], h += function () {
                        switch (!1) {
                            case!(l instanceof a):
                                return this.dtdAttList(l, n + 1);
                            case!(l instanceof o):
                                return this.dtdElement(l, n + 1);
                            case!(l instanceof r):
                                return this.dtdEntity(l, n + 1);
                            case!(l instanceof s):
                                return this.dtdNotation(l, n + 1);
                            case!(l instanceof t):
                                return this.cdata(l, n + 1);
                            case!(l instanceof i):
                                return this.comment(l, n + 1);
                            case!(l instanceof c):
                                return this.processingInstruction(l, n + 1);
                            default:
                                throw new Error("Unknown DTD node type: " + l.constructor.name)
                        }
                    }.call(this);
                    h += "]"
                }
                return h += this.spacebeforeslash + ">", h += this.newline
            }, n.prototype.element = function (e, n) {
                var a, o, r, s, l, u, g, k, m, T, v, C, S;
                for (g in n || (n = 0), S = !1, this.textispresent ? (this.newline = "", this.pretty = !1) : (this.newline = this.newlinedefault, this.pretty = this.prettydefault), k = "", k += (C = this.space(n)) + "<" + e.name, m = e.attributes) p.call(m, g) && (a = m[g], k += this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? k += "></" + e.name + ">" + this.newline : k += this.spacebeforeslash + "/>" + this.newline; else if (this.pretty && 1 === e.children.length && null != e.children[0].value) k += ">", k += e.children[0].value, k += "</" + e.name + ">" + this.newline; else {
                    if (this.dontprettytextnodes) for (r = 0, l = (T = e.children).length; r < l; r++) if (null != (o = T[r]).value) {
                        this.textispresent++, S = !0;
                        break
                    }
                    for (this.textispresent && (this.newline = "", this.pretty = !1, C = this.space(n)), k += ">" + this.newline, s = 0, u = (v = e.children).length; s < u; s++) o = v[s], k += function () {
                        switch (!1) {
                            case!(o instanceof t):
                                return this.cdata(o, n + 1);
                            case!(o instanceof i):
                                return this.comment(o, n + 1);
                            case!(o instanceof d):
                                return this.element(o, n + 1);
                            case!(o instanceof h):
                                return this.raw(o, n + 1);
                            case!(o instanceof f):
                                return this.text(o, n + 1);
                            case!(o instanceof c):
                                return this.processingInstruction(o, n + 1);
                            default:
                                throw new Error("Unknown XML node type: " + o.constructor.name)
                        }
                    }.call(this);
                    S && this.textispresent--, this.textispresent || (this.newline = this.newlinedefault, this.pretty = this.prettydefault), k += C + "</" + e.name + ">" + this.newline
                }
                return k
            }, n.prototype.processingInstruction = function (e, t) {
                var n;
                return n = this.space(t) + "<?" + e.target, e.value && (n += " " + e.value), n += this.spacebeforeslash + "?>" + this.newline
            }, n.prototype.raw = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, n.prototype.text = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, n.prototype.dtdAttList = function (e, t) {
                var n;
                return n = this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType, "#DEFAULT" !== e.defaultValueType && (n += " " + e.defaultValueType), e.defaultValue && (n += ' "' + e.defaultValue + '"'), n += this.spacebeforeslash + ">" + this.newline
            }, n.prototype.dtdElement = function (e, t) {
                return this.space(t) + "<!ELEMENT " + e.name + " " + e.value + this.spacebeforeslash + ">" + this.newline
            }, n.prototype.dtdEntity = function (e, t) {
                var n;
                return n = this.space(t) + "<!ENTITY", e.pe && (n += " %"), n += " " + e.name, e.value ? n += ' "' + e.value + '"' : (e.pubID && e.sysID ? n += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (n += ' SYSTEM "' + e.sysID + '"'), e.nData && (n += " NDATA " + e.nData)), n += this.spacebeforeslash + ">" + this.newline
            }, n.prototype.dtdNotation = function (e, t) {
                var n;
                return n = this.space(t) + "<!NOTATION " + e.name, e.pubID && e.sysID ? n += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.pubID ? n += ' PUBLIC "' + e.pubID + '"' : e.sysID && (n += ' SYSTEM "' + e.sysID + '"'), n += this.spacebeforeslash + ">" + this.newline
            }, n.prototype.openNode = function (e, t) {
                var n, i, a, o;
                if (t || (t = 0), e instanceof d) {
                    for (i in a = this.space(t) + "<" + e.name, o = e.attributes) p.call(o, i) && (n = o[i], a += this.attribute(n));
                    return a += (e.children ? ">" : "/>") + this.newline
                }
                return a = this.space(t) + "<!DOCTYPE " + e.rootNodeName, e.pubID && e.sysID ? a += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (a += ' SYSTEM "' + e.sysID + '"'), a += (e.children ? " [" : ">") + this.newline
            }, n.prototype.closeNode = function (e, t) {
                switch (t || (t = 0), !1) {
                    case!(e instanceof d):
                        return this.space(t) + "</" + e.name + ">" + this.newline;
                    case!(e instanceof u):
                        return this.space(t) + "]>" + this.newline
                }
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(7), o = n(25), r = a.default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = "HKEY_LOCAL_MACHINE", i = "Software\\Thunder Network\\Xmp", a = e;
                t = r.queryRegValue(n, i, a);
                let o = r.getLongPathName(t);
                null !== o && void 0 !== o && "" !== o && (t = o)
            } while (0);
            return t
        }

        e.getXmpPath = function () {
            let e = "";
            return e = "1" === o.ConfigNS.getValue("DownloadAndPlay", "LanuchMediaPlayer", "0") ? t("Path") : i.join(__rootDir, "../../XMP/XMP.exe")
        }, e.getXmpReg = t
    }(t.DownloadAndPlayNS || (t.DownloadAndPlayNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = n(719), r = n(2), s = n(10), l = n(8), u = n(32), d = n(34), c = n(134), h = n(105), f = n(1),
        g = n(571), p = n(807), k = n(25), m = n(7), T = n(33), v = n(12), C = n(3), S = n(15), y = n(202), w = n(28),
        I = n(229), b = m.default(r.join(__rootDir, "../bin/ThunderHelper.node")),
        A = f.default.getLogger("DownloadAndPlayHelper"), N = u.DownloadKernelTaskManager.getTaskManager(),
        D = d.DownloadKernelEventManager.getEventManager(),
        _ = ["libcurl.dll", "libeay32.dll", "ssleay32.dll", "XLBugHandler.dll", "XLBugReport.exe"];
    const x = new class {
        constructor() {
            this.taskStatusChangedEventTable = [], A.information("constructor DownloadAndPlayHelper object")
        }

        init() {
            return i(this, void 0, void 0, function* () {
                if (!1 === (yield this.isCodecsIntegral())) {
                    let e = a.tmpdir(), t = "APlayerCodecs3.exe", n = r.join(e, "..\\..\\"), i = r.join(n, t);
                    (yield s.FileSystemAWNS.existsAW(i)) && (yield s.FileSystemAWNS.unlinkAW(i)), A.information("downloadplay:", n, i);
                    let o = "http://";
                    A.information(n, i);
                    let u = {taskBaseInfo: {savePath: n, taskName: t}, p2spTaskInfo: {url: o}, isBackground: !0},
                        d = yield N.createTask(l.DownloadKernel.TaskType.P2sp, u);
                    if (null !== d) {
                        let e = d.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        this.attachTaskStatusChangedEvent(e), c.DownloadDispatchNS.startTask(e)
                    }
                }
                p.DownloadAndPlayIPCNS.init()
            })
        }

        uninit() {
            p.DownloadAndPlayIPCNS.uninit()
        }

        installXmp() {
            return i(this, void 0, void 0, function* () {
                let e = null;
                return "1" === k.ConfigNS.getValue("DownloadAndPlay", "LanuchMediaPlayer", "0") ? (A.information("XmpFixBoxEx: ipcMain on channelRMDownloadXmpEx"), T.MessageBox.confirm({
                    title: "您还没有安装迅雷影音，需要现在下载吗？",
                    type: T.MessageBox.ConfirmType.Warning,
                    fileName: "",
                    okText: "立即下载",
                    cancelText: "取消",
                    cancelVisible: !0
                }).then(e => i(this, void 0, void 0, function* () {
                    e.action === w.MessageBoxNS.Action.OK ? yield this.downloadXmpEx() : e.action === w.MessageBoxNS.Action.Cancel ? A.information("XmpFixBoxEx: Cancel") : e.action === w.MessageBoxNS.Action.Close && A.information("XmpFixBoxEx: Close")
                })).catch()) : e = new Promise(e => i(this, void 0, void 0, function* () {
                    let t = r.join(__rootDir, "../../MiniXmp.zip"), n = r.join(__rootDir, "../../XMP/");
                    (yield s.FileSystemAWNS.existsAW(t)) ? (C.remote.ipcMain.once(S.ThunderChannelList.channelRMXmpFixBoxCreated, () => {
                        y.UnzipUtilitiesAWNS.uncompressZipFile(n, t).then(t => i(this, void 0, void 0, function* () {
                            C.ipcRenderer.send(S.ThunderChannelList.channelMRFixXmpSuc), A.information("XmpFixBoxEx: Send channelMRFixXmpSuc");
                            let t = r.join(__rootDir, "../../");
                            for (let e = 0; e < _.length; e++) {
                                let i = r.join(t, _[e]), a = r.join(n, _[e]);
                                yield s.FileSystemAWNS.copyFileAW(i, a)
                            }
                            e(!0)
                        }), () => {
                            C.ipcRenderer.send(S.ThunderChannelList.channelMRFixXMPFail), e(!1)
                        })
                    }), C.remote.ipcMain.once(S.ThunderChannelList.channelRMDownloadXmp, this.downloadXmp), T.MessageBox.custom("XmpFixBox").catch(() => {
                        C.remote.ipcMain.removeListener(S.ThunderChannelList.channelRMDownloadXmp, this.downloadXmp)
                    })) : (this.downloadXmp(), e(!1))
                })), e
            })
        }

        openXmp(e) {
            return i(this, void 0, void 0, function* () {
                let t = 0;
                {
                    let n = g.DownloadAndPlayNS.getXmpPath();
                    if (null === n || void 0 === n || "" === n) yield this.installXmp(); else {
                        let i = r.dirname(n);
                        b.shellExecute(0, "open", n, e, i, "SW_SHOW") > 32 && (t = 1)
                    }
                }
                return t
            })
        }

        getXmpCoreVersion() {
            return i(this, void 0, void 0, function* () {
                let e = "", t = g.DownloadAndPlayNS.getXmpPath();
                return (yield s.FileSystemAWNS.existsAW(t)) && (e = b.getFileVersion(t)), e
            })
        }

        getXmpUserDataPath() {
            return i(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let n = r.join(__rootDir, "../../XMP");
                    t = "V" + t, e = r.join(n, t) + "\\XMP5\\" + t
                } while (0);
                return e
            })
        }

        getXmpBuildNum() {
            return i(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let n = t.split(/\./);
                    null !== n && void 0 !== n && 4 === n.length && (e = n[3])
                } while (0);
                return e
            })
        }

        downloadXmp() {
            let e = [];
            e.push("http://xmp.down.sandai.net/xmp/XMPSetup-xlx.exe"), h.ThunderNewTask.createPreNewTaskWindow(e)
        }

        downloadXmpEx() {
            return i(this, void 0, void 0, function* () {
                A.information("XmpFixBoxEx: enter downloadXmpEx");
                const e = u.DownloadKernelTaskManager.getTaskManager();
                let t = yield I.TaskUtilitiesAWNS.batchFindTaskAW([{
                    taskType: l.DownloadKernel.TaskType.P2sp,
                    value: "http://xmp.down.sandai.net/xmp/XMPSetup-xlx.exe"
                }]);
                if (t.length > 0) T.MessageBox.confirm({
                    title: "重复下载，该任务已存在列表中",
                    type: T.MessageBox.ConfirmType.Warning,
                    fileName: "XMPSetup-xlx.exe",
                    okText: "查看",
                    cancelText: "取消",
                    cancelVisible: !0
                }).then(e => i(this, void 0, void 0, function* () {
                    if (e.action === w.MessageBoxNS.Action.OK) {
                        let e = t[0].getId();
                        h.ThunderNewTask.selectTask(e)
                    } else e.action, w.MessageBoxNS.Action.Cancel
                })).catch(); else {
                    let t = v.ThunderUtil.getDefaultDownloadDir(),
                        n = {taskName: "", savePath: "", taskName: "XMPSetup-xlx.exe"};
                    n.savePath = t;
                    let i = {url: "http://xmp.down.sandai.net/xmp/XMPSetup-xlx.exe", refUrl: "", cookie: ""},
                        a = yield e.createTask(l.DownloadKernel.TaskType.P2sp, {taskBaseInfo: n, p2spTaskInfo: i});
                    if (null !== a) {
                        let t = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        e.startTask(t)
                    }
                }
            })
        }

        isCodecsIntegral() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                {
                    let t = b.getPublicUserDataPath(),
                        n = r.join(t, "Thunder Network\\APlayer\\codecs\\avisplitter.dll"),
                        i = r.join(t, "Thunder Network\\APlayer\\codecs\\realmediasplitter.dll");
                    (yield s.FileSystemAWNS.existsAW(n)) && (yield s.FileSystemAWNS.existsAW(i)) && (e = !0)
                }
                return e
            })
        }

        attachTaskStatusChangedEvent(e) {
            void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = D.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                do {
                    if (!t) break;
                    if (t[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let n = t[1];
                    if (n.length > 0) {
                        let t = n[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                            i = n[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), a = r.join(t, i);
                        s.FileSystemAWNS.existsAW(a).then(t => {
                            if (t && n[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId) === e) {
                                let t = n[0].getTaskStatus();
                                t !== l.DownloadKernel.TaskStatus.Succeeded && t !== l.DownloadKernel.TaskStatus.Seeding || (A.information("downloadplay:运行exe = ", a), o.spawn(a), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (A.information("downloadplay:取消监听 ", this.taskStatusChangedEventTable[e]), D.detachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null))
                            }
                        }).catch()
                    }
                } while (0)
            }))
        }
    };
    t.default = x
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(725), r = n(21), s = n(2), l = n(5), u = n(78), d = n(809),
        c = n(1).default.getLogger("Thunder.Main.Renderer.Embedded.Browser"),
        h = a.remote.require(s.join(__rootDir, "../bin/ThunderHelper.node"));
    t.EmbeddedBrowser = class {
        constructor() {
            this.isAlreadyClose = !1, this.width = 460, this.height = 500, this.browserCtr = null, this.wnd = null, this.leftMargin = 5, this.rigthMargin = 5, this.topMargin = 58, this.bootomMargin = 2, this.callBackShow = null, this.callBackClose = null, this.callBackClosed = null, this.attachListener()
        }

        createWnd(e, t, n, i, s, l, c, f, g, p, k, m, T, v) {
            do {
                if (null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed()) break;
                this.isAlreadyClose = !1, this.width = s, this.height = l, this.leftMargin = c, this.rigthMargin = f, this.topMargin = g, this.bootomMargin = p, this.callBackShow = m, this.callBackClose = T, this.callBackClosed = v;
                let C = "development" === process.env.RUN_ENV ? "http://localhost:9080/embedded-browser-renderer/" : `file:///${__dirname}/../embedded-browser-renderer/index.html`;
                C += `?browserType=${i}&title=${t}`;
                let S = a.remote.getCurrentWindow();
                this.wnd = new a.remote.BrowserWindow({
                    width: this.width,
                    height: this.height,
                    resizable: !1,
                    frame: !1,
                    parent: S,
                    center: !0,
                    show: !1,
                    modal: n
                }), a.ipcRenderer.send("embedded-browser-create", this.wnd.id), this.wnd.loadURL(C), u.ThunderWindowNS.fitWindowPosInParent(this.wnd, S);
                let y = d.CommonFunctionNs.getBrowserWindowRect(this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bootomMargin);
                this.browserCtr = new o.BrowserCtrl, this.wnd.once("ready-to-show", () => {
                    let t = this.wnd.getNativeWindowHandle().readUIntLE(0, 4);
                    this.showWnd().catch(), this.browserCtr.createChromiumBrowser(t, e, !1, y, this.getDefaultEvents()), this.registerNativeFunctions(k), h.setWindowLong(t, r.SetWindowType.GWL_STYLE, r.WindowStyle.WS_CLIPCHILDREN)
                }), this.wnd.on("resize", () => {
                    d.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bootomMargin)
                }), this.wnd.on("move", () => {
                    d.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bootomMargin)
                }), this.wnd.hookWindowMessage(736, (e, t) => {
                    null === this.wnd || void 0 === this.wnd || this.wnd.isDestroyed() || this.wnd.setSize(this.width, this.height)
                }), this.wnd.once("show", () => {
                    this.wnd.setSize(this.width, this.height)
                }), this.wnd.once("close", () => {
                    null !== this.callBackClose && void 0 !== this.callBackClose && "function" == typeof this.callBackClose && this.callBackClose().catch(), this.browserCtr.destroyBrowser(!1)
                }), this.wnd.once("closed", () => {
                    null !== this.callBackClosed && void 0 !== this.callBackClosed && "function" == typeof this.callBackClosed && this.callBackClosed(), this.isAlreadyClose = !1, this.wnd = null, this.browserCtr = null
                })
            } while (0)
        }

        closeWnd() {
            null === this.wnd || void 0 === this.wnd || this.wnd.isDestroyed() || !1 !== this.isAlreadyClose || (this.isAlreadyClose = !0, this.wnd.close())
        }

        showWnd() {
            return i(this, void 0, void 0, function* () {
                null === this.wnd || void 0 === this.wnd || this.wnd.isDestroyed() || (null !== this.callBackShow && void 0 !== this.callBackShow && "function" == typeof this.callBackShow ? (yield this.callBackShow()) ? this.wnd.show() : this.closeWnd() : this.wnd.show())
            })
        }

        registerNativeFunction(e, t) {
            do {
                if (null === this.browserCtr || void 0 === this.browserCtr) break;
                if (null === e || void 0 === e || "" === e) break;
                if (null === t || void 0 === t) break;
                this.browserCtr.registerNativeFunction(e, t, !0)
            } while (0)
        }

        getBrowserObj() {
            return this.browserCtr
        }

        onLoadError(e, t, n, i, a, o) {
            if (null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed() && e) if (-3 === n) {
                let e = o.getWindowHandle();
                h.showWindow(e, r.showCmd.SW_SHOW)
            } else !1 === this.isAlreadyClose && this.closeWnd()
        }

        onLoadEnd(e, t, n, i, a) {
            if (c.information("OnLoadEnd isMainframe", e), null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed() && e) {
                let e = a.getWindowHandle();
                h.showWindow(e, r.showCmd.SW_SHOW)
            }
        }

        onBeforeNavigate(e, t, n, i) {
            if (c.information("OnBeforeNavigate isMainframe", e), null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed() && e) {
                let e = i.getWindowHandle();
                h.showWindow(e, r.showCmd.SW_HIDE)
            }
        }

        getDefaultEvents() {
            return [{
                eventName: "OnBeforeNavigate",
                listener: this.onBeforeNavigate.bind(this)
            }, {eventName: "OnLoadError", listener: this.onLoadError.bind(this)}, {
                eventName: "OnLoadEnd",
                listener: this.onLoadEnd.bind(this)
            }]
        }

        attachListener() {
            l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogin", e)
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogout", e)
            }), a.remote.ipcMain.on("eventShowDevTool", (e, t) => {
            })
        }

        registerNativeFunctions(e) {
            do {
                if (null === this.browserCtr || void 0 === this.browserCtr) break;
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) this.browserCtr.registerNativeFunction(e[t].functionName, e[t].nativeFunc, !0)
            } while (0)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(726), a = n(810), o = n(281), r = n(811), s = n(573), l = n(21),
        u = n(1).default.getLogger("EmbeddedBrowserManagerNs");
    let d = [];
    !function (e) {
        function t(e, ...t) {
            do {
                if (null === e || void 0 === e || "" === e) {
                    u.information("createWebWnd 参数错误：webType=", e);
                    break
                }
                let n = t[0];
                if (null === n || void 0 === n || "" === n) {
                    u.information("createWebWnd 参数错误：url=", n);
                    break
                }
                let i = t[1];
                if (null === i || void 0 === i || "" === i) {
                    u.information("createWebWnd 参数错误：title=", i);
                    break
                }
                let a = t[2];
                null !== a && void 0 !== a || (a = !0);
                let o = e, r = t[3];
                if (null === r || void 0 === r || r <= 0) {
                    u.information("createWebWnd 参数错误：wndWidth=", r);
                    break
                }
                let l = t[4];
                if (null === l || void 0 === l || l <= 0) {
                    u.information("createWebWnd 参数错误：wndHeight=", l);
                    break
                }
                let c = t[5];
                if (null === c || void 0 === c) {
                    u.information("createWebWnd 参数错误：browserLeftMargin=", c);
                    break
                }
                let h = t[6];
                if (null === h || void 0 === h) {
                    u.information("createWebWnd 参数错误：browserRightMargin=", h);
                    break
                }
                let f = t[7];
                if (null === f || void 0 === f) {
                    u.information("createWebWnd 参数错误：browserTopMargin=", f);
                    break
                }
                let g = t[8];
                if (null === g || void 0 === g) {
                    u.information("createWebWnd 参数错误：browserBootomMargin=", g);
                    break
                }
                let p = d.filter(t => e === t.moduleName), k = null;
                if (!(null === p || void 0 === p || p.length <= 0)) {
                    k = p[0].embeddedBrowserObj;
                    break
                }
                {
                    k = new s.EmbeddedBrowser;
                    let t = {moduleName: e, embeddedBrowserObj: k};
                    d.push(t)
                }
                let m = t[9], T = t[10], v = t[11];
                k.createWnd(n, i, a, o, r, l, c, h, f, g, m, T, v, () => {
                    for (let t in d) if (d[Number(t)].moduleName === e) {
                        d.splice(Number(t), 1);
                        break
                    }
                })
            } while (0)
        }

        e.showWebWnd = function (e, ...n) {
            if ("sign" === e) {
                let e = "";
                null !== n && void 0 !== n && null !== n[0] && void 0 !== n[0] && (e = n[0]), i.signObject.createSignDlg(e, a.signNative.getNativeFunctionMap()).catch()
            } else if ("phoneAuth" === e) {
                let e = "";
                null !== n && void 0 !== n && null !== n[0] && void 0 !== n[0] && (e = n[0]), o.phoneAuthObject.createPhoneAuthDlg(e, r.phoneAuthNative.getNativeFunctionMap()).catch()
            } else t(e, ...n)
        }, e.createWebWnd = t, e.registerWebFunction = function (e, t, n) {
            let i = d.filter(t => e === t.moduleName);
            null !== i && void 0 !== i && i.length > 0 && i[0].embeddedBrowserObj.registerNativeFunction(t, n)
        }, e.callBackWebFunction = function (e, t, n, i) {
            let a = d.filter(t => e === t.moduleName);
            if (null !== a && void 0 !== a && a.length > 0) {
                let e = a[0].embeddedBrowserObj.getBrowserObj();
                null !== e && void 0 !== e && e.callNativeFunctionCallback(t, n, l.NativeFunctionErrorCode.Success, i)
            }
        }, e.fireEventWebFunction = function (e, ...t) {
            let n = d.filter(t => e === t.moduleName);
            if (null !== n && void 0 !== n && n.length > 0) {
                let e = n[0].embeddedBrowserObj.getBrowserObj();
                if (null !== e && void 0 !== e) {
                    let n = t[0];
                    if (null === n || void 0 === n || "" === n) return;
                    t.splice(0, 1), e.fireEvent(n, ...t)
                }
            }
        }
    }(t.EmbeddedBrowserManagerNs || (t.EmbeddedBrowserManagerNs = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(129), o = n(68), r = n(143), s = n(246), l = n(8), u = n(730), d = n(577), c = n(728), h = n(232),
        f = n(145), g = n(56), p = n(1).default.getLogger("Thunder.VipDownload.download-manager"),
        k = r.DkHelperNS.getHelper(), m = o.UserHelperNS.getHelper(), T = s.TaskManagerNS.getTaskManager(),
        v = h.KuainiaoManagerNS.getManager(), C = f.TaskEventContainerNS.getEventContainer();

    class S {
        constructor() {
            this.mExpandTaskId = void 0, this.mIsUpdateTotalAcclerateStatus = !1, this.mIsTotalAcclrating = !1
        }

        get expandTaskId() {
            return this.mExpandTaskId
        }

        init() {
            m.attachListener(o.UserEventNS.authorityChanged, (e, t) => i(this, void 0, void 0, function* () {
                yield this.onUserAuthorityChanged(e, t)
            })), this.attachDkEvents(), v.attachListener(h.KuainiaoEventNS.statusChanged, e => {
                this.onKuaiNiaoStatusChanged(e)
            }), C.attachListener(f.TaskEventNS.taskAcclerateStatusChanged, () => {
                this.onTaskAcclerateStatusChanged()
            }), this.loadTryDataBase().catch()
        }

        onTaskExpand(e) {
            return i(this, void 0, void 0, function* () {
                if (this.mExpandTaskId !== e) {
                    p.information("onTaskExpand", "taskId", e), this.mExpandTaskId = e;
                    let t = yield T.createTask(e);
                    t && (t.onExpand(), C.onEvent(f.TaskEventNS.taskExpand, e))
                }
            })
        }

        onTaskUnExpand(e) {
            e === this.mExpandTaskId && (p.information("onTaskUnExpand", "taskId", e), this.mExpandTaskId = void 0)
        }

        enterAcclerate(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = yield T.createTask(e);
                n && n.getTaskExtra().enterAcclerate(t)
            })
        }

        autoAcclerate(e) {
            return i(this, void 0, void 0, function* () {
                let t = yield T.createTask(e);
                t && t.getTaskExtra().autoAcclerate()
            })
        }

        createVipTaskInfo(e) {
            let t = null, n = T.getTask(e);
            if (n) {
                t = n.getTaskExtra().createVipTaskInfo()
            }
            return t
        }

        getVipTaskInfo(e) {
            let t = null, n = T.getTask(e);
            if (n) {
                t = n.getTaskExtra().getVipTaskInfo()
            }
            return t
        }

        getVipSubTaskInfo(e, t) {
            let n = null, i = T.getTask(e);
            if (i) {
                n = i.getTaskExtra().getVipSubTaskInfo(t)
            }
            return n
        }

        attachDkEvents() {
            k.attachListener(r.DkEventNS.taskCompleted, e => {
                this.onTaskCompleted(e)
            }), k.attachListener(r.DkEventNS.taskRemoved, e => {
                this.onTaskRemoved(e)
            }), k.attachListener(r.DkEventNS.taskStatusChanged, (e, t) => i(this, void 0, void 0, function* () {
                yield this.onTaskStatusChanged(e, t)
            })), k.attachListener(r.DkEventNS.taskDetailChanged, (e, t) => {
                this.onTaskDetailChanged(e, t)
            }), k.attachListener(r.DkEventNS.taskDcdnStatusChanged, (e, t) => {
                this.onTaskDcdnStatusChanged(e, t)
            }), k.attachListener(r.DkEventNS.btSubFileDcdnStatusChanged, (e, t, n) => {
                this.onBtSubFileDcdnStatusChanged(e, t, n)
            }), k.attachListener(r.DkEventNS.btSubFileDetailChanged, (e, t) => {
                this.onBtSubFileDetailChanged(e, t)
            }), k.attachListener(r.DkEventNS.btSubFileForbidden, e => {
                this.onBtSubFileForbidden(e)
            })
        }

        onUserAuthorityChanged(e, t) {
            return i(this, void 0, void 0, function* () {
                if (e ? yield this.loadVipDataBase() : this.unloadVipDataBase(), m.offlineAuthority ? yield this.loadOfflineDataBase() : this.unloadOfflineDataBase(), T.getTaskMap().forEach(function (n) {
                    n.onUserAuthorityChanged(e, t)
                }), this.mExpandTaskId) {
                    let e = T.getTask(this.mExpandTaskId);
                    e && e.onExpand()
                }
            })
        }

        loadVipDataBase() {
            return i(this, void 0, void 0, function* () {
                p.information("loadVipDataBase");
                let e = u.VipTaskDataBaseNS.getTable();
                yield e.init(m.userId);
                let t = yield e.getTaskIds();
                for (let n of t) {
                    let t = yield k.IsTaskExist(n);
                    if (t) {
                        let e = yield k.getTaskStatus(n);
                        e !== l.DownloadKernel.TaskStatus.Succeeded && e !== l.DownloadKernel.TaskStatus.Seeding || (t = !1)
                    }
                    t ? yield this.autoAcclerate(n) : yield e.removeTask(n, -2)
                }
            })
        }

        unloadVipDataBase() {
            u.VipTaskDataBaseNS.getTable().clear()
        }

        loadOfflineDataBase() {
            return i(this, void 0, void 0, function* () {
                p.information("loadOfflineDataBase");
                let e = c.OfflineTaskDataBaseNS.getTable();
                yield e.init(m.userId);
                let t = yield e.getTaskIds();
                for (let n of t) {
                    let t = yield k.IsTaskExist(n);
                    if (t) {
                        let e = yield k.getTaskStatus(n);
                        e !== l.DownloadKernel.TaskStatus.Succeeded && e !== l.DownloadKernel.TaskStatus.Seeding || (t = !1)
                    }
                    t || (yield e.removeTask(n, -2))
                }
            })
        }

        unloadOfflineDataBase() {
            c.OfflineTaskDataBaseNS.getTable().clear()
        }

        loadTryDataBase() {
            return i(this, void 0, void 0, function* () {
                p.information("loadTryDataBase"), yield d.TryTaskDataBaseNS.getTable().init("0")
            })
        }

        onTaskCompleted(e) {
            let t = T.getTask(e);
            t && t.onTaskCompleted(), T.deleteTask(e)
        }

        onTaskRemoved(e) {
            let t = T.getTask(e);
            t && t.onTaskRemoved(), T.deleteTask(e)
        }

        onTaskStatusChanged(e, t) {
            return i(this, void 0, void 0, function* () {
                switch (t) {
                    case l.DownloadKernel.TaskStatus.DestroyPending:
                    case l.DownloadKernel.TaskStatus.Succeeded:
                        break;
                    default:
                        let n = yield T.createTask(e);
                        n && (yield n.onTaskStatusChanged(t))
                }
            })
        }

        onTaskDcdnStatusChanged(e, t) {
            let n = T.getTask(e);
            n && n.onTaskDcdnStatusChanged(-1, t)
        }

        onBtSubFileDcdnStatusChanged(e, t, n) {
            let i = T.getTask(e);
            i && i.onTaskDcdnStatusChanged(t, n)
        }

        onTaskDetailChanged(e, t) {
            let n = T.getTask(e);
            n && n.onTaskDetailChanged(t)
        }

        onBtSubFileDetailChanged(e, t) {
            let n = T.getTask(e);
            n && n.onBtSubFileDetailChanged(e, t)
        }

        onBtSubFileForbidden(e) {
            p.information("onBtSubFileForbidden", e), C.onEvent(f.TaskEventNS.btSubFileForbidden, e)
        }

        onKuaiNiaoStatusChanged(e) {
            T.getTaskMap().forEach(function (t) {
                let n = t.getTaskExtra();
                n.careKuaiNiao && n.onKuaiNiaoStatusChanged(e)
            })
        }

        onTaskAcclerateStatusChanged() {
            this.mIsUpdateTotalAcclerateStatus || (this.mIsUpdateTotalAcclerateStatus = !0, setTimeout(() => {
                let e = !1;
                if (T.getTaskMap().forEach(function (t) {
                    let n = t.getTaskExtra().getVipTaskInfo();
                    n && n.taskStatus > a.VipDownloadDefineNS.VipTaskStatus.Init && (e = !0)
                }), e !== this.mIsTotalAcclrating) {
                    let t = {acclerating: e};
                    g.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTotalVipAcclerateStatusChanged", JSON.stringify(t)), this.mIsTotalAcclrating = e
                }
                this.mIsUpdateTotalAcclerateStatus = !1
            }, 500))
        }
    }

    t.DownloadManager = S, function (e) {
        const t = new S;
        e.getDownloadManager = function () {
            return t
        }
    }(t.DownloadManagerNS || (t.DownloadManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(57), o = n(818), r = a.PluginHelperNS.getHelper(), s = n(1), l = n(819),
        u = s.default.getLogger("Thunder.VipDownload.sqlite-table"), d = "584C535343444E2E";

    class c {
        constructor() {
            this.mUserId = void 0, this.mName = "", this.mJsonify = !1, this.mEncrypt = !1, this.mEnable = !1
        }

        static execSqlite(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = void 0;
                    r.nativeCall ? r.nativeCall.CallNativeFunction("ExecSqlite", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        static querySqlite(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = null;
                    r.nativeCall ? r.nativeCall.CallNativeFunction("QuerySqlite", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        set enable(e) {
            this.mEnable = e
        }

        get enable() {
            return this.mEnable
        }

        set userId(e) {
            this.mUserId = e
        }

        get userId() {
            return this.mUserId
        }

        set name(e) {
            this.mName = e
        }

        get name() {
            return this.mName
        }

        get tableName() {
            let e = void 0;
            return this.userId && this.name && (e = "AccelerateTaskMap" + this.userId + "_" + this.name), e
        }

        get jsonify() {
            return this.mJsonify
        }

        set jsonify(e) {
            this.mJsonify = e
        }

        get encrypt() {
            return this.mEncrypt
        }

        set encrypt(e) {
            this.mEncrypt = e
        }

        init(e) {
            return i(this, void 0, void 0, function* () {
                this.userId = e;
                let t = yield this.isTableExist();
                u.information("table exist", t), t || (yield this.createTable()), this.enable = !0
            })
        }

        clear() {
            this.userId = void 0, this.enable = !1
        }

        createTable() {
            return i(this, void 0, void 0, function* () {
                let e = -1, t = this.tableName;
                if (t) {
                    let n = `create table ${t}(LocalTaskId BIGINT, AcclerateTaskId BIGINT, LocalSubFileIndex INT, UserData NVARCHAR, primary key(LocalTaskId,LocalSubFileIndex))`;
                    u.information("command", n), e = yield c.execSqlite(n), u.information("createTable", e)
                }
                return e
            })
        }

        isTableExist() {
            return i(this, void 0, void 0, function* () {
                let e = !1, t = this.tableName;
                if (t) {
                    let n = `select count(*) from sqlite_master where type='table' and name='${t}'`;
                    u.information("command", n);
                    let i = yield c.querySqlite(n);
                    if (i && i.length > 0) {
                        let t = i[0];
                        if (t && t.length > 0) {
                            let n = t[0].value;
                            n && Number(n).valueOf() > 0 && (e = !0)
                        }
                    }
                }
                return e
            })
        }

        setUserData(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = -1, a = this.tableName;
                if (!this.enable || !a) return i;
                let r = "null";
                n && (r = this.jsonify ? JSON.stringify(n) : l.stringify(n), this.encrypt && (r = o.AesCryptoNS.encryptString(r, d)), r = `'${r}'`);
                let s = void 0, h = yield this.isTaskExist(e, t);
                return u.information("task exist", h), s = h ? `update ${a} set UserData=${r} where LocalTaskId=${e} and LocalSubFileIndex=${t}` : `insert into ${a} values(${e}, -1, ${t}, ${r})`, u.information("command", s), i = yield c.execSqlite(s)
            })
        }

        getUserData(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null, i = this.tableName;
                if (!this.enable || !i) return n;
                let a = `select UserData from ${i} where LocalTaskId=${e} and LocalSubFileIndex=${t}`;
                u.information("command", a);
                let r = yield c.querySqlite(a);
                if (r && r.length > 0) {
                    let e = r[0];
                    if (e && e.length > 0) {
                        let t = e[0].value;
                        if (t) if (this.encrypt && (t = o.AesCryptoNS.decryptString(t, d)), this.jsonify) try {
                            n = JSON.parse(t)
                        } catch (e) {
                            u.warning(e)
                        } else n = t
                    }
                }
                return n
            })
        }

        removeTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = -1, i = this.tableName;
                if (!this.enable || !i) return n;
                let a = void 0;
                return a = -2 === t ? `delete from ${i} where LocalTaskId=${e}` : `delete from ${i} where LocalTaskId=${e} and LocalSubFileIndex=${t}`, u.information("command", a), n = yield c.execSqlite(a), u.information("removeTask", n), n
            })
        }

        getTaskIds() {
            return i(this, void 0, void 0, function* () {
                let e = [], t = this.tableName;
                if (!this.enable || !t) return e;
                let n = `select distinct LocalTaskId from ${t}`;
                u.information("command", n);
                let i = yield c.querySqlite(n);
                return i && i.length > 0 && i.forEach(function (t) {
                    if (t && t.length > 0) {
                        let n = t[0];
                        if (n.value) {
                            let t = Number(n.value).valueOf();
                            e.push(t)
                        }
                    }
                }), e
            })
        }

        getTaskIndexs(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = this.tableName;
                if (!this.enable || !n) return t;
                let i = `select distinct LocalSubFileIndex from ${n} where LocalTaskId=${e}`;
                u.information("command", i);
                let a = yield c.querySqlite(i);
                return a && a.length > 0 && a.forEach(function (e) {
                    if (e && e.length > 0) {
                        let n = e[0];
                        if (n.value) {
                            let e = Number(n.value).valueOf();
                            t.push(e)
                        }
                    }
                }), t
            })
        }

        isTaskExist(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1, i = this.tableName;
                if (!this.enable || !i) return n;
                let a = `select count(*) from ${i} where LocalTaskId=${e} and LocalSubFileIndex=${t}`;
                u.information("command", a);
                let o = yield c.querySqlite(a);
                if (o && o.length > 0) {
                    let e = o[0];
                    if (e && e.length > 0) {
                        let t = e[0].value;
                        t && Number(t).valueOf() > 0 && (n = !0)
                    }
                }
                return n
            })
        }
    }

    t.SqliteTable = c
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(576);
    !function (e) {
        const t = new i.SqliteTable;
        t.name = "try", t.encrypt = !0, t.jsonify = !0, e.getTable = function () {
            return t
        }
    }(t.TryTaskDataBaseNS || (t.TryTaskDataBaseNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n;
        !function (e) {
            e[e.Vip = 1] = "Vip", e[e.Try = 2] = "Try"
        }(t = e.KuaiNiaoType || (e.KuaiNiaoType = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Init = 0] = "Init", e[e.Enable = 1] = "Enable", e[e.Commiting = 2] = "Commiting", e[e.Failed = 3] = "Failed", e[e.Alive = 4] = "Alive", e[e.Finish = 5] = "Finish"
        }(n = e.KuaiNiaoStatus || (e.KuaiNiaoStatus = {}))
    }(t.KuaiNiaoDefineNS || (t.KuaiNiaoDefineNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(57), a = n(1).default.getLogger("Thunder.VipDownload.stat-utilities");
    !function (e) {
        const t = i.PluginHelperNS.getHelper();
        e.trackEvent = function (e, n) {
            if (t.nativeCall) {
                let i = (n = n || {}).attribute1 || "", o = n.attribute2 || "", r = n.extData || new Map;
                r.set("plugin_version", t.pluginVersion);
                let s = function (e) {
                    let t = "";
                    return e.forEach((e, n) => {
                        "" !== t && (t += ","), t = t + n + "=" + e
                    }), t
                }(r);
                a.information("key", e), a.information("attribute1", i), a.information("attribute2", o), a.information("extData", s), s = encodeURIComponent(s), a.information("encode extData", s), t.nativeCall.CallNativeFunction("TrackEvent", e, i, o, 0, 0, 0, 0, s, (e, t) => {
                    a.information("trackEvent", "errorCode", e, "returnValue", t)
                })
            }
        }
    }(t.StatUtilitiesNS || (t.StatUtilitiesNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(129), a = n(579), o = n(8), r = n(68), s = n(246), l = n(575), u = n(145), d = n(282), c = n(578),
        h = n(232), f = n(1).default.getLogger("Thunder.VipDownload.try-task"), g = r.UserHelperNS.getHelper();
    !function (e) {
        let t = void 0, n = !1, r = !1, p = !1, k = !1;
        const m = u.TaskEventContainerNS.getEventContainer();

        function T(e, t) {
            f.information("tryButtonShow");
            let n = new Map, i = _(), o = P(e);
            n.set("is_login", i), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("btn_type", t);
            let r = {attribute1: "jssy_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", r)
        }

        function v(e, t) {
            f.information("tryOpenVipButtonShow");
            let n = new Map, i = _(), o = P(e);
            n.set("is_login", i), n.set("is_vip", 0), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("btn_type", t);
            let r = {attribute1: "jssy_kthy_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", r)
        }

        function C(e) {
            if (r) return;
            r = !0, f.information("trySuccess");
            let n = new Map, i = _(), o = P(e);
            n.set("is_login", i), n.set("is_vip", 0), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("btn_type", t), n.set("js_type", 3);
            let s = {attribute1: "jssy_succ", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", s)
        }

        function S(e, i, o) {
            if (!n) return;
            n = !1, f.information("tryEnd");
            let r = new Map, s = _(), l = P(e), u = i ? "fail" : "succ";
            r.set("is_login", s), r.set("is_vip", 0), r.set("vip_type", 0), r.set("taskid", e), r.set("gcid", l), r.set("btn_type", t), r.set("result", u), o && r.set("errcode", o);
            let d = {attribute1: "jssy_end", extData: r};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }

        function y(e, t) {
            f.information("superTryButtonShow");
            let n = new Map, i = _(), o = x(), r = E(), s = P(e);
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", r), n.set("taskid", e), n.set("gcid", s), n.set("btn_type", t);
            let l = {attribute1: "cjjssy_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", l)
        }

        function w(e, t) {
            f.information("superTryOpenVipButtonShow");
            let n = new Map, i = _(), o = x(), r = E(), s = 1 === o ? "vipsj" : "vipkt", l = P(e);
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", r), n.set("taskid", e), n.set("gcid", l), n.set("biz_type", s), n.set("btn_type", t);
            let u = {attribute1: "cjjssy_ktch_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", u)
        }

        function I(e) {
            if (r) return;
            r = !0, f.information("superTrySuccess");
            let n = new Map, i = _(), o = x(), s = E(), l = P(e);
            let u = h.KuainiaoManagerNS.getManager().status === c.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive ? 1 : 3;
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", s), n.set("taskid", e), n.set("gcid", l), n.set("btn_type", t), n.set("js_type", u);
            let d = {attribute1: "cjjssy_succ", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }

        function b(e, i, o) {
            if (!n) return;
            n = !1, f.information("superTryEnd");
            let r = new Map, s = _(), l = x(), u = E(), d = P(e), c = i ? "fail" : "succ";
            r.set("is_login", s), r.set("is_vip", l), r.set("vip_type", u), r.set("taskid", e), r.set("gcid", d), r.set("btn_type", t), r.set("result", c), o && r.set("errcode", o);
            let h = {attribute1: "cjjssy_end", extData: r};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", h)
        }

        function A(e) {
            p = !1, k = !1, D(e, l.DownloadManagerNS.getDownloadManager().getVipTaskInfo(e))
        }

        function N(e, t, n) {
            if (!n) return;
            if (e === l.DownloadManagerNS.getDownloadManager().expandTaskId && D(e, t), t && t.taskType === i.VipDownloadDefineNS.VipTaskType.Try) switch (t.taskStatus) {
                case i.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    t.isSuper ? I(e) : C(e);
                    break;
                case i.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                case i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    let n = d.TryTaskCacheNS.getCacheManager().getTask(e);
                    n && n.error && (t.isSuper ? b(e, n.error.errorStep, n.error.result) : S(e, n.error.errorStep, n.error.result));
                    break;
                case i.VipDownloadDefineNS.VipTaskStatus.Finished:
                case i.VipDownloadDefineNS.VipTaskStatus.Unkown:
                    t.isSuper ? b(e) : S(e)
            }
        }

        function D(e, t) {
            t && t.taskType === i.VipDownloadDefineNS.VipTaskType.Try && (t.taskStatus === i.VipDownloadDefineNS.VipTaskStatus.Init ? t.isSuper ? y(e, "task") : T(e, "task") : t.taskStatus > i.VipDownloadDefineNS.VipTaskStatus.Init && t.taskStatus < i.VipDownloadDefineNS.VipTaskStatus.Finished ? p || (p = !0, t.isSuper ? w(e, "cjjssying") : v(e, "sying")) : t.taskStatus === i.VipDownloadDefineNS.VipTaskStatus.Finished && (k || (k = !0, t.isSuper ? w(e, "cjjssyend") : v(e, "syend"))))
        }

        function _() {
            let e = 0;
            return g.isLogin && (e = 1), e
        }

        function x() {
            let e = 0;
            return g.isVip && (e = 1), e
        }

        function E() {
            let e = 0;
            return g.isPlatinumVip ? e = 3 : g.isVip && (e = 2), e
        }

        function P(e) {
            const t = s.TaskManagerNS.getTaskManager().getTask(e);
            let n = "";
            if (t) {
                const e = t.getTaskBase();
                !e || e.taskType !== o.DownloadKernel.TaskType.P2sp && e.taskType !== o.DownloadKernel.TaskType.Emule || (n = e.gcid)
            }
            return n
        }

        m.attachListener(u.TaskEventNS.vipTaskInfoChanged, N), m.attachListener(u.TaskEventNS.taskExpand, A), e.tryButtonShow = T, e.tryButtonClick = function (e, i) {
            f.information("tryButtonClick"), n = !0, r = !1;
            let o = new Map, s = _(), l = P(e);
            o.set("is_login", s), o.set("vip_type", 0), o.set("taskid", e), o.set("gcid", l), o.set("clickid", i), t = i;
            let u = {attribute1: "jssy_click", extData: o};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", u)
        }, e.tryOpenVipButtonShow = v, e.tryOpenVipButtonClick = function (e, t) {
            f.information("tryOpenVipButtonClick");
            let n = new Map, i = _(), o = P(e);
            n.set("is_login", i), n.set("is_vip", 0), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("clickid", t);
            let r = {attribute1: "jssy_kthy_click", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", r)
        }, e.trySuccess = C, e.tryEnd = S, e.superTryButtonShow = y, e.superTryButtonClick = function (e, i) {
            f.information("superTryButtonClick"), n = !0;
            let o = new Map, r = _(), s = x(), l = E(), u = P(e);
            o.set("is_login", r), o.set("is_vip", s), o.set("vip_type", l), o.set("taskid", e), o.set("gcid", u), o.set("clickid", i), t = i;
            let d = {attribute1: "cjjssy_click", extData: o};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }, e.superTryOpenVipButtonShow = w, e.superTryOpenVipButtonClick = function (e, t) {
            f.information("superTryOpenVipButtonClick");
            let n = new Map, i = _(), o = x(), r = E(), s = 1 === o ? "vipsj" : "vipkt", l = P(e);
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", r), n.set("taskid", e), n.set("gcid", l), n.set("biz_type", s), n.set("clickid", t);
            let u = {attribute1: "cjjssy_ktch_click", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", u)
        }, e.superTrySuccess = I, e.superTryEnd = b, e.onTaskExpand = A, e.onVipTaskInfoChanged = N
    }(t.TryStatNS || (t.TryStatNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(24), r = n(10), s = n(1), l = n(72), u = n(8), d = n(32), c = n(34), h = n(134), f = n(58),
        g = n(15), p = n(3), k = d.DownloadKernelTaskManager.getTaskManager(),
        m = c.DownloadKernelEventManager.getEventManager(), T = s.default.getLogger("SubtiteManager");
    !function (e) {
        const t = a.resolve(__profilesDir, "SubTitleDownload/"),
            n = a.resolve(__profilesDir, "SubTitleDownload/subtitledata.json");

        class s extends l.default {
            constructor() {
                super(...arguments), this.subtitleData = {}, this.taskStatusChangedEventTable = []
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    T.information("Init");
                    let e = yield r.FileSystemAWNS.existsAW(n);
                    if (e) {
                        let e = yield r.FileSystemAWNS.readFileAW(n);
                        if (e) {
                            try {
                                this.subtitleData = JSON.parse(e.toString())
                            } catch (e) {
                                T.warning(e)
                            }
                            T.information("Init, subtitle data", this.subtitleData)
                        }
                    } else (e = yield r.FileSystemAWNS.mkdirsAW(t)) && (yield r.FileSystemAWNS.writeFileAW(n, "{}"));
                    p.remote.ipcMain.on(g.ThunderChannelList.channelRMGetSutitleByCid, (e, t, n) => i(this, void 0, void 0, function* () {
                        T.information("channelRMGetSutitleByCid cid and taskid ", t, n);
                        let i = yield this.querySubtitleByCid(t, n);
                        T.information("send channelMRGetSutitleByCidResult"), e.sender.isDestroyed() || e.sender.send(g.ThunderChannelList.channelMRGetSutitleByCidResult, i)
                    })), p.remote.ipcMain.on(g.ThunderChannelList.channelRMGetSutitleByName, (e, t, n) => i(this, void 0, void 0, function* () {
                        T.information("channelRMGetSutitleByName name and taskid ", t, n);
                        let i = yield this.querySubtitleByName(t, n);
                        T.information("send channelMRGetSutitleByNameResult"), e.sender.isDestroyed() || e.sender.send(g.ThunderChannelList.channelMRGetSutitleByNameResult, i)
                    })), p.remote.ipcMain.on(g.ThunderChannelList.channelRMDownloadSutitle, (e, t, n, a) => i(this, void 0, void 0, function* () {
                        T.information("channelRMDownloadSutitle taskid ", n), yield this.downloadSubtitle(t, n, a)
                    })), p.remote.ipcMain.on(g.ThunderChannelList.channelRMGetDisplayName, (e, t) => i(this, void 0, void 0, function* () {
                        T.information("channelRMGetDisplayName taskid ", t);
                        let n = this.getDisaplayName(t);
                        e.sender.send(g.ThunderChannelList.channelMRGetDisplayNameResult, n)
                    }))
                })
            }

            getDisaplayName(e) {
                let t = [], n = k.getTaskFromTaskId(e), i = n.getTaskBaseInfo(), a = n.getType();
                if (a === u.DownloadKernel.TaskType.P2sp || a === u.DownloadKernel.TaskType.Emule) {
                    let e = i.taskName, a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid);
                    T.information(" fileName: ", e, " cid: ", a);
                    let o = {fileName: e, cid: a};
                    o && t.push(o)
                } else if (a === u.DownloadKernel.TaskType.Bt) {
                    let e = n.getExtraObject();
                    if (0 === e.getDownloadFile().length) return null;
                    let i = e.getBtFileList();
                    for (let [e, n]of i) {
                        let i = n.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                        if (f.TaskUtilHelper.getTaskFileType(i) === f.TaskUtilHelper.FileExtType.Video) {
                            let a = n.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Cid);
                            T.information("btfile inde: ", e, " fileName: ", i, " cid: ", a);
                            let o = {fileName: i, cid: a};
                            o && t.push(o)
                        }
                    }
                } else if (a === u.DownloadKernel.TaskType.Group) {
                    let e = n.getExtraObject(), i = e.getSubTaskCount();
                    for (let n = 0; n < i; ++n) {
                        let i = e.getSubTaskByIndex(n), a = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName);
                        if (f.TaskUtilHelper.getTaskFileType(a) === f.TaskUtilHelper.FileExtType.Video) {
                            let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid);
                            T.information(" fileName: ", a, " cid: ", e);
                            let n = {fileName: a, cid: e};
                            n && t.push(n)
                        }
                    }
                }
                return T.information("getDisaplayName ret ", t), t
            }

            querySubtitleByCid(e, t) {
                return i(this, void 0, void 0, function* () {
                    T.information("querySubtitleByCid");
                    let n = [], i = null;
                    try {
                        i = yield o.default.get(`http://sub.xmp.sandai.net:8000/subxl/${e}.json`), T.information("response: ", i)
                    } catch (e) {
                        T.warning(e)
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data) {
                        T.information("sublist: ", i.data.sublist);
                        let e = i.data.sublist;
                        if (e && e.length > 1) for (let i of e) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = i.scid, e.surl = i.surl, e.sname = i.sname, e.language = i.language, e.rate = i.rate, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && n.push(e)
                        }
                    }
                    return n
                })
            }

            querySubtitleByName(e, t) {
                return i(this, void 0, void 0, function* () {
                    T.information("querySubtitleByName");
                    let n = [];
                    e = encodeURI(e);
                    let i = null;
                    try {
                        i = yield o.default.get(`http://subtitle.kankan.xunlei.com:8000/search.json/mname=${e}`), T.information("querySubtitleByName response: ", i)
                    } catch (e) {
                        T.warning(e)
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data) {
                        let e = i.data.sublist;
                        if (e && e.length >= 1) for (let i of e) if (i.scid) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = i.scid, e.surl = i.surl, e.sname = i.sname, e.language = i.language;
                            let a = parseInt(i.simility, 10), o = 0;
                            o = (a *= 100) < 15 ? 0 : a < 35 ? 1 : a < 55 ? 2 : a < 85 ? 3 : a < 92 ? 4 : 5, e.rate = o, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && n.push(e)
                        }
                    }
                    return n
                })
            }

            downloadSubtitle(e, t, n) {
                return i(this, void 0, void 0, function* () {
                    T.information("downloadSubtitle");
                    let i = e.surl, o = i.substring(i.lastIndexOf(".")),
                        r = n.substring(0, n.lastIndexOf(".")) + ".XLSUB" + o, s = this.getSaveDir(t);
                    T.information("downloadSubtitle fileName", r), T.information("downloadSubtitle filePath", s);
                    let l = a.join(s, r);
                    T.information("downloadSubtitle:", s, l);
                    let d = {taskBaseInfo: {savePath: s, taskName: r}, p2spTaskInfo: {url: i}, isBackground: !0},
                        c = yield k.createTask(u.DownloadKernel.TaskType.P2sp, d);
                    if (null !== c) {
                        let n = c.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        this.attachTaskStatusChangedEvent(n, e, t), h.DownloadDispatchNS.startTask(n)
                    }
                })
            }

            save(e) {
                return i(this, void 0, void 0, function* () {
                    T.information("save"), T.information(e);
                    let t = JSON.stringify(e, void 0, 2);
                    T.information("save jsonStr: ", t), yield r.FileSystemAWNS.writeFileAW(n, t)
                })
            }

            attachTaskStatusChangedEvent(e, t, n) {
                T.information("Sunbtitle taskId: ", e), T.information("item: ", t), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = m.attachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, (...o) => i(this, void 0, void 0, function* () {
                    let i = !1;
                    do {
                        if (!o) {
                            T.information("args is null");
                            break
                        }
                        if (o[0] !== u.DownloadKernel.TaskEventType.StatusChanged) {
                            T.information("args[0] is not StatusChanged");
                            break
                        }
                        let r = o[1];
                        if (!r) {
                            T.information("taskList is null");
                            break
                        }
                        for (let o = 0; o < r.length; ++o) {
                            let s = r[o];
                            if (!s) continue;
                            if (s.getId() !== e) continue;
                            let l = s.getTaskStatus();
                            if (T.information("get status ", l), l === u.DownloadKernel.TaskStatus.Succeeded) {
                                T.information("send: channelMRDownloadSutitleSuc"), p.ipcRenderer.send(g.ThunderChannelList.channelMRDownloadSutitleSuc);
                                let i = [];
                                T.information("subtitleData: ", this.subtitleData), T.information("befor has sutitleTaskId "), this.subtitleData[n] && (T.information("has sutitleTaskId ", e), i = this.subtitleData[n]), T.information("after has sutitleTaskId ");
                                let o = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                                o.scid = t.scid, o.surl = t.surl, o.sname = s.getTaskName().replace(".XLSUB", ""), o.language = t.language, o.rate = t.rate, o.status = 1;
                                let r = this.getSaveDir(e), l = s.getTaskName();
                                o.path = a.join(r, l), i.push(o), this.subtitleData[n] = i, yield this.save(this.subtitleData), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (T.information("取消监听 ", this.taskStatusChangedEventTable[e]), m.detachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
                            } else l === u.DownloadKernel.TaskStatus.Failed && (T.information("send: channelMRDownloadSutitleFail"), p.ipcRenderer.send(g.ThunderChannelList.channelMRDownloadSutitleFail), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (T.information("取消监听 ", this.taskStatusChangedEventTable[e]), m.detachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null));
                            i = !0
                        }
                    } while (0);
                    return i
                })))
            }

            getSaveDir(e) {
                T.information("getSaveDir");
                let t = "", n = k.getTaskFromTaskId(e), i = n.getTaskName(), o = n.getType();
                if (n && (t = n.getSavePath()), o === u.DownloadKernel.TaskType.Bt) {
                    n.getExtraObject().getFileCount() > 1 && (t = a.join(t, i))
                }
                return T.information("name and save dir: ", i, t), t
            }

            isAlreadyDownload(e, t) {
                return i(this, void 0, void 0, function* () {
                    T.information("isAlreadyDownload cid ", e);
                    let n = !1, i = this.subtitleData[t];
                    if (T.information("isAlreadyDownload subtitleList ", i), i && i.length >= 1) for (let t of i) if (t.scid === e) {
                        let e = t.path;
                        T.information("isAlreadyDownload fielPath ", e), (yield r.FileSystemAWNS.existsAW(e)) && (n = !0)
                    }
                    return T.information("isAlreadyDownload ret ", n), n
                })
            }
        }

        e.SubtitleManager = s;
        const d = new s;
        e.getSubtitleManger = function () {
            return d
        }, e.init = function () {
            return i(this, void 0, void 0, function* () {
                yield d.init()
            })
        }
    }(t.SubtitleManagerNS || (t.SubtitleManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(7), s = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")), l = n(5),
        u = n(51), d = n(72), c = n(13), h = o.default.getLogger("MessageChannel");
    let f = null, g = void 0, p = null;
    !function (e) {
        let t, n;

        function o() {
            return p || (p = r.default(a.join(__rootDir, "../bin/ThunderMsgChannel.node"))), p
        }

        function k() {
            return g || (g = s.getFileVersion(a.join(__rootDir, "../../xluagc.dll"))), g
        }

        !function (e) {
            e[e.Init = 0] = "Init", e[e.Connecting = 1] = "Connecting", e[e.Connected = 2] = "Connected", e[e.ConnectRecovering = 3] = "ConnectRecovering"
        }(t = e.LongConnectState || (e.LongConnectState = {})), function (e) {
            e[e.Init = 0] = "Init", e[e.Logining = 1] = "Logining", e[e.Login = 2] = "Login", e[e.LoginFailed = 3] = "LoginFailed", e[e.Logouting = 4] = "Logouting", e[e.Logout = 5] = "Logout", e[e.LogoutFailed = 6] = "LogoutFailed"
        }(n = e.UserState || (e.UserState = {})), e.eventUserLogin = "OnMessageChannelUserLogin", e.eventUserLoginFailed = "OnMessageChannelUserLoginFailed", e.eventUserLogout = "OnMessageChannelUserLogout", e.eventUserLogoutFailed = "OnMessageChannelUserLogoutFailed", e.eventServiceCallbackId = "OnMessageChannelServiceCallback", e.eventGroupServiceCallbackId = "OnMessageChannelGroupServiceCallback", e.getThunderMsgChannel = o;
        const m = new class extends d.default {
            constructor() {
                super(...arguments), this.longConnectState = t.Init, this.userState = n.Init, this.userLoginEventId = void 0, this.userLogoutEventId = void 0, this.userCheckInTryTimes = 0, this.userCheckOutTryTimes = 0, this.maxTryTimes = 3, this.userId = "0", this.statDataInfo = new Map
            }

            init() {
                let e = s.getPeerID();
                h.information("[MsgChannelStat]init appid:0, peerid:", e);
                let t = o().init(e, "0", this.initCallback.bind(this), this.longConnectCallback.bind(this), this.userStateCallback.bind(this));
                return t && (this.userLoginEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", this.onUserLogin.bind(this)), this.userLogoutEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", this.onUserLogout.bind(this)), f = setInterval(() => {
                    this.sendMsgCountStat()
                }, 6e4)), t
            }

            uninit() {
                return void 0 !== this.userLoginEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", this.userLoginEventId), this.userLoginEventId = void 0), void 0 !== this.userLogoutEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogout", this.userLogoutEventId), this.userLogoutEventId = void 0), f && (h.information("killTimer..."), clearInterval(f), f = null), o().uninit()
            }

            registerService(e) {
                return o().registerService(e, this.serviceCallback.bind(this))
            }

            unregisterService(e) {
                return o().unregisterService(e)
            }

            joinGroup(e) {
                return o().joinGroup(e, this.groupServiceCallback.bind(this))
            }

            leaveGroup(e) {
                return o().leaveGroup(e)
            }

            getLongConnectState() {
                return this.longConnectState
            }

            getUserState() {
                return this.userState
            }

            getCurrentTime() {
                return Math.floor((new Date).getTime() / 1e3).toString()
            }

            sendMsgCountStat() {
                for (let [e, t]of this.statDataInfo) if (e && "" !== e && t) {
                    let e = "sdk_version=" + k() + ",msg_count=" + t.msgCount + ",cmdtype=" + t.cmdType + ",begin_time=" + t.beginTime + ",end_time=" + t.endTime + ",uid=" + t.userId;
                    "" !== t.serviceType ? (e = e + ",servicetype=" + t.serviceType, h.information("[MsgChannelStat]longlink_recvmessage_count extdata:", e), c.XLStatNS.trackEvent("community", "longlink_recvmessage_count", "", 0, 0, 0, 0, e)) : "" !== t.groupId && (e = e + ",groupid=" + t.groupId, h.information("[MsgChannelStat]longlink_recvmessage_count extdata:", e), c.XLStatNS.trackEvent("community", "longlink_recvmessage_count", "", 0, 0, 0, 0, e))
                }
                this.statDataInfo.clear()
            }

            getUserID() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        u.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                            h.information("getUserID:userid = ", t), e(t)
                        })
                    })
                })
            }

            getSessionID() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        u.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                            h.information("getSessionID:sessionid = ", t), e(t)
                        })
                    })
                })
            }

            onUserLogin(e) {
                return i(this, void 0, void 0, function* () {
                    if (h.information("onUserLogin userState:", this.userState), this.longConnectState === t.Connected) {
                        let t = yield this.getSessionID();
                        h.information("onUserLogin userCheckIn uid = ", e, " token = ", t), this.userCheckInTryTimes = 0, this.userState = n.Logining, o().userCheckIn(e, t)
                    }
                })
            }

            onUserLogout() {
                h.information("onUserLogout userState:", this.userState), this.userState !== n.Logining && this.userState !== n.Login || (this.userCheckOutTryTimes = 0, this.userState = n.Logouting, o().userCheckOut())
            }

            initCallback(e) {
                return i(this, void 0, void 0, function* () {
                    h.information("[MsgChannelStat]initCallback ret:", e);
                    let t = "sdk_version=" + k();
                    t = t + ",ret=" + e, h.information("[MsgChannelStat]initCallback longlink_xluagcinit extData: ", t), c.XLStatNS.trackEvent("community", "longlink_xluagcinit", "", 0, 0, 0, 0, t)
                })
            }

            onLongConnectSuccess() {
                return i(this, void 0, void 0, function* () {
                    this.longConnectState = t.Connected;
                    let e = yield this.getUserID(), i = yield this.getSessionID();
                    e && "" !== e && this.userState !== n.Logining && this.userState !== n.Login && setTimeout(() => {
                        h.information("longConnectCallback user has already logged in. userId:", e, ", sessionId:", i, ", start checking in message channel."), this.userCheckInTryTimes = 0, this.userState = n.Logining, o().userCheckIn(e, i)
                    }, 1)
                })
            }

            longConnectCallback(e) {
                return i(this, void 0, void 0, function* () {
                    h.information("longConnectCallback state:", e);
                    let n = "sdk_version=" + k();
                    1 === e ? (this.longConnectState = t.Connecting, h.information("[MsgChannelStat]longConnectCallback connecting:", this.longConnectState)) : 2 === e ? (h.information("[MsgChannelStat]longConnectCallback connect success."), yield this.onLongConnectSuccess(), n += ",ret=1", h.information("[MsgChannelStat]longlink_deviceloginend extdata:", n), c.XLStatNS.trackEvent("community", "longlink_deviceloginend", "", 0, 0, 0, 0, n)) : 3 === e && (h.information("[MsgChannelStat]longConnectCallback connect recovering."), this.longConnectState = t.ConnectRecovering, n += ",ret=0", h.information("longlink_deviceloginend extdata:", n), c.XLStatNS.trackEvent("community", "longlink_deviceloginend", "", 0, 0, 0, 0, n))
                })
            }

            onMessageChannelUserLogin() {
                h.information("userStateCallback login success, this.userState:", this.userState), this.userState = n.Login, this.userCheckInTryTimes = 0, this.fireEvent(e.eventUserLogin)
            }

            onMessageChannelUserLoginFailed() {
                return i(this, void 0, void 0, function* () {
                    if (h.information("userStateCallback login failed, this.userState:", this.userState, ", userCheckInTryTimes:", this.userCheckInTryTimes), this.userState = n.LoginFailed, this.fireEvent(e.eventUserLoginFailed), this.userCheckInTryTimes = this.userCheckInTryTimes + 1, this.userCheckInTryTimes < this.maxTryTimes) {
                        let e = yield this.getUserID(), t = yield this.getSessionID();
                        e && "" !== e && setTimeout(() => {
                            h.information("uid = ", e, " token = ", t), h.information("userStateCallback retry login userCheckInTryTimes:", this.userCheckInTryTimes), this.userState = n.Logining, o().userCheckIn(e, t)
                        }, 1)
                    }
                })
            }

            onMessageChannelUserLogout() {
                h.information("userStateCallback logout success."), this.userState = n.Logout, this.userCheckOutTryTimes = 0, this.fireEvent(e.eventUserLogout)
            }

            onMessageChannelUserLogoutFailed() {
                h.information("userStateCallback logout failed, self.UserState:", this.userState), this.userState = n.LogoutFailed, this.fireEvent(e.eventUserLogoutFailed), h.information("userStateCallback retry logout, this.userCheckOutTryTimes:", this.userCheckOutTryTimes), this.userCheckOutTryTimes = this.userCheckOutTryTimes + 1, this.userCheckOutTryTimes < this.maxTryTimes && setTimeout(() => {
                    this.userState = n.Logouting, o().userCheckOut(), h.information("userStateCallback retry logout, userCheckOutTryTimes", this.userCheckOutTryTimes)
                }, 1)
            }

            userStateCallback(e) {
                return i(this, void 0, void 0, function* () {
                    h.information("userStateCallback state = ", e);
                    let t = "sdk_version=" + k();
                    if (0 === e) {
                        this.onMessageChannelUserLogin(), t += ",ret=1";
                        let e = yield this.getUserID();
                        this.userId = e, h.information("[MsgChannelStat]longlink_userloginend extdata:", t), c.XLStatNS.trackEvent("community", "longlink_userloginend", "", 0, 0, 0, 0, t)
                    } else 1 === e ? (yield this.onMessageChannelUserLoginFailed(), this.userId = "0", t += ",ret=0", h.information("[MsgChannelStat]longlink_userloginend extdata:", t), c.XLStatNS.trackEvent("community", "longlink_userloginend", "", 0, 0, 0, 0, t)) : 2 === e ? (this.onMessageChannelUserLogout(), this.userId = "0", this.sendMsgCountStat()) : 3 === e && (this.userId = "0", this.onMessageChannelUserLogoutFailed())
                })
            }

            serviceCallback(t, n, i) {
                h.information("[MsgChannelStat]serviceCallback serviceType:", t, ", msgCount:", n, ", msgArray:", i), this.fireEvent(e.eventServiceCallbackId, t, i);
                let a = "serviceType_" + t + "_" + this.userId;
                if (this.statDataInfo.has(a)) {
                    let e = this.statDataInfo.get(a);
                    e.endTime = this.getCurrentTime(), e.msgCount = e.msgCount + n
                } else {
                    let e = {
                        serviceType: "",
                        groupId: "",
                        cmdType: "",
                        beginTime: "",
                        endTime: "",
                        msgCount: 0,
                        userId: "0"
                    };
                    e.beginTime = this.getCurrentTime(), e.endTime = this.getCurrentTime(), e.msgCount = n, e.serviceType = t, e.cmdType = "1", e.userId = this.userId, this.statDataInfo.set(a, e)
                }
            }

            groupServiceCallback(t, n, i) {
                h.information("groupServiceCallback groupId:", t, ", msgCount:", n, ", msgArray:", i), this.fireEvent(e.eventGroupServiceCallbackId, t, i);
                let a = "groupId_" + t + "_" + this.userId;
                if (this.statDataInfo.has(a)) {
                    let e = this.statDataInfo.get(a);
                    e.endTime = this.getCurrentTime(), e.msgCount = e.msgCount + n
                } else {
                    let e = {
                        serviceType: "",
                        groupId: "",
                        cmdType: "",
                        beginTime: "",
                        endTime: "",
                        msgCount: 0,
                        userId: "0"
                    };
                    e.beginTime = this.getCurrentTime(), e.endTime = this.getCurrentTime(), e.msgCount = n, e.groupId = t, e.cmdType = "2", e.userId = this.userId, this.statDataInfo.set(a, e)
                }
            }
        };
        e.init = function () {
            return m.init()
        }, e.uninit = function () {
            return m.uninit()
        }, e.registerService = function (e) {
            return m.registerService(e)
        }, e.unregisterService = function (e) {
            return m.unregisterService(e)
        }, e.attachListener = function (e, t) {
            m.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            m.detachListener(e, t)
        }, e.joinGroup = function (e) {
            return m.joinGroup(e)
        }, e.leaveGroup = function (e) {
            return m.leaveGroup(e)
        }, e.getLongConnectState = function () {
            return m.getLongConnectState()
        }, e.getUserState = function () {
            return m.getUserState()
        }
    }(t.MessageChannelNS || (t.MessageChannelNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(249), a = n(25), o = n(1), r = n(33), s = n(3), l = n(13), u = o.default.getLogger("Bt-task-renderer");

    class d {
        constructor() {
            this.isPopWndExist = !1, this.isManualPopUp = !1
        }

        whetherShowEntry() {
            return this.getBrowserInfos().length > 0
        }

        whetherPopUp() {
            let e = a.ConfigNS.getValue("ThunderFirstInstall", "IsFirstInstall", 1);
            return u.information("是否是重新安装迅雷:", e), 1 === e && this.getBrowserInfos().length > 0
        }

        popUpBrowserGuide(e) {
            if (this.isPopWndExist) return;
            this.isManualPopUp = e;
            const t = s.remote.getGlobal("mainRendererWindow");
            t && !t.isVisible() ? t.once("show", () => {
                setTimeout(() => {
                    this.interalShow()
                }, 1e3)
            }) : this.interalShow()
        }

        interalShow() {
            r.MessageBox.custom("BrowserConfigGuide", {}, {modal: !1}).then(e => {
                this.isPopWndExist = !1
            }).catch(e => {
                this.isPopWndExist = !1
            }), this.isPopWndExist = !0, !0 !== this.isManualPopUp && l.XLStatNS.trackEvent("setting_center", "use_xl_download_show", "", 0, 0, 0, 0)
        }

        getBrowserInfos() {
            let e = [], t = i.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("360安全浏览器");
            t && e.push(t);
            let n = i.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("搜狗浏览器");
            n && e.push(n);
            let a = i.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("QQ浏览器");
            return a && e.push(a), u.information("已安装的浏览器:", e), e
        }
    }

    t.default = function () {
        return d.instance || (d.instance = new d), d.instance
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.colorList = [{id: 0}, {
            id: 1,
            defaultOpacity: .9,
            colors: {
                colorPreview: "196,208,232",
                colorAccordion: ["116,137,180", "116,137,180"],
                colorGradientBackground: ["191,207,230", "227,236,246"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "116,137,180",
                colorPrimaryControl1: "120,149,209",
                colorPrimaryControl2: "116,137,180",
                colorPrimaryControl3: "212,225,225",
                colorPrimaryControl4: "240,243,250",
                colorPrimaryGradient: ["168,187,226", "105,132,177"],
                colorPrimaryText: "56,66,77",
                colorSearch: "252,252,252",
                colorSecondary: "83,95,117"
            }
        }, {
            id: 2,
            defaultOpacity: .9,
            colors: {
                colorPreview: "159,204,255",
                colorAccordion: ["51,160,255", "91,179,255"],
                colorGradientBackground: ["217,236,255", "138,204,255"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "51,160,255",
                colorPrimaryControl1: "119,182,255",
                colorPrimaryControl2: "51,160,255",
                colorPrimaryControl3: "212,231,255",
                colorPrimaryControl4: "232,240,255",
                colorPrimaryGradient: ["0,137,226", "103,189,255"],
                colorPrimaryText: "73,91,104",
                colorSearch: "252,252,252",
                colorSecondary: "103,132,154"
            }
        }, {
            id: 3,
            defaultOpacity: .9,
            colors: {
                colorPreview: "255,187,128",
                colorAccordion: ["255,149,87", "255,149,87"],
                colorGradientBackground: ["255,210,142", "255,151,119"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "255,149,87",
                colorPrimaryControl1: "255,178,110",
                colorPrimaryControl2: "255,149,87",
                colorPrimaryControl3: "229,210,194",
                colorPrimaryControl4: "242,233,226",
                colorPrimaryGradient: ["255,176,39", "255,137,33"],
                colorPrimaryText: "97,64,47",
                colorSearch: "252,252,252",
                colorSecondary: "130,99,75"
            }
        }, {
            id: 4,
            defaultOpacity: .9,
            colors: {
                colorPreview: "150,200,158",
                colorAccordion: ["93,154,103", "93,154,103"],
                colorGradientBackground: ["171,207,158", "124,188,162"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "85,123,91",
                colorPrimaryControl1: "114,152,120",
                colorPrimaryControl2: "85,123,91",
                colorPrimaryControl3: "191,210,194",
                colorPrimaryControl4: "220,232,222",
                colorPrimaryGradient: ["84,123,81", "115,165,150"],
                colorPrimaryText: "67,74,61",
                colorSearch: "252,252,252",
                colorSecondary: "97,109,86"
            }
        }, {
            id: 5,
            defaultOpacity: .5,
            colors: {
                colorPreview: "47,73,141",
                colorAccordion: ["99,177,255", "121,175,244"],
                colorGradientBackground: ["56,76,140", "41,72,143"],
                colorGradientForeground: ["97,144,251", "19,34,75"],
                colorPrimary: "230,199,138",
                colorPrimaryControl1: "204,170,122",
                colorPrimaryControl2: "220,191,132",
                colorPrimaryControl3: "185,185,185",
                colorPrimaryControl4: "233,233,233",
                colorPrimaryGradient: ["111,150,255", "156,192,255"],
                colorPrimaryText: "230,207,161",
                colorSearch: "68,124,209",
                colorSecondary: "204,184,143"
            }
        }, {
            id: 6,
            defaultOpacity: .7,
            colors: {
                colorPreview: "65,17,17",
                colorAccordion: ["214,99,99", "214,99,99"],
                colorGradientBackground: ["72,29,29", "16,7,7"],
                colorGradientForeground: ["117,57,57", "30,22,22"],
                colorPrimary: "223,77,77",
                colorPrimaryControl1: "220,96,96",
                colorPrimaryControl2: "159,51,51",
                colorPrimaryControl3: "219,193,193",
                colorPrimaryControl4: "239,224,224",
                colorPrimaryGradient: ["255,86,86", "161,70,70"],
                colorPrimaryText: "235,197,197",
                colorSearch: "88,74,74",
                colorSecondary: "184,151,151"
            }
        }, {
            id: 7,
            defaultOpacity: .3,
            colors: {
                colorPreview: "75,65,129",
                colorAccordion: ["160,185,252", "103,155,207"],
                colorGradientBackground: ["29,90,151", "105,61,191"],
                colorGradientForeground: ["163,177,204", "0,0,0"],
                colorPrimary: "128,213,255",
                colorPrimaryControl1: "118,193,230",
                colorPrimaryControl2: "161,207,230",
                colorPrimaryControl3: "205,215,235",
                colorPrimaryControl4: "228,232,240",
                colorPrimaryGradient: ["142,163,245", "120,144,222"],
                colorPrimaryText: "184,197,204",
                colorSearch: "153,153,153",
                colorSecondary: "138,184,230"
            }
        }, {
            id: 8,
            defaultOpacity: .6,
            colors: {
                colorPreview: "82,39,90",
                colorAccordion: ["170,163,204", "136,122,204"],
                colorGradientBackground: ["83,42,118", "61,46,77"],
                colorGradientForeground: ["93,82,193", "0,0,0"],
                colorPrimary: "170,153,255",
                colorPrimaryControl1: "136,122,204",
                colorPrimaryControl2: "147,132,220",
                colorPrimaryControl3: "204,194,255",
                colorPrimaryControl4: "234,230,255",
                colorPrimaryGradient: ["156,149,255", "128,128,255"],
                colorPrimaryText: "191,184,230",
                colorSearch: "166,148,255",
                colorSecondary: "153,143,204"
            }
        }, {
            id: 9,
            defaultOpacity: .3,
            colors: {
                colorPreview: "74,77,83",
                colorAccordion: ["103,155,207", "160,185,252"],
                colorGradientBackground: ["69,71,77", "15,19,26"],
                colorGradientForeground: ["179,179,179", "0,34,51"],
                colorPrimary: "204,238,255",
                colorPrimaryControl1: "143,184,204",
                colorPrimaryControl2: "161,207,230",
                colorPrimaryControl3: "205,215,235",
                colorPrimaryControl4: "228,232,240",
                colorPrimaryGradient: ["140,173,205", "103,132,162"],
                colorPrimaryText: "184,197,204",
                colorSearch: "153,153,153",
                colorSecondary: "138,184,230"
            }
        }, {
            id: 10,
            defaultOpacity: .5,
            colors: {
                colorPreview: "77,62,45",
                colorAccordion: ["204,177,122", "204,191,163"],
                colorGradientBackground: ["51,44,30", "26,22,15"],
                colorGradientForeground: ["153,122,92", "0,0,0"],
                colorPrimary: "230,199,138",
                colorPrimaryControl1: "204,170,122",
                colorPrimaryControl2: "220,191,132",
                colorPrimaryControl3: "219,212,203",
                colorPrimaryControl4: "236,230,223",
                colorPrimaryGradient: ["186,152,105", "226,197,139"],
                colorPrimaryText: "230,207,161",
                colorSearch: "105,105,105",
                colorSecondary: "204,184,143"
            }
        }]
    }(t.SkinConfigNS || (t.SkinConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(1), r = n(12), s = n(35), l = n(25), u = n(23), d = n(236),
        c = n(14), {isDef: h} = r.ThunderUtil, f = o.default.getLogger("Thunder.Skin:spring-festival-skin");
    !function (e) {
        let t = void 0, o = !1;
        const r = 1e4;
        let g = null;
        e.init = function () {
            return i(this, void 0, void 0, function* () {
                yield function () {
                    return i(this, void 0, void 0, function* () {
                        return new Promise(e => {
                            l.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                                e(!0)
                            })
                        })
                    })
                }();
                let e = null;
                try {
                    const t = "http://msg.vip.xunlei.com/xlact/conf";
                    f.information("init", "url", t);
                    let i = yield c.default("GetPeerID");
                    a.default.defaults.adapter = n(22);
                    let s = yield a.default.get(t, {
                        params: {actid: "vip2019redpack", source: 3e3, peerid: i},
                        timeout: r
                    });
                    f.information("init res", s), 200 === s.status && h(s.data) && 0 === s.data.result && h(s.data.data) && (o = Boolean(s.data.data.is_spring_festival), e = s.data.data.skin, g = s.data.data.scroll_text)
                } catch (e) {
                    f.warning(e)
                }
                e = e || {}, localStorage.setItem("springFestivalSkinData", JSON.stringify(e))
            })
        }, e.canShowSkin = function () {
            return i(this, void 0, void 0, function* () {
                do {
                    let e = l.ConfigNS.getValue("Skin", "DisableSpringFestivalSkin", !1);
                    if (f.information("showSkin disable", e), e) {
                        t = !1;
                        break
                    }
                    t = o
                } while (0);
                return t
            })
        }, e.getSkin = function () {
            return i(this, void 0, void 0, function* () {
                let e = null;
                do {
                    let t = yield d.default.getSpringFestivalWallpaper();
                    if (!t) break;
                    let n = yield d.default.getImage(t);
                    e = {
                        type: s.SkinHelperNS.SkinType.Wallpaper,
                        colorID: t.color,
                        image: n,
                        opacity: t.transparency / 100,
                        opacityDesc: !0,
                        skinID: t.id,
                        is_spring_festival: !0
                    }
                } while (0);
                return e
            })
        }, e.disableSkin = function () {
            !0 === t && (t = !1, l.ConfigNS.setValue("Skin", "DisableSpringFestivalSkin", !0))
        }, e.onClickLink = function () {
            let e = (new Date).toLocaleDateString();
            l.ConfigNS.setValue("Skin", "SpringFestivalLinkClickDate", e)
        }, e.canShowLink = function () {
            return i(this, void 0, void 0, function* () {
                let e = !0;
                return l.ConfigNS.getValue("Skin", "SpringFestivalLinkClickDate", "") === (new Date).toLocaleDateString() && (e = !1), e
            })
        }, e.getColor = function () {
            return {
                id: 11,
                defaultOpacity: .8,
                colors: {
                    colorAccordion: ["255,149,87", "255,64,64"],
                    colorGradientBackground: ["255,147,119", "255,64,51"],
                    colorGradientForeground: ["255,244,225", "255,239,214"],
                    colorPrimary: "236,78,78",
                    colorPrimaryControl1: "255,109,109",
                    colorPrimaryControl2: "236,78,78",
                    colorPrimaryControl3: "248,197,197",
                    colorPrimaryControl4: "251,229,229",
                    colorPrimaryGradient: ["255,136,106", "255,84,84"],
                    colorPrimaryText: "87,5,5",
                    colorSearch: "255,232,232",
                    colorSecondary: "183,68,68"
                }
            }
        }, e.getTextLink = function (e) {
            let t = null;
            return g && (t = e ? g.login : g.unlogin), t
        }
    }(t.SpringFestivalSkinNS || (t.SpringFestivalSkinNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(3), o = n(285), r = n(15), s = n(7), l = n(1),
        u = o.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        d = s.default(i.join(__rootDir, "../bin/ThunderHelper.node")), c = l.default.getLogger("notification");
    !function (e) {
        let t = null, n = null, i = !1;

        function o() {
            try {
                t && t.close()
            } catch (e) {
                c.warning(e)
            }
        }

        function s(e) {
            c.information("setTimer..."), i = !1, e = e || 1e4, n && l(), n = setInterval(() => {
                i || (e -= 1e3) <= 0 && o()
            }, 1e3)
        }

        function l() {
            n && (c.information("killTimer..."), clearInterval(n), n = null)
        }

        e.notify = function (e, n) {
            do {
                if (d.IsInFullScreen()) break;
                let h = "development" === process.env.RUN_ENV ? "http://localhost:9080/notification-renderer/" : `file:///${__dirname}/../notification-renderer/index.html`;
                e.url && (h = e.url);
                let f = a.screen.getPrimaryDisplay().workAreaSize, g = new a.remote.BrowserWindow({
                    width: e.width || 440,
                    height: e.height || 245,
                    x: f.width - (e.width || 440),
                    y: f.height - (e.height || 245),
                    frame: !1,
                    resizable: !1,
                    show: !1,
                    alwaysOnTop: !0,
                    skipTaskbar: !0
                });
                t = g, a.remote.ipcMain.once("notification-init", n => {
                    g === t && (c.information("notification-init"), n.sender.send("notification-init-reply", e))
                }), a.remote.ipcMain.on(r.ThunderChannelList.channelMRNotificationMsg, (e, ...n) => {
                    do {
                        if (g !== t) break;
                        if (c.information("notification-event"), null === n[0] || void 0 === n[0]) break;
                        let e = n[0];
                        switch (e) {
                            case"hover":
                                c.information("msg", e, n[1]), i = n[1];
                                break;
                            case"close":
                                c.information("msg", e), o()
                        }
                    } while (0)
                }), t.loadURL(h), c.information("notification...", e), t.on("ready-to-show", () => {
                    g === t && (c.information("ready-to-show..."), t.showInactive(), t.setAlwaysOnTop(!1), s(e.duration), n && n("ready-to-show"))
                }), t.on("closed", () => {
                    g === t && (c.information("closed..."), l(), t = null, u.deQueue())
                })
            } while (0)
        }, e.close = o, e.getCurrentWindow = function () {
            return t
        }
    }(t.Notification || (t.Notification = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(59);
    !function (e) {
        let t;
        !function (e) {
            e.Unknow = "Unknow", e.OnJoinTeam = "OnJoinTeam", e.OnExitTeam = "OnExitTeam", e.OnReceiveGcid = "OnReceiveGcid", e.OnTaskSpeedChange = "OnTaskSpeedChange", e.OnTaskStatusChange = "OnTaskStatusChange", e.OnTeamInfoUpdated = "OnTeamInfoUpdated", e.InsertToCategoryView = "InsertToCategoryView", e.RemoveFromCategoryView = "RemoveFromCategoryView", e.RequestTaskTeamInfoSuccess = "RequestTaskTeamInfoSuccess", e.RequestTaskTeamInfofailed = "RequestTaskTeamInfofailed"
        }(t = e.GroupAccelerateEventType || (e.GroupAccelerateEventType = {}));
        const n = new i.EventEmitter;
        e.getEventManager = function () {
            return n
        }
    }(t.GroupAccelerateEventManagerNS || (t.GroupAccelerateEventManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(6), r = n(5), s = n(77), l = n(587), u = n(286), d = n(76), c = n(21), h = n(25), f = n(13),
        g = n(284), p = u.GroupAccelerateManagerNS.getManager(), k = l.GroupAccelerateEventManagerNS.getEventManager(),
        m = d.TabEventManagerNS.getEventEmitter(), T = a.default.getLogger("GroupAccelerate.WebManager");
    !function (e) {
        class t {
            constructor() {
                this.entryPage = "", this.pendingShowTeamInfoArray = new Array, this.taskSpeedListenerMap = new Map, this.taskStatusListenerMap = new Map, this.nextListenerCookie = 0, T.information("constructor")
            }

            init(e) {
                T.information("init", " entryPage: ", e), e && (this.entryPage = e), k.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, (e, t, n) => {
                    T.information("init OnTaskStatusChange", " taskId: ", e, " taskStatus: ", t, " taskUniqueId: ", n), this.fireTaskStatusChangeEvent(e, t, n)
                }), k.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, (e, t, n, i, a) => {
                    T.information("init OnTaskSpeedChange", " taskId: ", e, " taskSpeed: ", t, " increaseSpeed: ", n, " extraStr: ", i, " taskUniqueId: ", a), this.fireTaskSpeedChangeEvent(e, t, n, i, a)
                }), m.on(d.TabEventManagerNS.EventType.RemoveTab, e => {
                    if ("组队加速" === e.tabInfo.title && "groupAccelerate" === e.tabInfo.tab.name) {
                        p.exitAllTeamNoTask();
                        for (let [t, n]of this.taskSpeedListenerMap) if (n.tab === e.tabInfo.tab) {
                            this.taskSpeedListenerMap.delete(t);
                            break
                        }
                        for (let [t, n]of this.taskStatusListenerMap) if (n.tab === e.tabInfo.tab) {
                            this.taskStatusListenerMap.delete(t);
                            break
                        }
                    }
                }), this.registerNativeFunction()
            }

            openGroupAccelerateTabByTaskId(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    T.information("openGroupAccelerateTabByTaskId", " taskId: ", e, " entry: ", t, " panel: ", n, " queryString: ", a);
                    let i = p.getTaskUniqueIdByTaskId(e);
                    T.information("openGroupAccelerateTabByTaskId", " taskUniqueId: ", i), i && "" !== i && this.openGroupAccelerateTabByTaskUniqueId(i, t, n, a).then(e => {
                        T.information("openGroupAccelerateTabByTaskId success")
                    }).catch(() => {
                        T.information("openGroupAccelerateTabByTaskId failed")
                    })
                })
            }

            openGroupAccelerateTabByTaskUniqueId(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    if (T.information("openGroupAccelerateTabByTaskUniqueId", " taskUniqueId: ", e, " entry: ", t, " panel: ", n, " queryString: ", a), !e) return void T.information("openGroupAccelerateTabByTaskUniqueId bad taskUniqueId");
                    o.isNullOrUndefined(t) && (t = ""), o.isNullOrUndefined(n) && (n = ""), o.isNullOrUndefined(a) && (a = "");
                    let i = yield s.default(!1, !0, "groupspeedup");
                    if (T.information("openGroupAccelerateTabByTaskUniqueId", " userId: ", i), i && "0" !== i) {
                        let o = Number(i);
                        if (!isNaN(o) && 0 !== o) {
                            let i = JSON.stringify({
                                title: "组队加速",
                                url: this.entryPage,
                                name: "groupAccelerate",
                                showUrl: !1
                            });
                            r.NativeCallModule.nativeCall.CallNativeFunction("GetTabIndexByTitleAndName", i, (o, s) => {
                                if (T.information("GetTabIndexByTitleAndName", i, o, s), o === c.NativeFunctionErrorCode.Success && s > -1) T.information("groupAccelerate tab exists", s), r.NativeCallModule.nativeCall.CallNativeFunction("SelectTab", s), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e, t, n, a); else {
                                    let o = {};
                                    o.taskUniqueId = e, o.entry = t, o.panel = n, o.queryString = a, this.pendingShowTeamInfoArray.push(o), T.information("openGroupAccelerateTabByTaskUniqueId do opentab"), r.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", this.entryPage, i)
                                }
                            }), h.ConfigNS.setValue("GroupAccelerate", "unusecount", 0);
                            let o = (new Date).getTime();
                            h.ConfigNS.setValue("GroupAccelerate", "lastusetime", o), this.sendPageShowStat(e, t, n)
                        }
                    }
                })
            }

            fireTaskStatusChangeEvent(e, t, n) {
                this.taskStatusListenerMap.forEach((i, a) => {
                    i && i.tab && "nativeCallId" in i && i.callBackId && i.gcid === n && i.tab.callNativeFunctionCallback(i.nativeCallId, i.callBackId, e, t, n)
                })
            }

            fireTaskSpeedChangeEvent(e, t, n, i, a) {
                this.taskSpeedListenerMap.forEach((o, r) => {
                    o && o.tab && "nativeCallId" in o && o.callBackId && o.gcid === a && o.tab.callNativeFunctionCallback(o.nativeCallId, o.callBackId, e, t, n, i, a)
                })
            }

            registerNativeFunction() {
                let e = [{
                    functionName: "OpenGroupAccelerateTab",
                    nativeFunc: this.externalOpenGroupAccelerateTab.bind(this)
                }, {
                    functionName: "GetGroupTaskInfo",
                    nativeFunc: this.externalGetTaskInfo.bind(this)
                }, {functionName: "JoinTeam", nativeFunc: this.externalJoinTeam.bind(this)}, {
                    functionName: "ExitTeam",
                    nativeFunc: this.externalExitTeam.bind(this)
                }, {
                    functionName: "TeamPageReady",
                    nativeFunc: this.externalTeamPageReady.bind(this)
                }, {
                    functionName: "SubscribeTaskSpeed",
                    nativeFunc: this.externalSubscribeTaskSpeed.bind(this)
                }, {
                    functionName: "UnsubscribeTaskSpeed",
                    nativeFunc: this.externalUnsubscribeTaskSpeed.bind(this)
                }, {
                    functionName: "SubscribeTaskStatus",
                    nativeFunc: this.externalSubscribeTaskStatus.bind(this)
                }, {functionName: "UnsubscribeTaskStatus", nativeFunc: this.externalUnsubscribeTaskStatus.bind(this)}];
                d.setDefaultNativeFunctionMap(e)
            }

            externalOpenGroupAccelerateTab(e, t, n, i) {
                do {
                    if (T.information("externalOpenGroupAccelerateTab enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalOpenGroupAccelerateTab bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1]) || o.isNullOrUndefined(i[2]) || o.isNullOrUndefined(i[3])) {
                        T.information("externalOpenGroupAccelerateTab bad args"), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = i[2], l = i[3];
                    this.openGroupAccelerateTabByTaskId(a, r, s, l).then(e => {
                        T.information("externalOpenGroupAccelerateTab success")
                    }).catch(() => {
                        T.information("externalOpenGroupAccelerateTab failed")
                    }), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalGetTaskInfo(e, t, n, i) {
                do {
                    if (T.information("externalGetTaskInfo enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[1])) {
                        T.information("externalGetTaskInfo bad args"), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1];
                    T.information("externalGetTaskInfo", " taskId: ", a, " taskUniqueId: ", r);
                    let s = p.getTaskInfoJson(a, r);
                    T.information("externalGetTaskInfo", " taskInfoJson: ", s), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            externalJoinTeam(e, t, n, i) {
                do {
                    if (T.information("externalJoinTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[3])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = i[2], l = i[3], u = null;
                    try {
                        u = JSON.parse(s)
                    } catch (e) {
                        T.warning(e)
                    }
                    if (null === u) break;
                    let d = u.member_count;
                    d || (d = 0);
                    let h = u.group_name;
                    if (o.isNullOrUndefined(h) && (h = ""), T.information("externalJoinTeam", " taskId: ", a, " groupId: ", r, " opts: ", s, " taskUniqueId: ", l, " memberCount: ", d, " groupName: ", h), !r || !l) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    p.joinTeam(a, "" + r, h, d, l).catch();
                    let k = !1;
                    if ("1" !== g.DownloadModeNS.getCurrentDownloadMode()) {
                        g.DownloadModeNS.setFullDownloadMode(), k = !0;
                        let e = 0,
                            t = "taskid=" + (e = l && "" !== l ? p.getTaskIdByTaskUniqueId(l) : a) + ",gcid=" + l;
                        f.XLStatNS.trackEvent("download_pannel", "groupspeedup_fullspeed_change", "", 0, 0, 0, 0, t)
                    }
                    let m = JSON.stringify({hasChangeMode: k});
                    e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, m)
                } while (0)
            }

            externalExitTeam(e, t, n, i) {
                do {
                    if (T.information("externalExitTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1]) || o.isNullOrUndefined(i[2])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = i[2];
                    p.exitTeam(a, r, s), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalTeamPageReady(e, t, n, i) {
                do {
                    if (T.information("externalTeamPageReady enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalGetTaskInfo bad external args");
                        break
                    }
                    for (let e of this.pendingShowTeamInfoArray) e && (T.information("externalTeamPageReady fire event", " taskUniqueId: ", e.taskUniqueId, " entry: ", e.entry, " panel: ", e.panel, " queryString: ", e.queryString), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e.taskUniqueId, e.entry, e.panel, e.queryString));
                    this.pendingShowTeamInfoArray = [], e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskSpeed(e, t, n, i) {
                do {
                    if (T.information("externalSubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalSubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = {};
                    s.tab = e, s.nativeCallId = t, s.callBackId = r, s.gcid = a;
                    let l = this.nextListenerCookie;
                    this.taskSpeedListenerMap.set("" + l, s), this.nextListenerCookie += 1, e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskSpeed(e, t, n, i) {
                do {
                    if (T.information("externalUnsubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalUnsubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskStatus(e, t, n, i) {
                do {
                    if (T.information("externalSubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalSubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = {};
                    s.tab = e, s.nativeCallId = t, s.callBackId = r, s.gcid = a;
                    let l = this.nextListenerCookie;
                    this.taskStatusListenerMap.set("" + l, s), this.nextListenerCookie += 1, e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskStatus(e, t, n, i) {
                do {
                    if (T.information("externalUnsubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalUnsubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            sendPageShowStat(e, t, n) {
                do {
                    if (!e) break;
                    if (!t || !n) break;
                    let i = "entry=" + t + ",pannel=" + n + ",gcid=" + e;
                    f.XLStatNS.trackEvent("download_pannel", "groupspeedupdetail_show", "", 0, 0, 0, 0, i)
                } while (0)
            }
        }

        e.Manager = t;
        const n = new t;
        e.getManager = function () {
            return n
        }
    }(t.GroupAccelerateWebManagerNS || (t.GroupAccelerateWebManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(211), a = n(158);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(601);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, "69ad46c4", null);
    s.options.__file = "src\\common\\generator-view\\generator-view.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(215), a = n(160);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkbox.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1211);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(226), a = n(170);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(223), a = n(172);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed-time.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(217), a = n(176);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-radio.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(224), a = n(178);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-container.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(219), a = n(180);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkinput.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(220), a = n(182);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkselect.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(214), a = n(184);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-textarea.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(221), a = n(186);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed-text.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(222), a = n(188);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-proxy-list.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1213);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1217);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1220);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(10), r = n(254), s = n(287), l = n(194), u = n(751), d = n(13), c = n(12),
        h = n(7).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    var f, g;
    !function (e) {
        e.Market = "Market", e.Functional = "Functional"
    }(f = t.OrderType || (t.OrderType = {})), function (e) {
        e[e.TextButton = 1] = "TextButton", e[e.SmallImageButton = 2] = "SmallImageButton", e[e.BigImageButton = 3] = "BigImageButton", e[e.Image = 4] = "Image", e[e.Flash = 5] = "Flash"
    }(g = t.StyleType || (t.StyleType = {}));
    t.AdTips = class {
    }
}, , , , , , , , , , , , , , , , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("header", {staticClass: "xlx-client__header"}, [n("div", {
            staticClass: "xlx-client-header",
            class: {dragable: e.dragable}
        }, [n("login-area", {
            staticClass: "none-dragable", on: {
                "tooltip-show": function (t) {
                    e.dragable = !1
                }, "tooltip-hide": function (t) {
                    e.dragable = !0
                }
            }
        }), e._v(" "), n("address-bar-container", {staticClass: "none-dragable"}), e._v(" "), n("system-buttons-container", {staticClass: "none-dragable"}), e._v(" "), n("message-tips")], 1), e._v(" "), n("TabsContainer"), e._v(" "), n("book-marks")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)("div", {staticClass: "xlx-media"})
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-personal"}, [n("div", {
            staticClass: "xlx-personal-concise",
            class: e.strIsOffline
        }, [n("a", {
            ref: "userAvatar",
            staticClass: "xlx-personal-concise__avatar",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.clickUserHeader("head")
                }, mouseenter: function (t) {
                    e.enter("head")
                }
            }
        }, [n("img", {
            attrs: {src: e.curLoginHeaderUrl, alt: "头像", draggable: "false"}, on: {
                error: function (t) {
                    e.setDefaultHeader()
                }
            }
        })]), e._v(" "), !1 !== e.isLogin || "unlogin" !== e.curLoginStatus || e.promptData ? !1 === e.isLogin && "unlogin" === e.curLoginStatus && e.promptData ? n("a", {
            staticClass: "xlx-personal-concise__text",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.clickPromptTitle("wzl")
                }
            }
        }, [e._v(e._s(e.promptData.title))]) : n("a", {
            ref: "userNick",
            staticClass: "xlx-personal-concise__name",
            class: e.strNickCss,
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.clickUserHeader("name")
                }, mouseenter: function (t) {
                    e.enter("name")
                }
            }
        }, [e._v(e._s(e.userNick))]) : n("a", {
            ref: "login",
            staticClass: "xlx-personal-concise__button",
            attrs: {href: "#"},
            on: {
                click: e.clickUserHeader, function (t) {
                    e.enter("login")
                }
            }
        }, [e._v("登录")]), e._v(" "), e.vipData ? n("vip-icon", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin && !e.isCanShowOpenVipBtn,
                expression: "isLogin && !isCanShowOpenVipBtn"
            }],
            ref: "userVip",
            staticStyle: {cursor: "pointer"},
            attrs: {vipData: e.vipData, size: "normal", disabled: 0 === e.isVip},
            nativeOn: {
                click: function (t) {
                    e.onClick("vip")
                }, mouseenter: function (t) {
                    e.enter("vip")
                }
            }
        }) : e._e(), e._v(" "), n("td-tooltip", {
            attrs: {
                trigger: "hover",
                visible: e.isShowYearTip,
                offset: {x: -5, y: -4},
                placement: "bottom"
            }, on: {
                show: function (t) {
                    e.onToolYearTip(!0)
                }, hide: function (t) {
                    e.onToolYearTip(!1)
                }
            }
        }, [n("template", {slot: "content"}, [e._v("\n        " + e._s(e.yearTipsText) + "\n        "), n("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("nian_tip")
                }
            }
        }, [e._v(e._s(e.strOpenVip))])]), e._v(" "), n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin && !e.isCanShowOpenVipBtn,
                expression: "isLogin && !isCanShowOpenVipBtn"
            }], staticClass: "xlx-personal-concise__nian"
        }, [n("a", {
            class: e.userYearIcon, attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.onClick("nian")
                }
            }
        })])], 2), e._v(" "), n("td-tooltip", {
            attrs: {
                trigger: e.cashTipTrigger,
                visible: !1,
                offset: {x: -5},
                placement: "bottom"
            }
        }, [n("template", {slot: "content"}, [e._v("您有代金券可使用")]), e._v(" "), n("div", {staticClass: "xlx-personal-concise__vip"}, [n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: (e.isCanShowOpenVipBtn || e.isCanShowXufeiBtn) && "online" === e.curLoginStatus,
                expression: "(isCanShowOpenVipBtn || isCanShowXufeiBtn) && curLoginStatus==='online'"
            }], staticClass: "xlx-personal-concise__join", attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.onIconClick()
                }
            }
        }, [e._v(e._s(e.curIconText))])])], 2)], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-client__body"}, [t("home-tab-view", {
            directives: [{
                name: "opacity",
                rawName: "v-opacity",
                value: this.downloadShow,
                expression: "downloadShow"
            }], staticStyle: {position: "absolute"}
        }), this._v(" "), t("browser-view-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: this.webviewShow,
                expression: "webviewShow"
            }]
        }), this._v(" "), this.hadSettingTab ? t("setting-view-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: this.settingViewShow,
                expression: "settingViewShow"
            }]
        }) : this._e()], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xlx-client", attrs: {id: "app"}, on: {
                dragstart: function (e) {
                    e.preventDefault()
                }
            }
        }, [t("main-background"), this._v(" "), t("main-top"), this._v(" "), t("main-bottom")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-client-nav"}, [n("td-browser-tab", {
            attrs: {
                tabs: e.tabs,
                sortable: "",
                "min-width": 60,
                "show-total-limit": 12,
                current: e.current,
                background: e.background,
                "tab-listeners": e.tabListeners
            },
            on: {
                "update:tabs": e.updateTabs,
                "update:current": e.updateCurrent,
                add: e.handleAdd,
                remove: e.handleRemove,
                change: e.handleChange,
                "middle-click": e.handleMiddleDown,
                "total-click": e.handleTotalClick
            },
            nativeOn: {
                click: function (t) {
                    return e.handleClick(t)
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var i = t.index, a = t.tab;
                    return [0 === i && 0 !== e.current && -1 === e.currentCategoryId ? [n("div", {
                        ref: "progress",
                        staticClass: "xlx-browser-tab__progress",
                        class: {"is-finished": e.finished || e.hasNewTask, "is-fail": e.fail && !e.hasNewTask},
                        style: e.progressStyle
                    }, [n("span", {staticClass: "xlx-browser-tab__progress-inner"})]), e._v(" "), n("span", {staticClass: "xlx-browser-tab__text"}, [e._v("\n          " + e._s(e.titleCue) + "\n          "), e.hasDownloading && !e.hasNewTask ? [n("i", {staticClass: "xlx-browser-tab__status"}, [e.isLoading ? n("b", {staticClass: "xlx-browser-tab__load"}) : e._e(), e._v("\n              " + e._s(e.isLoading ? "连接资源" : e.speed) + "\n            ")])] : e._e(), e._v(" "), e.fail && !e.hasNewTask ? n("i", {staticClass: "td-icon-warning"}) : e._e(), e._v(" "), e.hasNewTask ? [n("i", {staticClass: "td-browser-tab__number"}, [e._v(e._s(e.newCount))])] : e._e()], 2)] : e._e(), e._v(" "), n("span", {
                        directives: [{
                            name: "show",
                            rawName: "v-show",
                            value: 0 !== i || 0 === e.current || -1 !== e.currentCategoryId,
                            expression: "index !== 0 || current === 0 || currentCategoryId !== -1"
                        }], attrs: {id: 0 === i ? "downloadTab" : "", tabindex: "0"}, on: {
                            click: function (t) {
                                0 === i && e.showChangeCategoryMenu()
                            }
                        }
                    }, [e._v("\n        " + e._s(0 === i && -1 !== e.currentCategoryId ? "私人空间" : a.title) + "\n        "), "community" === a.tab.name && e.unread ? n("i", {staticClass: "td-browser-tab__number"}, [e._v(e._s(e._f("unread")(e.unread)))]) : 0 === i && 0 === e.current ? n("i", {staticClass: "td-icon-arrow-drop"}) : e._e()])]
                }
            }])
        }), e._v(" "), e.isSpringFestivalSkin ? n("tabs-spring-festival", {attrs: {tabsCount: e.tabsCount}}) : e._e()], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-client-operate", on: {
                mouseenter: function (t) {
                    e.disableHover = !1
                }
            }
        }, [n("message-button-container"), e._v(" "), n("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.showIndividuation}
        }, [n("i", {
            staticClass: "xlx-icon-theme",
            attrs: {title: "个性化中心"}
        }, [e.isShowNewTag ? n("i", {staticClass: "xlx-tag-new-1"}, [e._v("new")]) : e._e()])]), e._v(" "), n("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.showMenu}
        }, [n("i", {
            staticClass: "xlx-icon-menu",
            attrs: {title: "主菜单"}
        }), e._v(" "), e.showNewIcon ? n("i", {staticClass: "xlx-tag-new"}) : e._e()]), e._v(" "), n("a", {
            ref: "minize",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.minizeMainWindow}
        }, [n("i", {staticClass: "xlx-icon-minimize"})]), e._v(" "), n("a", {
            ref: "maximize",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.toggleMaximizeMainWindow}
        }, [n("i", {
            staticClass: "xlx-icon-maximize",
            class: {"is-active": e.maximized}
        })]), e._v(" "), n("a", {
            ref: "close",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.closeMainWindow}
        }, [n("i", {staticClass: "xlx-icon-close"})])], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("td-input-group", {staticClass: "xlx-search"}, [n("td-input-group-button", {
            attrs: {
                slot: "prepend",
                title: "后退",
                disabled: !e.canGoBack
            }, nativeOn: {
                click: function (t) {
                    return e.goBack(t)
                }
            }, slot: "prepend"
        }, [n("td-icon", {attrs: {type: "arrow-left"}})], 1), e._v(" "), n("td-input-group-button", {
            attrs: {
                slot: "prepend",
                title: "前进",
                disabled: !e.canGoForward
            }, nativeOn: {
                click: function (t) {
                    return e.goForward(t)
                }
            }, slot: "prepend"
        }, [n("td-icon", {attrs: {type: "arrow-right"}})], 1), e._v(" "), e.isHttps ? n("td-icon", {
            attrs: {
                slot: "prepend",
                type: "security"
            }, slot: "prepend"
        }) : e._e(), e._v(" "), n("td-input", {
            ref: "input",
            attrs: {value: e.textData, placeholder: e.placeholder},
            on: {
                focus: e.onInputFocus, blur: e.onInputBlur, input: e.handle, keydown: [function (t) {
                    return "button" in t || !e._k(t.keyCode, "enter", 13, t.key, "Enter") ? e.navigate(t) : null
                }, function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? void e.$refs.input.select() : null
                }]
            },
            nativeOn: {
                contextmenu: function (t) {
                    return e.handlePopInputMenu(t)
                }
            }
        }), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showGroupEnrty,
                expression: "showGroupEnrty"
            }], staticClass: "xlx-search__button", attrs: {href: "javascript:;"}, on: {click: e.handleClickGroup}
        }, [n("i", {staticClass: "xlx-icon-chat"}), e._v("加入社区\n  ")]), e._v(" "), n("a", {
            staticClass: "td-input__button",
            attrs: {href: "javascript:;"}
        }, [n("i", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.hideCollectIcon,
                expression: "!hideCollectIcon"
            }],
            staticClass: "xlx-icon-fav",
            class: {"is-active": void 0 !== e.bookMarks[e.curUrl]},
            attrs: {title: "收藏"},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handleCollect(t)
                }
            }
        })]), e._v(" "), n("td-input-group-button", {
            attrs: {slot: "append", title: "刷新", disabled: !e.canRefresh},
            nativeOn: {
                click: function (t) {
                    return e.goRefresh(t)
                }
            },
            slot: "append"
        }, [n("td-icon", {attrs: {type: "refresh"}})], 1)], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-client-content xlx-client-content--default"}, [t("download-panel"), this._v(" "), t("home-page")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)("span", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !1,
                expression: "false"
            }]
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowBookMarkBar,
                expression: "isShowBookMarkBar"
            }], staticClass: "xlx-bookmarks-bar"
        }, [n("div", {
            staticClass: "xlx-bookmarks-bar__content", on: {
                contextmenu: function (t) {
                    t.stopPropagation(), e.showAddBookMarkMenu()
                }
            }
        }, e._l(e.showMarksList, function (t) {
            return n("a", {
                key: t.url,
                staticClass: "xlx-bookmarks-bar__item",
                attrs: {href: "javascript:;", title: t.name + "\n" + t.url},
                on: {
                    click: function (n) {
                        return "button" in n || !e._k(n.keyCode, "left", 37, n.key, ["Left", "ArrowLeft"]) ? "button" in n && 0 !== n.button ? null : (n.stopPropagation(), void e.openNewTab(t.url, t.name)) : null
                    }, contextmenu: function (n) {
                        n.stopPropagation(), e.showBookMarkMenu(t.url, t.name)
                    }
                }
            }, [n("book-marks-item", {
                attrs: {
                    url: t.url,
                    iconUrl: t.iconUrl,
                    updateBookMarksIconUrl: e.updateBookMarksIconUrl
                }
            }), e._v(" "), n("span", {staticClass: "xlx-bookmarks-bar__text"}, [e._v(e._s(t.name))])], 1)
        })), e._v(" "), e.hideBookMarksList.length ? n("a", {
            staticClass: "xlx-bookmarks-bar__more",
            attrs: {href: "javascript:;"},
            on: {click: e.showMenu}
        }, [n("i", {staticClass: "xlx-icon-unfold"})]) : e._e()])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-activity-spring"}, [n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.redPaperVisible,
                expression: "redPaperVisible"
            }], staticClass: "xlx-activity-spring__link"
        }, [n("a", {
            attrs: {href: "#"}, on: {
                click: function (t) {
                    return t.stopPropagation(), e.clickRedPaper(t)
                }
            }
        }, [e._v(e._s(e.text))])]), e._v(" "), n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.recoverSkinVisible,
                expression: "recoverSkinVisible"
            }], staticClass: "xlx-activity-spring__back"
        }, [n("a", {
            attrs: {href: "javascript:;", title: "恢复原有皮肤"}, on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickRecoverSkin(t)
                }
            }
        }, [n("span", [e._v("恢复原有皮肤>")])])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-client-content"}, [n("div", {
            ref: "settinContain",
            staticClass: "xlx-setting",
            on: {scroll: e.handleScroll}
        }, [n("ul", {staticClass: "xlx-setting-nav"}, e._l(e.confSchema, function (t, i) {
            return n("li", {
                key: i,
                staticClass: "xlx-setting-nav__item",
                class: {"is-active": e.currenIndex === i},
                on: {
                    click: function (t) {
                        e.clickTab(i)
                    }
                }
            }, [n("a", {attrs: {href: "#"}}, [e._v(e._s(t.name))])])
        })), e._v(" "), n("div", {staticClass: "xlx-setting-wrapper"}, e._l(e.confSchema, function (t, i) {
            return n("div", {
                key: i,
                staticClass: "xlx-setting-content contain-tab",
                staticStyle: {display: "block"}
            }, [n("ul", e._l(t.children, function (t, i) {
                return n("li", {
                    key: i,
                    staticClass: "xlx-setting-content__item"
                }, [n("span", {staticClass: "xlx-setting-content__label"}, [e._v(e._s(t.name))]), e._v(" "), n("div", {staticClass: "xlx-setting-content__box"}, [n("ul", {class: t.classes}, e._l(t.children, function (t, i) {
                    return n("li", {key: i, class: t.liClasses || ""}, [n("generator-view", {
                        attrs: {
                            item: t,
                            formData: e.formData
                        }, on: {input: e.handleConfChange}
                    })], 1)
                }))])])
            }))])
        }))])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-client-content"}, [n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isError,
                expression: "isError"
            }], staticClass: "error-page"
        }, [e._m(0), e._v(" "), n("div", {staticClass: "error-button"}, [n("td-button", {
            attrs: {
                secondary: "",
                disabled: !e.canGoBack
            }, on: {click: e.goBack}
        }, [e._v("返回")]), e._v(" "), n("td-button", {on: {click: e.refresh}}, [e._v("刷新")])], 1)])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "error-main"}, [t("div", {staticClass: "pic-error"}), this._v(" "), t("h1", [this._v("您访问的网站飞到了外太空")]), this._v(" "), t("p")])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("span", {staticClass: "xlx-bookmarks__icon"}, [this.iconExist ? t("img", {attrs: {src: this.existUrl}}) : t("i", {staticClass: "xlx-icon-net"})])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-client-side",
            class: {"is-secret": e.isShowPrivateSpace}
        }, [n("tool-bar-container"), e._v(" "), n("ad-platform-ctrl", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.adShow,
                expression: "adShow"
            }], on: {"ad-show": e.handleAdShow}
        }), e._v(" "), e.isSearch ? n("download-search-container", {
            attrs: {isFengxingAdShow: e.isFengxingAdShow},
            on: {"close:keysearch": e.closeSearchUI}
        }) : e._e(), e._v(" "), e.showPrivateSpaceOpenPage ? n("private-space-open-page-container") : n("download-list-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.isSearch,
                expression: "!isSearch"
            }], ref: "downloadlist", nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyOpenSearchUI(t) : null
                }
            }
        }), e._v(" "), e.showUpgradeTask ? n("upgrade-task-container") : e._e(), e._v(" "), n("toast-notify", {attrs: {fengxingAdEnable: e.isFengxingAsEnable}}), e._v(" "), n("status-bar-container"), e._v(" "), n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isFengxingAdShow,
                expression: "isFengxingAdShow"
            }], staticClass: "xlx-side-promotion", staticStyle: {background: "transparent"}
        })], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-client-index"}, [t("webview", {
            ref: "webview",
            staticClass: "iframe-home",
            attrs: {nodeintegration: "", src: this.homePageUrl, preload: this.preloadPath}
        })], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            directives: [{name: "show", rawName: "v-show", value: e.show, expression: "show"}],
            staticClass: "xlx-bar",
            class: e.isUp ? "xlx-bar--" + e.type + " is-up" : "xlx-bar--" + e.type,
            on: {mousemove: e.handleMouseMove, mouseout: e.handleMouseOut}
        }, [n("p", ["fail" === e.type ? n("i", {staticClass: "td-icon-warning"}) : e._e(), e._v(e._s(e.message))]), e._v(" "), n("div", {staticClass: "xlx-bar__option"}, [e.cancel ? n("a", {
            staticClass: "xlx-bar__button",
            attrs: {href: "javascript:;"},
            on: {click: e.handleCancel}
        }, [e._v("取消")]) : e._e(), e._v(" "), n("a", {
            staticClass: "xlx-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.handleClose}
        }, [n("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-bar xlx-bar--ad"}, [n("p", [n("span", {staticClass: "xlx-bar__image"}, [n("img", {
            attrs: {
                src: e.iconUrl,
                alt: ""
            }
        })]), n("a", {
            attrs: {href: "#"}, on: {
                click: function (t) {
                    e.onClick("content")
                }
            }
        }, [e._v(e._s(e.content))])]), e._v(" "), n("div", {staticClass: "xlx-bar__option"}, [n("a", {
            staticClass: "xlx-bar__button",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("btn")
                }
            }
        }, [e._v(e._s(e.btnText))]), e._v(" "), n("a", {
            staticClass: "xlx-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {
                click: function (t) {
                    e.onClick("close")
                }
            }
        }, [n("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-search"}, [n("div", {staticClass: "xlx-search-record"}, [n("label", {staticClass: "td-input"}, [n("td-input", {
            ref: "input",
            attrs: {placeholder: e.holderTextTip},
            on: {
                focus: e.onInputFocus, blur: e.onInputBlur, input: e.startSearch, keydown: function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? void e.$refs.input.select() : null
                }
            },
            nativeOn: {
                contextmenu: function (t) {
                    return e.handlePopInputMenu(t)
                }, keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            },
            model: {
                value: e.curSearchKey, callback: function (t) {
                    e.curSearchKey = t
                }, expression: "curSearchKey"
            }
        })], 1), e._v(" "), this.inputFlag && this.curSearchKey.trim().length > 0 ? n("p", {staticClass: "xlx-search-record__result"}, [n("span", [e._v(e._s(e.resultCount))]), e._v("个结果")]) : e._e(), e._v(" "), n("a", {
            staticClass: "xlx-search-record__clear is-danger",
            attrs: {href: "#", title: ""},
            on: {click: e.clickCloseSearch}
        }, [n("i", {staticClass: "td-icon-close"})])]), e._v(" "), n("div", {
            staticClass: "xlx-search-list",
            style: {height: e.isFengxingAdShow ? "calc(100% - 68px - 46px)" : "calc(100% - 46px)"}
        }, [n("td-collapse", {
            staticClass: "xlx-search-list",
            staticStyle: {height: "100%"},
            attrs: {value: e.searchListPanel, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [e.downloadingSearchList.length > 0 ? n("td-collapse-item", {
            staticClass: "xlx-side-downloading",
            attrs: {title: e.downloadingCategoryTitle, value: e.categoryLastSelectList[0].category, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [n("download-category", {
            ref: "downloading",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "DownloadingItemContainer",
                sortable: !1,
                tasklist: e.downloadingSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_DOWNLOADING_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag
            },
            on: {dblclick: e.downloadingItemDbClick, contextmenu: e.handleDownloadingItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!1)
                }
            }
        })], 1) : e._e(), e._v(" "), e.completeSearchList.length > 0 ? n("td-collapse-item", {
            staticClass: "xlx-side-completed",
            attrs: {title: e.completedCategoryTitle, value: e.categoryLastSelectList[1].category, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [n("download-category", {
            ref: "completed",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "CompletedItemContainer",
                sortable: !1,
                tasklist: e.completeSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_COMPLETED_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag
            },
            on: {contextmenu: e.handleCompletedItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!1)
                }
            }
        })], 1) : e._e(), e._v(" "), e.recycleSearchList.length > 0 ? n("td-collapse-item", {
            staticClass: "xlx-side-deleted",
            attrs: {title: e.recycleCategoryTitle, value: e.categoryLastSelectList[2].category, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [n("download-category", {
            ref: "dustbin",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "RecycleItemContainer",
                sortable: !1,
                tasklist: e.recycleSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_RECYCLE_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect
            },
            on: {dblclick: e.recycleItemDbClick, contextmenu: e.handleRecycleItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!0)
                }
            }
        })], 1) : e._e(), e._v(" "), this.inputFlag && e.resultCount < 1 && this.curSearchKey.trim().length > 0 ? n("div", {staticClass: "xlx-side__empty"}, [n("p", [e._v("没有搜索到相关内容")])]) : e._e()], 1)], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-nav"}, [this._l(this.toolbarButtons, function (e) {
            return ["xlx-icon-nav-vip" != e.id ? t("tool-bar-button-container", {
                key: e.id,
                attrs: {id: e.id, title: e.title, buttonClassFilter: e.filterClass, click: e.onClick}
            }) : t("tool-bar-vip-button-container", {
                key: e.id,
                attrs: {id: e.id, title: e.title, buttonClassFilter: e.filterClass, click: e.onClick}
            })]
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.isLimit ? "xlx-status is-limit" : "xlx-status"}, [n("div", {staticClass: "xlx-status-control"}, [n("div", {
            staticClass: "xlx-status-plan",
            attrs: {tabindex: "0"},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("entry")
                }, blur: e.onPopUpBlur
            }
        }, [n("p", {staticClass: "xlx-status-plan__text"}, [n("i", {staticClass: "xlx-icon-time"}), e._v(" "), n("span", [e._v(e._s(e.entryText))]), e._v(" "), n("span", {staticClass: "xlx-status-plan__line"})]), e._v(" "), n("div", {
            staticClass: "xlx-status-control-pop",
            style: e.popUp ? "display:block;" : "display:none"
        }, [n("div", {staticClass: "td-context-menu"}, [n("ul", {staticClass: "td-context-menu__main"}, [n("li", {
            class: e.isLimit ? "td-context-menu__item is-limit" : "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("limitSpeed")
                }
            }
        }, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v(e._s(e.limitSpeetMenuText))])])]), e._v(" "), e.isLimit ? n("li", {
            staticClass: "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("totalSpeed")
                }
            }
        }, [e._m(0)]) : e._e()]), e._v(" "), n("ul", {staticClass: "td-context-menu__main"}, [n("li", {
            staticClass: "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("freeDownload")
                }
            }
        }, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}, [n("i", {class: {"td-icon-choose": e.isFreeDownload}})]), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v("空闲下载")])])]), e._v(" "), n("li", {
            staticClass: "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("scheduleTask")
                }
            }
        }, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v("计划任务")]), e._v(" "), e.scheduleTaskCount > 0 ? n("span", {staticClass: "xlx-context-menu__number"}, [e._v(e._s(e.scheduleTaskCount))]) : e._e()])])]), e._v(" "), n("ul", {staticClass: "td-context-menu__main"}, [n("li", {staticClass: "td-context-menu__item xlx-context-menu__item--customize"}, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v("下载完成后:")]), e._v(" "), n("ul", {staticClass: "xlx-context-menu__tag"}, [n("li", {
            class: {"is-chosen": 0 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("shutdown")
                }
            }
        }, [n("a", {attrs: {href: "#"}}, [e._v("关机")])]), e._v(" "), n("li", {
            class: {"is-chosen": 1 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("sleep")
                }
            }
        }, [n("a", {attrs: {href: "#"}}, [e._v("睡眠")])]), e._v(" "), n("li", {
            class: {"is-chosen": 2 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("exit")
                }
            }
        }, [n("a", {attrs: {href: "#"}}, [e._v("退出")])])])])])])])])])]), e._v(" "), e.canShowKuainiaoInterface ? n("div", {staticClass: "xlx-status-plugin"}, [n("a", {
            staticClass: "xlx-status-plugin__kuainiao",
            attrs: {href: "javascript:;"},
            on: {click: e.onKuainiaoTextClick}
        }, [e._v(e._s(e.kuaiNiaoText))]), e._v(" "), e.canShowKuainiaoTip ? n("div", {
            staticClass: "xlx-status-plugin-pop ",
            on: {click: e.onKuainiaoTipClick}
        }, [n("div", {staticClass: "xlx-status-plugin-pop__kuainiao"}, [n("i"), n("p", [e._v(e._s(e.kuaiNiaoTipText))])])]) : e._e()]) : e._e(), e._v(" "), n("div", {staticClass: "xlx-status-speed"}, [e.canShowVipSpeed ? n("div", {staticClass: "xlx-status-speed__text"}, [n("p", {
            on: {
                mouseover: e.showPop,
                mouseleave: e.hidePop
            }
        }, [e._v("\n        " + e._s(e.curSpeed) + "\n        "), n("em", [e._v("+" + e._s(e.curVipSpeed))])])]) : n("div", {staticClass: "xlx-status-speed__text"}, [n("p", {
            on: {
                mouseover: e.showPop,
                mouseleave: e.hidePop
            }
        }, [e._v("\n        " + e._s(e.curSpeed) + "\n        "), n("em")]), e._v(" "), n("a", {
            staticClass: "xlx-status-speed__link",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handClickleVipText(t)
                }
            }
        }, [e._v(e._s(e.vipText))])]), e._v(" "), n("div", {
            staticClass: "xlx-status-speed-pop",
            style: {display: e.bDisplay}
        }, [n("div", {staticClass: "xlx-status-speed-list"}, [n("div", {staticClass: "xlx-status-speed-list__item"}, [n("i", {staticClass: "xlx-icon xlx-icon-tips-download"}), e._v(" "), n("p", [e._v("\n            当前下载速度：\n            "), n("em", [e._v(e._s(e.curHoverSpeed))])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed-list__item"}, [n("i", {staticClass: "xlx-icon xlx-icon-tips-upload"}), e._v(" "), n("p", [e._v("\n            当前上传速度：\n            "), n("em", [e._v(e._s(e.curUpSpeed))])])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed-list"}, [n("div", {staticClass: "xlx-status-speed-list__item"}, [n("p", [e._v("\n            今日下载流量：\n            "), n("em", [e._v(e._s(e.downSize))])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed-list__item"}, [n("p", [e._v("\n            今日上传流量：\n            "), n("em", [e._v(e._s(e.upSize))])])])])])]), e._v(" "), e.canShowDiskBusy ? n("div", {
            staticClass: "xlx-status-disk",
            on: {
                mouseenter: function (t) {
                    e.hover()
                }
            }
        }, [n("span", {staticClass: "xlx-status-plan__line"}), e._v(" "), e._m(1), e._v(" "), n("div", {staticClass: "xlx-status-disk__pop"}, [e._m(2), e._v(" "), n("div", {staticClass: "xlx-status-disk__content"}, [n("div", {staticClass: "xlx-status-disk__progress"}, [n("ul", e._l(e.diskInfo, function (t) {
            return n("li", {key: t.name}, [n("div", {staticClass: "td-progress"}, [n("div", {staticClass: "td-progress-bar"}, [n("div", {staticClass: "td-progress-bar__outer"}, [n("div", {
                staticClass: "td-progress-bar__inner",
                style: {width: t.percent + "%"}
            })])])]), e._v(" "), n("p", {staticClass: "xlx-status-disk__progress-text"}, [e._v("\n                磁盘 " + e._s(t.name) + ")繁忙度：\n                "), n("span", [e._v(e._s(t.percent) + "%")])])])
        })), e._v(" "), e._m(3)]), e._v(" "), n("button", {
            staticClass: "td-button", on: {
                click: function (t) {
                    e.openTab()
                }
            }
        }, [n("i", {staticClass: "td-icon-question"}), e._v("了解磁盘繁忙原因\n        ")])])])]) : e._e()])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-context-menu__content"}, [t("span", {staticClass: "td-context-menu__text"}, [this._v("全速下载")])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", {staticClass: "xlx-status-disk__text"}, [t("i", {staticClass: "xlx-icon-disk"}), this._v(" 磁盘繁忙\n    ")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-status-disk__note"}, [t("span", {staticClass: "td-dialog-comfirm__icon"}, [t("i", {staticClass: "td-icon-warning"})]), this._v(" "), t("div", {staticClass: "xlx-status-disk__title"}, [t("p", [this._v("检测到磁盘过于繁忙！")])])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-status-disk__detail"}, [t("p", [this._v("可能会导致以下情况，请您耐心等待：")]), this._v(" "), t("ul", [t("li", [this._v("1.下载速度变慢")]), this._v(" "), t("li", [this._v("2.电脑响应变慢")]), this._v(" "), t("li", [this._v("3.下载进度卡在99.9%")])])])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-side-update"}, [t("div", {staticClass: "xlx-side-update__progress"}, [this._v(this._s(this.progress) + "%")]), this._v(" "), this._m(0)])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", [this._v("正在升级下载引擎"), t("span", [t("i", [this._v("...")])])])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-collapse xlx-side"}, [t("div", {staticClass: "xlx-side__empty"}, [t("span", {staticClass: "xlx-icon-empty-secret"}), this._v(" "), t("h3", [this._v("私人空间")]), this._v(" "), t("p", {staticClass: "xlx-side__empty-text"}, [this._v("只有自己可以查看的下载任务")]), this._v(" "), t("a", {
            staticClass: "td-button",
            attrs: {href: "javascript:;"},
            on: {click: this.openPrivateSpace}
        }, [this._v("开启私人空间")])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("td-collapse", {
            staticClass: "xlx-side",
            class: {"is-hover": e.isHoverClass},
            attrs: {value: e.currentCategoryViewId},
            on: {change: e.handleCollapseChange}
        }, [n("td-collapse-item", {
            staticClass: "xlx-side-downloading",
            attrs: {title: e.downloadingCategoryTitle, value: e.categoryLastSelectList[0].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleDownloadingCategoryMenu(t)
                }, keydown: [function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }, function (t) {
                    return e.handleKeyDown(t)
                }]
            }
        }, [0 === e.downloadingTaskList.length ? n("div", {
            staticClass: "xlx-side__empty",
            staticStyle: {height: "100%"},
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }
            }
        }, [n("span", {staticClass: "xlx-icon-empty-down"}), e._v(" "), n("p", [e._v("没有正在下载任务")])]) : n("download-category", {
            ref: "downloading",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "DownloadingItemContainer",
                tasklist: e.downloadingTaskList,
                selectedTaskIds: e.downloadingSelectedIndexs,
                COMMIT_SELECT: e.UPDATE_DOWNLOADING_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_DOWNLOADING_TASKLIST,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId
            },
            on: {dblclick: e.downloadingItemDbClick, contextmenu: e.handleDownloadingItemMenu},
            nativeOn: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }, keydown: function (t) {
                    return e.handleDelete(t)
                }
            }
        })], 1), e._v(" "), n("td-collapse-item", {
            staticClass: "xlx-side-completed",
            attrs: {title: e.completedCategoryTitle, value: e.categoryLastSelectList[1].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleCompletedCategoryMenu(t)
                }, keydown: [function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }, function (t) {
                    return e.handleKeyDown(t)
                }]
            }
        }, [n("template", {slot: "title"}, [e._v("\n      " + e._s(e.completedCategoryTitle) + "\n      "), n("div", {
            staticClass: "xlx-side-filter__title",
            class: {"is-show": "全部" !== e.completedFilter},
            on: {click: e.showFilterMenu}
        }, [n("span", {staticClass: "xlx-side-filter__icon is-collapse"}, [n("i", {
            ref: "filterMenu",
            staticClass: "td-icon-arrow-drop"
        })]), e._v(" "), n("span", {staticClass: "xlx-side-filter__text"}, [e._v(e._s(e.completedFilter))])])]), e._v(" "), 0 === e.completedTaskList.length ? n("div", {
            staticClass: "xlx-side__empty",
            staticStyle: {height: "100%"},
            on: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }
            }
        }, [n("span", {staticClass: "xlx-icon-empty-finish"}), e._v(" "), n("p", [e._v("没有已完成任务")])]) : n("download-category", {
            ref: "completed",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "CompletedItemContainer",
                sortable: "全部" === e.completedFilter,
                tasklist: e.completedFilterTaskList,
                selectedTaskIds: e.completedSelectedTaskIndexs,
                COMMIT_SELECT: e.UPDATE_COMPLETED_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_COMPLETED_TASKLIST,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId
            },
            on: {contextmenu: e.handleCompletedItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    return e.handleDelete(t)
                }
            }
        })], 2), e._v(" "), -1 === e.currentCategoryId ? n("td-collapse-item", {
            staticClass: "xlx-side-deleted",
            attrs: {title: e.recycleCategoryTitle, value: e.categoryLastSelectList[2].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleRecycleCategoryMenu(t)
                }, keydown: [function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }, function (t) {
                    return e.handleKeyDown(t)
                }]
            }
        }, [0 === e.recycleTaskList.length ? n("div", {
            staticClass: "xlx-side__empty",
            staticStyle: {height: "100%"},
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }
            }
        }, [n("span", {staticClass: "xlx-icon-empty-dustbin"}), e._v(" "), n("p", [e._v("没有垃圾箱任务")])]) : n("download-category", {
            ref: "dustbin",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "RecycleItemContainer",
                tasklist: e.recycleTaskList,
                selectedTaskIds: e.recycleSelectedTaskIndexs,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                COMMIT_SELECT: e.UPDATE_RECYCLE_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_RECYCLE_TASKLIST
            },
            on: {contextmenu: e.handleRecycleItemMenu},
            nativeOn: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }, keydown: function (t) {
                    e.handleDelete(t, !0)
                }
            }
        })], 1) : e._e(), e._v(" "), e._t("default")], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("td-list", {
            staticStyle: {height: "100%"},
            attrs: {
                list: e.loadedListWithKey,
                multiple: "",
                drop: "",
                sortable: e.sortable,
                "drag-selectable": "",
                "chosen-keys": e.selectedTaskIds,
                "load-more": e.loadMore,
                "scroll-speed": 6
            },
            on: {"update:chosenKeys": e.handleSelectChange, "update:list": e.handleListChange},
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var i = t.item, a = t.index, o = t.chosen, r = t.active;
                    return [n(e.componentName, {
                        tag: "component",
                        attrs: {
                            taskId: i.key,
                            itemType: e.itemType,
                            sharedKeyWords: e.sharedKeyWords,
                            pulseForRename: e.pulseForRename,
                            currentCategoryId: e.currentCategoryId,
                            currentCategoryViewId: e.currentCategoryViewId,
                            deleted: e.deleted[i.key],
                            opened: e.opened[i.key],
                            chosen: o,
                            active: r,
                            index: a
                        },
                        on: {
                            "update:deleted": function (t) {
                                e.$set(e.deleted, i.key, t)
                            }, "update:opened": function (t) {
                                e.$set(e.opened, i.key, t)
                            }, dblclick: e.handleItemDbClick, "active-change": function (t) {
                                return e.handleActiveChange(t, a)
                            }, "active-nearby": e.handleActiveNearby
                        },
                        nativeOn: {
                            contextmenu: function (t) {
                                return t.stopPropagation(), e.handleContextMenu(t)
                            }
                        }
                    })]
                }
            }])
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("a", {
            staticClass: "xlx-nav-operate",
            class: e.filterClass,
            attrs: {href: "javascript:;", title: e.handleTitle},
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, ["" == e.vipIcon ? n("i", {class: e.id}) : n("img", {attrs: {src: e.vipIcon}, on: {error: e.handleError}})])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("a", {
            staticClass: "xlx-nav-operate",
            class: this.filterClass,
            attrs: {href: "javascript:;", title: this.title},
            on: {click: this.handleClick}
        }, [t("i", {class: this.id})])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-item"}, [n("div", {staticClass: "xlx-side-wrapper"}, [n("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [n("i", {
            staticClass: "xlx-icon-type",
            class: e.fileTypeClass,
            style: e.isFileIcon ? {background: "url(" + e.fileIcon + ")", "background-size": "100% 100%"} : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), n("p", {
            staticClass: "xlx-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {mouseover: e.handleTaskNameMouseOver}
        }), e._v(" "), n("div", {staticClass: "xlx-side-operate"}, [n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "还原"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleRestore(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-restore"})]), e._v(" "), n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "彻底删除"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleClear(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-clear"})])]), e._v(" "), n("div", {staticClass: "xlx-file-info"}, [n("p", {staticClass: "xlx-file-size"}, [n("span", {staticClass: "xlx-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), n("p", {staticClass: "xlx-file-time"}, [e._v(e._s(e.creationTime))])])])], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-item"}, [n("div", {staticClass: "xlx-side-wrapper"}, [n("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return t.stopPropagation(), e.handleDbClick(t)
                }, mouseover: function (t) {
                    return e.handleItemMouseHover(t)
                }, mouseout: function (t) {
                    return e.handleItemMouseOut(t)
                }
            }
        }, [n("i", {
            staticClass: "xlx-icon-type",
            class: e.fileTypeClass,
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), n("p", {
            staticClass: "xlx-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {mouseover: e.handleTaskNameMouseOver}
        }), e._v(" "), n("div", {staticClass: "xlx-side-operate"}, [e.isForbidden ? [n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "彻底删除"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-clear"})])] : [e.canPlay ? n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "边下边播"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePlayTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-download-play"})]) : e._e(), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canStart,
                expression: "canStart"
            }],
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "下载"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: e.handleStartTask
            }
        }, [n("i", {staticClass: "xlx-icon-download"})]), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canPause,
                expression: "canPause"
            }],
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "暂停"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: e.handlePauseTask
            }
        }, [n("i", {staticClass: "xlx-icon-pause"})])]], 2), e._v(" "), n("td-progress", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.taskError,
                expression: "!taskError"
            }], class: {"is-super": e.isSuperVip}, attrs: {value: e.progress}
        }), e._v(" "), n("div", {staticClass: "xlx-file-info"}, [e.taskError ? [n("p", {staticClass: "xlx-file-error"}, [e._v(e._s(e.errInfo))])] : e.showStartTemplate ? [n("p", {staticClass: "xlx-file-size"}, [n("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [n("span", {
            staticClass: "xlx-file-size__total", on: {
                mouseover: function (t) {
                    e.onShowQueryTip(!0)
                }, mouseout: function (t) {
                    e.onShowQueryTip(!1)
                }
            }
        }, [e._v(e._s(e.fileSizeFormat))])])], 1), e._v(" "), e.bTaskCountShow ? n("a", {
            staticClass: "xlx-file-num",
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleFileCountClick(t)
                }, dblclick: function (e) {
                    e.stopPropagation()
                }
            }
        }, [e._v(e._s(e.subTaskCountDesc))]) : e._e(), e._v(" "), n("p", {staticClass: "xlx-file-time"}, [e._v(e._s(e.remain))]), e._v(" "), n("p", {staticClass: "xlx-file-speed"}, [n("span", {staticClass: "xlx-file-speed__total"}, [e._v(e._s(e.taskStatusSpeedInfo))]), e._v(" "), n("ItemVipSpeed", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                active: e.active,
                startStatusPrompt: e.startStatusPrompt
            }, on: {"vip-taskinfo": e.handleVipTaskInfo}
        })], 1)] : [n("p", {staticClass: "xlx-file-size"}, [n("span", {staticClass: "xlx-file-size__finish"}, [e._v(e._s(e.downloadSizeFormat))]), e._v(" "), n("span", {staticClass: "xlx-file-size__separator"}, [e._v("/")]), e._v(" "), n("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [n("span", {
            staticClass: "xlx-file-size__total", on: {
                mouseover: function (t) {
                    e.onShowQueryTip(!0)
                }, mouseout: function (t) {
                    e.onShowQueryTip(!1)
                }
            }
        }, [e._v(e._s(e.fileSizeFormat))])])], 1), e._v(" "), e.bTaskCountShow ? n("a", {
            staticClass: "xlx-file-num",
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, dblclick: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleFileCountClick(t)
                }
            }
        }, [e._v(e._s(e.subTaskCountDesc))]) : e._e(), e._v(" "), n("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.percentVisible,
                expression: "percentVisible"
            }], staticClass: "xlx-file-percent"
        }, [e._v(e._s(e.progressPercent))]), e._v(" "), n("p", {staticClass: "xlx-file-status"}, [e._v("\n            " + e._s(e.taskStatusSpeedInfo) + "\n            "), n("ItemVipSpeed", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                active: e.active
            }, on: {"vip-taskinfo": e.handleVipTaskInfo}
        })], 1)]], 2)], 1), e._v(" "), n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowExpand,
                expression: "isShowExpand"
            }], staticClass: "xlx-side-ad"
        }, [n("div", {staticClass: "xlx-side-ad__image"}, [n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowGroupAccelerate,
                expression: "isShowGroupAccelerate"
            }], staticClass: "xlx-ad-group"
        })]), e._v(" "), n("ItemVipExpand", {attrs: {taskId: e.taskId, visible: e.isShowExpand}})], 1)], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-item"}, [n("div", {staticClass: "xlx-side-wrapper"}, [n("a", {
            staticClass: "xlx-side-completed__mark",
            attrs: {href: "javascript:;", title: e.markTitle},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleMark(t)
                }
            }
        }), e._v(" "), n("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [n("i", {
            class: e.fileTypeClass,
            style: e.isInstallFileIcon ? {
                background: "url(" + e.installFileIcon + ")",
                "background-size": "100% 100%"
            } : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), n("p", {
            staticClass: "xlx-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {mouseover: e.handleTaskNameMouseOver}
        }), e._v(" "), n("div", {staticClass: "xlx-side-operate"}, [e.canPlay ? n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "播放"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePlayTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-play"})]) : e._e(), e._v(" "), e.deleted ? n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "删除任务记录"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-clear"})]) : n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "打开文件夹"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleOpenFile(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-file"})])]), e._v(" "), n("div", {staticClass: "xlx-file-info"}, [n("p", {staticClass: "xlx-file-size"}, [n("span", {staticClass: "xlx-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), n("p", {staticClass: "xlx-file-time"}, [e._v(e._s(e.completeTime))]), e._v(" "), e.bTaskCountShow ? n("a", {
            staticClass: "xlx-file-num",
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, dblclick: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleFileCountClick(t)
                }
            }
        }, [e._v(e._s(e.subTaskCount))]) : e._e()])])], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return e.isShowVipSpeed ? n("span", {
            staticClass: "xlx-file-speed__vip",
            class: {"is-super": e.isShowSuperSpeed}
        }, [e._v(e._s(e.vipSpeed))]) : n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowVipHover,
                expression: "isShowVipHover"
            }],
            staticClass: "xlx-file-speed__vip-link",
            class: {"is-super": e.isShowSuperHover},
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipLink(t)
                }
            }
        }, [e._v(e._s(e.hoverText))])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return e.isTry ? n("ItemTryStatus", {
            attrs: {
                taskId: e.taskId,
                taskUIStatus: e.taskUIStatus,
                isVip: e.isVip,
                taskInfo: e.taskInfo
            }
        }) : n("ItemVipStatus", {
            attrs: {
                taskId: e.taskId,
                taskUIStatus: e.taskUIStatus,
                isVip: e.isVip,
                authority: e.authority,
                taskInfo: e.taskInfo,
                visible: e.visible,
                btErrorType: e.btErrorType
            }
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-plugin-vip",
            class: [e.pluginVipClass, {"is-trying": e.showTrying, "is-normal": e.isNormal}]
        }, [n("div", {
            directives: [{name: "show", rawName: "v-show", value: e.showTrying, expression: "showTrying"}],
            staticClass: "td-progress-bar"
        }, [n("div", {staticClass: "td-progress-bar__outer"}, [n("div", {
            staticClass: "td-progress-bar__inner",
            style: {width: e.progressPercent}
        })])]), e._v(" "), n("div", {staticClass: "xlx-plugin-vip__inner"}, [n("p", {
            staticClass: "xlx-plugin-vip__text",
            class: {"is-error": e.isError}
        }, [e._v(e._s(e.taskStatusText))]), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.isError,
                expression: "!isError"
            }], staticClass: "xlx-plugin-vip__button", attrs: {href: "javascript:;"}, on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipButton(t)
                }
            }
        }, [e.isSuper ? n("i", {staticClass: "vip-icon-svip0"}) : n("span", {staticClass: "xlx-plugin-vip__logo-vip"}, [e._v("VIP")]), e._v(" "), n("span", {staticClass: "xlx-plugin-vip__button-text"}, [e._v(e._s(e.buttonText))])])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-plugin-vip xlx-plugin-vip--ordinary is-normal"}, [n("div", {staticClass: "xlx-plugin-vip__inner"}, [e.isErrorScene ? n("a", {
            staticClass: "xlx-plugin-vip__text is-error",
            attrs: {href: "#"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickErrorScenceText(t)
                }
            }
        }, [e._v(e._s(e.errorSceneText))]) : e.isDefaultScene ? n("p", {staticClass: "xlx-plugin-vip__text is-default"}, [e._v(e._s(e.defaultSceneText))]) : n("a", {
            staticClass: "xlx-plugin-vip__text",
            attrs: {href: " javascript:; "},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickScenceText(t)
                }
            }
        }, [e._v(e._s(e.sceneText))]), e._v(" "), 1 === e.vipBtnType ? n("a", {
            staticClass: "",
        }, [e._v("")]) : 0 === e.vipBtnType ? n("a", {
            staticClass: "xlx-plugin-vip__button",
            attrs: {href: " javascript:; "},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipButton(t)
                }
            }
        }, [n("span", {staticClass: "xlx-plugin-vip__logo-vip"}, [e._v("VIP")]), e._v(" "), n("span", {staticClass: "xlx-plugin-vip__button-text"}, [e._v("会员加速")])]) : n("p", {
            staticClass: "xlx-plugin-vip__status",
            class: {"is-super": e.isSuperStarted, "is-error": e.showFailed}
        }, [e._v(e._s(e.taskStatusText))])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(34), r = i.default.getLogger("DownloadKernel.CategoryView"),
        s = o.DownloadKernelEventManager.getEventManager();
    t.CategoryView = class {
        constructor(e, t) {
            this.categoryId = e, this.categoryViewId = t, this.tasks = new Map
        }

        getCategoryViewId() {
            return this.categoryViewId
        }

        getTasks() {
            return this.tasks
        }

        getTaskCount() {
            return this.tasks.size
        }

        insertTask(e, t = a.DownloadKernel.TaskInsertReason.Unknown) {
            if (null !== e) {
                let n = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    if (!i) continue;
                    i.setCategoryViewId(this.categoryViewId);
                    let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    0 !== o && (this.tasks.set(o, i), n.push(i)), r.information("insertTask categoryId:", this.categoryId, ", catygoryViewId:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.categoryId, this.categoryViewId, n, t)
            }
        }

        removeTask(e) {
            if (null !== e) {
                let t = [];
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n];
                    if (!i) continue;
                    let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    this.tasks.has(o) && (this.tasks.delete(o), t.push(i)), r.information("removeTask catygoryView:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.categoryId, this.categoryViewId, t)
            }
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24);
    !function (e) {
        let t = !1, o = [];
        e.initBtTaskTrackers = function () {
            return i(this, void 0, void 0, function* () {
                if (!t) {
                    t = !0;
                    let e = null;
                    try {
                        a.default.defaults.adapter = n(22), e = yield a.default.get("http://plugin.xl7.xunlei.com/7.9/normal/trackers.json")
                    } catch (e) {
                    }
                    if (null !== e && 200 === e.status && e.data && "" !== e.data && e.data.trackers && e.data.trackers.tracker) for (let t = 0; t < e.data.trackers.tracker.length; ++t) {
                        let n = e.data.trackers.tracker[t];
                        n && "" !== n && o.push(n)
                    }
                }
            })
        }, e.getExtraTracks = function () {
            return o
        }
    }(t.BTExtraTrackNS || (t.BTExtraTrackNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(244), o = n(127), r = n(788), s = n(68), l = n(230), u = n(57), d = n(38),
        c = n(1).default.getLogger("Thunder.VipDownload.vip-task"), h = s.UserHelperNS.getHelper(),
        f = u.PluginHelperNS.getHelper();

    class g extends o.HttpSession {
        constructor() {
            super(...arguments), this.mGcidTaskMap = new Map
        }

        queyToken(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++g.sequence, n = h.userId, i = yield h.getSessionId(), o = f.currentTime,
                    s = a.HttpJsonCryptoNS.getUriParam(t, o, 0);
                return this.host = "speed.auth.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed/speedup?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.mGcidTaskMap.clear(), this.body = yield r.VipTaskHttpPackageNS.createTokenBuffer(e, this.mGcidTaskMap), yield this.postTokenRequest(e)
            })
        }

        queryErrorCode() {
            return i(this, void 0, void 0, function* () {
                let e = f.clientName, t = f.thunderVersionNumber || 0, n = f.currentTime, i = Math.random(),
                    a = "!@#$%^&*()QAZ" + e + t + n + i,
                    o = "client_name=" + e + "&client_version=" + t + "&ts=" + n + "&r=" + i + "&key=" + (a = (a = d.ToolsUtilitiesAWNS.genarateMd5(a)).toUpperCase());
                return c.information("key", a), this.host = "download.code.lixian.vip.xunlei.com", this.retries = 2, this.timeout = 15e3, this.path = "/errcode?" + o, yield this.getErrorCodeRequest()
            })
        }

        postTokenRequest(e) {
            return new Promise(t => {
                this.post(n => {
                    let i = [];
                    if (h.userId === e.userId) {
                        let t = n.headers["random-num"];
                        c.information("random", t);
                        let a = null, o = void 0;
                        do {
                            if (200 !== n.statusCode) {
                                o = l.HttpErrorNS.errorStatusCode;
                                break
                            }
                            if (!n.body || !t) {
                                o = l.HttpErrorNS.errorData;
                                break
                            }
                            {
                                let i = Number(t).valueOf();
                                a = r.VipTaskHttpPackageNS.praseTokenBuffer(e.userId, i, n.body)
                            }
                            if (!a) {
                                o = l.HttpErrorNS.errorPrase;
                                break
                            }
                            o = l.HttpErrorNS.errorOk
                        } while (0);
                        i = this.createTokenResponse(o, e, a)
                    }
                    t(i)
                }, n => {
                    c.information("error", n);
                    let i = [];
                    h.userId === e.userId && (i = this.createTokenResponse(l.HttpErrorNS.errorConnect, e)), t(i)
                })
            })
        }

        getErrorCodeRequest() {
            return new Promise(e => {
                this.get(t => {
                    let n = null;
                    200 === t.statusCode && t.body && (n = r.VipTaskHttpPackageNS.praseErrorCodeBuffer(t.body)), e(n)
                }, t => {
                    c.information("error", t), e(null)
                })
            })
        }

        createTokenResponse(e, t, n) {
            let i = [];
            if (e === l.HttpErrorNS.errorOk) if (0 === n.result && n.task_infos && n.task_infos.length > 0) for (let e of n.task_infos) {
                let t = this.getSubIdByGcid(e.gcid);
                if (void 0 !== t) {
                    let n = {
                        subId: t,
                        result: e.result,
                        message: e.simple_msg,
                        detailMessage: e.message,
                        token: e.token,
                        expire: e.expire
                    };
                    i.push(n)
                }
            } else for (let e of t.files) {
                let t = {subId: e.subId, result: n.result, message: n.message, detailMessage: n.detailMessage};
                i.push(t)
            } else for (let n of t.files) {
                let t = {subId: n.subId, result: e, message: l.HttpErrorNS.getMessage(e)};
                i.push(t)
            }
            return i
        }

        getSubIdByGcid(e) {
            return this.mGcidTaskMap.get(e)
        }
    }

    g.sequence = 0, t.VipTaskHttpSession = g
}, function (e, t) {
    e.exports = require("child_process")
}, function (e, t) {
    (function () {
        e.exports = function () {
            function e(e, t, n) {
                if (this.options = e.options, this.stringify = e.stringify, null == t) throw new Error("Missing attribute name of element " + e.name);
                if (null == n) throw new Error("Missing attribute value for attribute " + t + " of element " + e.name);
                this.name = this.stringify.attName(t), this.value = this.stringify.attValue(n)
            }

            return e.prototype.clone = function () {
                return Object.create(this)
            }, e.prototype.toString = function (e) {
                return this.options.writer.set(e).attribute(this)
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        var t = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, n = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var i, a, o;
                for (i in this.assertLegalChar = t(this.assertLegalChar, this), e || (e = {}), this.noDoubleEncoding = e.noDoubleEncoding, a = e.stringify || {}) n.call(a, i) && (o = a[i], this[i] = o)
            }

            return e.prototype.eleName = function (e) {
                return e = "" + e || "", this.assertLegalChar(e)
            }, e.prototype.eleText = function (e) {
                return e = "" + e || "", this.assertLegalChar(this.elEscape(e))
            }, e.prototype.cdata = function (e) {
                return e = (e = "" + e || "").replace("]]>", "]]]]><![CDATA[>"), this.assertLegalChar(e)
            }, e.prototype.comment = function (e) {
                if ((e = "" + e || "").match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + e);
                return this.assertLegalChar(e)
            }, e.prototype.raw = function (e) {
                return "" + e || ""
            }, e.prototype.attName = function (e) {
                return "" + e || ""
            }, e.prototype.attValue = function (e) {
                return e = "" + e || "", this.attEscape(e)
            }, e.prototype.insTarget = function (e) {
                return "" + e || ""
            }, e.prototype.insValue = function (e) {
                if ((e = "" + e || "").match(/\?>/)) throw new Error("Invalid processing instruction value: " + e);
                return e
            }, e.prototype.xmlVersion = function (e) {
                if (!(e = "" + e || "").match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + e);
                return e
            }, e.prototype.xmlEncoding = function (e) {
                if (!(e = "" + e || "").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) throw new Error("Invalid encoding: " + e);
                return e
            }, e.prototype.xmlStandalone = function (e) {
                return e ? "yes" : "no"
            }, e.prototype.dtdPubID = function (e) {
                return "" + e || ""
            }, e.prototype.dtdSysID = function (e) {
                return "" + e || ""
            }, e.prototype.dtdElementValue = function (e) {
                return "" + e || ""
            }, e.prototype.dtdAttType = function (e) {
                return "" + e || ""
            }, e.prototype.dtdAttDefault = function (e) {
                return null != e ? "" + e || "" : e
            }, e.prototype.dtdEntityValue = function (e) {
                return "" + e || ""
            }, e.prototype.dtdNData = function (e) {
                return "" + e || ""
            }, e.prototype.convertAttKey = "@", e.prototype.convertPIKey = "?", e.prototype.convertTextKey = "#text", e.prototype.convertCDataKey = "#cdata", e.prototype.convertCommentKey = "#comment", e.prototype.convertRawKey = "#raw", e.prototype.assertLegalChar = function (e) {
                var t;
                if (t = e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)) throw new Error("Invalid character in string: " + e + " at index " + t.index);
                return e
            }, e.prototype.elEscape = function (e) {
                var t;
                return t = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, e.replace(t, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;")
            }, e.prototype.attEscape = function (e) {
                var t;
                return t = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, e.replace(t, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;")
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        var t = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var n, i, a, o, r, s, l, u, d;
                for (n in e || (e = {}), this.pretty = e.pretty || !1, this.allowEmpty = null != (i = e.allowEmpty) && i, this.pretty ? (this.indent = null != (a = e.indent) ? a : "  ", this.newline = null != (o = e.newline) ? o : "\n", this.offset = null != (r = e.offset) ? r : 0, this.dontprettytextnodes = null != (s = e.dontprettytextnodes) ? s : 0) : (this.indent = "", this.newline = "", this.offset = 0, this.dontprettytextnodes = 0), this.spacebeforeslash = null != (l = e.spacebeforeslash) ? l : "", !0 === this.spacebeforeslash && (this.spacebeforeslash = " "), this.newlinedefault = this.newline, this.prettydefault = this.pretty, u = e.writer || {}) t.call(u, n) && (d = u[n], this[n] = d)
            }

            return e.prototype.set = function (e) {
                var n, i, a;
                for (n in e || (e = {}), "pretty" in e && (this.pretty = e.pretty), "allowEmpty" in e && (this.allowEmpty = e.allowEmpty), this.pretty ? (this.indent = "indent" in e ? e.indent : "  ", this.newline = "newline" in e ? e.newline : "\n", this.offset = "offset" in e ? e.offset : 0, this.dontprettytextnodes = "dontprettytextnodes" in e ? e.dontprettytextnodes : 0) : (this.indent = "", this.newline = "", this.offset = 0, this.dontprettytextnodes = 0), this.spacebeforeslash = "spacebeforeslash" in e ? e.spacebeforeslash : "", !0 === this.spacebeforeslash && (this.spacebeforeslash = " "), this.newlinedefault = this.newline, this.prettydefault = this.pretty, i = e.writer || {}) t.call(i, n) && (a = i[n], this[n] = a);
                return this
            }, e.prototype.space = function (e) {
                var t;
                return this.pretty && (t = (e || 0) + this.offset + 1) > 0 ? new Array(t).join(this.indent) : ""
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        "use strict";
        var e;
        e = new RegExp(/(?!xmlns)^.*:/), t.normalize = function (e) {
            return e.toLowerCase()
        }, t.firstCharLowerCase = function (e) {
            return e.charAt(0).toLowerCase() + e.slice(1)
        }, t.stripPrefix = function (t) {
            return t.replace(e, "")
        }, t.parseNumbers = function (e) {
            return isNaN(e) || (e = e % 1 == 0 ? parseInt(e, 10) : parseFloat(e)), e
        }, t.parseBooleans = function (e) {
            return /^(?:true|false)$/i.test(e) && (e = "true" === e.toLowerCase()), e
        }
    }).call(this)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(10), s = n(8), l = n(148), u = n(32), d = n(805), c = n(195), h = n(132),
        f = n(144), g = n(6), p = n(38), k = n(82), m = o.default.getLogger("NativeFunction.TaskInfo"),
        T = u.DownloadKernelTaskManager.getTaskManager();

    class v {
        constructor() {
            d.HistoryTaskSpeedInfoNS.init().catch()
        }

        getHistoryTaskInfoString(e) {
            return i(this, void 0, void 0, function* () {
                let t = "", n = yield this.getTaskInfo(e);
                if (n) {
                    let i = T.getTaskFromTaskId(e);
                    if (i) {
                        let a = this.getFileList(i);
                        n.fileList = a;
                        let o = n.progress, r = yield this.getHistorySpeedInfo(e, o);
                        r && (r.maxSpeed && (n.maxSpeed = r.maxSpeed), r.historySpeedMap && (n.historySpeed = r.historySpeedMap), r.historyIncreaseSpeedMap && (n.historyIncreaseSpeed = r.historyIncreaseSpeedMap), t = JSON.stringify(n), m.information("taskInfo: ", t))
                    } else m.warning("task is null")
                } else m.warning("taskInfo is null");
                return t
            })
        }

        getTaskInfoString(e) {
            return i(this, void 0, void 0, function* () {
                let t = "", n = yield this.getTaskInfo(e);
                return n ? (t = JSON.stringify(n), m.information("taskInfo: ", t)) : m.warning("taskInfo is null"), t
            })
        }

        getBtSubFileListString(e, t) {
            let n = [];
            do {
                let i = T.getTaskFromTaskId(e);
                if (!i) break;
                if (i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Bt) break;
                let a = i.getExtraObject();
                if (!a) break;
                for (let e = 0; e < t.length; ++e) {
                    let i = {}, o = t[e], r = a.getBtFileByRealIndex(o.realIndex);
                    i.index = o.realIndex, i.filePath = o.relativePath, i.fileName = "", r ? (i.fileName = r.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), i.isNeedDownload = r.getIsDownload()) : i.isNeedDownload = 1, i.fileSize = o.fileSize, i.cid = o.cid, i.gcid = o.gcid, i.status = o.fileStatus, i.downloadSize = o.downloadSize, i.errCode = o.errorCode, i.status === s.DownloadKernel.BtFileStatus.Forbidden ? i.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(i.errCode) : i.errMessage = "", n.push(i)
                }
            } while (0);
            return JSON.stringify(n)
        }

        getGroupTaskSubFileListString(e) {
            let t = [];
            for (let n = 0; n < e.length; ++n) {
                let i = e[n];
                if (i) {
                    let e = {};
                    e.filePath = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), e.index = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileIndex), e.taskId = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), e.fileName = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), e.url = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), e.isNeedDownload = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), e.cid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), e.gcid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), e.status = i.getTaskStatus(), e.errCode = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), e.status === s.DownloadKernel.TaskStatus.Failed ? e.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                    let n = i.getTaskChannelInfo();
                    e.dcdnStatus = n.dcdnStatus, t.push(e)
                }
            }
            return JSON.stringify(t)
        }

        calcGroupTaskUniqueId(e) {
            let t = "", n = e.getExtraObject(), i = n.getSubTaskCount();
            if (i > 0) {
                let e = [];
                for (let t = 0; t < i; ++t) {
                    let i = n.getSubTaskByIndex(t).getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
                    g.isString(i) && i.length > 0 && e.push(i)
                }
                if (e.length > 0) {
                    e.sort();
                    let n = e.length, i = "#" + n + "#";
                    m.information("CalcGroupTaskUniqueID urlNum: ", n);
                    for (let t = 0; t < n; ++t) i += e[t] + "#";
                    let a = Buffer.alloc(i.length);
                    a.write(i), (t = p.ToolsUtilitiesAWNS.encryptSha1Buffer(a)) && (t = t.toUpperCase())
                }
            }
            return t
        }

        getTaskInfo(e) {
            return i(this, void 0, void 0, function* () {
                let t = {}, n = T.getTaskFromTaskId(e);
                if (n) {
                    let i = n.getTaskStatus(), o = 0;
                    i !== s.DownloadKernel.TaskStatus.Succeeded && i !== s.DownloadKernel.TaskStatus.Seeding || (o = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CompletionTime)), n.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0 && (i = 20);
                    let r = "", u = "", d = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType),
                        c = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                    d !== s.DownloadKernel.TaskType.P2sp && d !== s.DownloadKernel.TaskType.Emule || ((r = a.extname(c)) && (r = r.substring(1)), u = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl));
                    let h = "";
                    if (d === s.DownloadKernel.TaskType.Bt) {
                        h = n.getExtraObject().getInfoId()
                    }
                    let g = "", p = n.getTaskChannelInfo(),
                        k = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                        T = p.offlineSize + p.originSize + p.p2pSize + p.p2sSize;
                    T < k && (p.p2pSize > 0 ? p.p2pSize = p.p2pSize + k - T : p.offlineSize > 0 ? p.offlineSize = p.offlineSize + k - T : p.originSize > 0 ? p.originSize = p.originSize + k - T : p.p2sSize > 0 && (p.p2sSize = p.p2sSize + k - T));
                    let v = "";
                    d === s.DownloadKernel.TaskType.P2sp || d === s.DownloadKernel.TaskType.Emule ? v = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid) : d === s.DownloadKernel.TaskType.Group && (m.information("calcGroupTaskUniqueId before"), v = this.calcGroupTaskUniqueId(n), m.information("calcGroupTaskUniqueId end, taskId: ", n.getId(), ", uniqueId: ", v));
                    let C = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                        S = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal),
                        y = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing),
                        w = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        I = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime),
                        b = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                        A = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Description),
                        N = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode),
                        D = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Moving), _ = yield this.getActions(n),
                        x = this.getProgress(n), E = this.getSpeedInfo(n);
                    if (t.status = i, t.taskID = e, t.type = d, t.name = c, t.gcid = v, t.suffix = r, t.url = u, t.isFromVest = !1, t.isMoving = D, "" !== u || "" !== h) {
                        let e = "" === u ? h : u, n = yield f.isVestUrl(e, "vestURL");
                        t.isFromVest = n
                    }
                    t.size = C, t.downloadSize = k, t.progress = x, t.allResourceCount = S, t.resourceCount = y, t.errCode = N, t.status === s.DownloadKernel.TaskStatus.Failed ? t.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(t.errCode) : t.errMessage = "", n.getStopReason() === s.DownloadKernel.TaskStopReason.SelectDownloadLists ? t.stopReason = "downloadSelected" : t.stopReason = "", t.actions = _, t.averageSpeed = E.averageSpeed, t.speed = E.speed, t.increaseSpeed = E.increaseSpeed, t.channelInfo = p, t.savePath = b, t.infoId = h, t.duration = w, t.createTime = I, t.completeTime = o, t.md5 = g, t.note = A
                }
                return t
            })
        }

        isForbidden(e) {
            let t = !1;
            do {
                if (e.getTaskStatus() === s.DownloadKernel.TaskStatus.Failed) {
                    let n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode);
                    if (7 === n) {
                        t = !0;
                        break
                    }
                    if (n >= 700 && n <= 799) {
                        t = !0;
                        break
                    }
                }
            } while (0);
            return t
        }

        getActions(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = !0;
                0 === k.default.getConfigInfo("shouleiDownload", "enable") && (n = !1);
                do {
                    let n = e.getTaskStatus();
                    if (n !== s.DownloadKernel.TaskStatus.Failed && n !== s.DownloadKernel.TaskStatus.Unkown) {
                        e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Group && t.push("repost")
                    }
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                        t.push("restore"), t.push("delete");
                        break
                    }
                    if (this.isForbidden(e)) {
                        t.push("delete");
                        break
                    }
                    if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                        if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) === s.DownloadKernel.TaskType.Group) {
                            if (!(yield c.TaskCtrlOperatorNS.isExistTaskFile(e.getTaskBaseInfo()))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder")
                        } else {
                            let n = void 0;
                            if (yield h.SingleBtTaskNS.isSingleBtTask(e)) n = h.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                let t = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName),
                                    i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath);
                                n = a.join(i, t)
                            }
                            if (!(yield r.FileSystemAWNS.existsAW(n))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder")
                        }
                        e.isSupportPlay() && (t.push("play"), t.push("subtitleDownload"));
                        break
                    }
                    if (1 === e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Forbidden)) {
                        t.push("delete");
                        break
                    }
                    e.isSupportPlay() && n !== s.DownloadKernel.TaskStatus.Failed && t.push("downAndPlay"), n === s.DownloadKernel.TaskStatus.Stopped || n === s.DownloadKernel.TaskStatus.Failed || n === s.DownloadKernel.TaskStatus.Unkown ? t.push("continue") : t.push("pause"), e.isSupportPlay() && t.push("subtitleDownload")
                } while (0);
                let i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
                return n && i !== s.DownloadKernel.TaskType.Group && (this.removeItem(t, "play"), this.removeItem(t, "downAndPlay"), this.removeItem(t, "continue"), this.removeItem(t, "pause"), t.push("shouleiDownload")), t
            })
        }

        removeItem(e, t) {
            let n = e.indexOf(t);
            n > -1 && e.splice(n, 1)
        }

        getProgress(e) {
            let t = 0, n = e.getTaskStatus(), i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
            return 0 !== i && 0 !== a && (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding || a >= i ? t = 100 : (t = a / i * 100, t = parseInt(t.toString(), 10))), t
        }

        getFileList(e) {
            let t = [], n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
            if (n === s.DownloadKernel.TaskType.Bt) {
                let n = e.getExtraObject().getBtFileList();
                for (let [, e]of n) {
                    let n = {};
                    n.index = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.RealIndex), n.filePath = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath), n.fileName = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), n.isNeedDownload = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download), n.fileSize = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileSize), n.cid = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Cid), n.gcid = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Gcid), n.status = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus), n.downloadSize = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.DownloadSize), n.errCode = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.ErrorCode), n.status === s.DownloadKernel.BtFileStatus.Forbidden ? n.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(n.errCode) : n.errMessage = "", t.push(n)
                }
            } else if (n === s.DownloadKernel.TaskType.Group) {
                let n = e.getExtraObject(), i = n.getSubTaskCount();
                for (let e = 0; e < i; ++e) {
                    let i = n.getSubTaskByIndex(e);
                    if (i) {
                        let n = {};
                        n.index = e, n.filePath = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), n.taskId = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), n.fileName = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), n.url = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), n.isNeedDownload = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), n.fileSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), n.downloadSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), n.cid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), n.gcid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), n.status = i.getTaskStatus(), n.errCode = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), n.status === s.DownloadKernel.TaskStatus.Failed ? n.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(n.errCode) : n.errMessage = "";
                        let a = i.getTaskChannelInfo();
                        n.dcdnStatus = a.dcdnStatus, t.push(n)
                    }
                }
            }
            return t
        }

        getSpeedInfo(e) {
            let t = e.getDownloadSpeed(), n = 0, i = e.getVipSpeed(),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
            o < 1 && (o = 1), n = a / o, n = parseInt(n.toString(), 10);
            let r = {};
            return r.averageSpeed = n, r.speed = t, r.increaseSpeed = i, r
        }

        getHistorySpeedInfo(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = {maxSpeed: 0, historySpeedMap: {}, historyIncreaseSpeedMap: {}},
                    i = yield d.HistoryTaskSpeedInfoNS.getTaskSpeedInfo(e);
                do {
                    if (!i) break;
                    if (!i.maxSpeed || i.maxSpeed < 0) break;
                    n.maxSpeed = i.maxSpeed;
                    let e = i.speedInfoMap;
                    if (!e) break;
                    void 0 === t && (t = 0), (!(t = parseInt(t.toString(), 10)) || t < 0) && (t = 0), t > 100 && (t = 100);
                    let a = {}, o = {};
                    for (let n in e) if (void 0 !== e[n]) {
                        let i = parseInt(n, 10);
                        if (i <= t) {
                            let t = e[n];
                            a[i] = t.downloadSpeed, o[i] = t.addSpeed
                        }
                    }
                    n.historySpeedMap = a, n.historyIncreaseSpeedMap = o
                } while (0);
                return n
            })
        }
    }

    t.TaskInfoManager = v, function (e) {
        const t = new v;
        e.getTaskInfoManager = function () {
            return t
        }
    }(t.TaskInfoManagerNS || (t.TaskInfoManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(231), o = n(6);

    class r {
        constructor() {
            this.privateNativeFunctionMap = []
        }

        createChromiumBrowser(e, t, n, i, r) {
            let s = null;
            do {
                if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) break;
                if (s = a.browserSupport.browserManager.createChromiumBrowser(e, t, n, i), this.browser = s, null !== this.browser && void 0 !== this.browser) {
                    null !== r && void 0 !== r && r.length > 0 && this.attachListeners(r);
                    let e = {
                        eventName: "OnJsCallNativeFunction", listener: (e, t, n, i) => {
                            this.onJsCallNativeFunction(0, e, t, i)
                        }
                    };
                    this.attachListener(e)
                }
            } while (0);
            return s
        }

        showDevTool(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(e)) break;
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        navigate(e) {
            let t = !1;
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.navigate(e, "", "", !1), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(e)) break;
                this.browser.refresh(e)
            } while (0);
            return !1
        }

        stop() {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.stop()
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(a.browserSupport.browserManager)) break;
                if (o.isNullOrUndefined(e)) break;
                a.browserSupport.browserManager.destroyBrowser(this.browser, e)
            } while (0);
            return !1
        }

        attachListener(e) {
            let t = 0;
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(e) || o.isNullOrUndefined(e.eventName) || o.isNullOrUndefined(e.listener)) break;
                t = this.browser.attachEventListener(e.eventName, e.listener)
            } while (0);
            return t
        }

        detachListener(e, t) {
            let n = !1;
            do {
                if (0 === t) break;
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (o.isNullOrUndefined(this.browser)) break;
                n = this.browser.detachEventListener(e, t)
            } while (0);
            return n
        }

        getBrowser() {
            return this.browser
        }

        attachListeners(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                for (let t of e) {
                    if (o.isNullOrUndefined(t) || o.isNullOrUndefined(t.eventName) || o.isNullOrUndefined(t.listener)) continue;
                    this.browser.attachEventListener(t.eventName, t.listener)
                }
            } while (0)
        }

        registerNativeFunction(e, t, n) {
            let i = !1;
            do {
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (o.isNullOrUndefined(t)) break;
                if (!0 === n) {
                    if (o.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    let n = this.privateNativeFunctionMap.filter(t => e === t.functionName);
                    if (o.isNullOrUndefined(n) || n.length <= 0) {
                        let n = {functionName: e, nativeFunc: t};
                        this.privateNativeFunctionMap.push(n), i = !0
                    }
                } else {
                    if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                    let n = r.nativeFunctionMap.filter(t => e === t.functionName);
                    if (o.isNullOrUndefined(n) || n.length <= 0) {
                        let n = {functionName: e, nativeFunc: t};
                        r.nativeFunctionMap.push(n), i = !0
                    }
                }
            } while (0);
            return i
        }

        unRegisterNativeFunction(e, t) {
            let n = !1;
            do {
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (!0 === t) {
                    if (o.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    for (let t in this.privateNativeFunctionMap) if (this.privateNativeFunctionMap[Number(t)].functionName === e) {
                        this.privateNativeFunctionMap.splice(Number(t), 1), n = !0;
                        break
                    }
                } else {
                    if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                    for (let t in r.nativeFunctionMap) if (r.nativeFunctionMap[Number(t)].functionName === e) {
                        r.nativeFunctionMap.splice(Number(t), 1), n = !0;
                        break
                    }
                }
            } while (0);
            return n
        }

        callNativeFunctionCallback(e, t, ...n) {
            let i = !1;
            do {
                if (o.isNullOrUndefined(t)) break;
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.callNativeFunctionCallback(t, n), i = !0
            } while (0);
            return i
        }

        callJSFunction(e, t, ...n) {
            let i = !1;
            do {
                if (o.isNullOrUndefined(t) || "" === t) break;
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.callJSFunction(t, n), i = !0
            } while (0);
            return i
        }

        fireEvent(e, ...t) {
            let n = !1;
            do {
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.fireEvent(e, t), n = !0
            } while (0);
            return n
        }

        onJsCallNativeFunction(e, t, n, a) {
            let s = !1;
            do {
                if (o.isNullOrUndefined(e), o.isNullOrUndefined(t) || "" === t) break;
                if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                let l = r.nativeFunctionMap.filter(e => t === e.functionName);
                (o.isNullOrUndefined(l) || 0 === l.length || o.isNullOrUndefined(l[0].nativeFunc)) && (l = this.privateNativeFunctionMap.filter(e => t === e.functionName));
                let u = void 0, d = i.NativeFunctionErrorCode.Success;
                if (o.isNullOrUndefined(l) || 0 === l.length || o.isNullOrUndefined(l[0].nativeFunc)) {
                    if (d = i.NativeFunctionErrorCode.FunctionUnExist, o.isNullOrUndefined(n)) {
                        s = !0;
                        break
                    }
                    if (o.isNullOrUndefined(this.browser)) break;
                    this.browser.callNativeFunctionCallback(n, [d].concat(u))
                } else l[0].nativeFunc(this, e, n, a)
            } while (0);
            return s
        }

        onJsCheckNativeFunction(e, t, n) {
            do {
                if (o.isNullOrUndefined(e), o.isNullOrUndefined(n)) break;
                if (o.isNullOrUndefined(t) || "" === t) break;
                if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                let a = r.nativeFunctionMap.filter(e => t === e.functionName), s = i.NativeFunctionErrorCode.Success;
                if ((o.isNullOrUndefined(a) || o.isNullOrUndefined(a[0]) || o.isNullOrUndefined(a[0].nativeFunc)) && (s = i.NativeFunctionErrorCode.FunctionUnExist), o.isNullOrUndefined(this.browser)) break;
                this.browser.callNativeFunctionCallback(n, [].concat(s))
            } while (0);
            return !1
        }

        static registerDefaultNativeFunction(e) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t].functionName, i = e[t].nativeFunc;
                    if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                    let a = r.nativeFunctionMap.filter(e => n === e.functionName);
                    if (o.isNullOrUndefined(a) || a.length <= 0) {
                        let e = {functionName: n, nativeFunc: i};
                        r.nativeFunctionMap.push(e)
                    }
                }
            } while (0)
        }
    }

    r.nativeFunctionMap = [], t.BrowserCtrl = r
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(573), r = n(25), s = n(1), l = n(5), u = n(51), d = n(13), c = n(727), h = n(23), f = n(82),
        g = s.default.getLogger("Sign");
    t.signObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "", this.url = "", this.width = 400, this.height = 460, this.curPopupType = "", this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.embeddedBrowserObj = new o.EmbeddedBrowser, this.attachListener()
        }

        createSignDlg(e, t) {
            return i(this, void 0, void 0, function* () {
                do {
                    if ("auto" === e && !1 === this.isPopup()) {
                        g.information("不满足auto弹出条件");
                        break
                    }
                    let n = yield c.CommonSignFunctionNs.isAlreadySign();
                    if ("auto" === e && n) {
                        g.information("用户已经答过");
                        break
                    }
                    if (yield this.isAlreadyShowTips()) {
                        g.information("createSignDlg 正在显示tips");
                        break
                    }
                    if (!1 === (yield c.CommonSignFunctionNs.isHaveSignQuestion())) {
                        g.information("不存在答题");
                        break
                    }
                    this.curPopupType = e;
                    let i = a.remote.getCurrentWindow();
                    if (i.isMinimized() || !1 === i.isVisible()) {
                        g.information("窗口最小化或者不可见");
                        break
                    }
                    this.setDefaultValue();
                    let o = f.default.getConfigInfo("activity", "enable_sign");
                    if (null !== o && void 0 !== o && 1 === o) {
                        let e = f.default.getConfigInfo("activity", "actid");
                        if (null !== e && void 0 !== e && "" !== e) {
                            let t = yield c.CommonSignFunctionNs.actSwitch(e);
                            t.actSwitch && null !== t.width && void 0 !== t.width && null !== t.height && void 0 !== t.height && (this.width = t.width, this.height = t.height, this.url = `${this.url}?actid=${e}`)
                        }
                    }
                    this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "sign", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, this.onWndShowResult.bind(this))
                } while (0)
            })
        }

        onWndShowResult() {
            return i(this, void 0, void 0, function* () {
                let e = !0;
                return (yield this.isAlreadyShowTips()) ? (g.information("onWndShowResult 正在显示tips"), e = !1) : (this.writeConfig(), this.statSign("sign_popup_show").catch()), e
            })
        }

        closeDialog() {
            this.embeddedBrowserObj.closeWnd()
        }

        attachListener() {
            l.NativeCallModule.nativeCall.AttachNativeEvent("showTipsWnd", () => {
                g.information("showTipsWnd:"), this.embeddedBrowserObj.closeWnd()
            }), a.remote.ipcMain.on(h.NodeEventMesssageNS.eventEmbeddedBrowserWndClick, (e, t, n) => {
                if ("sign" === t) {
                    let e = "";
                    "btn_close" === n ? e = "sign_close" : "sign_nopop" === n && (e = "sign_nopop"), this.statSign("sign_detail_click", e).catch()
                }
            })
        }

        isAlreadyShowTips() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.NativeCallModule.nativeCall.CallNativeFunction("IsTipsWndShow", t => {
                        g.information("isAlreadyShowTips:", t), e(t)
                    })
                })
            })
        }

        writeConfig() {
            if ("auto" === this.curPopupType) {
                let e = this.getCurDate();
                r.ConfigNS.setValue("ConfigPopUpPanel", "ShowDate", e)
            }
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        isPopup() {
            let e = !1;
            return e
        }

        statSign(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = "";
                if (yield u.LoginHelperNS.loginHelper.isLoginedAw()) {
                    n = "is_login=1";
                    let e = 0;
                    "0" !== (yield u.LoginHelperNS.loginHelper.getUserInfoByKeyAw("isVip", "vip_xl")) && (e = 1), n = `${n},is_vip=${e}`
                } else n = "is_login=0";
                "sign_detail_click" === e && (n = `${n},button=${t}`), g.information("statSign:", e, n), d.XLStatNS.trackEvent("business", e, "", 0, 0, 0, 0, n)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(92), o = n(25), r = n(51);
    let s = void 0;
    !function (e) {
        function t() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        e.isAlreadySign = function () {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                if (yield r.LoginHelperNS.loginHelper.isLoginedAw()) {
                    let t = yield r.LoginHelperNS.loginHelper.getUserInfoByKeyAw("userID");
                    try {
                        let n = yield a.fetchSlRes({url: "/sign/pc/query_piece", data: {uid: t}, method: "post"});
                        if (null !== n && void 0 !== n && 200 === n.status && null !== n.data && void 0 !== n.data) {
                            let t = n.data;
                            0 === t.err_code && "" !== t.status && (e = !0)
                        }
                    } catch (e) {
                    }
                }
                return e
            })
        }, e.isHaveSignQuestion = function () {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (void 0 !== s && o.ConfigNS.getValue("sign", "getQuestionTime", "") === t()) {
                        e = !!s;
                        break
                    }
                    try {
                        let t = yield a.fetchSlRes({url: "/sign/pc/get_question", data: {}});
                        null !== t && void 0 !== t && 200 === t.status && null !== t.data && void 0 !== t.data && (0 === t.data.err_code ? (e = !0, s = !0) : (e = !1, s = !1))
                    } catch (e) {
                    }
                    o.ConfigNS.setValue("sign", "getQuestionTime", t())
                } while (0);
                return e
            })
        }, e.actSwitch = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = {actSwitch: !1};
                try {
                    let n = yield a.fetchRequest({
                        method: "get",
                        url: "https://msg-vip-ssl.xunlei.com/xlact/conf",
                        data: {actid: e, source: 3e3}
                    });
                    if (null !== n && void 0 !== n && 200 === n.status && null !== n.data && void 0 !== n.data) {
                        let e = n.data;
                        if (0 === e.result && e.data) {
                            let n = e.data;
                            "on" === n.switch && (t = {actSwitch: !0, width: n.width, height: n.height})
                        }
                    }
                } catch (e) {
                }
                return t
            })
        }, e.getCurDate = t
    }(t.CommonSignFunctionNs || (t.CommonSignFunctionNs = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(576);
    !function (e) {
        const t = new i.SqliteTable;
        t.name = "offline", t.encrypt = !0, t.jsonify = !0, e.getTable = function () {
            return t
        }
    }(t.OfflineTaskDataBaseNS || (t.OfflineTaskDataBaseNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(129), a = n(230), o = n(8);
    t.VipTaskBase = class {
        constructor(e) {
            this.mTaskId = e.getTaskId(), this.mTask = e
        }

        get taskId() {
            return this.mTaskId
        }

        get task() {
            return this.mTask
        }

        get vipTaskStatus() {
            return this.mVipTaskStatus
        }

        set vipTaskStatus(e) {
            if (this.mVipTaskStatus !== e) {
                let t = !1;
                if (e === i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped) {
                    if (this.mVipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.CommitFailed || this.mVipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed) return;
                    t = !0
                } else e === i.VipDownloadDefineNS.VipTaskStatus.Init || e === i.VipDownloadDefineNS.VipTaskStatus.Unkown || this.mVipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped ? t = !0 : e > this.mVipTaskStatus && (t = !0);
                t && (this.mVipTaskStatus = e, this.task.getTaskExtra().setVipTaskStatus(this.vipTaskType, e))
            }
        }

        batchSetVipSubTaskStatus(e, t, n) {
            this.task.getTaskExtra().batchSetVipSubTaskStatus(e, this.vipTaskType, t, n)
        }

        createDcdnError(e) {
            let t = void 0;
            switch (e) {
                case o.DownloadKernel.DcdnStatusCode.ResourceNotFound:
                    t = "正在查找资源";
                    break;
                case o.DownloadKernel.DcdnStatusCode.AuthorizingFailed:
                    t = "加速状态异常";
                    break;
                case o.DownloadKernel.DcdnStatusCode.ForbidByCopyright:
                case o.DownloadKernel.DcdnStatusCode.ForbidByPorNoGraphy:
                case o.DownloadKernel.DcdnStatusCode.ForbidByReactionary:
                case o.DownloadKernel.DcdnStatusCode.ForbidByOtherFilter:
                    t = "资源被屏蔽"
            }
            return {errorStep: a.HttpDefineNS.ErrorStep.Acclerate, result: e, message: t}
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(576);
    !function (e) {
        const t = new i.SqliteTable;
        t.name = "superspeed", t.encrypt = !0, t.jsonify = !0, e.getTable = function () {
            return t
        }
    }(t.VipTaskDataBaseNS || (t.VipTaskDataBaseNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(143).DkHelperNS.getHelper();
    !function (e) {
        let t = new Map;
        e.enableTaskCert = function (e, n) {
            t.get(e) ? i.updateDcdnWithVipCert(e, n) : (i.enableDcdnWithVipCert(e, n), t.set(e, !0))
        }, e.disableTaskCert = function (e) {
            t.get(e) && (i.disableDcdnWithVipCert(e), t.delete(e))
        }
    }(t.TaskCertHelperNS || (t.TaskCertHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(244), o = n(127), r = n(825), s = n(68), l = n(230), u = n(57),
        d = n(1).default.getLogger("Thunder.VipDownload.try-task"), c = s.UserHelperNS.getHelper();

    class h extends o.HttpSession {
        query(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++h.sequence, n = c.userId, i = yield c.getSessionId(),
                    o = u.PluginHelperNS.getHelper().currentTime, s = a.HttpJsonCryptoNS.getUriParam(t, o);
                return this.host = "try.speed.cdn.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed_trial/query?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.body = yield r.TryTaskHttpPackageNS.createQueryBuffer(e), new Promise(t => {
                    this.post(i => {
                        let a = null;
                        if (c.userId === e.userId) {
                            let e = i.headers["random-num"];
                            if (d.information("random", e), 200 === i.statusCode && i.body && e) {
                                let t = Number(e).valueOf();
                                a = r.TryTaskHttpPackageNS.praseQueryBuffer(n, t, i.body)
                            }
                        }
                        t(a)
                    }, e => {
                        d.information("error", e), t(null)
                    })
                })
            })
        }

        commit(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++h.sequence, n = c.userId, i = yield c.getSessionId(),
                    o = u.PluginHelperNS.getHelper().currentTime, s = a.HttpJsonCryptoNS.getUriParam(t, o);
                return this.host = "try.speed.cdn.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed_trial/commit?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.body = yield r.TryTaskHttpPackageNS.createCommitBuffer(e), new Promise(t => {
                    this.post(i => {
                        let a = null;
                        if (c.userId === e.userId) {
                            let e = i.headers["random-num"];
                            if (d.information("random", e), 200 === i.statusCode) if (i.body && e) {
                                let t = Number(e).valueOf();
                                (a = r.TryTaskHttpPackageNS.praseCommitBuffer(n, t, i.body)) || (a = this.createCommitResponse(l.HttpErrorNS.errorPrase))
                            } else a = this.createCommitResponse(l.HttpErrorNS.errorData); else a = this.createCommitResponse(l.HttpErrorNS.errorStatusCode);
                            t(a)
                        }
                    }, e => {
                        d.information("error", e);
                        let n = this.createCommitResponse(l.HttpErrorNS.errorConnect);
                        t(n)
                    })
                })
            })
        }

        queyToken(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++h.sequence, n = c.userId, i = e.verify, o = u.PluginHelperNS.getHelper().currentTime,
                    s = a.HttpJsonCryptoNS.getUriParam(t, o, 1);
                return this.host = "speed.auth.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed/speedup?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.body = yield r.TryTaskHttpPackageNS.createTokenBuffer(e), new Promise(t => {
                    this.post(i => {
                        let a = null;
                        if (c.userId === e.userId) {
                            let e = i.headers["random-num"];
                            if (d.information("random", e), 200 === i.statusCode) if (i.body && e) {
                                let t = Number(e).valueOf();
                                (a = r.TryTaskHttpPackageNS.praseTokenBuffer(n, t, i.body)) || (a = this.createTokenResponse(l.HttpErrorNS.errorPrase))
                            } else a = this.createTokenResponse(l.HttpErrorNS.errorData); else a = this.createTokenResponse(l.HttpErrorNS.errorStatusCode);
                            t(a)
                        }
                    }, e => {
                        d.information("error", e);
                        let n = this.createTokenResponse(l.HttpErrorNS.errorConnect);
                        t(n)
                    })
                })
            })
        }

        createCommitResponse(e) {
            return {result: e, message: l.HttpErrorNS.getMessage(e)}
        }

        createTokenResponse(e) {
            return {result: e, message: l.HttpErrorNS.getMessage(e)}
        }
    }

    h.sequence = 0, t.TryTaskHttpSession = h
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(579), a = n(57), o = n(1).default.getLogger("Thunder.VipDownload.task-scene"),
        r = a.PluginHelperNS.getHelper(), s = n(3);
    !function (e) {
        let t = new Map, n = new Map;
        e.scenceShow = function (e, n) {
            let a = `${e},${n.id}`;
            if (t.get(a)) return;
            t.set(a, !0);
            let l = s.remote.getCurrentWindow();
            if (!l.isVisible() || l.isMinimized()) return;
            o.information("scenceShow");
            let u = new Map;
            u.set("groupid", e), u.set("type", "Normal"), u.set("id", n.id), u.set("version", r.pluginVersion);
            let d = {attribute1: "sceneshow", extData: u};
            i.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }, e.scenceClick = function (e, t) {
            let a = `${e},${t.id}`;
            if (n.get(a)) return;
            n.set(a, !0), o.information("scenceClick");
            let s = new Map;
            s.set("groupid", e), s.set("type", "Normal"), s.set("id", t.id), s.set("version", r.pluginVersion);
            let l = {attribute1: "sceneclick", extData: s};
            i.StatUtilitiesNS.trackEvent("xlx_vip_event", l)
        }
    }(t.SceneStatNS || (t.SceneStatNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(2), r = n(7).default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        s = a.default.getLogger("BaiduDWZ"), l = "9c91afc9e35ea5752a68590088c7259a";
    s.information("Enter");
    let u = {};

    function d(e) {
        return i(this, void 0, void 0, function* () {
            try {
                const t = yield n(24);
                return t.defaults.adapter = n(22), t.defaults.headers["Content-Type"] = "application/json", t.defaults.headers.Token = l, t.request({
                    method: "post",
                    url: "https://dwz.cn/admin/v2/create",
                    params: {},
                    data: {url: e}
                }).then(e => (s.information("getBaiduDWZ success", e), e))
            } catch (e) {
                return s.information("getBaiduDWZ error"), {error: e}
            }
        })
    }

    t.getBaiduDWZ = function (e) {
        return i(this, void 0, void 0, function* () {
            let t = "";
            s.information("getBaiduDWZ enter cacheDWZs = ", u);
            do {
                if (null === e || "" === e) break;
                if (-1 !== e.indexOf("&taskDownload=")) {
                    let t = e.match(/.*&taskDownload=(.*)&scheme=xunleiapp:.?/);
                    if (t && t.length > 0) {
                        let n = t[1];
                        r.isThunderPrivateUrl(n) || (n = r.makeThunderPrivateUrl(n), e = e.replace(t[1], n))
                    }
                }
                s.information("getBaiduDWZ url = ", e);
                let n = e;
                if (null !== u[n] && void 0 !== u[n]) {
                    t = u[n];
                    break
                }
                let i = "";
                try {
                    let t = yield d(e);
                    s.information("getBaiduDWZ res = ", t), 200 === t.status && t.data && 0 === t.data.Code && (i = t.data.ShortUrl)
                } catch (e) {
                    i = ""
                }
                "" !== i && (u[n] = i), t = i
            } while (0);
            return s.information("getBaiduDWZ leave ret = ", t), t
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(25), r = n(23), s = n(82), l = n(51), u = n(1).default.getLogger("CommonLoginHelper");
    a.default.defaults.adapter = n(22);
    t.commonLoginHelper = new class {
        sendSmsAw(e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                do {
                    let n = yield this.getCommonParmAw();
                    if (null === n || void 0 === n) break;
                    null !== e && void 0 !== e && "" !== e && (n = `${n}&creditkey=${e}`);
                    let i = null, o = "https://xluser-ssl.xunlei.com/msg/v1.1/SendSms?";
                    o = `${o}${n}`;
                    try {
                        null !== (i = yield a.default.get(o)) && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data && "" !== i.data && (t = JSON.stringify(i.data))
                    } catch (e) {
                        u.information("sendSmsAw:error=", e);
                        break
                    }
                } while (0);
                return t
            })
        }

        checkSmsAw(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                do {
                    if (null === e || void 0 === e) {
                        u.information("checkSmsAw token有问题 token：", e);
                        break
                    }
                    if (null === t || void 0 === t) {
                        u.information("checkSmsAw code有问题 code：", t);
                        break
                    }
                    let i = yield this.getCommonParmAw();
                    if (null === i || void 0 === i) break;
                    let o = null, r = "https://xluser-ssl.xunlei.com/msg/v1.1/CheckSms?";
                    r = `${r}${i = `${i}&token=${e}&code=${t}`}`;
                    try {
                        null !== (o = yield a.default.get(r)) && void 0 !== o.status && 200 === o.status && void 0 !== o.data && null !== o.data && "" !== o.data && (n = JSON.stringify(o.data))
                    } catch (e) {
                        u.information("sendSmsAw:error=", e);
                        break
                    }
                } while (0);
                return n
            })
        }

        isAutoPopupLogin() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                {
                    yield s.default.isInitedAw();
                    let t = s.default.getConfigInfo("login", "loginWndAutoPopup");
                    if (void 0 === t || null === t || -1 === t) e = !1; else if (0 === t) {
                        let t = yield this.getLoginWndShowConfigAw();
                        e = this.getCurDate() !== t
                    } else 1 === t && (e = !0)
                }
                return e
            })
        }

        setLoginWndShowConfig() {
            let e = this.getCurDate();
            o.ConfigNS.setValue("LoginWndAutoShow", "Date", e)
        }

        getCommonParmAw() {
            return i(this, void 0, void 0, function* () {
                let e = null;
                do {
                    let t = yield l.LoginHelperNS.loginHelper.isLoginedAw();
                    if (!0 !== t) {
                        u.information("getCommonParmAw 没有登陆 isLogin：", t);
                        break
                    }
                    let n = yield l.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === n || void 0 === n) {
                        u.information("getCommonParmAw userInfo有问题 userInfo:", n);
                        break
                    }
                    let i = n.sessionid;
                    if (null === i || void 0 === i || "" === i) {
                        u.information("getCommonParmAw sessionid有问题 sessionid:", i);
                        break
                    }
                    let a = n.deviceid, o = n.userid, r = l.LoginHelperNS.loginSDKHelper.getInitData(),
                        s = JSON.parse(r), d = s.appid, c = "PC-" + s.package;
                    e = `deviceid=${a}&sessionid=${i}&userid=${o}&platformVersion=${s.platform}&appid=${d}&appName=${c}&scene=040`
                } while (0);
                return e
            })
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        getLoginWndShowConfigAw() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    o.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = o.ConfigNS.getValue("LoginWndAutoShow", "Date", "");
                        e(t)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(25), a = n(250), o = n(2), r = n(17), s = o.join(__rootDir, "../../download-complete.wav");
    !function (e) {
        e.conf = {
            sechema: [{
                name: "基本设置",
                children: [{
                    name: "启动",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigNormalSession-ConfigNormal_AutoRun",
                        type: "confCheckbox",
                        label: "开机启动迅雷",
                        classes: ""
                    }, {
                        name: "Others-AntiDisturb",
                        type: "confCheckbox",
                        label: "开启免打扰模式",
                        classes: "",
                        extEles: [{
                            type: "confTip",
                            classes: "td-icon-info",
                            text: "免打扰模式下，当您运行全屏程序时，迅雷将\n自动帮您取消提示消息弹出，避免打扰您的其\n它体验。",
                            value: ""
                        }]
                    }, {
                        name: "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask",
                        type: "confCheckbox",
                        label: "启动迅雷后自动开始未完成任务"
                    }]
                }, {
                    name: "下载目录",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "TaskDefaultSettings-DefaultPath",
                        type: "confSelect",
                        label: "",
                        classes: "",
                        optionByName: "PathAndCategory-historyDownloadPaths",
                        selectType: "file",
                        slotOption: "openDirectory",
                        editable: !0,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史下载目录",
                        maxOptionLen: 5,
                        rules: [function (e, t, n) {
                            let i = [], a = t.match(/(^[a-zA-Z]):[\\\/].*?/);
                            !/^[a-zA-Z]:[\\\/].*?/.test(t) || /[\*\"<>《》\?:：、？“”\|]/i.test(t.slice(3)) ? i.push(new Error("下载目录名称不能包含下列任何字符：:|* ?“<>")) : null !== a && null !== a && r.existsSync(`${a[0]}`) ? t.length > 256 && i.push(new Error("您输入的下载目录路径长度超过系统限制，请控制在256个字符以内")) : i.push(new Error("该磁盘分区不存在, 请重新选择")), n(i)
                        }]
                    }, {
                        name: "TaskDefaultSettings-UseLastCatalog",
                        type: "confCheckbox",
                        label: "自动修改为上次使用的目录",
                        linkItem: {
                            section: "PathAndCategory",
                            key: "LastUsedPath",
                            name: "TaskDefaultSettings-DefaultPath"
                        }
                    }]
                }]
            }, {
                name: "下载接管设置", children: [{
                    name: "接管设置",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "",
                        type: "confText",
                        text: "接管对象",
                        value: "xlx-setting-content__text"
                    }, {
                        name: "Monitor-MonitorClipBoard",
                        type: "confCheckbox",
                        label: "接管剪切板"
                    }, {name: "Motitor-MotitorAll", type: "confCheckbox", label: "接管所有浏览器"}, {
                        name: "",
                        type: "confText",
                        text: "接管下载类型",
                        value: "xlx-setting-content__text"
                    }, {
                        name: "Monitor-WatchTraditionLink",
                        type: "confCheckbox",
                        label: "传统下载",
                        liClasses: "inline",
                        option: []
                    }, {
                        name: "Monitor-ConfigWatch_Bt",
                        type: "confCheckbox",
                        label: "BT下载",
                        liClasses: "inline"
                    }, {
                        name: "EMuleGenericSettings-EMuleWatchLink",
                        type: "confCheckbox",
                        label: "eMule下载",
                        liClasses: "inline",
                        option: []
                    }, {
                        name: "MagnetGenericSettings-MagnetWatchLink",
                        type: "confCheckbox",
                        label: "磁力链接下载",
                        liClasses: "inline"
                    }, {
                        type: "confBtn",
                        text: "编辑下载文件扩展名",
                        bindName: "Monitor-WatchTraditionLink",
                        classes: "td-button td-button--small",
                        boxType: "pop",
                        pop: {
                            title: "编辑下载文件扩展名",
                            size: "large",
                            maximizable: !1,
                            schema: [{
                                type: "confText",
                                classes: "xlx-dialog-setting__tips",
                                text: " 您可以编辑传统下载中的下载文件扩展名："
                            }, {type: "confTextarea", name: "Monitor-ExtendNames"}],
                            formData: {
                                "Monitor-ExtendNames": {
                                    section: "Monitor",
                                    key: "ExtendNames",
                                    value: a.BHOConfigNS.getDefaultExtendNames()
                                }
                            }
                        }
                    }]
                }, {
                    name: "BT关联",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "BtGenericSettings-AutoBTNewTask",
                        type: "confCheckbox",
                        label: "下载种子文件后自动打开新建面板"
                    }, {name: "BtGenericSettings-AssocTorrent", type: "confCheckbox", label: "启动时关联BT种子文件(.torrent文件)"}]
                }]
            }, {
                name: "下载设置", children: [{
                    name: "下载管理",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "TaskDefaultSettings-OpenSilenceDownload",
                        type: "confCheckbox",
                        label: "一键下载",
                        extEles: [{
                            type: "confTip",
                            text: '"一键下载" 生效时,点击下载链接将直接建立下载任务,不会弹出新建任务面板',
                            classes: "td-icon-info"
                        }]
                    }, {
                        name: "TaskDefaultSettings-NewTaskStartMode",
                        type: "confSelect",
                        label: "默认下载方式",
                        classes: "xlx-select-size-4",
                        option: ["立即下载", "手动下载"]
                    }, {
                        name: "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount",
                        type: "confSelect",
                        label: "同时下载的最大任务数",
                        classes: "xlx-select-size-1",
                        option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50"]
                    }, {
                        name: "ConfigNoLimitDownload-TaskCountAutoAdd",
                        type: "confCheckboxInput",
                        label: "全局下载速度低于",
                        extEles: [{
                            type: "confInput",
                            name: "ConfigNoLimitDownload-TaskCountAutoAddRate",
                            label: " ",
                            toolTipsContent: "输入速度值必须大于0",
                            rules: [["rule, value, callback", "let errors = [];\n                        let speed = 100;\n                        if (value.trim() !== '') {\n                          speed = Number(value);\n                          if (isNaN(speed) || speed <= 0) {\n                            errors.push(new Error('输入速度值必须大于0'));\n                          }\n                          callback(errors);\n                        }"]],
                            outClasses: "xlx-select-size-1"
                        }, {
                            type: "confText",
                            classes: "xlx-select-size-2",
                            text: " KB/s自动增加同时下载任务数",
                            style: "padding-right: 3px"
                        }, {
                            type: "confTip",
                            text: "当您使用迅雷进行排队下载时，开启本选项能够尽量\n充分利用您的网络带宽进行下载。本选项合理的设定\n值应为您的网络带宽最大下载速度的80%。假设您最\n大下载速度曾达到1000KB/s，则此项合理的设定值\n应为800KB/s。",
                            classes: "td-icon-info"
                        }]
                    }, {
                        name: "ConfigNoLimitDownload-OpenNoLimitDownload",
                        type: "confCheckboxSelect",
                        label: "优先下载小于",
                        extEles: [{
                            type: "confSelect",
                            classes: "xlx-select-size-1",
                            name: "ConfigNoLimitDownload-NoLimitDownloadFileSize",
                            option: ["5", "10", "20", "30", "50", "100"],
                            style: "padding-left: 3px"
                        }, {
                            type: "confText",
                            classes: "textCenter flexLay",
                            text: "MB的任务",
                            style: "padding-left: 5px"
                        }],
                        classes: "flexLay"
                    }, {
                        name: "TaskDefaultSettings-OrignHostThreads",
                        type: "confSelect",
                        label: "原始地址线程数",
                        classes: "xlx-select-size-1",
                        option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
                    }, {
                        name: "TaskDefaultSettings-OpenFile",
                        type: "confCheckbox",
                        label: "下载完成后自动打开"
                    }, {
                        name: "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile",
                        type: "confCheckbox",
                        label: "自动删除“文件不存在”的任务"
                    }]
                }, {
                    name: "下载模式",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigNet-ConfigNet_Type",
                        type: "confRadio",
                        label: "全速下载",
                        extEles: [{
                            type: "confTip",
                            text: "p2sp下载完的文件会通过p2p的方式上传分享，\n帮助其它网友加速下载，绝不会涉及任何用户隐\n私。下载和分享是通过智能带宽控制的技术，不\n会影响您的上网体验，请放心使用。",
                            classes: "td-icon-info"
                        }, {
                            type: "confBtn",
                            text: "修改配置",
                            classes: "td-button--small",
                            outerClass: "inline",
                            boxType: "speedConfBox"
                        }],
                        extActiveValue: "0",
                        labels: ["全速下载", "限速下载"],
                        option: ["1", "0"]
                    }, {type: "confSpeedText", classes: "xlx-setting-content__config"}]
                }]
            }, {
                name: "消息及提醒",
                children: [{
                    name: "提醒",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigMsg-ConfigMsg_Finish",
                        type: "confCheckbox",
                        label: "下载完成后右下角弹窗提示"
                    }, {
                        name: "ConfigMsg-ConfigMsg_PlayWaveWhileFinish",
                        type: "confCheckbox",
                        label: "下载完成后播放提示音"
                    }, {
                        type: "confSelect",
                        name: "ConfigMsg-ConfigMsg_WavePath",
                        classes: "noPullDown",
                        selectType: "file",
                        slotOption: "openFile",
                        outerClass: "td-checkbox",
                        editable: !0
                    }, {
                        name: "ConfigMsg-ConfigMsg_FailSuggest",
                        type: "confCheckbox",
                        label: "下载失败时右下角弹窗提示"
                    }, {
                        name: "",
                        type: "confText",
                        text: "消息通知设置",
                        isReleventUser: !0,
                        value: "xlx-setting-content__text"
                    }, {
                        name: "UserCommunitySet-radio_id_",
                        isReleventUser: !0,
                        type: "confRadio",
                        label: "接收所有人的消息通知",
                        option: ["1", "3"],
                        labels: ["接收所有人的消息通知", "不接收消息通知"],
                        ulClasses: "xlx-setting-content__horizontal"
                    }]
                }]
            }, {
                name: "高级设置",
                children: [{
                    name: "快捷设置",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "TaskDefaultSettings-AwayModeEnabled",
                        type: "confCheckbox",
                        label: '启用"离开模式"',
                        extEles: [{
                            type: "confTip",
                            text: "启用“离开模式”后，在电脑处于“睡眠”状态时，\n迅雷仍然能帮您继续下载资源",
                            classes: "td-icon-info"
                        }]
                    }, {
                        name: "BossKey-BossKeySwitch",
                        type: "confCheckboxInput",
                        label: "启用老板键",
                        extEles: [{
                            type: "confInput",
                            name: "BossKey-BossKeyName",
                            label: " ",
                            toolTipsContent: "注册老板键失败,请选择功能键 + 字母键/数字键",
                            rules: [["rule, value, callback", "let errors = [];\n                        value = String(value);\n                        if (value.indexOf('+') === -1 ) {\n                          errors.push(new Error('注册老板键失败,请选择功能键 + 字母键/数字键'));\n                        }\n                        callback(errors);"]],
                            outClasses: "xlx-select-size-4",
                            ShortcutKey: !0,
                            style: "padding-right: 3px"
                        }, {type: "confTip", text: "如果老板来了，按老板键，迅雷将自动隐身", classes: "td-icon-info"}]
                    }, {
                        name: "TaskDefaultSettings-NewTaskDlgWithoutMainWnd",
                        type: "confCheckbox",
                        label: "新建任务时显示主界面"
                    }]
                }, {
                    name: "悬浮窗",
                    classes: "xlx-setting-content__horizontal",
                    children: [{
                        name: "ConfigFloatPanel-FloatPanelValue",
                        type: "confRadio",
                        label: "显示悬浮窗",
                        option: ["0", "1", "2"],
                        labels: ["显示悬浮窗", "下载时显示悬浮窗", "隐藏悬浮窗"],
                        ulClasses: "xlx-setting-content__horizontal"
                    }]
                }, {
                    name: "动画效果",
                    children: [{
                        name: "GenericSettings-AnimationLevel",
                        type: "confRadio",
                        label: "开启全部动效",
                        ulClasses: "xlx-setting-content__vertical",
                        tip: "适用于CPU性能较低的电脑",
                        tipClass: "xlx-setting-content__tips tip-text",
                        option: ["1", "0"],
                        labels: ["开启全部动效", "关闭部分动效"]
                    }]
                }, {
                    name: "下载磁盘缓存",
                    children: [{
                        name: "DiskCache-DiskCacheSelect",
                        type: "confRadio",
                        label: "256",
                        ulClasses: "xlx-setting-content__horizontal",
                        tip: "磁盘缓存越大，下载速度越快，占用资源越多",
                        tipClass: "xlx-setting-content__tips tip-text",
                        option: ["128", "256", "512"],
                        labels: ["128M", "256M", "512M"]
                    }]
                }, {
                    name: "下载加速",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启镜像服务器加速",
                        tip: "全网数据挖掘，自动匹配与原始资源相同的镜像供用户下载",
                        tipClass: "xlx-setting-content__tips tip-text"
                    }, {
                        name: "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启迅雷P2P加速",
                        tip: "利用P2P技术进行用户间加速，该通道产生的上传流量会慢慢提升通道的健康度，从而提升通道加速效果",
                        tipClass: "xlx-setting-content__tips tip-text"
                    }]
                }, {
                    name: "播放组件",
                    children: [{
                        name: "DownloadAndPlay-LanuchMediaPlayer",
                        type: "confRadio",
                        label: "使用迅雷播放组件播放",
                        option: ["0", "1"],
                        labels: ["使用迅雷播放组件播放", "使用迅雷影音播放"],
                        ulClasses: "xlx-setting-content__vertical"
                    }]
                }]
            }], formData: {
                "ConfigNormalSession-ConfigNormal_AutoRun": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoRun",
                    value: !0
                },
                "Others-AntiDisturb": {section: "Others", key: "AntiDisturb", value: !0},
                "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoStartUnFinishedTask",
                    value: !1
                },
                "TaskDefaultSettings-DefaultPath": {section: "TaskDefaultSettings", key: "DefaultPath", value: ""},
                "TaskDefaultSettings-UseLastCatalog": {
                    section: "TaskDefaultSettings",
                    key: "UseLastCatalog",
                    value: !0
                },
                "DiskCache-DiskCacheSelect": {section: "DiskCache", key: "DiskCacheSelect", value: "256"},
                "TaskDefaultSettings-NewTaskStartMode": {
                    section: "TaskDefaultSettings",
                    key: "NewTaskStartMode",
                    value: "立即下载",
                    optionToValue: {"立即下载": 1, "手动下载": 0}
                },
                "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_MaxRunningTaskCount",
                    value: "5"
                },
                "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoDeleteNotExistFile",
                    value: !1
                },
                "TaskDefaultSettings-OpenFile": {section: "TaskDefaultSettings", key: "OpenFile", value: !1},
                "ConfigNet-ConfigNet_Type": {section: "ConfigNet", key: "ConfigNet_Type", value: "1"},
                "ConfigMsg-ConfigMsg_Finish": {section: "ConfigMsg", key: "ConfigMsg_Finish", value: !0},
                "ConfigMsg-ConfigMsg_PlayWaveWhileFinish": {
                    section: "ConfigMsg",
                    key: "ConfigMsg_PlayWaveWhileFinish",
                    value: !0
                },
                "ConfigMsg-ConfigMsg_WavePath": {section: "ConfigMsg", key: "ConfigMsg_WavePath", value: s},
                "ConfigMsg-ConfigMsg_FailSuggest": {section: "ConfigMsg", key: "ConfigMsg_FailSuggest", value: !0},
                "Monitor-MonitorClipBoard": {section: "Monitor", key: "MonitorClipBoard", value: !0},
                "Monitor-ShortcutMonitor": {section: "Monitor", key: "ShortcutMonitor", value: !0},
                "Monitor-WatchTraditionLink": {section: "Monitor", key: "WatchTraditionLink", value: !0},
                "Monitor-ConfigWatch_Bt": {section: "Monitor", key: "ConfigWatch_Bt", value: !0},
                "EMuleGenericSettings-EMuleWatchLink": {
                    section: "EMuleGenericSettings",
                    key: "EMuleWatchLink",
                    value: !0
                },
                "MagnetGenericSettings-MagnetWatchLink": {
                    section: "MagnetGenericSettings",
                    key: "MagnetWatchLink",
                    value: !0
                },
                "BtGenericSettings-AutoBTNewTask": {section: "BtGenericSettings", key: "AutoBTNewTask", value: !0},
                "BtGenericSettings-AssocTorrent": {section: "BtGenericSettings", key: "AssocTorrent", value: !0},
                "TaskDefaultSettings-OpenSilenceDownload": {
                    section: "TaskDefaultSettings",
                    key: "OpenSilenceDownload",
                    type: "number",
                    value: 0
                },
                "TaskDefaultSettings-AwayModeEnabled": {
                    section: "TaskDefaultSettings",
                    key: "AwayModeEnabled",
                    value: !1
                },
                "BossKey-BossKeySwitch": {section: "BossKey", key: "BossKeySwitch", value: !1},
                "BossKey-BossKeyName": {section: "BossKey", key: "BossKeyName", value: "Alt+D"},
                "TaskDefaultSettings-NewTaskDlgWithoutMainWnd": {
                    section: "TaskDefaultSettings",
                    key: "NewTaskDlgWithoutMainWnd",
                    value: !0
                },
                "ConfigFloatPanel-FloatPanelValue": {
                    section: "ConfigFloatPanel",
                    key: "FloatPanelValue",
                    value: "0",
                    immediatelySave: !0
                },
                "TaskDefaultSettings-OrignHostThreads": {
                    section: "TaskDefaultSettings",
                    key: "OrignHostThreads",
                    value: "5"
                },
                "ConfigNoLimitDownload-TaskCountAutoAdd": {
                    section: "ConfigNoLimitDownload",
                    key: "TaskCountAutoAdd",
                    value: !1
                },
                "ConfigNoLimitDownload-TaskCountAutoAddRate": {
                    section: "ConfigNoLimitDownload",
                    key: "TaskCountAutoAddRate",
                    value: "100"
                },
                "ConfigNormalSession-ConfigNormal_AutoSlowTask2Tail": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoSlowTask2Tail",
                    value: !0
                },
                "ConfigNoLimitDownload-OpenNoLimitDownload": {
                    section: "ConfigNoLimitDownload",
                    key: "OpenNoLimitDownload",
                    value: !1
                },
                "ConfigNoLimitDownload-NoLimitDownloadFileSize": {
                    section: "ConfigNoLimitDownload",
                    key: "NoLimitDownloadFileSize",
                    value: "30"
                },
                "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_OpenMirrorImageIncreaseSpeed",
                    value: !0
                },
                "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_OpenXunleiP2PIncreaseSpeed",
                    value: !0
                },
                "ConfigNet-ConfigNet_Custom_DownloadSpeedChk": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_DownloadSpeedChk",
                    value: !0,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_UploadSpeedChk": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_UploadSpeedChk",
                    value: !0,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_MaxDownloadSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_MaxDownloadSpeed",
                    value: "1024",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_MaxUploadSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_MaxUploadSpeed",
                    value: "1024",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Switch": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Switch",
                    value: !1,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Begin_Hour": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Begin_Hour",
                    value: "0",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Begin_Minute": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Begin_Minute",
                    value: "0",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_End_Hour": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_End_Hour",
                    value: "23",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_End_Minute": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_End_Minute",
                    value: "59",
                    immediatelySave: !0
                },
                "BtGenericSettings-ConfigBt_SetPortType": {
                    section: "BtGenericSettings",
                    key: "ConfigBt_SetPortType",
                    value: "0"
                },
                "BtGenericSettings-ConfigBt_Manul_TcpPort": {
                    section: "BtGenericSettings",
                    key: "ConfigBt_Manul_TcpPort",
                    value: "15000"
                },
                "Monitor-FilterSitesForUI": {
                    section: "Monitor",
                    key: "FilterSitesForUI",
                    value: "\n*.mail.live.com\n*.mail.yahoo.com\n*.mail.qq.com\n*.mail.sohu.com\n*.mail.google.com\n*.sinamail.sina.com.cn\n*.mail.sina.com.cn\n*.mail.163.com\n*.mail.10086.cn\n*.www.126.com\n*.passport.alipay.com\n*.login.live.com\n*.mail.sogou.com\n*.web.mail.tom.com\n*.www.2980.com\n*.mail.21cn.com\n*.www.188.com\n*.yeah.net\n*.mail.wo.com.cn\n*.263.net\n*.ecitic.com\n*.pos.baidu.com"
                },
                "UserCommunitySet-radio_id_": {
                    section: "UserCommunitySet",
                    key: "radio_id_",
                    value: "1",
                    isReleventUser: !0,
                    immediatelySave: !0
                },
                "GenericSettings-AnimationLevel": {section: "GenericSettings", key: "AnimationLevel", value: "1"},
                "Motitor-MotitorAll": {
                    section: "Motitor",
                    key: "MotitorAll",
                    value: 1,
                    type: "number",
                    selectItems: ["Motitor-MotitorIE浏览器"]
                },
                "Bookmark-ShowBookmarkBar": {section: "Bookmark", key: "ShowBookmarkBar", value: 1},
                "PathAndCategory-historyDownloadPaths": {
                    section: "PathAndCategory",
                    key: "historyDownloadPaths",
                    value: []
                },
                "DownloadAndPlay-LanuchMediaPlayer": {
                    section: "DownloadAndPlay",
                    key: "LanuchMediaPlayer",
                    value: "0",
                    immediatelySave: !0
                },
                "ConnectType-ProxyName": {section: "ConnectType", key: "ProxyName", value: ["直接连接"]}
            }
        }, e.setBaseConf = function () {
            let t = Object.values(e.conf.formData);
            for (let n = 0; n < t.length; n++) {
                let a = "";
                if (void 0 !== t[n].optionToValue) {
                    let e = i.ConfigNS.getValue(t[n].section, t[n].key, t[n].optionToValue[t[n].value]);
                    for (let i in t[n].optionToValue) if (t[n].optionToValue[i] === e) {
                        a = i;
                        break
                    }
                } else a = i.ConfigNS.getValue(t[n].section, t[n].key, t[n].value);
                e.conf.formData[`${t[n].section}-${t[n].key}`].value = a
            }
        }, e.initConf = function () {
            return i.ConfigNS.init(o.join(__profilesDir, "config.json"))
        }, e.getConfSchema = function () {
            return e.conf.sechema
        }, e.getConfFormData = function () {
            return e.conf.formData
        }, e.addSettingItemData = function (t, n) {
            let i = !1;
            if (t.name && t.name.length > 0 && t.children) {
                let n = !1;
                for (let a = 0; a < e.conf.sechema.length; ++a) if (e.conf.sechema[a].name === t.name) {
                    n = !0;
                    let o = t.children[0], r = !1;
                    for (let t = 0; t < e.conf.sechema[a].children.length; ++t) {
                        let n = e.conf.sechema[a].children[t];
                        if (n.name === o.name) {
                            if (r = !0, i = !0, o.children.length > 0) for (let e = 0; e < o.children.length; ++e) if (n.children.length > 0) {
                                let t = !1;
                                for (let i = 0; i < n.children.length; ++i) if (o.children[e].name === n.children[i].name) {
                                    t = !0;
                                    break
                                }
                                t || n.children.push(o.children[e])
                            } else n.children.push(o.children[e]);
                            break
                        }
                    }
                    r || (i = !0, e.conf.sechema[a].children.push(t.children[0]));
                    break
                }
                n || (i = !0, e.conf.sechema.push(t))
            }
            for (let t in n) e.conf.formData[t] = n[t];
            return i
        }, e.removeSettingItemData = function (t, n) {
            let i = !1;
            if (t.name && t.name.length > 0 && t.children) for (let n = 0; n < e.conf.sechema.length; ++n) if (e.conf.sechema[n].name === t.name) {
                let a = t.children[0];
                for (let t = 0; t < e.conf.sechema[n].children.length; ++t) {
                    let o = e.conf.sechema[n].children[t];
                    if (o.name === a.name) {
                        if (a.children.length > 0 && o.children.length > 0) for (let e = 0; e < a.children.length; ++e) for (let t = 0; t < o.children.length; ++t) if (a.children[e].name === o.children[t].name) {
                            i = !0, o.children.splice(t, 1);
                            break
                        }
                        0 === o.children.length && (i = !0, e.conf.sechema[n].children.splice(t, 1));
                        break
                    }
                }
                0 === e.conf.sechema[n].children.length && (i = !0, e.conf.sechema.splice(n, 1));
                break
            }
            for (let t in n) e.conf.formData[t] && delete e.conf.formData[t];
            return i
        }
    }(t.SettingInit || (t.SettingInit = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(59), o = n(1), r = n(35), s = n(12), l = n(584), u = n(10), d = n(585),
        c = o.default.getLogger("Thunder.Skin");
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SkinHelperNS.defaultSkinInfo, this.lsatSkinInfo = r.SkinHelperNS.defaultSkinInfo, this.cacheURL = `${__profilesDir}/skin-info.json`, this.init().catch(e => {
                c.warning(e)
            })
        }

        init() {
            return i(this, void 0, void 0, function* () {
                {
                    let e;
                    try {
                        e = JSON.parse((yield u.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        c.warning("解析皮肤信息失败")
                    }
                    e && (this.lsatSkinInfo = e, yield this.setSkinInfo(e)), yield d.SpringFestivalSkinNS.init(), (yield d.SpringFestivalSkinNS.canShowSkin()) && d.SpringFestivalSkinNS.getSkin().then(e => i(this, void 0, void 0, function* () {
                        c.information("SpringFestival skinInfo", e), e && (yield this.setSkinInfo(e))
                    })).catch()
                }
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, n = !1) {
            return i(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.skinInfo.is_spring_festival ? this.skinInfo.colors = d.SpringFestivalSkinNS.getColor().colors : this.skinInfo.colors = l.SkinConfigNS.colorList.find(e => e.id === this.skinInfo.colorID).colors, this.emit("changeSkin", this.skinInfo, t), n || !t || e.is_spring_festival || d.SpringFestivalSkinNS.disableSkin();
                    let i = yield d.SpringFestivalSkinNS.canShowSkin();
                    if (e.is_spring_festival && i && (e = this.lsatSkinInfo), s.ThunderUtil.isUndef(e)) return;
                    let a = Object.assign({}, e);
                    delete a.colors;
                    try {
                        !n && (yield u.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(a)))
                    } catch (e) {
                        c.warning("保存皮肤信息失败")
                    }
                }
            })
        }

        recoverSkin() {
            return i(this, void 0, void 0, function* () {
                this.lsatSkinInfo && (d.SpringFestivalSkinNS.disableSkin(), yield this.setSkinInfo(this.lsatSkinInfo))
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(7).default(a.join(__rootDir, "../bin/ThunderHelper.node")), r = 1;
    let s = new Map;

    function l(e, t, n, i, a) {
        o.createRegKey(e, t), o.writeRegValue(e, t, n, i, a)
    }

    function u(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let n = "Xunlei." + t[0] + ".6", i = a.join(__rootDir, "../../" + t[2]),
                o = a.join(__rootDir, "../../Thunder.exe"), u = "Software\\Classes\\." + e;
            l("HKEY_CURRENT_USER", u, "", n, r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n, "", t[1], r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n + "\\DefaultIcon", "", i, r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n + "\\Shell\\Open", "", t[3], r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n + "\\Shell\\Open\\command", "", '"' + o + '" "%1" -StartType:' + e, r)
        } while (0)
    }

    function d(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let n = "Software\\Classes\\." + e;
            o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Classes\\" + t[0], o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList", o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithProgids", o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\UserChoice", o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e, o.deleteRegKey("HKEY_CURRENT_USER", n), u(e), o.refreshIcon()
        } while (0)
    }

    function c(e) {
        do {
            let t = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList",
                n = o.readRegString("HKEY_CURRENT_USER", t, "MRUList");
            if (null === n || void 0 === n || "" === n) break;
            let i = n.substring(0, 1);
            null !== (n = o.readRegString("HKEY_CURRENT_USER", t, i)) && void 0 !== n && "" !== n && "Thunder.exe" !== n && d(e)
        } while (0)
    }

    s.set("td", ["TDFile", "迅雷临时数据文件", "XLTempFile.ico", "使用迅雷下载未完成文件"]), s.set("xltd", ["TDFile", "迅雷临时数据文件", "XLTempFile.ico", "使用迅雷下载未完成文件"]), s.set("downlist", ["LSTFile", "迅雷专有下载文件", "XLDownloadList.ico", "使用迅雷下载该任务列表文件"]), s.set("torrent", ["Bittorrent", "BT种子文件", "TorrentFile.ico", "使用迅雷下载该BT文件"]), s.set("thunderskin", ["ThunderSkin", "迅雷9皮肤文件", "thunderskin.ico", "为迅雷9应用该皮肤"]), s.set("xlb", ["XLB", "迅雷下载合集文件", "DownloadCollection.ico", "使用迅雷查看该下载合集文件"]), function (e) {
        function t(e) {
            do {
                if (!e || "" === e) break;
                let t = s.get(e);
                if (!t) break;
                let n = "Xunlei." + t[0] + ".6";
                if (o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\." + e, "") === n) break;
                o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Classes\\." + e), o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Classes\\" + t[0]), o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e), u(e), o.refreshIcon()
            } while (0)
        }

        function n(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = '"' + a.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:' + e;
                    if (o.queryRegValue("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "") === n) break;
                    o.deleteRegKey("HKEY_CURRENT_USER", "Software\\classes\\" + e), l("HKEY_CURRENT_USER", "Software\\classes\\" + e, "URL Protocol", "", r), l("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "", n, r), t = !0
                } while (0);
                return t
            })
        }

        e.checkAndRegisterFileType = t, e.checkAndRegisterTorrentFile = function () {
            {
                let e = a.join(__rootDir, "../../Thunder.exe"), n = "torrent",
                    i = o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\Xunlei.Bittorrent.6\\Shell\\Open\\command", "");
                i && "" !== i ? (i.includes(e) || t(n), c(n)) : t(n)
            }
        }, e.doAsynCheckAndRegisterProtocal = n, e.asynCheckAndAssociate = function () {
            return i(this, void 0, void 0, function* () {
                t("td"), t("downlist"), yield n("ed2k"), yield n("magnet"), yield n("thunder"), yield n("thunderx"), yield n("xlb")
            })
        }
    }(t.FileAssociationNS || (t.FileAssociationNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(7), r = n(34), s = n(8), l = n(126), u = n(197), d = n(33), c = n(85), h = n(15), f = n(3),
        g = n(135), p = n(133), k = n(146), m = n(90), T = n(28), v = n(56), C = n(5), S = n(59),
        y = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        w = m.DownloadKernelCategoryManager.getCategoryManager(), I = r.DownloadKernelEventManager.getEventManager(),
        b = l.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        A = g.ToastNotifyManagerNS.getToastNotifyManger();
    var N, D;
    !function (e) {
        e[e.UnKnown = -1] = "UnKnown", e[e.ShutDown = 0] = "ShutDown", e[e.Sleep = 1] = "Sleep", e[e.Exit = 2] = "Exit", e[e.StartAll = 3] = "StartAll", e[e.StopAll = 4] = "StopAll"
    }(N = t.ScheduleCompleteTaskType || (t.ScheduleCompleteTaskType = {})), function (e) {
        e.Unknow = "Unknow", e.ScheduleTaskCountChange = "ScheduleTaskCountChange"
    }(D = t.ScheduleTaskEventType || (t.ScheduleTaskEventType = {})), function (e) {
        let t = N.UnKnown, n = null, a = -1, o = -1, r = -1, l = [], m = !1, _ = !1;
        const x = new S.EventEmitter;

        function E() {
            n = I.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, V)
        }

        function P() {
            null !== n && (I.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, n), n = null)
        }

        function M() {
            P(), t = N.UnKnown
        }

        function F(e) {
            let t = 0, n = ["关机", "睡眠", "退出迅雷", "开始全部任务", "暂停全部任务"];
            for (let i = n.length - 1; i >= 0; --i) if (n[i] === e) {
                t = i;
                break
            }
            return t
        }

        function O() {
            let e = 300;
            r = setInterval(() => {
                (function () {
                    let e = !1, t = b.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks();
                    for (let [, n]of t) {
                        let t = n.getTaskStatus();
                        do {
                            if (t === s.DownloadKernel.TaskStatus.Started || t === s.DownloadKernel.TaskStatus.StartPending || t === s.DownloadKernel.TaskStatus.StartWaiting) {
                                e = !0;
                                break
                            }
                        } while (0)
                    }
                    return e
                })() || function () {
                    let e = !1, t = w.getCurrentPrivateCategory();
                    t && (e = c.TaskOperatorNs.hasCategoryStartTask(t.getId()));
                    return e
                }() ? e = 0 : e >= 300 ? (v.NativeCallHostModule.nativeCallHost.fireNativeEvent("getCurrentTabUrl", "callbackGetCurrentTabUrl"), C.NativeCallModule.nativeCall.AttachNativeEvent("callbackGetCurrentTabUrl", t => {
                    t ? e = 0 : (m = !0, c.TaskOperatorNs.startAllPausedTask(), clearInterval(r), r = -1)
                })) : e++
            }, 1e3)
        }

        function U(e) {
            return e && (e = !1, c.TaskOperatorNs.pauseAll(), -1 !== r && (clearInterval(r), r = -1), function () {
                let e = w.getCurrentPrivateCategory();
                e && c.TaskOperatorNs.pauseCategoryAllTask(e.getId())
            }()), e
        }

        function L(e) {
            let t = !1;
            for (let n = 0; n < e.length; ++n) {
                let i = e[n];
                if (!i) continue;
                let a = i.getTaskStatus();
                if (a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding && a !== s.DownloadKernel.TaskStatus.Failed) continue;
                let o = i.getTaskBaseInfo(), r = i.getTaskPreStatus();
                if (o.taskType !== s.DownloadKernel.TaskType.Bt || a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding || r !== s.DownloadKernel.TaskStatus.Succeeded && r !== s.DownloadKernel.TaskStatus.Seeding) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function B() {
            let e = !1;
            do {
                let t = b.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks(), n = !1;
                for (let [, e]of t) if (null !== e) {
                    let t = e.getTaskStatus();
                    if (t === s.DownloadKernel.TaskStatus.PreDownloading || t === s.DownloadKernel.TaskStatus.StartWaiting || t === s.DownloadKernel.TaskStatus.StartPending || t === s.DownloadKernel.TaskStatus.Started) {
                        n = !0;
                        break
                    }
                }
                if (n) break;
                e = !0
            } while (0);
            return e
        }

        function K(e) {
            e === N.ShutDown ? y.shutDownMachine() : e === N.Sleep ? y.suspendMachine() : e === N.Exit ? u.quitPromises.run() : e === N.StartAll ? c.TaskOperatorNs.startAll() : e === N.StopAll && c.TaskOperatorNs.pauseAll()
        }

        function V(...e) {
            do {
                if (!e) break;
                if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                if (!L(e[1])) break;
                if (!B()) break;
                setTimeout(() => {
                    K(t), M()
                }, 1e4)
            } while (0)
        }

        e.getEventEmitter = function () {
            return x
        }, e.setDownloadCompleteTaskType = function (e) {
            do {
                if (e !== N.ShutDown && e !== N.Sleep && e !== N.Exit) break;
                if (t === e) break;
                M(), t = e, E();
                let n = "";
                switch (e) {
                    case N.ShutDown:
                        n = "已开启下载完成后关机";
                        break;
                    case N.Sleep:
                        n = "已开启下载完成后睡眠";
                        break;
                    case N.Exit:
                        n = "已开启下载完成后退出迅雷"
                }
                let i = A.showNotify(g.ToastNotifyManagerNS.notifyIdScheduleTaskComplete, p.ToastNotifyItemType.RedCancelNotify, n, 5e3);
                i && i.onCancel(() => {
                    M()
                })
            } while (0)
        }, e.getDownloadCompleteTaskType = function () {
            return t
        }, e.startDownloadCompleteMonitor = E, e.stopDownloadCompleteMonitor = P, e.cancelDownloadCompleteTask = M, e.showPlanTaskDlg = function () {
            d.MessageBox.custom("PlanTask", l, {width: 400, height: 142, center: !0}).catch()
        }, e.init = function () {
            f.remote.ipcMain.on(h.ThunderChannelList.channelRMCommitPlanTask, (e, t) => i(this, void 0, void 0, function* () {
                l = t, -1 !== a && (clearInterval(a), a = -1), x.emit(D.ScheduleTaskCountChange, l.length), a = setInterval(() => {
                    for (let e = l.length - 1; e >= 0; --e) {
                        let t = l[e],
                            n = k.TimeHelperNS.convertTimeToMinutes(Number(t.hours), Number(t.minutes), Number(t.seconds));
                        if ((n -= 1) <= 0) {
                            K(F(t.operation)), l.splice(e, 1), x.emit(D.ScheduleTaskCountChange, l.length);
                            continue
                        }
                        let i = k.TimeHelperNS.convertMinuteToTime(n);
                        t.hours = i[0] + "", t.minutes = i[1] + "", t.seconds = i[2] + ""
                    }
                    l.length <= 0 && -1 !== a && (clearInterval(a), a = -1)
                }, 1e3)
            })), f.remote.ipcMain.on(h.ThunderChannelList.channelRMPerformePlanTask, (e, t) => i(this, void 0, void 0, function* () {
                K(F(t))
            }))
        }, e.getOperationIndex = F, e.getScheduleTaskCount = function () {
            return l.length
        }, e.popMessageBox = function (e) {
            _ ? e() : d.MessageBox.confirm({
                title: "空闲下载",
                type: d.MessageBox.ConfirmType.Info,
                content: "当您长时间没有操作电脑时，迅雷会自动下载之前被暂停的任务",
                okText: "开启",
                cancelVisible: !1
            }, {width: 400, height: 177, center: !0}).then(t => {
                t.action === T.MessageBoxNS.Action.OK && (_ = !0, e())
            }).catch()
        }, e.startFreeDownLoad = function () {
            let e = !1, t = 0;
            o = setInterval(() => {
                t = y.getFreeTime(), e ? t < 300 && (e = !1, m = U(m)) : t >= 300 && (e = !0, O())
            }, 2e3)
        }, e.closeFreeDownLoad = function () {
            -1 !== o && (clearInterval(o), o = -1), m = U(m)
        }, e.excuteTask = K
    }(t.ScheduleTaskNS || (t.ScheduleTaskNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(862), a = n(13);
    let o, r = localStorage.getItem("guideDone"), s = r ? r.split(",") : [];
    (o = new i.default([{
        name: "search",
        selector: ".xlx-search .td-input__inner",
        offset: [0, -5],
        position: "left"
    }, {name: "downloadTab", selector: "#downloadTab", offset: [0, -5]}, {
        name: "downloadPlan",
        selector: ".xlx-status-plan",
        offset: [0, -5],
        style: {zIndex: 1}
    }].filter(e => !s.includes(e.name)))).on("show", e => {
        a.XLStatNS.trackEvent("download_leftpanel", "guide_show", "", 0, 0, 0, 0, {type: e})
    }), o.on("done", e => {
        s.push(e), localStorage.setItem("guideDone", s.join()), a.XLStatNS.trackEvent("download_leftpanel", "guide_click", "", 0, 0, 0, 0, {type: e})
    }), t.default = o
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(21), o = n(136), r = n(231), s = n(2), l = n(1), u = n(7), d = n(6), c = n(863), h = n(79), f = n(105),
        g = n(76), p = l.default.getLogger("Thunder.MainRenderer.stroe.Tabs"),
        k = u.default(s.join(__rootDir, "../bin/ThunderHelper.node")), m = g.TabEventManagerNS.getEventEmitter();
    let T = g.createXDASTab({pinned: !0});
    d.isNullOrUndefined(T) && p.error(T), t.onJsCallNativeFunction = function (e, t, n, i) {
        T.onJsCallNativeFunction(e, t, n, i)
    }, t.onJsCheckNativeFunction = function (e, t, n) {
        T.onJsCheckNativeFunction(e, t, n)
    };
    let v = 1;
    const C = {
        tabs: [{title: T.getTitle(), tab: T, pinned: T.getPinned(), key: v++}],
        current: 0,
        curBrowserWndHandle: 0
    };

    function S(e, t) {
        do {
            if (p.information("Remove_TAb_CTRL param:", t), d.isNullOrUndefined(t) || d.isNullOrUndefined(t.index) || d.isNullOrUndefined(t.tabInfo) || d.isNullOrUndefined(t.tabInfo.tab)) {
                p.error(t);
                break
            }
            e.tabs.splice(t.index, 1), e.current === t.index && t.index > 0 ? e.current = t.index - 1 : e.current > t.index && (e.current = e.current - 1);
            let n = e.tabs[e.current];
            (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) && p.error(n);
            let i = n.tab.getBrowser();
            if (d.isNullOrUndefined(i)) break;
            let o = i.getWindowHandle();
            if (!1 === k.isWindowHandle(o)) {
                p.error(o);
                break
            }
            r.resizeBrowserWindow(o), p.information("CLOSE_TAB isErrorPage:", e.tabs[e.current].tab.isErrorPage), !0 === e.tabs[e.current].tab.isErrorPage && k.showWindow(o, a.showCmd.SW_HIDE), 0 !== e.curBrowserWndHandle && e.curBrowserWndHandle !== o && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), k.setWindowFocus(o, !0), e.curBrowserWndHandle = o, m.emit(g.TabEventManagerNS.EventType.RemoveTab, t)
        } while (0)
    }

    const y = {
        CREATE_NEW_TAB(e, t) {
            do {
                if (t.tabType === o.TabType.Chromium) {
                    let e = r.getBrowserWindowRect();
                    t.tabParam.rect = e
                }
                let n = -1;
                if (t.tabParam.name && (n = e.tabs.findIndex(e => e.tab.name === t.tabParam.name)), -1 !== n) this.commit("SELECT_TAB", n), t.tabParam.url && e.tabs[n].tab.navigate(t.tabParam.url); else {
                    let n = g.createNewTab(t.tabType, t.tabParam);
                    if (c.registerContextMenu(n), d.isNullOrUndefined(n)) {
                        p.error(n);
                        break
                    }
                    t.tabType === o.TabType.Chromium && n.getBrowser().queryWindowHandle(), t.tabType === o.TabType.XDAS && (k.isWindowHandle(e.curBrowserWndHandle) && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = 0);
                    let i = "index" in t.tabParam ? t.tabParam.index : e.tabs.length;
                    e.tabs.splice(i, 0, {
                        title: n.getTitle(),
                        tab: n,
                        pinned: n.getPinned(),
                        key: v++
                    }), e.current = i, m.emit(g.TabEventManagerNS.EventType.AddTab, t)
                }
            } while (0)
        }, SELECT_TAB(e, t) {
            p.information("SELECT_TAB index: " + t);
            do {
                if (d.isNullOrUndefined(t)) break;
                if (t < 0) break;
                if (t >= e.tabs.length) break;
                let n = e.tabs[t];
                if (d.isNullOrUndefined(n)) break;
                let i = {tabInfo: n, index: t}, s = i.tabInfo.tab;
                if (d.isNullOrUndefined(s)) break;
                if (s.getTabType() === o.TabType.Chromium) {
                    let t = s.getBrowser();
                    if (d.isNullOrUndefined(t)) {
                        p.error(t);
                        break
                    }
                    let n = t.getWindowHandle();
                    if (!1 === k.isWindowHandle(n)) {
                        p.error(n), t.queryWindowHandle();
                        break
                    }
                    if (p.information("SELECT_TAB hwnd: " + n + " curBrowserWndHandle: " + e.curBrowserWndHandle), n === e.curBrowserWndHandle) break;
                    r.resizeBrowserWindow(n), k.isWindowHandle(n) && (s.isErrorPage ? (k.showWindow(n, a.showCmd.SW_HIDE), t.refresh(!1)) : (k.showWindow(n, a.showCmd.SW_SHOW), k.setWindowFocus(n, !0))), k.isWindowHandle(e.curBrowserWndHandle) && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = n
                } else s.getTabType() === o.TabType.IE ? p.information("ie") : s.getTabType() === o.TabType.XDAS && (k.isWindowHandle(e.curBrowserWndHandle) && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = 0);
                e.current = i.index, m.emit(g.TabEventManagerNS.EventType.ChangeTab, t, s)
            } while (0)
        }, ON_BIND_WND_HANDLE(e, t) {
            p.information("ON_BIND_WND_HANDLE");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.hwnd)) {
                    p.error(t);
                    break
                }
                if (!1 === k.isWindowHandle(t.hwnd)) {
                    p.error(t.hwnd);
                    break
                }
                if (e.curBrowserWndHandle === t.hwnd) break;
                if (!0 === e.tabs[e.current].tab.isErrorPage) {
                    k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = t.hwnd;
                    break
                }
                r.resizeBrowserWindow(t.hwnd), k.showWindow(t.hwnd, a.showCmd.SW_SHOW), k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = t.hwnd
            } while (0)
        }, ON_NEW_BROWSER_POPUP(e, t) {
            e.tabs.push({
                title: t.getTitle(),
                tab: t,
                pinned: t.getPinned(),
                key: v++
            }), e.current = e.tabs.length - 1, m.emit(g.TabEventManagerNS.EventType.AddTab)
        }, ON_NEW_BROWSER_POPUP_COMPLETED(e, t) {
            p.information("ON_NEW_BROWSER_POPUP_COMPLETED");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        e.queryWindowHandle();
                        break
                    }
                }
            } while (0)
        }, ON_TITLE_CHANGE(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser) || d.isNullOrUndefined(t.title)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        n.title = t.title, n.tab.setTitle(t.title);
                        break
                    }
                }
            } while (0)
        }, ON_FAV_ICON_GET(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser) || d.isNullOrUndefined(t.iconUrl)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        n.tab.setIconUrl(t.iconUrl);
                        break
                    }
                }
            } while (0)
        }, ON_ORIGINAL_URL_CHANGE(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser) || d.isNullOrUndefined(t.originalUrl)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        n.tab.originalUrl = t.originalUrl;
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_START(e, t) {
            p.information("ON_LOAD_START");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let i = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(i) && (i === t.browser && !0 === t.isMainFrame && (n.tab.isErrorPage = !1, n.tab === e.tabs[e.current].tab))) {
                        let t = i.getWindowHandle();
                        k.isWindowHandle(t) && (k.showWindow(t, a.showCmd.SW_SHOW), e.curBrowserWndHandle = t)
                    }
                }
            } while (0)
        }, ON_LOAD_STATUS_CHANGE(e, t) {
            p.information("ON_LOAD_STATUS_CHANGE");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    d.isNullOrUndefined(e) || e === t.browser && (n.tab.canGoBack = t.canGoBack, n.tab.canGoForward = t.canGoForward, t.isLoading && (n.tab.isErrorPage = !1))
                }
            } while (0)
        }, ON_ADDRESS_CHANGE(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    d.isNullOrUndefined(e) || e === t.browser && !0 === t.isMainFrame && (n.tab.url = t.url)
                }
            } while (0)
        }, ON_LOAD_ERROR(e, t) {
            p.error("ON_LOAD_ERROR ", t.errorCode);
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame && (-105 === t.errorCode || -21 === t.errorCode || -106 === t.errorCode || -118 === t.errorCode || -7 === t.errorCode || -101 === t.errorCode))) {
                        let i = e.getWindowHandle();
                        if (0 === i) {
                            n.tab.url = t.failedUrl, n.tab.isErrorPage = !0, e.queryWindowHandle();
                            break
                        }
                        p.error("ON_LOAD_ERROR HIDE hwnd: ", i), n.tab.url = t.failedUrl, n.tab.isErrorPage = !0, k.isWindowHandle(i) && k.showWindow(i, a.showCmd.SW_HIDE)
                    }
                }
            } while (0)
        }, ON_APP_QUIT(e) {
            p.information(e);
            for (let t of e.tabs) d.isNullOrUndefined(t) || d.isNullOrUndefined(t.tab) || t.tab.getTabType() === o.TabType.Chromium && t.tab.destroyBrowser(!0);
            void 0 !== r.browserSupport.browserComponent && r.browserSupport.browserComponent.uninit()
        }, REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(e.tabs[0]) || d.isNullOrUndefined(e.tabs[0].tab)) break;
                let n = e.tabs[0].tab.registerNativeFunction(t.functionName, t.nativeFunc);
                !1 === n && p.error(n)
            } while (0)
        }, UN_REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(e.tabs) || d.isNullOrUndefined(e.tabs[0].tab)) break
            } while (0);
            e.tabs[0].tab.unRegisterNativeFunction(t)
        }, CLOSE_TAB(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.index) || d.isNullOrUndefined(t.tabInfo) || d.isNullOrUndefined(t.tabInfo.tab)) {
                    p.error(t);
                    break
                }
                let n = t.tabInfo.tab;
                if (n.getTabType() === o.TabType.Chromium) {
                    n.destroyBrowser(!0) || S(e, t)
                } else S(e, t)
            } while (0)
        }, Remove_TAb_CTRL(e, t) {
            S(e, t)
        }, ON_CHROMIUM_CALL_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.functionName) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        !1 === n.tab.onJsCallNativeFunction(0, t.functionName, t.callBackId, t.args) && p.error(t)
                    }
                }
            } while (0)
        }, ON_CHROMIUM_CHECK_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.functionName) || d.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        !1 === n.tab.onJsCheckNativeFunction(0, t.functionName, t.callBackId) && p.error(t)
                    }
                }
            } while (0)
        }, UPDATE_CURRENT(e, t) {
            e.current = t
        }, UPDATE_TABS(e, t) {
            e.tabs = t
        }
    }, w = {
        selectTab({commit: e}, t) {
            e("SELECT_TAB", t)
        }, closeTab({commit: e}, t) {
            e("CLOSE_TAB", t)
        }, removeTabCtrl({commit: e}, t) {
            e("Remove_TAb_CTRL", t)
        }, onChromiumCallNativeFunction({commit: e}, t) {
            e("ON_CHROMIUM_CALL_NATIVE_FUNCTION", t)
        }, onChromiumCheckNativeFunction({commit: e}, t) {
            e("ON_CHROMIUM_CHECK_NATIVE_FUNCTION", t)
        }, onNewBrowserPopup({commit: e}, t) {
            return i(this, void 0, void 0, function* () {
                p.information("ON_NEW_BROWSER_POPUP");
                do {
                    if (d.isNullOrUndefined(t)) {
                        p.error(t);
                        break
                    }
                    if (yield h.URLHelperNS.isCustomProtocol(t.url)) {
                        f.ThunderNewTask.createTaskByUrl(t.url);
                        break
                    }
                    let n = {isFromPopup: !0, url: t.url}, i = o.TabType.Chromium, a = g.createNewTab(i, n);
                    if (c.registerContextMenu(a), d.isNullOrUndefined(a)) {
                        p.error(a);
                        break
                    }
                    a.getBrowser().queryWindowHandle(), e("ON_NEW_BROWSER_POPUP", a)
                } while (0)
            })
        }
    }, I = {
        currentTab: e => {
            let t = null;
            do {
                if (d.isNullOrUndefined(e) || d.isNullOrUndefined(e.current) || d.isNullOrUndefined(e.tabs)) {
                    p.error(e);
                    break
                }
                let n = e.tabs[e.current];
                if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) break;
                t = n
            } while (0);
            return t
        }
    };
    t.default = {state: C, mutations: y, actions: w, getters: I}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.unread = function (e) {
        return e > 99 ? "..." : e ? String(e) : ""
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(197), a = n(85), o = n(105), r = n(13), s = n(1).default.getLogger("MenuContextHelper");
    const l = new class {
        constructor() {
            s.information("constructor MenuContextHelper object")
        }

        exitThunderX(e) {
            i.quitPromises.run()
        }

        showNewTaskPanel(e) {
            s.information("trackEvent", "core_event", "create_task_click", "click_source=other"), r.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=other"), o.ThunderNewTask.createPreNewTaskWindow(null)
        }

        importUncompleted(e) {
            a.TaskOperatorNs.importUncompleted()
        }

        initAccelerator() {
            window.addEventListener("keyup", e => {
                "n" !== e.key && "N" !== e.key || !e.ctrlKey || this.showNewTaskPanel("system-menu")
            }, !0)
        }
    };
    t.default = l
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(53), o = n(1).default.getLogger("ConTextMenu");
    !function (e) {
        e.popContextMenu = function (e, t) {
            t && (o.information("params", t), t.isEditable ? function (e, t) {
                let n = [{label: "撤销", role: "undo", enabled: t.editFlags.canUndo}, {type: "separator"}, {
                    label: "剪切",
                    role: "cut",
                    enabled: t.editFlags.canCut
                }, {label: "复制", role: "copy", enabled: t.editFlags.canCopy}, {
                    label: "粘贴",
                    role: "paste",
                    enabled: t.editFlags.canPaste
                }, {label: "删除", role: "delete", enabled: t.editFlags.canDelete}, {type: "separator"}, {
                    label: "全选",
                    role: "selectall",
                    enabled: t.editFlags.canSelectAll
                }], o = i.remote.Menu.buildFromTemplate(n);
                a.MenuSkinNS.setStyle(o, {}), o.popup({window: i.remote.getCurrentWindow()})
            }(0, t) : "" !== t.selectionText && function (e, t) {
                let n = [{label: "复制", role: "copy", enabled: t.editFlags.canCopy}],
                    o = i.remote.Menu.buildFromTemplate(n);
                a.MenuSkinNS.setStyle(o, {}), o.popup({window: i.remote.getCurrentWindow()})
            }(0, t))
        }, e.popCustomContextMenu = function (e) {
            i.remote.getCurrentWebContents().once("context-menu", (t, n) => {
                o.information("event", t, "params", n);
                let r = [];
                if (void 0 !== e && "function" == typeof e && (r = e(n)), r.length > 0) {
                    let e = i.remote.Menu.buildFromTemplate(r);
                    a.MenuSkinNS.setStyle(e, {}), e.popup({window: i.remote.getCurrentWindow()})
                }
            })
        }, e.popupAt = function (e, t, n) {
            do {
                if (t.x && t.y) break;
                let e = n.getBoundingClientRect();
                t.x = Math.round(e.left), t.y = Math.round(e.bottom)
            } while (0);
            e.popup(t)
        }
    }(t.ContextMenuNS || (t.ContextMenuNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(7), s = n(8), l = n(90), u = n(910), d = n(73), c = n(23), h = n(126), f = n(72),
        g = n(84), p = n(10), k = o.default.getLogger("DownloadKernel.Upgrade"),
        m = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        T = l.DownloadKernelCategoryManager.getCategoryManager(), v = u.PrivateSpaceUpgradeNS.getUpgrade(),
        C = h.DownloadKernelCategoryViewManager.getCategoryViewManager();

    class S extends f.default {
        constructor() {
            super(...arguments), this.eventUpgradeProgress = "OnUpgradeProgress", this.totalTaskCount = 0, this.upgradeTaskCount = 0
        }

        upgradeP2sp(e) {
            let t = e.getSavePath(), n = e.getTaskName();
            return k.information("upgradeP2sp savePath:", t, ", taskName:", n), new Promise(e => {
                m.asyncUpgradeP2spTask(t, n, t => {
                    e(t)
                })
            })
        }

        upgradeBt(e) {
            let t = e.getExtraObject(), n = t.getFileCount(), o = t.getSeedFilePath(), r = a.parse(o), s = r.dir,
                l = r.name + r.ext, u = e.getSavePath(), d = t.getDisplayName(), c = "";
            if (1 !== n) u = a.join(u, d); else {
                let e = t.getBtFileInfoList();
                c = e[0].fileName
            }
            return k.information("upgradeBt savePath:", u, ", taskName:", d, ", fileCount:", n, ", seedFilePath:", o, ", seedFileName:", l), new Promise(e => {
                m.asyncUpgradeBtTask(u, l, s, t => i(this, void 0, void 0, function* () {
                    if (t && 1 === n) {
                        let e = a.join(u, d);
                        (yield p.FileSystemAWNS.existsAW(e)) || (yield p.FileSystemAWNS.mkdirAW(e));
                        let t = a.join(u, c), n = a.join(e, c);
                        t += ".bt.xltd", n += ".bt.xltd", (yield p.FileSystemAWNS.existsAW(n)) || (yield p.FileSystemAWNS.renameAW(t, n));
                        let i = a.join(u, l), o = a.join(e, l);
                        (yield p.FileSystemAWNS.existsAW(o)) || (yield p.FileSystemAWNS.renameAW(i, o))
                    }
                    e(t)
                }))
            })
        }

        upgradeEmule(e) {
            let t = e.getSavePath(), n = e.getTaskName(),
                i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
            return g.Common.isThunderPrivateUrl(i) && (i = g.Common.parseThunderPrivateUrl(i)), k.information("upgradeEmule url:", i, ", savePath:", t, ", taskName:", n), new Promise(e => {
                m.asyncUpgradeEmuleTask(i, t, n, t => {
                    e(t)
                })
            })
        }

        upgradeGroup(e) {
            return new Promise(t => {
                let n = e.getExtraObject(), i = n.getSubTaskCount();
                if (i > 0) for (let e = 0; e < i; e++) {
                    let i = n.getSubTaskByIndex(e);
                    i.getType() !== s.DownloadKernel.TaskType.Group && this.upgradeCategoryViewTask(i).then(e => {
                        t(e)
                    }).catch()
                } else t(!0)
            })
        }

        upgradeCategoryViewTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = e.getType();
                return t === s.DownloadKernel.TaskType.P2sp ? this.upgradeP2sp(e) : t === s.DownloadKernel.TaskType.Bt ? this.upgradeBt(e) : t === s.DownloadKernel.TaskType.Emule && this.upgradeEmule(e)
            })
        }

        upgradeCategoryView(e) {
            let t = e.getTasks();
            if (t.size <= 0) return !1;
            this.totalTaskCount += t.size, this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount);
            for (let [, e]of t) {
                e.getType() === s.DownloadKernel.TaskType.Group ? this.upgradeGroup(e).then(t => {
                    this.upgradeTaskCount += 1, k.information("upgradeGroup return. this.upgradeTaskCount:", this.upgradeTaskCount, ", result:", t, ", taskName:", e.getTaskName()), this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount)
                }).catch() : this.upgradeCategoryViewTask(e).then(t => {
                    this.upgradeTaskCount += 1, k.information("upgradeCategoryViewTask return. this.upgradeTaskCount:", this.upgradeTaskCount, ", result:", t, ", taskName:", e.getTaskName()), this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount)
                }).catch()
            }
            return !0
        }

        init() {
            let e = a.join(__rootDir, "../bin/SDK/");
            return m.initUpgrade(e)
        }

        upgradePrivateSpace(e) {
            return v.upgradePrivateSpace(e)
        }

        startUpgrade() {
            this.totalTaskCount = 0, this.upgradeTaskCount = 0, d.DownloadKernelManager.attachOnceListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                let e = C.getCategoryViews();
                for (let t = 0; t < e.length; t++) {
                    let n = e[t], i = n.getCategoryViewId();
                    i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(n)
                }
                let t = T.getCategorys();
                for (let [, e]of t) {
                    let t = e.getCategoryViews();
                    for (let e = 0; e < t.length; e++) {
                        let n = t[e], i = n.getCategoryViewId();
                        i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(n)
                    }
                }
            })
        }
    }

    t.DownloadKernelUpgrade = S, function (e) {
        const t = new S;
        e.getUpgrade = function () {
            return t
        }
    }(t.DownloadKernelUpgradeNS || (t.DownloadKernelUpgradeNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(7), r = n(1), s = n(10), l = n(3), u = n(23), d = n(248), c = n(59), h = n(5), f = n(51),
        g = n(68), p = n(197), k = n(13), m = n(76), T = g.UserHelperNS.getHelper(),
        v = r.default.getLogger("FengxingAdHelper"), C = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let S = l.remote.getCurrentWindow().getNativeWindowHandle().readUIntLE(0, 4), y = new c.EventEmitter;
    !function (e) {
        let t = !1, n = !1, o = 0, r = -1;

        function l(i) {
            do {
                if (!t || n) break;
                v.information("showFengxingAd bShow, isVip, current = ", i, T.isVip, m.getCurrentTabID()), 0 !== o && C.isWindowHandle(o) && (i ? 0 === m.getCurrentTabID() ? C.showWindow(o, 5) : (C.showWindow(o, 0), i = !1) : C.showWindow(o, 0), c(e.eventFengxingAdShow, i))
            } while (0)
        }

        function c(e, ...t) {
            return y.emit(e, ...t)
        }

        e.eventFengxingAdShow = "event_fengxing_ad_show", d.default.attachListener(u.NodeEventMesssageNS.eventOnCommand, (t, a) => i(this, void 0, void 0, function* () {
            v.information("OnCommand key, value", t, a), "CooperateAd" === t ? (0 !== (o = Number(a)) && (k.XLStatNS.trackEvent("xlx_ad_event", "ad_show", "pc_banner", 0, 0, 0, 0, ""), r = setInterval(() => {
                !1 === C.isWindowHandle(o) && (c(e.eventFengxingAdShow, !1), -1 !== r && clearInterval(r))
            }, 1e3)), T.isVip ? l(!1) : l(!0)) : "CloseCooperateAd" === t && (n = !0, k.XLStatNS.trackEvent("xlx_ad_event", "ad_closed", "pc_banner", 0, 0, 0, 0, ""), c(e.eventFengxingAdShow, !1))
        })), h.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
            f.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                do {
                    if (null === e || void 0 === e) break;
                    let t = e.vipList[0];
                    0 !== Number(t.isVip) && l(!1)
                } while (0)
            })
        }), h.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
            l(!0)
        }), p.quitPromises.add(() => new Promise(e => i(this, void 0, void 0, function* () {
            v.information("before quit"), l(!1), e(!0)
        }))), e.createFengxingAd = function () {
            return i(this, void 0, void 0, function* () {
                do {
                    if (t) break;
                    let e = a.join(__rootDir, "plugins/XunFengCooperate/XunFengCooperate.exe");
                    if (v.information("createFengxingAd adExePath = ", e), yield s.FileSystemAWNS.existsAW(e)) {
                        let n = a.dirname(e);
                        v.information("hwndNum", S, e);
                        let i = C.shellExecute(0, "open", e, "-hMainWnd:" + S, n, "SW_SHOW");
                        v.information("shellexecute result", i), i > 32 && (t = !0)
                    }
                } while (0)
            })
        }, e.showFengxingAd = l, e.attachListener = function (e, t) {
            y.addListener(e, t)
        }, e.detachListener = function (e, t) {
            y.removeListener(e, t)
        }
    }(t.FengxingAdHelperNS || (t.FengxingAdHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(72), r = n(38), s = n(10), l = n(254), u = n(287), d = n(25), c = n(194), h = n(1), f = n(13),
        g = h.default.getLogger("AdPlatform");
    var p;
    !function (e) {
        e.waiting = "waiting", e.abort = "abort", e.ready = "ready"
    }(p || (p = {}));
    t.adPlatform = new class extends o.default {
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(706), a = n(362);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(925);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-category.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(8), o = n(74), r = n(23), s = n(32), l = n(84), u = s.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        let t = null, s = -1, d = null;
        e.init = function () {
            o.default.attachListener(r.NodeEventMesssageNS.eventDownloadItemActive, (e, o, r, c, h) => {
                o && e === a.DownloadKernel.CategroyViewID.Downloading ? (-1 !== s && null !== t && (clearTimeout(t), t = null), s = r, t = setTimeout(() => i(this, void 0, void 0, function* () {
                    if (-1 !== s) {
                        let e = u.getTaskFromTaskId(s);
                        if (e) {
                            let t = e.getTaskBaseInfo();
                            if (t.gcid && "" !== t.gcid) return;
                            const {QueryTaskInfoHelperNS: i} = yield Promise.resolve().then(() => n(255));
                            if (t.taskType === a.DownloadKernel.TaskType.P2sp) {
                                let n = e.getExtraObject().getDisplayUrl();
                                "" === n && (n = t.url), l.Common.isThunderPrivateUrl(n) && (n = l.Common.parseThunderPrivateUrl(n)), i.queryResInfo("url", n).then(t => {
                                    t && 200 === t.status && null !== t.data && null !== t.data.code && 0 === t.data.code && "" !== t.data.gcid && (e.beginBatchSetTaskAttribute(), e.setFileSize(t.data.file_size), e.setGcid(t.data.gcid), e.commitBatchSetTaskAttribute())
                                }).catch()
                            } else if (t.taskType === a.DownloadKernel.TaskType.Emule) {
                                let n = t.url;
                                l.Common.isThunderPrivateUrl(n) && (n = l.Common.parseThunderPrivateUrl(n)), i.postRequestEd2kTaskInfoByEd2kLink(n).then(t => {
                                    t && t.gcid && "" !== t.gcid && "1111111111111111111111111111111111111111" !== t.gcid && e.setGcid(t.gcid)
                                }).catch()
                            }
                            if (t.taskType === a.DownloadKernel.TaskType.Group) {
                                let e = [], n = "", o = u.getTaskFromTaskId(t.taskId).getExtraObject(),
                                    r = o.getSubTaskCount(), s = new Map;
                                for (let t = 0; t < r; ++t) {
                                    let i = o.getSubTaskByIndex(t);
                                    if (i.getType() === a.DownloadKernel.TaskType.P2sp) {
                                        let a = i.getTaskBaseInfo();
                                        if (a.fileSize && a.fileSize > 0) continue;
                                        a.url && a.url.length > 0 && (n = a.url, l.Common.isThunderPrivateUrl(n) && (n = l.Common.parseThunderPrivateUrl(n)), e.push(n), s.set(n, t))
                                    }
                                }
                                e.length > 0 && !d && (d = t.taskId, i.asyncBatchQueryP2spTaskInfoByUrl(e, (e, t, n) => {
                                    o.setSubTaskFileSize(s.get(e), t.fileSize)
                                }, () => {
                                    d = null
                                }).catch())
                            }
                        }
                    }
                }), 100)) : s === r && (null !== t && (clearTimeout(t), t = null), s = -1)
            })
        }, e.getQueryTaskId = function () {
            return d
        }
    }(t.QueryTaskInfoNS || (t.QueryTaskInfoNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(10), s = o.default.getLogger("plugin-updater");

    class l {
        constructor(e) {
            this.dir = "", this.versionsDir = "", s.verbose("constructor", "dir", e), this.dir = e, this.versionsDir = a.join(e, "versions")
        }

        static getPluginUpdater(e) {
            return new l(e)
        }

        install(e, t) {
            return i(this, void 0, void 0, function* () {
                s.information("install", "version", e, "src", t);
                try {
                    if ((yield this.getCurVersion()) >= e) return;
                    yield this.save(e, t), yield this.setCurVersion(e)
                } catch (e) {
                    s.warning(e)
                }
            })
        }

        active() {
            return i(this, void 0, void 0, function* () {
                s.information("active");
                try {
                    const e = yield this.getCurVersion();
                    yield this.clear(this.versionsDir, e)
                } catch (e) {
                    s.warning(e)
                }
            })
        }

        getCurFilePath() {
            return i(this, void 0, void 0, function* () {
                s.information("getCurFilePath");
                try {
                    const e = yield this.getCurVersion();
                    if (e) return a.join(this.versionsDir, e)
                } catch (e) {
                    s.warning(e)
                }
                return ""
            })
        }

        clear(e, t) {
            return i(this, void 0, void 0, function* () {
                return s.information("clear", "src", e, "exclude", t), (yield r.FileSystemAWNS.readdirAW(e)).filter(e => e !== t).map(e => r.FileSystemAWNS.rmdirsAW(a.join(this.versionsDir, e)))
            })
        }

        save(e, t) {
            return i(this, void 0, void 0, function* () {
                yield r.FileSystemAWNS.mkdirsAW(this.dir), yield r.FileSystemAWNS.mkdirsAW(this.versionsDir);
                const n = a.join(this.versionsDir, e);
                return r.FileSystemAWNS.copyDirsAW(t, n)
            })
        }

        getCurVersion() {
            return i(this, void 0, void 0, function* () {
                return (yield r.FileSystemAWNS.readFileAW(`${this.dir}/VERION.txt`)).toString()
            })
        }

        setCurVersion(e) {
            return i(this, void 0, void 0, function* () {
                return r.FileSystemAWNS.writeFileAW(`${this.dir}/VERION.txt`, e)
            })
        }
    }

    t.default = l
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(586), o = n(285).MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification");
    !function (e) {
        function t(e, t) {
            o.enQueue({
                callback: () => i(this, void 0, void 0, function* () {
                    a.Notification.notify(e, t)
                }), name: e.name, priority: e.priority
            })
        }

        e.notify = function (e, n) {
            e.priority = e.priority || 0, a.Notification.getCurrentWindow() ? o.getCurrentProperty() < e.priority ? (t(e, n), a.Notification.close()) : e.noDelay || t(e, n) : (t(e, n), o.deQueue())
        }, e.clearNotificationsByName = function (e) {
            o.clearQueuesByName(e)
        }
    }(t.NotificationHelper || (t.NotificationHelper = {}))
}, , , , , , , , , , , , , , , , , , , , function (e, t, n) {
    n(41), e.exports = n(772)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(26), o = n(27);
    o.CommonIPCRenderer.rendererCommunicator.initialize(a.CommonIPCBase.mainRendererContext), o.CommonIPCRenderer.rendererCommunicator.connect();
    const r = n(42), s = n(5), l = n(3), u = n(2), d = n(59), c = n(30), h = n(1);
    n(773);
    const f = n(105), g = n(73), p = n(792), k = n(23), m = n(804), T = n(56), v = n(841), C = n(842), S = n(843),
        y = n(844), w = n(845), I = n(280), b = n(15), A = n(85), N = n(847), D = n(565), _ = n(134), x = n(51),
        E = n(735), P = n(74), M = n(25), F = n(250), O = n(848), U = n(249), L = n(248), B = n(197), K = n(572),
        V = n(849), R = n(13), W = n(45), H = n(951), j = n(743), G = n(952), z = n(738), $ = n(82), q = n(582),
        X = n(953), J = n(33), Y = n(135), Q = n(133), Z = n(286), ee = n(588), te = n(750), ne = n(581), ie = n(954),
        ae = n(7).default(u.join(__rootDir, "../bin/ThunderHelper.node")), oe = n(955), re = n(749), se = n(583),
        le = n(959), ue = n(961), de = n(14), ce = n(35);
    n(962), n(963);
    const he = n(964), fe = n(574), ge = Z.GroupAccelerateManagerNS.getManager(),
        pe = ee.GroupAccelerateWebManagerNS.getManager(), ke = Y.ToastNotifyManagerNS.getToastNotifyManger();
    r.PerformanceMonitorStatNS.init("main-renderer"), l.ipcRenderer.send(b.ThunderChannelList.channelRMProcessSend, process.pid);
    const me = h.default.getLogger("Thunder.Main");
    W.ThunderToolsNS.enableDevTools().catch(e => {
        me.warning(e)
    });
    let Te = "";
    for (let e = 0; e < l.remote.process.argv.length; e++) {
        let t = l.remote.process.argv[e];
        if ("-StartType:Install" === t ? Te = "Install" : "-StartType:AutoRun" === t && (Te = "AutoRun"), 0 === t.indexOf("thunderx://", 0)) {
            let e = `newthunder=${encodeURIComponent(t)}`;
            R.XLStatNS.trackEvent("core_operate", "newthunder_startup", "", 0, 0, 0, 0, e)
        }
    }
    B.quitPromises.add(function () {
        return new Promise(e => {
            G.default.saveMainWndData(), ae.stopListenLocalNet(), e(!0)
        })
    }), B.quitPromises.add(function () {
        return new Promise(e => {
            f.ThunderNewTask.uninit(), e(!0)
        })
    }), B.quitPromises.add(function () {
        return i(this, void 0, void 0, function* () {
            return yield M.ConfigNS.save(), yield F.BHOConfigNS.save(), !0
        })
    }), B.quitPromises.add(function () {
        return new Promise(e => {
            e(!0)
        })
    }), B.quitPromises.add(function () {
        return i(this, void 0, void 0, function* () {
            return q.MessageChannelNS.uninit(), !0
        })
    }), B.quitPromises.add(function () {
        return i(this, void 0, void 0, function* () {
            return K.default.uninit(), !0
        })
    });
    let ve = l.remote.getCurrentWindow();

    function Ce() {
        me.information("onMainWndShow"), fe.EmbeddedBrowserManagerNs.showWebWnd("sign", "auto")
    }

    var Se;
    $.default.init().catch(e => {
        me.warning(e)
    }), ve.on("ready-to-show", () => i(this, void 0, void 0, function* () {
        const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(52));
        j.default.initAccelerator(), g.DownloadKernelManager.init().catch(e => {
            me.warning(e)
        }), P.default.trackWin7NewTrait(), W.ThunderToolsNS.enableDragOpenFile(!0), O.ConfigHandlerNS.init(), U.SettingConfigHelperNS.configBrowserHelper.init().catch(), N.TaskHelperNS.init(), _.DownloadDispatchNS.init(), D.DownloadJammedNS.init(), I.TaskDetailNS.init(), z.FileAssociationNS.asynCheckAndAssociate().catch(), K.default.init().then().catch(), ge.init(), pe.init("http://misc-xl9-ssl.xunlei.com/acc_xdas/dist/#/"), H.ClipBoardNS.init(), re.QueryTaskInfoNS.init(), ne.SubtitleManagerNS.init().catch(e => {
            me.warning(e)
        }), ae.startListenLocalNet(e => {
            if (me.information("startListenLocalNet, result = ", e), "OnInternetConnectSuc" === e || "OnInternetFallLine" === e) {
                let t = 1, n = 1;
                "OnInternetConnectSuc" === e ? (n = 1, t = 2) : (n = 2, t = 1), me.information("返回值：0 初始化状态，1 在线状态， 2 断网状态 onInternetConnectChange:", t, n), T.NativeCallHostModule.nativeCallHost.fireNativeEvent("onInternetConnectChange", t, n)
            } else me.information("返回数据错误！")
        }), setTimeout(() => {
            q.MessageChannelNS.init()
        }, 2e3), setTimeout(() => {
            ae.startAutoUpdateWithUI()
        }, 12e4);
        let t = new d.EventEmitter;
        e.init(), setTimeout(() => {
            try {
                let e = ae.getPeerID(), n = ae.getOSVersion(), i = u.join(__rootDir, "../../Thunder.exe"),
                    a = ae.getFileVersion(i), o = ae.getChannelID();
                p.PluginLoaderNS.pluginLoader.startDownloadPlugins(e, n, "21", a, o, t)
            } catch (e) {
            }
        }, 1e4), t.on(k.NodeEventMesssageNS.eventPluginLoderPluginReady, e => i(this, void 0, void 0, function* () {
            let t = yield p.PluginLoaderNS.pluginLoader.loadPlugin(e);
            "addTest4" === e && t.add("plugin loader")
        })), setTimeout(() => {
            if (se.default().whetherPopUp()) {
                let e = M.ConfigNS.getValue("ThunderFirstInstall", "IsFirstInstall", 0), t = e + 1;
                M.ConfigNS.setValue("ThunderFirstInstall", "IsFirstInstall", t), me.information("迅雷第一次启动标志值:", t, e), se.default().popUpBrowserGuide()
            }
        }, 1e4);
        let a = document.querySelector(".xlx-search").getBoundingClientRect();
        l.ipcRenderer.send(b.ThunderChannelList.channelRMCreateSearchWindow, Math.round(a.left), Math.round(a.top + a.height + 3), Math.round(a.width))
    })), ae.allowSetForegroundWindow(), global.AsyncGetNativeCallModuleObj = function (e) {
        e(s.NativeCallModule)
    }, global.xlNativeCallModule = s.NativeCallModule, m.NaviteFunctionNS.registerNativeFunction(), L.default.init(), f.ThunderNewTask.init(), L.default.setStartArgs(Te), c.default.config.ignoredElements = ["webview"], new c.default({
        components: {App: V.default},
        render: e => e("app")
    }).$mount("#app"), x.LoginHelperNS.loginSDKHelper.init().then(() => {
        p.PluginLoaderNS.pluginLoader.loadPlugin("ThunderXLogin").catch(), x.LoginHelperNS.loginHelper.isAutologin(e => i(this, void 0, void 0, function* () {
            let t = yield E.commonLoginHelper.isAutoPopupLogin();
            me.information("isAutologin:", e, Te, t), !e && ("Install" === Te || t && "AutoRun" !== Te) && setTimeout(() => {
                let e = "other";
                "Install" === Te ? e = "Install" : t && (e = "auto"), x.LoginHelperNS.loginHelper.showLoginDlg(e, !0), t && "AutoRun" !== Te && E.commonLoginHelper.setLoginWndShowConfig()
            }, 1e3)
        }))
    }).catch(e => {
        me.warning(e)
    }), M.ConfigNS.init(u.join(__profilesDir, "config.json")).catch(e => {
        me.warning(e)
    }), F.BHOConfigNS.init().catch(e => {
        me.warning(e)
    }), ie.BindConfigNS.init(), G.default.initMainRendererHelper(), C.DKNaviteFunctionNS.registerNativeFunction(), S.ConfigNaviteFunctionNS.registerNativeFunction(), y.DownloadAndPlayNaviteFunctionNS.registerNativeFunction(), w.SkinNaviteFunctionNS.registerNativeFunction(), X.MessageChannelNaviteFunctionNS.init(), v.LoginNaviteFunctionNS.registerNativeFunction(), le.TipsNaviteFunctionNS.registerNativeFunction(), ue.NotificationNaviteFunctionNS.registerNativeFunction(), oe.AdManageNS.init(), he.defaultNavite.registerDefaultNativeFunction(), l.ipcRenderer.on(b.ThunderChannelList.channelMRGetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                l.ipcRenderer.send(b.ThunderChannelList.channelRMGetConfigValueReject);
                break
            }
            let e = t[0], n = t[1], i = t[2], a = M.ConfigNS.getValue(e, n, i);
            l.ipcRenderer.send(b.ThunderChannelList.channelRMGetConfigValueResolve, a)
        } while (0)
    }), l.ipcRenderer.on(b.ThunderChannelList.channelMRSetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                l.ipcRenderer.send(b.ThunderChannelList.channelRMGetConfigValueReject);
                break
            }
            let e = t[0], n = t[1], i = t[2];
            M.ConfigNS.setValue(e, n, i), M.ConfigNS.save().catch()
        } while (0)
    }), l.ipcRenderer.on(b.ThunderChannelList.channelMRTrayMenuClick, (e, t, n) => {
        me.verbose(e), "-task:newtask" === t ? (n = void 0 === n ? "other" : n, R.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=" + n), me.information("trackEvent", "core_event", "create_task_click", "click_source=" + n), f.ThunderNewTask.createPreNewTaskWindow(null)) : "-task:startall" === t ? A.TaskOperatorNs.startAll() : "-task:pauseall" === t ? A.TaskOperatorNs.pauseAll() : "-task:quitprocess" === t && B.quitPromises.run()
    }), l.ipcRenderer.on(b.ThunderChannelList.channelMRFileCopyResult, (e, t, n) => {
        me.information("channelMRFileCopyResult", t, n), t && ke.showNotify(Y.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, Q.ToastNotifyItemType.GreenNotify, "复制成功", 3e3)
    }), l.remote.ipcMain.on("onShowMessageBox", (e, t) => {
        me.verbose(e), "retryLogin" === t && J.MessageBox.confirm({
            title: "登录失败，请检查网络是否正常",
            type: J.MessageBox.ConfirmType.Warning,
            content: "如果通过代理访问网络，请确认代理已正确设置。<br>如果是办公网络，请确认网络是否限制迅雷登录。",
            okText: "我知道了",
            cancelVisible: !1
        }).catch()
    }), window.getPluginUpdater = te.default.getPluginUpdater, de.default("GetSkinInfo").then(e => {
        me.information("GetSkinInfo", e)
    }).catch(e => {
        me.warning("GetSkinInfo Error", e)
    }), s.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", e => {
        me.information("OnChangeSkin", e)
    }), window.setSkinInfo = (() => {
        de.default("SetSkinInfo", {type: ce.SkinHelperNS.SkinType.Color, colorID: 1}).catch(e => {
            me.warning("SetSkinInfo Error", e)
        })
    }), setTimeout(() => i(this, void 0, void 0, function* () {
        let e = M.ConfigNS.getValue("Install", "PersonalUid", "");
        if (e && "" !== e) try {
            const t = yield n(24);
            t.defaults.adapter = n(22);
            let i = "https://msg-vip-ssl.xunlei.com/individuation/Clinetreport?userid=";
            i += e, i += "&param=active_user", i += "&peer_id=" + ae.getPeerID(), yield t.get(i, {responseType: "arraybuffer"})
        } catch (e) {
            me.warning(e)
        }
    }), 5e3), setTimeout(() => {
        fe.EmbeddedBrowserManagerNs.showWebWnd("sign", "auto"), null !== (Se = l.remote.getCurrentWindow()) && void 0 !== Se && (Se.on("show", Ce), Se.on("restore", Ce), Se.on("maximize", Ce), Se.on("unmaximize", Ce))
    }, 15e3), l.ipcRenderer.on(b.ThunderChannelList.channelMRShowOrHideWindow, (e, t, n) => {
        "show" === t ? M.ConfigNS.setValue("Consumption", "ShowMainWindowTime", n) : M.ConfigNS.setValue("Consumption", "HideMainWindowTime", n)
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(774), a = n(775), o = n(30);
    n(43);
    const r = n(241);
    n(776), n(1168);
    const s = n(242), l = n(562);
    o.default.directive("visibility", i.default), o.default.directive("opacity", a.default), o.default.use(r.default), o.default.use(s), o.default.use(l.default)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        bind(e, {value: t}, n) {
            e.__vOriginalVisibility = e.style.visiblity, e.style.visibility = t ? "visible" : "hidden"
        }, update(e, {value: t, oldValue: n}, i) {
            t !== n && (e.style.visibility = t ? "visible" : "hidden")
        }, unbind(e, t, n, i, a) {
            a || (e.style.visiblity = e.__vOriginalVisibility)
        }
    };
    t.default = i
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        bind(e, {value: t}, n) {
            e.__vOriginalOpacity = e.style.opacity, e.__vOriginalPointerEvents = e.style.pointerEvents, e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none"
        }, update(e, {value: t, oldValue: n}, i) {
            t !== n && (e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none")
        }, unbind(e, t, n, i, a) {
            a || (e.style.opacity = e.__vOriginalOpacity, e.style.pointerEvents = e.__vOriginalPointerEvents)
        }
    };
    t.default = i
}, function (e, t) {
    !function (e) {
        var t,
            n = '<svg><symbol id="td-icon-svg-file" viewBox="0 0 1204 1024"><path d="M180.705882 1024c-102.4 0-180.705882-78.305882-180.705882-180.705882V180.705882c0-102.4 78.305882-180.705882 180.705882-180.705882h240.941177c102.4 0 180.705882 78.305882 180.705882 180.705882h421.647059c102.4 0 180.705882 78.305882 180.705882 180.705883v481.882353c0 102.4-78.305882 180.705882-180.705882 180.705882H180.705882z" fill="#FFC25A" ></path><path d="M301.176471 361.411765h602.352941c66.258824 0 120.470588 54.211765 120.470588 120.470588v361.411765c0 66.258824-54.211765 120.470588-120.470588 120.470588H301.176471c-66.258824 0-120.470588-54.211765-120.470589-120.470588V481.882353c0-66.258824 54.211765-120.470588 120.470589-120.470588z" fill="#FFFFFF" ></path><path d="M180.705882 542.117647h843.294118c102.4 0 180.705882 78.305882 180.705882 180.705882v120.470589c0 102.4-78.305882 180.705882-180.705882 180.705882H180.705882c-102.4 0-180.705882-78.305882-180.705882-180.705882v-120.470589c0-102.4 78.305882-180.705882 180.705882-180.705882z" fill="#FFD68F" ></path></symbol></svg>',
            i = function (e, t) {
                t.firstChild ? function (e, t) {
                    t.parentNode.insertBefore(e, t)
                }(e, t.firstChild) : t.appendChild(e)
            };
        if ((t = document.getElementsByTagName("script"))[t.length - 1].getAttribute("data-injectcss") && !e.__iconfont__svg__cssinject__) {
            e.__iconfont__svg__cssinject__ = !0;
            try {
                document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")
            } catch (e) {
                console && console.log(e)
            }
        }
        !function (t) {
            if (document.addEventListener) if (~["complete", "loaded", "interactive"].indexOf(document.readyState)) setTimeout(t, 0); else {
                var n = function () {
                    document.removeEventListener("DOMContentLoaded", n, !1), t()
                };
                document.addEventListener("DOMContentLoaded", n, !1)
            } else document.attachEvent && function (e, t) {
                var n = e.document, i = !1, a = function () {
                    i || (i = !0, t())
                }, o = function () {
                    try {
                        n.documentElement.doScroll("left")
                    } catch (e) {
                        return void setTimeout(o, 50)
                    }
                    a()
                };
                o(), n.onreadystatechange = function () {
                    "complete" == n.readyState && (n.onreadystatechange = null, a())
                }
            }(e, t)
        }(function () {
            var e, t;
            (e = document.createElement("div")).innerHTML = n, n = null, (t = e.getElementsByTagName("svg")[0]) && (t.setAttribute("aria-hidden", "true"), t.style.position = "absolute", t.style.width = 0, t.style.height = 0, t.style.overflow = "hidden", i(t, document.body))
        })
    }(window)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(10), s = n(8), l = n(83), u = n(778), d = n(780), c = n(782), h = n(783),
        f = n(243), g = n(34), p = n(84), k = n(90), m = n(717), T = n(132),
        v = o.default.getLogger("DownloadKernel.Task"), C = g.DownloadKernelEventManager.getEventManager(),
        S = k.DownloadKernelCategoryManager.getCategoryManager(),
        y = [".asf", ".mpg", ".rmvb", ".rm", ".wmv", ".avi", ".mp4", ".mpeg", ".mkv", ".mov", ".ts", ".flv", ".3gp"];
    var w;
    !function (e) {
        e[e.None = 0] = "None", e[e.Create = 1] = "Create", e[e.StartPending = 2] = "StartPending", e[e.Downloading = 3] = "Downloading", e[e.StopPending = 4] = "StopPending", e[e.Pause = 5] = "Pause", e[e.CompletePending = 6] = "CompletePending", e[e.Complete = 7] = "Complete", e[e.Error = 8] = "Error", e[e.ErrorStopPending = 9] = "ErrorStopPending"
    }(w || (w = {}));
    t.Task = class {
        constructor() {
            this.taskId = 0, this.virtualTaskId = 0, this.isBackground = !1, this.taskType = s.DownloadKernel.TaskType.Unkown, this.preStatus = s.DownloadKernel.TaskStatus.Stopped, this.taskStatus = s.DownloadKernel.TaskStatus.Stopped, this.taskExtra = null, this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = [], this.startTime = 0, this.downloadingPeriod = 0, this.dispatchStrategy = void 0, this.freeFromSchedule = void 0, this.originOnlyStrategy = void 0, this.originThreadCount = void 0, this.vipCert = void 0, this.taskStatusChangedReason = s.DownloadKernel.TaskStopReason.Unknown, this.batchSetTaskAttribute = !1, this.batchDetailChangedFlags = s.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.attribute = new Map;
            for (let e = s.DownloadKernel.TaskAttribute.NumberStrart; e < s.DownloadKernel.TaskAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = s.DownloadKernel.TaskAttribute.BooleanStart; e < s.DownloadKernel.TaskAttribute.BooleanEnd; ++e) this.attribute.set(e, !1);
            for (let e = s.DownloadKernel.TaskAttribute.StringStart; e < s.DownloadKernel.TaskAttribute.StringEnd; ++e) this.attribute.set(e, "");
            for (let e = s.DownloadKernel.TaskAttribute.ObjectStart; e < s.DownloadKernel.TaskAttribute.ObjectEnd; ++e) this.attribute.set(e, null);
            this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, -1), this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryViewId, s.DownloadKernel.CategroyViewID.Unkown), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, s.DownloadKernel.TaskType.Unkown), this.attribute.set(s.DownloadKernel.TaskAttribute.ErrorCode, s.DownloadKernel.TaskError.Unkown), this.attribute.set(s.DownloadKernel.TaskAttribute.NameType, 1), this.attribute.set(s.DownloadKernel.TaskAttribute.CreateTime, (new Date).getTime()), this.channelInfo = {
                originSize: 0,
                p2pSize: 0,
                p2sSize: 0,
                offlineSize: 0,
                dcdnSize: 0,
                dcdnStatus: s.DownloadKernel.DcdnStatusCode.Unkown
            }, this.historyChannelInfo = {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0}
        }

        getId() {
            return this.taskId
        }

        getType() {
            return this.taskType
        }

        reName(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (!e || "" === e) break;
                    if (this.taskStatus !== s.DownloadKernel.TaskStatus.Succeeded && this.taskStatus !== s.DownloadKernel.TaskStatus.Seeding) break;
                    let t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                    if (t === e) break;
                    if (!(yield T.SingleBtTaskNS.isSingleBtTask(this)) && this.taskType !== s.DownloadKernel.TaskType.Group) {
                        let n = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath), i = a.join(n, t),
                            o = a.join(n, e), l = yield r.FileSystemAWNS.existsAW(i);
                        l && (o = p.Common.getMaxFilePath(o), yield r.FileSystemAWNS.renameAW(i, o), (l = yield r.FileSystemAWNS.existsAW(o)) && (e = a.basename(o)))
                    }
                    this.setTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskRenamed)
                } while (0)
            })
        }

        setUserRead(e) {
            0 !== e && (e = 1), e !== this.attribute.get(s.DownloadKernel.TaskAttribute.UserRead) && (this.attribute.set(s.DownloadKernel.TaskAttribute.UserRead, e), this.saveTaskInfo(this.taskId, f.StatementType.SetTaskUserRead, f.ValueType.ValueInt, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskUserRead))
        }

        setDescription(e) {
            let t = this.attribute.get(s.DownloadKernel.TaskAttribute.Description);
            e && t !== e && (this.attribute.set(s.DownloadKernel.TaskAttribute.Description, e), this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDescription, f.ValueType.ValueString, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskDescriptionChanged))
        }

        setOriginThreadCount(e) {
            this.taskType === s.DownloadKernel.TaskType.P2sp && this.getExtraObject().setOriginThreadCount(e)
        }

        setOriginOnlyStrategy(e) {
            if (this.taskType === s.DownloadKernel.TaskType.P2sp) {
                let t = this.getExtraObject();
                e ? (t.setUseOriginOnly(1), this.originOnlyStrategy = 1) : (t.setUseOriginOnly(0), this.originOnlyStrategy = 0)
            }
        }

        getOriginOnlyStrategy() {
            let e = !1;
            return this.taskType === s.DownloadKernel.TaskType.P2sp && 1 === this.getExtraObject().getUseOriginOnly() && (e = !0), e
        }

        setDispatchStrategy(e) {
            this.dispatchStrategy = e
        }

        setDownloadStrategy(e) {
            l.ThunderKernel.setDownloadStrategy(this.virtualTaskId, e)
        }

        setFreeFromSchedule(e) {
            this.freeFromSchedule !== e && (this.freeFromSchedule = e)
        }

        setOpenOnComplete(e) {
            this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, e), this.saveTaskInfo(this.taskId, f.StatementType.SetTaskOpenOnCompelete, f.ValueType.ValueInt, e)
        }

        setTaskMovingState(e) {
            this.attribute.get(s.DownloadKernel.TaskAttribute.Moving) !== e && (this.attribute.set(s.DownloadKernel.TaskAttribute.Moving, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovingStateChange))
        }

        getExtraObject() {
            return this.taskExtra
        }

        getTaskStatus() {
            return this.taskStatus
        }

        getTaskPreStatus() {
            return this.preStatus
        }

        getDownloadSpeed() {
            return this.speed
        }

        getVipSpeed() {
            let e = this.vipSpeed;
            return this.vipSpeed > this.speed && (e = this.speed), e
        }

        getTaskAttribute(e) {
            return this.attribute.get(e)
        }

        getTaskChannelInfo() {
            let e = {};
            return e.originSize = this.historyChannelInfo.originSize + this.channelInfo.originSize, e.p2pSize = this.historyChannelInfo.p2pSize + this.channelInfo.p2pSize, e.p2sSize = this.historyChannelInfo.p2sSize + this.channelInfo.p2sSize, e.offlineSize = this.historyChannelInfo.offlineSize + this.channelInfo.offlineSize, e.dcdnSize = this.historyChannelInfo.dcdnSize + this.channelInfo.dcdnSize, e.dcdnStatus = this.channelInfo.dcdnStatus, e.dcdnResult = this.channelInfo.dcdnResult, e.enableDcdn = this.channelInfo.enableDcdn, e
        }

        getTaskBaseInfo() {
            let e = {};
            return e.taskId = this.taskId, e.taskType = this.taskType, e.downloadSpeed = this.speed, this.vipSpeed > this.speed ? e.vipSpeed = this.speed : e.vipSpeed = this.vipSpeed, e.taskStatus = this.getTaskStatus(), e.isMoving = this.attribute.get(s.DownloadKernel.TaskAttribute.Moving), e.savePath = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath), e.createTime = this.attribute.get(s.DownloadKernel.TaskAttribute.CreateTime), e.url = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = this.attribute.get(s.DownloadKernel.TaskAttribute.RefUrl), e.cid = this.attribute.get(s.DownloadKernel.TaskAttribute.Cid), e.gcid = this.attribute.get(s.DownloadKernel.TaskAttribute.Gcid), e.taskName = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), e.description = this.attribute.get(s.DownloadKernel.TaskAttribute.Description), e.nameType = this.attribute.get(s.DownloadKernel.TaskAttribute.NameType), e.categoryId = this.attribute.get(s.DownloadKernel.TaskAttribute.CategoryId), e.userRead = this.attribute.get(s.DownloadKernel.TaskAttribute.UserRead), e.openOnComplete = this.attribute.get(s.DownloadKernel.TaskAttribute.OpenOnComplete), e.ownerProduct = this.attribute.get(s.DownloadKernel.TaskAttribute.OwnerProduct), e.downloadingPeriod = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadingPeriod), e.errorCode = this.attribute.get(s.DownloadKernel.TaskAttribute.ErrorCode), e.groupTaskId = this.attribute.get(s.DownloadKernel.TaskAttribute.GroupTaskId), e.downloadSubTask = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadSubTask), e.productInfo = this.attribute.get(s.DownloadKernel.TaskAttribute.ProductInfo), e.origin = this.attribute.get(s.DownloadKernel.TaskAttribute.Origin), e.fileCreated = this.attribute.get(s.DownloadKernel.TaskAttribute.FileCreated), e.recycleTime = this.attribute.get(s.DownloadKernel.TaskAttribute.RecycleTime), e.forbidden = this.attribute.get(s.DownloadKernel.TaskAttribute.Forbidden), e.fileSize = this.attribute.get(s.DownloadKernel.TaskAttribute.FileSize), e.receiveSize = this.attribute.get(s.DownloadKernel.TaskAttribute.ReceivedSize), e.downloadSize = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadSize), e.srcTotal = this.attribute.get(s.DownloadKernel.TaskAttribute.SrcTotal), e.srcUsing = this.attribute.get(s.DownloadKernel.TaskAttribute.SrcUsing), e.completionTime = this.attribute.get(s.DownloadKernel.TaskAttribute.CompletionTime), e.channelInfo = this.getTaskChannelInfo(), e
        }

        isSupportPlay() {
            let e = !1;
            if (this.taskStatus === s.DownloadKernel.TaskStatus.Failed) {
                let t = this.attribute.get(s.DownloadKernel.TaskAttribute.ErrorCode);
                e = !(t && t > 700) && this.isVideoFile()
            } else e = this.isVideoFile();
            return e
        }

        isFreeFromSchedule() {
            return this.freeFromSchedule
        }

        getPlayUrl(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.virtualTaskId && this.virtualTaskId > 0 ? l.ThunderKernel.queryPlayInfo(this.virtualTaskId, e, (n, i) => {
                        e === n && t(i)
                    }) : t(void 0)
                })
            })
        }

        enableDcdnWithVipCert(e) {
            if (this.vipCert = e, this.taskType === s.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject(), n = t.getSubTaskCount();
                for (let i = 0; i < n; ++i) {
                    let n = t.getSubTaskByIndex(i);
                    n && n.enableDcdnWithVipCert(e)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && l.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, -1, e)
        }

        updateDcdnWithVipCert(e) {
            if (this.vipCert = e, this.taskType === s.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject(), n = t.getSubTaskCount();
                for (let i = 0; i < n; ++i) {
                    let n = t.getSubTaskByIndex(i);
                    n && n.updateDcdnWithVipCert(e)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && l.ThunderKernel.updateDcdnWithVipCert(this.virtualTaskId, -1, e)
        }

        disableDcdnWithVipCert() {
            if (this.vipCert = void 0, this.taskType === s.DownloadKernel.TaskType.Group) {
                let e = this.getExtraObject(), t = e.getSubTaskCount();
                for (let n = 0; n < t; ++n) {
                    let t = e.getSubTaskByIndex(n);
                    t && t.disableDcdnWithVipCert()
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && l.ThunderKernel.disableDcdnWithVipCert(this.virtualTaskId, -1)
        }

        start(e) {
            v.information("start this.taskStatus:", this.taskStatus, ", this.taskType:", this.taskType);
            let t = !1;
            return (this.taskStatus === s.DownloadKernel.TaskStatus.Stopped || this.taskStatus === s.DownloadKernel.TaskStatus.StartWaiting || this.taskStatus === s.DownloadKernel.TaskStatus.Failed || this.taskStatus === s.DownloadKernel.TaskStatus.Unkown || e) && (this.taskType === s.DownloadKernel.TaskType.Group ? (t = this.getExtraObject().start(e)) && (t = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StartPending)) : (this.createDownloadSdkTask().catch(), t = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StartPending))), e && (t = !0), t
        }

        startWaiting() {
            v.information("startWaiting this.taskStatus:", this.taskStatus);
            let e = !1;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== s.DownloadKernel.TaskStatus.Failed && this.taskStatus !== s.DownloadKernel.TaskStatus.Unkown || (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StartWaiting)), e
        }

        stop() {
            v.information("stop");
            let e = !1;
            if (this.taskStatus === s.DownloadKernel.TaskStatus.StartWaiting) e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Stopped); else if (this.taskType === s.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject();
                if (e = t.stop()) {
                    let n = t.getTaskStatus();
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding && n !== s.DownloadKernel.TaskStatus.Stopped && (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StopPending))
                }
            } else this.taskStatus !== s.DownloadKernel.TaskStatus.Succeeded && this.taskStatus !== s.DownloadKernel.TaskStatus.Seeding && this.taskStatus !== s.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== s.DownloadKernel.TaskStatus.Failed && (this.virtualTaskId && this.virtualTaskId > 0 ? (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StopPending), l.ThunderKernel.stopTask(this.virtualTaskId)) : e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Stopped));
            return e
        }

        delete(e) {
            return i(this, void 0, void 0, function* () {
                v.information("delete");
                let t = !1;
                return this.taskType === s.DownloadKernel.TaskType.Group ? (t = yield this.getExtraObject().delete(e), this.deleteStorageTask()) : (t = !0, this.deleteStorageTask(), e && (t = yield this.destroy())), t
            })
        }

        commit() {
        }

        updateTaskStatus(e) {
            let t = !1;
            return this.taskStatus !== e && (this.taskStatus === s.DownloadKernel.TaskStatus.StartPending ? e === s.DownloadKernel.TaskStatus.Stopped || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : this.taskStatus === s.DownloadKernel.TaskStatus.StopPending ? e === s.DownloadKernel.TaskStatus.Started || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : (this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding) && e !== s.DownloadKernel.TaskStatus.Stopped && e !== s.DownloadKernel.TaskStatus.DestroyPending || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0)), e !== s.DownloadKernel.TaskStatus.Started && (this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = []), t && (this.startTime = 0, this.downloadingPeriod = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadingPeriod), this.taskStatus !== s.DownloadKernel.TaskStatus.DestroyPending && this.saveTaskInfo(this.taskId, f.StatementType.SetTaskStatus, f.ValueType.ValueInt, this.taskStatus)), t
        }

        createP2spTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.P2sp, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, n.url), this.attribute.set(s.DownloadKernel.TaskAttribute.RefUrl, n.refUrl), this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, n.origin), this.attribute.set(s.DownloadKernel.TaskAttribute.Cookie, n.cookie), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(s.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === n.downloadSubTask && this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSubTask, 1), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            return t.fileSize && this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, t.fileSize), t.gcid && this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new u.P2spTask(this, !e, n.useOriginResourceOnly, n.originResourceThreadCount), this.taskId
        }

        createBtTask(e, t, n, o) {
            return i(this, void 0, void 0, function* () {
                if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Bt, t.taskName || (t.taskName = n.displayName), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), o) {
                    let e = S.getCurrentPrivateCategory();
                    e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
                }
                let i = a.join(__profilesDir, "Torrents"), u = yield r.FileSystemAWNS.existsAW(i);
                u || (yield r.FileSystemAWNS.mkdirsAW(i));
                let c = n.infoId + ".torrent", h = a.join(i, c);
                yield r.FileSystemAWNS.copyFileAW(n.seedFile, h), (u = yield r.FileSystemAWNS.existsAW(h)) && (n.seedFile = h), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new d.BtTask(this, !e, n);
                let f = this.getExtraObject().getFileSize();
                this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, f), this.saveAttribute(s.DownloadKernel.TaskAttribute.FileSize, f)
            })
        }

        createEmuleTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Emule, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, n.url), this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, n.origin), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(s.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === n.downloadSubTask && this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSubTask, 1), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            if (t.fileSize) this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, t.fileSize); else {
                let e = p.Common.parseEd2kUrl(n.url);
                e && e.fileSize && this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, e.fileSize)
            }
            return t.gcid && this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new c.EmuleTask(this, !e), this.taskId
        }

        createGroupTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Group, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            let a = 0;
            for (let e = 0; e < n.subTaskList.length; ++e) {
                let t = n.subTaskList[e].taskBaseInfo.fileSize;
                t && (a += t)
            }
            return a && this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, a), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new h.GroupTask(this, !e), this.taskId
        }

        createMagnetTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Magnet, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, n.url), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, n.torrentFilePath), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            return e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskId
        }

        loadStorageP2spTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new u.P2spTask(this, !1, 0, 5)
        }

        loadStorageBtTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new d.BtTask(this, !1, null), this.taskExtra.loadBtTask(e => {
                if (e) {
                    let t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                    void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                }
                C.fireTaskEvent(s.DownloadKernel.TaskEventType.BtSubFileLoaded, this.taskId, []), C.fireTaskEvent(s.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [])
            })
        }

        loadStorageBtTaskAW(e) {
            return new Promise(t => i(this, void 0, void 0, function* () {
                this.setTaskBaseInfo(e), this.taskExtra = new d.BtTask(this, !1, null), this.getExtraObject().loadBtTask(e => {
                    if (e) {
                        let t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                    }
                    C.fireTaskEvent(s.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, []), t()
                })
            }))
        }

        loadStorageEmuleTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new c.EmuleTask(this, !1)
        }

        loadStorageGroupTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new h.GroupTask(this, !1)
        }

        updateTaskSavePath(e) {
            this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath, e)
        }

        updateTaskRelativePath(e) {
            this.setTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath, e)
        }

        updateTaskName(e) {
            this.setTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName, e)
        }

        updateDownloadSubTask(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask, e)
        }

        queryTaskInfo(e, t, n) {
            let i = !1;
            switch (this.taskType) {
                case s.DownloadKernel.TaskType.P2sp:
                    i = this.queryP2spTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Bt:
                    i = this.queryBtTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Emule:
                    i = this.queryEmuleTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Group:
                    i = this.queryGroupTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Magnet:
                    i = this.queryMagnetTaskInfo(e, t, n)
            }
            return i
        }

        updateTaskInfo(e, t, n) {
            let i = 0, a = s.DownloadKernel.TaskDetailChangedFlags.UnKnown;
            if (this.attribute.get(s.DownloadKernel.TaskAttribute.ErrorCode) === s.DownloadKernel.TaskError.DownloadSDKCrash) return i;
            if (void 0 !== e.finalName && "" !== e.finalName && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName, e.finalName) && (a |= s.DownloadKernel.TaskDetailChangedFlags.TaskName), a |= this.updateDownloadSpeed(e.downloadSize), e.downloadSize) {
                let t = this.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
                this.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize) === e.fileSize && t > e.downloadSize || this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize) && (a |= s.DownloadKernel.TaskDetailChangedFlags.DownloadSize)
            }
            e.receivedSize && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ReceivedSize, e.receivedSize) && (a |= s.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), e.fileSize && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize, e.fileSize) && (a |= s.DownloadKernel.TaskDetailChangedFlags.FileSize), this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode, e.taskError) && (a |= s.DownloadKernel.TaskDetailChangedFlags.ErrorCode), e.cid && "" !== e.cid && this.updateCid(e.cid) && (a |= s.DownloadKernel.TaskDetailChangedFlags.Cid), e.gcid && "" !== e.gcid && this.updateGcid(e.gcid) && (a |= s.DownloadKernel.TaskDetailChangedFlags.Gcid), e.srcTotal && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal, e.srcTotal) && (a |= s.DownloadKernel.TaskDetailChangedFlags.SrcTotal), e.srcUsing && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing, e.srcUsing) && (a |= s.DownloadKernel.TaskDetailChangedFlags.SrcUsing), e.taskStatus !== w.Error || e.taskError !== s.DownloadKernel.TaskError.FileCreate ? this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileCreated, 1) : this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileCreated, 0);
            let o = this.changeToDownloadKernelTaskStatus(e.taskStatus), r = this.updateTaskStatus(o),
                l = e.channelInfo;
            return l && this.updateChannelInfo(l) && (a |= s.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), 0 === e.fileSize && (a = s.DownloadKernel.TaskDetailChangedFlags.UnKnown), r && (i |= 1, t(this)), a !== s.DownloadKernel.TaskDetailChangedFlags.UnKnown && (i |= 2, n(this, a)), i
        }

        updateCid(e) {
            let t = !1, n = this.attribute.get(s.DownloadKernel.TaskAttribute.Cid);
            return n && "" !== n || (n !== e && (this.saveAttribute(s.DownloadKernel.TaskAttribute.Cid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, e)), t
        }

        updateGcid(e) {
            let t = !1, n = this.attribute.get(s.DownloadKernel.TaskAttribute.Gcid);
            return n && "" !== n || (n !== e && (this.saveAttribute(s.DownloadKernel.TaskAttribute.Gcid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, e)), t
        }

        onFinish() {
            let e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Succeeded);
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.CompletionTime, (new Date).getTime()), this.virtualTaskId > 0 && (l.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onStop() {
            let e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Stopped);
            return this.virtualTaskId > 0 && (l.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onFail() {
            let e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Failed);
            return this.virtualTaskId > 0 && (l.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        moveToRecycle() {
            let e = (new Date).getTime();
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime, e)
        }

        recover() {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime, 0)
        }

        destroy() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                switch (this.taskType) {
                    case s.DownloadKernel.TaskType.P2sp:
                        e = yield this.deleteP2spTaskFile();
                        break;
                    case s.DownloadKernel.TaskType.Bt:
                        e = yield this.deleteBtTaskFile();
                        break;
                    case s.DownloadKernel.TaskType.Emule:
                        e = yield this.deleteEmuleTaskFile();
                        break;
                    case s.DownloadKernel.TaskType.Group:
                        e = yield this.deleteGroupTaskFile()
                }
                return e
            })
        }

        setSavePath(e) {
            this.taskStatus !== s.DownloadKernel.TaskStatus.StartPending && this.taskStatus !== s.DownloadKernel.TaskStatus.Started && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath, e)
        }

        setCategoryViewId(e) {
            this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryViewId, e)
        }

        getIsPrivate() {
            let e = this.attribute.get(s.DownloadKernel.TaskAttribute.CategoryId);
            return void 0 !== e && e > -1
        }

        getUserName() {
            let e = this.attribute.get(s.DownloadKernel.TaskAttribute.CategoryId);
            if (void 0 !== e && e > -1) {
                let t = S.getCategoryFromId(e);
                if (t) return t.getUserName()
            }
            return ""
        }

        setCategoryId(e) {
            this.isBackground || (this.setTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId, e), l.ThunderKernel.setCategoryId(e, this.taskId))
        }

        getTaskName() {
            return this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName)
        }

        getSavePath() {
            return this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath)
        }

        fireTaskDetailChanged(e) {
            let t = this.attribute.get(s.DownloadKernel.TaskAttribute.GroupTaskId);
            if (t > 0) {
                let e = new Map;
                e.set(t, [this]), C.fireTaskEvent(s.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            } else this.fireTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, e)
        }

        getVirtualTaskId() {
            return this.virtualTaskId
        }

        setStopReason(e) {
            this.taskStatusChangedReason = e
        }

        getStopReason() {
            return this.taskStatusChangedReason
        }

        internalSetTaskSpeed(e, t) {
            let n = !1;
            return e = Math.round(e), t = Math.round(t), this.speed !== e && (n = !0, this.speed = e), this.vipSpeed !== t && (n = !0, this.vipSpeed = t), n
        }

        internalSetFileSize(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize, e)
        }

        internalSetGcid(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid, e)
        }

        internalSetDownloadingPeriod(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod, e)
        }

        internalSetDownloadSize(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize, e)
        }

        internalSetReceivedSize(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ReceivedSize, e)
        }

        internalSetSrcUsing(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing, e)
        }

        internalSetSrcTotal(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal, e)
        }

        internalSetFileIndex(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileIndex, e)
        }

        internalSetTaskChannelInfo(e) {
            return (this.channelInfo.originSize !== e.originSize || this.channelInfo.p2sSize !== e.p2sSize || this.channelInfo.p2pSize !== e.p2pSize || this.channelInfo.offlineSize !== e.offlineSize || this.channelInfo.dcdnSize !== e.dcdnSize || this.channelInfo.dcdnStatus !== e.dcdnStatus) && (this.channelInfo = e, l.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize), !0)
        }

        setFileSize(e) {
            let t = this.internalSetFileSize(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.FileSize : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.FileSize)), t
        }

        setGcid(e) {
            let t = this.internalSetGcid(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.Gcid : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.Gcid)), t
        }

        setDownloadingPeriod(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)), t
        }

        setDownloadSize(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.DownloadSize : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.DownloadSize)), t
        }

        setReceivedSize(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ReceivedSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.ReceivedSize : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.ReceivedSize)), t
        }

        setSrcUsing(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.SrcUsing : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.SrcUsing)), t
        }

        setSrcTotal(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.SrcTotal : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.SrcTotal)), t
        }

        beginBatchSetTaskAttribute() {
            v.information("beginBatchSetTaskAttribute taskId:", this.taskId), this.batchSetTaskAttribute = !0
        }

        commitBatchSetTaskAttribute() {
            if (this.batchSetTaskAttribute && (this.batchSetTaskAttribute = !1, v.information("commitBatchSetTaskAttribute taskId:", this.taskId), this.batchDetailChangedFlags !== s.DownloadKernel.TaskDetailChangedFlags.UnKnown)) {
                let e = this.batchDetailChangedFlags;
                this.batchDetailChangedFlags = s.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.fireTaskDetailChanged(e)
            }
        }

        createDownloadSdkTask() {
            return i(this, void 0, void 0, function* () {
                switch (this.taskType) {
                    case s.DownloadKernel.TaskType.P2sp: {
                        let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(s.DownloadKernel.TaskAttribute.RefUrl),
                            n = this.attribute.get(s.DownloadKernel.TaskAttribute.Cookie),
                            i = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                            a = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        this.virtualTaskId = l.ThunderKernel.createP2spTask(e, t, n, i, a), v.information("createP2spTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", refUrl: ", t, ", cookie:", n, ", savePath:", i, ", fileName:", a)
                    }
                        break;
                    case s.DownloadKernel.TaskType.Bt: {
                        let e = this.getExtraObject(), t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                            n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        (yield T.SingleBtTaskNS.isSingleBtTask(this)) || (t = a.join(t, n)), e.isBtFileLoadEnd() || (yield this.loadStorageBtTaskAW(this.getTaskBaseInfo()));
                        let i = e.getSeedFilePath(), o = e.getDownloadFile();
                        this.virtualTaskId = l.ThunderKernel.createBtTask(i, t, o), v.information("createBtTask virtualTaskId:", this.virtualTaskId, ", torrentFilePath:", i, ", savePath: ", t, ", downloadIndexs:", o)
                    }
                        break;
                    case s.DownloadKernel.TaskType.Emule: {
                        let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                            n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        this.virtualTaskId = l.ThunderKernel.createEmuleTask(e, t, n), v.information("createEmuleTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", savePath: ", t, ", fileName:", n)
                    }
                        break;
                    case s.DownloadKernel.TaskType.Magnet: {
                        let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath);
                        this.virtualTaskId = l.ThunderKernel.createMagnetTask(e, t), v.information("createMagnetTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", savePath: ", t)
                    }
                }
                return v.information("createDownloadSdkTask virtualTaskId:", this.virtualTaskId), this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId), this.setStartInfo(), this.virtualTaskId
            })
        }

        setStatusAndErrorCode(e, t) {
            this.taskStatus = e, this.attribute.set(s.DownloadKernel.TaskAttribute.ErrorCode, t)
        }

        setStartInfo() {
            if (this.virtualTaskId && this.virtualTaskId > 0) {
                if (this.taskType === s.DownloadKernel.TaskType.P2sp) {
                    let e = this.getExtraObject(), t = e.getThreadCount();
                    void 0 !== this.originOnlyStrategy && e.setUseOriginOnly(this.originOnlyStrategy), 1 === this.originOnlyStrategy ? l.ThunderKernel.setTaskStrategy(this.virtualTaskId, 1) : void 0 !== this.dispatchStrategy && l.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), void 0 !== this.originThreadCount ? l.ThunderKernel.setTaskThreadCount(this.virtualTaskId, this.originThreadCount) : l.ThunderKernel.setTaskThreadCount(this.virtualTaskId, t)
                } else if (void 0 !== this.dispatchStrategy && l.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), this.taskType === s.DownloadKernel.TaskType.Bt) {
                    let e = m.BTExtraTrackNS.getExtraTracks();
                    e.length > 0 && l.ThunderKernel.setBTExtraTrackers(this.virtualTaskId, e)
                }
                this.setTaskExtInfoBeforeStart(), void 0 !== this.vipCert && l.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, -1, this.vipCert), this.taskExtra && this.taskExtra.setTaskPriorityLevel(-1), l.ThunderKernel.startTask(this.virtualTaskId)
            } else v.error("setStartInfo failed! virtualTaskId:", this.virtualTaskId)
        }

        queryP2spTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryTaskInfo(this.virtualTaskId, i => {
                null !== i && this.updateTaskInfo(i, e, t), n()
            })), i
        }

        queryBtTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryBtTaskInfo(this.virtualTaskId, i => {
                null !== i && (this.updateTaskInfo(i, e, t), this.getExtraObject().updateSubFileInfo(i.fileLists)), n()
            })), i
        }

        queryEmuleTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryTaskInfo(this.virtualTaskId, i => {
                null !== i && this.updateTaskInfo(i, e, t), n()
            })), i
        }

        queryGroupTaskInfo(e, t, n) {
            let i = !1;
            return this.taskExtra && (i = this.getExtraObject().querySubTaskInfo(e, t, n)), i
        }

        queryMagnetTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryTaskInfo(this.virtualTaskId, i => {
                null !== i && this.updateTaskInfo(i, e, t), n()
            })), i
        }

        setTaskBaseInfo(e) {
            e && (this.taskId = e.taskId, this.taskType = e.taskType, this.taskStatus = e.taskStatus, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, e.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, e.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.FileCreated, e.fileCreated), this.attribute.set(s.DownloadKernel.TaskAttribute.RecycleTime, e.recycleTime), this.attribute.set(s.DownloadKernel.TaskAttribute.Forbidden, e.forbidden), this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, e.fileSize), this.attribute.set(s.DownloadKernel.TaskAttribute.ReceivedSize, e.receiveSize), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize), this.attribute.set(s.DownloadKernel.TaskAttribute.CreateTime, e.createTime), this.attribute.set(s.DownloadKernel.TaskAttribute.CompletionTime, e.completionTime), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadingPeriod, e.downloadingPeriod), this.attribute.set(s.DownloadKernel.TaskAttribute.ErrorCode, e.errorCode), this.attribute.set(s.DownloadKernel.TaskAttribute.NameType, e.nameType), this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.categoryId), this.attribute.set(s.DownloadKernel.TaskAttribute.UserRead, e.userRead), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, e.openOnComplete), this.attribute.set(s.DownloadKernel.TaskAttribute.OwnerProduct, e.ownerProduct), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSubTask, e.downloadSubTask), this.attribute.set(s.DownloadKernel.TaskAttribute.GroupTaskId, e.groupTaskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, e.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, e.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, e.url), this.attribute.set(s.DownloadKernel.TaskAttribute.RefUrl, e.refUrl), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, e.description), this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, e.productInfo), this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, e.origin), this.attribute.set(s.DownloadKernel.TaskAttribute.UserData, e.userData), "0000000000000000000000000000000000000000" === e.cid ? this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, e.cid), "0000000000000000000000000000000000000000" === e.gcid ? this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, e.gcid), e.channelInfo && (this.historyChannelInfo = e.channelInfo))
        }

        setTaskAttribute(e, t) {
            let n = !1;
            return this.getTaskAttribute(e) !== t && void 0 !== t && (this.attribute.set(e, t), n = !0, this.saveAttribute(e, t)), n
        }

        updateDownloadSpeed(e) {
            let t = s.DownloadKernel.TaskDetailChangedFlags.UnKnown;
            if (e) {
                let n = e - this.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
                (0 === e || n < 0) && (n = 0);
                let i = this.calculateDownloadSpeed(n);
                (i = Math.round(i)) !== this.speed && (this.speed = i, t |= s.DownloadKernel.TaskDetailChangedFlags.TaskSpeed)
            }
            if (this.taskStatus === s.DownloadKernel.TaskStatus.Started) if (0 === this.startTime) this.startTime = (new Date).getTime(); else {
                let e = ((new Date).getTime() - this.startTime) / 1e3, n = this.downloadingPeriod + Math.round(e);
                this.saveAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod, n), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadingPeriod, n), this.attribute.get(s.DownloadKernel.TaskAttribute.GroupTaskId) < 1 && (t |= s.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            }
            return t
        }

        saveAttribute(e, t) {
            switch (e) {
                case s.DownloadKernel.TaskAttribute.TaskName:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskName, f.ValueType.ValueString, t);
                    break;
                case s.DownloadKernel.TaskAttribute.SavePath:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskSavePath, f.ValueType.ValueString, t);
                    break;
                case s.DownloadKernel.TaskAttribute.ReceivedSize:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskReceiveSize, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.DownloadSize:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDownloadSize, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.FileSize:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskFileSize, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.RecycleTime:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskRemovingToRecycleTime, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.FileCreated:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskFileCreated, f.ValueType.ValueInt, t);
                    break;
                case s.DownloadKernel.TaskAttribute.CompletionTime:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskCompletionTime, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.DownloadingPeriod:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDownloadingPeriod, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.ErrorCode:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskFailureErrorCode, f.ValueType.ValueInt, t);
                    break;
                case s.DownloadKernel.TaskAttribute.Cid:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskCid, f.ValueType.ValueBlob, t);
                    break;
                case s.DownloadKernel.TaskAttribute.Gcid:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskGcid, f.ValueType.ValueBlob, t);
                    break;
                case s.DownloadKernel.TaskAttribute.DownloadSubTask:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDownload, f.ValueType.ValueInt, t)
            }
        }

        insertStorageTaskBase() {
            let e = this.getTaskBaseInfo();
            l.ThunderKernel.insertTaskBase(e)
        }

        deleteStorageTask() {
            l.ThunderKernel.deleteStorageTask(this.taskId, f.StatementType.DestroyTaskBase);
            let e = f.StatementType.StatementBengin;
            switch (this.taskType) {
                case s.DownloadKernel.TaskType.P2sp:
                    e = f.StatementType.DestroyP2spTask;
                    break;
                case s.DownloadKernel.TaskType.Bt:
                    e = f.StatementType.DestroyBtTask, this.getExtraObject().deleteStorageBtFile();
                    break;
                case s.DownloadKernel.TaskType.Emule:
                    e = f.StatementType.DestroyEmuleTask;
                    break;
                case s.DownloadKernel.TaskType.Group:
                    e = f.StatementType.DestroyGroupTask;
                    break;
                case s.DownloadKernel.TaskType.Magnet:
                    e = f.StatementType.DestroyMagnetTask
            }
            e !== f.StatementType.StatementBengin && l.ThunderKernel.deleteStorageTask(this.taskId, e)
        }

        saveTaskInfo(e, t, n, i) {
            this.isBackground || l.ThunderKernel.saveTaskBaseInfo(e, t, n, i)
        }

        updateChannelInfo(e) {
            let t = !1;
            if ((this.channelInfo.originSize !== e.originSize || this.channelInfo.p2sSize !== e.p2sSize || this.channelInfo.p2pSize !== e.p2pSize || this.channelInfo.offlineSize !== e.offlineSize || this.channelInfo.dcdnSize !== e.dcdnSize || this.channelInfo.dcdnStatus !== e.dcdnStatus) && (t = !0, e.offlineSize > 0 || e.dcdnSize > 0)) {
                let t = e.offlineSize - this.channelInfo.offlineSize + (e.dcdnSize - this.channelInfo.dcdnSize);
                t < 0 && (t = 0);
                let n = this.calculateVipSpeed(t);
                n = Math.round(n), this.vipSpeed !== n && (this.vipSpeed = n)
            }
            let n = !1, i = e.dcdnStatus;
            if (this.channelInfo.dcdnStatus !== i && (n = !0), this.taskStatus === s.DownloadKernel.TaskStatus.Stopped || this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding) {
                this.channelInfo = {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0};
                let t = this.historyChannelInfo.originSize + e.originSize,
                    n = this.historyChannelInfo.p2pSize + e.p2pSize, i = this.historyChannelInfo.p2sSize + e.p2sSize,
                    a = this.historyChannelInfo.offlineSize + e.offlineSize,
                    o = this.historyChannelInfo.dcdnSize + e.dcdnSize;
                this.historyChannelInfo = {originSize: t, p2pSize: n, p2sSize: i, offlineSize: a, dcdnSize: o}
            } else this.channelInfo = e;
            return t && this.saveChannelInfo(), n && this.fireTaskEvent(s.DownloadKernel.TaskEventType.DcdnStatusChanged), t
        }

        saveChannelInfo() {
            let e = this.getTaskChannelInfo();
            l.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize)
        }

        deleteP2spTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                    n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), i = a.join(t, n);
                if (this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding || this.taskStatus === s.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === s.DownloadKernel.TaskStatus.Succeeded || this.preStatus === s.DownloadKernel.TaskStatus.Seeding) (yield r.FileSystemAWNS.existsAW(i)) && (e = yield r.FileSystemAWNS.unlinkAW(i)); else {
                    let t = i + ".xltd", n = i + ".xltd.cfg";
                    (yield r.FileSystemAWNS.existsAW(t)) && (e = yield r.FileSystemAWNS.unlinkAW(t)), (yield r.FileSystemAWNS.existsAW(n)) && (e = (yield r.FileSystemAWNS.unlinkAW(n)) && e)
                }
                return e
            })
        }

        deleteBtTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                    t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName),
                    n = a.join(__profilesDir, "Torrents"), i = this.getExtraObject().getInfoId(), o = i + ".xlbt.cfg",
                    l = i + ".xlbt.dat", u = i + ".torrent", d = a.join(e, t), c = a.join(n, o), h = a.join(n, l),
                    f = !0;
                if (yield T.SingleBtTaskNS.isSingleBtTask(this)) yield this.deleteSingleBtTaskFile(); else if (yield r.FileSystemAWNS.existsAW(d)) {
                    let e = a.join(d, u);
                    (yield r.FileSystemAWNS.existsAW(e)) && (f = (yield r.FileSystemAWNS.unlinkAW(e)) && f), f = (yield this.deleteBtSubFile()) && f
                }
                return (yield r.FileSystemAWNS.existsAW(c)) && (f = (yield r.FileSystemAWNS.unlinkAW(c)) && f), (yield r.FileSystemAWNS.existsAW(h)) && (f = (yield r.FileSystemAWNS.unlinkAW(h)) && f), f
            })
        }

        deleteBtSubFile() {
            return i(this, void 0, void 0, function* () {
                let e = !0, t = this.getExtraObject().getBtFileInfoList();
                if (t.length > 0) {
                    let n = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                        i = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), o = a.join(n, i), l = [o];
                    for (let n = 0; n < t.length; ++n) {
                        let i = t[n], s = a.join(o, i.filePath);
                        if (!(yield r.FileSystemAWNS.existsAW(s))) continue;
                        let u = a.join(s, i.fileName);
                        for ((yield r.FileSystemAWNS.existsAW(u)) ? e = (yield r.FileSystemAWNS.unlinkAW(u)) && e : (u += ".bt.xltd", (yield r.FileSystemAWNS.existsAW(u)) && (e = (yield r.FileSystemAWNS.unlinkAW(u)) && e)); s.length > o.length && !l.includes(s);) l = l.concat([s]), s = a.parse(s).dir
                    }
                    l.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), v.information("task.deleteBtSubFile savePaths:", l);
                    for (let e = 0; e < l.length; ++e) {
                        let t = l[e];
                        (yield r.FileSystemAWNS.existsAW(t)) && (yield r.FileSystemAWNS.rmdirAW(t))
                    }
                }
                return e
            })
        }

        deleteEmuleTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                    n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), i = a.join(t, n);
                if (this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding || this.taskStatus === s.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === s.DownloadKernel.TaskStatus.Succeeded || this.preStatus === s.DownloadKernel.TaskStatus.Seeding) (yield r.FileSystemAWNS.existsAW(i)) && (e = yield r.FileSystemAWNS.unlinkAW(i)); else {
                    let t = i + ".emule.xltd", n = i + ".xlemule.cfg";
                    (yield r.FileSystemAWNS.existsAW(t)) && (e = yield r.FileSystemAWNS.unlinkAW(t)), (yield r.FileSystemAWNS.existsAW(n)) && (e = (yield r.FileSystemAWNS.unlinkAW(n)) && e)
                }
                return e
            })
        }

        deleteGroupTaskFile() {
            return i(this, void 0, void 0, function* () {
                return yield this.getExtraObject().destroy()
            })
        }

        deleteSingleBtTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = T.SingleBtTaskNS.getSinleBtTaskFilePath(this);
                if (yield r.FileSystemAWNS.existsAW(e)) yield r.FileSystemAWNS.unlinkAW(e); else {
                    let t = e + ".bt.xltd";
                    (yield r.FileSystemAWNS.existsAW(t)) ? yield r.FileSystemAWNS.unlinkAW(t) : (t = e + ".bt.td", yield r.FileSystemAWNS.unlinkAW(t))
                }
                let t = this.getExtraObject().getInfoId(), n = this.getSavePath(), i = t + ".torrent", o = a.join(n, i);
                yield r.FileSystemAWNS.unlinkAW(o)
            })
        }

        fireTaskEvent(e, ...t) {
            C.fireTaskEvent(e, [this], ...t)
        }

        isVideoFileExt(e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = a.extname(e);
                for (let e = 0; e < y.length; ++e) if (n.toLowerCase() === y[e]) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        isVideoFile() {
            let e = !1;
            do {
                let t = "";
                if (this.taskType === s.DownloadKernel.TaskType.P2sp || this.taskType === s.DownloadKernel.TaskType.Emule) t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), e = this.isVideoFileExt(t); else if (this.taskType === s.DownloadKernel.TaskType.Bt) {
                    let t = this.getExtraObject();
                    if (t.getDownloadFile().length <= 0) break;
                    let n = t.getBtFileList();
                    for (let [, t]of n) {
                        let n = t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download),
                            i = t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName);
                        if (1 === n && (e = this.isVideoFileExt(i))) break
                    }
                } else if (this.taskType === s.DownloadKernel.TaskType.Group) {
                    let t = this.getExtraObject();
                    if (null !== t && void 0 !== t) {
                        let n = t.getSubTaskCount();
                        for (let i = 0; i < n; ++i) {
                            let n = t.getSubTaskByIndex(i),
                                a = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                            if (1 === n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask) && (e = this.isVideoFileExt(a))) break
                        }
                    }
                }
            } while (0);
            return e
        }

        setTaskExtInfoBeforeStart() {
            if (this.virtualTaskId > 0) {
                let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskId),
                    t = this.attribute.get(s.DownloadKernel.TaskAttribute.Origin);
                this.attribute.get(s.DownloadKernel.TaskAttribute.Background) && (t = "background");
                let n = "parentid=" + e.toString();
                n = n + ",taskorigin=" + t, l.ThunderKernel.setTaskExtInfo(this.virtualTaskId, n)
            }
        }

        calculateDownloadSpeed(e) {
            this.downloadSizeList.length > 5 && this.downloadSizeList.splice(0, 1), this.downloadSizeList.push(e);
            let t = 0;
            for (let e = 0; e < this.downloadSizeList.length; ++e) t += this.downloadSizeList[e];
            let n = t / this.downloadSizeList.length;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Started && (n = 0, this.downloadSizeList = []), n
        }

        calculateVipSpeed(e) {
            this.vipSizeList.length > 5 && this.vipSizeList.splice(0, 1), this.vipSizeList.push(e);
            let t = 0;
            for (let e = 0; e < this.vipSizeList.length; ++e) t += this.vipSizeList[e];
            let n = t / this.vipSizeList.length;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Started && (n = 0, this.vipSizeList = []), n
        }

        changeToDownloadKernelTaskStatus(e) {
            let t = this.taskStatus;
            switch (e) {
                case w.None:
                case w.Create:
                case w.StartPending:
                    break;
                case w.Downloading:
                case w.StopPending:
                case w.CompletePending:
                case w.ErrorStopPending:
                    t = s.DownloadKernel.TaskStatus.Started;
                    break;
                case w.Pause:
                    t = s.DownloadKernel.TaskStatus.Stopped;
                    break;
                case w.Complete:
                    t = s.DownloadKernel.TaskStatus.Succeeded;
                    break;
                case w.Error:
                    t = s.DownloadKernel.TaskStatus.Failed;
                    break;
                default:
                    t = s.DownloadKernel.TaskStatus.Unkown
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(83), o = n(243), r = n(266), s = n(6);
    t.P2spTask = class {
        constructor(e, t, n, s) {
            this.task = e, this.downloadSpeedLimit = 0, this.threadCount = s || 5, this.useOriginOnly = n || 0, this.taskId = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId), this.cookie = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.Cookie), this.displayUrl = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskUrl), t ? a.ThunderKernel.insertP2spTask(this.taskId, this.downloadSpeedLimit, this.useOriginOnly, this.threadCount, void 0 === this.cookie ? "" : this.cookie, this.displayUrl) : a.ThunderKernel.loadStorageTask(this.taskId, o.StatementType.LoadP2spTask, e => {
                this.useOriginOnly = e.originOnly, this.threadCount = e.threadCount, this.downloadSpeedLimit = e.speedLimit, this.displayUrl = e.displayUrl, this.cookie = e.cookie
            });
            let l = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.UserData);
            this.userData = new r.TaskUserData(e, l)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            s.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let n = this.task.getVirtualTaskId();
            n && n > 0 && !s.isNullOrUndefined(t) && a.ThunderKernel.setTaskPriorityLevel(n, e, t)
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        setUseOriginOnly(e) {
            e !== this.useOriginOnly && (this.useOriginOnly = e, a.ThunderKernel.setP2spTaskOriginOnly(this.taskId, e))
        }

        setOriginThreadCount(e) {
            e !== this.threadCount && (this.threadCount = e, a.ThunderKernel.setP2spTaskThreadCount(this.taskId, e))
        }

        getUseOriginOnly() {
            return this.useOriginOnly
        }

        getThreadCount() {
            return this.threadCount
        }

        getSpeedLimit() {
            return this.downloadSpeedLimit
        }

        getDisplayUrl() {
            return this.displayUrl
        }

        getCookie() {
            return this.cookie
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(6);
    !function (e) {
        let t;
        !function (e) {
            e[e.LowerBound = -1] = "LowerBound", e[e.Integer = 0] = "Integer", e[e.String = 1] = "String", e[e.List = 2] = "List", e[e.Map = 3] = "Map", e[e.UpperBound = 4] = "UpperBound"
        }(t = e.BencodeDataType || (e.BencodeDataType = {}));

        class n {
            constructor(e) {
                this.type = t.LowerBound, this.type = e
            }

            getType() {
                return this.type
            }
        }

        e.BencodeObject = n;

        class a extends n {
            constructor() {
                super(t.Integer), this.value = 0
            }

            getValue() {
                return this.value
            }

            setValue(e) {
                return this.value !== e && (this.value = e, !0)
            }

            decode(e) {
                if (e.length < 2 || "i" !== e[0]) return -1;
                this.value = 0;
                let t = 1;
                for ("-" === e[1] && t++; t < e.length; t++) {
                    if (!(e[t] >= "0" && e[t] <= "9")) return "e" === e[t] ? ("-" === e[1] && (this.value = -this.value), t + 1) : -1;
                    this.value = 10 * this.value + parseInt(e[t], 10)
                }
                return -1
            }

            encode(e) {
                return e += "i", e += this.value, e += "e"
            }
        }

        e.BencodeInteger = a;

        class o extends n {
            constructor() {
                super(t.String), this.value = ""
            }

            getValue() {
                return this.value
            }

            setValue(e) {
                return this.value !== e && (this.value = e, !0)
            }

            decode(e) {
                let t = 0, n = 0;
                for (; n < e.length; n++) {
                    if (!(e[n] >= "0" && e[n] <= "9")) {
                        if (":" !== e[n]) return -1;
                        break
                    }
                    t = 10 * t + parseInt(e[n], 10)
                }
                return t + n + 1 > e.length ? -1 : (this.value = e.substr(n + 1, t), t + n + 1)
            }

            encode(e) {
                return e += this.value.length, e += ":", e += this.value
            }
        }

        e.BencodeString = o;

        class r extends n {
            constructor() {
                super(t.List), this.value = []
            }

            getItemList() {
                return this.value
            }

            decode(e) {
                return 0
            }

            encode(e) {
                return e
            }
        }

        e.BencodeList = r;

        class s extends n {
            constructor() {
                super(t.Map), this.value = new Map
            }

            getValue() {
                return this.value
            }

            getItem(e) {
                return this.value.get(e)
            }

            addMapItem(e) {
                let n = null, i = this.value.get(e);
                return i && i.getType() === t.Map ? n = i : (n = new s, this.value.set(e, n)), n
            }

            addItem(e, n) {
                if (i.isNumber(n)) {
                    let i = null, o = this.value.get(e);
                    o && o.getType() === t.Integer ? i = o : (i = new a, this.value.set(e, i)), i.setValue(n)
                } else if (i.isString(n)) {
                    let i = null, a = this.value.get(e);
                    a && a.getType() === t.String ? i = a : (i = new o, this.value.set(e, i)), i.setValue(n)
                }
                return !0
            }

            removeItem(e) {
                let n = this.value.get(e);
                if (n) {
                    let i = !0;
                    if (n.getType() === t.Map) {
                        0 === n.getValue().size && (i = !0)
                    }
                    return this.value.delete(e), i
                }
                return !1
            }

            decode(e) {
                if (!e) return -1;
                let t = e.length;
                if (t < 2 || "d" !== e[0]) return -1;
                let n = 1, i = new o, r = null, l = -1, u = -1;
                for (; n < t && "e" !== e[n];) {
                    if (!((l = i.decode(e.substr(n))) >= 0)) return -1;
                    if ("i" === e[n += l]) {
                        let t = new a;
                        u = t.decode(e.substr(n)), r = t
                    } else if ("d" === e[n]) {
                        let t = new s;
                        u = t.decode(e.substr(n)), r = t
                    } else {
                        let t = new o;
                        u = t.decode(e.substr(n)), r = t
                    }
                    if (!(u >= 0)) return -1;
                    n += u, this.value.set(i.getValue(), r)
                }
                return n < t && "e" === e[n] ? n + 1 : -1
            }

            encode(e) {
                e += "d";
                let t = new o;
                return this.value.forEach(function (n, i) {
                    t.setValue(i), e = t.encode(e), e = n.encode(e)
                }), e += "e"
            }
        }

        e.BencodeMap = s;
        e.Bencode = class {
            constructor() {
                this.objectList = []
            }

            getItemList() {
                return this.objectList
            }

            encode(e) {
                for (let t = 0; t < this.objectList.length; t++) e = this.objectList[t].encode(e);
                return e
            }

            decode(e) {
                let t = null, n = -1, i = 0, l = e.length;
                for (; i < l; i++) (n = (t = "i" === e[i] ? new a : "l" === e[i] ? new r : "d" === e[i] ? new s : new o).decode(e.substr(i))) >= 0 && (i += n, this.objectList.push(t));
                return e
            }
        }
    }(t.BencodeMap || (t.BencodeMap = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(83), o = n(243), r = n(781), s = n(34), l = n(266), u = n(6),
        d = s.DownloadKernelEventManager.getEventManager();
    t.BtTask = class {
        constructor(e, t, n) {
            this.subError = !1, this.fileLists = new Map, this.priorityMap = new Map, this.downloadIndexLists = [], this.task = e;
            let o = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            if (n) {
                this.infoId = n.infoId, this.tracker = n.tracker, this.seedFile = n.seedFile, this.displayName = n.displayName, this.downloadIndexLists = n.fileRealIndexLists, this.loadSubFileEnd = t, t && a.ThunderKernel.insertBtTask(o, this.infoId, this.tracker, this.seedFile, this.displayName);
                let e = n.fileLists, i = a.ThunderKernel.beginTransaction();
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n], a = i.realIndex, o = 0;
                    this.downloadIndexLists.indexOf(a) > -1 && (o = 1);
                    let s = new r.BtFile(this);
                    s.saveBtFileInfo(t, o, i), this.fileLists.set(a, s)
                }
                a.ThunderKernel.commitTransaction(i)
            }
            let s = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.UserData);
            this.userData = new l.TaskUserData(e, s)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            u.isNullOrUndefined(t) ? t = this.priorityMap.get(e) : this.priorityMap.set(e, t);
            let n = this.task.getVirtualTaskId();
            if (n && n > 0 && !u.isNullOrUndefined(t)) if (-1 === e) for (let e = 0; e < this.downloadIndexLists.length; ++e) a.ThunderKernel.setTaskPriorityLevel(n, this.downloadIndexLists[e], t); else a.ThunderKernel.setTaskPriorityLevel(n, e, t)
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        getFileCount() {
            return this.fileLists.size
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getBtFileByRealIndex(e) {
            return this.fileLists.get(e)
        }

        getInfoId() {
            return this.infoId
        }

        getDisplayName() {
            return this.displayName
        }

        getTrackerUrls() {
            return this.tracker
        }

        getSeedFilePath() {
            return this.seedFile
        }

        getDownloadFile() {
            return this.downloadIndexLists
        }

        getFileSize() {
            let e = 0;
            for (let t of this.fileLists) {
                let n = t[1];
                if (1 === n.getIsDownload()) {
                    let t = n.getBtFileAttribute(i.DownloadKernel.BtFileAttribute.FileSize);
                    t && (e += t)
                }
            }
            return e
        }

        setDownloadFile(e) {
            for (let t of this.fileLists) {
                let n = t[1], i = n.getFileIndex();
                e.indexOf(i) > -1 ? n.setIsDownload(1) : n.setIsDownload(0)
            }
            this.downloadIndexLists = e
        }

        getBtFileList() {
            return this.fileLists
        }

        getBtFileInfoList() {
            let e = [];
            for (let t of this.fileLists) {
                let n = t[1].getBtFileInfo();
                e.push(n)
            }
            return e
        }

        updateSubFileInfo(e) {
            if (e && e.length > 0) {
                let t = !1, n = !1, a = [];
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t], o = n.realIndex, r = this.getFileStatus(n.fileStatus), s = n.errorCode;
                    0 !== s && (r = s > 700 ? i.DownloadKernel.BtFileStatus.Forbidden : i.DownloadKernel.BtFileStatus.Error, a.push(o)), n.fileStatus = r;
                    let l = this.fileLists.get(o);
                    l && l.updateFileInfo(n)
                }
                if (a.length > 0) {
                    let e = this.getDownloadFile();
                    for (let o = 0; o < a.length; ++o) for (let r = 0; r < e.length; ++r) if (e[r] === a[o]) {
                        e.splice(r, 1), this.subError || (this.subError = !0, n = !0);
                        let s = a[o], l = this.fileLists.get(s);
                        l && l.getBtFileAttribute(i.DownloadKernel.BtFileAttribute.ErrorCode) > 700 && (t = !0);
                        break
                    }
                    this.setDownloadFile(e)
                }
                let o = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
                if (d.fireTaskEvent(i.DownloadKernel.TaskEventType.BtSubFileDetailChanged, o, e), n) {
                    let e = "Error";
                    t && (e = "Forbidden"), d.fireTaskEvent(i.DownloadKernel.TaskEventType.BtSubFileForbidden, o, e)
                }
            }
        }

        deleteStorageBtFile() {
            let e = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            a.ThunderKernel.deleteStorageTask(e, o.StatementType.DestroyBtFile)
        }

        loadBtTask(e) {
            let t = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            a.ThunderKernel.loadStorageTask(t, o.StatementType.LoadBtTask, n => {
                n ? (this.infoId = n.infoId, this.tracker = n.tracker, this.seedFile = n.seedFile, this.displayName = n.displayName, a.ThunderKernel.loadStorageTask(t, o.StatementType.LoadBtFile, t => {
                    if (t) for (let e = 0; e < t.length; ++e) {
                        let n = t[e], i = new r.BtFile(this);
                        i.setFileData(n), this.fileLists.set(n.realIndex, i), 1 === n.download && this.downloadIndexLists.push(n.realIndex)
                    }
                    this.loadSubFileEnd = !0, e(n, t)
                })) : e(null, null)
            })
        }

        isBtFileLoadEnd() {
            return this.loadSubFileEnd
        }

        getFileStatus(e) {
            let t = i.DownloadKernel.BtFileStatus.Stopped;
            switch (e) {
                case 0:
                    break;
                case 1:
                    t = i.DownloadKernel.BtFileStatus.Stopped;
                    break;
                case 2:
                    t = i.DownloadKernel.BtFileStatus.Started;
                    break;
                case 3:
                    t = i.DownloadKernel.BtFileStatus.Complete
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(83), o = n(34).DownloadKernelEventManager.getEventManager();
    t.BtFile = class {
        constructor(e) {
            this.attribute = new Map;
            for (let e = i.DownloadKernel.BtFileAttribute.NumberStrart; e < i.DownloadKernel.BtFileAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = i.DownloadKernel.BtFileAttribute.StringStart; e < i.DownloadKernel.BtFileAttribute.StringEnd; ++e) this.attribute.set(e, "");
            this.attribute.set(i.DownloadKernel.BtFileAttribute.DcdnStatus, i.DownloadKernel.DcdnStatusCode.Unkown), this.btTask = e;
            let t = this.btTask.getTask().getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            this.taskId = t, this.attribute.set(i.DownloadKernel.BtFileAttribute.TaskId, t)
        }

        getBtFileAttribute(e) {
            return this.attribute.get(e)
        }

        updateFileInfo(e) {
            this.realIndex = e.realIndex, this.attribute.set(i.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.EnableDcdn, e.enableDcdn), this.setAttribute(i.DownloadKernel.BtFileAttribute.ErrorCode, e.errorCode) && a.ThunderKernel.setBtFileFailureErrorCode(this.realIndex, this.taskId, this.attribute.get(i.DownloadKernel.BtFileAttribute.ErrorCode)), e.relativePath && this.attribute.set(i.DownloadKernel.BtFileAttribute.RelativePath, e.relativePath), e.finalName && "" !== e.finalName && (this.attribute.set(i.DownloadKernel.BtFileAttribute.FinalName, e.finalName), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileName, e.finalName));
            let t = this.setAttribute(i.DownloadKernel.BtFileAttribute.FileStatus, e.fileStatus),
                n = this.setAttribute(i.DownloadKernel.BtFileAttribute.DownloadSize, e.downloadSize);
            (t || n) && a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(i.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(i.DownloadKernel.BtFileAttribute.DownloadSize)), e.cid && "" !== e.cid && e.gcid && "" !== e.gcid && this.updateCidAndGcid(e.cid, e.gcid);
            let r = this.attribute.get(i.DownloadKernel.BtFileAttribute.DcdnStatus);
            if (r !== e.dcdnStatus) {
                this.attribute.set(i.DownloadKernel.BtFileAttribute.DcdnStatus, e.dcdnStatus);
                let t = this.btTask.getTask().getId();
                o.fireTaskEvent(i.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, t, this.realIndex, e.dcdnStatus, r)
            }
        }

        saveBtFileInfo(e, t, n) {
            if (this.download = t, this.realIndex = n.realIndex, this.attribute.set(i.DownloadKernel.BtFileAttribute.Download, t), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileSize, n.fileSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, n.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, n.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileOffset, n.fileOffset), n.fileName && this.attribute.set(i.DownloadKernel.BtFileAttribute.FileName, n.fileName), n.filePath && this.attribute.set(i.DownloadKernel.BtFileAttribute.FilePath, n.filePath), e) {
                let e = {
                    taskId: this.taskId,
                    status: 0,
                    realIndex: n.realIndex,
                    visible: 1,
                    download: t,
                    fileSize: n.fileSize,
                    fileOffset: n.fileOffset,
                    filePath: void 0 === n.filePath ? "" : n.filePath,
                    fileName: void 0 === n.fileName ? "" : n.fileName
                };
                a.ThunderKernel.insertBtFile(this.taskId, e)
            }
        }

        getBtFileInfo() {
            let e = {};
            return e.fileSize = this.attribute.get(i.DownloadKernel.BtFileAttribute.FileSize), e.realIndex = this.attribute.get(i.DownloadKernel.BtFileAttribute.RealIndex), e.fileOffset = this.attribute.get(i.DownloadKernel.BtFileAttribute.FileOffset), e.fileName = this.attribute.get(i.DownloadKernel.BtFileAttribute.FileName), e.filePath = this.attribute.get(i.DownloadKernel.BtFileAttribute.FilePath), e
        }

        getBtDownloadFileInfo() {
            return {
                realIndex: this.attribute.get(i.DownloadKernel.BtFileAttribute.RealIndex),
                fileStatus: this.attribute.get(i.DownloadKernel.BtFileAttribute.FileStatus),
                downloadSize: this.attribute.get(i.DownloadKernel.BtFileAttribute.DownloadSize),
                fileSize: this.attribute.get(i.DownloadKernel.BtFileAttribute.FileSize),
                enableDcdn: this.attribute.get(i.DownloadKernel.BtFileAttribute.EnableDcdn),
                errorCode: this.attribute.get(i.DownloadKernel.BtFileAttribute.ErrorCode),
                dcdnStatus: this.attribute.get(i.DownloadKernel.BtFileAttribute.DcdnStatus),
                relativePath: this.attribute.get(i.DownloadKernel.BtFileAttribute.RelativePath),
                finalName: this.attribute.get(i.DownloadKernel.BtFileAttribute.FinalName),
                cid: this.attribute.get(i.DownloadKernel.BtFileAttribute.Cid),
                gcid: this.attribute.get(i.DownloadKernel.BtFileAttribute.Gcid)
            }
        }

        getIsDownload() {
            return this.download
        }

        setIsDownload(e) {
            this.download = e, this.attribute.set(i.DownloadKernel.BtFileAttribute.Download, e), a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(i.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(i.DownloadKernel.BtFileAttribute.DownloadSize))
        }

        getFileIndex() {
            return this.realIndex
        }

        setFileData(e) {
            this.download = e.download, this.taskId = e.taskId, this.realIndex = e.realIndex, this.attribute.set(i.DownloadKernel.BtFileAttribute.TaskId, e.taskId), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileOffset, e.fileOffset), this.attribute.set(i.DownloadKernel.BtFileAttribute.DownloadSize, e.receivedSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileStatus, e.status), this.attribute.set(i.DownloadKernel.BtFileAttribute.Visible, e.visible), this.attribute.set(i.DownloadKernel.BtFileAttribute.Download, e.download), e.filePath && this.attribute.set(i.DownloadKernel.BtFileAttribute.FilePath, e.filePath), e.fileName && this.attribute.set(i.DownloadKernel.BtFileAttribute.FileName, e.fileName), e.cid && this.attribute.set(i.DownloadKernel.BtFileAttribute.Cid, e.cid), e.gcid && this.attribute.set(i.DownloadKernel.BtFileAttribute.Gcid, e.gcid), this.attribute.set(i.DownloadKernel.BtFileAttribute.ErrorCode, e.failureErrorCode)
        }

        updateCidAndGcid(e, t) {
            let n = !1, o = this.attribute.get(i.DownloadKernel.BtFileAttribute.Cid),
                r = this.attribute.get(i.DownloadKernel.BtFileAttribute.Gcid);
            o && "" !== o || ("0000000000000000000000000000000000000000" === e ? this.setAttribute(i.DownloadKernel.BtFileAttribute.Cid, "") : this.setAttribute(i.DownloadKernel.BtFileAttribute.Cid, e), o = e, n = !0), r && "" !== r || ("0000000000000000000000000000000000000000" === t ? this.setAttribute(i.DownloadKernel.BtFileAttribute.Gcid, "") : this.setAttribute(i.DownloadKernel.BtFileAttribute.Gcid, t), r = t, n = !0), n && a.ThunderKernel.saveBtFileCid(this.taskId, this.realIndex, o, r)
        }

        setAttribute(e, t) {
            let n = !1;
            return this.attribute.get(e) !== t && void 0 !== t && (this.attribute.set(e, t), n = !0), n
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(84), a = n(8), o = n(83), r = n(243), s = n(266), l = n(6), u = n(2);
    t.EmuleTask = class {
        constructor(e, t) {
            if (this.task = e, this.configPath = u.join(__profilesDir, "Emule"), this.taskId = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId), t) {
                let e = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId),
                    t = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl);
                i.Common.isThunderPrivateUrl(t) && (t = i.Common.parseThunderPrivateUrl(t)), this.fileHash = o.ThunderKernel.getFileHashByUrl(t), o.ThunderKernel.insertEmuleTask(e, this.fileHash, this.configPath)
            } else o.ThunderKernel.loadStorageTask(this.taskId, r.StatementType.LoadEmuleTask, e => {
                this.fileHash = e.fileHash, this.configPath = e.configPath
            });
            let n = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.UserData);
            this.userData = new s.TaskUserData(e, n)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            l.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let n = this.task.getVirtualTaskId();
            n && n > 0 && !l.isNullOrUndefined(t) && o.ThunderKernel.setTaskPriorityLevel(n, e, t)
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getFileHash() {
            return this.fileHash
        }

        getConfigPath() {
            return this.configPath
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(10), r = n(8), s = n(83), l = n(243), u = n(34), d = n(266), c = n(1),
        h = u.DownloadKernelEventManager.getEventManager(), f = c.default.getLogger("DownloadKernel.TaskGroup");
    t.GroupTask = class {
        constructor(e, t) {
            this.startTime = 0, this.downloadingPeriod = 0, this.startTaskCount = 5, this.task = e, this.subTasks = [], this.moveTimeout = 120, this.downloadingSubCount = 5, this.subTaskOrder = "", this.taskId = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), t ? s.ThunderKernel.insertGroupTask(this.taskId, this.moveTimeout, this.downloadingSubCount, this.subTaskOrder) : (this.downloadingPeriod = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadingPeriod), s.ThunderKernel.loadStorageTask(this.taskId, l.StatementType.LoadGroupTask, e => {
                this.moveTimeout = e.moveTimeout, this.downloadingSubCount = e.downloadingSubCount
            }));
            let n = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.UserData);
            this.userData = new d.TaskUserData(e, n)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            if (-1 === e) for (let e = 0; e < this.subTasks.length; ++e) {
                let n = this.subTasks[e].getExtraObject();
                n && n.setTaskPriorityLevel(-1, t)
            } else {
                let n = this.getSubTaskByIndex(e);
                if (n) {
                    let e = n.getExtraObject();
                    e && e.setTaskPriorityLevel(-1, t)
                }
            }
        }

        setSubTaskFileSize(e, t) {
            let n = !1, i = this.subTasks[e];
            if (i && (n = i.setFileSize(t))) {
                let e = 0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let n = this.subTasks[t];
                    if (n) {
                        if (0 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                        let t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize);
                        t && (e += t)
                    }
                }
                this.task.setFileSize(e)
            }
            return n
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getSubTaskCount() {
            return this.subTasks.length
        }

        getDownloadTaskCount() {
            let e = 0;
            for (let t = 0; t < this.subTasks.length; ++t) {
                let n = this.subTasks[t];
                n && 1 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask) && e++
            }
            return e
        }

        getSubTaskByIndex(e) {
            return this.subTasks[e]
        }

        addSubTask(e) {
            e && (this.subTasks.push(e), e.internalSetFileIndex(this.subTasks.length - 1))
        }

        start(e) {
            let t = !1, n = 0, i = 0;
            for (let a = 0; a < this.subTasks.length; ++a) {
                let o = this.subTasks[a];
                if (!o) continue;
                if (0 === o.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                    i++;
                    continue
                }
                let s = o.getTaskStatus();
                if (s !== r.DownloadKernel.TaskStatus.Succeeded && s !== r.DownloadKernel.TaskStatus.Seeding) if (s !== r.DownloadKernel.TaskStatus.Failed) {
                    if (o.start(e) && (t = !0, ++n >= this.startTaskCount)) break
                } else o.start(e) && (t = !0); else i++
            }
            return i === this.subTasks.length && (t = !0), e && (t = !0), t
        }

        stop() {
            let e = !1;
            for (let t = 0; t < this.subTasks.length; ++t) {
                let n = this.subTasks[t];
                if (!n) continue;
                let i = n.getTaskStatus();
                i !== r.DownloadKernel.TaskStatus.Succeeded && i !== r.DownloadKernel.TaskStatus.Seeding && n.stop() && (e = !0)
            }
            return e
        }

        delete(e) {
            return i(this, void 0, void 0, function* () {
                let t = !0;
                for (let n = 0; n < this.subTasks.length; ++n) {
                    let i = this.subTasks[n];
                    i && (t = (yield i.delete(e)) && t)
                }
                if (e) {
                    let e = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath), n = [e];
                    for (let t = 0; t < this.subTasks.length; ++t) {
                        let i = this.subTasks[t];
                        if (i) {
                            let t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                            for (; t.length > e.length && !n.includes(t);) n = n.concat([t]), t = a.parse(t).dir
                        }
                    }
                    n.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), f.information("task.delete savePaths:", n);
                    for (let e = 0; e < n.length; ++e) {
                        let i = n[e];
                        (yield o.FileSystemAWNS.existsAW(i)) && (t = (yield o.FileSystemAWNS.rmdirAW(i)) && t)
                    }
                }
                return t
            })
        }

        destroy() {
            return i(this, void 0, void 0, function* () {
                let e = !0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let n = this.subTasks[t];
                    if (n) {
                        let t = yield n.destroy();
                        e && !t && (e = !1)
                    }
                }
                return e
            })
        }

        querySubTaskInfo(e, t, n) {
            let i = !1, a = 0, o = 0, l = !1, u = [];
            for (let d = 0; d < this.subTasks.length; ++d) {
                let c = this.subTasks[d];
                if (!c) continue;
                let f = c.getTaskStatus();
                if (f === r.DownloadKernel.TaskStatus.Stopped || f === r.DownloadKernel.TaskStatus.Succeeded || f === r.DownloadKernel.TaskStatus.Seeding || f === r.DownloadKernel.TaskStatus.Failed) continue;
                let g = c.getTaskAttribute(r.DownloadKernel.TaskAttribute.VirtualId);
                g < 1 || (a++, i = s.ThunderKernel.queryTaskInfo(g, i => {
                    if (o++, null !== i) {
                        let n = c.updateTaskInfo(i, e, t);
                        1 & n && (l = !0), n > 0 && u.push(c)
                    }
                    if (a === o && (this.updateTaskDetail(), l && this.checkSubTaskStatus(), this.updateTaskStatus() && e(this.task), n(), u.length > 0)) {
                        let e = new Map;
                        e.set(this.taskId, u), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
                    }
                }))
            }
            return 0 === a && (this.subTasks.length > 0 && e(this.subTasks[0]), this.updateTaskDetail(), this.updateTaskStatus(), n()), i
        }

        getTaskStatus() {
            let e = 0, t = 0, n = 0, i = 0, a = 0, o = 0, s = 0, l = this.task.getTaskStatus();
            if (l === r.DownloadKernel.TaskStatus.StartWaiting || l === r.DownloadKernel.TaskStatus.DestroyPending) return l;
            let u = 0;
            for (let l = 0; l < this.subTasks.length; ++l) {
                let d = this.subTasks[l], c = !1;
                if (d) {
                    if (0 === d.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                        u++;
                        continue
                    }
                    switch (d.getTaskStatus()) {
                        case r.DownloadKernel.TaskStatus.Unkown:
                            e++;
                            break;
                        case r.DownloadKernel.TaskStatus.Started:
                            n++, c = !0;
                            break;
                        case r.DownloadKernel.TaskStatus.StartPending:
                            i++;
                            break;
                        case r.DownloadKernel.TaskStatus.Stopped:
                            t++;
                            break;
                        case r.DownloadKernel.TaskStatus.StopPending:
                            a++;
                            break;
                        case r.DownloadKernel.TaskStatus.Succeeded:
                            o++;
                            break;
                        case r.DownloadKernel.TaskStatus.Failed:
                            s++;
                            break;
                        case r.DownloadKernel.TaskStatus.Seeding:
                            o++
                    }
                }
                if (c) break
            }
            let d = !1;
            l !== r.DownloadKernel.TaskStatus.StopPending && (n > 0 ? (l = r.DownloadKernel.TaskStatus.Started, d = !0) : i > 0 && (l = r.DownloadKernel.TaskStatus.StartPending, d = !0));
            let c = this.subTasks.length - u;
            return d || (a > 0 ? l = r.DownloadKernel.TaskStatus.StopPending : e === c ? l = r.DownloadKernel.TaskStatus.Unkown : o === c ? l = r.DownloadKernel.TaskStatus.Succeeded : s === c ? l = r.DownloadKernel.TaskStatus.Failed : s + o === c ? l = r.DownloadKernel.TaskStatus.Failed : t > 0 && (l = r.DownloadKernel.TaskStatus.Stopped)), l
        }

        setDownloadTask(e) {
            let t = [];
            for (let n = 0; n < this.subTasks.length; ++n) {
                let i = this.subTasks[n], a = !1, o = !1;
                for (let t = 0; t < e.length; ++t) if (n === e[t]) {
                    o = i.updateDownloadSubTask(1), a = !0;
                    break
                }
                a || (o = i.updateDownloadSubTask(0)), o && t.push(i)
            }
            if (t.length > 0) {
                let e = new Map;
                e.set(this.taskId, t), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            }
        }

        getTaskSizeInfo() {
            let e = {
                downloadSpeed: 0,
                vipSpeed: 0,
                fileSize: 0,
                downloadSize: 0,
                receivedSize: 0,
                usingResCount: 0,
                totalResCount: 0,
                channelInfo: {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0}
            };
            for (let t = 0; t < this.subTasks.length; ++t) {
                let n = this.subTasks[t];
                if (n) {
                    if (0 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                    let t = n.getDownloadSpeed(), i = n.getVipSpeed(),
                        a = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize),
                        o = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize),
                        s = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ReceivedSize),
                        l = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcUsing),
                        u = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcTotal), d = n.getTaskChannelInfo();
                    d && (e.channelInfo.p2pSize += d.p2pSize, e.channelInfo.p2sSize += d.p2sSize, e.channelInfo.offlineSize += d.offlineSize, e.channelInfo.originSize += d.originSize, e.channelInfo.dcdnSize += d.dcdnSize), t && (e.downloadSpeed += t), i && (e.vipSpeed += i), a && (e.fileSize += a), o && (e.downloadSize += o), s && (e.receivedSize += s), l && (e.usingResCount += l), u && (e.totalResCount += u)
                }
            }
            return e
        }

        updateTaskStatus() {
            let e = this.getTaskStatus();
            return this.task.updateTaskStatus(e)
        }

        checkSubTaskStatus() {
            let e = this.task.getTaskStatus();
            e !== r.DownloadKernel.TaskStatus.Stopped && e !== r.DownloadKernel.TaskStatus.StopPending && this.startWaittingTasks()
        }

        startWaittingTasks() {
            let e = 0, t = 0;
            for (let n = 0; n < this.subTasks.length; ++n) {
                let i = this.subTasks[n];
                if (!i) continue;
                if (0 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                let a = i.getTaskStatus();
                a !== r.DownloadKernel.TaskStatus.Started && a !== r.DownloadKernel.TaskStatus.StartPending || (e++, t = n)
            }
            if (e < this.startTaskCount && t < this.subTasks.length) for (let n = t + 1; n < this.subTasks.length; ++n) {
                let t = this.subTasks[n];
                if (!t) continue;
                if (0 === t.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                let i = t.getTaskStatus();
                if (i !== r.DownloadKernel.TaskStatus.Succeeded && i !== r.DownloadKernel.TaskStatus.Seeding && i !== r.DownloadKernel.TaskStatus.Failed && t.start() && ++e >= this.startTaskCount) break
            }
        }

        updateTaskDetail() {
            let e = r.DownloadKernel.TaskDetailChangedFlags.UnKnown, t = this.getTaskSizeInfo();
            if (t.downloadSpeed > 0) if (0 === this.startTime) this.startTime = (new Date).getTime(), this.downloadingPeriod = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadingPeriod); else {
                let t = ((new Date).getTime() - this.startTime) / 1e3, n = this.downloadingPeriod + Math.round(t);
                this.task.internalSetDownloadingPeriod(n) && (e |= r.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            } else this.startTime = 0;
            this.task.internalSetTaskSpeed(t.downloadSpeed, t.vipSpeed) && (e |= r.DownloadKernel.TaskDetailChangedFlags.TaskSpeed), this.task.internalSetFileSize(t.fileSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.FileSize), this.task.internalSetDownloadSize(t.downloadSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.DownloadSize), this.task.internalSetReceivedSize(t.receivedSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), this.task.internalSetSrcUsing(t.usingResCount) && (e |= r.DownloadKernel.TaskDetailChangedFlags.SrcUsing), this.task.internalSetSrcTotal(t.totalResCount) && (e |= r.DownloadKernel.TaskDetailChangedFlags.SrcTotal), this.task.internalSetTaskChannelInfo(t.channelInfo) && (e |= r.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), h.fireTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, [this.task], e)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(716), r = n(785), s = i.default.getLogger("DownloadKernel.PrivateCategory");

    class l extends r.Category {
        constructor(e) {
            super(e);
            let t = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Downloading),
                n = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Completed);
            this.categoryViews.push(t), this.categoryViews.push(n)
        }

        static createCategoryFromData(e) {
            let t = e.categoryId;
            if (void 0 === t || t < 0) return null;
            s.information("createCategoryFromData ", e);
            let n = new l(t);
            return n.setParentId(e.parentId), n.setNextId(e.nextId), n.setStatus(e.status), n.setDescription(e.description), n.setDefaultPath(e.defaultPath), n.setUserName(e.userName), n.setPassword(e.password, e.passwordV2), n.setAccountPassword(e.accountPassword), n
        }
    }

    t.PrivateCategory = l
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(83), a = n(29);
    t.Category = class {
        constructor(e) {
            this.categoryViews = [], this.id = e, this.parentId = -1, this.nextId = -1, this.status = 0
        }

        getCategoryViews() {
            return this.categoryViews
        }

        getCategoryViewCount() {
            return this.categoryViews.length
        }

        getCategoryViewFromId(e) {
            let t = null;
            for (let n = 0; n < this.categoryViews.length; ++n) {
                let i = this.categoryViews[n];
                if (i && e === i.getCategoryViewId()) {
                    t = i;
                    break
                }
            }
            return t
        }

        getId() {
            return this.id
        }

        setParentId(e) {
            e && (this.parentId = e)
        }

        getParentId() {
            return this.parentId
        }

        setNextId(e) {
            e && (this.nextId = e)
        }

        getNextId() {
            return this.nextId
        }

        setStatus(e) {
            e && (this.status = e)
        }

        getStatus() {
            return this.status
        }

        setName(e) {
            this.name = e
        }

        getName() {
            return this.name
        }

        setDescription(e) {
            this.description = e
        }

        getDescription() {
            return this.description
        }

        setDefaultPath(e) {
            this.defaultPath = e
        }

        getDefaultPath() {
            return this.defaultPath
        }

        setUserName(e) {
            this.userName = e
        }

        getUserName() {
            return this.userName
        }

        setPassword(e, t = "", n = !1, o = null) {
            if (this.password = e, "" !== this.password && "" === t) {
                let e = a.createHash("md5");
                e.update(this.password), t = e.digest("hex")
            }
            this.passwordV2 = t, n && i.ThunderKernel.setCategoryPassword(this.id, this.password, this.passwordV2, o)
        }

        getPassword() {
            return this.password
        }

        getPasswordV2() {
            return this.passwordV2
        }

        setAccountPassword(e) {
            this.accountPassword !== e && (this.accountPassword = e)
        }

        getAccountPassword() {
            return this.accountPassword
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = new class {
        getUserInfo(e, t) {
            let n = "string" == typeof e ? e : "", i = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "userinfo", function (e) {
                if (e) {
                    let t = "" !== n ? e[n] : e;
                    i && i(t)
                } else i && i(null)
            })
        }

        getAllUserInfo(e, t) {
            let n = "string" == typeof e ? e : "", i = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "allUserInfo", function (e) {
                if (e) {
                    let t = "" !== n ? e[n] : e;
                    i && i(t)
                } else i && i(null)
            })
        }

        logout() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({userid: "", sessionid: "", loginType: "1"}))
        }

        switchAccount() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({userid: "", sessionid: "", loginType: "2"}))
        }

        retryLogin() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({loginType: "3"}))
        }

        saveToXdas(e, t, n) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("SaveLoginData", e, t, n, function (e, t) {
            })
        }

        isLogined(e) {
            this.getUserInfo(null, function (t) {
                t && t.userid && "" !== t.userid ? e(!0) : e(!1)
            })
        }

        isAutologin(e) {
            this.getXdasDatas("file", "users", function (t) {
                let n = t || [];
                if (0 == n.length) e(!1); else {
                    let t = n[0];
                    e(!!t.xl_autologin)
                }
            })
        }

        getXdasDatas(e, t, n) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("LoadLoginData", e, t, function (e, t) {
                let i = "" !== t ? JSON.parse(t) : null;
                n && n(i)
            })
        }

        channel(e) {
            this.saveToXdas("memory", "channel", e)
        }
    };
    t.xlQuickLogin = i
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(10), o = n(82), r = n(23), s = n(25), l = n(563), u = n(1).default.getLogger("Activity");
    t.activityObj = new class {
        constructor() {
            this.activityEnable = !1, this.activityCssPath = "", this.activityUrl = ""
        }

        getActiveConfig() {
            return i(this, void 0, void 0, function* () {
            })
        }

        isHaverActivityAw(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (null === this.activityEnable || void 0 === this.activityEnable || !1 === this.activityEnable) break;
                    if ("auto" === e) {
                        let e = yield this.getActivityTimerAw();
                        t = this.getCurDate() !== e
                    } else !0 === this.activityEnable && (t = !0)
                } while (0);
                return t
            })
        }

        getActivityInfo() {
            return {
                activityEnable: this.activityEnable,
                activityCssPath: this.activityCssPath,
                activityUrl: this.activityUrl
            }
        }

        setActivityConfig() {
            let e = this.getCurDate();
            s.ConfigNS.setValue("Activity", "Date", e)
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        getActivityTimerAw() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    s.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = s.ConfigNS.getValue("Activity", "Date", "");
                        e(t)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(244), o = n(143), r = n(1).default.getLogger("Thunder.VipDownload.vip-task"),
        s = o.DkHelperNS.getHelper();
    !function (e) {
        e.createTokenBuffer = function (e, t) {
            return i(this, void 0, void 0, function* () {
                r.information("--\x3ecreateTokenBuffer");
                let n = [];
                for (let i of e.files) {
                    let a = {
                        url: i.url,
                        filename: i.fileName,
                        gcid: i.gcid,
                        cid: i.cid,
                        filesize: i.fileSize,
                        refer_url: i.refUrl,
                        cookies: "",
                        file_index: 2 === e.taskType ? i.subId : void 0
                    };
                    n.push(a), t.set(i.gcid, i.subId)
                }
                let i = {peer_id: yield s.getTpPeerId(), infohash: e.infoId, bt_title: e.btTitle, task_infos: n},
                    o = a.HttpJsonCryptoNS.getKey(e.userId, e.random), l = a.HttpJsonCryptoNS.encryptHttpBuffer(i, o);
                return r.information("<--createTokenBuffer"), l
            })
        }, e.praseTokenBuffer = function (e, t, n) {
            r.information("--\x3epraseTokenBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), o = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i), s = null;
            return o && ((s = o).detailMessage = o.message, s.message = o.simple_msg), r.information("<--praseTokenBuffer"), s
        }, e.praseErrorCodeBuffer = function (e) {
            r.information("--\x3epraseErrorCodeBuffer");
            let t = null;
            if (e) try {
                let n = e.toString();
                r.information("jsonStr", n), n && (t = JSON.parse(n))
            } catch (e) {
            }
            return r.information("<--praseErrorCodeBuffer"), t
        }
    }(t.VipTaskHttpPackageNS || (t.VipTaskHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(127), o = n(790), r = n(1).default.getLogger("Thunder.VipDownload.user-info");
    t.UserHttpSession = class extends a.HttpSession {
        queryFlux(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.host = "service.cdn.vip.xunlei.com", this.retries = 2, this.timeout = 15e3, this.body = o.UserHttpPackageNS.createUserFluxBuffer(e), this.post(e => {
                        let n = null;
                        200 === e.statusCode && e.body && e.body.length > 12 && (n = o.UserHttpPackageNS.praseUserFluxBuffer(e.body)), t(n)
                    }, e => {
                        r.information("error", e), t(null)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(200), a = n(201), o = n(57), r = n(1).default.getLogger("Thunder.VipDownload.user-info");
    !function (e) {
        e.createUserFluxBuffer = function (e) {
            r.information("--\x3ecreateUserFluxBuffer");
            let t = 0, n = Buffer.alloc(1024);
            t = n.writeUInt32LE(0, t), r.information("protocolVersion:", 0), t = n.writeUInt32LE(1, t), r.information("sequence:", 1), t = n.writeUInt32LE(0, t), r.information("commandLegth:", 0);
            let s = o.PluginHelperNS.getHelper().thunderVersionNumber;
            t = n.writeUInt32LE(s, t), r.information("thunderVersion:", s), t = n.writeUInt16LE(0, t), r.information("compressFlag:", 0), t = n.writeUInt16LE(12, t), r.information("commandType:", 12);
            let l = Number(e.userId).valueOf();
            t = a.BufferUtilitiesNS.writeUInt64LE(n, l, t), r.information("userId:", l);
            let u = e.jumpKey;
            t = a.BufferUtilitiesNS.writeString(n, u, t, "gbk"), r.information("jumpKey:", u);
            let d = e.peerId;
            return t = a.BufferUtilitiesNS.writeString(n, d, t, "gbk"), r.information("peerId:", d), t = n.writeUInt32LE(0, t), r.information("taskCount:", 0), t = n.writeUInt32LE(0, t), r.information("businessFlag:", 0), n = n.slice(0, t), n = i.ShubCryptoNS.encryptHttpBuffer(n), r.information("<--createUserFluxBuffer"), n
        }, e.praseUserFluxBuffer = function (e) {
            r.information("--\x3epraseUserFluxBuffer");
            let t = null;
            try {
                e = i.ShubCryptoNS.decryptHttpBuffer(e);
                let n = 0, o = e.readUInt32LE(n);
                r.information("protocolVersion:", o), n += 4;
                let s = e.readUInt32LE(n);
                r.information("sequence:", s), n += 4;
                let l = e.readUInt32LE(n);
                r.information("commandLegth:", l), n += 4;
                let u = e.readUInt32LE(n);
                r.information("thunderVersion:", u), n += 4;
                let d = e.readUInt16LE(n);
                r.information("compressFlag:", d), n += 2;
                let c = e.readUInt16LE(n);
                r.information("commandType:", c), n += 2;
                let h = e.readUInt32LE(n);
                r.information("result:", h), n += 4;
                let f = a.BufferUtilitiesNS.readString(e, n, "gbk"), g = f[1];
                r.information("message:", g), n = f[0];
                let p = a.BufferUtilitiesNS.readUInt64LE(e, n), k = p[1];
                r.information("capacity:", k), n = p[0];
                let m = (p = a.BufferUtilitiesNS.readUInt64LE(e, n))[1];
                r.information("remain:", m), n = p[0];
                let T = (p = a.BufferUtilitiesNS.readUInt64LE(e, n))[1];
                r.information("need:", T), n = p[0], t = {result: h, capacity: k}
            } catch (e) {
                r.warning("praseUserFluxBuffer", e)
            }
            return r.information("<--praseUserFluxBuffer"), t
        }
    }(t.UserHttpPackageNS || (t.UserHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(32), s = n(34), l = a.default.getLogger("magnet-listener"),
        u = r.DownloadKernelTaskManager.getTaskManager(), d = s.DownloadKernelEventManager.getEventManager();
    const c = new class {
        constructor() {
            this.listenerMap = {}
        }

        addRef(e, t) {
            this.listenerMap.hasOwnProperty(e) ? l.information("listener addRef") : (l.information("listener addRef not in map to attachTaskStatus"), this.attachTaskStatus(e));
            let n = this.listenerMap[e];
            n.callbacks.push(t), n.counter++
        }

        release(e) {
            do {
                if (!this.listenerMap.hasOwnProperty(e)) break;
                let t = this.listenerMap[e];
                t.counter--, 0 === t.counter ? (l.information("release listener to remove"), this.detachTaskStatus(t.cookie), t.cookie = -1, u.stopTask(e), u.deleteTask(e, !1).catch(), delete this.listenerMap[e]) : l.information("release listener remain", t.counter)
            } while (0)
        }

        fireAll(e, t) {
            do {
                if (!this.listenerMap.hasOwnProperty(e)) {
                    l.information("fire callback but maybe already release");
                    break
                }
                let n = this.listenerMap[e];
                if (0 === n.counter) break;
                for (let i of n.callbacks) i(e, t).catch(), this.release(e)
            } while (0)
        }

        attachTaskStatus(e) {
            let t = d.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => i(this, void 0, void 0, function* () {
                do {
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let n = t[1];
                    for (let t = 0; t < n.length; ++t) {
                        let i = n[t];
                        if (!i) continue;
                        let a = i.getTaskStatus(), r = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskType),
                            s = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        l.information("magnet channelRMNewTaskDownloadTorrent taskStatus", a, s, e), r === o.DownloadKernel.TaskType.Magnet && s === e && (a === o.DownloadKernel.TaskStatus.Succeeded || a === o.DownloadKernel.TaskStatus.Seeding ? this.fireAll(s, !0) : a === o.DownloadKernel.TaskStatus.Failed && this.fireAll(s, !1))
                    }
                } while (0)
            }));
            l.information("attachTaskEvent StatusChanged", t);
            let n = {cookie: t, counter: 0, callbacks: []};
            this.listenerMap[e] = n
        }

        detachTaskStatus(e) {
            l.information("detachTaskEvent StatusChanged", e), d.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, e)
        }
    };
    !function (e) {
        e.addRef = function (e, t) {
            return c.addRef(e, t)
        }, e.release = function (e) {
            return c.release(e)
        }
    }(t.MagnetListenerNS || (t.MagnetListenerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(719), o = n(24), r = n(10), s = n(38), l = n(23), u = n(1), d = n(568), c = n(13), h = n(197), f = n(8),
        g = n(32), p = n(34), k = n(134), m = g.DownloadKernelTaskManager.getTaskManager(),
        T = p.DownloadKernelEventManager.getEventManager(), v = u.default.getLogger("Thunder.plugin-loader");
    !function (e) {
        e.pluginLoader = new class {
            constructor() {
                this.plugins = null, this.currentDir = `${__rootDir}/plugins/`, this.configName = `${this.currentDir}plugin-loader-config.json`, this.unzipConfig = `${this.currentDir}plugin-unzip-config.json`, this.isUnzipConfigLoad = !1, this.unzipPlugins = {}, this.emitter = null, this.updatePlugins = null, this.updatePluginsConfig = `${this.currentDir}plugin-update-config.xml`, this.downloadPluginsStat = [], this.unzipPluginsStat = [], this.loadPluginsStat = [], this.taskStatusChangedEventTable = [], this.handlePluginIndex = 0, h.quitPromises.add(() => new Promise(e => i(this, void 0, void 0, function* () {
                    v.information("stat before quit"), this.sendPluginStat(this.downloadPluginsStat, "plugin_download"), this.downloadPluginsStat = [], this.sendPluginStat(this.unzipPluginsStat, "plugin_decompression"), this.unzipPluginsStat = [], this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.loadPluginsStat = [], yield this.saveUpdatePluginsConfig(), yield this.saveUnzipConfig(), e(!0)
                })))
            }

            getPluginsCount() {
                return this.plugins ? this.plugins.data.length : 0
            }

            getPluginFromName(e) {
                if (!this.plugins) return null;
                for (let t = 0; t < this.getPluginsCount(); ++t) if (e === this.plugins.data[t].name) return this.plugins.data[t];
                return null
            }

            updateStat(e, t) {
                let n = 0;
                for (n = 0; n < e.length; ++n) if (e[n].name === t.name) {
                    e[n].version = t.version, e[n].state = t.state, e[n].errorCode = t.errorCode;
                    break
                }
                n >= e.length && e.push(t)
            }

            sendPluginStat(e, t) {
                v.information("sendPluginStat enter");
                let n = "", i = 0;
                for (let a = 0; a < e.length; ++a) n += `key=${e[a].name},version=${e[a].version},value=${e[a].state},errorCode=${e[a].errorCode};`, ++i >= 16 && (v.information("sendPluginStat", t, n), n = encodeURIComponent(n), c.XLStatNS.trackEvent("core_event", t, "", 0, 0, 0, 0, n), i = 0, n = "");
                "" !== n && (v.information("sendPluginStat", t, n), n = encodeURIComponent(n), c.XLStatNS.trackEvent("core_event", t, "", 0, 0, 0, 0, n))
            }

            saveUpdatePluginsConfig() {
                return i(this, void 0, void 0, function* () {
                    v.information("saveUpdatePluginsConfig enter", this.updatePlugins);
                    do {
                        if (null === this.updatePlugins || 0 === this.updatePlugins.data.length) break;
                        let e = (new d.Builder).buildObject(this.updatePlugins);
                        yield r.FileSystemAWNS.writeFileAW(`${this.updatePluginsConfig}`, e.toString())
                    } while (0)
                })
            }

            updateUpPlugins(e) {
                return i(this, void 0, void 0, function* () {
                    if (yield r.FileSystemAWNS.existsAW(this.currentDir + e.name + "/plugin-config-file.xml")) {
                        let t = {plugin: {name: e.name, version: e.version, md5: e.md5, success: 0}};
                        null === this.updatePlugins && (this.updatePlugins = {data: []}), this.updatePlugins.data.push(t)
                    }
                })
            }

            loadUnzipConfig() {
                return i(this, void 0, void 0, function* () {
                    v.information("loadUnzipConfig enter");
                    do {
                        if (this.isUnzipConfigLoad) break;
                        let e = yield r.FileSystemAWNS.readFileAW(`${this.unzipConfig}`);
                        if (null !== e) try {
                            this.unzipPlugins = JSON.parse(e.toString()), this.isUnzipConfigLoad = !0
                        } catch (e) {
                            v.warning(e)
                        }
                    } while (0);
                    return this.isUnzipConfigLoad
                })
            }

            saveUnzipConfig() {
                return i(this, void 0, void 0, function* () {
                    let e = void 0;
                    try {
                        e = JSON.stringify(this.unzipPlugins)
                    } catch (e) {
                        v.warning(e)
                    }
                    void 0 !== e && (v.information(e), yield r.FileSystemAWNS.writeFileAW(`${this.unzipConfig}`, e))
                })
            }

            isPluginUnzip(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1, n = e.name;
                    return null !== this.unzipPlugins && null !== this.unzipPlugins[`${n}`] && void 0 !== this.unzipPlugins[`${n}`] && this.unzipPlugins[`${n}`].md5 === e.md5 && (t = this.unzipPlugins[`${n}`].unzipstate), t
                })
            }

            updatePluginUnzip(e, t) {
                let n = e.name;
                null !== this.unzipPlugins && (this.unzipPlugins[`${n}`] = t)
            }

            startDownloadPlugins(e, t, a, s, l, u) {
                return i(this, void 0, void 0, function* () {
                })
            }

            loadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    v.information("loadPlugin enter");
                    let t = null;
                    const n = `${this.currentDir}${e}/index`, i = `${this.currentDir}${e}/config.json`;
                    let o = yield r.FileSystemAWNS.existsAW(`${n}.js`), s = yield r.FileSystemAWNS.existsAW(`${i}`);
                    v.information("loadPlugin outProcess", i, s);
                    let l = yield r.FileSystemAWNS.existsAW(this.currentDir + e + "/plugin-config-file.xml");
                    if (s) {
                        let n = require(i);
                        if (v.information("loadPlugin config", n), n && n.main) {
                            let i = `${this.currentDir}${e}/${n.main}`;
                            if (yield r.FileSystemAWNS.existsAW(i)) {
                                const n = a.fork(i, ["--type=xdas-plugin-process", `--xdas-plugin-name=${e}`]);
                                v.information("loadPlugin fork", n), t = {}
                            }
                        }
                    } else o && (t = require(n));
                    let u = this.getPluginFromName(e);
                    return u ? (t || l ? this.updateStat(this.loadPluginsStat, {
                        name: u.name,
                        version: u.version,
                        state: "success",
                        errorCode: 0
                    }) : this.updateStat(this.loadPluginsStat, {
                        name: u.name,
                        version: u.version,
                        state: "fail",
                        errorCode: -1
                    }), this.loadPluginsStat.length >= this.getPluginsCount() && (this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.loadPluginsStat = []), v.information("loadPlugin leave", t), t) : t
                })
            }

            loadConfig(e, t) {
                return i(this, void 0, void 0, function* () {
                    if (v.information("loadConfig enter"), this.plugins = e, t) {
                        let t = void 0;
                        try {
                            t = JSON.stringify(e)
                        } catch (e) {
                            v.warning(e)
                        }
                        void 0 !== t && (v.information(t), yield r.FileSystemAWNS.writeFileAW(`${this.configName}`, t))
                    }
                    this.loadUnzipConfig().then(() => {
                        this.downloadPlugins()
                    }).catch()
                })
            }

            checkFile(e) {
                return i(this, void 0, void 0, function* () {
                    v.information("checkFile enter");
                    const t = `${this.currentDir}${e.name}.zip`;
                    let n = yield r.FileSystemAWNS.existsAW(t);
                    return n && (n = yield s.ToolsUtilitiesAWNS.matchFileMd5(t, e.md5)), n
                })
            }

            checkLoadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    v.information("checkLoadPlugin enter"), void 0 !== e.loadtype && (1 === e.loadtype && void 0 !== e.time && e.time >= 0 ? setTimeout(() => {
                        this.loadPlugin(e.name)
                    }, 1e3 * e.time) : 2 === e.loadtype && null !== this.emitter && this.emitter.emit(l.NodeEventMesssageNS.eventPluginLoderPluginReady, e.name))
                })
            }

            onDownloadPluginFinish(e, t) {
                return i(this, void 0, void 0, function* () {
                    v.information("onDownloadPluginFinish bSuccess:", e, "name:", t.name, "index:", this.handlePluginIndex);
                    const i = `${this.currentDir}${t.name}.zip`, a = `${this.currentDir}${t.name}/`;
                    let o = !1, s = !1, l = !1;
                    if (e) {
                        let e = yield r.FileSystemAWNS.existsAW(a);
                        if (e && (l = yield this.isPluginUnzip(t)), s = e, o = !l) {
                            const {UnzipUtilitiesAWNS: e} = yield Promise.resolve().then(() => n(202));
                            (s = yield e.uncompressZipFile(a, i)) ? (yield this.updateUpPlugins(t), this.updateStat(this.unzipPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "success",
                                errorCode: 0
                            })) : this.updateStat(this.unzipPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "fail",
                                errorCode: -1
                            })
                        }
                        if (s) {
                            let e = {version: t.version, md5: t.md5, unzipstate: !0};
                            this.updatePluginUnzip(t, e), yield this.checkLoadPlugin(t), ++this.handlePluginIndex
                        } else ++this.handlePluginIndex
                    } else ++this.handlePluginIndex;
                    this.handlePluginIndex === this.getPluginsCount() && (v.information("send stat and save config after load finish"), this.sendPluginStat(this.downloadPluginsStat, "plugin_download"), this.downloadPluginsStat = [], this.sendPluginStat(this.unzipPluginsStat, "plugin_decompression"), this.unzipPluginsStat = [], this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.loadPluginsStat = [], yield this.saveUpdatePluginsConfig(), yield this.saveUnzipConfig())
                })
            }

            checkDownloadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    if (v.information("checkDownloadPlugin enter"), yield this.checkFile(e)) yield this.onDownloadPluginFinish(!0, e); else {
                        let t = {version: e.version, md5: e.md5, unzipstate: !1};
                        this.updatePluginUnzip(e, t), yield this.downloadPlugin(e, this.onDownloadPluginFinish.bind(this))
                    }
                })
            }

            detachTakStatusChangeEvent(e) {
                null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (v.information("取消监听 ", this.taskStatusChangedEventTable[e]), T.detachTaskEvent(f.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
            }

            attachTaskStatusChangedEvent(e, t) {
                v.information("attachTaskStatusChangedEvent taskId: ", e), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = T.attachTaskEvent(f.DownloadKernel.TaskEventType.StatusChanged, (...n) => i(this, void 0, void 0, function* () {
                    let i = !1;
                    do {
                        if (!n) {
                            v.information("args is null");
                            break
                        }
                        if (n[0] !== f.DownloadKernel.TaskEventType.StatusChanged) {
                            v.information("args[0] is not StatusChanged");
                            break
                        }
                        let a = n[1];
                        if (!a) {
                            v.information("taskList is null");
                            break
                        }
                        for (let n = 0; n < a.length; ++n) {
                            let o = a[n];
                            if (!o) continue;
                            if (o.getId() !== e) continue;
                            let r = o.getTaskStatus();
                            v.information("get status ", r), r === f.DownloadKernel.TaskStatus.Succeeded ? (yield this.onDownloadPluginFinish(!0, t), this.updateStat(this.downloadPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "success",
                                errorCode: 0
                            }), this.detachTakStatusChangeEvent(e)) : r === f.DownloadKernel.TaskStatus.Failed && (yield this.onDownloadPluginFinish(!1, t), this.updateStat(this.downloadPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "fail",
                                errorCode: -1
                            }), this.detachTakStatusChangeEvent(e)), i = !0
                        }
                    } while (0);
                    return i
                })))
            }

            downloadPlugin(e, t) {
                return i(this, void 0, void 0, function* () {
                    v.information("downloadPlugin enter");
                    let a = !1;
                    const s = `${this.currentDir}`, l = `${this.currentDir}${e.name}.zip`, u = `${e.name}.zip`;
                    do {
                        if (void 0 !== e.url) {
                            let t = null;
                            try {
                                o.default.defaults.adapter = n(22), t = yield o.default.get(e.url, {responseType: "arraybuffer"})
                            } catch (e) {
                                break
                            }
                            if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data) {
                                if (yield r.FileSystemAWNS.writeFileAW(l, t.data)) {
                                    a = yield this.checkFile(e);
                                    break
                                }
                                break
                            }
                            break
                        }
                    } while (0);
                    a ? (t(!0, e), this.updateStat(this.downloadPluginsStat, {
                        name: e.name,
                        version: e.version,
                        state: "success",
                        errorCode: 0
                    }), yield r.FileSystemAWNS.unlinkAW(l + ".xltd"), yield r.FileSystemAWNS.unlinkAW(l + ".xltd.cfg")) : r.FileSystemAWNS.unlinkAW(l).then(() => i(this, void 0, void 0, function* () {
                        let t = {
                            taskBaseInfo: {savePath: s, taskName: u},
                            p2spTaskInfo: {url: e.url},
                            isBackground: !0
                        }, n = yield m.createTask(f.DownloadKernel.TaskType.P2sp, t);
                        if (null !== n) {
                            let t = n.getTaskAttribute(f.DownloadKernel.TaskAttribute.TaskId);
                            this.attachTaskStatusChangedEvent(t, e), k.DownloadDispatchNS.startTask(t)
                        }
                    })).catch()
                })
            }

            downloadPlugins() {
                if (v.information("downloadPlugins enter"), null !== this.plugins && null !== this.plugins.data && void 0 !== this.plugins.data) for (let e = 0; e < this.plugins.data.length; ++e) {
                    let t = this.plugins.data[e];
                    null !== t && void 0 !== t.name && void 0 !== t.status && t.status && this.checkDownloadPlugin(t).then().catch()
                }
            }
        }
    }(t.PluginLoaderNS || (t.PluginLoaderNS = {}))
}, function (e, t, n) {
    (function () {
        "use strict";
        var e, i, a, o, r, s = {}.hasOwnProperty;
        e = n(794), i = n(569).defaults, o = function (e) {
            return "string" == typeof e && (e.indexOf("&") >= 0 || e.indexOf(">") >= 0 || e.indexOf("<") >= 0)
        }, r = function (e) {
            return "<![CDATA[" + a(e) + "]]>"
        }, a = function (e) {
            return e.replace("]]>", "]]]]><![CDATA[>")
        }, t.Builder = function () {
            function t(e) {
                var t, n, a;
                for (t in this.options = {}, n = i[.2]) s.call(n, t) && (a = n[t], this.options[t] = a);
                for (t in e) s.call(e, t) && (a = e[t], this.options[t] = a)
            }

            return t.prototype.buildObject = function (t) {
                var n, a, l, u, d, c;
                return n = this.options.attrkey, a = this.options.charkey, 1 === Object.keys(t).length && this.options.rootName === i[.2].rootName ? t = t[d = Object.keys(t)[0]] : d = this.options.rootName, c = this, l = function (e, t) {
                    var i, u, d, h, f, g;
                    if ("object" != typeof t) c.options.cdata && o(t) ? e.raw(r(t)) : e.txt(t); else if (Array.isArray(t)) {
                        for (h in t) if (s.call(t, h)) for (f in u = t[h]) d = u[f], e = l(e.ele(f), d).up()
                    } else for (f in t) if (s.call(t, f)) if (u = t[f], f === n) {
                        if ("object" == typeof u) for (i in u) g = u[i], e = e.att(i, g)
                    } else if (f === a) e = c.options.cdata && o(u) ? e.raw(r(u)) : e.txt(u); else if (Array.isArray(u)) for (h in u) s.call(u, h) && (e = "string" == typeof (d = u[h]) ? c.options.cdata && o(d) ? e.ele(f).raw(r(d)).up() : e.ele(f, d).up() : l(e.ele(f), d).up()); else "object" == typeof u ? e = l(e.ele(f), u).up() : "string" == typeof u && c.options.cdata && o(u) ? e = e.ele(f).raw(r(u)).up() : (null == u && (u = ""), e = e.ele(f, u.toString()).up());
                    return e
                }, u = e.create(d, this.options.xmldec, this.options.doctype, {
                    headless: this.options.headless,
                    allowSurrogateChars: this.options.allowSurrogateChars
                }), l(u, t).end(this.options.renderOpts)
            }, t
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l;
        l = n(196), r = l.assign, s = l.isFunction, t = n(795), i = n(796), o = n(570), a = n(797), e.exports.create = function (e, n, i, a) {
            var o, s;
            if (null == e) throw new Error("Root element needs a name");
            return a = r({}, n, i, a), s = (o = new t(a)).element(e), a.headless || (o.declaration(a), null == a.pubID && null == a.sysID || o.doctype(a)), s
        }, e.exports.begin = function (e, n, a) {
            var o;
            return s(e) && (n = (o = [e, n])[0], a = o[1], e = {}), n ? new i(e, n, a) : new t(e)
        }, e.exports.stringWriter = function (e) {
            return new o(e)
        }, e.exports.streamWriter = function (e, t) {
            return new a(e, t)
        }
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r = {}.hasOwnProperty;
        o = n(196).isPlainObject, t = n(128), a = n(721), i = n(570), e.exports = function (e) {
            function n(e) {
                n.__super__.constructor.call(this, null), e || (e = {}), e.writer || (e.writer = new i), this.options = e, this.stringify = new a(e), this.isDocument = !0
            }

            return function (e, t) {
                for (var n in t) r.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, t), n.prototype.end = function (e) {
                var t;
                return e ? o(e) && (t = e, e = this.options.writer.set(t)) : e = this.options.writer, e.document(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).document(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, g, p, k, m, T, v, C, S = {}.hasOwnProperty;
        C = n(196), T = C.isObject, m = C.isFunction, v = C.isPlainObject, c = n(268), i = n(269), a = n(270), f = n(277), k = n(278), h = n(279), u = n(271), d = n(272), o = n(273), s = n(274), r = n(275), l = n(276), t = n(720), p = n(721), g = n(570), e.exports = function () {
            function e(e, t, n) {
                var i;
                e || (e = {}), e.writer ? v(e.writer) && (i = e.writer, e.writer = new g(i)) : e.writer = new g(e), this.options = e, this.writer = e.writer, this.stringify = new p(e), this.onDataCallback = t || function () {
                }, this.onEndCallback = n || function () {
                }, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null
            }

            return e.prototype.node = function (e, t, n) {
                var i;
                if (null == e) throw new Error("Missing node name");
                if (this.root && -1 === this.currentLevel) throw new Error("Document can only have one root node");
                return this.openCurrent(), e = e.valueOf(), null == t && (t = {}), t = t.valueOf(), T(t) || (n = (i = [t, n])[0], t = i[1]), this.currentNode = new c(this, e, t), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, null != n && this.text(n), this
            }, e.prototype.element = function (e, t, n) {
                return this.currentNode && this.currentNode instanceof d ? this.dtdElement.apply(this, arguments) : this.node(e, t, n)
            }, e.prototype.attribute = function (e, n) {
                var i, a;
                if (!this.currentNode || this.currentNode.children) throw new Error("att() can only be used immediately after an ele() call in callback mode");
                if (null != e && (e = e.valueOf()), T(e)) for (i in e) S.call(e, i) && (a = e[i], this.attribute(i, a)); else m(n) && (n = n.apply()), this.options.skipNullAttributes && null == n || (this.currentNode.attributes[e] = new t(this, e, n));
                return this
            }, e.prototype.text = function (e) {
                var t;
                return this.openCurrent(), t = new k(this, e), this.onData(this.writer.text(t, this.currentLevel + 1)), this
            }, e.prototype.cdata = function (e) {
                var t;
                return this.openCurrent(), t = new i(this, e), this.onData(this.writer.cdata(t, this.currentLevel + 1)), this
            }, e.prototype.comment = function (e) {
                var t;
                return this.openCurrent(), t = new a(this, e), this.onData(this.writer.comment(t, this.currentLevel + 1)), this
            }, e.prototype.raw = function (e) {
                var t;
                return this.openCurrent(), t = new f(this, e), this.onData(this.writer.raw(t, this.currentLevel + 1)), this
            }, e.prototype.instruction = function (e, t) {
                var n, i, a, o, r;
                if (this.openCurrent(), null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (n = 0, o = e.length; n < o; n++) i = e[n], this.instruction(i); else if (T(e)) for (i in e) S.call(e, i) && (a = e[i], this.instruction(i, a)); else m(t) && (t = t.apply()), r = new h(this, e, t), this.onData(this.writer.processingInstruction(r, this.currentLevel + 1));
                return this
            }, e.prototype.declaration = function (e, t, n) {
                var i;
                if (this.openCurrent(), this.documentStarted) throw new Error("declaration() must be the first node");
                return i = new u(this, e, t, n), this.onData(this.writer.declaration(i, this.currentLevel + 1)), this
            }, e.prototype.doctype = function (e, t, n) {
                if (this.openCurrent(), null == e) throw new Error("Missing root node name");
                if (this.root) throw new Error("dtd() must come before the root node");
                return this.currentNode = new d(this, t, n), this.currentNode.rootNodeName = e, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this
            }, e.prototype.dtdElement = function (e, t) {
                var n;
                return this.openCurrent(), n = new r(this, e, t), this.onData(this.writer.dtdElement(n, this.currentLevel + 1)), this
            }, e.prototype.attList = function (e, t, n, i, a) {
                var r;
                return this.openCurrent(), r = new o(this, e, t, n, i, a), this.onData(this.writer.dtdAttList(r, this.currentLevel + 1)), this
            }, e.prototype.entity = function (e, t) {
                var n;
                return this.openCurrent(), n = new s(this, !1, e, t), this.onData(this.writer.dtdEntity(n, this.currentLevel + 1)), this
            }, e.prototype.pEntity = function (e, t) {
                var n;
                return this.openCurrent(), n = new s(this, !0, e, t), this.onData(this.writer.dtdEntity(n, this.currentLevel + 1)), this
            }, e.prototype.notation = function (e, t) {
                var n;
                return this.openCurrent(), n = new l(this, e, t), this.onData(this.writer.dtdNotation(n, this.currentLevel + 1)), this
            }, e.prototype.up = function () {
                if (this.currentLevel < 0) throw new Error("The document node has no parent");
                return this.currentNode ? (this.currentNode.children ? this.closeNode(this.currentNode) : this.openNode(this.currentNode), this.currentNode = null) : this.closeNode(this.openTags[this.currentLevel]), delete this.openTags[this.currentLevel], this.currentLevel--, this
            }, e.prototype.end = function () {
                for (; this.currentLevel >= 0;) this.up();
                return this.onEnd()
            }, e.prototype.openCurrent = function () {
                if (this.currentNode) return this.currentNode.children = !0, this.openNode(this.currentNode)
            }, e.prototype.openNode = function (e) {
                if (!e.isOpen) return !this.root && 0 === this.currentLevel && e instanceof c && (this.root = e), this.onData(this.writer.openNode(e, this.currentLevel)), e.isOpen = !0
            }, e.prototype.closeNode = function (e) {
                if (!e.isClosed) return this.onData(this.writer.closeNode(e, this.currentLevel)), e.isClosed = !0
            }, e.prototype.onData = function (e) {
                return this.documentStarted = !0, this.onDataCallback(e)
            }, e.prototype.onEnd = function () {
                return this.documentCompleted = !0, this.onEndCallback()
            }, e.prototype.ele = function () {
                return this.element.apply(this, arguments)
            }, e.prototype.nod = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.txt = function (e) {
                return this.text(e)
            }, e.prototype.dat = function (e) {
                return this.cdata(e)
            }, e.prototype.com = function (e) {
                return this.comment(e)
            }, e.prototype.ins = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.dec = function (e, t, n) {
                return this.declaration(e, t, n)
            }, e.prototype.dtd = function (e, t, n) {
                return this.doctype(e, t, n)
            }, e.prototype.e = function (e, t, n) {
                return this.element(e, t, n)
            }, e.prototype.n = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.t = function (e) {
                return this.text(e)
            }, e.prototype.d = function (e) {
                return this.cdata(e)
            }, e.prototype.c = function (e) {
                return this.comment(e)
            }, e.prototype.r = function (e) {
                return this.raw(e)
            }, e.prototype.i = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.att = function () {
                return this.currentNode && this.currentNode instanceof d ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.a = function () {
                return this.currentNode && this.currentNode instanceof d ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, e.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, e.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, e
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, g, p = {}.hasOwnProperty;
        l = n(271), u = n(272), t = n(269), i = n(270), d = n(268), h = n(277), f = n(278), c = n(279), a = n(273), o = n(275), r = n(274), s = n(276), g = n(722), e.exports = function (e) {
            function n(e, t) {
                n.__super__.constructor.call(this, t), this.stream = e
            }

            return function (e, t) {
                for (var n in t) p.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, g), n.prototype.document = function (e) {
                var t, n, a, o, r, s, d, h;
                for (n = 0, o = (s = e.children).length; n < o; n++) (t = s[n]).isLastRootNode = !1;
                for (e.children[e.children.length - 1].isLastRootNode = !0, h = [], a = 0, r = (d = e.children).length; a < r; a++) switch (t = d[a], !1) {
                    case!(t instanceof l):
                        h.push(this.declaration(t));
                        break;
                    case!(t instanceof u):
                        h.push(this.docType(t));
                        break;
                    case!(t instanceof i):
                        h.push(this.comment(t));
                        break;
                    case!(t instanceof c):
                        h.push(this.processingInstruction(t));
                        break;
                    default:
                        h.push(this.element(t))
                }
                return h
            }, n.prototype.attribute = function (e) {
                return this.stream.write(" " + e.name + '="' + e.value + '"')
            }, n.prototype.cdata = function (e, t) {
                return this.stream.write(this.space(t) + "<![CDATA[" + e.text + "]]>" + this.endline(e))
            }, n.prototype.comment = function (e, t) {
                return this.stream.write(this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.endline(e))
            }, n.prototype.declaration = function (e, t) {
                return this.stream.write(this.space(t)), this.stream.write('<?xml version="' + e.version + '"'), null != e.encoding && this.stream.write(' encoding="' + e.encoding + '"'), null != e.standalone && this.stream.write(' standalone="' + e.standalone + '"'), this.stream.write(this.spacebeforeslash + "?>"), this.stream.write(this.endline(e))
            }, n.prototype.docType = function (e, n) {
                var l, u, d, h;
                if (n || (n = 0), this.stream.write(this.space(n)), this.stream.write("<!DOCTYPE " + e.root().name), e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), e.children.length > 0) {
                    for (this.stream.write(" ["), this.stream.write(this.endline(e)), u = 0, d = (h = e.children).length; u < d; u++) switch (l = h[u], !1) {
                        case!(l instanceof a):
                            this.dtdAttList(l, n + 1);
                            break;
                        case!(l instanceof o):
                            this.dtdElement(l, n + 1);
                            break;
                        case!(l instanceof r):
                            this.dtdEntity(l, n + 1);
                            break;
                        case!(l instanceof s):
                            this.dtdNotation(l, n + 1);
                            break;
                        case!(l instanceof t):
                            this.cdata(l, n + 1);
                            break;
                        case!(l instanceof i):
                            this.comment(l, n + 1);
                            break;
                        case!(l instanceof c):
                            this.processingInstruction(l, n + 1);
                            break;
                        default:
                            throw new Error("Unknown DTD node type: " + l.constructor.name)
                    }
                    this.stream.write("]")
                }
                return this.stream.write(this.spacebeforeslash + ">"), this.stream.write(this.endline(e))
            }, n.prototype.element = function (e, n) {
                var a, o, r, s, l, u, g, k;
                for (l in n || (n = 0), k = this.space(n), this.stream.write(k + "<" + e.name), u = e.attributes) p.call(u, l) && (a = u[l], this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? this.stream.write("></" + e.name + ">") : this.stream.write(this.spacebeforeslash + "/>"); else if (this.pretty && 1 === e.children.length && null != e.children[0].value) this.stream.write(">"), this.stream.write(e.children[0].value), this.stream.write("</" + e.name + ">"); else {
                    for (this.stream.write(">" + this.newline), r = 0, s = (g = e.children).length; r < s; r++) switch (o = g[r], !1) {
                        case!(o instanceof t):
                            this.cdata(o, n + 1);
                            break;
                        case!(o instanceof i):
                            this.comment(o, n + 1);
                            break;
                        case!(o instanceof d):
                            this.element(o, n + 1);
                            break;
                        case!(o instanceof h):
                            this.raw(o, n + 1);
                            break;
                        case!(o instanceof f):
                            this.text(o, n + 1);
                            break;
                        case!(o instanceof c):
                            this.processingInstruction(o, n + 1);
                            break;
                        default:
                            throw new Error("Unknown XML node type: " + o.constructor.name)
                    }
                    this.stream.write(k + "</" + e.name + ">")
                }
                return this.stream.write(this.endline(e))
            }, n.prototype.processingInstruction = function (e, t) {
                return this.stream.write(this.space(t) + "<?" + e.target), e.value && this.stream.write(" " + e.value), this.stream.write(this.spacebeforeslash + "?>" + this.endline(e))
            }, n.prototype.raw = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, n.prototype.text = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, n.prototype.dtdAttList = function (e, t) {
                return this.stream.write(this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType), "#DEFAULT" !== e.defaultValueType && this.stream.write(" " + e.defaultValueType), e.defaultValue && this.stream.write(' "' + e.defaultValue + '"'), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.dtdElement = function (e, t) {
                return this.stream.write(this.space(t) + "<!ELEMENT " + e.name + " " + e.value), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.dtdEntity = function (e, t) {
                return this.stream.write(this.space(t) + "<!ENTITY"), e.pe && this.stream.write(" %"), this.stream.write(" " + e.name), e.value ? this.stream.write(' "' + e.value + '"') : (e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), e.nData && this.stream.write(" NDATA " + e.nData)), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.dtdNotation = function (e, t) {
                return this.stream.write(this.space(t) + "<!NOTATION " + e.name), e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.pubID ? this.stream.write(' PUBLIC "' + e.pubID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.endline = function (e) {
                return e.isLastRootNode ? "" : this.newline
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        "use strict";
        var e, i, a, o, r, s, l, u, d = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, c = {}.hasOwnProperty;
        l = n(799), a = n(59), e = n(801), s = n(723), u = n(802).setImmediate, i = n(569).defaults, o = function (e) {
            return "object" == typeof e && null != e && 0 === Object.keys(e).length
        }, r = function (e, t, n) {
            var i, a;
            for (i = 0, a = e.length; i < a; i++) t = (0, e[i])(t, n);
            return t
        }, t.Parser = function (n) {
            function h(e) {
                var n, a, o;
                if (this.parseString = d(this.parseString, this), this.reset = d(this.reset, this), this.assignOrPush = d(this.assignOrPush, this), this.processAsync = d(this.processAsync, this), !(this instanceof t.Parser)) return new t.Parser(e);
                for (n in this.options = {}, a = i[.2]) c.call(a, n) && (o = a[n], this.options[n] = o);
                for (n in e) c.call(e, n) && (o = e[n], this.options[n] = o);
                this.options.xmlns && (this.options.xmlnskey = this.options.attrkey + "ns"), this.options.normalizeTags && (this.options.tagNameProcessors || (this.options.tagNameProcessors = []), this.options.tagNameProcessors.unshift(s.normalize)), this.reset()
            }

            return function (e, t) {
                for (var n in t) c.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(h, a.EventEmitter), h.prototype.processAsync = function () {
                var e, t;
                try {
                    return this.remaining.length <= this.options.chunkSize ? (e = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(e), this.saxParser.close()) : (e = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(e), u(this.processAsync))
                } catch (e) {
                    if (t = e, !this.saxParser.errThrown) return this.saxParser.errThrown = !0, this.emit(t)
                }
            }, h.prototype.assignOrPush = function (e, t, n) {
                return t in e ? (e[t] instanceof Array || (e[t] = [e[t]]), e[t].push(n)) : this.options.explicitArray ? e[t] = [n] : e[t] = n
            }, h.prototype.reset = function () {
                var e, t, n, i, a;
                return this.removeAllListeners(), this.saxParser = l.parser(this.options.strict, {
                    trim: !1,
                    normalize: !1,
                    xmlns: this.options.xmlns
                }), this.saxParser.errThrown = !1, this.saxParser.onerror = (a = this, function (e) {
                    if (a.saxParser.resume(), !a.saxParser.errThrown) return a.saxParser.errThrown = !0, a.emit("error", e)
                }), this.saxParser.onend = function (e) {
                    return function () {
                        if (!e.saxParser.ended) return e.saxParser.ended = !0, e.emit("end", e.resultObject)
                    }
                }(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, i = [], e = this.options.attrkey, t = this.options.charkey, this.saxParser.onopentag = function (n) {
                    return function (a) {
                        var o, s, l, u, d;
                        if ((l = {})[t] = "", !n.options.ignoreAttrs) for (o in d = a.attributes) c.call(d, o) && (e in l || n.options.mergeAttrs || (l[e] = {}), s = n.options.attrValueProcessors ? r(n.options.attrValueProcessors, a.attributes[o], o) : a.attributes[o], u = n.options.attrNameProcessors ? r(n.options.attrNameProcessors, o) : o, n.options.mergeAttrs ? n.assignOrPush(l, u, s) : l[e][u] = s);
                        return l["#name"] = n.options.tagNameProcessors ? r(n.options.tagNameProcessors, a.name) : a.name, n.options.xmlns && (l[n.options.xmlnskey] = {
                            uri: a.uri,
                            local: a.local
                        }), i.push(l)
                    }
                }(this), this.saxParser.onclosetag = function (e) {
                    return function () {
                        var n, a, s, l, u, d, h, f, g, p;
                        if (d = i.pop(), u = d["#name"], e.options.explicitChildren && e.options.preserveChildrenOrder || delete d["#name"], !0 === d.cdata && (n = d.cdata, delete d.cdata), g = i[i.length - 1], d[t].match(/^\s*$/) && !n ? (a = d[t], delete d[t]) : (e.options.trim && (d[t] = d[t].trim()), e.options.normalize && (d[t] = d[t].replace(/\s{2,}/g, " ").trim()), d[t] = e.options.valueProcessors ? r(e.options.valueProcessors, d[t], u) : d[t], 1 === Object.keys(d).length && t in d && !e.EXPLICIT_CHARKEY && (d = d[t])), o(d) && (d = "" !== e.options.emptyTag ? e.options.emptyTag : a), null != e.options.validator && (p = "/" + function () {
                            var e, t, n;
                            for (n = [], e = 0, t = i.length; e < t; e++) l = i[e], n.push(l["#name"]);
                            return n
                        }().concat(u).join("/"), function () {
                            var t;
                            try {
                                d = e.options.validator(p, g && g[u], d)
                            } catch (n) {
                                return t = n, e.emit("error", t)
                            }
                        }()), e.options.explicitChildren && !e.options.mergeAttrs && "object" == typeof d) if (e.options.preserveChildrenOrder) {
                            if (g) {
                                for (s in g[e.options.childkey] = g[e.options.childkey] || [], h = {}, d) c.call(d, s) && (h[s] = d[s]);
                                g[e.options.childkey].push(h), delete d["#name"], 1 === Object.keys(d).length && t in d && !e.EXPLICIT_CHARKEY && (d = d[t])
                            }
                        } else l = {}, e.options.attrkey in d && (l[e.options.attrkey] = d[e.options.attrkey], delete d[e.options.attrkey]), !e.options.charsAsChildren && e.options.charkey in d && (l[e.options.charkey] = d[e.options.charkey], delete d[e.options.charkey]), Object.getOwnPropertyNames(d).length > 0 && (l[e.options.childkey] = d), d = l;
                        return i.length > 0 ? e.assignOrPush(g, u, d) : (e.options.explicitRoot && (f = d, (d = {})[u] = f), e.resultObject = d, e.saxParser.ended = !0, e.emit("end", e.resultObject))
                    }
                }(this), n = function (e) {
                    return function (n) {
                        var a, o;
                        if (o = i[i.length - 1]) return o[t] += n, e.options.explicitChildren && e.options.preserveChildrenOrder && e.options.charsAsChildren && (e.options.includeWhiteChars || "" !== n.replace(/\\n/g, "").trim()) && (o[e.options.childkey] = o[e.options.childkey] || [], (a = {"#name": "__text__"})[t] = n, e.options.normalize && (a[t] = a[t].replace(/\s{2,}/g, " ").trim()), o[e.options.childkey].push(a)), o
                    }
                }(this), this.saxParser.ontext = n, this.saxParser.oncdata = function (e) {
                    var t;
                    if (t = n(e)) return t.cdata = !0
                }
            }, h.prototype.parseString = function (t, n) {
                var i;
                null != n && "function" == typeof n && (this.on("end", function (e) {
                    return this.reset(), n(null, e)
                }), this.on("error", function (e) {
                    return this.reset(), n(e)
                }));
                try {
                    return "" === (t = t.toString()).trim() ? (this.emit("end", null), !0) : (t = e.stripBOM(t), this.options.async ? (this.remaining = t, u(this.processAsync), this.saxParser) : this.saxParser.write(t).close())
                } catch (e) {
                    if (i = e, !this.saxParser.errThrown && !this.saxParser.ended) return this.emit("error", i), this.saxParser.errThrown = !0;
                    if (this.saxParser.ended) throw i
                }
            }, h
        }(), t.parseString = function (e, n, i) {
            var a, o;
            return null != i ? ("function" == typeof i && (a = i), "object" == typeof n && (o = n)) : ("function" == typeof n && (a = n), o = {}), new t.Parser(o).parseString(e, a)
        }
    }).call(this)
}, function (e, t, n) {
    !function (e) {
        e.parser = function (e, t) {
            return new a(e, t)
        }, e.SAXParser = a, e.SAXStream = r, e.createStream = function (e, t) {
            return new r(e, t)
        }, e.MAX_BUFFER_LENGTH = 65536;
        var t,
            i = ["comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script"];

        function a(t, n) {
            if (!(this instanceof a)) return new a(t, n);
            !function (e) {
                for (var t = 0, n = i.length; t < n; t++) e[i[t]] = ""
            }(this), this.q = this.c = "", this.bufferCheckPosition = e.MAX_BUFFER_LENGTH, this.opt = n || {}, this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags, this.looseCase = this.opt.lowercase ? "toLowerCase" : "toUpperCase", this.tags = [], this.closed = this.closedRoot = this.sawRoot = !1, this.tag = this.error = null, this.strict = !!t, this.noscript = !(!t && !this.opt.noscript), this.state = I.BEGIN, this.strictEntities = this.opt.strictEntities, this.ENTITIES = this.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), this.attribList = [], this.opt.xmlns && (this.ns = Object.create(c)), this.trackPosition = !1 !== this.opt.position, this.trackPosition && (this.position = this.line = this.column = 0), A(this, "onready")
        }

        e.EVENTS = ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"], Object.create || (Object.create = function (e) {
            function t() {
            }

            return t.prototype = e, new t
        }), Object.keys || (Object.keys = function (e) {
            var t = [];
            for (var n in e) e.hasOwnProperty(n) && t.push(n);
            return t
        }), a.prototype = {
            end: function () {
                E(this)
            }, write: function (t) {
                if (this.error) throw this.error;
                if (this.closed) return x(this, "Cannot write after close. Assign an onready handler.");
                if (null === t) return E(this);
                "object" == typeof t && (t = t.toString());
                var n = 0, a = "";
                for (; a = V(t, n++), this.c = a, a;) switch (this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++), this.state) {
                    case I.BEGIN:
                        if (this.state = I.BEGIN_WHITESPACE, "\ufeff" === a) continue;
                        K(this, a);
                        continue;
                    case I.BEGIN_WHITESPACE:
                        K(this, a);
                        continue;
                    case I.TEXT:
                        if (this.sawRoot && !this.closedRoot) {
                            for (var o = n - 1; a && "<" !== a && "&" !== a;) (a = V(t, n++)) && this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++);
                            this.textNode += t.substring(o, n - 1)
                        }
                        "<" !== a || this.sawRoot && this.closedRoot && !this.strict ? (k(a) || this.sawRoot && !this.closedRoot || P(this, "Text data outside of root node."), "&" === a ? this.state = I.TEXT_ENTITY : this.textNode += a) : (this.state = I.OPEN_WAKA, this.startTagPosition = this.position);
                        continue;
                    case I.SCRIPT:
                        "<" === a ? this.state = I.SCRIPT_ENDING : this.script += a;
                        continue;
                    case I.SCRIPT_ENDING:
                        "/" === a ? this.state = I.CLOSE_TAG : (this.script += "<" + a, this.state = I.SCRIPT);
                        continue;
                    case I.OPEN_WAKA:
                        if ("!" === a) this.state = I.SGML_DECL, this.sgmlDecl = ""; else if (k(a)) ; else if (v(h, a)) this.state = I.OPEN_TAG, this.tagName = a; else if ("/" === a) this.state = I.CLOSE_TAG, this.tagName = ""; else if ("?" === a) this.state = I.PROC_INST, this.procInstName = this.procInstBody = ""; else {
                            if (P(this, "Unencoded <"), this.startTagPosition + 1 < this.position) {
                                var r = this.position - this.startTagPosition;
                                a = new Array(r).join(" ") + a
                            }
                            this.textNode += "<" + a, this.state = I.TEXT
                        }
                        continue;
                    case I.SGML_DECL:
                        (this.sgmlDecl + a).toUpperCase() === s ? (N(this, "onopencdata"), this.state = I.CDATA, this.sgmlDecl = "", this.cdata = "") : this.sgmlDecl + a === "--" ? (this.state = I.COMMENT, this.comment = "", this.sgmlDecl = "") : (this.sgmlDecl + a).toUpperCase() === l ? (this.state = I.DOCTYPE, (this.doctype || this.sawRoot) && P(this, "Inappropriately located doctype declaration"), this.doctype = "", this.sgmlDecl = "") : ">" === a ? (N(this, "onsgmldeclaration", this.sgmlDecl), this.sgmlDecl = "", this.state = I.TEXT) : m(a) ? (this.state = I.SGML_DECL_QUOTED, this.sgmlDecl += a) : this.sgmlDecl += a;
                        continue;
                    case I.SGML_DECL_QUOTED:
                        a === this.q && (this.state = I.SGML_DECL, this.q = ""), this.sgmlDecl += a;
                        continue;
                    case I.DOCTYPE:
                        ">" === a ? (this.state = I.TEXT, N(this, "ondoctype", this.doctype), this.doctype = !0) : (this.doctype += a, "[" === a ? this.state = I.DOCTYPE_DTD : m(a) && (this.state = I.DOCTYPE_QUOTED, this.q = a));
                        continue;
                    case I.DOCTYPE_QUOTED:
                        this.doctype += a, a === this.q && (this.q = "", this.state = I.DOCTYPE);
                        continue;
                    case I.DOCTYPE_DTD:
                        this.doctype += a, "]" === a ? this.state = I.DOCTYPE : m(a) && (this.state = I.DOCTYPE_DTD_QUOTED, this.q = a);
                        continue;
                    case I.DOCTYPE_DTD_QUOTED:
                        this.doctype += a, a === this.q && (this.state = I.DOCTYPE_DTD, this.q = "");
                        continue;
                    case I.COMMENT:
                        "-" === a ? this.state = I.COMMENT_ENDING : this.comment += a;
                        continue;
                    case I.COMMENT_ENDING:
                        "-" === a ? (this.state = I.COMMENT_ENDED, this.comment = _(this.opt, this.comment), this.comment && N(this, "oncomment", this.comment), this.comment = "") : (this.comment += "-" + a, this.state = I.COMMENT);
                        continue;
                    case I.COMMENT_ENDED:
                        ">" !== a ? (P(this, "Malformed comment"), this.comment += "--" + a, this.state = I.COMMENT) : this.state = I.TEXT;
                        continue;
                    case I.CDATA:
                        "]" === a ? this.state = I.CDATA_ENDING : this.cdata += a;
                        continue;
                    case I.CDATA_ENDING:
                        "]" === a ? this.state = I.CDATA_ENDING_2 : (this.cdata += "]" + a, this.state = I.CDATA);
                        continue;
                    case I.CDATA_ENDING_2:
                        ">" === a ? (this.cdata && N(this, "oncdata", this.cdata), N(this, "onclosecdata"), this.cdata = "", this.state = I.TEXT) : "]" === a ? this.cdata += "]" : (this.cdata += "]]" + a, this.state = I.CDATA);
                        continue;
                    case I.PROC_INST:
                        "?" === a ? this.state = I.PROC_INST_ENDING : k(a) ? this.state = I.PROC_INST_BODY : this.procInstName += a;
                        continue;
                    case I.PROC_INST_BODY:
                        if (!this.procInstBody && k(a)) continue;
                        "?" === a ? this.state = I.PROC_INST_ENDING : this.procInstBody += a;
                        continue;
                    case I.PROC_INST_ENDING:
                        ">" === a ? (N(this, "onprocessinginstruction", {
                            name: this.procInstName,
                            body: this.procInstBody
                        }), this.procInstName = this.procInstBody = "", this.state = I.TEXT) : (this.procInstBody += "?" + a, this.state = I.PROC_INST_BODY);
                        continue;
                    case I.OPEN_TAG:
                        v(f, a) ? this.tagName += a : (M(this), ">" === a ? U(this) : "/" === a ? this.state = I.OPEN_TAG_SLASH : (k(a) || P(this, "Invalid character in tag name"), this.state = I.ATTRIB));
                        continue;
                    case I.OPEN_TAG_SLASH:
                        ">" === a ? (U(this, !0), L(this)) : (P(this, "Forward-slash in opening tag not followed by >"), this.state = I.ATTRIB);
                        continue;
                    case I.ATTRIB:
                        if (k(a)) continue;
                        ">" === a ? U(this) : "/" === a ? this.state = I.OPEN_TAG_SLASH : v(h, a) ? (this.attribName = a, this.attribValue = "", this.state = I.ATTRIB_NAME) : P(this, "Invalid attribute name");
                        continue;
                    case I.ATTRIB_NAME:
                        "=" === a ? this.state = I.ATTRIB_VALUE : ">" === a ? (P(this, "Attribute without value"), this.attribValue = this.attribName, O(this), U(this)) : k(a) ? this.state = I.ATTRIB_NAME_SAW_WHITE : v(f, a) ? this.attribName += a : P(this, "Invalid attribute name");
                        continue;
                    case I.ATTRIB_NAME_SAW_WHITE:
                        if ("=" === a) this.state = I.ATTRIB_VALUE; else {
                            if (k(a)) continue;
                            P(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", N(this, "onattribute", {
                                name: this.attribName,
                                value: ""
                            }), this.attribName = "", ">" === a ? U(this) : v(h, a) ? (this.attribName = a, this.state = I.ATTRIB_NAME) : (P(this, "Invalid attribute name"), this.state = I.ATTRIB)
                        }
                        continue;
                    case I.ATTRIB_VALUE:
                        if (k(a)) continue;
                        m(a) ? (this.q = a, this.state = I.ATTRIB_VALUE_QUOTED) : (P(this, "Unquoted attribute value"), this.state = I.ATTRIB_VALUE_UNQUOTED, this.attribValue = a);
                        continue;
                    case I.ATTRIB_VALUE_QUOTED:
                        if (a !== this.q) {
                            "&" === a ? this.state = I.ATTRIB_VALUE_ENTITY_Q : this.attribValue += a;
                            continue
                        }
                        O(this), this.q = "", this.state = I.ATTRIB_VALUE_CLOSED;
                        continue;
                    case I.ATTRIB_VALUE_CLOSED:
                        k(a) ? this.state = I.ATTRIB : ">" === a ? U(this) : "/" === a ? this.state = I.OPEN_TAG_SLASH : v(h, a) ? (P(this, "No whitespace between attributes"), this.attribName = a, this.attribValue = "", this.state = I.ATTRIB_NAME) : P(this, "Invalid attribute name");
                        continue;
                    case I.ATTRIB_VALUE_UNQUOTED:
                        if (!T(a)) {
                            "&" === a ? this.state = I.ATTRIB_VALUE_ENTITY_U : this.attribValue += a;
                            continue
                        }
                        O(this), ">" === a ? U(this) : this.state = I.ATTRIB;
                        continue;
                    case I.CLOSE_TAG:
                        if (this.tagName) ">" === a ? L(this) : v(f, a) ? this.tagName += a : this.script ? (this.script += "</" + this.tagName, this.tagName = "", this.state = I.SCRIPT) : (k(a) || P(this, "Invalid tagname in closing tag"), this.state = I.CLOSE_TAG_SAW_WHITE); else {
                            if (k(a)) continue;
                            C(h, a) ? this.script ? (this.script += "</" + a, this.state = I.SCRIPT) : P(this, "Invalid tagname in closing tag.") : this.tagName = a
                        }
                        continue;
                    case I.CLOSE_TAG_SAW_WHITE:
                        if (k(a)) continue;
                        ">" === a ? L(this) : P(this, "Invalid characters in closing tag");
                        continue;
                    case I.TEXT_ENTITY:
                    case I.ATTRIB_VALUE_ENTITY_Q:
                    case I.ATTRIB_VALUE_ENTITY_U:
                        var u, d;
                        switch (this.state) {
                            case I.TEXT_ENTITY:
                                u = I.TEXT, d = "textNode";
                                break;
                            case I.ATTRIB_VALUE_ENTITY_Q:
                                u = I.ATTRIB_VALUE_QUOTED, d = "attribValue";
                                break;
                            case I.ATTRIB_VALUE_ENTITY_U:
                                u = I.ATTRIB_VALUE_UNQUOTED, d = "attribValue"
                        }
                        ";" === a ? (this[d] += B(this), this.entity = "", this.state = u) : v(this.entity.length ? p : g, a) ? this.entity += a : (P(this, "Invalid character in entity name"), this[d] += "&" + this.entity + a, this.entity = "", this.state = u);
                        continue;
                    default:
                        throw new Error(this, "Unknown state: " + this.state)
                }
                this.position >= this.bufferCheckPosition && function (t) {
                    for (var n = Math.max(e.MAX_BUFFER_LENGTH, 10), a = 0, o = 0, r = i.length; o < r; o++) {
                        var s = t[i[o]].length;
                        if (s > n) switch (i[o]) {
                            case"textNode":
                                D(t);
                                break;
                            case"cdata":
                                N(t, "oncdata", t.cdata), t.cdata = "";
                                break;
                            case"script":
                                N(t, "onscript", t.script), t.script = "";
                                break;
                            default:
                                x(t, "Max buffer length exceeded: " + i[o])
                        }
                        a = Math.max(a, s)
                    }
                    var l = e.MAX_BUFFER_LENGTH - a;
                    t.bufferCheckPosition = l + t.position
                }(this);
                return this
            }
            /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */, resume: function () {
                return this.error = null, this
            }, close: function () {
                return this.write(null)
            }, flush: function () {
                var e;
                D(e = this), "" !== e.cdata && (N(e, "oncdata", e.cdata), e.cdata = ""), "" !== e.script && (N(e, "onscript", e.script), e.script = "")
            }
        };
        try {
            t = n(81).Stream
        } catch (e) {
            t = function () {
            }
        }
        var o = e.EVENTS.filter(function (e) {
            return "error" !== e && "end" !== e
        });

        function r(e, n) {
            if (!(this instanceof r)) return new r(e, n);
            t.apply(this), this._parser = new a(e, n), this.writable = !0, this.readable = !0;
            var i = this;
            this._parser.onend = function () {
                i.emit("end")
            }, this._parser.onerror = function (e) {
                i.emit("error", e), i._parser.error = null
            }, this._decoder = null, o.forEach(function (e) {
                Object.defineProperty(i, "on" + e, {
                    get: function () {
                        return i._parser["on" + e]
                    }, set: function (t) {
                        if (!t) return i.removeAllListeners(e), i._parser["on" + e] = t, t;
                        i.on(e, t)
                    }, enumerable: !0, configurable: !1
                })
            })
        }

        r.prototype = Object.create(t.prototype, {constructor: {value: r}}), r.prototype.write = function (e) {
            if ("function" == typeof Buffer && "function" == typeof Buffer.isBuffer && Buffer.isBuffer(e)) {
                if (!this._decoder) {
                    var t = n(800).StringDecoder;
                    this._decoder = new t("utf8")
                }
                e = this._decoder.write(e)
            }
            return this._parser.write(e.toString()), this.emit("data", e), !0
        }, r.prototype.end = function (e) {
            return e && e.length && this.write(e), this._parser.end(), !0
        }, r.prototype.on = function (e, n) {
            var i = this;
            return i._parser["on" + e] || -1 === o.indexOf(e) || (i._parser["on" + e] = function () {
                var t = 1 === arguments.length ? [arguments[0]] : Array.apply(null, arguments);
                t.splice(0, 0, e), i.emit.apply(i, t)
            }), t.prototype.on.call(i, e, n)
        };
        var s = "[CDATA[", l = "DOCTYPE", u = "http://www.w3.org/XML/1998/namespace",
            d = "http://www.w3.org/2000/xmlns/", c = {xml: u, xmlns: d},
            h = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
            f = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,
            g = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
            p = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;

        function k(e) {
            return " " === e || "\n" === e || "\r" === e || "\t" === e
        }

        function m(e) {
            return '"' === e || "'" === e
        }

        function T(e) {
            return ">" === e || k(e)
        }

        function v(e, t) {
            return e.test(t)
        }

        function C(e, t) {
            return !v(e, t)
        }

        var S, y, w, I = 0;
        for (var b in e.STATE = {
            BEGIN: I++,
            BEGIN_WHITESPACE: I++,
            TEXT: I++,
            TEXT_ENTITY: I++,
            OPEN_WAKA: I++,
            SGML_DECL: I++,
            SGML_DECL_QUOTED: I++,
            DOCTYPE: I++,
            DOCTYPE_QUOTED: I++,
            DOCTYPE_DTD: I++,
            DOCTYPE_DTD_QUOTED: I++,
            COMMENT_STARTING: I++,
            COMMENT: I++,
            COMMENT_ENDING: I++,
            COMMENT_ENDED: I++,
            CDATA: I++,
            CDATA_ENDING: I++,
            CDATA_ENDING_2: I++,
            PROC_INST: I++,
            PROC_INST_BODY: I++,
            PROC_INST_ENDING: I++,
            OPEN_TAG: I++,
            OPEN_TAG_SLASH: I++,
            ATTRIB: I++,
            ATTRIB_NAME: I++,
            ATTRIB_NAME_SAW_WHITE: I++,
            ATTRIB_VALUE: I++,
            ATTRIB_VALUE_QUOTED: I++,
            ATTRIB_VALUE_CLOSED: I++,
            ATTRIB_VALUE_UNQUOTED: I++,
            ATTRIB_VALUE_ENTITY_Q: I++,
            ATTRIB_VALUE_ENTITY_U: I++,
            CLOSE_TAG: I++,
            CLOSE_TAG_SAW_WHITE: I++,
            SCRIPT: I++,
            SCRIPT_ENDING: I++
        }, e.XML_ENTITIES = {amp: "&", gt: ">", lt: "<", quot: '"', apos: "'"}, e.ENTITIES = {
            amp: "&",
            gt: ">",
            lt: "<",
            quot: '"',
            apos: "'",
            AElig: 198,
            Aacute: 193,
            Acirc: 194,
            Agrave: 192,
            Aring: 197,
            Atilde: 195,
            Auml: 196,
            Ccedil: 199,
            ETH: 208,
            Eacute: 201,
            Ecirc: 202,
            Egrave: 200,
            Euml: 203,
            Iacute: 205,
            Icirc: 206,
            Igrave: 204,
            Iuml: 207,
            Ntilde: 209,
            Oacute: 211,
            Ocirc: 212,
            Ograve: 210,
            Oslash: 216,
            Otilde: 213,
            Ouml: 214,
            THORN: 222,
            Uacute: 218,
            Ucirc: 219,
            Ugrave: 217,
            Uuml: 220,
            Yacute: 221,
            aacute: 225,
            acirc: 226,
            aelig: 230,
            agrave: 224,
            aring: 229,
            atilde: 227,
            auml: 228,
            ccedil: 231,
            eacute: 233,
            ecirc: 234,
            egrave: 232,
            eth: 240,
            euml: 235,
            iacute: 237,
            icirc: 238,
            igrave: 236,
            iuml: 239,
            ntilde: 241,
            oacute: 243,
            ocirc: 244,
            ograve: 242,
            oslash: 248,
            otilde: 245,
            ouml: 246,
            szlig: 223,
            thorn: 254,
            uacute: 250,
            ucirc: 251,
            ugrave: 249,
            uuml: 252,
            yacute: 253,
            yuml: 255,
            copy: 169,
            reg: 174,
            nbsp: 160,
            iexcl: 161,
            cent: 162,
            pound: 163,
            curren: 164,
            yen: 165,
            brvbar: 166,
            sect: 167,
            uml: 168,
            ordf: 170,
            laquo: 171,
            not: 172,
            shy: 173,
            macr: 175,
            deg: 176,
            plusmn: 177,
            sup1: 185,
            sup2: 178,
            sup3: 179,
            acute: 180,
            micro: 181,
            para: 182,
            middot: 183,
            cedil: 184,
            ordm: 186,
            raquo: 187,
            frac14: 188,
            frac12: 189,
            frac34: 190,
            iquest: 191,
            times: 215,
            divide: 247,
            OElig: 338,
            oelig: 339,
            Scaron: 352,
            scaron: 353,
            Yuml: 376,
            fnof: 402,
            circ: 710,
            tilde: 732,
            Alpha: 913,
            Beta: 914,
            Gamma: 915,
            Delta: 916,
            Epsilon: 917,
            Zeta: 918,
            Eta: 919,
            Theta: 920,
            Iota: 921,
            Kappa: 922,
            Lambda: 923,
            Mu: 924,
            Nu: 925,
            Xi: 926,
            Omicron: 927,
            Pi: 928,
            Rho: 929,
            Sigma: 931,
            Tau: 932,
            Upsilon: 933,
            Phi: 934,
            Chi: 935,
            Psi: 936,
            Omega: 937,
            alpha: 945,
            beta: 946,
            gamma: 947,
            delta: 948,
            epsilon: 949,
            zeta: 950,
            eta: 951,
            theta: 952,
            iota: 953,
            kappa: 954,
            lambda: 955,
            mu: 956,
            nu: 957,
            xi: 958,
            omicron: 959,
            pi: 960,
            rho: 961,
            sigmaf: 962,
            sigma: 963,
            tau: 964,
            upsilon: 965,
            phi: 966,
            chi: 967,
            psi: 968,
            omega: 969,
            thetasym: 977,
            upsih: 978,
            piv: 982,
            ensp: 8194,
            emsp: 8195,
            thinsp: 8201,
            zwnj: 8204,
            zwj: 8205,
            lrm: 8206,
            rlm: 8207,
            ndash: 8211,
            mdash: 8212,
            lsquo: 8216,
            rsquo: 8217,
            sbquo: 8218,
            ldquo: 8220,
            rdquo: 8221,
            bdquo: 8222,
            dagger: 8224,
            Dagger: 8225,
            bull: 8226,
            hellip: 8230,
            permil: 8240,
            prime: 8242,
            Prime: 8243,
            lsaquo: 8249,
            rsaquo: 8250,
            oline: 8254,
            frasl: 8260,
            euro: 8364,
            image: 8465,
            weierp: 8472,
            real: 8476,
            trade: 8482,
            alefsym: 8501,
            larr: 8592,
            uarr: 8593,
            rarr: 8594,
            darr: 8595,
            harr: 8596,
            crarr: 8629,
            lArr: 8656,
            uArr: 8657,
            rArr: 8658,
            dArr: 8659,
            hArr: 8660,
            forall: 8704,
            part: 8706,
            exist: 8707,
            empty: 8709,
            nabla: 8711,
            isin: 8712,
            notin: 8713,
            ni: 8715,
            prod: 8719,
            sum: 8721,
            minus: 8722,
            lowast: 8727,
            radic: 8730,
            prop: 8733,
            infin: 8734,
            ang: 8736,
            and: 8743,
            or: 8744,
            cap: 8745,
            cup: 8746,
            int: 8747,
            there4: 8756,
            sim: 8764,
            cong: 8773,
            asymp: 8776,
            ne: 8800,
            equiv: 8801,
            le: 8804,
            ge: 8805,
            sub: 8834,
            sup: 8835,
            nsub: 8836,
            sube: 8838,
            supe: 8839,
            oplus: 8853,
            otimes: 8855,
            perp: 8869,
            sdot: 8901,
            lceil: 8968,
            rceil: 8969,
            lfloor: 8970,
            rfloor: 8971,
            lang: 9001,
            rang: 9002,
            loz: 9674,
            spades: 9824,
            clubs: 9827,
            hearts: 9829,
            diams: 9830
        }, Object.keys(e.ENTITIES).forEach(function (t) {
            var n = e.ENTITIES[t], i = "number" == typeof n ? String.fromCharCode(n) : n;
            e.ENTITIES[t] = i
        }), e.STATE) e.STATE[e.STATE[b]] = b;

        function A(e, t, n) {
            e[t] && e[t](n)
        }

        function N(e, t, n) {
            e.textNode && D(e), A(e, t, n)
        }

        function D(e) {
            e.textNode = _(e.opt, e.textNode), e.textNode && A(e, "ontext", e.textNode), e.textNode = ""
        }

        function _(e, t) {
            return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t
        }

        function x(e, t) {
            return D(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = new Error(t), e.error = t, A(e, "onerror", t), e
        }

        function E(e) {
            return e.sawRoot && !e.closedRoot && P(e, "Unclosed root tag"), e.state !== I.BEGIN && e.state !== I.BEGIN_WHITESPACE && e.state !== I.TEXT && x(e, "Unexpected end"), D(e), e.c = "", e.closed = !0, A(e, "onend"), a.call(e, e.strict, e.opt), e
        }

        function P(e, t) {
            if ("object" != typeof e || !(e instanceof a)) throw new Error("bad call to strictFail");
            e.strict && x(e, t)
        }

        function M(e) {
            e.strict || (e.tagName = e.tagName[e.looseCase]());
            var t = e.tags[e.tags.length - 1] || e, n = e.tag = {name: e.tagName, attributes: {}};
            e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, N(e, "onopentagstart", n)
        }

        function F(e, t) {
            var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), i = n[0], a = n[1];
            return t && "xmlns" === e && (i = "xmlns", a = ""), {prefix: i, local: a}
        }

        function O(e) {
            if (e.strict || (e.attribName = e.attribName[e.looseCase]()), -1 !== e.attribList.indexOf(e.attribName) || e.tag.attributes.hasOwnProperty(e.attribName)) e.attribName = e.attribValue = ""; else {
                if (e.opt.xmlns) {
                    var t = F(e.attribName, !0), n = t.prefix, i = t.local;
                    if ("xmlns" === n) if ("xml" === i && e.attribValue !== u) P(e, "xml: prefix must be bound to " + u + "\nActual: " + e.attribValue); else if ("xmlns" === i && e.attribValue !== d) P(e, "xmlns: prefix must be bound to " + d + "\nActual: " + e.attribValue); else {
                        var a = e.tag, o = e.tags[e.tags.length - 1] || e;
                        a.ns === o.ns && (a.ns = Object.create(o.ns)), a.ns[i] = e.attribValue
                    }
                    e.attribList.push([e.attribName, e.attribValue])
                } else e.tag.attributes[e.attribName] = e.attribValue, N(e, "onattribute", {
                    name: e.attribName,
                    value: e.attribValue
                });
                e.attribName = e.attribValue = ""
            }
        }

        function U(e, t) {
            if (e.opt.xmlns) {
                var n = e.tag, i = F(e.tagName);
                n.prefix = i.prefix, n.local = i.local, n.uri = n.ns[i.prefix] || "", n.prefix && !n.uri && (P(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = i.prefix);
                var a = e.tags[e.tags.length - 1] || e;
                n.ns && a.ns !== n.ns && Object.keys(n.ns).forEach(function (t) {
                    N(e, "onopennamespace", {prefix: t, uri: n.ns[t]})
                });
                for (var o = 0, r = e.attribList.length; o < r; o++) {
                    var s = e.attribList[o], l = s[0], u = s[1], d = F(l, !0), c = d.prefix, h = d.local,
                        f = "" === c ? "" : n.ns[c] || "", g = {name: l, value: u, prefix: c, local: h, uri: f};
                    c && "xmlns" !== c && !f && (P(e, "Unbound namespace prefix: " + JSON.stringify(c)), g.uri = c), e.tag.attributes[l] = g, N(e, "onattribute", g)
                }
                e.attribList.length = 0
            }
            e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), N(e, "onopentag", e.tag), t || (e.noscript || "script" !== e.tagName.toLowerCase() ? e.state = I.TEXT : e.state = I.SCRIPT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0
        }

        function L(e) {
            if (!e.tagName) return P(e, "Weird empty close tag."), e.textNode += "</>", void (e.state = I.TEXT);
            if (e.script) {
                if ("script" !== e.tagName) return e.script += "</" + e.tagName + ">", e.tagName = "", void (e.state = I.SCRIPT);
                N(e, "onscript", e.script), e.script = ""
            }
            var t = e.tags.length, n = e.tagName;
            e.strict || (n = n[e.looseCase]());
            for (var i = n; t--;) {
                if (e.tags[t].name === i) break;
                P(e, "Unexpected close tag")
            }
            if (t < 0) return P(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", void (e.state = I.TEXT);
            e.tagName = n;
            for (var a = e.tags.length; a-- > t;) {
                var o = e.tag = e.tags.pop();
                e.tagName = e.tag.name, N(e, "onclosetag", e.tagName);
                var r = {};
                for (var s in o.ns) r[s] = o.ns[s];
                var l = e.tags[e.tags.length - 1] || e;
                e.opt.xmlns && o.ns !== l.ns && Object.keys(o.ns).forEach(function (t) {
                    var n = o.ns[t];
                    N(e, "onclosenamespace", {prefix: t, uri: n})
                })
            }
            0 === t && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = I.TEXT
        }

        function B(e) {
            var t, n = e.entity, i = n.toLowerCase(), a = "";
            return e.ENTITIES[n] ? e.ENTITIES[n] : e.ENTITIES[i] ? e.ENTITIES[i] : ("#" === (n = i).charAt(0) && ("x" === n.charAt(1) ? (n = n.slice(2), a = (t = parseInt(n, 16)).toString(16)) : (n = n.slice(1), a = (t = parseInt(n, 10)).toString(10))), n = n.replace(/^0+/, ""), isNaN(t) || a.toLowerCase() !== n ? (P(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(t))
        }

        function K(e, t) {
            "<" === t ? (e.state = I.OPEN_WAKA, e.startTagPosition = e.position) : k(t) || (P(e, "Non-whitespace before first tag."), e.textNode = t, e.state = I.TEXT)
        }

        function V(e, t) {
            var n = "";
            return t < e.length && (n = e.charAt(t)), n
        }

        I = e.STATE, String.fromCodePoint || (S = String.fromCharCode, y = Math.floor, w = function () {
            var e, t, n = [], i = -1, a = arguments.length;
            if (!a) return "";
            for (var o = ""; ++i < a;) {
                var r = Number(arguments[i]);
                if (!isFinite(r) || r < 0 || r > 1114111 || y(r) !== r) throw RangeError("Invalid code point: " + r);
                r <= 65535 ? n.push(r) : (e = 55296 + ((r -= 65536) >> 10), t = r % 1024 + 56320, n.push(e, t)), (i + 1 === a || n.length > 16384) && (o += S.apply(null, n), n.length = 0)
            }
            return o
        }, Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
            value: w,
            configurable: !0,
            writable: !0
        }) : String.fromCodePoint = w)
    }(t)
}, function (e, t) {
    e.exports = require("string_decoder")
}, function (e, t) {
    (function () {
        "use strict";
        t.stripBOM = function (e) {
            return "\ufeff" === e[0] ? e.substring(1) : e
        }
    }).call(this)
}, function (e, t) {
    e.exports = require("timers")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(2), o = n(7).default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        r = i.default.getLogger("HistoryDataNS");
    let s = a.resolve(__profilesDir, "mainWndData.ini"), l = 1020, u = 650;
    !function (e) {
        e.getMainWndSizeHistoryData = function () {
            let e = null;
            r.information(s);
            let t = o.readINI(s, "MainFrame", "ExitState"), n = o.readINI(s, "MainFrame", "MainWndLastWidth"),
                i = o.readINI(s, "MainFrame", "MainWndLastHeight");
            if (r.information(t, n, i), "" !== n && "" !== i) {
                let a = Number(n), o = Number(i);
                (a < l || o < u) && (a = l, o = u), (e = {}).width = a, e.height = o, e.exitState = t
            }
            return null === e && ((e = {}).exitState = "normal", e.width = l, e.height = u), e
        }, e.setExitType = function (e) {
            o.writeINI(s, "MainFrame", "ExitType", e)
        }, e.getExitType = function () {
            return o.readINI(s, "MainFrame", "ExitType")
        }
    }(t.HistoryDataNS || (t.HistoryDataNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(3), r = n(2), s = n(38), l = n(76), u = n(21), d = n(280), c = n(724), h = n(806), f = n(13),
        g = n(8), p = n(74), k = n(23), m = n(6), T = n(248), v = n(105), C = n(234), S = n(20), y = n(56), w = n(284),
        I = n(148), b = n(7), A = n(583), N = n(25), D = n(10), _ = n(12), x = n(574), E = n(281), P = n(840),
        M = n(734), F = b.default(r.join(__rootDir, "../bin/ThunderHelper.node")),
        O = C.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(),
        U = a.default.getLogger("NativeFunction"), L = c.TaskInfoManagerNS.getTaskInfoManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, this.isPersonalPageTrackEvent = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "PageReady", nativeFunc: this.pageReady}, {
                        functionName: "GetTaskInfo",
                        nativeFunc: this.getTaskInfo
                    }, {functionName: "OperateTask", nativeFunc: this.operateTask}, {
                        functionName: "ShellOpen",
                        nativeFunc: this.shellOpen
                    }, {
                        functionName: "OpenFolderWithSelectFile",
                        nativeFunc: this.openFolderWithSelectFile
                    }, {functionName: "GetFileMd5", nativeFunc: this.getFileMd5}, {
                        functionName: "GetPeerID",
                        nativeFunc: this.getPeerID
                    }, {functionName: "GetDeviceID", nativeFunc: this.getDeviceID}, {
                        functionName: "GetThunderVersion",
                        nativeFunc: this.getThunderVersion
                    }, {functionName: "TrackEvent", nativeFunc: this.trackEvent}, {
                        functionName: "GetCurrentCategoryId",
                        nativeFunc: this.getCurrentCategoryId
                    }, {
                        functionName: "SelectCategoryView",
                        nativeFunc: this.switchCategoryView
                    }, {
                        functionName: "GetCurInternetState",
                        nativeFunc: this.getCurInternetState
                    }, {functionName: "DropOpenFile", nativeFunc: this.dragOpenFile}, {
                        functionName: "DropOpenUrl",
                        nativeFunc: this.dragOpenUrl
                    }, {
                        functionName: "GetCurPlatform",
                        nativeFunc: this.getCurPlatform
                    }, {
                        functionName: "CreateNewTask",
                        nativeFunc: this.createNewTask
                    }, {
                        functionName: "CreateNewTaskEx",
                        nativeFunc: this.createNewTaskEx
                    }, {
                        functionName: "FireEventFunction",
                        nativeFunc: this.fireEventFunction
                    }, {
                        functionName: "ShowCustomDownloadModeDlg",
                        nativeFunc: this.showCustomDownloadModeDlg
                    }, {
                        functionName: "GetTaskStartStatusPrompt",
                        nativeFunc: this.getTaskStartStatusPrompt
                    }, {
                        functionName: "ShowBrowserGuideDlg",
                        nativeFunc: this.showBrowserGuideDlg
                    }, {
                        functionName: "OpenURLByIEorDefault",
                        nativeFunc: this.openURLByIEorDefault
                    }, {
                        functionName: "GetDownloadDir",
                        nativeFunc: this.getDownloadDir
                    }, {
                        functionName: "ShowPersonalPage",
                        nativeFunc: this.showPersonalPage
                    }, {functionName: "ShowWebWnd", nativeFunc: this.showWebWnd}, {
                        functionName: "CreateWebWnd",
                        nativeFunc: this.createWebWnd
                    }, {
                        functionName: "RegisterWebFunction",
                        nativeFunc: this.registerWebFunction
                    }, {
                        functionName: "CallBackWebFunction",
                        nativeFunc: this.callBackWebFunction
                    }, {
                        functionName: "FireEventWebFunction",
                        nativeFunc: this.fireEventWebFunction
                    }, {
                        functionName: "IsPhoneAuth",
                        nativeFunc: this.isPhoneAuth
                    }, {
                        functionName: "GetSearchRecommends",
                        nativeFunc: this.getSearchRecommends
                    }, {
                        functionName: "SetSearchRecommends",
                        nativeFunc: this.setSearchRecommends
                    }, {functionName: "GetBaiduDWZ", nativeFunc: this.getBaiduDWZ}, {
                        functionName: "Log",
                        nativeFunc: this.log
                    }];
                    l.setDefaultNativeFunctionMap(e)
                }
            }

            pageReady(e, t, n, i) {
                do {
                    if (!e || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    "taskDetail" === a ? (d.TaskDetailNS.pageReady(), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)) : "community" === a ? (O.emit("community.pageReady"), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[2]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    "taskDetail" === i[2] ? L.getHistoryTaskInfoString(a).then(i => {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    }).catch() : e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            operateTask(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (!e || !t || !n) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let i = a[0], o = a[1], r = a[2];
                        yield h.TaskOperate.operateTaskActions(i, o, r), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            shellOpen(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    o.remote.shell.openItem(a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openFolderWithSelectFile(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    o.remote.shell.showItemInFolder(a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            getFileMd5(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    s.ToolsUtilitiesAWNS.calculateFileMd5(a).then(i => {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            getPeerID(e, t, n, i) {
                U.information(i);
                let a = F.getPeerID();
                e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
            }

            getDeviceID(e, t, n, i) {
                U.information(i);
                let a = F.getPeerID();
                e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
            }

            getThunderVersion(e, t, n, i) {
                U.information(i);
                let a = r.join(__rootDir, "../../Thunder.exe"), o = F.getFileVersion(a);
                e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, o)
            }

            trackEvent(e, t, n, i) {
                U.information(i);
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = void 0 === i[1] ? "" : i[1], r = void 0 === i[2] ? "" : i[2],
                        s = void 0 === i[3] ? 0 : i[3], l = void 0 === i[4] ? 0 : i[4], d = void 0 === i[5] ? 0 : i[5],
                        c = void 0 === i[6] ? 0 : i[6], h = void 0 === i[7] ? "" : i[7], g = void 0 === i[8] ? 0 : i[8],
                        p = f.XLStatNS.trackEvent(a, o, r, s, l, d, c, h, g);
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, p)
                } while (0)
            }

            getCurrentCategoryId(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let i = p.default.getCurrentCategoryId();
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            switchCategoryView(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0]) || m.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], r = void 0;
                    void 0 !== i[2] && (r = i[2]);
                    let s = i[3];
                    U.information(a, o, r), p.default.fireEvent(k.NodeEventMesssageNS.eventDownloadSwitchCategory, a, o, r, s)
                } while (0)
            }

            dragOpenFile(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    if (void 0 === a || null === a || "" === a) break;
                    T.default.onCommand("path", a, "file_drag").catch()
                } while (0)
            }

            dragOpenUrl(e, t, n, i) {
                do {
                    if (void 0 === e || null === e) break;
                    if (void 0 === t || null === t) break;
                    if (void 0 === n || null === n) break;
                    let a = i[0];
                    if (void 0 === a || null === a || "" === a) break;
                    let o = S.ThunderHelper.getTaskTypeFromUrl(a);
                    o === g.DownloadKernel.TaskType.P2sp || o === g.DownloadKernel.TaskType.Emule ? v.ThunderNewTask.createPreNewTaskWindow([a], "url_drag") : o !== g.DownloadKernel.TaskType.Bt && o !== g.DownloadKernel.TaskType.Magnet || v.ThunderNewTask.createBtTaskWindow({
                        url: a,
                        type: "url"
                    }, {source: "url_drag"})
                } while (0)
            }

            getCurInternetState(e, t, n, i) {
                do {
                    if (U.information(i), m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = F.getCurInternetState();
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getCurPlatform(e, t, n, i) {
                do {
                    if (U.information(i), m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = "pc-xdas";
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            createNewTask(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = i[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        U.warning(e)
                    }
                    if (U.information("createNewTask", o), m.isNullOrUndefined(o)) break;
                    for (let e in o) {
                        let t = o[e];
                        if ("com" === t.type) {
                            let e = void 0;
                            for (let t in o) {
                                void 0 === e && (e = []), U.information("createNewTask url", o[t].url);
                                let n = o[t].url.split("%0A");
                                if (1 === n.length && (n = o[t].url.split(/[\n\r\n]/)), U.information("createNewTask urls", n), 1 === n.length) e.push({
                                    url: o[t].url,
                                    referer: o[t].refer,
                                    fileName: o[t].name,
                                    statClick: "outline",
                                    browser: "xlbrowser.exe"
                                }); else for (let i of n) e.push({
                                    url: i,
                                    referer: o[t].refer,
                                    statClick: "outline",
                                    browser: "xlbrowser.exe"
                                })
                            }
                            v.ThunderNewTask.createPreNewTaskWindow(e);
                            break
                        }
                        if ("bt" === t.type) {
                            let e = t.url;
                            v.ThunderNewTask.createBtTaskWindow({url: e, type: "url"}, {
                                source: "outline",
                                browser: "xlbrowser.exe"
                            });
                            break
                        }
                    }
                } while (0)
            }

            createNewTaskEx(e, t, n, i) {
                do {
                    if (U.information("createNewTaskEx 接口 enter 第一个参数:", i[0]), m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = i[0];
                    if (m.isNullOrUndefined(a)) break;
                    let o = [];
                    for (let e in a) {
                        let t = a[e], n = S.ThunderHelper.getTaskTypeFromUrl(t.url);
                        if (U.information(" createNewTaskEx", t.url, " type:", n), n === g.DownloadKernel.TaskType.P2sp || n === g.DownloadKernel.TaskType.Emule) o.push({
                            url: a[e].url,
                            referer: a[e].refer,
                            fileName: a[e].name,
                            statClick: a[e].stat
                        }); else if (n === g.DownloadKernel.TaskType.Bt || n === g.DownloadKernel.TaskType.Magnet) {
                            let e = t.url;
                            v.ThunderNewTask.createBtTaskWindow({url: e, type: "url"}, {source: t.stat})
                        }
                    }
                    o.length > 0 && v.ThunderNewTask.createPreNewTaskWindow(o)
                } while (0)
            }

            fireEventFunction(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.NativeCallHostModule.nativeCallHost.fireNativeEvent("onWebEvent", ...i), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showCustomDownloadModeDlg(e, t, n) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    w.DownloadModeNS.showCustomDownloadModeDlg().catch(), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showBrowserGuideDlg(e, t, n) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    A.default().popUpBrowserGuide(!0)
                } while (0)
            }

            getTaskStartStatusPrompt(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(i[0]), o = I.TaskStatusHelper.getTaskStartStatusPrompt(a);
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, o)
                    } catch (i) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError)
                    }
                } while (0)
            }

            openURLByIEorDefault(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = F.openURLByIEorDefault(i[0]);
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getDownloadDir(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                        let i = "";
                        do {
                            if (void 0 !== (i = N.ConfigNS.getValue("TaskDefaultSettings", "UseLastCatalog", !0) ? N.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "") : N.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")) && null !== i && "" !== i && (yield D.FileSystemAWNS.mkdirsAW(i))) break;
                            i = _.ThunderUtil.getDefaultDownloadDir()
                        } while (0);
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    } while (0)
                })
            }

            showPersonalPage(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = 0, o = i[0];
                    if (!this.isPersonalPageTrackEvent) {
                        this.isPersonalPageTrackEvent = !0;
                        let e = N.ConfigNS.getValue("Install", "PersonalUid", "");
                        void 0 !== e && null !== e || (e = "");
                        let t = "uid=" + e + ",start_page=" + (o ? "Individualization_home_page" : "official_home_page");
                        a = f.XLStatNS.trackEvent("core_event", "startup_page", "", 0, 0, 0, 0, t)
                    }
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            showWebWnd(e, t, n, a) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(a) || m.isNullOrUndefined(a[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = a[0];
                    if (a.splice(0, 1), null !== a[10] && void 0 !== a[10]) {
                        let e = a[10];
                        a[10] = (() => i(this, void 0, void 0, function* () {
                            return new Promise(n => {
                                y.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e, (e, t) => {
                                    U.information(e, t), n(t)
                                })
                            })
                        }))
                    }
                    if (null !== a[11] && void 0 !== a[11]) {
                        let e = a[11];
                        a[11] = (() => i(this, void 0, void 0, function* () {
                            y.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                        }))
                    }
                    x.EmbeddedBrowserManagerNs.showWebWnd(o, ...a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            createWebWnd(e, t, n, a) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(a) || m.isNullOrUndefined(a[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = a[0];
                    if (a.splice(0, 1), null !== a[10] && void 0 !== a[10]) {
                        let e = a[10];
                        a[10] = (() => i(this, void 0, void 0, function* () {
                            return new Promise(n => {
                                y.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e, (e, t) => {
                                    U.information(e, t), n(t)
                                })
                            })
                        }))
                    }
                    if (null !== a[11] && void 0 !== a[11]) {
                        let e = a[11];
                        a[11] = (() => i(this, void 0, void 0, function* () {
                            y.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                        }))
                    }
                    x.EmbeddedBrowserManagerNs.createWebWnd(o, ...a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            registerWebFunction(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], r = i[2];
                    if (null === o || void 0 === o || "" === o) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === r || void 0 === r) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    x.EmbeddedBrowserManagerNs.registerWebFunction(a, o, (...e) => {
                        y.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, r, ...e)
                    }), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            callBackWebFunction(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], r = i[2], s = i[3];
                    if (null === a || void 0 === a || "" === a) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === o || void 0 === o) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === r || void 0 === r) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    x.EmbeddedBrowserManagerNs.callBackWebFunction(a, o, r, s), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            fireEventWebFunction(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    if (null === a || void 0 === a || "" === a) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    i.splice(0, 1), x.EmbeddedBrowserManagerNs.fireEventWebFunction(a, ...i), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isPhoneAuth(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    E.phoneAuthObject.isPhoneAuthAw().then(i => {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            getSearchRecommends(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let i = P.SearchConfigNS.getRecommends();
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            setSearchRecommends(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    P.SearchConfigNS.setRecommends(a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            getBaiduDWZ(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let i = a[0], o = yield M.getBaiduDWZ(i);
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, o)
                    } while (0)
                })
            }

            log(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (!i || i.length < 3) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = i[0], r = i[1], s = null;
                    s = m.isString(o) && o.length > 0 ? a.default.getLogger(o) : U;
                    let l = !0;
                    switch (r) {
                        case"verbose":
                            s.verbose(i.splice(2));
                            break;
                        case"information":
                            s.information(i.splice(2));
                            break;
                        case"warning":
                            s.warning(i.splice(2));
                            break;
                        case"error":
                            s.error(i.splice(2));
                            break;
                        case"critical":
                            s.critical(i.splice(2));
                            break;
                        default:
                            l = !1
                    }
                    e.callNativeFunctionCallback(t, n, l ? u.NativeFunctionErrorCode.Success : u.NativeFunctionErrorCode.ParamError)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NaviteFunctionNS || (t.NaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(10), s = n(8), l = n(34), u = n(32), d = n(6),
        c = o.default.getLogger("NativeFunction.TaskInfoHistory"), h = l.DownloadKernelEventManager.getEventManager(),
        f = u.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    this.isInit || (this.isInit = !0, this.taskSpeedMap = new Map, this.dataPath = a.join(__profilesDir, "TaskSpeedInfo"), (yield r.FileSystemAWNS.existsAW(this.dataPath)) || (yield r.FileSystemAWNS.mkdirsAW(this.dataPath)), h.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                        this.onTaskDetailChanged(...e)
                    }), h.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                        this.onTaskStatusChanged(...e)
                    }))
                })
            }

            getTaskSpeedInfo(e) {
                return i(this, void 0, void 0, function* () {
                    let t = this.taskSpeedMap.get(e);
                    return t || (yield this.loadTaskSpeedInfo(e), t = this.taskSpeedMap.get(e)), t && this.checkTaskSpeedInfo(e, t), t
                })
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.DetailChanged) break;
                    let t = e[1], n = e[2];
                    if (!t || !n) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = 0, a = 0, o = n.getDownloadSpeed(), r = n.getVipSpeed(),
                            l = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                            u = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            d = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        d < 1 && (d = 1), i = Math.round(u / d);
                        let h = n.getTaskStatus();
                        if (h === s.DownloadKernel.TaskStatus.Succeeded || h === s.DownloadKernel.TaskStatus.Seeding) a = 100; else {
                            let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize);
                            0 !== e && (a = u / e * 100, (a = parseInt(a.toString(), 10)) > 100 ? a = 100 : a < 0 && (a = 0))
                        }
                        this.updateProgress(l, i, a, o, r).catch(e => {
                            c.warning(e)
                        })
                    }
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = n.getTaskStatus(), o = n.getTaskPreStatus();
                        if (i !== s.DownloadKernel.TaskStatus.StartWaiting && i !== s.DownloadKernel.TaskStatus.StartPending || o !== s.DownloadKernel.TaskStatus.StandBy) {
                            if (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) {
                                let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = this.taskSpeedMap.get(e);
                                if (t) {
                                    let i = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                                        a = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                                    a < 1 && (a = 1), t.aveSpeed = Math.round(i / a), this.checkTaskSpeedInfo(e, t)
                                }
                            } else if (i === s.DownloadKernel.TaskStatus.DestroyPending) {
                                let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = a.join(this.dataPath, "TaskInfoEx_" + e + ".txt");
                                c.information("destroy task taskId:", e, ", taskinfo file:", t), r.FileSystemAWNS.unlinkAW(t).catch(), this.taskSpeedMap.delete(e)
                            }
                        } else {
                            let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                t = this.taskSpeedMap.get(e);
                            t && (t.speedInfoMap = {}, this.taskSpeedMap.set(e, t), this.saveTaskSpeedInfo(e).catch(e => {
                                c.warning(e)
                            }))
                        }
                    }
                } while (0)
            }

            updateProgress(e, t, n, a, o) {
                return i(this, void 0, void 0, function* () {
                    let i = this.taskSpeedMap.get(e);
                    i || (i = this.newTaskSpeedInfo(e)), i.aveSpeed = t, a > i.maxSpeed && (i.maxSpeed = a), i.progress = n;
                    let r = {progress: n, downloadSpeed: a, addSpeed: o}, s = Math.floor(n);
                    100 === s && i.speedInfoMap[s] || (i.speedInfoMap[s] = r, this.taskSpeedMap.set(e, i), yield this.saveTaskSpeedInfo(e))
                })
            }

            newTaskSpeedInfo(e) {
                let t = {};
                return t.taskId = e, t.aveSpeed = 0, t.maxSpeed = 0, t.progress = 0, t.speedInfoMap = {}, t
            }

            loadTaskSpeedInfo(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1, n = "TaskInfoEx_" + e.toString() + ".txt", i = a.join(this.dataPath, n);
                    if (yield r.FileSystemAWNS.existsAW(i)) {
                        let n = yield r.FileSystemAWNS.readFileAW(i);
                        if (n) {
                            let i = null;
                            try {
                                i = JSON.parse(n.toString())
                            } catch (e) {
                                c.warning(e)
                            }
                            null !== i && (this.taskSpeedMap.set(e, i), t = !0)
                        }
                    }
                    return t
                })
            }

            checkTaskSpeedInfo(e, t) {
                let n = f.getTaskFromTaskId(e);
                if (!n) return;
                let i = n.getTaskStatus(), a = !1;
                if (d.isNumber(t.aveSpeed) || (c.warning("checkTaskSpeedInfo bad aveSpeed", ", taskId: ", e), t.aveSpeed = 0, a = !0), d.isNumber(t.maxSpeed) || (c.warning("checkTaskSpeedInfo bad maxSpeed", ", taskId: ", e), t.maxSpeed = 0, a = !0), t.aveSpeed > t.maxSpeed && (c.warning("checkTaskSpeedInfo aveSpeed > maxSpeed", ", taskId: ", e), t.aveSpeed = t.maxSpeed, a = !0), i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) {
                    c.information("checkTaskSpeedInfo check complete data");
                    let i = t.speedInfoMap[100], o = t.speedInfoMap[0];
                    if (!(d.isObject(i) && d.isObject(o) || 0 !== t.aveSpeed)) {
                        let i = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            o = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        o < 1 && (o = 1), t.aveSpeed = Math.round(i / o), c.information("checkTaskSpeedInfo recalc aveSpeed:", t.aveSpeed, ", taskId: ", e), a = !0
                    }
                }
                a && this.saveTaskSpeedInfo(e).catch()
            }

            saveTaskSpeedInfo(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1, n = this.taskSpeedMap.get(e);
                    if (n) {
                        let i = JSON.stringify(n), o = "TaskInfoEx_" + e.toString() + ".txt",
                            s = a.join(this.dataPath, o);
                        t = yield r.FileSystemAWNS.writeFileAW(s, i)
                    }
                    return t
                })
            }
        };
        e.init = function () {
            return i(this, void 0, void 0, function* () {
                yield t.init()
            })
        }, e.getTaskSpeedInfo = function (e) {
            return i(this, void 0, void 0, function* () {
                return yield t.getTaskSpeedInfo(e)
            })
        }
    }(t.HistoryTaskSpeedInfoNS || (t.HistoryTaskSpeedInfoNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(23), r = n(8), s = n(32), l = n(85), u = n(33), d = n(74), c = n(134), h = n(581), f = n(25),
        g = n(28), p = s.DownloadKernelTaskManager.getTaskManager(), k = h.SubtitleManagerNS.getSubtitleManger();
    t.TaskOperate = class {
        static operateTaskActions(e, t, n) {
            return i(this, void 0, void 0, function* () {
                switch (t) {
                    case"play":
                        this.playTask(e, n);
                        break;
                    case"downAndPlay":
                        this.downloadAndPlayTask(e, n);
                        break;
                    case"openFolder":
                        this.openFolder(e);
                        break;
                    case"open":
                        this.open(e, n);
                        break;
                    case"continue":
                        this.startTask(e);
                        break;
                    case"pause":
                        this.stopTask(e);
                        break;
                    case"restore":
                        this.restoreTask(e);
                        break;
                    case"delete":
                        this.deleteTask(e);
                        break;
                    case"note":
                        this.noteTask(e, n);
                        break;
                    case"downloadSelectFiles":
                        yield this.downloadSelectFiles(e, n);
                        break;
                    case"showHomePage":
                        this.showHomePage(e);
                        break;
                    case"install":
                        this.installFile(e, n);
                        break;
                    case"subtitleDownload":
                        this.openSubtitleDlg(e);
                        break;
                    case"repost":
                        this.createBirdKey(e)
                }
            })
        }

        static playTask(e, t) {
            let n = p.getTaskFromTaskId(e);
            n && (null !== t && void 0 !== t && "object" == typeof t ? l.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, t.panel, t.categoryId).catch() : l.TaskOperatorNs.downloadAndPlay(e).catch(), n.setUserRead(1))
        }

        static downloadAndPlayTask(e, t) {
            p.getTaskFromTaskId(e) && (null !== t && void 0 !== t && "object" == typeof t ? l.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, t.panel, t.categoryId).catch() : l.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, "downloading").catch())
        }

        static openFolder(e) {
            let t = p.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskBaseInfo();
                l.TaskOperatorNs.markReadStatus([e], 1), l.TaskOperatorNs.openTaskFolder(e, !0).catch()
            }
        }

        static open(e, t) {
            let n = p.getTaskFromTaskId(e);
            if (n) {
                let e = n.getTaskBaseInfo(), i = -1;
                i = null === t || void 0 === t || "" === t ? -1 : Number(t), l.TaskOperatorNs.openTaskItem(e, i).catch(), n.setUserRead(1)
            }
        }

        static startTask(e) {
            c.DownloadDispatchNS.startTask(e)
        }

        static stopTask(e) {
            p.stopTask(e, r.DownloadKernel.TaskStopReason.TaskDetail)
        }

        static restoreTask(e) {
            p.recoverFromRecycle(e)
        }

        static deleteTask(e) {
            let t = p.getTaskFromTaskId(e);
            if (t) if (t.getTaskAttribute(r.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                let t = f.ConfigNS.getValue("ConfigMsg", "ConfigMsg_DeleteFile", !0);
                u.MessageBox.confirm({
                    title: "您确定要删除此任务吗？",
                    type: u.MessageBox.ConfirmType.Warning,
                    checkboxEnabled: !0,
                    checkboxChecked: t,
                    checkboxLabel: "同时删除文件"
                }).then(t => {
                    t.action === g.MessageBoxNS.Action.OK && (f.ConfigNS.setValue("ConfigMsg", "ConfigMsg_DeleteFile", t.checkboxChecked), p.deleteTask(e, t.checkboxChecked).catch())
                }).catch()
            } else p.deleteTask(e, !1).catch()
        }

        static noteTask(e, t) {
            if (t) {
                let n = p.getTaskFromTaskId(e);
                n && n.setDescription(t)
            }
        }

        static downloadSelectFiles(e, t) {
            return i(this, void 0, void 0, function* () {
                (yield p.downloadTaskSelectFiles(e, t)) && c.DownloadDispatchNS.startTask(e)
            })
        }

        static showHomePage(e) {
            d.default.fireEvent(o.NodeEventMesssageNS.eventShowHomePage, e)
        }

        static installFile(e, t) {
            if (null !== t && void 0 !== t && "" !== t) try {
                let n = JSON.parse(t), i = n.path, a = "";
                null !== n.runParams && void 0 !== n.runParams && "" !== n.runParams && (a = n.runParams);
                let o = p.getTaskFromTaskId(e);
                l.TaskOperatorNs.executeInstallFile(o, i, a).catch()
            } catch (e) {
            }
        }

        static openSubtitleDlg(e) {
            let t = p.getTaskFromTaskId(e);
            if (t) {
                let n = t.getTaskName(), i = t.getType(), o = "";
                t && (o = t.getSavePath()), i === r.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (o = a.join(o, n));
                let s = t.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId), l = k.getDisaplayName(e),
                    d = 0;
                (d = l.length) > 1 ? u.MessageBox.custom("SubtitleTaskFilelist", {
                    size: "large",
                    taskId: e,
                    taskName: n,
                    taskType: i,
                    fileList: l,
                    saveDir: o,
                    categoryViewId: s
                }, {
                    center: !0,
                    width: 460,
                    height: 358
                }).catch() : u.MessageBox.custom("SubtitleSearch", {
                    size: "large",
                    taskId: e,
                    taskName: n,
                    cid: l[0].cid,
                    saveDir: o,
                    from: "taskList",
                    categoryViewId: s
                }, {center: !0, width: 460, height: 358}).catch()
            }
        }

        static createBirdKey(e) {
            l.TaskOperatorNs.createBirdKey(e)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(808), o = n(8), r = n(34), s = n(32), l = n(51), u = n(82), d = n(25), c = n(6), h = n(1), f = n(5),
        g = n(281), p = n(574), k = n(3), m = n(7), T = n(2), v = n(129), C = n(52), S = n(145),
        y = m.default(T.join(__rootDir, "../bin/ThunderHelper.node")), w = a.XLIPCManagerNS.getManager(),
        I = r.DownloadKernelEventManager.getEventManager(), b = s.DownloadKernelTaskManager.getTaskManager(),
        A = h.default.getLogger("Thunder.DownloadAndPlayIPC"), N = S.TaskEventContainerNS.getEventContainer();
    !function (e) {
        let t = null, n = void 0, r = void 0, s = void 0, h = void 0, m = void 0, T = void 0, D = void 0, _ = void 0,
            x = void 0;

        function E() {
            let e = u.default.getConfigInfo("downloadAndPlay", "enableIPC");
            return A.information("configModules.getConfigInfo ipcEnable:", e), c.isBoolean(e) ? d.ConfigNS.setValue("DownloadAndPlay", "EnableIPC", e) : (e = d.ConfigNS.getValue("DownloadAndPlay", "EnableIPC", !0), A.information("ConfigNS.getValue ipcEnable:", e)), e
        }

        function P() {
            A.information("internalInit");
            do {
                let e = w.getFactory();
                if (!e) break;
                if (!(t = e.createIPCServer(a.XLIPCManagerNS.xlipcDownloadAndPlayId))) {
                    A.error("createIPCServer failed!");
                    break
                }
                if (0 !== t.start()) {
                    A.error("server start failed!");
                    break
                }
                t.onAccept(M), t.onDisconnect(F)
            } while (0)
        }

        function M(e) {
            A.information("onAccept");
            let t = [{name: "SetOrderDownload", func: O}, {name: "SetDisorderDownload", func: U}, {
                name: "OnStopPlay",
                func: L
            }, {name: "GetUserID", func: j}, {name: "GetSessionID", func: G}, {
                name: "OpenUserCenterTab",
                func: z
            }, {name: "OpenMovieCenterTab", func: $}, {name: "OpenNewTab", func: H}, {
                name: "GetTaskAccState",
                func: X
            }, {name: "GetTaskState", func: q}];
            e.registerInterfaces(t), n = I.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                do {
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    t[1].forEach(t => {
                        let n = t.getTaskStatus();
                        n === o.DownloadKernel.TaskStatus.StopPending ? e.call("OnTaskStopPending", t.getId()) : n === o.DownloadKernel.TaskStatus.Stopped ? e.call("OnTaskStopped", t.getId()) : n === o.DownloadKernel.TaskStatus.Started ? e.call("OnTaskStarted", t.getId()) : n === o.DownloadKernel.TaskStatus.Succeeded || n === o.DownloadKernel.TaskStatus.Seeding ? e.call("OnTaskSuccess", t.getId()) : n === o.DownloadKernel.TaskStatus.DestroyPending ? e.call("OnTaskDestroyPending", t.getId()) : n === o.DownloadKernel.TaskStatus.Failed && e.call("OnTaskFailed", t.getId())
                    })
                } while (0)
            })
        }

        function F(e) {
            A.information("onDisconnect"), void 0 !== n && (I.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, n), n = void 0), void 0 !== m && (f.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", r), m = void 0), void 0 !== T && (f.NativeCallModule.nativeCall.DetachNativeEvent("onGetUserInfoFinished", T), T = void 0, A.information("DetachNativeEvent  onGetUserInfoFinished")), void 0 !== D && (f.NativeCallModule.nativeCall.DetachNativeEvent("onUserInfoChange", D), D = void 0), void 0 !== x && (N.detachListener(S.TaskEventNS.subTaskAcclerateStatusChanged, x), x = void 0), void 0 !== _ && (N.detachListener(S.TaskEventNS.subTaskStatusChanged, _), _ = void 0)
        }

        function O(e, t) {
            A.information("setOrderDownload taskId:", t);
            do {
                let e = b.getTaskFromTaskId(t);
                if (!e) break;
                e.setDownloadStrategy(1)
            } while (0)
        }

        function U(e, t) {
            A.information("setDisorderDownload taskId:", t);
            do {
                let e = b.getTaskFromTaskId(t);
                if (!e) break;
                e.setDownloadStrategy(0)
            } while (0)
        }

        function L(e, t) {
            A.information("onStopPlay taskId:", t)
        }

        function B() {
            let e = k.remote.getGlobal("mainRendererWindow");
            if (null !== e && void 0 !== e) {
                e.show();
                let t = e.getNativeWindowHandle().readUIntLE(0, 4);
                null !== y && void 0 !== y && y.setForegroundWindow(t)
            }
        }

        function K(e, t) {
            e.call("OnUserInterrupt", t)
        }

        function V(e) {
            void 0 === r && (r = f.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e))
        }

        function R(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    l.LoginHelperNS.loginHelper.getAllUserInfo(n => {
                        do {
                            if (A.information("收到 getAllUserInfo 返回数据"), null === n || void 0 === n) {
                                A.information("getAllUserInfo 得到数据是 null");
                                break
                            }
                            let t = n.vipList[0];
                            e.call("OnGetUserInfoFinished", t), A.information("call back: OnGetUserInfoFinished ", JSON.stringify(t))
                        } while (0);
                        t()
                    })
                })
            })
        }

        function W(e, t, n, i) {
            var a;
            !1 !== i ? function (e) {
                g.phoneAuthObject.isPhoneAuthAw().then(t => {
                    A.information("当前账号认证状态:", t), e(t)
                }).catch(e => ({error: e}))
            }(i => {
                i ? e.call("OnGetUserID", t, n) : (n = "auth", B(), setTimeout(() => {
                    p.EmbeddedBrowserManagerNs.showWebWnd("phoneAuth")
                }, 500), a = (i => {
                    1 === i ? e.call("OnGetUserID", t, n) : 0 === i && K(e, "authwndclose")
                }), void 0 === s && (s = f.NativeCallModule.nativeCall.AttachNativeEvent("OnPhoneAuthResult", e => {
                    f.NativeCallModule.nativeCall.DetachNativeEvent("OnPhoneAuthResult", s), s = void 0, a(e)
                })))
            }) : e.call("OnGetUserID", t, n)
        }

        function H(e, t) {
            A.information("url", t), "" !== t && (B(), f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t))
        }

        function j(e, t = !1, n = !0) {
            !function (e) {
                void 0 === m && (m = f.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => i(this, void 0, void 0, function* () {
                    e.call("OnLogout")
                })))
            }(e), function (e) {
                void 0 === D && (D = f.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (t, n) => {
                    A.information("onUserInfoChange ", t), "vipinfo" === t && R(e).catch()
                }), A.information("AttachNativeEvent onGetUserInfoFinished"))
            }(e), function (e) {
                void 0 === T && (T = f.NativeCallModule.nativeCall.AttachNativeEvent("onGetUserInfoFinished", () => i(this, void 0, void 0, function* () {
                    yield R(e)
                })), A.information("AttachNativeEvent onGetUserInfoFinished"))
            }(e), l.LoginHelperNS.loginHelper.getUserInfo("userid", function (i) {
                if ("" === i || void 0 === i || null === i) {
                    if (!n) return;
                    B(), l.LoginHelperNS.loginHelper.showLoginDlg("xmp-XMP", !0), V(function (n) {
                        f.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", r), r = void 0, W(e, n, "login", t)
                    }), a = (t => {
                        "close" === t && K(e, "loginwndclose")
                    }), void 0 === h && (h = f.NativeCallModule.nativeCall.AttachNativeEvent("OnLoginWndClose", e => {
                        "close" === e && "function" == typeof a && a(e)
                    }))
                } else R(e).catch(), W(e, i, "ok", t);
                var a
            })
        }

        function G(e) {
            l.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                if (null === t || void 0 === t || "" === t) {
                    let t = -1;
                    t = f.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", n => {
                        f.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", t), f.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (t, n) => {
                            0 === t && e.call("OnGetSessionID", n)
                        })
                    })
                } else e.call("OnGetSessionID", t)
            })
        }

        function z(e) {
            A.information("调用openUserCenterTab"), l.LoginHelperNS.loginHelper.getUserInfo("userid", function (e) {
                if (A.information("调用getUserInfo userid=", e), "" !== e && void 0 !== e && null !== e) {
                    let t = "" + e + "?entrypage=xmp_comment_dialog&entry=xmp_comment_dialog_viewbutton";
                    A.information("调用openNewTab url=", t), B(), f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t)
                } else B(), l.LoginHelperNS.loginHelper.showLoginDlg("xmp-XMP", !0), V(function (e) {
                    f.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", r), r = void 0;
                    let t = "http://pc.xunlei.com/d#/users/" + e + "?entrypage=xmp_comment_dialog&entry=xmp_comment_dialog_viewbutton";
                    f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t)
                })
            })
        }

        function $(e, t) {
            let n = "http://movie.xunlei.com/movies/" + t + "?entrypage=xmp_comment_dialog&entry=xmp_comment_dialog_viewbutton";
            A.information("调用openNewTab打开电影页 url=", n), B(), f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
        }

        function q(e, t, n) {
            A.information("getTaskState taskid", t);
            let i = null;
            f.NativeCallModule.nativeCall.CallNativeFunction("GetTaskBaseInfo", Number(t), (e, t) => {
                if (0 === e && t) try {
                    i = JSON.parse(t), A.information("taskbase ", i), n(i)
                } catch (e) {
                    n(i), A.warning(e)
                } else n(i)
            })
        }

        function X(e, t, n, i) {
            var a;
            A.information("getSubTaskAccState taskid,subId", t, n), a = function (t, n, i, a, r) {
                let s = {enterType: i, enterStatus: a, error: r};
                A.information("OnTaskAccStateChanged taskId ", t, "subIds", n), A.information("subTaskInfo", JSON.stringify(s)), s.enterStatus = a, null !== r && (s.error = r), f.NativeCallModule.nativeCall.CallNativeFunction("GetTaskBaseInfo", Number(t), (i, a) => {
                    if (0 === i && a) try {
                        let i = JSON.parse(a);
                        if (A.information("OnTaskAccStateChanged taskbase ", JSON.stringify(i)), null !== i) if (i.taskType === o.DownloadKernel.TaskType.Bt || i.taskType === o.DownloadKernel.TaskType.Group) for (let i = 0; i < n.length; i++) e.call("OnTaskAccStateChanged", t, n[i], s); else e.call("OnTaskAccStateChanged", t, -1, s)
                    } catch (e) {
                        A.warning(e)
                    }
                })
            }, A.information("attachAccStateChangedEvent"), void 0 === x && (x = a, N.attachListener(S.TaskEventNS.subTaskAcclerateStatusChanged, a)), function (e, t) {
                A.information("attachSubTaskStateChangedEvent"), void 0 === _ && (N.attachListener(S.TaskEventNS.subTaskStatusChanged, t), _ = t)
            }(0, function (t, n, i) {
                A.information("OnSubTaskStateChanged  taskId, subId, subStatus ", t, n, i), e.call("OnSubTaskStateChanged", t, n, i)
            }), f.NativeCallModule.nativeCall.CallNativeFunction("GetTaskBaseInfo", Number(t), (e, a) => {
                let r = {
                    enterType: v.VipDownloadDefineNS.VipTaskType.Try,
                    enterStatus: v.VipDownloadDefineNS.VipTaskStatus.Init,
                    error: null
                };
                if (0 === e && a) {
                    try {
                        let e = JSON.parse(a);
                        if (A.information("getSubTaskAccState taskbase ", JSON.stringify(e)), A.information("tasktype ", e.taskType), A.information("subId ", n), null !== e) if (e.taskType === o.DownloadKernel.TaskType.Bt) {
                            let e = C.VipDownloadPlugin.getVipSubTaskInfo(Number(t), Number(n));
                            A.information("getSubTaskAccState Info", JSON.stringify(e)), r = e
                        } else if (e.groupTaskId > 0) r = C.VipDownloadPlugin.getVipSubTaskInfo(Number(e.groupTaskId), Number(t)); else {
                            let e = C.VipDownloadPlugin.getVipTaskInfo(Number(t));
                            A.information("taskInfo ", e), null !== e && (r.enterStatus = e.enterStatus, null !== e.error && (r.error = e.error))
                        }
                        null == r && (r = {
                            enterType: v.VipDownloadDefineNS.VipTaskType.Try,
                            enterStatus: v.VipDownloadDefineNS.VipTaskStatus.Init,
                            error: null
                        }), A.information("getSubTaskAccState subTaskInfo", JSON.stringify(r))
                    } catch (e) {
                        A.warning(e)
                    }
                    i(r)
                } else i(r)
            })
        }

        e.init = function () {
            u.default.isInited() ? E() && P() : u.default.getEventEmitter().once("OnConfigModulesLoaded", e => {
                E() && P()
            })
        }, e.uninit = function () {
            let e = w.getFactory();
            e && t && (e.destroyIPCServer(t), t = null), void 0 !== n && (I.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, n), n = void 0)
        }
    }(t.DownloadAndPlayIPCNS || (t.DownloadAndPlayIPCNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(7).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        class t {
            constructor() {
                this.xlipcFactory = null
            }

            getFactory() {
                return this.xlipcFactory || (this.xlipcFactory = a.xlipcFactory), this.xlipcFactory
            }
        }

        e.Manager = t;
        let n = null;
        e.getManager = function () {
            return n || (n = new t), n
        }, e.xlipcDownloadAndPlayId = "DownloadAndPlay"
    }(t.XLIPCManagerNS || (t.XLIPCManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(21), o = n(2), r = n(231),
        s = i.remote.require(o.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e, t, n, i, a, o) {
            let l = {x: 0, y: 0, width: 0, height: 0}, u = function () {
                let e = 1;
                return e = r.browserSupport.dpiAwareSupport ? s.getMonitorDPIFactor(r.browserSupport.browserParentWndHandle) : r.browserSupport.systemDpiFactor
            }();
            return l.x = Math.ceil(n * u), l.y = Math.ceil(a * u), l.width = Math.ceil((e - n - i) * u), l.height = Math.ceil((t - a - o) * u), l
        }

        e.resizeBrowserWindow = function (e, n, i, o, r, l, u) {
            let d = !1;
            {
                let c = t(n, i, o, r, l, u);
                s.setWindowPos(e, a.OptionOfhwndInAfter.HWND_TOP, Math.round(c.x), Math.round(c.y), Math.round(c.width), Math.round(c.height), a.Uflags.SWP_SHOWWINDOW), d = !0
            }
            return d
        }, e.getBrowserWindowRect = t
    }(t.CommonFunctionNs || (t.CommonFunctionNs = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(726), o = n(5);
    t.signNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "CloseDialog", nativeFunc: this.closeDialog}, {
                functionName: "ShowLoginPanel",
                nativeFunc: this.showLoginPanel
            }]
        }

        closeDialog(e, t, n, o) {
            a.signObject.closeDialog(), e.callNativeFunctionCallback(t, n, i.NativeFunctionErrorCode.Success)
        }

        showLoginPanel(e, t, n, a) {
            o.NativeCallModule.nativeCall.CallNativeFunction("ShowLoginDlg", "sign"), e.callNativeFunctionCallback(t, n, i.NativeFunctionErrorCode.Success)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(281);
    t.phoneAuthNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "HideWebDlg", nativeFunc: this.hideWebDlg}]
        }

        hideWebDlg(e, t, n, o) {
            do {
                if (null === e || void 0 === e) break;
                if (null === o || void 0 === o) break;
                let r = o[0], s = o[1];
                a.phoneAuthObject.closeDialog(s, r), e.callNativeFunctionCallback(t, n, i.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(813), o = n(8), r = n(143), s = n(145), l = n(1).default.getLogger("Thunder.VipDownload.task"),
        u = r.DkHelperNS.getHelper(), d = s.TaskEventContainerNS.getEventContainer();
    t.Task = class {
        constructor(e, t) {
            this.mTaskBase = null, this.mTaskStatus = void 0, this.mDcdnStatus = void 0, this.mIsGcidOk = !1, this.mIsSubGcidOk = new Map, this.mTaskDetail = null, this.mTaskExtra = null, this.mTaskId = e, this.mTaskExtra = new a.TaskExtra(this), this.init(t).catch()
        }

        getTaskId() {
            return this.mTaskId
        }

        getTaskBase() {
            return this.mTaskBase
        }

        getTaskStatus() {
            return this.mTaskStatus
        }

        getDcdnStatus() {
            return this.mDcdnStatus
        }

        setDcdnStatus(e) {
            let t = this.getDcdnStatusPriority(this.mDcdnStatus);
            this.getDcdnStatusPriority(e) > t && (this.mDcdnStatus = e)
        }

        getTaskDetail() {
            return this.mTaskDetail
        }

        getTaskExtra() {
            return this.mTaskExtra
        }

        getFilesWithFilter(e, t) {
            let n = [];
            if (!this.mTaskBase) return n;
            let i = void 0, a = void 0;
            switch (t && (i = t.get("downloading"), a = t.get("select")), this.mTaskBase.taskType) {
                case o.DownloadKernel.TaskType.P2sp:
                case o.DownloadKernel.TaskType.Emule:
                    if (i && this.mTaskStatus !== o.DownloadKernel.TaskStatus.Started) break;
                    let r = this.getP2pFile();
                    n.push(r);
                    break;
                case o.DownloadKernel.TaskType.Bt:
                case o.DownloadKernel.TaskType.Group:
                    if (!this.mTaskDetail) break;
                    if (e) {
                        for (let t of e) {
                            let e = this.mTaskDetail.files.get(t);
                            e && (i && !this.isSubTaskDownloading(t) || a && 1 !== e.isNeedDownload || n.push(e))
                        }
                        break
                    }
                    this.mTaskDetail.files.forEach(e => {
                        i && !this.isSubTaskDownloading(e.subId) || a && 1 !== e.isNeedDownload || n.push(e)
                    })
            }
            return n
        }

        getAllFiles() {
            return this.getFilesWithFilter()
        }

        getSelectFiles(e) {
            let t = new Map;
            return t.set("select", !0), this.getFilesWithFilter(e, t)
        }

        getDownloadingFiles(e) {
            let t = new Map;
            return t.set("downloading", !0), this.getFilesWithFilter(e, t)
        }

        getFile(e) {
            let t = null;
            if (!this.mTaskBase) return t;
            switch (this.mTaskBase.taskType) {
                case o.DownloadKernel.TaskType.P2sp:
                case o.DownloadKernel.TaskType.Emule:
                    t = this.getP2pFile();
                    break;
                case o.DownloadKernel.TaskType.Bt:
                case o.DownloadKernel.TaskType.Group:
                    this.mTaskDetail && (t = this.mTaskDetail.files.get(e))
            }
            return t
        }

        remove() {
            this.mTaskExtra.remove()
        }

        select() {
            return i(this, void 0, void 0, function* () {
                let e = yield u.getCurrentCategoryId();
                e && u.selectCategoryView(e, o.DownloadKernel.CategroyViewID.Downloading, this.mTaskId)
            })
        }

        onExpand() {
            this.mTaskExtra.onExpand()
        }

        onUserAuthorityChanged(e, t) {
            this.mTaskExtra.onUserAuthorityChanged(e, t).catch()
        }

        onTaskStatusChanged(e) {
            return i(this, void 0, void 0, function* () {
                switch (l.information("onTaskStatusChanged", "taskId", this.mTaskId, "taskStatus", e), this.mTaskStatus = e, e) {
                    case o.DownloadKernel.TaskStatus.Started:
                        yield this.initTaskDetail();
                        break;
                    case o.DownloadKernel.TaskStatus.Stopped:
                        this.mDcdnStatus = void 0
                }
                yield this.mTaskExtra.onTaskStatusChanged(e)
            })
        }

        onTaskDetailChanged(e) {
            this.setTaskBase(e), this.mTaskBase && this.mTaskBase.taskType === o.DownloadKernel.TaskType.Group && u.getTaskDetail(this.mTaskId).then(e => {
                e && e.files && e.files.forEach(e => {
                    this.setFile(e.subId, e)
                })
            }).catch()
        }

        onTaskDcdnStatusChanged(e, t) {
            e < 0 && this.mTaskBase && (this.mTaskBase.taskType === o.DownloadKernel.TaskType.Group || this.mTaskBase.taskType === o.DownloadKernel.TaskType.Bt) || (l.information("onTaskDcdnStatusChanged", "taskId", this.mTaskId, "subId", e, "dcdnStatus", t), this.setDcdnStatus(t), this.mTaskExtra.onTaskDcdnStatusChanged(e, t))
        }

        onBtSubFileDetailChanged(e, t) {
            if (this.mTaskDetail) for (let e of t) {
                let t = e.realIndex, n = u.createBtFileUrl(t, this.mTaskDetail.infoId), i = {
                    subId: t,
                    taskStatus: e.fileStatus,
                    filePath: "",
                    fileName: e.finalName,
                    gcid: e.gcid,
                    cid: e.cid,
                    url: n,
                    refUrl: "",
                    fileSize: e.fileSize,
                    downloadSize: e.downloadSize,
                    errCode: e.errorCode
                };
                this.setFile(t, i)
            }
        }

        onCidGcidRetrieved(e) {
            l.information("onCidGcidRetrieved", this.mTaskId, e), this.mTaskExtra.onCidGcidRetrieved(e)
        }

        onTaskCompleted() {
            l.information("onTaskCompleted", "taskId", this.mTaskId), this.remove()
        }

        onTaskRemoved() {
            l.information("onTaskRemoved", "taskId", this.mTaskId), this.remove()
        }

        init(e) {
            return i(this, void 0, void 0, function* () {
                this.onTaskDetailChanged(e);
                let t = yield u.getTaskStatus(this.mTaskId);
                yield this.onTaskStatusChanged(t)
            })
        }

        initTaskDetail() {
            return i(this, void 0, void 0, function* () {
                if (this.mTaskDetail = null, this.mTaskBase) {
                    let e = this.mTaskBase.taskType;
                    e !== o.DownloadKernel.TaskType.Bt && e !== o.DownloadKernel.TaskType.Group || (this.mTaskDetail = yield u.getTaskDetail(this.mTaskId))
                }
            })
        }

        setTaskBase(e) {
            this.mTaskBase = e, e && (e.taskType !== o.DownloadKernel.TaskType.P2sp && e.taskType !== o.DownloadKernel.TaskType.Emule || this.mIsGcidOk || e && e.gcid && "" !== e.gcid && e.cid && "" !== e.cid && (this.mIsGcidOk = !0, this.onCidGcidRetrieved(-1)))
        }

        getP2pFile() {
            return this.mTaskBase ? {
                subId: -1,
                taskStatus: this.mTaskBase.taskStatus,
                filePath: this.mTaskBase.savePath,
                fileName: this.mTaskBase.taskName,
                gcid: this.mTaskBase.gcid,
                cid: this.mTaskBase.cid,
                url: this.mTaskBase.url,
                refUrl: this.mTaskBase.refUrl,
                fileSize: this.mTaskBase.fileSize,
                downloadSize: this.mTaskBase.downloadSize,
                isNeedDownload: 1
            } : null
        }

        setFile(e, t) {
            if (!this.mTaskDetail) return;
            let n = this.getFile(e);
            this.mTaskDetail.files.set(e, t), n && n.taskStatus === t.taskStatus || (this.mTaskExtra.onSubTaskStatusChanged(e, t.taskStatus), d.onEvent(s.TaskEventNS.subTaskStatusChanged, this.mTaskId, e, t.taskStatus)), this.mIsSubGcidOk.get(e) || t.gcid && "" !== t.gcid && t.cid && "" !== t.cid && (this.mIsSubGcidOk.set(e, !0), this.onCidGcidRetrieved(e)), this.mTaskBase && this.mTaskBase.taskType === o.DownloadKernel.TaskType.Group && (n && n.dcdnStatus === t.dcdnStatus || this.onTaskDcdnStatusChanged(e, t.dcdnStatus))
        }

        isSubTaskDownloading(e) {
            if (!this.mTaskBase) return !1;
            let t = !1;
            switch (this.mTaskBase.taskType) {
                case o.DownloadKernel.TaskType.P2sp:
                case o.DownloadKernel.TaskType.Emule:
                    t = this.mTaskBase.taskStatus === o.DownloadKernel.TaskStatus.Started;
                    break;
                case o.DownloadKernel.TaskType.Bt:
                    if (this.mTaskDetail) {
                        let n = this.mTaskDetail.files.get(e);
                        n && (t = n.taskStatus === o.DownloadKernel.BtFileStatus.Started)
                    }
                    break;
                case o.DownloadKernel.TaskType.Group:
                    if (this.mTaskDetail) {
                        let n = this.mTaskDetail.files.get(e);
                        n && (t = n.taskStatus === o.DownloadKernel.TaskStatus.Started)
                    }
            }
            return t
        }

        getDcdnStatusPriority(e) {
            let t = -1;
            switch (e) {
                case void 0:
                    t = -1;
                    break;
                case o.DownloadKernel.DcdnStatusCode.Unkown:
                    t = 0;
                    break;
                case o.DownloadKernel.DcdnStatusCode.AuthorizingFailed:
                    t = 2;
                    break;
                case o.DownloadKernel.DcdnStatusCode.Success:
                    t = 3;
                    break;
                default:
                    t = 1
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(129), o = n(814), r = n(68), s = n(8), l = n(820), u = n(824), d = n(145), c = n(732), h = n(282),
        f = n(578), g = n(232), p = n(57), k = n(577), m = n(25), T = n(203), v = n(56),
        C = n(1).default.getLogger("Thunder.VipDownload.task-extra"), S = r.UserHelperNS.getHelper(),
        y = T.ConfigHelperNS.getHelper(), w = d.TaskEventContainerNS.getEventContainer(),
        I = g.KuainiaoManagerNS.getManager();
    t.TaskExtra = class {
        constructor(e) {
            this.mTask = null, this.mOfflineTask = null, this.mAcclerateTasks = new Map, this.mIsCheckTry = !1, this.mKuaiNiaoInit = !1, this.mKuaiNiaoShow = !1, this.mKuaiNiaoTimer = null, this.mVipTaskInfo = null, this.mEnterType = void 0, this.mTaskId = e.getTaskId(), this.mTask = e
        }

        get vipTaskType() {
            let e = a.VipDownloadDefineNS.VipTaskType.Vip;
            return this.tryTask && (e = a.VipDownloadDefineNS.VipTaskType.Try), e
        }

        get vipTaskStatus() {
            let e = a.VipDownloadDefineNS.VipTaskStatus.Init;
            return this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Try ? this.tryTask && (e = this.tryTask.vipTaskStatus) : this.vipTask && (e = this.vipTask.vipTaskStatus), e
        }

        get vipTaskError() {
            let e = null;
            return this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Try ? this.tryTask && (e = this.tryTask.error) : this.vipTask && (e = this.vipTask.error), e
        }

        get careKuaiNiao() {
            if (this.mKuaiNiaoInit && void 0 !== this.mEnterType) {
                let e = this.getAcclerateTask(this.mEnterType);
                if (e) return e.enableKuaiNiao
            }
            return !1
        }

        getVipTaskInfo() {
            return this.mVipTaskInfo || (this.mVipTaskInfo = this.createVipTaskInfo()), this.mVipTaskInfo
        }

        getVipSubTaskInfo(e) {
            let t = null, n = this.getAcclerateTask(this.mEnterType);
            return n && (t = n.getVipSubTaskInfo(e)), t
        }

        setVipTaskStatus(e, t) {
            this.updateVipTaskInfo(), w.onEvent(d.TaskEventNS.taskAcclerateStatusChanged, this.mTaskId, e, t)
        }

        createVipTaskInfo() {
            C.information("createVipTaskInfo", this.mTaskId);
            let e = null, t = !1, n = this.careKuaiNiao;
            this.taskStatus !== s.DownloadKernel.TaskStatus.Started || n || this.mAcclerateTasks.forEach(e => {
                e.showSpeed && (t = !0)
            });
            let i = !1, o = this.getAcclerateTask(this.vipTaskType);
            o && (i = o.acclerated);
            let r = !1, l = void 0;
            (o = this.getAcclerateTask(this.mEnterType)) && (r = o.continued, l = o.vipTaskStatus);
            let u = !1;
            this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Vip ? u = S.isSuperVip : this.tryTask && (u = this.tryTask.tryType === a.VipDownloadDefineNS.TryType.SuperVip);
            let d = !1;
            return u && !n && this.vipTaskStatus > a.VipDownloadDefineNS.VipTaskStatus.Init && this.vipTaskStatus < a.VipDownloadDefineNS.VipTaskStatus.Finished && this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.CommitFailed && this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed && (d = !0), e = {
                taskType: this.vipTaskType,
                isSuper: u,
                taskStatus: this.vipTaskStatus,
                isShowVipSpeed: t,
                isShowSuperSpeed: d,
                error: this.vipTaskError,
                isAcclerated: i,
                careKuaiNiao: n,
                showKuaiNiao: this.mKuaiNiaoShow,
                kuaiNiaoStatus: I.status,
                enterType: this.mEnterType,
                enterStatus: l,
                isContinued: r
            }, this.mVipTaskInfo = e, e
        }

        updateVipTaskInfo() {
            let e = this.mVipTaskInfo, t = this.createVipTaskInfo(), n = !1;
            e && e.taskType === t.taskType && e.taskStatus === t.taskStatus || (n = !0), C.information("onVipTaskInfoChanged", "taskId", this.mTaskId, "taskInfo", t, "statusChange", n), w.onEvent(d.TaskEventNS.vipTaskInfoChanged, this.mTaskId, t, n), v.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnVipTaskInfoChanged", this.mTaskId, JSON.stringify(t), n)
        }

        enterAcclerate(e) {
            C.information("enter", "type", e), this.mEnterType !== e && (this.mEnterType = e, this.mKuaiNiaoInit = !0, this.createAcclerateTask(e).enter(), this.startKuaiNiaoShow())
        }

        exitAcclerate(e) {
            let t = this.getAcclerateTask(e);
            t && (C.information("exit", "type", e), this.killKuaiNiaoTimer(), t.exit(), this.deleteAcclerateTask(e), this.updateVipTaskInfo()), this.mEnterType === e && (this.mEnterType = void 0)
        }

        autoAcclerate() {
            this.vipTaskStatus === a.VipDownloadDefineNS.VipTaskStatus.Init && this.enterAcclerate(a.VipDownloadDefineNS.VipTaskType.Vip)
        }

        batchSetVipSubTaskStatus(e, t, n, i) {
            e && e.length > 0 && (C.information("batchSetVipSubTaskStatus", "taskId", this.mTaskId, "subIds", e, "type", t, "status", n, "error", i), w.onEvent(d.TaskEventNS.subTaskAcclerateStatusChanged, this.mTaskId, e, t, n, i))
        }

        showTry() {
            C.information("showTry"), h.TryTaskCacheNS.getCacheManager().setTaskId(this.mTaskId);
            let e = a.VipDownloadDefineNS.VipTaskType.Try;
            this.createAcclerateTask(e)
        }

        removeTry() {
            C.information("removeTry");
            let e = a.VipDownloadDefineNS.VipTaskType.Try;
            this.exitAcclerate(e)
        }

        remove() {
            this.mAcclerateTasks.forEach(e => {
                e.remove()
            }), this.offlineTask && this.offlineTask.remove()
        }

        onExpand() {
            this.activeTry().catch()
        }

        onUserAuthorityChanged(e, t) {
            return i(this, void 0, void 0, function* () {
                e ? !this.tryTask || this.userCanTry && this.tryTask.tryType !== a.VipDownloadDefineNS.TryType.PlatinumVip || this.exitAcclerate(a.VipDownloadDefineNS.VipTaskType.Try) : this.exitAcclerate(a.VipDownloadDefineNS.VipTaskType.Vip), yield this.checkAcclerate(), yield this.checkOffline(!0), t && this.updateVipTaskInfo()
            })
        }

        onKuaiNiaoStatusChanged(e) {
            e === f.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive && (this.killKuaiNiaoTimer(), this.mKuaiNiaoInit = !0, this.mKuaiNiaoShow = !0, this.createKuaiNiaoTimer(3e3), this.updateVipTaskInfo())
        }

        onTaskStatusChanged(e) {
            return i(this, void 0, void 0, function* () {
                this.mAcclerateTasks.forEach(t => {
                    t.onTaskStatusChanged(e)
                }), yield this.checkAcclerate(), yield this.checkOffline()
            })
        }

        onSubTaskStatusChanged(e, t) {
            this.mAcclerateTasks.forEach(n => {
                n.onSubTaskStatusChanged(e, t)
            })
        }

        onTaskDcdnStatusChanged(e, t) {
            this.mAcclerateTasks.forEach(n => {
                n.onTaskDcdnStatusChanged(e, t)
            })
        }

        onCidGcidRetrieved(e) {
            setTimeout(() => i(this, void 0, void 0, function* () {
                yield this.activeTry()
            }), 1e3), this.mAcclerateTasks.forEach(t => {
                t.onCidGcidRetrieved(e)
            })
        }

        onTryFinishOpenVipClick() {
            this.tryTask && this.tryTask.setFinishClickDispearDelay()
        }

        get task() {
            return this.mTask
        }

        get taskStatus() {
            return this.mTask.getTaskStatus()
        }

        get vipTask() {
            return this.getAcclerateTask(a.VipDownloadDefineNS.VipTaskType.Vip)
        }

        getAcclerateTask(e) {
            return this.mAcclerateTasks.get(e)
        }

        createAcclerateTask(e) {
            let t = this.mAcclerateTasks.get(e);
            return t || (t = e === a.VipDownloadDefineNS.VipTaskType.Try ? new u.TryTask(this.task) : new l.VipTask(this.task), this.mAcclerateTasks.set(e, t), t.init()), t
        }

        deleteAcclerateTask(e) {
            this.mAcclerateTasks.delete(e)
        }

        checkAcclerate() {
            return i(this, void 0, void 0, function* () {
                S.isVip && this.taskStatus === s.DownloadKernel.TaskStatus.Started && this.autoAcclerate(), yield this.activeTry()
            })
        }

        get tryTask() {
            return this.getAcclerateTask(a.VipDownloadDefineNS.VipTaskType.Try)
        }

        get trySubId() {
            let e = 0, t = void 0, n = this.task.getDownloadingFiles();
            for (let i of n) i.gcid && "" !== i.gcid && i.cid && "" !== i.cid && i.fileSize && i.fileSize > e && (e = i.fileSize, t = i.subId);
            return t
        }

        get userCanTry() {
            return !S.isSuperVip && !S.hasFlux
        }

        get isTryMode() {
            return this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Try
        }

        get isTryInit() {
            return !!this.isTryMode && this.vipTaskStatus === a.VipDownloadDefineNS.VipTaskStatus.Init
        }

        activeTry() {
            return i(this, void 0, void 0, function* () {
                if (this.mIsCheckTry) C.information("is checking try!"); else {
                    this.mIsCheckTry = !0;
                    do {
                        C.information("checkActiveTry");
                        let e = p.PluginHelperNS.getHelper().currentTime, t = this.isTryMode, n = this.isTryInit;
                        const i = h.TryTaskCacheNS.getCacheManager().getTask(this.mTaskId);
                        n && i && i.createTime && i.expireTime && e - i.createTime > i.expireTime && (this.removeTry(), t = !1, n = !1);
                        let a = !1;
                        if (i && (a = this.canShowTry(i.type)), n && !a) {
                            C.information("task can not show try anymore!"), this.removeTry();
                            break
                        }
                        if (t) {
                            C.information("task already show try!");
                            break
                        }
                        if (i) {
                            i.trialKey && !i.commited && a ? (C.information("show try from cache"), this.showTry()) : C.information("this task had query!");
                            break
                        }
                        if (this.taskStatus !== s.DownloadKernel.TaskStatus.Started) {
                            C.information("this task is not started!");
                            break
                        }
                        if (!this.canQueryTry()) {
                            C.information("this task can not query try!");
                            break
                        }
                        let o = m.ConfigNS.getValue("VipDownload", "LastTryEnterTime", 0),
                            r = y.getValue("VipDownload", "TryInterval");
                        if (e - o < r) {
                            C.information("interval time less than ", r);
                            break
                        }
                        let l = yield k.TryTaskDataBaseNS.getTable().getUserData(this.mTaskId, -1);
                        if (l && l.tryDate) {
                            let e = (new Date).toDateString();
                            if (l.tryDate === e) {
                                C.information("this task had try today!");
                                break
                            }
                        }
                        let u = this.trySubId;
                        if (void 0 === u) {
                            C.information("subId invalid!");
                            break
                        }
                        yield this.queryTry(u)
                    } while (0);
                    this.mIsCheckTry = !1
                }
            })
        }

        queryTry(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.task.getTaskBase(), n = this.task.getFile(e);
                if (!t || !n) return null;
                let i = {btTitle: 2 === t.taskType ? t.taskName : void 0, file: n},
                    a = yield(new c.TryTaskHttpSession).query(i);
                a && (h.TryTaskCacheNS.getCacheManager().setQueryData(this.mTaskId, e, a), 0 === a.result && this.canShowTry(a.type) && (this.showTry(), this.task.select()))
            })
        }

        canQueryTry() {
            if (!this.userCanTry) return C.information("this user can not try!"), !1;
            let e = this.task.getTaskBase();
            if (!e) return C.information("task base not exist!"), !1;
            if (e.taskType === s.DownloadKernel.TaskType.Group) return C.information("this task is group task!"), !1;
            const t = h.TryTaskCacheNS.getCacheManager();
            if (t.chances <= 0) return C.information("no chances to try!", "chances:", t.chances), !1;
            let n = t.taskId;
            return !n || n === this.mTaskId || (C.information("another task trying!", "taskId:", n), !1)
        }

        canShowTry(e) {
            let t = this.task.getTaskBase();
            if (!t) return C.information("task base not exist!"), !1;
            if (!this.canQueryTry()) return !1;
            if (e !== a.VipDownloadDefineNS.TryType.SuperVip) {
                if (S.authority) return C.information("current user has superspeed authority!"), !1;
                if (this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.Init) return C.information("task already enter!"), !1
            }
            let n = 0, i = 0;
            e === a.VipDownloadDefineNS.TryType.SuperVip ? (n = y.getValue("VipDownload", "EnableSuperTryMinSize"), i = y.getValue("VipDownload", "EnableSuperTryMaxProgress")) : (n = y.getValue("VipDownload", "EnableTryMinSize"), i = y.getValue("VipDownload", "EnableTryMaxProgress"));
            let o = t.fileSize || 0;
            return o < n ? (C.information("fileSize less than minSize!"), !1) : !(100 * (t.downloadSize || 0) / o > i && (C.information("progress more than maxProgress!"), 1))
        }

        get offlineTask() {
            return this.mOfflineTask
        }

        checkOffline(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.mTask.getTaskStatus();
                S.offlineAuthority && t === s.DownloadKernel.TaskStatus.Started && (this.mOfflineTask || (this.mOfflineTask = new o.OfflineTask(this.mTask), e = !0), e && (yield this.mOfflineTask.loadData()), yield this.mOfflineTask.enter())
            })
        }

        startKuaiNiaoShow() {
            this.careKuaiNiao && (C.information("startKuaiNiaoShow"), this.createKuaiNiaoTimer(5e3))
        }

        createKuaiNiaoTimer(e) {
            this.mKuaiNiaoTimer || (C.information("createKuaiNiaoTimer"), this.mKuaiNiaoTimer = setTimeout(() => {
                C.information("onKuaiNiaoTimer"), this.mKuaiNiaoInit = !1, this.mKuaiNiaoShow = !1, this.mKuaiNiaoTimer = null, this.updateVipTaskInfo()
            }, e))
        }

        killKuaiNiaoTimer() {
            this.mKuaiNiaoTimer && (C.information("killKuaiNiaoTimer"), clearTimeout(this.mKuaiNiaoTimer), this.mKuaiNiaoInit = !1, this.mKuaiNiaoShow = !1, this.mKuaiNiaoTimer = null)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(8), o = n(815), r = n(817), s = n(143).DkHelperNS.getHelper(),
        l = n(1).default.getLogger("Thunder.VipDownload.offline-page");
    var u;
    !function (e) {
        e[e.Init = 0] = "Init", e[e.CommitWait = 1] = "CommitWait", e[e.Commiting = 2] = "Commiting", e[e.CommitFailed = 3] = "CommitFailed", e[e.CommitSuccess = 4] = "CommitSuccess"
    }(u = t.OfflineTaskStatus || (t.OfflineTaskStatus = {}));
    t.OfflineTask = class {
        constructor(e) {
            this.mOfflineTaskStatus = void 0, this.mCache = null, this.mTaskId = e.getTaskId(), this.mTask = e, this.offlineTaskStatus = u.Init, this.mCache = new r.OfflineTaskCacheNS.Task(this.mTaskId)
        }

        get taskId() {
            return this.mTaskId
        }

        get task() {
            return this.mTask
        }

        get offlineTaskStatus() {
            return this.mOfflineTaskStatus
        }

        set offlineTaskStatus(e) {
            (void 0 === this.mOfflineTaskStatus || e === u.Init || e > this.mOfflineTaskStatus) && (this.mOfflineTaskStatus = e)
        }

        enter() {
            return i(this, void 0, void 0, function* () {
                this.offlineTaskStatus === u.Init && (yield this.commit())
            })
        }

        exit() {
            this.clear(), this.offlineTaskStatus = u.Init
        }

        remove() {
            this.clear(!0)
        }

        loadData() {
            return i(this, void 0, void 0, function* () {
                yield this.mCache.load()
            })
        }

        clear(e) {
            this.mCache.clear(e)
        }

        commit() {
            return i(this, void 0, void 0, function* () {
                l.information("commit"), this.offlineTaskStatus = u.CommitWait;
                let e = this.task.getTaskBase();
                if (!e) return null;
                let t = [];
                if (e.taskType === a.DownloadKernel.TaskType.Bt) this.mCache.getItem(-1) || t.push(-1); else {
                    let e = this.task.getSelectFiles();
                    for (let n of e) this.mCache.getItem(n.subId) || t.push(n.subId)
                }
                if (l.information("subIds", t), t.length > 0) {
                    this.offlineTaskStatus = u.Commiting;
                    for (let e of t) yield this.commitOneTask(e)
                }
            })
        }

        commitOneTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.task.getTaskBase();
                if (!t) return l.information("taskBase not exits!"), null;
                let n = null;
                if (t.taskType === a.DownloadKernel.TaskType.Bt) {
                    let e = this.task.getTaskDetail();
                    if (!e) return l.information("taskDetail not exits!"), null;
                    let i = [], a = this.task.getSelectFiles();
                    for (let e of a) i.push(e.subId);
                    n = {
                        url: s.createBtTaskUrl(e.infoId),
                        filename: t.taskName,
                        gcid: "",
                        cid: "",
                        filesize: t.fileSize,
                        file_indexs: i,
                        refer_url: t.refUrl,
                        cookies: ""
                    }
                } else {
                    let t = this.task.getFile(e);
                    if (!t) return l.information("file not exits!"), null;
                    n = {
                        url: t.url,
                        filename: t.fileName,
                        gcid: t.gcid,
                        cid: t.cid,
                        filesize: t.fileSize,
                        file_indexs: [],
                        refer_url: t.refUrl,
                        cookies: ""
                    }
                }
                let i = {taskInfo: n}, r = yield(new o.OfflineTaskHttpSession).commitTask(i);
                this.onCommitTaskCallback(e, r)
            })
        }

        onCommitTaskCallback(e, t) {
            t && (0 === t.result ? this.offlineTaskStatus = u.CommitSuccess : this.offlineTaskStatus = u.CommitFailed, this.mCache.setItemData(e))
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(244), o = n(127), r = n(816), s = n(68), l = n(57), u = n(38),
        d = n(1).default.getLogger("Thunder.VipDownload.offline-page"), c = s.UserHelperNS.getHelper(),
        h = l.PluginHelperNS.getHelper();
    t.OfflineTaskHttpSession = class extends o.HttpSession {
        commitTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = c.userId, n = yield c.getSessionId(), i = h.clientName, o = h.thunderVersionNumber,
                    s = h.currentTime, l = Math.random(), f = "+]^%?#@COLL`(^POST" + i + o + s + l,
                    g = "client_name=" + i + "&client_version=" + o + "&ts=" + s + "&r=" + l + "&key=" + (f = u.ToolsUtilitiesAWNS.genarateMd5(f));
                return d.information("key", f), this.host = "api.zone.lixian.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/tasks/" + t + "?" + g, this.auth = t + ":" + n + ":client:0", this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = t, this.body = yield r.OfflineTaskHttpPackageNS.createCommitTaskBuffer(e), yield this.postCommitTaskRequest(e)
            })
        }

        postCommitTaskRequest(e) {
            return new Promise(t => {
                this.post(n => {
                    let i = null;
                    c.userId === e.userId && 200 === n.statusCode && n.body && (i = r.OfflineTaskHttpPackageNS.praseCommitTaskBuffer(n.body)), t(i)
                }, e => {
                    d.information("error", e), t(null)
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1).default.getLogger("Thunder.VipDownload.offline-page");
    !function (e) {
        e.createCommitTaskBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                a.information("--\x3ecreateCommitTaskBuffer");
                let t = {task_info: e.taskInfo}, n = JSON.stringify(t);
                a.information("jsonStr", n);
                let i = Buffer.from(n);
                return a.information("<--createCommitTaskBuffer"), i
            })
        }, e.praseCommitTaskBuffer = function (e) {
            a.information("--\x3epraseCommitTaskBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                a.information("jsonStr", n);
                try {
                    t = JSON.parse(n)
                } catch (e) {
                    a.warning(e)
                }
            }
            return a.information("<--praseCommitTaskBuffer"), t
        }
    }(t.OfflineTaskHttpPackageNS || (t.OfflineTaskHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(728).OfflineTaskDataBaseNS.getTable();
    !function (e) {
        class t {
            constructor(e) {
                this.mSubId = e
            }

            get subId() {
                return this.mSubId
            }

            set itemData(e) {
                this.mData = e
            }

            get itemData() {
                return this.mData
            }
        }

        e.SubTask = t;
        e.Task = class {
            constructor(e) {
                this.mTaskId = void 0, this.mSubTasks = new Map, this.mTaskId = e
            }

            createItem(e) {
                let n = this.getItem(e);
                return n || (n = new t(e), this.mSubTasks.set(e, n)), n
            }

            deleteItem(e) {
                this.mSubTasks.delete(e)
            }

            getItem(e) {
                return this.mSubTasks.get(e)
            }

            setItemData(e, t) {
                this.createItem(e).itemData = t, this.save(e).catch()
            }

            load() {
                return i(this, void 0, void 0, function* () {
                    let e = yield a.getTaskIndexs(this.mTaskId);
                    for (let t of e) this.setItemData(t)
                })
            }

            save(e) {
                return i(this, void 0, void 0, function* () {
                    (yield a.isTaskExist(this.mTaskId, e)) || (yield a.setUserData(this.mTaskId, e))
                })
            }

            clear(e) {
                this.mSubTasks.clear(), e && a.removeTask(this.mTaskId, -2).catch()
            }
        }
    }(t.OfflineTaskCacheNS || (t.OfflineTaskCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(29), a = n(1).default.getLogger("Thunder.VipDownload.aes-crypto");
    !function (e) {
        e.encryptString = function (e, t, n = "utf8", o = "hex") {
            let r = void 0;
            try {
                let s = i.createCipheriv("aes-128-ecb", t, "");
                r = s.update(e, n, o) + s.final(o)
            } catch (e) {
                a.error("encryptString", e)
            }
            return r
        }, e.decryptString = function (e, t, n = "hex", o = "utf8") {
            let r = void 0;
            try {
                let s = i.createDecipheriv("aes-128-ecb", t, "");
                r = s.update(e, n, o) + s.final(o)
            } catch (e) {
                a.error("decryptString", e)
            }
            return r
        }
    }(t.AesCryptoNS || (t.AesCryptoNS = {}))
}, function (e, t) {
    e.exports = require("querystring")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(129), o = n(729), r = n(718), s = n(821), l = n(230), u = n(8), d = n(203), c = n(57), h = n(567),
        f = n(731), g = n(145), p = n(12), k = n(1).default.getLogger("Thunder.VipDownload.vip-task"),
        m = d.ConfigHelperNS.getHelper(), T = h.ErrorCodeHelperNS.getHelper(),
        v = g.TaskEventContainerNS.getEventContainer();
    t.VipTask = class extends o.VipTaskBase {
        constructor() {
            super(...arguments), this.mTokenTimer = null, this.mCache = new s.VipTaskCacheNS.Task(this.taskId)
        }

        get vipTaskType() {
            return a.VipDownloadDefineNS.VipTaskType.Vip
        }

        get enableKuaiNiao() {
            return !1
        }

        get error() {
            return this.mCache.error
        }

        get showSpeed() {
            let e = !1;
            switch (this.vipTaskStatus) {
                case a.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    e = !0;
                    break;
                case a.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                case a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    this.error && this.error.isForbidResource && (e = !0)
            }
            return e
        }

        get acclerated() {
            return this.mCache.acclerated
        }

        get continued() {
            return this.mCache.continued
        }

        getVipSubTaskInfo(e) {
            if (!this.task.getTaskBase()) return null;
            let t = a.VipDownloadDefineNS.VipTaskStatus.Init, n = null, i = this.task.getTaskStatus();
            if (this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.Init && i === u.DownloadKernel.TaskStatus.Stopped) t = a.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped; else {
                let i = this.mCache.getItem(e);
                i && (t = i.taskStatus, n = i.error)
            }
            return {enterType: this.vipTaskType, enterStatus: t, error: n}
        }

        init() {
            this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.Init
        }

        enter() {
            this.vipTaskStatus === a.VipDownloadDefineNS.VipTaskStatus.Init && (this.mCache.enter().catch(), this.task.getTaskStatus() === u.DownloadKernel.TaskStatus.Started ? this.commit() : this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped)
        }

        exit() {
            this.updateVipSubTaskStatus(-2, a.VipDownloadDefineNS.VipTaskStatus.Init), this.unAcclerate()
        }

        remove() {
            this.unAcclerate(!0)
        }

        onCidGcidRetrieved(e) {
            let t = this.task.getTaskBase();
            if (!t) return;
            let n = this.task.getTaskStatus(), i = this.vipTaskStatus;
            if (n === u.DownloadKernel.TaskStatus.Started && i !== a.VipDownloadDefineNS.VipTaskStatus.Init) do {
                let n = this.mCache.getItem(e);
                if (n && n.commited) break;
                let o = t.taskType === u.DownloadKernel.TaskType.Bt && i === a.VipDownloadDefineNS.VipTaskStatus.Acclerating;
                this.commit([e], o)
            } while (0)
        }

        onTaskStatusChanged(e) {
            if (this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.Init) switch (e) {
                case u.DownloadKernel.TaskStatus.Started:
                    this.commit();
                    break;
                case u.DownloadKernel.TaskStatus.Stopped:
                    this.updateVipSubTaskStatus(-2, a.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped), this.unAcclerate(), this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped
            }
        }

        onTaskDcdnStatusChanged(e, t) {
            let n = this.task.getTaskStatus(), i = this.vipTaskStatus;
            if (n === u.DownloadKernel.TaskStatus.Started && i >= a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait) {
                if (t === u.DownloadKernel.DcdnStatusCode.AuthorizingFailed && i === a.VipDownloadDefineNS.VipTaskStatus.Acclerating) {
                    let t = [e];
                    return void this.commit(t)
                }
                switch (t) {
                    case void 0:
                    case u.DownloadKernel.DcdnStatusCode.Unkown:
                        break;
                    case u.DownloadKernel.DcdnStatusCode.Success:
                        this.mCache.acclerated = !0, this.updateVipSubTaskStatus(e, a.VipDownloadDefineNS.VipTaskStatus.Acclerating), this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.Acclerating;
                        break;
                    case u.DownloadKernel.DcdnStatusCode.ResourceNotFound:
                        this.updateVipSubTaskStatus(e, a.VipDownloadDefineNS.VipTaskStatus.SearchResource), this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.SearchResource;
                        break;
                    default:
                        let n = this.createDcdnError(t), i = T.getMessage(h.ErrorCodeHelperNS.ErrorType.Dcdn, n.result);
                        i && (n.message = i), n.isForbidResource = n.result && n.result >= 5 && n.result <= 8, this.updateVipSubTaskStatus(e, a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed, n), this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed && (this.mCache.error = n, this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed)
                }
            }
        }

        onSubTaskStatusChanged(e, t) {
            let n = this.task.getTaskBase();
            if (!n) return;
            let i = this.task.getTaskStatus(), o = this.vipTaskStatus;
            if (i === u.DownloadKernel.TaskStatus.Started && o !== a.VipDownloadDefineNS.VipTaskStatus.Init && (n.taskType === u.DownloadKernel.TaskType.Bt && t === u.DownloadKernel.BtFileStatus.Started || n.taskType === u.DownloadKernel.TaskType.Group && t === u.DownloadKernel.TaskStatus.Started)) do {
                let t = this.mCache.getItem(e);
                if (t && t.commited) break;
                let i = n.taskType === u.DownloadKernel.TaskType.Bt && o === a.VipDownloadDefineNS.VipTaskStatus.Acclerating;
                this.commit([e], i)
            } while (0)
        }

        clear(e) {
            this.killTokenTimer(), this.mCache.clear(e)
        }

        commit(e, t) {
            k.information("commit"), this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.CommitWait;
            let n = this.task.getTaskBase();
            if (!n) return null;
            let i = this.task.getDownloadingFiles(e);
            k.information("downloadingFiles", i);
            let o = [];
            for (let e of i) e.gcid && "" !== e.gcid && e.cid && "" !== e.cid && (o.push(e), this.mCache.createItem(e.subId), this.updateVipSubTaskStatus(e.subId, a.VipDownloadDefineNS.VipTaskStatus.Commiting));
            if (!t && o.length > 0) {
                let e = void 0, t = void 0, i = o, s = n.taskType === u.DownloadKernel.TaskType.Bt;
                if (s) {
                    let a = this.task.getTaskDetail();
                    if (!a) return;
                    e = n.taskName, t = a.infoId, i = [o[0]]
                }
                let l = {taskType: n.taskType, files: i, btTitle: e, infoId: t};
                this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.Commiting, (new r.VipTaskHttpSession).queyToken(l).then(e => {
                    if (s && e.length > 0) {
                        let t = e[0];
                        e = [];
                        for (let n of o) {
                            let i = p.ThunderUtil.deepCopy(t);
                            i.subId = n.subId, e.push(i)
                        }
                    }
                    this.onTokenCallback(e)
                }).catch()
            }
        }

        onTokenCallback(e) {
            let t = this.vipTaskStatus, n = this.task.getTaskStatus();
            if (t !== a.VipDownloadDefineNS.VipTaskStatus.Init && n === u.DownloadKernel.TaskStatus.Started) {
                let t = [], n = void 0, i = null;
                for (let o of e) {
                    let e = o.subId;
                    if (0 === o.result) t.push(e), n = o.expire, this.updateVipSubTaskStatus(e, a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait); else {
                        let t = o;
                        t.errorStep = l.HttpDefineNS.ErrorStep.Token, i = t, this.updateVipSubTaskStatus(e, a.VipDownloadDefineNS.VipTaskStatus.CommitFailed, t)
                    }
                    this.mCache.setItemData(e, o), this.mCache.getItem(e) && v.onEvent(g.TaskEventNS.taskTokenQueryResult, this.taskId, o.subId, o.result)
                }
                if (t.length > 0) this.acclerate(t); else if (i) {
                    let e = T.getMessage(h.ErrorCodeHelperNS.ErrorType.Speed, i.result);
                    e && (i.message = e), this.mCache.error = i, this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.CommitFailed
                }
                this.createTokenTimer(n)
            }
        }

        createTokenTimer(e) {
            if (!this.mTokenTimer) {
                k.information("--\x3ecreateTokenTimer");
                let t = void 0, n = c.PluginHelperNS.getHelper().currentTime;
                if (e) {
                    let i = m.getValue("VipDownload", "TokenExpireAdvanceSecond");
                    t = e - n - i, k.information("expire", e, "current", n);
                    let a = m.getValue("VipDownload", "TokenExpireMinSecond");
                    t = Math.max(a, t), k.information("advance", i, "min", a)
                } else {
                    let e = this.mCache.error;
                    e && e.result < 0 && (t = m.getValue("VipDownload", "TokenDefaultQueryInterval"))
                }
                k.information("timeout", t), t && (t *= 1e3, this.mTokenTimer = setTimeout(() => i(this, void 0, void 0, function* () {
                    k.information("onTokenTimer");
                    let e = this.mCache.itemIds;
                    this.commit(e), this.mTokenTimer = null
                }), t)), k.information("<--createTokenTimer")
            }
        }

        killTokenTimer() {
            this.mTokenTimer && (clearTimeout(this.mTokenTimer), this.mTokenTimer = null)
        }

        acclerate(e) {
            this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait;
            let t = this.task.getTaskBase();
            if (t) for (let n of e) {
                let e = this.mCache.getItem(n);
                if (e && e.itemData) {
                    let i = this.taskId;
                    t.taskType === u.DownloadKernel.TaskType.Group && (i = n);
                    let a = e.itemData.token;
                    a && f.TaskCertHelperNS.enableTaskCert(i, a)
                }
            }
        }

        unAcclerate(e) {
            if (this.vipTaskStatus >= a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait) {
                let e = this.task.getTaskBase();
                if (!e) return;
                let t = this.mCache.itemIds;
                for (let n of t) {
                    let t = this.taskId;
                    e.taskType === u.DownloadKernel.TaskType.Group && (t = n), f.TaskCertHelperNS.disableTaskCert(t)
                }
            }
            this.clear(e)
        }

        updateVipSubTaskStatus(e, t, n) {
            let i = null;
            -2 === e ? i = this.mCache.itemIds : (i = [e], this.mCache.setItemStatus(e, t, n)), this.batchSetVipSubTaskStatus(i, t, n)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(730).VipTaskDataBaseNS.getTable();
    !function (e) {
        class t {
            constructor(e) {
                this.mSubId = e
            }

            get subId() {
                return this.mSubId
            }

            set commited(e) {
                this.mCommited = e
            }

            get commited() {
                return this.mCommited
            }

            set itemData(e) {
                this.mData = e
            }

            get itemData() {
                return this.mData
            }

            set taskStatus(e) {
                this.mTaskStatus = e
            }

            get taskStatus() {
                return this.mTaskStatus
            }

            set error(e) {
                e && (this.mError = e)
            }

            get error() {
                return this.mError
            }

            clear() {
                this.itemData = null, this.error = null, this.commited = void 0
            }
        }

        e.SubTask = t;
        e.Task = class {
            constructor(e) {
                this.mTaskId = void 0, this.mSubTasks = new Map, this.mError = null, this.mAcclerated = !1, this.mContinued = !1, this.mTaskId = e
            }

            enter() {
                return i(this, void 0, void 0, function* () {
                    let e = yield a.isTaskExist(this.mTaskId, -1);
                    e || a.setUserData(this.mTaskId, -1).catch(), this.mContinued = e
                })
            }

            createItem(e) {
                let n = this.getItem(e);
                n || (n = new t(e), this.mSubTasks.set(e, n)), n.commited = !0
            }

            deleteItem(e) {
                this.mSubTasks.delete(e)
            }

            getItem(e) {
                return this.mSubTasks.get(e)
            }

            setItemData(e, t) {
                let n = this.getItem(e);
                n && (n.itemData = t)
            }

            setItemStatus(e, t, n) {
                let i = this.getItem(e);
                i && (i.taskStatus = t, i.error = n)
            }

            get itemIds() {
                let e = [];
                return this.mSubTasks.forEach(function (t, n) {
                    e.push(n)
                }), e
            }

            set error(e) {
                e && (this.mError = e)
            }

            get error() {
                return this.mError
            }

            set acclerated(e) {
                this.mAcclerated = e
            }

            get acclerated() {
                return this.mAcclerated
            }

            set continued(e) {
                this.mContinued = e
            }

            get continued() {
                return this.mContinued
            }

            clear(e) {
                this.mSubTasks.forEach(e => {
                    e.clear()
                }), this.mContinued = !0, this.error = null, e && a.removeTask(this.mTaskId, -2).catch()
            }
        }
    }(t.VipTaskCacheNS || (t.VipTaskCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(127), o = n(10), r = n(1).default.getLogger("Thunder.VipDownload.file-download");
    !function (e) {
        e.downloadFile = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                r.information("downloadFile", "downloadUrl", e, "savePath", t);
                let s = yield function (e) {
                    return i(this, void 0, void 0, function* () {
                        let t = new Promise(t => {
                            let n = new a.HttpSession;
                            n.url = e, n.get(e => {
                                let n = null;
                                200 === e.statusCode && e.body && (n = e.body), t(n)
                            }, e => {
                                r.information("error", e), t(null)
                            })
                        });
                        return t
                    })
                }(e);
                return s && (n = yield o.FileSystemAWNS.writeFileAW(t, s)), n
            })
        }
    }(t.FileDownloadNS || (t.FileDownloadNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(10), o = n(1).default.getLogger("Thunder.VipDownload.config");
    t.Config = class {
        constructor() {
            this.configData = {}
        }

        init() {
            this.configData = {
                VipDownload: {
                    TokenExpireAdvanceSecond: 300,
                    TokenExpireMinSecond: 20,
                    TokenDefaultQueryInterval: 300,
                    EnableTryMinSize: 209715200,
                    EnableTryMaxProgress: 40,
                    TryInterval: 1800,
                    TryMaxProgress: 20,
                    TryMaxSize: 1073741824,
                    TryFailDispearDelay: 5,
                    TryFinishDispearDelay: 1800,
                    TryFinishClickDispearDelay: 180,
                    EnableSuperTryMinSize: 524288e3,
                    EnableSuperTryMaxProgress: 50,
                    SuperTryFinishDispearDelay: 5,
                    SceneChangeInterval: 10
                }, KuaiNiao: {KuaiNiaoPortalPort: 81, KuaiNiaoHeartBeatInterval: 300, KuaiNiaoHeartBeatLoseMaxCount: 2}
            }
        }

        getValue(e, t) {
            let n = void 0;
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = this.configData[e];
                if (!i) break;
                n = i[t]
            } while (0);
            return n
        }

        loadFile(e) {
            return i(this, void 0, void 0, function* () {
                let t = yield a.FileSystemAWNS.existsAW(e);
                if (t) {
                    t = !1;
                    let n = yield a.FileSystemAWNS.readFileAW(e);
                    if (n) {
                        let e = null;
                        try {
                            (e = JSON.parse(n.toString())) && (t = !0)
                        } catch (e) {
                            o.warning(e)
                        }
                        this.mergeConfigData(e)
                    }
                }
                return t
            })
        }

        printConfigData() {
            o.information("configData", this.configData)
        }

        mergeConfigData(e) {
            if (e) if (null === this.configData) this.configData = e; else for (let t in e) {
                let n = e[t];
                if (!n) break;
                for (let e in n) {
                    let i = n[e], a = this.configData[t];
                    if (a) a[e] = i; else {
                        let n = {};
                        n[e] = i, this.configData[t] = n
                    }
                }
            }
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(129), a = n(729), o = n(732), r = n(282), s = n(8), l = n(230), u = n(203), d = n(232), c = n(68),
        h = n(57), f = n(145), g = n(731), p = n(56), k = n(1).default.getLogger("Thunder.VipDownload.try-task"),
        m = r.TryTaskCacheNS.getCacheManager(), T = u.ConfigHelperNS.getHelper(), v = d.KuainiaoManagerNS.getManager(),
        C = c.UserHelperNS.getHelper(), S = f.TaskEventContainerNS.getEventContainer();
    t.TryTask = class extends a.VipTaskBase {
        constructor() {
            super(...arguments), this.mTryTimer = null, this.mTryFinishTimer = null, this.mIsExit = !1, this.mIsFinish = !1, this.mRemainTime = void 0, this.mRemainSize = void 0, this.mStartSize = void 0, this.mTrySize = void 0
        }

        get vipTaskType() {
            return i.VipDownloadDefineNS.VipTaskType.Try
        }

        get tryType() {
            let e = i.VipDownloadDefineNS.TryType.PlatinumVip;
            return this.cache && (e = this.cache.type), e
        }

        get enableKuaiNiao() {
            return this.tryType === i.VipDownloadDefineNS.TryType.SuperVip
        }

        get error() {
            let e = null;
            return this.cache && (e = this.cache.error), e
        }

        get showSpeed() {
            let e = !1;
            switch (this.vipTaskStatus) {
                case i.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    e = !0
            }
            return e
        }

        get acclerated() {
            return !!this.cache && this.cache.acclerated
        }

        get continued() {
            return !!this.cache && this.cache.continued
        }

        set vipTaskStatus(e) {
            this.updateVipSubTaskStatus(e), super.vipTaskStatus = e
        }

        get vipTaskStatus() {
            return super.vipTaskStatus
        }

        getVipSubTaskInfo(e) {
            return this.cache && this.cache.subId === e ? {
                enterType: this.vipTaskType,
                enterStatus: this.vipTaskStatus,
                error: this.cache.error
            } : null
        }

        init() {
            this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Init
        }

        enter() {
            this.checkExitVip(), this.task.getTaskStatus() === s.DownloadKernel.TaskStatus.Started ? this.commit() : this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped, this.mTrySize = this.getTrySize(), k.information("mTrySize", this.mTrySize), this.mRemainSize = this.mTrySize, this.updateDetail(), this.kuaiNiaoAcclerate()
        }

        exit() {
            this.unAcclerate(), this.clear(), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Unkown
        }

        remove() {
            this.clear(), m.removeTask(this.taskId, !0)
        }

        setFinishClickDispearDelay() {
            if (this.tryType === i.VipDownloadDefineNS.TryType.PlatinumVip) {
                let e = T.getValue("VipDownload", "TryFinishClickDispearDelay");
                this.killTryFinishTimer(), this.createTryFinishTimer(e)
            }
        }

        onCidGcidRetrieved(e) {
        }

        onTaskStatusChanged(e) {
            k.information("onTaskStatusChanged", e);
            let t = this.vipTaskStatus;
            if (k.information("vipTaskStatus", t), t > i.VipDownloadDefineNS.VipTaskStatus.Init && t < i.VipDownloadDefineNS.VipTaskStatus.Finished) switch (e) {
                case s.DownloadKernel.TaskStatus.Started:
                    this.commit();
                    break;
                case s.DownloadKernel.TaskStatus.Stopped:
                    this.unAcclerate(), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped
            }
        }

        onTaskDcdnStatusChanged(e, t) {
            if (!this.cache) return;
            if (-1 !== e && e !== this.cache.subId) return;
            let n = this.task.getTaskStatus(), a = this.vipTaskStatus;
            if (!this.mIsExit && n === s.DownloadKernel.TaskStatus.Started && a >= i.VipDownloadDefineNS.VipTaskStatus.AcclerateWait && a < i.VipDownloadDefineNS.VipTaskStatus.Finished) {
                if (t === s.DownloadKernel.DcdnStatusCode.AuthorizingFailed && a === i.VipDownloadDefineNS.VipTaskStatus.Acclerating) return void this.commit();
                switch (t) {
                    case void 0:
                    case s.DownloadKernel.DcdnStatusCode.Unkown:
                        break;
                    case s.DownloadKernel.DcdnStatusCode.Success:
                        this.cache.acclerated = !0, this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Acclerating, this.createTryTimer();
                        break;
                    default:
                        if (this.vipTaskStatus !== i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed) {
                            let e = this.createDcdnError(t);
                            this.cache && (this.cache.error = e), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed, this.failed()
                        }
                }
            }
        }

        onSubTaskStatusChanged(e, t) {
        }

        clear() {
            this.killTryTimer(), this.killTryFinishTimer(), this.mIsExit = !0, m.removeTaskId(this.taskId)
        }

        commit() {
            if (k.information("commit"), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Commiting, !this.cache) return;
            if (this.cache.trialVerify) return void this.queryToken();
            let e = this.task.getFile(this.cache.subId);
            if (!e) return;
            let t = {trialKey: this.cache.trialKey, file: e};
            (new o.TryTaskHttpSession).commit(t).then(e => {
                this.onCommitCallback(e)
            }).catch()
        }

        onCommitCallback(e) {
            if (k.information("onCommitCallback"), !this.mIsExit && e) if (m.setCommitData(this.taskId, e), 0 === e.result) this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.CommitSuccess, this.task.getTaskStatus() === s.DownloadKernel.TaskStatus.Started && this.queryToken(); else {
                let t = e;
                t.errorStep = l.HttpDefineNS.ErrorStep.Commit, this.cache && (this.cache.error = t), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.CommitFailed, this.failed()
            }
        }

        queryToken() {
            if (k.information("queryToken"), !this.cache) return;
            let e = this.task.getTaskBase(), t = this.task.getFile(this.cache.subId);
            if (!e || !t) return;
            let n = void 0, i = void 0;
            if (e.taskType === s.DownloadKernel.TaskType.Bt) {
                let t = this.task.getTaskDetail();
                if (!t) return;
                n = e.taskName, i = t.infoId
            }
            let a = {verify: this.cache.trialVerify, file: t, taskType: e.taskType, btTitle: n, infohash: i};
            (new o.TryTaskHttpSession).queyToken(a).then(e => {
                this.onTokenCallback(e)
            }).catch()
        }

        onTokenCallback(e) {
            if (k.information("onTokenCallback"), !this.mIsExit && this.cache && e) if (m.setTokenData(this.taskId, e), S.onEvent(f.TaskEventNS.taskTokenQueryResult, this.taskId, this.cache.subId, e.result), 0 === e.result) this.task.getTaskStatus() === s.DownloadKernel.TaskStatus.Started && this.acclerate(); else {
                let t = e;
                t.errorStep = l.HttpDefineNS.ErrorStep.Token, this.cache.error = t, this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.CommitFailed, this.failed()
            }
        }

        acclerate() {
            this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateWait, this.cache && g.TaskCertHelperNS.enableTaskCert(this.taskId, this.cache.token)
        }

        unAcclerate() {
            this.cache && (this.cache.continued = !0);
            let e = this.vipTaskStatus;
            !this.mIsFinish && e >= i.VipDownloadDefineNS.VipTaskStatus.AcclerateWait && g.TaskCertHelperNS.disableTaskCert(this.taskId)
        }

        checkEnterVip() {
            if (this.tryType === i.VipDownloadDefineNS.TryType.SuperVip) {
                let e = this.task.getTaskStatus();
                C.isVip && e === s.DownloadKernel.TaskStatus.Started && this.task.getTaskExtra().enterAcclerate(i.VipDownloadDefineNS.VipTaskType.Vip)
            }
        }

        checkExitVip() {
            this.tryType === i.VipDownloadDefineNS.TryType.SuperVip && this.task.getTaskExtra().exitAcclerate(i.VipDownloadDefineNS.VipTaskType.Vip)
        }

        finish() {
            k.information("finish"), this.killTryTimer();
            let e = void 0;
            e = this.tryType === i.VipDownloadDefineNS.TryType.SuperVip ? T.getValue("VipDownload", "SuperTryFinishDispearDelay") : T.getValue("VipDownload", "TryFinishDispearDelay"), this.createTryFinishTimer(e), this.unAcclerate(), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Finished, this.mIsFinish = !0, this.checkEnterVip()
        }

        failed() {
            k.information("failed"), this.createTryFailTimer(), this.unAcclerate(), this.mIsFinish = !0, this.checkEnterVip()
        }

        kuaiNiaoAcclerate() {
            this.enableKuaiNiao && v.triggerTry().catch()
        }

        get cache() {
            return m.getTask(this.taskId)
        }

        createTryTimer() {
            if (!this.mTryTimer) {
                if (k.information("createTryTimer"), !this.cache || void 0 === this.cache.maxTime) return void k.information("cache.maxTime not exist!");
                let e = this.task.getTaskBase();
                if (!e || void 0 === e.receiveSize) return void k.information("taskBase.receiveSize not exist!");
                this.mRemainTime = this.cache.maxTime, this.mStartSize = e.receiveSize, k.information("mStartSize", this.mStartSize), this.mTryTimer = setInterval(() => {
                    this.onTryTimer()
                }, 1e3)
            }
        }

        onTryTimer() {
            this.mRemainTime -= 1;
            let e = this.task.getTaskBase();
            if (e && e.receiveSize) {
                k.information("receiveSize", e.receiveSize);
                let t = e.receiveSize - this.mStartSize;
                this.mRemainSize = this.mTrySize - t
            }
            k.information("mRemainSize", this.mRemainSize), k.information("mRemainTime", this.mRemainTime), this.mRemainSize <= 0 && (this.mRemainSize = 0, this.mRemainTime = 0), this.updateDetail(), this.mRemainTime <= 0 && this.finish();
            let t = T.getValue("VipDownload", "TokenExpireAdvanceSecond"), n = h.PluginHelperNS.getHelper().currentTime;
            this.vipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.Acclerating && this.cache && this.cache.tokenExpire - t < n && this.commit()
        }

        killTryTimer() {
            this.mTryTimer && (k.information("killTryTimer"), clearInterval(this.mTryTimer), this.mTryTimer = void 0)
        }

        createTryFinishTimer(e) {
            this.mTryFinishTimer || (k.information("createTryFinishTimer"), this.mTryFinishTimer = setTimeout(() => {
                this.task.getTaskExtra().exitAcclerate(this.vipTaskType), this.killTryFinishTimer()
            }, 1e3 * e))
        }

        killTryFinishTimer() {
            this.mTryFinishTimer && (k.information("killTryFinishTimer"), clearTimeout(this.mTryFinishTimer), this.mTryFinishTimer = void 0)
        }

        createTryFailTimer() {
            let e = T.getValue("VipDownload", "TryFailDispearDelay");
            this.createTryFinishTimer(e)
        }

        getTrySize() {
            let e = 0, t = this.task.getTaskBase();
            if (!t || !t.fileSize) return e;
            if (!this.cache || void 0 === this.cache.subId) return e;
            const n = T.getValue("VipDownload", "TryMaxProgress"), i = T.getValue("VipDownload", "TryMaxSize");
            return e = Math.floor(t.fileSize * n / 100), e = Math.min(e, i)
        }

        updateDetail() {
            let e = this.mTrySize ? 1 - this.mRemainSize / this.mTrySize : 0,
                t = {remainSize: this.mRemainSize, progress: e};
            S.onEvent(f.TaskEventNS.taskTryDetailChanged, this.taskId, t), p.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskTryDetailChanged", this.taskId, JSON.stringify(t))
        }

        updateVipSubTaskStatus(e) {
            if (!this.cache) return;
            let t = this.cache.subId;
            void 0 !== t && null !== t && this.batchSetVipSubTaskStatus([t], e, this.cache.error)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(244), o = n(129), r = n(143), s = n(1).default.getLogger("Thunder.VipDownload.try-task"),
        l = r.DkHelperNS.getHelper();
    !function (e) {
        e.createQueryBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3ecreateQueryBuffer");
                let t = {
                    peer_id: yield l.getTpPeerId(),
                    bt_title: e.btTitle,
                    url: e.file.url,
                    filename: e.file.fileName,
                    gcid: e.file.gcid,
                    cid: e.file.cid,
                    filesize: e.file.fileSize
                }, n = a.HttpJsonCryptoNS.getKey(e.userId, e.random), i = a.HttpJsonCryptoNS.encryptHttpBuffer(t, n);
                return s.information("<--createQueryBuffer"), i
            })
        }, e.praseQueryBuffer = function (e, t, n) {
            s.information("--\x3epraseQueryBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), r = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i);
            if (!r) return null;
            let l = void 0;
            l = 1 === r.speed_type ? o.VipDownloadDefineNS.TryType.SuperVip : o.VipDownloadDefineNS.TryType.PlatinumVip;
            let u = {
                result: r.result,
                message: r.message,
                trialKey: r.trial_key,
                expireTime: r.trial_refresh_time,
                leftCount: r.trial_left_times,
                type: l
            };
            return s.information("<--praseQueryBuffer"), u
        }, e.createCommitBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3ecreateCommitBuffer");
                let t = {
                    peer_id: yield l.getTpPeerId(),
                    url: e.file.url,
                    filename: e.file.fileName,
                    gcid: e.file.gcid,
                    cid: e.file.cid,
                    filesize: e.file.fileSize,
                    trial_key: e.trialKey
                }, n = a.HttpJsonCryptoNS.getKey(e.userId, e.random), i = a.HttpJsonCryptoNS.encryptHttpBuffer(t, n);
                return s.information("<--createCommitBuffer"), i
            })
        }, e.praseCommitBuffer = function (e, t, n) {
            s.information("--\x3epraseCommitBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), o = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i);
            if (!o) return null;
            let r = {result: o.result, message: o.message, verify: o.trial_verify_info};
            return s.information("<--praseCommitBuffer"), r
        }, e.createTokenBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3ecreateTokenBuffer");
                let t = {
                        url: e.file.url,
                        filename: e.file.fileName,
                        gcid: e.file.gcid,
                        cid: e.file.cid,
                        filesize: e.file.fileSize,
                        refer_url: e.file.refUrl,
                        cookies: "",
                        file_index: 2 === e.taskType ? e.file.subId : void 0
                    }, n = {peer_id: yield l.getTpPeerId(), infohash: e.infohash, bt_title: e.btTitle, task_infos: [t]},
                    i = a.HttpJsonCryptoNS.getKey(e.userId, e.random), o = a.HttpJsonCryptoNS.encryptHttpBuffer(n, i);
                return s.information("<--createTokenBuffer"), o
            })
        }, e.praseTokenBuffer = function (e, t, n) {
            s.information("--\x3epraseTokenBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), o = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i);
            if (!o) return null;
            if (0 !== o.result) return {result: o.result, message: o.message};
            let r = o.task_infos;
            if (!r) return null;
            let l = r[0];
            if (!l) return null;
            let u = {
                result: l.result,
                message: l.simple_msg,
                detailMessage: l.message,
                gcid: l.gcid,
                token: l.token,
                expire: l.expire,
                maxTime: o.speed_duration
            };
            return s.information("<--praseTokenBuffer"), u
        }
    }(t.TryTaskHttpPackageNS || (t.TryTaskHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    t.TaskCache = class {
        constructor() {
            this.mSelectId = void 0, this.mTrialKey = void 0, this.mTrialVerify = void 0, this.mExpireTime = void 0, this.mCreateTime = void 0, this.mToken = void 0, this.mTokenExpire = void 0, this.mMaxTime = void 0, this.mError = null, this.mCommited = !1, this.mAcclerated = !1, this.mContinued = !1
        }

        get subId() {
            return this.mSelectId
        }

        set subId(e) {
            this.mSelectId = e
        }

        set type(e) {
            this.mType = e
        }

        get type() {
            return this.mType
        }

        set trialKey(e) {
            this.mTrialKey = e
        }

        get trialKey() {
            return this.mTrialKey
        }

        set expireTime(e) {
            this.mExpireTime = e
        }

        get expireTime() {
            return this.mExpireTime
        }

        set createTime(e) {
            this.mCreateTime = e
        }

        get createTime() {
            return this.mCreateTime
        }

        set trialVerify(e) {
            this.mTrialVerify = e
        }

        get trialVerify() {
            return this.mTrialVerify
        }

        set token(e) {
            this.mToken = e
        }

        get token() {
            return this.mToken
        }

        set tokenExpire(e) {
            this.mTokenExpire = e
        }

        get tokenExpire() {
            return this.mTokenExpire
        }

        set maxTime(e) {
            this.mMaxTime = e
        }

        get maxTime() {
            return this.mMaxTime
        }

        set commited(e) {
            this.mCommited = e
        }

        get commited() {
            return this.mCommited
        }

        set acclerated(e) {
            this.mAcclerated = e
        }

        get acclerated() {
            return this.mAcclerated
        }

        set continued(e) {
            this.mContinued = e
        }

        get continued() {
            return this.mContinued
        }

        set error(e) {
            e && (this.mError = e)
        }

        get error() {
            return this.mError
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(127), o = n(828), r = n(68), s = n(57), l = n(203), u = n(1).default.getLogger("Thunder.KuaiNiao"),
        d = s.PluginHelperNS.getHelper(), c = r.UserHelperNS.getHelper(), h = l.ConfigHelperNS.getHelper();

    class f extends a.HttpSession {
        queryPortal() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => i(this, void 0, void 0, function* () {
                    this.host = "api.portal.swjsq.vip.xunlei.com", this.retries = 1, this.port = h.getValue("KuaiNiao", "KuaiNiaoPortalPort"), this.path = "/v2/queryportal", this.timeout = 1e4;
                    let t = yield this.getPortalRequest();
                    t || (this.host = "api2.portal.swjsq.vip.xunlei.com", this.retries = 0, t = yield this.getPortalRequest()), e(t)
                }))
            })
        }

        queryBand(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.ip, this.port = Number(e.port).valueOf();
                    let a = yield c.getPeerId(), o = c.userId;
                    this.path = `/v2/bandwidth?sequence=${n}&peerid=${a}&userid=${o}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 15e3;
                    let r = void 0, s = yield this.getBandRequest();
                    if (s) switch (s.result) {
                        case 0:
                        case 520:
                            break;
                        case 711:
                            r = 1e4;
                            break;
                        default:
                            r = 3e3
                    } else r = 3e3;
                    r ? setTimeout(() => i(this, void 0, void 0, function* () {
                        s = yield this.getBandRequest(), t(s)
                    }), r) : t(s)
                }))
            })
        }

        speedUp(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let a = yield c.getPeerId(), o = e.userId, r = e.sessionId;
                    this.path = `/v2/upgrade?sequence=${n}&peerid=${a}&userid=${o}&sessionid=${r}&user_type=${e.speedType}&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 15e3;
                    let s = void 0, l = yield this.getSpeedUpRequest();
                    if (l) switch (l.result) {
                        case 711:
                            s = 1e4
                    } else s = 3e3;
                    s ? setTimeout(() => i(this, void 0, void 0, function* () {
                        l = yield this.getSpeedUpRequest(), t(l)
                    }), s) : t(l)
                }))
            })
        }

        speedDown(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let i = yield c.getPeerId(), a = e.userId, o = e.sessionId;
                    this.path = `/v2/recover?sequence=${n}&peerid=${i}&userid=${a}&sessionid=${o}&user_type=${e.speedType}&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 1e4;
                    let r = !0, s = yield this.getSpeedDownRequest();
                    if (s) switch (s.result) {
                        case 0:
                        case 520:
                        case 513:
                        case 518:
                        case 700:
                            r = !1
                    }
                    r && (s = yield this.getSpeedDownRequest()), t(s)
                }))
            })
        }

        heartBeat(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let i = yield c.getPeerId(), a = c.userId, o = yield c.getSessionId();
                    this.path = `/v2/keepalive?sequence=${n}&peerid=${i}&userid=${a}&sessionid=${o}&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 1e4;
                    let r = yield this.getHeartBeatRequest();
                    t(r)
                }))
            })
        }

        queryTry(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let a = yield c.getPeerId(), o = c.userId, r = yield c.getSessionId();
                    this.path = `/v2/query_try_info?sequence=${n}&peerid=${a}&userid=${o}&sessionid=${r}&upspeed=0&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 1e4;
                    let s = void 0, l = yield this.getTryRequest();
                    if (l) switch (l.result) {
                        case 0:
                        case 508:
                        case 520:
                        case 715:
                        case 717:
                        case 718:
                            break;
                        default:
                            s = 3e3
                    } else s = 3e3;
                    s ? setTimeout(() => i(this, void 0, void 0, function* () {
                        l = yield this.getTryRequest(), t(l)
                    }), s) : t(l)
                }))
            })
        }

        getPortalRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.prasePortalBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getBandRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseBandBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getSpeedUpRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseSpeedUpBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getSpeedDownRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseSpeedDownBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getHeartBeatRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseHeartBeatBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getTryRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseTryBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        get clientType() {
            return "pc-xlxknplugin-" + d.thunderVersionString
        }

        get clientVersion() {
            return "xlxkn-" + d.thunderVersionString
        }

        get osVersion() {
            return "1.0"
        }
    }

    f.sequence = 0, t.KuainiaoHttpSession = f
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1).default.getLogger("Thunder.KuaiNiao");
    !function (e) {
        e.prasePortalBuffer = function (e) {
            i.information("--\x3eprasePortalBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                serverIp: n.interface_ip,
                serverPort: n.interface_port
            };
            return i.information("<--prasePortalBuffer"), a
        }, e.praseBandBuffer = function (e) {
            i.information("--\x3epraseBandBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                canUpgrade: n.can_upgrade,
                dialAccount: n.dial_account,
                bandWidth: n.bandwidth,
                maxBandWidth: n.max_bandwidth
            };
            return i.information("<--praseBandBuffer"), a
        }, e.praseSpeedUpBuffer = function (e) {
            i.information("--\x3epraseSpeedUpBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                dialAccount: n.dial_account,
                bandWidth: n.bandwidth,
                timeStamp: n.timestamp
            };
            return i.information("<--praseSpeedUpBuffer"), a
        }, e.praseSpeedDownBuffer = function (e) {
            i.information("--\x3epraseSpeedDownBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                dialAccount: n.dial_account,
                bandWidth: n.bandwidth,
                timeStamp: n.timestamp
            };
            return i.information("<--praseSpeedDownBuffer"), a
        }, e.praseHeartBeatBuffer = function (e) {
            i.information("--\x3epraseHeartBeatBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                timeStamp: n.timestamp,
                userId: n.userid,
                peerId: n.peerid,
                clientType: n.client_type,
                hasSpeedTime: n.has_speedup_time
            };
            return i.information("<--praseHeartBeatBuffer"), a
        }, e.praseTryBuffer = function (e) {
            i.information("--\x3epraseTryBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                timeStamp: n.timestamp,
                leftCount: n.number_of_try,
                duration: n.try_duration
            };
            return i.information("<--praseTryBuffer"), a
        }
    }(t.KuainiaoHttpPackageNS || (t.KuainiaoHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(57), a = n(1).default.getLogger("Thunder.VipDownload.ui-helper"), o = i.PluginHelperNS.getHelper();

    class r {
        init() {
        }

        showLoginDialog() {
        }

        openTab(e) {
            o.nativeCall && o.nativeCall.CallNativeFunction("openNewTab", e, e => {
                a.information("errorCode", e)
            })
        }
    }

    t.UIHelper = r, function (e) {
        const t = new r;
        e.getHelper = function () {
            return t
        }
    }(t.UIHelperNS || (t.UIHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(831), o = n(68), r = n(143), s = n(833), l = n(203), u = n(57), d = n(72),
        c = n(1).default.getLogger("Thunder.VipDownload.task-scene"), h = r.DkHelperNS.getHelper(),
        f = l.ConfigHelperNS.getHelper();
    var g;
    !function (e) {
        e.taskSceneChanged = "OnTaskSceneChanged"
    }(g = t.SceneEventNS || (t.SceneEventNS = {}));

    class p extends d.default {
        constructor() {
            super(), this.mSelectTaskId = void 0, this.mRefreshTime = void 0, this.mSession = null, this.mCacheManager = null, this.mSession = new a.SceneHttpSession, this.mCacheManager = s.SceneCacheNS.getCacheManager(), this.setMaxListeners(0)
        }

        init() {
            o.UserHelperNS.getHelper().attachListener(o.UserEventNS.authorityChanged, e => {
                c.information("authority", e), this.clear(), this.mSelectTaskId && this.activeTask(this.mSelectTaskId)
            }), setInterval(() => {
                this.refresh()
            }, 5e3), this.attachDkEvents()
        }

        getScene(e) {
            let t = this.mCacheManager.getTask(e);
            return t ? t.getItem() : null
        }

        onTaskExpand(e) {
            this.mSelectTaskId !== e && (this.mSelectTaskId = e, this.activeTask(e))
        }

        onTaskUnExpand(e) {
            this.mSelectTaskId === e && (this.mSelectTaskId = void 0, this.mRefreshTime = void 0)
        }

        onClickScene(e) {
            this.changeToNextScene(e)
        }

        attachDkEvents() {
            h.attachListener(r.DkEventNS.taskCompleted, e => {
                this.onTaskCompleted(e)
            }), h.attachListener(r.DkEventNS.taskRemoved, e => {
                this.onTaskRemoved(e)
            })
        }

        clear() {
            this.mSession.clear(), this.mCacheManager.clear()
        }

        refresh() {
            let e = f.getValue("VipDownload", "SceneChangeInterval"), t = this.mSelectTaskId, n = this.mRefreshTime,
                i = u.PluginHelperNS.getHelper().currentTime;
            t && n && i - n >= e && this.changeToNextScene(t)
        }

        activeTask(e) {
            this.mCacheManager.getTask(e) ? this.changeToNextScene(e) : this.mSession.queryTask(e, t => i(this, void 0, void 0, function* () {
                t && (yield this.mCacheManager.createTask(e, t), this.changeToNextScene(e))
            }))
        }

        changeToNextScene(e) {
            if (this.mSelectTaskId === e) {
                c.information("changeToNextScene", e);
                let t = this.mCacheManager.getTask(e);
                if (t) {
                    let n = t.getItem();
                    n && (this.fireEvent(g.taskSceneChanged, e, n), c.information("item.text", n.text)), t.next()
                }
                this.mRefreshTime = u.PluginHelperNS.getHelper().currentTime
            }
        }

        onTaskRemoved(e) {
            this.removeTask(e)
        }

        onTaskCompleted(e) {
            this.removeTask(e)
        }

        removeTask(e) {
            this.mCacheManager.deleteTask(e), this.mSession.removeTask(e), this.mSelectTaskId === e && (this.mSelectTaskId = void 0, this.mRefreshTime = void 0)
        }
    }

    t.SceneManager = p, function (e) {
        const t = new p;
        e.getSceneManager = function () {
            return t
        }
    }(t.TaskSceneManagerNS || (t.TaskSceneManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(127), o = n(832), r = n(68), s = n(1).default.getLogger("Thunder.VipDownload.task-scene");
    t.SceneHttpSession = class extends a.HttpSession {
        constructor() {
            super(), this.mMapDoneTaskids = new Map, this.mListWaitTasks = [], this.mIsQuerying = !1
        }

        clear() {
            this.mMapDoneTaskids.clear(), this.mListWaitTasks = []
        }

        removeTask(e) {
            this.mMapDoneTaskids.delete(e)
        }

        queryTask(e, t) {
            this.mMapDoneTaskids.get(e) ? s.information("taskId already query!") : (this.mMapDoneTaskids.set(e, e), this.mListWaitTasks.push({
                taskId: e,
                callback: t
            }), this.queryNext().catch())
        }

        queryNext() {
            return i(this, void 0, void 0, function* () {
                if (!this.mIsQuerying && this.mListWaitTasks.length > 0) {
                    let e = this.mListWaitTasks[0], t = e.taskId, n = e.callback;
                    this.mListWaitTasks.splice(0, 1);
                    let i = -1, a = {peerId: yield r.UserHelperNS.getHelper().getPeerId(), taskId: t, subId: i};
                    this.mIsQuerying = !0, n(yield this.query(a)), this.mIsQuerying = !1, this.queryNext().catch()
                }
            })
        }

        query(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.host = "scene.vip.xunlei.com", this.port = 8e3, this.retries = 1, this.timeout = 15e3, this.body = o.SceneHttpPackageNS.createSceneBuffer(e), this.post(e => {
                        let n = null;
                        200 === e.statusCode && e.body && e.body.length > 12 && (n = o.SceneHttpPackageNS.praseSceneBuffer(e.body)), t(n)
                    }, e => {
                        s.information("error", e), t(null)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(200), a = n(201), o = n(57), r = n(68), s = n(1).default.getLogger("Thunder.VipDownload.task-scene");
    !function (e) {
        let t = 0;

        class n {
        }

        e.ItemData = n, e.createSceneBuffer = function (e) {
            s.information("--\x3ecreateSceneBuffer");
            let n = 0, l = Buffer.alloc(1024);
            n = l.writeUInt32LE(11, n), s.information("    protocolVersion:", 11), n = l.writeUInt32LE(++t, n), s.information("    sequence:", t), n = l.writeUInt32LE(0, n), s.information("    commandLegth:", 0);
            let u = o.PluginHelperNS.getHelper().thunderVersionNumber;
            n = l.writeUInt32LE(u, n), s.information("    thunderFlag:", u), n = l.writeUInt16LE(256, n), s.information("    compressFlag:", 256), n = l.writeUInt16LE(1, n), s.information("    commandType:", 1);
            let d = r.UserHelperNS.getHelper(), c = Number(d.userId).valueOf();
            n = a.BufferUtilitiesNS.writeUInt64LE(l, c, n), s.information("    userId:", c);
            let h = d.vipLevel;
            n = l.writeInt8(h, n), s.information("    vipLevel:", h);
            let f = d.userLevel;
            n = l.writeUInt32LE(f, n), s.information("    userLevel:", f);
            let g = e.peerId;
            return n = a.BufferUtilitiesNS.writeString(l, g, n, "gbk"), s.information("    peerId:", g), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    taskUrl:", ""), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    referUrl:", ""), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    gcid:", ""), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    cid:", ""), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    fileSize:", 0), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    taskName:", ""), n = l.writeUInt32LE(0, n), s.information("    netStatus:", 0), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    taskSpeed:", 0), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    totalSpeed:", 0), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    speedLimit:", 0), n = l.writeUInt32LE(0, n), s.information("    downloadingCount:", 0), n = l.writeUInt32LE(0, n), s.information("    resourceCount:", 0), n = l.writeUInt32LE(0, n), s.information("    downloadMode:", 0), n = l.writeUInt32LE(2, n), s.information("    queryType:", 2), n = l.writeUInt32LE(0, n), s.information("    ipProvince:", 0), n = l.writeUInt32LE(0, n), s.information("    ipCity:", 0), n = l.writeUInt32LE(0, n), s.information("    ipIsp:", 0), n = l.writeUInt32LE(0, n), s.information("    privilege:", 0), n = l.writeUInt32LE(0, n), s.information("    subNum:", 0), l = l.slice(0, n), l = i.ShubCryptoNS.encryptHttpBuffer(l), s.information("<--createSceneBuffer"), l
        }, e.praseSceneBuffer = function (e) {
            s.information("--\x3epraseSceneBuffer");
            let t = null;
            try {
                e = i.ShubCryptoNS.decryptHttpBuffer(e);
                let o = 0, r = e.readUInt32LE(o);
                s.information("    protocolVersion:", r), o += 4;
                let l = e.readUInt32LE(o);
                s.information("    sequence:", l), o += 4;
                let u = e.readUInt32LE(o);
                s.information("    commandLegth:", u), o += 4;
                let d = e.readUInt32LE(o);
                s.information("    thunderVersion:", d), o += 4;
                let c = e.readUInt16LE(o);
                s.information("    compressFlag:", c), o += 2;
                let h = e.readUInt16LE(o);
                s.information("    commandType:", h), o += 2;
                let f = e.readUInt32LE(o);
                s.information("    result:", f), o += 4;
                let g = a.BufferUtilitiesNS.readString(e, o, "gbk"), p = g[1];
                s.information("    key:", p), o = g[0];
                let k = e.readUInt32LE(o);
                s.information("    queryAgain:", k), o += 4;
                let m = e.readUInt32LE(o);
                s.information("    tryListNum:", m), o += 4;
                for (let t = 0; t < m; t++) {
                    s.information("");
                    let n = e.readUInt32LE(o);
                    s.information("      index", t, "size:", n), o += 4, o += n
                }
                let T = [], v = e.readUInt32LE(o);
                s.information("    sceneListNum:", v), o += 4;
                for (let t = 0; t < v; t++) {
                    s.information("");
                    let i = e.readUInt32LE(o);
                    s.information("      index", t, "size:", i), o += 4;
                    let r = new n, l = o;
                    r.id = e.readUInt32LE(l), s.information("      id:", r.id), l += 4, r.type = e.readUInt32LE(l), s.information("      type:", r.type), l += 4;
                    let u = a.BufferUtilitiesNS.readString(e, l, "gbk");
                    r.name = u[1], s.information("      name:", r.name), l = u[0], r.status = e.readInt32LE(l), s.information("      status:", r.status), l += 4;
                    let d = e.readUInt32LE(l);
                    s.information("      scoped:", d), l += 4, r.priority = e.readUInt32LE(l), s.information("      priority:", r.priority), l += 4;
                    let c = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      clickStr:", c), l = u[0], u = a.BufferUtilitiesNS.readString(e, l, "gbk"), r.lineStr = u[1], s.information("      lineStr:", r.lineStr), l = u[0];
                    let h = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      tipsStr:", h), l = u[0];
                    let f = e.readUInt32LE(l);
                    s.information("      indate:", f), l += 4;
                    let g = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      matchStr:", g), l = u[0];
                    let p = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      showStr:", p), l = u[0], T.push(r), o += i
                }
                t = {itemDatas: T}
            } catch (e) {
                s.error("praseSceneBuffer", e)
            }
            return s.information("<--praseSceneBuffer"), t
        }
    }(t.SceneHttpPackageNS || (t.SceneHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(834);

    class o {
        constructor() {
            this.mTasks = new Map
        }

        createTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = this.getTask(e);
                return n || (yield(n = new a.TaskCache).setData(t), this.mTasks.set(e, n)), n
            })
        }

        deleteTask(e) {
            this.mTasks.delete(e)
        }

        getTask(e) {
            return this.mTasks.get(e)
        }

        clear() {
            this.mTasks.clear()
        }
    }

    t.SceneCacheManager = o, function (e) {
        const t = new o;
        e.getCacheManager = function () {
            return t
        }
    }(t.SceneCacheNS || (t.SceneCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(568), o = n(6).promisify, r = n(1).default.getLogger("Thunder.VipDownload.task-scene");
    t.TaskCache = class {
        constructor() {
            this.mItems = [], this.mCursor = 0
        }

        next() {
            this.mCursor += 1
        }

        getItem() {
            let e = this.mItems.length;
            if (e > 0) {
                let t = this.mCursor % e;
                return this.mItems[t]
            }
            return null
        }

        setData(e) {
            return i(this, void 0, void 0, function* () {
                let t = yield this.parseData(e);
                this.mItems = t
            })
        }

        parseData(e) {
            return i(this, void 0, void 0, function* () {
                let t = [];
                for (let n of e.itemDatas) if (-1 === n.status) {
                    let e = {explicitArray: !1}, i = yield o(a.parseString)(n.lineStr, e);
                    if (!i || !i.scene || !i.scene.element) {
                        r.information("scene elements is null");
                        continue
                    }
                    let s = null, l = i.scene.element;
                    if (l instanceof Array ? s = l : l instanceof Object && (s = [l]), !s) {
                        r.information("scene elements is null");
                        continue
                    }
                    let u = {id: n.id, priority: n.priority}, d = void 0, c = void 0;
                    for (let e of s) e.text && "" !== e.text && (d = e.text, e.code && "" !== e.code && (c = this.parseUrl(e.code)));
                    d && "" !== d && (u.text = d, u.textlink = c, t.push(u))
                }
                return t
            })
        }

        parseUrl(e) {
            let t = void 0, n = e.indexOf('GenerateJumpKey("');
            if (n < 0 || n >= e.length) return t;
            n += 17;
            let i = e.indexOf('")', n);
            return i <= n || i >= e.length ? t : t = e.substring(n, i)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(14), o = n(5), r = n(129), s = n(145), l = n(233), u = n(57), d = n(1), c = n(247),
        h = d.default.getLogger("Thunder.VipDownload.speedcurve-skin");
    let f = void 0, g = null;
    s.TaskEventContainerNS.getEventContainer().attachListener(s.TaskEventNS.taskAcclerateStatusChanged, function (e, t, n) {
        return i(this, void 0, void 0, function* () {
            do {
                if (t !== r.VipDownloadDefineNS.VipTaskType.Try) break;
                switch (n) {
                    case r.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                        if (f) {
                            h.information("enableChangeSkin already true");
                            break
                        }
                        h.information("onTaskAcclerateStatusChanged", "taskStatus", n);
                        let e = yield a.default("GetSpeedCurveSkinInfo");
                        if (h.information("skinInfo", e), e && e.type !== l.SpeedCurveSkinHelperNS.SkinType.Default) break;
                        let t = (yield c.default.getSkins()) || [];
                        if (t.length > 0) {
                            let e = u.PluginHelperNS.getHelper().currentTime, n = e % t.length;
                            f = !0, (g = t[n]).is_vip_try = !0, h.information("curSkinInfo", g), yield a.default("SetSpeedCurveSkinInfo", g, !1, !0)
                        }
                        break;
                    case r.VipDownloadDefineNS.VipTaskStatus.Unkown:
                    case r.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                    case r.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    case r.VipDownloadDefineNS.VipTaskStatus.Finished:
                        if (g && (g.is_vip_try = !1, g = null), !f) break;
                        h.information("onTaskAcclerateStatusChanged", "taskStatus", n), f = !1, yield a.default("SetSpeedCurveSkinInfo", l.SpeedCurveSkinHelperNS.defaultSkinInfo, !1, !0)
                }
            } while (0)
        })
    }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSpeedCurveSkin", function (e, t = !1, n = !1) {
        return i(this, void 0, void 0, function* () {
            t && f && (f = !1)
        })
    })
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(14), o = n(143), r = n(8), s = n(129), l = n(57), u = n(1), d = n(145), c = n(68), h = n(575),
        f = n(246), g = n(282), p = n(230), k = u.default.getLogger("Thunder.VipDownload.download-kernel-stat"),
        m = o.DkHelperNS.getHelper(), T = l.PluginHelperNS.getHelper(), v = d.TaskEventContainerNS.getEventContainer(),
        C = h.DownloadManagerNS.getDownloadManager(), S = c.UserHelperNS.getHelper(),
        y = f.TaskManagerNS.getTaskManager();
    !function (e) {
        let t = new Map;

        function n(e, t) {
            return i(this, void 0, void 0, function* () {
                yield c(e, t, "vipversion", T.pluginVersion)
            })
        }

        function l(e, t) {
            return i(this, void 0, void 0, function* () {
                yield c(e, t, "startvip", "yes");
                let n = S.isVip ? "1" : "0";
                yield c(e, t, "vip_identify", n);
                const i = C.getVipTaskInfo(e);
                if (i) {
                    let n = i.enterType === s.VipDownloadDefineNS.VipTaskType.Try ? "vip_tryout_action" : "vip_action",
                        a = i.isContinued ? "1" : "0";
                    yield c(e, t, n, a)
                }
            })
        }

        function u(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = g.TryTaskCacheNS.getCacheManager().getTask(e);
                if (!n) return;
                let i = n.subId, a = void 0;
                t ? a = 0 : n.error && n.error.errorStep === p.HttpDefineNS.ErrorStep.Commit && (a = n.error.result), void 0 !== a && (yield c(e, i, "vip_tryout_commit", a.toString()))
            })
        }

        function c(e, t, n, o) {
            return i(this, void 0, void 0, function* () {
                let s = yield function (e, t) {
                    return i(this, void 0, void 0, function* () {
                        let n = yield m.getTaskBaseInfo(e);
                        if (!n) return null;
                        let i = e, a = t;
                        return n.taskType === r.DownloadKernel.TaskType.Group && (i = t, a = -1), [i, a]
                    })
                }(e, t);
                if (s) {
                    let e = s[0], t = s[1];
                    k.information("SetTaskExtStat", "taskId", e, "index", t, "key", n, "value", o), yield a.default("SetTaskExtStat", e, t, n, o)
                }
            })
        }

        m.attachListener(o.DkEventNS.taskStatusChanged, function (e, t) {
            return i(this, void 0, void 0, function* () {
                let i = yield m.getTaskBaseInfo(e);
                if (i && i.taskType !== r.DownloadKernel.TaskType.Group && i.taskType !== r.DownloadKernel.TaskType.Bt && !(i.groupTaskId && i.groupTaskId > 0)) switch (k.information("onTaskStatusChanged", e, t), t) {
                    case r.DownloadKernel.TaskStatus.Started:
                        yield n(e, -1)
                }
            })
        }), v.attachListener(d.TaskEventNS.subTaskStatusChanged, function (e, t, a) {
            return i(this, void 0, void 0, function* () {
                let i = yield m.getTaskBaseInfo(e);
                if (!i) return;
                k.information("onSubTaskStatusChanged", e, t, a);
                const o = i.taskType === r.DownloadKernel.TaskType.Bt && a === r.DownloadKernel.BtFileStatus.Started,
                    u = i.taskType === r.DownloadKernel.TaskType.Group && a === r.DownloadKernel.TaskStatus.Started;
                if (o || u) {
                    yield n(e, t);
                    let i = C.getVipTaskInfo(e);
                    i && i.enterType === s.VipDownloadDefineNS.VipTaskType.Vip && (yield l(e, t))
                }
            })
        }), v.attachListener(d.TaskEventNS.taskAcclerateStatusChanged, function (e, n, a) {
            return i(this, void 0, void 0, function* () {
                switch (a) {
                    case s.VipDownloadDefineNS.VipTaskStatus.Commiting:
                        if (n === s.VipDownloadDefineNS.VipTaskType.Try) {
                            const t = g.TryTaskCacheNS.getCacheManager();
                            let n = t.getTask(e);
                            if (n) {
                                let t = n.subId;
                                yield l(e, t)
                            }
                        } else {
                            const t = y.getTask(e);
                            if (t) {
                                let n = t.getDownloadingFiles();
                                for (let t of n) yield l(e, t.subId)
                            }
                        }
                        t.delete(e);
                        break;
                    case s.VipDownloadDefineNS.VipTaskStatus.CommitSuccess:
                        n === s.VipDownloadDefineNS.VipTaskType.Try && (yield u(e, !0));
                        break;
                    case s.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                        n === s.VipDownloadDefineNS.VipTaskType.Try && (yield u(e, !1))
                }
            })
        }), v.attachListener(d.TaskEventNS.taskTokenQueryResult, function (e, n, a) {
            return i(this, void 0, void 0, function* () {
                k.information("onTokenCallback", e, n, "result", a), function (e, n, i) {
                    let a = function (e, n) {
                        let i = function (e) {
                            return t.get(e)
                        }(e);
                        if (!i) return null;
                        return i.subTaskCacheMap.get(n)
                    }(e, n) ? "vip_dcdn_certificate_re" : "vip_dcdn_certificate";
                    c(e, n, a, i.toString()).catch();
                    let o = function (e, n) {
                        let i = function (e) {
                            let n = t.get(e);
                            n || (n = {subTaskCacheMap: new Map});
                            return t.set(e, n), n
                        }(e), a = i.subTaskCacheMap.get(n);
                        a || (a = {tokenQueryTotal: 0, tokenQuerySuccess: 0}, i.subTaskCacheMap.set(n, a));
                        return a
                    }(e, n);
                    o.tokenQueryTotal++, 0 === i && o.tokenQuerySuccess++;
                    if (o.tokenQueryTotal > 0) {
                        let t = o.tokenQuerySuccess / o.tokenQueryTotal;
                        c(e, n, "token_qurey_sucrate", t.toFixed(2)).catch()
                    }
                }(e, n, a)
            })
        })
    }(t.DkStatNS || (t.DkStatNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(8), o = n(73), r = n(32), s = n(34), l = n(90), u = n(126), d = n(229), c = n(25), h = n(51),
        f = n(5), g = n(582), p = n(7);
    !function (e) {
        e.dk = a.DownloadKernel, e.dkManager = o.DownloadKernelManager, e.taskManager = r.DownloadKernelTaskManager.getTaskManager(), e.eventManager = s.DownloadKernelEventManager.getEventManager(), e.categoryManager = l.DownloadKernelCategoryManager.getCategoryManager(), e.categoryViewManager = u.DownloadKernelCategoryViewManager.getCategoryViewManager(), e.taskUtilities = d.TaskUtilitiesAWNS, e.config = c.ConfigNS, e.logHelper = h.LoginHelperNS, e.thunderHelper = p.default(i.join(__rootDir, "../bin/ThunderHelper.node")), e.nativeCallModule = f.NativeCallModule, e.messageChannel = g.MessageChannelNS, e.thunderMsgChannel = g.MessageChannelNS.getThunderMsgChannel()
    }(t.DownloadKernelTestNS || (t.DownloadKernelTestNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(34), r = n(32), s = n(90), l = n(5),
        u = r.DownloadKernelTaskManager.getTaskManager(), d = o.DownloadKernelEventManager.getEventManager(),
        c = s.DownloadKernelCategoryManager.getCategoryManager(), h = i.default.getLogger("Community.TaskManager");
    !function (e) {
        class t {
            constructor() {
                this.insertToCategoryViewEventId = void 0, this.detailChangedEventId = void 0, this.taskStatusChangedEventId = void 0, this.taskInfoMap = new Map, this.userLoginEventId = void 0, this.userLogoutEventId = void 0
            }

            init() {
                h.information("init"), this.insertToCategoryViewEventId = d.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = d.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1], e[2])
                }), this.taskStatusChangedEventId = d.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                }), this.userLoginEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", this.onUserLogin.bind(this)), this.userLogoutEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", this.onUserLogout.bind(this))
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (this.insertToCategoryViewEventId = void 0, d.detachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId)), void 0 !== this.detailChangedEventId && (this.detailChangedEventId = void 0, d.detachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId)), void 0 !== this.taskStatusChangedEventId && (this.taskStatusChangedEventId = void 0, d.detachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId)), void 0 !== this.userLoginEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", this.userLoginEventId), this.userLoginEventId = void 0), void 0 !== this.userLogoutEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogout", this.userLogoutEventId), this.userLogoutEventId = void 0), this.taskInfoMap.clear()
            }

            getTaskNameByTaskUniqueID(e) {
                if (!e || "" === e) return "";
                let t = this.taskInfoMap.get(e);
                if (t) {
                    if (-1 === t.categoryId) return t.taskName;
                    {
                        let e = c.getCurrentPrivateCategory();
                        if (e && e.getId() === t.categoryId) return t.taskName
                    }
                }
                return ""
            }

            getTaskAverageSpeedByTaskUniqueID(e) {
                if (!e || "" === e) return 0;
                let t = 0, n = this.taskInfoMap.get(e);
                if (n) if (-1 !== n.categoryId) {
                    let e = c.getCurrentPrivateCategory();
                    e && e.getId() === n.categoryId && (t = this.getTaskAverageSpeed(n.taskId))
                } else t = this.getTaskAverageSpeed(n.taskId);
                return t
            }

            getTaskInfoByTaskUniqueID(e) {
                return e && "" !== e ? this.taskInfoMap.get(e) : null
            }

            onUserLogin(e) {
                h.information("onUserLogin userId:", e);
                let t = c.getPrivateCategoryFromUserId(e);
                if (t) {
                    let e = t.getCategoryViews();
                    for (let t = 0; t < e.length; ++t) {
                        let n = [];
                        e[t].getTasks().forEach(e => {
                            n.push(e)
                        }), this.updateTaskInfo(n)
                    }
                }
            }

            onUserLogout() {
                h.information("onUserLogout");
                let e = new Map;
                this.taskInfoMap.forEach((t, n) => {
                    -1 !== t.categoryId && e.set(n, t)
                }), e.forEach((e, t) => {
                    -1 !== e.categoryId && this.taskInfoMap.delete(t)
                })
            }

            onInsertToCategoryView(e, t, n) {
                do {
                    if (!n) break;
                    h.information("onInsertToCategoryView number of taskList:", n.length), this.updateTaskInfo(n)
                } while (0)
            }

            onDetailChanged(e, t) {
                do {
                    if (!e || !t) break;
                    h.information("onDetailChanged number of taskList:", e.length, ", detailChangedFlags:", t);
                    for (let n = 0; n < e.length; ++n) {
                        let i = e[n];
                        i && ((t & a.DownloadKernel.TaskDetailChangedFlags.TaskName || t & a.DownloadKernel.TaskDetailChangedFlags.Gcid) && this.updateTaskInfo([i]))
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    if (n && n.getTaskStatus() === a.DownloadKernel.TaskStatus.DestroyPending) {
                        let e = this.getTaskUniqueIDByTask(n);
                        e && "" !== e && (h.information("onTaskStatusChanged delete taskInfoMap uniqueId:", e), this.taskInfoMap.delete(e))
                    }
                }
            }

            updateTaskInfo(e) {
                let t = c.getCurrentPrivateCategory();
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n];
                    if (!i) continue;
                    let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryId);
                    if (-1 !== o && (!t || t.getId() !== o)) continue;
                    let r = this.getTaskUniqueIDByTask(i);
                    if (r && "" !== r) {
                        let e = this.getTaskNameByTask(i), t = i.getTaskBaseInfo().taskId,
                            n = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryViewId);
                        h.information("updateTaskInfo uniqueId:", r, ", taskId:", t, ", taskName:", e, ", categoryId:", o, ", categoryViewId:", n);
                        let s = {taskId: t, taskName: e, categoryId: o, categoryViewId: n};
                        this.taskInfoMap.set(r, s)
                    }
                }
            }

            getTaskAverageSpeed(e) {
                let t = u.getTaskFromTaskId(e);
                if (!t) return 0;
                let n = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    i = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadSize);
                0 === n && (n = 0);
                let o = Math.round(i / n);
                return h.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", o, ", taskAverageSpeedFormat:", this.formatSize(o)), o
            }

            formatSize(e, t = 2) {
                if (!e || e < 0) return "0.0B";
                let n = 0, i = e;
                for (; i > 1024 && !(n >= 5);) i /= 1024, n += 1;
                let a = Math.pow(10, t);
                return Math.round(i * a) / a + ["B", "KB", "MB", "GB", "TB", "PB"][n]
            }

            getTaskNameByTask(e) {
                let t = e.getTaskName();
                if (!t || "" === t) {
                    if (e.getTaskBaseInfo().taskType === a.DownloadKernel.TaskType.Bt) {
                        t = e.getExtraObject().getDisplayName()
                    }
                }
                return t
            }

            getTaskUniqueIDByTask(e) {
                let t = "";
                if (!e) return t;
                switch (e.getType()) {
                    case a.DownloadKernel.TaskType.Bt:
                        let n = e.getExtraObject().getInfoId();
                        h.information("getTaskUniqueIDByTask bt task infoId:", n), t = n;
                        break;
                    case a.DownloadKernel.TaskType.P2sp:
                    case a.DownloadKernel.TaskType.Emule:
                        let i = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.Gcid);
                        h.information("getTaskUniqueIDByTask p2sp or emule task gcid: ", i), t = i
                }
                return t
            }
        }

        e.TaskManager = t;
        const n = new t;
        e.getTaskManager = function () {
            return n
        }
    }(t.CommunityTaskManagerNS || (t.CommunityTaskManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = "\n", a = "\r\n", o = /^\s*\[(.+?)\]\s*$/, r = /^\s*([^#].*?)\s*=\s*(.*?)\s*$/;
    !function (e) {
        e.stringify = function (e) {
            let t = "";
            for (let n in e) {
                let i = e[n];
                if (!i) break;
                t += "[" + n + "]" + a;
                for (let e in i) {
                    let n = i[e];
                    if (void 0 === n || null === n) break;
                    t += e + "=" + n + a
                }
            }
            return t + i
        }, e.parse = function (e) {
            let t, n = {}, i = e.split(/\r\n|\r|\n/), a = {};
            for (let e = 0; e < i.length; ++e) {
                let s = i[e];
                (t = s.match(o)) ? n[t[1]] = a = n[t[1]] || {} : a && (t = s.match(r)) && (a[t[1]] = t[2])
            }
            return n
        }
    }(t.IniNS || (t.IniNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t = "";
        e.getRecommends = function () {
            return t
        }, e.setRecommends = function (e) {
            t = e
        }
    }(t.SearchConfigNS || (t.SearchConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(76), o = n(6), r = n(56), s = n(21), l = n(727), u = n(51), d = n(563), c = n(735),
        h = i.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "NativeFireEvent",
                        nativeFunc: this.fireEvent
                    }, {
                        functionName: "CreateLoginWnd",
                        nativeFunc: this.createLoginWnd
                    }, {functionName: "CloseLoginWnd", nativeFunc: this.closeLoginWnd}, {
                        functionName: "UpdateLoginWnd",
                        nativeFunc: this.updateLoginWnd
                    }, {functionName: "SaveLoginData", nativeFunc: this.saveLoginData}, {
                        functionName: "LoadLoginData",
                        nativeFunc: this.loadLoginData
                    }, {functionName: "GetUserID", nativeFunc: this.getUserID}, {
                        functionName: "GetSessionID",
                        nativeFunc: this.getSessionID
                    }, {functionName: "GetLoginOption", nativeFunc: this.getLoginOption}, {
                        functionName: "ShowLoginDlg",
                        nativeFunc: this.showLoginDlg
                    }, {functionName: "GetLoginInfo", nativeFunc: this.getLoginInfo}, {
                        functionName: "GetUserInfo",
                        nativeFunc: this.getUserInfo
                    }, {functionName: "GetAllUserInfo", nativeFunc: this.getAllUserInfo}, {
                        functionName: "IsLogined",
                        nativeFunc: this.isLogined
                    }, {functionName: "Logout", nativeFunc: this.logout}, {
                        functionName: "GetLoginDeviceID",
                        nativeFunc: this.getLoginDeviceID
                    }, {
                        functionName: "RetryLogIn",
                        nativeFunc: this.retryLogIn
                    }, {
                        functionName: "ShowModifierUserInfoWnd",
                        nativeFunc: this.showModifierUserInfoWnd
                    }, {
                        functionName: "GetUserHeaderByUserID",
                        nativeFunc: this.getUserHeaderByUserID
                    }, {
                        functionName: "IsAlreadySign",
                        nativeFunc: this.isAlreadySign
                    }, {
                        functionName: "IsHaveSignQuestion",
                        nativeFunc: this.isHaveSignQuestion
                    }, {functionName: "SendSms", nativeFunc: this.sendSms}, {
                        functionName: "CheckSms",
                        nativeFunc: this.checkSms
                    }];
                    a.setDefaultNativeFunctionMap(e)
                }
            }

            fireEvent(e, t, n, i) {
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                h.information("fireEvent eventName:", a), i.splice(0, 1), r.NativeCallHostModule.nativeCallHost.fireNativeEvent(a, ...i), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getUserID(e, t, n, i) {
                h.information("getUserID:", i), u.LoginHelperNS.loginHelper.getUserInfo("userid", function (i) {
                    h.information("getUserID:userid = ", i), null !== i && void 0 !== i && "" !== i || (i = "0"), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            getSessionID(e, t, n, i) {
                h.information("getSessionID:", i), u.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (i) {
                    h.information("getSessionID:sessionid = ", i), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            getLoginOption(e, t, n, i) {
                let a = d.LoginOptionNS.loginOption.getOption(), o = void 0;
                a && (o = JSON.stringify(a)), h.information("getLoginOption:option = ", o), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, o)
            }

            showLoginDlg(e, t, n, i) {
                h.information(i);
                let a = "other", r = !0, l = null;
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || (a = i[0]), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[1]) || (r = i[1]), !o.isNullOrUndefined(i) && !o.isNullOrUndefined(i[2])) {
                    let e = i[2];
                    try {
                        l = JSON.parse(e)
                    } catch (e) {
                        h.warning(e)
                    }
                }
                u.LoginHelperNS.loginHelper.showLoginDlg(a, r, l), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getLoginInfo(e, t, n, i) {
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) u.LoginHelperNS.loginHelper.getUserInfo(function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }); else {
                    let a = i[0];
                    u.LoginHelperNS.loginHelper.getUserInfo(a, function (i) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    })
                }
            }

            getUserInfo(e, t, n, i) {
                h.information(i), (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                let a = 0;
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) a = 0; else {
                    let e = i[0];
                    a = null === e || void 0 === e || "" === e ? 0 : Number(e)
                }
                u.LoginHelperNS.loginHelper.getUserInfoEx(a, function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            getAllUserInfo(e, t, n, i) {
                if (h.information(i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) u.LoginHelperNS.loginHelper.getAllUserInfo(function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }); else {
                    let a = i[0];
                    u.LoginHelperNS.loginHelper.getAllUserInfo(a, function (i) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    })
                }
            }

            isLogined(e, t, n, i) {
                h.information(i), (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError), u.LoginHelperNS.loginHelper.isLogined(function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            logout(e, t, n, i) {
                h.information(i), u.LoginHelperNS.loginHelper.logout(), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            saveLoginData(e, t, n, i) {
                do {
                    if (h.information("saveLoginData", e, t, n), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1]) || o.isNullOrUndefined(i[2])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], l = i[2];
                    u.LoginHelperNS.loginSDKHelper.saveData(a, r, l).then(i => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    }).catch(() => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.CallFailed)
                    })
                } while (0)
            }

            loadLoginData(e, t, n, i) {
                let a = null;
                do {
                    if (h.information("loadLoginData", e, t, n), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let r = i[0], l = i[1];
                    a = "memory" === r && "initconfig" === l ? u.LoginHelperNS.loginSDKHelper.getInitData() : u.LoginHelperNS.loginSDKHelper.loadData(r, l), h.information("loadLoginData:data = ", a), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            createLoginWnd(e, t, n, i) {
                do {
                    if (h.information("createLoginWnd", e, t, n), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) {
                        h.information("createLoginWnd 失败");
                        break
                    }
                    if (o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        h.information("createLoginWnd 失败 参数错误"), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], l = "", d = null, c = null;
                    o.isNullOrUndefined(i[2]) || (l = i[2]), o.isNullOrUndefined(i[3]) || (d = i[3]), o.isNullOrUndefined(i[4]) || (c = i[4]), u.LoginHelperNS.loginUIHelper.createLoginWnd(a, r, l, d, c), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            closeLoginWnd(e, t, n, i) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    u.LoginHelperNS.loginUIHelper.closeLoginWnd(a)
                } while (0)
            }

            updateLoginWnd(e, t, n, i) {
                h.information("updateLoginWnd", e, t, n);
                let a = !1, r = null, l = null, d = null, c = null;
                o.isNullOrUndefined(i[0]) || (a = i[0]), o.isNullOrUndefined(i[1]) || (r = i[1]), o.isNullOrUndefined(i[2]) || (l = i[2]), o.isNullOrUndefined(i[3]) || (d = i[3]), o.isNullOrUndefined(i[4]) || (c = i[4]), u.LoginHelperNS.loginUIHelper.updateLoginWnd(a, r, l, d, c), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getLoginDeviceID(e, t, n, i) {
                h.information("getDeviceID", e, t, n), u.LoginHelperNS.loginSDKHelper.getDeviceID().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.CallFailed, i)
                })
            }

            retryLogIn(e, t, n, i) {
                h.information("retryLogIn"), u.LoginHelperNS.loginHelper.logIn("retryLogIn"), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            showModifierUserInfoWnd(e, t, n, i) {
                h.information("showModifierUserInfoWnd", e, t, n);
                let a = "";
                a = o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) ? "" : i[0], u.LoginHelperNS.loginUIHelper.createModifierUserInfoWnd(a), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getUserHeaderByUserID(e, t, n, i) {
                if (h.information("getUserHeaderByUserID", e, t, n), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                let a = u.LoginHelperNS.loginHelper.getUserHeader(i[0]);
                e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, a)
            }

            isAlreadySign(e, t, n, i) {
                h.information("isAlreadySign", e, t, n), l.CommonSignFunctionNs.isAlreadySign().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            isHaveSignQuestion(e, t, n, i) {
                h.information("isHaveSignQuestion", e, t, n), l.CommonSignFunctionNs.isHaveSignQuestion().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            sendSms(e, t, n, i) {
                h.information("sendSms", e, t, n);
                let a = "";
                null !== i && void 0 !== i && i.length > 0 && (a = i[0]), c.commonLoginHelper.sendSmsAw(a).then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            checkSms(e, t, n, i) {
                h.information("checkSms", e, t, n);
                do {
                    if (null === i || void 0 === i || i.length < 2) {
                        h.information("checkSms args存在问题 args：", i), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1];
                    c.commonLoginHelper.checkSmsAw(a, o).then(i => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.LoginNaviteFunctionNS || (t.LoginNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(73), r = n(32), s = n(34), l = n(126), u = n(76), d = n(21), c = n(56), h = n(83),
        f = n(23), g = n(195), p = n(10), k = n(245), m = n(564), T = n(132), v = n(235),
        C = i.default.getLogger("DKNativeFunction"), S = r.DownloadKernelTaskManager.getTaskManager(),
        y = s.DownloadKernelEventManager.getEventManager(),
        w = l.DownloadKernelCategoryViewManager.getCategoryViewManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, y.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.onTaskDetailChanged(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChanged(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.DcdnStatusChanged, (...e) => {
                    this.onTaskDcdnStatusChanged(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileLoaded, (...e) => {
                    this.onBtSubFileLoaded(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileForbidden, (...e) => {
                    this.onBtSubFileForbidden(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, (...e) => {
                    this.onBtSubFileDcdnStatusChanged(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    this.onTaskInserted(...e)
                }), y.attachTaskEvent(a.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    this.onTaskRemoved(...e)
                }), o.DownloadKernelManager.attachListener(f.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                    this.onGlobalDownloadSpeedChanged(...e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetTaskChannelInfo",
                        nativeFunc: this.getTaskChannelInfo
                    }, {
                        functionName: "GetTaskBaseInfo",
                        nativeFunc: this.getTaskBaseInfo
                    }, {
                        functionName: "GetTaskBaseInfos",
                        nativeFunc: this.getTaskBaseInfos
                    }, {
                        functionName: "GetTaskAttribute",
                        nativeFunc: this.getTaskAttribute
                    }, {functionName: "GetTaskStatus", nativeFunc: this.getTaskStatus}, {
                        functionName: "FindTask",
                        nativeFunc: this.findTask
                    }, {functionName: "IsTaskExist", nativeFunc: this.isTaskExist}, {
                        functionName: "IsSupportPlay",
                        nativeFunc: this.isSupportPlay
                    }, {
                        functionName: "GetTaskDownloadSpeed",
                        nativeFunc: this.getTaskDownloadSpeed
                    }, {
                        functionName: "EnableDcdnWithVipCert",
                        nativeFunc: this.enableDcdnWithVipCert
                    }, {
                        functionName: "UpdateDcdnWithVipCert",
                        nativeFunc: this.updateDcdnWithVipCert
                    }, {
                        functionName: "DisableDcdnWithVipCert",
                        nativeFunc: this.disableDcdnWithVipCert
                    }, {functionName: "GetTpPeerId", nativeFunc: this.getPeerId}, {
                        functionName: "ExecSqlite",
                        nativeFunc: this.execSqlite
                    }, {
                        functionName: "QuerySqlite",
                        nativeFunc: this.querySqlite
                    }, {
                        functionName: "GetCategoryViewTaskList",
                        nativeFunc: this.getCategoryViewTaskList
                    }, {
                        functionName: "GetCategoryViewTaskListForSuspensionWnd",
                        nativeFunc: this.getCategoryViewTaskListForSuspensionWnd
                    }, {
                        functionName: "IsLoadStorageTaskFinish",
                        nativeFunc: this.isLoadStorageTaskFinish
                    }, {
                        functionName: "IsSupportInstall",
                        nativeFunc: this.isSupportInstall
                    }, {
                        functionName: "GetDownloadProgress",
                        nativeFunc: this.getDownloadProgressPercent
                    }, {
                        functionName: "GetDownloadProgressNumber",
                        nativeFunc: this.getDownloadProgress
                    }, {functionName: "IsSingleBtTask", nativeFunc: this.isSingleBtTask}, {
                        functionName: "VerifyProxy",
                        nativeFunc: this.verifyProxy
                    }, {functionName: "SetProxy", nativeFunc: this.setProxy}, {
                        functionName: "SetTaskExtStat",
                        nativeFunc: this.setTaskExtStat
                    }];
                    u.setDefaultNativeFunctionMap(e)
                }
            }

            getTaskChannelInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getTaskChannelInfo(), a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskAttribute(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], r = S.getTaskFromTaskId(a);
                    if (r) {
                        let i = r.getTaskAttribute(o), a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getTaskBaseInfo(), a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfos(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        C.warning(e)
                    }
                    if (o) {
                        let i = [];
                        for (let e = 0; e < o.length; ++e) {
                            let t = S.getTaskFromTaskId(o[e]);
                            if (t) {
                                let e = t.getTaskBaseInfo();
                                i.push(e)
                            }
                        }
                        let a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskDownloadSpeed(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getDownloadSpeed();
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskStatus(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getTaskStatus();
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            findTask(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = {keyType: i[0], keyValue: i[1], keyFilter: a.DownloadKernel.KeyFilter.All};
                    S.batchFindTaskAsync([o]).then(i => {
                        if (i && i.length > 0) {
                            let o = i[0].getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                            e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0, o)
                        } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1, 0)
                    }).catch()
                } while (0)
            }

            isTaskExist(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    S.getTaskFromTaskId(a) ? e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            isSupportPlay(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.isSupportPlay();
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            enableDcdnWithVipCert(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    o ? (o.enableDcdnWithVipCert(i[1]), e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            updateDcdnWithVipCert(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    o ? (o.updateDcdnWithVipCert(i[1]), e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            disableDcdnWithVipCert(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = S.getTaskFromTaskId(a);
                    o ? (o.disableDcdnWithVipCert(), e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getPeerId(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    C.verbose(i), o.DownloadKernelManager.getPeerId().then(i => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            execSqlite(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    h.ThunderKernel.execSqlite(i[0], i => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    })
                } while (0)
            }

            querySqlite(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    h.ThunderKernel.querySqlite(i[0], i => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    })
                } while (0)
            }

            getCategoryViewTaskList(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = w.getCategoryViewFromId(i[0]);
                    if (a) {
                        let i = [], o = a.getTasks();
                        if (o) for (let e of o) {
                            let t = e[0];
                            i.push(t)
                        }
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getCategoryViewTaskListForSuspensionWnd(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = w.getCategoryViewFromId(i[0]);
                    if (a) {
                        let i = a.getTasks(), o = "", r = [];
                        if (i) {
                            for (let [, e]of i) {
                                let t = e.getTaskBaseInfo();
                                r.push(t)
                            }
                            o = JSON.stringify(r)
                        }
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, o)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            isLoadStorageTaskFinish(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    o.DownloadKernelManager.attachListener(f.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId), r = n.getTaskBaseInfo();
                        i[o] = r
                    }
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDetailChanged", JSON.stringify(i), n)
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let o = i.getTaskStatus();
                        n[i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId)] = o
                    }
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskStatusChanged", JSON.stringify(n))
                } while (0)
            }

            onTaskDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.DcdnStatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId),
                            r = i.getTaskChannelInfo().dcdnStatus;
                        n[o] = r
                    }
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDcdnStatusChanged", JSON.stringify(n))
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2], i = S.getTaskFromTaskId(t).getTaskBaseInfo();
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDetailChanged", t, JSON.stringify(n), JSON.stringify(i))
                } while (0)
            }

            onBtSubFileLoaded(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileLoaded) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2], i = S.getTaskFromTaskId(t).getTaskBaseInfo();
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileLoaded", t, JSON.stringify(n), JSON.stringify(i))
                } while (0)
            }

            onBtSubFileForbidden(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileForbidden) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2];
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileForbidden", t, n)
                } while (0)
            }

            onBtSubFileDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged) break;
                    if (!e[1] || null === e[2] || void 0 === e[2] || null === e[3] || void 0 === e[3] || null === e[4] || void 0 === e[4]) break;
                    let t = e[1], n = e[2], i = e[3], o = e[4];
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDcdnStatusChanged", t, n, i, o)
                } while (0)
            }

            onTaskInserted(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], o = [];
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e].getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInserted", t, n, r)
                } while (0)
            }

            onTaskRemoved(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], o = [];
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e].getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskRemoved", t, n, r)
                } while (0)
            }

            onGlobalDownloadSpeedChanged(...e) {
                let t = o.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1),
                    n = o.DownloadKernelManager.getTotalTaskVipSpeed(!1, !1);
                c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnGlobalDownloadSpeedChanged", t, n)
            }

            isSupportInstall(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = i[0], r = S.getTaskFromTaskId(o);
                    if (r.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskType) === a.DownloadKernel.TaskType.Group) {
                        let i = r.getExtraObject(),
                            a = i.getUserData(k.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 !== a && null !== a && "" !== a && "0" !== a) {
                            let r = g.TaskCtrlOperatorNS.getSavePathByFileName(o, a);
                            p.FileSystemAWNS.existsAW(r).then(a => {
                                if (a) {
                                    let a = i.getUserData(k.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                                    e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0, r, a)
                                } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                            }).catch()
                        } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            getDownloadProgressPercent(e, t, n, i) {
                let a = m.DownloadProgressNS.getDownloadProgressPercent();
                e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
            }

            getDownloadProgress(e, t, n, i) {
                let a = m.DownloadProgressNS.getDownloadProgress();
                e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
            }

            isSingleBtTask(e, t, n, i) {
                let a = i[0], o = S.getTaskFromTaskId(a);
                T.SingleBtTaskNS.isSingleBtTask(o).then(i => {
                    e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            verifyProxy(e, t, n, i) {
                let a = i[0], o = i[1], r = i[2], s = i[3], l = i[4];
                0 !== h.ThunderKernel.verifyProxy(a, o, r, s, l, i => {
                    e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                }) && e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, v.ProxyNS.ProxyVerifyResult.ParamError)
            }

            setProxy(e, t, n, i) {
                let a = i[0], o = i[1], r = i[2], s = i[3], l = i[4], u = h.ThunderKernel.setProxy(a, o, r, s, l);
                e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, u)
            }

            setTaskExtStat(e, t, n, i) {
                let o = i[0], r = S.getTaskFromTaskId(o);
                if (r) {
                    let o = i[1], s = i[2], l = i[3], u = r.getTaskAttribute(a.DownloadKernel.TaskAttribute.VirtualId),
                        c = h.ThunderKernel.setTaskExtStat(u, o, s, l);
                    e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, c)
                } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DKNaviteFunctionNS || (t.DKNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(23), o = n(76), r = n(21), s = n(56), l = n(25), u = n(736), d = n(82), c = n(249),
        h = i.default.getLogger("ConfigNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigValueChanaged", e, t, n, i)
                }), l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigInitFinished")
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "Save", nativeFunc: this.save}, {
                        functionName: "GetValue",
                        nativeFunc: this.getValue
                    }, {functionName: "SetValue", nativeFunc: this.setValue}, {
                        functionName: "SaveConfig",
                        nativeFunc: this.save
                    }, {functionName: "GetConfigValue", nativeFunc: this.getValue}, {
                        functionName: "SetConfigValue",
                        nativeFunc: this.setValue
                    }, {
                        functionName: "IsConfigInitFinish",
                        nativeFunc: this.isConfigInitFinish
                    }, {
                        functionName: "GetConfigModules",
                        nativeFunc: this.getConfigModules
                    }, {
                        functionName: "IsConfigBrowserInitFinish",
                        nativeFunc: this.isConfigBrowserInitFinish
                    }, {
                        functionName: "GetInstallBrowserInfo",
                        nativeFunc: this.getInstallBrowserInfo
                    }, {
                        functionName: "AddConfigSettingItemData",
                        nativeFunc: this.addConfigSettingItemData
                    }, {functionName: "RemoveConfigSettingItemData", nativeFunc: this.removeConfigSettingItemData}];
                    o.setDefaultNativeFunctionMap(e)
                }
            }

            save(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    h.verbose(i), l.ConfigNS.save().then(() => {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    }).catch()
                } while (0)
            }

            getValue(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], s = i[2], u = l.ConfigNS.getValue(a, o, s);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, u)
                } while (0)
            }

            setValue(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], s = i[2];
                    l.ConfigNS.setValue(a, o, s), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isConfigInitFinish(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getConfigModules(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    let a = "", o = "";
                    null !== i && void 0 !== i && (null !== i[0] && void 0 !== i[0] && "" !== i[0] && (a = i[0]), null !== i[1] && void 0 !== i[1] && "" !== i[1] && (o = i[1]));
                    let s = d.default.getConfigInfo(a, o);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            isConfigBrowserInitFinish(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    c.SettingConfigHelperNS.configBrowserHelper.attachListener(a.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getInstallBrowserInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (null === i || void 0 === i || i.length <= 0 || void 0 === i[0] || null === i[0] || "" === i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = c.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName(a);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            addConfigSettingItemData(e, t, n, i) {
                {
                    let a = null, o = null;
                    if (i[0] && i[1]) try {
                        a = JSON.parse(i[0]), o = JSON.parse(i[1])
                    } catch (e) {
                    }
                    if (a && o) {
                        let i = u.SettingInit.addSettingItemData(a, o);
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
                }
            }

            removeConfigSettingItemData(e, t, n, i) {
                {
                    let a = null, o = null;
                    if (i[0] && i[1]) try {
                        a = JSON.parse(i[0]), o = JSON.parse(i[1])
                    } catch (e) {
                    }
                    if (a && o) {
                        let i = u.SettingInit.removeSettingItemData(a, o);
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
                }
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ConfigNaviteFunctionNS || (t.ConfigNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(76), a = n(6), o = n(572), r = n(571), s = n(21);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "InstallXmp", nativeFunc: this.installXmp}, {
                        functionName: "OpenXmp",
                        nativeFunc: this.openXmp
                    }, {
                        functionName: "GetXmpCoreVersion",
                        nativeFunc: this.getXmpCoreVersion
                    }, {functionName: "GetXmpBuildNum", nativeFunc: this.getXmpBuildNum}, {
                        functionName: "GetXmpPath",
                        nativeFunc: this.getXmpPath
                    }, {functionName: "GetXmpReg", nativeFunc: this.getXmpReg}, {
                        functionName: "GetXmpUserDataPath",
                        nativeFunc: this.getXmpUserDataPath
                    }];
                    i.setDefaultNativeFunctionMap(e)
                }
            }

            installXmp(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.installXmp().then(() => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
                }).catch()
            }

            openXmp(e, t, n, i) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) break;
                    let r = "";
                    a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || (r = i[0]), o.default.openXmp(r).then(i => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            getXmpCoreVersion(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.getXmpCoreVersion().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            getXmpBuildNum(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.getXmpBuildNum().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            getXmpPath(e, t, n, i) {
                if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) return;
                let o = r.DownloadAndPlayNS.getXmpPath();
                e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, o)
            }

            getXmpReg(e, t, n, i) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = i[0];
                    if (a.isNullOrUndefined(o) || "" === o) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let l = r.DownloadAndPlayNS.getXmpReg(o);
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            getXmpUserDataPath(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.getXmpUserDataPath().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DownloadAndPlayNaviteFunctionNS || (t.DownloadAndPlayNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(76), r = n(21), s = n(12), l = n(737), u = n(846), d = n(56), c = n(3), h = n(33), f = n(14),
        g = n(82), p = n(2), k = n(7), m = a.default.getLogger("SkinNaviteFunction"),
        T = k.default(p.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.default.on("changeSkin", this.onChangeSkin), u.default.on("changeSkin", this.onChangeSpeedCurveSkin)
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "GetSkinInfo", nativeFunc: this.getSkinInfo}, {
                        functionName: "SetSkinInfo",
                        nativeFunc: this.setSkinInfo
                    }, {
                        functionName: "GetSpeedCurveSkinInfo",
                        nativeFunc: this.getSpeedCurveSkinInfo
                    }, {
                        functionName: "SetSpeedCurveSkinInfo",
                        nativeFunc: this.setSpeedCurveSkinInfo
                    }, {
                        functionName: "ClickSpeedCurveIcon",
                        nativeFunc: this.clickSpeedCurveIcon
                    }, {functionName: "ShowIndividuation", nativeFunc: this.showIndividuation}];
                    o.setDefaultNativeFunctionMap(e)
                }
            }

            getSkinInfo(e, t, n) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                    let i = l.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(i)) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    m.information(i), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            setSkinInfo(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield l.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSkin(e, t) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    m.information(e), d.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSkin", e, t), c.ipcRenderer.send("OnChangeSkin", e)
                } while (0)
            }

            getSpeedCurveSkinInfo(e, t, n) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                    let i = u.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(i)) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    m.information(i), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            setSpeedCurveSkinInfo(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield u.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            clickSpeedCurveIcon(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        try {
                            yield f.default("ShowIndividuation", {activeKey: "skin", skinActiveKey: "speedcurve"})
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSpeedCurveSkin(e, t, n) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    m.information("onChangeSpeedCurveSkin", e), d.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSpeedCurveSkin", e, t, n)
                } while (0)
            }

            showIndividuation(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        if (s.ThunderUtil.isUndef(a)) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let i;
                        try {
                            i = yield h.MessageBox.custom("Individuation", Object.assign({
                                singleton: !0,
                                version: T.getFileVersion(p.join(__rootDir, "../../Thunder.exe")),
                                dynamicSkinVersion: g.default.getConfigInfo("dynamicSkinVersion")
                            }, a[0] || {}), {modal: !1, webPreferences: {webSecurity: !1}})
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.SkinNaviteFunctionNS || (t.SkinNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(59), o = n(1), r = n(233), s = n(12), l = n(10), u = n(247),
        d = o.default.getLogger("Thunder.speedcurve-skin.skin-manager"), c = r.SpeedCurveSkinHelperNS.cacheDir;
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SpeedCurveSkinHelperNS.defaultSkinInfo, this.cacheURL = `${c}/skin-info.json`, this.init().catch(e => {
                d.warning(e)
            })
        }

        init() {
            return i(this, void 0, void 0, function* () {
                do {
                    let e;
                    yield l.FileSystemAWNS.mkdirAW(c);
                    try {
                        e = JSON.parse((yield l.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        d.warning("解析皮肤信息失败")
                    }
                    if (s.ThunderUtil.isUndef(e)) break;
                    let t = JSON.parse(localStorage.getItem("speedcurveSkins"));
                    if (null === t && (t = (yield u.default.getSkins()) || []), e = t.find(t => t.id === e.id), s.ThunderUtil.isUndef(e)) break;
                    yield this.setSkinInfo(e)
                } while (0)
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, n = !1) {
            return i(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.emit("changeSkin", this.skinInfo, t, n);
                    try {
                        if (!n) {
                            let t = {id: e.id, type: e.type};
                            d.information("保存皮肤", JSON.stringify(t)), yield l.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(t))
                        }
                    } catch (e) {
                        d.warning("保存皮肤信息失败")
                    }
                }
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(10), r = n(25), s = n(23), l = n(85), u = n(8), d = n(73), c = n(34), h = n(586), f = n(3),
        g = n(1), p = n(251), k = n(285), m = n(245), T = n(134), v = n(135), C = n(133), S = n(13), y = n(150),
        w = n(144), I = n(68), b = n(51), A = n(126), N = n(248),
        D = n(7).default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        _ = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        x = c.DownloadKernelEventManager.getEventManager(), E = g.default.getLogger("notification-render"),
        P = v.ToastNotifyManagerNS.getToastNotifyManger(), M = I.UserHelperNS.getHelper(),
        F = p.MsgQueueNS.MsgPriority.Download, O = A.DownloadKernelCategoryViewManager.getCategoryViewManager();
    const U = new class {
        init() {
            this.attachConfigInitFinished(), this.attachTaskStatusChanged(), this.attachTaskCreated()
        }

        calculateSurplusTime(e) {
            let t = [9, 12, 20, 21, 22, 23], n = {surplusTime: -9999, taskTye: 2}, i = new Date, a = i.getHours(),
                o = i.getMinutes(), r = i.getSeconds(), s = 0, l = new Date(e);
            do {
                if (a >= 23) break;
                if (0 !== e && l.getTime() + 12096e5 > i.getTime()) {
                    E.information("consumptionTips is in 14day", l.getTime(), i.getTime());
                    break
                }
                if (0 === o && 0 === r) {
                    for (s = 0; s < t.length; ++s) if (a === t[s]) {
                        n.surplusTime = 0, 9 === t[s] ? n.taskTye = 0 : 20 !== t[s] && 21 !== t[s] && 22 !== t[s] || (n.taskTye = 1);
                        break
                    }
                } else {
                    for (s = 0; s < t.length && !(a < t[s]); ++s) ;
                    9 === t[s] ? n.taskTye = 0 : 20 !== t[s] && 21 !== t[s] && 22 !== t[s] || (n.taskTye = 1), n.surplusTime = 1e3 * (60 - r + 60 * (60 - o - 1) + 60 * (t[s] - a - 1) * 60)
                }
            } while (0);
            return n
        }

        attachShowConsumptionTips() {
            let e = "", t = 0;
            if (e = "task_cnt_tag=" + (t = this.getCompletedTaskInfo().totalNumber), S.XLStatNS.trackEvent("business", "downloaded_check_cnt", "", 0, 0, 0, 0, e), E.information("trackEvent", "business", "downloaded_check_cnt", e), e = "task_cnt_tag=" + (t = this.getDownloadingTaskInfo().totalNumber), S.XLStatNS.trackEvent("business", "downloading_check_cnt", "", 0, 0, 0, 0, e), E.information("trackEvent", "business", "downloading_check_cnt", e), "AutoRun" !== N.default.startArgs) return;
            let n = r.ConfigNS.getValue("Consumption", "ShowMainWindowTime", 0),
                i = r.ConfigNS.getValue("Consumption", "HideMainWindowTime", 0),
                a = r.ConfigNS.getValue("Consumption", "ShowTipsTime", 0);
            do {
                if ((n > 0 || i > 0) && Math.abs(n - i) >= 2592e5) {
                    let e = {surplusTime: -1, taskTye: 1};
                    if ((e = this.calculateSurplusTime(a)).surplusTime < 0) break;
                    E.information("consumptionTips calculateSurplusTime", e.surplusTime, e.taskTye), setTimeout(() => {
                        this.onConsumptionNotifiy(e.taskTye)
                    }, e.surplusTime)
                }
            } while (0)
        }

        attachConfigInitFinished() {
            r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished(), setTimeout(() => {
                    this.attachShowConsumptionTips()
                }, 3e4)
            })
        }

        onConfigInitFinished() {
            this.attachLoadStorageTaskFinish()
        }

        attachLoadStorageTaskFinish() {
            d.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                this.autoStartUnfinishTask(), setTimeout(() => {
                    this.autoDeleteNonExistTasks().catch()
                }, 1e4)
            })
        }

        autoDeleteNonExistTasks() {
            return i(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoDeleteNotExistFile", !1)) {
                    let e = yield l.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        E.information(t), P.showNotify(v.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, C.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        autoStartUnfinishTask() {
            let e = r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
            T.DownloadDispatchNS.setStartTaskCount(e), r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoStartUnFinishedTask", !1) && l.TaskOperatorNs.startAll()
        }

        getBrowserFromProductInfo(e) {
            let t = "";
            do {
                if (void 0 === e || null === e || "" === e) break;
                let n = /^(xl_thunder_pc)\|([\d\.]+)\|(\d+)\|(.*)$/.exec(e);
                if (null === n) break;
                if (null === n[4] || void 0 === n[4]) break;
                t = n[4]
            } while (0);
            return t
        }

        convertSourceToStat(e) {
            let t = e;
            do {
                if ("leftup" === e || "rightup" === e || "BHO_left" === e || "BHO_right" === e) {
                    t = "BHO";
                    break
                }
                if ("wfp" === e) {
                    t = "XLWFP";
                    break
                }
                if ("redown" === e) {
                    t = "re_download";
                    break
                }
                if ("newwindow" === e) {
                    t = "newwindow_url";
                    break
                }
                if ("bt_file" === e) {
                    t = "Torrent";
                    break
                }
            } while (0);
            return t
        }

        statCoreEvent(e, t, n) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (null === e) break;
                    if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                    let i = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin);
                    i = this.convertSourceToStat(i);
                    let o = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.ProductInfo),
                        r = this.getBrowserFromProductInfo(o), s = e.getId();
                    const l = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize);
                    let c = `broswer=${r},taskid=${s}`, h = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType),
                        f = "";
                    if (h === u.DownloadKernel.TaskType.P2sp) f = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), c = `${c},task_type=p2sp,download_info=${encodeURIComponent(f)}`; else if (h === u.DownloadKernel.TaskType.Bt) {
                        let t = e.getExtraObject().getInfoId();
                        c = `${c},task_type=bt,download_info=${t}`, f = t
                    } else h === u.DownloadKernel.TaskType.Emule ? (f = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), c = `${c},task_type=emule,download_info=${encodeURIComponent(f)}`) : h === u.DownloadKernel.TaskType.Group ? c = `${c},task_type=group,download_info=` : h === u.DownloadKernel.TaskType.Magnet && (f = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), c = `${c},task_type=magnet,download_info=${encodeURIComponent(f)}`);
                    let g = yield w.isVestUrl(f, "vestURL"), p = yield w.isVestUrl(f, "commonUrl");
                    g ? i = "xl_password_vest" : p && (i = "xl_password_common");
                    let k = 0;
                    M.isLogin && M.isVip && (k = M.isSuperVip ? 7 : M.isPlatinumVip ? 3 : 2), c = `${c},source=${i},is_login=${M.isLogin ? 1 : 0},is_vip=${M.isVip ? 1 : 0},vip_type=${k}`;
                    let m = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), T = encodeURIComponent(m),
                        v = a.extname(m);
                    "" !== (v = void 0 === v ? "" : v) && (v = v.substring(1)), y.ParseUrlFileNameNS.isUsualFileExtName(v) || (v = ""), c = `${c},filename=${T},filesize=${l},filesuffix=${v},libversion=${d.DownloadKernelManager.getDownloadSdkVersion()}`, void 0 !== n && (c = `${c},${n}`);
                    let C = "core_event";
                    E.information("trackEvent", C, t, c), S.XLStatNS.trackEvent(C, t, "", 0, 0, 0, 0, c)
                } while (0)
            })
        }

        statJsSdkEvent(e, t, n) {
            do {
                if (null === e) break;
                if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                if ("ThunderUnion" !== e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin)) break;
                let i = e.getId();
                const a = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize);
                let o = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), r = encodeURIComponent(o),
                    s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid), l = e.getExtraObject();
                if (null === l || void 0 === l) break;
                let d = `taskid=${i},filesize=${a},filename=${r},gcid=${s},filenum=${l.getSubTaskCount()}`;
                if ("js_grouptask_download_success" === t && null !== a && void 0 !== a && a >= 1048576) {
                    let t = 0, n = 0, i = 0, a = 0, o = e.getTaskChannelInfo();
                    if (null !== o && void 0 !== o) {
                        void 0 !== o.originSize && (t = this.getSizeFormat(o.originSize)), null !== o.p2sSize && void 0 !== o.p2sSize && (n = this.getSizeFormat(o.p2sSize)), null !== o.p2pSize && void 0 !== o.p2pSize && (i = this.getSizeFormat(o.p2pSize));
                        let e = 0;
                        null !== o.offlineSize && void 0 !== o.offlineSize && (e = o.offlineSize), null !== o.dcdnSize && void 0 !== o.dcdnSize && (e += o.dcdnSize), d = `${d},ysdzh=${t},jxjs=${n},P2P=${i},hyjs=${a = this.getSizeFormat(e)}`
                    }
                }
                void 0 !== n && (d = `${d},${n}`);
                let c = "core_operate";
                E.information("trackEvent", c, t, d), S.XLStatNS.trackEvent(c, t, "", 0, 0, 0, 0, d)
            } while (0)
        }

        getSizeFormat(e) {
            let t = 0;
            do {
                if (void 0 === e || null === e || e <= 0) break;
                t = Number((e / 1048576).toFixed(2))
            } while (0);
            return t
        }

        attachTaskCreated() {
            x.attachTaskEvent(u.DownloadKernel.TaskEventType.TaskCreated, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== u.DownloadKernel.TaskEventType.TaskCreated) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e of t) {
                        let t = "location=other";
                        -1 !== e.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryId) && (t = "location=private"), this.statCoreEvent(e, "createtask", t).catch(), this.statJsSdkEvent(e, "js_grouptask_create", t)
                    }
                } while (0)
            })
        }

        attachTaskStatusChanged() {
            x.attachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== u.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = n.getTaskStatus();
                        if (n.getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                            i === u.DownloadKernel.TaskStatus.Succeeded && this.checkOpenOnFinish(n).catch();
                            continue
                        }
                        let a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background);
                        if (i === u.DownloadKernel.TaskStatus.Succeeded) {
                            let e = `task_stop_type=success,errorcode=0,gcid=${n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid)}`;
                            this.statCoreEvent(n, "download_task_result", e).catch();
                            let t = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CreateTime);
                            e = `downloadtime=${(n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CompletionTime) - t) / 1e3}`, this.statJsSdkEvent(n, "js_grouptask_download_success", e), a || this.onTaskFinished(n)
                        } else if (i === u.DownloadKernel.TaskStatus.Failed) {
                            let e = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid),
                                t = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.ErrorCode),
                                i = `task_stop_type=fail,errorcode=${t},gcid=${e}`;
                            this.statCoreEvent(n, "download_task_result", i).catch(), i = `errorcode=${t}`, this.statJsSdkEvent(n, "js_grouptask_download_fail", i), a || this.onTaskFailed(n)
                        }
                    }
                } while (0)
            })
        }

        getTaskUrl(e) {
            let t = "", n = e.getType();
            return n === u.DownloadKernel.TaskType.Bt ? t = e.getExtraObject().getSeedFilePath() : n !== u.DownloadKernel.TaskType.Emule && n !== u.DownloadKernel.TaskType.P2sp || (t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl)), t
        }

        getDownloadFileReportedData(e) {
            let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize),
                n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid), i = this.getTaskUrl(e), a = 0, o = 0,
                r = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadSize),
                s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadingPeriod),
                l = e.getTaskChannelInfo().originSize;
            E.information("getDownloadFileReportedData fileSize=", t, ";cid=", n, ";url=", i, ";recvValidSize=", r, ";period=", s, ";originalsize=", l), null !== t && void 0 !== t && null !== s && void 0 !== s && null !== l && void 0 !== l && 0 !== l && null !== r && void 0 !== r && 0 !== r ? o = Math.floor((t / l - t / r) * s) : a = 1;
            let d = JSON.stringify({
                type: "dlfile_report",
                data: {dlFileSize: t, cid: n, url: i, deadLinks: a, saveTime: o}
            });
            return E.information("getDownloadFileReportedData data=", d), d
        }

        onTaskFinished(e) {
            let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
            const n = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_Finish", !0),
                i = f.remote.getGlobal("mainRendererWindow"), a = i.isMinimized(), o = i.isVisible(),
                s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                d = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize), c = e.getTaskBaseInfo(),
                g = c.taskType === u.DownloadKernel.TaskType.Group, p = e.getIsPrivate(),
                k = null !== f.remote.BrowserWindow.getFocusedWindow();
            if (b.LoginHelperNS.loginHelper.channel(this.getDownloadFileReportedData(e)), t || this.playTaskFinishedSound().catch(), this.openFinishedTask(e).catch(), g) {
                let t = e.getExtraObject().getUserData(m.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall");
                null !== t && void 0 !== t && "1" === t && l.TaskOperatorNs.executeInstallFile(e).catch()
            }
            if (!t && n && (a || !o || !k) && s && !p) {
                if (g && d < 10485760) return;
                E.information("DownloadComplete", _), _.enQueue({
                    callback: function () {
                        E.information("trackEvent", "download_leftpanel", "dl_finished_tips_show", "panel_type=mypc"), S.XLStatNS.trackEvent("download_leftpanel", "dl_finished_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), h.Notification.notify({
                            type: "DownloadComplete",
                            data: {taskBase: c},
                            width: 400,
                            height: 205
                        })
                    }, name: "download", priority: F
                }), h.Notification.getCurrentWindow() ? _.getCurrentProperty() < F && h.Notification.close() : _.deQueue()
            }
        }

        getCompletedTaskInfo() {
            let e = [], t = 0, n = O.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Completed).getTasks(),
                i = new Date;
            for (let [, a]of n) if (null !== a && a.getTaskStatus() === u.DownloadKernel.TaskStatus.Succeeded) {
                let n = a.getTaskAttribute(u.DownloadKernel.TaskAttribute.CompletionTime),
                    o = a.getTaskAttribute(u.DownloadKernel.TaskAttribute.UserRead);
                if (i.getTime() - n <= 2592e6 && 0 === o) {
                    let n = a.getTaskBaseInfo().taskName;
                    t < 3 && e.push({taskName: n, percent: ""}), t += 1
                }
            }
            return {taskList: e, totalNumber: t}
        }

        getDownloadingTaskInfo() {
            let e = [], t = 0, n = O.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, i]of n) {
                if (null !== i && i.getTaskStatus() === u.DownloadKernel.TaskStatus.Stopped) {
                    const t = i.getTaskBaseInfo();
                    let n = t.taskName, a = 0;
                    0 !== t.fileSize && (a = t.downloadSize / t.fileSize), a >= 1 && (a = .9999);
                    let o = (100 * a).toFixed(0) + "%";
                    "100%" === o && (o = "99%"), e.length < 3 && e.push({taskName: n, percent: o})
                }
                t += 1
            }
            return {taskList: e, totalNumber: t}
        }

        onConsumptionNotifiy(e) {
            let t = {taskList: [], totalNumber: 0}, n = 4, i = "downloaded_notcheck_popup_show", a = "task_cnt=";
            0 === e ? (t = this.getDownloadingTaskInfo(), i = "not_downloaded_popup_show") : 1 === e ? (t = this.getCompletedTaskInfo(), n = 3) : (t = this.getCompletedTaskInfo(), n = 3, 0 === t.totalNumber && (n = 4, i = "not_downloaded_popup_show", t = this.getDownloadingTaskInfo()));
            do {
                if (0 === t.totalNumber) break;
                a += t.totalNumber;
                let e = new Date;
                _.enQueue({
                    callback: () => {
                        E.information("trackEvent", "business", i, a), S.XLStatNS.trackEvent("business", i, "", 0, 0, 0, 0, a);
                        let o = "亲,";
                        b.LoginHelperNS.loginHelper.getAllUserInfo(i => {
                            M.isLogin && (o = i.nickName), E.information("consumpiton consumptionMsgType,taskInfo", n, t), h.Notification.notify({
                                type: "ConsumptionTips",
                                data: {msgType: n, userName: o, fileCountNumber: t.totalNumber, exData: t.taskList},
                                width: 400,
                                height: 272
                            }), D.IsInFullScreen() ? this.attachShowConsumptionTips() : r.ConfigNS.setValue("Consumption", "ShowTipsTime", e.getTime())
                        })
                    }, name: "download", priority: F
                }), h.Notification.getCurrentWindow() ? _.getCurrentProperty() < F && h.Notification.close() : _.deQueue()
            } while (0)
        }

        onTaskFailed(e) {
            let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
            const n = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_FailSuggest", !0),
                i = f.remote.getGlobal("mainRendererWindow"), a = i.isMinimized(), o = i.isVisible(),
                s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                l = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize), d = e.getTaskBaseInfo(),
                c = d.taskType === u.DownloadKernel.TaskType.Group, g = e.getIsPrivate(),
                p = null !== f.remote.BrowserWindow.getFocusedWindow();
            if (!t && n && (a || !o || !p) && s && !g) {
                if (c && l < 10485760) return;
                _.enQueue({
                    callback: function () {
                        E.information("trackEvent", "download_leftpanel", "dl_fail_tips_show", "panel_type=mypc"), S.XLStatNS.trackEvent("download_leftpanel", "dl_fail_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), h.Notification.notify({
                            type: "DownloadFail",
                            data: {taskBase: d},
                            width: 400,
                            height: 180
                        })
                    }, name: "download", priority: F
                }), h.Notification.getCurrentWindow() ? _.getCurrentProperty() < F && h.Notification.close() : _.deQueue()
            }
        }

        playTaskFinishedSound() {
            return i(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_PlayWaveWhileFinish", !0)) {
                    let e = a.join(__rootDir, "../../download-complete.wav"),
                        t = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_WavePath", e);
                    (yield o.FileSystemAWNS.existsAW(t)) ? yield new Audio(t).play() : (yield o.FileSystemAWNS.existsAW(e)) && (yield new Audio(e).play())
                }
            })
        }

        checkOpenOnFinish(e) {
            return i(this, void 0, void 0, function* () {
                let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName);
                if (".torrent" === a.extname(t)) {
                    if (r.ConfigNS.getValue("BtGenericSettings", "AutoBTNewTask", !1)) {
                        let t = e.getTaskBaseInfo();
                        yield l.TaskOperatorNs.openTaskItem(t)
                    }
                } else if (1 === e.getTaskAttribute(u.DownloadKernel.TaskAttribute.OpenOnComplete)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                }
            })
        }

        openFinishedTask(e) {
            return i(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("TaskDefaultSettings", "OpenFile", !1)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                } else this.checkOpenOnFinish(e).catch()
            })
        }
    };
    !function (e) {
        e.init = function () {
            U.init()
        }
    }(t.TaskHelperNS || (t.TaskHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = n(2), r = n(7), s = n(1), l = n(13), u = n(23), d = n(25), c = n(250), h = n(73), f = n(738),
        g = n(284), p = n(85), k = n(134), m = n(135), T = n(133), v = n(249), C = n(739), S = n(3), y = n(15),
        w = n(235), I = n(83), b = s.default.getLogger("ConfigHandler"),
        A = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        N = m.ToastNotifyManagerNS.getToastNotifyManger();
    const D = new class {
        init() {
            this.attachConfigInitFinished(), d.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                switch (e) {
                    case"ConfigNormalSession":
                        this.onConfigNormalSessionChanged(t, n, i);
                        break;
                    case"TaskDefaultSettings":
                        this.onTaskDefaultSettingsChanged(t, n, i);
                        break;
                    case"ConfigNet":
                        this.onConfigNetChanged(t, n, i);
                        break;
                    case"ConfigMsg":
                        this.onConfigMsgChanged(t, n, i);
                        break;
                    case"Monitor":
                        this.onMonitorChanged(t, n, i);
                        break;
                    case"Proxy":
                        this.onProxyChanged(t, n, i);
                        break;
                    case"BtGenericSettings":
                        this.onBtGenericSettingsChanged(t, n, i);
                        break;
                    case"ConfigNoLimitDownload":
                        this.onConfigNoLimitDownloadChanged(t, n, i);
                        break;
                    case"Others":
                        this.onOthersChanged(t, n, i);
                        break;
                    case"IdleDownload":
                        this.onIdleDownloadChanged(t, n, i);
                        break;
                    case"EMuleGenericSettings":
                        this.onEMuleGenericSettingsChanged(t, n, i);
                        break;
                    case"MagnetGenericSettings":
                        this.onMagnetGenericSettingsChanged(t, n, i);
                        break;
                    case"BossKey":
                        this.onBossKeyChanged(t, n, i);
                        break;
                    case"DiskCache":
                        this.onDiskCacheChanged(t, n, i);
                        break;
                    case"Motitor":
                        this.onMotitorChanged(t, n, i);
                        break;
                    case"ProxySetting":
                        this.onProxySettingChanged(t, n, i)
                }
            }), c.BHOConfigNS.attachListener(u.NodeEventMesssageNS.eventBHOConfigValueChanged, (e, t, n, i) => {
                switch (e) {
                    case"Monitor":
                        this.onBHOConfigMonitorSessionChanged(t, n, i);
                        break;
                    case"EMuleGenericSettings":
                        "EMuleWatchLink" === t && this.handleWatchEmuleLink(n, i);
                        break;
                    case"MagnetGenericSettings":
                        "MagnetWatchLink" === t && this.handleWatchMagnetLink(n, i)
                }
            })
        }

        attachConfigInitFinished() {
            d.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            })
        }

        onConfigInitFinished() {
            let e = d.ConfigNS.getValue("DiskCache", "DiskCacheSelect", 256);
            h.DownloadKernelManager.setCacheSize(e);
            let t = d.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
            if (k.DownloadDispatchNS.setStartTaskCount(t), d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1)) {
                let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                e = Number(e), !isNaN(e) && e > 0 && k.DownloadDispatchNS.setAutoAddTask(!0, e)
            }
            h.DownloadKernelManager.attachListener(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                let e = d.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
                if (this.handleDownloadMode(void 0, e), d.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1)) {
                    let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                    k.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                }
            }), h.DownloadKernelManager.attachListener(u.NodeEventMesssageNS.eventDownloadSDKRecover, e => {
                if (0 === e) {
                    let e = d.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
                    this.handleDownloadMode(void 0, e)
                }
            });
            let n = d.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0),
                i = A.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
            if (n && "" === i ? d.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 0) : n || "" === i || d.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 1), d.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1) && C.ScheduleTaskNS.startFreeDownLoad(), d.ConfigNS.getValue("BtGenericSettings", "AssocTorrent", !0) && f.FileAssociationNS.checkAndRegisterTorrentFile(), 0 === d.ConfigNS.getValue("GenericSettings", "CheckCpu", 0)) {
                d.ConfigNS.setValue("GenericSettings", "CheckCpu", 1);
                let e = A.getCpuProcessors();
                A.getCpuFrequency(t => {
                    let n = "0";
                    n = 1 === e ? "0" : 2 === e || 3 === e ? t < 3500 ? "0" : "1" : 4 === e && t < 3e3 ? "0" : "1", d.ConfigNS.setValue("GenericSettings", "AnimationLevel", n);
                    let i = "cpu_processors=" + e.toString();
                    i += ",cpu_frequency=", i += t.toString(), l.XLStatNS.trackEvent("xdas_client_pro", "cpu_info", "", 0, 0, 0, 0, i)
                })
            }
        }

        onConfigNormalSessionChanged(e, t, n) {
            switch (e) {
                case"ConfigNormal_AutoRun":
                    this.handleAutoRun(t, n);
                    break;
                case"ConfigNormal_AutoStartUnFinishedTask":
                    break;
                case"ConfigNormal_MaxRunningTaskCount":
                    this.handleSetMaxRunningTaskCount(t, n);
                    break;
                case"TaskCountTotalSpeed":
                case"ConfigNormal_AutoSlowTask2Tail":
                    break;
                case"ConfigNormal_AutoDeleteNotExistFile":
                    this.handleAutoDeleteNonExistTasks(t, n).catch()
            }
        }

        onTaskDefaultSettingsChanged(e, t, n) {
            switch (e) {
                case"DefaultPath":
                case"UseLastCatalog":
                case"Win7Libraries":
                case"NewTaskStartMode":
                case"OpenFile":
                case"OpenSilenceDownload":
                    break;
                case"AwayModeEnabled":
                    this.handleAwayMode(t, n);
                    break;
                case"NewTaskDlgWithoutMainWnd":
                    this.handleNewTaskDlgWithoutMainWnd(t, n);
                    break;
                case"OrignHostThreads":
                    this.handleSetThreadCount(t, n)
            }
        }

        onConfigNetChanged(e, t, n) {
            switch (e) {
                case"ConfigNet_Type":
                    this.handleDownloadMode(t, n);
                    break;
                case"ConfigNet_Custom_DownloadSpeedChk":
                    (n = n) ? k.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : k.DownloadDispatchNS.setAutoAddTaskAvailable(!0);
                    break;
                case"ConfigNet_Custom_MaxDownloadSpeed":
                case"ConfigNet_Custom_MaxUploadSpeed":
                case"ConfigNet_Custom_Time_Switch":
                case"ConfigNet_Custom_Time_Begin_Hour":
                case"ConfigNet_Custom_Time_Begin_Minute":
                case"ConfigNet_Custom_Time_End_Hour":
                case"ConfigNet_Custom_Time_End_Minute":
                    b.information("onConfigNetChanged DownloadMode handleCustomDownloadMode"), g.DownloadModeNS.handleCustomDownloadMode();
                    break;
                case"ConfigNet_OpenMirrorImageIncreaseSpeed":
                    this.handleOpenMirrorImageIncreaseSpeed(t, n);
                    break;
                case"ConfigNet_OpenXunleiP2PIncreaseSpeed":
                    this.handleOpenXunleiP2PIncreaseSpeed(t, n);
                    break;
                case"ConfigNet_IdleDownload":
                    this.handleSetFreedown(t, n)
            }
        }

        onConfigMsgChanged(e, t, n) {
            switch (e) {
                case"ConfigMsg_Finish":
                    break;
                case"ConfigMsg_PlayWaveWhileFinish":
                    this.handlePlayWaveWhileFinish(t, n)
            }
        }

        onMonitorChanged(e, t, n) {
            switch (e) {
                case"MonitorClipBoard":
                    this.handleMonitorClipBoard(t, n);
                    break;
                case"ShortcutMonitor":
                    break;
                case"WatchTraditionLink":
                    c.BHOConfigNS.setValue("Monitor", "WatchTraditionLink", n ? 1 : 0), c.BHOConfigNS.save().catch();
                    break;
                case"ConfigWatch_Bt":
                    c.BHOConfigNS.setValue("Monitor", "ConfigWatch_Bt", n ? 1 : 0), c.BHOConfigNS.save().catch();
                    break;
                case"ExtendNames":
                    if (t !== n) {
                        let e = n.trim();
                        c.BHOConfigNS.setValue("Monitor", "ExtendNames", e), c.BHOConfigNS.save().catch()
                    }
            }
        }

        handleSetFreedown(e, t) {
            b.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && N.showNotify(m.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, T.ToastNotifyItemType.GreenNotify, "已开启空闲下载", 3e3)
        }

        onMotitorChanged(e, t, n) {
            b.information("onMotitorChanged:", e, t, n);
            do {
                if ("MotitorAll" === e) break;
                let t = v.SettingConfigHelperNS.configBrowserHelper.getWriteIniConfigShowBrowsers();
                c.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", t), v.SettingConfigHelperNS.configBrowserHelper.savaMotiorBrowserToConfig()
            } while (0)
        }

        onProxySettingChanged(e, t, n) {
            switch (b.information("onProxySettingChanged:", e, t, n), e) {
                case"ConfigProxy_Type":
                    this.handleProxyTypeChanged(t, n);
                    break;
                case"ConnectType_Http":
                    this.handleSetProxy(t, n)
            }
        }

        onProxyChanged(e, t, n) {
            if (!e) switch (e) {
                case"UseProxy":
                    this.handleUseProxy(t, n)
            }
        }

        onBtGenericSettingsChanged(e, t, n) {
            switch (e) {
                case"AutoBTNewTask":
                case"AssocTorrent":
                    break;
                case"ConfigBt_SetPortType":
                    this.handleSetPortType(t, n)
            }
        }

        onConfigNoLimitDownloadChanged(e, t, n) {
            switch (e) {
                case"TaskCountAutoAdd":
                    this.handleAutoAddTask(t, n);
                    break;
                case"TaskCountAutoAddRate":
                    d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1) && t !== n && k.DownloadDispatchNS.setAutoAddTask(!0, Number(n));
                    break;
                case"OpenNoLimitDownload":
                    this.handleOpenNoLimitDownload(t, n);
                    break;
                case"NoLimitDownloadFileSize":
                    d.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1) && t !== n && k.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(n))
            }
        }

        onOthersChanged(e, t, n) {
            switch (e) {
                case"AntiDisturb":
                    this.handleAntiDisturb(t, n)
            }
        }

        onIdleDownloadChanged(e, t, n) {
            switch (e) {
                case"isOpen":
                    this.handleOpenIdleDownload(t, n)
            }
        }

        onEMuleGenericSettingsChanged(e, t, n) {
            switch (e) {
                case"EMuleWatchLink":
                    c.BHOConfigNS.setValue("EMuleGenericSettings", "EMuleWatchLink", n ? 1 : 0), c.BHOConfigNS.save().catch()
            }
        }

        onMagnetGenericSettingsChanged(e, t, n) {
            switch (e) {
                case"MagnetWatchLink":
                    c.BHOConfigNS.setValue("MagnetGenericSettings", "MagnetWatchLink", n ? 1 : 0), c.BHOConfigNS.save().catch()
            }
        }

        onBossKeyChanged(e, t, n) {
            switch (e) {
                case"BossKeySwitch":
                    this.handleBossKeySwitch(t, n)
            }
        }

        onDiskCacheChanged(e, t, n) {
            switch (e) {
                case"DiskCacheSelect":
                    this.handleDiskCacheSelect(t, n)
            }
        }

        handleAutoRun(e, t) {
            if (b.verbose("handleAutoRun preValue:", e, "; newValue:", t), t) {
                let e = o.join(__rootDir, "../../Thunder.exe") + " -silent -StartType:AutoRun";
                A.writeRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder", e, 1)
            } else A.deleteRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder")
        }

        handleSetMaxRunningTaskCount(e, t) {
            b.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && k.DownloadDispatchNS.setStartTaskCount(t)
        }

        handleAutoDeleteNonExistTasks(e, t) {
            return i(this, void 0, void 0, function* () {
                if (t) {
                    let e = yield p.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        b.information(t), N.showNotify(m.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, T.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        handleSetThreadCount(e, t) {
            b.verbose("handleSetThreadCount preValue:", e, "; newValue:", t)
        }

        handleDownloadMode(e, t) {
            b.verbose("handleDownloadMode preValue:", e, "; newValue:", t), "1" === String(t) ? (b.information("handleDownloadMode DownloadMode setFullDownloadMode"), g.DownloadModeNS.setFullDownloadMode(), k.DownloadDispatchNS.setAutoAddTaskAvailable(!0)) : "0" === String(t) && (d.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0) ? k.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : k.DownloadDispatchNS.setAutoAddTaskAvailable(!0), b.information("handleDownloadMode DownloadMode handleCustomDownloadMode"), g.DownloadModeNS.handleCustomDownloadMode())
        }

        handleOpenMirrorImageIncreaseSpeed(e, t) {
            b.verbose("handleOpenMirrorImageIncreaseSpeed preValue:", e, "; newValue:", t), h.DownloadKernelManager.enableCommonP2sChannel(t)
        }

        handleOpenXunleiP2PIncreaseSpeed(e, t) {
            b.verbose("handleOpenXunleiP2PIncreaseSpeed preValue:", e, "; newValue:", t), h.DownloadKernelManager.enableCommonP2pChannel(t)
        }

        handleMonitorClipBoard(e, t) {
            b.verbose("handleMonitorClipBoard preValue:", e, "; newValue:", t)
        }

        handleUseProxy(e, t) {
            b.verbose("handleUseProxy preValue:", e, "; newValue:", t)
        }

        handleProxyTypeChanged(e, t) {
            b.verbose("handleUseProxy preValue:", e, "; newValue:", t);
            let n = "1", i = "null";
            if ("0" === t) void 0 !== e && I.ThunderKernel.setProxy(w.ProxyNS.ProxyType.None, "", 0, "", ""); else if ("1" === t) this.useIEProxy(), n = "0", i = "IE"; else if ("2" === t) {
                let e = d.ConfigNS.getValue("ProxySetting", "ConnectType_Http", "直接连接");
                "直接连接" !== e ? this.useCostomProxy(e) : I.ThunderKernel.setProxy(w.ProxyNS.ProxyType.None, "", 0, "", ""), n = "0", i = "custom"
            }
            let a = "download_agent=" + n;
            a = a + ",agent=" + i, b.information("trackEvent", "core_event", "download_agent_check", a), l.XLStatNS.trackEvent("core_event", "download_agent_check", "", 0, 0, 0, 0, a)
        }

        handleSetProxy(e, t) {
            this.useCostomProxy(t)
        }

        handlePlayWaveWhileFinish(e, t) {
            b.verbose("handlePlayWaveWhileFinish preValue:", e, "; newValue:", t)
        }

        handleSetPortType(e, t) {
            b.verbose("handleSetPortType preValue:", e, "; newValue:", t)
        }

        handleOpenNoLimitDownload(e, t) {
            b.verbose("handleOpenNoLimitDownload preValue:", e, "; newValue:", t);
            do {
                if (e === t) break;
                if (t) {
                    let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                    k.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                } else k.DownloadDispatchNS.setFreeFromScheduleOpen(!1)
            } while (0)
        }

        handleAutoAddTask(e, t) {
            do {
                if (e === t) break;
                if (t) {
                    let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                    k.DownloadDispatchNS.setAutoAddTask(!0, Number(e))
                } else k.DownloadDispatchNS.setAutoAddTask(!1)
            } while (0)
        }

        handleAntiDisturb(e, t) {
            b.verbose("handleAntiDisturb preValue:", e, "; newValue:", t)
        }

        handleOpenIdleDownload(e, t) {
            b.verbose("handleOpenIdleDownload preValue:", e, "; newValue:", t)
        }

        handleWatchEmuleLink(e, t) {
            b.verbose("handleWatchEmuleLink preValue:", e, "; newValue:", t);
            let n = '"' + o.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:ed2k';
            if (b.information("emuleValue: ", n), 1 === t) A.createRegKey("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command"), A.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "", n, 1), b.information("writeRegValue HKEY_CURRENT_USER Software\\Classes\\ed2k\\Shell\\Open\\command ", n); else {
                let e = A.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "");
                b.information("oldEmuleValue: ", e), e === n && (A.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "", "", 1), b.information("remove HKEY_CURRENT_USER Software\\Classes\\ed2k\\Shell\\Open\\command"))
            }
        }

        handleWatchMagnetLink(e, t) {
            b.verbose("handleWatchMagnetLink preValue:", e, "; newValue:", t);
            let n = '"' + o.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:magnet';
            if (b.information("magnetValue: ", n), 1 === t) A.createRegKey("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command"), A.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "", n, 1), b.information("writeRegValue HKEY_CURRENT_USER Software\\Classes\\magnet\\Shell\\Open\\command ", n); else {
                let e = A.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "");
                b.information("oldMagnetValue: ", e), e === n && (A.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "", "", 1), b.information("remove HKEY_CURRENT_USER Software\\Classes\\magnet\\Shell\\Open\\command"))
            }
        }

        handleBossKeySwitch(e, t) {
            b.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t)
        }

        handleDiskCacheSelect(e, t) {
            b.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t), h.DownloadKernelManager.setCacheSize(t)
        }

        onBHOConfigMonitorSessionChanged(e, t, n) {
            switch (c.BHOConfigNS.saveSync(), e) {
                case"ConfigBrowsers":
                case"FilterSitesForUI":
                    this.handleBHOConfigMonitorBrowserChanged(t, n)
            }
        }

        handleBHOConfigMonitorBrowserChanged(e, t) {
            A.notifyBrowserConfigChanged(), b.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t)
        }

        handleNewTaskDlgWithoutMainWnd(e, t) {
            e !== t && d.ConfigNS.saveSync()
        }

        setAwayMode(e) {
            let t = o.join(__rootDir, "../../ThunderCmd.exe");
            S.ipcRenderer.send(y.ThunderChannelList.channelRMExecute, "AwayMode", "runas", t, e, "", "SW_HIDE"), S.ipcRenderer.once(y.ThunderChannelList.channelMRExecuteResult, function (t, n, i) {
                if ("AwayMode" === n) if (i > 32) {
                    let t = !0;
                    "-CloseLeaveMode" === e && (t = !1), d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                } else {
                    let t = !1;
                    "-CloseLeaveMode" === e && (t = !0), d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                }
            })
        }

        handleAwayMode(e, t) {
            let n = t, i = a.release(), o = i.indexOf(".", 0), r = i.substring(0, o);
            if (null !== r && void 0 !== r && Number(r) >= 6) {
                let e = A.queryRegValue("HKEY_LOCAL_MACHINE", "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", "AwayModeEnabled");
                b.information("设置离开模式:", n, e), n ? 1 !== e ? this.setAwayMode("-OpenLeaveMode") : d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !0) : 1 === e ? this.setAwayMode("-CloseLeaveMode") : d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !1)
            }
        }

        useCostomProxy(e) {
            if (b.verbose("useCostomProxy proxyName:", e), "直接连接" === e) return void I.ThunderKernel.setProxy(w.ProxyNS.ProxyType.None, "", 0, "", "");
            let t = {}, n = d.ConfigNS.getValue("ProxyList", "proxys", []);
            if (n.length > 0) for (let i = 0; i < n.length; ++i) {
                let a = n[i].split(";");
                if (a[0] === e) {
                    t.name = a[0], t.host = a[1], t.type = a[3], t.userName = a[4], t.passWord = a[5], a[2] ? t.port = Number(a[2]) ? Number(a[2]) : 80 : t.port = 80;
                    break
                }
            }
            if (t.host && t.port) {
                let e = w.ProxyNS.ProxyType.None;
                "HTTP" === t.type ? e = w.ProxyNS.ProxyType.Http : "SOCKS5" === t.type && (e = w.ProxyNS.ProxyType.Sock5), I.ThunderKernel.setProxy(e, t.host, t.port, t.userName, t.passWord)
            }
        }

        useIEProxy() {
            let e = this.getIEProxy();
            if (e.host && e.port) {
                let t = w.ProxyNS.ProxyType.None;
                "HTTP" === e.type ? t = w.ProxyNS.ProxyType.Http : "SOCKS5" === e.type && (t = w.ProxyNS.ProxyType.Sock5), I.ThunderKernel.setProxy(t, e.host, e.port, e.userName, e.passWord)
            }
        }

        getIEProxy() {
            let e = {}, t = A.getIEProxy();
            if (t && "" !== t) {
                let n = t.indexOf("http=");
                if (e.type = "HTTP", n > 0) {
                    let e = (t = t.substr(n, t.length - (n + 5))).indexOf(";");
                    e > 0 && (t = t.substr(0, t.length - e))
                } else if ((n = t.indexOf("socks=")) > 0) {
                    e.type = "SOCKS5";
                    let i = (t = t.substr(n, t.length - (n + 6))).indexOf(",");
                    i > 0 && (t = t.substr(0, t.length - i))
                }
                if (t && t.length > 0 && t.indexOf(":") > 0 && t.indexOf("=") < 0) {
                    n = t.indexOf(":");
                    let i = t.substr(0, n), a = t.substr(n + 1, t.length - (n + 1));
                    i && a && Number(a) && (e.host = i, e.port = Number(a))
                }
            }
            return e
        }
    };
    !function (e) {
        e.init = function () {
            D.init()
        }
    }(t.ConfigHandlerNS || (t.ConfigHandlerNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(673), a = n(290);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(602), n(603), n(941), n(942), n(943), n(944), n(945), n(946), n(947), n(948), n(949), n(950);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\app.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(625), a = n(292);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(891);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(670), a = n(294);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\login-area.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(25), o = n(72), r = n(853), s = n(1).default.getLogger("login-prompt"), l = n(5);
    let u = new r.DataHelper;
    var d;
    !function (e) {
        e.promptDataGet = "OnpromptDataGet"
    }(d = t.LoginPromptManagerEventNS || (t.LoginPromptManagerEventNS = {}));

    class c extends o.default {
        constructor() {
            super(...arguments), this.dataList = null
        }

        init() {
            return i(this, void 0, void 0, function* () {
                s.information("init---\x3e"), this.setMaxListeners(1), this.fireEvent(d.promptDataGet, !0), s.information("1 fire prompt data get event"), (yield u.init()) && u.httpLoadDataInfo((e, t) => {
                    e && (this.dataList = t, s.information("datalist len", this.dataList.length), this.fireEvent(d.promptDataGet, !0), s.information("2 fire prompt data get event"), this.run())
                }), s.information("<---init")
            })
        }

        getPromptData() {
            return this.curShowData ? this.curShowData : null
        }

        run() {
            s.information("run---\x3e"), this.clearConfig(), this.startAttach(), this.startRun(), s.information("<---run")
        }

        getShowData(e) {
            for (let t = 0; t < this.dataList.length; t++) {
                const n = this.dataList[t];
                if (!e.includes(String(n.id))) return n
            }
            return null
        }

        updateData() {
            s.information("updateData---\x3e");
            let e = a.ConfigNS.getValue("XLLoginPrompt", "id", "");
            this.curShowData = this.getShowData(e), this.curShowData || (this.clearConfig(), this.curShowData = this.getShowData("")), s.information("cur show data", this.curShowData), e = "" === (e = a.ConfigNS.getValue("XLLoginPrompt", "id", "")) ? String(this.curShowData.id) : e + "," + this.curShowData.id, s.information("showids", e), a.ConfigNS.setValue("XLLoginPrompt", "id", e), this.fireEvent(d.promptDataGet, !0), s.information("3 fire prompt data get event"), s.information("<---updateData")
        }

        hideLoginPromptPanel() {
            s.information("hideLoginPromptPanel---\x3e")
        }

        startAttach() {
            s.information("startAttach---\x3e"), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                this.startRun()
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.startRun()
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("OnMainWindowVisibleChange", e => {
                s.information("OnMainWindowVisibleChange returnValue", e), e && this.startRun()
            }), this.startRun(), s.information("<---startAttach")
        }

        startRun() {
            s.information("startRun---\x3e"), l.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (e, t) => {
                0 === e ? (s.information("logined", t), l.NativeCallModule.nativeCall.CallNativeFunction("IsMainWndShow", e => {
                    s.information("IsMainWndShow returnValue", e), this.updateData()
                })) : this.hideLoginPromptPanel()
            }), s.information("<---startRun")
        }

        clearConfig() {
            s.information("clearConfig---\x3e"), a.ConfigNS.setValue("XLLoginPrompt", "id", ""), s.information("<---clearConfig")
        }
    }

    t.LoginPromptManager = c, function (e) {
        let t = new c;
        e.getManager = function () {
            return t
        }, e.init = function () {
            t.init().then().catch()
        }, e.getPromptData = function () {
            return t.getPromptData()
        }
    }(t.LoginPromptManagerNS || (t.LoginPromptManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(127), o = n(1).default.getLogger("login-prompt"), r = n(2), s = n(10), l = n(194);
    t.DataHelper = class extends a.HttpSession {
        constructor() {
            super(...arguments), this.dataList = []
        }

        init() {
            return i(this, void 0, void 0, function* () {
                let e = yield s.FileSystemAWNS.mkdirsAW(this.adDataDir);
                return e || o.information("初始化路径目录失败"), e
            })
        }

        httpLoadDataInfo(e) {
            o.information("httpLoadDataInfo---\x3e"), this.host = "admin.static.xl9.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/json/login_icon.json", o.information("uri:" + this.path), o.information("host:" + this.host), this.get(t => {
                if (200 === t.statusCode && t.body) {
                    let n = this.parseResponse(t.body);
                    this.downLoadResource(n, e).then().catch()
                }
            }, e => {
                o.information("error", e)
            }), o.information("<---httpLoadDataInfo")
        }

        downLoadResource(e, t) {
            return i(this, void 0, void 0, function* () {
                if (o.information("downLoadResource---\x3e"), e && e.length > 0) {
                    for (let t = 0; t < e.length; t++) {
                        const n = e[t];
                        o.information("element", t, n);
                        let i = n.img.substring(n.img.lastIndexOf("/") + 1), a = this.adDataDir + "/" + i;
                        o.information("imageLocalPath", a);
                        let r = yield l.AxiosNS.downloadFileAW(n.img, a);
                        if (o.information("ret", r), r) {
                            if (!(yield s.FileSystemAWNS.existsAW(a))) continue;
                            if (0 === (yield s.FileSystemAWNS.lstatAW(a)).size) continue;
                            let e = "png", t = i.substring(i.lastIndexOf(".") + 1, i.length);
                            o.information("fileExt", t), "gif" === t && (e = "gif");
                            let r = {id: n.id, title: n.title, image: n.img, url: n.url, imgLocalPath: a, iconType: e};
                            this.dataList.push(r)
                        }
                    }
                    o.information("<---downLoadResource"), this.dataList.length > 0 ? t(!0, this.dataList) : t(!1, null)
                }
            })
        }

        parseResponse(e) {
            if (!e) return null;
            let t = e.toString(), n = JSON.parse(t);
            return o.information("jsonstr", t), o.information("resObj", n), n || null
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(51), o = n(855), r = n(72), s = n(5), l = n(858), u = n(10), d = n(2),
        c = n(1).default.getLogger("vip-renewicon.manager");
    var h;
    !function (e) {
        e.userTypeChanged = "OnuserTypeChanged"
    }(h = t.UserEventNS || (t.UserEventNS = {}));

    class f extends r.default {
        constructor() {
            super(...arguments), this.cashHover = !1, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.expiredRange = 7, this.userType = 0, this.vipData = null, this.aidfromMap = new Map, this.iconDataDir = d.resolve(__profilesDir, "vipicon/"), this.iconData = null, this.iconUrl = null
        }

        get $hasCash() {
            return this.hasCash
        }

        get $iconData() {
            return this.iconData
        }

        initDataDir() {
            return i(this, void 0, void 0, function* () {
                let e = yield u.FileSystemAWNS.mkdirsAW(this.iconDataDir);
                return e || c.information("初始化路径目录失败"), e
            })
        }

        init() {
            super.setMaxListeners(1), this.aidfromMap.set(6, "xfbtn_grow0_kt"), this.aidfromMap.set(7, "xfbtn_grow1_kt"), this.aidfromMap.set(8, "xfbtn_grow1_kt"), this.aidfromMap.set(9, "xfbtn_pt_mrxf"), this.aidfromMap.set(10, "xfbtn_pt_mrxf"), this.aidfromMap.set(11, "xfbtn_bj_mrxf"), this.aidfromMap.set(12, "xfbtn_bj_mrxf"), this.aidfromMap.set(13, "xfbtn_cj_mrxf"), this.aidfromMap.set(14, "xfbtn_cj_mrxf")
        }

        calculateExpireDate() {
            let e, t, n;
            e = this.vipData.expireDate.substring(0, 4), t = this.vipData.expireDate.substring(4, 6), n = this.vipData.expireDate.substring(6, 8);
            let i = new Date(e + "-" + t + "-" + n + " 00:00:00").getTime() / 1e3, a = new Date, o = a.getFullYear(),
                r = a.getMonth(), s = a.getDate(),
                l = (a = new Date(o + "-" + (r < 10 ? "0" + (r + 1) : r + 1) + "-" + (s < 10 ? "0" + s : s) + " 00:00:00")).getTime() / 1e3;
            return Math.ceil((i - l) / 86400)
        }

        updateUserVipData(e) {
            return i(this, void 0, void 0, function* () {
                c.information("updateUserData---\x3e"), c.information("vipData", e), yield this.querySettingInfo(), this.vipData = e, c.information("expirerange", this.expiredRange), c.information("userType", this.userType), c.information("cashHover", this.cashHover), yield this.queryCashInfo(), yield this.queryUserTagInfo()
            })
        }

        onLogout() {
            this.cashHover = !1, this.expiredRange = 7, this.vipData = null, this.userType = 0, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.iconUrl = null, this.iconData = null, this.fireEvent(h.userTypeChanged, this.userType)
        }

        openNewTab() {
            if (!this.iconUrl && this.mSetting) for (let e = 0; e < this.mSetting.settings.length; e++) {
                let t = this.mSetting.settings[e];
                t.id === this.userType && t.url && (this.iconUrl = t.url)
            }
            let e = this.iconUrl ? this.iconUrl : "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=" + this.aidfromMap.get(this.userType);
            c.information("openNewTab---\x3e", e), s.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", e)
        }

        onIconClick() {
            c.information("onIconClick---\x3e"), this.openNewTab();
            let e = new Map;
            e.set("show_type", this.userType), e.set("isvip", this.vipData.isVip), e.set("vas_type", this.vipData.vasType), e.set("referfrom", "v_pc_xlx_ggong_pay_top"), e.set("aidfrom", this.aidfromMap.get(this.userType));
            let t = {attribute1: "xufei_botton_click", extData: e};
            l.StatUtilitiesNS.trackEvent("clienttop", t), c.information("<----onIconClick")
        }

        onIconShow() {
            c.information("onIconShow---\x3e");
            let e = new Map;
            e.set("show_type", this.userType), e.set("isvip", this.vipData.isVip), e.set("vas_type", this.vipData.vasType);
            let t = {attribute1: "xufei_botton_show", extData: e};
            l.StatUtilitiesNS.trackEvent("clienttop", t), c.information("<----onIconShow")
        }

        querySettingInfo() {
            return i(this, void 0, void 0, function* () {
                c.information("querySettingInfo");
                let e = new o.UserHttpSession;
                this.mSetting = yield e.querySettingInfo(), c.information("this.mSetting :", this.mSetting), this.mSetting && (1 === this.mSetting.cash_hover && (this.cashHover = !0), this.hasCash && !this.cashHover && (this.hasCash = !1), this.mSetting.expired_day > 0 && (this.expiredRange = this.mSetting.expired_day), c.information("this.mSetting :", this.mSetting), c.information("<---querySettingInfo"))
            })
        }

        checkUserType(e) {
            if (c.information("checkUserType---\x3e"), e && e.code && 1 === e.code) if (this.vipData && 1 === this.vipData.isVip) {
                let t = this.calculateExpireDate();
                c.information("leftdays", t), t <= this.expiredRange && (5 === this.vipData.vasType ? 0 === e.usedToActPay ? this.userType = 14 : this.userType = 13 : 3 === this.vipData.vasType ? 0 === e.usedToActPay ? this.userType = 12 : this.userType = 11 : 2 === this.vipData.vasType && (0 === e.usedToActPay ? this.userType = 10 : this.userType = 9))
            } else 0 === e.payTimesRangeForDL ? this.userType = 6 : 0 === e.usedToActPay ? this.userType = 8 : this.userType = 7; else if (this.vipData && 1 === this.vipData.isVip) {
                let e = this.calculateExpireDate();
                c.information("leftdays", e), e <= this.expiredRange && (5 === this.vipData.vasType ? this.userType = 14 : 3 === this.vipData.vasType ? this.userType = 12 : 2 === this.vipData.vasType && (this.userType = 10))
            } else this.userType = 6;
            c.information("usertype ", this.userType), c.information("<---checkUserType")
        }

        setIconData() {
            if (this.mSetting) for (let e = 0; e < this.mSetting.settings.length; e++) {
                let t = this.mSetting.settings[e];
                this.userType === t.id && (this.iconData = {iconUrl: t.icon_url, iconText: t.icon_text})
            }
        }

        queryUserTagInfo() {
            return i(this, void 0, void 0, function* () {
                c.information("queryUserTagInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), n = yield this.getSessionID();
                c.information("userId", t), c.information("sessionId", n), this.isQueryTagsBack = !1;
                let i = yield e.queryUserTags(t, n);
                c.information("response :", i), this.checkUserType(i), this.isQueryTagsBack = !0, c.information("usertype", this.userType), this.isQueryCashBack && (this.setIconData(), this.fireEvent(h.userTypeChanged, this.userType)), c.information("<---queryUserTagInfo")
            })
        }

        queryCashInfo() {
            return i(this, void 0, void 0, function* () {
                c.information("queryCashInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), n = yield this.getSessionID();
                c.information("userId", t), c.information("sessionId", n), this.isQueryCashBack = !1;
                let i = yield e.queryCashInfo(t, n);
                c.information("response", i), c.information("this.cashHover", this.cashHover), i && 0 === i.result && i.totalnum > 0 && this.cashHover ? this.hasCash = !0 : this.hasCash = !1, this.isQueryCashBack = !0, c.information("this.hasCash :", this.hasCash), this.isQueryTagsBack && (this.setIconData(), this.fireEvent(h.userTypeChanged, this.userType)), c.information("<---queryCashInfo")
            })
        }

        getUserID() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    a.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        c.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }

        getSessionID() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    a.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                        c.information("getSessionID:sessionid = ", t), e(t)
                    })
                })
            })
        }
    }

    t.VipRenewIconManager = f, function (e) {
        const t = new f;
        t.init(), e.getIconManager = function () {
            return t
        }
    }(t.VipRenewIconManagerNS || (t.VipRenewIconManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(856), o = n(857), r = n(1).default.getLogger("vip-renewicon.http-session");
    t.UserHttpSession = class extends a.HttpSession {
        querySettingInfo() {
            return i(this, void 0, void 0, function* () {
                return r.information("querySettingInfo----\x3e"), this.host = "images.client.vip.xunlei.com", this.retries = 1, this.timeout = 5e3, this.path = "/mini/xlx/tips_300x310/ssi_html/xdsxfbtnconf.js", r.information("uri:", this.path), r.information("host:", this.host), new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.UserHttpPackageNS.praseSettingBuffer(t.body)), e(n)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryCashInfo(e, t) {
            return i(this, void 0, void 0, function* () {
                return r.information("queryCashInfo"), this.host = "dynamic.vip.xunlei.com", this.retries = 1, this.timeout = 5e3, this.path = "/cashv2/userCashCount?userid=" + e + "&sessionid=" + t, r.information("host:", this.host), r.information("uri:", this.path), new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.UserHttpPackageNS.praseCashBuffer(t.body)), e(n)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryUserTags(e, t) {
            return i(this, void 0, void 0, function* () {
                return r.information("queryUserTags--\x3e"), this.host = "soa.vip.xunlei.com", this.retries = 1, this.timeout = 5e3, this.path = "/xlvip.common.mooseapi/querytags?userid=" + e + "&sessionid=" + t + "&tags=isSign,payTimesRangeForDL,usedToActPay", r.information("uri:", this.path), r.information("host:", this.host), new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.UserHttpPackageNS.praseTagBuffer(t.body)), e(n)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(47);
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = 80, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mTimeout = void 0, this.mCurRetries = 0
        }

        set host(e) {
            this.mHost = e
        }

        get host() {
            return this.mHost
        }

        set port(e) {
            this.mPort = e
        }

        get port() {
            return this.mPort
        }

        set path(e) {
            this.mPath = e
        }

        get path() {
            return this.mPath
        }

        set url(e) {
            this.mUrl = e
        }

        get url() {
            return this.mUrl
        }

        set auth(e) {
            this.mAuth = e
        }

        get auth() {
            return this.mAuth
        }

        set accept(e) {
            this.mAccept = e
        }

        get accept() {
            return this.mAccept
        }

        set body(e) {
            this.mBody = e
        }

        get body() {
            return this.mBody
        }

        set retries(e) {
            this.mRetries = e
        }

        get retries() {
            return this.mRetries
        }

        set timeout(e) {
            this.mTimeout = e
        }

        get timeout() {
            return this.mTimeout
        }

        get(e, t) {
            let n = {hostname: this.host, port: this.port, path: this.path || "/", method: "GET"};
            this.getImpl(n, e, n => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, this.get(e, t)) : t(n)
            })
        }

        getImpl(e, t, n) {
            i.get(e, e => {
                let n = null;
                e.on("data", e => {
                    n = n ? Buffer.concat([n, e]) : e
                }), e.on("end", () => {
                    t({statusCode: e.statusCode, headers: e.headers, body: n})
                })
            }).on("error", e => {
                n(e)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1).default.getLogger("vip-renewicon.http-package");
    !function (e) {
        e.praseSettingBuffer = function (e) {
            i.information("--\x3epraseSettingBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                if (n) {
                    i.information("jsonStr :", n);
                    try {
                        let e = JSON.parse(n);
                        i.information("resobj", e);
                        let a = [];
                        for (let t = 6; t <= 14; t++) if (e[t] && e[t].url) {
                            let n = e[t];
                            n.id = t, i.information("node", n), a.push(n)
                        }
                        t = {cash_hover: Number(e.cash_hover), expired_day: Number(e.expired_day), settings: a}
                    } catch (e) {
                        i.information(e), i.information("parser json error")
                    }
                }
            }
            return i.information("<--praseSettingBuffer"), t
        }, e.praseCashBuffer = function (e) {
            i.information("--\x3epraseCashBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                if (n) {
                    i.information("jsonStr :", n);
                    try {
                        let e = JSON.parse(n);
                        t = {
                            result: Number(e.result),
                            msg: e.msg,
                            totalnum: Number(e.data.total_num),
                            expirenum: Number(e.data.expire_num)
                        }
                    } catch (e) {
                        i.information("parser json error")
                    }
                }
            }
            return i.information("<--praseCashBuffer"), t
        }, e.praseTagBuffer = function (e) {
            i.information("--\x3epraseTagBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                if (n) {
                    i.information("jsonStr :", n);
                    try {
                        let e = JSON.parse(n);
                        t = {
                            code: Number(e.code),
                            msg: e.message,
                            isSign: e.result ? Number(e.result.isSign) : 0,
                            payTimesRangeForDL: e.result ? Number(e.result.payTimesRangeForDL) : 0,
                            usedToActPay: e.result ? Number(e.result.usedToActPay) : 0
                        }
                    } catch (e) {
                        i.information("parser json error")
                    }
                }
            }
            return i.information("<--praseTagBuffer"), t
        }
    }(t.UserHttpPackageNS || (t.UserHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(5), a = n(1).default.getLogger("vip-renewicon.stat-utilities");
    !function (e) {
        e.trackEvent = function (e, t) {
            if (i.NativeCallModule.nativeCall) {
                let n = (t = t || {}).attribute1 || "", o = t.attribute2 || "", r = function (e) {
                    let t = "";
                    return e.forEach((e, n) => {
                        "" !== t && (t += ","), t = t + n + "=" + e
                    }), t
                }(t.extData || new Map);
                a.information("key : ", e), a.information("attribute1 : ", n), a.information("attribute2 ：", o), a.information("extData ： ", r), r = encodeURIComponent(r), i.NativeCallModule.nativeCall.CallNativeFunction("TrackEvent", e, n, o, 0, 0, 0, 0, r, (e, t) => {
                    a.information("trackEvent", "errorCode", e, "returnValue", t)
                })
            }
        }
    }(t.StatUtilitiesNS || (t.StatUtilitiesNS = {}))
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(296);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\address-bar-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(679), a = n(298);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\address-bar.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(59), a = n(12), {isDef: o, throttle: r, setStyle: s} = a.ThunderUtil;
    t.default = class extends i.EventEmitter {
        constructor(e) {
            super(), this.options = [...e]
        }

        position() {
            let e, t, n = this.currentElement.getBoundingClientRect(),
                i = this.currentReference.getBoundingClientRect(),
                a = o(this.currentGuideOptions.position) ? this.currentGuideOptions.position : "center";
            ["center", "top", "bottom"].includes(a) ? e = i.left + (i.width - n.width) / 2 : "left" === a ? e = i.left : "right" === a && (e = i.right - n.width), ["center", "left", "right"].includes(a) ? t = i.top + i.height / 2 - n.height : "top" === a ? t = i.top - n.height / 2 : "bottom" === a && (t = i.bottom - n.height / 2), o(this.currentGuideOptions.offset) && (e += this.currentGuideOptions.offset[0], t += this.currentGuideOptions.offset[1]), this.currentElement.style.left = `${e}px`, this.currentElement.style.top = `${t}px`
        }

        next() {
            let e, t, n;
            if (e = this.currentGuideOptions = this.options.shift(), o(this.currentGuideOptions)) {
                document.body.insertAdjacentHTML("beforeend", '<div class="xlx-new"><i></i></div>'), t = this.currentElement = document.body.lastElementChild, n = this.currentReference = document.querySelector(this.currentGuideOptions.selector);
                let i = r(() => {
                    this.position()
                }, 16);
                o(this.currentGuideOptions.style) && s(this.currentElement, this.currentGuideOptions.style), this.position(), this.emit("show", this.currentGuideOptions.name), window.addEventListener("resize", i), this.currentReference.addEventListener("focus", () => {
                    "none" !== t.style.display && (t.style.display = "none", this.emit("done", e.name), window.removeEventListener("resize", i), n.addEventListener("blur", () => {
                        this.next()
                    }))
                })
            }
        }

        setVisible(e, t) {
            o(this.currentGuideOptions) && this.currentGuideOptions.name === e && o(this.currentElement) && (this.currentElement.style.display = t ? "" : "none")
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(2), r = a.default.getLogger("Thunder.renderer.contextmenu"), s = n(6), l = n(5), u = n(136),
        d = n(24), c = n(10), h = n(3), f = n(84), g = n(105), p = n(8), k = n(20), m = n(7), T = n(82),
        v = m.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        C = ".asf;.avi;.exe;.iso;.mp3;.mp4;.mkv;.mpeg;.mpg;.mpga;.ra;.rar;||.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf",
        S = ["http://", "https://", "ftp://"], y = ["thunder://", "thunders://", "ed2k://", "magnet:"];

    function w(e) {
        let t = !1;
        if (e) for (let n = 0; n < S.length; ++n) {
            let i = S[n];
            if (0 === e.indexOf(i)) {
                t = !0;
                break
            }
        }
        return t
    }

    function I(e) {
        let t = !1;
        if (e) for (let n = 0; n < y.length; ++n) {
            let i = y[n];
            if (0 === e.indexOf(i)) {
                t = !0;
                break
            }
        }
        return t
    }

    function b(e) {
        let t = [], n = e;
        if (f.Common.isThunderPrivateUrl(n) && (n = f.Common.parseThunderPrivateUrl(n)), function (e) {
            let t = !1;
            do {
                if (!e) break;
                if (w(e)) {
                    let n = o.extname(e);
                    if (!n) break;
                    C.indexOf(n) > -1 && (t = !0)
                } else I(e) && (t = !0)
            } while (0);
            return t
        }(n)) {
            let i = k.ThunderHelper.getTaskTypeFromUrl(n);
            if (i === p.DownloadKernel.TaskType.P2sp || i === p.DownloadKernel.TaskType.Emule) t.push(e); else if (i === p.DownloadKernel.TaskType.Magnet || i === p.DownloadKernel.TaskType.Bt) return g.ThunderNewTask.createBtTaskWindow({
                url: e,
                type: "url"
            }, {browser: "xlbrowser.exe"}), !0
        }
        return t.length > 0 && (g.ThunderNewTask.createPreNewTaskWindow(t), !0)
    }

    function A(e, t) {
        return i(this, void 0, void 0, function* () {
            let n = null, i = !1;
            try {
                n = yield d.default.get(e)
            } catch (e) {
            }
            return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (i = yield c.FileSystemAWNS.writeFileAW(t, n.data)), i
        })
    }

    function N(e) {
        do {
            if (s.isNullOrUndefined(e)) break;
            let t = e;
            if (!1 === D(e)) {
                t = "https://www.baidu.com/s?" + (T.default.getConfigInfo("searchBar", "baidutn") || "tn=48021271_21_hao_pg").toString() + "&wd=" + e
            }
            l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t)
        } while (0)
    }

    function D(e) {
        let t = !1;
        do {
            let n = e.trim();
            if (s.isNullOrUndefined(n)) break;
            if (t = /([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test(n)) {
                t = 1 === v.isPingHostValid(n)
            }
        } while (0);
        return t
    }

    function _(e, t) {
        r.information("commandOpenUrl", e), b(e.link_url) ? r.information(e.link_url) : N(e.link_url)
    }

    function x(e, t) {
        if (r.information(e), b(e.link_url)) return;
        let n = h.remote.getCurrentWindow(), i = h.remote.dialog.showSaveDialog(n, {
            defaultPath: "新建网页.html",
            filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
        });
        void 0 !== i && "" !== i && (".html" !== o.extname(i).toLowerCase() && (i += ".html"), setTimeout(() => {
            A(e.link_url, i).catch()
        }, 0))
    }

    t.contextMenuPage = [{
        label: "返回", commandFunc: function (e, t) {
            r.information("goBack"), t.goBack()
        }
    }, {
        label: "前进", commandFunc: function (e, t) {
            r.information(e), t.goForward()
        }
    }, {
        label: "重新加载", commandFunc: function (e, t) {
            r.information(e), t.refresh(!1)
        }
    }, {
        label: "另存为", commandFunc: function (e, t) {
            r.information(e);
            let n = h.remote.getCurrentWindow(), i = h.remote.dialog.showSaveDialog(n, {
                defaultPath: "新建网页.html",
                filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
            });
            if (void 0 === i || "" === i) return;
            ".html" !== o.extname(i).toLowerCase() && (i += ".html");
            setTimeout(() => {
                A(e.page_url, i).catch()
            }, 0)
        }
    }, {
        label: "查看网页源代码", commandFunc: function (e, t) {
            r.information(e), l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "view-source:" + e.page_url)
        }
    }], t.contextMenuDownloadableLink = [{label: "在新标签页打开链接", commandFunc: _}, {
        label: "链接另存为",
        commandFunc: x
    }, {
        label: "复制链接地址", commandFunc: function (e, t) {
            r.information(e), v.copyTextToClipBoard(e.link_url)
        }
    }], t.contextMenuMedia = [{
        label: "在新标签页中打开图片", commandFunc: function (e, t) {
            r.information("commandOpenUrl", e), N(e.source_url)
        }
    }, {
        label: "图片另存为", commandFunc: function (e, t) {
            r.information(e);
            let n = o.basename(e.source_url), a = o.extname(n);
            "" === n && (n = function () {
                let e = "";
                for (let t = 1; t <= 32; t++) {
                    let n = Math.floor(16 * Math.random()).toString(16);
                    e += n, 8 !== t && 12 !== t && 16 !== t && 20 !== t || (e += "-")
                }
                return e
            }() + a);
            let s = void 0;
            s = "" !== a ? {
                defaultPath: n,
                filters: [{name: "图片（*" + a + "）", extensions: [a]}, {name: "所有文件", extensions: ["*"]}]
            } : {defaultPath: n, filters: [{name: "所有文件", extensions: ["*"]}]};
            let l = h.remote.getCurrentWindow(), u = h.remote.dialog.showSaveDialog(l, s);
            if (void 0 === u || "" === u) return;
            setTimeout(() => {
                (function (e, t) {
                    return i(this, void 0, void 0, function* () {
                        let n = null, i = !1;
                        try {
                            n = yield d.default.get(e, {responseType: "arraybuffer"})
                        } catch (e) {
                        }
                        return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (i = yield c.FileSystemAWNS.writeFileAW(t, n.data)), i
                    })
                })(e.source_url, u).catch()
            }, 0)
        }
    }, {
        label: "复制图片", commandFunc: function (e, t) {
            r.information(e), setTimeout(() => {
                (function (e) {
                    return i(this, void 0, void 0, function* () {
                        let t = null, i = !1;
                        try {
                            t = yield d.default.get(e, {responseType: "arraybuffer"})
                        } catch (e) {
                            return !1
                        }
                        if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data) {
                            let e = "data:" + t.headers["content-type"] + ";base64," + new Buffer(t.data).toString("base64"),
                                a = n(3).nativeImage.createFromDataURL(e);
                            h.clipboard.clear(), h.clipboard.writeImage(a), i = !0
                        }
                        return i
                    })
                })(e.source_url).catch()
            }, 0)
        }
    }, {
        label: "复制图片地址", commandFunc: function (e, t) {
            r.information(e), v.copyTextToClipBoard(e.source_url)
        }
    }], t.contextMenuSelection = [{
        label: "复制", commandFunc: function (e, t) {
            r.information(e), t.editCopy()
        }
    }, {
        label: "用百度搜索", commandFunc: function (e, t) {
            r.information(e);
            let n = "https://www.baidu.com/s?" + (T.default.getConfigInfo("searchBar", "baidutn") || "tn=48021271_21_hao_pg").toString() + "&wd=" + e.selection_text;
            l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
        }
    }], t.contextMenuEditable = [{
        label: "撤销", commandFunc: function (e, t) {
            r.information(e), t.editUndo()
        }
    }, {
        label: "剪切", commandFunc: function (e, t) {
            r.information(e), t.editCut()
        }
    }, {
        label: "复制", commandFunc: function (e, t) {
            r.information(e), t.editCopy()
        }
    }, {
        label: "粘贴", commandFunc: function (e, t) {
            r.information(e), t.editPaste()
        }
    }, {
        label: "删除", commandFunc: function (e, t) {
            r.information(e), t.editDelete()
        }
    }, {
        label: "全选", commandFunc: function (e, t) {
            r.information(e), t.editSelectAll()
        }
    }], t.contextMenuLink = [{label: "在新标签页打开链接", commandFunc: _}, {label: "链接另存为", commandFunc: x}, {
        label: "复制链接地址",
        commandFunc: function (e, t) {
            r.information(e), v.copyTextToClipBoard(e.link_url), b(e.link_url) && r.information(e.link_url)
        }
    }], t.registerContextMenu = function (e) {
        e.getTabType() === u.TabType.Chromium && e.getBrowser().registerContextMenu({
            page: t.contextMenuPage,
            selection: t.contextMenuSelection,
            edit: t.contextMenuEditable,
            link: t.contextMenuLink,
            media: t.contextMenuMedia,
            downloadLink: t.contextMenuDownloadableLink
        })
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(25), a = n(736), o = n(30), r = n(1).default.getLogger("setting-conf"), s = {
        REMOVE_CONFIG_DATA(e) {
            e.formData = {}, e.confSchema = []
        }, SET_CONFIG_DATA(e, t) {
            e.formData = Object.assign({}, e.formData, t)
        }, SET_CONF_SCHEMA(e, t) {
            e.confSchema = t
        }, ADD_SCHEMA_ITEM(e, t) {
            if (r.information("ADD_SCHEMA_ITEM", t), void 0 !== t.position[0] && void 0 !== t.position[1]) {
                let n = 0;
                n = t.direction < 0 ? e.confSchema[t.position[0]].children[t.position[1]].children.length + t.direction + 1 : t.direction, e.confSchema[t.position[0]].children[t.position[1]].children.splice(n, 0, t.schemaItem), o.default.set(e.confSchema[t.position[0]].children[t.position[1]].children, "children", e.confSchema[t.position[0]].children[t.position[1]].children)
            }
        }, ADD_FORMDATA_ITEM(e, t) {
            let n = `${t.section}-${t.key}`;
            void 0 === e.formData[n] && o.default.set(e.formData, n, t)
        }, ADD_SELECT_ITEM(e, t) {
            let n = e.formData[t.target];
            r.information("targetItem", n), n.selectItems.includes(t.from) || (n.selectItems.push(t.from), o.default.set(e.formData[t.target], "selectItems", n.selectItems))
        }, SET_CONFIG_VALUE(e, t) {
            if (void 0 !== e.formData[t.name].optionToValue) {
                let n = t.value;
                i.ConfigNS.setValue(t.section, `${t.key}`, e.formData[t.name].optionToValue[n]), "" !== t.userId && i.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e.formData[t.name].optionToValue[n])
            } else if (e.formData[t.name].type && "number" === e.formData[t.name].type) {
                let e = Number(t.value);
                i.ConfigNS.setValue(t.section, `${t.key}`, e), "" !== t.userId && i.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e)
            } else i.ConfigNS.setValue(t.section, `${t.key}`, t.value), "" !== t.userId && i.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, t.value);
            void 0 !== e.formData[t.name].immediatelySave && i.ConfigNS.saveSync(), function (e, t) {
                let n = e.formData[t.name];
                void 0 !== n.selectItems && n.selectItems.map(n => {
                    let a = t.value;
                    e.formData[n].type && "number" === e.formData[n].type && (a = Number(t.value)), i.ConfigNS.setValue(e.formData[n].section, e.formData[n].key, a)
                });
                if (void 0 !== n.selectAllName) {
                    let n = e.formData[t.name].selectAllName, a = e.formData[n];
                    if (t.value) {
                        let t = !0;
                        a.selectItems.map(n => {
                            t = i.ConfigNS.getValue(e.formData[n].section, e.formData[n].key, !1) && t
                        }), t && i.ConfigNS.setValue(a.section, a.key, !0)
                    } else {
                        let e = i.ConfigNS.getValue(a.section, a.key, "");
                        e && i.ConfigNS.setValue(a.section, a.key, !1)
                    }
                }
            }(e, t)
        }, SET_FOMR_DATA(e, t) {
            let n = `${t.section}-${t.key}`;
            if (void 0 === e.formData[n]) return;
            let i = t.value;
            if (void 0 !== e.formData[n] && void 0 !== e.formData[n].optionToValue) {
                let a = e.formData[n];
                for (let e in a.optionToValue) if (a.optionToValue[e] === t.value) {
                    i = e;
                    break
                }
            } else void 0 !== e.formData[`${t.section}-${t.key}`] && (i = t.value);
            e.formData[`${t.section}-${t.key}`].value = i
        }
    }, l = {
        initSettingData({commit: e}) {
            a.SettingInit.setBaseConf();
            let t = null, n = a.SettingInit.getConfFormData();
            try {
                t = JSON.parse(JSON.stringify(a.SettingInit.getConfSchema()))
            } catch (e) {
            }
            null === t && (t = a.SettingInit.getConfSchema()), e("SET_CONF_SCHEMA", t), e("SET_CONFIG_DATA", n)
        }
    };
    t.default = {state: {confSchema: [], formData: {}}, mutations: s, actions: l}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(4), a = n(1), o = n(8), r = n(34), s = n(126), l = n(90), u = n(32), d = n(866), c = n(74), h = n(566),
        f = a.default.getLogger("DownloadStore"), g = u.DownloadKernelTaskManager.getTaskManager(),
        p = r.DownloadKernelEventManager.getEventManager(),
        k = s.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        m = l.DownloadKernelCategoryManager.getCategoryManager(), T = {
            currentCategoryId: -1,
            currentCategoryViewId: o.DownloadKernel.CategroyViewID.Downloading,
            taskList: [{
                categoryId: -1,
                id: o.DownloadKernel.CategroyViewID.Downloading,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {
                categoryId: -1,
                id: o.DownloadKernel.CategroyViewID.Completed,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {categoryId: -1, id: o.DownloadKernel.CategroyViewID.Recycle, tasksMap: {}, selected: [], taskIds: []}],
            taskListPrivate: [{
                id: o.DownloadKernel.CategroyViewID.Downloading,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {id: o.DownloadKernel.CategroyViewID.Completed, tasksMap: {}, selected: [], taskIds: []}]
        }, v = {
            INIT_CATEGORY_TASKLIST(e) {
                f.information("INIT_CATEGORY_TASKLIST state.currentCategoryId:", e.currentCategoryId);
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let n = 0; n < t.length; n++) {
                    let i = t[n], a = null;
                    if (!(a = -1 === e.currentCategoryId ? k.getCategoryViewFromId(i.id) : m.getCategoryView(e.currentCategoryId, i.id))) {
                        i.tasksMap = null, i.selected = [], i.taskIds = [], i.tasksMap = {};
                        continue
                    }
                    let o = a.getTasks();
                    t[n].tasksMap = null, t[n].tasksMap = {}, t[n].selected = [], t[n].categoryId = e.currentCategoryId;
                    let r = {};
                    for (let [e, t]of o) r[e] = t.getTaskBaseInfo();
                    let s = [...Object.values(r)];
                    s.sort(h.SortNS.getSortFuncByConfig(i.id, i.categoryId)), t[n].tasksMap = Object.assign({}, r), t[n].taskIds = s.map(e => e.taskId)
                }
                f.information("INIT_CATEGORY_TASKLIST end")
            }, SORT_CATEGORY_HISTORY(e) {
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let e = 0; e < t.length; e++) {
                    let n = [...Object.values(t[e].tasksMap)];
                    n.sort(h.SortNS.getSortFuncByConfig(t[e].id, t[e].categoryId)), t[e].taskIds = n.map(e => e.taskId)
                }
            }, SORT_CATEGORY_BY_FUNCTION(e, t) {
                do {
                    if (t.index < 0 || t.index > 2) break;
                    if ("function" != typeof t.compareFn) break;
                    if (-1 === t.categoryId) {
                        let n = [...Object.values(e.taskList[t.index].tasksMap)];
                        n.sort(t.compareFn), e.taskList[t.index].taskIds = n.map(e => e.taskId)
                    } else {
                        let n = [...Object.values(e.taskListPrivate[t.index].tasksMap)];
                        n.sort(t.compareFn), e.taskListPrivate[t.index].taskIds = n.map(e => e.taskId)
                    }
                } while (0)
            }, UPDATE_CATEGORYVIEW(e, t) {
                e.currentCategoryViewId !== t && (e.currentCategoryViewId = t)
            }, INSERT_TO_CATEGORY_VIEW(e, t) {
                f.information("insert INSERT_TO_CATEGORY_VIEW in ");
                let n = e.taskList;
                -1 !== t.categoryId && (n = e.taskListPrivate);
                for (let e = 0; e < n.length; e++) if (n[e].id === t.id) {
                    if (n[e].categoryId !== t.categoryId) break;
                    let i = [], a = {};
                    for (let e of t.tasks) a[e.taskId] = Object.assign({}, e), i.push(e.taskId);
                    n[e].tasksMap = Object.assign({}, n[e].tasksMap, a), i.length > 0 && n[e].taskIds.splice(0, 0, ...i);
                    break
                }
                f.information("insert INSERT_TO_CATEGORY_VIEW end ")
            }, REMOVE_FROM_CATEGORY_VIEW(e, t) {
                let n = e.taskList;
                -1 !== t.categoryId && (n = e.taskListPrivate);
                for (let e = 0; e < n.length; e++) if (n[e].id === t.categoryViewId) {
                    if (n[e].categoryId !== t.categoryId) break;
                    let i = Object.assign({}, n[e].tasksMap), a = Object.assign([], n[e].taskIds),
                        o = Object.assign([], n[e].selected);
                    for (let e of t.tasks) {
                        let t = e.taskId;
                        delete i[t];
                        let n = a.indexOf(t);
                        -1 !== n && a.splice(n, 1);
                        let r = o.indexOf(t);
                        -1 !== r && o.splice(r, 1)
                    }
                    n[e].tasksMap = i, n[e].taskIds = a, n[e].selected = o;
                    break
                }
            }, UPDATE_TASK_INFO(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    for (let n of t) {
                        let t = 0;
                        e.taskList[t].tasksMap.hasOwnProperty(String(n.taskId)) ? i.Vue.set(e.taskList[t].tasksMap, String(n.taskId), Object.assign({}, n)) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(n.taskId)) ? i.Vue.set(e.taskListPrivate[t].tasksMap, String(n.taskId), Object.assign({}, n)) : (t = 1, e.taskList[t].tasksMap.hasOwnProperty(String(n.taskId)) ? (f.information("update task info not find in downloading", n), i.Vue.set(e.taskList[t].tasksMap, String(n.taskId), Object.assign({}, n))) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(n.taskId)) ? i.Vue.set(e.taskListPrivate[t].tasksMap, String(n.taskId), Object.assign({}, n)) : (t = 2, e.taskList[t].tasksMap.hasOwnProperty(String(n.taskId)) && (f.information("update task info not find in downloading & complete", n), i.Vue.set(e.taskList[t].tasksMap, String(n.taskId), Object.assign({}, n)))))
                    }
                } while (0)
            }, UPDATE_TASK_READED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_RENAME(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_MOVING_STATE_CHANGE(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (n = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_MOVED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (n = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_STATUS(e, t) {
                f.information("update status in", t.length, t[0].taskStatus, t[0].taskId);
                let n = {}, i = void 0;
                for (let a of t) void 0 === i && (i = !e.taskList[0].tasksMap.hasOwnProperty(String(a.taskId))), n[a.taskId] = a;
                f.information("update status "), i ? e.taskListPrivate[0].tasksMap = Object.assign({}, e.taskListPrivate[0].tasksMap, n) : e.taskList[0].tasksMap = Object.assign({}, e.taskList[0].tasksMap, n), f.information("update status end")
            }, UPDATE_DOWNLOADING_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId ? e.taskList[0].selected = [...t] : e.taskListPrivate[0].selected = [...t]
            }, UPDATE_COMPLETED_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId ? e.taskList[1].selected = [...t] : e.taskListPrivate[1].selected = [...t]
            }, UPDATE_RECYCLE_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId && (e.taskList[2].selected = [...t])
            }, MOVE_TO_TOP(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (n = e.taskListPrivate[0].taskIds);
                    let i = [];
                    for (let e of t) {
                        let t = n.indexOf(e);
                        -1 !== t && i.push(t)
                    }
                    i.sort((e, t) => e - t);
                    let a = [];
                    for (let e = i.length - 1; e >= 0; e--) a.unshift(n.splice(i[e], 1)[0]);
                    n.splice(0, 0, ...a)
                } while (0)
            }, MOVE_TO_BOTTOM(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (n = e.taskListPrivate[0].taskIds);
                    let i = [];
                    for (let e of t) {
                        let t = n.indexOf(e);
                        -1 !== t && i.push(t)
                    }
                    i.sort((e, t) => e - t);
                    let a = [];
                    for (let e = i.length - 1; e >= 0; e--) a.unshift(n.splice(i[e], 1)[0]);
                    n.splice(n.length, 0, ...a)
                } while (0)
            }, UPDATE_CATEGORY(e, t) {
                if (e.currentCategoryId !== t) {
                    if (e.currentCategoryId = t, -1 !== t) for (let n = 0; n < e.taskListPrivate.length; n++) e.taskListPrivate[n].categoryId = t, e.taskListPrivate[n].tasksMap = null, e.taskListPrivate[n].tasksMap = {}, e.taskListPrivate[n].taskIds = [], e.taskListPrivate[n].selected = [];
                    c.default.setCurrentCategoryId(t)
                }
            }, UPDATE_DOWNLOADING_TASKLIST(e, t) {
                if (t.length > 0) {
                    let n = 0, i = e.taskList[n];
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[n]), i.taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_COMPLETED_TASKLIST(e, t) {
                if (t.length > 0) {
                    let n = 1, i = e.taskList[n];
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[n]), i.taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_RECYCLE_TASKLIST(e, t) {
                t.length > 0 && -1 === e.currentCategoryId && e.taskList[2].taskIds.splice(0, t.length, ...t)
            }
        }, C = {
            attachTaskEvent({commit: e}) {
                p.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_INFO", n)
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskUserRead, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskUserRead) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_READED", n)
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovingStateChange, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovingStateChange) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_MOVING_STATE_CHANGE", n)
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                        if (!t[1] || !t[2]) break;
                        let n = t[1];
                        if (t[2].length > 0) break;
                        let i = g.getTaskFromTaskId(n);
                        if (!i) break;
                        e("UPDATE_TASK_INFO", [i.getTaskBaseInfo()])
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskRenamed, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskRenamed) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_RENAME", n)
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovedEnd) break;
                        if (!t[1]) break;
                        let n = t[1], i = [];
                        for (let e of n) null !== e && i.push(e.getTaskBaseInfo());
                        i.length > 0 && e("UPDATE_TASK_MOVED", i)
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                        if (!t[1]) break;
                        let n = t[1], i = [];
                        for (let e of n) null !== e && i.push(e.getTaskBaseInfo());
                        i.length > 0 && e("UPDATE_TASK_MOVED", i)
                    } while (0)
                }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                        if (void 0 === t[1] || !t[2] || !t[3]) break;
                        let n = t[1], i = t[2], a = t[3].map(e => e.getTaskBaseInfo());
                        e("REMOVE_FROM_CATEGORY_VIEW", {categoryId: n, categoryViewId: i, tasks: a})
                    } while (0)
                })
            }
        }, S = {
            toolbarButtons: e => {
                let t = [];
                return -1 === e.currentCategoryId ? e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? t = d.DownloadToolbar.downloadingButtons : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? t = d.DownloadToolbar.completedButtons : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && (t = d.DownloadToolbar.recycleButtons) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? t = d.DownloadToolbar.privateDownloadingButtons : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed && (t = d.DownloadToolbar.privateCompletedButtons), t
            }, currentCategoryTaskCount: e => {
                let t = 0;
                return e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? t = e.taskList[0].taskIds.length : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].taskIds.length) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? t = e.taskList[1].taskIds.length : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[1].taskIds.length) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2].taskIds.length), t
            }, currentSelectdTaskInfos: e => {
                let t = [], n = null, i = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[0].categoryId && (n = e.taskListPrivate[0].tasksMap, i = e.taskListPrivate[0].selected) : (n = e.taskList[0].tasksMap, i = e.taskList[0].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[1].categoryId && (n = e.taskListPrivate[1].tasksMap, i = e.taskListPrivate[1].selected) : (n = e.taskList[1].tasksMap, i = e.taskList[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (n = e.taskList[2].tasksMap, i = e.taskList[2].selected), null !== n) for (let e of i) void 0 !== n[e] && null !== n[e] ? t.push(n[e]) : f.information("selected taskbase undefined", e);
                return t
            }, downloadingSelectedIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[0].selected : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].selected), t
            }, completedSelectedTaskIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[1].selected : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1].selected), t
            }, recycleSelectedTaskIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId && (t = e.taskList[2].selected), t
            }, downloadingTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[0].taskIds : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].taskIds), t
            }, completedTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[1].taskIds : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1].taskIds), t
            }, recycleTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId && (t = e.taskList[2].taskIds), t
            }, downloadingOrder: e => {
                return e.taskList[0].taskIds
            }, canStartAll: e => {
                let t = !0;
                {
                    let n = e.taskList[0].tasksMap;
                    for (let e in n) {
                        if (n[e].isMoving) {
                            t = !1;
                            break
                        }
                    }
                }
                return t
            }, downloadingTaskBaseList: e => {
                let t = [], n = {};
                return -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[0].categoryId && (n = e.taskListPrivate[0].tasksMap) : n = e.taskList[0].tasksMap, t = [...Object.values(n)]
            }, completedTaskBaseList: e => {
                let t = [], n = {};
                return -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[1].categoryId && (n = e.taskListPrivate[1].tasksMap) : n = e.taskList[1].tasksMap, t = [...Object.values(n)]
            }, recycleTaskBaseList: e => {
                let t = [], n = {};
                return -1 === e.currentCategoryId && (n = e.taskList[2].tasksMap), t = [...Object.values(n)]
            }
        };
    t.default = {state: T, mutations: v, actions: C, getters: S}
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(105), s = n(148), l = n(32), u = n(85), d = n(195), c = n(126), h = n(13),
        f = n(253), g = n(132), p = c.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        k = a.default.getLogger("DownloadToolbar"), m = l.DownloadKernelTaskManager.getTaskManager();
    let T = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_newtask_click"), h.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=dltab_menu"), r.ThunderNewTask.createPreNewTaskWindow(null)
    }, v = () => "", C = (e, t, n, i) => {
        let a = "";
        return i && (a = "is-disabled"), a
    }, S = (e, t) => {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.startTasks(i) : k.error("toolbar start tasks but not in downloading category")
    }, y = (e, t, n, i) => {
        let a = "is-disabled";
        return !i && s.TaskStatusHelper.canStartSelectedTask(t, n) && (a = ""), a
    }, w = (e, t) => {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.pauseTasks(i, o.DownloadKernel.TaskStopReason.ToolbarButton) : k.error("toolbar pause tasks but not in downloading category")
    }, I = (e, t, n, i) => {
        let a = "is-disabled";
        return !i && s.TaskStatusHelper.canStopSelectedTask(t, n) && (a = ""), a
    }, b = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let n = t.currentSelectdTaskInfos, i = !1;
        e.shiftKey && (i = !0), i ? u.TaskOperatorNs.destroyTasks(n) : u.TaskOperatorNs.deleteTasks(n)
    }, A = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let n = t.currentSelectdTaskInfos;
        u.TaskOperatorNs.destroyTasks(n)
    }, N = (e, t, n, i) => {
        let a = "is-disabled";
        return !i && s.TaskStatusHelper.canDeleteSelectedTask(t, n) && (a = ""), a
    }, D = (e, t) => i(this, void 0, void 0, function* () {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        do {
            if (n === o.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== i.length) break;
            let e = i[0].taskType;
            if (e === o.DownloadKernel.TaskType.Bt) {
                let e = m.getTaskFromTaskId(i[0].taskId);
                (yield g.SingleBtTaskNS.isSingleBtTask(e)) ? yield u.TaskOperatorNs.openTaskItem(i[0]) : yield u.TaskOperatorNs.openTaskFolder(i[0], !0)
            } else if (e === o.DownloadKernel.TaskType.Group) if (n === o.DownloadKernel.CategroyViewID.Completed) {
                let e = m.getTaskFromTaskId(i[0].taskId);
                (yield u.TaskOperatorNs.executeInstallFile(e)) || (yield u.TaskOperatorNs.openTaskFolder(i[0], !0))
            } else yield u.TaskOperatorNs.openTaskFolder(i[0], !0); else {
                let e = "";
                n === o.DownloadKernel.CategroyViewID.Completed ? e = "finished" : n === o.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), yield u.TaskOperatorNs.openTaskItem(i[0], void 0, void 0, e)
            }
            n === o.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(i, 1)
        } while (0)
    }), _ = (e, t) => i(this, void 0, void 0, function* () {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        do {
            if (n === o.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== i.length) break;
            yield u.TaskOperatorNs.openTaskFolder(i[0]), n === o.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(i, 1)
        } while (0)
    }), x = (e, t, n, a) => i(this, void 0, void 0, function* () {
        let e = "is-disabled";
        do {
            if (a || t !== o.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === n.length) {
                if (!(yield d.TaskCtrlOperatorNS.canOpenSelectedTaskFile(n[0]))) break;
                e = ""
            }
        } while (0);
        return e
    }), E = (e, t, n, a) => i(this, void 0, void 0, function* () {
        let e = "is-disabled";
        do {
            if (a || t !== o.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === n.length) {
                if (!(yield d.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(n[0]))) break;
                e = ""
            }
        } while (0);
        return e
    }), P = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_undo_click"), k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.recoverTask(i)
    }, M = (e, t) => {
        k.verbose(e), h.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.destroyTasks(i)
    }, F = (e, t, n, i) => {
        k.verbose(t);
        let a = "is-disabled";
        return !i && n.length > 0 && (a = ""), a
    }, O = () => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_clear_click"), u.TaskOperatorNs.clearRecycle()
    }, U = (e, t, n, i) => {
        let a = p.getCategoryViewFromId(o.DownloadKernel.CategroyViewID.Recycle).getTasks().size, r = "is-disabled";
        return !i && a > 0 && (r = ""), r
    }, L = (e, t, n, i) => {
        let a = "";
        return i && (a = "is-disabled"), a
    }, B = (e, t) => i(this, void 0, void 0, function* () {
        const {VipDownloadPlugin: t} = yield Promise.resolve().then(() => n(52));
        let i = encodeURIComponent("referfrom=v_pc_xlx_ggong_taskbar_vip");
        h.XLStatNS.trackEvent("download_leftpanel", "top_vipicon_click", "", 0, 0, 0, 0, i), k.verbose(e), t.clickToolbarVipBtn()
    }), K = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_more_click"), k.information("open more"), k.verbose(e), f.downloadContextMenu.setContextInfo(t, t.currentCategoryId), f.downloadContextMenu.popMenu(f.DownloadMenuType.ToolbarMore).catch()
    }, V = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_private_setting_click"), f.downloadContextMenu.setContextInfo(t, t.currentCategoryId), f.downloadContextMenu.popMenu(f.DownloadMenuType.PrivateSpaceHome).catch()
    };
    !function (e) {
        e.downloadingButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: y}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: w,
            filterClass: I
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: b, filterClass: N}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: K,
            filterClass: C
        }], e.completedButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: D, filterClass: x}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: _,
            filterClass: E
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: b, filterClass: N}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: K,
            filterClass: C
        }], e.recycleButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-restore", title: "还原", onClick: P, filterClass: F}, {
            id: "xlx-icon-nav-clear",
            title: "彻底删除",
            onClick: M,
            filterClass: F
        }, {id: "xlx-icon-nav-rubbish", title: "清空垃圾箱", onClick: O, filterClass: U}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: K,
            filterClass: C
        }], e.privateDownloadingButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: y}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: w,
            filterClass: I
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: A, filterClass: N}, {
            id: "xlx-icon-nav-home",
            title: "私人空间设置",
            onClick: V,
            filterClass: L
        }], e.privateCompletedButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: D, filterClass: x}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: _,
            filterClass: E
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: A, filterClass: N}, {id: "xlx-icon-nav-home", title: "私人空间设置", onClick: V, filterClass: L}]
    }(t.DownloadToolbar || (t.DownloadToolbar = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.contextMenuDownloadImportUncomplete = "context_menu_download_import_uncompleted", e.contextMenuDownloadFolder = "context_menu_download_folder", e.contextMenuGroupAccelerate = "context_menu_group_accelerate", e.contxtMenuSubtitleSearch = "context_menu_subtitle_search", e.contextMenuDownloadStart = "context_menu_download_start", e.contextMenuDownloadPause = "context_menu_download_pause", e.contextMenuDownloadStartAll = "context_menu_download_start_all", e.contextMenuDownloadPauseAll = "context_menu_download_pause_all", e.contextMenuDownloadDelete = "context_menu_download_delete", e.contextMenuDownloadDestroy = "context_menu_download_destroy", e.contextMenuDownloadMoveFilePrivateSpace = "context_menu_download_move_file_private_space", e.contextMenuDownloadMoveFileOutPrivateSpace = "context_menu_download_move_file_out_private_space", e.contextMenuDownloadMoveFileOther = "context_menu_download_move_file_other", e.contextMenuDownloadMoveFileLastest = "context_menu_download_move_file_lastest", e.contextMenuDownloadMoveTop = "context_menu_download_move_top", e.contextMenuDownloadMoveBottom = "context_menu_download_move_bottom", e.contextMenuDownloadMerge = "context_menu_download_merge", e.contextMenuDownloadVipAcc = "context_menu_download_vip_acc", e.contextMenuDownloadCopyLink = "context_menu_download_copy_link", e.contextMenuDownloadTorrentSaveAs = "context_menu_download_torrent_save_as", e.contextMenuDownloadCopyMagnet = "context_menu_download_copy_magnet", e.contextMenuDownloadFile = "context_menu_download_file", e.contextMenuDownloadRename = "context_menu_download_rename", e.contextMenuDownloadCopyFileLastest = "context_menu_download_copy_file_lastest", e.contextMenuDownloadCopyFileOther = "context_menu_download_copy_file_other", e.contextMenuDownloadRedownload = "context_menu_download_redownload", e.contextMenuDownloadRecover = "context_menu_download_recover", e.contextMenuDownloadClear = "context_menu_download_clear", e.contextMenuDownloadByShoulei = "context_menu_download_shoulei", e.contextMenuDownloadSelectAll = "context_menu_download_select_all", e.contextMenuDownloadDeleteNonexisting = "context_menu_download_delete_non_existing", e.contextMenuDownloadAsReadedAll = "context_menu_download_as_readed_all", e.contextMenuToolbarMoreOpenSearch = "context_menu_toolbar_more_opensearch", e.contextMenuToolbarMoreOpenHelp = "context_menu_toolbar_more_openhelp", e.contextMenuToolbarMoreDestroy = "context_menu_toolbar_more_destroy", e.contextMenuToolbarMoreConfig = "context_menu_toolbar_more_config", e.contextMenuToolbarMoreSortByDefault = "context_menu_toolbar_more_sort_default", e.contextMenuToolbarMoreSortByTime = "context_menu_toolbar_more_sort_time", e.contextMenuToolbarMoreSortByType = "context_menu_toolbar_more_sort_type", e.contextMenuToolbarMoreSortByName = "context_menu_toolbar_more_sort_name", e.contextMenuToolbarMoreSortBySize = "context_menu_toolbar_more_sort_size", e.contextMenuToolbarMoreSortByStatus = "context_menu_toolbar_more_sort_status", e.contextMenuToolbarMoreSortByProgress = "context_menu_toolbar_more_sort_progress", e.contextMenuTabChangeCategoryMyComputer = "context_menu_tab_change_category_mycomputer", e.contextMenuTabChangeCategoryPrivateSpace = "context_menu_tab_change_category_privatespace", e.contextMenuToolbarPrivateSpaceSelectAll = "context_menu_toolbar_privatespace_select_all", e.contextMenuToolbarPrivateSpaceDownloadSetting = "context_menu_toolbar_privatespace_download_setting", e.contextMenuToolbarPrivateSpacePasswwordChange = "context_menu_toolbar_privatespace_passwword_change", e.contextMenuToolbarPrivateSpaceTaskManager = "context_menu_toolbar_privatespace_download_task_manager", e.contextMenuOpenTaskPosition = "context_menu_search_openfile_position"
    }(t.ContextMenuIdsNS || (t.ContextMenuIdsNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        ON_MOUNTED(e, t) {
            e.homePageUrl = t
        }
    };
    t.default = {state: {homePageUrl: ""}, mutations: i, actions: {}}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(870), o = i.default.getLogger("CommunityStore"), r = [6, 8, 10], s = [7, 9, 11];
    o.verbose("enter");
    const l = {
        SET_UNREAD_NUMS(e, t) {
            e.unreadNums = Object.assign({}, e.unreadNums, t)
        }, SET_SHOW_MESSAGE_BUTTON(e, t) {
            e.showMessageButton = t
        }, SET_UNREAD_MESSAGES(e, t) {
            e.messages = t
        }, SET_UNREAD_STARS(e, t) {
            e.stars = t
        }, SET_CHAT_MSGS(e, t) {
            o.information("SET_CHAT_MSGS", Object.assign({}, e.chatMsgs)), e.chatMsgs = e.chatMsgs.concat(t)
        }, RESET_CHATS_NUM(e) {
            e.chatMsgs = []
        }, SET_USERS_INFO(e, t) {
            e.chatUsersInfo[t.uid || "0"] = t, o.information(" state.chatUsersInfo", e.chatUsersInfo), e.chatUserId = t.uid || 0
        }, SET_CHATS_NUM(e, t) {
            e.unreadNums.chat = t
        }, SET_MINE_ID(e, t) {
            e.mineId = t
        }
    }, u = {
        getUnreadNums: ({commit: e, state: t, rootState: n}, i) => (o.information("getUnreadNums"), a.getUnreadMsgNum(i).then(n => {
            n.error || "ok" !== n.data.result || (o.information("获取未读数消息", n), e("SET_UNREAD_NUMS", {
                star: n.data.aggregation,
                comment: n.data.comment,
                chat: t.unreadNums.chat
            }))
        }).catch(e => {
            o.information("getUnreadNums error")
        })),
        getUnreadNoticeNum: ({commit: e, state: t, rootState: n}, i) => (o.information("getUnreadNoticeNum"), a.getUnreadNoticeNum(i).then(t => {
            o.information("获取未读系统通知数", t), t.error || "ok" !== t.data.result || e("SET_UNREAD_NUMS", {notice: t.data.count})
        }).catch(e => {
            o.information("getUnreadNoticeNum error")
        })),
        getUnreadMessages: ({commit: e, state: t, rootState: n}, i) => a.getUnreadMsgs(i, 0).then(t => {
            o.information("获取未读消息内容，评论/回复", t);
            let n = [];
            if (!t.error && "ok" === t.data.result) {
                let i = 0;
                for (let e = 0; e < t.data.messages.length; e++) !t.data.messages[e].have_read && r.includes(t.data.messages[e].type) && (n[i] = {
                    msgType: t.data.messages[e].type,
                    userId: t.data.messages[e].initiator,
                    userName: t.data.messages[e].initiator_name,
                    userAvatar: t.data.messages[e].initiator_portrait,
                    messageContent: t.data.messages[e].reply,
                    msgid: t.data.messages[e].msgid,
                    res: t.data.messages[e].cinecism,
                    createTime: t.data.messages[e].insert_time
                }, i++);
                o.information("messages--", n), n.length > 0 && e("SET_UNREAD_MESSAGES", n)
            }
        }).catch(e => {
            o.information("getUnreadMessages error")
        }),
        getUnreadStars: ({commit: e, state: t, rootState: n}, i) => a.getStarsMsg(i, 0).then(t => {
            o.information("获取点赞的消息内容", t);
            let n = [];
            if (!t.error && "ok" === t.data.result) {
                let i = 0;
                for (let e = 0; e < t.data.messages.length; e++) !t.data.messages[e].have_read && s.includes(t.data.messages[e].type) && (n[i] = {
                    msgType: t.data.messages[e].type,
                    userId: t.data.messages[e].initiator,
                    userName: t.data.messages[e].initiator_name,
                    userAvatar: t.data.messages[e].initiator_portrait,
                    messageContent: t.data.messages[e].original,
                    res: t.data.messages[e].cinecism,
                    msgid: t.data.messages[e].msgid,
                    createTime: t.data.messages[e].insert_time
                }, i++);
                o.information("messages--", n), n.length > 0 && e("SET_UNREAD_STARS", n)
            }
        }).catch(e => {
            o.information("getUnreadStars error")
        }),
        getUserInfo: ({commit: e, state: t, rootState: n}, i) => (o.information("getUserInfo", i), void 0 !== t.chatUsersInfo[i] ? (o.information("用户信息已存在"), Promise.resolve({data: {result: "ok"}})) : a.getUserInfo(i).then(t => (o.information("getUserInfo....", t), t.error || "ok" !== t.data.result || (o.information("getUserInfo....", t.data.user_info), e("SET_USERS_INFO", t.data.user_info)), t)).catch(e => {
            o.information("getUserInfo error")
        })),
        getUserSessionList: ({commit: e, state: t, rootState: n}, i) => a.getUserSessionList(i).then(n => {
            if (o.information("获取用户会话列表", n), !n.error && "ok" === n.data.result) {
                let a = 0, r = [];
                o.information("getUserSessionList userId: ", i, ", sessions:", n.data.sessions);
                for (let e = 0; e < n.data.sessions.length; e++) o.information("mineId--", t.mineId), n.data.sessions[e].user_id === t.mineId || r.includes(n.data.sessions[e].record.sender) || (a += n.data.sessions[e].unread, r.push(n.data.sessions[e].record.sender));
                a > 0 && e("SET_CHATS_NUM", a), o.information("私信未读数 chatNum", a)
            }
        }).catch(e => {
            o.information("getUserSessionList error")
        })
    }, d = {
        totalUnread(e, t, n) {
            let {star: i, comment: a, notice: o, chat: r} = e.unreadNums;
            return i + a + o + r
        }, UnreadMsgsLen: (e, t, n) => e.messages.length + e.stars.length + e.chatMsgs.length
    };
    t.default = {
        state: {
            unreadNums: {star: 0, comment: 0, notice: 0, chat: 0},
            showMessageButton: !0,
            messages: [],
            stars: [],
            chatUserId: 0,
            chatMsgs: [],
            chatUsersInfo: {},
            mineId: 0
        }, mutations: l, actions: u, getters: d
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(92);
    t.getUnreadMsgNum = function (e) {
        return i.fetchSlRes({url: "/msgcenter/unread_info_v3", data: {userid: e, "Chat-Version": 4}})
    }, t.getUnreadNoticeNum = function (e) {
        return i.fetchSlRes({url: "/msgcenter/pc/unread_count", data: {user_id: e, "Chat-Version": 4}})
    }, t.getUnreadMsgs = function (e, t, n, a) {
        return i.fetchSlRes({
            url: "/msgcenter/query_comment_v3",
            data: {userid: e, "Chat-Version": 4, reset_read_status: t, cursor: n, size: a}
        })
    }, t.getStarsMsg = function (e, t, n, a) {
        return i.fetchSlRes({
            url: "/msgcenter/query_star_v3",
            data: {userid: e, "Chat-Version": 4, reset_read_status: t, cursor: n, size: a}
        })
    }, t.getUserInfo = function (e) {
        return i.fetchSlRes({url: "/user_info/pc_info", data: {uid: e}})
    }, t.getUserSessionList = function (e, t = 60) {
        return i.fetchSlRes({url: "/chitchat/sessions", data: {uid: e, limit: t}})
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        SHOW_PRIVATE_SPACE_OPEN_PAGE(e, t) {
            e.showPrivateSpaceOpenPage = t
        }
    };
    t.default = {state: {showPrivateSpaceOpenPage: !1}, mutations: i, actions: {}, getters: {}}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        SHOW_UPGRADE_TASK(e, t) {
            e.showUpgradeTask !== t && (e.showUpgradeTask = t)
        }
    };
    t.default = {state: {showUpgradeTask: !1}, mutations: i, actions: {}, getters: {}}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(17), a = n(2), o = n(25), r = n(4), s = n(1).default.getLogger("book-marks-store"), l = n(93),
        u = a.join(__profilesDir, "XLBrowserApp", "bookmarks"), d = 1, c = {
            ADD_BOOK_MARKS_ITEM(e, t) {
                e.bookMarks = Object.assign({}, e.bookMarks, t);
                let n = JSON.stringify(e.bookMarks);
                o.ConfigNS.setValue("book-marks-section", "book-marks-key", n)
            }, REMOVE_BOOK_MARKS_ITEM(e, t) {
                if (s.information("REMOVE_BOOK_MARKS_ITEM", t), void 0 !== e.bookMarks[t]) {
                    s.information("delete state.bookMarks", e.bookMarks), r.Vue.delete(e.bookMarks, t);
                    let n = JSON.stringify(e.bookMarks);
                    o.ConfigNS.setValue("book-marks-section", "book-marks-key", n)
                }
            }, SET_BOOK_MARKS_STATE(e, t) {
                e.bookMarks = t
            }, UPDATE_BOOK_MARKS_ICONURL(e, t) {
                for (let n in e.bookMarks) {
                    let i = e.bookMarks[n];
                    if (i.url === t.url) {
                        i.iconUrl = t.iconUrl;
                        let n = JSON.stringify(e.bookMarks);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", n)
                    }
                }
            }
        }, h = {
            initBookMarks: ({commit: e, state: t, rootState: n}) => new Promise((e, t) => {
                let n = o.ConfigNS.getValue("book-marks-section", "book-marks-key", "/");
                if ("/" !== n) try {
                    let i = JSON.parse(n);
                    e(i)
                } catch (e) {
                    t(new Error("JSON parse book marks error"))
                } else i.readFile(`${u}`, "utf8", (n, i) => {
                    if (n) s.information("读取书签文件出错,书签路径..", u), t(new Error("read book marks file error")); else try {
                        let t = function (e) {
                            if (void 0 === l(e, "roots", "bookmarkbar", "itemlist")) return {};
                            let t = l(e, "roots", "bookmarkbar", "itemlist");
                            s.information("bookMarkItemList", t);
                            let n = {};
                            for (let e = 0; e < t.length; e++) l(t[e], "bmType") === d && void 0 === n[l(t[e], "url")] ? n[l(t[e], "url")] = {
                                url: l(t[e], "url"),
                                name: l(t[e], "name"),
                                iconUrl: l(t[e], "iconUrl") || ""
                            } : f(t[e], n);
                            return n
                        }(JSON.parse(i)), n = JSON.stringify(t);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", n), e(t)
                    } catch (e) {
                        s.information("book marks data parse error")
                    }
                })
            }).then(t => {
                e("SET_BOOK_MARKS_STATE", t)
            }).catch(e => {
                s.information("初始化书签数据失败")
            })
        };

    function f(e, t) {
        let n = l(e, "itemlist");
        for (let e = 0; e < n.length; e++) l(n[e], "bmType") === d && void 0 === t[l(t[e], "url")] ? t[l(n[e], "url")] = {
            url: l(n[e], "url"),
            name: l(n[e], "name")
        } : f(n[e], t)
    }

    t.default = {state: {bookMarks: {}}, mutations: c, actions: h}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(24), o = i.default.getLogger("groupStore"), r = {
        SET_GROUP_DATA(e, t) {
            e.all = t
        }
    }, s = {
        getGroupData: ({commit: e, state: t, rootState: i}) => (a.default.defaults.adapter = n(22), a.default.get("http://static-xl9-ssl.xunlei.com/json/group_data.json").then(t => {
            o.information(t), null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && e("SET_GROUP_DATA", t.data)
        }).catch(e => {
            o.information("getGroupData Error", e)
        }))
    };
    t.default = {state: {all: {}}, mutations: r, actions: s}
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(300);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\system-buttons-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(676), a = n(302);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(879);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\system-buttons.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(304);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\message-button-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(692), a = n(306);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\message-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1177);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(308);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\tabs-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(675), a = n(310);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(885);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\tabs.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(12), o = n(8), r = n(23), s = n(148), l = n(564), u = n(32), d = n(73), c = n(34),
        h = i.default.getLogger("tabs-cue"), f = u.DownloadKernelTaskManager.getTaskManager(),
        g = c.DownloadKernelEventManager.getEventManager();
    const p = new class {
        constructor() {
            this.enable = !1
        }

        enableTrack(e) {
            h.information("enableTrack", e), this.enable = e
        }

        getCurTasksStatus(e) {
            let t = l.DownloadProgressNS.getDownloadDetails(), n = !1, i = "";
            if (1 === t.downloadingTaskIds.length) {
                let e = t.downloadingTaskIds[0], i = f.getTaskFromTaskId(e);
                void 0 !== s.TaskStatusHelper.getTaskStartStatusPrompt(i.getTaskBaseInfo()) && (n = !0)
            }
            if (n) ; else if (t.progress >= 0) {
                let e = d.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1);
                i = a.ThunderUtil.formatSize(e, 1) + "/s"
            }
            h.information(n, t.progress, i), e(n, t.progress, i)
        }

        track(e, t, n, i) {
            d.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                do {
                    if (!this.enable) {
                        h.information("in downloading tab not cue", this.enable);
                        break
                    }
                    this.getCurTasksStatus(t)
                } while (0)
            }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!this.enable) break;
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let a = t[e];
                        if (!a) continue;
                        if (a.getTaskAttribute(o.DownloadKernel.TaskAttribute.GroupTaskId) > 0) continue;
                        if (a.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        if (-1 !== a.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) continue;
                        let r = a.getTaskStatus();
                        r === o.DownloadKernel.TaskStatus.Succeeded ? n() : r === o.DownloadKernel.TaskStatus.Failed && (h.information("cue task fail"), i())
                    }
                } while (0)
            }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCreated, (...t) => {
                do {
                    if (!this.enable) break;
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.TaskCreated) break;
                    let n = t[1];
                    if (!n) break;
                    if (n[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) break;
                    if (-1 !== n[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) {
                        h.information("private does not cue");
                        break
                    }
                    h.information("cue task new", n.length), e(n.length)
                } while (0)
            })
        }
    };
    !function (e) {
        e.enableTrack = function (e) {
            p.enableTrack(e)
        }, e.getCurTasksStatus = function (e) {
            p.getCurTasksStatus(e)
        }, e.track = function (e, t, n, i) {
            p.track(e, t, n, i)
        }
    }(t.DownloadingTabCueNS || (t.DownloadingTabCueNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(685), a = n(312);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(884);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\tabs-spring-festival.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1179);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1181);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(314);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\message-tips-containner.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(682), a = n(316);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\message-tips.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(318);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\book-marks-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(684), a = n(320);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\book-marks.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(690), a = n(322);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\book-marks-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1183);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(324);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(671), a = n(326);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(681), a = n(328);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(330);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(691), a = n(332);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(334);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(701), a = n(336);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(338);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-button-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(708), a = n(340);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(342);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-vip-button-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(707), a = n(344);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-vip-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(5), o = n(13), r = n(24), s = n(2), l = n(10), u = n(194),
        d = n(1).default.getLogger("DownloadPanel.ToolBarVipButton");

    class c {
        constructor() {
            this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0, this.mVipData = null
        }

        get vasType() {
            return this.mVasType
        }

        get vipLevel() {
            return this.mVipLevel
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPlatinumVip() {
            return this.isVip && this.mVasType > 2
        }

        get isSuperVip() {
            return this.isVip && 5 === this.mVasType
        }

        get vipData() {
            return this.mVipData
        }

        getSessionId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (t, n) => {
                        0 === t && (this.mSessionId = n), e(this.mSessionId || "0")
                    }) : e(this.mSessionId || "0")
                })
            })
        }

        getPeerId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetPeerID", (t, n) => {
                        0 === t && n && "" !== n && (this.mPeerId = n), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getUserinfo() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetAllUserInfo", (n, i) => {
                        0 === n && (t = i), e(t)
                    }) : e(t)
                })
            })
        }

        parseUserInfo() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (e) if (this.mIsLogin = !0, this.mUserId = e.userID || "0", e.vipList && e.vipList[0]) {
                    if (e.vipList[0].isVip) {
                        let t = Number(e.vipList[0].isVip).valueOf();
                        this.mIsVip = t > 0
                    } else this.mIsVip = !1;
                    e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf()), this.mVipData = e.vipList[0]
                } else this.mIsVip = !1
            })
        }

        onLogin() {
            return i(this, void 0, void 0, function* () {
                this.clear(), yield this.parseUserInfo()
            })
        }

        onLogout() {
            this.clear()
        }

        clear() {
            this.mUserId = "0", this.mSessionId = void 0, this.mIsVip = !1, this.mIsLogin = !1, this.mVasType = 0, this.mVipLevel = 0
        }
    }

    t.UserHelper = c;
    t.VipIconMgr = class {
        constructor(e) {
            this.mVueObj = null, this.mVipIconData = null, this.mModel = "b", this.mUserHelper = null, this.mUsedDLVipCache = null, this.mUpdateType = "", this.mIsFirstLoad = !0, this.mVueObj = e, this.mUserHelper = new c
        }

        init() {
            return i(this, void 0, void 0, function* () {
                try {
                    r.default.defaults.adapter = n(22), r.default.get("http://act.vip.xunlei.com/vip/2018/ssi/vipiconData.js", {timeout: 1e4}).then(e => i(this, void 0, void 0, function* () {
                        if (a.NativeCallModule.nativeCall && null !== e && 200 === e.status && null !== e.data && "string" == typeof e.data.atestuids) {
                            this.mVipIconData = e.data.btpl;
                            let t = yield this.mUserHelper.getPeerId();
                            d.information(`init: peerid=${t},ipData.data.atestuids=${e.data.atestuids}`), "" !== t && 16 === t.length && -1 !== e.data.atestuids.toLowerCase().indexOf(t.toLowerCase()[11]) && (this.mVipIconData = e.data.atpl, this.mModel = "a"), this.attachUserEvents(), this.updateUI().catch()
                        } else this.sendStat("download_leftpanel", "top_vipicon_show")
                    })).catch(e => {
                        d.warning(e)
                    })
                } catch (e) {
                    d.information(e)
                }
            })
        }

        sendStat(e, t, n = "") {
            let i = 0;
            this.mUserHelper.isLogin && (i = 5 === this.mUserHelper.vasType ? 5 : this.mUserHelper.vasType > 2 ? 3 : 2);
            let a = "";
            "newuser" === this.mUpdateType ? a = "new" : "inner15" === this.mUpdateType ? a = "expire_1_15" : "out15" === this.mUpdateType && (a = "expire_15+");
            let r = `is_red=${this.mVueObj.hasRedPoint ? 1 : 0},is_login=${this.mUserHelper.isLogin ? 1 : 0},is_vip=${this.mUserHelper.isVip ? 1 : 0},user_type=${a},vip_type=${i},test_type=${this.mModel}`;
            "" !== n && (r = `${r},${n}`), d.information(`sendStat: event=${e}, attr1=${t}, statExtData=${r}`), r = encodeURIComponent(r), o.XLStatNS.trackEvent(e, t, "", 0, 0, 0, 0, r)
        }

        updateUIDefault() {
            this.mVueObj.cfgType = "", this.mVueObj.hasRedPoint = !1, this.mVueObj.clickUrl = "https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip", this.mVueObj.vipIcon = "", this.mVueObj.hoverTitle = ""
        }

        updateUI() {
            return i(this, void 0, void 0, function* () {
                if (yield this.isLogin()) if (yield this.mUserHelper.onLogin(), this.mUserHelper.isVip) {
                    let e = "vip", t = "LastLink_PlatinumVip_" + String(this.mUserHelper.userId);
                    this.mUserHelper.isSuperVip && (e = "super", t = "LastLink_SuperVip_" + String(this.mUserHelper.userId)), this.updateUIPrivate(e, t)
                } else {
                    null === this.mUsedDLVipCache && (this.mUsedDLVipCache = {});
                    let e = () => {
                        if (0 === this.mUsedDLVipCache[this.mUserHelper.userId] || 2 === this.mUsedDLVipCache[this.mUserHelper.userId]) this.updateUIPrivate("newuser", "LastLink_Newuser_" + String(this.mUserHelper.userId)); else {
                            let e = "inner15", t = "LastLink_Inner15_" + String(this.mUserHelper.userId);
                            15 < this.calculateExpireDate() && (e = "out15", t = "LastLink_Out15_" + String(this.mUserHelper.userId)), this.updateUIPrivate(e, t)
                        }
                    };
                    if (void 0 === this.mUsedDLVipCache[this.mUserHelper.userId]) try {
                        let t = yield this.mUserHelper.getSessionId();
                        this.queryUsedToBeDLVip(this.mUserHelper.userId, t).then(t => {
                            null !== t && 200 === t.status && null !== t.data && 1 === t.data.code && null !== t.data.result && void 0 !== t.data.result.usedToBeDLVip ? (this.mUsedDLVipCache[this.mUserHelper.userId] = Number(t.data.result.usedToBeDLVip).valueOf(), e()) : this.updateUIDefault()
                        }).catch(e => {
                            d.warning(e), this.updateUIDefault()
                        })
                    } catch (e) {
                        d.information(e), this.updateUIDefault()
                    } else e()
                } else this.mIsFirstLoad ? (this.mIsFirstLoad = !1, setTimeout(() => i(this, void 0, void 0, function* () {
                    (yield this.isLogin()) || this.updateUIPrivate("visitor", "LastLink_UnLogin")
                }), 3e3)) : this.updateUIPrivate("visitor", "LastLink_UnLogin")
            })
        }

        calculateExpireDate() {
            if (!this.mUserHelper.vipData || !this.mUserHelper.vipData.expireDate) return 0;
            let e, t, n;
            e = this.mUserHelper.vipData.expireDate.substring(0, 4), t = this.mUserHelper.vipData.expireDate.substring(4, 6), n = this.mUserHelper.vipData.expireDate.substring(6, 8);
            let i = new Date(e + "-" + t + "-" + n + " 00:00:00").getTime() / 1e3, a = new Date(Date.now()),
                o = a.getFullYear(), r = a.getMonth(), s = a.getDate(),
                l = (a = new Date(o + "-" + (r < 10 ? "0" + (r + 1) : r + 1) + "-" + (s < 10 ? "0" + s : s) + " 00:00:00")).getTime() / 1e3;
            return Math.ceil((l - i) / 86400)
        }

        updateUIPrivate(e, t) {
            d.information(`updateUIPrivate: updateType=${e}, cfgType=${t}`), this.mUpdateType = e;
            let n = Date.now(), o = n;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].online && (o = new Date(this.mVipIconData[e].online).getTime());
            let r = n;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].offline && (r = new Date(this.mVipIconData[e].offline).getTime()), d.information("updateUIPrivate, curDate=" + String(n) + ", onlineDate=" + String(o) + ", offlineDate=" + String(r)), o >= n || n >= r || a.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "ToolBarButtonVipIcon", t, "", (n, a) => i(this, void 0, void 0, function* () {
                let i = "";
                0 === n && (i = a);
                let o = this.mVueObj.clickUrl;
                this.mVipIconData && this.mVipIconData[e] && ("string" == typeof this.mVipIconData[e].xdslink && "" !== this.mVipIconData[e].xdslink ? o = this.mVipIconData[e].xdslink.trim() : "string" == typeof this.mVipIconData[e].link && "" !== this.mVipIconData[e].link && (o = this.mVipIconData[e].link.trim()));
                let r = "";
                r = "newuser" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_new" : "inner15" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_expire1" : "out15" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_over15" : "super" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip" : "vip" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip" : "v_pc_xlx_ggong_taskbar_nolog", r += "_", r += this.mModel, -1 === o.toLowerCase().indexOf("referfrom") && (o = -1 === o.indexOf("?") ? `${o}?referfrom=${r}` : `${o}&referfrom=${r}`), this.mVueObj.clickUrl = o, this.mVueObj.cfgType = t, this.mVueObj.hasRedPoint = i !== o;
                let c = "";
                this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].xdsicon && (c = this.mVipIconData[e].xdsicon);
                let h = s.resolve(__profilesDir, "VipDownload/vipicon");
                if ((yield l.FileSystemAWNS.mkdirsAW(h)) && "" !== c) {
                    let e = s.basename(c), t = s.join(h, e), n = c, i = String(1e6 * Math.random()).valueOf();
                    n.indexOf("?") >= 0 ? n += "&rd=" + i : n += "?rd=" + i, u.AxiosNS.downloadFileAW(n, t).then(n => {
                        d.information("下载图片：result = ", n, ";fileName = ", e), this.mVueObj.vipIcon = n ? "file://" + t : ""
                    }).catch(e => {
                        d.warning(e), this.mVueObj.vipIcon = ""
                    })
                } else this.mVueObj.vipIcon = "";
                let f = "";
                this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].hover && (f = this.mVipIconData[e].hover), "" !== f && (this.mVueObj.hoverTitle = f), this.sendStat("download_leftpanel", "top_vipicon_show")
            }))
        }

        queryUsedToBeDLVip(e, t) {
            return i(this, void 0, void 0, function* () {
                let i = `http://soa.vip.xunlei.com/xlvip.common.mooseapi/querytags?userid=${e}&sessionid=${t}&tags=usedToBeDLVip&platform=xlx`;
                return r.default.defaults.adapter = n(22), r.default.get(i, {timeout: 1e4})
            })
        }

        isLogin() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (n, i) => {
                        0 === n && (t = i), e(t)
                    }) : e(t)
                })
            })
        }

        attachUserEvents() {
            a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                this.updateUI().catch()
            })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.mUserHelper.onLogout(), this.updateUI().catch()
            }), a.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => i(this, void 0, void 0, function* () {
                yield this.onUserInfoChange(e, t)
            })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                this.onLoginStatusChange(t)
            })
        }

        onUserInfoChange(e, t) {
            return i(this, void 0, void 0, function* () {
                d.information("vipicon --\x3eonUserInfoChange"), "vipinfo" === e && this.updateUI().catch(), d.information("<--onUserInfoChange")
            })
        }

        onLoginStatusChange(e) {
            d.information("vipicon --\x3eonLoginStatusChange", "newStatus", e), "offline" === e && (this.mUserHelper.onLogout(), this.updateUI().catch()), d.information("<--onLoginStatusChange")
        }
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(346);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\status-bar-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(702), a = n(348);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\status-bar.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(25), a = n(73), o = n(197);
    !function (e) {
        let t = 0, n = 0, r = "", s = 0, l = 0;

        function u() {
            let e = new Date;
            return e.getFullYear() + "." + (e.getMonth() + 1) + "." + e.getDate()
        }

        function d() {
            let e = !0;
            return u() === r && (e = !1), e
        }

        function c() {
            return i.ConfigNS.getValue("FlowMonitor", "DownloadSize", 0)
        }

        function h() {
            return i.ConfigNS.getValue("FlowMonitor", "UploadSize", 0)
        }

        function f(e, t) {
            i.ConfigNS.setValue("FlowMonitor", "DownloadSize", e), i.ConfigNS.setValue("FlowMonitor", "UploadSize", t), i.ConfigNS.setValue("FlowMonitor", "Date", u())
        }

        e.isDateChange = d, e.getDownloadSizeFromFile = c, e.getUploadSizeFromFile = h, e.setFlowData = f, e.startMonitor = function () {
            t = c(), n = h(), r = i.ConfigNS.getValue("FlowMonitor", "Date", ""), d() && (t = 0, n = 0, f(0, 0)), s = t, l = n, o.quitPromises.add(function () {
                return new Promise(e => {
                    f(s, l), i.ConfigNS.save().catch(), e(!0)
                })
            })
        }, e.getTodayDownloadSize = function () {
            let e = a.DownloadKernelManager.getTotalDownloadSize();
            return s = t + e
        }, e.getTodayUploadSize = function () {
            let e = a.DownloadKernelManager.getTotalUploadSize();
            return l = n + e
        }, e.getCurrentDownloadSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskDownloadSpeed(!1)
        }, e.getCurrentVipSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskVipSpeed(!1)
        }
    }(t.FlowMonitorNS || (t.FlowMonitorNS = {}))
}, function (e) {
    e.exports = {urls: [{url: "www.iqiyi.com"}, {url: "v.qq.com"}, {url: "www.youku.com"}, {url: "www.bilibili.com"}, {url: "www.pptv.com"}, {url: "www.youtube.com"}, {url: "tv.sohu.com"}, {url: "v.ifeng.com/film"}, {url: "www.mgtv.com"}, {url: "www.56.com"}, {url: "www.cctv.com"}, {url: "www.pps.tv"}, {url: "tv.sohu.com"}, {url: "www.tvb.com"}, {url: "www.wasu.cn"}, {url: "www.baomihua.com"}, {url: "www.1905.com"}, {url: "v.163.com"}, {url: "www.v1.cn"}, {url: "www.6.cn"}, {url: "www.tvbs.com.tw"}, {url: "www.tangdou.com"}, {url: "www.pipi.cn"}, {url: "www.360kan.com"}, {url: "www.le.com"}, {url: "v.baidu.com"}, {url: "www.tudou.com"}, {url: "www.douyu.com"}, {url: "www.huya.com"}, {url: "www.panda.tv"}, {url: "www.longzhu.com"}, {url: "www.zhanqi.tv"}, {url: "www.yy.com"}, {url: "www.huajiao.com"}]}
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(350);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\upgrade-task-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(703), a = n(352);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\upgrade-task.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(32), s = n(90), l = n(229), u = n(25), d = n(6),
        c = a.default.getLogger("PrivateSpace.Upgrade"), h = r.DownloadKernelTaskManager.getTaskManager(),
        f = s.DownloadKernelCategoryManager.getCategoryManager();

    class g {
        insertTaskToNewPrivateSpace(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1, a = yield l.TaskUtilitiesAWNS.batchFindTaskAW([n]);
                return (!a || a.length <= 0) && (c.information("insertTaskToNewPrivateSpace taskId:", t.getId(), ", findInfo:", n), i = h.moveCategoryTask(t.getId(), e.getId())), i
            })
        }

        getOldPrivateSpaceTaskList() {
            let e = [], t = f.getCategorys();
            for (let [, n]of t) {
                let t = n.getName(), i = n.getUserName();
                if ("Private" === t && "0" === i) {
                    let t = n.getCategoryViews();
                    for (let n = 0; n < t.length; n++) {
                        let i = t[n].getTasks();
                        for (let [, t]of i) e.push(t)
                    }
                }
            }
            return e
        }

        insertTaskListToNewPrivateSpace(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1, n = this.getOldPrivateSpaceTaskList();
                for (let i = 0; i < n.length; i++) {
                    let a = n[i], r = a.getType();
                    if (c.information("addTaskListToNewPrivateSpace taskType:", r), r === o.DownloadKernel.TaskType.P2sp) {
                        let n = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskUrl),
                            i = {taskType: o.DownloadKernel.TaskType.P2sp, value: n};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, i)
                    } else if (r === o.DownloadKernel.TaskType.Bt) {
                        let n = a.getExtraObject().getInfoId(), i = {taskType: o.DownloadKernel.TaskType.Bt, value: n};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, i)
                    } else if (r === o.DownloadKernel.TaskType.Emule) {
                        let n = a.getExtraObject().getFileHash(),
                            i = {taskType: o.DownloadKernel.TaskType.Emule, value: n};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, i)
                    }
                }
                return t
            })
        }

        upgradePrivateSpace(e) {
            let t = !1, n = u.ConfigNS.getValue("TaskUpgrading", "UpgradedUsers", "");
            if (d.isString(n) || (n = ""), -1 === n.indexOf(e + ", ")) {
                let i = f.getPrivateCategoryFromUserId(e);
                i && (this.insertTaskListToNewPrivateSpace(i).catch(), n += e + ", ", u.ConfigNS.setValue("TaskUpgrading", "UpgradedUsers", n), t = !0)
            }
            return t
        }
    }

    t.PrivateSpaceUpgrade = g, function (e) {
        const t = new g;
        e.getUpgrade = function () {
            return t
        }
    }(t.PrivateSpaceUpgradeNS || (t.PrivateSpaceUpgradeNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(696), a = n(354);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\toast-notify\\toast-notify.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(699), a = n(356);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\ad-platform\\ad-platform.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(358);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-list-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(705), a = n(360);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-list.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(364);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\downloading-item-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(710), a = n(366);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\downloading-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(713), a = n(368);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(715), a = n(370);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\item-vip-status.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(714), a = n(372);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\item-try-status.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(712), a = n(374);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\item-vip-speed.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(376);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\completed-item-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(711), a = n(378);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\completed-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(380);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\recycle-item-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(709), a = n(382);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\recycle-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1204);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(1), o = n(13), r = n(8), s = n(53), l = n(83), u = a.default.getLogger("task filter");
    let d = "全部";
    !function (e) {
        const t = [{type: "checkbox", label: "全部", id: "all"}, {type: "separator"}, {
            type: "checkbox",
            label: "视频文件",
            extFilter: "avi|mp4|mkv|mpeg|mpg|wmv|rmvb|rm|mov|ts|m2ts|tp|3gp|flv"
        }, {
            type: "checkbox",
            label: "音频文件",
            extFilter: "mp3|wma|m4a|aac|wav|flac|ape|alac|wv|opus|ogg|dts"
        }, {type: "checkbox", label: "图片文件", extFilter: "bmp|jpg|jpeg|png|gif|webp|psd|tga"}, {
            type: "checkbox",
            label: "应用程序",
            extFilter: "exe|msi|com|bat|cmd|py|vbs"
        }, {type: "checkbox", label: "压缩文件", extFilter: "rar|zip|7z|cab|lzh|jar"}, {
            type: "checkbox",
            label: "镜像文件",
            extFilter: "iso|img|bin|nrg|ccd|vcd|dts|cdi|gho|mds|mdf"
        }, {type: "checkbox", label: "文档文件", extFilter: "txt|doc|docx|xls|xlsx|csv|wps|rtf|pdf"}, {
            type: "checkbox",
            label: "BT任务",
            taskType: r.DownloadKernel.TaskType.Bt
        }, {type: "checkbox", label: "任务组", taskType: r.DownloadKernel.TaskType.Group}];
        e.reset = function () {
            d = "全部"
        }, e.refresh = function (e) {
        }, e.showMenu = function (e, n, a) {
            o.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_show");
            let c = [];
            for (let e of t) "separator" === e.type ? c.push({type: e.type}) : c.push({
                type: e.type,
                label: e.label,
                enabled: e.enabled,
                icon: e.icon,
                id: e.id,
                checked: d === e.label,
                click: t => {
                    let i = `category=${encodeURIComponent(t.label)}`;
                    o.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_click", "", 0, 0, 0, 0, i);
                    do {
                        if ("function" != typeof a) break;
                        if (t.label === d) {
                            u.information("select old item");
                            break
                        }
                        if (d = t.label, "all" === e.id) {
                            a(e);
                            break
                        }
                        let i = r.DownloadKernel.FilterKeyType.ExtEqual;
                        e.taskType ? i = r.DownloadKernel.FilterKeyType.TaskTypeEqual : e.nameFilter && "" !== e.nameFilter.trim() && (i = r.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), l.ThunderKernel.filterTask(i, e.nameFilter ? e.nameFilter : "", e.extFilter ? e.extFilter : "", t => {
                            u.information("task filter", t), a(e, t)
                        }, n, void 0, e.taskType)
                    } while (0)
                }
            });
            const h = i.remote.getCurrentWindow(), f = i.remote.Menu.buildFromTemplate(c);
            s.MenuSkinNS.setStyle(f, {});
            let g = e.getBoundingClientRect(), p = Math.round(g.left), k = Math.round(g.top);
            f.popup({window: h, x: p, y: k, async: !1})
        }
    }(t.CompletedFilterNS || (t.CompletedFilterNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(384);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\private-space-open-page-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(704), a = n(386);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\private-space-open-page.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(388);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-search-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(700), a = n(390);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-list-search.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(392);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\home-page\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(695), a = n(394);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(933);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, "f12073ec", null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\home-page\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1206);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(396);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\browser-view-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(687), a = n(398);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(936);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\browser-view.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1208);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(400);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\setting-center-view\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(686), a = n(402);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(939);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\setting-center-view\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1215);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(663), a = n(404);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-background.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1224);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1229);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1231);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1233);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1235);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1237);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1240);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1246);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1248);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1250);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(31), o = n(1), r = n(7), s = n(84), l = n(8), u = n(25), d = n(105), c = n(248), h = n(20),
        f = n(144), g = n(79), p = n(250), k = r.default(i.join(__rootDir, "../bin/ThunderHelper.node"));

    class m {
        static getInstance() {
            return null === m.instance && (m.instance = new m), m.instance
        }
    }

    m.instance = null, function (e) {
        const t = ["http://", "https://", "ftp://"], n = ["thunder://", "thunders://", "ed2k://", "magnet:"],
            r = o.default.getLogger("ClipBoardNS");

        function T(e) {
            let n = !1;
            if (e) for (let i = 0; i < t.length; ++i) {
                let a = t[i];
                if (0 === e.indexOf(a)) {
                    n = !0;
                    break
                }
            }
            return n
        }

        function v(e) {
            let t = !1;
            if (e) for (let i = 0; i < n.length; ++i) {
                let a = n[i];
                if (0 === e.indexOf(a)) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function C(e, t) {
            let n = !1;
            do {
                if (!e) break;
                t.indexOf(e) > -1 && (n = !0)
            } while (0);
            return n
        }

        function S(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                let n = "thunderx://";
                if (void 0 === (e = e.trim()) || null === e || "" === e) break;
                0 === e.indexOf(n, 0) && (t = !0)
            } while (0);
            return t
        }

        function y(e) {
            let t = "", n = (e = e.trim()).substring("thunderx://".length), i = n.lastIndexOf("}");
            return i > 0 && (t = n.substring(0, i + 1)), t
        }

        function w(e, t) {
            let n = [], o = u.ConfigNS.getValue("Monitor", "MonitorClipBoard", !0);
            do {
                if (!o) {
                    r.information("notwatch");
                    break
                }
                let u = t.join("");
                if (r.information("textList", t), g.URLHelperNS.isBirdKey(u) && (r.information("isbirdkey"), f.openBirdKeyDecodeDialog(u, {from: "clipboard"}, k)), r.information("attachClipBoardCallback type:", e, t), null !== t && void 0 !== t && t.length > 0) {
                    let e = t.join("");
                    if (S(e)) {
                        let t = y(e);
                        d.ThunderNewTask.createThunderxTask(t).catch();
                        break
                    }
                }
                let m = p.BHOConfigNS.getValue("Monitor", "ExtendNames", p.BHOConfigNS.getDefaultExtendNames()),
                    w = p.BHOConfigNS.getValue("Monitor", "WatchTraditionLink", 1),
                    I = p.BHOConfigNS.getValue("Monitor", "ConfigWatch_Bt", 1),
                    b = p.BHOConfigNS.getValue("EMuleGenericSettings", "EMuleWatchLink", 1),
                    A = p.BHOConfigNS.getValue("MagnetGenericSettings", "MagnetWatchLink", 1);
                for (let e = 0; e < t.length; ++e) {
                    let o = t[e], u = o;
                    if (u && (u = u.trim()), s.Common.isThunderPrivateUrl(o) && (o = s.Common.parseThunderPrivateUrl(o)), !T(o) && !v(o)) {
                        r.information("isVaildUrl && isVaildUrl url:", o);
                        continue
                    }
                    let f = h.ThunderHelper.getTaskTypeFromUrl(o);
                    if (f === l.DownloadKernel.TaskType.P2sp) {
                        if (0 === w && 0 === I) {
                            r.information("taskType: P2sp, watchTraditionLink === 0 && watchBtLink === 0");
                            continue
                        }
                        let e = a.parse(o);
                        if (null === e) continue;
                        let t = i.extname(e.pathname);
                        if (t && (t = t.toLowerCase()), 0 !== w && C(t, m)) r.information("valid watchTraditionLink"); else {
                            if (0 === I || ".torrent" !== t) {
                                r.information("invalid ext:", t);
                                continue
                            }
                            r.information("valid watchBtLink")
                        }
                        n.includes(u, 0) || n.push(u)
                    } else if (f === l.DownloadKernel.TaskType.Emule) {
                        if (0 === b) {
                            r.information("taskType: Emule, watchBtLink === 0");
                            continue
                        }
                        n.includes(u, 0) || n.push(u)
                    } else if (f === l.DownloadKernel.TaskType.Magnet || f === l.DownloadKernel.TaskType.Bt) {
                        if (0 === A) {
                            r.information("taskType: Magnet, watchMagnetLink === 0");
                            continue
                        }
                        c.default.bringMainWindowToTop(), d.ThunderNewTask.createBtTaskWindow({
                            url: u,
                            type: "url"
                        }, {source: "clipboard"})
                    }
                }
            } while (0);
            n.length > 0 && d.ThunderNewTask.createPreNewTaskWindow(n, "clipboard")
        }

        e.init = function () {
            k.initClipBoard(), setTimeout(() => {
                k.attachClipBoard(w)
            }, 5e3)
        }, e.getOperInfoInstance = function () {
            return m.getInstance()
        }
    }(t.ClipBoardNS || (t.ClipBoardNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(3), r = n(2), s = n(10), l = n(12), u = n(7), d = n(23), c = n(25),
        h = a.default.getLogger("MainRendererHelper"), f = u.default(r.join(__rootDir, "../bin/ThunderHelper.node"));
    const g = new class {
        constructor() {
            this.mainWndDataIniPath = r.resolve(__profilesDir, "mainWndData.ini"), this.preBossKeyName = "", this.defaultMainWndWidth = 1020, this.defaultMainWndHeight = 650
        }

        saveMainWndData() {
            let e = o.remote.getCurrentWindow(), t = e.getSize(), n = "normal";
            e.isMaximized() && (n = "max");
            let i = this.defaultMainWndWidth, a = this.defaultMainWndHeight;
            t && (i = t[0], a = t[1]), f.writeINI(this.mainWndDataIniPath, "MainFrame", "ExitState", n), f.writeINI(this.mainWndDataIniPath, "MainFrame", "MainWndLastWidth", i.toString()), f.writeINI(this.mainWndDataIniPath, "MainFrame", "MainWndLastHeight", a.toString()), h.information("saveMainWndData:", this.mainWndDataIniPath, i, a, n)
        }

        initMainRendererHelper() {
            c.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onRegisterBossKey(), this.onInitDefaultPath().catch()
            })
        }

        onInitDefaultPath() {
            return i(this, void 0, void 0, function* () {
                let e = c.ConfigNS.getValue("TaskDefaultSettings", "InitPath", "");
                if ("" === e) {
                    let t = l.ThunderUtil.getMaxFreeDriver();
                    null !== t && "" !== t && (e = t + ":\\迅雷下载")
                }
                "" !== e && c.ConfigNS.setValue("TaskDefaultSettings", "InitPath", e);
                let t = c.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                "" !== t && (yield s.FileSystemAWNS.mkdirsAW(t)) || "" !== e && (yield s.FileSystemAWNS.mkdirsAW(e), c.ConfigNS.setValue("TaskDefaultSettings", "DefaultPath", e))
            })
        }

        onRegisterBossKey() {
            c.ConfigNS.setValue("BossKey", "BossKeyState", !1), this.registerBossKey(), c.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                "BossKey" === e && this.registerBossKey()
            })
        }

        registerBossKey() {
            if ("" !== this.preBossKeyName && o.remote.globalShortcut.unregister(this.preBossKeyName), c.ConfigNS.getValue("BossKey", "BossKeySwitch", !1)) {
                let e = c.ConfigNS.getValue("BossKey", "BossKeyName", "");
                null !== e && void 0 !== e && "" !== e && (o.remote.globalShortcut.register(e, () => {
                    o.ipcRenderer.send("closeMainWindow", "BossKey")
                }), this.preBossKeyName = e)
            }
        }
    };
    t.default = g
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(76), o = n(6), r = n(21), s = n(582), l = n(5),
        u = i.default.getLogger("MessageChannel.NativeFunction"), d = a.TabEventManagerNS.getEventEmitter();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1, this.nextListenerCookie = 0, this.listenerMap = new Map
            }

            init() {
                if (!this.isInit) {
                    this.isInit = !0;
                    let e = [{
                        functionName: "MessageChannelRegisterService",
                        nativeFunc: this.registerService.bind(this)
                    }, {
                        functionName: "MessageChannelUnregisterService",
                        nativeFunc: this.unregisterService.bind(this)
                    }, {
                        functionName: "MessageChannelJoinGroup",
                        nativeFunc: this.joinGroup.bind(this)
                    }, {
                        functionName: "MessageChannelLeaveGroup",
                        nativeFunc: this.leaveGroup.bind(this)
                    }, {
                        functionName: "MessageChannelGetLongConnectState",
                        nativeFunc: this.getLongConnectState.bind(this)
                    }, {
                        functionName: "MessageChannelGetUserState",
                        nativeFunc: this.getUserState.bind(this)
                    }, {
                        functionName: "MessageChannelAttachEvent",
                        nativeFunc: this.attachEvent.bind(this)
                    }, {functionName: "MessageChannelDetachEvent", nativeFunc: this.detachEvent.bind(this)}];
                    a.setDefaultNativeFunctionMap(e), d.on(a.TabEventManagerNS.EventType.RemoveTab, this.onTabRemove.bind(this)), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLogin, () => {
                        this.fireUserLogin()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLoginFailed, () => {
                        this.fireUserLoginFailed()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLogout, () => {
                        this.fireUserLogout()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLogoutFailed, () => {
                        this.fireUserLogoutFailed()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventServiceCallbackId, (e, t) => {
                        this.fireServiceCallbackEvent(e, t)
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventGroupServiceCallbackId, (e, t) => {
                        this.fireGroupServiceCallbackEvent(e, t)
                    })
                }
            }

            onTabRemove(e) {
                this.listenerMap.forEach(t => {
                    let n = [];
                    for (let [i, a]of t) a.tab === e.tabInfo.tab && n.push(i);
                    n.forEach(e => {
                        if (t.size > 0) {
                            let n = t.get(e);
                            if (!n) return;
                            if (t.delete(e), n.eventType === s.MessageChannelNS.eventServiceCallbackId) {
                                let e = 0;
                                for (let [, i]of t) if (i.serviceType === n.serviceType) {
                                    ++e;
                                    break
                                }
                                if (0 === e) {
                                    let e = s.MessageChannelNS.unregisterService(n.serviceType);
                                    u.information("unregisterService serviceType: ", n.serviceType, ", success: ", e)
                                }
                            } else if (n.eventType === s.MessageChannelNS.eventGroupServiceCallbackId) {
                                let e = 0;
                                for (let [, i]of t) if (i.groupId === n.groupId) {
                                    ++e;
                                    break
                                }
                                if (0 === e) {
                                    let e = s.MessageChannelNS.leaveGroup(n.groupId);
                                    u.information("leaveGroup groupId: ", n.groupId, ", success: ", e)
                                }
                            }
                        }
                    })
                })
            }

            registerService(e, t, n, i) {
                if (u.information("registerService args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                if (o.isNullOrUndefined(i[1])) {
                    let i = s.MessageChannelNS.registerService(a);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } else if (o.isNumber(i[1])) {
                    let o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventServiceCallbackId);
                    l || (l = new Map, this.listenerMap.set(s.MessageChannelNS.eventServiceCallbackId, l));
                    let d = 0;
                    for (let [, e]of l) if (e.serviceType === a) {
                        ++d;
                        break
                    }
                    if (0 === d && !s.MessageChannelNS.registerService(a)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !1);
                    let c = {};
                    c.tab = e, c.nativeCallId = t, c.eventType = s.MessageChannelNS.eventServiceCallbackId, c.serviceType = a, c.callBackId = o;
                    let h = this.nextListenerCookie;
                    u.information("registerService callBackId:", c.callBackId, ", cookie:", h), l.set(h, c), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0, h)
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            unregisterService(e, t, n, i) {
                if (u.information("unregisterService args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                if (o.isNullOrUndefined(i[1])) {
                    let i = s.MessageChannelNS.unregisterService(a);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } else if (o.isNumber(i[1])) {
                    let o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventServiceCallbackId);
                    if (l) {
                        l.delete(o);
                        let i = 0;
                        if (0 === l.size) this.listenerMap.delete(s.MessageChannelNS.eventServiceCallbackId); else for (let [, e]of l) if (e.serviceType === a) {
                            ++i;
                            break
                        }
                        if (u.information("unregisterService cookie: ", o, ", serviceType: ", a, ", serviceRefCount: ", i), 0 === i) {
                            let i = s.MessageChannelNS.unregisterService(a);
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                        } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    } else {
                        u.warning("serviceType already unregister! cookie: ", o);
                        let i = s.MessageChannelNS.unregisterService(a);
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    }
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            joinGroup(e, t, n, i) {
                if (u.information("joinGroup args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError); else if (o.isNumber(i[1])) {
                    let a = i[0], o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId);
                    l || (l = new Map, this.listenerMap.set(s.MessageChannelNS.eventGroupServiceCallbackId, l));
                    let d = 0;
                    for (let [, e]of l) if (e.groupId === a) {
                        ++d;
                        break
                    }
                    if (0 === d && !s.MessageChannelNS.joinGroup(a)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !1);
                    let c = {};
                    c.tab = e, c.nativeCallId = t, c.eventType = s.MessageChannelNS.eventGroupServiceCallbackId, c.groupId = a, c.callBackId = o;
                    let h = this.nextListenerCookie;
                    u.information("joinGroup callBackId:", c.callBackId, ", cookie:", h), l.set(h, c), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0, h)
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            leaveGroup(e, t, n, i) {
                if (u.information("leaveGroup args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError); else if (o.isNullOrUndefined(i[1])) {
                    let a = i[0], o = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId), l = !1;
                    if (o && o.size > 0) {
                        let e = [];
                        for (let [t, n]of o) n.groupId === a && e.push(t);
                        e.length > 0 && (e.forEach(e => {
                            o.delete(e)
                        }), l = s.MessageChannelNS.leaveGroup(a))
                    }
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, l)
                } else if (o.isNumber(i[1])) {
                    let a = i[0], o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId);
                    if (l) {
                        l.delete(o);
                        let i = 0;
                        if (0 === l.size) this.listenerMap.delete(s.MessageChannelNS.eventGroupServiceCallbackId); else for (let [, e]of l) if (e.groupId === a) {
                            ++i;
                            break
                        }
                        if (u.information("leaveGroup cookie: ", o, ", groupId: ", a, ", serviceRefCount: ", i), 0 === i) {
                            let i = s.MessageChannelNS.leaveGroup(a);
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                        } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    } else {
                        u.warning("groupServiceCallback already unregister! cookie: ", o);
                        let i = s.MessageChannelNS.leaveGroup(a);
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    }
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            getLongConnectState(e, t, n, i) {
                if (u.information("getLongConnectState"), o.isNullOrUndefined(i)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = s.MessageChannelNS.getLongConnectState();
                u.information("longConnectState:", a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, a)
            }

            getUserState(e, t, n, i) {
                if (u.information("getUserState"), o.isNullOrUndefined(i)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = s.MessageChannelNS.getUserState();
                u.information("userState:", a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, a)
            }

            attachEvent(e, t, n, i) {
                if (u.information("attachEvent enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) return void u.information("attachEvent bad external args");
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0], l = {};
                if (l.tab = e, l.nativeCallId = t, l.eventType = a, a === s.MessageChannelNS.eventServiceCallbackId) {
                    if (o.isNullOrUndefined(i[2])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    let a = i[1], s = i[2];
                    l.serviceType = a, l.callBackId = s
                } else if (a === s.MessageChannelNS.eventGroupServiceCallbackId) {
                    if (o.isNullOrUndefined(i[2])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    let a = i[1], s = i[2];
                    l.groupId = a, l.callBackId = s
                } else {
                    let n = i[1];
                    l.callBackId = n, a === s.MessageChannelNS.eventUserLogin && s.MessageChannelNS.getUserState() === s.MessageChannelNS.UserState.Login && (u.information("attach eventUserLogin, current userState is already MessageChannelNS.UserState.Login, direct callback this time."), e.callNativeFunctionCallback(t, n))
                }
                let d = this.nextListenerCookie;
                u.information("attachEvent eventType:", a, ", callBackId:", l.callBackId, ", cookie:", d);
                let c = this.listenerMap.get(a);
                c || (c = new Map, this.listenerMap.set(a, c)), c.set(d, l), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, d)
            }

            detachEvent(e, t, n, i) {
                if (u.information("detachEvent enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) return void u.information("detachEvent bad external args");
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                u.information("detachEvent cookie:", a), this.listenerMap.forEach(e => {
                    e.delete(a)
                }), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
            }

            fireUserLogin() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLogin);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLogin && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLogin)
            }

            fireUserLoginFailed() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLoginFailed);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLoginFailed && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLoginFailed)
            }

            fireUserLogout() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLogout);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLogout && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLogout)
            }

            fireUserLogoutFailed() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLogoutFailed);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLogoutFailed && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLogoutFailed)
            }

            fireServiceCallbackEvent(e, t) {
                let n = JSON.stringify(t), i = this.listenerMap.get(s.MessageChannelNS.eventServiceCallbackId);
                i && i.forEach((t, i) => {
                    t.eventType === s.MessageChannelNS.eventServiceCallbackId && t.serviceType === e && t.tab.callNativeFunctionCallback(t.nativeCallId, t.callBackId, e, n)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventServiceCallbackId, e, n)
            }

            fireGroupServiceCallbackEvent(e, t) {
                let n = JSON.stringify(t), i = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId);
                i && i.forEach((t, i) => {
                    t.eventType === s.MessageChannelNS.eventGroupServiceCallbackId && t.groupId === e && t.tab.callNativeFunctionCallback(t.nativeCallId, t.callBackId, e, n)
                })
            }
        };
        e.init = function () {
            t.init()
        }
    }(t.MessageChannelNaviteFunctionNS || (t.MessageChannelNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(2), r = n(7), s = n(5), l = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        u = a.default.getLogger("BindConfigNS");
    let d = o.resolve(__profilesDir, "BindingConfig.ini");
    !function (e) {
        e.init = function () {
            s.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => i(this, void 0, void 0, function* () {
                u.information("BindConfigNS init userId:", e), l.writeINI(d, "UserInfo", "UserId", e)
            }))
        }
    }(t.BindConfigNS || (t.BindConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(76), a = n(6), o = n(21), r = n(747), s = n(956);
    !function (e) {
        e.adNaviteFunction = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "SetSceneStatus",
                        nativeFunc: this.setSceneStatus
                    }, {functionName: "ShowAdTips", nativeFunc: this.showTips}];
                    i.setDefaultNativeFunctionMap(e)
                }
            }

            setSceneStatus(e, t, n, i) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let s = i[0], l = i[1];
                    r.adPlatform.setSceneStatus(s, l), e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showTips(e, t, n, i) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let r = i[0], l = i[1];
                    s.adTipsManager.showFunctionalTips(l, r), e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.Success)
                } while (0)
            }
        }, e.init = function () {
            e.adNaviteFunction.registerNativeFunction(), setTimeout(() => {
                r.adPlatform.initAw().catch()
            }, 5e3), setTimeout(() => {
                s.adTipsManager.initAw().catch()
            }, 12e4)
        }
    }(t.AdManageNS || (t.AdManageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(604), o = n(957), r = n(958), s = n(15), l = n(3);
    t.adTipsManager = new class {
        constructor() {
            this.marketTips = new o.AdMarketTips, this.functionalTips = new r.AdFunctionalTips
        }

        initAw() {
            return i(this, void 0, void 0, function* () {
                l.remote.ipcMain.on(s.ThunderChannelList.channelMRAdTipsClick, (e, t, n) => i(this, void 0, void 0, function* () {
                    n && n.orderType && (n.orderType === a.OrderType.Market ? yield this.marketTips.onClickAw(t, n) : n.orderType === a.OrderType.Functional && (yield this.functionalTips.onClickAw(t, n)))
                })), yield this.marketTips.initAw(), setTimeout(() => i(this, void 0, void 0, function* () {
                    yield this.functionalTips.initAw()
                }), 3e4)
            })
        }

        showFunctionalTips(e, t) {
            this.functionalTips.showTip(e, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(254), o = n(25), r = n(251), s = n(604), l = n(5), u = n(14), d = n(1);
    t.AdMarketTips = class extends s.AdTips {
        constructor() {
            super(), this.isVip = !1, this.lastShowTime = 0, this.orderType = s.OrderType.Market, this.tipsPriority = r.MsgQueueNS.MsgPriority.AdvertisementMarket, this.positionId = 1305, this.logger = d.default.getLogger("AdMarketTips")
        }

        initAw() {
            const e = e => super[e];
            return i(this, void 0, void 0, function* () {
                return l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                    yield this.updateUserInfoAw()
                })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => i(this, void 0, void 0, function* () {
                    this.isVip = !1, (new Date).getTime() - this.lastShowTime > 108e5 && this.timerCookie && (this.killTimer(), yield this.fetchOrdersAw())
                })), yield this.updateUserInfoAw(), e("initAw").call(this)
            })
        }

        showTip() {
            do {
                if (null === this.curSelectOrder || void 0 === this.curSelectOrder) {
                    this.logger.information("showTip:curSelectOrder 有问题");
                    break
                }
                let e = this.curSelectOrder.materials;
                if (e.length <= 0) {
                    this.logger.information("showTip:materials 有问题");
                    break
                }
                let t = e[0].materialId;
                super.showTip(t)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return i(this, void 0, void 0, function* () {
                let t = null;
                return this.isVip || (this.shownOrderIds = yield this.getShownOrderIdAw(), t = e("fetchOrdersAw").call(this)), this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const n = e => super[e];
            return i(this, void 0, void 0, function* () {
                try {
                    switch (yield n("handleEventAW").call(this, e, t), e) {
                        case"ad_load":
                            let i = yield this.downloadResourcesAW();
                            this.logger.information("downloadResourcesAW result", i), i && (this.isVip ? yield this.handleEventAW("ad_noshow", "vip") : this.showTip());
                            break;
                        case"ad_show":
                            this.lastShowTime = (new Date).getTime(), this.saveShownOrders()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        updateUserInfoAw() {
            return i(this, void 0, void 0, function* () {
                try {
                    let e = JSON.parse(yield u.default("GetUserInfo", 2)).isVip;
                    this.isVip = e > 0, this.isVip && this.clearAllTips()
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        getShownOrderIdAw() {
            return i(this, void 0, void 0, function* () {
                let e = "";
                return yield a.AdHelperNS.onConfigInitAw(), o.ConfigNS.getValue("AdMarketTips", "TheDate", "") === a.AdHelperNS.getCurDate() && "" !== (e = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        saveShownOrders() {
            let e = o.ConfigNS.getValue("AdMarketTips", "TheDate", ""), t = a.AdHelperNS.getCurDate(), n = "";
            e === t ? "" !== (n = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === n.slice(n.length - 1) && (n = n.slice(0, n.length - 1)) : o.ConfigNS.setValue("AdMarketTips", "TheDate", t), n = "" !== n ? `${n},${this.curShowOrder.orderId}` : `${this.curShowOrder.orderId}`, o.ConfigNS.setValue("AdMarketTips", "shownOrders", n)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(254), r = n(38), s = n(10), l = n(251), u = n(604), d = n(194), c = n(1);
    t.AdFunctionalTips = class extends u.AdTips {
        constructor() {
            super(), this.readyScenesMap = new Map, this.orderType = u.OrderType.Functional, this.tipsPriority = l.MsgQueueNS.MsgPriority.AdvertisementFunctional, this.positionId = 1306, this.logger = c.default.getLogger("AdFunctionalTips")
        }

        showTip(e, t) {
            this.logger.information("sceneName", t);
            do {
                let n = this.readyScenesMap.get(t);
                if (!n) {
                    this.logger.information("showTip:sceneName 有问题");
                    break
                }
                this.curSelectScene = n, super.showTip(e)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return i(this, void 0, void 0, function* () {
                let t = e("fetchOrdersAw").call(this);
                return this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const n = e => super[e];
            return i(this, void 0, void 0, function* () {
                switch (yield n("handleEventAW").call(this, e, t), e) {
                    case"ad_load":
                        let i = yield this.downloadResourcesAW();
                        this.logger.information("downloadResourcesAW result", i), i && (yield this.downloadScenes(), yield this.loadAllScenes())
                }
            })
        }

        downloadScenes() {
        }

        loadAllScenes() {
            return i(this, void 0, void 0, function* () {
                do {
                    if (null === this.curSelectOrder || void 0 === this.curSelectOrder) break;
                    let e = this.curSelectOrder.scenes;
                    if (e.length <= 0) this.logger.information("没有场景包"); else for (let t = 0; t < e.length; ++t) {
                        let n = e[t], i = n.name, r = this.readyScenesMap.get(i);
                        if (null === r || void 0 === r) {
                            this.readyScenesMap.set(i, n);
                            let e = a.join(this.adDataScenesDir, i);
                            yield o.AdHelperNS.loadScene(e)
                        }
                    }
                } while (0)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(76), o = n(6), r = n(21), s = n(960), l = n(56), u = n(5),
        d = i.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "AttachCallbackEvent",
                        nativeFunc: this.attachCallbackEvent
                    }, {functionName: "IsTipsWndShow", nativeFunc: this.isTipsWndShow}, {
                        functionName: "IsMainWndShow",
                        nativeFunc: this.isMainWndShow
                    }, {functionName: "CreateTipsWnd", nativeFunc: this.createTipsWnd}, {
                        functionName: "CloseTipsWnd",
                        nativeFunc: this.closeTipsWnd
                    }, {functionName: "ShowOrHideTipsWnd", nativeFunc: this.showOrHideTipsWnd}];
                    a.setDefaultNativeFunctionMap(e)
                }
            }

            attachCallbackEvent(e, t, n, i) {
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0], s = i[1];
                u.NativeCallModule.nativeCall.AttachNativeEvent(a, (...e) => {
                    l.NativeCallHostModule.nativeCallHost.fireNativeEvent(s, ...e)
                }), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
            }

            createTipsWnd(e, t, n, i) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], l = i[1], u = "", d = null, c = null;
                    o.isNullOrUndefined(i[2]) || (d = i[2]), o.isNullOrUndefined(i[3]) || (c = i[3]), o.isNullOrUndefined(i[4]) || (u = i[4]), s.TipsHelperNS.tipsUIHelper.createTipsWnd(a, l, d, c, u), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isTipsWndShow(e, t, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    let i = s.TipsHelperNS.tipsUIHelper.isTipsWndShow();
                    e.callNativeFunctionCallback(t, n, i)
                } while (0)
            }

            isMainWndShow(e, t, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    let i = s.TipsHelperNS.tipsUIHelper.isMainWndShow();
                    e.callNativeFunctionCallback(t, n, i)
                } while (0)
            }

            closeTipsWnd(e, t, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    s.TipsHelperNS.tipsUIHelper.closeTipsWnd(), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showOrHideTipsWnd(e, t, n, i) {
                d.information("showOrHideTipsWnd", e, t, n);
                let a = !1, l = null, u = null, c = null, h = null;
                o.isNullOrUndefined(i[0]) || (a = i[0]), o.isNullOrUndefined(i[1]) || (l = i[1]), o.isNullOrUndefined(i[2]) || (u = i[2]), o.isNullOrUndefined(i[3]) || (c = i[3]), o.isNullOrUndefined(i[4]) || (h = i[4]), s.TipsHelperNS.tipsUIHelper.showOrHideTipsWnd(a, l, u, c, h), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.TipsNaviteFunctionNS || (t.TipsNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(2), o = n(6), r = n(1), s = n(38), l = n(7), u = n(56),
        d = l.default(a.join(__rootDir, "../bin/ThunderHelper.node")), c = r.default.getLogger("login-helper");
    !function (e) {
        e.tipsUIHelper = new class {
            constructor() {
                this.tipsWnd = null, this.isReadyShow = !1, this.isLoadFinish = !1, this.lastTipsWndShowState = !1
            }

            createTipsWnd(e, t, n, a, r) {
                c.information("create TipsWnd:", t, e, r, n, a, this.tipsWnd), null === this.tipsWnd && (o.isNullOrUndefined(e) || (this.isLoadFinish = !1, this.isReadyShow = !1, this.lastTipsWndShowState = t, o.isNullOrUndefined(n) && (n = 460), o.isNullOrUndefined(a) && (a = 360), o.isNullOrUndefined(this.tipsWnd) && (this.tipsWnd = new i.remote.BrowserWindow({
                    width: n,
                    height: a,
                    modal: !1,
                    resizable: !1,
                    skipTaskbar: !0,
                    frame: !1,
                    center: !0,
                    parent: i.remote.getCurrentWindow(),
                    show: !1,
                    webPreferences: {webSecurity: !0}
                })), this.tipsWnd.loadURL(e), this.tipsWnd.on("hide", () => {
                    let e = i.remote.getCurrentWindow();
                    !e.isMinimized() && e.isVisible() && i.remote.getCurrentWindow().show()
                }), this.tipsWnd.once("ready-to-show", () => {
                    this.isReadyShow = !0, c.information("create tipswindow ready-to-show:", this.isReadyShow), this.lastTipsWndShowState && (u.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), this.tipsWnd.show())
                }), this.tipsWnd.webContents.once("did-finish-load", () => {
                    this.isLoadFinish = !0, c.information("create TipsWnd did-finish-load:", this.isLoadFinish)
                }), this.tipsWnd.on("closed", () => {
                    c.information("TipsWnd closed"), this.tipsWnd = null;
                    let e = i.remote.getCurrentWindow();
                    !e.isMinimized() && e.isVisible() && i.remote.getCurrentWindow().show()
                })))
            }

            closeTipsWnd() {
                c.information("closeTipsWnd"), null !== this.tipsWnd && (this.lastTipsWndShowState = !1, this.tipsWnd.close(), this.tipsWnd = null)
            }

            showOrHideTipsWnd(e, t, n, i, a) {
                if (c.information("updateTipsWnd:", e, t, n, i, this.tipsWnd), o.isNullOrUndefined(e) && (e = !1), o.isNullOrUndefined(this.tipsWnd)) {
                    if (null === t || void 0 === t || "" === t) return;
                    this.createTipsWnd(t, e, n, i, a)
                } else this.lastTipsWndShowState = e, this.lastTipsWndShowState ? (u.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), c.information("updateLoginWnd:显示tips窗口"), this.tipsWnd.show(), s.ToolsUtilitiesAWNS.setForegroundWindow(d, this.tipsWnd)) : this.tipsWnd.hide()
            }

            isMainWndShow() {
                c.information("getMainWndState");
                let e = !0, t = i.remote.getCurrentWindow();
                return !t.isMinimized() && t.isVisible() || (e = !1), e
            }

            isTipsWndShow() {
                c.information("getTipsWndState");
                let e = !1;
                return this.lastTipsWndShowState && (e = !0), e
            }
        }
    }(t.TipsHelperNS || (t.TipsHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(76), o = n(21), r = n(56), s = n(12), l = n(751),
        u = i.default.getLogger("NotificationNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "ShowNotification", nativeFunc: this.showNotification}];
                    a.setDefaultNativeFunctionMap(e)
                }
            }

            showNotification(e, t, n, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                    if (s.ThunderUtil.isUndef(i) || s.ThunderUtil.isUndef(i[0])) {
                        e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(i[0]);
                        if (u.information("showNotification", "options", a), !a) break;
                        let d = i[1], c = null;
                        u.information("notificationCallBackId", d), s.ThunderUtil.isDef(d) && (c = ((...e) => {
                            r.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, d, ...e)
                        })), l.NotificationHelper.notify(a, c)
                    } catch (i) {
                        e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    e.callNativeFunctionCallback(t, n, o.NativeFunctionErrorCode.Success)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NotificationNaviteFunctionNS || (t.NotificationNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(14), o = n(5), r = n(35), s = n(1), l = n(12), u = n(10), d = n(236), c = n(585), h = n(3),
        f = s.default.getLogger("MainRenderer"), {isDef: g, isUndef: p} = l.ThunderUtil;
    let k = !1, m = "", T = `${__profilesDir}/user-skin-info.json`, v = !1, C = null;

    function S(e, t = !1) {
        return i(this, void 0, void 0, function* () {
            if (t || function (e) {
                let t, n, i = !0;
                do {
                    if (e.type !== r.SkinHelperNS.SkinType.Wallpaper) break;
                    try {
                        t = JSON.parse(localStorage.getItem("wallpapers"))
                    } catch (e) {
                        f.warning(e);
                        break
                    }
                    n = (t || []).find(t => t.id === e.skinID), g(n) && n.is_vip && (i = k)
                } while (0);
                return i
            }(e)) {
                if (e.type === r.SkinHelperNS.SkinType.Default) document.body.classList.remove("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                    "--background-main": "",
                    "--color-primary-theme": "",
                    "--color-primary-control-1": "",
                    "--color-primary-control-2": "",
                    "--color-primary-control-3": "",
                    "--color-primary-control-4": "",
                    "--color-primary-gradient-1": "",
                    "--color-primary-gradient-2": "",
                    "--color-primary-text": "",
                    "--color-search": "",
                    "--color-secondary": "",
                    "--color-gradient-background-1": "",
                    "--color-gradient-background-2": "",
                    "--color-gradient-foreground-1": "",
                    "--color-gradient-foreground-2": "",
                    "--color-accordion-1": "",
                    "--color-accordion-2": "",
                    "--default-opacity-1": "",
                    "--default-opacity-2": ""
                }); else if (e.type === r.SkinHelperNS.SkinType.Color || e.type === r.SkinHelperNS.SkinType.Wallpaper) {
                    let {colors: {colorGradientBackground: t, colorGradientForeground: n, colorPrimaryControl1: i, colorPrimaryControl2: a, colorPrimaryControl3: o, colorPrimaryControl4: s, colorSearch: u, colorPrimaryText: d, colorPrimary: c, colorPrimaryGradient: h, colorSecondary: f, colorAccordion: g}, opacity: p, opacityDesc: k, image: m} = e;
                    if (document.body.classList.add("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                        "--background-main": "",
                        "--color-primary-theme": `${c}`,
                        "--color-primary-control-1": `${i}`,
                        "--color-primary-control-2": `${a}`,
                        "--color-primary-control-3": `${o}`,
                        "--color-primary-control-4": `${s}`,
                        "--color-primary-gradient-1": `${h[0]}`,
                        "--color-primary-gradient-2": `${h[1]}`,
                        "--color-primary-text": `${d}`,
                        "--color-search": `${u}`,
                        "--color-secondary": `${f}`,
                        "--color-gradient-background-1": `${t[0]}`,
                        "--color-gradient-background-2": `${t[1]}`,
                        "--color-gradient-foreground-1": `${n[0]}`,
                        "--color-gradient-foreground-2": `${n[1]}`,
                        "--color-accordion-1": `${g[0]}`,
                        "--color-accordion-2": `${g[1]}`,
                        "--default-opacity-1": k ? `${p + .1}` : `${p - .1}`,
                        "--default-opacity-2": k ? `${p - .1}` : `${p + .1}`
                    }), e.type === r.SkinHelperNS.SkinType.Wallpaper) {
                        let e = new Image;
                        e.addEventListener("load", () => {
                            l.ThunderUtil.setCSSProperties(document.body, {"--background-main": `url("${m}")`})
                        }), e.src = m
                    }
                }
            } else try {
                yield a.default("SetSkinInfo", r.SkinHelperNS.defaultSkinInfo)
            } catch (e) {
                f.warning(e)
            }
            yield w(m)
        })
    }

    function y(e) {
        return i(this, void 0, void 0, function* () {
            if (p(e) || e) try {
                k = "1" === JSON.parse(yield a.default("GetUserInfo", 2)).isVip
            } catch (e) {
                f.warning(e)
            } else k = !1;
            try {
                yield S(yield a.default("GetSkinInfo"))
            } catch (e) {
                f.warning(e)
            }
        })
    }

    function w(e) {
        return i(this, void 0, void 0, function* () {
            try {
                let t = {}, n = yield a.default("GetSkinInfo"), i = yield c.SpringFestivalSkinNS.canShowSkin();
                if (n.is_spring_festival && i && (n = C), p(n)) return;
                let o = "{}";
                if (C = n, "" !== e) {
                    (yield u.FileSystemAWNS.existsAW(T)) && (o = (yield u.FileSystemAWNS.readFileAW(T)).toString() || "{}", t = JSON.parse(o)), (t = JSON.parse(o))[e] = n, delete t[e].colors, yield u.FileSystemAWNS.writeFileAW(T, JSON.stringify(t))
                }
            } catch (e) {
                f.warning(e)
            }
        })
    }

    o.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", S), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => i(this, void 0, void 0, function* () {
        do {
            try {
                yield y(!0), m = e;
                let t = (yield u.FileSystemAWNS.readFileAW(T)).toString(), n = JSON.parse(t)[e],
                    i = yield a.default("GetSkinInfo");
                C = n, k = "1" === JSON.parse(yield a.default("GetUserInfo", 2)).isVip;
                let o = JSON.parse(localStorage.getItem("wallpapers"));
                null === o && (o = ((yield d.default.getWallpapers()) || []).sort((e, t) => e.manual_order - t.manual_order) || []);
                let r = o.find(e => e.id === n.skinID), s = o.find(e => e.id === i.skinID);
                if (v && (v = !1, !s || s && !s.is_vip || s && s.is_vip && k)) return void (yield w(e));
                if ("" !== t && (!r || k && r.is_vip || !r.is_vip)) {
                    if (yield c.SpringFestivalSkinNS.canShowSkin()) break;
                    yield a.default("SetSkinInfo", n)
                }
            } catch (e) {
                f.warning(e)
            }
        } while (0)
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => i(this, void 0, void 0, function* () {
        try {
            m = "", yield y(!1)
        } catch (e) {
            f.warning(e)
        }
    })), h.remote.ipcMain.on("update-skin-reserved", (e, t) => {
        v = t
    })
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(14), o = n(5), r = n(1), s = n(12), l = n(10), u = n(233), d = n(247),
        c = r.default.getLogger("Thunder.speedcurve-skin.init-skin"), {isDef: h, isUndef: f} = s.ThunderUtil;
    let g = !1, p = !1, k = "", m = `${u.SpeedCurveSkinHelperNS.cacheDir}/user-skin-info.json`;

    function T(e) {
        let t = !0;
        return e.type === u.SpeedCurveSkinHelperNS.SkinType.SuperVip ? t = p : e.type === u.SpeedCurveSkinHelperNS.SkinType.Vip && (t = g), t
    }

    function v(e) {
        return h(e.type) && e.type >= u.SpeedCurveSkinHelperNS.SkinType.Vip
    }

    function C(e, t = !1, n = !1) {
        return i(this, void 0, void 0, function* () {
            if (n || T(e)) ; else try {
                yield a.default("SetSpeedCurveSkinInfo", u.SpeedCurveSkinHelperNS.defaultSkinInfo)
            } catch (e) {
                c.warning(e)
            }
            n && !t || (yield y(k))
        })
    }

    function S(e) {
        return i(this, void 0, void 0, function* () {
            if (f(e) || e) try {
                let e = JSON.parse(yield a.default("GetUserInfo", 2));
                if (h(e)) {
                    let t = Number(e.vasType).valueOf();
                    g = "1" === e.isVip, p = g && 5 === t
                }
            } catch (e) {
                c.warning(e)
            } else g = !1, p = !1;
            try {
                yield C(yield a.default("GetSpeedCurveSkinInfo"))
            } catch (e) {
                c.warning(e)
            }
        })
    }

    function y(e) {
        return i(this, void 0, void 0, function* () {
            try {
                let t = {}, n = yield a.default("GetSpeedCurveSkinInfo"), i = "{}";
                if ("" !== e) {
                    (yield l.FileSystemAWNS.existsAW(m)) && (i = (yield l.FileSystemAWNS.readFileAW(m)).toString() || "{}"), (t = JSON.parse(i))[e] = {
                        id: n.id,
                        type: n.type
                    }, yield l.FileSystemAWNS.writeFileAW(m, JSON.stringify(t))
                }
            } catch (e) {
                c.warning(e)
            }
        })
    }

    o.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSpeedCurveSkin", C), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => i(this, void 0, void 0, function* () {
        try {
            yield S(!0), k = e;
            let t = (yield l.FileSystemAWNS.readFileAW(m)).toString(), n = JSON.parse(t)[e],
                i = yield a.default("GetSpeedCurveSkinInfo"), o = JSON.parse(localStorage.getItem("speedcurveSkins"));
            if (null === o && (o = (yield d.default.getSkins()) || []), (i = o.find(e => e.id === i.id)) && v(i) && T(i)) return void (yield y(e));
            if (!n) return;
            if (n = o.find(e => e.id === n.id)) {
                let e = v(n);
                (e && T(n) || !e) && (yield a.default("SetSpeedCurveSkinInfo", n))
            }
        } catch (e) {
            c.warning(e)
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => i(this, void 0, void 0, function* () {
        try {
            k = "", yield S(!1)
        } catch (e) {
            c.warning(e)
        }
    }))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(725), a = n(21), o = n(51), r = n(6), s = n(5), l = n(13), u = n(2),
        d = n(7).default(u.join(__rootDir, "../bin/ThunderHelper.node"));
    t.defaultNavite = new class {
        constructor() {
        }

        registerDefaultNativeFunction() {
            let e = [{functionName: "GetUserID", nativeFunc: this.getUserID}, {
                functionName: "GetSessionID",
                nativeFunc: this.getSessionID
            }, {functionName: "LoadLoginData", nativeFunc: this.loadLoginData}, {
                functionName: "GetUserInfo",
                nativeFunc: this.getUserInfo
            }, {functionName: "IsLogined", nativeFunc: this.isLogined}, {
                functionName: "OpenNewTab",
                nativeFunc: this.openNewTab
            }, {functionName: "TrackEvent", nativeFunc: this.trackEvent}, {
                functionName: "GetThunderVersion",
                nativeFunc: this.getThunderVersion
            }, {functionName: "ShowLoginDlg", nativeFunc: this.showLoginDlg}, {
                functionName: "GetPeerID",
                nativeFunc: this.getPeerID
            }, {functionName: "GetDeviceID", nativeFunc: this.getDeviceID}];
            i.BrowserCtrl.registerDefaultNativeFunction(e)
        }

        getUserID(e, t, n, i) {
            o.LoginHelperNS.loginHelper.getUserInfo("userid", function (i) {
                null !== i && void 0 !== i && "" !== i || (i = "0"), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        getSessionID(e, t, n, i) {
            o.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (i) {
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        loadLoginData(e, t, n, i) {
            let s = null;
            do {
                if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) {
                    e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError);
                    break
                }
                let l = i[0], u = i[1];
                s = "memory" === l && "initconfig" === u ? o.LoginHelperNS.loginSDKHelper.getInitData() : o.LoginHelperNS.loginSDKHelper.loadData(l, u), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, s)
            } while (0)
        }

        getUserInfo(e, t, n, i) {
            (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError);
            let s = 0;
            if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) s = 0; else {
                let e = i[0];
                s = null === e || void 0 === e || "" === e ? 0 : Number(e)
            }
            o.LoginHelperNS.loginHelper.getUserInfoEx(s, function (i) {
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        isLogined(e, t, n, i) {
            (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError), o.LoginHelperNS.loginHelper.isLogined(function (i) {
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        openNewTab(e, t, n, i) {
            do {
                if (r.isNullOrUndefined(i)) break;
                if (r.isNullOrUndefined(i[0])) break;
                let o = i[0];
                s.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", o), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success)
            } while (0)
        }

        trackEvent(e, t, n, i) {
            do {
                if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(n)) break;
                if (!i || !i[0]) {
                    e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError);
                    break
                }
                let o = i[0], s = void 0 === i[1] ? "" : i[1], u = void 0 === i[2] ? "" : i[2],
                    d = void 0 === i[3] ? 0 : i[3], c = void 0 === i[4] ? 0 : i[4], h = void 0 === i[5] ? 0 : i[5],
                    f = void 0 === i[6] ? 0 : i[6], g = void 0 === i[7] ? "" : i[7], p = void 0 === i[8] ? 0 : i[8],
                    k = l.XLStatNS.trackEvent(o, s, u, d, c, h, f, g, p);
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, k)
            } while (0)
        }

        getThunderVersion(e, t, n, i) {
            let o = u.join(__rootDir, "../../Thunder.exe"), r = d.getFileVersion(o);
            e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, r)
        }

        showLoginDlg(e, t, n, i) {
            let s = "other", l = !0;
            r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || (s = i[0]), r.isNullOrUndefined(i) || r.isNullOrUndefined(i[1]) || (l = i[1]), o.LoginHelperNS.loginHelper.showLoginDlg(s, l), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success)
        }

        getPeerID(e, t, n, i) {
            let o = d.getPeerID();
            e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, o)
        }

        getDeviceID(e, t, n, i) {
            let o = d.getPeerID();
            e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, o)
        }
    }
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (e, t) {
}, , , , , , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , , , , , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , , , function (e, t) {
}, , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}]);
//# sourceMappingURL=renderer.js.map
/*! ThunderX BY LUOCHENZHIMU */
/*! Last updated on 2019/03/18 */
/*! https://www.luochenzhimu.com */