/*! Thunder 11 BY LUOCHENZHIMU */
/*! Last updated on 2020/12/27 */
/*! https://www.luochenzhimu.com */
module.exports = function (e) {
    var t = {};

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

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

    function n(e, t, i, n, a, o, r, s) {
        var l, d = "function" == typeof e ? e.options : e;
        if (t && (d.render = t, d.staticRenderFns = i, d._compiled = !0), n && (d.functional = !0), o && (d._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)
        }, d._ssrRegister = l) : a && (l = s ? function () {
            a.call(this, this.$root.$options.shadowRoot)
        } : a), l) if (d.functional) {
            d._injectStyles = l;
            var u = d.render;
            d.render = function (e, t) {
                return l.call(t), u(e, t)
            }
        } else {
            var c = d.beforeCreate;
            d.beforeCreate = c ? [].concat(c, l) : [l]
        }
        return {exports: e, options: d}
    }

    i.d(t, "a", function () {
        return n
    })
}, function (e, t) {
    e.exports = require("path")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i, n, a, o, r, s, l, d, u, c, h, f, g, p, v, m, y, k, T, w, C;
        !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.FileOccupied = 211] = "FileOccupied", e[e.FileAccessDenied = 212] = "FileAccessDenied", 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", e[e.torrentFileNotExist = 10002] = "torrentFileNotExist"
        }(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"
        }(i = 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"
        }(n = 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[e.Invalid = 0] = "Invalid", e[e.P2sp = 1] = "P2sp", e[e.Emule = 2] = "Emule"
        }(s = e.TaskCfgType || (e.TaskCfgType = {})), function (e) {
            e.Unkown = "Unkown", e.Downloading = "Downloading", e.Completed = "Completed", e.Recycle = "Recycle"
        }(l = 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"
        }(d = 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.TotalDownloadSize = 8] = "TotalDownloadSize", e[e.CreateTime = 9] = "CreateTime", e[e.CompletionTime = 10] = "CompletionTime", e[e.DownloadingPeriod = 11] = "DownloadingPeriod", e[e.Progress = 12] = "Progress", e[e.RecycleTime = 13] = "RecycleTime", e[e.FileCreated = 14] = "FileCreated", e[e.Forbidden = 15] = "Forbidden", e[e.CategoryId = 16] = "CategoryId", e[e.UserRead = 17] = "UserRead", e[e.OpenOnComplete = 18] = "OpenOnComplete", e[e.GroupTaskId = 19] = "GroupTaskId", e[e.DownloadSubTask = 20] = "DownloadSubTask", e[e.NameType = 21] = "NameType", e[e.OwnerProduct = 22] = "OwnerProduct", e[e.FileIndex = 23] = "FileIndex", e[e.NameFixed = 24] = "NameFixed", e[e.ValidDownloadSize = 25] = "ValidDownloadSize", e[e.RealDownloadSize = 26] = "RealDownloadSize", e[e.ResourceLegal = 27] = "ResourceLegal", e[e.TaskType = 28] = "TaskType", e[e.ErrorCode = 29] = "ErrorCode", e[e.PlayPosition = 30] = "PlayPosition", e[e.Duration = 31] = "Duration", e[e.NumberEnd = 32] = "NumberEnd", e[e.BooleanStart = 4096] = "BooleanStart", e[e.Destroyed = 4097] = "Destroyed", e[e.Background = 4098] = "Background", e[e.Moving = 4099] = "Moving", e[e.BooleanEnd = 4100] = "BooleanEnd", e[e.StringStart = 8192] = "StringStart", e[e.TaskName = 8193] = "TaskName", e[e.SavePath = 8194] = "SavePath", e[e.RelativePath = 8195] = "RelativePath", e[e.TaskUrl = 8196] = "TaskUrl", e[e.RefUrl = 8197] = "RefUrl", e[e.Cid = 8198] = "Cid", e[e.Gcid = 8199] = "Gcid", e[e.Cookie = 8200] = "Cookie", e[e.ProductInfo = 8201] = "ProductInfo", e[e.Origin = 8202] = "Origin", e[e.Description = 8203] = "Description", e[e.UserData = 8204] = "UserData", e[e.OriginName = 8205] = "OriginName", e[e.HTTPContentType = 8206] = "HTTPContentType", e[e.CategoryViewId = 8207] = "CategoryViewId", e[e.YunTaskId = 8208] = "YunTaskId", e[e.StringEnd = 8209] = "StringEnd", e[e.ObjectStart = 12288] = "ObjectStart", e[e.ObjectEnd = 12289] = "ObjectEnd"
        }(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", e[e.ValidDownloadSize = 8388608] = "ValidDownloadSize", e[e.OriginName = 16777216] = "OriginName", e[e.HTTPContentType = 33554432] = "HTTPContentType", e[e.PlayPosition = 67108864] = "PlayPosition", e[e.Duration = 134217728] = "Duration", e[e.YunTaskId = 268435456] = "YunTaskId"
        }(c = e.TaskDetailChangedFlags || (e.TaskDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(h = e.BtSubFileDetailChangedFlags || (e.BtSubFileDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(f = 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.UserRead = 12] = "UserRead", e[e.PlayPosition = 13] = "PlayPosition", e[e.Duration = 14] = "Duration", e[e.NumberEnd = 15] = "NumberEnd", e[e.StringStart = 4096] = "StringStart", e[e.FinalName = 4097] = "FinalName", e[e.RelativePath = 4098] = "RelativePath", e[e.FileName = 4099] = "FileName", e[e.FilePath = 4100] = "FilePath", e[e.Cid = 4101] = "Cid", e[e.Gcid = 4102] = "Gcid", e[e.StringEnd = 4103] = "StringEnd"
        }(g = 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"
        }(p = e.KeyType || (e.KeyType = {})), function (e) {
            e[e.NameInclude = 1] = "NameInclude", e[e.BtDisplayNameInclude = 2] = "BtDisplayNameInclude"
        }(v = e.SearchKeyType || (e.SearchKeyType = {})), function (e) {
            e[e.ExtEqual = 1] = "ExtEqual", e[e.NameLikeAndExtEqual = 2] = "NameLikeAndExtEqual", e[e.TaskTypeEqual = 4] = "TaskTypeEqual"
        }(m = 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"
        }(y = e.KeyFilter || (e.KeyFilter = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.LoadTaskBasic = 0] = "LoadTaskBasic", e[e.Create = 1] = "Create", e[e.Complete = 2] = "Complete", e[e.Recycle = 3] = "Recycle", e[e.Recover = 4] = "Recover", e[e.ReDownload = 5] = "ReDownload", e[e.MoveThoughCategory = 6] = "MoveThoughCategory"
        }(k = e.TaskInsertReason || (e.TaskInsertReason = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.Manual = 0] = "Manual", e[e.PauseAll = 1] = "PauseAll", e[e.DeleteTask = 2] = "DeleteTask", e[e.TaskJammed = 3] = "TaskJammed", e[e.LowSpeed = 4] = "LowSpeed", e[e.MaxDownloadReduce = 5] = "MaxDownloadReduce", e[e.MoveTask = 6] = "MoveTask", e[e.SelectDownloadLists = 7] = "SelectDownloadLists", e[e.PrivateLoginOut = 8] = "PrivateLoginOut", e[e.FreeDownload = 9] = "FreeDownload", e[e.Exit = 10] = "Exit"
        }(T = e.TaskStopReason || (e.TaskStopReason = {})), function (e) {
            e[e.RESOURCE_FROM_MEMBER = 1] = "RESOURCE_FROM_MEMBER", e[e.RESOURCE_FROM_OFFLINE = 2] = "RESOURCE_FROM_OFFLINE", e[e.RESOURCE_FROM_CRYSTAL_LARGE = 4] = "RESOURCE_FROM_CRYSTAL_LARGE", e[e.RESOURCE_FROM_CRYSTAL_SMALL = 8] = "RESOURCE_FROM_CRYSTAL_SMALL", e[e.RESOURCE_FROM_DCDN = 16] = "RESOURCE_FROM_DCDN", e[e.RESOURCE_FROM_FREEDCDN = 32] = "RESOURCE_FROM_FREEDCDN"
        }(w = e.XLResourceFrom || (e.XLResourceFrom = {})), function (e) {
            e[e.XL_TASKDOWNLOAD_STRATEGY_NORMALDOWNLOAD = 0] = "XL_TASKDOWNLOAD_STRATEGY_NORMALDOWNLOAD", e[e.XL_TASKDOWNLOAD_STRATEGY_DOWNLOADINGPLAYING = 1] = "XL_TASKDOWNLOAD_STRATEGY_DOWNLOADINGPLAYING", e[e.XL_TASKDOWNLOAD_STRATEGY_ONLINEPLAYING = 2] = "XL_TASKDOWNLOAD_STRATEGY_ONLINEPLAYING"
        }(C = e.XLDownloadStrategy || (e.XLDownloadStrategy = {}))
    }(t.DownloadKernel || (t.DownloadKernel = {}))
}, function (e, t) {
    e.exports = require("util")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(515), r = i(55), s = i(115);

    function l(e) {
        s.information("on object freeer"), global.__xdasIPCClienInstance.notifyFreer(e.remoteId, e.callbackId)
    }

    let d = void 0;
    global.__xdasIPCClienInstance || (global.__xdasIPCClienInstance = new class extends a.EventEmitter {
        constructor() {
            super(), this.rid = 0, this.apis = {}, this.singletonMap = {}, this.connectedMap = {}, this.retCallbackMap = {}, this.eventCallbackMaps = {}, this.contextCallbackMap = {}
        }

        start(e, t, i, n) {
            do {
                if (t || (t = r.getDefaultPrex()), this.singletonMap.hasOwnProperty(t.toLowerCase())) {
                    if (n) if (this.connectedMap.hasOwnProperty(t.toLowerCase())) n("connect"); else {
                        let e = this.singletonMap[t.toLowerCase()];
                        e.on("error", e => {
                            n("error", e)
                        }), e.on("connect", () => {
                            n("connect")
                        }), e.on("end", () => {
                            let t = e.isInprocess();
                            n("end", e.getContext(), i, t)
                        })
                    }
                    break
                }
                if (global.__xdasPluginConfig && global.__xdasPluginConfig.name ? e = {
                    name: global.__xdasPluginConfig.name,
                    version: global.__xdasPluginConfig.version
                } : void 0 !== e && null !== e || (e = this.parseContext()), !e) {
                    if (!this.client || !this.client.getContext()) throw new Error("no suitable context for client, please specify context with start function");
                    e = {name: this.client.getContext().name, version: this.client.getContext().version}
                }
                if (e.name === r.serverContextName) throw new Error("client context must difference from server");
                if (i && !this.client) throw new Error("connect to other product must start self firstly");
                global.__xdasPluginConfig || (global.__xdasPluginConfig = e);
                let a = new o.Client({context: e, socketPrex: t});
                this.singletonMap[t.toLowerCase()] = a, i || (this.client = a), a.on("message", e => {
                    if ("fire_event" === e.action) this.fireServerEvent(a, e.name, [e.__context].concat(e.args)); else if ("client_context_freer" === e.action) do {
                        let t = e.rid;
                        if (t) {
                            if (!this.contextCallbackMap[t]) break;
                            delete this.contextCallbackMap[t]
                        }
                    } while (0); else if ("call_client_by_id" === e.action) this.callFunctionById(a, e.rid, e.s_rid, e.args); else if ("call_client_api" === e.action) this.callRegisterFunction(a, e); else if ("check_client_function" === e.action) {
                        let t = e.method, i = !0;
                        t && this.apis && this.apis[t] || (i = !1), this.sendAdapter(a, {
                            s_rid: e.s_rid,
                            action: "check_client_function_callback",
                            success: !0,
                            data: i
                        })
                    } else if (void 0 !== e.success && null !== e.success) {
                        let t = e;
                        this.client === a && this.emit("stat_call_function_back", a.getContext(), e);
                        const i = this.retCallbackMap[t.rid].callback;
                        if (i) if (t.success) do {
                            if ("remote_client_callback" === e.action && e.__context && e.__context.name && e.__context.productId) {
                                let n = `${e.__context.productId}-${e.__context.name}`.toLowerCase();
                                i(null, this.decodeParameter(t.data, n));
                                break
                            }
                            i(null, t.data)
                        } while (0); else i(t.error, t.data);
                        delete this.retCallbackMap[t.rid]
                    }
                }), a.on("error", e => {
                    n && n("error", e), this.emit("socket-error", e, a.getContext(), i, a.isInprocess()), delete this.singletonMap[t.toLowerCase()], delete this.connectedMap[t.toLowerCase()], i || (this.client = null)
                }), a.isInprocess() ? (this.connectedMap[t.toLowerCase()] = a, n && n("connect"), this.emit("connect", a.getContext(), i, !0)) : a.on("connect", () => {
                    this.connectedMap[t.toLowerCase()] = a, n && n("connect"), this.emit("connect", a.getContext(), i, !1)
                }), a.on("end", () => {
                    let e = a.isInprocess();
                    s.information("server is ended, and this client emit end", t, i, e), n && n("end", a.getContext(), i, e), this.emit("end", a.getContext(), i, e), delete this.singletonMap[t.toLowerCase()], delete this.connectedMap[t.toLowerCase()], i || (this.client = null)
                }), this.registry(a)
            } while (0)
        }

        registerFunctions(e) {
            do {
                if (!e) break;
                let t = void 0;
                for (let i in e) if (this.apis.hasOwnProperty(i)) {
                    t = i;
                    break
                }
                if (t) throw new Error(`try to coverd function ${t}`);
                this.apis = Object.assign({}, this.apis, e)
            } while (0)
        }

        checkServerFunction(e) {
            return n(this, void 0, void 0, function* () {
                return this.internalCheckServerFunction(this.client, e)
            })
        }

        callServerFunction(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = null, n = yield this.callServerFunctionEx(e, ...t);
                return n && (i = n[0]), i
            })
        }

        callServerFunctionEx(e, ...t) {
            return this.internalCallServerFunctionEx(this.client, e, ...t)
        }

        isRemoteClientExist(e) {
            return this.internalIsRemoteClientExist(this.client, e)
        }

        checkRemoteFunction(e, t) {
            return this.internalCheckRemoteFunction(this.client, e, t)
        }

        callRemoteClientFunction(e, t, ...i) {
            return this.internalCallRemoteClientFunction(this.client, e, t, ...i)
        }

        notifyFreer(e, t) {
            this.sendAdapter(this.client, {action: "client_context_freer", dst: e, rid: t})
        }

        callRemoteContextById(e, t, ...i) {
            this.sendAdapter(this.client, {dst: e, action: "call_remote_context_by_id", rid: t, args: i})
        }

        attachServerEvent(e, t) {
            return this.internalAttachServerEvent(this.client, e, t)
        }

        detachServerEvent(e, t) {
            this.internalDetachServerEvent(this.client, e, t)
        }

        broadcastEvent(e, ...t) {
            this.sendAdapter(this.client, {action: "broadcast", name: e, args: t})
        }

        crossCheckServerFunction(e, t) {
            return n(this, void 0, void 0, function* () {
                {
                    if (!e) throw new Error("An argument for 'productId' was not provided");
                    let i = this.singletonMap[e.toLowerCase()];
                    if (!i) throw new Error("Please call the 'start' interface first");
                    return this.internalCheckServerFunction(i, t)
                }
            })
        }

        crossCallServerFunction(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                let n = null, a = yield this.crossCallServerFunctionEx(e, t, ...i);
                return a && (n = a[0]), n
            })
        }

        crossCallServerFunctionEx(e, t, ...i) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let n = this.singletonMap[e.toLowerCase()];
                if (!n) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'funcName' was not provided");
                return this.internalCallServerFunctionEx(n, t, ...i)
            }
        }

        crossIsRemoteClientExist(e, t) {
            return n(this, void 0, void 0, function* () {
                {
                    if (!e) throw new Error("An argument for 'productId' was not provided");
                    let i = this.singletonMap[e.toLowerCase()];
                    if (!i) throw new Error("Please call the 'start' interface first");
                    return this.internalIsRemoteClientExist(i, t)
                }
            })
        }

        crossCheckRemoteFunction(e, t, i) {
            return n(this, void 0, void 0, function* () {
                {
                    if (!e) throw new Error("An argument for 'productId' was not provided");
                    let n = this.singletonMap[e.toLowerCase()];
                    if (!n) throw new Error("Please call the 'start' interface first");
                    if (!t) throw new Error("An argument for 'remoteId' was not provided");
                    if (!i) throw new Error("An argument for 'funcName' was not provided");
                    return this.internalCheckRemoteFunction(n, t, i)
                }
            })
        }

        crossCallRemoteClientFunction(e, t, i, ...n) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let a = this.singletonMap[e.toLowerCase()];
                if (!a) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'remoteId' was not provided");
                if (!i) throw new Error("An argument for 'funcName' was not provided");
                return this.internalCallRemoteClientFunction(a, t, i, ...n)
            }
        }

        crossAttachServerEvent(e, t, i) {
            let n = void 0;
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let a = this.singletonMap[e.toLowerCase()];
                if (!a) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'eventName' was not provided");
                n = this.internalAttachServerEvent(a, t, i)
            }
            return n
        }

        crossDetachServerEvent(e, t, i) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let n = this.singletonMap[e.toLowerCase()];
                if (!n) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'eventName' was not provided");
                this.internalDetachServerEvent(n, t, i)
            }
        }

        crossBroadcastEvent(e, t, ...i) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let n = this.singletonMap[e.toLowerCase()];
                if (!n) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'eventName' was not provided");
                this.sendAdapter(n, {
                    action: "broadcast",
                    name: t,
                    args: i,
                    __context: Object.assign({}, this.client.getContext())
                })
            }
        }

        registry(e) {
            let t = this.getFullContextName(this.client);
            return new Promise((i, n) => {
                do {
                    if (!t) {
                        i(!1);
                        break
                    }
                    let n = this.generateId();
                    const a = {alias: t, action: "register", rid: n};
                    let o = (e, n) => {
                        e ? (s.error("register error", e.message), i(n)) : i(t)
                    };
                    this.retCallbackMap[n] = Object.assign({callback: o}, a), this.sendAdapter(e, a)
                } while (0)
            })
        }

        getNow() {
            return Date.now()
        }

        sendAdapter(e, t) {
            do {
                if (!t) break;
                let i = this.getNow();
                if (t.timestamp ? t.timestamp = [...t.timestamp].concat(i) : t.timestamp = [].concat(i), !t.__context) {
                    let i = e.getContext();
                    i && (t = Object.assign({__context: i}, t))
                }
                e.isInprocess() ? (s.information("send to server in process"), global.__xdasIPCServer.emit("message", t, e)) : e.send(t)
            } while (0)
        }

        parseContext() {
            let e = void 0;
            do {
                let t = "";
                for (let e = 0; e < process.argv.length; e++) {
                    let i = process.argv[e];
                    if (0 === i.indexOf("--xdas-plugin-name=", 0)) {
                        t = i.substr("--xdas-plugin-name=".length);
                        break
                    }
                }
                if (!t) break;
                e = {name: t}
            } while (0);
            return e
        }

        generateId() {
            return this.rid++
        }

        getFullContextName(e, t) {
            let i = "";
            do {
                if (t === r.serverContextName) {
                    i = t;
                    break
                }
                if (void 0 === t) {
                    i = `${e.getContext().productId}-${e.getContext().name}`.toLowerCase();
                    break
                }
                i = `${e.getContext().productId}-${t}`.toLowerCase()
            } while (0);
            return i
        }

        internalCheckServerFunction(e, t) {
            return new Promise((i, n) => {
                do {
                    if (!e) {
                        i(!1);
                        break
                    }
                    if (!t) {
                        i(!1);
                        break
                    }
                    let n = this.generateId();
                    const a = {action: "check_server_function_exist", method: t, rid: n};
                    let o = (e, t) => {
                        i(!e && t)
                    };
                    this.retCallbackMap[n] = Object.assign({callback: o}, a), this.sendAdapter(e, a)
                } while (0)
            })
        }

        internalCallServerFunctionEx(e, t, ...i) {
            return new Promise((n, a) => {
                do {
                    if (!e) {
                        n([null, "client doesn't ready"]);
                        break
                    }
                    if (!t) {
                        n([null, "funcName is not specifed"]);
                        break
                    }
                    e === this.client && this.emit("stat_call_function", this.client.getContext(), t);
                    let a = this.generateId();
                    if (i) for (let e = 0; e < i.length; e++) i[e] = this.convertFunction2IdEx(i[e]);
                    const o = {rid: a, method: t, args: i};
                    let r = (t, i) => {
                        t ? (s.error("callServerFunction error", t, e.getContext()), n([null, t])) : n([i, void 0])
                    };
                    this.retCallbackMap[a] = Object.assign({callback: r}, o), this.sendAdapter(e, o)
                } while (0)
            })
        }

        internalIsRemoteClientExist(e, t) {
            return new Promise((i, n) => {
                do {
                    if (!t) {
                        i([!1, "remote client alias is not specifed"]);
                        break
                    }
                    if (e === this.client && t.toLowerCase() === e.getContext().name.toLowerCase()) {
                        i([!0, "self is exist"]);
                        break
                    }
                    let n = this.generateId();
                    const a = {dst: this.getFullContextName(e, t), action: "check_client_exist", rid: n};
                    let o = (e, t) => {
                        i(e ? [!1, e] : [t, "success"])
                    };
                    this.retCallbackMap[n] = Object.assign({callback: o}, a), this.sendAdapter(e, a)
                } while (0)
            })
        }

        internalCheckRemoteFunction(e, t, i) {
            return new Promise((n, a) => {
                do {
                    if (!e) {
                        n(!1);
                        break
                    }
                    if (!t) {
                        n(!1);
                        break
                    }
                    if (!i) {
                        n(!1);
                        break
                    }
                    if (e === this.client && t.toLowerCase() === e.getContext().name.toLowerCase()) {
                        n(!(!this.apis || !this.apis[i]));
                        break
                    }
                    let a = this.generateId();
                    const o = {
                        action: "check_client_function_exist",
                        method: i,
                        rid: a,
                        src: this.getFullContextName(this.client),
                        dst: this.getFullContextName(e, t)
                    };
                    let r = (e, t) => {
                        n(!e && t)
                    };
                    this.retCallbackMap[a] = Object.assign({callback: r}, o), this.sendAdapter(e, o)
                } while (0)
            })
        }

        internalCallRemoteClientFunction(e, t, i, ...n) {
            return new Promise((a, o) => {
                do {
                    if (!e) {
                        a([null, "client doesn't ready"]);
                        break
                    }
                    if (!t) {
                        a([null, "remote client alias is not specifed"]);
                        break
                    }
                    if (!i) {
                        a([null, "funcName is not specifed"]);
                        break
                    }
                    let o = (e, t) => {
                        e ? (s.information("callRemoteClientFunction", e.message), a([null, e])) : a([t, void 0])
                    };
                    if (n) for (let e = 0; e < n.length; e++) n[e] = this.convertFunction2IdEx(n[e]);
                    let r = this.generateId();
                    const l = {
                        src: this.getFullContextName(this.client),
                        dst: this.getFullContextName(e, t),
                        action: "call_remote_client_api",
                        method: i,
                        args: n,
                        rid: r
                    };
                    this.retCallbackMap[r] = Object.assign({callback: o}, l), this.sendAdapter(e, l)
                } while (0)
            })
        }

        internalAttachServerEvent(e, t, i) {
            let n = e.getContext().productId.toLowerCase();
            this.eventCallbackMaps.hasOwnProperty(n) || (this.eventCallbackMaps[n] = {}), this.eventCallbackMaps[n].hasOwnProperty(t) || (this.eventCallbackMaps[n][t] = {}), r.isObjectEmpty(this.eventCallbackMaps[n][t]) && this.sendAdapter(e, {
                action: "attach_event",
                name: t
            });
            let a = this.generateId();
            return this.eventCallbackMaps[n][t][a] = i, a
        }

        internalDetachServerEvent(e, t, i) {
            let n = e.getContext().productId.toLowerCase();
            do {
                if (!this.eventCallbackMaps.hasOwnProperty(n)) break;
                if (!this.eventCallbackMaps[n].hasOwnProperty(t)) break;
                delete this.eventCallbackMaps[n][t][i], r.isObjectEmpty(this.eventCallbackMaps[n][t]) && this.sendAdapter(e, {
                    action: "detach_event",
                    name: t
                })
            } while (0)
        }

        fireServerEvent(e, t, ...i) {
            let n = e.getContext().productId.toLowerCase();
            do {
                if (!this.eventCallbackMaps.hasOwnProperty(n)) break;
                if (!this.eventCallbackMaps[n].hasOwnProperty(t)) break;
                let e = this.eventCallbackMaps[n][t];
                for (let t in e) {
                    let n = e[t];
                    n && n.apply(null, ...i)
                }
            } while (0)
        }

        callFunctionById(e, t, i, ...n) {
            let a = void 0, o = !1;
            do {
                const r = this.contextCallbackMap[t];
                if (!r) {
                    s.error("the context function has been freeer", t), a = {
                        s_rid: i,
                        action: "call_client_by_id_callback",
                        success: !1,
                        error: "the context function has been freeer"
                    };
                    break
                }
                let l = void 0, d = void 0;
                try {
                    l = r.apply(null, ...n)
                } catch (e) {
                    d = e.message;
                    break
                }
                if (void 0 === i || null === i) break;
                if (a = {s_rid: i, action: "call_client_by_id_callback", success: !1}, void 0 !== d) {
                    a.error = d;
                    break
                }
                if (l && l.then) {
                    l.then(t => {
                        a.data = this.convertFunction2IdEx(t), a.success = !0, this.sendAdapter(e, a)
                    }).catch(t => {
                        a.error = t instanceof Error ? t.message : t, this.sendAdapter(e, a)
                    }), o = !0;
                    break
                }
                a.success = !0, a.data = this.convertFunction2IdEx(l)
            } while (0);
            !o && a && this.sendAdapter(e, a)
        }

        convertFunction2IdEx(e) {
            let t = e;
            if ("function" == typeof e) {
                let i = this.generateId();
                this.contextCallbackMap[i] = e, t = {"__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}": i}
            } else if (e && "object" == typeof e) {
                t = Array.isArray(e) ? [...e] : Object.assign({}, e);
                for (let e in t) {
                    let i = t[e];
                    if ("function" == typeof i) {
                        let n = this.generateId();
                        this.contextCallbackMap[n] = i, t[e] = {"__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}": n}
                    } else i && "object" == typeof i && (t[e] = this.convertFunction2IdEx(i))
                }
            }
            return t
        }

        decodeParameter(e, t) {
            let i = e;
            do {
                if (!e) break;
                if (!t) break;
                if ("object" != typeof e) break;
                let n = e["__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}"];
                if (n) {
                    i = ((...e) => {
                        this.callRemoteContextById(t, n, ...e)
                    }), global.__xdasObjectLiftMonitor && global.__xdasObjectLiftMonitor.setObjectFreer(i, {
                        remoteId: t,
                        callbackId: n
                    }, l);
                    break
                }
                for (let i in e) {
                    let n = e[i];
                    e[i] = this.decodeParameter(n, t)
                }
            } while (0);
            return i
        }

        callRegisterFunction(e, t) {
            let i = void 0, n = !1;
            do {
                if (!t) break;
                let a = t.method;
                if (!a) break;
                let o = this.getNow();
                if (i = {
                    s_rid: t.s_rid,
                    action: "remote_client_callback",
                    success: !1,
                    rid: t.rid,
                    method: t.method,
                    src: t.src,
                    timestamp: t.timestamp ? t.timestamp.concat(o) : [].concat(o)
                }, !this.apis || !this.apis[a]) {
                    i.error = `callRegisterFunction ${a} is undefined`;
                    break
                }
                let r = void 0, s = this.decodeParameter(t.args, t.src);
                try {
                    r = this.apis[a].apply(null, [t.src].concat(s))
                } catch (e) {
                    i.error = e.message;
                    break
                }
                if (r && r.then) {
                    r.then(t => {
                        i.data = this.convertFunction2IdEx(t), i.success = !0, this.sendAdapter(e, i)
                    }).catch(t => {
                        i.error = t instanceof Error ? t.message : t, this.sendAdapter(e, i)
                    }), n = !0;
                    break
                }
                i.success = !0, i.data = this.convertFunction2IdEx(r)
            } while (0);
            s.information("callRegisterFunction", i), !n && i && this.sendAdapter(e, i)
        }
    }), d = global.__xdasIPCClienInstance, t.client = d
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

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

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

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

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

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

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

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

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

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

        e.readFileAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const i = r(a.readFile);
                    try {
                        t = yield i(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }, e.writeFileAW = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                if (void 0 !== e && null !== t) {
                    const n = r(a.writeFile);
                    try {
                        yield n(e, t), i = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return i
            })
        }, e.existsAW = t, e.dirExistsAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    if (!(i = yield t(e))) break;
                    let n = yield h(e);
                    if (!n) break;
                    i = n.isDirectory()
                } while (0);
                return i
            })
        }, e.mkdirAW = l, e.rmdirAW = d, e.unlinkAW = u, e.readdirAW = c, e.lstatAW = h, e.rmdirsAW = g, e.mkdirsAW = p, e.renameAW = function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (void 0 !== e && void 0 !== t) {
                    const i = r(a.rename);
                    try {
                        yield i(e, t)
                    } catch (e) {
                        s.warning(e)
                    }
                }
            })
        }, e.copyFileAW = v, e.copyDirsAW = function e(i, a) {
            return n(this, void 0, void 0, function* () {
                let n = !1, r = yield h(i);
                if (r.isDirectory()) {
                    n = yield p(a);
                    let s = (yield c(i)) || [];
                    for (let l = 0; l < s.length; l++) {
                        let d = o.join(i, s[l]), u = o.join(a, s[l]);
                        (n = yield t(d)) && (n = (r = yield h(d)).isDirectory() ? yield e(d, u) : yield v(d, u))
                    }
                }
                return n
            })
        }, e.mkdtempAW = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                const t = r(a.mkdtemp), n = (yield Promise.resolve().then(() => i(59))).tmpdir();
                try {
                    e = yield t(`${n}${o.sep}`)
                } catch (e) {
                    s.warning(e)
                }
                return e
            })
        }, e.deleteEmptySubDirs = function (e, i) {
            return n(this, void 0, void 0, function* () {
                let n = !0;
                e = o.normalize(e), i = o.normalize(i), e.length > 3 && "\\" === e[e.length - 1] && (e = e.slice(0, e.length - 1)), i.length > 3 && "\\" === i[i.length - 1] && (i = i.slice(0, i.length - 1));
                do {
                    if (0 !== e.indexOf(i)) {
                        n = !1;
                        break
                    }
                    let a = e;
                    for (; a !== i;) {
                        if ((yield t(a)) && !(yield d(a))) {
                            n = !1;
                            break
                        }
                        a = o.dirname(a)
                    }
                } while (0);
                return n
            })
        }, e.getFileSize = function e(i) {
            return n(this, void 0, void 0, function* () {
                let n = 0;
                do {
                    if (!i) break;
                    if (!(yield t(i))) break;
                    let a = yield h(i);
                    if (a) if (a.isDirectory()) {
                        let t = yield c(i);
                        for (let a = 0; a < t.length; a++) n += (yield e(o.join(i, t[a])))
                    } else n = a.size
                } while (0);
                return n
            })
        }, e.isDirectoryEmptyAW = function (e, i = !0) {
            return n(this, void 0, void 0, function* () {
                let n = !0;
                do {
                    if (!e) {
                        n = !1;
                        break
                    }
                    if (!(yield t(e))) {
                        n = i;
                        break
                    }
                    let a = yield h(e);
                    if (!a) {
                        n = !1;
                        break
                    }
                    if (!a.isDirectory()) {
                        n = !1;
                        break
                    }
                    if ((yield c(e)).length > 0) {
                        n = !1;
                        break
                    }
                } while (0);
                return n
            })
        }
    }(t.FileSystemAWNS || (t.FileSystemAWNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.default = function (e) {
        return require(e)
    }
}, function (e, t, i) {
    e.exports = i(58)(208)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(45), o = i(2), r = i(0), s = i(42), l = i(6), d = i(14), u = i(13), c = r.default.getLogger("Config");

    class h {
        constructor() {
            this.isInit = !1, this.configData = {}, this.configPath = void 0, this.configBakPath = void 0, this.eventContainer = new s.default, this.changed = !1, this.timer = null, this.eventContainer.setMaxListeners(0)
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    this.configPath = e, this.configBakPath = e + ".bak";
                    let t = null, i = yield l.FileSystemAWNS.existsAW(e);
                    if (i) {
                        let i = yield l.FileSystemAWNS.readFileAW(e);
                        if (i && i.length > 0) try {
                            t = JSON.parse(i.toString())
                        } catch (e) {
                            c.warning(e)
                        }
                    }
                    if (!t && (i = yield l.FileSystemAWNS.existsAW(this.configBakPath))) {
                        let e = yield l.FileSystemAWNS.readFileAW(this.configBakPath);
                        if (e && e.length > 0) try {
                            t = JSON.parse(e.toString())
                        } catch (e) {
                            c.warning(e)
                        }
                    }
                    t && this.mergeConfigData(t), this.isInit = !0, this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventConfigInitFinished)
                }
                this.timer || (this.timer = setInterval(() => {
                    this.changed && (this.changed = !1, this.save().catch())
                }, 5e3))
            })
        }

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

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

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

        isInitConfigFinished() {
            return this.isInit
        }

        getNetDiscVODCachePath() {
            return n(this, void 0, void 0, function* () {
                yield this.ensureConfigFisihed();
                let e = this.getValue("ThunderPanPlugin", "defaultDownloadPath", "");
                if (!e) {
                    let t = this.getValue("ThunderPanPlugin", "downloadPaths", []);
                    t && t.length > 0 && (e = t[0])
                }
                if (e) e = o.join(e, "云盘缓存"); else {
                    let t = yield u.ThunderUtil.getThunderTempPath(!0);
                    e = o.join(t, "云盘取回", "云盘缓存")
                }
                return e
            })
        }

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

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

        attachListener(e, t) {
            do {
                if (e === d.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)
        }

        prependListener(e, t) {
            do {
                if (e === d.NodeEventMesssageNS.eventConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.prependOnceListener(e, t);
                    break
                }
                this.eventContainer.prependListener(e, t)
            } while (0)
        }

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

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

        ensureConfigFisihed() {
            return new Promise((e, t) => {
                this.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    e()
                })
            })
        }
    }

    t.Config = h;
    const f = new h;
    !function (e) {
        e.init = function (e) {
            return n(this, void 0, void 0, function* () {
                yield f.init(e)
            })
        }, e.getNetDiscVODCachePath = function () {
            return n(this, void 0, void 0, function* () {
                return yield f.getNetDiscVODCachePath()
            })
        }, e.isInitConfigFinished = function () {
            return f.isInitConfigFinished()
        }, e.save = function () {
            return n(this, void 0, void 0, function* () {
                yield f.save()
            })
        }, e.saveSync = function () {
            f.saveSync()
        }, e.getValue = function (e, t, i) {
            return f.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            f.setValue(e, t, i)
        }, e.attachListener = function (e, t) {
            f.attachListener(e, t)
        }, e.prependListener = function (e, t) {
            f.prependListener(e, t)
        }, e.detachListener = function (e, t) {
            f.detachListener(e, t)
        }
    }(t.ConfigNS || (t.ConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(7), r = i(0).default.getLogger("XLStat");
    let s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

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

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

    !function (e) {
        let t = null;

        function i() {
            return t || (t = s.xlstat4), t
        }

        function a(e, t = "", a = "", o = 0, s = 0, d = 0, u = 0, c = "", h = 0) {
            return n(this, void 0, void 0, function* () {
                let n = 0;
                do {
                    if (void 0 === e) {
                        n = 1;
                        break
                    }
                    let f = l(c);
                    n = "browser" === process.type ? yield new Promise(r => {
                        n = i().asyncTrackEvent(e, t, a, o, s, d, u, f, h, e => {
                            r(e)
                        })
                    }) : i().trackEvent(e, t, a, o, s, d, u, f, h), r.information(e, t, a, o, s, d, u, f, h)
                } while (0);
                return n
            })
        }

        function o(e, t = 0) {
            do {
                if (void 0 === e) break;
                "browser" !== process.type && i().trackClick(e, t)
            } while (0)
        }

        e.asyncTrackEvent = a, e.trackEvent = function (e, t = "", i = "", n = 0, o = 0, r = 0, s = 0, l = "", d = 0) {
            a(e, t, i, n, o, r, s, l, d).catch()
        }, e.trackClick = o, e.trackShow = function (e, t = 0) {
            o(e, t)
        }, e.setUserID = function (e = 0, t = 0) {
            "browser" !== process.type && i().setUserID(e, t)
        }, e.initParam = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = -1;
                return t = "browser" === process.type ? yield new Promise(t => {
                    i().asyncInitParam(e, (e, i) => {
                        t(e ? i : -1)
                    })
                }) : yield new Promise(t => {
                    i().initParamRemote(e, e => {
                        t(e)
                    })
                })
            })
        }, e.asyncUninit = function (e) {
            return n(this, void 0, void 0, function* () {
                "browser" === process.type && (yield new Promise(t => {
                    i().asyncUninit(e, () => {
                        t()
                    })
                }))
            })
        }, e.uninit = function () {
            "browser" === process.type && i().waitFinish()
        }
    }(t.XLStatNS || (t.XLStatNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0).default.getLogger("async-remote-call"), o = i(517), r = i(19), s = i(4);
    t.asyncRemoteCall = new class extends r.EventEmitter {
        constructor() {
            super(), this.mapObj = new Map, this.mapObjIniting = new Map, "renderer" !== process.type && a.warning('can not import "renderer-process-call" module in non-renderer process', process.type)
        }

        getAppName() {
            return n(this, void 0, void 0, function* () {
                if (void 0 === this.appName) {
                    let e = yield this.getApp();
                    this.appName = yield e.getName()
                }
                return this.appName
            })
        }

        getAppVersion() {
            return n(this, void 0, void 0, function* () {
                if (void 0 === this.appVersion) {
                    let e = yield this.getApp();
                    this.appVersion = yield e.getVersion()
                }
                return this.appVersion
            })
        }

        getProcess() {
            return n(this, void 0, void 0, function* () {
                return o.global.process.__resolve()
            })
        }

        getIpcMain() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("ipcMain")
            })
        }

        getDialog() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("dialog")
            })
        }

        getApp() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("app")
            })
        }

        getShell() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("shell")
            })
        }

        getMenu() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("Menu")
            })
        }

        getScreen() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("screen")
            })
        }

        getBrowserWindow() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("BrowserWindow")
            })
        }

        getWebContents() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("webContents")
            })
        }

        getGlobalShortcut() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("globalShortcut")
            })
        }

        getCurrentWebContents() {
            return n(this, void 0, void 0, function* () {
                let e = this.mapObj.get("currentWebContents");
                return void 0 === e && (this.mapObjIniting.get("currentWebContents") ? e = yield new Promise(e => n(this, void 0, void 0, function* () {
                    this.on("OnInitCurrentWebContents", t => {
                        e(t)
                    })
                })) : (this.mapObjIniting.set("currentWebContents", !0), e = yield o.getCurrentWebContents().__resolve(), this.mapObjIniting.set("currentWebContents", !1), this.emit("OnInitCurrentWebContents", e), this.listeners("OnInitCurrentWebContents").forEach(e => {
                    this.removeListener("OnInitCurrentWebContents", e)
                })), this.mapObj.set("currentWebContents", e)), e
            })
        }

        getCurrentWindow() {
            return n(this, void 0, void 0, function* () {
                let e = this.mapObj.get("currentWindow");
                return void 0 === e && (this.mapObjIniting.get("currentWindow") ? e = yield new Promise(e => n(this, void 0, void 0, function* () {
                    this.on("OnInitCurrentWindow", t => {
                        e(t)
                    })
                })) : (this.mapObjIniting.set("currentWindow", !0), e = yield o.getCurrentWindow().__resolve(), this.mapObjIniting.set("currentWindow", !1), this.emit("OnInitCurrentWindow", e), this.listeners("OnInitCurrentWindow").forEach(e => {
                    this.removeListener("OnInitCurrentWindow", e)
                })), this.mapObj.set("currentWindow", e)), e
            })
        }

        getCurrentObject(e) {
            return n(this, void 0, void 0, function* () {
                let t = this.mapObj.get(e);
                return s.isNullOrUndefined(t) && (this.mapObjIniting.get(e) ? t = yield new Promise(t => n(this, void 0, void 0, function* () {
                    this.on(e, e => {
                        t(e)
                    })
                })) : (this.mapObjIniting.set(e, !0), t = yield o.electron[e].__resolve(), this.mapObjIniting.set(e, !1), this.emit(e, t), this.listeners(e).forEach(t => {
                    this.removeListener(e, t)
                })), this.mapObj.set(e, t)), t
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(2), r = i(0), s = i(7), l = i(42), d = i(6), u = i(14), c = i(43), h = i(3), f = i(30),
        g = i(533), p = i(15), v = i(40), m = i(26), y = i(33), k = i(5), T = i(4), w = i(47), C = i(22), S = i(38),
        I = i(51), b = i(119), _ = p.DownloadKernelEventManager.getEventManager(),
        D = v.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        A = m.DownloadKernelCategoryManager.getCategoryManager(), N = r.default.getLogger("DownloadKernel.TaskManager"),
        x = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

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

        getStartTaskIDs() {
            return this.startTasks
        }

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

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

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

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

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

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

        batchStopTask(e, t) {
            let i = [], n = [];
            for (let t = 0; t < e.length; ++t) {
                let a = this.tasks.get(e[t]);
                if (a) {
                    a.getTaskStatus() === h.DownloadKernel.TaskStatus.StartWaiting ? i.push(a) : n.push(a)
                }
            }
            let a = [];
            for (let e = 0; e < i.length; ++e) {
                let n = i[e];
                n.stop(t) && a.push(n)
            }
            for (let e = 0; e < n.length; ++e) {
                let i = n[e];
                i.stop(t) && a.push(i)
            }
            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) {
            return n(this, void 0, void 0, function* () {
                let i = this.tasks.get(e);
                return i ? i.stop(t) ? (this.taskStatusChanage([i]), i.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && i.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)) : N.warning("task stop fail! taskId", e) : N.warning("task not exist! taskId", e), this.attachTaskStopOnce(e)
            })
        }

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

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

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

        batchRemoveToRecycle(e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = [];
                for (let n = 0; n < e.length; ++n) {
                    let a = this.tasks.get(e[n]), o = a.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.StartPending || o === h.DownloadKernel.TaskStatus.Started ? i.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), D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).insertTask(t, h.DownloadKernel.TaskInsertReason.Recycle)
                }
                i.length > 0 && i.forEach(e => n(this, void 0, void 0, function* () {
                    let t = e.getId();
                    if (yield this.stopTaskAW(t, h.DownloadKernel.TaskStopReason.DeleteTask), e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId) === h.DownloadKernel.CategroyViewID.Completed) {
                        let t = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed), i = [e];
                        t.removeTask(i)
                    } else {
                        D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).removeTask([e]), this.removeStartTask(t)
                    }
                    e.moveToRecycle(), D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).insertTask([e], h.DownloadKernel.TaskInsertReason.Recycle)
                }))
            })
        }

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

        batchRecoverFromRecycle(e) {
            let t = [], i = [], n = [], 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 ? i.push(e) : n.push(e)
                    }
                }
            }
            if (f.ThunderKernel.commitTransaction(a), t.length > 0) {
                D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).removeTask(t)
            }
            if (i.length > 0) {
                D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).insertTask(i, h.DownloadKernel.TaskInsertReason.Recover)
            }
            if (n.length > 0) {
                D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).insertTask(n, h.DownloadKernel.TaskInsertReason.Recover)
            }
        }

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

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

        moveCategoryTask(e, t) {
            let i = !1, n = this.getTaskFromTaskId(e);
            do {
                if (!n) break;
                let e = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 === t || e === t) break;
                let a = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId), o = null;
                if (!(o = -1 === e ? D.getCategoryViewFromId(a) : A.getCategoryView(e, a))) break;
                let r = null;
                if (!(r = -1 === t ? D.getCategoryViewFromId(a) : A.getCategoryView(t, a))) break;
                let s = [];
                if (s.push(n), o.removeTask(s), 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)
                    }
                }
                r.insertTask(s, h.DownloadKernel.TaskInsertReason.MoveThoughCategory), i = !0
            } while (0);
            let a = [];
            return a[0] = i ? n : null, _.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, a), i
        }

        getTaskCount() {
            return this.tasks.size
        }

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

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

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

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

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

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

        batchFindTaskAsync(e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = [], n = [], 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 ? i.push(l) : s.keyType === h.DownloadKernel.KeyType.BtInfoId ? n.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 && i.length <= 0 && n.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 (i.length > 0) {
                    let e = yield this.batchFindEmuleTask(i);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (n.length > 0) {
                    let e = yield this.batchFindBtTask(n);
                    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 N.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 === u.NodeEventMesssageNS.eventTaskDataBaseLoadEnd) {
                    if (this.isLoadStorageFinish) {
                        t(this.isLoadStorageFinish);
                        break
                    }
                    this.attachOnceListener(e, t);
                    break
                }
                if (e === u.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, i = void 0;
            t > 0 && (i = f.ThunderKernel.beginTransaction());
            for (let n = 0; n < this.startTasks.length; ++n) {
                let a = this.startTasks[n], 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(i)
                })), r || ++e === t && f.ThunderKernel.commitTransaction(i)
            }
            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(u.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(u.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 n(this, void 0, void 0, function* () {
                const {LoginHelperNS: t} = yield Promise.resolve().then(() => i(23));
                if (yield t.loginHelper.isLoginedAw()) t.loginHelper.getAllUserInfo(t => {
                    let i = "0", n = "", a = 0, o = "";
                    do {
                        if (!t) break;
                        if (o = t.userID, N.information(`stat dk userId ${t.userID}`, t), !t.vipList) break;
                        if (!t.vipList[0]) break;
                        if (N.information(`stat dk isVip ${t.vipList[0].isVip}`), "0" === (i = "1" === String(t.vipList[0].isVip) ? "1" : "0")) break;
                        N.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)) && (n = 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=${i},viptype=${n},viplevel=${a},userchannel=${e}`;
                    N.information("stat dk extinfo", r), f.ThunderKernel.setGlobalExtInfo(r, !1)
                }); else {
                    f.ThunderKernel.setUserInfo("", "");
                    let t = `isvip=0,viptype=,viplevel=0,userchannel=${e}`;
                    N.information("stat dk extinfo", t), f.ThunderKernel.setGlobalExtInfo(t, !1)
                }
            })
        }

        isDkLoaded() {
            return this.isInitDkFinish
        }

        initDownloadKernelStart() {
            this.isInitingDk = !0
        }

        initDownloadKernelEnd(e) {
            this.isInitingDk = !1, this.isInitDkFinish = 0 === e, this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, e)
        }

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

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

        enableCommonP2pChannel(e) {
            this.isEnableP2pChannel = e
        }

        enableCommonP2sChannel(e) {
            this.isEnableP2sChannel = e
        }

        getTotalTaskDownloadSpeed(e, t) {
            let i = 0;
            for (let n = 0; n < this.startTasks.length; ++n) {
                let a = this.startTasks[n], 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 && (i += r) : i += r
            }
            return i
        }

        getTotalTaskVipSpeed(e, t) {
            let i = 0;
            for (let n = 0; n < this.startTasks.length; ++n) {
                let a = this.startTasks[n], 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 && (i += r) : i += r
            }
            return i
        }

        attachTaskStopOnce(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let i = this.tasks.get(e);
                    if (i) {
                        let n = i.getTaskStatus();
                        if (n === h.DownloadKernel.TaskStatus.Succeeded || n === h.DownloadKernel.TaskStatus.Seeding || n === h.DownloadKernel.TaskStatus.Stopped || n === h.DownloadKernel.TaskStatus.Failed) t(!0); else {
                            let i = 0;
                            i = _.attachTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, (...n) => {
                                do {
                                    if (!n) break;
                                    if (n[0] !== h.DownloadKernel.TaskEventType.StatusChanged) break;
                                    let a = n[1];
                                    if (!a) break;
                                    for (let n = 0; n < a.length; ++n) {
                                        let o = a[n];
                                        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 || (_.detachTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, i), t(!0));
                                        break
                                    }
                                } while (0)
                            })
                        }
                    } else t(!1)
                })
            })
        }

        downloadTaskSelectFiles(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    if (!t) break;
                    let n = null;
                    try {
                        n = JSON.parse(t)
                    } catch (e) {
                        N.warning(e)
                    }
                    if (null == n) break;
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let o = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType);
                    if (o !== h.DownloadKernel.TaskType.Bt && o !== h.DownloadKernel.TaskType.Group) break;
                    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()), o === h.DownloadKernel.TaskType.Bt) {
                        a.getExtraObject().setDownloadFile(n)
                    } else if (o === h.DownloadKernel.TaskType.Group) {
                        a.getExtraObject().setDownloadTask(n)
                    }
                    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(), i = t.getFileSize();
                            a.internalSetFileSize(i) && this.taskDetailChanage([a], h.DownloadKernel.TaskDetailChangedFlags.FileSize);
                            let n = [], o = t.getBtFileList();
                            for (let [, e] of o) {
                                let t = e.getBtDownloadFileInfo();
                                n.push(t)
                            }
                            _.fireTaskEvent(h.DownloadKernel.TaskEventType.BtSubFileDetailChanged, e, n)
                        }
                    } else 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 ? A.getCategoryView(t, h.DownloadKernel.CategroyViewID.Completed) : D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed)) {
                            let t = [];
                            t.push(a), e.removeTask(t)
                        }
                        let i = null;
                        if (i = void 0 !== t && t > -1 ? A.getCategoryView(t, h.DownloadKernel.CategroyViewID.Downloading) : D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading)) {
                            if (o === h.DownloadKernel.TaskType.Group) {
                                let e = a.getExtraObject(), t = e.getSubTaskCount();
                                for (let i = 0; i < t; ++i) {
                                    let t = e.getSubTaskByIndex(i);
                                    if (t) {
                                        if (1 !== t.getTaskAttribute(h.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                                        t.getTaskStatus() === h.DownloadKernel.TaskStatus.Failed && t.updateTaskStatus(h.DownloadKernel.TaskStatus.Stopped)
                                    }
                                }
                            }
                            let e = [];
                            e.push(a), i.insertTask(e, h.DownloadKernel.TaskInsertReason.ReDownload), a.updateTaskStatus(h.DownloadKernel.TaskStatus.Stopped) && (a.setStopReason(h.DownloadKernel.TaskStopReason.SelectDownloadLists), this.taskStatusChanage([a]), a.setStopReason(h.DownloadKernel.TaskStopReason.Unknown))
                        }
                    }
                    i = !0
                } while (0);
                return i
            })
        }

        batchRelateYunTask(e) {
            let t = f.ThunderKernel.beginTransaction();
            for (let t of e) b.ThunderPanTaskNS.insertTask(t.taskId, t.panId, t.user_id, JSON.stringify({
                title: t.path,
                id: t.path_id
            }));
            f.ThunderKernel.commitTransaction(t)
        }

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

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

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

        redownloadP2spTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                if (e) {
                    let n = 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(), d = null;
                    t && t.taskBaseInfo ? ((d = t.taskBaseInfo).taskName && "" !== d.taskName || (d.taskName = n), d.savePath && "" !== d.savePath || (d.savePath = a)) : d = {
                        taskName: n,
                        savePath: a
                    };
                    let u = e.getExtraObject(), c = {
                        url: o,
                        refUrl: r,
                        cookie: s,
                        useOriginResourceOnly: e.getOriginOnlyStrategy() ? 1 : 0,
                        nameFixed: u.getNameFixed()
                    };
                    t && t.p2spTaskInfo && (void 0 !== t.p2spTaskInfo.useOriginResourceOnly ? (N.information("redownload redefine orign", t.p2spTaskInfo.useOriginResourceOnly), c.useOriginResourceOnly = t.p2spTaskInfo.useOriginResourceOnly ? 1 : 0) : N.information("redownload extends origin", c.useOriginResourceOnly)), i = yield this.createTask(h.DownloadKernel.TaskType.P2sp, {
                        taskBaseInfo: d,
                        p2spTaskInfo: c,
                        privateSpace: l
                    })
                }
                return i
            })
        }

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

        redownloadEmuleTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                if (e) {
                    let n = 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 = n), s.savePath && "" !== s.savePath || (s.savePath = a)) : s = {
                        taskName: n,
                        savePath: a
                    };
                    let l = null;
                    t && t.emuleTaskInfo ? (l = t.emuleTaskInfo).url = o : l = {url: o}, i = yield this.createTask(h.DownloadKernel.TaskType.Emule, {
                        taskBaseInfo: s,
                        emuleTaskInfo: l,
                        privateSpace: r
                    })
                }
                return i
            })
        }

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

        addTask(e, t) {
            let i = !1;
            if (e) {
                let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                this.tasks.set(n, e);
                let a = this.getTaskStrategy(n);
                N.information("set taskStrategy", a), e.setDispatchStrategy(a);
                let o = null;
                t && (t.birdKey || t.searchSource) && (t.taskType === h.DownloadKernel.TaskType.P2sp ? o = e.getExtraObject() : t.taskType === h.DownloadKernel.TaskType.Bt ? o = e.getExtraObject() : t.taskType === h.DownloadKernel.TaskType.Emule ? o = e.getExtraObject() : t.taskType === h.DownloadKernel.TaskType.Group ? o = e.getExtraObject() : (t.taskType, h.DownloadKernel.TaskType.Magnet), o && (t.birdKey && o.setUserData(I.TaskUserDataGUID.guidBirdKey, "birdKey", t.birdKey), t.searchSource && o.setUserData(I.TaskUserDataGUID.guidSearchFrom, "searchFrom", t.searchSource))), i = !0
            }
            return i
        }

        findTask(e) {
            let t = -1;
            do {
                if (!this.tasks || this.tasks.size < 1) break;
                for (let i of this.tasks.values()) {
                    if (i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl) === e) {
                        t = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                        break
                    }
                }
            } while (0);
            return t
        }

        getBackgroundTasks() {
            return this.backgroundTasks
        }

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

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

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

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

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

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

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

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

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

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

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

        moveGroupTask(e, t, a) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let r = this.tasks.get(e);
                    if (!r) break;
                    let s = r.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType);
                    if (s !== h.DownloadKernel.TaskType.Group) break;
                    let l = r.getExtraObject();
                    if (!l) break;
                    if (!l.getSubTaskByIndex(0)) break;
                    let u = r.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        c = r.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName), f = o.join(u, "*"),
                        g = o.join(t, c);
                    if (r.setTaskMovingState(!0), n = yield this.moveTaskFiles(f, g, e, s), r.setTaskMovingState(!1), n) {
                        let t = l.getSubTaskCount();
                        for (let e = 0; e < t; ++e) {
                            let t = l.getSubTaskByIndex(e);
                            if (t) {
                                let e = g, i = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                                if (i === u) ; else if (i.length > u.length && i.substr(0, u.length) === u) {
                                    let t = i.slice(u.length);
                                    "\\" === t[0] && (t = t.slice(1), e = o.join(g, t))
                                }
                                t.setSavePath(e)
                            }
                        }
                        yield d.FileSystemAWNS.rmdirAW(u), r.setSavePath(g), a && (yield this.startTask(e)), k.client.callServerFunction("ShowMessageToast", {
                            message: "移动成功",
                            type: "success"
                        }).catch();
                        const {TaskUserDataGUID: n} = yield Promise.resolve().then(() => i(51));
                        let s = l.getUserData(n.guidNotSavePath, "notSavePath");
                        if (s && (u = o.normalize(u), s = o.normalize(s), 0 === u.indexOf(s))) {
                            let e = s.indexOf(":\\");
                            if (-1 !== e) {
                                let t = s.substr(0, e + ":\\".length);
                                t && d.FileSystemAWNS.deleteEmptySubDirs(s, t).catch()
                            }
                        }
                    }
                } while (0);
                return n
            })
        }

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

        getTaskCfgType(e) {
            let t = h.DownloadKernel.TaskCfgType.Invalid;
            do {
                if (e === h.DownloadKernel.TaskType.P2sp) {
                    t = h.DownloadKernel.TaskCfgType.P2sp;
                    break
                }
                if (e === h.DownloadKernel.TaskType.Emule) {
                    t = h.DownloadKernel.TaskCfgType.Emule;
                    break
                }
            } while (0);
            return t
        }

        getTaskName(e, t, i, a, r) {
            return n(this, void 0, void 0, function* () {
                let n = "";
                for (; ;) {
                    if (e === h.DownloadKernel.TaskType.P2sp || e === h.DownloadKernel.TaskType.Emule) {
                        let e = o.extname(i), t = o.basename(i, e);
                        n = 0 === a ? i : t + "(" + a.toString() + ")" + e
                    } else n = 0 === a ? i : i + "(" + a.toString() + ")";
                    let s = !1, l = o.join(t, n);
                    if ("TD" !== r && "file_drag" !== r) {
                        let t = this.getTaskCfgType(e);
                        t !== h.DownloadKernel.TaskCfgType.Invalid && (s = yield f.ThunderKernel.isDownloadTaskCfgFileExist(t, l))
                    }
                    if (!s && !(yield d.FileSystemAWNS.existsAW(l))) break;
                    ++a
                }
                return {newName: n, index: a}
            })
        }

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

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

        downloadSdkInited() {
            return n(this, void 0, void 0, function* () {
                this.isInitDkFinish || this.isInitingDk && (yield new Promise(e => n(this, void 0, void 0, function* () {
                    this.eventContainer.attachOnceListener(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                        e()
                    })
                })))
            })
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(2), r = i(0), s = i(6), l = i(34), d = r.default.getLogger("Thunder.Util"),
        u = "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(), i = 0;
            for (let n = 0; n < t.length; n++) {
                if (l.ThunderHelper.getDriveType(t[n]) === l.ThunderHelper.DriverType.DRIVE_FIXED) {
                    let a = l.ThunderHelper.getDriveInfo(t[n]);
                    i < a.freeBytes && t[n] !== e && (i = a.freeBytes, e = t[n])
                }
            }
            return e.substring(0, 1) + ":\\迅雷下载"
        }

        function r(e) {
            let t = (e.style.webkitTransform || getComputedStyle(e, "").getPropertyValue("-webkit-transform") || e.style.transform || getComputedStyle(e, "").getPropertyValue("transform")).match(/\-?[0-9]+\.?[0-9]*/g);
            return {x: parseInt(t && (t[12] || t[4]) || "0", 10), y: parseInt(t && (t[13] || t[5]) || "0", 10)}
        }

        e.formatSize = function (e, t) {
            0 === t || (t = t || 2);
            let i = "0B";
            if ("number" == typeof e && e > 0) {
                let n = ["B", "KB", "MB", "GB", "TB"], a = 0, o = e;
                for (; o >= 1e3 && !(a >= 4);) o /= 1024, a += 1;
                i = -1 === String(o).indexOf(".") ? o + n[a] : o.toFixed(t) + n[a]
            }
            return i
        }, e.formatSizeCustom = function (e, t = 2, i = 5) {
            let n = "0B";
            if ("number" == typeof e && e > 0) {
                let a = ["B", "KB", "MB", "GB", "TB"], o = 0, r = e;
                for (; r >= 1e3 && !(o >= 4);) r /= 1024, o += 1;
                if (-1 === String(r).indexOf(".")) n = r + a[o]; else {
                    let e = r.toFixed(t);
                    e.length <= i ? n = "KB" !== a[o] && "MB" !== a[o] || 1 === t ? e + a[o] : r.toFixed(1) + a[o] : ("." === (e = e.substr(0, i))[i - 1] && (e = e.substr(0, i - 1)), n = e + a[o])
                }
            }
            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), i = null;
            try {
                i = JSON.parse(t)
            } catch (e) {
                d.warning(e)
            }
            return i
        }, e.swap = function (e, t, i) {
            do {
                if (t < 0 || t >= e.length) break;
                if (i < 0 || i >= e.length) break;
                if (t === i) break;
                e[t] = e.splice(i, 1, e[t])[0]
            } while (0);
            return e
        }, e.compareNocase = function (e, t) {
            let i = !1;
            do {
                if (void 0 === e && void 0 === t) {
                    i = !0;
                    break
                }
                if (void 0 === e || void 0 === t) break;
                if ("string" != typeof e || "string" != typeof t) break;
                i = e.toLowerCase() === t.toLowerCase()
            } while (0);
            return i
        }, e.parseCommandLine = function (e) {
            let t = 0, i = "", n = !1, a = [], o = e.length;
            for (let r = 0; r < o; r++) {
                let s = e[r];
                if ('"' !== s && "'" !== s || ("" === i ? (n = !0, i = s) : i === s && (n = !1, i = "")), " " !== s || n || r === o - 1) {
                    if (r === o - 1) {
                        let i = e.substring(t);
                        "" !== i.trim() && a.push(c(i))
                    }
                } else {
                    let i = e.substring(t, r);
                    "" !== i.trim() && a.push(c(i)), t = r + 1
                }
            }
            return a
        }, e.getThunderTempPath = function (e, t) {
            return n(this, void 0, void 0, function* () {
                const n = yield Promise.resolve().then(() => i(59));
                let a = o.join(n.tmpdir(), u);
                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((i, n) => {
                e += 0 === n ? "?" : "&", e += `${i}=${t[i]}`
            }), e
        }, e.setQueryStringEx = function (e, t) {
            for (let i in t) e += -1 === e.indexOf("?") ? "?" : "&", e += `${i}=${t[i]}`;
            return 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 i of t) if ("text/plain" === i) {
                e = !0;
                break
            }
            return e
        }, e.keywordsHighLight = function (e, t, i) {
            if (!e) return "";
            if (!t) return e;
            if (0 === e.length) return e;
            if (0 === t.length) return e;
            let n = /\\/, 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(n) > 0) return e;
            i = void 0 === i || null === i ? "#FF0000" : i;
            let o = "", r = ["\\[", "\\^", "\\*", "\\(", "\\)", "\\|", "\\?", "\\$", "\\.", "\\+"], s = "", l = "|";
            for (let e = 0; e < a.length; e++) {
                for (let t = 0; t < r.length; t++) {
                    let i = new RegExp(r[t], "g");
                    a[e] = a[e].replace(i, r[t])
                }
                e === a.length - 1 && (l = ""), s = s.concat(a[e], l)
            }
            let d = new RegExp(s, "gi");
            return o = e.replace(d, e => '<span style= "color:' + i + '">' + 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, i]) => {
                e.style[t] = i
            })
        }, e.setCSSProperties = function (e, t) {
            Object.entries(t).forEach(([t, i]) => {
                e.style.setProperty(t, i)
            })
        }, e.versionCompare = function (e, t) {
            let i = e.split("."), n = t.split("."), a = 0;
            for (let e = 0; e < i.length; e++) {
                if (Number(i[e]) - Number(n[e]) > 0) {
                    a = 1;
                    break
                }
                if (Number(i[e]) - Number(n[e]) < 0) {
                    a = -1;
                    break
                }
            }
            return a
        }, e.throttle = function (e, t) {
            let i, n = 0;
            return (...a) => {
                const o = Date.now();
                clearTimeout(i), o - n > t ? (e(...a), n = o) : i = setTimeout(() => {
                    e(...a), n = o
                }, t)
            }
        }, e.debounce = function (e, t) {
            let i = null;
            return (...n) => {
                i && clearTimeout(i), i = setTimeout(() => {
                    e(...n)
                }, t)
            }
        }, e.getElementFixed = function (e) {
            let t = e.offsetLeft, i = e.offsetTop, n = e.offsetParent;
            for (; null !== n;) {
                let e = r(n);
                t += n.offsetLeft + e.x, i += n.offsetTop + e.y, n = n.offsetParent
            }
            return {x: t, y: i}
        }, e.escapeHTML = function (e) {
            return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;")
        }, e.unescapeHTML = function (e) {
            return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'")
        }, e.isValidPath = function (e) {
            let t = !1;
            do {
                let i = "", n = "";
                if (/^[a-zA-Z]:\\/.test(e)) i = e.slice(3); else {
                    if (0 !== e.indexOf("\\\\")) break;
                    {
                        let t = e.indexOf("\\", 2);
                        if (-1 === t || t === e.length - 1) break;
                        if ("" === (n = (i = e.slice(2)).substr(0, t - 2))) break
                    }
                }
                if (/[\*\"<>\?:\|]/i.test(i)) break;
                if (e.length > 256) break;
                if ("" === n) {
                    t = !0;
                    break
                }
                let a = n.indexOf(".ipv6-literal.net");
                -1 !== a ? (-1 !== (a = (n = n.substr(0, a)).indexOf("%")) && (n = n.substr(0, a)), n = n.replace(/\-/g, ":"), /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(n) && (t = !0)) : /(?=(\b|\D))(((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))(?=(\b|\D))/.test(n) && (t = !0)
            } while (0);
            return t
        };
        let h = void 0;

        function f(e, t = "normal 12px sans-serif") {
            h || (h = document.createElement("canvas"));
            let i = h.getContext("2d");
            return i.font = t, i.measureText(e).width
        }

        function g(e, t, i = "normal 12px sans-serif", n = 1) {
            function a(e, t, n, o, r) {
                let s = -1;
                do {
                    if (e > t) {
                        s = t;
                        break
                    }
                    let l = Math.round((e + t) / 2), d = f(`${n.substr(0, l)}...${o}`, i);
                    if (r === d) {
                        s = l;
                        break
                    }
                    if (r > d) {
                        if (Math.round(r) === Math.round(d)) {
                            s = l;
                            break
                        }
                        s = a(l + 1, t, n, o, r)
                    } else if (d > r) {
                        if (Math.round(r) === Math.round(d)) {
                            s = l - 1;
                            break
                        }
                        s = a(e, l - 1, n, o, r)
                    }
                } while (0);
                return s
            }

            let r = e;
            do {
                if (!t) break;
                if (!e) break;
                let s = t.offsetWidth * n;
                if (s > f(e, i)) break;
                let l = o.extname(e);
                "" !== l && (l = l.substring(1));
                let d = e.substr(0, e.length - l.length - 1);
                if (!d) break;
                let u = a(0, d.length, d, l, s);
                if (-1 === u) break;
                r = `${d.substr(0, u - 2 * (n - 1))}...${l}`
            } while (0);
            return r
        }

        e.getTextWidth = f, e.getOmitName = g, e.getOmitNameMultiLine = function (e, t, i) {
            return g(e, t, "normal 12px microsoft yahei", 2)
        }, e.setTimeoutAw = function (e, t) {
            return new Promise((i, n) => {
                setTimeout(() => {
                    t && t(), i()
                }, e)
            })
        }
    }(t.ThunderUtil || (t.ThunderUtil = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.eventPluginLoderPluginReady = "event_plugin_loader_plugin_ready", e.eventDownloadItemActive = "event_download_item_active", e.eventDownloadItemChosen = "event_download_item_chosen", e.eventDetailSwitch2Index = "event_detail_switch_to_index", e.eventDownloadSwitchCategory = "event_download_switch_category", e.evetDownloadMove2Tail = "event_download_move_to_tail", e.eventBringMainWindowToTop = "event_bring_main_window_to_top", e.eventDownloadContextMenuClick = "event_download_context_menu_click", e.eventOnCommand = "event_on_command", e.eventOnCommandline = "event_on_command_line", 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.eventMemoryConfigValueChanged = "event_memory_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.eventLoginWndCreated = "event_login_wnd_created", 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", e.eventBrowserNumberChange = "event_browser_number_change", e.eventUploadConfigInitFinished = "event_upload_config_init_finished", e.eventUploadConfigValueChanged = "event_upload_config_value_changed"
    }(t.NodeEventMesssageNS || (t.NodeEventMesssageNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});

    class n {
        constructor(e, t, i = !1) {
            this.cookie = null, this.once = !1, this.callback = null, this.ref = 0, this.callback = e, this.cookie = t, this.once = i, 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 i = new n(t, this.cookie, !1), a = this.listeners.get(e);
            return a || (a = []), a.push(i), this.listeners.set(e, a), this.cookie
        }

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

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

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

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(513), r = i(55), s = i(115);

    function l(e) {
        s.information("on object freeer"), global.__xdasIPCServerInstance.notifyFreer(e.client, e.callbackId)
    }

    let d = void 0;
    global.__xdasIPCServerInstance || (global.__xdasIPCServerInstance = new class extends a.EventEmitter {
        constructor() {
            super(), this.rid = 0, this.apis = {}, this.eventMap = {}, this.clientAliasMap = {}, this.retCallbackMap = {}, this.contextCallbackMap = {}, this.singleton = !1
        }

        registerFunctions(e) {
            do {
                if (!e) break;
                let t = void 0;
                for (let i in e) if (this.apis.hasOwnProperty(i)) {
                    t = i;
                    break
                }
                if (t) throw new Error(`try to coverd function ${t}`);
                this.apis = Object.assign({}, this.apis, e)
            } while (0)
        }

        start(e, t) {
            if (this.singleton) throw new Error("try to start server duplicate");
            this.singleton = !0, this.server = new o.Server, global.__xdasIPCServer = this.server, this.server.listen(void 0, t), e && this.registerFunctions(e), this.server.on("connect", e => {
                this.emit("connect", e)
            }), this.server.on("message", (e, t) => {
                do {
                    if ("attach_event" === e.action) {
                        this.attachEvent(e.name, t);
                        break
                    }
                    if ("detach_event" === e.action) {
                        this.detachEvent(e.name, t);
                        break
                    }
                    if ("broadcast" === e.action) {
                        if (e.__context && e.__context.name === r.serverContextName) throw new Error("client context must difference from server");
                        this.forwardEvent(e.name, e.__context, e.timestamp, ...e.args);
                        break
                    }
                    if ("call_remote_client_api" === e.action) {
                        this.callClientFunction(e, t);
                        break
                    }
                    if ("call_remote_context_by_id" === e.action) {
                        if (e.dst && this.clientAliasMap.hasOwnProperty(e.dst)) {
                            let t = this.clientAliasMap[e.dst];
                            t && this.callClientFunctionById(t, e.rid, ...e.args)
                        }
                        break
                    }
                    if ("call_client_by_id_callback" === e.action) {
                        this.fireRetCallback(e, t);
                        break
                    }
                    if ("check_client_function_callback" === e.action) {
                        this.fireRetCallback(e, t);
                        break
                    }
                    if ("remote_client_callback" === e.action) {
                        this.reply2Client(e, t);
                        break
                    }
                    if ("check_client_function_exist" === e.action) {
                        this.internalCheckClientFunction(e.dst, e.method).then(i => {
                            let n = this.getNow();
                            this.sendAdapter(t, {
                                success: !0,
                                rid: e.rid,
                                method: e.method,
                                data: i,
                                timestamp: e.timestamp ? e.timestamp.concat(n) : [].concat(n)
                            })
                        });
                        break
                    }
                    let i = this.getNow(), n = {
                        success: !1,
                        rid: e.rid,
                        method: e.method,
                        timestamp: e.timestamp ? e.timestamp.concat(i) : [].concat(i)
                    }, a = e.method;
                    do {
                        if ("register" === e.action) {
                            this.registerAlias(e, t, n), this.sendAdapter(t, n);
                            break
                        }
                        if ("client_context_freer" === e.action) {
                            if (e.dst && this.clientAliasMap.hasOwnProperty(e.dst)) {
                                let t = this.clientAliasMap[e.dst];
                                this.notifyFreer(t, e.rid)
                            }
                            break
                        }
                        if ("check_server_function_exist" === e.action) {
                            n.success = !0, n.data = !(!this.apis || !this.apis[a]), this.sendAdapter(t, n);
                            break
                        }
                        if ("check_client_exist" === e.action) {
                            n.success = !0, n.data = !1, e.dst && this.clientAliasMap.hasOwnProperty(e.dst) && (n.data = !0), this.sendAdapter(t, n);
                            break
                        }
                        if (!a) break;
                        if (!this.apis || !this.apis[a]) {
                            n.error = `${e.__context} try to call method '${a}' which is undefined`, this.sendAdapter(t, n);
                            break
                        }
                        let i = void 0, o = this.decodeParameter(e.args, t);
                        try {
                            i = this.apis[a].apply(null, [t, e.__context].concat(o))
                        } catch (e) {
                            n.error = e.message, this.sendAdapter(t, n);
                            break
                        }
                        if (i && i.then) {
                            i.then(e => {
                                n.data = e, n.success = !0, this.sendAdapter(t, n)
                            }).catch(e => {
                                n.error = e instanceof Error ? e.message : e, this.sendAdapter(t, n)
                            });
                            break
                        }
                        n.success = !0, n.data = i, this.sendAdapter(t, n)
                    } while (0)
                } while (0)
            }), this.server.on("end", e => {
                this.emit("end", e), this.clearClientInfo(e)
            }), this.server.on("error", (e, t) => {
                s.information("server error", t, t && t.code), t && "EPIPE" === t.code && this.clearClientInfo(e)
            })
        }

        fireClientEvent(e, ...t) {
            this.forwardEvent(e, {name: r.serverContextName}, void 0, ...t)
        }

        callClientFunctionById(e, t, ...i) {
            this.sendAdapter(e, {action: "call_client_by_id", rid: t, args: i})
        }

        callClientFunctionByIdAw(e, t, ...i) {
            return new Promise((n, a) => {
                {
                    let a = this.generateId(), o = (e, t) => {
                        n(e ? [null, e] : [t])
                    }, r = {s_rid: a, action: "call_client_by_id", rid: t, args: i};
                    this.retCallbackMap[a] = Object.assign({callback: o}, r), this.sendAdapter(e, r)
                }
            })
        }

        checkClientFunction(e, t) {
            return "string" == typeof e && (e = this.getFullAlias(e)), this.internalCheckClientFunction(e, t)
        }

        callClientFunctionByName(e, t, ...i) {
            return new Promise((n, a) => {
                do {
                    if (!e) {
                        n([null, null]);
                        break
                    }
                    let a = void 0;
                    if ("string" == typeof e) {
                        if (e = this.getFullAlias(e), !this.clientAliasMap.hasOwnProperty(e)) {
                            n([null, null]);
                            break
                        }
                        a = this.clientAliasMap[e]
                    } else a = e;
                    if (!a) {
                        n([null, null]);
                        break
                    }
                    let o = this.generateId(), s = (e, t, i) => {
                        n(e ? [null, i, e] : [t, i])
                    };
                    if (i) for (let e = 0; e < i.length; e++) i[e] = this.convertFunction2Id(i[e]);
                    let l = {s_rid: o, action: "call_client_api", args: i, src: r.serverContextName, method: t};
                    this.retCallbackMap[o] = Object.assign({callback: s}, l), this.sendAdapter(a, l)
                } while (0)
            })
        }

        isRemoteClientExist(e) {
            let t = !1;
            return this.clientAliasMap.hasOwnProperty(this.getFullAlias(e)) && (t = !0), t
        }

        getRemoteClient(e, t) {
            let i = null;
            do {
                if (!e) break;
                t || (t = this.server.getProductId());
                let n = `${t}-${e}`.toLowerCase();
                i = this.clientAliasMap[n]
            } while (0);
            return i
        }

        internalCheckClientFunction(e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise((i, n) => {
                    do {
                        if (!e) {
                            i(!1);
                            break
                        }
                        let n = void 0;
                        if ("string" == typeof e) {
                            if (!this.clientAliasMap.hasOwnProperty(e)) {
                                i(!1);
                                break
                            }
                            n = this.clientAliasMap[e]
                        } else n = e;
                        if (!n) {
                            i(!1);
                            break
                        }
                        let a = this.generateId(), o = (e, t) => {
                            i(!e && t)
                        }, r = {s_rid: a, action: "check_client_function", method: t};
                        this.retCallbackMap[a] = Object.assign({callback: o}, r), this.sendAdapter(n, r)
                    } while (0)
                })
            })
        }

        convertFunction2Id(e) {
            let t = e;
            if ("function" == typeof e) {
                let i = this.generateId();
                this.contextCallbackMap[i] = e, t = i
            } else if (e && "object" == typeof e) for (let t in e) {
                let i = e[t];
                if ("function" == typeof i) {
                    let n = this.generateId();
                    this.contextCallbackMap[n] = i, e[t] = n
                } else i && "object" == typeof i && (e[t] = this.convertFunction2Id(i))
            }
            return t
        }

        clearClientInfo(e) {
            for (let t in this.clientAliasMap) this.clientAliasMap[t] === e && delete this.clientAliasMap[t];
            for (let t in this.eventMap) this.detachEvent(t, e);
            for (let t in this.retCallbackMap) {
                let i = this.retCallbackMap[t];
                if (i.dstRemote === e) {
                    let e = {
                        rid: i.rid,
                        method: i.method,
                        error: "client has been ended by the other party",
                        action: "remote_client_callback",
                        success: !1
                    };
                    s.information("client has been ended by other party, but still has return callback", e), this.sendAdapter(i.remote, e), delete this.retCallbackMap[t]
                }
            }
        }

        registerAlias(e, t, i) {
            do {
                if (!e) break;
                if (!e.alias) {
                    i.error = "register alias can not be empty";
                    break
                }
                if (this.clientAliasMap.hasOwnProperty(e.alias)) {
                    if (this.clientAliasMap[e.alias] === t) {
                        i.data = e.alias, i.success = !0;
                        break
                    }
                    i.error = "register failed cause alias is in use";
                    break
                }
                {
                    let n = void 0;
                    for (let e in this.clientAliasMap) if (this.clientAliasMap[e] === t) {
                        n = e;
                        break
                    }
                    if (n) {
                        i.data = n, i.error = `register failed cause already register by another alias ${n}`;
                        break
                    }
                    this.clientAliasMap[e.alias] = t, i.data = e.alias, i.success = !0;
                    break
                }
            } while (0)
        }

        callClientFunction(e, t) {
            do {
                if (!e) break;
                let i = e.dst, n = {rid: e.rid, method: e.method};
                if (!this.clientAliasMap.hasOwnProperty(i)) {
                    let a = `call remote function but dst client is not start or ended ${i}, method ${e.method}`;
                    s.error(a), n.error = a, n.action = "remote_client_callback", n.success = !1, this.sendAdapter(t, n);
                    break
                }
                let a = this.generateId(), o = this.clientAliasMap[i];
                n = Object.assign({
                    s_rid: a,
                    action: "call_client_api",
                    args: e.args,
                    src: e.src
                }, n), this.retCallbackMap[a] = Object.assign({remote: t, dstRemote: o}, n), this.sendAdapter(o, n)
            } while (0)
        }

        fireRetCallback(e, t) {
            do {
                let i = e.s_rid;
                if (void 0 === i || null === i) break;
                let n = this.retCallbackMap[i];
                if (!n) break;
                const a = n.callback;
                if (!a) break;
                e.success ? a(null, this.decodeParameter(e.data, t)) : a(e.error, e.data), delete this.retCallbackMap[i], s.information("free fireRetCallback", i)
            } while (0)
        }

        decodeParameter(e, t) {
            let i = e;
            do {
                if (!e) break;
                if ("object" != typeof e) break;
                let a = e["__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}"];
                if (a) {
                    i = ((...e) => n(this, void 0, void 0, function* () {
                        return this.callClientFunctionByIdAw(t, a, ...e)
                    })), global.__xdasObjectLiftMonitor && global.__xdasObjectLiftMonitor.setObjectFreer(i, {
                        client: t,
                        callbackId: a
                    }, l);
                    break
                }
                for (let i in e) {
                    let n = e[i];
                    e[i] = this.decodeParameter(n, t)
                }
            } while (0);
            return i
        }

        notifyFreer(e, t) {
            this.sendAdapter(e, {action: "client_context_freer", rid: t})
        }

        reply2Client(e, t) {
            do {
                let i = e.s_rid;
                if (void 0 === i || null === i) break;
                let n = this.retCallbackMap[i];
                if (!n) break;
                if (e.src === r.serverContextName) {
                    const i = n.callback;
                    if (!i) break;
                    e.success ? i(null, this.decodeParameter(e.data, t), t) : i(e.error, e.data, t)
                } else {
                    let t = n.remote;
                    if (!t) break;
                    this.sendAdapter(t, e)
                }
                delete this.retCallbackMap[i]
            } while (0)
        }

        getNow() {
            return Date.now()
        }

        sendAdapter(e, t) {
            let i = this.getNow();
            t.timestamp = t.timestamp ? t.timestamp.concat(i) : [].concat(i), e.isInprocess() ? (s.information("send to client in process"), e.emit("message", t)) : e.send(t)
        }

        forwardEvent(e, t, i, ...n) {
            do {
                if (!this.eventMap.hasOwnProperty(e)) break;
                let a = this.eventMap[e];
                for (let o of a) this.sendAdapter(o, {
                    action: "fire_event",
                    name: e,
                    args: n,
                    __context: t,
                    timestamp: i
                })
            } while (0)
        }

        attachEvent(e, t) {
            {
                this.eventMap[e] || (this.eventMap[e] = []);
                let i = this.eventMap[e], n = !1;
                for (let a of i) if (a === t) {
                    s.information("server attachEvent attached", e), n = !0;
                    break
                }
                n || (this.eventMap[e].push(t), s.information("server attachEvent ", e))
            }
        }

        detachEvent(e, t) {
            do {
                if (!this.eventMap.hasOwnProperty(e)) break;
                let i = this.eventMap[e];
                for (let n = 0; n < i.length; n++) if (i[n] === t) {
                    this.eventMap[e].splice(n, 1), s.information("server detachEvent current eventMap", this.eventMap);
                    break
                }
            } while (0)
        }

        generateId() {
            return this.rid++
        }

        getFullAlias(e) {
            return `${this.server.getProductId()}-${e}`.toLowerCase()
        }
    }), d = global.__xdasIPCServerInstance, t.server = d
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4), a = i(113), o = i(114), r = i(69), s = i(330);
    !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 i {
            constructor(e, t, i) {
                this.maxId = e, this.minId = t, this.invalidId = i
            }

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

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

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

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

            AttachNativeEvent(t, i) {
                let o = void 0;
                do {
                    if (n.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(i)) {
                        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, i); else {
                        let e = new Map;
                        e.set(r, i), this.eventJsCallbakcs.set(t, e)
                    }
                    o = r
                } while (0);
                return o
            }

            DetachNativeEvent(e, t) {
                do {
                    if (n.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (n.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, i) {
                do {
                    if (n.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(i)) {
                        a.error("callback is empty");
                        break
                    }
                    if (!this.targetCommunitorInfo) {
                        a.error("CheckNativeFunction but targetCommunitorInfo null");
                        break
                    }
                    a.information("funcName = ", t);
                    let r = e.idGenerator.generateId();
                    this.jsReturnCallbacks.set(r, i), s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCheckNativeFunction,
                        args: [t, r]
                    })
                } while (0)
            }

            RegisterJSFunction(e, i) {
                let o = t.ParamaterError;
                do {
                    if (n.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(i)) {
                        a.error("jsFunc is empty");
                        break
                    }
                    this.jsRegisterFunctions.set(e, i), 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 i = t[0];
                    if (!n.isNumber(i)) {
                        a.error(`id error id = ${i}`);
                        break
                    }
                    if (e.idGenerator.isInvalidId(i)) {
                        a.error(`id = ${i} invalid`);
                        break
                    }
                    let o = null, r = 0;
                    if (this.jsCallbacks.has(i) && (r = 1, o = this.jsCallbacks.get(i)), this.jsReturnCallbacks.has(i) && (r = 2, o = this.jsReturnCallbacks.get(i)), 0 === r) {
                        a.error(`callbacks[${i}] is null`);
                        break
                    }
                    t.splice(0, 1), o.apply(null, t), 2 === r && this.jsReturnCallbacks.delete(i)
                } while (0)
            }

            handleCallJsFunctionByName(e) {
                do {
                    let t = e[0];
                    if (!n.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 (!n.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, i, o) => {
                        a.information(`value = ${t}, key = ${i}, map = ${o}`), n.isNullOrUndefined(t) || t.apply(null, e)
                    })
                } while (0)
            }

            notifyNativeCallReady() {
                do {
                    if (!this.targetCommunitorInfo) {
                        a.error("notifyNativeCallReady but targetCommunitorInfo null");
                        break
                    }
                    s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCNativeCallReady,
                        args: [s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfo()]
                    })
                } while (0)
            }

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

        e.NativeCallImpl = d, e.nativeCall = new d
    }(t.NativeCallModule || (t.NativeCallModule = {}))
}, function (e, t) {
    e.exports = require("electron")
}, function (e, t) {
    e.exports = require("events")
}, function (e, t, i) {
    e.exports = i(541)
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(438), o = i(440), r = i(96), s = i(334), l = i(441).http, d = i(441).https, u = i(46),
        c = i(74), h = i(553), f = i(333), g = i(439);
    e.exports = function (e) {
        return new Promise(function (t, i) {
            var p, v = e.data, m = e.headers;
            if (m["User-Agent"] || m["user-agent"] || (m["User-Agent"] = "axios/" + h.version), v && !n.isStream(v)) {
                if (Buffer.isBuffer(v)) ; else if (n.isArrayBuffer(v)) v = new Buffer(new Uint8Array(v)); else {
                    if (!n.isString(v)) return i(f("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", e));
                    v = new Buffer(v, "utf-8")
                }
                m["Content-Length"] = v.length
            }
            var y = void 0;
            e.auth && (y = (e.auth.username || "") + ":" + (e.auth.password || ""));
            var k = u.parse(e.url), T = k.protocol || "http:";
            if (!y && k.auth) {
                var w = k.auth.split(":");
                y = (w[0] || "") + ":" + (w[1] || "")
            }
            y && delete m.Authorization;
            var C = "https:" === T, S = C ? e.httpsAgent : e.httpAgent, I = {
                path: o(k.path, e.params, e.paramsSerializer).replace(/^\?/, ""),
                method: e.method,
                headers: m,
                agent: S,
                auth: y
            };
            e.socketPath ? I.socketPath = e.socketPath : (I.hostname = k.hostname, I.port = k.port);
            var b, _ = e.proxy;
            if (!_ && !1 !== _) {
                var D = T.slice(0, -1) + "_proxy", A = process.env[D] || process.env[D.toUpperCase()];
                if (A) {
                    var N = u.parse(A);
                    if (_ = {host: N.hostname, port: N.port}, N.auth) {
                        var x = N.auth.split(":");
                        _.auth = {username: x[0], password: x[1]}
                    }
                }
            }
            if (_ && (I.hostname = _.host, I.host = _.host, I.headers.host = k.hostname + (k.port ? ":" + k.port : ""), I.port = _.port, I.path = T + "//" + k.hostname + (k.port ? ":" + k.port : "") + I.path, _.auth)) {
                var E = new Buffer(_.auth.username + ":" + _.auth.password, "utf8").toString("base64");
                I.headers["Proxy-Authorization"] = "Basic " + E
            }
            e.transport ? b = e.transport : 0 === e.maxRedirects ? b = C ? s : r : (e.maxRedirects && (I.maxRedirects = e.maxRedirects), b = C ? d : l), e.maxContentLength && e.maxContentLength > -1 && (I.maxBodyLength = e.maxContentLength);
            var P = b.request(I, function (n) {
                if (!P.aborted) {
                    clearTimeout(p), p = null;
                    var o = n;
                    switch (n.headers["content-encoding"]) {
                        case"gzip":
                        case"compress":
                        case"deflate":
                            o = o.pipe(c.createUnzip()), delete n.headers["content-encoding"]
                    }
                    var r = n.req || P, s = {
                        status: n.statusCode,
                        statusText: n.statusMessage,
                        headers: n.headers,
                        config: e,
                        request: r
                    };
                    if ("stream" === e.responseType) s.data = o, a(t, i, s); else {
                        var l = [];
                        o.on("data", function (t) {
                            l.push(t), e.maxContentLength > -1 && Buffer.concat(l).length > e.maxContentLength && i(f("maxContentLength size of " + e.maxContentLength + " exceeded", e, null, r))
                        }), o.on("error", function (t) {
                            P.aborted || i(g(t, e, null, r))
                        }), o.on("end", function () {
                            var n = Buffer.concat(l);
                            "arraybuffer" !== e.responseType && (n = n.toString("utf8")), s.data = n, a(t, i, s)
                        })
                    }
                }
            });
            P.on("error", function (t) {
                P.aborted || i(g(t, e, null, P))
            }), e.timeout && !p && (p = setTimeout(function () {
                P.abort(), i(f("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", P))
            }, e.timeout)), e.cancelToken && e.cancelToken.promise.then(function (e) {
                P.aborted || (P.abort(), i(e))
            }), n.isStream(v) ? v.pipe(P) : P.end(v)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(11);
    !function (e) {
        let t;
        !function (e) {
            e.Info = "info", e.Warning = "warning", e.Error = "error", e.Success = "success"
        }(t = e.ConfirmType || (e.ConfirmType = {})), e.confirm = function (e, t = {}) {
            return n(this, void 0, void 0, function* () {
                let i = String(Math.random()).replace(/\D/, "");
                a.ipcRenderer.send("message-box-confirm-create", {options: e, dialogConf: t, boxId: i});
                let n = yield o.asyncRemoteCall.getIpcMain();
                return n.once(`message-box-init-${i}`, t => {
                    t.sender.send("message-box-init-reply", {popType: "confirm", options: e})
                }), new Promise(e => {
                    n.once(`message-box-resolve-${i}`, (t, i, n) => {
                        e({action: i, checkboxChecked: n})
                    })
                })
            })
        }, e.pop = function (e, t = {}) {
            return n(this, void 0, void 0, function* () {
                let i = String(Math.random()).replace(/\D/, ""), n = e.parentId;
                a.ipcRenderer.send("message-box-pop-create", {dialogConf: t, boxId: i, parentId: n});
                let r = yield o.asyncRemoteCall.getIpcMain();
                return r.once(`message-box-init-${i}`, t => {
                    t.sender.send("message-box-init-reply", {popType: "message-box", options: e})
                }), new Promise(e => {
                    r.once(`message-box-resolve-${i}`, (t, i, n) => {
                        e({action: i, formData: n})
                    })
                })
            })
        }, e.custom = function (e, t = {}, i = {}) {
            return n(this, void 0, void 0, function* () {
                let n = String(Math.random()).replace(/\D/, "");
                a.ipcRenderer.send("message-box-custom-create", JSON.parse(JSON.stringify({
                    popType: e,
                    dialogConf: i,
                    boxId: n,
                    options: t
                })));
                let r = yield o.asyncRemoteCall.getIpcMain();
                return r.once(`message-box-init-${n}`, n => {
                    n.sender.send("message-box-init-reply", JSON.parse(JSON.stringify({
                        popType: e,
                        options: t,
                        dialogConf: i
                    })))
                }), new Promise(e => {
                    r.once(`message-box-resolve-${n}`, (t, i, n) => {
                        e({action: i, args: n})
                    })
                })
            })
        }, e.customIndividuation = function (e, t = {}, i = {}) {
            return n(this, void 0, void 0, function* () {
                let n = String(Math.random()).replace(/\D/, "");
                return a.ipcRenderer.send("message-box-individuation-create", {
                    popType: e,
                    dialogConf: i,
                    boxId: n,
                    options: t
                }), (yield o.asyncRemoteCall.getIpcMain()).once(`message-box-init-${n}`, n => {
                    n.sender.send("message-box-init-reply", {popType: e, options: t, dialogConf: i})
                }), new Promise(e => {
                    a.ipcRenderer.once(`message-box-resolve-${n}`, (t, i, n) => {
                        e({action: i, args: n})
                    })
                })
            })
        }
    }(t.MessageBox || (t.MessageBox = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(59), o = i(18), r = i(11), s = i(561), l = i(2), d = i(4), u = i(0), c = i(6), h = i(35), f = i(27),
        g = i(60), p = i(7), v = i(14), m = i(562), y = i(120), k = i(19), T = i(5), w = i(445), C = i(17),
        S = p.default(l.join(__rootDir, "../bin/ThunderHelper.node")), I = u.default.getLogger("login-helper");
    !function (e) {
        let t;
        !function (e) {
            e[e.Success = 0] = "Success", e[e.UnKnown = -1] = "UnKnown", e[e.WrongParam = -2] = "WrongParam"
        }(t = e.CommonResultCodeType || (e.CommonResultCodeType = {}));
        e.loginUIHelper = new class {
            constructor() {
            }

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

            createLoginWndEx(e, t, i, a, s) {
                return new Promise(l => n(this, void 0, void 0, function* () {
                    o.ipcRenderer.once(v.NodeEventMesssageNS.eventLoginWndCreated, (e, t) => n(this, void 0, void 0, function* () {
                        let e = yield(yield r.asyncRemoteCall.getBrowserWindow()).fromId(t);
                        l(e);
                        let i = void 0, n = "unknown";
                        i = C.NativeCallModule.nativeCall.AttachNativeEvent("onLoginWndClose", e => {
                            C.NativeCallModule.nativeCall.DetachNativeEvent("onLoginWndClose", i), i = void 0, I.information("on login wnd event", e), n = e
                        }), e.once("closed", () => {
                            I.information("on login wnd close", n)
                        })
                    })), o.ipcRenderer.send(v.NodeEventMesssageNS.eventLoginWndCreate, e, t, i, a, s)
                }))
            }

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

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

            createPersonalInfoWnd(e, t) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(i => n(this, void 0, void 0, function* () {
                        o.ipcRenderer.once("personal-info-window-created", (e, t) => n(this, void 0, void 0, function* () {
                            let e = yield r.asyncRemoteCall.getBrowserWindow();
                            i(yield e.fromId(t))
                        })), o.ipcRenderer.once("personal-info-window-ready-to-show", (e, t) => {
                            T.client.broadcastEvent(w.ThunderEvent.hoverWindowReadyToShow)
                        });
                        let a = yield T.client.callServerFunction("IsLogined");
                        o.ipcRenderer.send("create-personal-info-window", e, t, a)
                    }))
                })
            }

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

            createModifierUserInfoWnd(e) {
                o.ipcRenderer.send(v.NodeEventMesssageNS.eventModifierUserinfoWndCreate, e)
            }
        }, e.loginSDKHelper = new class {
            constructor() {
                this.curUserInfo = null, this.key = "XUNLEIACCOUNT123", this.loginInfo = null, this.loginDataDir = l.join(__profilesDir, "xlaccount/"), this.loginDataPath = l.join(__profilesDir, "xlaccount/accountdata.dat"), this.deviceId = "", this.canSaveDataNow = !0, this.dataToSave = null, this.eventEmitter = null, I.information("loginSDKHelper obj create"), this.eventEmitter = new k.EventEmitter, this.eventEmitter.setMaxListeners(0)
            }

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

            getDeviceID() {
                return n(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 = "", i = "", n = "SYSTEM_CONFIG", a = "DEVICEID", o = S.getPublicUserDataPath(),
                            r = l.join(o, "Thunder Network/Thunder"), s = l.join(r, "/xlconfig.ini");
                        if ("" !== o && ((yield c.FileSystemAWNS.mkdirsAW(r)) && (i = S.readINI(s, n, a)), I.information("得到文件保存 peeridMd5Str:", i)), "" === i) {
                            let e = S.getPeerID();
                            i = h.ToolsUtilitiesAWNS.genarateMd5(e), I.information("重新计算 peeridStr:", e, ";peeridMd5Str:", i), (yield c.FileSystemAWNS.mkdirsAW(r)) && S.writeINI(s, n, a, i)
                        }
                        let d = S.getDmideCode(), u = h.ToolsUtilitiesAWNS.genarateMd5(d);
                        I.information("dmideCodeStr:", d, ";dmideCodeMd5Str:", u), t = u + i, e = h.ToolsUtilitiesAWNS.genarateMd5(t), this.deviceId = e
                    } while (0);
                    return I.information("deviceIDMd5Str:", e), e
                })
            }

            getInitData() {
                return n(this, void 0, void 0, function* () {
                    let e = yield T.client.callServerFunction("GetInitUserLoginParam"), t = e.clientId,
                        i = e.clientSecret, n = l.join(__rootDir, "../../Thunder.exe"), o = S.getFileVersion(n),
                        r = m.activityObj.getActivityInfo(), s = r.activityEnable, d = r.activityCssPath;
                    return I.information("getInitData:", r), JSON.stringify({
                        appid: "0",
                        package: "com.xunlei.thunderx",
                        appkey: "4af30ad6c6b0c02c4d8df3ded2cb79b8",
                        platform: "pc-xdas",
                        osversion: a.release(),
                        thirdLoginDefault: ["weixin", "qq"],
                        thirdLoginGroup: ["qq", "weixin", "sina", "alipay"],
                        loginTypes: ["account", "mobile"],
                        registerTypes: ["mobile"],
                        uiText: "xlx_new",
                        clientVersion: o,
                        thunderVersion: o,
                        activityEnable: s,
                        activityCssPath: d,
                        clientId: t,
                        clientSecret: i,
                        enableOauthLogout: !0,
                        platformVersion: "0",
                        appName: "PC-com.xunlei.thunderx"
                    })
                })
            }

            saveDataToFile(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = !1;
                    return this.canSaveDataNow ? (this.canSaveDataNow = !1, i = yield c.FileSystemAWNS.writeFileAW(e, t), this.canSaveDataNow = !0, this.eventEmitter.emit("OnSaveDataToFileComplete")) : (this.dataToSave = t, this.eventEmitter.removeAllListeners("OnSaveDataToFileComplete"), this.eventEmitter.once("OnSaveDataToFileComplete", () => n(this, void 0, void 0, function* () {
                        i = yield this.saveDataToFile(e, this.dataToSave)
                    }))), i
                })
            }

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

            fireEvent(e, i) {
                return n(this, void 0, void 0, function* () {
                    let n = {code: t.UnKnown};
                    do {
                        if (d.isNullOrUndefined(e)) {
                            n.code = t.WrongParam;
                            break
                        }
                        f.NativeCallHostModule.nativeCallHost.fireNativeEvent("onFireLoginEvent", e, i), n.code = t.Success
                    } while (0);
                    return n
                })
            }

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

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

            getCurInternetState() {
                return S.getCurInternetState()
            }

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

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

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

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

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

            getUserInfoAw(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => {
                        e ? s.xlQuickLogin.getUserInfo(e, e => {
                            t(e)
                        }) : s.xlQuickLogin.getUserInfo(e => {
                            t(e)
                        })
                    })
                })
            }

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

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

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

            getUserInfoByKeyAw(e, t) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(i => {
                        null !== t && void 0 !== t && "vip_xl" === t ? s.xlQuickLogin.getAllUserInfo(t => {
                            let n = "";
                            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;
                                n = t.vipList[0][e]
                            } while (0);
                            i(n)
                        }) : s.xlQuickLogin.getAllUserInfo(e, e => {
                            i(e)
                        })
                    })
                })
            }

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

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

            showLoginDlg(e, t, i) {
                I.information(e), null !== t && void 0 !== t || (t = !0), y.LoginOptionNS.loginOption.setOption(i), f.NativeCallHostModule.nativeCallHost.fireNativeEvent("onShowLoginWnd", e, t)
            }

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

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

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

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

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

            getVipInfo() {
                return this.getVipInfoStr()
            }

            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 && this.curUserInfo.vipList && 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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(0), r = i(19), s = i(10), l = i(6), d = o.default.getLogger("config-modules"),
        u = `${__profilesDir}/modules.json`;
    const c = new class {
        constructor() {
            this.configModulesJsonData = null, this.eventEmitter = new r.EventEmitter, this.inited = !1
        }

        cache(e) {
            return n(this, void 0, void 0, function* () {
                yield l.FileSystemAWNS.writeFileAW(u, JSON.stringify(e))
            })
        }

        loadLatest() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!(yield l.FileSystemAWNS.existsAW(u))) break;
                    let e = (yield l.FileSystemAWNS.readFileAW(u)).toString();
                    try {
                        this.configModulesJsonData = JSON.parse(e)
                    } catch (e) {
                    }
                } while (0)
            })
        }

        update() {
            return n(this, void 0, void 0, function* () {
                let e = null, t = !1;
                try {
                    a.default.defaults.adapter = i(21), e = yield a.default.get("http://static-xl.a.88cdn.com/json/modules.json", {timeout: 1e4})
                } catch (e) {
                    d.information(e)
                }
                if (null !== e && void 0 !== e.status && 200 === e.status && void 0 !== e.data && null !== e.data && "" !== e.data && (this.configModulesJsonData = e.data, this.cache(e.data).catch(), t = !0), !t) {
                    let t = null !== e ? e.status : -1;
                    s.XLStatNS.trackEvent("business", "module_json_download_fail", "", 0, 0, 0, 0, `err_code=${t}`)
                }
                return t
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.update();
                e || (d.information("module_json_download_fail load cache"), this.loadLatest().catch()), setInterval(() => n(this, void 0, void 0, function* () {
                    this.update().catch()
                }), 36e5), this.inited = !0, this.eventEmitter.emit("OnConfigModulesLoaded", e)
            })
        }

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

        getEventEmitter() {
            return this.eventEmitter
        }

        isInited() {
            return this.inited
        }

        isInitedAw() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.inited ? e(!0) : this.eventEmitter.once("OnConfigModulesLoaded", t => {
                        e(!0)
                    })
                })
            })
        }

        getJsonData() {
            return this.configModulesJsonData
        }
    };
    t.default = c
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.Success = 0] = "Success", e[e.FunctionUnExist = 1] = "FunctionUnExist", e[e.ParamError = 2] = "ParamError", e[e.CallFailed = 3] = "CallFailed", e[e.NotAllowed = 4] = "NotAllowed"
    }(t.NativeFunctionErrorCode || (t.NativeFunctionErrorCode = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(4), r = i(540), s = i(30), l = i(73), d = i(435), u = i(19),
        c = a.default.getLogger("DownloadKernel.CategoryManager");

    class h {
        constructor() {
            this.newCategoryId = 0, this.categorys = new Map, this.userId = "", this.accountPassword = "", this.isInit = !1, this.isIniting = !1, this.eventEmitter = new u.EventEmitter
        }

        innerInit() {
            do {
                if (this.isIniting) break;
                this.isIniting = !0, s.ThunderKernel.loadCategory(e => {
                    e.forEach(e => {
                        if (c.information("load category, name:", e.name), e.name === h.privateCategoryName) {
                            let t = r.PrivateCategory.createCategoryFromData(e);
                            t && this.categorys.set(e.categoryId, t)
                        } else if (e.name === h.panCategoryName) {
                            let t = d.CommonCategory.createCategoryFromData(e);
                            t && this.categorys.set(e.categoryId, t)
                        } else c.warning("unkown category name:", e.name);
                        void 0 !== e.categoryId && this.newCategoryId <= e.categoryId && (this.newCategoryId = e.categoryId + 1)
                    }), this.isIniting = !1, this.isInit = !0, this.eventEmitter.emit(h.loadedEvent)
                })
            } while (0)
        }

        init() {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit && (this.innerInit(), this.isIniting)) return new Promise((e, t) => {
                    this.eventEmitter.on(h.loadedEvent, () => {
                        e()
                    })
                })
            })
        }

        getCategorys() {
            return this.categorys
        }

        getCategoryByName(e) {
            let t = new Map;
            for (let i of this.categorys.values()) i.getName() === e && t.set(i.getId(), i);
            return t
        }

        getCategoryCount() {
            return this.categorys.size
        }

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

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

        getCategoryFromUserId(e, t, i) {
            if (!o.isString(e) || !t || "" === t) return null;
            let n = null;
            for (let i of this.categorys.values()) if (i.getName() === e && i.getUserName() === t) {
                n = i;
                break
            }
            return n || (c.information("create new category, id:", this.newCategoryId), (n = new d.CommonCategory(this.newCategoryId)).setName(e), n.setDescription(i || e), n.setUserName(t), n.setAccountPassword(""), this.categorys.set(this.newCategoryId, n), this.newCategoryId++, s.ThunderKernel.createCategory(n.getId(), -1, -1, n.getName(), n.getDescription(), n.getUserName(), n.getAccountPassword())), n
        }

        getPrivateCategoryFromUserId(e) {
            if (!e || "" === e) return null;
            let t = null;
            for (let i of this.categorys.values()) if (i.getUserName() === e) {
                t = i;
                break
            }
            return t || (c.information("create new private category, id:", this.newCategoryId), (t = new r.PrivateCategory(this.newCategoryId)).setName(h.privateCategoryName), t.setDescription("Private Space"), t.setUserName(e), t.setAccountPassword(""), this.categorys.set(this.newCategoryId, t), this.newCategoryId++, s.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 i = !1;
            this.userId !== e && (this.userId = e, i = !0);
            let n = "";
            if ("" === t) n = ""; else {
                let e = l.createHash("md5");
                e.update(this.accountPassword), n = e.digest("hex")
            }
            if (this.accountPassword !== n && (this.accountPassword = n, i = !0), i) {
                let e = null;
                for (let t of this.categorys.values()) if (t.getUserName() === this.userId) {
                    e = t;
                    break
                }
                e && e.setAccountPassword(this.accountPassword)
            }
        }

        isPrivateCategory(e) {
            let t = !1;
            do {
                let i = this.getCategoryFromId(e);
                if (!i) break;
                i.getName() === h.privateCategoryName && (t = !0)
            } while (0);
            return t
        }
    }

    h.privateCategoryName = "Private", h.panCategoryName = "ThunderPanPlugin", h.loadedEvent = "OnCatetoryLoaded", t.CategoryManager = h, function (e) {
        const t = new h;
        e.getCategoryManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryManager || (t.DownloadKernelCategoryManager = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4), a = i(113), o = i(114), r = i(330), s = 0, l = "#home-1EAC214F-7644-4163-9EB8-AF4BAA62D144";
    !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, ...i) {
                a.information(`funcId = ${t}`);
                do {
                    if (!n.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (!n.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(i);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

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

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

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

            bindWebviewMsgListeners() {
                const e = document.querySelector(l);
                n.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 (n.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (n.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (n.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let i = e.msg.args;
                    if (n.isNullOrUndefined(i)) {
                        a.error("args is null");
                        break
                    }
                    let o = i[0];
                    if (!n.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = i[1];
                    if (!n.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    i.splice(0, 2), this.appendNativeCallInfoList(t), this.delegate.onJsCallNativeFunction(t.id, o, r, i)
                } while (0)
            }

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

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

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

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

            appendNativeCallInfoList(e) {
                let t = !0;
                for (let i of this.nativeCallInfoList) if (i.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 i = document.querySelector(l);
                do {
                    if (n.isNullOrUndefined(i)) {
                        a.error("webview is null");
                        break
                    }
                    if (!1 === global.__homepageWebviewReady) {
                        a.warning("The WebView must be attached to the DOM and the dom-ready event emitted before this method can be called.");
                        break
                    }
                    if (n.isNullOrUndefined(i.send)) {
                        a.error("webview.send is null");
                        break
                    }
                    i.send(e, t)
                } while (0)
            }

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

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

        e.NativeCallHost = t, e.nativeCallHost = new t
    }(t.NativeCallHostModule || (t.NativeCallHostModule = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(117), a = i(644), o = i(645), r = i(646), s = i(647), l = i(648), d = i(649), u = i(650), c = i(651),
        h = i(652), f = i(653), g = i(654), p = i(655), v = i(656), m = i(53);
    n.default.use(a.default);
    const y = new a.default.Store({
        modules: {
            Tabs: r.default,
            DownloadListState: l.default,
            ToolbarState: d.default,
            VipSpeedState: u.default,
            WebView: c.default,
            SettingConf: s.default,
            Community: h.default,
            PrivateSpaceState: f.default,
            UpgradeTaskState: g.default,
            BookMarks: p.default,
            Group: v.default,
            Navs: m.default
        }, strict: !1
    });
    t.connector = new o.default(y)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(11), r = i(2), s = i(0), l = i(42), d = i(3), u = i(15), c = i(31), h = i(14), f = i(33),
        g = i(335), p = i(40), v = i(13), m = i(34), y = i(6), k = s.default.getLogger("DownloadMgr"),
        T = u.DownloadKernelEventManager.getEventManager(),
        w = p.DownloadKernelCategoryViewManager.getCategoryViewManager(), C = [{
            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 S = new class extends l.default {
        constructor() {
            super(...arguments), this.completedList = [], this.recentList = [], this.tracked = !1, this.needSelectNext = !1, this.currentCategoryId = -1, this.currentCategoryView = d.DownloadKernel.CategroyViewID.Downloading
        }

        setNeedSelectNext(e) {
            this.needSelectNext = e
        }

        getNeedSelectNext() {
            return this.needSelectNext
        }

        getCurrentCategoryId() {
            return this.currentCategoryId
        }

        setCurrentCategoryId(e) {
            this.currentCategoryId = e
        }

        getCurrentCategoryView() {
            return this.currentCategoryView
        }

        setCurrentCategoryView(e) {
            this.currentCategoryView = e
        }

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

        trackTaskComplete() {
            return n(this, void 0, void 0, function* () {
                yield(yield o.asyncRemoteCall.getApp()).getJumpListSettings();
                do {
                    if (this.tracked) break;
                    this.tracked = !0, c.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        this.initCompeltedList(), this.getJumplistGroup().catch(), this.updateJumpList().catch(), this.attachCompletedCategoryViewChange()
                    })
                } while (0)
            })
        }

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

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

        getJumplistGroup() {
            return n(this, void 0, void 0, function* () {
                do {
                    this.sortCompletedList();
                    let e = yield(yield o.asyncRemoteCall.getApp()).getJumpListSettings();
                    k.information("getJumpListSettings", e);
                    let t = e.removedItems;
                    if (!t || 0 === t.length) {
                        k.information("update jumplist removedItems null");
                        break
                    }
                    if (0 === this.completedList.length) break;
                    k.information("update jumplist removedItems", t);
                    for (let e of t) for (let t = 0; t < this.completedList.length; t++) {
                        let i = this.completedList[t], n = i.savePath, a = i.taskName;
                        void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                        let o = "";
                        if (o = i.taskType === d.DownloadKernel.TaskType.Group ? n : r.join(n, a), e.iconPath && o.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), k.information("getJumplistGroup", this.recentList)
            })
        }

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

        attachCompletedCategoryViewChange() {
            T.attachTaskEvent(d.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== d.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (!e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== d.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let i = t.map(e => e.getTaskBaseInfo());
                    this.completedList.push(...i), this.getJumplistGroup().catch(), this.updateJumpList().catch()
                } while (0)
            }), T.attachTaskEvent(d.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== d.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== d.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let i = this.completedList.map(e => e.taskId);
                    for (let e of t) {
                        let t = i.indexOf(e.getId());
                        -1 !== t && (this.completedList.splice(t, 1), i.splice(t, 1))
                    }
                    this.getJumplistGroup().catch(), this.updateJumpList().catch()
                } while (0)
            })
        }
    };
    t.default = S
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(7), r = i(43), s = i(18), l = i(33);
    !function (e) {
        const t = i(2), d = o.default(t.join(__rootDir, "../bin/ThunderKernel.node")),
            u = a.default.getLogger("DownloadKernel.ThunderKernel");
        let c = 0, h = [];
        s.ipcRenderer.on(l.ThunderChannelList.channelMRUpdateLogEnviroment, () => {
            d.enableETWLogger(a.default.enableLogger)
        }), e.registerDownloadSDKCrashCallback = function (e) {
            return d.registerDownloadSDKCrashCallback(e)
        }, e.initDownloadSdk = function (e, t, i, n) {
            return d.initDownloadSdk(e, t, i, n)
        }, e.createP2spTask = function (e, t, i, n, a, o) {
            return e && "" !== e || u.warning("createP2spTask url:", e), n && "" !== n || u.warning("createP2spTask savePath:", n), a && "" !== a || u.warning("createP2spTask fileName:", a), e = r.Common.parseThunderPrivateUrl(e), d.createP2spTask(e, void 0 === t ? "" : t, void 0 === i ? "" : i, n, a, o)
        }, e.createBtTask = function (e, t, i, n) {
            return e && "" !== e || u.warning("createBtTask torrentFilePath:", e), t && "" !== t || u.warning("createBtTask savePath:", t), 0 === i.length && u.warning("createBtTask fileRealIndexLists:", 0), d.createBtTask(e, t, i, n)
        }, e.createEmuleTask = function (e, t, i, n) {
            return e && "" !== e || u.warning("createEmuleTask url:", e), t && "" !== t || u.warning("createEmuleTask savePath:", t), i && "" !== i || u.warning("createEmuleTask fileName:", i), e = r.Common.parseThunderPrivateUrl(e), d.createEmuleTask(e, t, i, n)
        }, e.createMagnetTask = function (e, t, i) {
            return e && "" !== e || u.warning("createMagnetTask url:", e), t && "" !== t || u.warning("createMagnetTask torrentFilePath:", t), e = r.Common.parseThunderPrivateUrl(e), d.createMagnetTask(e, t, i)
        }, e.startTask = function (e) {
            return u.information("startTask virtualTaskId:", e), d.startTask(e)
        }, e.stopTask = function (e) {
            return u.information("stopTask virtualTaskId:", e), d.stopTask(e)
        }, e.deleteTask = function (e) {
            return u.information("deleteTask virtualTaskId:", e), d.deleteTask(e)
        }, e.renameP2spTaskFile = function (e, t) {
            return d.renameP2spTaskFile(e, t)
        }, e.queryTaskInfo = function (e, t) {
            return 0 === d.queryTaskInfo(e, t)
        }, e.queryBtTaskInfo = function (e, t) {
            return 0 === d.queryBtTaskInfo(e, t)
        }, e.queryPlayInfo = function (e, t, i) {
            return 0 === d.queryPlayInfo(e, t, i)
        }, e.queryGlobalInfo = function (e, t) {
            return 0 === d.queryGlobalInfo(e, t)
        }, e.createTaskId = function () {
            return d.createTaskId()
        }, e.importTask = function (e, t, i) {
            return d.importTask(e, t, i)
        }, e.parserBtFileInfo = function (e, t) {
            return d.parserBtFileInfo(e, t)
        }, e.getFileHashByUrl = function (e) {
            return d.getFileHashByUrl(e)
        }, e.getInfoHashByUrl = function (e) {
            return d.getInfoHashByUrl(e)
        }, e.enableDcdnWithVipCert = function (e, t, i) {
            return d.enableDcdnWithVipCert(e, t, i)
        }, e.updateDcdnWithVipCert = function (e, t, i) {
            return d.updateDcdnWithVipCert(e, t, i)
        }, e.disableDcdnWithVipCert = function (e, t) {
            return d.disableDcdnWithVipCert(e, t)
        }, e.setDownloadSpeedLimit = function (e) {
            return d.setDownloadSpeedLimit(Number(e))
        }, e.setUploadSpeedLimit = function (e) {
            return d.setUploadSpeedLimit(Number(e))
        }, e.getSubNetUploader = function (e) {
            return d.getSubNetUploader(e)
        }, e.setTaskStrategy = function (e, t) {
            return d.setTaskStrategy(e, t)
        }, e.setDownloadStrategy = function (e, t) {
            return d.setDownloadStrategy(e, t)
        }, e.setTaskThreadCount = function (e, t) {
            return d.setTaskThreadCount(e, Number(t))
        }, e.setCacheSize = function (e) {
            return d.setCacheSize(Number(e))
        }, e.setGlobalConnectionLimit = function (e) {
            return d.setGlobalConnectionLimit(e)
        }, e.setUserInfo = function (e, t) {
            return d.setUserInfo(e, t)
        }, e.updateNetDiscVODCachePath = function (e) {
            return d.updateNetDiscVODCachePath(e)
        }, e.setBTExtraTrackers = function (e, t) {
            return d.setBTExtraTrackers(e, t)
        }, e.setGlobalExtInfo = function (e, t) {
            return d.setGlobalExtInfo(e, t)
        }, e.setTaskExtInfo = function (e, t) {
            return d.setTaskExtInfo(e, t)
        }, e.setTaskExtStat = function (e, t, i, n) {
            return d.setTaskExtStat(e, t, i, n)
        }, e.addHttpHeaderField = function (e, t, i) {
            return d.addHttpHeaderField(e, t, i)
        }, e.setupNetDiskFetchTaskFlag = function (e) {
            return d.setupNetDiskFetchTaskFlag(e)
        }, e.updateTaskVideoByteRatio = function (e, t, i) {
            return d.updateTaskVideoByteRatio(e, t, i)
        }, e.initDataBase = function (e, t) {
            return d.initDataBase(e, t)
        }, e.beginTransaction = function () {
            u.information("beginTransaction transactionId:", c);
            let e = c;
            return d.beginTransaction(e), c >= Number.MAX_SAFE_INTEGER ? c = 0 : c++, h.push(e), e
        }, e.commitTransaction = function (e) {
            let t = -1;
            u.information("commitTransaction transactionId:", e);
            for (let i = 0; i < h.length; ++i) if (h[i] === e) {
                h.splice(i, 1), t = d.commitTransaction(e);
                break
            }
            return t
        }, e.commitAllTransaction = function () {
            for (let e = 0; e < h.length; ++e) d.commitTransaction(h[e]);
            h = []
        }, e.rollbackTransaction = function (e) {
            return u.information("rollbackTransaction transactionId:", e), d.rollbackTransaction(e)
        }, e.execSqlite = function (e, t) {
            return d.execSqlite(e, t)
        }, e.execSqliteEx = function (e, t) {
            return d.execSqliteEx(e, t)
        }, e.querySqlite = function (e, t) {
            return d.querySqlite(e, t)
        }, e.querySqliteEx = function (e, t) {
            return d.querySqliteEx(e, t)
        }, e.insertTaskBase = function (e) {
            d.insertTaskBase(e)
        }, e.insertP2spTask = function (e, t, i, n, a, o, r) {
            d.insertP2spTask(e, t, i, n, a, o, r)
        }, e.insertBtTask = function (e, t, i, n, a) {
            d.insertBtTask(e, t, i, n, a)
        }, e.insertBtFile = function (e, t) {
            d.insertBtFile(e, t)
        }, e.insertEmuleTask = function (e, t, i) {
            d.insertEmuleTask(e, t, i)
        }, e.insertGroupTask = function (e, t, i, n) {
            d.insertGroupTask(e, t, i, n)
        }, e.insertMagnetTask = function (e) {
            d.insertMagnetTask(e)
        }, e.deleteStorageTask = function (e, t) {
            d.deleteStorageTask(e, t)
        }, e.loadTaskBase = function (e) {
            d.loadTaskBase(e)
        }, e.loadBtFile = function (e) {
            d.loadBtFile(e)
        }, e.loadStorageTask = function (e, t, i) {
            d.loadStorageTask(e, t, i)
        }, e.saveTaskBaseInfo = function (e, t, i, n) {
            d.saveTaskBaseInfo(e, t, i, n)
        }, e.saveTaskUserData = function (e, t) {
            d.saveTaskUserData(e, t)
        }, e.saveTaskChannelInfo = function (e, t, i, n, a, o) {
            d.saveTaskChannelInfo(e, t, i, n, a, o)
        }, e.setP2spTaskOriginOnly = function (e, t) {
            d.setP2spTaskOriginOnly(e, t)
        }, e.setP2spTaskThreadCount = function (e, t) {
            d.setP2spTaskThreadCount(e, t)
        }, e.saveBtFileInfo = function (e, t, i, n, a) {
            d.saveBtFileInfo(e, t, i, n, a)
        }, e.saveBtTaskSeedFile = function (e, t) {
            d.saveBtTaskSeedFile(e, t)
        }, e.saveBtFileCid = function (e, t, i, n) {
            d.saveBtFileCid(e, t, i, n)
        }, e.saveBtFileUserRead = function (e, t, i) {
            d.saveBtFileUserRead(e, t, i)
        }, e.setCategoryId = function (e, t) {
            d.setCategoryId(e, t)
        }, e.loadCategory = function (e) {
            d.loadCategory(e)
        }, e.createCategory = function (e, t, i, n, a, o, r) {
            d.createCategory(e, t, i, n, a, o, r)
        }, e.setCategoryPassword = function (e, t, i, n) {
            d.setCategoryPassword(e, t, i, n)
        }, e.setCategoryAccountPassword = function (e, t) {
            d.setCategoryAccountPassword(e, t)
        }, e.searchTask = function (e, t, i, n, a) {
            d.searchTask(e, t, i, n, a)
        }, e.filterTask = function (e, t, i, n, a, o, r) {
            let s = `SELECT taskid from TaskBase WHERE  CompletionTime != 0 and RemovingToRecycleTime = 0 and (${"CategoryId = " + a.join(" or CategoryId = ")})`;
            if (void 0 !== r) s = `${s} and ${"type = " + r}`; else {
                if (t) {
                    let e = t.split("|"), i = `Name LIKE '%${e[0]}%' `;
                    for (let t = 1; t < e.length; t++) i += `or Name LIKE '%${e[t]}%' `;
                    s = `${s} and (${i})`
                }
                if (i) {
                    let e = i.split("|"), t = `Name LIKE '%${e[0]}' `;
                    for (let i = 1; i < e.length; i++) t += `or Name LIKE '%${e[i]}' `;
                    s = `${s} and (${t})`
                }
            }
            d.querySqlite(s, (e, t, i) => {
                u.information("filter result", t);
                let a = [];
                for (let e of t) a.push(Number(e[0].value));
                n(a)
            })
        }, e.setTaskPriorityLevel = function (e, t, i) {
            d.setTaskPriorityLevel(e, t, i)
        }, e.setBtFileFailureErrorCode = function (e, t, i) {
            d.setBtFileFailureErrorCode(e, t, i)
        }, e.setBtFilePlayPosition = function (e, t, i) {
            d.setBtFilePlayPosition(e, t, i)
        }, e.setBtFileDuration = function (e, t, i) {
            d.setBtFileDuration(e, t, i)
        }, e.batchFindP2spTask = function (e, t) {
            return 0 === d.batchFindP2spTask(e, t)
        }, e.batchFindEmuleTask = function (e, t) {
            return 0 === d.batchFindEmuleTask(e, t)
        }, e.batchFindBtTask = function (e, t) {
            return 0 === d.batchFindBtTask(e, t)
        }, e.batchFindGroupTask = function (e, t) {
            return 0 === d.batchFindGroupTask(e, t)
        }, e.verifyProxy = function (e, t, i, n, a, o) {
            return n || (n = ""), i || (i = "", n = ""), t = t ? Number(t) : 0, d.verifyProxy(e, t, i, n, a, o)
        }, e.setProxy = function (e, t, i, n, a) {
            return a || (a = ""), n || (n = "", a = ""), i = i ? Number(i) : 0, d.setProxy(e, t, i, n, a)
        }, e.getSumOfRemotePeerBeBenefited = function (e) {
            return d.getSumOfRemotePeerBeBenefited(e)
        }, e.isFileSizeSetterWorking = function (e) {
            return d.isFileSizeSetterWorking(e)
        }, e.isDownloadTaskCfgFileExist = function (e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise(i => {
                    d.isDownloadTaskCFGFileExist(e, t, e => {
                        i(1 === e)
                    })
                })
            })
        }, e.launchFileAssistant = function (e) {
            return d.launchFileAssistant(e)
        }, e.getTaskProfileLog = function (e, t, i) {
            return d.getTaskProfileLog(e, t, i)
        }, e.stopPushStorageCommand = function () {
            return d.stopPushStorageCommand()
        }, e.getStorageWaitingCommandSize = function () {
            return d.getStorageWaitingCommandSize()
        }, e.addServer = function (e, t, i) {
            d.addServer(e, t, i)
        }, e.discardServer = function (e, t, i) {
            d.discardServer(e, t, i)
        }
    }(t.ThunderKernel || (t.ThunderKernel = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(7), r = i(0), s = i(6), l = i(30), d = i(12), u = i(26), c = i(19), h = i(436), f = i(17),
        g = i(14), p = i(119);
    !function (e) {
        const t = d.DownloadKernelTaskManager.getTaskManager(),
            i = u.DownloadKernelCategoryManager.getCategoryManager(),
            v = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
            m = r.default.getLogger("DownloadKernelManager");
        let y = void 0, k = !1, T = new c.EventEmitter;
        T.setMaxListeners(0);
        let w = 0;

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

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

        function I(e, i) {
            t.attachListener(e, i)
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(18), r = i(0), s = i(7), l = i(6), d = i(3), u = i(31), c = i(12), h = i(40), f = i(26),
        g = i(15), p = i(43), v = i(61), m = i(22), y = i(38), k = i(10), T = i(39), w = i(9), C = i(37), S = i(4),
        I = i(29), b = i(33), _ = i(44), D = i(52), A = i(49), N = i(51), x = i(63), E = i(348), P = i(41), O = i(141),
        M = i(75), F = i(47), L = i(102), R = i(16), B = i(5), U = i(24), K = i(11), V = i(34), W = i(56), G = i(23),
        H = i(69), z = i(55), j = r.default.getLogger("Thunder.TaskOperator"),
        X = s.default(a.join(__rootDir, "../bin/ThunderHelper.node")), $ = c.DownloadKernelTaskManager.getTaskManager(),
        Y = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        q = f.DownloadKernelCategoryManager.getCategoryManager(), J = g.DownloadKernelEventManager.getEventManager(),
        Z = D.ToastNotifyManagerNS.getToastNotifyManger();

    function Q(e) {
        return n(this, void 0, void 0, function* () {
            if (void 0 !== e) {
                let t = e + "\\.", i = yield K.asyncRemoteCall.getShell();
                (yield l.FileSystemAWNS.existsAW(t)) && (yield i.openPath(t))
            }
        })
    }

    function ee(e) {
        return n(this, void 0, void 0, function* () {
            return new Promise(t => n(this, void 0, void 0, function* () {
                e.properties = ["openFile"];
                let i = yield K.asyncRemoteCall.getCurrentWindow();
                (yield K.asyncRemoteCall.getDialog()).showOpenDialog(i, e).then(e => {
                    let i = e.filePaths;
                    e.canceled ? t(void 0) : t(i[0])
                }).catch()
            }))
        })
    }

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

    function ie() {
        return n(this, void 0, void 0, function* () {
            return E.DownloadAndPlayNS.getXmpPath()
        })
    }

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

    !function (e) {
        function t(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    e ? X.asyncShellExecute(0, "open", e, "", "", "SW_SHOW", i => {
                        j.information("async openitem", e, i), t(!(i <= 32))
                    }) : t(!1)
                })
            })
        }

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

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

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

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

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

        function E(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== t && "" !== t) {
                    if (!1 !== i) {
                        let e = w.ConfigNS.getValue("MoveToDir", "LatestSavePath", []), i = e.indexOf(t);
                        -1 !== i && e.splice(i, 1), e.splice(0, 0, t), e = e.slice(0, 3), w.ConfigNS.setValue("MoveToDir", "LatestSavePath", e), w.ConfigNS.save().catch()
                    }
                    for (let i of e) n = yield $.moveTaskToPath(i.taskId, t)
                }
                return n
            })
        }

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

        function ae(e) {
            let t = q.getCategoryView(e, d.DownloadKernel.CategroyViewID.Downloading);
            if (t) if (q.isPrivateCategory(e)) {
                let e = t.getTasks();
                for (let [, t] of e) if (null !== t) {
                    t.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || $.startTask(t.getId()).catch()
                }
            } else {
                let e = t.getTasks(), i = [];
                for (let [t, n] of e) if (null !== n) {
                    n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || i.push(t)
                }
                i.length > 0 && _.DownloadDispatchNS.startTasks(i)
            }
        }

        function oe(e, i = !1) {
            return n(this, void 0, void 0, function* () {
                function n(e) {
                    let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        i = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.DownloadSize);
                    return 0 === t && (t = 1), Math.round(i / t)
                }

                let o = {ret: !1, errcode: 0};
                do {
                    let r = null;
                    if (e.playUrl && !e.panFileId && (yield l.FileSystemAWNS.existsAW(e.playUrl))) {
                        let i = yield B.client.callServerFunction("GetConfigValue", "CompletedTaskPlay", "LanuchMediaPlayer", "0");
                        if ("1" === i) {
                            if (!(r = yield ie()) || !(yield l.FileSystemAWNS.existsAW(r))) {
                                if (!(yield O.default.installXmp())) break;
                                if (!(r = yield ie()) || !(yield l.FileSystemAWNS.existsAW(r))) break
                            }
                        } else if ("2" === i) {
                            t(e.playUrl).catch();
                            break
                        }
                    }
                    if (!e.playUrl || "" === e.playUrl) break;
                    let s = $.getTaskFromTaskId(e.taskId), c = "", h = 0, f = "", g = void 0;
                    if (null !== s && void 0 !== s) {
                        if ((g = s.getType()) === d.DownloadKernel.TaskType.Bt) {
                            f = c = s.getExtraObject().getInfoId(), e.taskUrl || (e.taskUrl = "magnet:?xt=urn:btih:" + c)
                        } else if (g === d.DownloadKernel.TaskType.Magnet) {
                            c = s.getExtraObject().getFileHash()
                        } else g !== d.DownloadKernel.TaskType.Emule && g !== d.DownloadKernel.TaskType.P2sp || (c = s.getTaskBaseInfo().gcid);
                        h = n(s)
                    }
                    let p = [], v = '/surl "' + e.playUrl + '"', m = "/sstartfrom xl11", y = "/sopenfrom " + e.openFrom;
                    "dc" === e.playType && (p.push("/stype"), p.push("dc")), p.push(m), p.push(y);
                    let k = '/sname "' + e.fileName + '"';
                    p.push(k);
                    let T = "/scid " + e.cid;
                    p.push(T);
                    let w = "/sgcid " + e.gcid;
                    p.push(w), e.playPosPercent ? p.push("/iplaypercent " + 100 * e.playPosPercent) : S.isNumber(e.startPos) && (V.ThunderHelper.isWindows10() ? p.push("/iplayposition " + e.startPos) : p.push("/#i_laststartpos " + e.startPos));
                    let I, b = U.default.getConfigInfo("XmpLitePlayer", "EmbedMode"),
                        _ = (yield(yield K.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle()).readUInt32LE(0);
                    p.push("-thunderwnd:" + _), j.information("[CrossProduct] embed=", b);
                    let D = W.XmpPlaySoure.PLAY_BY_DOWNLOAD;
                    if (s) {
                        let t = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.GroupTaskId);
                        I = "number" == typeof t && t > 0 ? t.toString() : e.taskId.toString()
                    } else e.panFileId && (I = e.panFileId, D = W.XmpPlaySoure.PLAY_BY_PAN);
                    if (r || (yield B.client.callServerFunction("SetPlayingTaskId", I, D)), e.playSoure = D, null !== b && 1 !== b || !e.isEmbed || p.push("-embedmode"), i || (yield C.ThunderNewTask.selectTask(Number(I))), s) {
                        let e = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.RefUrl);
                        if (e) {
                            let t = "/srefurl " + e;
                            p.push(t)
                        }
                    }
                    let A = (new Date).getTime();
                    p.push("/sclicktimestamp " + A), "" !== c && p.push("/scommentid " + c), h > 0 && p.push("/thunderdownloadSpeed " + h);
                    let N = "/sfilesize " + e.fileSize;
                    if (p.push(N), g === d.DownloadKernel.TaskType.Bt) {
                        let t = '/shashid "' + f + '"';
                        p.push(t);
                        let i = '/ssubid "' + e.fileIndex + '"';
                        p.push(i)
                    }
                    let x = '/sext "' + a.extname(e.fileName) + '"';
                    p.push(x);
                    let E = "/staskid " + e.taskId;
                    if (p.push(E), void 0 !== e.taskType) {
                        let t = "/stasktype " + e.taskType;
                        p.push(t)
                    }
                    if (null !== e.fileDir && void 0 !== e.fileDir && "" !== e.fileDir) {
                        let t = '/sFilePath "' + e.fileDir + '"';
                        p.push(t)
                    }
                    let M = "/ssdkver " + u.DownloadKernelManager.getDownloadSdkVersion();
                    p.push(M);
                    let F = yield P.TaskCtrlOperatorNS.getUserLoginInfo();
                    if ("" !== F && p.push(F), e.dlnaPlay && p.push("/sshowdlna on"), e.panFileId) {
                        let t = '/spanfileid "' + e.panFileId + '"';
                        p.push(t)
                    }
                    if (e.playType) {
                        let t = '/splayType "' + e.playType + '"';
                        p.push(t)
                    }
                    if (e.playFrom) {
                        let t = '/splayFrom "' + e.playFrom + '"';
                        p.push(t)
                    }
                    p.push(v);
                    let L = p.join(" ");
                    if (j.information("playVideoByXmp strArgs", L), r) {
                        let e = a.dirname(r);
                        L += " LocalFile";
                        let t = X.shellExecute(0, "open", r, L, e, "SW_SHOW");
                        t > 32 ? o.ret = !0 : o.errcode = t, R.server.fireClientEvent("OnPlayVideo", t), j.information("shellExecute:result = ", t)
                    } else {
                        let t = (new Date).getTime();
                        yield R.server.callClientFunctionByName(z.mainRendererContext, "XmpPlayerRecordStat", "setclickStartTime", t), R.server.callClientFunctionByName(H.CommonIPCBase.mainRendererContext, "XmpPlayerOpen", e).catch()
                    }
                } while (0);
                return o
            })
        }

        function re(e, t, i, o, r, s, u, c = !0, p, v, m) {
            return n(this, void 0, void 0, function* () {
                let n = !1, y = $.getTaskFromTaskId(e);
                do {
                    if (!y) break;
                    if (!y.isSupportPlay()) break;
                    let T = !1, w = q.getCategoryFromId(r);
                    (!w || w && w.getName() === f.CategoryManager.panCategoryName) && (T = !0);
                    let C = {playUrl: "", fileName: ""}, S = "", b = y.getTaskStatus(), D = null;
                    if (C.taskUrl = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl), C.fileSize = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.FileSize), C.taskId = e, C.taskType = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType), C.fileIndex = -1, C.isEmbed = p, C.dlnaPlay = s, C.startPos = void 0, C.playPosPercent = u, C.openFrom = "xunlei11", C.playFrom = v, C.showBackIcon = !1 !== m, p && R.server.fireClientEvent("OnShowDownAndPlayToast", e), b === d.DownloadKernel.TaskStatus.Succeeded || b === d.DownloadKernel.TaskStatus.Seeding) {
                        if (C.playType = "local", C.taskType === d.DownloadKernel.TaskType.Emule || C.taskType === d.DownloadKernel.TaskType.P2sp) {
                            let e = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath);
                            if (C.fileName = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), S = a.resolve(e, C.fileName), !(yield l.FileSystemAWNS.existsAW(S))) break;
                            if (C.cid = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid), C.gcid = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid), C.playUrl = S, c) {
                                let e = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                                    t = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                                C.startPos = e !== t ? t : 0
                            } else !1 === c && (C.startPos = 0)
                        } else if (C.taskType === d.DownloadKernel.TaskType.Bt || C.taskType === d.DownloadKernel.TaskType.Group) {
                            let i = [];
                            if (0 === (i = C.taskType === d.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield g(e, t)).length) break;
                            if (null !== (D = (i.length, i[0]))) {
                                if (yield l.FileSystemAWNS.existsAW(D.fullPath)) C.playUrl = D.fullPath; else if (C.taskType === d.DownloadKernel.TaskType.Bt) C.playUrl = yield y.getPlayUrl(D.index); else {
                                    let e = y.getExtraObject().getSubTaskByIndex(D.index);
                                    null !== e && void 0 !== e && (C.playUrl = yield e.getPlayUrl(-1))
                                }
                                C.fileName = D.fileName, C.cid = D.cid, C.gcid = D.gcid, C.fileIndex = D.index, c ? D.duration !== D.playPosition ? C.startPos = D.playPosition : C.startPos = 0 : !1 === c && (C.startPos = 0), C.taskType === d.DownloadKernel.TaskType.Group && (C.taskId = D.taskId, C.taskUrl = D.taskUrl)
                            }
                        }
                    } else {
                        if (C.playType = "p2s", b === d.DownloadKernel.TaskStatus.StartWaiting) {
                            j.information("down and play waiting");
                            break
                        }
                        if (y.setDownloadStrategy(d.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_DOWNLOADINGPLAYING), b === d.DownloadKernel.TaskStatus.Stopped || b === d.DownloadKernel.TaskStatus.Failed) {
                            if (!(yield _.DownloadDispatchNS.startTask(e))) {
                                j.information("down and play start waiting");
                                break
                            }
                            yield ne(e)
                        }
                        let i = !0;
                        if (C.taskType === d.DownloadKernel.TaskType.Bt || C.taskType === d.DownloadKernel.TaskType.Group) {
                            let n = [];
                            if (0 === (n = C.taskType === d.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield g(e, t)).length) break;
                            if (null !== (D = (n.length, n[0]))) {
                                if (yield l.FileSystemAWNS.existsAW(D.fullPath)) C.playUrl = D.fullPath, i = !1; else if (C.taskType === d.DownloadKernel.TaskType.Bt) C.playUrl = yield y.getPlayUrl(D.index); else {
                                    let e = y.getExtraObject().getSubTaskByIndex(D.index);
                                    null !== e && void 0 !== e && (C.playUrl = yield e.getPlayUrl(-1))
                                }
                                C.fileDir = a.dirname(D.fullPath), C.fileName = D.fileName, C.cid = D.cid, C.gcid = D.gcid, C.fileIndex = D.index, c ? D.duration !== D.playPosition ? C.startPos = D.playPosition : C.startPos = 0 : !1 === c && (C.startPos = 0), C.taskType === d.DownloadKernel.TaskType.Group && (C.taskId = D.taskId, C.taskUrl = D.taskUrl), j.information("Thunder.DownloadAndPlayIPC playTaskId:", C.taskId, ", taskId:", e)
                            }
                        } else if (C.taskType === d.DownloadKernel.TaskType.Emule || C.taskType === d.DownloadKernel.TaskType.P2sp) if (C.playUrl = yield y.getPlayUrl(-1), C.fileName = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), C.fileDir = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath), C.cid = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid), C.gcid = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid), c) {
                            let e = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                                t = y.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                            C.startPos = e !== t ? t : 0
                        } else !1 === c && (C.startPos = 0);
                        C.playUrl && C.playUrl
                    }
                    let A = yield oe(C, T);
                    if (n = A.ret) {
                        let e = y.getType();
                        if (e === d.DownloadKernel.TaskType.Bt) {
                            let e = y.getExtraObject().getBtFileByRealIndex(D.index);
                            e.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileStatus) === d.DownloadKernel.BtFileStatus.Complete && e.setUserRead(1)
                        } else if (e === d.DownloadKernel.TaskType.Group) {
                            let e = y.getExtraObject().getSubTaskByIndex(D.index);
                            null !== e && void 0 !== e && (e.getTaskStatus() !== d.DownloadKernel.TaskStatus.Succeeded && e.getTaskStatus() !== d.DownloadKernel.TaskStatus.Seeding || e.setUserRead(1))
                        } else y.getTaskStatus() !== d.DownloadKernel.TaskStatus.Succeeded && y.getTaskStatus() !== d.DownloadKernel.TaskStatus.Seeding || y.setUserRead(1)
                    }
                    let N = [];
                    if (void 0 === r && (r = I.default.getCurrentCategoryId()), -1 === r) N.push("panel_type=mypc"); else if (q.isPrivateCategory(r)) N.push("panel_type=private"); else {
                        let e = q.getCategoryFromId(r);
                        e && N.push("panel_type=" + e.getName())
                    }
                    void 0 === o && (o = ""), N.push("panel=" + o), N.push("taskid=" + e), N.push("filename=" + encodeURIComponent(C.fileName)), void 0 === i && (i = "other"), N.push("click_source=" + i), n ? N.push("result=success") : (N.push("result=fail"), N.push("errorcode=" + A.errcode));
                    let x = N.join(",");
                    j.information("trackEvent", "download_leftpanel", "play_panel_show", x), k.XLStatNS.trackEvent("download_leftpanel", "play_panel_show", "", 0, 0, 0, 0, x)
                } while (0);
                return n
            })
        }

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

        e.asyncOpenItem = t, e.importUncompletedFromFile = i, e.importUncompleted = function () {
            return n(this, void 0, void 0, function* () {
                j.information("import un-finished");
                let e = yield K.asyncRemoteCall.getCurrentWindow();
                (yield K.asyncRemoteCall.getDialog()).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"]}]
                }).then(e => {
                    let t = e.filePaths;
                    e.canceled ? j.information("import un finished select none") : i(t[0], "TD")
                }).catch()
            })
        }, e.removeNonExistingTask = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    if (void 0 === e || null === e) {
                        let t = Y.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Completed);
                        if (null === t) break;
                        let i = t.getTasks();
                        e = [...i.values()].map(e => e.getTaskBaseInfo())
                    }
                    if (null === e || void 0 === e || 0 === e.length) break;
                    let i = [];
                    for (let n of e) (yield P.TaskCtrlOperatorNS.isExistTaskFile(n)) || (i.push(n.taskId), t += 1);
                    yield $.deleteBatchTask(i, !0)
                } while (0);
                return t
            })
        }, e.markReadStatus = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let i of e) {
                    let e = $.getTaskFromTaskId(i.taskId);
                    e && e.setUserRead(t)
                }
            } while (0)
        }, e.moveCategoryTask = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let i of e) $.moveCategoryTask(i.taskId, t)
            } while (0)
        }, e.getFileIcon = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => n(this, void 0, void 0, function* () {
                    (yield K.asyncRemoteCall.getApp()).getFileIcon(e).then(e => {
                        t(null === e || void 0 === e ? null : e.toDataURL())
                    }).catch()
                }))
            })
        }, e.executeInstallFile = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let a = "", r = "";
                    if (null !== t && void 0 !== t && "" !== t) a = t, null !== i && void 0 !== i && "" !== i && (r = i); else {
                        if (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Group) break;
                        let t = e.getExtraObject(),
                            i = t.getUserData(N.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 === i || null === i || "" === i || "0" === i) break;
                        let n = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                        if (a = P.TaskCtrlOperatorNS.getSavePathByFileName(n, i), !(yield l.FileSystemAWNS.existsAW(a))) break;
                        r = "", null !== (i = t.getUserData(N.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams")) && void 0 !== i && "" !== i && (r = i)
                    }
                    if (o.ipcRenderer.send("onOpenExecute", a, r), n = !0, "ThunderUnion" === e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Origin)) {
                        let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName),
                            i = `filename=${encodeURIComponent(t)}`;
                        j.information("trackEvent js_grouptask_install ", t, i), k.XLStatNS.trackEvent("core_operate", "js_grouptask_install", "", 0, 0, 0, 0, i)
                    }
                } while (0);
                return n
            })
        }, e.openTaskFolder = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = e.savePath, n = e.taskName, o = "", r = yield K.asyncRemoteCall.getShell();
                "" === n ? o = i : (void 0 !== n && n.indexOf(".") === n.length - 1 && (n = n.substring(0, n.length - 1)), o = a.join(i, n));
                do {
                    if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        let n = $.getTaskFromTaskId(e.taskId), s = n.getExtraObject(), u = s.getDownloadFile();
                        if (1 !== u.length) {
                            t ? Q(o).catch() : r.showItemInFolder(o);
                            break
                        }
                        if (yield F.SingleBtTaskNS.isSingleBtTask(n)) o = F.SingleBtTaskNS.getSinleBtTaskFilePath(n); else {
                            let e = s.getBtFileList();
                            for (let [, t] of e) if (t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex) === u[0]) {
                                let e = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FilePath),
                                    n = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                    r = a.join(o, e);
                                if (o = a.join(o, e, n), e && !(yield l.FileSystemAWNS.dirExistsAW(r))) {
                                    let t = a.join(i, e);
                                    (yield l.FileSystemAWNS.dirExistsAW(t)) && (o = a.join(i, e, n))
                                }
                                break
                            }
                        }
                    } else {
                        if (e.taskType === d.DownloadKernel.TaskType.Group) {
                            t ? Q(i).catch() : r.showItemInFolder(i);
                            break
                        }
                        if (e.taskType === d.DownloadKernel.TaskType.Unkown) break;
                        if (e.taskType === d.DownloadKernel.TaskType.Magnet) break
                    }
                    if (e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === d.DownloadKernel.TaskStatus.Seeding) {
                        (yield l.FileSystemAWNS.existsAW(o)) ? r.showItemInFolder(o) : Q(i).catch();
                        break
                    }
                    if (yield l.FileSystemAWNS.existsAW(o)) {
                        r.showItemInFolder(o);
                        break
                    }
                    if (e.taskType === d.DownloadKernel.TaskType.P2sp) {
                        (yield l.FileSystemAWNS.existsAW(o + ".td")) ? r.showItemInFolder(o + ".td") : (yield l.FileSystemAWNS.existsAW(o + ".xltd")) ? r.showItemInFolder(o + ".xltd") : Q(i).catch();
                        break
                    }
                    if (e.taskType === d.DownloadKernel.TaskType.Emule) {
                        (yield l.FileSystemAWNS.existsAW(o + ".emule.td")) ? r.showItemInFolder(o + ".emule.td") : (yield l.FileSystemAWNS.existsAW(o + ".xltd")) ? r.showItemInFolder(o + ".xltd") : (yield l.FileSystemAWNS.existsAW(o + ".emule.xltd")) ? r.showItemInFolder(o + ".emule.xltd") : Q(i).catch();
                        break
                    }
                    if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        (yield l.FileSystemAWNS.existsAW(o + ".bt.td")) ? r.showItemInFolder(o + ".bt.td") : (yield l.FileSystemAWNS.existsAW(o + ".xltd")) ? r.showItemInFolder(o + ".xltd") : (yield l.FileSystemAWNS.existsAW(o + ".bt.xltd")) ? r.showItemInFolder(o + ".bt.xltd") : Q(i).catch();
                        break
                    }
                    e.taskType === d.DownloadKernel.TaskType.Group && Q(i).catch()
                } while (0)
            })
        }, e.openTaskItem = function (e, i, o, s, u, c, h) {
            return n(this, void 0, void 0, function* () {
                let n = e.savePath, f = e.taskName, g = "";
                "" === f ? g = n : (void 0 !== f && f.indexOf(".") === f.length - 1 && (f = f.substring(0, f.length - 1)), g = a.join(n, f));
                let p = $.getTaskFromTaskId(e.taskId), v = p.isSupportPlay();
                do {
                    if (e.taskType === d.DownloadKernel.TaskType.P2sp || e.taskType === d.DownloadKernel.TaskType.Emule) {
                        if (e.taskStatus !== d.DownloadKernel.TaskStatus.Succeeded && e.taskStatus !== d.DownloadKernel.TaskStatus.Seeding) break;
                        (yield l.FileSystemAWNS.existsAW(g)) && (v ? yield re(e.taskId, -1, o, s, u, void 0, void 0, !0, c, h) : t(g).catch())
                    } else if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        let f = p.getExtraObject(), m = f.getDownloadFile();
                        if (e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === d.DownloadKernel.TaskStatus.Seeding) if (1 === m.length) {
                            if (yield F.SingleBtTaskNS.isSingleBtTask(p)) g = F.SingleBtTaskNS.getSinleBtTaskFilePath(p); else {
                                let e = f.getBtFileList();
                                for (let [, t] of e) if (t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex) === m[0]) {
                                    let e = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FilePath),
                                        i = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                        o = a.join(g, e);
                                    if (g = a.join(g, e, i), e && !(yield l.FileSystemAWNS.dirExistsAW(o))) {
                                        let t = a.join(n, e);
                                        (yield l.FileSystemAWNS.dirExistsAW(t)) && (g = a.join(n, e, i))
                                    }
                                    break
                                }
                            }
                            v ? yield re(e.taskId, -1, o, s, u, void 0, void 0, !0, c, h) : t(g).catch()
                        } else if (null !== i && void 0 !== i && -1 !== i) {
                            let n = yield r(e.taskId, i);
                            null === n || void 0 === n || n.length <= 0 ? Q(g).catch() : n[0].fileExtType === T.TaskUtilHelper.FileExtType.Video ? yield re(e.taskId, i, o, s, u, void 0, void 0, !0, c, h) : null !== n[0].fullPath && void 0 !== n[0].fullPath && "" !== n[0].fullPath ? t(n[0].fullPath).catch() : Q(g).catch()
                        } else v ? yield re(e.taskId, -1, o, s, u, void 0, void 0, !0, c, h) : Q(g).catch(); else if (null !== i && void 0 !== i && -1 !== i) {
                            let n = yield r(e.taskId, i), a = {playUrl: n[0].fullPath, fileName: ""};
                            null === n || void 0 === n || n.length <= 0 ? Q(g).catch() : n[0].fileExtType === T.TaskUtilHelper.FileExtType.Video ? n[0].fullPath && (yield l.FileSystemAWNS.existsAW(n[0].fullPath)) ? (a.fileIndex = n[0].btFile.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex), a.fromweb = c, a.taskId = e.taskId, a.fileSize = 0, yield oe(a)) : yield re(e.taskId, i, o, s, u, void 0, void 0, !0, c, h) : null !== n[0].fullPath && void 0 !== n[0].fullPath && "" !== n[0].fullPath ? t(n[0].fullPath).catch() : Q(g).catch()
                        } else Q(g).catch()
                    } else if (e.taskType === d.DownloadKernel.TaskType.Group) if (null !== i && void 0 !== i && -1 !== i) {
                        let e = p.getExtraObject();
                        if (null === e || void 0 === e) break;
                        let n = e.getSubTaskByIndex(i), r = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId),
                            f = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                            g = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), v = "";
                        "" === g ? v = f : (void 0 !== g && g.indexOf(".") === g.length - 1 && (g = g.substring(0, g.length - 1)), v = a.join(f, g));
                        let m = n.isSupportPlay();
                        (yield l.FileSystemAWNS.existsAW(v)) && (m ? yield re(r, -1, o, s, u, void 0, void 0, !0, c, h) : t(v).catch())
                    } else {
                        let e = p.getExtraObject();
                        e && Q(e.getSubTaskByIndex(0).getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath)).catch()
                    }
                } while (0)
            })
        }, e.openAsTaskItem = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = e.savePath, i = e.taskName, n = "";
                "" === i ? n = t : (void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1)), n = a.join(t, i));
                let o = $.getTaskFromTaskId(e.taskId);
                do {
                    if (e.taskType === d.DownloadKernel.TaskType.P2sp || e.taskType === d.DownloadKernel.TaskType.Emule) {
                        if (e.taskStatus !== d.DownloadKernel.TaskStatus.Succeeded && e.taskStatus !== d.DownloadKernel.TaskStatus.Seeding) break;
                        L.exec(`rundll32.exe shell32.dll,OpenAs_RunDLL ${n}`, {cwd: process.cwd()})
                    } else if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        let t = o.getExtraObject(), i = t.getDownloadFile();
                        if ((e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === d.DownloadKernel.TaskStatus.Seeding) && 1 === i.length) if (yield F.SingleBtTaskNS.isSingleBtTask(o)) n = F.SingleBtTaskNS.getSinleBtTaskFilePath(o), L.exec(`rundll32.exe shell32.dll,OpenAs_RunDLL ${n}`, {cwd: process.cwd()}); else {
                            let i = yield F.SingleBtTaskNS.getCorrectSingleBtFolder(o);
                            if (i) {
                                let o = e.savePath, r = void 0, s = t.getBtFileList();
                                for (let [, e] of s) {
                                    r = e.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                                    break
                                }
                                n = a.join(o, i, r), L.exec(`rundll32.exe shell32.dll,OpenAs_RunDLL ${n}`, {cwd: process.cwd()})
                            }
                        }
                    }
                } while (0)
            })
        }, e.startTasks = function (e) {
            let t = e.map(e => e.taskId);
            _.DownloadDispatchNS.startTasks(t).catch()
        }, e.pauseTasks = function (e, t) {
            let i = [];
            for (let t of e) i.push(t.taskId);
            i.length > 0 && $.batchStopTask(i, 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 i of e) if (i.taskStatus === d.DownloadKernel.TaskStatus.Started) {
                        t = !0;
                        break
                    }
                    if (t) m.MessageBox.confirm({
                        title: "任务正在下载，您确定删除任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !1
                    }).then(t => {
                        if (t.action === y.MessageBoxNS.Action.OK) {
                            let t = [];
                            for (let i of e) se(i), t.push(i.taskId);
                            $.batchRemoveToRecycle(t).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                        }
                    }).catch(); else {
                        let t = [];
                        for (let i of e) se(i), t.push(i.taskId);
                        $.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 = w.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 === y.MessageBoxNS.Action.OK) {
                            let i = [];
                            for (let t of e) se(t), i.push(t.taskId);
                            w.ConfigNS.setValue("ConfigMsg", "ConfigMsg_DeleteFile", t.checkboxChecked), $.deleteBatchTask(i, t.checkboxChecked).then(e => {
                                t.checkboxChecked && !e && Z.showNotify(D.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, A.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                            }).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                        }
                    }).catch()
                } else {
                    let t = [];
                    for (let i of e) se(i), t.push(i.taskId);
                    $.deleteBatchTask(t, !0).then(e => {
                        e || Z.showNotify(D.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, A.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                    }).catch(), 1 === e.length && I.default.setNeedSelectNext(!0)
                }
            } while (0)
        }, e.move2Dir = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let a = !1;
                if (void 0 === t || "" === t) {
                    let o = yield K.asyncRemoteCall.getCurrentWindow();
                    (yield K.asyncRemoteCall.getDialog()).showOpenDialog(o, {properties: ["openDirectory"]}).then(o => n(this, void 0, void 0, function* () {
                        let n = o.filePaths;
                        o.canceled || (t = n[0]), void 0 !== t && "" !== t && (a = yield E(e, t, i))
                    })).catch()
                } else a = yield E(e, t, i);
                return a
            })
        }, e.copy2Dir = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = void 0;
                if (void 0 !== t && "" !== t) i = t; else {
                    let e = yield K.asyncRemoteCall.getCurrentWindow(),
                        t = yield(yield K.asyncRemoteCall.getDialog()).showOpenDialog(e, {properties: ["openDirectory"]});
                    t.canceled || (i = t.filePaths[0])
                }
                if (void 0 !== i && "" !== i) {
                    let t = w.ConfigNS.getValue("CopyToDir", "LatestSavePath", []), n = t.indexOf(i);
                    -1 !== n && t.splice(n, 1), t.splice(0, 0, i), t = t.slice(0, 3), w.ConfigNS.setValue("CopyToDir", "LatestSavePath", t), w.ConfigNS.save().catch();
                    for (let t of e) {
                        let e = t.savePath, n = t.taskName, r = e, s = i;
                        if (t.taskType !== d.DownloadKernel.TaskType.Group) {
                            let i = $.getTaskFromTaskId(t.taskId);
                            if (yield F.SingleBtTaskNS.isSingleBtTask(i)) {
                                let e = i.getExtraObject().getBtFileList();
                                for (let [, t] of e) {
                                    n = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                                    break
                                }
                            }
                            r = a.join(e, n)
                        } else r = a.join(r, "*");
                        s = a.join(i, n), r !== i && o.ipcRenderer.send(b.ThunderChannelList.channelRMFileCopy, r, s)
                    }
                }
            })
        }, e.copyLink = function (e, t) {
            let i = [];
            for (let t of e) {
                let e = $.getTaskFromTaskId(t.taskId);
                if (-1 === t.categoryId || q.isPrivateCategory(t.categoryId)) if (t.taskType !== d.DownloadKernel.TaskType.P2sp) if (t.taskType !== d.DownloadKernel.TaskType.Emule) if (t.taskType !== d.DownloadKernel.TaskType.Group) ; else {
                    let e = $.getTaskFromTaskId(t.taskId).getExtraObject(), n = e.getSubTaskCount();
                    for (let t = 0; t < n; t++) {
                        let n = J(e.getSubTaskByIndex(t));
                        i.push(n)
                    }
                } else i.push(t.url); else {
                    let n = e.getExtraObject().getDisplayUrl();
                    "" === n && (n = t.url), i.push(n)
                }
            }
            o.clipboard.writeText(i.join("\r\n")), B.client.callServerFunction("ShowMessageToast", {
                message: "链接已复制",
                type: "success"
            }).catch()
        }, e.copyMagnetLink = function (e, t) {
            do {
                if (void 0 === e) break;
                if (e.taskType !== d.DownloadKernel.TaskType.Bt) break;
                let t = $.getTaskFromTaskId(e.taskId), i = t.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl);
                i && "" !== i || (i = "magnet:?xt=urn:btih:" + t.getExtraObject().getInfoId()), o.clipboard.writeText(i), B.client.callServerFunction("ShowMessageToast", {
                    message: "磁力链接已复制",
                    type: "success"
                }).catch()
            } while (0)
        }, e.shareLink = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = "", o = e.taskName, r = "", s = $.getTaskFromTaskId(e.taskId);
                if (e.taskType === d.DownloadKernel.TaskType.P2sp) "" === (n = s.getExtraObject().getDisplayUrl()) && (n = e.url), r = a.extname(o).toLowerCase(); else if (e.taskType === d.DownloadKernel.TaskType.Emule) n = e.url, r = a.extname(o).toLowerCase(); else {
                    if (e.taskType !== d.DownloadKernel.TaskType.Bt) return;
                    (n = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)) && "" !== n || (n = "magnet:?xt=urn:btih:" + s.getExtraObject().getInfoId()), r = ".torrent"
                }
                let l = yield G.LoginHelperNS.loginHelper.getUserInfoAw("userid");
                m.MessageBox.custom("copy-link-share", {
                    url: n,
                    panel: t,
                    taskName: o,
                    ext: r,
                    taskId: e.taskId,
                    shareFrom: i,
                    userId: l
                }, {width: 500, height: 353, center: !0}).catch()
            })
        }, e.saveAsTorrent = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (void 0 === e) break;
                    if (e.taskType !== d.DownloadKernel.TaskType.Bt) break;
                    let i = $.getTaskFromTaskId(e.taskId).getExtraObject(), o = i.getSeedFilePath();
                    if (!(yield l.FileSystemAWNS.existsAW(o))) break;
                    let r = e.taskName;
                    void 0 !== r && "" !== r || "" === (r = i.getDisplayName()) && (r = a.parse(o).name);
                    let s = r, u = a.parse(r);
                    x.ParseUrlFileNameNS.isUsualFileExtName(u.ext) && (s = u.name + ".torrent");
                    let c = yield K.asyncRemoteCall.getCurrentWindow(),
                        h = {defaultPath: s, filters: [{name: "BT种子文件（*.torrent）", extensions: ["torrent"]}]};
                    (yield K.asyncRemoteCall.getDialog()).showSaveDialog(c, h).then(e => n(this, void 0, void 0, function* () {
                        let i = e.filePath;
                        void 0 !== i && "" !== i ? (".torrent" !== a.extname(i).toLowerCase() && (i += ".torrent"), (t = yield l.FileSystemAWNS.copyFileAW(o, i)) || Z.showNotify(D.ToastNotifyManagerNS.notifyIdTaskOperatorSaveAsTorrent, A.ToastNotifyItemType.RedNotify, "获取此任务种子文件失败", 3e3)) : t = !0
                    })).catch()
                } while (0)
            })
        }, e.renameTask = function (e) {
            j.information("rename", e.taskName, e.taskId);
            let t = e.taskName;
            m.MessageBox.custom("task-rename", {taskBase: e}, {width: 450, height: 194, center: !0}).then(i => {
                if (i.action === y.MessageBoxNS.Action.OK) do {
                    if (S.isNullOrUndefined(i.args)) break;
                    if (void 0 === i.args.fileName || null === i.args.fileName) break;
                    let n = i.args.fileName;
                    if (n === t) break;
                    $.getTaskFromTaskId(e.taskId).reName(n).catch()
                } while (0)
            }).catch()
        }, e.recoverTask = function (e) {
            if (e.length > 1) {
                let t = [];
                for (let i of e) t.push(i.taskId);
                $.batchRecoverFromRecycle(t)
            } else for (let t of e) $.recoverFromRecycle(t.taskId);
            Z.showNotify(D.ToastNotifyManagerNS.notifyIdTaskOperatorRecoverTask, A.ToastNotifyItemType.GreenNotify, "已还原任务", 3e3)
        }, e.clearRecycle = function () {
            let e = Y.getCategoryViewFromId(d.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 === y.MessageBoxNS.Action.OK) {
                    let i = [];
                    e.forEach(e => {
                        i.push(e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId))
                    }), $.deleteBatchTask(i, t.checkboxChecked).catch()
                }
            }).catch()
        }, e.startAllPausedTask = function () {
            return n(this, void 0, void 0, function* () {
                let e = [], t = Y.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Downloading).getTasks();
                for (let [, i] of t) i.getTaskStatus() === d.DownloadKernel.TaskStatus.Stopped && e.push(i);
                let i = e.map(e => e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId));
                yield _.DownloadDispatchNS.startTasks(i)
            })
        }, e.startAll = function () {
            let e = [], t = Y.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, i] of t) e.push(i);
            let i = e.map(e => e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId));
            _.DownloadDispatchNS.startTasks(i).catch(), G.LoginHelperNS.loginHelper.getUserInfoAw("userid").then(e => {
                e && ae(q.getCategoryFromUserId("ThunderPanPlugin", e, "ThunderPan Download Category").getId())
            }).catch()
        }, e.pauseAll = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = Y.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Downloading).getTasks();
                for (let [, e] of i) null !== e && (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || t.push(e.getId()));
                t.length > 0 && $.batchStopTask(t, e)
            })
        }, e.hasCategoryStartTask = function (e) {
            let t = !1, i = q.getCategoryView(e, d.DownloadKernel.CategroyViewID.Downloading);
            if (!i) return t;
            let n = i.getTasks();
            for (let [, e] of n) if (null !== e) {
                let i = e.getTaskStatus();
                if (i === d.DownloadKernel.TaskStatus.StartWaiting || i === d.DownloadKernel.TaskStatus.StartPending || i === d.DownloadKernel.TaskStatus.Started) {
                    t = !0;
                    break
                }
            }
            return t
        }, e.startCategoryAllTask = ae, e.pauseCategoryAllTask = function (e, t) {
            let i = q.getCategoryView(e, d.DownloadKernel.CategroyViewID.Downloading);
            if (!i) return;
            let n = [], a = i.getTasks();
            for (let [, e] of a) null !== e && (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || n.push(e.getId()));
            n.length > 0 && $.batchStopTask(n, t)
        }, e.playVideoByXmp = oe, e.downloadAndPlay = re, e.statJsSdkDeleteTask = se, e.createBirdKey = function (e) {
            let t, i, n = $.getTaskFromTaskId(e), a = n.getTaskBaseInfo(), o = n.getType(), r = "";
            if (o === d.DownloadKernel.TaskType.P2sp) r = a.url, i = "p2sp", t = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid); else if (o === d.DownloadKernel.TaskType.Emule) r = a.url, i = "emule", t = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid); else if (o === d.DownloadKernel.TaskType.Bt) {
                i = "bt";
                let e = n.getExtraObject();
                t = e.getInfoId(), (r = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)) && "" !== r || (r = "magnet:?xt=urn:btih:" + e.getInfoId())
            } else if (o === d.DownloadKernel.TaskType.Magnet) i = "magnet"; else if (o === d.DownloadKernel.TaskType.Group) {
                i = "group";
                let e = {};
                e.taskGroupName = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks = [];
                let t = n.getExtraObject(), a = t.getUserData(N.TaskUserDataGUID.guidDownloadGroupTask, "excludePath"),
                    o = t.getUserData(N.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile"),
                    s = t.getUserData(N.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                e.excludePath = a || "", e.installFile = o || "", e.runParams = s || "";
                let l = t.getUserData(N.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                if (l && l.length > 0) try {
                    l = JSON.parse(l), e.createShortcut = l
                } catch (e) {
                    j.warning(e)
                }
                let u = t.getSubTaskCount(), c = "", h = "";
                for (let i = 0; i < u; ++i) {
                    let n = t.getSubTaskByIndex(i), a = n.getType();
                    a !== d.DownloadKernel.TaskType.P2sp && a !== d.DownloadKernel.TaskType.Emule || (c = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl), h = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks.push({
                        name: h,
                        url: c,
                        dir: ""
                    }))
                }
                r = JSON.stringify(e)
            }
            if (r.length > 0) {
                j.information("点击任务详情按钮,生成迅雷口令,taskURL:", r);
                let e = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryViewId), o = new Map;
                o.set(d.DownloadKernel.CategroyViewID.Downloading, "downloading"), o.set(d.DownloadKernel.CategroyViewID.Completed, "complete"), o.set(d.DownloadKernel.CategroyViewID.Recycle, "trash"), o.set(d.DownloadKernel.CategroyViewID.Unkown, "unknown");
                let s = {
                    pannel: o.get(e),
                    gcid: t,
                    taskid: a.taskId.toString(),
                    filename: a.taskName,
                    pannelType: n.getIsPrivate() ? "private" : "mypc",
                    taskType: i
                };
                M.openBirdKeyEncodeDialog(r, s).catch()
            }
        }, e.getTaskBirdKeyData = function (e) {
            let t = "", i = $.getTaskFromTaskId(e), n = i.getTaskBaseInfo(), a = i.getType();
            if (a === d.DownloadKernel.TaskType.P2sp) t = n.url; else if (a === d.DownloadKernel.TaskType.Emule) t = n.url; else if (a === d.DownloadKernel.TaskType.Bt) (t = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)) && "" !== t || (t = "magnet:?xt=urn:btih:" + i.getExtraObject().getInfoId()); else if (a === d.DownloadKernel.TaskType.Magnet) ; else if (a === d.DownloadKernel.TaskType.Group) {
                let e = {};
                e.taskGroupName = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks = [];
                let n = i.getExtraObject(), a = n.getUserData(N.TaskUserDataGUID.guidDownloadGroupTask, "excludePath"),
                    o = n.getUserData(N.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile"),
                    r = n.getUserData(N.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                e.excludePath = a || "", e.installFile = o || "", e.runParams = r || "";
                let s = n.getUserData(N.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                if (s && s.length > 0) try {
                    s = JSON.parse(s), e.createShortcut = s
                } catch (e) {
                    j.warning(e)
                }
                let l = n.getSubTaskCount(), u = "", c = "";
                for (let t = 0; t < l; ++t) {
                    let i = n.getSubTaskByIndex(t), a = i.getType();
                    a !== d.DownloadKernel.TaskType.P2sp && a !== d.DownloadKernel.TaskType.Emule || (u = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl), c = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks.push({
                        name: c,
                        url: u,
                        dir: ""
                    }))
                }
                t = JSON.stringify(e)
            }
            return t
        }
    }(t.TaskOperatorNs || (t.TaskOperatorNs = {}))
}, function (e, t, i) {
    "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.channelRMNewTaskClose = "RM_NEWTASK_CLOSE", e.channelRMPreNewTaskClose = "RM_PRENEWTASK_CLOSE", 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.channelRMSetConfigValueReject = "RM_SET_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.channelRMShowSearchWindow = "RM_SHOW_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.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", e.channelRMConfigInitFinished = "RM_CONFIG_INIT_FINISHED", e.channelRMConfigValueChanged = "RM_CONFIG_VALUE_CHANGED", e.channelRMIndividuationBrowserMsg = "RM_INDIVIDUATION_BROWSER_MSG", e.channelMRIndividuationBrowserMsg = "MR_INDIVIDUATION_BROWSER_MSG", e.channelRMSetEnvironmentVariable = "RM_SET_ENVIRONMENT_VARIABLE", e.channelMREmbedPlayerPos = "MR_EMBED_PLAYER_POSITION", e.channelRMUpdateLogEnviroment = "RM_UPDATE_LOG_ENVIRONMENT", e.channelMRUpdateLogEnviroment = "MR_UPDATE_LOG_ENVIRONMENT"
    }(t.ThunderChannelList || (t.ThunderChannelList = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(93), r = i(59), s = i(3), l = i(7).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t, i;

        function a(e) {
            let t = e;
            return /^[a-zA-Z]:\\/.test(e) ? t = e.slice(0, 3) : e && "\\" !== e[e.length - 1] && (t = e + "\\"), t
        }

        !function (e) {
            e[e.DRIVE_UNKNOWN = 0] = "DRIVE_UNKNOWN", e[e.DRIVE_NO_ROOT_DIR = 1] = "DRIVE_NO_ROOT_DIR", e[e.DRIVE_REMOVABLE = 2] = "DRIVE_REMOVABLE", e[e.DRIVE_FIXED = 3] = "DRIVE_FIXED", e[e.DRIVE_REMOTE = 4] = "DRIVE_REMOTE", e[e.DRIVE_CDROM = 5] = "DRIVE_CDROM", e[e.DRIVE_RAMDISK = 6] = "DRIVE_RAMDISK"
        }(t = e.DriverType || (e.DriverType = {})), function (e) {
            e[e.Unspecified = 0] = "Unspecified", e[e.HDD = 3] = "HDD", e[e.SSD = 4] = "SSD", e[e.SCM = 5] = "SCM"
        }(i = e.MediaType || (e.MediaType = {})), e.getDriveType = function (e) {
            return e = a(e), l.getDriveType(e)
        }, e.getDriveInfo = function (e) {
            return e = a(e), l.getDriveInfo(e)
        }, e.getFreePartitionSpace = function (e) {
            return e = a(e), l.getFreePartitionSpace(e)
        }, e.getLogicalDriveStrings = function () {
            return l.getLogicalDriveStrings()
        }, e.getPartitionSpace = function (e) {
            return e = a(e), l.getPartitionSpace(e)
        }, e.getSystemTempPath = function () {
            return l.getSystemTempPath()
        }, e.getTaskTypeFromUrl = function (e) {
            let t = l.getTaskTypeFromUrl(e);
            if (t === s.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 i = /:\/\/\[(.+?)\].*/.exec(e);
                i || (i = /.+?:\/\/.*?\[(.+?)\].*/.exec(e)), i && i[1] && o.isIPv6(i[1]) && (t = s.DownloadKernel.TaskType.P2sp)
            }
            return t
        }, e.extractIcon = function (e, t) {
            return l.extractIcon(e, t)
        }, e.isWindow7 = function () {
            return 1 === l.isWin7()
        }, e.isWindow8OrLater = function () {
            let e = !1;
            do {
                let t = r.release();
                if (!t) break;
                let i = t.indexOf(".", 0);
                if (i < 0) break;
                let n = t.substring(0, i);
                if (!n) break;
                let a = parseInt(n, 10);
                a && a >= 8 && (e = !0)
            } while (0);
            return e
        }, e.isWindows10 = function () {
            let e = !1;
            do {
                let t = r.release();
                if (!t) break;
                if (0 === t.indexOf("10.0.")) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }, e.compareStr = function (e, t) {
            return l.compareStr(e, t)
        }, e.getTickCount = function () {
            return l.getTickCount()
        }, e.setScreenSaveActive = function (e) {
            return l.setScreenSaveActive(e)
        }, e.isSparseDriver = function (e) {
            return e = a(e), l.isSparseDriver(e)
        }, e.getAppList = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getAppList(t => {
                        e(t)
                    })
                })
            })
        }, e.isSSD = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.isSSD((t, i) => {
                        e(i)
                    })
                })
            })
        }, e.getMemoryInfo = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getMemoryInfo((t, i) => {
                        e({totalPhy: t, totalVir: i})
                    })
                })
            })
        }, e.getHardDiskSpaceList = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getHardDiskSpaceList(t => {
                        e(t)
                    })
                })
            })
        }, e.getCpuList = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getCpuList(t => {
                        e(t)
                    })
                })
            })
        }, e.getFixedDriveMediaType = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    e.length > 1 && (e = e.slice(0, 1)), l.getDriveMediaType(e.toUpperCase(), (e, i) => {
                        t(i)
                    })
                })
            })
        }, e.sleep = function (e) {
            return n(this, void 0, void 0, function* () {
                yield new Promise((t, i) => {
                    setTimeout(t, e)
                })
            })
        }
    }(t.ThunderHelper || (t.ThunderHelper = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

        e.genarateMd5 = function (e) {
            let t = void 0, i = a.createHash("md5");
            return null !== i && (t = i.update(e).digest("hex")), t
        }, e.matchFileMd5 = function (e, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1, a = yield t(e);
                return void 0 !== a && a === i.toUpperCase() && (s.information("check full md5 sucessful"), n = !0), n
            })
        }, e.calculateFileMd5Ex = function (e) {
            return n(this, void 0, void 0, function* () {
                let t;
                if (e && (yield r.FileSystemAWNS.existsAW(e))) {
                    let i = o.createReadStream(e), n = a.createHash("md5");
                    i.on("data", e => {
                        n.update(e)
                    }), t = new Promise(e => {
                        i.on("end", () => {
                            let t = n.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 i = null;
            try {
                let n = a.createCipheriv("aes-128-ecb", t, ""), o = n.update(e), r = n.final();
                i = Buffer.concat([o, r])
            } catch (e) {
                s.warning("encryptBuffer", e)
            }
            return i
        }, e.decryptBuffer = function (e, t) {
            let i = null;
            try {
                let n = a.createDecipheriv("aes-128-ecb", t, ""), o = n.update(e), r = n.final();
                i = Buffer.concat([o, r])
            } catch (e) {
                s.warning("decryptBuffer", e)
            }
            return i
        }, e.encryptSha1Buffer = function (e) {
            let t = null;
            try {
                t = a.createHash("sha1").update(e).digest("hex")
            } catch (e) {
                s.warning("encryptSha1Buffer", e)
            }
            return t
        }, e.encryptHmacBuffer = function (e, t, i, n = "hex") {
            let o = null;
            try {
                o = a.createHmac(e, t).update(i, "utf8").digest(n)
            } catch (e) {
                s.warning("encryptSha1Buffer", e)
            }
            return o
        }, e.setForegroundWindow = function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (null !== e && null !== t) {
                    let i = void 0, a = [];
                    "renderer" === process.type ? (i = yield t.getNativeWindowHandle(), a = yield t.getChildWindows()) : (i = t.getNativeWindowHandle(), a = t.getChildWindows());
                    let o = [];
                    for (let e = 0; e < a.length; ++e) {
                        let t = a[e], i = !1;
                        "renderer" === process.type ? (yield t.isDestroyed()) || (i = yield t.isAlwaysOnTop()) : t.isDestroyed() || (i = t.isAlwaysOnTop()), i && o.push(t)
                    }
                    let r = i.readUIntLE(0, 4);
                    e.setForegroundWindow(r) ? s.information("setForegroundWindow sucessful") : s.information("setForegroundWindow failed"), o.forEach(e => n(this, void 0, void 0, function* () {
                        "renderer" === process.type ? (yield e.isDestroyed()) || e.setAlwaysOnTop(!0).catch() : e.isDestroyed() || e.setAlwaysOnTop(!0)
                    }))
                }
            })
        }
    }(t.ToolsUtilitiesAWNS || (t.ToolsUtilitiesAWNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(4), o = i(27), r = i(25), s = n.default.getLogger("Thunder.MainRenderer.TabsBrowser");

    class l {
        constructor() {
        }

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

        unregisterNativeFunction(e) {
            let t = !1;
            do {
                if (a.isNullOrUndefined(e) || "" === e) {
                    s.warning(e);
                    break
                }
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) {
                    s.warning(l.nativeFunctionContainer);
                    break
                }
                for (let i in l.nativeFunctionContainer) if (l.nativeFunctionContainer[Number(i)].functionName === e) {
                    l.nativeFunctionContainer.splice(Number(i), 1), t = !0;
                    break
                }
            } while (0);
            return t
        }

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

        onJsCheckNativeFunction(e, t, i) {
            do {
                if (a.isNullOrUndefined(e) && s.warning(e), a.isNullOrUndefined(i)) break;
                if (a.isNullOrUndefined(t) || "" === t) {
                    s.warning(t);
                    break
                }
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) {
                    s.warning(l.nativeFunctionContainer);
                    break
                }
                let n = l.nativeFunctionContainer.filter(e => t === e.functionName),
                    d = r.NativeFunctionErrorCode.Success;
                if ((a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0]) || a.isNullOrUndefined(n[0].nativeFunc)) && (d = r.NativeFunctionErrorCode.FunctionUnExist, s.warning(n)), a.isNullOrUndefined(o.NativeCallHostModule.nativeCallHost)) {
                    s.warning(o.NativeCallHostModule.nativeCallHost);
                    break
                }
                o.NativeCallHostModule.nativeCallHost.callJsFunctionById(e, i, d)
            } while (0);
            return !1
        }

        callNativeFunctionCallback(e, t, ...i) {
            let n = !1;
            do {
                if (a.isNullOrUndefined(t)) {
                    s.warning(t);
                    break
                }
                if (a.isNullOrUndefined(o.NativeCallHostModule.nativeCallHost)) {
                    s.warning(o.NativeCallHostModule.nativeCallHost);
                    break
                }
                o.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(o.NativeCallHostModule.nativeCallHost, [e].concat(t, i)), n = !0
            } while (0);
            return n
        }
    }

    l.nativeFunctionContainer = [], t.NativeCall = l;
    const d = new l;
    !function (e) {
        function t(e, t, i, n) {
            d.onJsCallNativeFunction(e, t, i, n)
        }

        function i(e, t, i) {
            d.onJsCheckNativeFunction(e, t, i)
        }

        e.init = function () {
            o.NativeCallHostModule.nativeCallHost.initialize();
            let e = {onJsCallNativeFunction: t, onJsCheckNativeFunction: i};
            o.NativeCallHostModule.nativeCallHost.addDelegate(e)
        }, e.registerNativeFunction = function (e) {
            let t = !1;
            do {
                if (a.isNullOrUndefined(e)) {
                    s.warning("event listeners error");
                    break
                }
                if (0 === e.length) {
                    s.warning("event listeners length error");
                    break
                }
                l.nativeFunctionContainer = [...l.nativeFunctionContainer, ...e], t = !0
            } while (0);
            return t
        }, e.unregisterNativeFunction = function (e) {
            for (let t of e) for (let e = 0; e < l.nativeFunctionContainer.length; e++) if (l.nativeFunctionContainer[e].functionName === t) {
                l.nativeFunctionContainer.splice(e, 1);
                break
            }
        }, e.checkNativeFunction = function (e) {
            let t = !1;
            do {
                if (!e) break;
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) break;
                if (0 === l.nativeFunctionContainer.length) break;
                for (let i = 0; i < l.nativeFunctionContainer.length; i++) if (l.nativeFunctionContainer[i].functionName === e) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }
    }(t.NativeCallNS || (t.NativeCallNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(2), r = i(0), s = i(7), l = i(33), d = i(3), u = i(12), c = i(61), h = i(41), f = i(13),
        g = i(63), p = i(22), v = i(29), m = i(14), y = i(9), k = i(6), T = i(43), w = i(46), C = i(24), S = i(86),
        I = i(51), b = i(44), _ = i(447), D = i(39), A = i(34), N = i(10), x = i(448), E = i(52), P = i(49), O = i(5),
        M = i(87), F = i(99), L = E.ToastNotifyManagerNS.getToastNotifyManger(),
        R = r.default.getLogger("ThunderNewTask"), B = u.DownloadKernelTaskManager.getTaskManager(),
        U = s.default(o.join(__rootDir, "../bin/ThunderHelper.node")), K = i(38), V = i(11), W = i(16), G = i(53),
        H = i(65);
    let z = !1, j = !1;
    !function (e) {
        function t(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = B.getTaskFromTaskId(e);
                do {
                    if (!i) break;
                    let n = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryId),
                        a = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryViewId);
                    if (R.information("查看重复任务", a), a === d.DownloadKernel.CategroyViewID.Unkown) break;
                    t = void 0 === t || t, v.default.fireEvent(m.NodeEventMesssageNS.eventDownloadSwitchCategory, n, a, e, t)
                } while (0)
            })
        }

        function i(e, i) {
            R.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 === d.DownloadKernel.TaskType.P2sp || r.taskType === d.DownloadKernel.TaskType.Emule) {
                        let t = e[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.GroupTaskId);
                        if (t > 0) {
                            let e = B.getTaskFromTaskId(t);
                            null !== e && void 0 !== e && (o = e, a = !0)
                        }
                    }
                    p.MessageBox.confirm({
                        title: "该任务已存在，重新下载将会删除已下载的内容",
                        type: p.MessageBox.ConfirmType.Warning,
                        fileName: o.getTaskBaseInfo().taskName,
                        okText: "查看",
                        cancelText: "重新下载",
                        cancelVisible: !a
                    }).then(e => n(this, void 0, void 0, function* () {
                        if (e.action === K.MessageBoxNS.Action.OK) {
                            yield t(o.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId))
                        } else if (e.action === K.MessageBoxNS.Action.Cancel) if (void 0 === i || null === i || 0 === i.length) h.TaskCtrlOperatorNS.redownloadTask([o.getTaskBaseInfo()], !1).catch(); else {
                            yield B.deleteTask(o.getTaskBaseInfo().taskId, !0), i[0].newTaskInfo.taskBaseInfo.productInfo = h.TaskCtrlOperatorNS.constructProductInfo(""), i[0].newTaskInfo.taskBaseInfo.origin = "re_download";
                            let e = yield B.createTask(i[0].taskType, i[0].newTaskInfo);
                            if (null !== e) {
                                let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                yield b.DownloadDispatchNS.startTask(t)
                            }
                        }
                    })).catch()
                } else {
                    let t = e.map(e => e.getTaskBaseInfo().url), i = JSON.stringify(t);
                    p.MessageBox.custom("multi-repeat-task", {file: i}).catch()
                }
            } while (0)
        }

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

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

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

        function $(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (0 === e.length) break;
                    F.popMutual.setReady(M.PopView.NEW_TASK), a.ipcRenderer.send("create-new-task-window", JSON.stringify(e))
                } while (0)
            })
        }

        function Y(e, t, i, n, o) {
            F.popMutual.setReady(M.PopView.PRE_NEW_TASK), a.ipcRenderer.send("create-pre-new-task-window", e ? JSON.stringify(e) : e, t, i, n, o ? JSON.stringify(o) : o)
        }

        function q(e, t) {
            F.popMutual.setReady(M.PopView.BT_NEW_TASK), a.ipcRenderer.send("create-bt-task-window", e ? JSON.stringify(e) : e, t ? JSON.stringify(t) : t)
        }

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

        function Z(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                if (A.ThunderHelper.getDriveType(e) === A.ThunderHelper.DriverType.DRIVE_FIXED) {
                    (yield A.ThunderHelper.getFixedDriveMediaType(e)) === A.ThunderHelper.MediaType.HDD && (t = !0)
                }
                return t
            })
        }

        function Q(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (j) break;
                    if (e > 1048576e3) {
                        if (!(yield O.client.callServerFunction("IsFileSizeSetterWorking")) && (yield Z(t))) {
                            j = !0, 0 === (yield O.client.callServerFunction("LaunchFileAssistant")) && N.XLStatNS.trackEvent("core_event", "apply_for_disk_space_fast_succ")
                        }
                    }
                } while (0)
            })
        }

        function ee(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (e.length > 1) break;
                    let t = e[0], n = 0;
                    e.forEach(e => {
                        e.fileSize && (n += e.fileSize)
                    });
                    let a = yield O.client.callServerFunction("GetDownloadDir");
                    yield Q(n, a);
                    let o = A.ThunderHelper.getTaskTypeFromUrl(t.url), r = g.ParseUrlFileNameNS.getNameFromUrl(t.url),
                        s = yield O.client.callServerFunction("GetConfigValue", "TaskDefaultSettings", "NewTaskStartMode", 1),
                        l = [], u = void 0;
                    if (o === d.DownloadKernel.TaskType.P2sp) u = {
                        taskType: d.DownloadKernel.TaskType.P2sp,
                        newTaskInfo: {
                            taskType: d.DownloadKernel.TaskType.P2sp,
                            taskBaseInfo: {taskName: r, savePath: a},
                            p2spTaskInfo: {
                                url: t.url,
                                refUrl: t.referer,
                                cookie: t.cookie,
                                nameFixed: t.nameFixedFlag & x.ThunderNewtaskHelperNS.taskOptFileNameFixed ? 1 : 0
                            },
                            searchSource: t.searchFrom
                        }
                    }, l = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                        taskType: d.DownloadKernel.TaskType.P2sp,
                        value: t.url
                    }]); else if (o === d.DownloadKernel.TaskType.Emule) {
                        u = {
                            taskType: d.DownloadKernel.TaskType.Emule,
                            newTaskInfo: {
                                taskType: d.DownloadKernel.TaskType.Emule,
                                taskBaseInfo: {taskName: r, savePath: a},
                                emuleTaskInfo: {url: t.url},
                                searchSource: t.searchFrom
                            }
                        };
                        let e = g.ParseUrlFileNameNS.parseEd2kUrl(t.url);
                        l = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                            taskType: d.DownloadKernel.TaskType.Emule,
                            value: e.fileHash
                        }])
                    }
                    if (l && l.length > 0) {
                        (yield V.asyncRemoteCall.getCurrentWindow()).show(), i(l, [u]);
                        break
                    }
                    if (void 0 === u) break;
                    let h = yield B.createTask(u.taskType, u.newTaskInfo);
                    if (null !== h && 1 === s) {
                        let e = h.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                        yield b.DownloadDispatchNS.startTask(e)
                    }
                } while (0)
            })
        }

        function te(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (e.length > 1) {
                        $(e).catch();
                        break
                    }
                    let t = e[0];
                    if (void 0 === t.browser || t.browser, t.browser, 0 === (yield O.client.callServerFunction("GetConfigValue", "TaskDefaultSettings", "OpenSilenceDownload", 0))) {
                        $(e).catch();
                        break
                    }
                    ee(e).catch()
                } while (0)
            })
        }

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

        function ne(e) {
            return n(this, void 0, void 0, function* () {
                let t = "";
                do {
                    if (!e) break;
                    let i = yield O.client.callServerFunction("GetCurrentSelectTabValue", "url");
                    if (e !== i) break;
                    let n = yield O.client.callServerFunction("GetCurrentSelectTabValue", "extData");
                    if (!n) break;
                    let a = null;
                    try {
                        a = JSON.parse(n)
                    } catch (e) {
                    }
                    a && a.search_from && (t = a.search_from)
                } while (0);
                return t
            })
        }

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

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

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

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

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

        function de(e, t) {
            return n(this, void 0, void 0, function* () {
                if ((yield O.client.callServerFunction("GetCurrentNav")) === G.NavViewID.Download) {
                    if (!t) return yield O.client.callServerFunction("SelectNav", G.NavViewID.Cloud), void (yield W.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcShowTransferWindow"));
                    N.XLStatNS.trackEvent("download_leftpanel", "sync_to_yunpan_tips_show"), L.showNotifyEx(E.ToastNotifyManagerNS.notifyIdTaskAdd2Cloud, P.ToastNotifyItemType.GreenNotify, `${e}个下载任务已同步到云盘`, 3e3, {
                        viewVisible: !0,
                        onView: () => n(this, void 0, void 0, function* () {
                            N.XLStatNS.trackEvent("download_leftpanel", "sync_to_yunpan_tips_click", "", 0, 0, 0, 0, "clickid=look"), yield O.client.callServerFunction("SelectNav", G.NavViewID.Cloud), yield W.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcShowTransferWindow")
                        }),
                        onClose: () => {
                            N.XLStatNS.trackEvent("download_leftpanel", "sync_to_yunpan_tips_click", "", 0, 0, 0, 0, "clickid=close")
                        }
                    })
                }
            })
        }

        function ue(e) {
            return n(this, void 0, void 0, function* () {
                let t = void 0;
                do {
                    if (yield O.client.callServerFunction("IsLogined")) {
                        t = e;
                        break
                    }
                    let i = "";
                    if (!(yield H.default(!1, !0, i))) break;
                    yield f.ThunderUtil.setTimeoutAw(50);
                    let n = yield W.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcDefaultSavePath");
                    if (!n || !n[0]) {
                        R.information("cloud IpcDefaultSavePath error", n[2]);
                        break
                    }
                    "我的资源" === n[0].name && (n[0].name = "我的云盘\\我的资源"), t = n[0]
                } while (0);
                return t
            })
        }

        function ce(e, t, i, a, o, r) {
            return n(this, void 0, void 0, function* () {
                if (t = yield ue(t)) {
                    let n = 0, s = [], l = e.map(e => ({
                        from: r,
                        searchFrom: e.data.searchFrom,
                        url: e.data.url,
                        name: e.data.fileName,
                        path: t.name,
                        parentId: t.id,
                        files: []
                    })), d = [];
                    if ((d = i ? yield W.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcAddUrlTaskGroup", {
                        groupName: i,
                        urlTasks: l
                    }) : yield W.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", l)) && d[0]) {
                        let e = d[0];
                        for (let i = 0; i < e.length; i++) {
                            let r = e[i];
                            if (r && r.task) {
                                if (n++, !a && !o) continue;
                                let e = r.task, d = a || o[l[i].url];
                                d && s.push({panId: e.id, user_id: e.user_id, path_id: t.id, path: t.name, taskId: d})
                            }
                        }
                    } else R.information("cloud IpcBatchAddUrlsToDrive err", d[2]);
                    s.length > 0 && B.batchRelateYunTask(s), n > 0 && (yield de(n, !(!a && !o)))
                }
            })
        }

        function he(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                if (yield ue(t)) {
                    let n = yield W.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", [{
                        from: a,
                        searchFrom: e.searchFrom,
                        url: e.url,
                        name: e.name,
                        path: t.name,
                        parentId: t.id,
                        files: e.files
                    }]);
                    if (n && n[0]) {
                        let e = n[0][0];
                        if (e) {
                            let n = e.task;
                            n && i && B.batchRelateYunTask([{
                                panId: n.id,
                                user_id: n.user_id,
                                path_id: t.id,
                                path: t.name,
                                taskId: i
                            }]), n && (yield de(1, !!i))
                        }
                    }
                }
            })
        }

        e.selectTask = t, e.repeatTasksMsg = i, e.createNewTaskWindow = $, e.createPreNewTaskWindow = Y, e.createBtTaskWindow = q, e.uninit = function () {
        }, e.saveLastestDownloadPath = J, e.createP2spEmuleTasksDirectly = ee, e.createTaskByUrl = function (e, t) {
            do {
                if (void 0 === e || null === e || "" === e) break;
                let i = "";
                i = (t = t || {}).fileName ? t.fileName : g.ParseUrlFileNameNS.getNameFromUrl(e);
                let n = A.ThunderHelper.getTaskTypeFromUrl(e);
                n === d.DownloadKernel.TaskType.Emule || n === d.DownloadKernel.TaskType.P2sp ? te([Object.assign({}, t, {
                    url: e,
                    fileName: i,
                    nameFixedFlag: t.fileName ? x.ThunderNewtaskHelperNS.taskOptFileNameFixed : 0
                })]).catch() : n === d.DownloadKernel.TaskType.Bt && q({
                    url: e,
                    type: "url"
                }, {browser: t.browser || "xlbrowser.exe", searchFrom: t.searchFrom})
            } while (0)
        }, e.createUnionTask = function (e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = decodeURIComponent(e);
                    R.information("createUnionTask:urlPath = ", t, e);
                    let i = yield k.FileSystemAWNS.readFileAW(t);
                    if (yield k.FileSystemAWNS.unlinkAW(t), null === i || void 0 === i || "" === i.toString()) {
                        R.information("createUnionTask:读取内容 buf为null");
                        break
                    }
                    let n = i.toString(), a = (n += "\r\n").split("\r\n");
                    if (a.length <= 1) {
                        R.information("createUnionTask:lines.length <= 1");
                        break
                    }
                    let r = !1, s = "", l = [], u = [], c = "", h = "", g = "", p = "", v = "", m = "",
                        w = y.ConfigNS.getValue("TaskDefaultSettings", "OrignHostThreads", "5"), C = new Map,
                        S = new Map, I = new Map, b = new Map, _ = new Map, D = null;
                    for (let e = 0; e < a.length; ++e) {
                        let t = a[e].split("=");
                        if (null !== t && 2 === t.length) {
                            let e = t[0].toLowerCase(), i = t[1];
                            if (null !== e && "" !== e) {
                                if (i = i.replace(/\+/g, "%20"), i = decodeURIComponent(i), "json" === e) {
                                    r = !0, s = i;
                                    break
                                }
                                if ("taskgroupname" === e) c = i; else if ("downloaddir" === e) h = i; else if ("installfile" === e) g = i; else if ("excludepath" === e) p = i; else if ("runparams" === e) v = i; else if (0 === e.indexOf("createshortcut")) {
                                    let t = e.match(/createshortcut\[(.+)\]/);
                                    if (t && t[1].length > 0) switch (D || (D = {}), t[1]) {
                                        case"name":
                                            D.name = i;
                                            break;
                                        case"targetfile":
                                            D.targetFile = i;
                                            break;
                                        case"runparams":
                                            D.runParams = i
                                    }
                                } else if ("useragent" === e) m = i; else if ("threadcount" === e) w = i; else {
                                    R.information("createUnionTask:", e, i);
                                    let t = e.match(/^tasks\[\d+\]/), n = "";
                                    null !== t && void 0 !== t && (n = t[0]);
                                    let a = /url/;
                                    a.test(e) ? "" !== n ? C.set(n, i) : l.push(i) : (a = /referer/).test(e) ? "" !== n ? S.set(n, i) : u.push(i) : (a = /^tasks\[\d+\]\[name\]/).test(e) ? "" !== n && I.set(n, i) : (a = /^tasks\[\d+\]\[size\]/).test(e) ? "" !== n && b.set(n, i) : (a = /^tasks\[\d+\]\[dir\]/).test(e) && "" !== n && _.set(n, i)
                                }
                            }
                        }
                    }
                    if (r) {
                        R.information("createUnionTask 通过读取配置信息得到数据 jsonUrlStr:", s);
                        let e = {minVersion: "", json: s};
                        yield le(JSON.stringify(e))
                    } else {
                        let e = [], t = [], i = "", n = "";
                        if (null !== C && C.size > 0 && C.forEach((a, o) => {
                            let r = a, s = A.ThunderHelper.getTaskTypeFromUrl(r), l = "", u = 0, c = S.get(o) || "";
                            if (null !== I && I.size > 0 && (l = I.get(o)), null !== g && void 0 !== g && "" !== g && "" === i) {
                                let e = oe(r, g, l);
                                "" !== e && (i = e)
                            }
                            if (D && "" !== D.targetFile && "" === n) {
                                let e = oe(r, D.targetFile, l);
                                "" !== e && (n = e)
                            }
                            if (null !== b && b.size > 0) {
                                let e = b.get(o);
                                null !== e && "" !== e && (u = Number(e))
                            }
                            let h = "", f = _.get(o);
                            null !== f && void 0 !== f && "" !== f ? h = ae(f) : null !== p && void 0 !== p && "" !== p && (h = ie(r, p));
                            let v = r;
                            if (T.Common.isThunderPrivateUrl(r) && (v = T.Common.parseThunderPrivateUrl(r)), void 0 !== v && null !== v && "" !== v) {
                                let i = {
                                    url: r,
                                    referer: c,
                                    fileName: l,
                                    fileSize: u,
                                    subDir: h,
                                    statClick: "ThunderUnion",
                                    nameFixedFlag: x.ThunderNewtaskHelperNS.taskOptFileNameFixed
                                };
                                s === d.DownloadKernel.TaskType.P2sp || s === d.DownloadKernel.TaskType.Emule ? e.push(i) : s !== d.DownloadKernel.TaskType.Magnet && s !== d.DownloadKernel.TaskType.Bt || t.push(i)
                            }
                        }), e.length >= 1) {
                            let t = {};
                            if (null !== h && "" !== h) {
                                let e = f.ThunderUtil.getMaxFreeDriver();
                                null !== e && "" !== e && (e += ":"), h = o.join(e, h), t.isNotSavePath = !0, t.notSavePath = h
                            }
                            if (w) {
                                let e = Number(w);
                                e <= 0 ? e = 1 : e >= 10 && (e = 10), t.threadCount = e
                            }
                            if (null !== m && void 0 !== m && "" !== m && (t.userAgent = m), null !== p && void 0 !== p && "" !== p && (t.excludePath = p), null !== c && void 0 !== c && "" !== c) {
                                if (null !== g && void 0 !== g && "" !== g && null !== i && void 0 !== i && "" !== i && re(i)) {
                                    let e = g.replace(/[*?:|<>"]/g, "_");
                                    t.installFile = e, t.runParams = v
                                }
                                D && D.name && D.targetFile && re(n) && (t.createShortcut = D)
                            }
                            R.information("createUnionTask：新协议拉起新建面板", t);
                            let a = yield ne(e[0].referer);
                            a && e.forEach(e => {
                                e.searchFrom = a
                            }), Y(e, "ThunderUnion", h, c, t)
                        }
                        if (t.length > 0) {
                            let e = yield ne(t[0].referer);
                            for (let i of t) q({url: i.url, type: "url"}, {
                                source: i.statClick,
                                referer: i.referer,
                                searchFrom: e
                            })
                        }
                        if (l.length >= 1) {
                            R.information("createUnionTask：旧协议拉起新建面板");
                            let e = yield ne(u[0]), t = [];
                            for (let i = 0; i < l.length; ++i) t.push({
                                url: l[i],
                                referer: u[i] || "",
                                searchFrom: e,
                                thread: Number(w)
                            });
                            Y(t, "ThunderUnion")
                        }
                    }
                } while (0)
            })
        }, e.sendMessageBox = se, e.createThunderxTask = le, e.addUrls2Cloud = ce, e.addBt2Cloud = he, e.init = function () {
            return n(this, void 0, void 0, function* () {
                R.information("xxxxx init=====");
                let e = yield V.asyncRemoteCall.getIpcMain();
                e.on(l.ThunderChannelList.channelRMNewTaskCreateNewTask, (e, t, a, r, s, u, f, g, p, v, m) => n(this, void 0, void 0, function* () {
                    let n = null;
                    try {
                        n = JSON.parse(r)
                    } catch (e) {
                        R.warning(e)
                    }
                    if (null === n) return;
                    let k = [...Object.values(n)];
                    if (R.information("xxx", k, s), s) {
                        let i = yield O.client.callServerFunction("GetUserID");
                        if (S.PrivateSpaceHelperNS.isPrivateSpaceOpen(i)) {
                            let t = yield S.PrivateSpaceHelperNS.openPrivateCategory(i);
                            if (t < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== t) return;
                            let n = yield S.PrivateSpaceHelperNS.accessPrivateCategory(i);
                            if (n < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== n) return
                        } else {
                            s = !1;
                            let e = y.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                            null !== e && void 0 !== e && "" !== e || (e = y.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), t = e, L.showNotify(E.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, P.ToastNotifyItemType.GreenNotify, "您未开通私人空间，请开通后再移动任务？", 3e3)
                        }
                    }
                    e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !0);
                    let T = 0;
                    void 0 !== typeof k && null !== k && k.length > 0 && k.forEach(e => {
                        e.data.fileSize && (T += e.data.fileSize), 0 === e.data.url.indexOf("ftp://") && e.setting.loginFtp && e.setting && e.setting.ftpInfo && e.setting.ftpInfo.userName && e.setting.ftpInfo.password && (e.data.url = U.makeUrl(e.data.url, e.setting.ftpInfo.userName, e.setting.ftpInfo.password))
                    }), yield Q(T, t), null !== g && void 0 !== g && null !== g.isNotSavePath && void 0 !== g.isNotSavePath && !0 === g.isNotSavePath || s || J(t), R.information(g), R.verbose(e);
                    let w = [], C = void 0, _ = {};
                    if (void 0 !== typeof k && null !== k && k.length > 0) {
                        let e = [], n = t;
                        null !== f && void 0 !== f && "" !== f && (n = o.join(t, f));
                        let r = k.map(e => {
                            let t = "";
                            return e.taskType === d.DownloadKernel.TaskType.P2sp ? t = e.data.url : e.taskType === d.DownloadKernel.TaskType.Emule && (t = e.data.fileHash), {
                                taskType: e.taskType,
                                value: t
                            }
                        }), l = yield c.TaskUtilitiesAWNS.batchFindTaskAW(r);
                        for (let t = 0; t < k.length; t++) {
                            let i = k[t], a = n;
                            void 0 !== i.data.subDir && null !== i.data.subDir && "" !== i.data.subDir && (a = o.join(n, i.data.subDir));
                            let r = h.TaskCtrlOperatorNS.constructProductInfo(i.data.browser),
                                u = {taskName: i.data.fileName, savePath: a, productInfo: r, origin: i.data.statClick};
                            i.data.fileSize && i.data.fileSize > 0 && (u.fileSize = i.data.fileSize), i.data.gcid && "" !== i.data.gcid && (u.gcid = i.data.gcid);
                            let c = {taskBaseInfo: u, privateSpace: s};
                            if (c.birdKey = i.data.birdkeyChars ? i.data.birdkeyChars : void 0, c.searchSource = i.data.searchFrom, void 0 !== i.setting && null !== i.setting) {
                                let e = i.setting;
                                void 0 !== e.note && null !== e.note && "" !== e.note && (u.description = e.note), e.openAfterDownload && (u.openOnComplete = 1)
                            }
                            if (i.taskType === d.DownloadKernel.TaskType.P2sp) {
                                if (c.taskType = d.DownloadKernel.TaskType.P2sp, c.p2spTaskInfo = {
                                    url: i.data.url,
                                    refUrl: i.data.referer,
                                    cookie: i.data.cookie,
                                    downloadSubTask: 1,
                                    nameFixed: i.data.nameFixedFlag & x.ThunderNewtaskHelperNS.taskOptFileNameFixed ? 1 : 0
                                }, void 0 !== i.setting && null !== i.setting) {
                                    let e = i.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() === d.DownloadKernel.TaskType.P2sp && e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl).toLowerCase() === i.data.url.toLowerCase()) {
                                    t = !0;
                                    break
                                }
                                if (t) {
                                    e.push({taskType: d.DownloadKernel.TaskType.P2sp, newTaskInfo: c});
                                    continue
                                }
                                w.push(c)
                            } else if (i.taskType === d.DownloadKernel.TaskType.Emule) {
                                c.taskType = d.DownloadKernel.TaskType.Emule, c.emuleTaskInfo = {
                                    url: i.data.url,
                                    downloadSubTask: 1
                                };
                                let t = !1;
                                if (l && l.length > 0) for (let e of l) if (e.getType() === d.DownloadKernel.TaskType.Emule && e.getExtraObject().getFileHash().toLowerCase() === i.data.fileHash.toLowerCase()) {
                                    t = !0;
                                    break
                                }
                                if (t) {
                                    e.push({taskType: d.DownloadKernel.TaskType.Emule, newTaskInfo: c});
                                    continue
                                }
                                w.push(c)
                            }
                        }
                        if (null !== f && void 0 !== f && "" !== f && w.length > 0) {
                            let e = {taskName: f, savePath: n, origin: w[0].taskBaseInfo.origin}, i = {subTaskList: w},
                                o = yield B.createTask(d.DownloadKernel.TaskType.Group, {
                                    taskType: d.DownloadKernel.TaskType.Group,
                                    taskBaseInfo: e,
                                    groupTaskInfo: i,
                                    privateSpace: s,
                                    searchSource: w[0].searchSource
                                });
                            if (null !== o) {
                                let e = o.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                C = e, 1 === a && (yield b.DownloadDispatchNS.startTask(e));
                                let i = o.getExtraObject();
                                null !== g && void 0 !== g && (R.information("setUserData:", g), null !== g.installFile && void 0 !== g.installFile && "" !== g.installFile && i.setUserData(I.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile", g.installFile), g.excludePath && "" !== g.excludePath && i.setUserData(I.TaskUserDataGUID.guidDownloadGroupTask, "excludePath", g.excludePath), null !== g.isSelectInstallCheck && void 0 !== g.isSelectInstallCheck && g.isSelectInstallCheck && i.setUserData(I.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall", "1"), null !== g.runParams && void 0 !== g.runParams && "" !== g.runParams && i.setUserData(I.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams", g.runParams), g.createShortcut && i.setUserData(I.TaskUserDataGUID.guidCreateShortcut, "createShortcut", JSON.stringify(g.createShortcut))), i.setUserData(I.TaskUserDataGUID.guidDownloadGroupTask, "canRepost", "true"), g && g.notSavePath === t && i.setUserData(I.TaskUserDataGUID.guidNotSavePath, "notSavePath", g.notSavePath)
                            }
                        } else if (w.length > 0) {
                            let e = yield B.createBatchTask(w), t = [];
                            for (let i of e) t.push(i.getId()), _[i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)] = i.getId();
                            1 === a && (R.information("download-dispatch createBatchTask", t), yield b.DownloadDispatchNS.startTasks(t))
                        }
                        l.length > 0 && i(l, e)
                    }
                    if (u && u.length > 0) for (let e of u) q({
                        url: e.url,
                        type: "url",
                        birdkeyChars: e.birdkeyChars
                    }, {source: e.statClick || "newwindow_url", referer: e.referer});
                    if (p && p.length > 0) for (let e of p) setTimeout(() => {
                        le(e.url, "newwindow_url", !1).catch()
                    }, 50);
                    v && (yield ce(k, v, f, C, C ? void 0 : _, m))
                })), e.on(l.ThunderChannelList.channelRMNewTaskDownloadTorrent, (e, t, i) => n(this, void 0, void 0, function* () {
                    let a = (t, i, a) => n(this, void 0, void 0, function* () {
                            do {
                                if (!e.sender) break;
                                let n = B.getTaskFromTaskId(t);
                                if (yield e.sender.isDestroyed()) {
                                    R.information("download torrent back isDestroyed");
                                    break
                                }
                                if (i) {
                                    if (!n) {
                                        e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1), R.information("channelRMNewTaskDownloadTorrent error");
                                        break
                                    }
                                    let t = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                                        i = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), a = o.join(t, i),
                                        r = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(a);
                                    if (!e.sender || (yield e.sender.isDestroyed())) {
                                        R.information("parserBtFileInfoAW back isDestroyed");
                                        break
                                    }
                                    if (null === r) {
                                        let t = {errinfo: "磁力链接解析失败"};
                                        e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1, JSON.stringify(t));
                                        break
                                    }
                                    let s = JSON.stringify(r);
                                    e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !0, s, a)
                                } else {
                                    let t = void 0;
                                    705 === a && (t = {
                                        errinfo: "包含违规内容 无法下载",
                                        disable: !0
                                    }), e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1, t ? JSON.stringify(t) : t)
                                }
                            } while (0)
                        }), r = {taskType: d.DownloadKernel.TaskType.Magnet, value: t},
                        s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([r]);
                    if (s && s.length > 0) {
                        R.information("channelRMNewTaskDownloadTorrent repeat magnet task.url:", t);
                        let i = s[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                        e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, i), _.MagnetListenerNS.addRef(i, a)
                    } else {
                        let n = yield f.ThunderUtil.getThunderTempPath(!0),
                            r = g.ParseUrlFileNameNS.parseMagnetUrl(t) + ".torrent", s = o.join(n, r), c = {
                                taskBaseInfo: {
                                    taskName: r,
                                    savePath: n,
                                    productInfo: h.TaskCtrlOperatorNS.constructProductInfo(i.browser),
                                    origin: i.source
                                }, magnetTaskInfo: {url: t, torrentFilePath: s}, isBackground: !0
                            };
                        const p = u.DownloadKernelTaskManager.getTaskManager();
                        R.information("create task magnet productinfo", i);
                        let v = yield p.createTask(d.DownloadKernel.TaskType.Magnet, c);
                        if (null !== v) {
                            let t = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                            e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, t), _.MagnetListenerNS.addRef(t, a), yield b.DownloadDispatchNS.startTask(t, !0)
                        }
                    }
                })), e.on(l.ThunderChannelList.channelRMNewTaskCancleMagnet, (e, t) => {
                    _.MagnetListenerNS.release(t)
                }), e.on(l.ThunderChannelList.channelRMNewTaskCreateBtTask, (e, t, a, r, s, u, f, g, v, m, k, T, w) => n(this, void 0, void 0, function* () {
                    R.verbose(e);
                    let C = !1, I = void 0, _ = f.map(e => String(e)), D = void 0, A = void 0;
                    do {
                        if (void 0 === r || null === r) {
                            e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1, "开启私人空间后才能创建任务至私人空间");
                            break
                        }
                        let T = null;
                        try {
                            T = JSON.parse(r)
                        } catch (e) {
                            R.warning(e)
                        }
                        if (null === T) break;
                        if (g) {
                            let i = yield O.client.callServerFunction("GetUserID");
                            if (S.PrivateSpaceHelperNS.isPrivateSpaceOpen(i)) {
                                let t = yield S.PrivateSpaceHelperNS.openPrivateCategory(i);
                                if (t < 0 && e.sender && !(yield e.sender.isDestroyed()) && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== t) break;
                                let n = yield S.PrivateSpaceHelperNS.accessPrivateCategory(i);
                                if (n < 0 && e.sender && !(yield e.sender.isDestroyed()) && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== n) break
                            } else {
                                g = !1;
                                let e = y.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                                null !== e && void 0 !== e && "" !== e || (e = y.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), t = e, L.showNotify(E.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, P.ToastNotifyItemType.GreenNotify, "您未开通私人空间，请开通后再移动任务？", 3e3)
                            }
                        }
                        if (e.sender && !(yield e.sender.isDestroyed()) && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !0), g || J(t), void 0 !== typeof t && null !== t || (t = yield O.client.callServerFunction("GetDownloadDir")), void 0 === typeof T || null === T) break;
                        if (T = Object.assign({}, T), I = m || `magnet:?xt=urn:btih:${T.infoId}`, void 0 === typeof s || null === s) break;
                        C = !0, A = T.title;
                        let w = 0, _ = {};
                        f.forEach(e => {
                            _[e] = !0
                        });
                        let N = 0, x = 0;
                        for (let e of T.fileLists) {
                            if (N === T.fileLists.length) break;
                            _[e.realIndex] && (N++, e.fileSize && (x += e.fileSize, w += e.fileSize))
                        }
                        yield Q(w, t);
                        let M = yield h.TaskCtrlOperatorNS.getBtExistFilePathList(t, T, f),
                            F = {taskType: d.DownloadKernel.TaskType.Bt, value: T.infoId},
                            U = yield c.TaskUtilitiesAWNS.batchFindTaskAW([F]), V = T.trackerUrls.join("\n"),
                            W = h.TaskCtrlOperatorNS.constructProductInfo(v.browser),
                            G = {savePath: t, taskName: T.title, productInfo: W, origin: v.source}, H = {
                                originUrl: m,
                                refUrl: v.referer,
                                seedFile: s,
                                displayName: u,
                                fileLists: T.fileLists,
                                infoId: T.infoId,
                                fileRealIndexLists: f,
                                tracker: V
                            }, z = {
                                taskType: d.DownloadKernel.TaskType.Bt,
                                newTaskInfo: {
                                    taskType: d.DownloadKernel.TaskType.Bt,
                                    taskBaseInfo: G,
                                    btTaskInfo: H,
                                    privateSpace: g
                                }
                            };
                        if (z.newTaskInfo.birdKey = k || void 0, z.newTaskInfo.searchSource = v.searchFrom ? v.searchFrom : void 0, 0 !== M.length) {
                            if (U && U.length > 0) {
                                p.MessageBox.custom("bt-repeat-task", {}, {
                                    width: 450,
                                    height: 240
                                }).then(e => n(this, void 0, void 0, function* () {
                                    if (e.action === K.MessageBoxNS.Action.OK) {
                                        let i = e.args.picked,
                                            n = U[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                        "continue" === i ? yield b.DownloadDispatchNS.startTask(n) : X(t, a, T, s, u, f, v, i, M, n, g).catch()
                                    }
                                })).catch();
                                break
                            }
                            {
                                let e = o.join(t, T.title), i = M.map(e => e.relativePath), n = JSON.stringify(i);
                                p.MessageBox.custom("bt-repeat-file", {saveDir: e, file: n}, {
                                    width: 450,
                                    height: 344
                                }).then(e => {
                                    if (e.action === K.MessageBoxNS.Action.OK) {
                                        let i = e.args.picked;
                                        X(t, a, T, s, u, f, v, i, M, void 0, g, m).catch()
                                    }
                                }).catch();
                                break
                            }
                        }
                        if (U && U.length > 0) {
                            i(U, [z]);
                            break
                        }
                        let j = yield B.createTask(z.taskType, z.newTaskInfo);
                        null !== j ? (D = j.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId), 1 === a && (yield b.DownloadDispatchNS.startTask(D))) : R.warning("create bt task null")
                    } while (0);
                    C && T && (yield he({files: _, url: I, name: A, searchFrom: v.searchFrom}, T, D, w))
                })), e.on(l.ThunderChannelList.channelRMImportTorrent, (e, t) => n(this, void 0, void 0, function* () {
                    R.verbose(e);
                    let i = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                    q(null === i ? {type: "file", seedFile: t} : {
                        data: JSON.stringify(i),
                        type: "file",
                        seedFile: t
                    }, {source: "newwindow_bt"})
                }))
            })
        }
    }(t.ThunderNewTask || (t.ThunderNewTask = {}))
}, function (e, t, i) {
    "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", e[e.Unknow = 3] = "Unknow"
        }(t = e.Action || (e.Action = {}))
    }(t.MessageBoxNS || (t.MessageBoxNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(3);
    let o = ["apk", "pic", "video", "mp4", "rmvb", "wmv", "mpg", "mkv", "mov", "rm", "avi", "flv", "doc", "link", "ppt", "word", "magnetic", "music", "pdf", "rar", "xls", "txt", "unknow", "gif", "ipa", "ipsw", "dll", "chm", "text", "install", "iso"];
    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;.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;",
        d = ".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;",
        u = ".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 = ".idx;.smi;.sub;.psb;.ssa;.ass;.usf;.ssf;.srt;.sup",
        g = ".3gp;.asf;.avi;.divx;.f4v;.flv;.mkv;.mov;.movie;.mp4;.mpeg;.mpeg4;.mpg;.mpg2;.rm;.rmvb;.rp;.swf;.tp;.tp0;.ts;.wmv",
        p = ".exe;.com;.bat;.msi", v = ".wav;.flac;.mp3;.aac;.wma;.m4a;.mid;.ape;.ogg;.ra;.mod",
        m = ".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",
        y = ".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",
        k = ".rar;.tar;.zip;.gzip;.cab;.uue;.arj;.bz2;.lzh;.jar;.ace;.iso;.7-zip;.7z",
        T = ".asf;.mpg;.rmvb;.rm;.wmv;.avi;.mp4;.mpeg;.mkv;.mov;.ts;.flv;.3gp;.m2ts;",
        w = ".exe;.com;.bat;.scr;.lnk;.pif;.wsh;", C = ".iso;";
    !function (e) {
        let t;

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

        e.getTaskIcon = function (e, t, i) {
            i = i || "xly-type-";
            let g = "";
            do {
                if (t === a.DownloadKernel.TaskType.Bt) {
                    g = "bt-file";
                    break
                }
                if (t === a.DownloadKernel.TaskType.Group) {
                    g = "group";
                    break
                }
                g = "unknown";
                let i = n.extname(e);
                if ("" === i || i.length < 2) break;
                let p = (i = i.toLowerCase()).substring(1);
                if (o.indexOf(p) > -1) {
                    g = "doc" === i ? "word" : p;
                    break
                }
                if (i += ";", r.indexOf(i) > -1) {
                    g = "video";
                    break
                }
                if (s.indexOf(i) > -1) {
                    g = "install", [".mds", ".bin", ".img"].indexOf(i) > -1 && (g = "iso");
                    break
                }
                if (l.indexOf(i) > -1) {
                    if (g = "doc", [".htm", ".html", ".mht"].indexOf(i) > -1) {
                        g = "link";
                        break
                    }
                    if ("docx" === i) {
                        g = "word";
                        break
                    }
                    if ("xlsx" === i) {
                        g = "xls";
                        break
                    }
                    if ("pptx" === i) {
                        g = "ppt";
                        break
                    }
                    break
                }
                if (d.indexOf(i) > -1) {
                    g = "music";
                    break
                }
                if (u.indexOf(i) > -1) {
                    g = "pic";
                    break
                }
                if (c.indexOf(i) > -1) {
                    g = "rar";
                    break
                }
                if (h.indexOf(i) > -1) {
                    g = "bt-link";
                    break
                }
                if (f.indexOf(i) > -1) {
                    g = "text";
                    break
                }
            } while (0);
            return `${i}${g}`
        }, 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, i) {
            let a = t.Unkown;
            return void 0 === i && void 0 !== e && (i = n.extname(e)), null !== i && void 0 !== i && i.length >= 2 && (i = i.toLowerCase(), i += ";"), void 0 === i || "" === i || i.length < 3 ? a = t.Unkown : r.indexOf(i) > -1 ? a = t.Video : s.indexOf(i) > -1 ? a = t.Software : l.indexOf(i) > -1 ? a = t.Doc : d.indexOf(i) > -1 ? a = t.Music : u.indexOf(i) > -1 ? a = t.Pic : c.indexOf(i) > -1 ? a = t.Zip : h.indexOf(i) > -1 && (a = t.Bt), i.length > 1 && ".z" === i.slice(0, 2) && /[0-9]+/.test(i.substring(2)) && (a = t.Zip), a
        }, e.isVideoFileExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", T.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.isSubtitleExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", f.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.isExecutableExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", w.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.isIsoExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", C.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.getGroupFileType = i, e.getDefaultGroupPrefix = function (e) {
            let n = "任务组";
            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 = i(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 ? n = "视频任务组" : o === t.Software ? n = "程序任务组" : o === t.Music ? n = "音乐任务组" : o === t.Pic ? n = "图片任务组" : o === t.Doc ? n = "文档任务组" : o === t.Zip && (n = "压缩包任务组")
            } while (0);
            return n
        }, e.compareVersion = function (e, t) {
            let i = -2;
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let n = 0, a = 0, o = 0, r = 0, s = 0, l = 0, d = 0, u = 0, c = e.split(/\./);
                if (null === c || void 0 === c || c.length < 3) break;
                if (n = 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]), d = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (u = Number(c[3])), s > n) {
                    i = 1;
                    break
                }
                if (s < n) {
                    i = -1;
                    break
                }
                if (l > a) {
                    i = 1;
                    break
                }
                if (l < a) {
                    i = -1;
                    break
                }
                if (d > o) {
                    i = 1;
                    break
                }
                if (d < o) {
                    i = -1;
                    break
                }
                if (0 !== r) {
                    if (u > r) {
                        i = 1;
                        break
                    }
                    if (u < r) {
                        i = -1;
                        break
                    }
                }
                i = 0
            } while (0);
            return i
        }
    }(t.TaskUtilHelper || (t.TaskUtilHelper = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(331);
    !function (e) {
        const t = new class {
            constructor() {
                this.categoryViews = [];
                let e = new a.CategoryView(-1, n.DownloadKernel.CategroyViewID.Downloading),
                    t = new a.CategoryView(-1, n.DownloadKernel.CategroyViewID.Completed),
                    i = new a.CategoryView(-1, n.DownloadKernel.CategroyViewID.Recycle);
                this.categoryViews.push(e), this.categoryViews.push(t), this.categoryViews.push(i)
            }

            getCategoryViews() {
                return this.categoryViews
            }

            getCategoryViewCount() {
                return this.categoryViews.length
            }

            getCategoryViewFromId(e) {
                let t = null;
                for (let i = 0; i < this.categoryViews.length; ++i) {
                    let n = this.categoryViews[i];
                    if (n && e === n.getCategoryViewId()) {
                        t = n;
                        break
                    }
                }
                return t
            }
        };
        e.getCategoryViewManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryViewManager || (t.DownloadKernelCategoryViewManager = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(7), s = i(6), l = i(3), d = i(12), u = i(22), c = i(38), h = i(10), f = i(4),
        g = i(29), p = i(44), v = i(47), m = i(39), y = i(122), k = i(30), T = i(26), w = i(5),
        C = o.default.getLogger("Thunder.TaskOperator"), S = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        I = d.DownloadKernelTaskManager.getTaskManager(), b = T.DownloadKernelCategoryManager.getCategoryManager();
    !function (e) {
        function t(e) {
            let t = S.getInstallChannel();
            e = void 0 === e ? "" : e;
            let i = a.join(__rootDir, "../../Thunder.exe");
            return `xl_thunder_pc|${S.getFileVersion(i)}|${t}|${e}`
        }

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

        function o(e) {
            return n(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 o = I.getTaskFromTaskId(e.taskId);
                    if (yield v.SingleBtTaskNS.isSingleBtTask(o)) {
                        let e = v.SingleBtTaskNS.getSinleBtTaskFilePath(o);
                        t = yield s.FileSystemAWNS.existsAW(e)
                    } else {
                        let n = e.savePath, r = e.taskName;
                        void 0 !== r && r.indexOf(".") === r.length - 1 && (r = r.substring(0, r.length - 1));
                        let d = a.join(n, r), u = e.taskType;
                        if (u === l.DownloadKernel.TaskType.Bt) {
                            if ("" === r) {
                                t = yield s.FileSystemAWNS.existsAW(n);
                                break
                            }
                            if (t = yield s.FileSystemAWNS.existsAW(d)) break;
                            {
                                let e = yield v.SingleBtTaskNS.getCorrectSingleBtFolder(o);
                                if (e) {
                                    let i = a.join(n, e);
                                    t = yield s.FileSystemAWNS.dirExistsAW(i)
                                }
                            }
                        } else u === l.DownloadKernel.TaskType.Group ? (t = yield s.FileSystemAWNS.existsAW(n)) && (t = yield i(e)) : t = yield s.FileSystemAWNS.existsAW(d)
                    }
                } while (0);
                return t
            })
        }

        e.getUserLoginInfo = function () {
            return n(this, void 0, void 0, function* () {
                let e = "";
                do {
                    if (!(yield w.client.callServerFunction("IsLogined"))) break;
                    let t = yield w.client.callServerFunction("GetSessionID"),
                        i = yield w.client.callServerFunction("GetUserID");
                    if (!t) break;
                    e = "/ssessionid " + t + " /suserid " + i
                } while (0);
                return e
            })
        }, e.redownloadTask = function (e, i, a) {
            return n(this, void 0, void 0, function* () {
                if (void 0 === i) if (1 === e.length) {
                    let t = e[0].taskStatus;
                    i = t === l.DownloadKernel.TaskStatus.Succeeded || t === l.DownloadKernel.TaskStatus.Seeding ? yield o(e[0]) : t !== l.DownloadKernel.TaskStatus.Failed
                } else i = !0;
                let r = g.default.getCurrentCategoryId(), s = "mypc";
                if (-1 !== r) if (b.isPrivateCategory(r)) s = "private"; else {
                    let e = b.getCategoryFromId(r);
                    e && (s = e.getName())
                }
                if (i) {
                    let i = !1, o = !1;
                    if (1 === e.length && e[0].taskType === l.DownloadKernel.TaskType.P2sp) {
                        i = !0;
                        let t = I.getTaskFromTaskId(e[0].taskId);
                        t && (o = t.getOriginOnlyStrategy())
                    }
                    u.MessageBox.confirm({
                        title: "重新下载会删除本地的文件，确定要重新下载吗？",
                        type: u.MessageBox.ConfirmType.Info,
                        checkboxEnabled: i,
                        checkboxChecked: o,
                        checkboxLabel: "从原始地址重新下载"
                    }).then(o => n(this, void 0, void 0, function* () {
                        if (o.action === c.MessageBoxNS.Action.OK) {
                            if (void 0 !== a) {
                                let e = "";
                                e = void 0 !== o.checkboxChecked && o.checkboxChecked ? `panel_type=${s},button=origin` : `panel_type=${s},button=reload`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                            }
                            for (let n of e) {
                                let e = {
                                    taskBaseInfo: {
                                        savePath: void 0,
                                        taskName: void 0,
                                        productInfo: t(""),
                                        origin: "re_download"
                                    },
                                    p2spTaskInfo: {
                                        url: void 0,
                                        useOriginResourceOnly: i ? o.checkboxChecked ? 1 : 0 : void 0
                                    }
                                };
                                (yield w.client.callServerFunction("GetXmpPlayTaskId")) === n.taskId && (yield w.client.callServerFunction("SetXmpStop"));
                                let a = yield I.reDownloadTask(n.taskId, e);
                                if (null !== a) {
                                    let e = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                                    yield p.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else if (void 0 !== a) {
                            let e = "";
                            e = o.action === c.MessageBoxNS.Action.Cancel ? `panel_type=${s},button=cancel` : `panel_type=${s},button=close`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                        }
                    })).catch()
                } else for (let i of e) {
                    if (void 0 !== a) {
                        let e = `panel_type=${s}`;
                        h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                    }
                    let e = {
                        taskBaseInfo: {
                            savePath: void 0,
                            taskName: void 0,
                            productInfo: t(""),
                            origin: "re_download"
                        }, p2spTaskInfo: {url: void 0, useOriginResourceOnly: void 0}
                    }, n = yield I.reDownloadTask(i.taskId, e);
                    if (null !== n) {
                        let e = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        yield p.DownloadDispatchNS.startTask(e)
                    }
                }
            })
        }, e.constructProductInfo = t, e.isExistTaskFile = i, e.canOpenSelectedTaskFolder = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = e.taskStatus;
                    if (i === l.DownloadKernel.TaskStatus.StartPending || i === l.DownloadKernel.TaskStatus.StopPending || i === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let n = I.getTaskFromTaskId(e.taskId);
                    if (yield v.SingleBtTaskNS.isSingleBtTask(n)) t = yield s.FileSystemAWNS.existsAW(e.savePath); else {
                        let i = e.savePath, o = e.taskName, r = e.taskType, d = a.join(i, o);
                        if (r === l.DownloadKernel.TaskType.Bt) {
                            if ("" === o) {
                                t = yield s.FileSystemAWNS.existsAW(i);
                                break
                            }
                            if (t = yield s.FileSystemAWNS.existsAW(d)) break;
                            {
                                let e = yield v.SingleBtTaskNS.getCorrectSingleBtFolder(n);
                                if (e) {
                                    let n = a.join(i, e);
                                    t = yield s.FileSystemAWNS.dirExistsAW(n)
                                }
                            }
                        } else l.DownloadKernel.TaskType.Group, t = yield s.FileSystemAWNS.existsAW(i)
                    }
                } while (0);
                return t
            })
        }, e.canOpenSelectedTaskFile = o, e.canOpenAsSelectedTaskFile = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = e.taskStatus;
                    if (i === l.DownloadKernel.TaskStatus.StartPending || i === l.DownloadKernel.TaskStatus.StopPending || i === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let n = I.getTaskFromTaskId(e.taskId), o = e.taskType;
                    if (o === l.DownloadKernel.TaskType.Bt) if (yield v.SingleBtTaskNS.isSingleBtTask(n)) {
                        let e = v.SingleBtTaskNS.getSinleBtTaskFilePath(n);
                        m.TaskUtilHelper.isExecutableExt(e) || (t = yield s.FileSystemAWNS.existsAW(e))
                    } else {
                        let i = yield v.SingleBtTaskNS.getCorrectSingleBtFolder(n);
                        if (i) {
                            let n = e.savePath, o = a.join(n, i);
                            t = yield s.FileSystemAWNS.dirExistsAW(o)
                        }
                    } else if (o !== l.DownloadKernel.TaskType.Group) {
                        let i = e.savePath, n = e.taskName;
                        void 0 !== n && n.indexOf(".") === n.length - 1 && (n = n.substring(0, n.length - 1));
                        let o = a.join(i, n);
                        if (m.TaskUtilHelper.isExecutableExt(o)) break;
                        t = yield s.FileSystemAWNS.existsAW(o)
                    }
                } while (0);
                return t
            })
        }, e.getBtExistFilePathList = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = [];
                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 !== i.indexOf(t.realIndex)) {
                            let e = a.join(t.filePath, t.fileName), i = a.join(o, e);
                            (yield s.FileSystemAWNS.existsAW(i)) && n.push({
                                fullPath: i,
                                index: t.realIndex,
                                relativePath: e
                            })
                        }
                    }
                } while (0);
                return n
            })
        }, e.getSavePathByFileName = function (e, t) {
            let i = "";
            do {
                if (void 0 === e || null === e) break;
                let n = I.getTaskFromTaskId(e);
                n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Group && (i = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), i = a.join(i, t), C.information("getSavePathByFileName:", i, t))
            } while (0);
            return i
        }, e.shouleiFileTransfer = function (e) {
            return n(this, void 0, void 0, function* () {
                k.ThunderKernel.getSubNetUploader((t, i) => n(this, void 0, void 0, function* () {
                    if (C.information("getSubNetUploader result", t, i), 0 === t) {
                        let t = {
                            singleton: !0,
                            shareLink: yield y.getShouleiFileTransferDlj(e.taskId, i, "pic", "leftlist_rk_phone"),
                            taskBase: e
                        };
                        if (e.taskType === l.DownloadKernel.TaskType.Bt) {
                            let i = [];
                            I.getTaskFromTaskId(e.taskId).getExtraObject().getBtFileList().forEach(e => {
                                i.push({
                                    index: e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex),
                                    fileName: e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName)
                                })
                            }), t.subFileList = i
                        }
                        u.MessageBox.custom("ShouleiFileTransfer", t, {modal: !1}).catch()
                    }
                }))
            })
        }
    }(t.TaskCtrlOperatorNS || (t.TaskCtrlOperatorNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(19);
    t.default = class {
        constructor() {
            this.emitter = null, this.emitter = new n.EventEmitter
        }

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

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

        prependListener(e, t) {
            this.emitter.prependListener(e, t)
        }

        prependOnceListener(e, t) {
            this.emitter.prependOnceListener(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, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(3), o = i(7), r = i(9), s = Math.pow(2, 38),
        l = o.default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return l.isThunderPrivateUrl(e)
        }

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

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

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

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

        e.getXmpPath = function () {
            if (!o) {
                let e = "HKEY_LOCAL_MACHINE", t = "SOFTWARE\\Thunder Network\\Xmp", i = "Path";
                o = l.readRegString(e, t, i)
            }
            return o
        }, e.getLastAssociateExts = function () {
            return r.ConfigNS.getValue("DownloadAndPlay", "AssociateExts", ".asf;.avi;.wm;.wmp;.wmv;.ram;.rm;.rmvb;.rp;.rpm;.rt;.smil;.scm;.dat;.m1v;.m2v;.m2p;.m2ts;.mp2v;.mpe;.mpeg;.mpeg1;.mpeg2;.mpg;.mpv2;.pss;.pva;.tp;.tpr;.ts;.m4b;.m4r;.m4p;.m4v;.mp4;.mpeg4;.3g2;.3gp;.3gp2;.3gpp;.mov;.qt;.flv;.f4v;.swf;.hlv;.ifo;.vob;.amv;.csf;.divx;.evo;.mkv;.mod;.pmp;.vp6;.bik;.mts;.xlmv;.ogm;.ogv;.ogx;.dvd;.srt;.ass;.ssa;.smi;.idx;.sub;.sup;.psb;.usf;.ssf")
        }, e.getStringLength = d, e.cutString = u, e.getMaxFilePath = function (e) {
            let t = "", i = d(e);
            if (i < 260) t = e; else {
                let a = n.dirname(e), o = n.basename(e), r = n.extname(e), s = 260 - (i = d(a) + 2) - r.length - 2;
                s > 0 && (o = u(o, s), o += r, t = n.join(a, o))
            }
            return t
        }
    }(t.Common || (t.Common = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(14), s = i(49), l = i(52), d = i(98), u = i(29), c = i(15), h = i(31), f = i(26),
        g = i(12), p = i(40), v = i(121), m = i(34), y = i(337), k = i(85), T = i(16),
        w = a.default.getLogger("download-dispatch"), C = g.DownloadKernelTaskManager.getTaskManager(),
        S = c.DownloadKernelEventManager.getEventManager(), I = f.DownloadKernelCategoryManager.getCategoryManager(),
        b = l.ToastNotifyManagerNS.getToastNotifyManger(),
        _ = p.DownloadKernelCategoryViewManager.getCategoryViewManager(), D = 50, A = 51200;
    var N;
    !function (e) {
        e[e.resume = 1] = "resume"
    }(N || (N = {}));
    const x = new class {
        constructor() {
            this.maxStartCount = 5, this.tasks = [], this.downloadingTasks = [], this.freeDownloadingTasks = [], this.waitingTasks = [], this.lowSpeedCache = {}, this.isFreeOpened = !1, this.noLimitSize = 30, this.autoAddTimerId = void 0, this.autoTailTimerId = void 0, this.taskDetailCookie = void 0, this.autoAddRate = void 0, this.speedArray = [], this.taskSpeedMap = {}, this.autoAddAvailable = !1
        }

        init() {
            this.attachTaskEvent(), setInterval(() => n(this, void 0, void 0, function* () {
                let e = 0 === C.getStartTaskIDs().length;
                e && (e = !(yield y.CommonNS.callXmp(k.XmpPlayerFunction.isPlaying))), m.ThunderHelper.setScreenSaveActive(e)
            }), 3e4)
        }

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

        setAutoTail(e) {
            w.information("setAutoTail", e), this.autoTailAvailbale = e, e ? (this.taskSpeedMap = {}, this.syncTaskSpeedMap(void 0, this.downloadingTasks), this.trySwitchAutoTail()) : this.stopAutoTail()
        }

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

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

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

        startTask(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !0;
                do {
                    if (this.downloadingTasks.includes(e) || this.freeDownloadingTasks.includes(e)) {
                        w.information("startTask is downloading", e);
                        break
                    }
                    let a = C.getTaskFromTaskId(e);
                    if (null === a) break;
                    if (a.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) {
                        w.information("startTask is background", e), yield C.startTask(e, i);
                        break
                    }
                    let r = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                    if (-1 !== r) {
                        I.isPrivateCategory(r) ? (w.information("startTask is private", e, r), yield C.startTask(e, i)) : yield T.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRetrieveTaskContol", N.resume, [e]);
                        break
                    }
                    let s = a.isFreeFromSchedule();
                    if (s) {
                        w.information("startTask isFreeFromSchedule"), yield this.startNoWaiting(e, !0, i), this.showSmallFileAdvancedNotify();
                        break
                    }
                    if (void 0 === s && this.isFreeOpened && !isNaN(this.noLimitSize) && this.noLimitSize > 0) {
                        let t = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                        if (t <= 1024 * this.noLimitSize * 1024 && t > 0) {
                            a.setFreeFromSchedule(!0), w.information("startTask isFreeFromSchedule"), yield this.startNoWaiting(e, !0, i), this.showSmallFileAdvancedNotify();
                            break
                        }
                        a.setFreeFromSchedule(!1)
                    }
                    if (t) {
                        w.information("startTask force no waiting", e), yield this.startNoWaiting(e, !1, i);
                        break
                    }
                    if (this.downloadingTasks.length < this.maxStartCount) {
                        w.information("startTask no waiting", e), yield this.startNoWaiting(e, !1, i);
                        break
                    }
                    w.information("startTask waiting", e), this.startWaiting(e), n = !1
                } while (0);
                return n
            })
        }

        startTasks(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (null === e || void 0 === e || 0 === e.length) break;
                    0 === this.tasks.length && (w.information("try to start multi task but tasks not inited"), this.initTasksOrderFromConfig());
                    let t = this.getTaskIdsInOrder(e), i = !1, n = [], a = [];
                    for (let e of t) {
                        let t = C.getTaskFromTaskId(e).getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                        void 0 !== t && -1 !== t ? I.isPrivateCategory(t) ? (i = !0, yield C.startTask(e)) : n.push(e) : a.push(e)
                    }
                    if (n.length > 0 && (yield T.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRetrieveTaskContol", N.resume, n)), i || 0 === a.length) break;
                    yield this.batchStartTasks(a)
                } while (0)
            })
        }

        setMaxStartTaskCount(e) {
            return n(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 i = this.tasks[t], n = C.getTaskFromTaskId(i), a = n.getTaskStatus(),
                                r = n.isFreeFromSchedule();
                            a !== o.DownloadKernel.TaskStatus.StartPending && a !== o.DownloadKernel.TaskStatus.Started || r || (e += 1) > this.maxStartCount && (w.information("to stop", i), this.stopAndWaiting(i, o.DownloadKernel.TaskStopReason.MaxDownloadReduce).catch())
                        }
                    } else if (this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount) {
                        w.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 (C.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting && (yield this.startNoWaiting(t), w.information("setMaxStartTaskCount add start task", t, this.waitingTasks.length, this.downloadingTasks.length), 0 === this.waitingTasks.length || this.downloadingTasks.length === this.maxStartCount)) break
                        }
                    }
                }
            })
        }

        getTaskIdsInOrder(e) {
            let t = [];
            do {
                if (!e || 0 === e.length) break;
                let i = [];
                for (let t of e) {
                    let e = this.tasks.indexOf(t);
                    -1 !== e && i.push(e)
                }
                if (i.length !== e.length) {
                    t = [...e];
                    break
                }
                i.sort((e, t) => e - t);
                for (let e of i) {
                    let i = this.tasks[e];
                    t.push(i)
                }
            } while (0);
            return t
        }

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

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

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

        startNoWaiting(e, t = !1, i) {
            return n(this, void 0, void 0, function* () {
                if (yield C.startTask(e, i)) {
                    t ? this.freeDownloadingTasks.includes(e) || this.freeDownloadingTasks.push(e) : this.downloadingTasks.includes(e) || (this.downloadingTasks.push(e), this.syncTaskSpeedMap(void 0, [e]));
                    let i = this.waitingTasks.indexOf(e);
                    -1 !== i && (this.waitingTasks.splice(i, 1), this.switchAutoAddTask(), this.trySwitchAutoTail())
                }
            })
        }

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

        startBatchWaiting(e) {
            for (let t of e) {
                let e = C.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(), this.trySwitchAutoTail());
                    let e = this.downloadingTasks.indexOf(t);
                    -1 !== e && (this.downloadingTasks.splice(e, 1), this.syncTaskSpeedMap([t]))
                }
            }
            C.startWaitingTasks(e)
        }

        convertWaiting2Start() {
            return n(this, void 0, void 0, function* () {
                for (let e = 0; e < this.tasks.length; e++) {
                    let t = this.tasks[e];
                    if (this.waitingTasks.includes(t) && C.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting) {
                        w.information("convertWaiting2Start", t), yield this.startNoWaiting(t);
                        break
                    }
                }
            })
        }

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

        onGlobalDownloadSpeedChanged() {
            do {
                if (void 0 === this.autoAddTimerId) break;
                let e = h.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1);
                this.speedArray.length >= 10 && this.speedArray.shift();
                let t = {speed: e, tickCount: m.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)), w.information("start auto add timer"), this.autoAddTimerId = setInterval(() => n(this, void 0, void 0, function* () {
                    do {
                        if (this.downloadingTasks.length + this.freeDownloadingTasks.length >= D) {
                            w.information("auto add task upper limit");
                            break
                        }
                        if (0 === this.waitingTasks.length) break;
                        this.isAutoAddTask() && (yield this.convertWaiting2Start())
                    } while (0)
                }), 3e4))
            } while (0)
        }

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

        isAutoAddTask() {
            let e = !1, t = this.getAverageSpeed(this.speedArray);
            return t < 1024 * this.autoAddRate && (e = !0), w.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) : (w.information("no waiting task to stopAutoAdd"), this.stopAutoAddTask())
            } while (0)
        }

        isLowSpeed(e, t) {
            let i = !1;
            do {
                if (0 === this.waitingTasks.length) {
                    w.information("isLowSpeed task no waiting now");
                    break
                }
                if (!t) break;
                if (0 === t.length) break;
                if (this.lowSpeedCache.hasOwnProperty(String(e))) {
                    w.information("task already move to tail once");
                    break
                }
                let n = C.getTaskFromTaskId(e);
                if (!n) break;
                let a = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize),
                    r = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.DownloadSize);
                if (a > 0 && 100 * r / a >= 99.9) {
                    w.information("isLowSpeed percent more then 99.9");
                    break
                }
                if (m.ThunderHelper.getTickCount() - t[0].tickCount < 1e4) {
                    w.information("isLowSpeed task start less then 10s", t);
                    break
                }
                this.getAverageSpeed(t.slice(1)) < A && (i = !0)
            } while (0);
            return i
        }

        syncTaskSpeedMap(e, t) {
            do {
                if (!this.autoTailAvailbale) break;
                if (e) for (let t of e) this.taskSpeedMap.hasOwnProperty(String(t)) && delete this.taskSpeedMap[t];
                if (t) for (let e of t) {
                    let t = m.ThunderHelper.getTickCount();
                    w.information("init first speed item", t, e), this.taskSpeedMap[e] = [{speed: 0, tickCount: t}]
                }
            } while (0)
        }

        trySwitchAutoTail() {
            w.information("trySwitchAutoTail", this.autoTailAvailbale, this.waitingTasks.length);
            do {
                if (!this.autoTailAvailbale) break;
                if (0 === this.waitingTasks.length) {
                    this.stopAutoTail();
                    break
                }
                if (void 0 !== this.autoTailTimerId) break;
                this.taskDetailCookie = S.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                        if (!e[1]) break;
                        let t = e[1];
                        for (let e of t) {
                            let t = e.getId();
                            if (this.taskSpeedMap.hasOwnProperty(String(t))) {
                                let i = e.getDownloadSpeed();
                                this.taskSpeedMap[t].length >= 11 && this.taskSpeedMap[t].shift(), this.taskSpeedMap[t].push({
                                    speed: i,
                                    tickCount: m.ThunderHelper.getTickCount()
                                })
                            }
                        }
                    } while (0)
                }), w.information("start auto tail timer"), this.autoTailTimerId = setInterval(() => n(this, void 0, void 0, function* () {
                    let e = this.taskSpeedMap,
                        t = this.downloadingTasks.length < this.waitingTasks.length ? this.downloadingTasks.length : this.waitingTasks.length,
                        i = 0, n = this.tasks.slice(0);
                    for (let a = 0; a < n.length; a++) {
                        let o = n[a];
                        if (e.hasOwnProperty(String(o)) && this.isLowSpeed(o, e[o]) && (w.information("isLowSpeed data is", o, e[o]), i++, yield this.convertWaiting2Start(), yield this.moveTask2Tail(Number(o)), this.lowSpeedCache[o] = !0, i === t)) {
                            w.information("isLowSpeed current waitingtask all convert start");
                            break
                        }
                    }
                }), 3e4)
            } while (0)
        }

        stopAutoTail() {
            w.information("stopAutoTail"), void 0 !== this.autoTailTimerId && (clearInterval(this.autoTailTimerId), this.autoTailTimerId = void 0), this.taskDetailCookie && (S.detachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, this.taskDetailCookie), this.taskDetailCookie = void 0)
        }

        stopAndWaiting(e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise((i, n) => {
                    C.stopTaskAW(e, t).then(t => {
                        t ? (w.information("stoptask and startwaiting", e), this.startWaiting(e)) : w.information("stopTaskAW fail", e), i()
                    }).catch()
                })
            })
        }

        moveTask2Tail(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.tasks.indexOf(e) === this.tasks.length - 1) {
                        w.information("moveTask2Tail already at the end"), yield this.stopAndWaiting(e, o.DownloadKernel.TaskStopReason.LowSpeed);
                        break
                    }
                    return new Promise((t, i) => {
                        u.default.fireEvent(r.NodeEventMesssageNS.evetDownloadMove2Tail, e, () => n(this, void 0, void 0, function* () {
                            yield this.stopAndWaiting(e, o.DownloadKernel.TaskStopReason.LowSpeed), t()
                        }))
                    })
                } while (0)
            })
        }

        attachTaskEvent() {
            S.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => n(this, void 0, void 0, function* () {
                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 i = t[e];
                        if (!i) continue;
                        if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        let n = i.getTaskStatus(), a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.GroupTaskId) > 0) continue;
                        if (-1 !== i.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) continue;
                        if (n === o.DownloadKernel.TaskStatus.StartPending || n === o.DownloadKernel.TaskStatus.Started) continue;
                        if ((n === o.DownloadKernel.TaskStatus.StopPending || n === o.DownloadKernel.TaskStatus.Stopped) && d.DownloadJammedNS.isStopPending(a)) {
                            w.information("ignore status change download jammed stop", n);
                            continue
                        }
                        let r = this.downloadingTasks.indexOf(a);
                        if (-1 !== r) this.downloadingTasks.splice(r, 1), this.syncTaskSpeedMap([a]); else {
                            let e = this.freeDownloadingTasks.indexOf(a);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        if (n === o.DownloadKernel.TaskStatus.StartWaiting) continue;
                        let s = this.waitingTasks.indexOf(a);
                        -1 !== s && (this.waitingTasks.splice(s, 1), this.switchAutoAddTask(), this.trySwitchAutoTail()), n !== o.DownloadKernel.TaskStatus.Succeeded && n !== o.DownloadKernel.TaskStatus.Failed && n !== o.DownloadKernel.TaskStatus.StopPending && n !== o.DownloadKernel.TaskStatus.Stopped || this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount && (yield this.convertWaiting2Start())
                    }
                } while (0)
            })), S.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),
                            i = this.downloadingTasks.indexOf(t);
                        if (-1 !== i) this.downloadingTasks.splice(i, 1), this.syncTaskSpeedMap([t]); else {
                            let e = this.freeDownloadingTasks.indexOf(t);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        let n = this.waitingTasks.indexOf(t);
                        -1 !== n && (this.waitingTasks.splice(n, 1), this.switchAutoAddTask(), this.trySwitchAutoTail())
                    }
                } while (0)
            })
        }
    };
    !function (e) {
        e.init = function () {
            x.init()
        }, e.updateTasksOrder = function (e) {
            x.updateTasks(e)
        }, e.startTask = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = C.getTaskFromTaskId(e).getTaskStatus();
                return n !== o.DownloadKernel.TaskStatus.Succeeded && n !== o.DownloadKernel.TaskStatus.Seeding && x.startTask(e, t, i)
            })
        }, e.startTasks = function (e) {
            return n(this, void 0, void 0, function* () {
                yield x.startTasks(e)
            })
        }, e.setStartTaskCount = function (e) {
            do {
                if ("number" != typeof e && (e = Number(e)), isNaN(e)) break;
                if (e <= 0) break;
                x.setMaxStartTaskCount(e).catch()
            } while (0)
        }, e.setFreeFromScheduleOpen = function (e, t) {
            x.setFreeFromScheduleOpen(e, t).catch()
        }, e.setAutoAddTaskAvailable = function (e) {
            x.setAutoAddTaskAvailable(e)
        }, e.setAutoAddTask = function (e, t) {
            x.setAutoAddTask(e, t)
        }, e.setAutoTail = function (e) {
            x.setAutoTail(e)
        }
    }(t.DownloadDispatchNS || (t.DownloadDispatchNS = {}))
}, function (e, t) {
    e.exports = require("fs")
}, function (e, t) {
    e.exports = require("url")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(3);
    !function (e) {
        e.isSingleBtTask = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1, i = void 0;
                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 s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        l = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), d = a.join(s, l);
                    if (yield o.FileSystemAWNS.existsAW(d)) {
                        let e = yield o.FileSystemAWNS.lstatAW(d);
                        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(d, e);
                            if (yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            let l = e + ".bt.xltd";
                            if (s = a.join(d, l), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            if (l = e + ".bt.td", s = a.join(d, l), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            break
                        }
                    }
                    let u = n.getBtFileList();
                    for (let [, e] of u) {
                        i = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath);
                        break
                    }
                    if (i) {
                        t = !1;
                        break
                    }
                    t = !0
                } while (0);
                return t
            })
        }, e.getCorrectSingleBtFolder = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = void 0;
                do {
                    if (!e) break;
                    if (e.getType() !== r.DownloadKernel.TaskType.Bt) break;
                    let i = e.getExtraObject();
                    if (!i) break;
                    if (1 !== i.getFileCount()) break;
                    let n = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), l = a.join(n, s),
                        d = yield o.FileSystemAWNS.dirExistsAW(l);
                    if (d) break;
                    let u = void 0, c = void 0, h = i.getBtFileList();
                    for (let [, e] of h) {
                        u = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), c = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath);
                        break
                    }
                    if (!u || !c) break;
                    if (l = a.join(n, c), d = yield o.FileSystemAWNS.dirExistsAW(l)) {
                        t = c;
                        break
                    }
                } while (0);
                return t
            })
        }, e.getSinleBtTaskFilePath = function (e) {
            let t = void 0;
            {
                let i = void 0, n = void 0, o = e.getExtraObject().getBtFileList();
                for (let [, e] of o) {
                    n = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath), i = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), n && (i = a.join(n, i));
                    break
                }
                let s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                t = a.join(s, i)
            }
            return t
        }
    }(t.SingleBtTaskNS || (t.SingleBtTaskNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = i(437), a = i(542), 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 d(e, t) {
        if (null !== e && void 0 !== e) if ("object" != typeof e && (e = [e]), r(e)) for (var i = 0, n = e.length; i < n; i++) t.call(null, e[i], i, 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: d, merge: function e() {
            var t = {};

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

            for (var n = 0, a = arguments.length; n < a; n++) d(arguments[n], i);
            return t
        }, extend: function (e, t, i) {
            return d(t, function (t, a) {
                e[a] = i && "function" == typeof t ? n(t, i) : t
            }), e
        }, trim: function (e) {
            return e.replace(/^\s*/, "").replace(/\s*$/, "")
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(42);
    var a;
    !function (e) {
        e[e.GreenNotify = 0] = "GreenNotify", e[e.RedNotify = 1] = "RedNotify", e[e.RedCancelNotify = 2] = "RedCancelNotify", e[e.Custom = 3] = "Custom"
    }(a = t.ToastNotifyItemType || (t.ToastNotifyItemType = {}));

    class o extends n.default {
        constructor(e, t, i, n) {
            super(), this.id = "", this.message = "", this.duration = 0, this.viewOptions = null, this.id = e, this.message = t, this.duration = i, this.viewOptions = 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 !(!this.viewOptions || !this.viewOptions.viewVisible)
        }

        getCancelText() {
            do {
                if (!this.viewOptions) break;
                if (this.viewOptions.viewVisible) return this.viewOptions.viewText ? this.viewOptions.viewText : "查看"
            } while (0);
            return ""
        }

        cancel() {
            this.viewOptions && this.viewOptions.onView ? this.viewOptions.onView() : this.fireEvent("OnCancel")
        }

        close() {
            this.viewOptions && this.viewOptions.onClose && this.viewOptions.onClose()
        }
    }

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

        getType() {
            return a.RedNotify
        }
    };

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

        getCancel() {
            return !0
        }

        getCancelText() {
            return "取消"
        }

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

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

        getType() {
            return a.RedCancelNotify
        }
    };
    t.CustomToastNotifyItem = class extends r {
        constructor(e, t, i, n) {
            super(e, t, i), this.component = "", this.component = n
        }

        getType() {
            return a.Custom
        }

        getComponentId() {
            return this.component
        }
    }
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g = {}.hasOwnProperty;
        f = i(70), h = f.isObject, c = f.isFunction, u = f.isEmpty, r = null, t = null, n = null, a = null, o = null, l = null, d = 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 = i(124), t = i(125), n = i(126), a = i(127), o = i(128), l = i(133), d = i(134), s = i(135))
            }

            return e.prototype.element = function (e, t, i) {
                var n, a, o, r, s, l, d, f, p, v;
                if (l = null, null == t && (t = {}), t = t.valueOf(), h(t) || (i = (p = [t, i])[0], t = p[1]), null != e && (e = e.valueOf()), Array.isArray(e)) for (o = 0, d = e.length; o < d; 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 (v = e[s], c(v) && (v = v.apply()), h(v) && u(v) && (v = null), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === s.indexOf(this.stringify.convertAttKey)) l = this.attribute(s.substr(this.stringify.convertAttKey.length), v); else if (!this.options.separateArrayItems && Array.isArray(v)) for (r = 0, f = v.length; r < f; r++) a = v[r], (n = {})[s] = a, l = this.element(n); else h(v) ? (l = this.element(s)).element(v) : l = this.element(s, v)
                } else l = !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === e.indexOf(this.stringify.convertTextKey) ? this.text(i) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === e.indexOf(this.stringify.convertCDataKey) ? this.cdata(i) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === e.indexOf(this.stringify.convertCommentKey) ? this.comment(i) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === e.indexOf(this.stringify.convertRawKey) ? this.raw(i) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === e.indexOf(this.stringify.convertPIKey) ? this.instruction(e.substr(this.stringify.convertPIKey.length), i) : this.node(e, t, i);
                if (null == l) throw new Error("Could not create any elements with: " + e);
                return l
            }, e.prototype.insertBefore = function (e, t, i) {
                var n, 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), n = this.parent.element(e, t, i), Array.prototype.push.apply(this.parent.children, o), n
            }, e.prototype.insertAfter = function (e, t, i) {
                var n, 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), n = this.parent.element(e, t, i), Array.prototype.push.apply(this.parent.children, o), n
            }, 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, i) {
                var n, a;
                return null != e && (e = e.valueOf()), t || (t = {}), t = t.valueOf(), h(t) || (i = (a = [t, i])[0], t = a[1]), n = new r(this, e, t), null != i && n.text(i), this.children.push(n), n
            }, e.prototype.text = function (e) {
                var t;
                return t = new d(this, e), this.children.push(t), this
            }, e.prototype.cdata = function (e) {
                var i;
                return i = new t(this, e), this.children.push(i), this
            }, e.prototype.comment = function (e) {
                var t;
                return t = new n(this, e), this.children.push(t), this
            }, e.prototype.commentBefore = function (e) {
                var t, i;
                return t = this.parent.children.indexOf(this), i = this.parent.children.splice(t), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.commentAfter = function (e) {
                var t, i;
                return t = this.parent.children.indexOf(this), i = this.parent.children.splice(t + 1), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, i), 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 i, n, 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++) i = e[o], this.instruction(i); else if (h(e)) for (i in e) g.call(e, i) && (n = e[i], this.instruction(i, n)); 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 i, n;
                return i = this.parent.children.indexOf(this), n = this.parent.children.splice(i), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.instructionAfter = function (e, t) {
                var i, n;
                return i = this.parent.children.indexOf(this), n = this.parent.children.splice(i + 1), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.declaration = function (e, t, i) {
                var n, o;
                return n = this.document(), o = new a(n, e, t, i), n.children[0] instanceof a ? n.children[0] = o : n.children.unshift(o), n.root() || n
            }, e.prototype.doctype = function (e, t) {
                var i, n, a, r, s, l, d, u, c;
                for (i = this.document(), n = new o(i, e, t), a = r = 0, l = (u = i.children).length; r < l; a = ++r) if (u[a] instanceof o) return i.children[a] = n, n;
                for (a = s = 0, d = (c = i.children).length; s < d; a = ++s) if (c[a].isRoot) return i.children.splice(a, 0, n), n;
                return i.children.push(n), n
            }, 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, i) {
                return this.element(e, t, i)
            }, e.prototype.nod = function (e, t, i) {
                return this.node(e, t, i)
            }, 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, i) {
                return this.declaration(e, t, i)
            }, e.prototype.dtd = function (e, t) {
                return this.doctype(e, t)
            }, e.prototype.e = function (e, t, i) {
                return this.element(e, t, i)
            }, e.prototype.n = function (e, t, i) {
                return this.node(e, t, i)
            }, 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, i) {
    "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}", e.guidDownloadGroupTask = "{66F815D6-ADE3-4c85-A6B2-E48D50C096A7}", e.guidNotSavePath = "{57D3CEED-8FE8-465e-B7B0-4A80BF7AED3D}", e.guidCreateShortcut = "{FF6109C2-2C71-4A9F-8C52-8BF2548D1A6F}", e.guidBirdKey = "{DC5A04D4-3FCF-43E4-A8F6-10809C8E5A8B}", e.guidSearchFrom = "{940D0737-FDA2-41AA-A210-F94A2CD7CD19}", e.guidHttpHeaderField = "{76E33F22-C09A-4A21-A31E-62CE63F1A2FE}", e.guidThunderYunDownloadUserData = "{56F48D3C-5453-4E16-B3A5-35EC5CC2C69E}"
    }(t.TaskUserDataGUID || (t.TaskUserDataGUID = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(42), o = i(49), r = n.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", e.notifyIdGetCoinPrize = "get_coin_prize", e.notifyIdTaskAdd2Cloud = "task_add_to_cloud_notify", e.notifyIdImportUnfinishedFail = "import_unfinished_fail";

        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 i = this.notifyList[t];
                    this.notifyList.splice(t, 1), this.fireEvent("OnCloseNotify", e, i);
                    break
                }
            }

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

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

            showNotifyEx(e, t, i, n, a, r) {
                let s = null;
                switch (t) {
                    case o.ToastNotifyItemType.GreenNotify:
                        s = new o.ToastNotifyItem(e, i, n, a);
                        break;
                    case o.ToastNotifyItemType.RedCancelNotify:
                        s = new o.RedCancelToastNotifyItem(e, i, n, a);
                        break;
                    case o.ToastNotifyItemType.RedNotify:
                        s = new o.RedToastNotifyItem(e, i, n, a);
                        break;
                    case o.ToastNotifyItemType.Custom:
                        s = new o.CustomToastNotifyItem(e, i, n, r)
                }
                return s ? (this.notifyList.push(s), this.fireEvent("OnShowNotify", e, s), s) : s
            }
        }

        e.ToastNotifyManager = t;
        const i = new t;
        e.getToastNotifyManger = function () {
            return i
        }
    }(t.ToastNotifyManagerNS || (t.ToastNotifyManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n;
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.Download = "download-panel", e.Cloud = "pan-plugin-view", e.Browser = "find-page", e.Message = "message-page"
    }(n = t.NavViewID || (t.NavViewID = {}));
    const a = {
        currentNav: n.Download,
        navs: [{
            content: "下载",
            icon: "xly-icon-nav-down",
            key: n.Download,
            unReadNum: 0,
            showUnRead: !0,
            showRedDot: !0
        }, {
            content: "云盘",
            icon: "xly-icon-nav-cloud",
            key: n.Cloud,
            unReadNum: 0,
            showUnRead: !0,
            showRedDot: !0
        }]
    }, o = {
        SELECT_NAV(e, t) {
            e.navs.some(e => e.key === t) && (e.currentNav = t, "find-page" === t ? this.commit("SHOW_OR_HIDE_BROWSER", !0, {root: !0}) : this.commit("SHOW_OR_HIDE_BROWSER", !1, {root: !0}))
        }, SET_NAV_UNREAD_NUM(e, t) {
            let i = e.navs.findIndex(e => e.key === t.nav);
            e.navs[i].unReadNum = t.unReadNum
        }, SET_NAV_SHOW_UNREAD_NUM(e, t) {
            let i = e.navs.findIndex(e => e.key === t.nav);
            e.navs[i].showUnRead = t.show
        }, SET_NAV_SHOW_RED_DOT(e, t) {
            let i = e.navs.findIndex(e => e.key === t.nav);
            e.navs[i].showRedDot = t.show
        }, ADD_NAV_UNREAD_NUM(e, t) {
            let i = e.navs.findIndex(e => e.key === t);
            e.navs[i].unReadNum = (e.navs[i].unReadNum || 0) + 1
        }
    };
    t.default = {state: a, mutations: o, getters: {currentNav: e => e.currentNav, navList: e => e.navs}}
}, function (e, t, i) {
    e.exports = i(58)(26)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(59), a = i(2);
    t.getDefaultPrex = function () {
        return a.basename(process.execPath, ".exe")
    }, t.getSockPath = function (e) {
        const t = n.tmpdir();
        let i = e;
        e || (i = a.basename(process.execPath, ".exe"));
        let o = a.join(t, `${i}-xunlei-node-net-ipc-{FD196984-2591-4588-AA6F-5C8AC1266290}.sock`);
        return "win32" === process.platform && (o = "\\\\.\\pipe\\" + (o = (o = o.replace(/^\//, "")).replace(/\//g, "-"))), o
    }, t.serverContextName = "xunlei-node-net-ipc-server-{46105371-DE78-4442-B59F-FDA1D6D7D430}", t.mainProcessContext = "main-process", t.mainRendererContext = "main-renderer", t.isObjectEmpty = function (e) {
        let t = !0;
        do {
            if (!e) break;
            if (0 === Object.keys(e).length) break;
            t = !1
        } while (0);
        return t
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), 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.Uflag || (t.Uflag = {})), function (e) {
        e[e.SW_FORCEMINIMIZE = 11] = "SW_FORCEMINIMIZE", e[e.SW_HIDE = 0] = "SW_HIDE", e[e.SW_MAXIMIZE = 3] = "SW_MAXIMIZE", e[e.SW_MINIMIZE = 6] = "SW_MINIMIZE", e[e.SW_RESTORE = 9] = "SW_RESTORE", e[e.SW_SHOW = 5] = "SW_SHOW", e[e.SW_SHOWDEFAULT = 10] = "SW_SHOWDEFAULT", e[e.SW_SHOWMAXIMIZED = 3] = "SW_SHOWMAXIMIZED", e[e.SW_SHOWMINIMIZED = 2] = "SW_SHOWMINIMIZED", e[e.SW_SHOWMINNOACTIVE = 7] = "SW_SHOWMINNOACTIVE", e[e.SW_SHOWNA = 8] = "SW_SHOWNA", e[e.SW_SHOWNOACTIVATE = 4] = "SW_SHOWNOACTIVATE", e[e.SW_SHOWNORMAL = 1] = "SW_SHOWNORMAL"
    }(t.CmdShow || (t.CmdShow = {})), 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_POPUP = 2147483648] = "WS_POPUP", e[e.WS_THICKFRAME = 262144] = "WS_THICKFRAME"
    }(t.WindowStyle || (t.WindowStyle = {})), function (e) {
        e[e.WS_EX_TOOLWINDOW = 128] = "WS_EX_TOOLWINDOW", e[e.WS_EX_APPWINDOW = 262144] = "WS_EX_APPWINDOW", e[e.WS_EX_TOPMOST = 8] = "WS_EX_TOPMOST", e[e.WS_EX_WINDOWEDGE = 256] = "WS_EX_WINDOWEDGE", e[e.WS_EX_NOACTIVATE = 134217728] = "WS_EX_NOACTIVATE", e[e.WS_EX_TRANSPARENT = 32] = "WS_EX_TRANSPARENT", e[e.WS_EX_LAYERED = 524288] = "WS_EX_LAYERED"
    }(t.WindowStyleEx || (t.WindowStyleEx = {})), 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_KEYDOWN = 256] = "WM_KEYDOWN", e[e.WM_KEYUP = 257] = "WM_KEYUP", e[e.WM_SYSKEYDOWN = 260] = "WM_SYSKEYDOWN", e[e.WM_MOUSEMOVE = 512] = "WM_MOUSEMOVE", e[e.WM_SETCURSOR = 32] = "WM_SETCURSOR", e[e.WM_LBUTTONDOWN = 513] = "WM_LBUTTONDOWN", e[e.WM_LBUTTONUP = 514] = "WM_LBUTTONUP", e[e.WM_LBUTTONDBLCLK = 515] = "WM_LBUTTONDBLCLK", e[e.WM_RBUTTONUP = 517] = "WM_RBUTTONUP", e[e.WM_MOUSEWHEEL = 522] = "WM_MOUSEWHEEL", e[e.WM_MOUSELEAVE = 675] = "WM_MOUSELEAVE", e[e.WM_DPICHANGED = 736] = "WM_DPICHANGED", e[e.WM_GETMINMAXINFO = 36] = "WM_GETMINMAXINFO", e[e.WM_NCHITTEST = 132] = "WM_NCHITTEST", e[e.WM_NCMOUSEMOVE = 160] = "WM_NCMOUSEMOVE", e[e.WM_NCLBUTTONDOWN = 161] = "WM_NCLBUTTONDOWN", e[e.WM_NCLBUTTONUP = 162] = "WM_NCLBUTTONUP", e[e.WM_NCLBUTTONDBLCLK = 163] = "WM_NCLBUTTONDBLCLK", e[e.WM_NCRBUTTONDOWN = 164] = "WM_NCRBUTTONDOWN", e[e.WM_NCRBUTTONUP = 165] = "WM_NCRBUTTONUP", e[e.WM_NCRBUTTONDBLCLK = 166] = "WM_NCRBUTTONDBLCLK", e[e.WM_NCMBUTTONDOWN = 167] = "WM_NCMBUTTONDOWN", e[e.WM_NCMBUTTONUP = 168] = "WM_NCMBUTTONUP", e[e.WM_NCMBUTTONDBLCLK = 169] = "WM_NCMBUTTONDBLCLK", e[e.WM_WINDOWPOSCHANGED = 71] = "WM_WINDOWPOSCHANGED", e[e.WM_WINDOWPOSCHANGING = 70] = "WM_WINDOWPOSCHANGING", e[e.WM_ACTIVATEAPP = 28] = "WM_ACTIVATEAPP", e[e.WM_DWMCOMPOSITIONCHANGED = 798] = "WM_DWMCOMPOSITIONCHANGED", e[e.WM_QUERYENDSESSION = 17] = "WM_QUERYENDSESSION"
    }(t.WindowMessage || (t.WindowMessage = {})), function (e) {
        e[e.GW_HWNDFIRST = 0] = "GW_HWNDFIRST", e[e.GW_HWNDLAST = 1] = "GW_HWNDLAST", e[e.GW_HWNDNEXT = 2] = "GW_HWNDNEXT", e[e.GW_HWNDPREV = 3] = "GW_HWNDPREV", e[e.GW_OWNER = 4] = "GW_OWNER", e[e.GW_CHILD = 5] = "GW_CHILD", e[e.GW_ENABLEDPOPUP = 6] = "GW_ENABLEDPOPUP"
    }(t.GWCmd || (t.GWCmd = {})), function (e) {
        e[e.HTERROR = -2] = "HTERROR", e[e.HTTRANSPARENT = -1] = "HTTRANSPARENT", e[e.HTNOWHERE = 0] = "HTNOWHERE", e[e.HTCLIENT = 1] = "HTCLIENT", e[e.HTCAPTION = 2] = "HTCAPTION", e[e.HTSYSMENU = 3] = "HTSYSMENU", e[e.HTGROWBOX = 4] = "HTGROWBOX", e[e.HTSIZE = 4] = "HTSIZE", e[e.HTMENU = 5] = "HTMENU", e[e.HTHSCROLL = 6] = "HTHSCROLL", e[e.HTVSCROLL = 7] = "HTVSCROLL", e[e.HTMINBUTTON = 8] = "HTMINBUTTON", e[e.HTMAXBUTTON = 9] = "HTMAXBUTTON", e[e.HTLEFT = 10] = "HTLEFT", e[e.HTRIGHT = 11] = "HTRIGHT", e[e.HTTOP = 12] = "HTTOP", e[e.HTTOPLEFT = 13] = "HTTOPLEFT", e[e.HTTOPRIGHT = 14] = "HTTOPRIGHT", e[e.HTBOTTOM = 15] = "HTBOTTOM", e[e.HTBOTTOMLEFT = 16] = "HTBOTTOMLEFT", e[e.HTBOTTOMRIGHT = 17] = "HTBOTTOMRIGHT", e[e.HTBORDER = 18] = "HTBORDER", e[e.HTREDUCE = 8] = "HTREDUCE", e[e.HTZOOM = 9] = "HTZOOM", e[e.HTSIZEFIRST = 10] = "HTSIZEFIRST", e[e.HTSIZELAST = 17] = "HTSIZELAST", e[e.HTOBJECT = 19] = "HTOBJECT", e[e.HTCLOSE = 20] = "HTCLOSE", e[e.HTHELP = 21] = "HTHELP"
    }(t.HitTestPositionCode || (t.HitTestPositionCode = {})), function (e) {
        e[e.VK_LBUTTON = 1] = "VK_LBUTTON", e[e.VK_RBUTTON = 2] = "VK_RBUTTON", e[e.VK_MBUTTON = 4] = "VK_MBUTTON", e[e.VK_BACK = 8] = "VK_BACK", e[e.VK_TAB = 9] = "VK_TAB", e[e.VK_RETURN = 13] = "VK_RETURN", e[e.VK_SHIFT = 16] = "VK_SHIFT", e[e.VK_CONTROL = 17] = "VK_CONTROL", e[e.VK_MENU = 18] = "VK_MENU", e[e.VK_ESCAPE = 27] = "VK_ESCAPE", e[e.VK_SPACE = 32] = "VK_SPACE", e[e.VK_PRIOR = 33] = "VK_PRIOR", e[e.VK_NEXT = 34] = "VK_NEXT", e[e.VK_END = 35] = "VK_END", e[e.VK_LEFT = 37] = "VK_LEFT", e[e.VK_UP = 38] = "VK_UP", e[e.VK_RIGHT = 39] = "VK_RIGHT", e[e.VK_DOWN = 40] = "VK_DOWN", e[e.VK_DELETE = 46] = "VK_DELETE", e[e.VK_F1 = 112] = "VK_F1", e[e.VK_F2 = 113] = "VK_F2", e[e.VK_F3 = 114] = "VK_F3", e[e.VK_F4 = 115] = "VK_F4", e[e.VK_F5 = 116] = "VK_F5", e[e.VK_F6 = 117] = "VK_F6", e[e.VK_F7 = 118] = "VK_F7", e[e.VK_F8 = 119] = "VK_F8", e[e.VK_F9 = 120] = "VK_F9", e[e.VK_F10 = 121] = "VK_F10", e[e.VK_F11 = 122] = "VK_F11", e[e.VK_F12 = 123] = "VK_F12", e[e.VK_OEM_1 = 186] = "VK_OEM_1", e[e.VK_OEM_PLUS = 187] = "VK_OEM_PLUS", e[e.VK_OEM_COMMA = 188] = "VK_OEM_COMMA", e[e.VK_OEM_MINUS = 189] = "VK_OEM_MINUS", e[e.VK_OEM_PERIOD = 190] = "VK_OEM_PERIOD", e[e.VK_OEM_2 = 191] = "VK_OEM_2", e[e.VK_OEM_3 = 192] = "VK_OEM_3", e[e.VK_OEM_4 = 219] = "VK_OEM_4", e[e.VK_OEM_5 = 220] = "VK_OEM_5", e[e.VK_OEM_6 = 221] = "VK_OEM_6", e[e.VK_OEM_7 = 222] = "VK_OEM_7", e[e.VK_PROCESSKEY = 229] = "VK_PROCESSKEY"
    }(t.VirtualKeyCode || (t.VirtualKeyCode = {})), function (e) {
        e[e.SW_HIDE = 0] = "SW_HIDE", e[e.SW_SHOWMAXIMIZED = 3] = "SW_SHOWMAXIMIZED", e[e.SW_SHOW = 5] = "SW_SHOW"
    }(t.ShowWindowCmd || (t.ShowWindowCmd = {})), function (e) {
        e[e.MIN_WINDOW_WIDTH = 520] = "MIN_WINDOW_WIDTH", e[e.MIN_WINDOW_HEIGHT = 335] = "MIN_WINDOW_HEIGHT", e[e.MIN_WINDOW_WIDTH_TAB = 910] = "MIN_WINDOW_WIDTH_TAB", e[e.MIN_WINDOW_HEIGHT_TAB = 600] = "MIN_WINDOW_HEIGHT_TAB", e[e.TOP_WINDOW_HEIGHT = 68] = "TOP_WINDOW_HEIGHT", e[e.TOP_WINDOW_HEIGHT_NORMAL = 68] = "TOP_WINDOW_HEIGHT_NORMAL", e[e.PLAYCTRL_HEIGHT = 82] = "PLAYCTRL_HEIGHT", e[e.PLAYLIST_WIDTH = 240] = "PLAYLIST_WIDTH", e[e.FRAME_BORDER = 0] = "FRAME_BORDER", e[e.FRAME_RESIZE_BORDER = 0] = "FRAME_RESIZE_BORDER", e[e.BROWSERWINDOW_SHADOW = 8] = "BROWSERWINDOW_SHADOW", e[e.SIDE_BAR_WIDTH = 25] = "SIDE_BAR_WIDTH", e[e.SIDE_BAR_HEIGHT = 100] = "SIDE_BAR_HEIGHT", e[e.SHOWHIDE_DELAY_TIME = 2e3] = "SHOWHIDE_DELAY_TIME", e[e.TIME_TIP_WINDOW_WIDTH = 111] = "TIME_TIP_WINDOW_WIDTH", e[e.TIME_TIP_WINDOW_HEIGHT = 30] = "TIME_TIP_WINDOW_HEIGHT", e[e.TIME_IMG_TIP_WINDOW_HEIGHT = 75] = "TIME_IMG_TIP_WINDOW_HEIGHT"
    }(t.WindowParams || (t.WindowParams = {})), function (e) {
        e[e.UNKNOWN_MODE = -1] = "UNKNOWN_MODE", e[e.TRANSPARENT_MODE = 0] = "TRANSPARENT_MODE", e[e.NORMAL_MODE = 1] = "NORMAL_MODE", e[e.MINI_MODE = 2] = "MINI_MODE", e[e.EMBED_CHILD_MODE = 3] = "EMBED_CHILD_MODE"
    }(t.XMPShowMode || (t.XMPShowMode = {})), function (e) {
        e[e.NO_TOPMOST_MODE = 0] = "NO_TOPMOST_MODE", e[e.PLAYING_TOPMOST_MODE = 1] = "PLAYING_TOPMOST_MODE", e[e.ALWAYLS_TOPMOST_MODE = 2] = "ALWAYLS_TOPMOST_MODE"
    }(t.WindowTopMode || (t.WindowTopMode = {})), function (e) {
        e[e.RGN_AND = 1] = "RGN_AND", e[e.RGN_OR = 2] = "RGN_OR", e[e.RGN_XOR = 3] = "RGN_XOR", e[e.RGN_DIFF = 4] = "RGN_DIFF", e[e.RGN_COPY = 5] = "RGN_COPY"
    }(t.CombineRgnType || (t.CombineRgnType = {})), function (e) {
        e[e.PLAY_UNKNOWN = 0] = "PLAY_UNKNOWN", e[e.PLAY_BY_DOWNLOAD = 1] = "PLAY_BY_DOWNLOAD", e[e.PLAY_BY_PAN = 2] = "PLAY_BY_PAN"
    }(t.XmpPlaySoure || (t.XmpPlaySoure = {})), function (e) {
        e.onOpenSucceeded = "OnOpenSucceeded", e.onOpenFailed = "OnOpenFailed", e.onPlayFailed = "OnPlayFailed", e.onPlaying = "OnPlaying", e.onPreOpen = "OnPreOpen", e.onPaused = "OnPaused", e.onPlayCompleted = "OnPlayCompleted", e.onPreStop = "OnPreStop", e.onStop = "OnStop", e.onXmpQuit = "OnXmpQuit", e.onXmpStartFailed = "OnXmpStartFailed", e.onError = "OnError"
    }(t.XmpEvent || (t.XmpEvent = {})), function (e) {
        e[e.Invalid = -100] = "Invalid", e[e.PreOpen = -10] = "PreOpen", e[e.QueryExt = -9] = "QueryExt", e[e.DownloadTorrent = -3] = "DownloadTorrent", e[e.ParserTorrent = -2] = "ParserTorrent", e[e.GetPlayUrl = -1] = "GetPlayUrl", e[e.Ready = 0] = "Ready", e[e.Opening = 1] = "Opening", e[e.Pausing = 2] = "Pausing", e[e.Paused = 3] = "Paused", e[e.Playing = 4] = "Playing", e[e.Play = 5] = "Play", e[e.Closeing = 6] = "Closeing", e[e.Completed = 7] = "Completed", e[e.Stopped = 8] = "Stopped", e[e.Error = 9] = "Error"
    }(t.XmpMediaState || (t.XmpMediaState = {})), function (e) {
        e[e.AbeLeft = 0] = "AbeLeft", e[e.AbeTop = 1] = "AbeTop", e[e.AbeRright = 2] = "AbeRright", e[e.AbeBottom = 3] = "AbeBottom"
    }(t.WindowTaskBarAbe || (t.WindowTaskBarAbe = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(582), r = i(0), s = i(11), l = i(16), d = r.default.getLogger("quit-promises");
    t.quitPromises = new class {
        constructor() {
            this.promiseFuncArray = [], this.promiseBeforeFuncArray = [], this.promiseAfterFuncArray = [], this.promiseIpcCallbackArray = [], a.ipcRenderer.once("OnQueryEndSession", () => n(this, void 0, void 0, function* () {
                a.ipcRenderer.send("closeMainWindow", "exit"), o.HistoryDataNS.setExitType("normal"), yield this.runAllPromises()
            }));
            let e = {AddQuitPromise: this.addQuitPromise.bind(this)};
            l.server.registerFunctions(e)
        }

        addQuitPromise(e, t, i) {
            d.information("addQuitPromise context:", t), this.promiseIpcCallbackArray.push({context: t, callback: i})
        }

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

        addBefore(e) {
            this.promiseBeforeFuncArray.push(e)
        }

        addAfter(e) {
            this.promiseAfterFuncArray.push(e)
        }

        runPromises(e) {
            return n(this, void 0, void 0, function* () {
                let t = [];
                for (let i of e) "function" == typeof i && t.push(i());
                return new Promise(e => {
                    Promise.all(t).then(() => {
                        d.information("runPromises finish."), e()
                    }).catch(t => {
                        d.warning("runPromises exception.", t), e()
                    })
                })
            })
        }

        runAllPromises() {
            return n(this, void 0, void 0, function* () {
                d.information("runPromises before"), yield this.runPromises(this.promiseBeforeFuncArray), d.information("runIpcPromises");
                let e = [];
                this.promiseIpcCallbackArray.forEach(t => {
                    e.push(t.callback)
                }), yield this.runPromises(e), d.information("runPromises"), yield this.runPromises(this.promiseFuncArray), d.information("runPromises after"), yield this.runPromises(this.promiseAfterFuncArray)
            })
        }

        run() {
            return n(this, void 0, void 0, function* () {
                a.ipcRenderer.send("closeMainWindow", "exit"), o.HistoryDataNS.setExitType("normal"), yield this.runAllPromises(), d.information("app.quit before"), yield(yield s.asyncRemoteCall.getApp()).quit(), d.information("app.quit end")
            })
        }
    }
}, function (e, t) {
    e.exports = vendor_09264ad0ec2472c8ac23
}, function (e, t) {
    e.exports = require("os")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(31), r = i(12), s = i(30), l = i(6), d = r.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        e.batchFindTaskAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = [];
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i], o = null;
                    n.taskType === a.DownloadKernel.TaskType.P2sp ? o = {
                        keyType: a.DownloadKernel.KeyType.P2spUrl,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : n.taskType === a.DownloadKernel.TaskType.Emule ? o = {
                        keyType: a.DownloadKernel.KeyType.EmuleFileHash,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : n.taskType === a.DownloadKernel.TaskType.Bt ? o = {
                        keyType: a.DownloadKernel.KeyType.BtInfoId,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : n.taskType === a.DownloadKernel.TaskType.Magnet && (o = {
                        keyType: a.DownloadKernel.KeyType.MagnetUrl,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    }), o && t.push(o)
                }
                return d.batchFindTaskAsync(t)
            })
        }, e.importUnfinishedTaskAW = function (e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise(i => {
                    o.DownloadKernelManager.importUnfinishedTask(e, t, (e, t, n) => {
                        i({ret: e, url: t, torrentPath: n})
                    })
                })
            })
        }, e.parserBtFileInfoAW = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => n(this, void 0, void 0, function* () {
                    (yield l.FileSystemAWNS.existsAW(e)) ? s.ThunderKernel.parserBtFileInfo(e, (e, i) => {
                        t(0 === e && i ? i : null)
                    }) : t(null)
                }))
            })
        }
    }(t.TaskUtilitiesAWNS || (t.TaskUtilitiesAWNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

    function u(e) {
        return (e = (e = encodeURIComponent(e)).replace(/\(/g, "%29")).replace(/\)/g, "%28")
    }

    function c({url: e, data: t, method: o = "get"}, d = "prod") {
        return n(this, arguments, void 0, function* () {
            l.information("fetchFromApiProxy", arguments);
            try {
                const n = yield Promise.all([a.client.callServerFunction("GetUserID"), a.client.callServerFunction("GetSessionID"), a.client.callServerFunction("GetPeerID")]), [c, h, f] = n;
                l.information(n);
                let g = {
                    _h: Object.assign({
                        "Account-Id": c,
                        "Peer-Id": f,
                        "User-Id": c,
                        "Session-Id": h,
                        "App-Type": "pc_xunlei"
                    }, t && t._h || {})
                };
                t && t._h && delete t._h, t && (t.peer_id = f);
                let p = {
                    accesskey: "pc.xunlei",
                    nonce: Math.floor(99999999 * Math.random()).toString(),
                    timestamp: Math.floor((new Date).getTime() / 1e3).toString()
                }, v = {};
                "get" === o && t && (v = t, t = null);
                for (let e in v) s.isObject(v[e]) || (p[e] = v[e]);
                let m = [];
                for (let e in p) m.push(u(e) + "%3D" + u(p[e]));
                m.sort();
                let y = u(e), k = o.toUpperCase() + "&" + y + "&", T = "";
                for (let e = 0; e < m.length - 1; ++e) T += m[e] + "%26";
                let w, C = k + (T += m[m.length - 1]);
                !t || "post" !== o && "put" !== o || (C += "%26" + JSON.stringify(t)), l.information("message: ", C), w = "test" === d ? "c9879c94a55474304cca0abafb867653" : "89917368930f3fea5bafebe704d6b623";
                let S = r.ToolsUtilitiesAWNS.encryptHmacBuffer("sha1", w, C, "base64");
                S = (S = S.replace(/\+/g, "-")).replace(/\//g, "_");
                let I = e + "?";
                for (let e in p) I += u(e) + "=" + u(p[e]) + "&";
                I += "sig=" + S, l.information("fetchFromApiProxy method", o, ", uri", I, ", data", t, ", headers", g._h);
                const b = yield i(20);
                return b.defaults.adapter = i(21), b.defaults.headers["Content-Type"] = "post" === o ? "application/json" : "application/x-www-form-urlencoded", b.request({
                    method: o,
                    url: I,
                    data: t,
                    headers: g._h
                }).then(e => (l.information("fetchFromApiProxy success", e), e)).catch(e => (l.information("fetchFromApiProxy failed", e), {error: e}))
            } catch (e) {
                return {error: e}
            }
        })
    }

    function h({url: e, data: t, method: i = "get"}, o = "prod") {
        return n(this, void 0, void 0, function* () {
            let n = d[o], r = yield a.client.callServerFunction("GetValue", "ConfigFetchInterface", "TestServer", 0);
            return 1 === r && (n = d[o = "test"]), l.information("当前fetchSlRes 是否测试服:", r, " 远程地址:", n), c({
                url: `${n}${e}`,
                data: t,
                method: i
            }, o)
        })
    }

    t.fetchFromApiProxy = c, t.fetchSlRes = h, t.fetchPCRes = function ({
                                                                            url: e,
                                                                            data: t,
                                                                            method: i = "get"
                                                                        }, a = "prod") {
        return n(this, void 0, void 0, function* () {
            return h({url: e, data: t, method: i}, a)
        })
    }, t.fetchPCRequest = function ({url: e, data: t, method: o = "get"}, r = "prod") {
        return n(this, void 0, void 0, function* () {
            let n = d[r], s = yield a.client.callServerFunction("GetValue", "ConfigFetchInterface", "TestServer", 0);
            1 === s && (n = d[r = "test"]), l.information("当前fetchPCRequest 是否测试服:", s, " 远程地址:", n);
            let u = {_h: Object.assign({}, t && t._h || {})};
            t && t._h && delete t._h;
            const c = yield i(20);
            c.defaults.adapter = i(21), c.defaults.headers["Content-Type"] = "post" === o ? "application/json" : "application/x-www-form-urlencoded";
            try {
                return c.request({
                    method: o,
                    url: `${n}${e}`,
                    params: "get" === o && t ? t : {},
                    data: "post" === o && t ? t : {},
                    headers: u._h
                }).then(e => (l.information("fetchRequest success", e), e)).catch(e => (l.information("fetchRequest fail", e), {error: e}))
            } catch (e) {
                return {error: e}
            }
        })
    }, t.fetchRequest = function ({url: e, data: t, method: a = "get"}) {
        return n(this, arguments, void 0, function* () {
            l.information("fetchRequest", arguments);
            try {
                const n = yield i(20);
                return n.defaults.adapter = i(21), n.defaults.headers["Content-Type"] = "post" === a ? "application/json" : "application/x-www-form-urlencoded", n.request({
                    method: a,
                    url: e,
                    params: "get" === a && t ? t : {},
                    data: "post" === a && t ? t : {}
                }).then(e => (l.information("fetchRequest success", e), e)).catch(e => (l.information("fetchRequest fail", e), {error: e}))
            } catch (e) {
                return {error: e}
            }
        })
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(0), o = i(3), r = i(39), s = i(34), l = i(7), d = a.default.getLogger("ThunderNewTask"),
        u = l.default(n.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;.dmg;.msu;",
        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 i(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 i = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                let n = r.TaskUtilHelper.getTaskFileType(void 0, e);
                if (n === r.TaskUtilHelper.FileExtType.Video || n === r.TaskUtilHelper.FileExtType.Music || n === r.TaskUtilHelper.FileExtType.Pic) {
                    i = !0;
                    break
                }
                i = t(e)
            } while (0);
            return i
        }

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

        function f(e) {
            let t = {};
            do {
                if (void 0 === e || null === e) break;
                d.information("parseDynamicUrlArgs");
                let i = /([^&=?]+)=([^&]*)/g;
                for (; i.exec(e);) t[RegExp.$1] = RegExp.$2;
                d.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;
                d.information("parseDynamicUrlPath"), e.match(/[\/]?([^?]*)\?([^\s]*)/) ? (t.pageFileName = RegExp.$1, t.args = RegExp.$2) : (t.pageFileName = e, t.args = ""), d.information("parseDynamicUrlPath ret", t)
            } while (0);
            return t
        }

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

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

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

        function y(e) {
            return u.isThunderPrivateUrl(e)
        }

        function k(e) {
            return u.parseEd2kUrl(e)
        }

        function T(e) {
            return u.parseUrl(e)
        }

        e.isDownloadFileExtName = t, e.isIllegalFileName = i, 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 = v, e.getNameFromUrl = function (e) {
            let t = "index.html", i = s.ThunderHelper.getTaskTypeFromUrl(e);
            if (i === o.DownloadKernel.TaskType.P2sp) {
                let i = T(e);
                if (i) {
                    let e = v(i.fullPath);
                    e.length > 0 && (t = e[0])
                } else {
                    let i = /:\/\/.*?\[.+?\].*(\/.+)/.exec(e);
                    if (i && i[1]) {
                        let e = v(i[1]);
                        e.length > 0 && (t = e[0])
                    }
                }
            } else i === o.DownloadKernel.TaskType.Emule && (t = k(e).fileName);
            return t.replace(/[*?/\\:|<>\"]/g, "_")
        }, e.parseFileNameFromP2spUrlPath = m, e.isThunderPrivateUrl = y, e.parseThunderPrivateUrl = function (e) {
            let t = {url: e, codePage: -1};
            return y(e) && (t = u.parseThunderPrivateUrl(e)), t
        }, e.parseEd2kUrl = k, e.parseUrl = T, e.parseMagnetUrl = function (e) {
            return u.parseMagnetUrl(e)
        }, e.makeUrl = function (e) {
            return u.makeUrl(e)
        }
    }(t.ParseUrlFileNameNS || (t.ParseUrlFileNameNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(336), o = i(98), r = i(26).DownloadKernelCategoryManager.getCategoryManager();
    !function (e) {
        let t, i, s;

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

        function d(e) {
            let t = "未知错误，无法继续下载";
            e > 704 && e <= 799 && (e = 701);
            let i = a.default.getMessage(a.ErrorType.Download, e);
            if (i) t = i; 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 211:
                case 212:
                    t = "当前下载目录无法写入数据，请尝试下载到其它目录";
                    break;
                case 601:
                    t = "BT任务已存在，无法继续下载";
                    break;
                case 701:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 702:
                    t = "帐号存在异常，无法继续下载";
                    break;
                case 703:
                    t = "根据当地法律法规，文件无法下载";
                    break;
                case 704:
                    t = "应版权方要求，文件无法下载";
                    break;
                case 2e4:
                case 10001:
                    t = "下载引擎未启动，无法继续下载";
                    break;
                case 10002:
                    t = "种子文件不存在，无法继续下载"
            }
            return t
        }

        e.canStartSelectedTask = function (e, t) {
            let i = !1;
            if (e === n.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                if (e.isMoving) {
                    i = !1;
                    break
                }
                let t = e.taskStatus;
                t !== n.DownloadKernel.TaskStatus.StandBy && t !== n.DownloadKernel.TaskStatus.Stopped && t !== n.DownloadKernel.TaskStatus.Failed && t !== n.DownloadKernel.TaskStatus.Unkown || (i = !0)
            }
            return i
        }, e.canMoveSelectedTask = function (e, t) {
            let i = !0;
            for (let e of t) if (e.isMoving) {
                i = !1;
                break
            }
            return i
        }, e.canStopSelectedTask = function (e, t) {
            let i = !1;
            if (e === n.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                let t = e.taskStatus;
                if (t === n.DownloadKernel.TaskStatus.Started || t === n.DownloadKernel.TaskStatus.StartWaiting) {
                    i = !0;
                    break
                }
            }
            return i
        }, e.canDeleteSelectedTask = function (e, t) {
            let i = !1;
            if (t.length > 0) for (let e of t) {
                if (e.isMoving) {
                    i = !1;
                    break
                }
                let t = e.taskStatus;
                t === n.DownloadKernel.TaskStatus.StartPending || t === n.DownloadKernel.TaskStatus.StopPending || t === n.DownloadKernel.TaskStatus.DestroyPending || (i = !0)
            }
            return i
        }, e.canMarkAsOpened = function (e) {
            let t = !1;
            do {
                if (null === e || 0 === e.length) break;
                for (let i of e) if (0 === i.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 i of e) if (i.taskType === n.DownloadKernel.TaskType.P2sp || i.taskType === n.DownloadKernel.TaskType.Emule || i.taskType === n.DownloadKernel.TaskType.Group) {
                    let e = i.categoryId;
                    if (-1 === e || r.isPrivateCategory(e)) {
                        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 i of e) if (i.taskType === n.DownloadKernel.TaskType.Bt || i.taskType === n.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"
        }(i = 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"
        }(s = e.EmuleStartStatus || (e.EmuleStartStatus = {})), e.getTaskStartStatus = l, e.getTaskStartStatusPrompt = function (e) {
            let a = void 0;
            do {
                if (null === e) break;
                if (e.taskStatus === n.DownloadKernel.TaskStatus.StartPending || e.taskStatus === n.DownloadKernel.TaskStatus.Started) {
                    if (e.taskType === n.DownloadKernel.TaskType.P2sp) {
                        let i = l(e);
                        if (null === i) break;
                        i === t.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === n.DownloadKernel.TaskType.Bt) {
                        let t = l(e);
                        if (null === t) break;
                        t === i.Analy ? a = "解析种子" : t === i.Search ? a = "寻找资源" : t === i.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === n.DownloadKernel.TaskType.Emule) {
                        let t = l(e);
                        if (null === t) break;
                        t === s.Search ? a = "寻找资源" : t === s.Connect && (a = "连接资源")
                    }
                }
            } while (0);
            return a
        }, e.getTaskStatusPrompt = function (e) {
            let t = void 0;
            do {
                if (null === e) break;
                let i = e.taskStatus;
                if (i === n.DownloadKernel.TaskStatus.Unkown) {
                    t = "未知错误";
                    break
                }
                if (i !== n.DownloadKernel.TaskStatus.Started) {
                    if (o.DownloadJammedNS.isStopPending(e.taskId)) {
                        t = "0B/s";
                        break
                    }
                } else if (o.DownloadJammedNS.isValidatingFileData(e.taskId)) {
                    t = "正在校验数据";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StandBy) {
                    t = "准备开始";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.PreDownloading) {
                    t = "等待中";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StartWaiting) {
                    t = "排队等待";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StartPending) {
                    t = "正在开始";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StopPending) {
                    t = "正在停止";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.Stopped) {
                    t = "暂停", e.isMoving && (t = "移动文件中");
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.Failed) {
                    t = "任务出错", t = d(e.errorCode);
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.Succeeded || i === n.DownloadKernel.TaskStatus.Seeding) {
                    t = "完成";
                    break
                }
            } while (0);
            return t
        }, e.getValueForSort = function (e) {
            let t = 0, i = e.taskStatus;
            if (i === n.DownloadKernel.TaskStatus.PreDownloading ? t = 11 : i === n.DownloadKernel.TaskStatus.Started ? t = 10 : i === n.DownloadKernel.TaskStatus.StartPending ? t = 9 : i === n.DownloadKernel.TaskStatus.StartWaiting ? t = 8 : i === n.DownloadKernel.TaskStatus.StopPending ? t = 7 : i === n.DownloadKernel.TaskStatus.DestroyPending ? t = 6 : i === n.DownloadKernel.TaskStatus.Unkown ? t = 5 : i === n.DownloadKernel.TaskStatus.StandBy ? t = 4 : i === n.DownloadKernel.TaskStatus.Stopped ? t = 3 : i === n.DownloadKernel.TaskStatus.Failed ? t = 2 : i === n.DownloadKernel.TaskStatus.Seeding ? t = 1 : i === n.DownloadKernel.TaskStatus.Succeeded && (t = 0), i === n.DownloadKernel.TaskStatus.Started) {
                let i = l(e);
                t = null === i || 4 === i ? t + .9 - 1 / (e.downloadSpeed + 1.2) : t + i / 10 - .4
            }
            return i === n.DownloadKernel.TaskStatus.StartPending && e.taskType === n.DownloadKernel.TaskType.Bt && (t += .1), t
        }, e.getTaskErrorInfoByCode = d
    }(t.TaskStatusHelper || (t.TaskStatusHelper = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(5), r = i(17), s = a.default.getLogger("Thunder.ShouldLogin");
    t.default = function (e = !1, t = !1, i) {
        return n(this, void 0, void 0, function* () {
            let n, a = null;
            try {
                let l = yield o.client.callServerFunction("IsLogined"),
                    d = yield o.client.callServerFunction("GetUserID");
                l ? (s.information("is logined"), n = Promise.resolve(d)) : (n = new Promise((i, n) => {
                    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 ? i("") : i(e), -1 !== o && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1)
                    }), !e) {
                        let e = r.NativeCallModule.nativeCall.AttachNativeEvent("OnLoginWndClose", n => {
                            do {
                                if ("close" === n) {
                                    if (i(""), !t && -1 !== o) {
                                        r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1;
                                        break
                                    }
                                } else if ("suc" === n && -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.client.callServerFunction("ShowLoginDlg", i).catch(e => {
                    s.warning(e)
                })))
            } catch (e) {
                s.warning(e), n = Promise.resolve("")
            }
            return n
        })
    }
}, function (e, t, i) {
    "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 i = {
                "M+": e.getMonth() + 1,
                "d+": e.getDate(),
                "h+": e.getHours(),
                "m+": e.getMinutes(),
                "s+": e.getSeconds()
            };
            for (let e in i) {
                let n = i[e] + "";
                new RegExp(`(${e})`).test(t) && (t = t.replace(RegExp.$1, 1 === RegExp.$1.length ? n : ("00" + (n = n)).substr(n.length)))
            }
            var n;
            if (/(f+)/.test(t)) {
                let i = e.getMilliseconds() + "";
                t = t.replace(RegExp.$1, ("000" + i).substr(i.length))
            }
            return t
        }, e.formatSeconds = function (e) {
            let t = "";
            do {
                if (e <= 0) {
                    t = "00:00:00";
                    break
                }
                let i = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, a = Math.floor(e % 60);
                t = i < 10 ? "0" + i + ":" : i + ":", t += n < 10 ? "0" + n + ":" : n + ":", t += a < 10 ? "0" + a : "" + a
            } while (0);
            return t
        }, e.formatSecondsCustom = function (e) {
            let t = "";
            do {
                if (e <= 0) {
                    t = "00:00:00";
                    break
                }
                let i = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, a = Math.floor(e % 60);
                if (i <= 99) t = i < 10 ? "0" + i + ":" : i + ":", t += n < 10 ? "0" + n + ":" : n + ":", t += a < 10 ? "0" + a : "" + a; else {
                    let i = Math.floor(e / 86400);
                    t = `剩${i = i > 999 ? 999 : i}天`
                }
            } while (0);
            return t
        }, e.convertTimeToMinutes = function (e, t, i) {
            return 3600 * e + 60 * t + i
        }, 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, i) {
    e.exports = i(58)(27)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(2), r = i(35), s = i(6), l = i(7), d = i(9), u = i(14), c = i(147), h = i(0), f = i(5),
        g = i(23), p = i(37), v = i(24), m = h.default.getLogger("AdHelperNS"),
        y = l.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    a.default.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
    const k = "1.0", T = "14", w = "1b301990901c336d84fbdd8bc8dda35c";
    !function (e) {
        let t;

        function i(e) {
            let t = "";
            do {
                if (null === e || void 0 === e) break;
                Object.keys(e).forEach(i => {
                    let n = e[i];
                    t = `${t}${i}=${n}`
                }), t = `${t}${w}`, t = r.ToolsUtilitiesAWNS.genarateMd5(t)
            } while (0);
            return t
        }

        function l() {
            return n(this, void 0, void 0, function* () {
                let e = t.unLogin;
                if (yield g.LoginHelperNS.loginHelper.isLoginedAw()) {
                    let i = yield g.LoginHelperNS.loginHelper.getAllUserInfoAw();
                    if (null === i || void 0 === i || null === i.vipList || void 0 === i.vipList || i.vipList.length <= 0) e = t.noVip; else {
                        let n = i.vipList[0], a = Number(n.isVip), o = Number(n.vasType), r = Number(n.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
            })
        }

        function h(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", n = {appId: T, callId: Date.now()};
                return Object.assign(n, e), n.sig = i(n), Object.keys(n).forEach(e => {
                    let i = n[e];
                    t = "" === t ? `${e}=${encodeURIComponent(i)}` : `${t}&${e}=${encodeURIComponent(i)}`
                }), t
            })
        }

        function C() {
            let e = "http://adsp.xunlei.com", t = v.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 === d.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, i) {
            return n(this, void 0, void 0, function* () {
                let n = null;
                do {
                    let o = v.default.getConfigInfo("ad", "enable");
                    if (0 === o) {
                        m.information("获取到的配置中信息，不显示广告 enable = ", o);
                        break
                    }
                    if (null === e || void 0 === e) break;
                    let r = `${C()}/api/adp/get`, s = null, d = "";
                    d = void 0 === i || null === i || !1 === i ? "" : yield l();
                    let u = yield h({
                        devicId: y.getPeerID(),
                        identity: d,
                        isAll: 1,
                        positionId: e,
                        shownOrderId: t,
                        v: k
                    });
                    m.information("getAdDataAw:", r, u);
                    try {
                        null !== (s = yield a.default({
                            method: "post",
                            url: r,
                            data: u
                        })) && void 0 !== s && 200 === s.status && void 0 !== s.data && null !== s.data && "" !== s.data && (n = s.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0);
                return n
            })
        }, e.getHotWordsAw = function (e = 1, t = !0) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                do {
                    yield v.default.isInitedAw();
                    let i = v.default.getConfigInfo("ad", "hotwordsEnable");
                    if (0 === i) {
                        m.information("获取到的配置中信息，不显示热词 enable = ", i);
                        break
                    }
                    let n = `${C()}/api/adp/hotword`, o = null, r = yield h({count: e});
                    m.information("getHotWordsAw:", n, r);
                    try {
                        null !== (o = yield a.default({
                            method: "get",
                            url: n + "?" + r
                        })) && void 0 !== o && 200 === o.status && void 0 !== o.data && null !== o.data && "" !== o.data && (t = o.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0);
                return t
            })
        }, e.statServer = function (e, t, o) {
            return n(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 n = {positionId: e, orderId: t, statType: o, statValue: 1}, r = [];
                    r.push(n);
                    let s = {
                        appId: T,
                        callId: Date.now(),
                        guid: y.getPeerID(),
                        identity: "",
                        items: JSON.stringify(r),
                        positionId: e,
                        v: k
                    };
                    s.sig = i(s);
                    let l = "";
                    Object.keys(s).forEach(e => {
                        let t = s[e];
                        l = "" === l ? `${e}=${encodeURIComponent(t)}` : `${l}&${e}=${encodeURIComponent(t)}`
                    });
                    let d = `${C()}/api/adp/addStat`, u = null;
                    m.information("statServer:", d, l);
                    try {
                        null !== (u = yield a.default({
                            method: "post",
                            url: d,
                            data: l
                        })) && void 0 !== u && 200 === u.status && void 0 !== u.data && null !== u.data && "" !== u.data && m.information(u.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 n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    d.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e(!0)
                    })
                })
            })
        }, e.loadScene = function (e) {
            return n(this, void 0, void 0, function* () {
                m.information("loadScene enter");
                let t = null, i = o.join(e, "index.js");
                return (yield s.FileSystemAWNS.existsAW(i)) && (t = require(i)), m.information("loadScene leave ", t), t
            })
        }, e.execute = function (e, t, i) {
            let n = 0;
            do {
                let a = t;
                if (null !== a && void 0 !== a && "" !== a || (a = i), null === a || void 0 === a || "" === a) break;
                if (e === c.AdCommonNS.OpenType.tab) {
                    f.client.callServerFunction("OpenNewTab", a).catch();
                    break
                }
                if (e === c.AdCommonNS.OpenType.app) {
                    let t = "file://";
                    if (a.indexOf(t) < 0) null !== i && void 0 !== i && "" !== i && f.client.callServerFunction("OpenNewTab", i).catch(); else {
                        let r = a.substring(t.length);
                        r = o.join(__rootDir, `../../../${r}`), n = y.shellExecute(0, "open", r, "", "", "SW_SHOW"), m.information("execute:", e, r, n), n <= 32 && null !== i && void 0 !== i && "" !== i && f.client.callServerFunction("OpenNewTab", i).catch()
                    }
                    break
                }
                if (e === c.AdCommonNS.OpenType.download) {
                    let e = [];
                    e.push(a), p.ThunderNewTask.createPreNewTaskWindow(e);
                    break
                }
                e === c.AdCommonNS.OpenType.defaultBrowser ? n = y.openURLByDefault(a) : e === c.AdCommonNS.OpenType.ieBrowser && (n = y.openURLByIEorDefault(a))
            } while (0);
            return n
        }
    }(t.AdHelperNS || (t.AdHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(18), a = i(4), o = i(113), r = i(114);
    !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() {
                n.ipcMain.on(r.CommonIPCMessage.msgIPCSendToMain, (e, t) => {
                    let i = void 0;
                    do {
                        if (a.isNullOrUndefined(t)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let n = t.msg.name;
                        if (this.isIPCModuleIntervalMsg(n)) {
                            o.information(`IPC module interval msg : ${n}`);
                            let a = this.handleIPCModuleIntervalMsg(e.sender, t);
                            if (i = a[1], !a[0]) break;
                            o.information("need to dispatch msg:" + n)
                        }
                        a.isNullOrUndefined(i) ? i = this.NotifyListener(t) : this.NotifyListener(t)
                    } while (0);
                    a.isNullOrUndefined(i) || (e.returnValue = i), t = null
                })
            }

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

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

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

            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, i = e.msg.name;
                if (this.listeners.has(i)) {
                    let n = this.listeners.get(i), a = !0;
                    for (let i of n) a ? (a = !1, t = i(e)) : i(e)
                }
                return t
            }
        }

        e.Communicator = t
    }(t.CommonIPCBase || (t.CommonIPCBase = {}))
}, function (e, t) {
    (function () {
        var t, i, n, a, o, r, s = [].slice, l = {}.hasOwnProperty;
        t = function () {
            var e, t, i, n, 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, i = o.length; e < i; e++) if (null != (n = o[e])) for (t in n) l.call(n, t) && (r[t] = n[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)
        }, i = function (e) {
            return a(Array.isArray) ? Array.isArray(e) : "[object Array]" === Object.prototype.toString.call(e)
        }, n = function (e) {
            var t;
            if (i(e)) return !e.length;
            for (t in e) if (l.call(e, t)) return !1;
            return !0
        }, r = function (e) {
            var t, i;
            return o(e) && (i = Object.getPrototypeOf(e)) && (t = i.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 = i, e.exports.isEmpty = n, e.exports.isPlainObject = r
    }).call(this)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(101), r = i(137), s = i(342), l = i(0), d = i(4), u = i(27), c = i(36), h = i(25), f = i(11),
        g = i(24), p = i(10), v = i(46), m = i(7), y = l.default.getLogger("Thunder.MainRenderer.TabsBrowser"),
        k = m.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let T = [".xunlei.com", "h5-pccloud.onethingpcs.com"];
    var w;
    !function (e) {
        e[e.XDAS = 0] = "XDAS", e[e.Chromium = 1] = "Chromium", e[e.IE = 2] = "IE", e[e.Other = 3] = "Other"
    }(w = t.TabType || (t.TabType = {}));

    class C extends c.NativeCall {
        constructor() {
            super(), this.canGoForward = !1, this.canGoBack = !1, this.url = "", this.curUrl = "", this.iconUrl = "", this.originalUrl = "", this.isErrorPage = !1, this.isLoadingPage = !0, this.hideUI = !1, this.state = "loading", this.extData = "", this.pinned = !1, y.information("tab construct"), this.beforeCloseExtra = null, y.information("init beforeClose null", this.beforeCloseExtra)
        }

        initTab(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    if (d.isNullOrUndefined(e)) {
                        y.warning(e);
                        break
                    }
                    this.type = e, this.originalUrl = t.url, this.curUrl = t.url || "", this.name = t.name, this.index = t.index, this.showUrl = !("showUrl" in t) || t.showUrl, this.hideUI = "hideUI" in t && t.hideUI, this.extData = t.extData, this.hideUI && (this.showUrl = !1), void 0 !== t.pinned && "boolean" == typeof t.pinned && (this.pinned = t.pinned), e === w.XDAS ? n = this.xdasTabInit(t) : e === w.Chromium ? n = yield this.chromiumTabInit(t, i) : e === w.IE && (n = this.ieTabInit(t))
                } while (0);
                return n
            })
        }

        navigate(e) {
            let t = !1;
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                this.browser.navigate(e, "", "", !1), this.isDefaultTab() || this.setShowUrl(!0), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e)) {
                    y.warning(e);
                    break
                }
                this.state = "loading", this.browser.refresh()
            } while (0);
            return !1
        }

        stop() {
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                this.browser.stop()
            } while (0);
            return !1
        }

        goForward() {
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                this.browser.goForward()
            } while (0);
            return !1
        }

        goBack() {
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                this.browser.goBack()
            } while (0);
            return !1
        }

        showDevTool(e) {
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e)) {
                    y.warning(e);
                    break
                }
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (this.type !== w.Chromium) {
                    y.warning(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e)) {
                    y.warning(e);
                    break
                }
                this.browser.destroy(e), this.browser.removeAllListeners()
            } while (0);
            return !1
        }

        viewSource() {
            do {
                if (this.type !== w.Chromium) break;
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                this.browser.viewSource()
            } while (0);
            return !1
        }

        attachListener(e) {
            do {
                if (this.type !== w.Chromium) break;
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e) || d.isNullOrUndefined(e.eventName) || d.isNullOrUndefined(e.listener)) {
                    y.warning(e);
                    break
                }
                let t = [{eventName: e.eventName, listener: e.listener}];
                this.attachBrowserEvents(this.browser, t)
            } while (0);
            return 0
        }

        detachListener(e) {
            let t = !1;
            do {
                if (d.isNullOrUndefined(e)) {
                    y.warning(e);
                    break
                }
                if (d.isNullOrUndefined(e.eventName) || "" === e.eventName) {
                    y.warning(e.eventName);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                if (this.type !== w.Chromium) break;
                this.browser.removeListener(e.eventName, e.listener), t = !0
            } while (0);
            return t
        }

        getTabType() {
            return this.type
        }

        getTitle() {
            return this.title
        }

        getOriginalUrl() {
            return this.originalUrl
        }

        getPinned() {
            return this.pinned
        }

        getBeforeCloseExtra() {
            return this.beforeCloseExtra
        }

        setBeforeCloseExtra(e) {
            this.beforeCloseExtra = e
        }

        getCurUrl() {
            return this.curUrl
        }

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

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

        setCurUrl(e) {
            return !d.isNullOrUndefined(e) && (this.curUrl = e, !0)
        }

        addExtData(e) {
            if (d.isNullOrUndefined(e)) return !1;
            let t = JSON.parse(e), i = JSON.parse(this.extData);
            return Object.assign(i, t), this.extData = JSON.stringify(i), !0
        }

        setExtData(e) {
            return !d.isNullOrUndefined(e) && (this.extData = e, !0)
        }

        getExtData() {
            return this.extData || ""
        }

        getSearchFrom() {
            let e = "";
            do {
                if (!this.extData) break;
                let t = null;
                try {
                    t = JSON.parse(this.extData)
                } catch (e) {
                }
                t && t.search_from && (e = t.search_from)
            } while (0);
            return e
        }

        getBrowser() {
            return this.browser
        }

        attachListeners(e) {
            do {
                if (d.isNullOrUndefined(this.browser)) {
                    y.warning(this.browser);
                    break
                }
                this.type === w.Chromium && this.attachBrowserEvents(this.browser, e)
            } while (0)
        }

        callNativeFunctionCallback(e, t, ...i) {
            let n = !1;
            do {
                if (d.isNullOrUndefined(t)) {
                    y.warning(t);
                    break
                }
                if (i && [1, 2, 3, 4].includes(i[0])) {
                    let e = null === g.default.getJsonData() ? 1 : 0;
                    p.XLStatNS.trackEvent("business", "native_Interface_invoke_fail", "", 0, 0, 0, 0, `err_code=${i[0]},config_empty=${e}`)
                }
                if (this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.warning(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(u.NativeCallHostModule.nativeCallHost, [e].concat(t, i)), n = !0
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.warning(this.browser);
                        break
                    }
                    this.browser.callJsFunctionById(t, ...i), n = !0
                }
            } while (0);
            return n
        }

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

        fireEvent(e, ...t) {
            let i = !1;
            do {
                if (d.isNullOrUndefined(e) || "" === e) {
                    y.warning(e);
                    break
                }
                if (this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.warning(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent.apply(u.NativeCallHostModule.nativeCallHost, [e].concat(t)), i = !0
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.warning(this.browser);
                        break
                    }
                    this.browser.fireEvent(e, ...t), i = !0
                }
            } while (0);
            return i
        }

        onJsCallNativeFunction(e, t, i, n) {
            let a = !1;
            do {
                if (d.isNullOrUndefined(e) && y.warning(e), d.isNullOrUndefined(t) || "" === t) {
                    y.warning(t);
                    break
                }
                if (d.isNullOrUndefined(c.NativeCall.nativeFunctionContainer)) {
                    y.warning(c.NativeCall.nativeFunctionContainer);
                    break
                }
                let o = c.NativeCall.nativeFunctionContainer.filter(e => t === e.functionName), r = void 0,
                    s = h.NativeFunctionErrorCode.Success, l = this.browser && n && n.length > 0 ? n[0] : void 0;
                y.information("frameurl", l, t, ...n), this.browser && (n = n && n.length > 0 ? n.slice(1) : n), y.information("curUrl:", this.curUrl);
                let f = g.default.getConfigInfo("nativeFunc", "domains") || T,
                    p = this.isUrlInDomains(this.curUrl, f, l);
                if (!p) {
                    let e = g.default.getConfigInfo("nativeFunc", "limitDomains");
                    if (e) for (let i = 0; i < e.length; ++i) {
                        let n = e[i];
                        if (n && n.domains && n.funcs && n.funcs.includes(t) && (p = this.isUrlInDomains(this.curUrl, n.domains, l))) break
                    }
                }
                if (!p && !d.isNullOrUndefined(this.browser) && this.type === w.Chromium) {
                    s = h.NativeFunctionErrorCode.NotAllowed, this.browser.callJsFunctionById(i, s);
                    break
                }
                if (d.isNullOrUndefined(o) || 0 === o.length || d.isNullOrUndefined(o[0].nativeFunc)) {
                    if (s = h.NativeFunctionErrorCode.FunctionUnExist, d.isNullOrUndefined(i)) {
                        a = !0;
                        break
                    }
                    if (this.type === w.XDAS) {
                        if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                            y.warning(u.NativeCallHostModule.nativeCallHost);
                            break
                        }
                        u.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(u.NativeCallHostModule.nativeCallHost, [e].concat(i, s, r))
                    } else if (this.type === w.Chromium) {
                        if (d.isNullOrUndefined(this.browser)) {
                            y.warning(this.browser);
                            break
                        }
                        this.browser.callJsFunctionById(i, s)
                    }
                } else o[0].nativeFunc(this, e, i, n)
            } while (0);
            return a
        }

        onJsCheckNativeFunction(e, t, i) {
            do {
                if (d.isNullOrUndefined(e) && y.warning(e), d.isNullOrUndefined(i)) break;
                if (d.isNullOrUndefined(t) || "" === t) {
                    y.warning(t);
                    break
                }
                if (d.isNullOrUndefined(c.NativeCall.nativeFunctionContainer)) {
                    y.warning(c.NativeCall.nativeFunctionContainer);
                    break
                }
                let n = c.NativeCall.nativeFunctionContainer.filter(e => t === e.functionName),
                    a = h.NativeFunctionErrorCode.Success;
                if ((d.isNullOrUndefined(n) || d.isNullOrUndefined(n[0]) || d.isNullOrUndefined(n[0].nativeFunc)) && (a = h.NativeFunctionErrorCode.FunctionUnExist, y.warning(n)), this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.warning(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.callJsFunctionById(e, i, a)
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.warning(this.browser);
                        break
                    }
                    this.browser.callJsFunctionById(i, a)
                }
            } while (0);
            return !1
        }

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

        setShowUrl(e) {
            this.showUrl = e
        }

        xdasTabInit(e) {
            return d.isNullOrUndefined(e) && (e = {}), void 0 === e.title ? this.title = C.defaultXDASTitle : this.title = e.title, this.state = "loaded", this.isLoadingPage = !1, !0
        }

        trackBrowserEvent(e, t, i = "") {
            do {
                if (!t || "" === t) break;
                let n = v.parse(t);
                if (n.host && n.host.indexOf(".xunlei.com") < 0) break;
                i = i + (i.length > 0 ? "," : "") + "url=" + encodeURIComponent(t), p.XLStatNS.trackEvent("new_tab", e, "", 0, 0, 0, 0, i)
            } while (0)
        }

        chromiumTabInit(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                if (this.browser) return !0;
                d.isNullOrUndefined(e) && (e = {});
                do {
                    d.isNullOrUndefined(e.url) && (e.url = C.defaultBrowserUrl, this.curUrl = e.url), r.BrowserSupportNS.browserIsInitFinish() || (this.trackBrowserEvent("browser_load_init", e.url), yield r.BrowserSupportNS.initTBC()), 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);
                    let n = yield f.asyncRemoteCall.getCurrentWindow();
                    if (void 0 === e.parentHwnd) if (e.isFromPopup) e.parentHwnd = t.target.getParentWindowHandle(); else {
                        let t = (yield n.getNativeWindowHandle()).readUIntLE(0, 4);
                        e.parentHwnd = t
                    }
                    void 0 === e.rect && (e.rect = yield s.BrowserWindowNS.getBrowserWindowPosition(k, n)), y.information("stroe chromiumTabInit param", e), this.trackBrowserEvent("browser_load_create", e.url);
                    let a = new o.Browser;
                    if (a.init({
                        rect: e.rect,
                        parent_window: e.parentHwnd,
                        is_popup: e.isFromPopup,
                        url: e.url,
                        visible: !(!0 === e.hideUI)
                    }), d.isNullOrUndefined(a)) {
                        y.warning(a);
                        break
                    }
                    e.isFromPopup && t && (t.returnValue = a), this.browser = a, a.addCustomProtocol("ed2k://"), a.addCustomProtocol("thunder://"), a.addCustomProtocol("magnet:?"), a.registerHotKey(116, 4), a.registerHotKey(116, 0), a.registerHotKey(84, 4), a.registerHotKey(82, 4), a.registerHotKey(87, 4), this.attachBrowserEvents(a, e.eventListeners), i = !0
                } while (0);
                return i
            })
        }

        attachBrowserEvents(e, t) {
            do {
                if (d.isNullOrUndefined(e)) {
                    y.warning(e);
                    break
                }
                if (this.type === w.Chromium) for (let i of t) if (!(d.isNullOrUndefined(i) || d.isNullOrUndefined(i.eventName) || d.isNullOrUndefined(i.listener))) switch (i.eventName) {
                    case"init-done":
                        e.on("init-done", i.listener);
                        break;
                    case"before-nav":
                        e.on("before-nav", i.listener);
                        break;
                    case"title-change":
                        e.on("title-change", i.listener);
                        break;
                    case"favicon-url-change":
                        e.on("favicon-url-change", i.listener);
                        break;
                    case"address-change":
                        e.on("address-change", i.listener);
                        break;
                    case"new-browser-popup":
                        e.on("new-browser-popup", i.listener);
                        break;
                    case"open-url-from-tab":
                        e.on("open-url-from-tab", i.listener);
                        break;
                    case"close":
                        e.on("close", i.listener);
                        break;
                    case"loading-state-change":
                        e.on("loading-state-change", i.listener);
                        break;
                    case"load-start":
                        e.on("load-start", i.listener);
                        break;
                    case"load-end":
                        e.on("load-end", i.listener);
                        break;
                    case"load-error":
                        e.on("load-error", i.listener);
                        break;
                    case"destroyed":
                        e.on("destroyed", i.listener);
                        break;
                    case"custom-protocol-execution":
                        e.on("custom-protocol-execution", i.listener);
                        break;
                    case"before-download":
                        e.on("before-download", i.listener);
                        break;
                    case"before-context-menu":
                        e.on("before-context-menu", i.listener);
                        break;
                    case"context-menu-command":
                        e.on("context-menu-command", i.listener);
                        break;
                    case"got-focus":
                        e.on("got-focus", i.listener);
                        break;
                    case"hotkey":
                        e.on("hotkey", i.listener);
                        break;
                    case"call-native-func":
                        e.on("call-native-func", i.listener);
                        break;
                    case"check-native-func":
                        e.on("check-native-func", i.listener)
                }
            } while (0)
        }

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

        isUrlInDomains(e, t, i) {
            let n = !1;
            for (let a = 0; a < t.length; ++a) if (e.includes(t[a]) || i && i.includes(t[a])) {
                n = !0;
                break
            }
            return n
        }
    }

    C.defaultXDASTitle = "下载", C.defaultBrowserTitle = "正在加载...", C.defaultBrowserUrl = "http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", C.defaultEventList = [], C.tempBrowser = null, t.Tab = C
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(0), r = i(19), s = i(2), l = i(23), d = i(7), u = i(17), c = i(9), h = i(14), f = i(73),
        g = d.default(s.join(__rootDir, "../bin/ThunderHelper.node")), p = o.default.getLogger("config-remote-global");
    const v = new class {
        constructor() {
            this.configJsonData = null, this.eventEmitter = new r.EventEmitter, this.inited = !1, this.token = 0
        }

        getBaseConfigUrl() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    c.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = c.ConfigNS.getValue("ConfigRemoteGlobal", "TestServer", !1);
                        e(t ? "http://alpha-conf-m-ssl.xunlei.com/external/e095b1fb-6807-11e9-80e6-0242ac160003?" : "https://conf-m-ssl.xunlei.com/external/e095b1fb-6807-11e9-80e6-0242ac160003?")
                    })
                })
            })
        }

        getUpdateInterval() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    c.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = c.ConfigNS.getValue("ConfigRemoteGlobal", "Interval", 864e5);
                        e(t)
                    })
                })
            })
        }

        getConfigUrl() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.getBaseConfigUrl(), t = yield l.LoginHelperNS.loginHelper.getUserInfoAw("userid"),
                    i = {};
                t && "" !== t && (i["user-id"] = t);
                let n = this.getThunderVersion();
                if (n && "" !== n) {
                    i["version-name"] = n;
                    let e = n.split(".");
                    e && 4 === e.length && (i["version-code"] = e[3])
                }
                let a = g.getPeerID();
                if (a && "" !== a) {
                    i["device-id"] = a;
                    let e = f.createHash("sha256");
                    e.update(a);
                    let t = e.digest("hex");
                    t && (a = t.toUpperCase()), i["peer-id"] = a
                }
                let o = g.getChannelID();
                o && "" !== o && (i.channel = o), i["app-type"] = "pc";
                let r = (new Date).getTimezoneOffset();
                i["time-zome"] = (r / 60).toString(), i.language = window.navigator.language;
                let s = g.getOSVersion();
                i.os = s;
                let d = !0;
                for (let t in i) d ? d = !1 : e += "&", e += t + "=" + i[t];
                return p.information("getConfigUrl url:", e), e
            })
        }

        getThunderVersion() {
            let e = s.join(__rootDir, "../../Thunder.exe");
            return g.getFileVersion(e)
        }

        requestConfig() {
            return n(this, void 0, void 0, function* () {
                let e = null, t = null;
                try {
                    a.default.defaults.adapter = i(21);
                    let e = yield this.getConfigUrl();
                    t = yield a.default.get(e, {timeout: 1e4}), p.information("url: ", e, ", response:", t)
                } catch (e) {
                    p.warning(e)
                }
                return t && 200 === t.status && t.data && "" !== t.data && "ok" === t.data.result && t.data.values && (e = t.data.values), e
            })
        }

        updateConfig() {
            return n(this, void 0, void 0, function* () {
                let e = ++this.token, t = yield this.requestConfig();
                e === this.token && (this.configJsonData = t, this.inited ? this.eventEmitter.emit("OnRemoteGlobalConfigUpdated", null !== this.configJsonData && void 0 !== this.configJsonData) : (this.inited = !0, this.eventEmitter.emit("OnRemoteGlobalConfigLoaded", null !== this.configJsonData && void 0 !== this.configJsonData)))
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                u.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", this.updateConfig.bind(this)), u.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", this.updateConfig.bind(this));
                let e = this.token, t = yield this.requestConfig();
                e !== this.token || this.inited || (this.configJsonData = t, this.inited = !0, this.eventEmitter.emit("OnRemoteGlobalConfigLoaded", null !== this.configJsonData && void 0 !== this.configJsonData));
                let i = yield this.getUpdateInterval();
                i > 0 && setInterval(() => {
                    p.information("time out updateConfig"), this.updateConfig().catch()
                }, i)
            })
        }

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

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

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

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

        isInited() {
            return this.inited
        }

        isInitedAW() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.inited ? e(!0) : this.eventEmitter.once("OnRemoteGlobalConfigLoaded", t => {
                        e(!0)
                    })
                })
            })
        }
    };
    t.default = v
}, function (e, t) {
    e.exports = require("crypto")
}, function (e, t) {
    e.exports = require("zlib")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(62), o = i(22), r = i(5), s = i(65), l = i(0).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 u {
        constructor() {
            this.lastBirdKey = []
        }

        static GetInstance() {
            return u.instance || (u.instance = new u), u.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 i = 0; i < e.length; i++) e[i] === this.lastBirdKey[i] && t++;
            return t === e.length
        }
    }

    function c(e, t, i, n) {
        let o = {url: "/dlj_create", data: {url: e, "Chat-Version": 2}, method: "post"};
        return "string" == typeof i && (o.data.type = i), t && (o.data.uid = t), "string" == typeof n && (o.data.passwd = n), a.fetchSlRes(o)
    }

    function h(e, t, i) {
        return c(e, t, i)
    }

    u.instance = null, t.encodeBirdKey = c, t.setBirdKeyPriority = function (e, t, i = !1) {
        return a.fetchSlRes({url: "/dlj/option", data: {url: e, priority: i, "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 n(this, void 0, void 0, function* () {
            let t = yield r.client.callServerFunction("GetThunderVersion");
            return a.fetchSlRes({
                url: "/dlj/bird_key",
                data: {_h: {"Chat-Version": 2, "Version-Name": t}, key: e.toLowerCase()},
                method: "get"
            })
        })
    }, t.openBirdKeyEncodeDialog = function (e, t) {
        return n(this, void 0, void 0, function* () {
            let i = function (e, t) {
                l.information("弹出生成迅雷口令面板,begin,url=", e), o.MessageBox.custom("BirdKeyShow", {
                    showType: d.ShowUI_Creating,
                    url: e,
                    statData: t
                }, {modal: !1}).catch(e => {
                    l.information("弹出生成迅雷口令面板,error=", e)
                }), l.information("弹出生成迅雷口令面板,end")
            };
            l.information("调用promise IsLogined 函数 Begin");
            let a = yield r.client.callServerFunction("IsLogined");
            l.information("调用promise IsLogined 函数 End, isLogined=", a), a ? i(e, t) : h(e).then(a => n(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 n = yield s.default(!1, !0, "birdkey");
                    if (!n || "" === n) return;
                    i(e, t)
                } else i(e, t);
                return Promise.resolve()
            })).catch(e => {
                l.information("调用queryBirdKeyInfo 接口异常 error=", e)
            })
        })
    }, t.openBirdKeyDecodeDialog = function (e, t) {
        o.MessageBox.custom("BirdKeyShow", {
            showType: d.ShowUI_Decoding,
            birdkeyChars: e,
            statData: t
        }, {modal: !1}).catch()
    }, t.saveVestUrlToConfig = function (e, t) {
        let i = t ? "vestURL" : "commonUrl";
        r.client.callServerFunction("GetValue", "BirdKeyVest", i, []).then(t => {
            let n = t || [];
            "" !== e && -1 === n.join().indexOf(e) && (n.push(e), r.client.callServerFunction("SetValue", "BirdKeyVest", i, n).catch())
        }).catch()
    }, t.isVestUrl = function (e, t) {
        return n(this, void 0, void 0, function* () {
            let i = yield r.client.callServerFunction("GetValue", "BirdKeyVest", t, []);
            return "" !== e && -1 !== (i || []).join().indexOf(e)
        })
    }, t.getBirdKeyMgr = function () {
        return u.GetInstance()
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(45), o = i(2), r = i(0), s = i(7), l = i(6), d = i(14), u = i(9), c = i(574),
        h = r.default.getLogger("BHOConfig"), f = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

    class g extends u.Config {
        init(e) {
            return n(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(d.NodeEventMesssageNS.eventBHOConfigInitFinished)
                        }
                    } else {
                        let t = o.dirname(e);
                        yield l.FileSystemAWNS.mkdirsAW(t), this.isInit = !0, this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventBHOConfigInitFinished)
                    }
                }
            })
        }

        save() {
            return n(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, i, n) {
            this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventBHOConfigValueChanged, e, t, i, n)
        }

        attachListener(e, t) {
            do {
                if (e === d.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 n(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;.dmg;.msu;.bz2;"
        }, e.getDefaultFilterSitesForUI = function () {
            return "*.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*.webmail30.189.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"
        }, e.save = function () {
            return n(this, void 0, void 0, function* () {
                yield p.save()
            })
        }, e.saveSync = function () {
            p.saveSync()
        }, e.getValue = function (e, t, i) {
            return p.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            p.setValue(e, t, i)
        }, 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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(3), r = i(34);
    let s = null;
    const l = i(0).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 i = 0; i < e.length; i++) if (e.charCodeAt(i) > 127) {
                    t = !1;
                    break
                }
            } else t = !1; else t = !1;
            return t
        }

        function d(e, i = !0) {
            i = void 0 === i || i;
            let n = !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 (!i) break;
                    t(a) && (n = !0)
                } else n = !0;
                n || a.match(/^file:\/\/\//) && (n = !0)
            } while (0);
            return n
        }

        e.isMagnetCode = t, e.fixMagnetUrl = function (e) {
            let i = "";
            do {
                if ("string" != typeof e || "" === e) break;
                if ("" === (i = e.trim())) break;
                r.ThunderHelper.getTaskTypeFromUrl(i) === o.DownloadKernel.TaskType.Unkown && t(i) && (i = "magnet:?xt=urn:btih:" + i)
            } while (0);
            return i
        }, e.isUrlValid = d, e.isBirdKey = function (e) {
            return e ? e.match(/#[Xx]([0-9a-zA-Z])+#/g) : null
        }, e.isYunFetchBackTask = function (e) {
            return e ? e.match(/#\$ThunderPanFetchBack:([\s\S]+)\$#/) : null
        }, e.isCustomProtocol = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                null === s && (s = yield Promise.resolve().then(() => i(46)));
                let n = s.parse(e);
                do {
                    if (null === n || void 0 === n) break;
                    let e = n.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 i = e.trim();
                if ("" === i) break;
                let n = r.ThunderHelper.getTaskTypeFromUrl(i);
                if (n === o.DownloadKernel.TaskType.P2sp || n === 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 u = ".edu;.gov;.mil;.hk;.tw;.com.tw;.com.tw;.aero;.biz;.coop;.info;.museum;.name;.pro;";
        u += ".com;.cn;.xin;.net;.top;.xyz;.wang;.shop;.site;.club;.cc;.fun;.online;.biz;.red;.link;.ltd;.mobi;.info;.org;", u += ".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 = (u += ".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 i = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(e);
                if (null === i) break;
                l.information("url parse result ", i), t = {};
                let n = ["url", "scheme", "slash", "host", "port", "path", "query", "hash"];
                for (let e = 0; e < n.length; e++) t[n[e]] = i[e];
                l.information("url parse", t)
            } while (0);
            return t
        }

        e.isUsualDomainSuffix = h, e.urlParse = f, e.isUrl = function (e) {
            let t = !1, i = e;
            do {
                if (void 0 === e || null === e) break;
                if (d(e, !1)) {
                    t = !0;
                    break
                }
                if (e.trim().match(/^file:\/\/\//)) {
                    t = !0;
                    break
                }
                let n = f(e);
                if (null === n) {
                    l.information("url parse failed");
                    break
                }
                if (void 0 === n.host || null === n.host) break;
                if (void 0 !== n.scheme) {
                    t = !0;
                    break
                }
                let o = n.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 === n.scheme && void 0 !== n.port && (i = `http://${e}`);
                    break
                }
                if (n.host.match(/\.{2,}/)) {
                    l.information("url parse has multi dot"), t = !1;
                    break
                }
                let r = a.extname(n.host);
                if ("" === r) break;
                if (h(r)) {
                    t = !0;
                    break
                }
            } while (0);
            return l.information("url parse isUrl", t), {ret: t, suggest: i}
        }, 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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(0), r = i(13), s = o.default.getLogger("MenuSkinNS");
    !function (e) {
        e.setStyle = function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (s.information("setStyle", e, t), null !== e) {
                    const {WindowPreferenceNS: e} = yield Promise.resolve().then(() => i(597));
                    let t = {windowPreference: e.getWindowPreference()};
                    s.information("skinOpts", t)
                }
            })
        }, e.popEditableDefaultContextMenu = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let i = yield a.asyncRemoteCall.getCurrentWebContents();
                i.once("context-menu", (o, l) => n(this, void 0, void 0, function* () {
                    if (s.verbose(o), l.isEditable) {
                        let n = [{
                            label: "撤销", enabled: l.editFlags.canUndo, click: () => {
                                i.undo()
                            }
                        }, {type: "separator"}, {
                            label: "剪切", enabled: l.editFlags.canCut, click: () => {
                                i.cut()
                            }
                        }, {
                            label: "复制", enabled: l.editFlags.canCopy, click: () => {
                                i.copy()
                            }
                        }, {
                            label: "粘贴",
                            enabled: l.editFlags.canPaste && r.ThunderUtil.isClipboardTextFormatAvailable(),
                            click: () => {
                                i.paste()
                            }
                        }, {
                            label: "删除", enabled: l.editFlags.canDelete, click: () => {
                                i.delete()
                            }
                        }, {type: "separator"}, {
                            label: "全选", enabled: l.editFlags.canSelectAll, click: () => {
                                i.selectAll()
                            }
                        }];
                        if (void 0 !== e && "function" == typeof e) {
                            let i = e(l);
                            void 0 !== i && i.length > 0 && (void 0 === t ? t = n.length : (t < 0 && (t = n.length + 1 + t) < 0 && (t = 0), t > n.length && (t = n.length)), n.splice(t, 0, ...i))
                        }
                        let o = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(n),
                            s = yield a.asyncRemoteCall.getCurrentWindow();
                        yield o.popup({window: s})
                    }
                }))
            })
        }
    }(t.MenuSkinNS || (t.MenuSkinNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0).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;
                n.information("消息队列增加消息", this.queue);
                for (let i = 0; i < this.queue.length; i++) if (this.queue[i].priority >= e.priority) {
                    t = !0, this.queue.splice(i, 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 && (n.information("消息队列弹出消息", this.queue), e.callback())
                }
            }

            clearQueuesByName(e) {
                let t = [];
                for (let i = 0; i < this.queue.length; i++) this.queue[i].name !== e && t.push(this.queue[i]);
                this.queue = t
            }

            isEmpty() {
                return 0 === this.queue.length
            }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(19), r = i(16), s = i(72), l = a.default.getLogger("adplatform-manager");
    var d, u;
    !function (e) {
        e.FunctionalHigh = "pack_using", e.Functional = "pack_before", e.Renew = "renew", e.Exactly = "exactly", e.AdPlatform = "adplatform"
    }(d = t.AdPlatformType || (t.AdPlatformType = {})), function (e) {
        e[e.Unknown = 0] = "Unknown", e[e.Click = 1] = "Click", e[e.Priority = 2] = "Priority", e[e.Expired = 3] = "Expired"
    }(u = t.AdPlatformCloseReason || (t.AdPlatformCloseReason = {}));
    !function (e) {
        const t = new class extends o.EventEmitter {
            constructor() {
                super(), this.adPriority = {
                    [d.AdPlatform]: 4,
                    [d.Exactly]: 3,
                    [d.Renew]: 2,
                    [d.Functional]: 1,
                    [d.FunctionalHigh]: 0
                }, this.showLimit = {
                    [d.FunctionalHigh]: 3,
                    [d.Functional]: 3,
                    [d.Renew]: 1,
                    [d.Exactly]: 1,
                    [d.AdPlatform]: 1
                }, this.adPlatformWaitOrder = null, this.currentOrder = null, this.inited = !1
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (this.inited) break;
                        this.inited = !0, r.server.registerFunctions({
                            EnqueueAdPlatform: (e, t, ...i) => this.tryShow(i[0], i[1], i[2], i[3]),
                            CloseAdPlatform: (e, t, ...i) => {
                                let n = !1;
                                do {
                                    let e = i[0];
                                    if (e === d.AdPlatform) {
                                        l.information("广告后台小黄条不能通过接口关闭");
                                        break
                                    }
                                    if (!this.currentOrder) {
                                        l.information("当前无广告订单展示");
                                        break
                                    }
                                    let t = i[1];
                                    if (e !== this.currentOrder.adType || this.currentOrder.data.msgid !== t) {
                                        l.information("当前展示的小黄条和关闭目标不一致");
                                        break
                                    }
                                    let a = void 0 === i[2] ? u.Expired : i[2];
                                    r.server.fireClientEvent("OnAdPlatformClose", e, t, a), n = !0
                                } while (0);
                                return n
                            }
                        }), yield s.default.isInitedAW();
                        let e = s.default.getConfigValue("vip", "xht");
                        e && e.hasOwnProperty(d.AdPlatform) && e.hasOwnProperty(d.Exactly) && e.hasOwnProperty(d.Renew) && e.hasOwnProperty(d.Functional) && e.hasOwnProperty(d.FunctionalHigh) && (this.adPriority = Object.assign({}, e))
                    } while (0)
                })
            }

            tryShow(e, t, i, n) {
                let a = !1;
                do {
                    if (l.information("tryShow", e, t), !this.adPriority.hasOwnProperty(e)) {
                        l.information("无法识别的来源");
                        break
                    }
                    let o = this.adPriority[e];
                    if (this.showLimit[e] <= 0) {
                        l.information("超过限制次数", e);
                        break
                    }
                    if (!this.currentOrder) {
                        l.information("当前小黄条没有任何展示内容，可展示", e), this.currentOrder = {
                            adType: e,
                            data: t,
                            showCallback: i,
                            closeCallback: n
                        }, this.showImmediately(), a = !0;
                        break
                    }
                    if (this.adPriority[this.currentOrder.adType] < o) {
                        e !== d.AdPlatform || this.adPlatformWaitOrder ? l.information("当前展示优先级更高，无法展示，返回") : (l.information("当前展示优先级更高，无法展示，广告后台订单等待"), this.adPlatformWaitOrder = {
                            data: t,
                            showCallback: i
                        });
                        break
                    }
                    if (this.currentOrder.adType === e) {
                        l.information("同一来源试图更新数据"), this.tryUpdateOrder(e, t);
                        break
                    }
                    l.information("替换当前显示的订单"), this.close(u.Priority, void 0), this.currentOrder = {
                        adType: e,
                        data: t,
                        showCallback: i,
                        closeCallback: n
                    }, this.showImmediately(), a = !0
                } while (0);
                return a
            }

            close(e, t) {
                do {
                    if (!this.currentOrder) break;
                    this.currentOrder.closeCallback && this.currentOrder.closeCallback(e || u.Unknown, t), this.currentOrder = null, e !== u.Priority && setTimeout(() => {
                        this.pop()
                    }, 6e4)
                } while (0)
            }

            pop() {
                l.information("pop in");
                do {
                    if (this.currentOrder) break;
                    this.adPlatformWaitOrder && (this.tryShow(d.AdPlatform, this.adPlatformWaitOrder.data, this.adPlatformWaitOrder.showCallback), this.adPlatformWaitOrder = null)
                } while (0);
                l.information("pop leave")
            }

            tryUpdateOrder(e, t) {
                switch (e) {
                    case d.AdPlatform:
                        l.information("广告后台的订单信息无法更新");
                        break;
                    case d.Renew:
                    case d.Exactly:
                    case d.Functional:
                    case d.FunctionalHigh:
                        t && this.currentOrder.data.msgid === t.msgid && (this.currentOrder.data = Object.assign({}, this.currentOrder.data, t), this.emit("adplatfor_update_order", e, t))
                }
            }

            showImmediately() {
                this.currentOrder.showCallback && this.currentOrder.showCallback();
                let e = this.showLimit[this.currentOrder.adType];
                this.showLimit[this.currentOrder.adType] = e - 1, r.server.fireClientEvent("OnAdPlatformShow", this.currentOrder.adType, this.currentOrder.data)
            }
        };
        e.getInstance = function () {
            return t
        }
    }(t.AdPlatformManagerNS || (t.AdPlatformManagerNS = {}))
}, function (e, t) {
    var i,
        n = [0, 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706];
    t.getSymbolSize = function (e) {
        if (!e) throw new Error('"version" cannot be null or undefined');
        if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
        return 4 * e + 17
    }, t.getSymbolTotalCodewords = function (e) {
        return n[e]
    }, t.getBCHDigit = function (e) {
        for (var t = 0; 0 !== e;) t++, e >>>= 1;
        return t
    }, t.setToSJISFunction = function (e) {
        if ("function" != typeof e) throw new Error('"toSJISFunc" is not a valid function.');
        i = e
    }, t.isKanjiModeEnabled = function () {
        return void 0 !== i
    }, t.toSJIS = function (e) {
        return i(e)
    }
}, function (e, t, i) {
    var n = i(488), a = i(489);
    t.NUMERIC = {id: "Numeric", bit: 1, ccBits: [10, 12, 14]}, t.ALPHANUMERIC = {
        id: "Alphanumeric",
        bit: 2,
        ccBits: [9, 11, 13]
    }, t.BYTE = {id: "Byte", bit: 4, ccBits: [8, 16, 16]}, t.KANJI = {
        id: "Kanji",
        bit: 8,
        ccBits: [8, 10, 12]
    }, t.MIXED = {bit: -1}, t.getCharCountIndicator = function (e, t) {
        if (!e.ccBits) throw new Error("Invalid mode: " + e);
        if (!n.isValid(t)) throw new Error("Invalid version: " + t);
        return t >= 1 && t < 10 ? e.ccBits[0] : t < 27 ? e.ccBits[1] : e.ccBits[2]
    }, t.getBestModeForData = function (e) {
        return a.testNumeric(e) ? t.NUMERIC : a.testAlphanumeric(e) ? t.ALPHANUMERIC : a.testKanji(e) ? t.KANJI : t.BYTE
    }, t.toString = function (e) {
        if (e && e.id) return e.id;
        throw new Error("Invalid mode")
    }, t.isValid = function (e) {
        return e && e.bit && e.ccBits
    }, t.from = function (e, i) {
        if (t.isValid(e)) return e;
        try {
            return function (e) {
                if ("string" != typeof e) throw new Error("Param is not a string");
                switch (e.toLowerCase()) {
                    case"numeric":
                        return t.NUMERIC;
                    case"alphanumeric":
                        return t.ALPHANUMERIC;
                    case"kanji":
                        return t.KANJI;
                    case"byte":
                        return t.BYTE;
                    default:
                        throw new Error("Unknown mode: " + e)
                }
            }(e)
        } catch (e) {
            return i
        }
    }
}, function (e, t, i) {
    e.exports = i(58)(29)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(7).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t() {
            let e = !0;
            {
                0;
                let t = n.resolve("C:\\ETW_LOG\\log.ini");
                e = "1" === a.readINI(t, "Log", "enable")
            }
            return e
        }

        e.isDevToolsEnable = function () {
            return t()
        }, e.isLogEnable = t, e.getLogOutput = function () {
            let e = process.env.TL_OUTPUT;
            do {
                if (e && "" !== e) break;
                let t = n.resolve("C:\\ETW_LOG\\log.ini");
                e = a.readINI(t, "Log", "output")
            } while (0);
            return e
        }
    }(t.DevEnvHelperNS || (t.DevEnvHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.Invalid = -100] = "Invalid", e[e.PreOpen = -10] = "PreOpen", e[e.QueryExt = -9] = "QueryExt", e[e.DownloadTorrent = -3] = "DownloadTorrent", e[e.ParserTorrent = -2] = "ParserTorrent", e[e.GetPlayUrl = -1] = "GetPlayUrl", e[e.Ready = 0] = "Ready", e[e.Opening = 1] = "Opening", e[e.Pausing = 2] = "Pausing", e[e.Paused = 3] = "Paused", e[e.Playing = 4] = "Playing", e[e.Play = 5] = "Play", e[e.Closeing = 6] = "Closeing", e[e.Completed = 7] = "Completed", e[e.Stopped = 8] = "Stopped", e[e.Error = 9] = "Error"
    }(t.XmpMediaState || (t.XmpMediaState = {})), function (e) {
        e[e.NumberStart = 0] = "NumberStart", e[e.MediaId = 1] = "MediaId", e[e.OwnerMediaId = 2] = "OwnerMediaId", e[e.CreateTime = 3] = "CreateTime", e[e.PlayTime = 4] = "PlayTime", e[e.LastPlayTime = 5] = "LastPlayTime", e[e.Duration = 6] = "Duration", e[e.Height = 7] = "Height", e[e.Width = 8] = "Width", e[e.PreState = 9] = "PreState", e[e.State = 10] = "State", e[e.Position = 11] = "Position", e[e.LastStartPos = 12] = "LastStartPos", e[e.PlaySpeed = 13] = "PlaySpeed", e[e.SubtitleShow = 14] = "SubtitleShow", e[e.SubtitleLanguage = 15] = "SubtitleLanguage", e[e.SubtitleType = 16] = "SubtitleType", e[e.SubtitlePosition = 17] = "SubtitlePosition", e[e.SubtitleTimming = 18] = "SubtitleTimming", e[e.Subtitle3D = 19] = "Subtitle3D", e[e.Subtitle2Show = 20] = "Subtitle2Show", e[e.Subtitle2Language = 21] = "Subtitle2Language", e[e.Subtitle2Type = 22] = "Subtitle2Type", e[e.Subtitle2Position = 23] = "Subtitle2Position", e[e.Subtitle2Timming = 24] = "Subtitle2Timming", e[e.Subtitle23D = 25] = "Subtitle23D", e[e.FileSize = 26] = "FileSize", e[e.Category = 27] = "Category", e[e.Type = 28] = "Type", e[e.MediaIndex = 29] = "MediaIndex", e[e.TaskId = 30] = "TaskId", e[e.TaskStop = 31] = "TaskStop", e[e.AudioTrack = 32] = "AudioTrack", e[e.ThunderTaskId = 33] = "ThunderTaskId", e[e.ThunderTaskSubId = 34] = "ThunderTaskSubId", e[e.PlayPercent = 35] = "PlayPercent", e[e.OpenFrom = 36] = "OpenFrom", e[e.DLNA = 37] = "DLNA", e[e.transcode = 38] = "transcode", e[e.NumberEnd = 39] = "NumberEnd", e[e.StringStart = 4096] = "StringStart", e[e.Name = 4097] = "Name", e[e.Url = 4098] = "Url", e[e.PlayUrl = 4099] = "PlayUrl", e[e.Cid = 4100] = "Cid", e[e.Gcid = 4101] = "Gcid", e[e.Subtitle = 4102] = "Subtitle", e[e.Subtitle2 = 4103] = "Subtitle2", e[e.Ext = 4104] = "Ext", e[e.Played = 4105] = "Played", e[e.AudioChannel = 4106] = "AudioChannel", e[e.OutputMode = 4107] = "OutputMode", e[e.Brightness = 4108] = "Brightness", e[e.ContrastRatio = 4109] = "ContrastRatio", e[e.Saturation = 4110] = "Saturation", e[e.SubtitleSize = 4111] = "SubtitleSize", e[e.SubtitleColor = 4112] = "SubtitleColor", e[e.SubtitleFont = 4113] = "SubtitleFont", e[e.Subtitle2Size = 4114] = "Subtitle2Size", e[e.Subtitle2Color = 4115] = "Subtitle2Color", e[e.Subtitle2Font = 4116] = "Subtitle2Font", e[e.Proportion = 4117] = "Proportion", e[e.AudioTime = 4118] = "AudioTime", e[e.Rorate = 4119] = "Rorate", e[e.FlipH = 4120] = "FlipH", e[e.FlipV = 4121] = "FlipV", e[e.LocalAudioTrack = 4122] = "LocalAudioTrack", e[e.ImgSrc = 4123] = "ImgSrc", e[e.PanFileId = 4124] = "PanFileId", e[e.RationText = 4125] = "RationText", e[e.RationTextEx = 4126] = "RationTextEx", e[e.vipLevel = 4127] = "vipLevel", e[e.PlayFrom = 4128] = "PlayFrom", e[e.resolution = 4129] = "resolution", e[e.trans_gcid = 4130] = "trans_gcid", e[e.PlayType = 4131] = "PlayType", e[e.StringEnd = 4132] = "StringEnd"
    }(t.XmpMediaAttr || (t.XmpMediaAttr = {})), function (e) {
        e.unKnow = "UnKnow", e.localFile = "LocalFile", e.downloadAndPlay = "DownloadAndPlay", e.yunBo = "YunBo"
    }(t.XmpPlayType || (t.XmpPlayType = {})), function (e) {
        e.init = "XmpPlayerInit", e.showAPlayerWindow = "XmpShowAPlayerWindow", e.createXmpMedia = "XmpPlayerCreateXmpMedia", e.open = "XmpPlayerOpen", e.openFile = "XmpPlayerOpenFile", e.addFile = "XmpPlayerAddFile", e.openFolder = "XmpPlayerOpenFolder", e.openBt = "XmpPlayerOpenBt", e.openUrl = "XmpPlayerOpenUrl", e.openMedia = "XmpPlayerOpenMedia", e.close = "XmpPlayerClose", e.stop = "XmpPlayerStop", e.play = "XmpPlayerPlay", e.pause = "XmpPlayerPause", e.getVersion = "XmpPlayerGetVersion", e.getState = "XmpPlayerGetState", e.isPlaying = "XmpPlayerIsPlaying", e.getDuration = "XmpPlayerGetDuration", e.getPosition = "XmpPlayerGetPosition", e.setPosition = "XmpPlayerSetPosition", e.getVideoWidth = "XmpPlayerGetVideoWidth", e.getVideoHeight = "XmpPlayerGetVideoHeight", e.getVolume = "XmpPlayerGetVolume", e.setVolume = "XmpPlayerSetVolume", e.isSeeking = "XmpPlayerIsSeeking", e.getBufferProgress = "XmpPlayerGetBufferProgress", e.getConfig = "XmpPlayerGetConfig", e.setConfig = "XmpPlayerSetConfig", e.setCurrentMedia = "XmpPlayerSetCurrentMedia", e.getCurrentMedia = "XmpPlayerGetCurrentMedia", e.getMediaAttribute = "XmpPlayerMediaAttribute", e.getCurrentMediaAttribute = "XmpPlayerGetCurrentMediaAttribute", e.clearCurrentMedia = "XmpPlayerClearCurrentMedia", e.openPreMedia = "XmpPlayerOpenPreMedia", e.openNextMedia = "XmpPlayerOpenNextMedia", e.isPlayOrderFirstMedia = "XmpPlayerIsPlayOrderFirstMedia", e.isPlayOrderLastMedia = "XmpPlayerIsPlayOrderLastMedia", e.isFirstMedia = "XmpPlayerIsFirstMedia", e.isLastMedia = "XmpPlayerIsLastMedia", e.isMediasLoadFinished = "XmpPlayerIsMediasLoadFinished", e.getMediasInfo = "XmpPlayerGetMediasInfo", e.removeMedia = "XmpPlayerRemoveMedia", e.removeAllMedia = "XmpPlayerRemoveAllMedia", e.setASpectRatioAtive = "XmpPlayerSetASpectRatioAtive", e.setPlayForward = "XmpPlayerSetPlayForward", e.postionChange = "XmpPlayerPostionChange", e.getBufferRange = "XmpPlayerGetBufferRange", e.fireKeyDown = "XmpPlayerFireKeyDown", e.fireKeyUp = "XmpPlayerFireKeyUp", e.setAudioTime = "XmpPlayerSetAudioTime", e.setProportion = "XmpPlayerSetProportion", e.setVlomue = "XmpPlayerSetVlomue", e.getCurView = "XmpPlayerGetCurView", e.recordStat = "XmpPlayerRecordStat", e.getHostWnd = "XmpPlayerGetHostWnd", e.startWindowZorderChecker = "StartWindowZorderChecker", e.stopWindowZorderChecker = "StopWindowZorderChecker", e.setZOrderCheckerWindowHandle = "SetZOrderCheckerWindowHandle", e.removeZOrderCheckerWindowHandle = "RemoveZOrderCheckerWindowHandle", e.getVideoDuration = "GetVideoDuration", e.getDownloadState = "GetDownloadState", e.getResConfig = "GetResConfig", e.queryTaskState = "QueryTaskState", e.shareMediaInfo = "ShareMediaInfo", e.getThunderDirState = "GetThunderDirState", e.setThunderDirState = "SetThunderDirState", e.showSyncDig = "ShowSyncDig", e.isXmpLite = "IsXmpLite", e.handleVipPlaySpeed = "handleVipPlaySpeed", e.getMediaInfo = "GetMediaInfo", e.getCurrentMediaInfo = "GetCurrentMediaInfo", e.setMediaAttribute = "XmpPlayerSetMediaAttribute", e.updateDownloadEmbedRect = "UpdateDownloadEmbedRect", e.updatePanEmbedRect = "UpdatePanEmbedRect", e.createIndependentWindow = "CreateIndependentWindow", e.thunderResize = "ThunderResize", e.updateFloatHwnd = "UpdateFloatHwnd", e.updateAplayerHwnd = "UpdateAplayerHwnd", e.updatePlaySource = "UpdatePlaySource", e.setXmpCurrentMode = "SetXmpCurrentMode", e.getXmpCurrentMode = "GetXmpCurrentMode", e.destroy = "XmpDestroy", e.maximize = "XmpMaximize", e.unmaximize = "XmpUnmaximize", e.minmized = "XmpMinmized", e.setPlaySpeed = "SetPlaySpeed", e.getPlaySpeed = "GetPlaySpeed", e.setWindowTopMode = "SetWindowTopMode", e.calcelWindowTopMode = "CalcelWindowTopMode", e.enterFullScreen = "EnterFullScreen", e.leaveFullScreen = "LeaveFullScreen", e.getIsFullScreen = "GetIsFullScreen", e.setPlayingTaskId = "SetPlayingTaskId", e.setlayPingPanFileId = "SetPlayingPanFileId", e.setSelectTaskId = "SetSelectTaskId", e.setSelectPanel = "SetSelectPanel", e.setSelectTab = "SetSelectTab", e.setSelectPanFileId = "SetSelectPanFileId", e.getPlayingTaskId = "GetPlayingTaskId", e.getPlayingPanFileId = "GetPlayingPanFileId", e.getSelectTaskId = "GetSelectTaskId",e.getSelectPanel = "GetSelectPanel",e.getSelectTab = "GetSelectTab",e.getSelectPanFileId = "GetSelectPanFileId",e.getXmpPlayType = "GetXmpPlayType",e.getDownloadAndPlayTaskData = "GetDownloadAndPlayTaskData",e.isCurrentBuffingIsByDrag = "IsCurrentBuffingIsByDrag",e.getLastPlayError = "GetLastPlayError"
    }(t.XmpPlayerFunction || (t.XmpPlayerFunction = {})), function (e) {
        e.onWindowMessage = "OnWindowMessage", e.onStateChanged = "OnStateChanged", e.onCreateMediaError = "OnCreateMediaError", e.onOpenSucceeded = "OnOpenSucceeded", e.onVideoSizeChanged = "OnVideoSizeChanged", e.onAPlayerCreated = "OnAPlayerCreated", e.onAllStoped = "OnAllStoped", e.onSeekCompleted = "OnSeekCompleted", e.onBuffer = "OnBuffer", e.onDownloadCodec = "OnDownloadCodec", e.onDownloadCodecProgress = "OnDownloadCodecProgress", e.onDropFiles = "OnDropFiles", e.onEvent = "OnEvent", e.onGetPlayUrl = "OnGetPlayUrl", e.onOpenFailed = "OnOpenFailed", e.onPlayFailed = "OnPlayFailed", e.onClearError = "OnClearError", e.onError = "OnError", e.onPlaying = "OnPlaying", e.onPreOpen = "OnPreOpen", e.onPaused = "OnPaused", e.onPlayCompleted = "OnPlayCompleted", e.onPreStop = "OnPreStop", e.onStop = "OnStop", e.onForceLoadingState = "OnForceLoadingState", e.onVipStruckPlayState = "OnVipStruckPlayState", e.onTimeDesChange = "OnTimeDesChange", e.onPositionChanged = "OnPositionChanged", e.onSnapShotCreated = "OnSnapShotCreated", e.onXmpPlayerEvent = "OnXmpPlayerEvent", e.onXmpAplayerCrash = "OnXmpAplayerCrash", e.onUpdateMediaCid = "OnUpdateMediaCid", e.onUpdateMediaGcid = "OnUpdateMediaGcid", e.onSpeedChange = "OnSpeedChange", e.onFullScreenStateChange = "OnFullScreenStateChange", e.onSetConfig = "OnSetConfig", e.onVolumeChange = "OnVolumeChange", e.onPlayStateChange = "OnPlayStateChange", e.onCurViewChanged = "OnCurViewChanged", e.onUserLogin = "OnUserLogin", e.onDwmCompositionChanged = "OnDwmCompositionChanged", e.onDpiChanged = "OnDpiChanged", e.onGPUProcessCrashed = "OnGPUProcessCrashed", e.onSetCurrentDevice = "OnSetCurrentDevice", e.onXmpPlayerRemoveMedias = "OnXmpPlayerRemoveMedias", e.onOpenMediaNotExist = "OnOpenMediaNotExist", e.onSwitchModeError = "OnSwitchModeError", e.onDlnaEvent = "OnDlnaEvent", e.onSubtitleInit = "OnSubtitleInit", e.onSubtitleUnInit = "onSubtitleUnInit", e.onEmbedSubInitFinish = "OnEmbedSubInitFinish", e.onEntertCurrentDevice = "OnEntertCurrentDevice", e.onWindowZOrderChanged = "OnWindowZOrderChanged", e.onAplayerSeekFrameChanged = "OnAplayerSeekFrameChanged", e.onModeBarChange = "OnModeBarChange", e.onThunderTaskRemove = "OnThunderTaskRemove", e.onXmpClose = "OnXmpClose", e.onXmpStartFailed = "OnXmpStartFailed", e.onVipViewInitFinish = "OnVipViewInitFinish", e.onModeEvent = "OnModeEvent", e.onMaxmized = "OnMaxmized", e.onUnMaxmized = "OnUnMaxmized", e.onSetWindowTopMost = "OnWindowTopMost", e.onCancelWindowTopMost = "OnCancelWindowTopMost", e.onOpenOrCloseSettingCenter = "OnOpenOrCloseSettingCenter", e.onUpdateBufferingUI = "OnUpdateBufferingUI"
    }(t.XmpEvent || (t.XmpEvent = {})), function (e) {
        e.XMP = "xmp", e.APlayer = "aplayer", e.DownloadKernel = "download_kernel", e.Thunder = "thunder", e.Other = "other", e.Exit = "exit", e.Crash = "crash", e.Restart = "restart", e.CancelDownloadCodecs = "cancel_download_codecs"
    }(t.ErrorFrom || (t.ErrorFrom = {})), function (e) {
        e[e.UNKNOWN_MODE = -1] = "UNKNOWN_MODE", e[e.INDEPENDENT_MODE = 0] = "INDEPENDENT_MODE", e[e.MAGNETIC_MODE = 1] = "MAGNETIC_MODE", e[e.EMBED_MODE = 2] = "EMBED_MODE"
    }(t.XmpMode || (t.XmpMode = {})), function (e) {
        let t = new Map([[2147746328, "无法解码该文件, 找不到所需的解码器或格式不支持，请尝试重新安装"], [2147680258, "找不到指定的资源"], [2147533648, "找不到指定的模块，请尝试重新安装"], [3222077446, "无法连接指定的服务器"], [3222080445, "无法播放受到版权保护的媒体文件"], [2147746351, "文件为空或无法访问"], [2147943792, "无效的播放参数，请确认输入了有效的播放文件地址"], [4294967263, "全网点播服务在维护中"], [1, "任务创建失败，无法继续下载"], [2, "任务参数错误，无法继续下载"], [3, "链接失效，无法继续下载"], [4, "任务配置文件错误，无法继续下载"], [5, "任务连接超时，无法继续下载"], [6, "文件校验失败，无法继续下载"], [7, "任务包含违规内容，无法继续下载"], [8, "下载引擎加速出错，无法继续下载"], [9, "文件路径超出系统限制，无法继续下载"], [201, "缓存文件创建失败，无法继续下载"], [202, "缓存文件写入失败，无法继续下载"], [203, "缓存文件读取失败，无法继续下载"], [204, "缓存文件文件重命名失败，无法继续下载"], [205, "缓存磁盘空间不足，无法继续下载，请清理再试"], [601, "BT任务已存在，无法继续下载"], [701, "任务包含违规内容，无法继续下载"], [702, "帐号存在异常，无法继续下载"], [703, "根据当地法律法规，文件无法下载"], [704, "应版权方要求，该文件无法下载"], [10001, "下载引擎未启动，无法继续下载"], [10002, "种子文件不存在，无法继续下载"], [44093, "播放进程崩溃了"], [44172, "边下边播任务异常,请尝试重启迅雷"], [44041, "本地BT媒体文件找不到,请稍后再试"], [44042, "种子内无有效的视频文件"], [44013, "媒体链接为网页地址,无法播放"], [44014, "媒体链接无法连接成功"], [44018, "不支持此媒体播放"], [44019, "媒体解码失败,无法播放"], [44091, "下载库崩溃,请重启迅雷播放组件再试"], [44111, "获取媒体格式失败"], [44112, "媒体文件下载失败"], [71200, "切换校验模式后，仍无法打开媒体文件"], [168965206, "播放失败，缺少必要的解码器"], [305419896, "播放出错, 可能暂不支持该格式解码, 建议尝试播放其他音视频文件"], [2326396930, "失效文件，可能已经被删除"]]);
        e.getErrorTextByErrorCode = function (e) {
            let i = t.get(e);
            return i || (i = "未知错误"), i
        }
    }(t.XmpErrorCodeNS || (t.XmpErrorCodeNS = {})), function (e) {
        e[e.Unkown = 0] = "Unkown", e[e.Download = 1] = "Download", e[e.Play = 2] = "Play", e[e.Collect = 3] = "Collect"
    }(t.XmpMediaCategory || (t.XmpMediaCategory = {})), function (e) {
        e[e.XMPDrag = 0] = "XMPDrag"
    }(t.OpenMode || (t.OpenMode = {})), function (e) {
        e[e.Unkown = 0] = "Unkown", e[e.Dc = 1] = "Dc", e[e.Vod = 2] = "Vod", e[e.P2s = 3] = "P2s", e[e.Gvod = 4] = "Gvod", e[e.ServerXlpan = 5] = "ServerXlpan", e[e.LocalXlpan = 6] = "LocalXlpan"
    }(t.XmpMediaType || (t.XmpMediaType = {})), function (e) {
        e.createButton = "CreateButton", e.updateButton = "UpdateButton", e.createWebview = "CreateWebview", e.setDefaultVipSpeedStatus = "SetDefaultVipSpeedStatus", e.updateVipSpeedStatus = "UpdateVipSpeedStatus", e.getWebviewInfo = "GetWebviewInfo", e.createVipView = "CreateVipview", e.showCurveChart = "showCurveChart", e.applyBrowserView = "ApplyBrowserView", e.getBrowserViewId = "GetBrowserViewId", e.initBrowserViewConfig = "initBrowserViewConfig", e.createVipMenu = "CreateVipMenu", e.getMenuSlot = "GetMenuSlot", e.openNewTab = "OpenNewTab", e.videoPause = "DoVideoPause", e.videoPlay = "DoVideoPlay", e.videoPauseEx = "DoVideoPauseEx", e.videoPlayEx = "DoVideoPlayEx", e.setPlaySpeed = "SetPlaySpeed", e.setProgressColor = "SetProgressColor", e.getProgressColor = "GetProgressColor", e.showBufferingEntry = "ShowBufferingEntry", e.isBufferingEntryShow = "IsBufferingEntryShow", e.showOpenVipEntry = "ShowOpenVipEntry", e.registerFunctionCall = "RegisterFunctionCall", e.executeFunctionCall = "ExecuteFunctionCall", e.videoGetPlayState = "VideoGetPlayState", e.setXmpFocus = "SetXmpFocus", e.leaveFullScreen = "LeaveFullScreen"
    }(t.UIFunction || (t.UIFunction = {})), function (e) {
        e.onXmpModeChanging = "OnXmpModeChanging", e.onXmpModeChanged = "OnXmpModeChanged", e.onXmpEnterFullScreen = "OnXmpEnterFullScreen", e.onXmpLeaveFullScreen = "OnXmpLeaveFullScreen"
    }(t.ModeChangeEvent || (t.ModeChangeEvent = {})), function (e) {
        e.saveConfig = "SaveConfig", e.getConfigValue = "GetConfigValue", e.setConfigValue = "SetConfigValue", e.isConfigInitFinish = "IsConfigInitFinish", e.getConfigModules = "GetConfigModules", e.setXmpAndThunderConfigValue = "SetXmpAndThunderConfigValue"
    }(t.ConfigFunction || (t.ConfigFunction = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(11), r = i(17), s = i(3), l = i(26), d = i(9), u = i(6), c = i(13), h = i(5), f = i(0),
        g = i(22), p = i(15), v = i(29), m = i(33), y = i(7), k = i(19), T = i(38), w = i(47), C = i(23), S = i(52),
        I = i(49), b = y.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        _ = p.DownloadKernelEventManager.getEventManager(), D = l.DownloadKernelCategoryManager.getCategoryManager(),
        A = f.default.getLogger("Thunder.PrivateSpaceHelper"), N = S.ToastNotifyManagerNS.getToastNotifyManger();
    !function (e) {
        let t = void 0, i = void 0, l = "", f = !0, p = void 0, y = void 0;
        const x = new k.EventEmitter;
        let E;

        function P(e, t, i) {
            A.information("onInsertToCategoryView categoryId:", e, ", categoryViewId:", t);
            for (let e = 0; e < i.length; e++) {
                let t = i[e];
                if (t.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) return;
                let n = t.getTaskStatus();
                A.information("onInsertToCategoryView taskStatus:", n), n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || M(t, t.getIsPrivate()).then().catch()
            }
        }

        function O(e) {
            for (let t = 0; t < e.length; t++) {
                let i = e[t];
                if (i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                let n = i.getTaskStatus();
                n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || i.getIsPrivate() && M(i, !0).then().catch()
            }
        }

        function M(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = e.getTaskStatus(), o = e.getTaskBaseInfo().taskType;
                if (A.information("moveTaskFileToPrivateSpace taskType:", o, ", taskStatus:", i, ", moveIn:", t), i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0) return;
                    let i = "";
                    if (t ? (i = yield L(l), i = a.join(i, l)) : i = yield h.client.callServerFunction("GetDownloadDir"), A.information("moveTaskFileToPrivateSpace newSrcPath:", i), o === s.DownloadKernel.TaskType.Group) return function (e, t, i) {
                        return n(this, void 0, void 0, function* () {
                            let n = e.getSavePath(), o = e.getTaskName();
                            if (!(yield u.FileSystemAWNS.existsAW(n))) return;
                            let r = a.join(n, o);
                            if (A.information("destPath:", r), n !== r) {
                                yield u.FileSystemAWNS.mkdirsAW(i);
                                let a = yield F(n, r);
                                if (a) {
                                    e.setSavePath(i), B(e, !!t && R());
                                    let n = e.getExtraObject(), a = n.getSubTaskCount();
                                    if (a && a > 0) for (let e = 0; e < a; e++) {
                                        let t = n.getSubTaskByIndex(e);
                                        t && t.setSavePath(r)
                                    }
                                    _.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e])
                                }
                            } else B(e, !!t && R())
                        })
                    }(e, t, i);
                    if (o === s.DownloadKernel.TaskType.Bt) return function (e, t, i) {
                        return n(this, void 0, void 0, function* () {
                            let n = e.getExtraObject(), o = n.getDownloadFile();
                            if (1 !== o.length) return;
                            let r = n.getBtFileList(), l = r.get(o[0]);
                            if (!l) return;
                            let d = void 0, c = e.getSavePath(),
                                h = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName),
                                f = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath),
                                g = yield w.SingleBtTaskNS.isSingleBtTask(e);
                            if (g) d = w.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                if (!h || "" === h) return;
                                c = a.join(c, f), d = a.join(c, h)
                            }
                            if (yield u.FileSystemAWNS.existsAW(d)) if (c !== i) {
                                yield u.FileSystemAWNS.mkdirsAW(i);
                                let n = a.join(i, h), o = yield F(d, n);
                                o && (e.setSavePath(i), _.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), B(e, !!t && R()))
                            } else B(e, !!t && R())
                        })
                    }(e, t, i);
                    if (o === s.DownloadKernel.TaskType.P2sp || o === s.DownloadKernel.TaskType.Emule) return function (e, t, i) {
                        return n(this, void 0, void 0, function* () {
                            let n = e.getSavePath(), o = e.getTaskName(), r = a.join(n, o);
                            if (yield u.FileSystemAWNS.existsAW(r)) if (n !== i) {
                                yield u.FileSystemAWNS.mkdirsAW(i);
                                let n = a.join(i, o), l = yield F(r, n);
                                l && (e.setSavePath(i), _.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), B(e, !!t && R()))
                            } else B(e, !!t && R())
                        })
                    }(e, t, i)
                }
            })
        }

        function F(e, t) {
            return n(this, void 0, void 0, function* () {
                return A.information("moveFile srcParh:", e, ", destPath:", t), new Promise(i => n(this, void 0, void 0, function* () {
                    if (e[0] === t[0]) {
                        yield u.FileSystemAWNS.renameAW(e, t);
                        let n = yield u.FileSystemAWNS.existsAW(t);
                        A.information("moveFile existsAW success:", n), i(n)
                    } else {
                        let n = !1;
                        (yield u.FileSystemAWNS.lstatAW(e)).isDirectory() ? (n = yield u.FileSystemAWNS.copyDirsAW(e, t), A.information("moveFile copyDirsAW success:", n), n && (n = yield u.FileSystemAWNS.rmdirsAW(e), A.information("moveFile rmdirsAW success:", n))) : (n = yield u.FileSystemAWNS.copyFileAW(e, t), A.information("moveFile copyFileAW success:", n), n && (n = yield u.FileSystemAWNS.unlinkAW(e), A.information("moveFile unlinkAW success:", n))), i(n)
                    }
                }))
            })
        }

        function L(e) {
            return n(this, void 0, void 0, function* () {
                let t = d.ConfigNS.getValue("PrivateSpaceDefaultPath", e, "");
                if (t && "" !== t) {
                    let i = a.join(t, e);
                    if (yield u.FileSystemAWNS.existsAW(i)) return t;
                    if (yield u.FileSystemAWNS.mkdirAW(i)) return t
                }
                let i = d.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                return void 0 !== i && "" !== i || (i = c.ThunderUtil.getDefaultDownloadDir()), void 0 !== i && "" !== i ? (d.ConfigNS.setValue("PrivateSpaceDefaultPath", e, i), i) : ""
            })
        }

        function R(e) {
            return e && "" === e || (e = l), 1 === d.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1)
        }

        function B(e, t) {
            let i = e.getSavePath(), n = e.getTaskName();
            A.information("setTaskHidden path:", i, ", name:", n, ", hidden:", t), t && !function (e) {
                if (!e || "" === e) return !1;
                let t = l;
                "" !== l && "0" !== l || (t = "私人空间");
                if (A.information("userId:", t), A.information("filePath:", e), new RegExp(t).test(e)) return !0;
                return !1
            }(i) || (U(i, t), U(a.join(i, n), t))
        }

        function U(e, t) {
            let i = t ? 2 : 128, n = b.setFileAttributes(e, i);
            A.information("setPathHidden ret:", n, ", path:", e, ", hidden:", t)
        }

        function K(e, t) {
            e && "" === e || (e = l), d.ConfigNS.setValue("PrivateSpacePasswordErrorCount", e, t)
        }

        function V(e, t) {
            return n(this, void 0, void 0, function* () {
                if (!t || "" === t) return;
                if (t = a.join(t, e), !(yield u.FileSystemAWNS.existsAW(t))) {
                    yield u.FileSystemAWNS.mkdirAW(t)
                }
                let i = d.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1);
                A.information("setPrivateSavePath", i, t), U(t, 1 === i)
            })
        }

        function W(e, t) {
            A.information("setAllTaskFileHidden", e, t);
            let i = D.getPrivateCategoryFromUserId(e);
            if (!i) return;
            let n = i.getCategoryViews();
            if (n && !(n.length <= 0)) for (let e = 0; e < n.length; e++) {
                let i = n[e].getTasks();
                for (let e of i.values()) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                    let i = e.getTaskStatus();
                    i !== s.DownloadKernel.TaskStatus.Succeeded && i !== s.DownloadKernel.TaskStatus.Seeding || e.getIsPrivate() && B(e, t)
                }
            }
        }

        function G(e, t, i) {
            return n(this, void 0, void 0, function* () {
                return new Promise((a, o) => n(this, void 0, void 0, function* () {
                    let n = null;
                    if (n = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) {
                        let e = yield C.LoginHelperNS.loginHelper.getUserInfoByKeyAw("mobile");
                        null === e || void 0 === e || "" === e ? (!1 !== i && (yield h.client.callServerFunction("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: {spellcheck: !1, nodeIntegration: !0, webSecurity: !1}})
                        }(e, t).then(e => {
                            e.action === T.MessageBoxNS.Action.OK ? a(0) : a(-1)
                        }).catch()
                    } else a(-1)
                }))
            })
        }

        function H(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = R(e);
                return new Promise((a, o) => {
                    (function (e, t) {
                        return g.MessageBox.custom("private-space-set-password", {isSetHide: e, showType: t})
                    })(i, t).then(t => {
                        if (t.action === T.MessageBoxNS.Action.OK) {
                            if (null !== t.args.isSetHide && void 0 !== t.args.isSetHide && "boolean" == typeof t.args.isSetHide && t.args.isSetHide !== i) {
                                let i = t.args.isSetHide ? 1 : 0;
                                d.ConfigNS.setValue("PrivateSpaceLockUserTask", e, i), W(e, t.args.isSetHide)
                            }
                            let o = D.getCurrentPrivateCategory();
                            o && o.setPassword(t.args.password, "", !0, (t, i) => n(this, void 0, void 0, function* () {
                                t && (j(!1), x.emit(E.SetPassword, !0), N.showNotify(S.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, I.ToastNotifyItemType.GreenNotify, "私人空间密码设置成功", 3e3), K(e, 0), a(0));
                                let i = yield L(e);
                                i && "" !== i && V(e, i).then().catch()
                            }))
                        } else a(-1)
                    }).catch()
                })
            })
        }

        function z(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    let n = null;
                    (n = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) ? H(e, "change").then(e => {
                        t(e)
                    }).catch() : t(-1)
                })
            })
        }

        function j(e) {
            f = e
        }

        function X() {
            return f
        }

        !function (e) {
            e.Unknow = "Unknow", e.SetPassword = "SetPassword"
        }(E = e.EventType || (e.EventType = {})), e.getEventEmitter = function () {
            return x
        }, e.getPrivateSavePath = L, e.isPrivateSpaceOpen = function (e) {
            let t = !1, i = D.getPrivateCategoryFromUserId(e);
            if (i) {
                let e = i.getPassword();
                e && "" !== e && (t = !0)
            }
            return t
        }, e.setPrivateSavePath = V, e.setAllTaskFileHidden = W, e.phoneVerifyPrivateCategory = G, e.changePrivateSpacePassword = z, e.openPrivateCategory = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    let n = null;
                    if (n = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) {
                        let i = n.getPassword();
                        i && "" !== i ? t(0) : H(e, "open").then(e => {
                            t(e)
                        }).catch()
                    } else t(-1)
                })
            })
        }, e.accessPrivateCategory = function (e) {
            return n(this, void 0, void 0, function* () {
                var t, i;
                return new Promise((t, i) => {
                    let a = null;
                    if (a = e && "" !== e ? D.getPrivateCategoryFromUserId(e) : D.getCurrentPrivateCategory()) if (X()) {
                        let i = a.getPassword();
                        if (i && "" !== i) {
                            let a = function (e) {
                                return e && "" === e || (e = l), d.ConfigNS.getValue("PrivateSpacePasswordErrorCount", e, 0)
                            }(e);
                            a >= 5 ? G(e, "more").then(i => n(this, void 0, void 0, function* () {
                                0 === i ? (i = yield z(e), t(0 === i ? 0 : -1)) : t(-1)
                            })).catch(() => {
                                t(-1)
                            }) : (i = i, a = a, g.MessageBox.custom("private-space-verify-password", {
                                password: i,
                                errorCount: a
                            })).then(i => n(this, void 0, void 0, function* () {
                                if (i.action === T.MessageBoxNS.Action.OK) i.args && i.args.success && (j(!1), K(e, 0), t(0)); else if (i.action === T.MessageBoxNS.Action.Close && i.args) {
                                    a = i.args.errorCount, K(e, a);
                                    let n = i.args.from;
                                    if ("forget" === n || "more" === n) {
                                        let i = yield G(e, n);
                                        0 === i && 0 === (i = yield z(e)) && t(0)
                                    }
                                }
                            })).catch(() => {
                                t(-1)
                            })
                        } else t(0)
                    } else t(0); else t(-1)
                })
            })
        }, e.setNeedPassword = j, e.getNeedPassword = X, e.init = function () {
            return n(this, void 0, void 0, function* () {
                (function () {
                    return n(this, void 0, void 0, function* () {
                        t = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => n(this, void 0, void 0, function* () {
                            A.information("OnUserLogin userId:", e), l = e, D.setUserInfo(e, "")
                        })), i = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                            A.information("OnUserLogout currentUserId:", l), l = "", f = !0, D.setUserInfo("", "")
                        })
                    })
                })().then().catch(), p = _.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 && O(t)
                    } while (0)
                }), y = _.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], i = e[2];
                        A.information("insertTaskCallback categoryId:", t, ", categoryViewId:", i);
                        let n = e[3], a = e[4];
                        n.length > 0 && a === s.DownloadKernel.TaskInsertReason.MoveThoughCategory && P(t, i, n)
                    } while (0)
                }), (yield o.asyncRemoteCall.getIpcMain()).on(m.ThunderChannelList.channelRMGetPrivateSpaceInfo, e => n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (yield e.sender.isDestroyed()) break;
                        let t = !0, i = D.getCurrentPrivateCategory();
                        if (i) {
                            let e = i.getPassword();
                            e && "" !== e && (t = !0)
                        }
                        let n = v.default.getCurrentCategoryId();
                        e.sender.send(m.ThunderChannelList.channelMRGetPrivateSpaceInfoResult, t, n)
                    } while (0)
                }))
            })
        }, e.uninit = function () {
            r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", t), r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", i), _.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, p), _.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, y)
        }
    }(t.PrivateSpaceHelperNS || (t.PrivateSpaceHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.PRE_NEW_TASK = "pre-newtask-dlg", e.BT_NEW_TASK = "bt-newtask-dlg", e.NEW_TASK = "newtask-dlg", e.LOGIN = "login-dlg", e.BROWSER_GUIDE = "browser-guide-dlg", e.SIGN = "sign-dlg"
    }(t.PopView || (t.PopView = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(7), s = i(449), l = i(42), d = i(4), u = i(14), c = i(9), h = i(76),
        f = d.promisify, g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        p = i(0).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 n(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(u.NodeEventMesssageNS.eventConfigBrowserInitFinished))
                })
            }

            attachListener(e, t) {
                do {
                    if (e === u.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 i = this.configShowBrowsers[t], n = i.browserName, a = "Motitor" + n, o = !1;
                        0 !== c.ConfigNS.getValue("Motitor", a, 2) && (o = !0);
                        let r = {content: n, name: i.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 i = 0; i < t.length; ++i) {
                        let n = t[i], a = n.name;
                        "IE浏览器" !== n.content && n.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 i = 0; i < this.installWatchBrowsers.length; ++i) {
                        let n = this.installWatchBrowsers[i];
                        if (n.browserName.toLowerCase() === e.toLowerCase()) {
                            t = n;
                            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 i = 0; i < e.length; ++i) {
                        let n = e[i];
                        n.isSelect && (t = !0), "IE浏览器" === n.content && (n.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 n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            onBhoConfigInit() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        h.BHOConfigNS.attachListener(u.NodeEventMesssageNS.eventBHOConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            readBrowserConfigXml() {
                return n(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(),
                            i = "XLWFPDOWNLOAD-SSID-{DB09E578-4ECF-486e-90A5-505A33219F71}_" + e + ".xml",
                            n = a.join(t, "Thunder Network\\ServicePlatform\\"), r = a.join(n, i);
                        if (!(yield o.FileSystemAWNS.existsAW(r))) break;
                        let 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 n(this, void 0, void 0, function* () {
                    p.information("enter writeNewBrowserToConfigINI");
                    let e = "||";
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let i = this.configShowBrowsers[t], n = "Motitor" + i.browserName,
                            a = c.ConfigNS.getValue("Motitor", n, 2);
                        2 === a && c.ConfigNS.setValue("Motitor", n, 1);
                        let o = i.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"), i = g.getFileVersion(t);
                    if (null === i || void 0 === i || "" === i) break;
                    let n = i.split(/\./);
                    null !== n && void 0 !== n && n.length >= 3 && (e = n[0] + "." + n[1] + "." + n[2])
                } while (0);
                return e
            }

            setInstallWatchBrowserList() {
                return n(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 i = e.browser[t], n = !1;
                            "appReg" === i.type ? n = yield this.checkInstallByappReg(i) : "appPath" === i.type && (n = this.checkInstallByappPath(i)), n && this.installWatchBrowsers.push(i)
                        }
                        p.information("配置初始化时,安装的浏览器:", this.installWatchBrowsers)
                    } while (0)
                })
            }

            checkInstallByappReg(e) {
                return n(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 i = e.reg.regRoot;
                        if (null === i || void 0 === i || "" === i) break;
                        let n = e.reg.regKey;
                        if (null === n || void 0 === n || "" === n) break;
                        let r = e.reg.regName, s = g.queryRegValue(i, n, r);
                        if (p.information("checkInstallByappReg:", s, i, n, 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 d = e.proName, u = d.toLowerCase();
                        if (s.toLowerCase().search(u) < 0) {
                            let e = a.extname(s);
                            if (void 0 === e || null === e || "" === e) s = a.join(s, d); else {
                                let e = a.dirname(s);
                                s = a.join(e, d)
                            }
                            if (!(t = yield o.FileSystemAWNS.existsAW(s))) {
                                let e = a.dirname(s);
                                s = this.getFilePathByDir(e, d)
                            }
                        }
                        t || (t = yield o.FileSystemAWNS.existsAW(s))
                    } while (0);
                    return t
                })
            }

            getPathFromRegString(e) {
                let t = e, i = t.search(/\,/);
                return i >= 0 && (t = t.substring(0, i)), 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 i = g.getSystemTempPath();
                    if (null === i || void 0 === i || "" === i) break;
                    let n = i.substring(0, 1);
                    if (null === n || void 0 === n || "" === n) break;
                    n += ":\\";
                    let o = a.join(n, 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], i = !1;
                        for (let e = 0; e < this.configShowBrowsers.length; ++e) {
                            let n = this.configShowBrowsers[e];
                            if (n.browserName.toLowerCase() === t.browserName.toLowerCase()) {
                                null !== n.icoUrl && void 0 !== n.icoUrl && "" !== n.icoUrl || (this.configShowBrowsers[e].icoUrl = t.icoUrl), i = !0;
                                break
                            }
                        }
                        i || this.configShowBrowsers.push(t)
                    }
                } while (0)
            }
        }
    }(t.SettingConfigHelperNS || (t.SettingConfigHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(71), o = i(4), r = i(0), s = i(19), l = r.default.getLogger("Thunder.MainRenderer.Tabs");
    t.createXDASTab = function (e) {
        let t = new a.Tab;
        return t.initTab(a.TabType.XDAS, e).catch(), t
    }, t.createNewTab = function (e, t, i) {
        return n(this, void 0, void 0, function* () {
            let n = new a.Tab;
            return !1 === (yield n.initTab(e, t, i)) && (n = null, l.warning("init tab error")), n
        })
    }, t.createChromiumTab = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = new a.Tab, i = {url: e};
            return !1 === (yield t.initTab(a.TabType.Chromium, i)) && (t = null, l.warning("init tab error")), t
        })
    }, t.setDefaultListeners = function (e) {
        let t = !1;
        do {
            if (o.isNullOrUndefined(e)) {
                l.warning("event listeners error");
                break
            }
            if (0 === e.length) {
                l.warning("event listeners length error");
                break
            }
            a.Tab.defaultEventList = 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", e.CreateNewTab = "CreateNewTab", e.SelectTab = "SelectTab"
        }(t = e.EventType || (e.EventType = {}));
        let i = new s.EventEmitter;
        e.getEventEmitter = function () {
            return i
        }
    }(t.TabEventManagerNS || (t.TabEventManagerNS = {}));
    let d = 0;
    t.setCurrentTabID = function (e) {
        d = e
    }, t.getCurrentTabID = function () {
        return d
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(16), s = i(69), l = i(105), d = i(52), u = i(49), c = i(106), h = i(107),
        f = i(356), g = i(79), p = i(108).MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        v = o.default.getLogger("plugin-ui"), m = l.PluginWebviewMgrNS.getWebViewMgr();
    !function (e) {
        const t = new class extends a.EventEmitter {
            constructor() {
                super(), this.isRegister = !1, this.isRegister = !1, this.buttonCreated = {}, this.index = 0
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        CreateButton: this.createButton.bind(this),
                        UpdateButton: this.updateButton.bind(this),
                        RemoveButton: this.removeButton.bind(this),
                        CreateWebview: this.createWebview.bind(this),
                        RegisterMenuEvent: this.registerMenuEvent.bind(this),
                        UnRegisterMenuEvent: this.unRegisterMenuEvent.bind(this),
                        SetDefaultVipSpeedStatus: this.setDefaultVipSpeedStatus.bind(this),
                        UpdateVipSpeedStatus: this.updateVipSpeedStatus.bind(this),
                        GetDownloadingActiveTaskId: this.getDownloadingActiveTaskId.bind(this),
                        ShowToast: this.showToast.bind(this),
                        CloseToast: this.closeToast.bind(this),
                        CreateBrowserWindow: this.createBrowserWindow,
                        RoundRectWindow: this.roundRectWindow,
                        OpenCommunityGroup: this.openCommunityGroup.bind(this),
                        PushNotify: this.pushNotify.bind(this)
                    };
                    r.server.registerFunctions(e), r.server.on("end", e => {
                        c.downloadContextMenu.unRegisterMenuEvent(void 0, e)
                    })
                }
            }

            constructButtonInfo(e, t, i, n) {
                let a = `${i}`;
                if (n.id && (a = `${i}|${n.id}`), this.buttonCreated.hasOwnProperty(a)) throw new Error(`${a} try to add toolbar button repeatedly`);
                this.buttonCreated[a] = e, t && "toolbar-vip-button" === t.name && (n.position || (n.position = -2))
            }

            createButton(e, t, ...i) {
                v.information("createButton in");
                do {
                    if (!e) break;
                    if (!i || !i[0] || !i[1]) break;
                    let n = i[0], a = i[1];
                    switch (n) {
                        case"toolbar_button":
                            if (!a.id) break;
                            this.constructButtonInfo(e, t, n, a), this.emit("add_toolbar_button", a);
                            break;
                        case"vip_renew_button":
                            if (!a.imgSrc) break;
                            this.constructButtonInfo(e, t, n, a), this.emit("add_vip_renew_button", a);
                            break;
                        case"onething_miner":
                            this.constructButtonInfo(e, t, n, a), this.emit("add_pc_node_button", a, e);
                            break;
                        case"kuainiao_plugin":
                            this.constructButtonInfo(e, t, n, a), this.emit("add_kuainiao_button", a, e)
                    }
                } while (0)
            }

            updateButtonInfo(e, t, i, n) {
                let a = `${i}`;
                if (n.id && (a = `${i}|${n.id}`), this.buttonCreated[a] !== e) throw this.buttonCreated[a] ? new Error(`${a} update failed cause button is created by others`) : new Error(`${a} update failed, please make sure that button is created`)
            }

            removeButtonInfo(e, t, i, n) {
                let a = `${i}`;
                if (n && n.id && (a = `${i}|${n.id}`), this.buttonCreated[a] !== e) throw this.buttonCreated[a] ? new Error(`${a} remove failed cause button is created by others`) : new Error(`${a} remove failed, please make sure that button is created`);
                delete this.buttonCreated[a]
            }

            updateButton(e, t, ...i) {
                v.information("updateButton in", i && i[1]);
                do {
                    if (!e) break;
                    if (!i || !i[0] || !i[1]) break;
                    let n = i[0], a = i[1];
                    switch (n) {
                        case"toolbar_button":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_toolbar_button", a);
                            break;
                        case"vip_renew_button":
                            this.emit("update_vip_renew_button", a);
                            break;
                        case"onething_miner":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_pc_node_button", a, e);
                            break;
                        case"kuainiao_plugin":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_kuainiao_button", a, e)
                    }
                } while (0)
            }

            removeButton(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let n = i[0], a = i[1];
                    switch (n) {
                        case"kuainiao_plugin":
                            this.removeButtonInfo(e, t, n, a), this.emit("remove_kuainiao_button", a, e)
                    }
                } while (0)
            }

            createWebview(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (!i && !i[0] || !i[1]) break;
                    let a = i[0], o = i[1];
                    if (!o.src) break;
                    n = m.create(t, a, o)[0]
                } while (0);
                return n
            }

            registerMenuEvent(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!t && !t.name) throw Error("registerMenuEvent but no context name");
                    if (!i && !i[0]) break;
                    let n = i[0];
                    if (n <= c.DownloadMenuType.Unknown || n >= c.DownloadMenuType.Upper) break;
                    c.downloadContextMenu.registerMenuEvent(n, e)
                } while (0)
            }

            unRegisterMenuEvent(e, t, ...i) {
                do {
                    if (!e) break;
                    let t = void 0;
                    if (i && i[0] && ((t = i[0]) <= c.DownloadMenuType.Unknown || t >= c.DownloadMenuType.Upper)) break;
                    c.downloadContextMenu.unRegisterMenuEvent(t, e)
                } while (0)
            }

            setDefaultVipSpeedStatus(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    this.emit("init_vip_task_status", t)
                } while (0)
            }

            updateVipSpeedStatus(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    this.emit("update_vip_task_status", t)
                } while (0)
            }

            getDownloadingActiveTaskId(e, t, ...i) {
                return m.getActiveTaskId()
            }

            showToast(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e || !t) break;
                    if (!i || !i[0]) break;
                    let a = i[0];
                    if (a.type < u.ToastNotifyItemType.GreenNotify || a.type > u.ToastNotifyItemType.RedCancelNotify) break;
                    a.id || (a.id = `${t.name || ""}_totast_${this.index++}`), n = a.id;
                    let o = d.ToastNotifyManagerNS.getToastNotifyManger().showNotify(a.id, a.type, a.message, a.duration);
                    o && a.type === u.ToastNotifyItemType.RedCancelNotify && o.onCancel(() => {
                        a.onCancle && a.onCancle()
                    })
                } while (0);
                return n
            }

            closeToast(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    d.ToastNotifyManagerNS.getToastNotifyManger().closeNotify(t)
                } while (0)
            }

            createBrowserWindow(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return (yield r.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "CreateBrowserWindow", ...i))[0]
                })
            }

            roundRectWindow(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return (yield r.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "RoundRectWindow", ...i))[0]
                })
            }

            openCommunityGroup(e, t, ...i) {
                do {
                    let e = null;
                    if (!i[0]) break;
                    if ("object" == typeof i[0]) e = i[0]; else if ("string" == typeof i[0]) try {
                        e = JSON.parse(i[0])
                    } catch (e) {
                    }
                    if (!e) break;
                    this.emit("openComunityGroup", e)
                } while (0)
            }

            pushNotify(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!i[0]) break;
                        let e = i[1] || {};
                        e = Object.assign({}, e, {
                            type: h.Notification.TipsType.CommonPushTip,
                            priority: g.MsgQueueNS.MsgPriority.Download,
                            data: {exData: i[0]},
                            width: 400,
                            height: 172
                        }), p.enQueue({
                            callback: () => {
                                f.NotificationNS.notify(e).catch()
                            }, name: "push", priority: g.MsgQueueNS.MsgPriority.Download
                        }), (yield f.NotificationNS.getCurrentWindow()) ? p.getCurrentProperty() < g.MsgQueueNS.MsgPriority.Download && f.NotificationNS.close().catch() : p.deQueue()
                    } while (0)
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }, e.on = function (e, i) {
            t.on(e, i)
        }, e.removeListener = function (e, i) {
            t.removeListener(e, i)
        }
    }(t.PluginFunctionUINS || (t.PluginFunctionUINS = {}))
}, function (e, t, i) {
    e.exports = i(116).Buffer
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(398), a = i(306);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(792);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-select.vue", t.default = s.exports
}, function (e, t) {
    e.exports = require("net")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.assert = t.log = t.error = t.warn = t.info = t.trace = t.timeEnd = t.time = t.traceback = void 0;
    const n = i(2);
    let a, o = console;

    function r(e = 5) {
        let t = /at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i, i = /at\s+()(.*):(\d*):(\d*)/i,
            a = (new Error).stack.split("\n").slice(e + 1);
        a.shift();
        let o = [];
        return a.forEach((e, a) => {
            let r = t.exec(e) || i.exec(e), s = {};
            r && 5 === r.length && (s.method = r[1], s.path = r[2], s.line = r[3], s.pos = r[4], s.file = n.basename(s.path), o.push(s))
        }), o
    }

    if (a = "renderer" === process.type ? "[Renderer] [async-remote]:" : "browser" === process.type ? "[Browser] [async-remote]:" : `[${process.type}] [async-remote]`, t.traceback = function (e = 5) {
        return r(e).map(e => e.method + "@(" + e.file + ")").join(" <= ")
    }, t.time = function (...e) {
        o.time(...e)
    }, t.timeEnd = function (...e) {
        o.timeEnd(...e)
    }, t.trace = function (...e) {
        let t = r(), i = "";
        t[0] && t[0].method && (i = i), o.trace(a, ...e)
    }, t.info = function (...e) {
        let t = r(), i = "anonymous";
        t[0] && t[0].method && (i = i), o.info(a, "[" + i + "]", e.join(","))
    }, t.warn = function (...e) {
        let t = r(), i = "";
        t[0] && t[0].method && (i = i), o.warn("<WARN>" + a, "[" + i + "]", e.join(","))
    }, t.error = function (...e) {
        let t = r(), i = "";
        t[0] && t[0].method && (i = i), o.error("<ERROR>" + a, "[" + i + "]", e.join(","))
    }, t.log = function (...e) {
        o.log(a, ...e)
    }, t.assert = function (e, t) {
        if (!e) throw new Error(t)
    }, !process.env.DEBUG_ASYNC_REMOTE) {
        let e = function () {
        };
        t.traceback = e, t.time = e, t.timeEnd = e, t.trace = e, t.info = e, t.warn = e, t.error = e, t.log = e, t.assert = e
    }
}, function (e, t, i) {
    "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.SetTaskUrl = 21] = "SetTaskUrl", e[e.SetTaskName = 22] = "SetTaskName", e[e.SetTaskNamingType = 23] = "SetTaskNamingType", e[e.SetTaskDescription = 24] = "SetTaskDescription", e[e.SetTaskCid = 25] = "SetTaskCid", e[e.SetTaskGcid = 26] = "SetTaskGcid", e[e.SetTaskStatus = 27] = "SetTaskStatus", e[e.SetTaskFileCreated = 28] = "SetTaskFileCreated", e[e.SetTaskFileSize = 29] = "SetTaskFileSize", e[e.SetTaskReceiveSize = 30] = "SetTaskReceiveSize", e[e.SetTaskDownloadSize = 31] = "SetTaskDownloadSize", e[e.SetTaskCompletionTime = 32] = "SetTaskCompletionTime", e[e.SetTaskDownloadingPeriod = 33] = "SetTaskDownloadingPeriod", e[e.SetTaskRemovingToRecycleTime = 34] = "SetTaskRemovingToRecycleTime", e[e.SetTaskFailureErrorCode = 35] = "SetTaskFailureErrorCode", e[e.SetTaskUserRead = 36] = "SetTaskUserRead", e[e.SetTaskOpenOnCompelete = 37] = "SetTaskOpenOnCompelete", e[e.SetTaskForbidden = 38] = "SetTaskForbidden", e[e.SetTaskUserData = 39] = "SetTaskUserData", e[e.SetTaskDownload = 40] = "SetTaskDownload", e[e.SetTaskOrigin = 41] = "SetTaskOrigin", e[e.SetTaskChannelInfo = 42] = "SetTaskChannelInfo", e[e.SetP2spTaskUseOriginOnly = 43] = "SetP2spTaskUseOriginOnly", e[e.SetP2spTaskThreadCount = 44] = "SetP2spTaskThreadCount", e[e.SetBtTaskSeedFile = 45] = "SetBtTaskSeedFile", e[e.SetBtFileInfo = 46] = "SetBtFileInfo", e[e.SetBtFileCid = 47] = "SetBtFileCid", e[e.SetBtFileUserRead = 48] = "SetBtFileUserRead", e[e.SetCategoryId = 49] = "SetCategoryId", e[e.LoadCategory = 50] = "LoadCategory", e[e.CreateCategory = 51] = "CreateCategory", e[e.SetCategoryPassword = 52] = "SetCategoryPassword", e[e.SetCategoryAccountPassword = 53] = "SetCategoryAccountPassword", e[e.SearchTaskByName = 54] = "SearchTaskByName", e[e.SearchTaskByBtDisplayName = 55] = "SearchTaskByBtDisplayName", e[e.SetBtFileFailureErrorCode = 56] = "SetBtFileFailureErrorCode", e[e.BatchFindP2spTask = 57] = "BatchFindP2spTask", e[e.BatchFindEmuleTask = 58] = "BatchFindEmuleTask", e[e.BatchFindBtTask = 59] = "BatchFindBtTask", e[e.BatchFindGroupTask = 60] = "BatchFindGroupTask", e[e.BatchLoadBtFile = 61] = "BatchLoadBtFile", e[e.SetTaskPlayPosition = 62] = "SetTaskPlayPosition", e[e.SetTaskDuration = 63] = "SetTaskDuration", e[e.SetBtFilePlayPosition = 64] = "SetBtFilePlayPosition", e[e.SetBtFileDuration = 65] = "SetBtFileDuration", e[e.SetYunTaskId = 66] = "SetYunTaskId", e[e.StatementEnd = 67] = "StatementEnd"
    }(t.StatementType || (t.StatementType = {}))
}, function (e, t) {
    e.exports = require("http")
}, function (e, t) {
    e.exports = require("stream")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(10), r = i(3), s = i(3), l = i(446), d = i(12), u = i(15),
        c = a.default.getLogger("download-jammed"), h = d.DownloadKernelTaskManager.getTaskManager(),
        f = u.DownloadKernelEventManager.getEventManager(), g = 3, p = 10;
    const v = 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
        }

        isJammedOnce(e) {
            let t = !1;
            return this.recordTaskRestartList.hasOwnProperty(String(e)) && (t = !0), t
        }

        attach() {
            this.startRefreshTaskListInfoTimer(), this.attachTaskEvent()
        }

        isJammed(e) {
            let t = !1;
            do {
                let i = e.taskTotalSize;
                if (i <= 0) break;
                let n = e.receiveValidDataSize;
                if (n <= 0) break;
                let a = 100 * n / i;
                if (a >= 99.9 && a < 100) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        constructJammedTaskInfo(e) {
            let t = null;
            do {
                let i = h.getTaskFromTaskId(e);
                if (!i) break;
                if (i.getTaskStatus() !== r.DownloadKernel.TaskStatus.Started) break;
                let n = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize),
                    a = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize);
                t = {
                    taskId: e,
                    taskTotalSize: n,
                    receiveDataSize: i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ReceivedSize),
                    receiveValidDataSize: a,
                    addReceiveDataSize: 0,
                    time: 0,
                    peering: i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcUsing)
                }
            } while (0);
            return t
        }

        getExistJammedTaskInfo(e) {
            let t = null;
            do {
                if (!e) break;
                let i = e.getId();
                this.taskListInfo.hasOwnProperty(String(i)) && (t = this.taskListInfo[i])
            } while (0);
            return t
        }

        getNewJammedTaskInfo(e) {
            let t = null;
            do {
                if (!e) break;
                let i = e.taskId, n = this.constructJammedTaskInfo(i);
                if (!n) break;
                let a = e.time;
                if (n.receiveValidDataSize > e.receiveValidDataSize) {
                    t = n;
                    break
                }
                let o = n.receiveDataSize - e.receiveDataSize;
                o > e.addReceiveDataSize ? a = 0 : 0 === n.peering ? a = 0 : a += 1, t = {
                    taskId: i,
                    taskTotalSize: n.taskTotalSize,
                    peering: n.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)) {
                    c.information("jammed false", e.taskId, e.taskTotalSize);
                    break
                }
                if (e.time === p && e.receiveValidDataSize >= e.taskTotalSize) {
                    c.information("already 10 seconds but still no speed", e.taskId, e.taskTotalSize), this.restartTask(e.taskId);
                    break
                }
                let i = .05 * e.taskTotalSize;
                if (e.addReceiveDataSize > i) {
                    c.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) >= g) {
                    c.information("restart break beacause reach max restart");
                    break
                }
                this.addRestartCountById(e), this.addStopPending(e);
                let t = h.getTaskFromTaskId(e);
                l.statCoreEvent(t, "download_jammed").catch(), h.stopTaskAW(e, r.DownloadKernel.TaskStopReason.TaskJammed).then(t => n(this, void 0, void 0, function* () {
                    t && (yield h.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 i = this.taskListInfo[t];
                        if (!i) continue;
                        let n = this.getNewJammedTaskInfo(i);
                        this.handleTaskByNewInfo(n) ? this.addJammedTaskInfo(i.taskId, n) : e.push(i.taskId)
                    }
                    for (let t of e) this.removeTaskListInfoById(t)
                } while (0)
            }, 1e3)
        }

        attachTaskEvent() {
            f.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.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 i = t[e];
                        if (!i) continue;
                        if (i.getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) continue;
                        let n = i.getTaskStatus();
                        n !== r.DownloadKernel.TaskStatus.StopPending && n !== r.DownloadKernel.TaskStatus.Stopped || this.removeTaskListInfoByTask(i), n === r.DownloadKernel.TaskStatus.Started && this.removeStopPending(i.getId())
                    }
                } while (0)
            }), f.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e of t) {
                        let t = e.getId(), i = this.constructJammedTaskInfo(t);
                        if (!i) continue;
                        if (!this.isJammed(i)) continue;
                        if (this.getExistJammedTaskInfo(e)) continue;
                        let n = this.getIsRemoveTaskId(t);
                        n && (n > 15 || n % 5 != 0) || (c.information("detailchange to add"), this.addJammedTaskInfo(t, i))
                    }
                } while (0)
            })
        }
    };
    const m = new class {
        constructor() {
            this.map = {}, this.validationSizeList = [], f.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.onTaskStatusChanged.bind(this)), f.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, this.onTaskDetailChanged.bind(this))
        }

        isValidatingFileData(e) {
            let t = this.map[e];
            return !!t && !!t.isValidating
        }

        getValidationDuration(e) {
            let t = this.map[e], i = null;
            return t && t.isValidating && (i = {remainSeconds: t.validation.remainSeconds}), i
        }

        isCorrectingPieces(e) {
            let t = this.map[e];
            return !!t && !!t.isCorrecting
        }

        onTaskStatusChanged(e, t) {
            for (let e of t) {
                if (e.getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) continue;
                let t = e.getId(), i = e.getTaskStatus();
                if (i === s.DownloadKernel.TaskStatus.StopPending || i === s.DownloadKernel.TaskStatus.Stopped) delete this.map[t]; else if (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Failed) {
                    if (this.isValidatingFileData(t) && i === s.DownloadKernel.TaskStatus.Succeeded) {
                        let e = this.map[t], i = Date.now() - e.validation.startTime;
                        o.XLStatNS.trackEvent("download_leftpanel", "check_data_end", "", 0, 0, 0, 0, "dur=" + i)
                    }
                    delete this.map[t]
                }
            }
        }

        calcValidatingSpeed(e) {
            return this.validationSizeList.length > 6 && this.validationSizeList.splice(0, 1), this.validationSizeList.push(e), this.validationSizeList.reduce((e, t) => e + t) / this.validationSizeList.length
        }

        updateValidationInfo(e) {
            let t = e.taskId;
            e.isValidating = !1, e.dlSize >= e.fileSize && e.validSize < e.fileSize && (e.isValidating = !0);
            let i = this.map[t];
            if (i && i.isValidating) {
                let t = e.validSize - i.validSize, n = this.calcValidatingSpeed(t), a = e.fileSize - e.validSize,
                    o = n > 0 ? Math.round(a / n) : 1 / 0;
                e.validation.remainSize = a, e.validation.speed = n, e.validation.remainSeconds = o
            }
            e.isValidating && (i && i.isValidating || (e.validation.startTime = Date.now(), o.XLStatNS.trackEvent("download_leftpanel", "checking_data", "", 0, 0, 0, 0, ""))), window.__validating && (e.isValidating = !0)
        }

        updateCorrectionInfo(e) {
            let t = e.taskId, i = this.map[t];
            i && (i.isCorrecting ? e.realSize >= e.dlSize ? (e.isCorrecting = !1, c.warning("DownloadKernel. correcting down")) : e.isCorrecting = !0 : e.isCorrecting = i.realSize > e.realSize, e.isCorrecting && (i && i.isCorrecting || (o.XLStatNS.trackEvent("download_leftpanel", "data_error_correction", "", 0, 0, 0, 0, ""), e.dlSize < e.fileSize && o.XLStatNS.trackEvent("download_leftpanel", "data_error_correction_icon_show", "", 0, 0, 0, 0, ""))), window.__correcting && (e.isCorrecting = !0), i.isCorrecting !== e.isCorrecting && c.warning("DownloadKernel. correction state changed. from ", i.isCorrecting, " ==> ", e.isCorrecting))
        }

        onTaskDetailChanged(e, t, i) {
            for (let e of t) {
                if (e.getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) continue;
                if (e.getTaskStatus() !== s.DownloadKernel.TaskStatus.Started) continue;
                let t = e.getId(), i = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize),
                    n = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.RealDownloadSize),
                    a = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.ValidDownloadSize),
                    o = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize), l = {
                        taskId: t,
                        dlSize: i,
                        realSize: n,
                        validSize: a,
                        fileSize: o,
                        validation: {remainSize: o - a, speed: 0, remainSeconds: 1 / 0},
                        isCorrecting: !1,
                        isValidating: !1
                    };
                this.updateValidationInfo(l), this.updateCorrectionInfo(l), this.map[t] ? Object.assign(this.map[t], l) : this.map[t] = l
            }
        }
    };
    !function (e) {
        e.init = function () {
            v.attach()
        }, e.isStopPending = function (e) {
            return v.isStopPending(e)
        }, e.isJammedOnce = function (e) {
            return v.isJammedOnce(e)
        }, e.isValidatingFileData = function (e) {
            return m.isValidatingFileData(e)
        }, e.getValidationDuration = function (e) {
            return m.getValidationDuration(e)
        }, e.isCorrectingData = function (e) {
            return m.isCorrectingPieces(e)
        }
    }(t.DownloadJammedNS || (t.DownloadJammedNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(87), o = i(23), r = i(123), s = i(136), l = n.default.getLogger("pop-mutual"), d = 3e3, u = {
        [a.PopView.PRE_NEW_TASK]: 0,
        [a.PopView.BT_NEW_TASK]: 0,
        [a.PopView.NEW_TASK]: 0,
        [a.PopView.LOGIN]: 1,
        [a.PopView.BROWSER_GUIDE]: 2,
        [a.PopView.SIGN]: 3
    };
    const c = new class {
        constructor() {
            this.showQueue = [], this.willPopQueue = {}
        }

        setReady(e, ...t) {
            l.information("setReady in", e, ...t);
            do {
                if (e === a.PopView.LOGIN) {
                    let i = t && t[2] || "";
                    if (i.toLowerCase() !== "autoLoginFail".toLowerCase() && "auto" !== i.toLowerCase()) {
                        this.popImmediately(e, ...t);
                        break
                    }
                }
                let i = !1, n = u[e];
                if (void 0 === n) break;
                for (let e of this.showQueue) if (u[e] < n) {
                    i = !0;
                    break
                }
                i ? (l.information("setReady wait pop", e), this.willPopQueue[e] = t) : (l.information("setReady popImmediately", e), this.popImmediately(e, ...t))
            } while (0)
        }

        setFinish(e) {
            l.information("setFinish in", e);
            let t = this.showQueue.indexOf(e);
            -1 !== t && this.showQueue.splice(t, 1), 0 === this.showQueue.length ? this.popNext() : l.information(`${e} finished, but still other party show`, this.showQueue)
        }

        popNext() {
            do {
                let e = Object.keys(this.willPopQueue);
                if (0 === e.length) {
                    l.information("popNext no dlg wait");
                    break
                }
                e.sort((e, t) => u[e] - u[t]), l.information("popNext", e);
                let t = e[0];
                if (0 === u[t]) {
                    l.information("popNext but newtask dlg still exist");
                    break
                }
                let i = this.willPopQueue[t];
                delete this.willPopQueue[t], setTimeout(() => {
                    this.popImmediately(t, ...i)
                }, d)
            } while (0)
        }

        popImmediately(e, ...t) {
            switch (this.showQueue.push(e), e) {
                case a.PopView.PRE_NEW_TASK:
                case a.PopView.BT_NEW_TASK:
                case a.PopView.NEW_TASK:
                    break;
                case a.PopView.LOGIN:
                    t = t || [], o.LoginHelperNS.loginUIHelper.createLoginWnd(t[0], t[1], t[2], t[3], t[4]);
                    break;
                case a.PopView.BROWSER_GUIDE:
                    r.default().popUpBrowserGuide(t[0], t[1]).catch();
                    break;
                case a.PopView.SIGN:
                    s.EmbeddedBrowserManagerNs.showWebWnd("sign", ...t).catch()
            }
        }
    };
    t.popMutual = c
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(341), r = i(11), s = i(2), l = i(17), d = i(343), u = i(455), c = i(0), h = i(4), f = i(35),
        g = i(16), p = i(5), v = i(56), m = i(7), y = c.default.getLogger("Thunder.Main.Renderer.Embedded.Browser"),
        k = m.default(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.bottomMargin = 2, this.callBackShow = null, this.callBackClose = null, this.callBackClosed = null, this.browserEventHandler = null, this.isAutoShow = !0, this.autoCloseAtError = !0, this.isTopLevel = !1, this.isToolWindow = !1, this.attachListener().catch()
        }

        createWnd(e, t, i, s, l, c, f, m, y, T, w, C, S, I, b, _, D, A) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (yield this.isWindow()) {
                        if (!h.isNullOrUndefined(this.browserCtr)) {
                            let e = this.browserCtr.getBrowser();
                            if (!h.isNullOrUndefined(e)) {
                                e.refresh(), this.isAutoShow && this.showWnd().catch();
                                break
                            }
                            yield this.closeWnd()
                        }
                        yield this.closeWnd()
                    }
                    this.isAlreadyClose = !1, this.width = l, this.height = c, this.leftMargin = f, this.rigthMargin = m, this.topMargin = y, this.bottomMargin = T, this.callBackShow = C, this.callBackClose = S, this.callBackClosed = I;
                    let N = "development" === process.env.RUN_ENV ? "http://localhost:9080/embedded-browser-renderer/" : `file:///${__dirname}/../embedded-browser-renderer/index.html`;
                    N += `?browserType=${s}&title=${t}&minimizable=${_ ? 1 : 0}`;
                    let x = yield r.asyncRemoteCall.getCurrentWindow(), E = this.isTopLevel ? null : x,
                        P = yield r.asyncRemoteCall.getBrowserWindow();
                    this.wnd = yield new P({
                        width: this.width,
                        height: this.height,
                        resizable: !1,
                        frame: !1,
                        parent: E,
                        center: !this.startX || !this.startY,
                        show: !1,
                        modal: i,
                        alwaysOnTop: b,
                        minimizable: !!_,
                        webPreferences: {
                            spellcheck: !1,
                            nodeIntegration: !0,
                            webSecurity: "development" !== process.env.RUN_ENV,
                            preload: `file:///${__rootDir}/out/plugin-boot.js`
                        }
                    }), a.ipcRenderer.send("embedded-browser-create", this.wnd.id, this.isTopLevel), this.isTopLevel || d.ThunderWindowNS.fitWindowPosInParent(this.wnd, x).catch(), this.browserCtr = new o.BrowserCtrl, this.wnd.once("show", () => {
                        if (D && D.length > 0) {
                            let e = `EmbeddedBrowserRendererContext${s}`;
                            g.server.isRemoteClientExist(e) && p.client.callRemoteClientFunction(e, "AddMenu", D).catch()
                        }
                    }), this.wnd.once("ready-to-show", () => n(this, void 0, void 0, function* () {
                        if (!(yield this.isWindow())) return;
                        if (this.isAutoShow && (yield this.showWnd()), !this.wnd) return;
                        let t = (yield this.wnd.getNativeWindowHandle()).readUIntLE(0, 4),
                            i = u.CommonFunctionNs.getBrowserWindowRect(t, this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bottomMargin);
                        this.browserCtr.createChromiumBrowser(t, e, !1, i, this.getDefaultEvents()).catch(), this.browserCtr.setNativeOptions(A), this.registerNativeFunctions(w), k.setWindowLong(t, v.SetWindowType.GWL_STYLE, v.WindowStyle.WS_CLIPCHILDREN), this.isToolWindow && k.setWindowLong(t, v.SetWindowType.GWL_EXSTYLE, v.WindowStyleEx.WS_EX_TOOLWINDOW)
                    })), this.wnd.on("resize", () => {
                        this.browserCtr.getBrowser() && u.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bottomMargin)
                    }), this.wnd.on("move", () => {
                        this.browserCtr && this.browserCtr.getBrowser() && u.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bottomMargin)
                    }), 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 && 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
                    }), yield this.wnd.loadURL(N)
                } while (0)
            })
        }

        setToolWindow(e) {
            this.isToolWindow = e
        }

        setBrowserEventHandler(e) {
            this.browserEventHandler = e
        }

        setWindowTopLevel(e) {
            this.isTopLevel = e
        }

        setStartPosition(e, t) {
            this.startX = e, this.startY = t
        }

        getWnd() {
            return this.wnd
        }

        bringToTop() {
            let e = this.getWnd();
            h.isNullOrUndefined(e) || f.ToolsUtilitiesAWNS.setForegroundWindow(k, e).catch()
        }

        closeWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && !1 === this.isAlreadyClose && (this.isAlreadyClose = !0, yield this.wnd.close())
            })
        }

        minimizeWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.minimize())
            })
        }

        setWndSize(e, t) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (this.width = e, this.height = t, yield this.wnd.setSize(e, t))
            })
        }

        getWndPosition() {
            return n(this, void 0, void 0, function* () {
                return (yield this.isWindow()) ? this.wnd.getPosition() : [0, 0]
            })
        }

        setWndPosition(e, t) {
            return n(this, void 0, void 0, function* () {
                if (yield this.isWindow()) return this.wnd.setPosition(e, t)
            })
        }

        centerWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.center())
            })
        }

        hideWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.hide())
            })
        }

        showWnd(e) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (null !== this.callBackShow && void 0 !== this.callBackShow && "function" == typeof this.callBackShow ? (yield this.callBackShow()) ? e ? yield this.wnd.showInactive() : yield this.wnd.show() : yield this.closeWnd() : e ? yield this.wnd.showInactive() : yield this.wnd.show())
            })
        }

        setAutoShow(e) {
            this.isAutoShow = e
        }

        setAutoCloseAtError(e) {
            this.autoCloseAtError = e
        }

        setMinimizable(e) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.setMinimizable(e))
            })
        }

        setMaximizable(e) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.setMaximizable(e))
            })
        }

        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, i, a, o, r) {
            return n(this, void 0, void 0, function* () {
                if (y.information("OnLoadError isMainFrame, errorCode, isAlreadyClose, url: ", t, a, this.isAlreadyClose, i), (yield this.isWindow()) && t) if (-3 === a) {
                    let t = e.target.getWindowHandle();
                    k.showWindow(t, v.CmdShow.SW_SHOW)
                } else !1 === this.isAlreadyClose && this.autoCloseAtError && (yield this.closeWnd());
                this.browserEventHandler && t && this.browserEventHandler("OnLoadError", t, i, a, o, r)
            })
        }

        onLoadEnd(e, t, i, a, o) {
            return n(this, void 0, void 0, function* () {
                if (y.information("OnLoadEnd isMainframe", t, i), (yield this.isWindow()) && t) {
                    let t = e.target.getWindowHandle();
                    k.showWindow(t, v.CmdShow.SW_SHOW)
                }
                this.browserEventHandler && t && this.browserEventHandler("OnLoadEnd", t, i, a, o)
            })
        }

        onBeforeNavigate(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                if (y.information("OnBeforeNavigate isMainframe", t, i), (yield this.isWindow()) && t) {
                    let t = e.target.getWindowHandle();
                    k.showWindow(t, v.CmdShow.SW_HIDE)
                }
                this.browserEventHandler && this.browserEventHandler("OnBeforeNavigate", t, i, a)
            })
        }

        onNewBrowserPopup(e, t, i, n, a, o) {
            y.information("onNewBrowserPopup url", i);
            let r = !1;
            this.browserEventHandler && (r = this.browserEventHandler("OnNewBrowserPopup", i)), r || p.client.callServerFunction("openNewTab", i).catch()
        }

        getDefaultEvents() {
            return [{eventName: "before-nav", listener: this.onBeforeNavigate.bind(this)}, {
                eventName: "load-error",
                listener: this.onLoadError.bind(this)
            }, {eventName: "load-end", listener: this.onLoadEnd.bind(this)}, {
                eventName: "new-browser-popup",
                listener: this.onNewBrowserPopup.bind(this)
            }]
        }

        attachListener() {
            return n(this, void 0, void 0, function* () {
                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)
                }), (yield r.asyncRemoteCall.getIpcMain()).on("eventShowDevTool", (e, t) => n(this, void 0, void 0, function* () {
                    "browser" === t ? null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.showDevTool(!0) : "wnd" === t && (yield this.isWindow()) && (yield function (e) {
                        return n(this, void 0, void 0, function* () {
                            null !== e && ((yield e.webContents.isDevToolsOpened()) ? e.webContents.closeDevTools() : e.webContents.openDevTools({mode: "undocked"}))
                        })
                    }(this.wnd))
                }))
            })
        }

        isWindow() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                return this.wnd && !(yield this.wnd.isDestroyed()) && (e = !0), e
            })
        }

        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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(2), r = i(45), s = i(0), l = i(11), d = s.default.getLogger("Browser"),
        u = require || i(575);

    function c() {
        return n(this, void 0, void 0, function* () {
            let e = yield(yield l.asyncRemoteCall.getApp()).getAppPath();
            return window.__rootDir ? window.__rootDir : e
        })
    }

    function h(e) {
        let t = process.env.PATH.split(";");
        -1 === t.indexOf(e) && (t.splice(0, 0, e), process.env.PATH = t.join(";"))
    }

    function f(e) {
        let t = process.env.PATH.split(";"), i = t.indexOf(e);
        -1 !== i && (t.splice(i, 1), process.env.PATH = t.join(";"))
    }

    let g = null;
    const p = new Proxy(function () {
    }, {
        getPrototypeOf: e => g ? Reflect.getPrototypeOf(g.Browser) : null,
        setPrototypeOf: (e, t) => g ? Reflect.setPrototypeOf(g.Browser, t) : null,
        isExtensible: e => !!g && Reflect.isExtensible(g.Browser),
        preventExtensions: e => !!g && Reflect.preventExtensions(g.Browser),
        getOwnPropertyDescriptor: (e, t) => g ? Reflect.getOwnPropertyDescriptor(g.Browser, t) : null,
        has: (e, t) => !!g && Reflect.has(g.Browser, t),
        deleteProperty: (e, t) => !!g && Reflect.deleteProperty(g.Browser, t),
        defineProperty: (e, t, i) => !!g && Reflect.defineProperty(e.Browser, t, i),
        get: (e, t, i) => {
            let n = g ? Reflect.get(g.Browser, t, i) : null;
            return "function" == typeof n ? n.bind(g.Browser) : n
        },
        set: (e, t, i, n) => !!g && Reflect.set(g.Browser, t, n),
        ownKeys: e => g ? Reflect.ownKeys(g.Browser) : [],
        apply: (e, t, i) => {
            throw new Error("only allow calling Browser as constructor ")
        },
        construct: (e, t, i) => g ? Reflect.construct(g.Browser, t, i) : null
    });
    Object.defineProperty(e.exports, "Browser", {value: p}), t.context = new class extends a.EventEmitter {
        constructor() {
            super(...arguments), this.ctx = null, this.dead = !1
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (d.information("[tbc] init", e, g), null === g) {
                        let i = yield c(), n = e.tbc_dir ? e.tbc_dir : o.join(i, "../bin/TBC"),
                            r = o.join(n, "libCef.dll");
                        if (!(t = yield this.fileExists(r))) break;
                        let s = e.node_module_path ? e.node_module_path : o.join(i, "../bin/TBC/xlbrowsernode.node");
                        if (!(t = yield this.fileExists(s))) break;
                        if (d.information("[tbc] myRequire", s), h(n), g = u(s), f(n), d.information("[tbc] myRequire tbcModule", g), !g) {
                            t = !1;
                            break
                        }
                        global.tbcModule = g, Object.setPrototypeOf(g.Context.prototype, a.EventEmitter.prototype), Object.setPrototypeOf(g.Browser.prototype, a.EventEmitter.prototype), this.ctx = new g.Context, this.ctx.on("init-done", (...e) => {
                            this.emit("init-done", ...e)
                        }), this.ctx.on("will-uninit", (...e) => {
                            this.emit("will-uninit", ...e)
                        }), this.ctx.on("uninit", (...e) => {
                            this.emit("uninit", ...e)
                        }), this.ctx.on("browser-created", (...e) => {
                            this.emit("browser-created", ...e)
                        }), this.ctx.on("browser-destroyed", (...e) => {
                            this.emit("browser-destroyed", ...e)
                        }), d.information("[tbc] innerInit"), t = yield this.innerInit(e), d.information("[tbc] innerInit", t)
                    }
                } while (0);
                return t
            })
        }

        uninit() {
            this.ctx && !this.dead && (this.dead = !0, this.ctx.uninit())
        }

        getUserAgent() {
            return this.ctx ? this.ctx.getUserAgent() : ""
        }

        innerInit(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    d.information("[tbc] this.ctx.init"), this.ctx.init(e, e => {
                        d.information("[tbc] this.ctx.init", e), t(e)
                    })
                })
            })
        }

        fileExists(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    r.exists(e, e => {
                        t(e)
                    })
                })
            })
        }
    }, function (e) {
        for (var i in e) t.hasOwnProperty(i) || (t[i] = e[i])
    }(i(576))
}, function (e, t) {
    e.exports = require("child_process")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(2), r = i(7), s = i(77), l = i(13), d = i(14), u = i(6), c = i(37), h = i(3), f = i(61),
        g = i(32), p = i(31), v = i(57), m = i(10), y = i(0), k = i(585), T = i(35), w = i(12), C = i(16), S = i(349),
        I = i(460), b = y.default.getLogger("command_line"), _ = w.DownloadKernelTaskManager.getTaskManager(),
        D = r.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    const A = new class {
        constructor() {
            this.readyToShow = !0, this.startArgs = ""
        }

        init() {
            return n(this, void 0, void 0, function* () {
                C.server.registerFunctions({
                    ProcessCommandLine: (e, t, ...i) => {
                        let n = i[0];
                        if (b.information("on command", n), this.readyToShow && this.needBringToTop(n) && this.bringMainWindowToTop().catch(), void 0 !== n && "" !== n.trim()) {
                            let e = l.ThunderUtil.parseCommandLine(n);
                            e.length > 0 && this.executeCmdLine(e).catch()
                        }
                    }
                })
            })
        }

        setStartArgs(e) {
            this.startArgs = e
        }

        getStartArgs() {
            return this.startArgs
        }

        onCommand(e, t, a) {
            return n(this, void 0, void 0, function* () {
                if (b.information(e, t), "path" === e) {
                    let e = o.extname(t);
                    ".torrent" === (e = e.toLowerCase()) ? (this.readyToShow && (yield this.bringMainWindowToTop()), a = "command" === a ? "Torrent" : a, this.ensureDkLoaded(e => n(this, void 0, void 0, function* () {
                        if (e) {
                            let e = yield f.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                            if (null === e) c.ThunderNewTask.createBtTaskWindow({
                                type: "file",
                                seedFile: t
                            }, {source: a}); else {
                                let i = JSON.stringify(e);
                                c.ThunderNewTask.createBtTaskWindow({data: i, 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"), b.information("trackEvent", "core_event", "create_task_click", "click_source=taskbar"), c.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(h.DownloadKernel.TaskStopReason.PauseAll).catch()
                    }
                } else if ("shell" === e) {
                    if ("exit" === t) {
                        let e = "button=exit";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), yield v.quitPromises.run()
                    }
                } else if ("speedMode" === e) ; else if ("unionfile" === e) {
                    let e = t;
                    c.ThunderNewTask.createUnionTask(e).catch()
                } else if ("-autotestinjectfile" === e && (yield u.FileSystemAWNS.existsAW(t))) {
                    let e = require(t);
                    const {DownloadKernelTestNS: n} = yield Promise.resolve().then(() => i(586));
                    e.init(n)
                }
            })
        }

        bringMainWindowToTop() {
            return n(this, void 0, void 0, function* () {
                if (this.readyToShow) {
                    let e = yield a.asyncRemoteCall.getCurrentWindow();
                    null !== e && ((yield e.isMinimized()) && e.restore(), yield T.ToolsUtilitiesAWNS.setForegroundWindow(D, e), (yield e.isVisible()) ? e.focus() : e.show())
                }
            })
        }

        ensureDkLoaded(e) {
            _.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 n(this, void 0, void 0, function* () {
                let t = !1, i = void 0, n = !1;
                for (let a = 0; a < e.length; ++a) e[a] && (e[a].indexOf("play:true") > -1 ? t = !0 : e[a].indexOf("yunfetchback") > -1 ? n = !0 : e[a].indexOf("unionfile") > -1 && (i = e[a]));
                if (b.information("executeCmdLine", t, n, i), t && i) return void (yield S.DownloadAndPlayUnionNS.createUnionPlayTasks(i, t));
                if (n && i) return void (yield I.ThunderUnionYunFetchBackNS.createYunFetchBackTask(i));
                let a = {};
                for (let t of e) {
                    if ("" === t) continue;
                    let i = "", n = "";
                    if (yield u.FileSystemAWNS.existsAW(t)) i = "path", n = t; else if (s.URLHelperNS.isSupportUrl(t)) i = "url", n = t; else {
                        let e = t.indexOf(":");
                        -1 === e ? i = t : e > 1 && (i = t.substring(1, e), e !== t.length - 1 && (n = t.substring(e + 1)))
                    }
                    this.onCommand(i, n, "command").catch(), k.default.fireEvent(d.NodeEventMesssageNS.eventOnCommand, e), a[i] = n
                }
                C.server.fireClientEvent(d.NodeEventMesssageNS.eventOnCommandline, a)
            })
        }
    };
    t.default = A
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(9), o = i(31), r = i(22), s = i(38), l = i(0).default.getLogger("DownloadMode");
    !function (e) {
        let t = void 0, i = void 0;

        function d() {
            void 0 !== t && (clearTimeout(t), t = void 0), void 0 !== i && (clearTimeout(i), i = void 0)
        }

        function u(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, i = 2048;
            if (t = Number(e.maxDownloadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", t), i = Number(e.maxUploadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", i), 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", i) : 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, i = e.limitTime[1].value, n = 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", i), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", n), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", o)
            }
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "0")
        }

        e.handleCustomDownloadMode = function e() {
            if ("1" === c()) return;
            d();
            let n = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024),
                o = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024),
                r = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1);
            if (l.information("handleCustomDownloadMode Enter maxDownloadSpeed = ", n, ", maxUploadSpeed = ", o, ", timeSwitch = ", r), r) {
                let r = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)),
                    s = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)),
                    l = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)),
                    d = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)), c = new Date,
                    h = c.getHours(), f = c.getMinutes(), g = c.getSeconds();
                (r > l || r === l && s > d) && (l += 24), (h > l || h === l && f > d) && (r += 24, l += 24);
                let p = 60 * h + f, v = 60 * r + s, m = 60 * l + d;
                if (v <= p && p < m) u(n, o), i = setTimeout(() => {
                    u(-1, -1), clearTimeout(i), i = void 0, e()
                }, 6e4 * (m - p)); else {
                    u(-1, -1), t = setTimeout(() => {
                        u(n, o), clearTimeout(t), t = void 0
                    }, 6e4 * (v - p));
                    let a = m - p;
                    a = a ? 6e4 * a : 1e3 * (60 - g), i = setTimeout(() => {
                        u(-1, -1), clearTimeout(i), i = void 0, e()
                    }, a)
                }
            } else u(n, o)
        }, 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), d()
        }, e.setFreeDownLoadConfig = function (e) {
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_IdleDownload", e)
        }, e.setCustomDownloadMode = h, e.showCustomDownloadModeDlg = function () {
            return n(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),
                    i = yield r.MessageBox.custom("CustomDownloadMode", {
                        title: "限制我的下载速度",
                        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)}]
                        }
                    });
                return i.action === s.MessageBoxNS.Action.OK && (h(i.args), !0)
            })
        }
    }(t.DownloadModeNS || (t.DownloadModeNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(19), r = i(5), s = i(16), l = i(0), d = i(144), u = i(3), c = i(14), h = i(29), f = i(84),
        g = i(33), p = i(11), v = "vip-download", m = "ThunderPanPlugin", y = "ThunderIM", k = [v, m, y],
        T = l.default.getLogger("plugin-ui-webview");

    class w extends o.EventEmitter {
        constructor() {
            super(), this.webviewInfoMap = {}, this.vipPluginEnable = !1, this.activeTasks = [], this.activeContainerMap = {}, this.webviewCreatedMap = {}, this.isSorting = !1
        }

        isVipPluginEnable() {
            return this.vipPluginEnable
        }

        setSorting(e) {
            this.isSorting = e
        }

        getActiveTaskId() {
            let e = void 0;
            do {
                let t = this.activeTasks.length;
                if (0 === t) break;
                if (e = this.activeTasks[t - 1], !this.activeContainerMap[e]) {
                    e = void 0;
                    break
                }
            } while (0);
            return e
        }

        showTaskAdWebview(e, t) {
            do {
                if (!this.vipPluginEnable) break;
                this.activeContainerMap[e] ? (T.information("webview alreay in map", e, this.activeTasks, this.activeContainerMap), this.show()) : (this.activeTasks.push(e), this.activeContainerMap[e] = t, this.show())
            } while (0)
        }

        show() {
            do {
                if (this.isSorting) break;
                let e = this.activeTasks.length;
                if (0 === e) break;
                let t = this.activeTasks[e - 1], i = this.activeContainerMap[t];
                if (!i) break;
                if (!i.isShowExpand) break;
                this.updateTaskAdWebview(), document.querySelector(`#webview_${v}`).parentElement.style.opacity = "1"
            } while (0)
        }

        updateTaskAdWebview() {
            do {
                if (this.isSorting) break;
                let e = this.activeTasks.length;
                if (0 === e) break;
                let t = this.activeTasks[e - 1], i = this.activeContainerMap[t];
                if (!i) break;
                if (!i.isShowExpand) break;
                let n = document.querySelector(`#webview_${v}`), a = n.parentElement, o = a.parentElement,
                    r = i.$el.parentElement.parentElement;
                if (!r) break;
                let s = i.$refs.pluginPlaceholder;
                if (!s) break;
                let l = r.getBoundingClientRect(), d = l.top, u = document.querySelector(".xly-side"), c = l.height;
                void 0 !== u && null !== u && (c = u.clientHeight - 40);
                let h = `position:absolute;left: 0px;top: ${d - 42}px;\n        width: ${l.width}px;height: ${c}px; overflow:hidden;`;
                o.style = h;
                let f = s.getBoundingClientRect(),
                    g = `position:absolute;left: ${s.offsetLeft}px; top: ${f.top - d}px;\n      width: ${f.width}px; height: 40px; z-index: 1;`;
                a.style = g;
                {
                    let e = n.shadowRoot.childElementCount;
                    for (let t = 0; t < e; t++) {
                        let e = n.shadowRoot.children[t];
                        if (!e) break;
                        if (e.type && "application/browser-plugin" === e.type.toLowerCase()) {
                            e.style = "width: 284px; height: 100%;";
                            break
                        }
                    }
                }
                T.information("show webview", f, g)
            } while (0)
        }

        hideTaskAdWebview(e) {
            do {
                if (!this.vipPluginEnable) break;
                let t = "-10000px",
                    i = `position:absolute;left: ${t};top: 142px;width: 540px;height: 40px; z-index=1; opacity:0;`;
                if (void 0 === e) {
                    let e = document.querySelector(`#webview_${v}`).parentElement;
                    e.style.left !== t && (e.style = i);
                    break
                }
                if (0 === this.activeTasks.length) break;
                let n = this.activeTasks.indexOf(e);
                if (delete this.activeContainerMap[e], -1 !== n && this.activeTasks.splice(n, 1), document.querySelector(`#webview_${v}`).parentElement.style.left === t) break;
                if (T.information("active hide", this.activeTasks.length, e, this.activeTasks), 0 === this.activeTasks.length) {
                    document.querySelector(`#webview_${v}`).parentElement.style = i
                }
            } while (0)
        }

        create(e, t, i) {
            let n = [!1, ""];
            switch (-1 === k.indexOf(t) && (n = [!1, `support for ${t} will coming soon`]), t) {
                case v:
                    n = e.name === v ? this.createTaskAdWebview(t, i) : [!1, "the client can not create this webview"];
                    break;
                case m:
                    e.name === m ? (n = this.createPanWebview(t, i), this.emit("create_pan_tab")) : n = [!1, "the client can not create this webview"];
                    break;
                case y:
                    e.name === y ? (n = this.createMessageWebView(t, i), this.emit("create_message_view")) : n = [!1, "the client can not create this webview"]
            }
            return T.information("create webview", n), n
        }

        attachDownloadItemActiveChange() {
            h.default.attachListener(c.NodeEventMesssageNS.eventDownloadItemActive, (e, t, i, n, a, o) => {
                if (e === u.DownloadKernel.CategroyViewID.Downloading) if (t) {
                    let e = n.__vue__;
                    e && e.$nextTick(() => {
                        this.showTaskAdWebview(i, e)
                    })
                } else this.hideTaskAdWebview(i)
            })
        }

        createTaskAdWebview(e, t) {
            let i = [!1, ""];
            do {
                let o = `webview_${v}`;
                if (document.querySelector(`#${o}`)) {
                    i = this.webviewCreatedMap[o] === e ? [!0, "success"] : [!1, `webview already created by other ${this.webviewCreatedMap[o]}`];
                    break
                }
                let r = document.createElement("webview");
                r.spellcheck = !1, r.nodeintegration = !0, r.id = o, r.style = "height: 100%; width: 100%;", r.src = t.src, r.preload = `file:///${__rootDir}/out/plugin-boot.js`, r.addEventListener("did-finish-load", () => n(this, void 0, void 0, function* () {
                    let e = r.getWebContentsId(), t = yield(yield p.asyncRemoteCall.getWebContents()).fromId(e);
                    if (t && !(yield t.isDestroyed())) {
                        let e = yield t.getOSProcessId(), i = yield t.getURL();
                        a.ipcRenderer.send(g.ThunderChannelList.channelRMSetEnvironmentVariable, e.toString(), i), t.once("destroyed", () => {
                            a.ipcRenderer.send(g.ThunderChannelList.channelRMSetEnvironmentVariable, e.toString())
                        })
                    }
                })), document.querySelector("#webview_container").appendChild(r), i = [!0, "success"], this.webviewCreatedMap[o] = e, r.addEventListener("dom-ready", e => {
                    this.vipPluginEnable = !0, this.emit("vip_plugin_enable", this.vipPluginEnable)
                }), this.attachDownloadItemActiveChange(), window.addEventListener("keyup", e => {
                    "F12" === e.key && e.altKey && f.DevEnvHelperNS.isDevToolsEnable() && r && r.openDevTools()
                }, !0)
            } while (0);
            return i
        }

        createPanWebview(e, t) {
            let o = [!1, ""];
            do {
                let s = `webview_${t.id}`;
                if (s || (s = `webview_${m}`), document.querySelector(`#${s}`)) {
                    o = this.webviewCreatedMap[s] === e ? [!0, "success"] : [!1, `webview already created by other ${this.webviewCreatedMap[s]}`];
                    break
                }
                let l = document.createElement("webview");
                l.spellcheck = !1, l.nodeintegration = !0, "development" !== process.env.RUN_ENV && (l.disablewebsecurity = !0), l.id = s, l.style = "height: 100%; width: 100%;", l.src = t.src, l.preload = `file:///${__rootDir}/out/plugin-boot.js`, l.addEventListener("did-finish-load", () => n(this, void 0, void 0, function* () {
                    let e = l.getWebContentsId(), t = yield(yield p.asyncRemoteCall.getWebContents()).fromId(e);
                    if (t && !(yield t.isDestroyed())) {
                        let e = yield t.getOSProcessId(), i = yield t.getURL();
                        a.ipcRenderer.send(g.ThunderChannelList.channelRMSetEnvironmentVariable, e.toString(), i), t.once("destroyed", () => {
                            a.ipcRenderer.send(g.ThunderChannelList.channelRMSetEnvironmentVariable, e.toString())
                        })
                    }
                })), document.querySelector("#pan-18BE0BEB-6C82-4D16-83C8-5566BE72D176").appendChild(l), o = [!0, "success"], this.webviewCreatedMap[s] = e, l.addEventListener("dom-ready", e => n(this, void 0, void 0, function* () {
                    let e = l.getWebContentsId(), t = yield(yield p.asyncRemoteCall.getWebContents()).fromId(e);
                    t && t.on("context-menu", (e, t) => {
                        d.ContextMenuNS.popContextMenu(e, t)
                    })
                })), l.addEventListener("new-window", e => {
                    let t = e.url;
                    const n = i(46).parse(t).protocol;
                    "http:" !== n && "https:" !== n || r.client.callServerFunction("openNewTab", t).catch()
                }), window.addEventListener("keyup", e => {
                    "F12" === e.key && e.shiftKey && f.DevEnvHelperNS.isDevToolsEnable() && l && l.openDevTools()
                }, !0), window.addEventListener("resize", () => {
                })
            } while (0);
            return o
        }

        createMessageWebView(e, t) {
            let i = [!1, ""];
            return this.webviewInfoMap[y] = t, i = [!0, "success"], s.server.fireClientEvent("CreateMessageWebViewEnd"), i
        }

        getWebViewInfo(e) {
            return this.webviewInfoMap[e] || {}
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(19), r = i(0), s = i(3), l = i(64), d = i(12), u = i(604), c = i(41), h = i(32), f = i(14),
        g = i(10), p = i(47), v = i(71), m = i(9), y = i(22), k = i(121), T = i(354), w = i(26), C = i(86), S = i(65),
        I = i(466), b = i(37), _ = i(29), D = i(4), A = i(2), N = i(142), x = i(38), E = i(78), P = i(24), O = i(16),
        M = i(122), F = i(5), L = i(39), R = r.default.getLogger("Thunder.ContextMenu"),
        B = w.DownloadKernelCategoryManager.getCategoryManager(), U = d.DownloadKernelTaskManager.getTaskManager(),
        K = I.GroupAccelerateWebManagerNS.getManager(), V = N.SubtitleManagerNS.getSubtitleManger();
    var W;
    !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"
    }(W = t.DownloadMenuType || (t.DownloadMenuType = {}));
    t.downloadContextMenu = new class {
        constructor() {
            this.contextInfo = null, this.count = 0, this.categoryId = -1, this.emitter = null, this.searchMode = !1, this.shouleiDownloadEnable = !0, this.emitter = new o.EventEmitter, this.menuEventClients = {}
        }

        registerMenuEvent(e, t) {
            this.menuEventClients.hasOwnProperty(String(e)) ? this.menuEventClients[e].push(t) : this.menuEventClients[e] = [].concat(t)
        }

        unRegisterMenuEvent(e, t) {
            if (void 0 === e) for (let e in this.menuEventClients) {
                let i = this.menuEventClients[e];
                for (let n = 0; n < i.length; n++) if (i[n] === t) {
                    this.menuEventClients[e].splice(n, 1);
                    break
                }
            } else {
                let i = this.menuEventClients[e];
                for (let n = 0; n < i.length; n++) if (i[n] === t) {
                    this.menuEventClients[e].splice(n, 1);
                    break
                }
            }
        }

        setContextInfo(e, t, i, n) {
            this.contextInfo = e, D.isNullOrUndefined(i) || (this.count = i), D.isNullOrUndefined(t) || (this.categoryId = t), D.isNullOrUndefined(n) ? this.searchMode = !1 : this.searchMode = n
        }

        canShare() {
            let e = !0;
            do {
                let t = this.getSelectdTaskInfos();
                if (!t) {
                    e = !1;
                    break
                }
                if (1 !== t.length) {
                    e = !1;
                    break
                }
                let i = t[0];
                if (i.taskStatus === s.DownloadKernel.TaskStatus.Failed || i.taskStatus === s.DownloadKernel.TaskStatus.Unkown) {
                    e = !1;
                    break
                }
                if (i.taskType === s.DownloadKernel.TaskType.Group) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        canDownloadByShoulei() {
            let e = !0;
            do {
                if (0 === P.default.getConfigInfo("shouleiDownload", "enable") && (this.shouleiDownloadEnable = !1), !this.shouleiDownloadEnable) {
                    e = !1;
                    break
                }
                if (null === this.contextInfo) {
                    e = !1;
                    break
                }
                let t = this.getSelectdTaskInfos();
                if (!t) {
                    e = !1;
                    break
                }
                if (t.length > 1) {
                    e = !1;
                    break
                }
                let i = t[0];
                if (!i || i.taskType === s.DownloadKernel.TaskType.Group) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        handleDownloadByShoulei() {
            return n(this, void 0, void 0, function* () {
                let e = "https://mobile.xunlei.com/m/channel.html?from=xunlei10daoliang";
                if (this.canDownloadByShoulei()) {
                    let t = this.getSelectdTaskInfos()[0];
                    e = yield M.getShouleiShareLinkDlj(t.taskId, "pic", "leftlist_rk_phone")
                }
                y.MessageBox.custom("ShouleiQRCode", {data: e}).catch()
            })
        }

        handleShouleiFileTransfer() {
            return n(this, void 0, void 0, function* () {
                let e = this.getSelectdTaskInfos()[0];
                c.TaskCtrlOperatorNS.shouleiFileTransfer(e).catch()
            })
        }

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

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

        popMenu(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = [];
                switch (e) {
                    case W.DownloadingCategory: {
                        let e = this.contextInfo.canStartAll;
                        i = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadSelectAll,
                            statId: "dl_downloading_more_btn_click",
                            extData: "clickid=all_select"
                        }, {
                            type: "normal",
                            label: "全部开始",
                            enabled: e,
                            id: u.ContextMenuIdsNS.contextMenuDownloadStartAll,
                            statId: "dl_downloading_more_btn_click",
                            extData: "clickid=all_start"
                        }, {
                            type: "normal",
                            label: "全部暂停",
                            id: u.ContextMenuIdsNS.contextMenuDownloadPauseAll,
                            statId: "dl_downloading_more_btn_click",
                            extData: "clickid=all_pause"
                        }];
                        let t = this.contextInfo.currentCategoryId;
                        B.isPrivateCategory(t) && i.push({
                            type: "normal",
                            label: "私人空间下载设置",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting
                        }, {
                            type: "normal",
                            label: "修改私人空间密码",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange
                        })
                    }
                        break;
                    case W.CompletedCategory: {
                        let e = this.contextInfo.currentCategoryId,
                            t = l.TaskStatusHelper.canMarkAsOpened(this.contextInfo.completedTaskBaseList);
                        i = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadSelectAll,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=all_select"
                        }, {
                            type: "normal",
                            label: "删除不存在任务",
                            id: u.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=delete_invalid"
                        }, {
                            type: "normal",
                            label: "全部标记为已打开",
                            id: u.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                            enabled: t,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=all_mark_open"
                        }, {
                            type: "submenu",
                            label: "筛选任务",
                            submenu: yield T.CompletedFilterNS.getMenuOptions(e, this.contextInfo.onFilterMenuClick)
                        }], -1 !== e && (i = [{
                            type: "normal",
                            label: "全部标记为已打开",
                            id: u.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                            enabled: t,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=all_mark_open"
                        }])
                    }
                        break;
                    case W.RecycleCategory: {
                        let e = !0;
                        null === this.contextInfo ? e = !1 : 0 === this.contextInfo.recycleTaskBaseList.length && (e = !1), i = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadSelectAll,
                            statId: "dl_rubbish_more_btn_click",
                            extData: "clickid=all_select"
                        }, {
                            type: "normal",
                            label: "清空回收站",
                            id: u.ContextMenuIdsNS.contextMenuDownloadClear,
                            enabled: e,
                            statId: "dl_rubbish_more_btn_click",
                            extData: "clickid=clear_empty"
                        }]
                    }
                        break;
                    case W.DownloadingBlank:
                        i = [{
                            type: "normal",
                            label: "导入未完成任务(&I)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadImportUncomplete
                        }];
                        break;
                    case W.DownloadingItem: {
                        let e = this.getSelectdTaskInfos();
                        if (null !== e && e.length > 0) {
                            let t = [], n = l.TaskStatusHelper.canMoveSelectedTask(void 0, e);
                            -1 === this.categoryId ? (t = yield this.getLastestSavePathsOptions(n, "MoveToDir", "LatestSavePath"), -1 === e[0].categoryId && t.push({
                                type: "normal",
                                label: "私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), t.push({
                                type: "normal",
                                label: "其他目录",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "downloading_rk_move_click",
                                extData: "button=other"
                            })) : t.push({
                                type: "normal",
                                label: "移出私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            });
                            let a = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e);
                            if (i = [], !this.canShare() || -1 !== e[0].categoryId && -1 === this.categoryId || i.push({
                                type: "normal",
                                label: "分享",
                                id: u.ContextMenuIdsNS.contextMenuDownloadShare,
                                statId: "downloading_rk_share_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }), -1 === this.categoryId ? (-1 === e[0].categoryId && i.push({
                                type: "normal",
                                label: "删除(&D)",
                                enabled: a,
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "downloading_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }), i.push({
                                type: "normal",
                                label: "彻底删除(&Q)",
                                enabled: a,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {type: "submenu", label: "移动文件到", submenu: t})) : i.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                enabled: a,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {
                                type: "submenu",
                                label: "移动文件到",
                                submenu: t
                            }), !this.searchMode && this.count > 3 && e.length !== this.count && i.splice(4, 0, {type: "separator"}, {
                                type: "normal",
                                label: "上移到顶部",
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveTop
                            }, {
                                type: "normal",
                                label: "下移到底部",
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveBottom
                            }, {type: "separator"}), 1 === e.length) {
                                if (l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e)) i.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadPause,
                                    statId: "downloading_rk_pause_click"
                                }); else {
                                    let t = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e);
                                    i.unshift({
                                        type: "normal",
                                        label: "开始(&S)",
                                        enabled: t,
                                        icon: `${__rootDir}/static/icon/startalltask.png`,
                                        id: u.ContextMenuIdsNS.contextMenuDownloadStart,
                                        statId: "downloading_rk_start_click"
                                    })
                                }
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(e[0]),
                                    n = U.getTaskFromTaskId(e[0].taskId).isSupportPlay(), a = 1;
                                n && (i.unshift({
                                    type: "normal",
                                    label: "播放(&O)",
                                    icon: `${__rootDir}/static/icon/play.png`,
                                    id: u.ContextMenuIdsNS.contextMenuPlayFile,
                                    statId: "downloading_rk_playfiles_click",
                                    visible: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), ++a), i.splice(a, 0, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    icon: `${__rootDir}/static/icon/openfolder.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    extData: this.searchMode ? void 0 : this.getOpenFolderExtData(),
                                    statId: "downloading_rk_openfolders_click",
                                    visible: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), ++a, this.searchMode && (i.splice(3, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: u.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), ++a), n ? i.splice(a, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: u.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "downloading_rk_subtitlesearch_click"
                                }, {type: "separator"}) : i.splice(a, 0, {type: "separator"}), e[0].taskType === s.DownloadKernel.TaskType.Bt ? (i.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "downloading_rk_torrentsave_click"
                                }), -1 !== e[0].categoryId && -1 === this.categoryId || i.push({
                                    type: "normal",
                                    label: "复制下载链接",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "downloading_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })) : -1 !== e[0].categoryId && -1 === this.categoryId || i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            } else {
                                let t = l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e),
                                    n = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e);
                                t && i.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadPause
                                }), n && i.unshift({
                                    type: "normal",
                                    label: "开始(&S)",
                                    icon: `${__rootDir}/static/icon/startalltask.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadStart
                                });
                                let a = l.TaskStatusHelper.canCopySelectTaskLink(e);
                                i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    enabled: a,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            }
                        }
                    }
                        break;
                    case W.CompletedItem: {
                        let e = this.getSelectdTaskInfos();
                        if (null !== e && e.length > 0) {
                            i = [];
                            let t = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e),
                                n = l.TaskStatusHelper.canMoveSelectedTask(void 0, e);
                            if (-1 === this.categoryId ? (-1 === e[0].categoryId && i.push({
                                type: "normal",
                                label: "删除(&D)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "finished_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), i.push({
                                type: "normal",
                                label: "彻底删除(&Q)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "finished_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), -1 === e[0].categoryId && i.push({
                                type: "normal",
                                label: "重新下载(&T)",
                                icon: `${__rootDir}/static/icon/redownload.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadRedownload,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            })) : i.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), -1 === this.categoryId) {
                                let e = yield this.getLastestSavePathsOptions(!0, "CopyToDir", "LatestSavePath", !0);
                                e.push({
                                    type: "normal",
                                    label: "其他目录",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyFileOther,
                                    statId: "finished_rk_copyfiles_click",
                                    extData: "button=other"
                                }), i.splice(2, 0, {type: "submenu", label: "复制文件到", submenu: e})
                            }
                            let a = [];
                            if (-1 === this.categoryId ? (a = yield this.getLastestSavePathsOptions(n, "MoveToDir", "LatestSavePath"), -1 === e[0].categoryId && a.push({
                                type: "normal",
                                label: "私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), a.push({
                                type: "normal",
                                label: "其他目录",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "finished_rk_move_click",
                                extData: "button=other"
                            })) : a.push({
                                type: "normal",
                                label: "移出私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), i.splice(2, 0, {type: "separator"}, {
                                type: "submenu",
                                label: "移动文件到",
                                submenu: a
                            }), 1 === e.length) {
                                i.splice(2, 0, {
                                    type: "normal",
                                    label: "重命名(&R)",
                                    enabled: !e[0].isMoving,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadRename,
                                    statId: "finished_rk_rename_click"
                                });
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(e[0]),
                                    n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(e[0]),
                                    a = yield c.TaskCtrlOperatorNS.canOpenAsSelectedTaskFile(e[0]);
                                i.splice(0, 0, {
                                    type: "normal",
                                    label: "打开方式",
                                    icon: `${__rootDir}/static/icon/openas.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadOpenAs,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    statId: "finished_rk_openas_click",
                                    visible: a,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    icon: `${__rootDir}/static/icon/openfolder.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    extData: this.searchMode ? void 0 : this.getOpenFolderExtData(),
                                    statId: "finished_rk_openfolders_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    visible: t,
                                    userData: this.searchMode
                                });
                                let o = U.getTaskFromTaskId(e[0].taskId).isSupportPlay();
                                o ? i.splice(0, 0, {
                                    type: "normal",
                                    label: "播放(&O)",
                                    icon: `${__rootDir}/static/icon/play.png`,
                                    id: u.ContextMenuIdsNS.contextMenuPlayFile,
                                    statId: "finished_rk_playfiles_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    visible: n,
                                    userData: this.searchMode
                                }) : i.splice(0, 0, {
                                    type: "normal",
                                    label: "打开文件(&O)",
                                    icon: `${__rootDir}/static/icon/open.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFile,
                                    statId: "finished_rk_openfiles_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    visible: n,
                                    userData: this.searchMode
                                });
                                let r = 3;
                                this.searchMode && i.splice(r, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: u.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                }), o ? i.splice(r, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: u.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "finished_rk_subtitlesearch_click"
                                }, {type: "separator"}) : i.splice(r, 0, {type: "separator"}), e[0].taskType === s.DownloadKernel.TaskType.Bt ? (i.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "finished_rk_torrent_click"
                                }), -1 !== e[0].categoryId && -1 === this.categoryId || i.push({
                                    type: "normal",
                                    label: "复制下载链接",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "finished_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })) : -1 !== e[0].categoryId && -1 === this.categoryId || i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            } else {
                                let t = l.TaskStatusHelper.canCopySelectTaskLink(e);
                                i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            }
                            let o = i.findIndex(e => e.id === u.ContextMenuIdsNS.contextMenuDownloadDelete);
                            -1 === o && (o = i.findIndex(e => e.id === u.ContextMenuIdsNS.contextMenuDownloadDestroy)), !this.canShare() || -1 !== e[0].categoryId && -1 === this.categoryId || i.splice(o++, 0, {
                                type: "normal",
                                label: "分享",
                                id: u.ContextMenuIdsNS.contextMenuDownloadShare,
                                statId: "finished_rk_share_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            })
                        }
                    }
                        break;
                    case W.RecycleBlank: {
                        let e = !0;
                        this.contextInfo && this.contextInfo.recycleTaskBaseList && 0 === this.contextInfo.recycleTaskBaseList.length && (e = !1), i = [{
                            type: "normal",
                            label: "清空(&B)",
                            enabled: e,
                            id: u.ContextMenuIdsNS.contextMenuDownloadClear
                        }]
                    }
                        break;
                    case W.RecycleItem: {
                        let e = this.getSelectdTaskInfos();
                        if (null !== e && e.length > 0) if (i = [{
                            type: "normal",
                            label: "打开任务位置(&G)",
                            id: u.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                            statId: "openfile_position_click",
                            userData: this.searchMode,
                            categoryView: s.DownloadKernel.CategroyViewID.Recycle
                        }, {
                            type: "normal",
                            label: "还原(&R)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadRecover,
                            statId: "dustbin_rk_undo_click"
                        }, {
                            type: "normal",
                            label: "清空(&B)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadClear,
                            statId: "dustbin_rk_clear_click"
                        }, {
                            type: "normal",
                            label: "彻底删除(&Q)",
                            icon: `${__rootDir}/static/icon/destroytask.png`,
                            id: u.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: u.ContextMenuIdsNS.contextMenuDownloadRedownload
                        }], this.searchMode || i.shift(), 1 === e.length) {
                            let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(e[0]), n = e[0].taskStatus;
                            if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                                let n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(e[0]),
                                    a = yield c.TaskCtrlOperatorNS.canOpenAsSelectedTaskFile(e[0]);
                                i.splice(2, 0, {type: "separator"}, {
                                    type: "normal",
                                    label: "打开文件(&O)",
                                    icon: `${__rootDir}/static/icon/open.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFile,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                    statId: "dustbin_rk_openfiles_click",
                                    visible: n,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开方式",
                                    icon: `${__rootDir}/static/icon/openas.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadOpenAs,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                    statId: "dustbin_rk_openas_click",
                                    visible: a,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    icon: `${__rootDir}/static/icon/openfolder.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "dustbin_rk_openfolders_click",
                                    visible: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                })
                            } else i.splice(2, 0, {type: "separator"}, {
                                type: "normal",
                                label: "打开文件夹(&F)",
                                icon: `${__rootDir}/static/icon/openfolder.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                statId: "dustbin_rk_openfolders_click",
                                visible: t,
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            });
                            e[0].taskType === s.DownloadKernel.TaskType.Bt ? i.push({
                                type: "normal",
                                label: "种子文件另存为(&C)",
                                id: u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs
                            }, {
                                type: "normal",
                                label: "复制下载链接",
                                id: u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }) : i.push({
                                type: "normal",
                                label: "复制下载链接(&C)",
                                id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                statId: "dustbin_rk_copyurl_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            });
                            let a = [];
                            !this.canShare() || -1 !== e[0].categoryId && -1 === this.categoryId || a.push({
                                type: "normal",
                                label: "分享",
                                id: u.ContextMenuIdsNS.contextMenuDownloadShare,
                                statId: "dustbin_rk_share_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }), a.length > 0 && (a.splice(0, 0, {type: "separator"}), i.splice(2, 0, ...a))
                        } else {
                            i.splice(1, 0, {type: "separator"});
                            let t = l.TaskStatusHelper.canCopySelectTaskLink(e);
                            i.push({
                                type: "normal",
                                label: "复制下载链接(&C)",
                                id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                statId: "dustbin_rk_copyurl_click",
                                enabled: t,
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            })
                        }
                    }
                        break;
                    case W.ToolbarMore:
                        if (null !== this.contextInfo) {
                            let e = this.getSelectdTaskInfos(), t = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e);
                            i = [{
                                type: "normal",
                                label: "彻底删除任务",
                                id: u.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/help.png`,
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreOpenHelp,
                                statId: "top_help_click",
                                extData: "button=dl_panel"
                            }, {
                                type: "normal",
                                label: "设置中心",
                                icon: `${__rootDir}/static/icon/config.png`,
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreConfig,
                                statId: "top_morelist_click",
                                extData: "button=setting"
                            }, {
                                type: "normal",
                                label: "搜索下载记录",
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch,
                                statId: "top_morelist_click",
                                extData: "button=searchtask"
                            }], g.XLStatNS.trackEvent("download_detail", "help_tips_entry_show", "", 0, 0, 0, 0, "position=dl_page")
                        }
                        break;
                    case W.ChangeCategory: {
                        let e = this.contextInfo.currentCategoryId;
                        i = [{
                            type: "checkbox",
                            label: "我的电脑",
                            id: u.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer,
                            checked: -1 === e,
                            statId: "top_dropdownlist_click",
                            extData: "button=computer"
                        }, {
                            type: "checkbox",
                            label: "私人空间",
                            id: u.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace,
                            checked: -1 !== e,
                            statId: "top_dropdownlist_click",
                            extData: "button=private"
                        }]
                    }
                        break;
                    case W.PrivateSpaceHome:
                        i = [{
                            type: "normal",
                            label: "全选",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll
                        }, {
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {type: "separator"}, {
                            type: "normal",
                            label: "私人空间下载设置",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting
                        }, {
                            type: "normal",
                            label: "修改私人空间密码",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange
                        }];
                        break;
                    case W.SearchMultiSel: {
                        let e = this.contextInfo.currentSelSearchTaskInfos,
                            t = l.TaskStatusHelper.canCopySelectTaskLink(e);
                        i = [{
                            type: "normal",
                            label: "删除(&D)",
                            icon: `${__rootDir}/static/icon/deletetask.png`,
                            id: u.ContextMenuIdsNS.contextMenuDownloadDelete,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "彻底删除(&Q)",
                            icon: `${__rootDir}/static/icon/destroytask.png`,
                            id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "复制下载链接(&C)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                            enabled: t,
                            userData: this.searchMode
                        }]
                    }
                }
                this.popMenuInternal(i, e, t).catch()
            })
        }

        getSortConfig(e) {
            let t = {sortBy: k.SortNS.SortType.Default, asce: !0};
            do {
                if (null === e || void 0 === e) break;
                let i = e.currentCategoryViewId;
                if (null === i || void 0 === i) break;
                let n = e.currentCategoryId;
                t = k.SortNS.getSortConfig(i, n)
            } while (0);
            return t
        }

        getSortSubMenuOptions(e) {
            let t = [];
            do {
                if (null === e || void 0 === e) break;
                let i = e.currentCategoryViewId;
                if (null === i || void 0 === i) break;
                let n = this.getSortConfig(e);
                R.information("sort_by", n);
                let a = n.sortBy === k.SortNS.SortType.ByTime_Remain || n.sortBy === k.SortNS.SortType.ByTime_Creation || n.sortBy === k.SortNS.SortType.ByTime_Completion,
                    o = "按时间", r = "";
                i === s.DownloadKernel.CategroyViewID.Downloading ? (o = "按创建时间", r = "downloading_rk_rank_click") : i === s.DownloadKernel.CategroyViewID.Completed ? (o = "按完成时间", r = "finished_rk_rank_click") : i === s.DownloadKernel.CategroyViewID.Recycle && (o = "按删除时间", r = "dustbin_rk_rank_click"), t = [{
                    type: "checkbox",
                    label: "默认",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault,
                    statId: r,
                    extData: "rank_type=default",
                    checked: n.sortBy === k.SortNS.SortType.Default
                }, {
                    type: "checkbox",
                    label: o,
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime,
                    checked: a,
                    statId: r,
                    extData: "rank_type=create_time",
                    userData: a ? n.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件名 A-Z",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByName,
                    checked: n.sortBy === k.SortNS.SortType.ByName,
                    statId: r,
                    extData: "rank_type=file_name",
                    userData: n.sortBy === k.SortNS.SortType.ByName ? n.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件大小",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize,
                    checked: n.sortBy === k.SortNS.SortType.BySize,
                    statId: r,
                    extData: "rank_type=file_size",
                    userData: n.sortBy === k.SortNS.SortType.BySize ? n.asce : void 0
                }], i === s.DownloadKernel.CategroyViewID.Downloading && t.splice(2, 0, {
                    type: "checkbox",
                    label: "按当前进度",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress,
                    checked: n.sortBy === k.SortNS.SortType.ByProgress,
                    statId: r,
                    extData: "rank_type=progress_speed",
                    userData: n.sortBy === k.SortNS.SortType.ByProgress ? n.asce : void 0
                })
            } while (0);
            return t
        }

        getLastestSavePathsOptions(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let n = m.ConfigNS.getValue(t, i, []), o = [],
                    r = u.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest;
                a && (r = u.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest);
                for (let t of n) {
                    let i = /&/gi;
                    t = t.replace(i, "&&"), o.push({type: "normal", label: t, enabled: e, id: r})
                }
                return o
            })
        }

        getOpenFolderExtData() {
            let e = "";
            do {
                let t = this.getSelectdTaskInfos();
                if (!t || 0 === t.length) break;
                let i = t[0];
                if (i.taskType === s.DownloadKernel.TaskType.Bt) e = "folder_type=bt"; else if (i.taskType === s.DownloadKernel.TaskType.Group) e = "folder_type=task_group"; else {
                    let t = A.extname(i.taskName);
                    t && t.length > 1 && (t = t.length > 10 ? "" : t.slice(1)), e = `folder_type=${t || ""}`
                }
            } while (0);
            return e
        }

        handleMenuClick(e) {
            let t = e.id, i = e.label, a = e.categoryView;
            switch (t) {
                case u.ContextMenuIdsNS.contextMenuDownloadSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.completedTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        h.TaskOperatorNs.removeNonExistingTask(e).catch(e => {
                            R.warning(e)
                        })
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadAsReadedAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.completedTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        h.TaskOperatorNs.markReadStatus(e, 1)
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadImportUncomplete:
                    h.TaskOperatorNs.importUncompleted().catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadFolder: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfolders_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && (h.TaskOperatorNs.openTaskFolder(t[0]).catch(e => {
                        R.warning(e)
                    }), void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(t, 1))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuGroupAccelerate: {
                    let e = this.getSelectdTaskInfos();
                    a === s.DownloadKernel.CategroyViewID.Downloading ? K.openGroupAccelerateTabByTaskId(e[0].taskId, "menu", "downloading", void 0).catch() : K.openGroupAccelerateTabByTaskId(e[0].taskId, "menu", "complete", void 0).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contxtMenuSubtitleSearch: {
                    let e = this.getSelectdTaskInfos()[0].taskId, t = U.getTaskFromTaskId(e), i = t.getTaskName(),
                        n = t.getType(), a = "";
                    t && (a = t.getSavePath()), n === s.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (a = A.join(a, i));
                    let o = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId), r = V.getDisaplayName(e),
                        l = 0;
                    (l = r.length) > 1 ? y.MessageBox.custom("SubtitleTaskFilelist", {
                        size: "large",
                        taskId: e,
                        taskName: i,
                        taskType: n,
                        fileList: r,
                        saveDir: a,
                        categoryViewId: o
                    }, {
                        center: !0,
                        width: 500,
                        height: 329
                    }).catch() : y.MessageBox.custom("SubtitleSearch", {
                        taskId: e,
                        taskName: r[0].fileName,
                        cid: r[0].cid,
                        saveDir: a,
                        from: "taskList",
                        categoryViewId: o
                    }, {center: !0, width: 500, height: 323}).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadStartAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.downloadingTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        -1 === this.categoryId ? h.TaskOperatorNs.startAll() : h.TaskOperatorNs.startCategoryAllTask(this.categoryId)
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadStart: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.startTasks(e)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadPauseAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.downloadingTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        h.TaskOperatorNs.pauseTasks(e, s.DownloadKernel.TaskStopReason.PauseAll)
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadPause: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.pauseTasks(e, s.DownloadKernel.TaskStopReason.Manual)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadDelete: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_delete_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos(), i = [], n = [];
                    for (let e = 0; e < t.length; e++) -1 === t[e].categoryId ? i.push(t[e]) : n.push(t[e]);
                    i.length > 0 && h.TaskOperatorNs.deleteTasks(i), n.length > 0 && h.TaskOperatorNs.destroyTasks(n)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadDestroy: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_completedelete_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.destroyTasks(t)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && S.default(!1, !0, "privatespace").then(t => n(this, void 0, void 0, function* () {
                        if (t && "" !== t) {
                            let i = 0;
                            if (!1 === C.PrivateSpaceHelperNS.isPrivateSpaceOpen(t) && 0 !== (i = yield C.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(t))) return;
                            if (0 === (i = yield C.PrivateSpaceHelperNS.openPrivateCategory(t)) && 0 === (i = yield C.PrivateSpaceHelperNS.accessPrivateCategory(t))) {
                                let i = yield C.PrivateSpaceHelperNS.getPrivateSavePath(t);
                                if (i = A.join(i, t), yield h.TaskOperatorNs.move2Dir(e, i, !1)) {
                                    let i = B.getPrivateCategoryFromUserId(t);
                                    i && h.TaskOperatorNs.moveCategoryTask(e, i.getId())
                                }
                            }
                        }
                    })).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = m.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                        null !== t && void 0 !== t && "" !== t || (t = m.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), h.TaskOperatorNs.move2Dir(e, t, !1).then(t => {
                            t && B.getCurrentPrivateCategory() && h.TaskOperatorNs.moveCategoryTask(e, -1)
                        }).catch()
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFileOther: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.move2Dir(e).catch(e => {
                        R.warning(e)
                    })
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = /&&/gi, n = i.replace(t, "&");
                        h.TaskOperatorNs.move2Dir(e, n).catch(e => {
                            R.warning(e)
                        })
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveTop:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_up");
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveBottom:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_down");
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMerge:
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyLink: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_copyurl_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.copyLink(t, this.getPanel(a))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_copyurl_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.copyMagnetLink(t[0], this.getPanel(a))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.saveAsTorrent(e[0]).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuPlayFile: {
                    let t = this.getSelectdTaskInfos();
                    if (-1 === this.categoryId && t.length > 0 && -1 !== t[0].categoryId) {
                        let i = t[0].taskName.split("."), n = i[i.length - 1], a = "video";
                        L.TaskUtilHelper.getTaskFileType(t[0].taskName) === L.TaskUtilHelper.FileExtType.Music && (a = "music"), g.XLStatNS.trackEvent("pc_yunpan", "yunpan_consumption_click", "", 0, 0, 0, 0, "from=" + (e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? "download_left_gotback_play_click" : "download_left_gettingback_play_click") + ",file_type=" + a + ",suffix=" + n)
                    } else !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_playfiles_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let i = "download_left_downloading_rk";
                    e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? i = -1 === this.categoryId && t.length > 0 && -1 !== t[0].categoryId ? "download_getback_complete_play" : "download_left_complate_rk" : -1 === this.categoryId && t.length > 0 && -1 !== t[0].categoryId && (i = "download_getbacking_play"), -1 !== this.categoryId && (i = e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? "download_private_space_local_play" : "download_private_space_bxbb_play"), t.length > 0 && (F.client.callServerFunction("OperateTask", t[0].taskId, "play", {
                        panel: "finished",
                        playFrom: i
                    }).catch(), h.TaskOperatorNs.markReadStatus(t, 1))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadFile: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfiles_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = "";
                    e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? t = "finished" : e.categoryView === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin");
                    let i = this.getSelectdTaskInfos();
                    if (i.length > 0) {
                        let e = i[0];
                        if (e.taskType === s.DownloadKernel.TaskType.Bt) {
                            let t = U.getTaskFromTaskId(e.taskId);
                            p.SingleBtTaskNS.isSingleBtTask(t).then(t => {
                                t ? h.TaskOperatorNs.openTaskItem(e).catch() : h.TaskOperatorNs.openTaskFolder(e, !0).catch()
                            }).catch()
                        } else if (e.taskType === s.DownloadKernel.TaskType.Group) {
                            let t = U.getTaskFromTaskId(e.taskId);
                            h.TaskOperatorNs.executeInstallFile(t).then(t => {
                                t || h.TaskOperatorNs.openTaskFolder(e, !0).catch()
                            }).catch()
                        } else h.TaskOperatorNs.openTaskItem(e, void 0, void 0, t, this.categoryId).catch(e => {
                            R.warning(e)
                        });
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(i, 1)
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadOpenAs:
                    let o = this.getSelectdTaskInfos();
                    if (o.length > 0) {
                        let e = o[0];
                        if (e.taskType === s.DownloadKernel.TaskType.Bt) {
                            let t = U.getTaskFromTaskId(e.taskId);
                            p.SingleBtTaskNS.isSingleBtTask(t).then(t => {
                                t && h.TaskOperatorNs.openAsTaskItem(e).catch()
                            }).catch()
                        } else e.taskType !== s.DownloadKernel.TaskType.Group && h.TaskOperatorNs.openAsTaskItem(e).catch()
                    }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadRename: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.renameTask(e[0])
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyFileOther: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.copy2Dir(e).catch(e => {
                        R.warning(e)
                    })
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = /&&/gi, n = i.replace(t, "&");
                        h.TaskOperatorNs.copy2Dir(e, n).catch(e => {
                            R.warning(e)
                        })
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadRedownload: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = "";
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed ? t = "finished_rk_reload_click" : a === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin_rk_reload_click"), c.TaskCtrlOperatorNS.redownloadTask(e, void 0, t).catch()
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadRecover: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.recoverTask(e)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadClear:
                    h.TaskOperatorNs.clearRecycle();
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreConfig:
                    if (null !== this.contextInfo) {
                        let e = {tabType: v.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 u.ContextMenuIdsNS.contextMenuToolbarMoreOpenHelp:
                    if (null !== this.contextInfo) {
                        let e = {
                            tabType: v.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 u.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch:
                    _.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !0);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.Default, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByTime, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByType:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByType, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByName:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByName, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.BySize, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByStatus:
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByProgress, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreDestroy:
                    if (null !== this.contextInfo) {
                        let e = this.getSelectdTaskInfos();
                        null !== e && void 0 !== e && e.length > 0 && h.TaskOperatorNs.destroyTasks(e)
                    }
                    break;
                case u.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "my_computer");
                    break;
                case u.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "private_space");
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting:
                    F.client.callServerFunction("GetUserID").then(e => n(this, void 0, void 0, function* () {
                        if (e && "" !== e) {
                            let t = yield C.PrivateSpaceHelperNS.getPrivateSavePath(e),
                                i = m.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1);
                            y.MessageBox.custom("private-space-download-setting", {
                                savePath: t,
                                hideLocalDir: 1 === i
                            }).then(t => n(this, void 0, void 0, function* () {
                                t.action === x.MessageBoxNS.Action.OK && (m.ConfigNS.setValue("PrivateSpaceDefaultPath", e, t.args.savePath), m.ConfigNS.setValue("PrivateSpaceLockUserTask", e, t.args.hideLocalDir), C.PrivateSpaceHelperNS.setPrivateSavePath(e, t.args.savePath).then().catch(), C.PrivateSpaceHelperNS.setAllTaskFileHidden(e, 1 === t.args.hideLocalDir))
                            })).catch()
                        }
                    })).catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange:
                    F.client.callServerFunction("GetUserID").then(e => n(this, void 0, void 0, function* () {
                        e && "" !== e && 0 === (yield C.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(e)) && C.PrivateSpaceHelperNS.changePrivateSpacePassword(e).catch()
                    })).catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceTaskManager:
                    y.MessageBox.custom("private-space-task-manager", {}).catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuShouleiFileTransfer:
                    this.handleShouleiFileTransfer().catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuOpenTaskPosition: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openlocation_click", "", 0, 0, 0, 0, this.getStatExtData(a)), _.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !1);
                    let t = this.getSelectdTaskInfos()[0];
                    b.ThunderNewTask.selectTask(t.taskId).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadByShoulei:
                    this.handleDownloadByShoulei().catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadShare: {
                    let e = this.getSelectdTaskInfos();
                    1 === e.length && h.TaskOperatorNs.shareLink(e[0], this.getPanel(a), "leftlist_rk_share").catch()
                }
            }
        }

        getStatExtData(e) {
            let t = "mypc";
            return -1 !== _.default.getCurrentCategoryId() && (t = "private"), "panel_type=" + t + ",panel=" + this.getPanel(e)
        }

        getPanel(e) {
            let t = "unknown";
            switch (e) {
                case s.DownloadKernel.CategroyViewID.Completed:
                    t = "finished";
                    break;
                case s.DownloadKernel.CategroyViewID.Downloading:
                    t = "downloading";
                    break;
                case s.DownloadKernel.CategroyViewID.Recycle:
                    t = "dustbin"
            }
            return t
        }

        getSelectdTaskInfos() {
            let e = this.contextInfo.currentSelectdTaskInfos;
            return "search" === this.contextInfo.searchType && (e = this.contextInfo.currentSelSearchTaskInfos), e
        }

        popMenuInternal(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = this.buildMenuTemplate(e);
                if (n.length > 0) {
                    let e = [];
                    if (this.menuEventClients.hasOwnProperty(t)) {
                        let i = this.menuEventClients[t];
                        for (let t of i) {
                            let i = yield O.server.callClientFunctionByName(t, "GetContextMenuExtra", this.contextInfo.currentCategoryId, this.contextInfo.currentCategoryViewId, this.getSelectdTaskInfos());
                            i && i[0] && i[0].length > 0 && e.push(...this.buildMenuTemplateFromRemote(t, i[0]))
                        }
                    }
                    e.length > 0 && n.push(...e);
                    const o = yield a.asyncRemoteCall.getCurrentWindow();
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuPopup, n);
                    const r = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                    yield E.MenuSkinNS.setStyle(r, {}), i ? r.popup({
                        window: o,
                        x: i.clientX,
                        y: i.clientY,
                        async: !1
                    }) : r.popup({
                        window: o,
                        async: !1
                    }), this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuEnd)
                }
            })
        }

        statExtData(e) {
            let t = "panel_type=mypc";
            return -1 !== this.categoryId && (t = "panel_type=private"), void 0 !== e && "" !== e && (t = t + "," + e), t
        }

        buildMenuTemplateFromRemote(e, t) {
            let i = [];
            for (let e = 0; e < t.length; e++) {
                let n = null, a = t[e];
                if (a) {
                    if ("submenu" === a.type) {
                        let e = this.buildMenuTemplate(a.submenu);
                        n = {type: a.type, label: a.label, submenu: e}
                    } else if ("separator" === a.type) n = {type: a.type}; else {
                        let e = Object.assign({}, a), t = a.click;
                        void 0 !== t && null !== t && (a.click = (() => {
                            if (void 0 !== a.statId && "" !== a.statId) {
                                void 0 === a.extData && (a.extData = "");
                                let e = this.statExtData(a.extData);
                                R.information("trackEvent", "download_leftpanel", a.statId, e), g.XLStatNS.trackEvent("download_leftpanel", a.statId, "", 0, 0, 0, 0, e)
                            }
                            a.statId = void 0, t(e)
                        })), n = {
                            type: a.type,
                            label: a.label,
                            enabled: a.enabled,
                            icon: a.icon,
                            id: a.id,
                            checked: a.checked,
                            click: a.click
                        }
                    }
                    null !== n && i.push(n)
                }
            }
            return i
        }

        buildMenuTemplate(e) {
            let t = [];
            for (let i = 0; i < e.length; i++) {
                let n = null, a = e[i];
                if (!D.isBoolean(a.visible) || a.visible) {
                    if ("submenu" === a.type) {
                        let e = this.buildMenuTemplate(a.submenu);
                        n = {type: a.type, label: a.label, submenu: e}
                    } else n = "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) => {
                            if ("function" != typeof a.click) {
                                if (void 0 !== a.statId && "" !== a.statId) {
                                    void 0 === a.extData && (a.extData = "");
                                    let e = this.statExtData(a.extData);
                                    R.information("trackEvent", "download_leftpanel", a.statId, e), g.XLStatNS.trackEvent("download_leftpanel", a.statId, "", 0, 0, 0, 0, e)
                                }
                                this.handleMenuClick(a)
                            } else a.click(...e)
                        }
                    };
                    null !== n && t.push(n)
                }
            }
            return t
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e.DownloadComplete = "DownloadComplete", e.DownloadFail = "DownloadFail", e.ConsumptionTips = "ConsumptionTips", e.CommunityTips = "CommunityTips", e.AdvertisementTips = "AdvertisementTips", e.AdvertisementWebPageTips = "AdvertisementWebPageTips", e.CommonPushTip = "CommonPushTip"
        }(t = e.TipsType || (e.TipsType = {}))
    }(t.Notification || (t.Notification = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(79);
    !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 n.MsgQueueNS.Queue), t.queueMap.get(e)
            }
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(19), r = i(360), s = i(3), l = i(12), d = i(15), u = i(40), c = i(44), h = i(0), f = i(5),
        g = i(62), p = i(41), v = i(61), m = i(13), y = i(34), k = i(63), T = i(24), w = i(17), C = i(447), S = i(6),
        I = l.DownloadKernelTaskManager.getTaskManager(), b = d.DownloadKernelEventManager.getEventManager(),
        _ = u.DownloadKernelCategoryViewManager.getCategoryViewManager(), D = h.default.getLogger("ShouleiSync"),
        A = 1e4, N = 12e4 / A;
    !function (e) {
        class t {
            constructor(e) {
                this.action = void 0, this.action = e
            }

            getAction() {
                return this.action
            }
        }

        class i extends t {
            constructor() {
                super("sync")
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    return this.report(yield this.getSyncTaskDatas()), !0
                })
            }

            report(e) {
                g.fetchSlRes({url: "/xlppc.downloadlist.sync/api/list", data: e, method: "post"}).catch()
            }

            getTaskStatus(e) {
                let t = "pause";
                switch (e) {
                    case s.DownloadKernel.TaskStatus.StartWaiting:
                        t = "waiting";
                        break;
                    case s.DownloadKernel.TaskStatus.Started:
                        t = "downloading";
                        break;
                    case s.DownloadKernel.TaskStatus.Failed:
                        t = "fail";
                        break;
                    case s.DownloadKernel.TaskStatus.StopPending:
                    case s.DownloadKernel.TaskStatus.Stopped:
                        t = "pause";
                        break;
                    case s.DownloadKernel.TaskStatus.Succeeded:
                    case s.DownloadKernel.TaskStatus.Seeding:
                        t = "complete"
                }
                return t
            }

            getTaskCategory(e) {
                let t;
                switch (e) {
                    case s.DownloadKernel.CategroyViewID.Downloading:
                        t = "downloading";
                        break;
                    case s.DownloadKernel.CategroyViewID.Completed:
                        t = "complete"
                }
                return t
            }

            getSyncTaskDatas() {
                return n(this, void 0, void 0, function* () {
                    let e = [], t = _.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading),
                        n = _.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Completed), a = t.getTasks(),
                        o = n.getTasks(), r = [...a.values(), ...o.values()];
                    r.sort((e, t) => t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime) - e.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime)), r = r.filter(e => {
                        let t = e.getType();
                        return t !== s.DownloadKernel.TaskType.Group && t !== s.DownloadKernel.TaskType.Unkown
                    });
                    let l = 0;
                    for (let t = 0; t < r.length && l < i.maxSyncCount; ++t) {
                        let i, n, a, o = r[t], d = o.getTaskBaseInfo(),
                            u = o.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                        if (u !== s.DownloadKernel.CategroyViewID.Completed || (yield p.TaskCtrlOperatorNS.isExistTaskFile(d))) {
                            if (d.taskType === s.DownloadKernel.TaskType.Bt) {
                                i = "bt";
                                let e = o.getExtraObject();
                                a = e.getInfoId();
                                let t = e.getFileCount();
                                n = "";
                                for (let i = 0; i < t; ++i) {
                                    let t = e.getBtFileByRealIndex(i);
                                    t && 1 === t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download) ? n += "1" : n += "0"
                                }
                            } else i = "url", a = d.url;
                            e.push({
                                task_id: String(d.taskId),
                                task_type: i,
                                name: d.taskName,
                                link: a,
                                source: d.origin,
                                source_url: d.url,
                                index: n,
                                status: this.getTaskStatus(d.taskStatus),
                                error_code: d.errorCode,
                                category: this.getTaskCategory(u),
                                speed: d.downloadSpeed,
                                total_size: o.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                                download_size: o.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize)
                            }), ++l
                        }
                    }
                    return D.information("taskInfos", e), JSON.stringify(e)
                })
            }
        }

        i.maxSyncCount = 100;

        class l extends t {
            constructor(e) {
                super("add"), this.taskList = null, this.magnetTaskIdMap = null, this.taskList = e, this.magnetTaskIdMap = new Map
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    return yield this.batchCreateTask(), !0
                })
            }

            doRepeatTasks(e, t) {
                return n(this, void 0, void 0, function* () {
                    for (let i = 0; i < e.length; ++i) {
                        let n = e[i], a = n.getType(), o = null;
                        for (let e = t.length - 1; e >= 0; --e) {
                            let i = t[e];
                            if (i.dk_task_type === a) if (a === s.DownloadKernel.TaskType.Bt) {
                                let a = n.getExtraObject();
                                if (i.link.toLocaleLowerCase() === a.getInfoId().toLocaleLowerCase()) {
                                    o = i, t.splice(e, 1);
                                    continue
                                }
                            } else if (a === s.DownloadKernel.TaskType.Emule) {
                                let a = n.getExtraObject();
                                if (i.ed2k_hash.toLocaleLowerCase() === a.getFileHash().toLocaleLowerCase()) {
                                    o = i, t.splice(e, 1);
                                    continue
                                }
                            } else if (a === s.DownloadKernel.TaskType.P2sp && i.link.toLocaleLowerCase() === n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl).toLocaleLowerCase()) {
                                o = i, t.splice(e, 1);
                                continue
                            }
                        }
                        if (o && -1 === n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId)) {
                            if (a === s.DownloadKernel.TaskType.Bt) {
                                let e = n.getExtraObject(), t = e.getFileCount(), i = "";
                                for (let n = 0; n < t; ++n) {
                                    let t = e.getBtFileByRealIndex(n);
                                    t && 1 === t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download) ? i += "1" : i += "0", t && s.DownloadKernel.BtFileStatus.Complete === t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus) && "1" !== o.index[n] && (o.index = o.index.substr(0, n) + "1" + o.index.substr(n + 1))
                                }
                                if (i !== o.index) {
                                    let t = [];
                                    for (let i = 0; i < o.index.length; ++i) if ("1" === o.index[i]) t.push(i); else {
                                        let n = e.getBtFileByRealIndex(i);
                                        s.DownloadKernel.BtFileStatus.Complete === n.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus) && t.push(i)
                                    }
                                    let i = n.getId();
                                    (yield I.downloadTaskSelectFiles(i, JSON.stringify(t))) && (yield c.DownloadDispatchNS.startTask(i));
                                    continue
                                }
                            }
                            let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                            e === s.DownloadKernel.CategroyViewID.Downloading ? yield c.DownloadDispatchNS.startTask(n.getId()) : e === s.DownloadKernel.CategroyViewID.Completed ? (yield p.TaskCtrlOperatorNS.isExistTaskFile(n.getTaskBaseInfo())) || (yield this.reDownloadTask(n, o)) : e === s.DownloadKernel.CategroyViewID.Recycle && (yield this.reDownloadTask(n, o))
                        }
                    }
                })
            }

            reDownloadTask(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = {
                        taskBaseInfo: {savePath: void 0, taskName: void 0, origin: t.source},
                        p2spTaskInfo: {url: void 0}
                    }, n = yield I.reDownloadTask(e.getId(), i);
                    if (null !== n) {
                        let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                        yield c.DownloadDispatchNS.startTask(e)
                    }
                })
            }

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

            batchCreateTask() {
                return n(this, void 0, void 0, function* () {
                    let e = [];
                    for (let t = 0; t < this.taskList.length; t++) {
                        let i = this.taskList[t];
                        if (!i || !i.task_type || !i.link) {
                            D.warning("invalid taskData!", i), this.taskList.splice(t, 1);
                            continue
                        }
                        if ("bt" === i.task_type && !i.index) {
                            D.warning("invalid bt task, no index!", i), this.taskList.splice(t, 1);
                            continue
                        }
                        let n, a = s.DownloadKernel.TaskType.Unkown;
                        if ((a = "bt" === i.task_type ? s.DownloadKernel.TaskType.Bt : y.ThunderHelper.getTaskTypeFromUrl(i.link)) !== s.DownloadKernel.TaskType.Unkown) {
                            if (a === s.DownloadKernel.TaskType.Emule) {
                                let e = k.ParseUrlFileNameNS.parseEd2kUrl(i.link);
                                i.ed2k_hash = e.fileHash, n = e.fileHash
                            } else a !== s.DownloadKernel.TaskType.P2sp && a !== s.DownloadKernel.TaskType.Bt || (n = i.link);
                            !n || n.length <= 0 ? (D.warning("findInfo unknown value!", i, a), this.taskList.splice(t, 1)) : (i.dk_task_type = a, e.push({
                                taskType: a,
                                value: n
                            }), ++t)
                        } else D.warning("unknown task type!", i.link), this.taskList.splice(t, 1)
                    }
                    let t = [...this.taskList], i = yield v.TaskUtilitiesAWNS.batchFindTaskAW(e);
                    if (D.information("repeatTasks", i), i.length > 0 && (yield this.doRepeatTasks(i, t)), D.information("newTaskDatas", t), t.length > 0) {
                        let e = [], i = m.ThunderUtil.getDefaultDownloadDir(), o = [];
                        for (let n = 0; n < t.length; ++n) {
                            let a = t[n];
                            if (a.dk_task_type === s.DownloadKernel.TaskType.Bt) e.push(a); else {
                                let e = p.TaskCtrlOperatorNS.constructProductInfo(""), t = {
                                    taskName: k.ParseUrlFileNameNS.getNameFromUrl(a.link),
                                    savePath: i,
                                    productInfo: e,
                                    origin: a.source
                                }, n = {taskType: a.dk_task_type, taskBaseInfo: t};
                                a.dk_task_type === s.DownloadKernel.TaskType.P2sp ? (n.p2spTaskInfo = {
                                    url: a.link,
                                    cookie: a.cookie
                                }, o.push(n)) : a.dk_task_type === s.DownloadKernel.TaskType.Emule && (n.taskType = s.DownloadKernel.TaskType.Emule, n.emuleTaskInfo = {url: a.link}, o.push(n))
                            }
                        }
                        if (o.length > 0) {
                            D.information("createBatchTask newTaskInfos", o);
                            let e = yield I.createBatchTask(o);
                            if (D.information("createBatchTask tasks", e), e.length > 0) {
                                let t = [];
                                e.forEach(e => {
                                    t.push(e.getId())
                                }), D.information("startTasks taskIds", t), yield c.DownloadDispatchNS.startTasks(t)
                            }
                        }
                        e.length > 0 && (D.information("btNewTasks", e), e.forEach(e => n(this, void 0, void 0, function* () {
                            let t = (e, t, o) => n(this, void 0, void 0, function* () {
                                    do {
                                        if (t) {
                                            let t = I.getTaskFromTaskId(e);
                                            if (!t) {
                                                D.warning("getTaskFromTaskId failed!", e);
                                                break
                                            }
                                            let n = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                                                o = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName),
                                                r = a.join(n, o), l = yield v.TaskUtilitiesAWNS.parserBtFileInfoAW(r);
                                            if (null === l) {
                                                D.warning("parserBtFileInfoAW!", r);
                                                break
                                            }
                                            let d = this.magnetTaskIdMap.get(e);
                                            if (d) {
                                                let e = p.TaskCtrlOperatorNS.constructProductInfo(""),
                                                    t = {savePath: i, taskName: l.title, productInfo: e, origin: d.source},
                                                    a = [];
                                                for (let e = 0; e < l.fileLists.length; ++e) "1" === d.index[e] && a.push(l.fileLists[e].realIndex);
                                                let o = yield p.TaskCtrlOperatorNS.getBtExistFilePathList(n, l, a);
                                                o.length > 0 && (yield this.btRepeatDeleteExist(o));
                                                let u = "magnet:?xt=urn:btih:" + d.link, h = {
                                                    originUrl: d.source_url || u,
                                                    seedFile: r,
                                                    displayName: l.title,
                                                    fileLists: l.fileLists,
                                                    infoId: l.infoId,
                                                    fileRealIndexLists: a,
                                                    tracker: l.trackerUrls.join("\n")
                                                }, f = {
                                                    taskType: s.DownloadKernel.TaskType.Bt,
                                                    taskBaseInfo: t,
                                                    btTaskInfo: h
                                                }, g = yield I.createTask(s.DownloadKernel.TaskType.Bt, f);
                                                if (D.information("create task magnet productinfo", e), null !== g) {
                                                    let e = g.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                                                    yield c.DownloadDispatchNS.startTask(e)
                                                }
                                            }
                                        } else D.warning("onTaskFinish download magnet fialed!", e, o)
                                    } while (0);
                                    this.magnetTaskIdMap.delete(e)
                                }), o = yield m.ThunderUtil.getThunderTempPath(!0), r = "magnet:?xt=urn:btih:" + e.link,
                                l = k.ParseUrlFileNameNS.parseMagnetUrl(r) + ".torrent", d = a.join(o, l), u = {
                                    taskName: l,
                                    savePath: o,
                                    productInfo: p.TaskCtrlOperatorNS.constructProductInfo(""),
                                    origin: e.source
                                }, h = {url: r, torrentFilePath: d}, f = {
                                    taskType: s.DownloadKernel.TaskType.Magnet,
                                    taskBaseInfo: u,
                                    magnetTaskInfo: h,
                                    isBackground: !0
                                };
                            D.information("create task magnet", f);
                            let g = yield I.createTask(s.DownloadKernel.TaskType.Magnet, f);
                            if (null !== g) {
                                let i = g.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                                C.MagnetListenerNS.addRef(i, t.bind(this)), this.magnetTaskIdMap.set(i, e), yield c.DownloadDispatchNS.startTask(i, !0)
                            }
                        })))
                    }
                })
            }
        }

        class d extends t {
            constructor(e, t) {
                super(e), this.taskIds = null, this.taskIds = [], t.forEach(e => {
                    this.taskIds.push(parseInt(e, 10))
                })
            }
        }

        class u extends d {
            constructor(e) {
                super("delete", e)
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (!this.taskIds || this.taskIds.length <= 0) break;
                        yield I.batchRemoveToRecycle(this.taskIds).catch(), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class h extends d {
            constructor(e) {
                super("pause", e)
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (!this.taskIds || this.taskIds.length <= 0) break;
                        I.batchStopTask(this.taskIds, s.DownloadKernel.TaskStopReason.Manual), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class x extends d {
            constructor(e) {
                super("continue", e)
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (!this.taskIds || this.taskIds.length <= 0) break;
                        yield c.DownloadDispatchNS.startTasks(this.taskIds), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class E {
            static createCommand(e) {
                let t = null;
                switch (e.action) {
                    case"add":
                        "object" == typeof e.task_list && e.task_list.length > 0 && (t = new l(e.task_list));
                        break;
                    case"delete":
                        "object" == typeof e.task_ids && e.task_ids.length > 0 && (t = new u(e.task_ids));
                        break;
                    case"pause":
                        "object" == typeof e.task_ids && e.task_ids.length > 0 && (t = new h(e.task_ids));
                        break;
                    case"continue":
                        "object" == typeof e.task_ids && e.task_ids.length > 0 && (t = new x(e.task_ids));
                        break;
                    case"sync":
                        t = new i
                }
                return D.information("createCommand", t), t
            }
        }

        class P {
            constructor(e) {
                this.timer = null, this.heartBeatTimes = 0, this.delegate = null, this.delegate = e
            }

            start() {
                this.timer || (this.timer = setInterval(() => {
                    ++this.heartBeatTimes, this.delegate && (this.delegate.onHeartBeat(this.heartBeatTimes) || this.stop())
                }, A))
            }

            stop() {
                this.timer && (clearInterval(this.timer), this.timer = null), this.heartBeatTimes = 0
            }

            reset() {
                this.heartBeatTimes = 0, this.start()
            }
        }

        class O extends o.EventEmitter {
            constructor() {
                super(), this.syncStateEventCookie = void 0, this.logoutCookie = void 0, this.syncMessageCookie = void 0, this.taskStatusChangedCookie = void 0, this.removeCategoryCookie = void 0, this.insertToCategoryCookie = void 0, this.syncState = "offline", this.topic = "/user/me/downloadlist", this.heartBeat = null, this.delayReportTimer = null, this.heartBeat = new P(this)
            }

            enable() {
                return n(this, void 0, void 0, function* () {
                    return yield T.default.isInitedAw(), 1 === T.default.getConfigInfo("shouleiDownload", "enableSync2")
                })
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    if (yield this.enable()) {
                        this.syncStateEventCookie = r.SyncMsgHelperNS.attachSyncMsgStateChangeEvent(this.onSyncMsgStateChangeEvent.bind(this));
                        let e = r.SyncMsgHelperNS.getSyncMsgState();
                        D.information("SyncMsgState", e), e === r.SyncMsgHelperNS.SyncMsgState.Connected && this.registerTopic().catch(), this.logoutCookie = w.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", this.onUserLogout.bind(this))
                    }
                })
            }

            uninit() {
                this.syncStateEventCookie && (r.SyncMsgHelperNS.detachSyncMsgStateChangeEvent(this.syncStateEventCookie), this.syncStateEventCookie = void 0), this.syncMessageCookie && (f.client.detachServerEvent("SyncMessage", this.syncMessageCookie), this.syncMessageCookie = void 0), this.delayReportTimer && (clearTimeout(this.delayReportTimer), this.delayReportTimer = null), this.detachTaskEvents(), this.logoutCookie && (w.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.logoutCookie), this.logoutCookie = void 0)
            }

            getState() {
                return this.syncState
            }

            onHeartBeat(e) {
                if (e >= N) return "online" === this.syncState && (this.syncState = "offline", this.detachTaskEvents(), this.fireEvent("OnConnectStateChanged", this.syncState)), !1;
                return (new i).execute().then(e => {
                    D.information("onHeartBeat, sync command ret:", e)
                }).catch(), !0
            }

            attachEvent(e, t) {
                return this.on(e, t), t
            }

            attachEventOnce(e, t) {
                return this.once(e, t), t
            }

            detachEvent(e, t) {
                this.detachEvent(e, t)
            }

            fireEvent(e, ...t) {
                D.information("fireEvent", e, ...t), this.emit(e, ...t)
            }

            onSyncMsgStateChangeEvent(e, t) {
                return n(this, void 0, void 0, function* () {
                    D.information("onSyncMsgStateChangeEvent", e, t), e === r.SyncMsgHelperNS.SyncMsgState.Connected && this.registerTopic().catch()
                })
            }

            onUserLogout() {
                "online" === this.syncState && (this.syncState = "offline", this.heartBeat.stop(), this.detachTaskEvents(), this.fireEvent("OnConnectStateChanged", this.syncState))
            }

            registerTopic() {
                return n(this, void 0, void 0, function* () {
                    let e = yield f.client.callRemoteClientFunction("User", "SyncStartReceiver", this.topic);
                    D.information("receving from topics: ", e), void 0 !== e[1] ? D.information("error = ", e[1]) : (D.information("receving from topics: ", e[0]), this.syncMessageCookie || (this.syncMessageCookie = f.client.attachServerEvent("SyncMessage", this.onSyncMessage.bind(this))))
                })
            }

            onSyncMessage(e, t) {
                return n(this, void 0, void 0, function* () {
                    D.information("onSyncMessage: ", t);
                    let e = null;
                    try {
                        e = JSON.parse(t)
                    } catch (e) {
                        D.warning(e)
                    }
                    if (e && e.subject === this.topic) {
                        let t = e.data;
                        if (t) {
                            let e = null;
                            if ("sync" === t.action ? "online" === this.syncState ? this.heartBeat.reset() : (this.heartBeat.start(), this.attachTaskEvents(), this.syncState = "online", this.fireEvent("OnConnectStateChanged", this.syncState), e = E.createCommand(t)) : e = E.createCommand(t), e) {
                                let i = yield e.execute();
                                D.information("command execute ret", i, t)
                            }
                        }
                    }
                })
            }

            attachTaskEvents() {
                this.taskStatusChangedCookie || (this.taskStatusChangedCookie = b.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.onTaskStatusChanged.bind(this))), this.insertToCategoryCookie || (this.insertToCategoryCookie = b.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.onInsertToCategoryView.bind(this))), this.removeCategoryCookie || (this.removeCategoryCookie = b.attachTaskEvent(s.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.onRemoveFromCategoryView.bind(this)))
            }

            detachTaskEvents() {
                this.taskStatusChangedCookie && (b.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedCookie), this.taskStatusChangedCookie = void 0), this.insertToCategoryCookie && (b.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryCookie), this.insertToCategoryCookie = void 0), this.removeCategoryCookie && (b.detachTaskEvent(s.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeCategoryCookie), this.removeCategoryCookie = void 0)
            }

            onTaskStatusChanged(e, t) {
                do {
                    if (e !== s.DownloadKernel.TaskEventType.StatusChanged || !t || t.length <= 0) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i && !(i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background) || -1 !== i.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId) || i.getType() === s.DownloadKernel.TaskType.Group || i.getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0)) {
                            this.reportDownloadList(!0);
                            break
                        }
                    }
                } while (0)
            }

            onInsertToCategoryView(e, t, i, n) {
                do {
                    if (e !== s.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === t || !i || !n || n.length <= 0) break;
                    if (i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Completed) break;
                    this.reportDownloadList(!0)
                } while (0)
            }

            onRemoveFromCategoryView(e, t, i, n) {
                do {
                    if (e !== s.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === t || !i || !n || n.length <= 0) break;
                    if (i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Completed) break;
                    this.reportDownloadList(!0)
                } while (0)
            }

            reportDownloadList(e = !1) {
                if (e) {
                    this.delayReportTimer && (clearTimeout(this.delayReportTimer), this.delayReportTimer = null), (new i).execute().then(e => {
                        D.information("reportDownloadList", e)
                    }).catch()
                } else this.delayReportTimer || (this.delayReportTimer = setTimeout(() => {
                    this.delayReportTimer = null, (new i).execute().then(e => {
                        D.information("reportDownloadList", e)
                    }).catch()
                }, 1e3))
            }
        }

        e.ShouleiListSyncManager = O;
        let M = null;
        e.getMananger = function () {
            return M || (M = new O), M
        }
    }(t.ShouleiListSyncNS || (t.ShouleiListSyncNS = {}))
}, function (e, t, i) {
    "use strict";
    e.exports = {
        PNG_SIGNATURE: [137, 80, 78, 71, 13, 10, 26, 10],
        TYPE_IHDR: 1229472850,
        TYPE_IEND: 1229278788,
        TYPE_IDAT: 1229209940,
        TYPE_PLTE: 1347179589,
        TYPE_tRNS: 1951551059,
        TYPE_gAMA: 1732332865,
        COLORTYPE_GRAYSCALE: 0,
        COLORTYPE_PALETTE: 1,
        COLORTYPE_COLOR: 2,
        COLORTYPE_ALPHA: 4,
        COLORTYPE_PALETTE_COLOR: 3,
        COLORTYPE_COLOR_ALPHA: 6,
        COLORTYPE_TO_BPP_MAP: {0: 1, 2: 3, 3: 1, 4: 2, 6: 4},
        GAMMA_DIVISION: 1e5
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(414), a = i(300);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-tip.vue", t.default = s.exports
}, function (e, t, i) {
    (function (e) {
        var i;
        !function () {
            var n = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || this || {},
                a = n._, o = Array.prototype, r = Object.prototype,
                s = "undefined" != typeof Symbol ? Symbol.prototype : null, l = o.push, d = o.slice, u = r.toString,
                c = r.hasOwnProperty, h = Array.isArray, f = Object.keys, g = Object.create, p = function () {
                }, v = function (e) {
                    return e instanceof v ? e : this instanceof v ? void (this._wrapped = e) : new v(e)
                };
            void 0 === t || t.nodeType ? n._ = v : (void 0 !== e && !e.nodeType && e.exports && (t = e.exports = v), t._ = v), v.VERSION = "1.9.1";
            var m, y = function (e, t, i) {
                if (void 0 === t) return e;
                switch (null == i ? 3 : i) {
                    case 1:
                        return function (i) {
                            return e.call(t, i)
                        };
                    case 3:
                        return function (i, n, a) {
                            return e.call(t, i, n, a)
                        };
                    case 4:
                        return function (i, n, a, o) {
                            return e.call(t, i, n, a, o)
                        }
                }
                return function () {
                    return e.apply(t, arguments)
                }
            }, k = function (e, t, i) {
                return v.iteratee !== m ? v.iteratee(e, t) : null == e ? v.identity : v.isFunction(e) ? y(e, t, i) : v.isObject(e) && !v.isArray(e) ? v.matcher(e) : v.property(e)
            };
            v.iteratee = m = function (e, t) {
                return k(e, t, 1 / 0)
            };
            var T = function (e, t) {
                return t = null == t ? e.length - 1 : +t, function () {
                    for (var i = Math.max(arguments.length - t, 0), n = Array(i), a = 0; a < i; a++) n[a] = arguments[a + t];
                    switch (t) {
                        case 0:
                            return e.call(this, n);
                        case 1:
                            return e.call(this, arguments[0], n);
                        case 2:
                            return e.call(this, arguments[0], arguments[1], n)
                    }
                    var o = Array(t + 1);
                    for (a = 0; a < t; a++) o[a] = arguments[a];
                    return o[t] = n, e.apply(this, o)
                }
            }, w = function (e) {
                if (!v.isObject(e)) return {};
                if (g) return g(e);
                p.prototype = e;
                var t = new p;
                return p.prototype = null, t
            }, C = function (e) {
                return function (t) {
                    return null == t ? void 0 : t[e]
                }
            }, S = function (e, t) {
                return null != e && c.call(e, t)
            }, I = function (e, t) {
                for (var i = t.length, n = 0; n < i; n++) {
                    if (null == e) return;
                    e = e[t[n]]
                }
                return i ? e : void 0
            }, b = Math.pow(2, 53) - 1, _ = C("length"), D = function (e) {
                var t = _(e);
                return "number" == typeof t && t >= 0 && t <= b
            };
            v.each = v.forEach = function (e, t, i) {
                var n, a;
                if (t = y(t, i), D(e)) for (n = 0, a = e.length; n < a; n++) t(e[n], n, e); else {
                    var o = v.keys(e);
                    for (n = 0, a = o.length; n < a; n++) t(e[o[n]], o[n], e)
                }
                return e
            }, v.map = v.collect = function (e, t, i) {
                t = k(t, i);
                for (var n = !D(e) && v.keys(e), a = (n || e).length, o = Array(a), r = 0; r < a; r++) {
                    var s = n ? n[r] : r;
                    o[r] = t(e[s], s, e)
                }
                return o
            };
            var A = function (e) {
                return function (t, i, n, a) {
                    var o = arguments.length >= 3;
                    return function (t, i, n, a) {
                        var o = !D(t) && v.keys(t), r = (o || t).length, s = e > 0 ? 0 : r - 1;
                        for (a || (n = t[o ? o[s] : s], s += e); s >= 0 && s < r; s += e) {
                            var l = o ? o[s] : s;
                            n = i(n, t[l], l, t)
                        }
                        return n
                    }(t, y(i, a, 4), n, o)
                }
            };
            v.reduce = v.foldl = v.inject = A(1), v.reduceRight = v.foldr = A(-1), v.find = v.detect = function (e, t, i) {
                var n = (D(e) ? v.findIndex : v.findKey)(e, t, i);
                if (void 0 !== n && -1 !== n) return e[n]
            }, v.filter = v.select = function (e, t, i) {
                var n = [];
                return t = k(t, i), v.each(e, function (e, i, a) {
                    t(e, i, a) && n.push(e)
                }), n
            }, v.reject = function (e, t, i) {
                return v.filter(e, v.negate(k(t)), i)
            }, v.every = v.all = function (e, t, i) {
                t = k(t, i);
                for (var n = !D(e) && v.keys(e), a = (n || e).length, o = 0; o < a; o++) {
                    var r = n ? n[o] : o;
                    if (!t(e[r], r, e)) return !1
                }
                return !0
            }, v.some = v.any = function (e, t, i) {
                t = k(t, i);
                for (var n = !D(e) && v.keys(e), a = (n || e).length, o = 0; o < a; o++) {
                    var r = n ? n[o] : o;
                    if (t(e[r], r, e)) return !0
                }
                return !1
            }, v.contains = v.includes = v.include = function (e, t, i, n) {
                return D(e) || (e = v.values(e)), ("number" != typeof i || n) && (i = 0), v.indexOf(e, t, i) >= 0
            }, v.invoke = T(function (e, t, i) {
                var n, a;
                return v.isFunction(t) ? a = t : v.isArray(t) && (n = t.slice(0, -1), t = t[t.length - 1]), v.map(e, function (e) {
                    var o = a;
                    if (!o) {
                        if (n && n.length && (e = I(e, n)), null == e) return;
                        o = e[t]
                    }
                    return null == o ? o : o.apply(e, i)
                })
            }), v.pluck = function (e, t) {
                return v.map(e, v.property(t))
            }, v.where = function (e, t) {
                return v.filter(e, v.matcher(t))
            }, v.findWhere = function (e, t) {
                return v.find(e, v.matcher(t))
            }, v.max = function (e, t, i) {
                var n, a, o = -1 / 0, r = -1 / 0;
                if (null == t || "number" == typeof t && "object" != typeof e[0] && null != e) for (var s = 0, l = (e = D(e) ? e : v.values(e)).length; s < l; s++) null != (n = e[s]) && n > o && (o = n); else t = k(t, i), v.each(e, function (e, i, n) {
                    ((a = t(e, i, n)) > r || a === -1 / 0 && o === -1 / 0) && (o = e, r = a)
                });
                return o
            }, v.min = function (e, t, i) {
                var n, a, o = 1 / 0, r = 1 / 0;
                if (null == t || "number" == typeof t && "object" != typeof e[0] && null != e) for (var s = 0, l = (e = D(e) ? e : v.values(e)).length; s < l; s++) null != (n = e[s]) && n < o && (o = n); else t = k(t, i), v.each(e, function (e, i, n) {
                    ((a = t(e, i, n)) < r || a === 1 / 0 && o === 1 / 0) && (o = e, r = a)
                });
                return o
            }, v.shuffle = function (e) {
                return v.sample(e, 1 / 0)
            }, v.sample = function (e, t, i) {
                if (null == t || i) return D(e) || (e = v.values(e)), e[v.random(e.length - 1)];
                var n = D(e) ? v.clone(e) : v.values(e), a = _(n);
                t = Math.max(Math.min(t, a), 0);
                for (var o = a - 1, r = 0; r < t; r++) {
                    var s = v.random(r, o), l = n[r];
                    n[r] = n[s], n[s] = l
                }
                return n.slice(0, t)
            }, v.sortBy = function (e, t, i) {
                var n = 0;
                return t = k(t, i), v.pluck(v.map(e, function (e, i, a) {
                    return {value: e, index: n++, criteria: t(e, i, a)}
                }).sort(function (e, t) {
                    var i = e.criteria, n = t.criteria;
                    if (i !== n) {
                        if (i > n || void 0 === i) return 1;
                        if (i < n || void 0 === n) return -1
                    }
                    return e.index - t.index
                }), "value")
            };
            var N = function (e, t) {
                return function (i, n, a) {
                    var o = t ? [[], []] : {};
                    return n = k(n, a), v.each(i, function (t, a) {
                        var r = n(t, a, i);
                        e(o, t, r)
                    }), o
                }
            };
            v.groupBy = N(function (e, t, i) {
                S(e, i) ? e[i].push(t) : e[i] = [t]
            }), v.indexBy = N(function (e, t, i) {
                e[i] = t
            }), v.countBy = N(function (e, t, i) {
                S(e, i) ? e[i]++ : e[i] = 1
            });
            var x = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
            v.toArray = function (e) {
                return e ? v.isArray(e) ? d.call(e) : v.isString(e) ? e.match(x) : D(e) ? v.map(e, v.identity) : v.values(e) : []
            }, v.size = function (e) {
                return null == e ? 0 : D(e) ? e.length : v.keys(e).length
            }, v.partition = N(function (e, t, i) {
                e[i ? 0 : 1].push(t)
            }, !0), v.first = v.head = v.take = function (e, t, i) {
                return null == e || e.length < 1 ? null == t ? void 0 : [] : null == t || i ? e[0] : v.initial(e, e.length - t)
            }, v.initial = function (e, t, i) {
                return d.call(e, 0, Math.max(0, e.length - (null == t || i ? 1 : t)))
            }, v.last = function (e, t, i) {
                return null == e || e.length < 1 ? null == t ? void 0 : [] : null == t || i ? e[e.length - 1] : v.rest(e, Math.max(0, e.length - t))
            }, v.rest = v.tail = v.drop = function (e, t, i) {
                return d.call(e, null == t || i ? 1 : t)
            }, v.compact = function (e) {
                return v.filter(e, Boolean)
            };
            var E = function (e, t, i, n) {
                for (var a = (n = n || []).length, o = 0, r = _(e); o < r; o++) {
                    var s = e[o];
                    if (D(s) && (v.isArray(s) || v.isArguments(s))) if (t) for (var l = 0, d = s.length; l < d;) n[a++] = s[l++]; else E(s, t, i, n), a = n.length; else i || (n[a++] = s)
                }
                return n
            };
            v.flatten = function (e, t) {
                return E(e, t, !1)
            }, v.without = T(function (e, t) {
                return v.difference(e, t)
            }), v.uniq = v.unique = function (e, t, i, n) {
                v.isBoolean(t) || (n = i, i = t, t = !1), null != i && (i = k(i, n));
                for (var a = [], o = [], r = 0, s = _(e); r < s; r++) {
                    var l = e[r], d = i ? i(l, r, e) : l;
                    t && !i ? (r && o === d || a.push(l), o = d) : i ? v.contains(o, d) || (o.push(d), a.push(l)) : v.contains(a, l) || a.push(l)
                }
                return a
            }, v.union = T(function (e) {
                return v.uniq(E(e, !0, !0))
            }), v.intersection = function (e) {
                for (var t = [], i = arguments.length, n = 0, a = _(e); n < a; n++) {
                    var o = e[n];
                    if (!v.contains(t, o)) {
                        var r;
                        for (r = 1; r < i && v.contains(arguments[r], o); r++) ;
                        r === i && t.push(o)
                    }
                }
                return t
            }, v.difference = T(function (e, t) {
                return t = E(t, !0, !0), v.filter(e, function (e) {
                    return !v.contains(t, e)
                })
            }), v.unzip = function (e) {
                for (var t = e && v.max(e, _).length || 0, i = Array(t), n = 0; n < t; n++) i[n] = v.pluck(e, n);
                return i
            }, v.zip = T(v.unzip), v.object = function (e, t) {
                for (var i = {}, n = 0, a = _(e); n < a; n++) t ? i[e[n]] = t[n] : i[e[n][0]] = e[n][1];
                return i
            };
            var P = function (e) {
                return function (t, i, n) {
                    i = k(i, n);
                    for (var a = _(t), o = e > 0 ? 0 : a - 1; o >= 0 && o < a; o += e) if (i(t[o], o, t)) return o;
                    return -1
                }
            };
            v.findIndex = P(1), v.findLastIndex = P(-1), v.sortedIndex = function (e, t, i, n) {
                for (var a = (i = k(i, n, 1))(t), o = 0, r = _(e); o < r;) {
                    var s = Math.floor((o + r) / 2);
                    i(e[s]) < a ? o = s + 1 : r = s
                }
                return o
            };
            var O = function (e, t, i) {
                return function (n, a, o) {
                    var r = 0, s = _(n);
                    if ("number" == typeof o) e > 0 ? r = o >= 0 ? o : Math.max(o + s, r) : s = o >= 0 ? Math.min(o + 1, s) : o + s + 1; else if (i && o && s) return n[o = i(n, a)] === a ? o : -1;
                    if (a != a) return (o = t(d.call(n, r, s), v.isNaN)) >= 0 ? o + r : -1;
                    for (o = e > 0 ? r : s - 1; o >= 0 && o < s; o += e) if (n[o] === a) return o;
                    return -1
                }
            };
            v.indexOf = O(1, v.findIndex, v.sortedIndex), v.lastIndexOf = O(-1, v.findLastIndex), v.range = function (e, t, i) {
                null == t && (t = e || 0, e = 0), i || (i = t < e ? -1 : 1);
                for (var n = Math.max(Math.ceil((t - e) / i), 0), a = Array(n), o = 0; o < n; o++, e += i) a[o] = e;
                return a
            }, v.chunk = function (e, t) {
                if (null == t || t < 1) return [];
                for (var i = [], n = 0, a = e.length; n < a;) i.push(d.call(e, n, n += t));
                return i
            };
            var M = function (e, t, i, n, a) {
                if (!(n instanceof t)) return e.apply(i, a);
                var o = w(e.prototype), r = e.apply(o, a);
                return v.isObject(r) ? r : o
            };
            v.bind = T(function (e, t, i) {
                if (!v.isFunction(e)) throw new TypeError("Bind must be called on a function");
                var n = T(function (a) {
                    return M(e, n, t, this, i.concat(a))
                });
                return n
            }), v.partial = T(function (e, t) {
                var i = v.partial.placeholder, n = function () {
                    for (var a = 0, o = t.length, r = Array(o), s = 0; s < o; s++) r[s] = t[s] === i ? arguments[a++] : t[s];
                    for (; a < arguments.length;) r.push(arguments[a++]);
                    return M(e, n, this, this, r)
                };
                return n
            }), v.partial.placeholder = v, v.bindAll = T(function (e, t) {
                var i = (t = E(t, !1, !1)).length;
                if (i < 1) throw new Error("bindAll must be passed function names");
                for (; i--;) {
                    var n = t[i];
                    e[n] = v.bind(e[n], e)
                }
            }), v.memoize = function (e, t) {
                var i = function (n) {
                    var a = i.cache, o = "" + (t ? t.apply(this, arguments) : n);
                    return S(a, o) || (a[o] = e.apply(this, arguments)), a[o]
                };
                return i.cache = {}, i
            }, v.delay = T(function (e, t, i) {
                return setTimeout(function () {
                    return e.apply(null, i)
                }, t)
            }), v.defer = v.partial(v.delay, v, 1), v.throttle = function (e, t, i) {
                var n, a, o, r, s = 0;
                i || (i = {});
                var l = function () {
                    s = !1 === i.leading ? 0 : v.now(), n = null, r = e.apply(a, o), n || (a = o = null)
                }, d = function () {
                    var d = v.now();
                    s || !1 !== i.leading || (s = d);
                    var u = t - (d - s);
                    return a = this, o = arguments, u <= 0 || u > t ? (n && (clearTimeout(n), n = null), s = d, r = e.apply(a, o), n || (a = o = null)) : n || !1 === i.trailing || (n = setTimeout(l, u)), r
                };
                return d.cancel = function () {
                    clearTimeout(n), s = 0, n = a = o = null
                }, d
            }, v.debounce = function (e, t, i) {
                var n, a, o = function (t, i) {
                    n = null, i && (a = e.apply(t, i))
                }, r = T(function (r) {
                    if (n && clearTimeout(n), i) {
                        var s = !n;
                        n = setTimeout(o, t), s && (a = e.apply(this, r))
                    } else n = v.delay(o, t, this, r);
                    return a
                });
                return r.cancel = function () {
                    clearTimeout(n), n = null
                }, r
            }, v.wrap = function (e, t) {
                return v.partial(t, e)
            }, v.negate = function (e) {
                return function () {
                    return !e.apply(this, arguments)
                }
            }, v.compose = function () {
                var e = arguments, t = e.length - 1;
                return function () {
                    for (var i = t, n = e[t].apply(this, arguments); i--;) n = e[i].call(this, n);
                    return n
                }
            }, v.after = function (e, t) {
                return function () {
                    if (--e < 1) return t.apply(this, arguments)
                }
            }, v.before = function (e, t) {
                var i;
                return function () {
                    return --e > 0 && (i = t.apply(this, arguments)), e <= 1 && (t = null), i
                }
            }, v.once = v.partial(v.before, 2), v.restArguments = T;
            var F = !{toString: null}.propertyIsEnumerable("toString"),
                L = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"],
                R = function (e, t) {
                    var i = L.length, n = e.constructor, a = v.isFunction(n) && n.prototype || r, o = "constructor";
                    for (S(e, o) && !v.contains(t, o) && t.push(o); i--;) (o = L[i]) in e && e[o] !== a[o] && !v.contains(t, o) && t.push(o)
                };
            v.keys = function (e) {
                if (!v.isObject(e)) return [];
                if (f) return f(e);
                var t = [];
                for (var i in e) S(e, i) && t.push(i);
                return F && R(e, t), t
            }, v.allKeys = function (e) {
                if (!v.isObject(e)) return [];
                var t = [];
                for (var i in e) t.push(i);
                return F && R(e, t), t
            }, v.values = function (e) {
                for (var t = v.keys(e), i = t.length, n = Array(i), a = 0; a < i; a++) n[a] = e[t[a]];
                return n
            }, v.mapObject = function (e, t, i) {
                t = k(t, i);
                for (var n = v.keys(e), a = n.length, o = {}, r = 0; r < a; r++) {
                    var s = n[r];
                    o[s] = t(e[s], s, e)
                }
                return o
            }, v.pairs = function (e) {
                for (var t = v.keys(e), i = t.length, n = Array(i), a = 0; a < i; a++) n[a] = [t[a], e[t[a]]];
                return n
            }, v.invert = function (e) {
                for (var t = {}, i = v.keys(e), n = 0, a = i.length; n < a; n++) t[e[i[n]]] = i[n];
                return t
            }, v.functions = v.methods = function (e) {
                var t = [];
                for (var i in e) v.isFunction(e[i]) && t.push(i);
                return t.sort()
            };
            var B = function (e, t) {
                return function (i) {
                    var n = arguments.length;
                    if (t && (i = Object(i)), n < 2 || null == i) return i;
                    for (var a = 1; a < n; a++) for (var o = arguments[a], r = e(o), s = r.length, l = 0; l < s; l++) {
                        var d = r[l];
                        t && void 0 !== i[d] || (i[d] = o[d])
                    }
                    return i
                }
            };
            v.extend = B(v.allKeys), v.extendOwn = v.assign = B(v.keys), v.findKey = function (e, t, i) {
                t = k(t, i);
                for (var n, a = v.keys(e), o = 0, r = a.length; o < r; o++) if (t(e[n = a[o]], n, e)) return n
            };
            var U, K, V = function (e, t, i) {
                return t in i
            };
            v.pick = T(function (e, t) {
                var i = {}, n = t[0];
                if (null == e) return i;
                v.isFunction(n) ? (t.length > 1 && (n = y(n, t[1])), t = v.allKeys(e)) : (n = V, t = E(t, !1, !1), e = Object(e));
                for (var a = 0, o = t.length; a < o; a++) {
                    var r = t[a], s = e[r];
                    n(s, r, e) && (i[r] = s)
                }
                return i
            }), v.omit = T(function (e, t) {
                var i, n = t[0];
                return v.isFunction(n) ? (n = v.negate(n), t.length > 1 && (i = t[1])) : (t = v.map(E(t, !1, !1), String), n = function (e, i) {
                    return !v.contains(t, i)
                }), v.pick(e, n, i)
            }), v.defaults = B(v.allKeys, !0), v.create = function (e, t) {
                var i = w(e);
                return t && v.extendOwn(i, t), i
            }, v.clone = function (e) {
                return v.isObject(e) ? v.isArray(e) ? e.slice() : v.extend({}, e) : e
            }, v.tap = function (e, t) {
                return t(e), e
            }, v.isMatch = function (e, t) {
                var i = v.keys(t), n = i.length;
                if (null == e) return !n;
                for (var a = Object(e), o = 0; o < n; o++) {
                    var r = i[o];
                    if (t[r] !== a[r] || !(r in a)) return !1
                }
                return !0
            }, U = function (e, t, i, n) {
                if (e === t) return 0 !== e || 1 / e == 1 / t;
                if (null == e || null == t) return !1;
                if (e != e) return t != t;
                var a = typeof e;
                return ("function" === a || "object" === a || "object" == typeof t) && K(e, t, i, n)
            }, K = function (e, t, i, n) {
                e instanceof v && (e = e._wrapped), t instanceof v && (t = t._wrapped);
                var a = u.call(e);
                if (a !== u.call(t)) return !1;
                switch (a) {
                    case"[object RegExp]":
                    case"[object String]":
                        return "" + e == "" + t;
                    case"[object Number]":
                        return +e != +e ? +t != +t : 0 == +e ? 1 / +e == 1 / t : +e == +t;
                    case"[object Date]":
                    case"[object Boolean]":
                        return +e == +t;
                    case"[object Symbol]":
                        return s.valueOf.call(e) === s.valueOf.call(t)
                }
                var o = "[object Array]" === a;
                if (!o) {
                    if ("object" != typeof e || "object" != typeof t) return !1;
                    var r = e.constructor, l = t.constructor;
                    if (r !== l && !(v.isFunction(r) && r instanceof r && v.isFunction(l) && l instanceof l) && "constructor" in e && "constructor" in t) return !1
                }
                i = i || [], n = n || [];
                for (var d = i.length; d--;) if (i[d] === e) return n[d] === t;
                if (i.push(e), n.push(t), o) {
                    if ((d = e.length) !== t.length) return !1;
                    for (; d--;) if (!U(e[d], t[d], i, n)) return !1
                } else {
                    var c, h = v.keys(e);
                    if (d = h.length, v.keys(t).length !== d) return !1;
                    for (; d--;) if (c = h[d], !S(t, c) || !U(e[c], t[c], i, n)) return !1
                }
                return i.pop(), n.pop(), !0
            }, v.isEqual = function (e, t) {
                return U(e, t)
            }, v.isEmpty = function (e) {
                return null == e || (D(e) && (v.isArray(e) || v.isString(e) || v.isArguments(e)) ? 0 === e.length : 0 === v.keys(e).length)
            }, v.isElement = function (e) {
                return !(!e || 1 !== e.nodeType)
            }, v.isArray = h || function (e) {
                return "[object Array]" === u.call(e)
            }, v.isObject = function (e) {
                var t = typeof e;
                return "function" === t || "object" === t && !!e
            }, v.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error", "Symbol", "Map", "WeakMap", "Set", "WeakSet"], function (e) {
                v["is" + e] = function (t) {
                    return u.call(t) === "[object " + e + "]"
                }
            }), v.isArguments(arguments) || (v.isArguments = function (e) {
                return S(e, "callee")
            });
            var W = n.document && n.document.childNodes;
            "function" != typeof /./ && "object" != typeof Int8Array && "function" != typeof W && (v.isFunction = function (e) {
                return "function" == typeof e || !1
            }), v.isFinite = function (e) {
                return !v.isSymbol(e) && isFinite(e) && !isNaN(parseFloat(e))
            }, v.isNaN = function (e) {
                return v.isNumber(e) && isNaN(e)
            }, v.isBoolean = function (e) {
                return !0 === e || !1 === e || "[object Boolean]" === u.call(e)
            }, v.isNull = function (e) {
                return null === e
            }, v.isUndefined = function (e) {
                return void 0 === e
            }, v.has = function (e, t) {
                if (!v.isArray(t)) return S(e, t);
                for (var i = t.length, n = 0; n < i; n++) {
                    var a = t[n];
                    if (null == e || !c.call(e, a)) return !1;
                    e = e[a]
                }
                return !!i
            }, v.noConflict = function () {
                return n._ = a, this
            }, v.identity = function (e) {
                return e
            }, v.constant = function (e) {
                return function () {
                    return e
                }
            }, v.noop = function () {
            }, v.property = function (e) {
                return v.isArray(e) ? function (t) {
                    return I(t, e)
                } : C(e)
            }, v.propertyOf = function (e) {
                return null == e ? function () {
                } : function (t) {
                    return v.isArray(t) ? I(e, t) : e[t]
                }
            }, v.matcher = v.matches = function (e) {
                return e = v.extendOwn({}, e), function (t) {
                    return v.isMatch(t, e)
                }
            }, v.times = function (e, t, i) {
                var n = Array(Math.max(0, e));
                t = y(t, i, 1);
                for (var a = 0; a < e; a++) n[a] = t(a);
                return n
            }, v.random = function (e, t) {
                return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1))
            }, v.now = Date.now || function () {
                return (new Date).getTime()
            };
            var G = {"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;"},
                H = v.invert(G), z = function (e) {
                    var t = function (t) {
                        return e[t]
                    }, i = "(?:" + v.keys(e).join("|") + ")", n = RegExp(i), a = RegExp(i, "g");
                    return function (e) {
                        return e = null == e ? "" : "" + e, n.test(e) ? e.replace(a, t) : e
                    }
                };
            v.escape = z(G), v.unescape = z(H), v.result = function (e, t, i) {
                v.isArray(t) || (t = [t]);
                var n = t.length;
                if (!n) return v.isFunction(i) ? i.call(e) : i;
                for (var a = 0; a < n; a++) {
                    var o = null == e ? void 0 : e[t[a]];
                    void 0 === o && (o = i, a = n), e = v.isFunction(o) ? o.call(e) : o
                }
                return e
            };
            var j = 0;
            v.uniqueId = function (e) {
                var t = ++j + "";
                return e ? e + t : t
            }, v.templateSettings = {
                evaluate: /<%([\s\S]+?)%>/g,
                interpolate: /<%=([\s\S]+?)%>/g,
                escape: /<%-([\s\S]+?)%>/g
            };
            var X = /(.)^/, $ = {"'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029"},
                Y = /\\|'|\r|\n|\u2028|\u2029/g, q = function (e) {
                    return "\\" + $[e]
                };
            v.template = function (e, t, i) {
                !t && i && (t = i), t = v.defaults({}, t, v.templateSettings);
                var n,
                    a = RegExp([(t.escape || X).source, (t.interpolate || X).source, (t.evaluate || X).source].join("|") + "|$", "g"),
                    o = 0, r = "__p+='";
                e.replace(a, function (t, i, n, a, s) {
                    return r += e.slice(o, s).replace(Y, q), o = s + t.length, i ? r += "'+\n((__t=(" + i + "))==null?'':_.escape(__t))+\n'" : n ? r += "'+\n((__t=(" + n + "))==null?'':__t)+\n'" : a && (r += "';\n" + a + "\n__p+='"), t
                }), r += "';\n", t.variable || (r = "with(obj||{}){\n" + r + "}\n"), r = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + r + "return __p;\n";
                try {
                    n = new Function(t.variable || "obj", "_", r)
                } catch (e) {
                    throw e.source = r, e
                }
                var s = function (e) {
                    return n.call(this, e, v)
                }, l = t.variable || "obj";
                return s.source = "function(" + l + "){\n" + r + "}", s
            }, v.chain = function (e) {
                var t = v(e);
                return t._chain = !0, t
            };
            var J = function (e, t) {
                return e._chain ? v(t).chain() : t
            };
            v.mixin = function (e) {
                return v.each(v.functions(e), function (t) {
                    var i = v[t] = e[t];
                    v.prototype[t] = function () {
                        var e = [this._wrapped];
                        return l.apply(e, arguments), J(this, i.apply(v, e))
                    }
                }), v
            }, v.mixin(v), v.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (e) {
                var t = o[e];
                v.prototype[e] = function () {
                    var i = this._wrapped;
                    return t.apply(i, arguments), "shift" !== e && "splice" !== e || 0 !== i.length || delete i[0], J(this, i)
                }
            }), v.each(["concat", "join", "slice"], function (e) {
                var t = o[e];
                v.prototype[e] = function () {
                    return J(this, t.apply(this._wrapped, arguments))
                }
            }), v.prototype.value = function () {
                return this._wrapped
            }, v.prototype.valueOf = v.prototype.toJSON = v.prototype.value, v.prototype.toString = function () {
                return String(this._wrapped)
            }, void 0 === (i = function () {
                return v
            }.apply(t, [])) || (e.exports = i)
        }()
    }).call(this, i(860)(e))
}, function (e, t, i) {
    "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, i) {
    "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, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.information = ((...e) => {
    }), t.error = ((...e) => {
    }), t.warning = ((...e) => {
    }), t.critical = ((...e) => {
    }), t.verbose = ((...e) => {
    })
}, function (e, t) {
    e.exports = require("buffer")
}, function (e, t, i) {
    e.exports = i(58)(45)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(535), o = i(4), r = i(30), s = n.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, i) {
            let n = !1;
            if (!e || 38 !== e.length) return s.warning("setUserData invalid userGuid:", e), n;
            let a = this.userData.addMapItem("UserData").addMapItem(e);
            if (o.isNumber(i) ? (n = a.addItem(t, i), s.information("addItem number key:", t, ", value:", i)) : o.isString(i) ? (n = a.addItem(t, i), s.information("addItem string key:", t, ", value:", i)) : o.isObject(i) ? (n = a.addItem(t, i), s.information("addItem map key:", t, ", value:", i)) : s.information("addItem not support value type. key:", t, ", value:", i), n) {
                let e = "";
                e = this.userData.encode(e), s.information("bencodingUserData:", e), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, e)
            }
            return n
        }

        getUserData(e, t) {
            if (!e || 38 !== e.length) return void s.warning("getUserData invalid userGuid:", e);
            let i = this.userData.getItem("UserData");
            if (!i) return;
            let n = i.getItem(e);
            if (!n) return;
            if (!t) return n.getValue();
            let o = n.getItem(t);
            if (o) switch (o.getType()) {
                case a.BencodeMap.BencodeDataType.Integer:
                case a.BencodeMap.BencodeDataType.String:
                case a.BencodeMap.BencodeDataType.List:
                case a.BencodeMap.BencodeDataType.Map:
                    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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(30), o = i(0), r = i(4), s = i(16), l = o.default.getLogger("download-panel-thunderPanTask");
    !function (e) {
        e.createPanTable = function () {
            let e = a.ThunderKernel.beginTransaction();
            a.ThunderKernel.execSqlite("CREATE TABLE if not exists ThunderPanTask (       id  INTEGER PRIMARY KEY,       TaskId BIGINT not null,       PanTaskId varchar(255),       Data Blob,       FileId varchar(255),       UserId varchar(20) not null,       FOREIGN KEY(TaskId) REFERENCES TaskBase(TaskId)      );", (e, t) => {
            }), a.ThunderKernel.execSqlite("CREATE INDEX if not exists PanTaskId ON ThunderPanTask (PanTaskId);                              CREATE INDEX if not exists FileId ON ThunderPanTask (FileId);                              CREATE INDEX if not exists TaskId ON ThunderPanTask (TaskId);    ", (e, t) => {
            }), a.ThunderKernel.commitTransaction(e)
        }, e.insertTask = function (e, t, i, n) {
            let o;
            return r.isNullOrUndefined(n) ? (l.warning("error param, expect data, got 0. "), !1) : (o = `INSERT INTO ThunderPanTask (TaskId, PanTaskId, UserId, Data) VALUES (${e}, '${t}', '${i}', '${n}')`, a.ThunderKernel.execSqlite(o, (e, t) => {
            }), s.server.fireClientEvent("OnInsertThunderPanTask"), !0)
        }, e.queryTask = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = {};
                return new Promise(function (n, o) {
                    a.ThunderKernel.querySqlite(`SELECT PanTaskId, FileId, Data from ThunderPanTask where TaskId = ${e} and userId = '${t}'`, (e, t, a) => {
                        if (!t || t.length < 1) n(void 0); else if (1 === t.length) {
                            for (let e of t[0]) i[e.key] = e.value;
                            n(i)
                        } else {
                            let e = [];
                            for (let i of t) {
                                let t = {};
                                for (let e of i) t[e.key] = e.value;
                                e.push(t)
                            }
                            n(e)
                        }
                    })
                })
            })
        }, e.deleteTask = function (e, t, i) {
            let n;
            if (e) n = `DELETE FROM ThunderPanTask where PanTaskId = '${e}'`; else if (t) n = `DELETE FROM ThunderPanTask WHERE FileId = '${t}'`; else {
                if (!i) return l.warning("deleteTask got wrong param, expect 1, get 0"), !1;
                n = `DELETE FROM ThunderPanTask where TaskId = ${i}`
            }
            return a.ThunderKernel.execSqlite(n, (e, t) => {
            }), !1
        }, e.updateTaskPath = function (e, t) {
            return a.ThunderKernel.execSqlite(`UPDATE ThunderPanTask SET Data = '${t}' where fileId = '${e}'`, (e, t) => {
            }), !1
        }, e.updateTaskFileId = function (e, t) {
            return "" !== e ? a.ThunderKernel.execSqlite(`UPDATE ThunderPanTask SET FileId = '${t}' WHERE PanTaskId = '${e}';`, (e, t) => {
            }) : "" !== t && a.ThunderKernel.execSqlite(`UPDATE ThunderPanTask SET PanTaskId = '${e}' WHERE FileId = '${t}';`, (e, t) => {
            }), !1
        }
    }(t.ThunderPanTaskNS || (t.ThunderPanTaskNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(17), a = i(5), o = i(13), r = i(10), s = i(0);
    let {isDef: l, isUndef: d} = o.ThunderUtil;
    const u = s.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 (d(e)) break;
                    if (e.priority = e.priority || t.Low, l(this.option) && e.priority <= this.option.priority) break;
                    this.option = e
                } while (0)
            }

            getOption() {
                return this.option
            }

            attachListenerEvent() {
                do {
                    if (d(this.option)) break;
                    if (!1 === this.eventListener) {
                        this.eventListener = !0;
                        let e = "logtype=client";
                        l(this.option.stat) && l(this.option.stat.logfrom) && (e = e + ",logfrom=" + this.option.stat.logfrom), r.XLStatNS.trackEvent("user_info", "loginpanel_show", "", 0, 0, 0, 0, e), this.onLoginSucCookie = n.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                            this.eventListener = !1, this.detachListenerEvent(), l(this.option.tabUrl) && "" !== this.option.tabUrl && a.client.callServerFunction("OpenNewTab", this.option.tabUrl).catch()
                        }), this.onLoginFailedCookie = n.NativeCallModule.nativeCall.AttachNativeEvent("onLoginFailed", (t, i) => {
                            "close" === i && (this.option.perpetual || (this.option = null), r.XLStatNS.trackEvent("user_info", "loginpanel_close", "", 0, 0, 0, 0, e)), this.eventListener = !1, this.detachListenerEvent()
                        })
                    }
                } while (0)
            }

            detachListenerEvent() {
                n.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginSucCookie), n.NativeCallModule.nativeCall.DetachNativeEvent("onLoginFailed", this.onLoginFailedCookie)
            }
        }
    }(t.LoginOptionNS || (t.LoginOptionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(34), o = i(3), r = i(9), s = i(64);
    !function (e) {
        let t;

        function i(e, i) {
            let n = {sortBy: t.Default, asce: !0};
            do {
                if (void 0 === e || null === e) break;
                let a = "", s = "";
                if (e === o.DownloadKernel.CategroyViewID.Downloading) -1 === i ? (a = "CategoryViewId1_SortAttr", s = "CategoryViewId1_SortState") : (a = "CategoryViewId4_SortAttr", s = "CategoryViewId4_SortState"); else if (e === o.DownloadKernel.CategroyViewID.Completed) -1 === i ? (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 d = 0 === r.ConfigNS.getValue("TaskList", s, -1);
                n.sortBy = l, n.asce = d
            } while (0);
            return n
        }

        function l(e, t, i) {
            do {
                if (void 0 === t || null === t) break;
                let n = "", a = "";
                if (t === o.DownloadKernel.CategroyViewID.Downloading) -1 === i ? (n = "CategoryViewId1_SortAttr", a = "CategoryViewId1_SortState") : (n = "CategoryViewId4_SortAttr", a = "CategoryViewId4_SortState"); else if (t === o.DownloadKernel.CategroyViewID.Completed) -1 === i ? (n = "CategoryViewId2_SortAttr", a = "CategoryViewId2_SortState") : (n = "CategoryViewId5_SortAttr", a = "CategoryViewId5_SortState"); else {
                    if (t !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    n = "CategoryViewId3_SortAttr", a = "CategoryViewId3_SortState"
                }
                r.ConfigNS.setValue("TaskList", n, e.sortBy);
                let s = e.asce ? 0 : -1;
                r.ConfigNS.setValue("TaskList", a, s)
            } while (0)
        }

        function d(e, t) {
            let i = null;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? i = ((e, i) => {
                let n = e.createTime, a = i.createTime;
                return t ? n - a : a - n
            }) : e === o.DownloadKernel.CategroyViewID.Completed ? i = ((e, i) => {
                let n = e.completionTime, a = i.completionTime;
                return t ? n - a : a - n
            }) : e === o.DownloadKernel.CategroyViewID.Recycle && (i = ((e, i) => {
                let n = e.recycleTime, a = i.recycleTime;
                return t ? n - a : a - n
            })), i
        }

        function u(e) {
            return (t, i) => {
                let a = t.taskType, o = i.taskType;
                if (e) {
                    if (a === o) {
                        let e = n.extname(t.taskName).toLowerCase(), a = n.extname(i.taskName).toLowerCase();
                        return e === a ? 0 : e < a ? -1 : 1
                    }
                    return a - o
                }
                if (a === o) {
                    let e = n.extname(t.taskName).toLowerCase(), a = n.extname(i.taskName).toLowerCase();
                    return e === a ? 0 : e < a ? 1 : -1
                }
                return o - a
            }
        }

        function c(e) {
            return (t, i) => {
                let n = t.fileSize, a = i.fileSize;
                return e ? n - a : a - n
            }
        }

        function h(e) {
            return (t, i) => {
                let n = t.taskName, o = i.taskName;
                return e ? a.ThunderHelper.compareStr(o, n) : a.ThunderHelper.compareStr(n, o)
            }
        }

        function f(e) {
            return (t, i) => {
                let n = s.TaskStatusHelper.getValueForSort(t), a = s.TaskStatusHelper.getValueForSort(i);
                return e ? n - a : a - n
            }
        }

        function g(e) {
            return (t, i) => {
                if (0 === t.fileSize && i.fileSize > 0) return e ? -1 : 1;
                if (t.fileSize > 0 && 0 === i.fileSize) return e ? 1 : -1;
                if (0 === t.fileSize && 0 === i.fileSize) return 0;
                {
                    let n = t.downloadSize / t.fileSize, a = i.downloadSize / i.fileSize;
                    return e ? n - a : a - n
                }
            }
        }

        function p(e, n, a) {
            let o = null;
            void 0 !== a && null !== a || (a = i(e, n));
            do {
                if (a.asce = !1, a.sortBy === t.Default) {
                    o = d(e, !1);
                    break
                }
                if (a.sortBy === t.ByTime_Creation || a.sortBy === t.ByTime_Completion || a.sortBy === t.ByTime_Remain) {
                    o = d(e, a.asce);
                    break
                }
                if (a.sortBy === t.BySize) {
                    o = c(a.asce);
                    break
                }
                if (a.sortBy === t.ByType) {
                    o = u(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 = d(e, !1)), o
        }

        function v(e, t, i) {
            let n = 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 && (n = {
                compareFn: p(e, t, i),
                index: a,
                categoryId: t
            }), n
        }

        !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 = i, e.setSortConfig = l, e.getSortFuncByConfig = p, e.getSortCommitParamByConfig = v, e.handleSortMenuClick = function (e, i, n, a, r) {
            let s = !1;
            i === t.ByTime && (i = 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), i !== t.Default && (s = void 0 === n || n), l({
                sortBy: i,
                asce: !s
            }, a, r), e(v(a, r))
        }
    }(t.SortNS || (t.SortNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(62), r = i(338), s = i(24), l = i(3), d = i(12).DownloadKernelTaskManager.getTaskManager(),
        u = a.default.getLogger("ShouleiShareLink");

    function c(e) {
        let t = "";
        do {
            t = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskUrl);
            let i = e.getType();
            if (i === l.DownloadKernel.TaskType.Emule || i === l.DownloadKernel.TaskType.P2sp) break;
            if (i === l.DownloadKernel.TaskType.Bt) {
                if (!t || "" === t) {
                    t = "magnet:?xt=urn:btih:" + e.getExtraObject().getInfoId()
                }
                break
            }
        } while (0);
        return t
    }

    function h(e) {
        let t = -1;
        do {
            if (e.getType() !== l.DownloadKernel.TaskType.Bt) break;
            let i = e.getExtraObject().getBtFileList();
            for (let e = 0; e < i.size; ++e) {
                let n = i.get(e);
                if (n && n.isSupportPlay()) {
                    t = e;
                    break
                }
            }
        } while (0);
        return t
    }

    function f(e) {
        let t = "";
        {
            let i = e.getType();
            if (i === l.DownloadKernel.TaskType.Emule || i === l.DownloadKernel.TaskType.P2sp) t = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.Gcid); else if (i === l.DownloadKernel.TaskType.Bt) {
                t = e.getExtraObject().getInfoId()
            }
        }
        return t
    }

    function g(e, t, i = "download", a = null) {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                let r = c(e);
                if (!r || "" === r) break;
                let s = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                    d = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.RefUrl),
                    g = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize), p = h(e), v = f(e);
                try {
                    let e = {
                        url: r,
                        title: s,
                        refUrl: d,
                        fileSize: g,
                        type: i,
                        gcid: v,
                        videobtindex: p,
                        share_from: t
                    };
                    a && (e.peerID = a.peerId, e.hostIPv4 = a.hostIp, e.tcpPort = a.tcpPort, e.udpPort = a.udpPort, e.peerCapability = a.peerCapability);
                    let l = yield o.fetchSlRes({url: "/remotestorage/wechart_set", data: e, method: "post"});
                    if (u.warning("fetchSlRes response", l), null !== l && void 0 !== l && 200 === l.status && null !== l.data && void 0 !== l.data) {
                        let e = l.data;
                        "ok" === e.result && "" !== e.storid && (n = e.storid)
                    }
                } catch (e) {
                    u.warning("fetchSlRes failed!", e)
                }
            } while (0);
            return n
        })
    }

    function p(e, t, i, a, r, s, l, d = "download", c = null) {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                if (!e || "" === e) break;
                try {
                    let h = {
                        url: e,
                        title: t,
                        refUrl: i,
                        fileSize: a,
                        type: d,
                        gcid: r,
                        videobtindex: s,
                        share_from: l
                    };
                    c && (h.peerID = c.peerId, h.hostIPv4 = c.hostIp, h.tcpPort = c.tcpPort, h.udpPort = c.udpPort, h.peerCapability = c.peerCapability);
                    let f = yield o.fetchSlRes({url: "/remotestorage/wechart_set", data: h, method: "post"});
                    if (u.information("fetchSlRes data", h, "response", f), null !== f && void 0 !== f && 200 === f.status && null !== f.data && void 0 !== f.data) {
                        let e = f.data;
                        "ok" === e.result && "" !== e.storid && (n = e.storid)
                    }
                } catch (e) {
                    u.warning("fetchSlRes failed!", e)
                }
            } while (0);
            return n
        })
    }

    function v(e, t = "pic", i = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                let a = d.getTaskFromTaskId(e);
                if (!a) break;
                let o = yield g(a, i);
                if (o && "" !== o) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "shareLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html");
                    let r = h(a);
                    n = `${e}?entry=${t}&appType=PC&videobtindex=${r}&storid=${o}&share_from=${i}`, u.information("shareLink", n)
                }
            } while (0);
            return n
        })
    }

    function m(e, t, i, a, o, r, l = "pic", d = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            {
                let c = yield p(e, t, i, a, o, r, d);
                if (c && "" !== c) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "shareLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html"), n = `${e}?entry=${l}&appType=PC&videobtindex=${r}&storid=${c}&share_from=${d}`, u.information("shareLink", n)
                }
            }
            return n
        })
    }

    function y(e, t, i = "pic", a = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                let o = d.getTaskFromTaskId(e);
                if (!o) break;
                let r = yield g(o, a, "file_transfer", t);
                if (r && "" !== r) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "fileTransferLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html");
                    let t = h(o);
                    n = `${e}?entry=${i}&appType=PC&videobtindex=${t}&storid=${r}&share_from=${a}&pcfiletransfer=1`, u.information("shareLink", n)
                }
            } while (0);
            return n
        })
    }

    function k(e, t, i, a, o, r, l, d = "pic", c = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            {
                let h = yield p(e, t, i, a, o, r, c, "file_transfer", l);
                if (h && "" !== h) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "fileTransferLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html"), n = `${e}?entry=${d}&appType=PC&videobtindex=${r}&storid=${h}&share_from=${c}&pcfiletransfer=1`, u.information("shareLink", n)
                }
            }
            return n
        })
    }

    t.getShouleiShareLink = v, t.getShouleiShareLink2 = m, t.getShouleiShareLinkDlj = function (e, t = "pic", i = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", a = yield v(e, t, i);
            return a && "" !== a && (n = yield r.getBaiduDWZ(a), u.information("GetBaiduDWZ", n)), n
        })
    }, t.getShouleiShareLinkDlj2 = function (e, t, i, a, o, s, l = "pic", d = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", c = yield m(e, t, i, a, o, s, l, d);
            return c && "" !== c && (n = yield r.getBaiduDWZ(c), u.information("GetBaiduDWZ", n)), n
        })
    }, t.getShouleiFileTransferLink = y, t.getShouleiFileTransferDlj = function (e, t, i = "pic", a = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", o = yield y(e, t, i, a);
            return o && "" !== o && (n = yield r.getBaiduDWZ(o), u.information("GetBaiduDWZ", n)), n
        })
    }, t.getShouleiFileTransferLink2 = k, t.getShouleiFileTransferDlj2 = function (e, t, i, a, o, s, l, d = "pic", c = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", h = yield k(e, t, i, a, o, s, l, d, c);
            return h && "" !== h && (n = yield r.getBaiduDWZ(h), u.information("GetBaiduDWZ", n)), n
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(88), o = i(9), r = i(0), s = i(22), l = i(11), d = i(10), u = i(87), c = i(5),
        h = r.default.getLogger("Bt-task-renderer");

    class f {
        constructor() {
            this.isPopWndExist = !1, this.isManualPopUp = !1
        }

        whetherShowEntry() {
            return this.getBrowserInfos().length > 0
        }

        whetherPopUp() {
            let e, t = this.getBrowserInfos(), i = "";
            if (t && t.length > 0) for (let n = 0; n < t.length; n++) if (t[n].browserName) {
                if (!(i = t[n].browserName.startsWith("360") ? t[n].browserName : "other")) continue;
                if (e = o.ConfigNS.getValue("ThunderFirstInstall", `IsFirstInstall${i}`, 1), h.information(`是否是第一次安装${i}: `, e), 1 === e) break
            }
            return 1 === e
        }

        popUpBrowserGuide(e = !1, t = "other", i) {
            return n(this, void 0, void 0, function* () {
                if (this.isPopWndExist) return;
                this.isManualPopUp = i;
                const n = yield l.asyncRemoteCall.getCurrentWindow();
                n && !(yield n.isVisible()) ? n.once("show", () => {
                    setTimeout(() => {
                        this.interalShow(e, t).catch()
                    }, 1e3)
                }) : this.interalShow(e, t).catch()
            })
        }

        interalShow(e, t) {
            return n(this, void 0, void 0, function* () {
                this.isPopWndExist = !0, !0 !== this.isManualPopUp && d.XLStatNS.trackEvent("setting_center", "use_xl_download_show", "", 0, 0, 0, 0), yield s.MessageBox.custom("BrowserConfigGuide", {
                    isManual: this.isManualPopUp,
                    showMoreSupport: e,
                    from: t
                }, {
                    modal: !0,
                    width: 450,
                    height: 348,
                    show: !1
                }), c.client.callServerFunction("ClosePopMutual", u.PopView.BROWSER_GUIDE).catch(), this.isPopWndExist = !1
            })
        }

        getBrowserInfos() {
            let e = [], t = a.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("360安全浏览器");
            t && e.push(t);
            let i = a.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("QQ浏览器");
            return i && e.push(i), h.information("已安装的浏览器:", e), e
        }
    }

    t.default = function () {
        return f.instance || (f.instance = new f), f.instance
    }
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s = {}.hasOwnProperty;
        r = i(70), o = r.isObject, a = r.isFunction, n = i(50), t = i(450), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing element name");
                this.name = this.stringify.eleName(t), this.attributes = {}, null != n && this.attribute(n), e.isDocument && (this.isRoot = !0, this.documentObject = e, e.rootObject = this)
            }

            return function (e, t) {
                for (var i in t) s.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, n), i.prototype.clone = function () {
                var e, t, i, n;
                for (t in (i = Object.create(this)).isRoot && (i.documentObject = null), i.attributes = {}, n = this.attributes) s.call(n, t) && (e = n[t], i.attributes[t] = e.clone());
                return i.children = [], this.children.forEach(function (e) {
                    var t;
                    return (t = e.clone()).parent = i, i.children.push(t)
                }), i
            }, i.prototype.attribute = function (e, i) {
                var n, r;
                if (null != e && (e = e.valueOf()), o(e)) for (n in e) s.call(e, n) && (r = e[n], this.attribute(n, r)); else a(i) && (i = i.apply()), this.options.skipNullAttributes && null == i || (this.attributes[e] = new t(this, e, i));
                return this
            }, i.prototype.removeAttribute = function (e) {
                var t, i, n;
                if (null == e) throw new Error("Missing attribute name");
                if (e = e.valueOf(), Array.isArray(e)) for (i = 0, n = e.length; i < n; i++) t = e[i], delete this.attributes[t]; else delete this.attributes[e];
                return this
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).element(this)
            }, i.prototype.att = function (e, t) {
                return this.attribute(e, t)
            }, i.prototype.a = function (e, t) {
                return this.attribute(e, t)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__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 i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).cdata(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__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 i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).comment(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a = {}.hasOwnProperty;
        n = i(70).isObject, t = i(50), e.exports = function (e) {
            function i(e, t, a, o) {
                var r;
                i.__super__.constructor.call(this, e), n(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 i in t) a.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).declaration(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l = {}.hasOwnProperty;
        s = i(70).isObject, r = i(50), t = i(129), a = i(130), n = i(131), o = i(132), e.exports = function (e) {
            function i(e, t, n) {
                var a, o;
                i.__super__.constructor.call(this, e), this.documentObject = e, s(t) && (t = (a = t).pubID, n = a.sysID), null == n && (n = (o = [t, n])[0], t = o[1]), null != t && (this.pubID = this.stringify.dtdPubID(t)), null != n && (this.sysID = this.stringify.dtdSysID(n))
            }

            return function (e, t) {
                for (var i in t) l.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, r), i.prototype.element = function (e, t) {
                var i;
                return i = new n(this, e, t), this.children.push(i), this
            }, i.prototype.attList = function (e, i, n, a, o) {
                var r;
                return r = new t(this, e, i, n, a, o), this.children.push(r), this
            }, i.prototype.entity = function (e, t) {
                var i;
                return i = new a(this, !1, e, t), this.children.push(i), this
            }, i.prototype.pEntity = function (e, t) {
                var i;
                return i = new a(this, !0, e, t), this.children.push(i), this
            }, i.prototype.notation = function (e, t) {
                var i;
                return i = new o(this, e, t), this.children.push(i), this
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).docType(this)
            }, i.prototype.ele = function (e, t) {
                return this.element(e, t)
            }, i.prototype.att = function (e, t, i, n, a) {
                return this.attList(e, t, i, n, a)
            }, i.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, i.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, i.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, i.prototype.up = function () {
                return this.root() || this.documentObject
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n, a, o, r) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                if (null == n) 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(n), this.attributeType = this.stringify.dtdAttType(a), this.defaultValue = this.stringify.dtdAttDefault(r), this.defaultValueType = o
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdAttList(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a = {}.hasOwnProperty;
        n = i(70).isObject, t = i(50), e.exports = function (e) {
            function i(e, t, a, o) {
                if (i.__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), n(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 i in t) a.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdEntity(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                n || (n = "(#PCDATA)"), Array.isArray(n) && (n = "(" + n.join(",") + ")"), this.name = this.stringify.eleName(t), this.value = this.stringify.dtdElementValue(n)
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdElement(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing notation name");
                if (!n.pubID && !n.sysID) throw new Error("Public or system identifiers are required for an external entity");
                this.name = this.stringify.eleName(t), null != n.pubID && (this.pubID = this.stringify.dtdPubID(n.pubID)), null != n.sysID && (this.sysID = this.stringify.dtdSysID(n.sysID))
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdNotation(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__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 i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).raw(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__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 i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).text(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing instruction target");
                this.target = this.stringify.insTarget(t), n && (this.value = this.stringify.insValue(n))
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).processingInstruction(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(454), o = i(578), r = i(138), s = i(579), l = i(456), d = i(581), u = i(100), c = i(25), h = i(0),
        f = i(4), g = h.default.getLogger("EmbeddedBrowserManagerNs");
    let p = [];
    !function (e) {
        function t(e, ...t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (null === e || void 0 === e || "" === e) {
                        g.information("createWebWnd 参数错误：webType=", e);
                        break
                    }
                    let i = t[0];
                    if (null === i || void 0 === i || "" === i) {
                        g.information("createWebWnd 参数错误：url=", i);
                        break
                    }
                    let n = t[1];
                    null !== n && void 0 !== n || (n = "");
                    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) {
                        g.information("createWebWnd 参数错误：wndWidth=", r);
                        break
                    }
                    let s = t[4];
                    if (null === s || void 0 === s || s <= 0) {
                        g.information("createWebWnd 参数错误：wndHeight=", s);
                        break
                    }
                    let l = t[5];
                    if (null === l || void 0 === l) {
                        g.information("createWebWnd 参数错误：browserLeftMargin=", l);
                        break
                    }
                    let d = t[6];
                    if (null === d || void 0 === d) {
                        g.information("createWebWnd 参数错误：browserRightMargin=", d);
                        break
                    }
                    let c = t[7];
                    if (null === c || void 0 === c) {
                        g.information("createWebWnd 参数错误：browserTopMargin=", c);
                        break
                    }
                    let h = t[8];
                    if (null === h || void 0 === h) {
                        g.information("createWebWnd 参数错误：browserBootomMargin=", h);
                        break
                    }
                    let f = p.filter(t => e === t.moduleName), v = null;
                    if (!(null === f || void 0 === f || f.length <= 0)) {
                        v = f[0].embeddedBrowserObj;
                        break
                    }
                    {
                        v = new u.EmbeddedBrowser;
                        let t = {moduleName: e, embeddedBrowserObj: v};
                        p.push(t)
                    }
                    let m = t[9], y = t[10], k = t[11], T = t[12];
                    T && v.setBrowserEventHandler(T), yield v.createWnd(i, n, a, o, r, s, l, d, c, h, m, y, k, () => {
                        for (let t in p) if (p[Number(t)].moduleName === e) {
                            p.splice(Number(t), 1);
                            break
                        }
                    })
                } while (0)
            })
        }

        e.enableSignAutoShow = function (e) {
            a.signObject.enableAutoShow(e)
        }, e.showWebWnd = function (e, ...i) {
            return n(this, void 0, void 0, function* () {
                if ("sign" === e) {
                    let e = "";
                    null !== i && void 0 !== i && null !== i[0] && void 0 !== i[0] && (e = i[0]), l.newsPopupObject.close(), yield a.signObject.createSignDlg(e, o.signNative.getNativeFunctionMap())
                } else if ("newsPopup" === e) {
                    let e = "";
                    null !== i && void 0 !== i && null !== i[0] && void 0 !== i[0] && (e = i[0]), f.isNullOrUndefined(a.signObject.getWnd()) && (yield l.newsPopupObject.createNewsPopupDlg(e, d.newsPopupNative.getNativeFunctionMap()))
                } else if ("phoneAuth" === e) {
                    let e = "";
                    null !== i && void 0 !== i && null !== i[0] && void 0 !== i[0] && (e = i[0]), yield r.phoneAuthObject.createPhoneAuthDlg(e, s.phoneAuthNative.getNativeFunctionMap())
                } else yield t(e, ...i)
            })
        }, e.createWebWnd = t, e.createWebWndEx = function (e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = e.business;
                    if (null === t || void 0 === t || "" === t) {
                        g.information("createWebWnd 参数错误：webType=", t);
                        break
                    }
                    let i = e.url;
                    if (null === i || void 0 === i || "" === i) {
                        g.information("createWebWnd 参数错误：url=", i);
                        break
                    }
                    let n = e.title;
                    null !== n && void 0 !== n || (n = "");
                    let a = e.isModal;
                    null !== a && void 0 !== a || (a = !0);
                    let o = t, r = e.width;
                    if (null === r || void 0 === r || r <= 0) {
                        g.information("createWebWnd 参数错误：wndWidth=", r);
                        break
                    }
                    let s = e.height;
                    if (null === s || void 0 === s || s <= 0) {
                        g.information("createWebWnd 参数错误：wndHeight=", s);
                        break
                    }
                    let l = e.leftMargin;
                    if (null === l || void 0 === l) {
                        g.information("createWebWnd 参数错误：browserLeftMargin=", l);
                        break
                    }
                    let d = e.rightMargin;
                    if (null === d || void 0 === d) {
                        g.information("createWebWnd 参数错误：browserRightMargin=", d);
                        break
                    }
                    let c = e.topMargin;
                    if (null === c || void 0 === c) {
                        g.information("createWebWnd 参数错误：browserTopMargin=", c);
                        break
                    }
                    let h = e.bottomMargin;
                    if (null === h || void 0 === h) {
                        g.information("createWebWnd 参数错误：browserBootomMargin=", h);
                        break
                    }
                    let f = p.filter(e => t === e.moduleName), v = null;
                    if (!(null === f || void 0 === f || f.length <= 0)) {
                        v = f[0].embeddedBrowserObj;
                        break
                    }
                    {
                        v = new u.EmbeddedBrowser;
                        let e = {moduleName: t, embeddedBrowserObj: v};
                        p.push(e)
                    }
                    let m = e.mapNative, y = e.onShowCallback, k = e.onCloseCallback, T = e.onBrowserEvent;
                    T && v.setBrowserEventHandler(T), void 0 !== e.autoShow && v.setAutoShow(e.autoShow), void 0 !== e.autoCloseAtError && v.setAutoCloseAtError(e.autoCloseAtError), e.isTopLevel && v.setWindowTopLevel(!0), e.isToolWindow && (v.setToolWindow(!0), e.minimizable && (e.minimizable = !1)), yield v.createWnd(i, n, a, o, r, s, l, d, c, h, m, y, k, () => {
                        for (let e in p) if (p[Number(e)].moduleName === t) {
                            p.splice(Number(e), 1);
                            break
                        }
                    }, e.alwaysOnTop, e.minimizable, e.menuOptions, e.nativeOptions)
                } while (0)
            })
        }, e.closeWebWnd = function (e) {
            do {
                if (null === e || void 0 === e || "" === e) {
                    g.information("closeWebWnd 参数错误：webType=", e);
                    break
                }
                let t = p.filter(t => e === t.moduleName), i = null;
                if (null === t || void 0 === t || t.length <= 0) break;
                (i = t[0].embeddedBrowserObj).closeWnd().catch()
            } while (0)
        }, e.existWebWnd = function (e) {
            let t = !1;
            do {
                if (!e) break;
                let i = p.filter(t => e === t.moduleName);
                if (!i || i.length <= 0) break;
                t = !0
            } while (0);
            return t
        }, e.visibleWebWnd = function (e, t, i) {
            let n = !1;
            do {
                if (!e) break;
                let a = p.filter(t => e === t.moduleName);
                if (!a || a.length <= 0) break;
                let o = a[0].embeddedBrowserObj;
                !1 === i ? o.hideWnd().catch() : o.showWnd(t).catch(), n = !0
            } while (0);
            return n
        }, e.bringWebWndToTop = function (e) {
            let t = !1;
            do {
                if (!e) break;
                let i = p.filter(t => e === t.moduleName);
                if (!i || i.length <= 0) break;
                i[0].embeddedBrowserObj.bringToTop(), t = !0
            } while (0);
            return t
        }, e.registerWebFunction = function (e, t, i) {
            let n = p.filter(t => e === t.moduleName);
            null !== n && void 0 !== n && n.length > 0 && n[0].embeddedBrowserObj.registerNativeFunction(t, i)
        }, e.callBackWebFunction = function (e, t, i, n) {
            let a = p.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, i, c.NativeFunctionErrorCode.Success, n)
            }
        }, e.fireEventWebFunction = function (e, ...t) {
            let i = p.filter(t => e === t.moduleName);
            if (null !== i && void 0 !== i && i.length > 0) {
                let e = i[0].embeddedBrowserObj.getBrowserObj();
                if (null !== e && void 0 !== e) {
                    let i = t[0];
                    if (null === i || void 0 === i || "" === i) return;
                    t.splice(0, 1), e.fireEvent(i, ...t)
                }
            }
        }
    }(t.EmbeddedBrowserManagerNs || (t.EmbeddedBrowserManagerNs = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(101), r = i(2), s = i(0), l = i(19), d = i(6), u = i(7), c = i(342), h = i(56),
        f = s.default.getLogger("Browser.Support"), g = u.default(r.join(__rootDir, "../bin/ThunderHelper.node"));
    let p = !1, v = !1;
    !function (e) {
        const t = new l.EventEmitter;
        e.isTabInit = function () {
            return v
        }, e.setTabInit = function (e) {
            v = e
        }, e.isTBCAvailable = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = r.join(__rootDir, "../bin/TBC/"), i = r.join(t, "libCef.dll");
                    if (!(e = yield d.FileSystemAWNS.existsAW(i))) break;
                    let n = r.join(__rootDir, "../bin/TBC/xlbrowsernode.node");
                    if (!(e = yield d.FileSystemAWNS.existsAW(n))) break
                } while (0);
                return e
            })
        }, e.initTBC = function () {
            return n(this, void 0, void 0, function* () {
                if (p) return p;
                f.information("[tbc] initTBC"), o.context.on("browser-created", (e, t) => {
                    f.information("new browser-created:", JSON.stringify(t))
                }), o.context.on("browser-destroyed", (e, t) => {
                    f.information("browser destroyed: ", JSON.stringify(t))
                });
                let e = r.join(__rootDir, "../bin/TBC/"), i = g.getPeerID(), n = r.join(__rootDir, "../../Thunder.exe"),
                    a = g.getFileVersion(n);
                return p = yield o.context.init({
                    data_path: r.join(e, "Data"),
                    product_version: a,
                    peer_id: i,
                    user_agent: "Thunder/" + a,
                    tbc_dir: e,
                    node_module_path: r.join(__rootDir, "../bin/TBC/xlbrowsernode.node")
                }), f.information("[tbc] initTBC", p), t.emit("BrowserSupportInit", p), p
            })
        }, e.browserIsInitFinish = function () {
            return p
        }, e.attachInit = function (e) {
            do {
                if (p) {
                    e(p);
                    break
                }
                t.on("BrowserSupportInit", e)
            } while (0)
        }, e.getDpiAwareSupport = function () {
            return g.getDPIAwareSupport()
        }, e.resizeBrowserWindow = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                {
                    let i = yield a.asyncRemoteCall.getCurrentWindow(),
                        n = yield c.BrowserWindowNS.getBrowserWindowPosition(g, i);
                    g.setWindowPos(e, h.OptionOfHWNDInAfter.HWND_TOP, n.x, n.y, n.width, n.height, 0), t = !0
                }
                return t
            })
        }
    }(t.BrowserSupportNS || (t.BrowserSupportNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(100), r = i(17), s = i(23), l = i(0).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 n(this, void 0, void 0, function* () {
                this.isType = !1, yield 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 n(this, void 0, void 0, function* () {
                this.isType || r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", 0)
            })
        }

        closeDialog(e, t) {
            this.isType = !0;
            let i = e;
            null !== e && void 0 !== e || (i = 0), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", i), this.embeddedBrowserObj.closeWnd().catch()
        }

        isPhoneAuthAw() {
            return n(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 i = yield s.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === i || void 0 === i) {
                        l.information("isPhoneAuthAw userInfo有问题 userInfo:", i);
                        break
                    }
                    let n = i.sessionid;
                    if (null === n || void 0 === n || "" === n) {
                        l.information("isPhoneAuthAw sessionid有问题 sessionid:", n);
                        break
                    }
                    let o = i.deviceid, r = i.userid, d = i.usernewno, u = i.usrname, c = i.usernick;
                    try {
                        let t = yield s.LoginHelperNS.loginSDKHelper.getInitData(), i = JSON.parse(t), h = i.platform,
                            f = i.appid, g = "PC-" + i.package, p = i.thunderVersion,
                            v = `auth.deviceid=${encodeURIComponent(o)}&auth.sessionid=${encodeURIComponent(n)}&auth.userid=${encodeURIComponent(r)}&auth.usernewno=${encodeURIComponent(d)}&auth.usrname=${encodeURIComponent(u)}&auth.usernick=${encodeURIComponent(c)}&auth.platformVersion=${encodeURIComponent(h)}&auth.appid=${encodeURIComponent(f)}&auth.appName=${encodeURIComponent(g)}&auth.clientVersion=${encodeURIComponent(p)}&authType==${encodeURIComponent("phone")}&userid ==${encodeURIComponent("userid")}`,
                            m = null, y = "https://xluser-ssl.xunlei.com/certification/v1/isauth?";
                        if (y = `${y}${v}`, null !== (m = yield a.default.get(y)) && void 0 !== m.status && 200 === m.status && void 0 !== m.data && null !== m.data && "" !== m.data) {
                            let t = m.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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5);
    !function (e) {
        const t = "vip-download-webview";
        let i = void 0;
        e.getVipTaskInfo = function (e) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                try {
                    i = (yield a.client.callRemoteClientFunction(t, "GetVipTaskInfo", e))[0]
                } catch (e) {
                }
                return i
            })
        }, e.getVipSubTaskInfo = function (e, i) {
            return n(this, void 0, void 0, function* () {
                let n = null;
                try {
                    n = (yield a.client.callRemoteClientFunction(t, "GetVipSubTaskInfo", e, i))[0]
                } catch (e) {
                }
                return n
            })
        }, e.getVipSpeedColor = function (e) {
            return n(this, void 0, void 0, function* () {
                let i = void 0;
                try {
                    i = (yield a.client.callRemoteClientFunction(t, "GetVipSpeedColor", e))[0]
                } catch (e) {
                }
                return i
            })
        }, e.clickTryAcclerateBtn = function (e, i) {
            return n(this, void 0, void 0, function* () {
                try {
                    yield a.client.callRemoteClientFunction(t, "ClickTryAcclerateBtn", e, i)
                } catch (e) {
                }
            })
        }, e.getThunderVersionNumber = function () {
            return n(this, void 0, void 0, function* () {
                if (void 0 === i) {
                    const e = yield a.client.callServerFunction("GetThunderVersion");
                    i = 0;
                    let t = e.split(".");
                    if (t && 4 === t.length) {
                        let e = Number(t[0]).valueOf(), n = Number(t[1]).valueOf(), a = Number(t[2]).valueOf();
                        i = 128 * Math.pow(2, 24) + e * Math.pow(2, 16) + n * Math.pow(2, 8) + a
                    }
                }
                return i
            })
        }
    }(t.VipPluginFunctionNS || (t.VipPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(59), o = i(102), r = i(2), s = i(6), l = i(3), d = i(12), u = i(15), c = i(44), h = i(37), f = i(0),
        g = i(348), p = i(584), v = i(7), m = i(22), y = i(13), k = i(38), T = i(61),
        w = v.default(r.join(__rootDir, "../bin/ThunderHelper.node")), C = f.default.getLogger("DownloadAndPlayHelper"),
        S = d.DownloadKernelTaskManager.getTaskManager(), I = u.DownloadKernelEventManager.getEventManager();
    const b = new class {
        constructor() {
            this.taskStatusChangedEventTable = [], C.information("constructor DownloadAndPlayHelper object")
        }

        init() {
            return n(this, void 0, void 0, function* () {
                if (!1 === (yield this.isCodecsIntegral())) {
                    let e = a.tmpdir(), t = "APlayerCodecs3.exe", i = r.join(e, "..\\..\\"), n = r.join(i, t);
                    (yield s.FileSystemAWNS.existsAW(n)) && (yield s.FileSystemAWNS.unlinkAW(n)), C.information("downloadplay:", i, n);
                    let o = "http://xmp.down.sandai.net/xmp/APlayerCodecs3Embed.exe";
                    C.information(i, n);
                    let d = {
                        taskBaseInfo: {savePath: i, taskName: t},
                        p2spTaskInfo: {url: o, nameFixed: 1},
                        isBackground: !0
                    }, u = yield S.createTask(l.DownloadKernel.TaskType.P2sp, d);
                    if (null !== u) {
                        let e = u.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        this.attachTaskStatusChangedEvent(e), yield c.DownloadDispatchNS.startTask(e)
                    }
                }
                p.DownloadAndPlayNodeIPCNS.init()
            })
        }

        uninit() {
            p.DownloadAndPlayNodeIPCNS.uninit()
        }

        installXmp() {
            return n(this, void 0, void 0, function* () {
                let e = null;
                {
                    C.information("XmpFixBoxEx: ipcMain on channelRMDownloadXmpEx");
                    let e = g.DownloadAndPlayNS.getXmpPath();
                    if (null !== e && void 0 !== e && "" !== e) return !0;
                    m.MessageBox.confirm({
                        title: "您未安装迅雷影音，是否下载安装？",
                        type: m.MessageBox.ConfirmType.Warning,
                        fileName: "",
                        okText: "立即下载",
                        cancelText: "取消",
                        cancelVisible: !0
                    }).then(e => n(this, void 0, void 0, function* () {
                        e.action === k.MessageBoxNS.Action.OK ? yield this.downloadXmpEx() : e.action === k.MessageBoxNS.Action.Cancel ? C.information("XmpFixBoxEx: Cancel") : e.action === k.MessageBoxNS.Action.Close && C.information("XmpFixBoxEx: Close")
                    })).catch()
                }
                return e
            })
        }

        openXmp(e) {
            return n(this, void 0, void 0, function* () {
                let t = 0;
                {
                    let i = g.DownloadAndPlayNS.getXmpPath();
                    if (null === i || void 0 === i || "" === i) yield this.installXmp(); else {
                        let n = r.dirname(i);
                        w.shellExecute(0, "open", i, e, n, "SW_SHOW") > 32 && (t = 1)
                    }
                }
                return t
            })
        }

        getXmpCoreVersion() {
            return n(this, void 0, void 0, function* () {
                let e = "", t = g.DownloadAndPlayNS.getXmpPath();
                return (yield s.FileSystemAWNS.existsAW(t)) && (e = w.getFileVersion(t)), e
            })
        }

        getXmpUserDataPath() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let i = r.join(__rootDir, "../../XMP");
                    t = "V" + t, e = r.join(i, t) + "\\XMP5\\" + t
                } while (0);
                return e
            })
        }

        getXmpBuildNum() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let i = t.split(/\./);
                    null !== i && void 0 !== i && 4 === i.length && (e = i[3])
                } while (0);
                return e
            })
        }

        downloadXmpEx() {
            return n(this, void 0, void 0, function* () {
                C.information("XmpFixBoxEx: enter downloadXmpEx");
                const e = d.DownloadKernelTaskManager.getTaskManager();
                let t = yield T.TaskUtilitiesAWNS.batchFindTaskAW([{
                    taskType: l.DownloadKernel.TaskType.P2sp,
                    value: "http://xmp.down.sandai.net/xmp/XMPSetup_xmpxl11.exe"
                }]);
                if (t.length > 0) m.MessageBox.confirm({
                    title: "重复下载，该任务已存在列表中",
                    type: m.MessageBox.ConfirmType.Warning,
                    fileName: "XMPSetup-xlx.exe",
                    okText: "查看",
                    cancelText: "取消",
                    cancelVisible: !0
                }).then(e => n(this, void 0, void 0, function* () {
                    if (e.action === k.MessageBoxNS.Action.OK) {
                        let e = t[0].getId();
                        yield h.ThunderNewTask.selectTask(e)
                    } else e.action, k.MessageBoxNS.Action.Cancel
                })).catch(); else {
                    let t = {taskName: "XMPSetup-xl11.exe", savePath: y.ThunderUtil.getDefaultDownloadDir()}, i = {
                        url: "http://xmp.down.sandai.net/xmp/XMPSetup_xmpxl11.exe",
                        refUrl: "",
                        cookie: "",
                        nameFixed: 1
                    }, n = yield e.createTask(l.DownloadKernel.TaskType.P2sp, {taskBaseInfo: t, p2spTaskInfo: i});
                    if (null !== n) {
                        let t = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        yield e.startTask(t)
                    }
                }
            })
        }

        isCodecsIntegral() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                {
                    let t = r.join(__rootDir, "../../codecs"), i = r.join(t, "avisplitter.dll"),
                        n = r.join(t, "realmediasplitter.dll"), a = r.join(t, "d3dcompiler_43.dll"),
                        o = r.join(t, "audioswitcher.dll");
                    (yield s.FileSystemAWNS.existsAW(i)) && (yield s.FileSystemAWNS.existsAW(n)) && (yield s.FileSystemAWNS.existsAW(a)) && (yield s.FileSystemAWNS.existsAW(o)) && (e = !0), C.information("cqm avicodecsPath", i, "realcodecsPath", n, "bIntegral", e)
                }
                return e
            })
        }

        attachTaskStatusChangedEvent(e) {
            void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = I.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                do {
                    if (!t) break;
                    if (t[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let i = t[1];
                    if (i.length > 0) {
                        let t = i[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                            n = i[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), a = r.join(t, n);
                        s.FileSystemAWNS.existsAW(a).then(t => {
                            if (t && i[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId) === e) {
                                let t = i[0].getTaskStatus();
                                t !== l.DownloadKernel.TaskStatus.Succeeded && t !== l.DownloadKernel.TaskStatus.Seeding || w.checkDigitalSignature(a, t => {
                                    if (C.information("cqm getVideoMediaInfo CheckDigitalSignature exePath", a, " result", t), !t) return;
                                    C.information("downloadplay:运行exe = ", a);
                                    let i = r.join(__rootDir, "../.."), n = `${a} -path=${i}`;
                                    C.information("cqm args", n), o.exec(n), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (C.information("downloadplay:取消监听 ", this.taskStatusChangedEventTable[e]), I.detachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
                                })
                            }
                        }).catch()
                    }
                } while (0)
            }))
        }
    };
    t.default = b
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(20), r = i(6), s = i(0), l = i(42), d = i(3), u = i(12), c = i(15), h = i(44), f = i(39),
        g = i(33), p = i(18), v = i(11), m = u.DownloadKernelTaskManager.getTaskManager(),
        y = c.DownloadKernelEventManager.getEventManager(), k = s.default.getLogger("SubtiteManager");
    !function (e) {
        let t;
        !function (e) {
            e.DownloadSuccess = "DownloadSuccess", e.DownloadFail = "DownloadFail"
        }(t = e.SubtitleEvent || (e.SubtitleEvent = {}));
        const i = a.resolve(__profilesDir, "SubTitleDownload/"),
            s = a.resolve(__profilesDir, "SubTitleDownload/subtitledata.json");

        class u extends l.default {
            constructor() {
                super(...arguments), this.subtitleData = {}, this.taskStatusChangedEventTable = []
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    k.information("Init");
                    let e = yield r.FileSystemAWNS.existsAW(s);
                    if (e) {
                        let e = yield r.FileSystemAWNS.readFileAW(s);
                        if (e) {
                            try {
                                this.subtitleData = JSON.parse(e.toString())
                            } catch (e) {
                                k.warning(e), this.subtitleData = {}
                            }
                            k.information("Init, subtitle data", this.subtitleData)
                        }
                    } else (e = yield r.FileSystemAWNS.mkdirsAW(i)) && (yield r.FileSystemAWNS.writeFileAW(s, "{}"));
                    let t = yield v.asyncRemoteCall.getIpcMain();
                    t.on(g.ThunderChannelList.channelRMGetSutitleByCid, (e, t, i) => n(this, void 0, void 0, function* () {
                        k.information("channelRMGetSutitleByCid cid and taskid ", t, i);
                        let n = yield this.querySubtitleByCid(t, i);
                        k.information("send channelMRGetSutitleByCidResult"), (yield e.sender.isDestroyed()) || e.sender.send(g.ThunderChannelList.channelMRGetSutitleByCidResult, n)
                    })), t.on(g.ThunderChannelList.channelRMGetSutitleByName, (e, t, i) => n(this, void 0, void 0, function* () {
                        k.information("channelRMGetSutitleByName name and taskid ", t, i);
                        let n = yield this.querySubtitleByName(t, i);
                        k.information("send channelMRGetSutitleByNameResult"), (yield e.sender.isDestroyed()) || e.sender.send(g.ThunderChannelList.channelMRGetSutitleByNameResult, n)
                    })), t.on(g.ThunderChannelList.channelRMDownloadSutitle, (e, t, i, a) => n(this, void 0, void 0, function* () {
                        k.information("channelRMDownloadSutitle taskid ", i), yield this.downloadSubtitle(t, i, a)
                    })), t.on(g.ThunderChannelList.channelRMGetDisplayName, (e, t) => n(this, void 0, void 0, function* () {
                        k.information("channelRMGetDisplayName taskid ", t);
                        let i = this.getDisaplayName(t);
                        e.sender.send(g.ThunderChannelList.channelMRGetDisplayNameResult, i)
                    }))
                })
            }

            getDisaplayName(e) {
                let t = [], i = m.getTaskFromTaskId(e), n = i.getTaskBaseInfo(), a = i.getType();
                if (a === d.DownloadKernel.TaskType.P2sp || a === d.DownloadKernel.TaskType.Emule) {
                    let e = n.taskName, a = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid);
                    k.information(" fileName: ", e, " cid: ", a);
                    let o = {fileName: e, cid: a};
                    o && t.push(o)
                } else if (a === d.DownloadKernel.TaskType.Bt) {
                    let e = i.getExtraObject();
                    if (0 === e.getDownloadFile().length) return null;
                    let n = e.getBtFileList();
                    for (let [e, i] of n) {
                        let n = i.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                        if (f.TaskUtilHelper.getTaskFileType(n) === f.TaskUtilHelper.FileExtType.Video) {
                            let a = i.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Cid);
                            k.information("btfile inde: ", e, " fileName: ", n, " cid: ", a);
                            let o = {fileName: n, cid: a};
                            o && t.push(o)
                        }
                    }
                } else if (a === d.DownloadKernel.TaskType.Group) {
                    let e = i.getExtraObject(), n = e.getSubTaskCount();
                    for (let i = 0; i < n; ++i) {
                        let n = e.getSubTaskByIndex(i), a = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName);
                        if (f.TaskUtilHelper.getTaskFileType(a) === f.TaskUtilHelper.FileExtType.Video) {
                            let e = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid);
                            k.information(" fileName: ", a, " cid: ", e);
                            let i = {fileName: a, cid: e};
                            i && t.push(i)
                        }
                    }
                }
                return k.information("getDisaplayName ret ", t), t
            }

            querySubtitleByCid(e, t) {
                return n(this, void 0, void 0, function* () {
                    k.information("querySubtitleByCid");
                    let i = [], n = null;
                    try {
                        n = yield o.default.get(`http://sub.xmp.sandai.net:8000/subxl/${e}.json`), k.information("response: ", n)
                    } catch (e) {
                        k.warning(e)
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data) {
                        k.information("sublist: ", n.data.sublist);
                        let e = n.data.sublist;
                        if (e && e.length > 1) for (let n of e) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = n.scid, e.surl = n.surl, e.sname = n.sname, e.language = n.language, e.rate = n.rate, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && i.push(e)
                        }
                    }
                    return i
                })
            }

            querySubtitleByName(e, t) {
                return n(this, void 0, void 0, function* () {
                    k.information("querySubtitleByName");
                    let i = [];
                    e = encodeURI(e);
                    let n = null;
                    try {
                        n = yield o.default.get(`http://subtitle.kankan.xunlei.com:8000/search.json/mname=${e}`), k.information("querySubtitleByName response: ", n)
                    } catch (e) {
                        k.warning(e)
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data) {
                        let e = n.data.sublist;
                        if (e && e.length >= 1) for (let n of e) if (n.scid) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = n.scid, e.surl = n.surl, e.sname = n.sname, e.language = n.language;
                            let a = parseInt(n.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 && i.push(e)
                        }
                    }
                    return i
                })
            }

            downloadSubtitle(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    k.information("downloadSubtitle");
                    let n = e.surl, o = n.substring(n.lastIndexOf(".")),
                        r = i.substring(0, i.lastIndexOf(".")) + ".XLSUB" + o, s = this.getSaveDir(t);
                    k.information("downloadSubtitle fileName", r), k.information("downloadSubtitle filePath", s);
                    let l = a.join(s, r);
                    k.information("downloadSubtitle:", s, l);
                    let u = {
                        taskBaseInfo: {savePath: s, taskName: r},
                        p2spTaskInfo: {url: n, nameFixed: 1},
                        isBackground: !0
                    }, c = void 0, f = yield m.createTask(d.DownloadKernel.TaskType.P2sp, u);
                    return null !== f && (c = f.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId), this.attachTaskStatusChangedEvent(c, e, t), yield h.DownloadDispatchNS.startTask(c)), c
                })
            }

            save(e) {
                return n(this, void 0, void 0, function* () {
                    k.information("save"), k.information(e);
                    let t = JSON.stringify(e, void 0, 2);
                    k.information("save jsonStr: ", t), yield r.FileSystemAWNS.writeFileAW(s, t)
                })
            }

            attachTaskStatusChangedEvent(e, i, o) {
                k.information("Sunbtitle taskId: ", e), k.information("item: ", i), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = y.attachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, (...r) => n(this, void 0, void 0, function* () {
                    let n = !1;
                    do {
                        if (!r) {
                            k.information("args is null");
                            break
                        }
                        if (r[0] !== d.DownloadKernel.TaskEventType.StatusChanged) {
                            k.information("args[0] is not StatusChanged");
                            break
                        }
                        let s = r[1];
                        if (!s) {
                            k.information("taskList is null");
                            break
                        }
                        for (let r = 0; r < s.length; ++r) {
                            let l = s[r];
                            if (!l) continue;
                            if (l.getId() !== e) continue;
                            let u = l.getTaskStatus();
                            if (k.information("get status ", u), u === d.DownloadKernel.TaskStatus.Succeeded) {
                                k.information("send: channelMRDownloadSutitleSuc"), p.ipcRenderer.send(g.ThunderChannelList.channelMRDownloadSutitleSuc), this.fireEvent(t.DownloadSuccess, e, o, i);
                                let n = [];
                                k.information("subtitleData: ", this.subtitleData), k.information("befor has sutitleTaskId "), this.subtitleData[o] && (k.information("has sutitleTaskId ", e), n = this.subtitleData[o]), k.information("after has sutitleTaskId ");
                                let r = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                                r.scid = i.scid, r.surl = i.surl, r.sname = l.getTaskName().replace(".XLSUB", ""), r.language = i.language, r.rate = i.rate, r.status = 1;
                                let s = this.getSaveDir(e), u = l.getTaskName();
                                r.path = a.join(s, u), n.push(r), this.subtitleData[o] = n, yield this.save(this.subtitleData), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (k.information("取消监听 ", this.taskStatusChangedEventTable[e]), y.detachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
                            } else u === d.DownloadKernel.TaskStatus.Failed && (k.information("send: channelMRDownloadSutitleFail"), p.ipcRenderer.send(g.ThunderChannelList.channelMRDownloadSutitleFail), this.fireEvent(t.DownloadFail, e, o, i), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (k.information("取消监听 ", this.taskStatusChangedEventTable[e]), y.detachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null));
                            n = !0
                        }
                    } while (0);
                    return n
                })))
            }

            getSaveDir(e) {
                k.information("getSaveDir");
                let t = "", i = m.getTaskFromTaskId(e), n = i.getTaskName(), o = i.getType();
                if (i && (t = i.getSavePath()), o === d.DownloadKernel.TaskType.Bt) {
                    i.getExtraObject().getFileCount() > 1 && (t = a.join(t, n))
                }
                return k.information("name and save dir: ", n, t), t
            }

            isAlreadyDownload(e, t) {
                return n(this, void 0, void 0, function* () {
                    k.information("isAlreadyDownload cid ", e);
                    let i = !1, n = this.subtitleData[t];
                    if (k.information("isAlreadyDownload subtitleList ", n), n && n.length >= 1) for (let t of n) if (t.scid === e) {
                        let e = t.path;
                        k.information("isAlreadyDownload fielPath ", e), (yield r.FileSystemAWNS.existsAW(e)) && (i = !0)
                    }
                    return k.information("isAlreadyDownload ret ", i), i
                })
            }
        }

        e.SubtitleManager = u;
        const c = new u;
        e.getSubtitleManger = function () {
            return c
        }, e.init = function () {
            return n(this, void 0, void 0, function* () {
                yield c.init()
            })
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.SubtitleManagerNS || (t.SubtitleManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(19), o = i(36), r = i(25), s = i(587), l = i(29), d = i(14), u = i(4),
        c = n.default.getLogger("CommunityNaviteFunction"), h = s.CommunityTaskManagerNS.getTaskManager();
    !function (e) {
        class t extends a.EventEmitter {
            constructor() {
                super(), this.isRegisted = !1, c.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.NativeCallNS.registerNativeFunction(e), h.init()
                }
            }

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

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

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

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

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

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

            notifyUnreadNum(e, i, n, a) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(n) || u.isNullOrUndefined(i)) break;
                    if (c.verbose(a), !a || !Array.isArray(a) || a.length < 2) {
                        e.callNativeFunctionCallback(i, n, 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
                    }), c.information("notifyUnreadNum", o), e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

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

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(78), r = i(0).default.getLogger("ConTextMenu");
    !function (e) {
        e.popContextMenu = function (e, t) {
            t && (r.information("params", t), t.isEditable ? function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let e = [{
                            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}],
                        i = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(e);
                    yield o.MenuSkinNS.setStyle(i, {});
                    let n = yield a.asyncRemoteCall.getCurrentWindow();
                    yield i.popup({window: n})
                })
            }(0, t).catch() : "" !== t.selectionText && function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let e = [{label: "复制", role: "copy", enabled: t.editFlags.canCopy}],
                        i = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(e);
                    yield o.MenuSkinNS.setStyle(i, {});
                    let n = yield a.asyncRemoteCall.getCurrentWindow();
                    yield i.popup({window: n})
                })
            }(0, t).catch())
        }, e.popupAt = function (e, t, i) {
            {
                let e = i.getBoundingClientRect();
                t.x = void 0 !== t.x ? t.x : Math.round(e.left), t.y = void 0 !== t.y ? t.y : Math.round(e.bottom)
            }
            e.popup(t)
        }
    }(t.ContextMenuNS || (t.ContextMenuNS = {}))
}, function (e, t, i) {
    "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", e[e.Cool = 4] = "Cool"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {type: t.Default, colorID: 0}
    }(t.SkinHelperNS || (t.SkinHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(107), r = i(356), s = i(108), l = i(24), d = i(476),
        u = s.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        c = a.default.getLogger("NotificationHelper");
    !function (e) {
        function t(e) {
            return !e.type || e.type !== o.Notification.TipsType.DownloadComplete && e.type !== o.Notification.TipsType.DownloadFail && e.type !== o.Notification.TipsType.ConsumptionTips && e.type !== o.Notification.TipsType.CommunityTips && e.type !== o.Notification.TipsType.CommonPushTip
        }

        function i(e, t) {
            return n(this, void 0, void 0, function* () {
                (yield r.NotificationNS.getCurrentWindow()) ? u.getCurrentProperty() < e.priority ? (a(e, t), r.NotificationNS.close().catch()) : e.noDelay || a(e, t) : (a(e, t), u.deQueue())
            })
        }

        function a(e, i) {
            if (t(e)) {
                let e = (new Date).getTime();
                d.MemoryConfigNS.setValue("ad", "adTipsLastPopupTime", e), c.information("enQueueNotification, adTipsLastPopupTime:", e)
            }
            u.enQueue({
                callback: () => n(this, void 0, void 0, function* () {
                    r.NotificationNS.notify(e, i).catch()
                }), name: e.name, priority: e.priority
            })
        }

        e.notify = function e(n, a) {
            do {
                if (c.information("notify options:", n), n.priority = n.priority || 0, t(n)) {
                    let t = l.default.getConfigInfo("ad", "adTipsPopupMode"),
                        i = d.MemoryConfigNS.getValue("ad", "adTipsLastPopupTime", 0);
                    if ("single" === t) {
                        if (i) {
                            c.information("adTipsPopupMode single, adTipsLastPopupTime:", i);
                            break
                        }
                    } else if ("interval" === t) {
                        let t = l.default.getConfigInfo("ad", "adTipsInterval");
                        if (t) {
                            let o = (new Date).getTime();
                            if (o - i < 60 * t * 1e3) {
                                c.information("adTipsPopupMode interval, adTipsLastPopupTime:", i, "currentTime:", o, "interval:", t), setTimeout(() => {
                                    e(n, a)
                                }, 60 * t * 1e3 - (o - i) + 1e3);
                                break
                            }
                        }
                    }
                }
                i(n, a).catch()
            } while (0)
        }, e.clearNotificationsByName = function (e) {
            u.clearQueuesByName(e)
        }
    }(t.NotificationHelper || (t.NotificationHelper = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i;
        !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", e.AdLeftBottomVip = "AdLeftBottomVip"
        }(i = e.AdName || (e.AdName = {})), e.eventAdShow = "event_ad_show"
    }(t.AdCommonNS || (t.AdCommonNS = {}))
}, function (e, t) {
    function i(e) {
        if ("string" != typeof e) throw new Error("Color should be defined as hex string");
        var t = e.slice().replace("#", "").split("");
        if (t.length < 3 || 5 === t.length || t.length > 8) throw new Error("Invalid hex color: " + e);
        3 !== t.length && 4 !== t.length || (t = Array.prototype.concat.apply([], t.map(function (e) {
            return [e, e]
        }))), 6 === t.length && t.push("F", "F");
        var i = parseInt(t.join(""), 16);
        return {r: i >> 24 & 255, g: i >> 16 & 255, b: i >> 8 & 255, a: 255 & i, hex: "#" + t.slice(0, 6).join("")}
    }

    t.getOptions = function (e) {
        e || (e = {}), e.color || (e.color = {});
        var t = void 0 === e.margin || null === e.margin || e.margin < 0 ? 4 : e.margin,
            n = e.width && e.width >= 21 ? e.width : void 0, a = e.scale || 4;
        return {
            width: n,
            scale: n ? 4 : a,
            margin: t,
            color: {dark: i(e.color.dark || "#000000ff"), light: i(e.color.light || "#ffffffff")},
            type: e.type,
            rendererOpts: e.rendererOpts || {}
        }
    }, t.getScale = function (e, t) {
        return t.width && t.width >= e + 2 * t.margin ? t.width / (e + 2 * t.margin) : t.scale
    }, t.getImageWidth = function (e, i) {
        var n = t.getScale(e, i);
        return Math.floor((e + 2 * i.margin) * n)
    }, t.qrToImageData = function (e, i, n) {
        for (var a = i.modules.size, o = i.modules.data, r = t.getScale(a, n), s = Math.floor((a + 2 * n.margin) * r), l = n.margin * r, d = [n.color.light, n.color.dark], u = 0; u < s; u++) for (var c = 0; c < s; c++) {
            var h = 4 * (u * s + c), f = n.color.light;
            if (u >= l && c >= l && u < s - l && c < s - l) f = d[o[Math.floor((u - l) / r) * a + Math.floor((c - l) / r)] ? 1 : 0];
            e[h++] = f.r, e[h++] = f.g, e[h++] = f.b, e[h] = f.a
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5);
    !function (e) {
        e.getValue = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                return yield a.client.callServerFunction("GetConfigValue", e, t, i)
            })
        }, e.setValue = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield a.client.callServerFunction("SetConfigValue", e, t, i)
            })
        }
    }(t.ConfigHelperNS || (t.ConfigHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(396), a = i(302);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-button.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(399), a = i(310);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-input.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(400), a = i(316);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-text.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(68), s = i(60), l = i(107), d = i(146), u = i(10), c = i(13), h = i(7), f = i(476),
        g = h.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    var p, v;
    !function (e) {
        e.Market = "Market", e.Functional = "Functional", e.WebPage = "WebPage"
    }(p = 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"
    }(v = t.StyleType || (t.StyleType = {}));
    t.AdTips = class {
	}
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(155), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(628), r = i(659);
    let s = class extends a.Vue {
    };
    s = n([a.Component({components: {MainLeft: o.default, MainBody: r.default}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(157), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(629), a = i(28);
    t.default = a.connector.connect({
        mapCommitToProps: {selectNav: "SELECT_NAV"},
        mapGettersToProps: {curNav: e => e.currentNav, navList: e => e.navList}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(159), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(630), s = i(640), l = i(5), d = i(657), u = i(53), c = i(65), h = i(10), f = i(143),
        g = i(90), p = i(11), v = f.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    v.registerNativeFunction();
    let m = class extends o.Vue {
        constructor() {
            super(...arguments), this.dragable = !0, this.curUserHeader = "", this.eventOnMessageLoadend = -1
        }

        select(e) {
            return a(this, void 0, void 0, function* () {
                let t = "download";
                if (e === u.NavViewID.Cloud ? t = "yunpan" : e === u.NavViewID.Browser ? t = "discover" : e === u.NavViewID.Message && (t = "message"), h.XLStatNS.trackEvent("clienttop", "clienleft_tab_click", "", 0, 0, 0, 0, "clickid=" + t), e === u.NavViewID.Message) {
                    h.XLStatNS.trackEvent("community", "message_tab_click", "", 0, 0, 0, 0, "number_bubble=0");
                    let e = yield c.default(!1, !0);
                    if (!e || "" === e) return
                }
                this.selectNav(e), l.client.callServerFunction("CloseSettingCenter")
            })
        }

        mounted() {
            d.initGetCoinPrizeToast(), v.on("openComunityGroup", e => {
                this.communityData = e, this.openComunityGroup()
            }), g.PluginFunctionUINS.on("openComunityGroup", e => {
                this.communityData = e, this.openComunityGroup()
            })
        }

        openComunityGroup() {
            this.showMainWindow(), this.select(u.NavViewID.Message), -1 !== this.eventOnMessageLoadend && l.client.detachServerEvent("OnMessageLoadend", this.eventOnMessageLoadend), this.eventOnMessageLoadend = l.client.attachServerEvent("OnMessageLoadend", () => {
                l.client.broadcastEvent("OpenMessageGroup", this.communityData)
            }), l.client.broadcastEvent("OpenMessageGroup", this.communityData)
        }

        showMainWindow() {
            return a(this, void 0, void 0, function* () {
                let e = yield this.mainWindow();
                const t = yield e.isMinimized(), i = yield e.isVisible();
                !t && (t || i) && i || (yield e.restore(), yield e.show())
            })
        }

        mainWindow() {
            return a(this, void 0, void 0, function* () {
                return yield p.asyncRemoteCall.getCurrentWindow()
            })
        }
    };
    n([o.Prop({})], m.prototype, "curNav", void 0), n([o.Prop({})], m.prototype, "navList", void 0), n([o.Prop({})], m.prototype, "selectNav", void 0), m = n([o.Component({
        components: {
            LoginArea: r.default,
            SystemButtons: s.default
        }
    })], m), t.default = m
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(161), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(11), r = i(8), s = i(2), l = i(17), d = i(35), u = i(23), c = i(0), h = i(10), f = i(13), g = i(7),
        p = i(631), v = i(633), m = i(16), y = i(90), k = i(360), T = i(5), w = i(445);
    let {isDef: C} = f.ThunderUtil;
    const S = g.default(s.join(__rootDir, "../bin/ThunderHelper.node")), I = i(638), b = i(639),
        _ = c.default.getLogger("login-area");
    let D = class extends r.Vue {
        constructor() {
            super(...arguments), this.vipRenewEnable = !1, this.title = "", this.vipText = "", this.badge = "", this.canShowVipText = !1, this.overflow = !1, this.overFlowPath = `${__rootDir}/static/transparent-img.png`, 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 = I, 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.isShowVipPluginBtn = !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, this.syncMsgEventId = void 0, this.syncMsgState = k.SyncMsgHelperNS.SyncMsgState.Connected, this.syncMsgOnceTimerID = null, this.eventHoverWindowReadyToShow = -1
        }

        onLoginChange(e) {
            return a(this, void 0, void 0, function* () {
                e ? this.syncMsgOnceTimerID = setTimeout(() => a(this, void 0, void 0, function* () {
                    (yield k.SyncMsgHelperNS.checkSyncMsg()) ? (this.syncMsgEventId = k.SyncMsgHelperNS.attachSyncMsgStateChangeEvent((e, t) => a(this, void 0, void 0, function* () {
                        this.syncMsgState = e
                    })), this.syncMsgState = k.SyncMsgHelperNS.getSyncMsgState()) : this.syncMsgState = k.SyncMsgHelperNS.SyncMsgState.Error
                }), 15e3) : (this.syncMsgOnceTimerID && (clearTimeout(this.syncMsgOnceTimerID), this.syncMsgOnceTimerID = null), this.syncMsgEventId && (k.SyncMsgHelperNS.detachSyncMsgStateChangeEvent(this.syncMsgEventId), this.syncMsgEventId = void 0))
            })
        }

        onHeaderChange(e, t) {
            _.information("curLoginHeaderUrl cur=", e, ";old=", t)
        }

        onVipButtonShow() {
            if (!this.vipRenewEnable) return;
            let e = this.$refs.userNick.clientWidth, t = !1;
            do {
                if (!this.vipButtonShow) break;
                if (!this.vipIconShow) break;
                if (e <= 126) break;
                t = !0
            } while (0);
            _.information("vip renew ", this.vipIconShow, e, t), this.overflow = t
        }

        get vipIconShow() {
            return this.isLogin && !this.isCanShowOpenVipBtn
        }

        get renewTitle() {
            return this.vipText ? this.vipText : ""
        }

        get toolTipTitle() {
            let e = "您有代金券可使用";
            do {
                if (!this.vipRenewEnable || !this.title) break;
                e = this.title
            } while (0);
            return e
        }

        get tooltipTrigger() {
            let e = null;
            do {
                if (!this.vipRenewEnable) {
                    e = this.cashTipTrigger;
                    break
                }
                if (!this.title) break;
                e = "hover"
            } while (0);
            return e
        }

        get vipButtonShow() {
            return "online" === this.curLoginStatus && (this.isShowVipPluginBtn || this.isCanShowOpenVipBtn || this.isCanShowXufeiBtn)
        }

        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.strOpenVip = "开通会员"), this.yearIcon
        }

        get strIsOffline() {
            let e = "";
            return "offline" === this.curLoginStatus && (e = "is-offline"), _.information("strIsOffline:", e), e
        }

        get showInfoIcon() {
            return this.isLogin && (this.syncMsgState === k.SyncMsgHelperNS.SyncMsgState.Close || this.syncMsgState === k.SyncMsgHelperNS.SyncMsgState.Error)
        }

        get showRestoreIcon() {
            return this.isLogin && this.syncMsgState === k.SyncMsgHelperNS.SyncMsgState.Connecting
        }

        closePersonalInfoWnd() {
            return a(this, void 0, void 0, function* () {
                null !== this.personalInfoWnd && ((yield this.personalInfoWnd.isDestroyed()) || this.personalInfoWnd && this.personalInfoWnd.close(), this.personalInfoWnd = null)
            })
        }

        setDefaultHeader() {
            _.information("setDefaultHeader"), this.curLoginHeaderUrl = I
        }

        setDefaultIcon() {
            _.information("setDefaultIcon"), this.curIconUrl = b
        }

        showPersonalInfoWnd(e) {
            return a(this, void 0, void 0, function* () {
                let t = this.getClientRectsEx(), i = yield this.isLoginInfoRect(t);
                if (_.information("datastr", t, i), t = JSON.stringify({
                    width: 100,
                    height: JSON.parse(t).height
                }), i && null === this.personalInfoWnd && (this.personalInfoWnd = yield u.LoginHelperNS.loginUIHelper.createPersonalInfoWnd(e, t), null !== this.personalInfoWnd)) {
                    let e = () => a(this, void 0, void 0, function* () {
                        t = this.getClientRectsEx(), (i = yield this.isLoginInfoRect(t)) ? (null != this.personalInfoWnd && (this.personalInfoWnd.show(), d.ToolsUtilitiesAWNS.setForegroundWindow(S, this.personalInfoWnd)), this.isLogin && this.stat("userinfo_show")) : yield this.closePersonalInfoWnd(), T.client.detachServerEvent(w.ThunderEvent.hoverWindowReadyToShow, this.eventHoverWindowReadyToShow)
                    });
                    this.personalInfoWnd.once("ready-to-show", () => {
                        e().catch()
                    }), this.eventHoverWindowReadyToShow = T.client.attachServerEvent(w.ThunderEvent.hoverWindowReadyToShow, () => {
                        e().catch()
                    }), this.personalInfoWnd.once("closed", () => {
                        this.personalInfoWnd = null
                    })
                }
            })
        }

        onPromptTitleShow(e) {
            if (_.information("onPromptTitleShow", e), e) {
                let e = "";
                e = "is_ad=1";
                let t = encodeURIComponent(e);
                _.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);
                    _.information(e, t), h.XLStatNS.trackEvent("clienttop", "xufei_botton_show", "", 0, 0, 0, 0, t)
                }
            } else this.$emit("tooltip-hide");
            this.isShowYearTip = e
        }

        onIconClick() {
            v.VipRenewIconManagerNS.getIconManager().onIconClick()
        }

        onRenewClick() {
            this.vipBtnClick && this.vipBtnClick()
        }

        getClientRectsEx() {
            let e = null, t = 60, i = 110;
            C(this.$refs.userAvatar) && null !== (e = this.$refs.userAvatar.$el.getClientRects()) && void 0 !== e && e.length > 0 && null !== e[0] && void 0 !== e[0] && (t = e[0].left, i = e[0].right);
            let n = i - t + 5, a = n;
            return JSON.stringify({width: n, height: a})
        }

        isLoginInfoRect(e) {
            return a(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = yield(yield o.asyncRemoteCall.getScreen()).getCursorScreenPoint(), n = null;
                    try {
                        n = JSON.parse(e)
                    } catch (e) {
                        _.warning(e)
                    }
                    if (null === n) break;
                    let a = yield(yield o.asyncRemoteCall.getCurrentWindow()).getBounds(), r = a.x + 26, s = a.y + 60,
                        l = a.x + 26 + Number(n.width), d = a.y + 60 + Number(n.height);
                    i.x >= r && i.x <= l && i.y >= s && i.y <= d && (t = !0)
                } while (0);
                return t
            })
        }

        getUserAvatarRect() {
            return a(this, void 0, void 0, function* () {
                let e = yield(yield o.asyncRemoteCall.getCurrentWindow()).getBounds(),
                    t = this.$refs.userAvatar.getClientRects(), i = e.x + t[0].left, n = e.y + t[0].top,
                    a = t[0].right - t[0].left, r = t[0].bottom - t[0].top;
                return JSON.stringify({x: i, y: n, width: a, height: r})
            })
        }

        enter(e) {
            return a(this, void 0, void 0, function* () {
                if (_.information("enter:", e, this.isLogin, this.curLoginStatus, this.personalInfoWnd), "offline" !== this.curLoginStatus && null === this.personalInfoWnd) this.showPersonalInfoWnd(e).catch(); else if ("offline" === this.curLoginStatus && "head" === e) {
                    let e = yield this.getUserAvatarRect();
                    yield this.closePersonalInfoWnd(), u.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
                }
            })
        }

        clickPromptTitle(e) {
            if (_.information("点击促销文案", this.promptData.title), _.information("islogin", this.isLogin), _.information("curLoginStatus", this.curLoginStatus), !this.isLogin) {
                let t = `button=${e}`;
                t += ",is_ad=1", _.information("extData", t);
                let i = encodeURIComponent(t);
                _.information(t, i), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_click", "", 0, 0, 0, 0, i), this.promptTextClicked = !0, _.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl), u.LoginHelperNS.loginHelper.showLoginDlg("clienthead", !0), _.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl)
            }
        }

        clickUserHeader(e) {
            if (_.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";
                T.client.callServerFunction("OpenNewTab", t);
                let i = `button=${e}`;
                i = i + ",is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=v_pc_xlx_ggong_head_nickname";
                let n = encodeURIComponent(i);
                _.information(i, n), h.XLStatNS.trackEvent("clienttop", "head_nickname_click", "", 0, 0, 0, 0, n)
            } else "unlogin" === this.curLoginStatus && u.LoginHelperNS.loginHelper.showLoginDlg("clienthead", !0);
            let t = `button=${e}`, i = "no";
            this.isLogin && (i = "yes"), t = `${t},is_login=${i}`, !this.isLogin && this.promptData && this.clickPromptTitle("head"), h.XLStatNS.trackEvent("clienttop", "clienttop_userinfo_click", "", 0, 0, 0, 0, t)
        }

        onClick(e) {
            let t = "", i = "", n = "";
            if ("nian" === e ? (t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_yearicon", i = "nf_icon_click", n = "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", i = "vip_icon_click", n = "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", i = "xufei_botton_click", n = "v_pc_xlx_ggong_pay_top") : "vip-center" === e && (t = "https://vip.xunlei.com/", i = "vip_center_click", n = "v_pc_xlx_ggong_vipcenter"), "" !== t) {
                T.client.callServerFunction("OpenNewTab", t);
                let a = "";
                a = "is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=" + n, "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);
                _.information(e, a, o), h.XLStatNS.trackEvent("clienttop", i, "", 0, 0, 0, 0, o)
            }
        }

        switchAccount() {
            this.isLogin = !1, this.curUserid = "", this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = I, this.rectDatas = "", this.updateLoginStatus(), u.LoginHelperNS.loginHelper.switchAccount("changeaccount")
        }

        personalCenter() {
            T.client.callServerFunction("OpenNewTab", "http://i.xunlei.com/login.html")
        }

        updateLoginStatus() {
            if (_.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) {
                }), m.server.fireClientEvent("onLoginStatusChange", e, this.curLoginStatus), m.server.fireClientEvent("OnLoginStatusChange", e, this.curLoginStatus)
            }
            this.checkPromptState()
        }

        updateUserInfo(e) {
            return a(this, void 0, void 0, function* () {
                return new Promise(t => {
                    u.LoginHelperNS.loginHelper.getAllUserInfo(i => a(this, void 0, void 0, function* () {
                        do {
                            if (_.information("收到 getAllUserInfo 返回数据 userInfo:", i), null === i || void 0 === i) {
                                _.information("getAllUserInfo 得到数据是 null");
                                break
                            }
                            "login" === e && (this.isLogin = !0, this.curLoginStatus = "online", this.updateLoginStatus()), this.curUserid = i.userID, this.userNick = f.ThunderUtil.unescapeHTML(i.nickName), this.rectDatas = "", "login" === e && h.XLStatNS.setUserID(Number(this.curUserid));
                            let t = i.imgURL;
                            t = null === t || void 0 === t || "" === t ? I : t.replace("%s", "100x100"), this.headerUrl = t;
                            let n = yield u.LoginHelperNS.loginHelper.updateHeaderAw(this.headerUrl, this.curUserid);
                            if ("online" === this.curLoginStatus && null !== n && void 0 !== n && "" !== n && (this.curLoginHeaderUrl = n), null === i.vipList || void 0 === i.vipList) break;
                            if (null === i.vipList[0] || void 0 === i.vipList[0]) break;
                            let a = i.vipList[0];
							a.isYear = 1;
							if (a.isVip == 0) {
								a.vipLevel = 10;
								a.isVip = 1;								
								a.vasType = 5;
							}
                            if (this.vipData = [{
                                VIPLevel: a.vipLevel,
                                isVIP: a.isVip,
                                isYear: a.isYear,
                                uid: i.userID,
                                vasID: 2,
                                vasType: a.vasType
                            }], "update" === e) {
                                let e = {isVip: Number(a.isVip), vasType: Number(a.vasType), expireDate: a.expireDate};
                                v.VipRenewIconManagerNS.getIconManager().updateUserVipData(e)
                            }
                            this.isYear = Number(a.isYear), this.isVip = Number(a.isVip), this.vipLevel = Number(a.vipLevel), this.vipType = Number(a.vasType), "" !== a.vipGrow && (this.nVipGrow = Number(a.vipGrow))
                        } while (0);
                        t()
                    }))
                })
            })
        }

        setChangeData(e, t) {
            return a(this, void 0, void 0, function* () {
                if (_.information("onLoginFailed:getCurInternetState: setChangeData: ", e, t), 0 === e && 2 === t) {
                    this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                    let e = yield this.getUserAvatarRect();
                    yield this.closePersonalInfoWnd(), u.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
                } else this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = I, this.updateLoginStatus()
            })
        }

        checkPromptState() {
            if (_.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, _.information("prompt data", this.promptData))
            }
        }

        stat(e) {
            let t = `is_login=${this.isLogin ? 1 : 0},is_vip=${this.isVip}`;
            _.information(e, t), h.XLStatNS.trackEvent("user_info", e, "", 0, 0, 0, 0, t)
        }

        pingThroughXLUserServer() {
            return a(this, void 0, void 0, function* () {
                try {
                    const e = yield i(20);
                    return e.defaults.adapter = i(21), e.request({
                        method: "options",
                        url: "https://xluser-ssl.xunlei.com/xluser.core.login"
                    }).then(e => !!(e && e.status >= 200 && e.status <= 300)).catch(e => !1)
                } catch (e) {
                    return !1
                }
            })
        }

        updateVipRenew(e) {
            do {
                if (!this.vipRenewEnable) break;
                if (!e) break;
                void 0 !== e.title && (this.title = e.title), e.text ? (this.vipText = e.text, this.badge = e.badge ? e.badge.trim() : "", this.canShowVipText = !0) : (this.vipText = "", this.canShowVipText = !1), e.onClick && (this.vipBtnClick = e.onClick), void 0 !== e.isVisible && (this.isShowVipPluginBtn = e.isVisible, this.isShowVipPluginBtn ? void 0 !== e.buttonType && ("kt" === e.buttonType ? this.isCanShowOpenVipBtn = !0 : this.isCanShowOpenVipBtn = !1) : (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1))
            } while (0)
        }

        getSyncMsgState() {
            return this.syncMsgState
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                let e = {GetSyncMsgState: this.getSyncMsgState.bind(this)};
                m.server.registerFunctions(e), y.PluginFunctionUINS.on("update_vip_renew_button", e => {
                    this.updateVipRenew(e)
                }), this.vipRenewEnable = !0, T.client.attachServerEvent("OnLoginBefore", (e, t, i) => {
                    if (_.information("收到onLoginBefore事件：this.oldLoginStatus = ", this.oldLoginStatus, t, i), "unlogin" === this.oldLoginStatus) if (this.rectDatas = "", this.curLoginStatus = "loging", this.updateLoginStatus(), null !== i && void 0 !== i && "" !== i && null !== t && void 0 !== t && "" !== t) {
                        this.userNick = t, this.curLoginHeaderUrl = I;
                        let e = u.LoginHelperNS.loginHelper.getUserHeader(i);
                        _.information("onLoginBefore:getUserHeader = ", e, "this.curLoginStatus:", this.curLoginStatus), "loging" === this.curLoginStatus && null !== e && void 0 !== e && "" !== e && (this.curLoginHeaderUrl = e)
                    } else this.userNick = "正在登录...", this.curLoginHeaderUrl = I
                }), T.client.attachServerEvent("OnLoginSuc", e => a(this, void 0, void 0, function* () {
                    if (_.information("收到 onLoginSuc 事件"), this.promptTextClicked && this.promptData && this.promptData.url) {
                        this.promptTextClicked = !1;
                        let e = this.promptData.url;
                        _.information("prompt url", e), T.client.callServerFunction("OpenNewTab", e)
                    }
                    yield this.updateUserInfo("login"), yield this.enter("onLoginSuc")
                })), T.client.attachServerEvent("OnGetUserInfoFinished", e => a(this, void 0, void 0, function* () {
                    _.information("收到 onGetUserInfoFinished 事件"), yield this.updateUserInfo("update");
                    let e = yield u.LoginHelperNS.loginHelper.updateHeaderAw(this.headerUrl, this.curUserid);
                    _.information("下载头像成功：", e, this.curLoginStatus), "online" === this.curLoginStatus && null !== e && void 0 !== e && "" !== e && (this.curLoginHeaderUrl = e, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onUserHeaderChange", e, t => {
                        _.information("onUserHeaderChange", e, t)
                    }))
                })), T.client.attachServerEvent("OnLoginFailed", (e, t, i) => {
                    _.information("收到 onLoginFailed 事件, this.oldLoginStatus:", this.oldLoginStatus, ";erro:", t, ";code:", i);
                    let n = Number(t), a = u.LoginHelperNS.loginHelper.getCurInternetState();
                    "offline" !== this.oldLoginStatus ? 0 === a ? setTimeout(() => {
                        let e = u.LoginHelperNS.loginHelper.getCurInternetState();
                        this.setChangeData(n, e).catch()
                    }, 3e3) : this.setChangeData(n, a).catch() : 1 === n && (this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = I, this.updateLoginStatus())
                }), T.client.attachServerEvent("OnLogout", e => a(this, void 0, void 0, function* () {
                    _.information("收到 onLogout 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = I, this.rectDatas = "", this.updateLoginStatus(), yield this.closePersonalInfoWnd(), v.VipRenewIconManagerNS.getIconManager().onLogout(), h.XLStatNS.setUserID(0)
                })), T.client.attachServerEvent("OnSwitchAccount", e => a(this, void 0, void 0, function* () {
                    this.switchAccount(), yield this.closePersonalInfoWnd()
                })), T.client.attachServerEvent("OnInternetConnectChange", (e, t, i) => a(this, void 0, void 0, function* () {
                    if (2 === i) {
                        let e = yield this.pingThroughXLUserServer();
                        if ("online" === this.curLoginStatus && !e) {
                            this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                            let e = yield this.getUserAvatarRect();
                            yield this.closePersonalInfoWnd(), u.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
                        }
                    } else 1 === i && (_.information("onInternetConnectChange:", this.curLoginStatus), "offline" === this.curLoginStatus && setTimeout(() => a(this, void 0, void 0, function* () {
                        (yield this.pingThroughXLUserServer()) && (h.XLStatNS.trackEvent("user_info", "broken_net_to_login", "", 0, 0, 0, 0, "type=1"), u.LoginHelperNS.loginHelper.logIn("RetryLogin"))
                    }), 3e3))
                })), T.client.attachServerEvent("OnUserDetailInfoChange", (e, t) => {
                    if (null !== t && void 0 !== t && "" !== t) try {
                        let e = JSON.parse(t);
                        this.userNick = f.ThunderUtil.unescapeHTML(e.nickName), this.$nextTick(() => {
                            this.onVipButtonShow()
                        })
                    } catch (e) {
                        _.warning(e)
                    }
                }), T.client.attachServerEvent("OnLoginUpdate", (e, t, i) => {
                    _.information("收到事件 onLoginUpdate:", t, i), "vipinfo" !== t && "userinfo" !== t || this.updateUserInfo("update").catch(), T.client.broadcastEvent("onUserInfoChange", t, i, e => {
                        _.information("fire onUserInfoChange:", e)
                    }), m.server.fireClientEvent("onUserInfoChange", t, i), m.server.fireClientEvent("OnUserInfoChange", t, i)
                }), (yield o.asyncRemoteCall.getIpcMain()).on("onCancelRetry", () => {
                    _.information("收到 onCancelRetry 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = I, this.rectDatas = "", this.updateLoginStatus(), u.LoginHelperNS.loginHelper.logout()
                });
                let t = p.LoginPromptManagerNS.getManager();
                t.attachListener(p.LoginPromptManagerEventNS.promptDataGet, e => {
                    _.information("prompt data event result", e), e && this.checkPromptState()
                }), t.init(), _.information("attach prompt data event")
            })
        }
    };
    n([r.Watch("isLogin")], D.prototype, "onLoginChange", null), n([r.Watch("curLoginHeaderUrl", {immediate: !0})], D.prototype, "onHeaderChange", null), n([r.Watch("vipButtonShow")], D.prototype, "onVipButtonShow", null), D = n([r.Component({})], D), t.default = D
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(163), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(641), a = i(28);
    t.default = a.connector.connect({mapCommitToProps: {createNewTab: "CREATE_NEW_TAB"}})(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(165), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(11), s = i(9), l = i(480), d = i(144), u = i(22), c = i(38), h = i(2), f = i(7), g = i(20),
        p = i(10), v = i(0), m = i(78), y = i(5), k = i(65), T = i(14), w = i(13), C = i(358),
        S = f.default(h.join(__rootDir, "../bin/ThunderHelper.node")),
        I = v.default.getLogger("system-buttons"), {isDef: b} = w.ThunderUtil, _ = i(67), D = i(642);
    let A = class extends o.Vue {
        constructor() {
            super(...arguments), this.bSelectAutoRun = !0, this.maximized = !1, this.disableHover = !1, this.showNewIcon = !1, this.communityName = "community", this.blankPage = "新标签页", this.bSelectShowBookmark = !1, this.isShowNewTag = !1, this.configurableButton = {
                aid: "",
                isShow: !1,
                title: "",
                img: "",
                imgBeforeClick: "",
                imgAfterClick: "",
                link: ""
            }
        }

        onMaximizedChange(e, t) {
        }

        onShowNewTag(e) {
            return a(this, void 0, void 0, function* () {
                if (e) {
                    let e = 0, t = 0, i = 0;
                    try {
                        e = Number(yield y.client.callServerFunction("IsLogined"))
                    } catch (e) {
                        I.warning(e)
                    }
                    try {
                        let e = JSON.parse(yield y.client.callServerFunction("GetUserInfo", 2));
                        b(e) && (i = Number(e.vasType), t = Number(e.isVip))
                    } catch (e) {
                        I.warning(e)
                    }
                    p.XLStatNS.trackEvent("user_info", "clienttop_skincenter_red_show", "", 0, 0, 0, 0, `is_login=${e},is_vip=${t},vip_type=${i},is_red=1`)
                }
            })
        }

        appendUrlParams(e, t) {
            let i = e;
            const n = Object.keys(t || {});
            for (let a = 0; a < n.length; a++) i = -1 === e.indexOf("?") && n.length > 0 && 0 === a ? `${i}?${n[a]}=${t[n[a]]}` : `${i}&${n[a]}=${t[n[a]]}`;
            return i
        }

        getConfigurableButton() {
            return a(this, void 0, void 0, function* () {
                try {
                    const e = yield y.client.callServerFunction("GetVipLabelConfig", "xl11_acti_siderbar_icon");
                    if (e && e.xl11_acti_siderbar_icon) {
                        this.configurableButton.aid = _(e, "xl11_acti_siderbar_icon", "0", "aidfrom"), this.configurableButton.title = _(e, "xl11_acti_siderbar_icon", "0", "hover"), this.configurableButton.link = this.appendUrlParams(_(e, "xl11_acti_siderbar_icon", "0", "url"), {
                            aidfrom: this.configurableButton.aid,
                            referfrom: _(e, "xl11_acti_siderbar_icon", "0", "referfrom")
                        }), this.configurableButton.imgBeforeClick = _(e, "xl11_acti_siderbar_icon").find(e => "image_link_before_click" === e.id).img, this.configurableButton.imgAfterClick = _(e, "xl11_acti_siderbar_icon").find(e => "image_link_after_click" === e.id).img;
                        const t = JSON.parse(window.localStorage.getItem("system_buttons_clicked_ad")),
                            i = !!Array.isArray(t) && t.includes(this.configurableButton.aid);
                        this.configurableButton.img = i ? this.configurableButton.imgAfterClick : this.configurableButton.imgBeforeClick, this.configurableButton.isShow = !0, this.trackVipEvent("sidebar_acti_entrance_show", {aidfrom: this.configurableButton.aid})
                    } else this.configurableButton.isShow = !1
                } catch (e) {
                    I.error(e)
                }
            })
        }

        clickConfigurableButton() {
            return a(this, void 0, void 0, function* () {
                try {
                    this.trackVipEvent("sidebar_acti_entrance_click", {aidfrom: this.configurableButton.aid}), this.configurableButton.img = this.configurableButton.imgAfterClick;
                    let e = JSON.parse(window.localStorage.getItem("system_buttons_clicked_ad"));
                    e = Array.isArray(e) ? Array.from(new Set([...e, this.configurableButton.aid])) : [this.configurableButton.aid], window.localStorage.setItem("system_buttons_clicked_ad", JSON.stringify(e)), y.client.callServerFunction("OpenNewTab", this.configurableButton.link)
                } catch (e) {
                    I.error(e)
                }
            })
        }

        openMobileQRCode() {
            u.MessageBox.custom("img-dlg", {src: D, width: 320, height: 420}, {
                width: 320,
                height: 420
            }).catch(), p.XLStatNS.trackEvent("clienttop", "clienleft_phone_click")
        }

        showNewTag() {
            return a(this, void 0, void 0, function* () {
                do {
                    let e = s.ConfigNS.getValue("Skin", "ClickTag", 0), t = new Date,
                        i = yield C.default.getWallpapers();
                    if (i) for (let n of i) if (t.getTime() - n.updated_at < 6048e5 && e < n.updated_at) {
                        this.isShowNewTag = !0;
                        break
                    }
                    if (this.isShowNewTag) break;
                    let n = yield C.default.getCoolWallpapers();
                    if (n) for (let i of n) if (t.getTime() - i.updated_at < 6048e5 && e < i.updated_at) {
                        this.isShowNewTag = !0;
                        break
                    }
                    if (this.isShowNewTag) break;
                    let a = yield C.default.getCoolShakes();
                    if (a) for (let i of a) if (t.getTime() - i.updated_at < 6048e5 && e < i.updated_at) {
                        this.isShowNewTag = !0;
                        break
                    }
                } while (0)
            })
        }

        showMenu(e) {
            return a(this, void 0, void 0, function* () {
                p.XLStatNS.trackEvent("clienttop", "clienttop_dropdown_click"), this.showNewIcon = !1, s.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1);
                let t = S.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
                this.bSelectAutoRun = "" !== t, s.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0) !== this.bSelectAutoRun && s.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun), this.bSelectShowBookmark = s.ConfigNS.getValue("Bookmark", "ShowBookmarkBar", 0) && !0;
                let i = [];
                i.push({
                    type: "normal",
                    label: "新建下载(&N)",
                    accelerator: "CmdOrCtrl+N",
                    icon: `${__rootDir}/static/icon/newtask.png`,
                    click: () => {
                        this.menuItemClick("newtask", !0)
                    }
                }, {
                    type: "normal", label: "导入未完成下载", click: () => {
                        this.menuItemClick("unfinished", !0)
                    }
                }, {type: "separator"}, {
                    type: "normal",
                    label: "开机启动",
                    icon: this.bSelectAutoRun ? `${__rootDir}/static/icon/select.png` : "",
                    click: () => {
                        this.menuItemClick("autorun", !0)
                    }
                }, {
                    type: "normal", label: "设置中心", icon: `${__rootDir}/static/icon/config.png`, click: () => {
                        this.menuItemClick("setting", !0)
                    }
                }), i.push({
                    type: "submenu",
                    label: "更多",
                    enabled: !0,
                    submenu: [{
                        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 n = yield(yield r.asyncRemoteCall.getMenu()).buildFromTemplate(i),
                    a = yield r.asyncRemoteCall.getCurrentWindow();
                yield m.MenuSkinNS.setStyle(n, {});
                let o = document.getElementsByClassName("xly-aside"), l = void 0;
                o && o[0] && (l = o[0].clientWidth), yield d.ContextMenuNS.popupAt(n, {window: a, x: l}, e.target)
            })
        }

        menuItemClick(e, t) {
            if (t) {
                let t = "button=" + e;
                p.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_click", "", 0, 0, 0, 0, t)
            }
            if ("quit" === e) l.default.exitThunderX("system-menu"); else if ("newtask" === e) l.default.showNewTaskPanel("system-menu"); else if ("setting" === e) p.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=menu"), y.client.callServerFunction("OpenSettingCenter"); else if ("autorun" === e) this.bSelectAutoRun ? this.bSelectAutoRun = !1 : this.bSelectAutoRun = !0, s.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun); else if ("unfinished" === e) l.default.importUncompleted("system-menu"); else if ("download_diagnosis" === e) u.MessageBox.custom("DownloadDetectTools", {singleton: !0}, {modal: !1}).then(e => {
                e.action, c.MessageBoxNS.Action.OK
            }).catch(); else if ("check" === e) s.ConfigNS.getValue("XLUpdate", "ShowMenuUpdateIcon", !1) && s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1), S.startManualUpdateWithUI(); else if ("personal" === e) this.showPersonalManagerPlatform(); else if ("more_about" === e) u.MessageBox.custom("about", {
                windowWidth: 450,
                windowHeight: 296
            }); else if ("more_kefu" === e) y.client.callServerFunction("OpenNewTab", "http://help.xunlei.com/").catch(); else if ("more_bbs" === e) y.client.callServerFunction("OpenNewTab", "http://bbs.xunlei.com/").catch(); else if ("privacy" === e) y.client.callServerFunction("OpenNewTab", "https://i.xunlei.com/xluser/privacy.html").catch(); else if ("feedback" === e) {
                let e = S.getPeerID(), t = h.join(__rootDir, "../../Thunder.exe"),
                    i = "http://misc-xl9-ssl.xunlei.com/client/view/dist/1.0/feedback.html?version=" + S.getFileVersion(t) + "&pid=" + e;
                y.client.callServerFunction("OpenNewTab", i).catch()
            }
        }

        bookMarkClick(e) {
            let t = `button=${e}`;
            p.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) {
                s.ConfigNS.getValue("XLUpdate", "UpdateMd5", "") !== e.data.md5 && 2 === parseInt(e.data.t, 10) && (s.ConfigNS.setValue("XLUpdate", "UpdateMd5", e.data.md5), s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !0), s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !0)), s.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && (this.showNewIcon = !0)
            } else s.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1); else s.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1)
        }

        checkUpgrade() {
        }

        showIndividuation() {
            return a(this, void 0, void 0, function* () {
                let e = 0, t = 0, i = 0;
                try {
                    e = Number(yield y.client.callServerFunction("IsLogined"))
                } catch (e) {
                    I.warning(e)
                }
                try {
                    let e = JSON.parse(yield y.client.callServerFunction("GetUserInfo", 2));
                    b(e) && (i = Number(e.vasType), t = Number(e.isVip))
                } catch (e) {
                    I.warning(e)
                }
                let n = this.isShowNewTag ? 1 : 0;
                if (this.isShowNewTag) {
                    let e = new Date;
                    s.ConfigNS.setValue("Skin", "ClickTag", e.getTime()), this.isShowNewTag = !1
                }
                p.XLStatNS.trackEvent("user_info", "personalized_center_entrance", "", 0, 0, 0, 0, `is_login=${e},is_vip=${t},vip_type=${i},source=right_corner,is_red=${n}`), yield y.client.callServerFunction("ShowIndividuation")
            })
        }

        trackVipEvent(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = 0, n = 0;
                try {
                    i = Number(yield y.client.callServerFunction("IsLogined"))
                } catch (e) {
                    I.warning(e)
                }
                try {
                    let e = JSON.parse(yield y.client.callServerFunction("GetUserInfo", 2));
                    b(e) && (n = Number(e.vasType))
                } catch (e) {
                    I.warning(e)
                }
                let a = h.join(__rootDir, "../../Thunder.exe"),
                    o = `is_login=${i},vip_type=${n},client_version=${S.getFileVersion(a)}`;
                for (var r in t) o += `,${r}=${t[r]}`;
                p.XLStatNS.trackEvent("xlx_vip_event", e, "", 0, 0, 0, 0, o)
            })
        }

        clickVipCenter() {
            return a(this, void 0, void 0, function* () {
                y.client.callServerFunction("OpenNewTab", "https://vip.xunlei.com/?referfrom=v_pc_xlx_ggong_sidebar_hygw"), this.trackVipEvent("sidebar_hygw_entrance_click")
            })
        }

        showPersonalManagerPlatform() {
            return a(this, void 0, void 0, function* () {
                let e = yield k.default(!1, !0);
                e && "" !== e && (yield y.client.callServerFunction("OpenNewTab", "https://vip.xunlei.com/thunder-x-custom-editon/"))
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                setTimeout(() => a(this, void 0, void 0, function* () {
                    this.checkUpgrade(), yield this.getConfigurableButton(), y.client.attachServerEvent("OnLoginStatusChange", () => {
                        this.getConfigurableButton()
                    })
                }), 3e3), s.ConfigNS.attachListener(T.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.showNewTag()
                }), this.trackShow(), y.client.attachServerEvent("OnMainWindowVisibleChange", e => a(this, void 0, void 0, function* () {
                    this.trackShow()
                }))
            })
        }

        trackShow() {
            return a(this, void 0, void 0, function* () {
                let e = yield r.asyncRemoteCall.getCurrentWindow(), t = yield e.isMinimized(), i = yield e.isVisible();
                e && !t && i && this.trackVipEvent("sidebar_hygw_entrance_show")
            })
        }
    };
    n([o.Prop({})], A.prototype, "createNewTab", void 0), n([o.Watch("maximized")], A.prototype, "onMaximizedChange", null), n([o.Watch("isShowNewTag")], A.prototype, "onShowNewTag", null), A = n([o.Component({components: {}})], A), t.default = A
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(167), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(660), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            currentTabId: e => e.Tabs.current,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            selectNav: "SELECT_NAV",
            showOrHideBrowser: "SHOW_OR_HIDE_BROWSER",
            addNavUnreadNum: "ADD_NAV_UNREAD_NUM",
            setNavUnreadNum: "SET_NAV_UNREAD_NUM",
            setNavShowUnreadNum: "SET_NAV_SHOW_UNREAD_NUM"
        },
        mapDispatchToProps: {selectTab: "selectTab", getUnreadNums: "getUnreadNums"},
        mapGettersToProps: {
            currentTab: e => e.currentTab,
            curNav: e => e.currentNav,
            startTaskCount: e => e.startTaskCount
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(169), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(661), s = i(71), l = i(668), d = i(680), u = i(53), c = i(23), h = i(5), f = i(16), g = i(56),
        p = i(105), v = i(17), m = i(351), y = i(79), k = i(108), T = i(0), w = i(9),
        C = p.PluginWebviewMgrNS.getWebViewMgr(), S = T.default.getLogger("main-body"),
        I = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"), b = i(67);
    let _ = class extends o.Vue {
        constructor() {
            super(...arguments), this.text = "", this.isLogined = !1, this.settingTab = !1, this.lastTabId = 0, this.timeoutMessagePageClose = void 0, this.isMessagePageLoaded = !1, this.messageWebViewInfo = {}, this.isSetXmpPause = !1, this.curUid = "", this.eventSyncMessage = -1, this.eventThunderImTotalUreadChange = -1, this.eventOnConfigValueChanged = -1, this.notifyDuration = 5e3, this.width = 300, this.height = 107, this.communityMsgProperty = y.MsgQueueNS.MsgPriority.Community, this.isMsgTipsShowing = !1, this.settingNotifyFlag = !0
        }

        onCurNavChange(e, t) {
            f.server.fireClientEvent("OnCurNavChange", e, t)
        }

        oncurrentTabIdChange() {
            0 !== this.currentTabId && (this.settingTab = !1)
        }

        onStartTaskCountChange(e) {
            this.setNavUnreadNum({nav: u.NavViewID.Download, unReadNum: e || 0})
        }

        onSettingTabChange() {
            return a(this, void 0, void 0, function* () {
                let e = yield h.client.callServerFunction("GetXmpMode");
                !0 === this.settingTab ? e !== g.XMPShowMode.MINI_MODE && e !== g.XMPShowMode.EMBED_CHILD_MODE || (h.client.callServerFunction("SetXmpPause"), this.isSetXmpPause = !0) : this.isSetXmpPause && (e !== g.XMPShowMode.MINI_MODE && e !== g.XMPShowMode.EMBED_CHILD_MODE || (h.client.callServerFunction("SetXmpPlay"), this.isSetXmpPause = !1))
            })
        }

        get messageElementId() {
            return this.messageWebViewInfo.id || ""
        }

        get messagePageUrl() {
            return this.messageWebViewInfo.src || ""
        }

        get panViewShow() {
            return "pan-plugin" === b(this.currentTab, "tab", "name") && b(this.currentTab, "tab", "type") === s.TabType.XDAS
        }

        get panStyle() {
            let e = !1;
            return e = !(!(this.curNav === u.NavViewID.Cloud) || this.settingTab)
        }

        get findPageStyle() {
            let e = !1;
            return e = !(!(this.curNav === u.NavViewID.Browser) || this.settingTab)
        }

        get messagePageStyle() {
            let e = !1;
            return e = !(!(this.curNav === u.NavViewID.Message) || this.settingTab), this.curNav === u.NavViewID.Message ? (I.clearQueuesByName("community"), void 0 !== this.timeoutMessagePageClose && (clearTimeout(this.timeoutMessagePageClose), this.timeoutMessagePageClose = void 0), this.isMessagePageLoaded = !0) : void 0 === this.timeoutMessagePageClose && (this.timeoutMessagePageClose = setTimeout(() => {
                this.isMessagePageLoaded = !1
            }, 3e5)), e
        }

        closeSettingCenter() {
            this.settingTab = !1, this.curNav === u.NavViewID.Browser && this.showOrHideBrowser(!0), f.server.fireClientEvent("OnOpenOrCloseSettingCenter", !1)
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                h.client.attachServerEvent("OnLoginSuc", (e, ...t) => {
                    this.isLogined = !0
                }), h.client.attachServerEvent("OnLogout", (e, ...t) => {
                    this.isLogined = !1
                }), this.isLogined = yield c.LoginHelperNS.loginHelper.isLoginedAw(), f.server.registerFunctions({
                    GetCurrentNav: (e, t, ...i) => this.curNav,
                    SelectNav: (e, t, ...i) => {
                        let n = i[0];
                        n && this.selectNav(n)
                    },
                    SetNavUnreadNum: (e, t, ...i) => {
                        let n = i[0];
                        n && this.setNavUnreadNum({nav: n, unReadNum: i[1] || 0})
                    },
                    OpenSettingCenter: (e, t, ...i) => a(this, void 0, void 0, function* () {
                        this.showOrHideBrowser(!1), this.settingTab = !0, f.server.fireClientEvent("OnOpenOrCloseSettingCenter", !0)
                    }),
                    CloseSettingCenter: (e, t, ...i) => {
                        this.settingTab = !1, f.server.fireClientEvent("OnOpenOrCloseSettingCenter", !1)
                    },
                    IsSettingCenterOpened: (e, t, ...i) => a(this, void 0, void 0, function* () {
                        return this.settingTab
                    }),
                    ShowMessageToast: (e, t, ...i) => {
                        if (!i || i.length < 1) return;
                        let n = i[0];
                        n && void 0 === n.duration && (n.duration = 3e3), n && void 0 === n.position && (n.position = "middle"), this.$message(n)
                    }
                }), this.messageWebViewInfo = C.getWebViewInfo("ThunderIM"), void 0 === this.messageWebViewInfo.id && h.client.attachServerEvent("CreateMessageWebViewEnd", () => {
                    this.messageWebViewInfo = C.getWebViewInfo("ThunderIM")
                }), this.initMessage()
            })
        }

        initMessage() {
            return a(this, void 0, void 0, function* () {
                this.curUid = yield h.client.callServerFunction("GetUserID"), "" !== this.curUid && this.getUnreadNums(this.curUid), v.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    S.information("onLoginSuc uid", e), this.curUid = e, setTimeout(() => {
                        this.setConfNotifyFlag(), this.getUnreadNums(this.curUid), this.eventSyncMessage = h.client.attachServerEvent("SyncMessage", (e, t) => a(this, void 0, void 0, function* () {
                            try {
                                "string" == typeof t && (t = JSON.parse(t)), S.information("### syncMessage ", t);
                                let e = b(t, "data", "sender");
                                if (String(e) === this.curUid) return;
                                if (!this.isMessagePageLoaded && "/user/me/group_chat" === t.subject) {
                                    if (t.data.group && void 0 !== t.data.group.class && 1 !== t.data.group.class) return;
                                    this.addNavUnreadNum(u.NavViewID.Message)
                                }
                            } catch (e) {
                                S.warning(e)
                            }
                        })), this.eventThunderImTotalUreadChange = h.client.attachServerEvent("ThunderImTotalUreadChange", (e, t) => {
                            this.isMessagePageLoaded && this.setNavUnreadNum({
                                nav: u.NavViewID.Message,
                                unReadNum: t || 0
                            })
                        })
                    }, 1e3)
                }), v.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                    S.information("OnLogout"), this.curUid = "", this.setNavUnreadNum({
                        nav: u.NavViewID.Message,
                        unReadNum: 0
                    }), -1 !== this.eventSyncMessage && h.client.detachServerEvent("SyncMessage", this.eventSyncMessage), -1 !== this.eventThunderImTotalUreadChange && h.client.detachServerEvent("ThunderImTotalUreadChange", this.eventThunderImTotalUreadChange), I.clearQueuesByName("community")
                }), -1 === this.eventOnConfigValueChanged && (this.eventOnConfigValueChanged = h.client.attachServerEvent("OnConfigValueChanged", (e, ...t) => {
                    !t || t.length < 4 || "UserCommunitySet" === t[0] && t[1] === `radio_id_${this.curUid}` && this.setConfNotifyFlag()
                }))
            })
        }

        getUnreadNums(e) {
            return a(this, void 0, void 0, function* () {
                return S.information("getUnreadNums"), m.getUnreadMsgNum(e).then(e => {
                    if (!e.error && "ok" === e.data.result) {
                        let t = b(e, "data", "data", "chitchat");
                        this.isMessagePageLoaded || (S.information("获取未读数消息", e, t), this.setNavUnreadNum({
                            nav: u.NavViewID.Message,
                            unReadNum: t || 0
                        }))
                    }
                }).catch(e => {
                    S.information("getUnreadNums error")
                })
            })
        }

        setConfNotifyFlag() {
            this.settingNotifyFlag = w.ConfigNS.getValue("UserCommunitySet", `radio_id_${this.curUid}`, !0), "1" === this.settingNotifyFlag ? this.settingNotifyFlag = !0 : "3" === this.settingNotifyFlag && (this.settingNotifyFlag = !1), this.setNavShowUnreadNum({
                nav: u.NavViewID.Message,
                show: this.settingNotifyFlag
            })
        }
    };
    n([o.Prop()], _.prototype, "curNav", void 0), n([o.Prop({})], _.prototype, "currentTab", void 0), n([o.Prop({})], _.prototype, "currentTabId", void 0), n([o.Prop({})], _.prototype, "startTaskCount", void 0), n([o.Prop({})], _.prototype, "selectNav", void 0), n([o.Prop({})], _.prototype, "selectTab", void 0), n([o.Prop({})], _.prototype, "createNewTab", void 0), n([o.Prop({})], _.prototype, "showOrHideBrowser", void 0), n([o.Prop()], _.prototype, "setNavUnreadNum", void 0), n([o.Prop()], _.prototype, "addNavUnreadNum", void 0), n([o.Prop()], _.prototype, "setNavShowUnreadNum", void 0), n([o.Watch("curNav", {immediate: !0})], _.prototype, "onCurNavChange", null), n([o.Watch("currentTabId")], _.prototype, "oncurrentTabIdChange", null), n([o.Watch("startTaskCount")], _.prototype, "onStartTaskCountChange", null), n([o.Watch("settingTab")], _.prototype, "onSettingTabChange", null), _ = n([o.Component({
        components: {
            MainTopContainer: r.default,
            PanPluginView: () => Promise.resolve().then(() => i(683)),
            DownloadPanel: () => Promise.resolve().then(() => i(685)),
            FindPage: l.default,
            MessagePage: d.default,
            SettingViewContainer: () => Promise.resolve().then(() => i(788))
        }
    })], _), t.default = _
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(171), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(662), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            tabs: e => e.Tabs.tabs.filter(e => !e.tab.hideUI),
            current: e => e.Tabs.current
        },
        mapCommitToProps: {
            updateTabs: "UPDATE_TABS",
            updateCurrent: "UPDATE_CURRENT",
            updateBookMarksIconUrl: "UPDATE_BOOK_MARKS_ICONURL"
        },
        mapDispatchToProps: {
            closeTab: "closeTab",
            closeTabByName: "closeTabByName",
            selectTab: "selectTab",
            onBrowserNewBrowserPopup: "onNewBrowserPopup",
            removeTabCtrl: "removeTabCtrl",
            onCreateNewTab: "onCreateNewTab"
        },
        mapGettersToProps: {allTabs: e => e.allTabs, curNav: e => e.currentNav, navList: e => e.navList}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(173), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(0), r = i(8), s = i(10), l = i(363), d = i(18), u = i(27), c = i(33), h = i(11), f = i(16), g = i(5),
        p = i(37), v = i(53);
    i(886);
    const m = o.default.getLogger("main-top-search");
    let y = class extends r.Vue {
        constructor() {
            super(...arguments), this.text = "", this.disableHover = !1, this.maximized = !1, this.dragable = !0, this.isPopupMenu = !1, this.allowUploadFolder = !1
        }

        onUserLogin() {
            return a(this, void 0, void 0, function* () {
                if (!this.isLogined) return void (this.allowUploadFolder = !1);
                let e = g.client.attachServerEvent("ThunderPanPluginReady", () => a(this, void 0, void 0, function* () {
                    yield g.client.detachServerEvent("ThunderPanPluginReady", e);
                    let t = yield f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcCheckPrivilege", "upload_folder");
                    t && t[0] && "ACCEPTED" === t[0].result && (this.allowUploadFolder = !0)
                }))
            })
        }

        get transferringTasksCount() {
            let e = 0, t = this.navList.findIndex(e => e.key === v.NavViewID.Cloud);
            return -1 !== t && (e = this.navList[t].unReadNum), e
        }

        get isFindPage() {
            return "find-page" === this.curNav
        }

        get isSearchPage() {
            return "pan-plugin-view" === this.curNav || "download-panel" === this.curNav
        }

        get buttonText() {
            return "download-panel" === this.curNav ? "新建" : "添加"
        }

        closeMainWindow() {
            return a(this, void 0, void 0, function* () {
                s.XLStatNS.trackEvent("clienttop", "clienttop_close_click"), this.disableHover = !0, yield l.QuitMessageBoxMgrNS.popupCreateShortcutMessageBox(), this.$nextTick(() => {
                    d.ipcRenderer.send("closeMainWindow")
                })
            })
        }

        minizeMainWindow(e) {
            this.disableHover = !0;
            let t = encodeURIComponent("button=small_get");
            s.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                d.ipcRenderer.send("minizeMainWindow")
            })
        }

        popupMenu() {
            return a(this, void 0, void 0, function* () {
                if ("download-panel" === this.curNav) return p.ThunderNewTask.createPreNewTaskWindow(null, "download");
                this.isPopupMenu = !0, setTimeout(() => {
                    this.$refs.menuButton.focus()
                }, 100), s.XLStatNS.trackEvent("pc_yunpan", "top_operation_click", "", 0, 0, 0, 0, "clickid=add")
            })
        }

        onBlur() {
            this.isPopupMenu = !1
        }

        uploadLocalFiles() {
            this.isPopupMenu = !1, m.information("uploadLocalFiles"), f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcUploadLocalFiles"), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=local_upload")
        }

        uploadLocalDir() {
            this.isPopupMenu = !1, m.information("uploadLocalDir"), f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcUploadLocalFiles", "dir"), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=local_upload_dir")
        }

        addLink() {
            this.isPopupMenu = !1, m.information("addLink"), p.ThunderNewTask.createPreNewTaskWindow(null, "yunpan"), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=link")
        }

        addBt() {
            this.isPopupMenu = !1, m.information("addBt"), g.client.callServerFunction("ImportTorrent", {clickFrom: "yunpan"}), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=BT_link")
        }

        createFolder() {
            this.isPopupMenu = !1, m.information("createFolder"), this.$nextTick(() => {
                document.getElementById("webview_home-1EAC214F-7644-4163-9EB8-AF4BAA62D144").focus(), f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcCreateFolder")
            }), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=new_folder")
        }

        toggleMaximizeMainWindow() {
            this.disableHover = !0;
            let e = `button=${this.maximized ? "get_back" : "big_get"}`, t = encodeURIComponent(e);
            s.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                this.maximized ? d.ipcRenderer.send("restoreMainWindow") : d.ipcRenderer.send("maximizeMainWindow")
            })
        }

        closeSettingCenter() {
            this.$emit("close")
        }

        handleTransport() {
            f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcShowTransferWindow")
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                const e = yield h.asyncRemoteCall.getCurrentWindow();
                (yield e.isMaximized()) && (this.maximized = !0), e.on("maximize", () => {
                    this.maximized = !0
                }), e.on("minimize", () => {
                    this.maximized = !1
                }), e.on("unmaximize", () => {
                    this.maximized = !1
                }), d.ipcRenderer.on(c.ThunderChannelList.channelMRMainWndMax, function () {
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0), f.server.fireClientEvent("OnMainWindowVisibleChange", !0)
                }), d.ipcRenderer.on(c.ThunderChannelList.channelMRMainWndMin, function () {
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !1), f.server.fireClientEvent("OnMainWindowVisibleChange", !1)
                }), d.ipcRenderer.on(c.ThunderChannelList.channelMRMainWndRestore, function () {
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0), f.server.fireClientEvent("OnMainWindowVisibleChange", !0)
                })
            })
        }
    };
    n([r.Prop()], y.prototype, "curNav", void 0), n([r.Prop({})], y.prototype, "navList", void 0), n([r.Prop()], y.prototype, "isLogined", void 0), n([r.Prop()], y.prototype, "settingTab", void 0), n([r.Watch("isLogined")], y.prototype, "onUserLogin", null), y = n([r.Component({components: {FindPageMainTop: () => Promise.resolve().then(() => i(663))}})], y), t.default = y
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(175), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(664);
    let r = class extends a.Vue {
    };
    n([a.Prop()], r.prototype, "isFindPage", void 0), r = n([a.Component({components: {AddressBarContainer: o.default}})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(177), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(665), a = i(28);
    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),
            curNav: e => e.currentNav
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            closeTabByName: "CLOSE_TAB_BY_NAME",
            onOriginalUrlChange: "ON_ORIGINAL_URL_CHANGE",
            addBookMarksItem: "ADD_BOOK_MARKS_ITEM",
            deleteBookMarksItem: "REMOVE_BOOK_MARKS_ITEM",
            setBookMarksItemTop: "SET_BOOK_MARKS_ITEM_TOP"
        },
        mapDispatchToProps: {getGroupData: "getGroupData", initBookMarks: "initBookMarks"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(179), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(11), r = i(2), s = i(8), l = i(4), d = i(71), u = i(13), c = i(77), h = i(10), f = i(22), g = i(143),
        p = i(0), v = i(7), m = i(75), y = i(24), k = i(38), T = i(78), w = i(9), C = i(20), S = i(6), I = i(35),
        b = i(5), _ = i(72), D = i(53), A = i(16), N = i(63), x = i(3), E = i(76), P = i(14),
        O = v.default(r.join(__rootDir, "../bin/ThunderHelper.node")), M = p.default.getLogger("address-bar"),
        F = g.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(), L = i(67);
    let R = class extends s.Vue {
        constructor() {
            super(...arguments), this.clearTextTimer = void 0, this.textData = "", this.placeholder = "搜全网、搜本地、访问网址", this.placeholders = [], this.placeholderSwitchTimer = null, this.isMunuOpenUrl = !1, this.isCanUndo = !0, this.flag = !0, this.curText = "", this.inputFocus = !1, this.communityName = "community", this.blankPage = "新标签页", this.timer = 0, this.switchOn = 0, this.searchSuffix = [], this.isSelectDropItem = !1, this.showFavanimation = !1, this.showFavoritesTip = !1, this.favTipTimerId = void 0, this.curRelatedKey = "关联词", this.headerHeight = 48, this.dialogWidth = 400, this.groupEntrySection = "groupEntry", this.groupEntryKey = "open", this.isBrowserInited = !1, this.commandid = 0
        }

        get relatedKeyWord() {
            let e = "";
            return -1 === this.curRelatedKey.indexOf("关联词") && (e = this.curRelatedKey), e
        }

        onCurrentTabChange(e) {
            this.isCanUndo = !1, this.hideCollectIcon || (this.$refs.collect && this.$refs.collect.classList.remove("is-animation"), this.showFavanimation = !1)
        }

        popEditableDefaultContextMenuForAddressBar(e, t, i, n) {
            return a(this, void 0, void 0, function* () {
                (yield o.asyncRemoteCall.getCurrentWebContents()).once("context-menu", (n, r) => a(this, void 0, void 0, function* () {
                    if (r.isEditable) {
                        let n = [{
                            label: "撤销",
                            enabled: r.editFlags.canUndo && e,
                            click: () => a(this, void 0, void 0, function* () {
                                h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=undo"), (yield o.asyncRemoteCall.getCurrentWebContents()).undo()
                            })
                        }, {type: "separator"}, {
                            label: "剪切",
                            enabled: r.editFlags.canCut,
                            click: () => a(this, void 0, void 0, function* () {
                                h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=shear"), (yield o.asyncRemoteCall.getCurrentWebContents()).cut()
                            })
                        }, {
                            label: "复制",
                            enabled: r.editFlags.canCopy,
                            click: () => a(this, void 0, void 0, function* () {
                                h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=copy"), (yield o.asyncRemoteCall.getCurrentWebContents()).copy()
                            })
                        }, {
                            label: "粘贴",
                            enabled: r.editFlags.canPaste && u.ThunderUtil.isClipboardTextFormatAvailable(),
                            click: () => a(this, void 0, void 0, function* () {
                                h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=paste"), (yield o.asyncRemoteCall.getCurrentWebContents()).paste()
                            })
                        }, {
                            label: "删除",
                            enabled: r.editFlags.canDelete,
                            click: () => a(this, void 0, void 0, function* () {
                                h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=delete"), (yield o.asyncRemoteCall.getCurrentWebContents()).delete()
                            })
                        }, {type: "separator"}, {
                            label: "全选",
                            enabled: r.editFlags.canSelectAll,
                            click: () => a(this, void 0, void 0, function* () {
                                h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=chooseall"), (yield o.asyncRemoteCall.getCurrentWebContents()).selectAll()
                            })
                        }];
                        if (void 0 !== t && "function" == typeof t) {
                            let e = t(r);
                            void 0 !== e && e.length > 0 && (void 0 === i ? i = n.length : (i < 0 && (i = n.length + 1 + i) < 0 && (i = 0), i > n.length && (i = n.length)), n.splice(i, 0, ...e))
                        }
                        let s = yield(yield o.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                        yield T.MenuSkinNS.setStyle(s, {});
                        let l = yield o.asyncRemoteCall.getCurrentWindow();
                        s.popup({window: l})
                    }
                }))
            })
        }

        get canGoBack() {
            let e = !1;
            do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoBack
            } while (0);
            return e
        }

        get canGoForward() {
            let e = !1;
            do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoForward
            } while (0);
            return e
        }

        get canRefresh() {
            let e = !1;
            do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                if (this.isShowHomepage) {
                    e = !0;
                    break
                }
                if (this.currentTab.tab.getTabType() !== d.TabType.Chromium) break;
                e = !0
            } while (0);
            return e
        }

        get text() {
            let e = "";
            do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                if (this.curNav !== D.NavViewID.Browser || this.currentTab.tab.getTabType() !== d.TabType.Chromium || this.currentTab.tab.isDefaultTab()) {
                    e = this.curText;
                    break
                }
                if (!this.currentTab.tab.showUrl) break;
                e = this.currentTab.tab.url
            } while (0);
            return this.textData = e, e
        }

        onFindPageSelect() {
            if (this.isFindPage) {
                let e = "";
                do {
                    if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                    if (this.currentTab.tab.getTabType() !== d.TabType.Chromium || this.currentTab.tab.isDefaultTab()) {
                        this.textData = this.curText;
                        break
                    }
                    if (!this.currentTab.tab.showUrl) break;
                    e = this.currentTab.tab.url, this.textData = e
                } while (0)
            } else do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                if (this.currentTab.tab.getTabType() !== d.TabType.Chromium || this.currentTab.tab.isDefaultTab()) break;
                if (!this.currentTab.tab.showUrl) break;
                this.textData = this.curText
            } while (0);
            this.showFavanimation = !1
        }

        get isHttps() {
            return /^https/.test(this.text)
        }

        get isShowHomepage() {
            return 0 === this.currentTabIndex && 1 !== this.currentSelectdTaskIds.length
        }

        get domain() {
            let e = "";
            if (void 0 !== this.curUrl && "" !== this.curUrl) {
                e = new URL(this.curUrl).host
            }
            return e
        }

        get curUrl() {
            return L(this.currentTab, "tab", "url")
        }

        get hideCollectIcon() {
            return L(this.currentTab, "tab", "type") === d.TabType.XDAS || L(this.currentTab, "tab", "name") === this.communityName || !1 === L(this.currentTab, "tab", "showUrl")
        }

        get showGroupEnrty() {
            return !1
        }

        get groupIsOpen() {
            return y.default.getConfigInfo(this.groupEntrySection, this.groupEntryKey)
        }

        relatedMenuClick(e) {
            this.curRelatedKey = e || "关联词", e = e || "", w.ConfigNS.setValue("SearchBar", "RelatedKey", e)
        }

        downloadIcon(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = null, n = !1;
                try {
                    i = yield C.default.get(e, {responseType: "arraybuffer"})
                } catch (e) {
                    M.warning("error=====" + e)
                }
                return null !== i && void 0 !== i.status && 200 === i.status && null !== i.data && (n = yield S.FileSystemAWNS.writeFileAW(t, i.data)), n
            })
        }

        addressbarCollect() {
            h.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, `button=collect,url=${encodeURIComponent(this.curUrl)}`), this.handleCollect()
        }

        handleCollect() {
            return a(this, void 0, void 0, function* () {
                let e = yield(yield o.asyncRemoteCall.getCurrentWindow()).getBounds(), t = {
                    y: e.y + this.headerHeight,
                    x: e.x + (e.width - this.dialogWidth) / 2,
                    width: 450,
                    height: 196,
                    modal: !1
                }, i = void 0 === this.bookMarks[this.curUrl] ? "add" : "edit", n = "";
                "add" === i ? (n = L(this.currentTab, "tab", "title"), h.XLStatNS.trackEvent("clienttop", "bookmarks_add")) : (n = this.bookMarks[this.curUrl].name, h.XLStatNS.trackEvent("clienttop", "bookmarks_modify"));
                let r = {state: i, title: n};
                f.MessageBox.custom("BookMarks", r, t).then(e => a(this, void 0, void 0, function* () {
                    if (e.action === k.MessageBoxNS.Action.OK) {
                        if ("ok" === e.args.state) {
                            let t = "";
                            if (-1 === this.curUrl.indexOf("ftp://")) {
                                let e = I.ToolsUtilitiesAWNS.genarateMd5(this.domain), i = this.currentTab.tab.iconUrl;
                                if (M.information("iconMd5 ", e, i), "" !== i) {
                                    t = __profilesDir + "/BookMarksIcon/" + e + ".png";
                                    let i = yield S.FileSystemAWNS.readdirAW(__profilesDir);
                                    do {
                                        let e = !1;
                                        for (let t of i) if ("BookMarksIcon" === t) {
                                            e = !0;
                                            break
                                        }
                                        if (e) break;
                                        (yield S.FileSystemAWNS.mkdirAW(__profilesDir + "/BookMarksIcon")) || M.information("创建保存书签icon文件夹失败")
                                    } while (0)
                                }
                                (yield this.downloadIcon(i, t)) || (t = "")
                            }
                            let n = {};
                            n[this.curUrl] = {
                                name: e.args.title,
                                url: this.curUrl,
                                iconUrl: t
                            }, this.addBookMarksItem(n), "add" === i && this.showFavAnimation(), this.dialogClick("add-to", this.curUrl, e.args.title)
                        }
                    } else e.action === k.MessageBoxNS.Action.Cancel && void 0 !== this.bookMarks[this.curUrl] && (this.deleteBookMarksItem(this.curUrl), h.XLStatNS.trackEvent("clienttop", "bookmarks_delete"), this.dialogClick(e.args.state, this.curUrl, e.args.title))
                })).catch()
            })
        }

        showFavAnimation() {
            this.showFavanimation ? (this.$refs.collect.classList.remove("is-animation"), this.showFavanimation = !1, setTimeout(() => {
                this.showFavanimation = !0
            }, 0)) : this.showFavanimation = !0, setTimeout(() => {
                this.$refs.collect && this.$refs.collect.classList.remove("is-animation")
            }, 1500)
        }

        onOpenFavorites(e) {
            return a(this, void 0, void 0, function* () {
                h.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=favorites"), this.closeFavoritesTip();
                let e = yield(yield o.asyncRemoteCall.getCurrentWindow()).getBounds(),
                    t = this.$refs.search_btn.getBoundingClientRect(), i = {
                        x: Math.round(e.x + t.right) - 300,
                        y: Math.round(e.y + t.bottom) + 3,
                        modal: !1,
                        width: 300,
                        height: 325
                    }, n = (Object.values(this.bookMarks) || []).reverse();
                f.MessageBox.custom("Favorites", n, i).catch()
            })
        }

        dialogClick(e, t, i) {
            let n = `button=${e},bookmarks_name=${i}, bookmarks_site=${t}`;
            h.XLStatNS.trackEvent("clienttop", "bookmarks_yitianjia", "", 0, 0, 0, 0, n)
        }

        goBack() {
            do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                h.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=left"), this.currentTab.tab.goBack()
            } while (0)
        }

        goForward() {
            do {
                if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                h.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=right"), this.currentTab.tab.goForward()
            } while (0)
        }

        goRefresh() {
            do {
                if (h.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=refresh"), this.isShowHomepage) this.refreshHomepage(!1); else {
                    if (l.isNullOrUndefined(this.currentTab) || l.isNullOrUndefined(this.currentTab.tab)) break;
                    this.currentTab.tab.refresh(!1)
                }
            } while (0)
        }

        onSearchBtnClick() {
            let e = this.$refs.input.$el.querySelector("input"), t = "";
            e && e.value && (t = e.value), t || "搜全网、搜本地、访问网址" !== this.placeholder && (t = this.placeholder), h.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, `button=magnifier,url=${encodeURIComponent(t)}`), this.curNav === D.NavViewID.Cloud && h.XLStatNS.trackEvent("pc_yunpan", "top_operation_click", "", 0, 0, 0, 0, `button=search,url=${encodeURIComponent(t)}`), this.navigate()
        }

        navigate(e) {
            do {
                if (this.isSelectDropItem) break;
                let t = void 0;
                if (t = void 0 === e ? this.$refs.input.$el.querySelector("input") : e.target, l.isNullOrUndefined(t) || l.isNullOrUndefined(t.value)) break;
                let i = t.value.trim();
                if (i || "搜全网、搜本地、访问网址" !== this.placeholder && (i = this.placeholder), this.handleBirdKey(i)) {
                    h.XLStatNS.trackEvent("download_leftpanel", "search_direct_click", "", 0, 0, 0, 0, `birdkey=${i}`), M.information("顶部地址栏输入为迅雷口令,已中断Tab导航");
                    break
                }
                M.information("顶部地址栏输入不是迅雷口令", i);
                let n = O.getTaskTypeFromUrl(i), a = void 0;
                if (n === x.DownloadKernel.TaskType.P2sp || n === x.DownloadKernel.TaskType.Emule) if (void 0 === (a = N.ParseUrlFileNameNS.getNameFromUrl(i)) || a.endsWith(".html") || -1 === a.indexOf(".")) a = null; else {
                    let e = a.split("."), t = e[e.length - 1];
                    t && (t = t.toLowerCase()), -1 === E.BHOConfigNS.getValue("Monitor", "ExtendNames", E.BHOConfigNS.getDefaultExtendNames()).indexOf(t) && (a = null)
                }
                if (n !== x.DownloadKernel.TaskType.Unkown && null !== a) {
                    M.information("顶部地址栏输入为下载链接, 中断Tab导航");
                    let e = {0: {url: i, type: "com", cid: "", stat: "search", refer: ""}};
                    b.client.callServerFunction("CreateNewTaskEx", e), this.curText = "", this.textData = "";
                    break
                }
                this.openUrl(i), this.curText === this.textData ? this.curText = "" : this.clearTextTimer = setTimeout(() => {
                    this.curText = "", this.textData = ""
                }, 3e4)
            } while (0);
            A.server.fireClientEvent("OnHideDropDownWindow"), this.isCanUndo = !1, this.isSelectDropItem = !1
        }

        needNewTab() {
            let e = !1;
            do {
                if (this.currentTab.tab.getTabType() !== d.TabType.Chromium || !this.isFindPage) {
                    e = !0;
                    break
                }
                if ("community" === this.currentTab.tab.name) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        openUrl(e, t) {
            M.information("openUlr", e, t);
            do {
                if (l.isNullOrUndefined(e)) break;
                let i = "word=" + encodeURIComponent(e);
                i += `,key_word=${encodeURIComponent(this.relatedKeyWord)}`, h.XLStatNS.trackEvent("clienttop", "clienttop_address_search", "", 0, 0, 0, 0, i);
                let n = e, a = c.URLHelperNS.isUrl(e);
                if (a.ret && void 0 !== a.suggest && (n = a.suggest), null !== t && void 0 !== t || (t = !1 === a.ret), t ? (n = _.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=48021271_21_hao_pg&wd=$word$"), n = -1 === this.curRelatedKey.indexOf("关联词") ? n.replace("$word$", encodeURIComponent(`${e} ${this.curRelatedKey}`)) : n.replace("$word$", encodeURIComponent(e)), b.client.callServerFunction("AddSearchKeyword", {keyword: e}).catch()) : b.client.callServerFunction("AddSearchKeyword", {url: e}).catch(), M.information("open url", n, t), this.needNewTab()) {
                    let e = {
                        tabType: d.TabType.Chromium,
                        tabParam: {url: n, extData: JSON.stringify({search_from: "top_search_address-enter_btn_click"})}
                    };
                    this.createNewTab(e)
                } else {
                    this.currentTab.tab.navigate(n), this.currentTab.tab.setExtData(JSON.stringify({search_from: "top_search_address-enter_btn_click"}));
                    let e = this.currentTab.tab.getBrowser();
                    this.onOriginalUrlChange({originalUrl: n, browser: e}), this.isCanUndo = !0
                }
                t ? h.XLStatNS.trackEvent("download_leftpanel", "search_direct_click", "", 0, 0, 0, 0, `type=search_word,search_word=${n}`) : h.XLStatNS.trackEvent("download_leftpanel", "search_direct_click", "", 0, 0, 0, 0, `type=search_url,search_url=${n}`)
            } while (0)
        }

        handleBirdKey(e) {
            let t = c.URLHelperNS.isBirdKey(e);
            return !!(t && t.length > 0) && (m.openBirdKeyDecodeDialog(e, {from: "address"}), !0)
        }

        onInputFocus() {
            do {
                if (this.inputFocus) break;
                this.initBrowser(), b.client.broadcastEvent("OnSearchBarInputFocus", !0), this.inputFocus = !0, this.$refs.input.$el.querySelector("input").select(), this.stopPlaceholderSwitchTimer();
                let e = this.$el.getBoundingClientRect();
                "" === this.textData && this.placeholders.length, A.server.fireClientEvent("CreateSearchWindow", Math.round(e.left), Math.round(e.top + e.height + 3), Math.round(e.width), !0);
                let t = "download-panel" === this.curNav ? "download" : "pan-plugin-view" === this.curNav ? "yunpan" : "discover";
                h.XLStatNS.trackEvent("download_leftpanel", "search_cursor_type", "", 0, 0, 0, 0, "tab=" + t)
            } while (0)
        }

        onInputBlur() {
            b.client.broadcastEvent("OnSearchBarInputFocus", !1), this.inputFocus = !1, this.startPlaceholderSwitchTimer()
        }

        handle(e) {
            return a(this, void 0, void 0, function* () {
                e = e.trimLeft(), this.curText = e, this.textData = e, this.isCanUndo = !0, !this.isMunuOpenUrl && this.flag && (clearTimeout(this.timer), this.timer = setTimeout(() => a(this, void 0, void 0, function* () {
                    if (this.flag) {
                        let t = this.$el.getBoundingClientRect();
                        A.server.fireClientEvent("OnAddressBarInputChanged", e, Math.round(t.left), Math.round(t.top + t.height + 3), Math.round(t.width), Math.round(t.height)), A.server.fireClientEvent("ShowSearchWindow", !0)
                    }
                }), 200)), this.clearTextTimer && (clearTimeout(this.clearTextTimer), this.clearTextTimer = void 0)
            })
        }

        handle2() {
            return a(this, void 0, void 0, function* () {
                this.isCanUndo = !0;
                let e = this.curText;
                if (!this.isMunuOpenUrl) {
                    let t = this.$el.getBoundingClientRect();
                    A.server.fireClientEvent("OnAddressBarInputChanged", e, Math.round(t.left), Math.round(t.top + t.height + 3), Math.round(t.width), Math.round(t.height)), A.server.fireClientEvent("ShowSearchWindow", !0)
                }
                setTimeout(() => {
                    this.flag = !0
                }, 10), this.clearTextTimer && (clearTimeout(this.clearTextTimer), this.clearTextTimer = void 0)
            })
        }

        handlePopInputMenu(e) {
            this.popEditableDefaultContextMenuForAddressBar(this.isCanUndo, e => {
                let t = [], i = u.ThunderUtil.isClipboardTextFormatAvailable(), n = !1;
                if (i) {
                    let e = O.getClipBoardText();
                    n = c.URLHelperNS.isUrl(e).ret
                }
                return t.push({
                    label: "粘贴并立即打开", click: () => {
                        h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=open"), this.isMunuOpenUrl = !0;
                        let e = O.getClipBoardText();
                        this.openUrl(e, !1), setTimeout(() => {
                            this.isMunuOpenUrl = !1
                        }, 1e3)
                    }, enabled: e.editFlags.canPaste && i && n
                }), t.push({
                    label: "粘贴并全网搜索", click: () => {
                        h.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=search"), this.isMunuOpenUrl = !0;
                        let e = O.getClipBoardText();
                        this.openUrl(e, !0), setTimeout(() => {
                            this.isMunuOpenUrl = !1
                        }, 1e3)
                    }, enabled: e.editFlags.canPaste && i && !n
                }), t
            }, -4).catch()
        }

        refreshHomepage(e = !1) {
            return a(this, void 0, void 0, function* () {
                let t = document.querySelector(".iframe-home");
                do {
                    if (!t || !0 !== global.__homepageWebviewReady) break;
                    if (e) {
                        let e = t.getWebContentsId();
                        (yield(yield o.asyncRemoteCall.getWebContents()).fromId(e)).session.clearCache().then(() => {
                            t.reload()
                        }).catch()
                    } else t.reload()
                } while (0)
            })
        }

        handleAddressFocus() {
            let e = this.$refs.input;
            if (e) e.$el.querySelector("input").blur(); else {
                document.querySelector("#addressbar-input").blur()
            }
        }

        getRecommends() {
            return a(this, void 0, void 0, function* () {
                let e = void 0, t = null;
                try {
                    C.default.defaults.adapter = i(21), t = yield C.default.get("http://static-xl.a.88cdn.com/json/thunderx_search_bar.json", {timeout: 1e4})
                } catch (e) {
                    M.warning(e)
                }
                if (null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data) {
                    let i = 3;
                    for (let e = 0; e < t.data.length && !(i <= 0); ++e, --i) this.placeholders.push(t.data[e].title);
                    try {
                        e = JSON.stringify(t.data)
                    } catch (e) {
                        M.warning(e)
                    }
                }
                return null !== e && void 0 !== e || (e = ""), b.client.callServerFunction("SetSearchRecommends", e), e
            })
        }

        closeFavoritesTip() {
            this.favTipTimerId && (clearTimeout(this.favTipTimerId), this.favTipTimerId = void 0), this.showFavoritesTip && (this.showFavoritesTip = !1, w.ConfigNS.setValue("SearchBar", "FavoritesTip", !1))
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                A.server.registerFunctions({
                    GetAddressBarInputText: (e, t, ...i) => this.textData,
                    DeleteBookMarksItem: (e, t, ...i) => {
                        i && i[0] && this.deleteBookMarksItem(i[0])
                    }
                }), w.ConfigNS.attachListener(P.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.curRelatedKey = w.ConfigNS.getValue("SearchBar", "RelatedKey", "关联词"), this.showFavoritesTip = w.ConfigNS.getValue("SearchBar", "FavoritesTip", !0), this.showFavoritesTip && (this.favTipTimerId = setTimeout(() => {
                        this.closeFavoritesTip()
                    }, 5e3))
                }), this.getGroupData(), b.client.attachServerEvent("SelectAddressDropItem", (e, ...t) => {
                    t && !l.isNullOrUndefined(t[0]) && (this.textData = t[0], l.isNullOrUndefined(t[1]) || (this.isSelectDropItem = t[1]))
                }), b.client.attachServerEvent("AddressDropWndKeyDown", (e, ...t) => {
                    if (!t || !t[0]) return;
                    13 === t[0] && this.navigate()
                }), b.client.attachServerEvent("SearchBarFocusChange", (e, ...t) => {
                    t[1] ? this.inputFocus = !0 : this.handleAddressFocus()
                }), document.addEventListener("keydown", e => {
                    e.ctrlKey && 65 === e.keyCode && e.preventDefault(), this.inputFocus && (40 !== e.keyCode && 38 !== e.keyCode && 13 !== e.keyCode || A.server.fireClientEvent("AddressKeyDown", e.keyCode), 13 === e.keyCode && this.handleAddressFocus())
                }), document.addEventListener("keyup", this.handleKeyUp, !0), document.addEventListener("compositionstart", () => {
                    this.inputFocus && (this.flag = !1)
                }), document.addEventListener("compositionend", () => {
                    if (!this.inputFocus) return;
                    this.$refs.input.$el.querySelector("input").placeholder === document.activeElement.placeholder && this.handle2()
                }), F.on("handleCollent", e => {
                    this.handleCollect()
                }), F.on("bookmarks.top", e => {
                    this.setBookMarksItemTop(e)
                }), F.on("bookmarks.editfinish", (e, t) => a(this, void 0, void 0, function* () {
                    let i = t.url, n = "";
                    if (i) {
                        n = new URL(i).host
                    }
                    if (e.action === k.MessageBoxNS.Action.OK) {
                        if ("ok" === e.args.state) {
                            let a = "";
                            if (-1 === i.indexOf("ftp://")) {
                                let e = I.ToolsUtilitiesAWNS.genarateMd5(n), i = t.iconUrl;
                                if (M.information("iconMd5 ", e, i), "" !== i) {
                                    a = __profilesDir + "/BookMarksIcon/" + e + ".png";
                                    let t = yield S.FileSystemAWNS.readdirAW(__profilesDir);
                                    do {
                                        let e = !1;
                                        for (let i of t) if ("BookMarksIcon" === i) {
                                            e = !0;
                                            break
                                        }
                                        if (e) break;
                                        (yield S.FileSystemAWNS.mkdirAW(__profilesDir + "/BookMarksIcon")) || M.information("创建保存书签icon文件夹失败")
                                    } while (0)
                                }
                                (yield this.downloadIcon(i, a)) || (a = "")
                            }
                            let o = {};
                            o[i] = {
                                name: e.args.title,
                                url: i,
                                iconUrl: a
                            }, this.addBookMarksItem(o), "add" === t.state && this.showFavAnimation()
                        }
                    } else e.action === k.MessageBoxNS.Action.Cancel && void 0 !== this.bookMarks[i] && this.deleteBookMarksItem(i)
                })), setTimeout(() => {
                    this.switchOn = y.default.getConfigInfo("searchBar", "enableAssociativeWord"), null !== this.switchOn && void 0 !== this.switchOn || (this.switchOn = 1), this.searchSuffix = y.default.getConfigInfo("searchBar", "searchSuffix") || this.searchSuffix, w.ConfigNS.setValue("SearchBar", "EnableAssociativeWord", this.switchOn), w.ConfigNS.setValue("SearchBar", "SearchSuffix", this.searchSuffix.toString())
                }, 3e3), (yield o.asyncRemoteCall.getCurrentWindow()).hookWindowMessage(528, () => {
                    do {
                        if (!this.$refs.input) break;
                        let e = O.getCursorPos(),
                            t = this.$refs.input.$el.querySelector("input").getBoundingClientRect();
                        A.server.fireClientEvent("OnSearchWindowClickMouse", e.x, e.y, Math.round(t.left), Math.round(t.top), Math.round(t.right), Math.round(t.bottom))
                    } while (0)
                }), yield this.getRecommends(), this.startPlaceholderSwitchTimer(), w.ConfigNS.attachListener(P.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.initBookMarks()
                }), A.server.registerFunctions({SearchBookMark: this.searchBookMark}), b.client.attachServerEvent("StartClearTextTimer", () => {
                    this.clearTextTimer = setTimeout(() => {
                        this.curText = "", this.textData = ""
                    }, 3e4)
                })
            })
        }

        startPlaceholderSwitchTimer() {
            if (null === this.placeholderSwitchTimer && this.placeholders.length > 0) {
                let e = 0;
                this.placeholderSwitchTimer = setInterval(() => {
                    this.placeholder = this.placeholders[e], ++e === this.placeholders.length && (e = 0)
                }, 4e3)
            }
        }

        stopPlaceholderSwitchTimer() {
            this.placeholderSwitchTimer && (this.placeholder = "搜全网、搜本地、访问网址", clearInterval(this.placeholderSwitchTimer), this.placeholderSwitchTimer = null)
        }

        beforeDestroy() {
            document.removeEventListener("keyup", this.handleKeyUp, !0), this.stopPlaceholderSwitchTimer()
        }

        handleKeyUp(e) {
            this.isShowHomepage && 116 === e.keyCode && this.refreshHomepage(e.ctrlKey)
        }

        searchBookMark(e, t, ...i) {
            if (!i || !i[0]) return [];
            let n = i[0].split(" "), a = [], o = (Object.values(this.bookMarks) || []).reverse();
            for (let e = 0; e < o.length; e++) {
                let t = !0;
                for (let i = 0; i < n.length; i++) if (!o[e].url.includes(n[i]) && !o[e].name.includes(n[i])) {
                    t = !1;
                    break
                }
                if (t && (a.push(o[e]), a.length >= 2)) return a
            }
            return a
        }

        initBrowser() {
            if (!this.isBrowserInited) {
                M.information("initBrowser"), this.isBrowserInited = !0;
                let e = {
                    tabType: d.TabType.Chromium,
                    tabParam: {
                        url: "https://pc.xunlei.com/pages/#/new-tab",
                        hideUI: !0,
                        name: "initBrowserTab",
                        extData: JSON.stringify({search_from: "top_search_address-enter_btn_click"})
                    }
                };
                this.createNewTab(e), setTimeout(() => {
                    this.closeTabByName("initBrowserTab")
                }, 6e4)
            }
        }
    };
    n([s.Prop()], R.prototype, "initBookMarks", void 0), n([s.Prop()], R.prototype, "isFindPage", void 0), n([s.Prop({})], R.prototype, "currentTab", void 0), n([s.Prop({})], R.prototype, "curNav", void 0), n([s.Prop({})], R.prototype, "currentSelectdTaskIds", void 0), n([s.Prop({})], R.prototype, "currentTabIndex", void 0), n([s.Prop({})], R.prototype, "bookMarks", void 0), n([s.Prop({})], R.prototype, "allNetGroups", void 0), n([s.Prop({})], R.prototype, "addBookMarksItem", void 0), n([s.Prop({})], R.prototype, "deleteBookMarksItem", void 0), n([s.Prop({})], R.prototype, "setBookMarksItemTop", void 0), n([s.Prop({})], R.prototype, "getGroupData", void 0), n([s.Watch("currentTab")], R.prototype, "onCurrentTabChange", null), n([s.Prop({})], R.prototype, "createNewTab", void 0), n([s.Prop({})], R.prototype, "closeTabByName", void 0), n([s.Prop({})], R.prototype, "onOriginalUrlChange", void 0), n([s.Watch("isFindPage")], R.prototype, "onFindPageSelect", null), R = n([s.Component], R), t.default = R
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(181), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(669), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            tabs: e => e.Tabs.tabs.filter(e => !e.tab.hideUI),
            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",
            onBrowserLoadEnd: "ON_LOAD_END",
            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",
            closeTabByName: "closeTabByName",
            selectTab: "selectTab",
            onJsCallNativeFunction: "onChromiumCallNativeFunction",
            onJsCheckNativeFunction: "onChromiumCheckNativeFunction",
            onBrowserNewBrowserPopup: "onNewBrowserPopup",
            removeTabCtrl: "removeTabCtrl",
            onCreateNewTab: "onCreateNewTab"
        },
        mapGettersToProps: {
            unread: e => e.totalUnread,
            allTabs: e => e.allTabs,
            currentTab: e => e.currentTab,
            currentNav: e => e.currentNav
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(183), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(670), s = i(71), l = i(89), d = i(137), u = i(25), c = i(673), h = i(101), f = i(18),
        g = i(11), p = i(17), v = i(36), m = i(57), y = i(674), k = i(4), T = i(2), w = i(0), C = i(7), S = i(37),
        I = i(10), b = i(343), _ = i(22), D = i(38), A = i(78), N = i(35), x = i(20), E = i(6), P = i(16), O = i(46),
        M = i(3), F = i(12), L = i(13), R = i(61), B = i(63), U = i(24), K = i(350), V = i(352),
        W = w.default.getLogger("Thunder.Main.Renderer.view.tabs"),
        G = C.default(T.join(__rootDir, "../bin/ThunderHelper.node")), H = l.TabEventManagerNS.getEventEmitter(),
        z = i(67);
    let j = class extends o.Vue {
        constructor() {
            super(...arguments), this.titleCue = "推荐", this.tabStyle = "simple", this.isLoading = !1, this.hasDownloading = !1, this.newCount = 0, this.totalTabsOpened = !1, this.totalTabsCreated = !1, this.appendChild = null, this.tabsCount = 1, this.nextListenerCookie = 0, this.listenerMap = new Map, this.lastMainWndVisible = !1, this.lastMainWndMinimized = !1, this.tabEventEmiting = !1, this.panPluginAttachFunc = null, this.isLoaded = !1, this.timeoutLoadClose = void 0
        }

        onTabsUpdated(e) {
            this.tabsCount = e.length, f.ipcRenderer.send("total-tabs-update", {
                tabs: JSON.parse(JSON.stringify(this.tabs)),
                current: this.current
            })
        }

        onCurrentUpdated(e) {
            f.ipcRenderer.send("total-tabs-update", {tabs: JSON.parse(JSON.stringify(this.tabs)), current: e})
        }

        get browserTabStyle() {
            return "find-page" === this.currentNav ? (void 0 !== this.timeoutLoadClose && (W.information("clear timeout close find Page", this.currentNav), clearTimeout(this.timeoutLoadClose), this.timeoutLoadClose = void 0), this.isLoaded = !0, "position: fixed;") : (void 0 === this.timeoutLoadClose && (this.timeoutLoadClose = setTimeout(() => {
                W.information("timeout close find Page", this.currentNav), this.isLoaded = !1
            }, 3e5)), "position: initial;")
        }

        get homepageShow() {
            return this.currentTabIsChromium || "recommend" !== this.currentTabName ? "opacity: 0; width: 0; height: 0; overflow: hidden;" : ""
        }

        get settingViewShow() {
            return "conf-setting" === z(this.currentTab, "tab", "name") && "设置中心" === z(this.currentTab, "title")
        }

        get hadSettingTab() {
            return -1 !== this.innerGetTabIndexByTitleAndName({name: "conf-setting", title: "设置中心"})
        }

        innerGetTabIndexByTitleAndName(e) {
            let t = -1;
            if (void 0 === this.tabs) return t;
            for (let i = 0; i < this.tabs.length; i++) if (this.tabs[i].title === e.title && this.tabs[i].tab.name === e.name) {
                t = i;
                break
            }
            return t
        }

        get currentTabIsChromium() {
            return z(this.currentTab, "tab", "type") === s.TabType.Chromium
        }

        get currentTabName() {
            return z(this.currentTab, "tab", "name")
        }

        get currentTabTitle() {
            return z(this.currentTab, "title")
        }

        get isDownloadingTab() {
            return 0 === this.current
        }

        isTabLoading(e) {
            let t = !1;
            do {
                let i = this.tabs[e].tab;
                if (k.isNullOrUndefined(i)) break;
                "loading" === i.state && (t = !0)
            } while (0);
            return t
        }

        handleAdd(e) {
            I.XLStatNS.trackEvent("clienttop", "clienttop_newtab_add");
            let t = {tabType: s.TabType.Chromium, tabParam: {showUrl: !1}};
            k.isNullOrUndefined(e) ? t.tabParam.index = this.tabs.length : t.tabParam.index = e + 1, this.createNewTab(t), this.$root.$emit("tab.createTab", t)
        }

        handleRemove({tab: e, index: t}) {
            return a(this, void 0, void 0, function* () {
                I.XLStatNS.trackEvent("clienttop", "clienttop_newtab_close");
                do {
                    let i = e.tab.getBeforeCloseExtra();
                    if (i && i.content) {
                        let n = yield _.MessageBox.confirm(i);
                        if (n.action === D.MessageBoxNS.Action.OK) {
                            void 0 === i.okCallbackId || null === i.okCallbackId || isNaN(i.okCallbackId) || e.tab.callNativeFunctionCallback(i.nativeCallId, i.okCallbackId, t);
                            break
                        }
                        if (n.action === D.MessageBoxNS.Action.Close) break
                    }
                    let n = {tabInfo: e, index: t};
                    this.closeTab(n), this.$root.$emit("tab.closeTab", n);
                    let a = n.tabInfo.tab.getCurUrl();
                    this.trackBrowserEvent("new_tab_close", a, "load_status=" + this.getLoadStatus(n.tabInfo.tab.state))
                } while (0)
            })
        }

        handleChange({tab: e, index: t}) {
            W.verbose(e), this.selectTab(t)
        }

        handleClick() {
            W.information("tab.click", z(this.tabs, `${this.current}`)), this.$root.$emit("tab.click", z(this.tabs, `${this.current}`))
        }

        tabListeners(e, t) {
            return {
                contextmenu: () => {
                    this.handlePopInputMenu(e, t)
                }
            }
        }

        handlePopInputMenu(e, t) {
            let i = e.getTitle();
            0 !== t && "设置中心" !== i && this.popEditableDefaultContextMenu(t)
        }

        handleOpenCopyTab(e, t) {
            let i = {tabType: s.TabType.Chromium, tabParam: {url: e, index: t + 1}};
            this.createNewTab(i)
        }

        getLoadStatus(e) {
            let t = "loading";
            switch (e) {
                case"loaded":
                    t = "success";
                    break;
                case"error":
                    t = "fail";
                    break;
                default:
                    t = "loading"
            }
            return t
        }

        handleCloseTab(e) {
            if (e > 0) {
                let t = {tabInfo: this.tabs[e], index: e};
                this.closeTab(t), this.$root.$emit("tab.closeTab", t);
                let i = t.tabInfo.tab.getCurUrl();
                this.trackBrowserEvent("new_tab_close", i, "load_status=" + this.getLoadStatus(t.tabInfo.tab.state))
            }
        }

        handleMiddleClick(e) {
            W.information("MiddleEventObject"), e.index > 0 && this.handleCloseTab(e.index)
        }

        popEditableDefaultContextMenu(e) {
            return a(this, void 0, void 0, function* () {
                (yield g.asyncRemoteCall.getCurrentWebContents()).once("context-menu", (t, i) => a(this, void 0, void 0, function* () {
                    let t = this.tabs.length > 2, i = e !== this.tabs.length - 1, n = [{
                            label: "打开新的标签页", accelerator: "CmdOrCtrl+T", click: () => {
                                this.menuItemClick("add", e)
                            }
                        }, {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: t, click: () => {
                                this.menuItemClick("close-other-tabs", e)
                            }
                        }, {
                            label: "关闭右侧标签页", enabled: i, click: () => {
                                this.menuItemClick("close-tabs-to-the-right", e)
                            }
                        }], a = yield(yield g.asyncRemoteCall.getMenu()).buildFromTemplate(n),
                        o = yield g.asyncRemoteCall.getCurrentWindow();
                    yield A.MenuSkinNS.setStyle(a, {}), yield a.popup({window: o})
                }))
            })
        }

        menuItemClick(e, t, i) {
            if ("add" === e) this.handleAdd(t); 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, t); 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)
            }
        }

        handleKeydownHotkey(e) {
            do {
                if (!e.ctrlKey) break;
                if ("t" === e.key || "T" === e.key) {
                    this.handleAdd(this.current);
                    break
                }
                if ("r" === e.key || "R" === e.key) {
                    let e = z(this.tabs, `${this.current}`, "tab");
                    e && e.refresh(!1)
                }
                if ("w" === e.key || "W" === e.key) {
                    this.handleCloseTab(this.current);
                    break
                }
            } while (0)
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                H.on(l.TabEventManagerNS.EventType.CreateNewTab, this.onCreateTab), (yield g.asyncRemoteCall.getGlobalShortcut()).register("ctrl+shift+f12", () => {
                    let e = z(this.tabs, `${this.current}`, "tab");
                    e && e.showDevTool(!0)
                }), window.addEventListener("keydown", this.handleKeydownHotkey, !0), window.addEventListener("keyup", e => {
                    if ("F5" === e.key) {
                        let e = z(this.tabs, `${this.current}`, "tab");
                        e && e.refresh(!1)
                    }
                }, !0);
                let e = [{eventName: "init-done", listener: this.onInit}, {
                    eventName: "before-nav",
                    listener: this.onBeforeNavigate
                }, {eventName: "title-change", listener: this.onTitleChange}, {
                    eventName: "favicon-url-change",
                    listener: this.onFaviconURLChange
                }, {eventName: "address-change", listener: this.onAddressChange}, {
                    eventName: "new-browser-popup",
                    listener: this.onNewBrowserPopup
                }, {
                    eventName: "new-browser-popup-done",
                    listener: this.onNewBrowserPopupCompleted
                }, {eventName: "open-url-from-tab", listener: this.onOpenURLFromTab}, {
                    eventName: "destroyed",
                    listener: this.onAfterBrowserDestroy
                }, {eventName: "load-start", listener: this.onLoadStart}, {
                    eventName: "load-end",
                    listener: this.onLoadEnd
                }, {eventName: "loading-state-change", listener: this.onLoadingStateChange}, {
                    eventName: "load-error",
                    listener: this.onLoadError
                }, {eventName: "got-focus", listener: this.onGotFocus}, {
                    eventName: "before-download",
                    listener: this.onBeforeDownload.bind(this)
                }, {
                    eventName: "custom-protocol-execution",
                    listener: this.onCustomProtocalExecution.bind(this)
                }, {
                    eventName: "call-native-func",
                    listener: this.onChromiumJsCallNativeFunction
                }, {eventName: "check-native-func", listener: this.onChromiumCheckNativeFunction}, {
                    eventName: "close",
                    listener: this.onClose
                }, {eventName: "hotkey", listener: this.onHotKey}];
                l.setDefaultListeners(e);
                let t = [{
                    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)
                }, {
                    functionName: "TabBeforeClose",
                    nativeFunc: this.tabBeforeClose.bind(this)
                }, {
                    functionName: "CloseTabByName",
                    nativeFunc: this.closeTabName.bind(this)
                }, {
                    functionName: "AttachTabEvent",
                    nativeFunc: this.attachTabEvent.bind(this)
                }, {functionName: "DetachTabEvent", nativeFunc: this.detachTabEvent.bind(this)}];
                v.NativeCallNS.registerNativeFunction(t);
                let i = {
                    openNewTab: this.plugin_openNewTab.bind(this),
                    OpenNewTab: (e, t, ...i) => {
                        do {
                            let n = i[0], a = "vip-download-webview";
                            if (t.name.toLowerCase() !== a.toLowerCase() && this.isVipPayUrl(n) && P.server.isRemoteClientExist(a)) {
                                P.server.callClientFunctionByName(a, "OpenPayVipUrl", n);
                                break
                            }
                            this.plugin_openNewTab(e, t, ...i)
                        } while (0)
                    },
                    GetTabIndexByTitleAndName: this.plugin_getTabIndexByTitleAndName.bind(this),
                    SelectTab: this.plugin_selectTabByIndex.bind(this),
                    CloseTabByIndex: this.plugin_closeTabByIndex.bind(this),
                    GetCurrentSelectTabValue: (e, t, ...i) => {
                        let n = void 0;
                        {
                            let e = i[0], t = i[1];
                            t || (t = "tab"), n = z(this.currentTab, t, e)
                        }
                        return n
                    }
                };
                P.server.registerFunctions(i);
                let n = yield g.asyncRemoteCall.getCurrentWindow();
                m.quitPromises.add(this.quitBrowser), p.NativeCallModule.nativeCall.AttachNativeEvent("onWebEvent", (...e) => {
                    if (0 === this.tabs.length) return;
                    if (k.isNullOrUndefined(e) || k.isNullOrUndefined(e[0])) return;
                    let t = e[0];
                    e.splice(0, 1);
                    for (let i = 0; i < this.tabs.length; i++) this.tabs[i].tab.fireEvent(t, ...e)
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onFireLoginEvent", (e, t) => {
                    if (0 !== this.tabs.length) for (let i = 0; i < this.tabs.length; i++) {
                        let n = this.tabs[i];
                        n && n.tab.getTabType() !== s.TabType.XDAS && this.tabs[i].tab.fireEvent("onFireLoginEvent", e, t)
                    }
                }), p.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)
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    if (0 !== this.tabs.length) {
                        W.information("监听到了退出事件！onLogout");
                        for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogout", e)
                    }
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onLoginWndClose", e => {
                    if (0 !== this.tabs.length) {
                        W.information("监听到了关闭事件：onLoginWndClose：", e);
                        for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnLoginWndClose", e)
                    }
                }), this.lastMainWndVisible = yield n.isVisible(), this.lastMainWndMinimized = yield n.isMinimizable(), n.on("hide", this.fireTabVisibleChangeEvent), n.on("minimize", this.fireTabVisibleChangeEvent), n.on("show", this.fireTabVisibleChangeEvent), n.on("restore", this.fireTabVisibleChangeEvent), n.on("maximize", this.fireTabVisibleChangeEvent), n.on("unmaximize", this.fireTabVisibleChangeEvent), H.on(l.TabEventManagerNS.EventType.RemoveTab, this.onTabEvent), H.on(l.TabEventManagerNS.EventType.AddTab, this.onTabEvent), H.on(l.TabEventManagerNS.EventType.ChangeTab, this.onTabEvent), H.on(l.TabEventManagerNS.EventType.VisibleChange, this.onTabVisibleChange), K.CommonSitesMgrNS.getInstance().init().catch()
            })
        }

        onCurrentNavChange() {
            return a(this, void 0, void 0, function* () {
                if ("find-page" === this.currentNav) {
                    let e = z(this.tabs, `${this.current}`, "tab");
                    if (k.isNullOrUndefined(e)) return;
                    if (e.getTabType() === s.TabType.Chromium) return void (yield this.addAllListener())
                }
                this.removeAllListener().catch()
            })
        }

        onCurrentTabChange(e, t) {
            return a(this, void 0, void 0, function* () {
                if ("find-page" === this.currentNav) {
                    let i = z(this.tabs, `${this.current}`, "tab");
                    if (k.isNullOrUndefined(i)) return;
                    if (i.getTabType() === s.TabType.Chromium && 0 !== e && 0 === t) return void (yield this.addAllListener());
                    if (0 !== e && 0 !== t) return
                }
                this.removeAllListener().catch()
            })
        }

        addAllListener() {
            return a(this, void 0, void 0, function* () {
                let e = yield g.asyncRemoteCall.getCurrentWindow();
                e.on("resize", this.resizeCurrentBrowserWindow), e.on("move", this.resizeCurrentBrowserWindow), e.on("show", this.resizeCurrentBrowserWindow)
            })
        }

        removeAllListener() {
            return a(this, void 0, void 0, function* () {
                let e = yield g.asyncRemoteCall.getCurrentWindow();
                e.removeListener("resize", this.resizeCurrentBrowserWindow), e.removeListener("move", this.resizeCurrentBrowserWindow), e.removeListener("show", this.resizeCurrentBrowserWindow)
            })
        }

        trackBrowserEvent(e, t, i = "") {
            do {
                if (!t || "" === t) break;
                let n = O.parse(t);
                if (n.host && n.host.indexOf(".xunlei.com") < 0) break;
                i = i + (i.length > 0 ? "," : "") + "url=" + encodeURIComponent(t), I.XLStatNS.trackEvent("new_tab", e, "", 0, 0, 0, 0, i)
            } while (0)
        }

        fireTabVisibleChangeEvent() {
            return a(this, void 0, void 0, function* () {
                let e = yield g.asyncRemoteCall.getCurrentWindow();
                if (e && !(yield e.isDestroyed())) {
                    let t = yield e.isVisible(), i = yield e.isMinimized();
                    if (this.tabEventEmiting || (t && !i) !== (this.lastMainWndVisible && !this.lastMainWndMinimized)) {
                        W.information("发送tab状态和主窗口状态改变事件 visible:", t, ", minimized:", i, ", current:", this.current);
                        for (let e = 0; e < this.tabs.length; e++) this.tabs[e].tab.fireEvent("OnTabVisibleChange", t && !i, this.current === e), H.emit(l.TabEventManagerNS.EventType.VisibleChange, this.tabs[e].tab, t && !i, this.current === e)
                    }
                    this.lastMainWndVisible = t, this.lastMainWndMinimized = i
                }
            })
        }

        onTabEvent() {
            this.$nextTick(() => a(this, void 0, void 0, function* () {
                this.tabEventEmiting = !0, yield this.fireTabVisibleChangeEvent(), this.tabEventEmiting = !1
            }))
        }

        onTabVisibleChange(e, t, i) {
            if (W.information("onTabVisibleChange", e, t, i), t && i && e.getTabType() === s.TabType.Chromium) do {
                let t = e.getBrowser();
                if (k.isNullOrUndefined(t)) {
                    W.warning(t);
                    break
                }
                let i = t.getWindowHandle();
                if (!1 === G.isWindowHandle(i)) break;
                G.setWindowFocus(i, !0)
            } while (0)
        }

        onCreateTab(e, t) {
            W.information("[tbc] onCreateTab", t), this.onCreateNewTab({newTab: e, createTabParam: t})
        }

        quitBrowser() {
            return a(this, void 0, void 0, function* () {
                return (yield g.asyncRemoteCall.getGlobalShortcut()).unregister("ctrl+shift+f12"), new Promise(e => {
                    this.onAppQuit(), e(!0)
                })
            })
        }

        getBrowserTab(e) {
            let t = null;
            if (this.allTabs) {
                let i = null;
                for (let n = 0; n < this.allTabs.length; ++n) i = this.allTabs[n].tab.getBrowser(), k.isNullOrUndefined(i) || e === i && (t = this.allTabs[n].tab)
            }
            return t
        }

        fireBrowserEvent(e, t) {
            W.information("fireBrowserEvent eventName", e, "tabName", t);
            let i = this.listenerMap.get(e);
            i && i.forEach((e, i) => {
                e.tabName === t && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId, t)
            })
        }

        onInit(e, t) {
            let i = e.target;
            if (i) {
                let e = {hwnd: i.getWindowHandle(), browser: i};
                this.onBrowserBindWindowHandle(e), i.addCustomProtocol("ed2k://"), i.addCustomProtocol("thunder://"), i.addCustomProtocol("magnet:?"), i.registerHotKey(h.Key.F5, h.KeyModifiers.CTRL_DOWN), i.registerHotKey(h.Key.F5, h.KeyModifiers.NONE), i.registerHotKey(h.Key.T, h.KeyModifiers.CTRL_DOWN), i.registerHotKey(h.Key.R, h.KeyModifiers.CTRL_DOWN), i.registerHotKey(h.Key.W, h.KeyModifiers.CTRL_DOWN), c.registerContextMenu(i)
            }
        }

        onTitleChange(e, t) {
            W.information("onTitleChange title", t);
            let i = {title: t, browser: e.target}, n = this.getBrowserTab(e.target);
            if (!k.isNullOrUndefined(n)) {
                this.fireBrowserEvent("OnTitleChange", n.name);
                let e = n.url;
                K.CommonSitesMgrNS.getInstance().updateItem({
                    url: e,
                    name: t
                }, "OnTitleChange"), V.historyManager.update({url: e, name: t}, "OnTitleChange")
            }
            this.onBrowserTitleChange(i)
        }

        onBeforeNavigate(e, t, i, n) {
            W.information("beforenavigate", t, i, n), t && this.trackBrowserEvent("browser_load_before_navigation", i)
        }

        onFaviconURLChange(e, t) {
            W.information("icon", t);
            let i = "", n = 0;
            for (n = 0; n < this.tabs.length; n++) if (this.tabs[n].tab.getBrowser() === e.target) {
                i = this.tabs[n].tab.url;
                break
            }
            let a = {iconUrl: t, browser: e.target};
            do {
                if (!i) break;
                if ("" === i) break;
                if (!t) {
                    t = "https://" + new URL(i).host + "/favicon.ico"
                }
                this.getIcon(i, t).catch(), k.isNullOrUndefined(this.tabs[n]) || this.fireBrowserEvent("OnFaviconURLChange", this.tabs[n].tab.name), this.onBrowserFavIconChange(a)
            } while (0)
        }

        onAddressChange(e, t, i) {
            W.information("onAddressChange", t, i);
            let n = {isMainFrame: t, url: i, browser: e.target}, a = this.getBrowserTab(e.target);
            if (!k.isNullOrUndefined(a) && (this.fireBrowserEvent("OnAddressChange", a.name), t)) {
                let e = ["http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", "http://pc.xunlei.com/pages/#/new-tab", "http://pc.xunlei.com/pages/#/help/question?tab=user_guide", "http://pc.xunlei.com/pages/#/help/question?tab=usually_question"];
                "community" === a.name || e.includes(i) || (K.CommonSitesMgrNS.getInstance().updateItem({url: i}, "OnAddressChange"), V.historyManager.update({url: i}, "OnAddressChange"))
            }
            this.onBrowserAddressChange(n)
        }

        onNewBrowserPopup(e, t, i, n, o, r) {
            return a(this, void 0, void 0, function* () {
                let t = e.target.getURL(), n = {url: i, refUrl: t, ev: e};
                I.XLStatNS.trackEvent("clienttop", "browsertabpage_show", "", 0, 0, 0, 0, "source=url_click");
                let a = this.getBrowserTab(e.target);
                k.isNullOrUndefined(a) || this.fireBrowserEvent("OnNewBrowserPopup", a.name), a.extData && (n.extData = a.extData), yield this.onBrowserNewBrowserPopup(n)
            })
        }

        onNewBrowserPopupCompleted(e, t) {
            W.information(t);
            let i = {url: t, browser: e.target}, n = this.getBrowserTab(e.target);
            k.isNullOrUndefined(n) || this.fireBrowserEvent("OnNewBrowserPopupCompleted", n.name), this.onBrowserNewBrowserPopupCompleted(i)
        }

        onOpenURLFromTab(e, t, i) {
            W.information(t), W.information(i)
        }

        onAfterBrowserDestroy(e) {
            W.information(e.target)
        }

        onLoadStart(e, t, i, n) {
            W.information("OnLoadStart", t, i, n);
            let a = e.target, o = {isMainFrame: t, url: i, transitionType: n, browser: a}, r = this.getBrowserTab(a);
            k.isNullOrUndefined(r) || this.fireBrowserEvent("OnLoadStart", r.name), this.onBrowserLoadStart(o), t && this.trackBrowserEvent("browser_load_navigation_start", i)
        }

        onLoadEnd(e, t, i, n, a) {
            W.information("onLoadEnd", t, i, n, a);
            let o = e.target, r = {isMainFrame: t, url: i, frameName: n, httpStatusCode: a, browser: o},
                s = this.getBrowserTab(o);
            k.isNullOrUndefined(s) || this.fireBrowserEvent("OnLoadEnd", s.name), this.onBrowserLoadEnd(r), t && "error" !== s.state && this.trackBrowserEvent("browser_load_navigation_result", i, "result=success")
        }

        onLoadingStateChange(e, t, i, n) {
            W.information("onLoadingStateChange", t, i, n);
            let a = e.target, o = {isLoading: t, canGoBack: i, canGoForward: n, browser: a}, r = this.getBrowserTab(a);
            k.isNullOrUndefined(r) || this.fireBrowserEvent("OnLoadingStateChange", r.name), this.onBrowserLoadStatusChange(o)
        }

        onLoadError(e, t, i, n, a, o) {
            W.information("OnLoadError", t, n, a, o, i);
            let r = e.target, s = {isMainFrame: t, url: i, errorCode: n, errorText: a, failedUrl: o, browser: r},
                l = this.getBrowserTab(r);
            k.isNullOrUndefined(l) || this.fireBrowserEvent("OnLoadError", l.name), this.onBrowserLoadError(s), t && this.trackBrowserEvent("browser_load_navigation_result", i, "result=fail")
        }

        onGotFocus(e) {
            return a(this, void 0, void 0, function* () {
                let t = void 0;
                for (let i = 0; i < this.tabs.length; i++) k.isNullOrUndefined(this.tabs[i]) || k.isNullOrUndefined(this.tabs[i].tab) || (t = this.tabs[i].tab.getBrowser(), k.isNullOrUndefined(t) || e.target === t && H.emit(l.TabEventManagerNS.EventType.GotFocus, this.tabs[i].tab));
                let i = (yield(yield g.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle()).readUInt32LE(0);
                b.ThunderWindowNS.bringWindowToTop(i)
            })
        }

        onBeforeDownload(e, t, i, n, o) {
            return a(this, void 0, void 0, function* () {
                W.information("onBeforeDownload", t, i, "suggestName:", n, "mimeType", o);
                const r = ["http://lx.patch1.9you.com/xlwan/%E8%BF%85%E9%9B%B7_%E7%A5%9E%E5%BA%A7.exe"];
                let s = U.default.getConfigInfo("webgame", "directDownloadUrls");
                if (k.isArray(s) || (s = r), W.information("onBeforeDownload urlList", s), s.includes(t)) {
                    const e = F.DownloadKernelTaskManager.getTaskManager();
                    let i = yield R.TaskUtilitiesAWNS.batchFindTaskAW([{
                        taskType: M.DownloadKernel.TaskType.P2sp,
                        value: t
                    }]);
                    if (i.length > 0) {
                        let e = i[0];
                        _.MessageBox.confirm({
                            title: "重复下载，该任务已存在列表中",
                            type: _.MessageBox.ConfirmType.Warning,
                            fileName: e.getTaskName(),
                            okText: "查看",
                            cancelText: "取消",
                            cancelVisible: !0
                        }).then(t => a(this, void 0, void 0, function* () {
                            if (t.action === D.MessageBoxNS.Action.OK) {
                                let t = e.getId();
                                S.ThunderNewTask.selectTask(t)
                            } else t.action, D.MessageBoxNS.Action.Cancel
                        })).catch()
                    } else {
                        let i = L.ThunderUtil.getDefaultDownloadDir(), n = B.ParseUrlFileNameNS.getNameFromUrl(t),
                            o = {taskName: n = n.replace(/[*?/\\:|<>\"]/g, "_"), savePath: i},
                            r = {url: t, refUrl: "", cookie: "", nameFixed: 1},
                            s = yield e.createTask(M.DownloadKernel.TaskType.P2sp, {taskBaseInfo: o, p2spTaskInfo: r});
                        if (null !== s) {
                            let t = s.getTaskAttribute(M.DownloadKernel.TaskAttribute.TaskId);
                            e.startTask(t), _.MessageBox.confirm({
                                title: "任务已创建，请前往下载列表查看",
                                type: _.MessageBox.ConfirmType.Success,
                                fileName: s.getTaskName(),
                                okText: "立即查看",
                                cancelVisible: !1
                            }).then(e => a(this, void 0, void 0, function* () {
                                if (e.action === D.MessageBoxNS.Action.OK) {
                                    let e = s.getId();
                                    S.ThunderNewTask.selectTask(e)
                                }
                            })).catch()
                        }
                    }
                } else {
                    let i = this.getBrowserTab(e.target), a = i && i.getSearchFrom(),
                        o = {referer: e.target.getURL(), fileName: n, browser: "xlbrowser.exe", searchFrom: a};
                    S.ThunderNewTask.createTaskByUrl(t, o)
                }
            })
        }

        onCustomProtocalExecution(e, t) {
            let i = this.getBrowserTab(e.target), n = i && i.getSearchFrom(),
                a = {referer: e.target.getURL(), browser: "xlbrowser.exe", searchFrom: n};
            S.ThunderNewTask.createTaskByUrl(t, a)
        }

        onChromiumJsCallNativeFunction(e, t, i, n) {
            let a = {nativeCallId: 0, functionName: t, callBackId: i, browser: e.target, args: n};
            this.onJsCallNativeFunction(a)
        }

        onChromiumCheckNativeFunction(e, t, i) {
            let n = {nativeCallId: 0, functionName: t, callBackId: i, browser: e.target};
            this.onJsCheckNativeFunction(n)
        }

        onClose(e) {
            W.information("onClose");
            let t = void 0;
            for (let i = 0; i < this.allTabs.length; i++) if (!k.isNullOrUndefined(this.allTabs[i]) && !k.isNullOrUndefined(this.allTabs[i].tab) && (t = this.allTabs[i].tab.getBrowser(), !k.isNullOrUndefined(t) && e.target === t)) {
                let e = {tabInfo: this.allTabs[i], index: i};
                this.fireBrowserEvent("OnCloseBrowser", z(e, "tabInfo", "tab", "name")), this.closeTab(e);
                break
            }
        }

        onHotKey(e, t, i) {
            W.information("onHotKey", i, t);
            let n = void 0;
            for (let a = 0; a < this.tabs.length; a++) if (!k.isNullOrUndefined(this.tabs[a]) && !k.isNullOrUndefined(this.tabs[a].tab) && (n = this.tabs[a].tab.getBrowser(), !k.isNullOrUndefined(n) && e.target === n)) {
                116 === t && e.target.refresh();
                do {
                    if (4 !== i) break;
                    if (84 === t && this.handleAdd(this.current), 82 === t) {
                        let e = z(this.tabs, `${this.current}`, "tab");
                        e && e.refresh(!1)
                    }
                    87 === t && this.handleCloseTab(this.current)
                } while (0);
                break
            }
        }

        getIcon(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = new URL(e).host, n = N.ToolsUtilitiesAWNS.genarateMd5(i),
                    a = __profilesDir + "/BookMarksIcon/" + n + ".png";
                return yield this.downloadIcon(e, t, a)
            })
        }

        downloadIcon(e, t, i) {
            return a(this, void 0, void 0, function* () {
                let n = null, a = !1;
                try {
                    n = yield x.default.get(t, {responseType: "arraybuffer"})
                } catch (i) {
                    W.warning("error " + i), "ECONNRESET" === i.code && (this.updateBookMarksIconUrl({
                        url: e,
                        iconUrl: t
                    }), K.CommonSitesMgrNS.getInstance().updateItem({
                        url: e,
                        iconUrl: t
                    }, "OnFaviconURLChange"), V.historyManager.update({url: e, iconUrl: t}, "OnFaviconURLChange"))
                }
                if (null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (a = yield E.FileSystemAWNS.writeFileAW(i, n.data))) {
                    let t = {url: e, iconUrl: i};
                    this.updateBookMarksIconUrl(t), K.CommonSitesMgrNS.getInstance().updateItem({
                        url: e,
                        iconUrl: i
                    }, "OnFaviconURLChange"), V.historyManager.update({url: e, iconUrl: i}, "OnFaviconURLChange")
                }
                return a
            })
        }

        internal_openNewTab(e, t) {
            let i = {url: e};
            if (t) try {
                i = Object.assign(i, JSON.parse(t))
            } catch (e) {
                W.warning(e)
            }
            let n = {tabType: s.TabType.Chromium, tabParam: i};
            W.information("tabParam:", i), this.createNewTab(n)
        }

        openNewTab(e, t, i, n) {
            do {
                if (W.information(e), k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    let n = e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    !0 !== n && W.warning(n);
                    break
                }
                this.internal_openNewTab(n[0], n[1]), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        plugin_openNewTab(e, t, ...i) {
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                this.internal_openNewTab(i[0], i[1])
            } while (0)
        }

        internal_getTabIndexByTitleAndName(e) {
            let t = -1;
            do {
                let i = null;
                try {
                    i = JSON.parse(e)
                } catch (e) {
                    W.warning(e)
                }
                if (!i) break;
                if (void 0 !== this.tabs) for (let e = 0; e < this.tabs.length; e++) if (this.tabs[e].title === i.title && this.tabs[e].tab.name === i.name) {
                    t = e;
                    break
                }
            } while (0);
            return t
        }

        getTabIndexByTitleAndName(e, t, i, n) {
            do {
                if (W.information(e), k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    let n = e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    !0 !== n && W.warning(n);
                    break
                }
                let a = this.internal_getTabIndexByTitleAndName(n[0]);
                e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, a)
            } while (0)
        }

        plugin_getTabIndexByTitleAndName(e, t, ...i) {
            let n = -1;
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                n = this.internal_getTabIndexByTitleAndName(i[0])
            } while (0);
            return n
        }

        isVipPayUrl(e) {
            let t = !1;
            do {
                if (!e) break;
                let i = O.parse(e);
                if (!i) break;
                if ("http:" !== i.protocol && "https:" !== i.protocol) break;
                if ("pay.xunlei.com" === i.host) {
                    if (L.ThunderUtil.getQueryString(e, "referfrom")) {
                        t = !0;
                        break
                    }
                }
            } while (0);
            return t
        }

        closeCurrentTab(e, t, i, n) {
            do {
                if (W.information("closeCurrentTab", e), k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                if (e === z(this.tabs, `${this.current}`, "tab")) {
                    let e = {tabInfo: this.tabs[this.current], index: this.current};
                    this.closeTab(e)
                }
            } while (0)
        }

        tabBeforeClose(e, t, i, n) {
            do {
                if (W.information("tabBeforeClose", e), k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                let a = null;
                if (n[0]) try {
                    a = JSON.parse(n[0])
                } catch (e) {
                }
                let o = n[1];
                a && "object" == typeof a && (a = Object.assign({}, a, {
                    nativeCallId: t,
                    okCallbackId: o
                })), e.setBeforeCloseExtra(a), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success)
            } while (0)
        }

        closeTabName(e, t, i, n) {
            W.information("closeTabName args", n);
            do {
                if (k.isNullOrUndefined(e) || k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) break;
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    break
                }
                this.closeTabByName(n[0]), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success)
            } while (0)
        }

        attachTabEvent(e, t, i, n) {
            W.information("attachTabEvent args", n);
            do {
                if (k.isNullOrUndefined(e) || k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) break;
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0]) || k.isNullOrUndefined(n[1])) {
                    e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], o = {};
                o.tab = e, o.nativeCallId = t, o.tabName = n[1], o.callBackId = n[2];
                let r = this.nextListenerCookie, s = this.listenerMap.get(a);
                s || (s = new Map, this.listenerMap.set(a, s)), s.set(r, o), ++this.nextListenerCookie, W.information("attachTabEvent listenerMap", this.listenerMap, r), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, r)
            } while (0)
        }

        detachTabEvent(e, t, i, n) {
            W.information("detachEvent enter");
            do {
                if (k.isNullOrUndefined(e) || k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) break;
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0];
                W.information("detachEvent cookie:", a), this.listenerMap.forEach(e => {
                    e.delete(a)
                }), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success)
            } while (0)
        }

        internal_closeTabByIndex(e) {
            {
                let t = {tabInfo: this.tabs[e], index: e};
                this.closeTab(t), this.$root.$emit("tab.closeTab", t)
            }
        }

        closeTabByIndex(e, t, i, n) {
            do {
                if (k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                const a = n[0];
                if (k.isNullOrUndefined(a)) break;
                this.internal_closeTabByIndex(a), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, {
                    tabs: this.tabs,
                    current: this.current
                })
            } while (0)
        }

        plugin_closeTabByIndex(e, t, ...i) {
            let n = void 0;
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                this.internal_closeTabByIndex(i[0]), n = {tabs: this.tabs, current: this.current}
            } while (0);
            return n
        }

        isTabSelected(e, t, i, n) {
            let a = !1;
            do {
                if (W.information("isTabSelected tab:", e), k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                e === z(this.tabs, `${this.current}`, "tab") && (a = !0), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, a)
            } while (0);
            return a
        }

        selectTabByIndex(e, t, i, n) {
            do {
                if (W.information("selectTabByIndex", e), k.isNullOrUndefined(e)) {
                    W.warning(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    W.warning(t, i);
                    break
                }
                let a = n[0];
                W.information("selectTabByIndex index", a), this.selectTab(a), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        plugin_selectTabByIndex(e, t, ...i) {
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                let t = i[0];
                this.selectTab(t)
            } while (0)
        }

        resizeCurrentBrowserWindow() {
            do {
                if (0 === this.tabs.length) break;
                let e = z(this.tabs, `${this.current}`, "tab");
                if (k.isNullOrUndefined(e)) break;
                if (e.getTabType() === s.TabType.Chromium) {
                    let t = e.getBrowser();
                    if (k.isNullOrUndefined(t)) break;
                    if (!0 === e.isErrorPage) break;
                    let i = t.getWindowHandle();
                    if (!1 === G.isWindowHandle(i)) {
                        W.warning(i);
                        break
                    }
                    d.BrowserSupportNS.resizeBrowserWindow(i)
                }
            } while (0)
        }

        handleTotalClick(e) {
            return a(this, void 0, void 0, function* () {
                if (this.totalTabsOpened) return;
                const t = e.currentTarget.getBoundingClientRect(), i = e.currentTarget.cloneNode();
                if (i.style.position = "fixed", i.style.zIndex = "100", i.style.opacity = "0", i.style.top = t.top + "px", i.style.left = t.left + "px", i.style.marginTop = "0", this.totalTabsCreated) document.body.appendChild(i), this.appendChild = i, f.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)
                    }
                }); else {
                    this.totalTabsOpened = this.totalTabsCreated = !0, document.body.appendChild(i), this.appendChild = 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
                    }), (yield g.asyncRemoteCall.getIpcMain()).on("total-tabs-hide", () => {
                        this.totalTabsOpened = !1, this.appendChild && (document.body.removeChild(this.appendChild), this.appendChild = null)
                    })
                }
            })
        }
    };
    n([o.Prop({})], j.prototype, "bookMarks", void 0), n([o.Prop({})], j.prototype, "currentCategoryId", void 0), n([o.Prop({})], j.prototype, "currentTab", void 0), n([o.Prop({})], j.prototype, "tabs", void 0), n([o.Prop({})], j.prototype, "allTabs", void 0), n([o.Prop({})], j.prototype, "unread", void 0), n([o.Prop({})], j.prototype, "updateBookMarksIconUrl", void 0), n([o.Prop({})], j.prototype, "createNewTab", void 0), n([o.Prop({})], j.prototype, "onBrowserBindWindowHandle", void 0), n([o.Prop({})], j.prototype, "onBrowserTitleChange", void 0), n([o.Prop({})], j.prototype, "onBrowserFavIconChange", void 0), n([o.Prop({})], j.prototype, "onBrowserLoadStatusChange", void 0), n([o.Prop({})], j.prototype, "onBrowserAddressChange", void 0), n([o.Prop({})], j.prototype, "onBrowserNewBrowserPopup", void 0), n([o.Prop({})], j.prototype, "onBrowserNewBrowserPopupCompleted", void 0), n([o.Prop({})], j.prototype, "onBrowserLoadStart", void 0), n([o.Prop({})], j.prototype, "onBrowserLoadEnd", void 0), n([o.Prop({})], j.prototype, "onBrowserLoadError", void 0), n([o.Prop({})], j.prototype, "selectTab", void 0), n([o.Prop({})], j.prototype, "closeTab", void 0), n([o.Prop({})], j.prototype, "closeTabByName", void 0), n([o.Prop({})], j.prototype, "removeTabCtrl", void 0), n([o.Prop({})], j.prototype, "onCreateNewTab", void 0), n([o.Prop({})], j.prototype, "onAppQuit", void 0), n([o.Prop({})], j.prototype, "onJsCallNativeFunction", void 0), n([o.Prop({})], j.prototype, "onJsCheckNativeFunction", void 0), n([o.Prop({default: "transparent"})], j.prototype, "background", void 0), n([o.Prop({default: 0})], j.prototype, "current", void 0), n([o.Prop({})], j.prototype, "updateCurrent", void 0), n([o.Prop({})], j.prototype, "updateTabs", void 0), n([o.Prop({})], j.prototype, "currentNav", void 0), n([o.Watch("tabs", {deep: !0})], j.prototype, "onTabsUpdated", null), n([o.Watch("current")], j.prototype, "onCurrentUpdated", null), n([o.Watch("currentNav")], j.prototype, "onCurrentNavChange", null), n([o.Watch("current")], j.prototype, "onCurrentTabChange", null), j = n([o.Component({
        filters: {unread: y.unread},
        components: {HomePage: r.default, BrowserViewContainer: () => Promise.resolve().then(() => i(675))}
    })], j), t.default = j
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(185), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(671), a = i(28);
    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"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(187), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(11), r = i(2), s = i(8), l = i(71), d = i(481), u = i(0), c = i(84),
        h = u.default.getLogger("home-page"), f = i(27), g = i(144);
    let p = class extends s.Vue {
        constructor() {
            super(...arguments), this.elementId = "home-1EAC214F-7644-4163-9EB8-AF4BAA62D144"
        }

        indexOfTab(e) {
            let t = -1;
            for (let i = 0; i < this.tabs.length; i++) if (this.tabs[i].tab.getTabType() === l.TabType.Chromium && this.tabs[i].tab.getOriginalUrl() === e) {
                t = i;
                break
            }
            return t
        }

        mounted() {
            this.enableDevTools(), this.initNativeCall()
        }

        enableDevTools() {
            window.addEventListener("keyup", e => {
                "F12" === e.key && e.shiftKey && c.DevEnvHelperNS.isDevToolsEnable() && this.$refs.webview.openDevTools()
            }, !0)
        }

        initNativeCall() {
            return a(this, void 0, void 0, function* () {
                let e = d.default.getPluginUpdater(r.join(__rootDir, "plugins/ThunderXWebXDAS"));
                f.NativeCallHostModule.nativeCallHost.initialize();
                let t = yield e.getCurFilePath();
                h.information("url", t), this.onMounted(`file:///${r.join(t, "index.html")}`), e.active();
                const n = document.querySelector(`#${this.elementId}`);
                n.addEventListener("new-window", e => {
                    let t = e.url;
                    const n = i(46).parse(t).protocol;
                    if ("http:" === n || "https:" === n) {
                        let e = {tabType: l.TabType.Chromium, tabParam: {url: t}};
                        this.createNewTab(e)
                    }
                });
                let s = void 0;
                n.addEventListener("did-finish-load", e => a(this, void 0, void 0, function* () {
                    if (global.__homepageWebviewReady = !0, !s && !n.isLoading) {
                        let e = n.getWebContentsId(), t = yield o.asyncRemoteCall.getWebContents();
                        (s = yield t.fromId(e)).on("context-menu", (e, t) => {
                            g.ContextMenuNS.popContextMenu(e, t)
                        })
                    }
                }))
            })
        }
    };
    n([s.Prop({})], p.prototype, "tabs", void 0), n([s.Prop({})], p.prototype, "homePageUrl", void 0), n([s.Prop({})], p.prototype, "preloadPath", void 0), n([s.Prop({})], p.prototype, "onMounted", void 0), n([s.Prop({})], p.prototype, "createNewTab", void 0), n([s.Prop({})], p.prototype, "selectTab", void 0), p = n([s.Component], p), t.default = p
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(189), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(676), a = i(28);
    t.default = a.connector.connect({mapGettersToProps: {currentTab: e => e.currentTab}})(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(191), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(4), r = i(67);
    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)
        }

        isDownloadTab() {
            return "" === r(this.currentTab, "tab", "url") && "下载" === r(this.currentTab, "title")
        }

        get isError() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isErrorPage")
        }

        get isLoading() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isLoadingPage")
        }
    };
    n([a.Prop({})], s.prototype, "currentTab", void 0), s = n([a.Component({components: {Loading: () => Promise.resolve().then(() => i(509))}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(193), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(681), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {preloadPath: e => `file:///${__rootDir}/out/plugin-boot.js`},
        mapCommitToProps: {onMounted: "ON_MOUNTED", createNewTab: "CREATE_NEW_TAB"},
        mapDispatchToProps: {selectTab: "selectTab"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(195), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(11), r = i(8), s = i(84), l = i(27), d = i(144), u = i(4);
    let c = class extends r.Vue {
        mounted() {
            return a(this, void 0, void 0, function* () {
                this.enableDevTools(), this.initNativeCall()
            })
        }

        enableDevTools() {
            window.addEventListener("keyup", e => {
                "F12" === e.key && e.shiftKey && s.DevEnvHelperNS.isDevToolsEnable() && this.$refs.messagePage.openDevTools()
            }, !0)
        }

        initNativeCall() {
            return a(this, void 0, void 0, function* () {
                let e;
                l.NativeCallHostModule.nativeCallHost.initialize(), u.isNullOrUndefined(this.elementId) || "" === this.elementId || (e = document.querySelector(`#${this.elementId}`)), e || (e = this.$refs.messagePage);
                let t = void 0;
                e.addEventListener("did-finish-load", i => a(this, void 0, void 0, function* () {
                    if (!t) {
                        let i = e.getWebContentsId(), n = yield o.asyncRemoteCall.getWebContents();
                        (t = yield n.fromId(i)).on("context-menu", (e, t) => {
                            d.ContextMenuNS.popContextMenu(e, t)
                        })
                    }
                }))
            })
        }
    };
    n([r.Prop()], c.prototype, "elementId", void 0), n([r.Prop()], c.prototype, "messagePageUrl", void 0), n([r.Prop({})], c.prototype, "preloadPath", void 0), c = n([r.Component], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(197), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(4), r = i(67);
    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)
        }

        isDownloadTab() {
            return "" === r(this.currentTab, "tab", "url") && "下载" === r(this.currentTab, "title")
        }

        get isError() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isErrorPage")
        }

        get isLoading() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isLoadingPage")
        }
    };
    n([a.Prop({})], s.prototype, "currentTab", void 0), s = n([a.Component({components: {Loading: () => Promise.resolve().then(() => i(509))}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(199), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(686), a = i(28);
    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,
            localDownloadingTaskBaseList: e => {
                let t = [], i = e.DownloadListState.taskList[0].tasksMap;
                return t = (t = [...Object.values(i)]).filter(e => -1 === e.categoryId)
            },
            localCompletedTaskBaseList: e => {
                let t = [], i = e.DownloadListState.taskList[1].tasksMap;
                return t = (t = [...Object.values(i)]).filter(e => -1 === e.categoryId)
            }
        },
        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",
            UPDATE_VIP_SPEED_STATUS: "UPDATE_VIP_SPEED_STATUS",
            UPDATE_DEFAULT_SPEED_STATUS: "UPDATE_DEFAULT_SPEED_STATUS",
            initPanCategoryTaskList: "INIT_PAN_CATEGORY_TASKLIST",
            uninitPanCategoryTaskList: "UNINIT_PAN_CATEGORY_TASKLIST"
        },
        mapDispatchToProps: {selectTab: "selectTab"},
        mapGettersToProps: {downloadingOrder: e => e.downloadingOrder, canStartAll: e => e.canStartAll}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(201), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(18), r = i(13), s = i(0), l = i(11), d = i(8), u = i(687), c = i(694), h = i(699), f = i(702),
        g = i(705), p = i(706), v = i(707), m = i(769), y = i(783), k = i(784), T = i(3), w = i(26), C = i(86),
        S = i(14), I = i(106), b = i(65), _ = i(17), D = i(32), A = i(29), N = i(53), x = i(5), E = i(44), P = i(31),
        O = i(15), M = i(482), F = i(12), L = i(786), R = i(89), B = i(90), U = i(105), K = i(23), V = i(16), W = i(10),
        G = i(364), H = i(24), z = i(121), j = i(9), X = s.default.getLogger("DownloadPanel"),
        $ = U.PluginWebviewMgrNS.getWebViewMgr(), Y = F.DownloadKernelTaskManager.getTaskManager(),
        q = O.DownloadKernelEventManager.getEventManager(), J = w.DownloadKernelCategoryManager.getCategoryManager(),
        Z = M.DownloadKernelUpgradeNS.getUpgrade();
    let Q = !1, {throttle: ee} = r.ThunderUtil, te = class extends d.Vue {
        constructor() {
            super(...arguments), this.adShow = !1, this.isFengxingAdShow = !1, this.removeCategoryCookie = -1, this.leftBottomAdShow = !1, this.canLeftBottomAdShow = !1, this.isSearch = !1, this.taskDbLoadFinished = !1, this.taskDbLoadCookie = void 0, this.curUserId = "", this.vipInfo = {}
        }

        onCurUserIdChange() {
            if ("" === this.curUserId) this.uninitPanCategoryTaskList(); else {
                let e = J.getCategoryFromUserId("ThunderPanPlugin", this.curUserId, "ThunderPan Download Category"),
                    t = null;
                e && (t = e.getCategoryData()), t && this.initPanCategoryTaskList(t.categoryId)
            }
        }

        onIsSearchChange(e) {
            this.$emit("show-download-list-search", e)
        }

        onCacheDownloadingSkeleton(e) {
            ee(() => {
                if (this.localDownloadingTaskBaseList && this.localDownloadingTaskBaseList.length > 0) {
                    let e = [...this.localDownloadingTaskBaseList];
                    e.sort(z.SortNS.getSortFuncByConfig(T.DownloadKernel.CategroyViewID.Downloading, -1)), localStorage.setItem("skeleton_downloading", JSON.stringify([{count: e.length}, ...e.slice(0, 15)]))
                } else localStorage.removeItem("skeleton_downloading")
            }, 1500)()
        }

        onCacheCompletedSkeleton(e) {
            ee(() => {
                if (this.localCompletedTaskBaseList && this.localCompletedTaskBaseList.length > 0) {
                    let e = [...this.localCompletedTaskBaseList];
                    e.sort(z.SortNS.getSortFuncByConfig(T.DownloadKernel.CategroyViewID.Completed, -1)), localStorage.setItem("skeleton_completed", JSON.stringify([{count: e.length}, ...e.slice(0, 15)]))
                } else localStorage.removeItem("skeleton_completed")
            }, 1500)()
        }

        onTabSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                R.setCurrentTabID(e), V.server.fireClientEvent("OnThunderTabSelectChange", e), this.tryRestorePrivate()
            })
        }

        onCategoryChange(e, t) {
            if (-1 !== e) {
                let t = J.getCategoryFromId(e);
                if (t) {
                    W.XLStatNS.trackEvent("download_leftpanel", "private_page_show", "", 0, 0, 0, 0, "");
                    let i = J.getCategoryView(e, T.DownloadKernel.CategroyViewID.Downloading), n = i.getTaskCount();
                    n += (i = J.getCategoryView(e, T.DownloadKernel.CategroyViewID.Completed)).getTaskCount();
                    let a = t.getPassword();
                    if ((!a || "" === a) && 0 === n) return void this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!0)
                }
            }
            this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
        }

        onDownloadingOrderChange(e) {
            Y.isLoadStorageTaskFinish() && E.DownloadDispatchNS.updateTasksOrder(e)
        }

        onCanStartAll(e) {
            o.ipcRenderer.send("can-start-all-task", e)
        }

        onShowLeftBottomAdChange(e) {
            e && G.adLeftBottomHelper.handleEvent("ad_show"), this.$nextTick(() => {
                $.updateTaskAdWebview()
            })
        }

        get bShowLeftBottomAd() {
            return !this.isFengxingAdShow && this.leftBottomAdShow && this.canLeftBottomAdShow
        }

        handleLeftBottomAdShow(e) {
            this.leftBottomAdShow = e
        }

        handleAdShow(e) {
            this.adShow = e, this.currentCategoryViewId === T.DownloadKernel.CategroyViewID.Downloading && this.$nextTick(() => {
                $.updateTaskAdWebview()
            })
        }

        get isShowPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        myComputer() {
            -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1)
        }

        keydownShowSearchUI(e) {
            if (e.ctrlKey && 70 === e.keyCode) ; else if (e.ctrlKey && 65 === e.keyCode) this.isSearch || this.$refs.downloadlist.selectAll(); else if (27 === e.keyCode) {
                if (this.isShowPrivateSpace) return;
                this.closeSearchUI(), this.$nextTick(() => {
                    this.$refs.downloadlist.$el.focus()
                })
            } else !this.isSearch && e.ctrlKey
        }

        closeSearchUI() {
            this.isSearch = !1, this.currentCategoryViewId === T.DownloadKernel.CategroyViewID.Downloading && this.$nextTick(() => {
                $.updateTaskAdWebview()
            })
        }

        keyOpenSearchUI() {
            W.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.openSearchUI()
        }

        openSearchUI() {
            this.isShowPrivateSpace || (this.isSearch = !0)
        }

        isVipUser() {
            return a(this, void 0, void 0, function* () {
                let e = !1;
                if (yield K.LoginHelperNS.loginHelper.isLoginedAw()) {
                    "0" !== (yield K.LoginHelperNS.loginHelper.getUserInfoByKeyAw("isVip", "vip_xl")) && (e = !0)
                }
                return e
            })
        }

        privateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield b.default(!1, !0, "privatespace");
                if (e && "" !== e) {
                    let t = J.getPrivateCategoryFromUserId(e);
                    if (t && this.currentCategoryId !== t.getId()) {
                        0 === (yield C.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, i, n) {
            return a(this, void 0, void 0, function* () {
                this.isSearch = !1;
                let a = yield l.asyncRemoteCall.getCurrentWindow();
                if (n && ((yield a.isMinimized()) && (yield a.restore()), yield a.show(), 0 !== this.currentTabId && this.selectTab(0)), (yield x.client.callServerFunction("GetCurrentNav")) !== N.NavViewID.Download && (yield x.client.callServerFunction("SelectNav", N.NavViewID.Download)), this.currentCategoryId !== e) if (-1 !== e && J.isPrivateCategory(e)) {
                    let t = yield x.client.callServerFunction("GetUserID");
                    if (0 !== (yield C.PrivateSpaceHelperNS.accessPrivateCategory(t))) return;
                    this.UPDATE_CATEGORY(e)
                } else this.UPDATE_CATEGORY(-1);
                this.$nextTick(() => {
                    this.currentCategoryViewId !== t && this.UPDATE_CATEGORYVIEW(t), this.$refs.downloadlist.selectTask(t, i)
                })
            })
        }

        handleOpenSearchPage(e) {
            if (e) {
                let e = "entry=morelist";
                W.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, e), this.openSearchUI()
            } else this.closeSearchUI()
        }

        needUpgradeTask() {
            return a(this, void 0, void 0, function* () {
                let e = "", t = 0, i = yield l.asyncRemoteCall.getProcess();
                for (let n = 0; n < i.argv.length; n++) {
                    if (0 === i.argv[n].indexOf("-StartType:")) e = i.argv[n].substr("-StartType:".length); else {
                        if (0 === i.argv[n].indexOf("-PreVersion:")) {
                            let e = i.argv[n].substr("-PreVersion:".length), a = e.indexOf(".");
                            a && (e = e.substr(0, a)) && (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), C.PrivateSpaceHelperNS.setNeedPassword(!0), -1 !== this.currentCategoryId && (Q = !0)
        }

        tryRestorePrivate() {
            Q && 0 === this.currentTabId && (Q = !1, this.handleMenuClick("private_space"))
        }

        created() {
            return a(this, void 0, void 0, function* () {
                C.PrivateSpaceHelperNS.init(), this.onLogoutEventId = _.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1);
                    let t = J.getPrivateCategoryFromUserId(e);
                    t && D.TaskOperatorNs.pauseCategoryAllTask(t.getId(), T.DownloadKernel.TaskStopReason.PrivateLoginOut), this.canLeftBottomAdShow = !1, this.curUserId = "", this.vipInfo = {}
                });
                let e = yield l.asyncRemoteCall.getCurrentWindow();
                e.on("hide", () => {
                    this.protectPrivate()
                }), e.on("minimize", () => {
                    this.protectPrivate()
                }), o.ipcRenderer.on("main-window-state-active-show", () => {
                    this.tryRestorePrivate()
                }), I.downloadContextMenu.attachListener(S.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), A.default.attachListener(S.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), A.default.attachListener(S.NodeEventMesssageNS.eventShowSearchTaskPage, this.handleOpenSearchPage), P.DownloadKernelManager.attachListener(S.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => a(this, void 0, void 0, function* () {
                    (yield this.needUpgradeTask()) && Z.init() && (Z.attachListener(Z.eventUpgradeProgress, this.onUpgradeProgress), Z.startUpgrade());
                    const {LoginHelperNS: e} = yield Promise.resolve().then(() => i(23));
                    this.onLoginEventId = _.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", t => {
                        Z.init() && Z.upgradePrivateSpace(t), e.loginHelper.getAllUserInfo(e => {
                            this.setUserVipAdConfig(e).catch()
                        }), this.curUserId = t
                    }), this.onUserInfoChangeCookie = _.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (t, i) => {
                        "vipinfo" === t && e.loginHelper.getAllUserInfo(e => {
                            this.setUserVipAdConfig(e).catch()
                        })
                    }), (yield e.loginHelper.isLoginedAw()) && e.loginHelper.getAllUserInfo(e => {
                        Z.init() && e && Z.upgradePrivateSpace(e.userID), this.setUserVipAdConfig(e).catch(), this.curUserId = e.userID
                    })
                })), x.client.attachServerEvent("fengxing_ad_show", (e, t) => {
                    this.isFengxingAdShow = t, this.currentCategoryViewId === T.DownloadKernel.CategroyViewID.Downloading && this.$nextTick(() => {
                        $.updateTaskAdWebview()
                    })
                })
            })
        }

        setUserVipAdConfig(e) {
            return a(this, void 0, void 0, function* () {
                if (!e || !e.vipList || !e.vipList[0]) return;
                this.vipInfo = e.vipList[0];
                let t = e.vipList[0], i = Number(t.isVip), n = H.default.getConfigInfo("cooperateAd", "allShow");
                0 !== i && 1 !== n && ((yield G.adLeftBottomHelper.isNoDisturb()) || (this.canLeftBottomAdShow = !0))
            })
        }

        onUpdateVipTaskStatus(e) {
            this.UPDATE_VIP_SPEED_STATUS(e)
        }

        onDefaultVipTaskStatus(e) {
            this.UPDATE_DEFAULT_SPEED_STATUS(e)
        }

        onTaskDataBaseLoadEnd() {
            let e = j.ConfigNS.isInitConfigFinished();
            X.information("[skeleton] onTaskDataBaseLoadEnd", e), e ? this.$nextTick(() => {
                this.taskDbLoadFinished = !0
            }) : j.ConfigNS.attachListener(S.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.taskDbLoadFinished = !0
            })
        }

        mounted() {
            this.taskDbLoadFinished = Y.isLoadStorageTaskFinish(), this.taskDbLoadFinished || (this.taskDbLoadCookie = 1, P.DownloadKernelManager.attachListener(S.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), B.PluginFunctionUINS.on("update_vip_task_status", this.onUpdateVipTaskStatus.bind(this)), B.PluginFunctionUINS.on("init_vip_task_status", this.onDefaultVipTaskStatus.bind(this)), this.removeCategoryCookie = q.attachTaskEvent(T.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== T.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (e[2] !== T.DownloadKernel.CategroyViewID.Downloading) break;
                    let t = e[3], i = {};
                    for (let e of t) i[e.getId()] = null;
                    this.UPDATE_VIP_SPEED_STATUS(i)
                } while (0)
            })
        }

        destroyed() {
            this.taskDbLoadCookie && (this.taskDbLoadCookie = void 0, P.DownloadKernelManager.detachListener(S.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), B.PluginFunctionUINS.removeListener("update_vip_task_status", this.onUpdateVipTaskStatus.bind(this)), B.PluginFunctionUINS.removeListener("init_vip_task_status", this.onDefaultVipTaskStatus.bind(this)), -1 !== this.removeCategoryCookie && (q.detachTaskEvent(T.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeCategoryCookie), this.removeCategoryCookie = -1), C.PrivateSpaceHelperNS.uninit(), void 0 !== this.onLogoutEventId && (_.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.onLogoutEventId), this.onLogoutEventId = void 0), void 0 !== this.onLoginEventId && (_.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginEventId), this.onLoginEventId = void 0), void 0 !== this.onUserInfoChangeCookie && (_.NativeCallModule.nativeCall.DetachNativeEvent("onUserInfoChange", this.onUserInfoChangeCookie), this.onUserInfoChangeCookie = void 0), I.downloadContextMenu.detachListener(S.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), A.default.detachListener(S.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), Z.detachListener(Z.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    n([d.Prop({})], te.prototype, "currentTabId", void 0), n([d.Prop({})], te.prototype, "currentCategoryId", void 0), n([d.Prop({})], te.prototype, "currentCategoryViewId", void 0), n([d.Prop({})], te.prototype, "showPrivateSpaceOpenPage", void 0), n([d.Prop({})], te.prototype, "showUpgradeTask", void 0), n([d.Prop({})], te.prototype, "downloadingOrder", void 0), n([d.Prop({})], te.prototype, "canStartAll", void 0), n([d.Prop({})], te.prototype, "localDownloadingTaskBaseList", void 0), n([d.Prop({})], te.prototype, "localCompletedTaskBaseList", void 0), n([d.Prop({})], te.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), n([d.Prop({})], te.prototype, "SHOW_UPGRADE_TASK", void 0), n([d.Prop({})], te.prototype, "selectTab", void 0), n([d.Prop({})], te.prototype, "UPDATE_CATEGORY", void 0), n([d.Prop({})], te.prototype, "UPDATE_CATEGORYVIEW", void 0), n([d.Prop({})], te.prototype, "UPDATE_VIP_SPEED_STATUS", void 0), n([d.Prop({})], te.prototype, "UPDATE_DEFAULT_SPEED_STATUS", void 0), n([d.Prop()], te.prototype, "uninitPanCategoryTaskList", void 0), n([d.Prop()], te.prototype, "initPanCategoryTaskList", void 0), n([d.Watch("curUserId")], te.prototype, "onCurUserIdChange", null), n([d.Watch("isSearch")], te.prototype, "onIsSearchChange", null), n([d.Watch("localDownloadingTaskBaseList")], te.prototype, "onCacheDownloadingSkeleton", null), n([d.Watch("localCompletedTaskBaseList")], te.prototype, "onCacheCompletedSkeleton", null), n([d.Watch("currentTabId")], te.prototype, "onTabSelectChange", null), n([d.Watch("currentCategoryId", {immediate: !0})], te.prototype, "onCategoryChange", null), n([d.Watch("downloadingOrder", {immediate: !0})], te.prototype, "onDownloadingOrderChange", null), n([d.Watch("canStartAll")], te.prototype, "onCanStartAll", null), n([d.Watch("bShowLeftBottomAd")], te.prototype, "onShowLeftBottomAdChange", null), te = n([d.Component({
        components: {
            ToolBarContainer: u.default,
            DownloadListContainer: m.default,
            PrivateSpaceOpenPageContainer: k.default,
            DownloadSearchContainer: L.default,
            UpgradeTaskContainer: h.default,
            ToastNotify: f.default,
            StatusBarContainer: c.default,
            AdPlatformCtrl: g.default,
            AdLeftBottom: p.default,
            TaskDetail: v.default,
            DownloadListSkeleton: y.default
        }
    })], te), t.default = te
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(203), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(688), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            downloadingButtons: e => e.ToolbarState.downloadingButtons,
            completedButtons: e => e.ToolbarState.completedButtons,
            recycleButtons: e => e.ToolbarState.recycleButtons,
            privateDownloadingButtons: e => e.ToolbarState.privateDownloadingButtons,
            privateCompletedButtons: e => e.ToolbarState.privateCompletedButtons
        }, mapDispatchToProps: {attachToolbarEvent: "attachToolbarEvent"}, mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(205), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(0), s = i(5), l = i(10), d = i(22), u = i(3), c = i(689), h = i(691), f = i(475), g = i(109),
        p = i(9), v = i(66), m = i(463), y = i(15), k = i(4), T = i(24),
        w = y.DownloadKernelEventManager.getEventManager(), C = r.default.getLogger("tool-bar");
    let S = class extends o.Vue {
        constructor() {
            super(...arguments), this.timerId = -1, this.vipButtonPluginEnable = -1, this.lastMobileQRCode = "", this.syncStateChangedCookie = null, this.shouleiSyncState = "offline", this.shouleiButtonNewIcon = !1, this.shouleiButtonTooltip = !1, this.taskCreatedCookie = void 0
        }

        get toolbarButtons() {
            let e = [];
            return -1 === this.currentCategoryId ? this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Downloading ? e = this.downloadingButtons : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Completed ? e = this.completedButtons : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Recycle && (e = this.recycleButtons) : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Downloading ? e = this.privateDownloadingButtons : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Completed && (e = this.privateCompletedButtons), e
        }

        onShouleiButtonClick() {
            if (this.shouleiButtonNewIcon) {
                this.shouleiButtonNewIcon = !1;
                let e = v.TimeHelperNS.formatDate(new Date, "yyyy-MM-dd");
                p.ConfigNS.setValue("ShouleiDownload", "SyncButtonNewClickDate", e), setTimeout(() => {
                    s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
                }, 0)
            }
            let e = "status=" + ("online" === this.shouleiSyncState ? "connected" : "disconnected");
            l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_click", "", 0, 0, 0, 0, e), d.MessageBox.custom("shoulei-sync-guide", {
                type: "online" === this.shouleiSyncState ? "remoting" : "open",
                sfrom: "list",
                statFrom: "top_icon"
            }).catch()
        }

        onShouleiButtonTooltipClose() {
            this.shouleiButtonTooltip = !1, setTimeout(() => {
                s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
            }, 0), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_toast_click", "", 0, 0, 0, 0, "button=close")
        }

        onShouleiButtonTooltipClick() {
            this.shouleiButtonTooltip = !1, this.shouleiButtonNewIcon = !1, d.MessageBox.custom("shoulei-sync-guide", {
                type: "online" === this.shouleiSyncState ? "remoting" : "open",
                sfrom: "list",
                statFrom: "icon_toast"
            }).catch(), setTimeout(() => {
                s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
            }, 0), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_toast_click", "", 0, 0, 0, 0, "button=bubble")
        }

        getShouleiButtonInfo() {
            return {
                id: "mobile-sync",
                onClick: this.onShouleiButtonClick.bind(this),
                onTooltipClose: this.shouleiButtonTooltip ? this.onShouleiButtonTooltipClose.bind(this) : null,
                onTooltipClick: this.shouleiButtonTooltip ? this.onShouleiButtonTooltipClick.bind(this) : null,
                position: 1,
                tooltipTitle: "手机可以遥控电脑下载啦！",
                tooltipSubTitle: "回家直接看大片",
                imgSrc: "online" === this.shouleiSyncState ? "xdas://res/xlx-icon-control" : "xdas://res/xlx-icon-control is-animation",
                title: "online" === this.shouleiSyncState ? "手机遥控下载中" : "手机遥控下载",
                loading: "online" === this.shouleiSyncState,
                newIcon: "online" !== this.shouleiSyncState && this.shouleiButtonNewIcon,
                tooltip: this.shouleiButtonTooltip
            }
        }

        detachTaskCreated() {
            this.taskCreatedCookie && (w.detachTaskEvent(u.DownloadKernel.TaskEventType.TaskCreated, this.taskCreatedCookie), this.taskCreatedCookie = void 0)
        }

        onTaskCreated(e, t) {
            do {
                if (e !== u.DownloadKernel.TaskEventType.TaskCreated || !t || t.length <= 0) break;
                if ("online" === this.shouleiSyncState) break;
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (!i) continue;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background)) continue;
                    if (-1 !== i.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryId)) continue;
                    this.detachTaskCreated();
                    let n = v.TimeHelperNS.formatDate(new Date, "yyyy-MM-dd");
                    p.ConfigNS.setValue("ShouleiDownload", "SyncButtonToolTip", n), this.shouleiButtonTooltip = !0, s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo()), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_toast_show");
                    break
                }
            } while (0)
        }

        addShouleiButton() {
            return a(this, void 0, void 0, function* () {
                const e = g.ShouleiListSyncNS.getMananger();
                if (yield e.enable()) {
                    this.shouleiSyncState = e.getState();
                    let t = T.default.getConfigInfo("shouleiDownload", "enableSyncNewIcon"),
                        i = T.default.getConfigInfo("shouleiDownload", "syncNewIconLimitTimes") || 1,
                        n = p.ConfigNS.getValue("ShouleiDownload", "SyncButtonNewTimes", 0);
                    if (k.isNullOrUndefined(t) || 1 === t) {
                        let e = v.TimeHelperNS.formatDate(new Date, "yyyy-MM-dd");
                        this.shouleiButtonNewIcon = p.ConfigNS.getValue("ShouleiDownload", "SyncButtonNewClickDate", "") !== e, this.shouleiButtonNewIcon && (n < i ? p.ConfigNS.getValue("ShouleiDownload", "SyncButtonShowDate", "") !== e && (p.ConfigNS.setValue("ShouleiDownload", "SyncButtonNewTimes", n + 1), p.ConfigNS.setValue("ShouleiDownload", "SyncButtonShowDate", e)) : n === i ? p.ConfigNS.getValue("ShouleiDownload", "SyncButtonShowDate", "") !== e && (this.shouleiButtonNewIcon = !1) : this.shouleiButtonNewIcon = !1)
                    }
                    s.client.callServerFunction("CreateButton", "toolbar_button", this.getShouleiButtonInfo()), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_show"), this.syncStateChangedCookie = e.attachEvent("OnConnectStateChanged", e => {
                        this.shouleiSyncState = e, s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
                    })
                } else m.getMobileImgSrc().then(e => {
                    if (C.information("getMobileImgSrc", e), e) {
                        this.lastMobileQRCode = e;
                        let t = {
                            id: "mobile",
                            imgSrc: `${__rootDir}/static/icon/mobile_xl.png`,
                            title: "手机迅雷",
                            onClick: () => {
                                l.XLStatNS.trackEvent("download_leftpanel", "top_shoulei_icon_click"), d.MessageBox.custom("img-dlg", {
                                    src: this.lastMobileQRCode,
                                    width: 400,
                                    height: 276
                                }, {width: 400, height: 276}).catch()
                            },
                            position: 4
                        };
                        l.XLStatNS.trackEvent("download_leftpanel", "top_shoulei_icon_show"), s.client.callServerFunction("CreateButton", "toolbar_button", t)
                    }
                })
            })
        }

        mounted() {
            this.attachToolbarEvent(), f.VipPluginSwitchConfigNS.getToolbarVipButtonEnable().then(e => {
                this.vipButtonPluginEnable = e
            }), setTimeout(() => {
                this.addShouleiButton().catch()
            }, 2e3);
            this.timerId = setInterval(() => {
                m.getMobileImgSrc().catch()
            }, 36e5)
        }

        destroyed() {
            if (-1 !== this.timerId && (clearInterval(this.timerId), this.timerId = -1), this.syncStateChangedCookie) {
                g.ShouleiListSyncNS.getMananger().detachEvent("OnConnectStateChanged", this.syncStateChangedCookie), this.syncStateChangedCookie = null
            }
            this.detachTaskCreated()
        }
    };
    n([o.Prop({})], S.prototype, "currentCategoryId", void 0), n([o.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], S.prototype, "downloadingButtons", void 0), n([o.Prop({})], S.prototype, "completedButtons", void 0), n([o.Prop({})], S.prototype, "recycleButtons", void 0), n([o.Prop({})], S.prototype, "privateDownloadingButtons", void 0), n([o.Prop({})], S.prototype, "privateCompletedButtons", void 0), n([o.Prop({})], S.prototype, "attachToolbarEvent", void 0), S = n([o.Component({
        components: {
            ToolBarButtonContainer: c.default,
            ToolBarVipButtonContainer: h.default
        }
    })], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(207), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(690), a = i(28);
    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}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(209), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
        constructor() {
            super(...arguments), this.disabled = !1
        }

        get customClass() {
            let e = "";
            do {
                if (this.imgSrc && "" !== this.imgSrc) {
                    let t = "xdas://res/";
                    0 === this.imgSrc.indexOf(t) && (e = this.imgSrc.substr(t.length));
                    break
                }
                e = this.id
            } while (0);
            return e
        }

        onSelectChange(e) {
            let t = this.buttonClassFilter;
            this.buttonClassFilter || (t = (() => ""));
            let i = t(this);
            i.then ? i.then(e => {
                this.disabled = "" !== e
            }) : this.disabled = "" !== i
        }

        handleClick(e) {
            this.disabled || this.click(e, this)
        }

        handleToolTipClose(e) {
            this.tooltipClose && this.tooltipClose(e, this)
        }

        handleToolTipClick(e) {
            this.tooltipClick && this.tooltipClick(e, this)
        }

        handleEnter(e) {
            this.disabled || this.enter && this.enter()
        }
    };
    n([a.Prop({})], o.prototype, "redDot", void 0), n([a.Prop({})], o.prototype, "imgSrc", void 0), n([a.Prop({})], o.prototype, "title", void 0), n([a.Prop({})], o.prototype, "id", void 0), n([a.Prop({})], o.prototype, "newIcon", void 0), n([a.Prop({})], o.prototype, "loading", void 0), n([a.Prop({})], o.prototype, "tooltip", void 0), n([a.Prop({})], o.prototype, "tooltipTitle", void 0), n([a.Prop({})], o.prototype, "tooltipSubTitle", void 0), n([a.Prop({})], o.prototype, "currentCategoryId", void 0), n([a.Prop({})], o.prototype, "currentCategoryViewId", void 0), n([a.Prop({})], o.prototype, "showPrivateSpaceOpenPage", void 0), n([a.Prop({})], o.prototype, "currentSelectdTaskInfos", void 0), n([a.Prop({})], o.prototype, "buttonClassFilter", void 0), n([a.Prop({})], o.prototype, "click", void 0), n([a.Prop({})], o.prototype, "tooltipClose", void 0), n([a.Prop({})], o.prototype, "tooltipClick", void 0), n([a.Prop({})], o.prototype, "enter", void 0), n([a.Prop({})], o.prototype, "CREATE_NEW_TAB", void 0), n([a.Prop({})], o.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), n([a.Watch("currentSelectdTaskInfos", {immediate: !0})], o.prototype, "onSelectChange", null), o = n([a.Component], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(211), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(692), a = i(28);
    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}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(213), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(5), s = i(0).default.getLogger("DownloadPanel.ToolBarVipButton"), l = i(693);
    let d = 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.client.callServerFunction("SetValue", "ToolBarButtonVipIcon", this.cfgType, this.clickUrl).catch(), r.client.callServerFunction("OpenNewTab", this.clickUrl).catch(), 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()
            })
        }
    };
    n([o.Prop({})], d.prototype, "title", void 0), n([o.Prop({})], d.prototype, "id", void 0), n([o.Prop({})], d.prototype, "currentCategoryId", void 0), n([o.Prop({})], d.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], d.prototype, "showPrivateSpaceOpenPage", void 0), n([o.Prop({})], d.prototype, "currentSelectdTaskInfos", void 0), n([o.Prop({})], d.prototype, "buttonClassFilter", void 0), n([o.Prop({})], d.prototype, "CREATE_NEW_TAB", void 0), n([o.Prop({})], d.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), n([o.Watch("currentSelectdTaskInfos", {immediate: !0})], d.prototype, "onSelectChange", null), d = n([o.Component], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(215), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(695), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            current: e => e.Tabs.current,
            currentCategoryId: e => e.DownloadListState.currentCategoryId
        }, mapCommitToProps: {UPDATE_CATEGORY: "UPDATE_CATEGORY"}, mapDispatchToProps: {}, mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(217), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(13), s = i(14), l = i(104), d = i(31), u = i(362), c = i(696), h = i(17), f = i(5), g = i(23),
        p = i(9), v = i(10), m = i(27), y = i(46), k = i(2), T = i(7), w = i(3), C = i(15), S = i(24), I = i(462),
        b = i(22), _ = i(65), D = i(90), A = i(109), N = i(26), x = i(86), E = i(99), P = i(87), O = i(103), M = i(697),
        F = i(0), L = i(6), R = F.default.getLogger("StatusBar"), B = C.DownloadKernelEventManager.getEventManager(),
        U = T.default(k.join(__rootDir, "../bin/ThunderHelper.node")), K = i(698).urls,
        V = N.DownloadKernelCategoryManager.getCategoryManager();
    let W = class extends o.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.wkyDisplay = "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.onceDiskInfo = !1, this.diskInfo = [], this.everySecondDiskInfo = {}, this.timeDiskIdleId = -1, this.taskIds = [], this.taskPath = [], this.showTime = 0, this.hideTime = 0, this.shouleiSyncEnable = !1, this.shouleiSyncState = "offline", this.canShowPcNode = !1, this.pcNodeImgSrc = "", this.pcNodeTooltip = "", this.pcBtnClick = null, this.pcNodeOpened = !1, this.showBrowserTip = !1, this.showIcon = !1, this.browserName = "", this.tipsInfo = null, this.pcNodePopOptions = {}, this.canShowKuainiaoTip = !1, this.canShowKuainiaoInterface = !1, this.kuainiaoImgSrc = "", this.kuaiNiaoText = "", this.kuaiNiaoTipText = "", this.kuaiNiaoClick = null, this.kuaiNiaoTipClick = null
        }

        get isInPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        showBrowserGuide() {
            return a(this, void 0, void 0, function* () {
                E.popMutual.setReady(P.PopView.BROWSER_GUIDE, !0, "status"), v.XLStatNS.trackEvent("download_leftpanel", "browser_plugin_entrance_click")
            })
        }

        findProcessAw(e) {
            return a(this, void 0, void 0, function* () {
                return new Promise(t => {
                    U.asyncFindProcess(e, e => {
                        let i = e && e.length > 0;
                        t(i)
                    })
                })
            })
        }

        openAddons(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = "", n = yield L.FileSystemAWNS.readFileAW(e), a = null;
                if (n && n.length > 0) {
                    i = n.toString();
                    try {
                        (a = JSON.parse(i)).extensions.settings.ncennffkjdiamlpmcbajkmaiiiddgioo.state = 1, "360chrome" !== t && "360se" !== t || (a.extensions.settings.ncennffkjdiamlpmcbajkmaiiiddgioo.disable_reasons = 0), i = JSON.stringify(a);
                        let n = yield L.FileSystemAWNS.writeFileAW(e, i);
                        R.information("openAddons writeFileAW ret", n)
                    } catch (e) {
                        return R.warning(e), n
                    }
                }
                return R.information("isEdgeAndChromeAddonsOpened open", !1, "path", e), !1
            })
        }

        startBrowserGuide() {
            return a(this, void 0, void 0, function* () {
                if (!this.tipsInfo) return;
                let e = "";
                switch (this.browserName) {
                    case"360安全浏览器":
                        e = "360se";
                        break;
                    case"360极速浏览器":
                        e = "360chrome";
                        break;
                    case"QQ浏览器":
                        e = "QQBrowser";
                        break;
                    case"Edge浏览器":
                        e = "msedge";
                        break;
                    case"Chrome浏览器":
                        e = "chrome"
                }
                let t = this.tipsInfo.browserInfo;
                if (t && t.browserExist) {
                    let i = "", n = !0, a = !1;
                    if (t.browserAddonInstall) {
                        if (!t.browserAddonOpen) {
                            if ("QQBrowser" === e) i = t.openCmdLine; else {
                                let o = e + ".exe";
                                (a = yield this.findProcessAw(o)) ? i = t.installCmdLine : n = !1, yield this.openAddons(t.browserAddonConfigPath, e)
                            }
                            i = t.openCmdLine
                        }
                    } else i = t.installCmdLine;
                    let o = ",browser=" + this.tipsInfo.title + ",click_id=quick_start";
                    v.XLStatNS.trackEvent("download_leftpanel", "browser_plugin_guid_bubble_click", "", 0, 0, 0, 0, o), n ? U.shellExecute(0, "open", t.browserPath, i, "", "SW_SHOW") : f.client.callServerFunction("ShowMessageToast", {
                        message: "已开启下载支持",
                        type: "success"
                    }).catch()
                }
                this.showBrowserTip = !1
            })
        }

        closeTip() {
            let e = ",browser=" + this.tipsInfo.title + ",click_id=close";
            v.XLStatNS.trackEvent("download_leftpanel", "browser_plugin_guid_bubble_click", "", 0, 0, 0, 0, e), this.showBrowserTip = !1
        }

        handlePrivateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = `state=${-1 === this.currentCategoryId ? "entry" : "quit"}`;
                if (v.XLStatNS.trackEvent("download_leftpanel", "dl_private_space_btn_click", "", 0, 0, 0, 0, e), -1 === this.currentCategoryId) {
                    let e = yield _.default(!1, !0, "privatespace");
                    if (e && "" !== e) {
                        let t = V.getPrivateCategoryFromUserId(e);
                        if (t && this.currentCategoryId !== t.getId()) {
                            0 === (yield x.PrivateSpaceHelperNS.accessPrivateCategory(e)) && this.UPDATE_CATEGORY(t.getId())
                        }
                    }
                } else this.UPDATE_CATEGORY(-1)
            })
        }

        get kuainiaoClass() {
            let e = "";
            do {
                if (this.kuainiaoImgSrc) {
                    let t = "xdas://res/";
                    0 === this.kuainiaoImgSrc.indexOf(t) && (e = this.kuainiaoImgSrc.substr(t.length));
                    break
                }
            } while (0);
            return e
        }

        onIsDiskInfoChange(e) {
            if (e) v.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();
                v.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 pcNodeTooltipVisible() {
            let e = !1;
            return this.pcNodeTooltip && (e = !0), e
        }

        get pcNodePopEnable() {
            let e = !0;
            do {
                if (this.pcNodeOpened) {
                    this.pcNodePopOptions.statusDesc && this.pcNodePopOptions.actionText || (e = !1);
                    break
                }
                this.pcNodePopOptions.introduction && this.pcNodePopOptions.buttonText || (e = !1)
            } while (0);
            return e
        }

        get vipText() {
            return this.showVipText
        }

        get curHoverSpeed() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s"
        }

        get curSpeed() {
            let e = "";
            return e = this.totalDownloadSpeed >= 1024e3 ? r.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s" : r.ThunderUtil.formatSize(this.totalDownloadSpeed, 0) + "/s"
        }

        get curUpSpeed() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.totalUploadSpeed, 1) + "/s"
        }

        get curVipSpeed() {
            let e = "";
            return e = this.downloadVipSpeed >= 1024e3 ? r.ThunderUtil.formatSize(this.downloadVipSpeed, 1) + "/s" : r.ThunderUtil.formatSize(this.downloadVipSpeed, 0) + "/s"
        }

        get downSize() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.todayDownSize)
        }

        get upSize() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.todayUpSize)
        }

        get shouleiRemoteSyncText() {
            return "online" === this.shouleiSyncState ? "手机遥控下载中" : "手机遥控下载"
        }

        showPop() {
            v.XLStatNS.trackEvent("download_leftpanel", "bottom_speed_hover"), this.popUpScheduleMenu(!1)
        }

        viewMoreData() {
            return a(this, void 0, void 0, function* () {
                v.XLStatNS.trackEvent("download_leftpanel", "bottom_speed_pop_click");
                let e = yield _.default(!1, !0, "download_data");
                e && "" !== e && b.MessageBox.custom("DownloadData", {
                    windowWidth: 450,
                    windowHeight: this.canShowVipSpeed ? 523 : 597
                })
            })
        }

        onKuainiaoTextClick(e) {
            this.kuaiNiaoClick && this.kuaiNiaoClick(e)
        }

        onKuainiaoTipClick() {
            this.kuaiNiaoTipClick && this.kuaiNiaoTipClick()
        }

        handClickleVipText() {
            if ("会员登录" === this.showVipText) g.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";
                f.client.callServerFunction("OpenNewTab", e).catch();
                let t = `clickid=bottom,vip_type=${this.vipType}`;
                v.XLStatNS.trackEvent("xlx_vip_event", "hyjs_click", "", 0, 0, 0, 0, t)
            }
        }

        openTab() {
            f.client.callServerFunction("OpenNewTab", "http://yangtai.xunlei.com/?p=11111").catch()
        }

        hover() {
            v.XLStatNS.trackEvent("download_leftpanel", "disk_overload_popup_show")
        }

        onConfigInitFinished() {
            let e = l.DownloadModeNS.getCurrentDownloadMode();
            this.isLimit = "1" !== e, this.isFreeDownload = l.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), c.FlowMonitorNS.startMonitor(), I.default.init(), u.ScheduleTaskNS.init(), d.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, e => {
                this.totalDownloadSpeed = c.FlowMonitorNS.getCurrentDownloadSpeed(), this.downloadVipSpeed = c.FlowMonitorNS.getCurrentVipSpeed(), this.todayDownSize = c.FlowMonitorNS.getTodayDownloadSize()
            }), d.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, e => {
                this.totalUploadSpeed = e, this.todayUpSize = c.FlowMonitorNS.getTodayUploadSize()
            })
        }

        onGetUserInfo() {
            g.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                do {
                    if (null === e || void 0 === e) break;
                    let t = e.vipList[0], i = Number(t.isVip);
                    if (this.vipType = Number(t.vasType), 0 !== i) this.canShowVipSpeed = !0; else {
                        this.showVipText = "会员加速";
                        let e = `btn_type=bottom,vip_type=${this.vipType}`;
                        v.XLStatNS.trackEvent("xlx_vip_event", "hyjs_show", "", 0, 0, 0, 0, e)
                    }
                } while (0)
            })
        }

        created() {
            p.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            }), p.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                switch (e) {
                    case"ConfigNet":
                        "ConfigNet_Type" === t && ("1" === String(n) ? this.isLimit = !1 : this.isLimit = !0)
                }
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                this.onGetUserInfo()
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => {
                "vipinfo" === e && this.onGetUserInfo()
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("getCurrentTabUrl", e => {
                let t = !1, i = y.parse(this.tabs[this.current].tab.url).hostname;
                do {
                    if ("" === i) break;
                    for (let e = 0; e < K.length; e++) if (K[e].url === i) {
                        t = !0;
                        break
                    }
                } while (0);
                m.NativeCallHostModule.nativeCallHost.fireNativeEvent(e, t)
            }), h.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 >= 6 && this.everySecondDiskInfo[e.name].splice(0, 1), this.everySecondDiskInfo[e.name].push(e.percent), 6 === this.everySecondDiskInfo[e.name].length) {
                let t = (this.everySecondDiskInfo[e.name][0] + this.everySecondDiskInfo[e.name][1] + this.everySecondDiskInfo[e.name][2] + this.everySecondDiskInfo[e.name][3] + this.everySecondDiskInfo[e.name][4] + this.everySecondDiskInfo[e.name][5]) / 6;
                t = Math.floor(t);
                let i = e.name, n = e.name,
                    a = {name: i = e.name.slice(0, 2) + "(" + n.slice(2), percent: t.toString()};
                if (t >= 99) {
                    for (let n of this.taskPath) if (-1 !== e.name.indexOf(n) || -1 !== e.name.indexOf(n.toLocaleUpperCase())) {
                        let e = !1;
                        for (let n of this.diskInfo) if (n.name === i) {
                            n.percent = t.toString(), e = !0;
                            break
                        }
                        e || this.diskInfo.push(a), this.canShowDiskBusy = !0
                    }
                } else this.diskInfo.some((e, t) => {
                    if (e.name === a.name) return this.diskInfo.splice(t), void (0 === this.diskInfo.length && (this.canShowDiskBusy = !1))
                })
            }
        }

        startAttchDiskIdleInfo() {
            0 !== S.default.getConfigInfo("diskIdleInfo", "enable") && (this.timeDiskIdleId = setInterval(() => {
                U.asyncDiskIdleInfo(e => {
                    do {
                        if (!e || 0 === e.length) break;
                        if (!this.onceDiskInfo) {
                            this.diskIdleInfo = e, this.onceDiskInfo = !0;
                            break
                        }
                        if (e.length !== this.diskIdleInfo.length) break;
                        for (let t in this.diskIdleInfo) {
                            if (!this.diskIdleInfo[t] || !e[t] || !e[t].name) break;
                            if (e[t].name === this.diskIdleInfo[t].name) {
                                let i = (Number(e[t].percent) - Number(this.diskIdleInfo[t].percent)) / (Number(e[t].percentBase) - Number(this.diskIdleInfo[t].percentBase));
                                i = Math.floor(100 * (1 - i));
                                let n = {name: e[t].name, percent: i};
                                "_Total" !== e[t].name && this.updateDiskInfo(n)
                            }
                        }
                        this.diskIdleInfo = e
                    } while (0)
                })
            }, 1e3))
        }

        handlePcNodeClick() {
            this.pcBtnClick && this.pcBtnClick()
        }

        showWkyPop() {
            "none" === this.wkyDisplay && (this.wkyDisplay = "block", this.pcNodePopOptions && this.pcNodePopOptions.onHover && this.pcNodePopOptions.onHover())
        }

        hideWkyPop(e) {
            do {
                if ("none" === this.wkyDisplay) break;
                if (!e) {
                    this.wkyDisplay = "none";
                    break
                }
                let t = document.getElementById("status-wky-pop");
                if (!t) break;
                let i = t.getBoundingClientRect();
                (e.clientX < i.left || e.clientX > i.right || e.clientY < i.top || e.clientY - 3 > i.bottom) && (this.wkyDisplay = "none")
            } while (0)
        }

        onWkyJoin() {
            this.hideWkyPop(), this.pcNodePopOptions && this.pcNodePopOptions.onJoin && this.pcNodePopOptions.onJoin()
        }

        onWkyAction() {
            this.hideWkyPop(), this.pcNodePopOptions && this.pcNodePopOptions.onAction && this.pcNodePopOptions.onAction()
        }

        onWkyDetail() {
            this.hideWkyPop(), this.pcNodePopOptions && this.pcNodePopOptions.onDetail && this.pcNodePopOptions.onDetail()
        }

        updatePcNodeButtonInfo(e, t) {
            do {
                if (!this.canShowPcNode) break;
                if (!e) break;
                e.imgSrc && (this.pcNodeImgSrc = e.imgSrc), void 0 !== e.opened && (this.pcNodeOpened = e.opened), e.onClick && (this.pcBtnClick = e.onClick), void 0 !== e.tooltip && (this.pcNodeTooltip = e.tooltip), e.popOptions && (this.pcNodePopOptions = Object.assign({}, this.pcNodePopOptions, e.popOptions))
            } while (0)
        }

        updateKuainiaoButtonInfo(e, t) {
            do {
                if (!this.canShowKuainiaoInterface) break;
                e.imgSrc && (this.kuainiaoImgSrc = e.imgSrc), e.text && (this.kuaiNiaoText = e.text), void 0 !== e.tooltip && (e.tooltip && (this.kuaiNiaoText || this.kuainiaoImgSrc) ? (this.kuaiNiaoTipText = e.tooltip, this.canShowKuainiaoTip = !0) : (this.kuaiNiaoTipText = "", this.canShowKuainiaoTip = !1)), e.onClick && (this.kuaiNiaoClick = e.onClick), e.onTipClick && (this.kuaiNiaoTipClick = (() => {
                    e.onTipClick()
                }))
            } while (0)
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.scheduleTaskCount = u.ScheduleTaskNS.getScheduleTaskCount(), u.ScheduleTaskNS.getEventEmitter().on(u.ScheduleTaskEventType.ScheduleTaskCountChange, e => {
                    this.scheduleTaskCount = e
                }), D.PluginFunctionUINS.on("add_pc_node_button", (e, t) => {
                    this.canShowPcNode = !0, this.updatePcNodeButtonInfo(e, t), this.pcNodePopOptions && this.pcNodePopOptions.onShow && this.pcNodePopOptions.onShow()
                }), D.PluginFunctionUINS.on("update_pc_node_button", (e, t) => {
                    this.updatePcNodeButtonInfo(e, t)
                }), D.PluginFunctionUINS.on("add_kuainiao_button", (e, t) => {
                    this.canShowKuainiaoInterface = !0, this.updateKuainiaoButtonInfo(e, t), e.onShow && e.onShow()
                }), D.PluginFunctionUINS.on("update_kuainiao_button", (e, t) => {
                    this.updateKuainiaoButtonInfo(e, t)
                }), D.PluginFunctionUINS.on("remove_kuainiao_button", e => {
                    this.canShowKuainiaoInterface = !1, this.canShowKuainiaoTip = !1, this.kuainiaoImgSrc = "", this.kuaiNiaoText = "", this.kuaiNiaoTipText = "", this.kuaiNiaoClick = null, this.kuaiNiaoTipClick = null
                }), B.attachTaskEvent(w.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== w.DownloadKernel.TaskEventType.StatusChanged) break;
                        let t = e[1];
                        if (!t) break;
                        let i = "";
                        for (let e = 0; e < t.length; ++e) {
                            let n = t[e];
                            if (!n) continue;
                            let a = n.getTaskAttribute(w.DownloadKernel.TaskAttribute.GroupTaskId);
                            if (n.getTaskAttribute(w.DownloadKernel.TaskAttribute.Background) || a > 0) continue;
                            let o = n.getTaskStatus();
                            i = n.getTaskAttribute(w.DownloadKernel.TaskAttribute.SavePath).slice(0, 2);
                            let r = n.getTaskAttribute(w.DownloadKernel.TaskAttribute.TaskId),
                                s = this.taskIds.indexOf(r), l = this.taskPath.indexOf(i);
                            o === w.DownloadKernel.TaskStatus.StartWaiting || o === w.DownloadKernel.TaskStatus.StartPending || o === w.DownloadKernel.TaskStatus.Started ? -1 === s && (this.taskIds.push(r), this.taskPath.push(i)) : -1 !== s && (this.taskIds.splice(s, 1), -1 !== l && this.taskPath.splice(l, 1))
                        }
                        0 !== this.taskIds.length ? -1 === this.timeDiskIdleId && this.startAttchDiskIdleInfo() : (this.canShowDiskBusy = !1, clearInterval(this.timeDiskIdleId), this.timeDiskIdleId = -1)
                    } while (0)
                });
                const e = A.ShouleiListSyncNS.getMananger();
                this.shouleiSyncEnable = yield e.enable(), this.shouleiSyncEnable && (this.shouleiSyncState = e.getState(), e.attachEvent("OnConnectStateChanged", e => {
                    this.shouleiSyncState = e
                })), setTimeout(() => a(this, void 0, void 0, function* () {
                    let e = p.ConfigNS.getValue("ShowBrowser", "ShowBox", !1),
                        t = p.ConfigNS.getValue("ShowBrowser", "ShowTip", !1);
                    if ((yield M.BrowserHelperNs.getInfos()).forEach((e, t) => {
                        e.browserExist && (this.showIcon = !0)
                    }), yield this.trackOpenAddon(), this.showIcon && v.XLStatNS.trackEvent("download_leftpanel", "browser_plugin_entrance_show"), R.information("showBoxed", e, "showTiped", t), e) {
                        let e = O.default.getStartArgs();
                        if (this.tipsInfo = yield M.BrowserHelperNs.getShowTipInfo(), !this.tipsInfo) return;
                        if (this.browserName = this.tipsInfo.title, this.showBrowserTip = "Install" === e ? this.tipsInfo.show : this.tipsInfo.show && !t, this.showBrowserTip) {
                            let e = ",browser=" + this.tipsInfo.title;
                            v.XLStatNS.trackEvent("download_leftpanel", "browser_plugin_guid_bubble_show", "", 0, 0, 0, 0, e), p.ConfigNS.setValue("ShowBrowser", "ShowTip", !0)
                        }
                        R.information("tipsInfo", this.tipsInfo, "startType", e, "showBrowserTip", this.showBrowserTip)
                    }
                }), 2e4)
            })
        }

        trackOpenAddon() {
            return a(this, void 0, void 0, function* () {
                let e = "", t = !1;
                (yield M.BrowserHelperNs.getInfos(!0)).forEach((i, n) => {
                    if (!i.browserExist) return;
                    let a = 2;
                    i.browserAddonInstall ? i.browserAddonInstall && !i.browserAddonOpen && (a = 1) : a = 0, e += "plug_name=" + n + ",startup=" + a + ";", t = !0
                }), t && (e = encodeURIComponent(e), v.XLStatNS.trackEvent("plugin_stat", "browser_plug_install_startup", "", 0, 0, 0, 0, e))
            })
        }

        onPopUpBlur() {
            this.popUpScheduleMenu(!1)
        }

        popUpScheduleMenu(e) {
            this.popUp = e
        }

        handleClick(e) {
            let t = "";
            switch (this.isFreeDownload = l.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), e) {
                case"entry":
                    v.XLStatNS.trackEvent("download_leftpanel", "bottom_plan_click"), this.popUpScheduleMenu(!0);
                    break;
                case"totalSpeed":
                    t = "button=fullspeed", v.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), l.DownloadModeNS.setFullDownloadMode(), f.client.callServerFunction("ShowMessageToast", {
                        message: "已为您切换至全速下载模式",
                        type: "success"
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"limitSpeed":
                    t = "button=limitspeed", v.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), l.DownloadModeNS.showCustomDownloadModeDlg().then(e => {
                        e && f.client.callServerFunction("ShowMessageToast", {
                            message: "已为您切换至限速下载模式",
                            type: "success"
                        }).catch()
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"shouleiSync":
                    t = "button=connect_shoulei,status=" + ("online" === this.shouleiSyncState ? "on" : "off"), v.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), b.MessageBox.custom("shoulei-sync-guide", {
                        type: "online" === this.shouleiSyncState ? "remoting" : "open",
                        sfrom: "plan",
                        statFrom: "left_corner"
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"freeDownload":
                    this.isFreeDownload ? (t = "button=freedom,status=off", v.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.closeFreeDownLoad(), l.DownloadModeNS.setFreeDownLoadConfig(!1)) : u.ScheduleTaskNS.popMessageBox(() => {
                        t = "button=freedom,status=on", v.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), l.DownloadModeNS.setFreeDownLoadConfig(!0), u.ScheduleTaskNS.startFreeDownLoad()
                    }), this.popUpScheduleMenu(!1);
                    break;
                case"scheduleTask":
                    t = "button=plan", v.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", v.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", v.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", v.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)
            }
        }
    };
    n([o.Prop({})], W.prototype, "currentCategoryId", void 0), n([o.Prop({})], W.prototype, "UPDATE_CATEGORY", void 0), n([o.Prop({})], W.prototype, "current", void 0), n([o.Prop({})], W.prototype, "tabs", void 0), n([o.Watch("canShowDiskBusy")], W.prototype, "onIsDiskInfoChange", null), n([o.Watch("isLimit")], W.prototype, "onIsLimtChanged", null), W = n([o.Component], W), t.default = W
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(219), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(700), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask},
        mapCommitToProps: {SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK"},
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(221), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), i(905);
    const a = i(8), o = i(482).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 = n([a.Component], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(223), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), i(907);
    const a = i(8), o = i(52), r = i(49), s = o.ToastNotifyManagerNS.getToastNotifyManger();
    let l = 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
        }

        onHasLeftBottomAdChange(e) {
            this.isUp = e
        }

        get cancel() {
            return !!this.showNotifyItem && this.showNotifyItem.getCancel()
        }

        get cancelText() {
            return this.showNotifyItem ? this.showNotifyItem.getCancelText() : ""
        }

        get component() {
            let e = "";
            return this.showNotifyItem && this.showNotifyItem.getType() === r.ToastNotifyItemType.Custom && (e = this.showNotifyItem.getComponentId()), e
        }

        handleClose() {
            this.showNotifyItem && (this.showNotifyItem.close(), s.closeNotify(this.showNotifyItem.getId()))
        }

        handleCancel() {
            this.showNotifyItem && (this.showNotifyItem.getCancel() && this.showNotifyItem.cancel(), s.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, this.showNotifyItem && s.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 i = t.getDuration();
            i && i > 0 && (this.durationTimer = setTimeout(() => {
                this.durationTimer = void 0, s.closeNotify(e)
            }, i))
        }

        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() {
            s.attachListener("OnShowNotify", this.onShowNotify), s.attachListener("OnUpdateNotify", this.onUpdateNotify), s.attachListener("OnCloseNotify", this.onCloseNotify)
        }

        destroyed() {
            s.detachListener("OnShowNotify", this.onShowNotify), s.detachListener("OnUpdateNotify", this.onUpdateNotify), s.detachListener("OnCloseNotify", this.onCloseNotify)
        }
    };
    n([a.Prop({})], l.prototype, "hasLeftBottomAd", void 0), n([a.Watch("hasLeftBottomAd")], l.prototype, "onHasLeftBottomAdChange", null), l = n([a.Component({components: {GetCoinPrizeToast: () => Promise.resolve().then(() => i(703))}})], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(225), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(13);
    let {isDef: s} = r.ThunderUtil;
    const l = i(5), d = i(10), u = i(9);
    let c = class extends o.Vue {
        constructor() {
            super(...arguments), this.coinCount = "", this.userId = ""
        }

        getIsVip() {
            return a(this, void 0, void 0, function* () {
                let e = !1;
                try {
                    let t = JSON.parse(yield l.client.callServerFunction("GetUserInfo", 2));
                    if (s(t)) {
                        e = Number(t.isVip) > 0
                    }
                } catch (e) {
                }
                return e
            })
        }

        handlePrize() {
            return a(this, void 0, void 0, function* () {
                yield l.client.callServerFunction("OpenNewTab", "https://misc-xl9-ssl.xunlei.com/welfare-pc/?entrypage=dltab_detail&entry=task_list");
                let e = yield this.getIsVip();
                d.XLStatNS.trackEvent("download_leftpanel", "coin_get_toast_click", "", 0, 0, 0, 0, {is_vip: e ? "1" : "0"}), u.ConfigNS.setValue("Toast", "GetCoinPrizePopDate" + this.userId, (new Date).toLocaleDateString()), u.ConfigNS.setValue("Toast", "GetCoinPrizePopClick" + this.userId, !0), this.$emit("ok")
            })
        }

        handleClose() {
            u.ConfigNS.setValue("Toast", "GetCoinPrizePopDate" + this.userId, (new Date).toLocaleDateString()), u.ConfigNS.setValue("Toast", "GetCoinPrizePopClick" + this.userId, !0), this.$emit("close")
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                let e = yield this.getIsVip();
                this.coinCount = e ? "+8" : "+5", this.userId = yield l.client.callServerFunction("GetUserID"), d.XLStatNS.trackEvent("download_leftpanel", "coin_get_toast_show", "", 0, 0, 0, 0, {is_vip: e ? "1" : "0"})
            })
        }
    };
    n([o.Prop({})], c.prototype, "data", void 0), n([o.Prop({})], c.prototype, "isUp", void 0), c = n([o.Component], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(227), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(483), s = i(68), l = i(5);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.cookie = null, this.closeCookie = null, this.content = "", this.btnText = "", this.iconUrl = "", this.sceneData = {}, this.orderData = {}, this.styleEx = {}, this.contextColor = "", this.contextBkgColor = "", this.btnColor = "", this.btnBkgColor = "", this.progress = 0, this.adType = "adplatform", this.isLarge = !1, this.showProgress = !1, this.secondary = "", this.btnVisible = !0, this.updateOrderScope = null
        }

        get adBackground() {
            let e = "";
            do {
                if (!this.styleEx) break;
                if (!this.styleEx.background) break;
                e = `background: ${this.styleEx.background};`
            } while (0);
            return e
        }

        get adPColor() {
            let e = "";
            do {
                if (!this.styleEx) break;
                if (!this.styleEx.p_color) break;
                e = `color: ${this.styleEx.p_color};`
            } while (0);
            return e
        }

        get adOptionAStyle() {
            let e = "";
            do {
                if (!this.styleEx) break;
                this.styleEx.a_color && (e = `color: ${this.styleEx.a_color};`), this.styleEx.a_background && (e = `${e}background: ${this.styleEx.a_background};`)
            } while (0);
            return e
        }

        get closeBtnVisible() {
            let e = !0;
            return "pack_using" === this.adType && (e = this.btnVisible), e
        }

        checkStyleExValid(e) {
            let t = !0;
            do {
                if (!e) {
                    t = !1;
                    break
                }
                if (e.background && !/^#[a-fA-F0-9]{6}/.test(e.background)) {
                    t = !1;
                    break
                }
                if (e.p_color && !/^#[a-fA-F0-9]{6}/.test(e.p_color)) {
                    t = !1;
                    break
                }
                if (e.a_background && !/^#[a-fA-F0-9]{6}/.test(e.a_background)) {
                    t = !1;
                    break
                }
                if (e.a_color && !/^#[a-fA-F0-9]{6}/.test(e.a_color)) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }

        onClick(e) {
            return a(this, void 0, void 0, function* () {
                const {
                    AdPlatformManagerNS: t,
                    AdPlatformType: n,
                    AdPlatformCloseReason: a
                } = yield Promise.resolve().then(() => i(80));
                switch (this.adType) {
                    case n.AdPlatform:
                        if (t.getInstance().close(a.Click, e), this.$emit("ad-show", !1), "btn" === e || "content" === e) {
                            let e = this.orderData.openType, t = this.orderData.targetUrl,
                                i = this.orderData.targetSubUrl;
                            s.AdHelperNS.execute(e, t, i)
                        }
                        r.adPlatform.handleEvent(e);
                        break;
                    case n.Functional:
                    case n.FunctionalHigh:
                        if ("close" === e) t.getInstance().close(a.Click, e), this.$emit("ad-show", !1); else {
                            let t = this.orderData;
                            t.onClick && t.onClick(e)
                        }
                        break;
                    case n.Exactly:
                    case n.Renew:
                        if (t.getInstance().close(a.Click, e), this.$emit("ad-show", !1), "btn" === e || "content" === e) {
                            let e = this.orderData, t = e.url;
                            if (e.aidfrom || e.referfrom) {
                                const {ThunderUtil: n} = yield Promise.resolve().then(() => i(13));
                                t = n.setQueryStringEx(t, {aidfrom: e.aidfrom || "", referfrom: e.referfrom || ""})
                            }
                            l.client.callServerFunction("OpenNewTab", t).catch()
                        }
                }
            })
        }

        updateOrder(e, t) {
            return a(this, void 0, void 0, function* () {
                do {
                    const {AdPlatformType: n} = yield Promise.resolve().then(() => i(80));
                    if (e === n.AdPlatform) break;
                    this.orderData = Object.assign({}, this.orderData, t);
                    let a = t;
                    void 0 !== a.showProgress && (this.showProgress = a.showProgress), void 0 !== a.progress && (this.progress = a.progress), void 0 !== a.subtitle && (this.secondary = a.subtitle || ""), void 0 !== a.maintitle && (this.content = a.maintitle), void 0 !== a.buttonText && (this.btnText = a.buttonText), void 0 !== a.icon && (this.iconUrl = a.icon), void 0 !== a.btnVisible && (this.btnVisible = a.btnVisible)
                } while (0)
            })
        }

        created() {
            this.cookie = l.client.attachServerEvent("OnAdPlatformShow", (e, t, n) => a(this, void 0, void 0, function* () {
                this.adType = t;
                const {AdPlatformType: e, AdPlatformManagerNS: a} = yield Promise.resolve().then(() => i(80));
                switch (this.adType) {
                    case e.AdPlatform: {
                        let e = n.scene, t = n.orders[0], i = n.styleEx;
                        this.sceneData = e, this.orderData = t, this.content = t.content, this.btnText = t.btnText, this.iconUrl = t.iconUrl, this.isLarge = !1, this.showProgress = !1, this.btnVisible = !0, this.checkStyleExValid(i) ? this.styleEx = i : this.styleEx = {}, this.$emit("ad-show", !0), r.adPlatform.handleEvent("ad_show")
                    }
                        break;
                    case e.Functional:
                    case e.Exactly:
                    case e.Renew:
                    case e.FunctionalHigh: {
                        this.updateOrderScope || (this.updateOrderScope = this.updateOrder.bind(this), a.getInstance().on("adplatfor_update_order", this.updateOrderScope));
                        let e = n;
                        this.isLarge = !!e.subtitle, this.showProgress = !!e.showProgress, this.progress = e.progress, this.secondary = e.subtitle || "", this.content = e.maintitle, this.btnText = e.buttonText, this.iconUrl = e.icon, this.btnVisible = void 0 === e.btnVisible || e.btnVisible, this.orderData = e, this.$emit("ad-show", !0)
                    }
                }
            })), this.closeCookie = l.client.attachServerEvent("OnAdPlatformClose", (e, ...t) => a(this, void 0, void 0, function* () {
                const {AdPlatformManagerNS: e, AdPlatformCloseReason: t} = yield Promise.resolve().then(() => i(80));
                e.getInstance().close(t.Expired, void 0), this.$emit("ad-show", !1)
            }))
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                if (null !== this.cookie && (l.client.detachServerEvent("OnAdPlatformShow", this.cookie), this.cookie = null), this.closeCookie && (l.client.detachServerEvent("OnAdPlatformClose", this.closeCookie), this.closeCookie = null), this.updateOrderScope) {
                    const {AdPlatformManagerNS: e} = yield Promise.resolve().then(() => i(80));
                    e.getInstance().removeListener("adplatfor_update_order", this.updateOrderScope), this.updateOrderScope = null
                }
            })
        }
    };
    d = n([o.Component], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(229), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(364), r = i(68), s = i(147);
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.cookie = null, this.content = "", this.picFile = "", this.orderData = {}
        }

        onClick(e) {
            if ("content" === e) {
                let e = this.orderData.openType, t = this.orderData.targetUrl, i = this.orderData.targetSubUrl;
                r.AdHelperNS.execute(e, t, i)
            } else "close" === e ? this.$emit("ad-left-bottom-show", !1) : "nodisturb" === e && (o.adLeftBottomHelper.setNoDisturb(), this.$emit("ad-left-bottom-show", !1));
            o.adLeftBottomHelper.handleEvent(e)
        }

        created() {
            this.cookie = o.adLeftBottomHelper.attachListener(s.AdCommonNS.eventAdShow, (e, t) => {
                e === s.AdCommonNS.AdName.AdLeftBottomVip && (this.orderData = t, this.picFile = t.picFile, this.$emit("ad-left-bottom-show", !0))
            })
        }

        destroyed() {
            null !== this.cookie && (o.adLeftBottomHelper.detachListener(s.AdCommonNS.eventAdShow, this.cookie), this.cookie = null)
        }
    };
    n([a.Prop({})], l.prototype, "isSearch", void 0), l = n([a.Component], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(231), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(708), a = i(28);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            tabs: e => e.Tabs.tabs,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {createNewTab: "CREATE_NEW_TAB", selectNav: "SELECT_NAV"},
        mapDispatchToProps: {selectTab: "selectTab"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(233), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(71), s = i(29), l = i(12), d = i(15), u = i(14), c = i(3), h = i(5), f = i(346), g = i(23),
        p = i(10), v = i(55), m = i(0), y = i(85), k = i(709), T = m.default.getLogger("task-detail"),
        w = l.DownloadKernelTaskManager.getTaskManager(), C = d.DownloadKernelEventManager.getEventManager();
    let S = class extends o.Vue {
        constructor() {
            super(...arguments), this.elementId = "home-1EAC214F-7644-4163-9EB8-AF4BAA62D144", this.transition = !1, this.curTaskId = 0, this.curTask = null, this.select = !1, this.curPannel = "", this.curIndex = I.Comments, this.unFireIndex = I.Comments, this.playingMediaIndex = -1, this.playingCurTask = !1, this.playingTaskId = 0, this.playState = y.XmpMediaState.Invalid, this.intervalGetPlayMedia = void 0, this.updatePlayAreaTimer = void 0, this.chosenTasks = [], this.multiChosenTaskList = [], this.timeoutOnTaskItemActive = void 0, this.curUserId = "", this.isLogined = !1, this.userInfo = {}, this.vipInfo = {}
        }

        get curTaskName() {
            return 0 !== this.curTaskId ? (T.information("this.curTaskId", this.curTaskId), this.curTask.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName)) : ""
        }

        get curTaskStatus() {
            return 0 !== this.curTaskId ? this.curTask.getTaskStatus() : c.DownloadKernel.TaskStatus.Unkown
        }

        get isBtOrGroup() {
            if (0 !== this.curTaskId) {
                let e = this.curTask.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType);
                return e === c.DownloadKernel.TaskType.Bt || e === c.DownloadKernel.TaskType.Group
            }
            return !1
        }

        switchNav(e) {
            this.selectNav(e)
        }

        indexOfTab(e) {
            let t = -1;
            for (let i = 0; i < this.tabs.length; i++) if (this.tabs[i].tab.getTabType() === r.TabType.Chromium && this.tabs[i].tab.getOriginalUrl() === e) {
                t = i;
                break
            }
            return t
        }

        updateTaskInfo(...e) {
            T.information("updateTaskInfo", this.curTaskId);
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (i && i.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId) === this.curTaskId) {
                        this.curTask = i;
                        break
                    }
                }
            } while (0)
        }

        operate(e, t = "right", ...i) {
            return a(this, void 0, void 0, function* () {
                return h.client.callServerFunction("OperateTask", this.curTaskId, e, ...i)
            })
        }

        updateUserInfo() {
            return a(this, void 0, void 0, function* () {
                this.curUserId = yield g.LoginHelperNS.loginHelper.getUserInfoAw("userid"), this.userInfo = yield g.LoginHelperNS.loginHelper.getUserInfoAw(), this.isLogined ? this.vipInfo = g.LoginHelperNS.loginHelper.getVipInfo() : this.vipInfo = {}
            })
        }

        onCurTaskChange() {
            this.getPlayMedia()
        }

        updatePosition() {
            return a(this, void 0, void 0, function* () {
                yield h.client.callServerFunction("ThunderResize")
            })
        }

        onScroll(e) {
            return a(this, void 0, void 0, function* () {
                this.$nextTick(() => a(this, void 0, void 0, function* () {
                    let t, i = document.querySelector("div#xly-task-detail-preview.xly-preview"),
                        n = {width: 0, height: 0, x: 0, y: 0};
                    if (i && (t = i.getBoundingClientRect()), t && (n.y = t.top > 42 ? t.top : 42, n.x = t.left, n.width = t.width, n.height = t.height, 0 !== n.x && 0 !== n.width && 0 !== n.height)) {
                        if (T.information("onscroll updateDownloadEmbedRect", JSON.stringify(n)), e && e.srcElement && e.srcElement.scrollTop > 100) n.y = 42, yield h.client.callServerFunction("UpdateDownloadEmbedRect", n), this.updatePosition(); else if (0 !== this.playingTaskId) if (this.playingTaskId === this.curTaskId) yield h.client.callServerFunction("UpdateDownloadEmbedRect", n), this.updatePosition(), p.XLStatNS.trackEvent("download_detail", "dl_detail_yunpan_ceiling_play"); else {
                            let e = w.getTaskFromTaskId(this.playingTaskId);
                            if (e) {
                                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId);
                                t > 0 && t === this.curTaskId && (yield h.client.callServerFunction("UpdateDownloadEmbedRect", n), this.updatePosition()), p.XLStatNS.trackEvent("download_detail", "dl_detail_yunpan_ceiling_play")
                            }
                        }
                        h.client.callRemoteClientFunction(v.mainRendererContext, "UpdateScrollShowOrHide")
                    }
                }))
            })
        }

        attachScrollEvent() {
            document.querySelector("div#xly-task-detail-down__main.xly-down__main").addEventListener("scroll", this.onScroll.bind(this))
        }

        getPlayMedia() {
            return a(this, void 0, void 0, function* () {
                let e = yield h.client.callServerFunction("GetPlayingTaskId");
                try {
                    this.playingTaskId = parseInt(e, 10)
                } catch (e) {
                    this.playingTaskId = 0
                }
                if (this.playingTaskId !== this.curTaskId) return this.playingMediaIndex = -1, void (this.playingCurTask = !1);
                this.playingCurTask = !0;
                let t = (yield h.client.callRemoteClientFunction(v.mainRendererContext, "XmpPlayerGetCurrentMediaAttribute", y.XmpMediaAttr.ThunderTaskSubId))[0];
                this.playingMediaIndex = t, this.playState = (yield h.client.callRemoteClientFunction(v.mainRendererContext, "XmpPlayerGetCurrentMediaAttribute", y.XmpMediaAttr.State))[0]
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                f.HistoryTaskSpeedInfoNS.init().catch(), s.default.attachListener(u.NodeEventMesssageNS.eventDownloadItemActive, (e, t, i, n, a, o) => {
                    this.timeoutOnTaskItemActive && clearTimeout(this.timeoutOnTaskItemActive), t ? (this.curTaskId = i, this.curTask = w.getTaskFromTaskId(this.curTaskId), this.select = !0, this.curIndex = o, T.information("DownloadItemActive", i, e, o)) : (a || i === this.curTaskId) && (this.timeoutOnTaskItemActive = setTimeout(() => {
                        this.curTaskId = 0, this.curTask = null, this.curPannel = "", this.select = !1
                    }, 100))
                }), s.default.attachListener(u.NodeEventMesssageNS.eventDetailSwitch2Index, (e, t) => {
                    T.information("DetailSwitch2Index", e, t), this.curTaskId = e, this.curIndex = t
                }), C.attachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), h.client.attachServerEvent("OnLoginSuc", (e, ...t) => {
                    this.isLogined = !0
                }), h.client.attachServerEvent("OnLogout", (e, ...t) => {
                    this.isLogined = !1
                }), this.isLogined = yield g.LoginHelperNS.loginHelper.isLoginedAw(), yield this.getPlayMedia(), this.intervalGetPlayMedia = setInterval(this.getPlayMedia, 2e3), this.attachScrollEvent(), h.client.attachServerEvent("OnDownloadItemChosen", (e, ...t) => {
                    if (t && !(t.length < 4)) {
                        if (this.timeoutSetChosenTasks && (clearTimeout(this.timeoutSetChosenTasks), this.timeoutSetChosenTasks = void 0), !0 === t[1]) {
                            -1 === this.chosenTasks.findIndex(e => e === t[2]) && this.chosenTasks.push(t[2])
                        } else {
                            let e = this.chosenTasks.findIndex(e => e === t[2]);
                            -1 !== e && this.chosenTasks.splice(e, 1)
                        }
                        this.timeoutSetChosenTasks = setTimeout(() => {
                            this.multiChosenTaskList = Object.assign([], this.chosenTasks), this.timeoutSetChosenTasks = void 0
                        }, 50)
                    }
                }), h.client.attachServerEvent("OnXmpBackUpEmbed", (e, ...t) => {
                    t && t[0] && h.client.callServerFunction("SwitchDetail", t[0])
                }), window.addEventListener("resize", this.updateViewPos), window.addEventListener("maximize", this.updateViewPos)
            })
        }

        beforeDestroy() {
            window.removeEventListener("resize", this.updateViewPos), window.removeEventListener("maximize", this.updateViewPos), clearInterval(this.intervalGetPlayMedia);
            let e = document.querySelector("div#xly-task-detail-down__main.xly-down__main");
            e && e.removeEventListener("scroll", this.onScroll)
        }

        updateViewPos() {
            this.$nextTick(() => a(this, void 0, void 0, function* () {
                let e, t = document.querySelector("div.xly-file-detail div.td-tabs__pane"),
                    i = {width: 0, height: 0, x: 0, y: 0};
                t && (e = t.getBoundingClientRect()), e && (i.y = e.top > 42 ? e.top : 42, i.x = e.left, i.width = e.width, i.height = e.height, T.information("updateViewPos UpdateDownloadEmbedRect", JSON.stringify(i)), 0 !== i.x && 0 !== i.width && 0 !== i.height && (yield h.client.callServerFunction("UpdateDownloadEmbedRect", i), yield h.client.callServerFunction("ThunderResize")))
            }))
        }
    };
    var I;
    n([o.Prop({})], S.prototype, "tabs", void 0), n([o.Prop({})], S.prototype, "preloadPath", void 0), n([o.Prop()], S.prototype, "currentCategoryId", void 0), n([o.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], S.prototype, "createNewTab", void 0), n([o.Prop({})], S.prototype, "selectTab", void 0), n([o.Prop({})], S.prototype, "selectNav", void 0), n([o.Watch("isLogined")], S.prototype, "updateUserInfo", null), n([o.Watch("curTaskId", {immediate: !0})], S.prototype, "onCurTaskChange", null), S = n([o.Component({
        components: {
            XlTab: () => Promise.resolve().then(() => i(748)),
            XlHeader: () => Promise.resolve().then(() => i(760)),
            XlDetail: () => Promise.resolve().then(() => i(761)),
            FileList: () => Promise.resolve().then(() => i(762)),
            MultiChosenTasks: () => Promise.resolve().then(() => i(764)),
            Recommend: () => Promise.resolve().then(() => i(766)),
            ScanCode: k.default
        }
    })], S), t.default = S, function (e) {
        e.Comments = "comments", e.FileList = "files", e.Attribute = "detail"
    }(I || (I = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(235), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(710), a = i(28), o = i(3), r = i(26).DownloadKernelCategoryManager.getCategoryManager();
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = t.curTaskId, a = t.currentCategoryId;
                if (-1 === a) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Downloading) {
                        i = e.DownloadListState.taskList[t].tasksMap[n];
                        break
                    }
                } else if (r.isPrivateCategory(a)) for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Downloading && (i = e.DownloadListState.taskListPrivate[t].tasksMap[n]);
                return i
            }, vipSpeedInfo: (e, t) => {
                let i = null, n = t.curTaskId;
                return i = e.VipSpeedState.vipSpeedMap[n] ? e.VipSpeedState.vipSpeedMap[n] : e.VipSpeedState.defaultStatus
            }, vipSpeedMap: e => e.VipSpeedState.vipSpeedMap
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(237), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(5), s = i(0), l = i(3), d = i(12), u = i(15), c = i(484), h = i(32), f = i(13), g = i(16),
        p = i(10), v = i(22), m = u.DownloadKernelEventManager.getEventManager(),
        y = d.DownloadKernelTaskManager.getTaskManager(), k = i(485), T = s.default.getLogger("ScanCode");
    let w = class extends o.Vue {
        constructor() {
            super(...arguments), this.showScancode = !0, this.curTask = {}, this.shortlink = "", this.accelerationTimes = 0, this.days = 0, this.eventSyncMessage = -1, this.tokenMap = {}, this.offlineSize = 0, this.intervalCalculateChannel = null, this.isAccelerating = !1, this.hasAccelerated = !1, this.maxSpeed = 0, this.saveTime = 0, this.allOfflineSize = "2G", this.qrcodeConfig = {
                right_panel_text: "扫码加速",
                text: "扫码加速",
                zerotype_text: "扫码加速，畅享高速下载",
                offlineSize: 2147483648,
                show_right_scancode: !0
            }, this.autoShow = !0, this.hasClickShowMore = !1, this.nextDate = ""
        }

        get isVip() {
            return !(!this.vipInfo || "1" !== this.vipInfo.isVip)
        }

        get curTaskStatus() {
            return this.taskBase ? this.taskBase.taskStatus : l.DownloadKernel.TaskStatus.Begin
        }

        onaccelerationTimesChange() {
            g.server.fireClientEvent("UpdateAccelerationTimes", this.accelerationTimes, this.days), this.accelerationTimes <= 0 && (this.autoShow = !1)
        }

        get needShowMore() {
            return this.autoShow
        }

        get maxSpeedStr() {
            return `${f.ThunderUtil.formatSizeCustom(this.maxSpeed, 1, 4)}/s`
        }

        get isHuddleOrTry() {
            return !!this.isVip || this.vipSpeedInfo && (this.vipSpeedInfo.isShowVipSpeed && "ScanCode" !== this.vipSpeedInfo.hoverType || this.vipSpeedInfo.isHuddle)
        }

        get vipSpeed() {
            return "+" + f.ThunderUtil.formatSizeCustom(this.taskBase.vipSpeed, 1, 4) + "/s"
        }

        get progress() {
            return 100 * this.offlineSize / this.qrcodeConfig.offlineSize
        }

        get offlineNumber() {
            let e = f.ThunderUtil.formatSizeCustom(this.offlineSize, 1, 4);
            return e.substring(0, e.length - 1)
        }

        get remainSize() {
            let e = this.qrcodeConfig.offlineSize - this.offlineSize, t = f.ThunderUtil.formatSizeCustom(e, 1, 4);
            return t.substring(0, t.length - 1)
        }

        get saveTimeStr() {
            return this.saveTime < 0 ? "0" : this.saveTime < 60 ? `${Math.floor(this.saveTime)}秒钟` : this.saveTime < 3600 ? `${(this.saveTime / 60).toFixed(1)}分钟` : this.saveTime < 86400 ? "1小时+" : "-"
        }

        get isList() {
            let e = !1;
            return !this.taskBase || this.taskBase.taskType !== l.DownloadKernel.TaskType.Bt && this.taskBase.taskType !== l.DownloadKernel.TaskType.Group || (e = !0), e
        }

        get switchShowType() {
            return this.accelerationTimes <= 0 ? 1 : this.curTaskStatus <= 5 && this.isAccelerating && "" === this.shortlink && !this.isHuddleOrTry ? 2 : [6, 7].includes(this.curTaskStatus) && this.isAccelerating && "" === this.shortlink && !this.isHuddleOrTry ? 3 : this.curTaskStatus < 8 && this.hasAccelerated && "" === this.shortlink ? 4 : "" === this.shortlink && this.isHuddleOrTry ? 5 : ""
        }

        onswitchShowTypeChange() {
            this.curCategoryViewid === l.DownloadKernel.CategroyViewID.Downloading && (this.accelerationTimes <= 0 ? p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_run_out_show", "", 0, 0, 0, 0, `task_id=${this.curTaskId}`) : this.curTaskStatus <= 5 && this.isAccelerating && "" === this.shortlink && !this.isHuddleOrTry ? p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_state_change", "", 0, 0, 0, 0, `if_child_tsak_list=${this.isList},type=accelerating,task_id=${this.curTaskId}`) : [6, 7].includes(this.curTaskStatus) && this.isAccelerating && "" === this.shortlink && !this.isHuddleOrTry ? p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_state_change", "", 0, 0, 0, 0, `if_child_tsak_list=${this.isList},type=pause,task_id=${this.curTaskId}`) : this.curTaskStatus < 8 && this.hasAccelerated && "" === this.shortlink ? p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_state_change", "", 0, 0, 0, 0, `if_child_tsak_list=${this.isList},type=complete,task_id=${this.curTaskId}`) : "" === this.shortlink && this.isHuddleOrTry && p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_state_change", "", 0, 0, 0, 0, `if_child_tsak_list=${this.isList},type=break,task_id=${this.curTaskId}`))
        }

        showMore() {
            this.autoShow = !this.autoShow, this.autoShow && "" !== this.shortlink && p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_2d_code_show", "", 0, 0, 0, 0, `position=right_center,if_child_task_list=${this.isList ? 1 : 0},task_id=${this.curTaskId}`)
        }

        onCurTaskIdChange() {
            if (this.curTaskId ? (this.curTask = y.getTaskFromTaskId(this.curTaskId), this.curTask.getType() === l.DownloadKernel.TaskType.Group || this.curTask.getType() === l.DownloadKernel.TaskType.Bt ? this.autoShow = !1 : this.autoShow = !0) : this.curTask = {}, this.hasAccelerated = !1, this.tokenMap[this.curTaskId] && this.tokenMap[this.curTaskId].timeoutTimer ? this.isAccelerating = !0 : (this.isAccelerating = !1, this.tokenMap[this.curTaskId] && null === this.tokenMap[this.curTaskId].timeoutTimer && (this.hasAccelerated = !0)), this.offlineSize = this.tokenMap[this.curTaskId] && this.tokenMap[this.curTaskId].downloadSizeSum || 0, this.maxSpeed = this.tokenMap[this.curTaskId] && this.tokenMap[this.curTaskId].maxSpeed ? this.tokenMap[this.curTaskId].maxSpeed : 0, this.isVip || !this.qrcodeConfig.show_right_scancode ? this.showScancode = !1 : this.showScancode = !0, this.tokenMap[this.curTaskId]) {
                let e = (this.tokenMap[this.curTaskId].downloadSizeSum - this.tokenMap[this.curTaskId].offlineSizeSum) / this.tokenMap[this.curTaskId].useTime;
                this.saveTime = this.tokenMap[this.curTaskId].downloadSizeSum / e - this.tokenMap[this.curTaskId].useTime
            }
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                m.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => a(this, void 0, void 0, function* () {
                    !e || e.length < 3 || 0 == (e[2] & l.DownloadKernel.TaskDetailChangedFlags.UserRead) && 0 == (e[2] & l.DownloadKernel.TaskDetailChangedFlags.PlayPosition) && this.updateTaskInfo(...e)
                })), m.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => a(this, void 0, void 0, function* () {
                    if (!e || e.length < 2) return;
                    if (e[0] !== l.DownloadKernel.TaskEventType.StatusChanged) return;
                    let t = e[1];
                    t && this.onTaskStatusChange(t)
                })), r.client.attachServerEvent("OnQrCodeConfigUpdate", (e, t) => {
                    if (t && void 0 !== t.offlineSize && void 0 !== t.zerotype_text && void 0 !== t.right_panel_text) {
                        this.qrcodeConfig = t;
                        let e = f.ThunderUtil.formatSizeCustom(t.offlineSize, 0, 4);
                        this.allOfflineSize = e.substring(0, e.length - 1)
                    }
                }), r.client.attachServerEvent("UpdateShortLink", (e, t) => {
                    if (this.shortlink = t, "" === this.shortlink) return;
                    let i = document.getElementById("showCodeAcceleration");
                    k.toCanvas(i, this.shortlink, {margin: 0, width: 58}, e => {
                        T.information("QRCode.toCanvas error = ", e)
                    });
                    let n = document.getElementById("hoverCodeAcceleration");
                    k.toCanvas(n, this.shortlink, {margin: 0, width: 72}, e => {
                        T.information("QRCode.toCanvas error = ", e)
                    }), this.autoShow && p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_2d_code_show", "", 0, 0, 0, 0, `position=right_center,if_child_task_list=${this.isList ? 1 : 0},task_id=${this.curTaskId}`)
                }), this.eventSyncMessage = r.client.attachServerEvent("SyncMessage", (e, t) => a(this, void 0, void 0, function* () {
                    do {
                        try {
                            if ("string" == typeof t && (t = JSON.parse(t)), T.information("### syncMessage- ", t), !t.subject.startsWith("/device/") || !t.subject.endsWith("/scancode_acceleration")) break;
                            g.server.fireClientEvent("UpdateFirstShowScanCode");
                            let e = t.data, i = Number(e.task_id);
                            if (this.tokenMap[i]) break;
                            p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_success", "", 0, 0, 0, 0, `task_id=${i}`), i === this.curTaskId && (this.shortlink = "");
                            let n = e.token_list;
                            if (!n || 1 !== n.length) break;
                            this.accelerationTimes -= 1;
                            let a = n[0];
                            a.btIndex = -1, a.offlineSizeSum = 0, a.useTime = 0, a.downloadSizeSum = 0, a.maxSpeed = 0, this.tokenMap[i] = a;
                            let o = y.getTaskFromTaskId(i), r = o.getTaskBaseInfo(), s = -1, d = 0;
                            if (r.taskType === l.DownloadKernel.TaskType.Bt) {
                                let e = o.getExtraObject().getBtFileList();
                                for (let [, t] of e) if (t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download) && t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileStatus) < 3) {
                                    let e = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileSize);
                                    e > d && (s = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex), d = e)
                                }
                                this.tokenMap[i].btIndex = s
                            }
                            o.getTaskStatus() === l.DownloadKernel.TaskStatus.Started ? this.updateVipCert(i) : h.TaskOperatorNs.startTasks([o.getTaskBaseInfo()]);
                            let u = Math.floor((new Date).getTime() / 1e3);
                            a.timeoutTimer = setTimeout(() => {
                                let e = y.getTaskFromTaskId(i).getTaskStatus();
                                e > 0 && e < 8 && this.exitAccelerate(i), T.warning("#### token过期, clean Accelerate")
                            }, 1e3 * (a.expire - u)), i === this.curTaskId && (this.isAccelerating = !0, this.hasAccelerated = !1)
                        } catch (e) {
                            T.warning(e)
                        }
                    } while (0)
                })), setTimeout(() => a(this, void 0, void 0, function* () {
                    let e = yield c.queryAccelerationTimes();
                    if (!e || void 0 === e.acceleration_times) return;
                    this.accelerationTimes = e.acceleration_times, this.days = e.days;
                    let t = new Date(1e3 * Number(e.date));
                    this.nextDate = `${t.getFullYear()}年${t.getMonth() + 1}月${t.getDate()}日0点重新发放`
                }), 3e3)
            })
        }

        updateTaskInfo(...e) {
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (!i) continue;
                    let n = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                    if (this.tokenMap[n]) break
                }
            } while (0)
        }

        onTaskStatusChange(e) {
            for (let t = 0; t < e.length; t++) {
                let i = e[t], n = i.getId();
                if (!this.tokenMap[n]) continue;
                let a = i.getTaskStatus();
                a === l.DownloadKernel.TaskStatus.Started ? this.updateVipCert(n) : a !== l.DownloadKernel.TaskStatus.Seeding && a !== l.DownloadKernel.TaskStatus.Succeeded && a !== l.DownloadKernel.TaskStatus.Failed || this.tokenMap[n] && this.tokenMap[n].timeoutTimer && (clearTimeout(this.tokenMap[n].timeoutTimer), this.tokenMap[n].timeoutTimer = null, n === this.curTaskId && (this.isAccelerating = !1, this.hasAccelerated = !0), T.warning("#### 任务成功或失败, clean Accelerate"))
            }
        }

        exitAccelerate(e) {
            let t = y.getTaskFromTaskId(e);
            clearTimeout(this.tokenMap[e].timeoutTimer), this.tokenMap[e].timeoutTimer = null, r.client.callServerFunction("DisableDcdnWithVipCert", e, this.tokenMap[e].btIndex), t.setAcclerating(!1), g.server.fireClientEvent("on_qrcode_update_item", e, {}, "cleanup");
            let i = {
                [e]: {
                    isShowVipSpeed: !1,
                    isShowSuperSpeed: !1,
                    isAcclerated: !1,
                    isHuddle: !1,
                    isSensitive: !1,
                    sensitive: null,
                    isShowVipHover: !1,
                    isShowSuperHover: !1,
                    hoverText: "超级加速",
                    hoverType: "MixTry",
                    remindType: "none"
                }
            };
            if (r.client.callServerFunction("UpdateVipSpeedStatus", i), e === this.curTaskId) {
                let e = (this.tokenMap[this.curTaskId].downloadSizeSum - this.tokenMap[this.curTaskId].offlineSizeSum) / this.tokenMap[this.curTaskId].useTime;
                this.saveTime = this.tokenMap[this.curTaskId].downloadSizeSum / e - this.tokenMap[this.curTaskId].useTime, this.isAccelerating = !1, this.hasAccelerated = !0
            }
        }

        updateVipCert(e, t = !0) {
            if (!this.vipSpeedMap[e].isShowVipSpeed && !this.vipSpeedMap[e].isHuddle) {
                y.getTaskFromTaskId(e).setAcclerating(!0), r.client.callServerFunction("UpdateDcdnWithVipCert", e, this.tokenMap[e].token, this.tokenMap[e].btIndex).catch();
                let t = {
                    [e]: {
                        isShowVipSpeed: !0,
                        isShowSuperSpeed: !1,
                        isAcclerated: !1,
                        isHuddle: !1,
                        isSensitive: !1,
                        sensitive: null,
                        isShowVipHover: !1,
                        isShowSuperHover: !1,
                        hoverText: "扫码加速",
                        hoverType: "ScanCode",
                        remindType: "none"
                    }
                };
                r.client.callServerFunction("UpdateVipSpeedStatus", t), g.server.fireClientEvent("on_qrcode_update_item", e, t, "setup")
            }
            t && !this.intervalCalculateChannel && (this.intervalCalculateChannel = setInterval(this.calculateChannel, 1e3))
        }

        calculateChannel() {
            let e = !0, t = Object.keys(this.tokenMap);
            for (let i = 0; i < t.length; i++) {
                let n = Number(t[i]);
                if (this.tokenMap[n] && this.tokenMap[n].timeoutTimer) {
                    e = !1;
                    let t = y.getTaskFromTaskId(n);
                    if (!t) {
                        delete this.tokenMap[n];
                        continue
                    }
                    let i = t.getTaskBaseInfo();
                    this.tokenMap[n].useTime += 1;
                    let a = t.getTaskChannelInfo();
                    if (void 0 !== this.tokenMap[n].lastOfflineSize && this.vipSpeedMap[n].isShowVipSpeed && "扫码加速" === this.vipSpeedMap[n].hoverText && !this.vipSpeedMap[n].isHuddle && "MixTry" !== this.vipSpeedMap[n].hoverType && (this.tokenMap[n].offlineSizeSum += a.offlineSize - this.tokenMap[n].lastOfflineSize, this.tokenMap[n].downloadSizeSum += i.downloadSize - this.tokenMap[n].lastDownloadSize, this.tokenMap[n].maxSpeed = Math.max(t.getDownloadSpeed(), this.tokenMap[n].maxSpeed), this.tokenMap[n].downloadSizeSum >= this.qrcodeConfig.offlineSize)) {
                        this.exitAccelerate(n), T.warning("#### 流量用完, clean Accelerate");
                        continue
                    }
                    if (i.taskType === l.DownloadKernel.TaskType.Bt) {
                        let e = t.getExtraObject().getBtFileList();
                        for (let [, t] of e) t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex) === this.tokenMap[n].btIndex && t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileStatus) === l.DownloadKernel.BtFileStatus.Complete && (this.exitAccelerate(n), T.warning("#### bt子文件下载完成, clean Accelerate"))
                    }
                    this.vipSpeedMap[n].isShowVipSpeed || this.vipSpeedMap[n].isShowSuperSpeed || this.vipSpeedMap[n].isHuddle || this.updateVipCert(n, !1), this.tokenMap[n].lastOfflineSize = a.offlineSize, this.tokenMap[n].lastDownloadSize = i.downloadSize, this.curTaskId === n && (this.maxSpeed = this.tokenMap[n].maxSpeed, this.offlineSize = this.tokenMap[n].downloadSizeSum)
                }
            }
            e && (clearInterval(this.intervalCalculateChannel), this.intervalCalculateChannel = null)
        }

        handleQRCodeHover() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_2d_code_show", "", 0, 0, 0, 0, `position=right_hover,if_child_task_list=${this.isList ? 1 : 0},task_id=${this.curTaskId}`)
        }

        testAccelerate() {
            c.accelerateTest({task_id: String(this.curTaskId)})
        }

        handleClickHelp() {
            v.MessageBox.custom("ScanCodeHelp", {windowWidth: 450, windowHeight: 388})
        }
    };
    n([o.Prop()], w.prototype, "curTaskId", void 0), n([o.Prop()], w.prototype, "vipSpeedInfo", void 0), n([o.Prop({})], w.prototype, "taskBase", void 0), n([o.Prop()], w.prototype, "vipSpeedMap", void 0), n([o.Prop()], w.prototype, "vipInfo", void 0), n([o.Prop()], w.prototype, "curCategoryViewid", void 0), n([o.Watch("accelerationTimes")], w.prototype, "onaccelerationTimesChange", null), n([o.Watch("switchShowType")], w.prototype, "onswitchShowTypeChange", null), n([o.Watch("curTaskId")], w.prototype, "onCurTaskIdChange", null), w = n([o.Component({components: {}})], w), t.default = w
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(239), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(3), s = i(12), l = i(15), d = i(41), u = i(16), c = i(5), h = i(10),
        f = l.DownloadKernelEventManager.getEventManager(), g = i(0).default.getLogger("XlTab.view"),
        p = s.DownloadKernelTaskManager.getTaskManager();
    let v = class extends o.Vue {
        constructor() {
            super(...arguments), this.tabs = [{title: "速度", key: "TaskChart"}, {
                title: "属性",
                key: "Attribute"
            }], this.activeKey = "TaskChart", this.eventOnTaskStatusChange = -1, this.eventOnTabChange = -1, this.eventOnInsertToCategoryView = -1
        }

        OnCurCategoryidChange() {
            this.curCategoryid === r.DownloadKernel.CategroyViewID.Completed && this.tabs && this.tabs.length > 0 && "边下边播" === this.tabs[0].title && (this.tabs[0].title = "播放")
        }

        onCurTaskIdChange() {
            return a(this, void 0, void 0, function* () {
                if (g.information("onCurTaskIdChange", this.curTaskId), 0 === this.curTaskId) return;
                this.curTask = p.getTaskFromTaskId(this.curTaskId);
                let e = this.curTask.isSupportPlay(), t = this.curTask.getTaskStatus(), i = !1,
                    n = this.curTask.getTaskBaseInfo();
                t !== r.DownloadKernel.TaskStatus.Seeding && t !== r.DownloadKernel.TaskStatus.Succeeded || (i = yield d.TaskCtrlOperatorNS.isExistTaskFile(n));
                let a = [];
                e && this.curCategoryid === r.DownloadKernel.CategroyViewID.Downloading && t !== r.DownloadKernel.TaskStatus.Failed ? (a = [{
                    title: "边下边播",
                    key: "Preview"
                }, {
                    title: "速度",
                    key: "TaskChart"
                }], this.activeKey = "Preview") : e && i && this.curCategoryid === r.DownloadKernel.CategroyViewID.Completed ? (a = [{
                    title: "播放",
                    key: "Preview"
                }, {title: "速度", key: "TaskChart"}], this.activeKey = "Preview") : (a = [{
                    title: "速度",
                    key: "TaskChart"
                }], this.activeKey = "TaskChart"), n && -1 === n.categoryId && a.push({
                    title: "属性",
                    key: "Attribute"
                }), this.tabs = a
            })
        }

        onActiveKeyChange() {
            u.server.fireClientEvent("OnSelectTabChange", this.activeKey, this.curTaskId.toString()), g.information("activeKey: ", this.activeKey), this.$emit("tabChange", this.activeKey)
        }

        onTrack() {
            if (null !== this.activeKey && 0 !== this.curTaskId) {
                let e = "module_type=" + this.activeKey + ",current_tab=" + this.curCategoryid;
                if (0 !== this.curTaskId) {
                    e += `,task_type=${this.curTask.getTaskBaseInfo().categoryId === this.currentCategoryId ? "download" : "getback"}`
                }
                h.XLStatNS.trackEvent("download_detail", "dl_detail_status_show", "", 0, 0, 0, 0, e)
            }
        }

        get track1() {
            return null !== this.activeKey && 0 !== this.curTaskId ? this.activeKey + String(this.curTaskId) : 0
        }

        onTabChange(e) {
            this.activeKey = e
        }

        mounted() {
            this.eventOnInsertToCategoryView = f.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                if (e && e[0] === r.DownloadKernel.TaskEventType.InsertToCategoryView && e[1] && e[2] && e[3]) {
                    g.information("eventOnInsertToCategoryView", e[2]);
                    for (let t of e[3]) if (t && t.taskId === this.curTaskId) {
                        g.information("eventOnInsertToCategoryView call", e[2], this.curTaskId), this.onCurTaskIdChange();
                        break
                    }
                }
            }), this.eventOnTaskStatusChange = f.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                if (!e || e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) return;
                if (!e[1]) return;
                g.information("eventOnTaskStatusChange", e[1]);
                let t = e[1];
                for (let e of t) if (e.getId() === this.curTaskId) {
                    e.getTaskStatus() === r.DownloadKernel.TaskStatus.Failed && (this.tabs = [{
                        title: "速度",
                        key: "TaskChart"
                    }, {title: "属性", key: "Attribute"}], this.activeKey = "TaskChart");
                    break
                }
            }), this.eventOnTabChange = c.client.attachServerEvent("OnTabChange", (e, t) => {
                for (let e = 0; e < this.tabs.length; e++) if (this.tabs[e].key === t) return void (this.activeKey = t)
            })
        }

        beforeDestroy() {
            f.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.eventOnTaskStatusChange), c.client.detachServerEvent("OnTabChange", this.eventOnTabChange), f.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.eventOnInsertToCategoryView)
        }
    };
    n([o.Prop({default: 0})], v.prototype, "curTaskId", void 0), n([o.Prop({default: ""})], v.prototype, "curUserId", void 0), n([o.Prop()], v.prototype, "curCategoryid", void 0), n([o.Prop()], v.prototype, "currentCategoryId", void 0), n([o.Watch("curCategoryid", {immediate: !0})], v.prototype, "OnCurCategoryidChange", null), n([o.Watch("curTaskId", {immediate: !0})], v.prototype, "onCurTaskIdChange", null), n([o.Watch("activeKey", {immediate: !0})], v.prototype, "onActiveKeyChange", null), n([o.Watch("track1")], v.prototype, "onTrack", null), v = n([o.Component({
        components: {
            Preview: () => Promise.resolve().then(() => i(749)),
            Attribute: () => Promise.resolve().then(() => i(754)),
            TaskChart: () => Promise.resolve().then(() => i(756))
        }
    })], v), t.default = v
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(241), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(5), s = i(16), l = i(3), d = i(12), u = i(10), c = i(750), h = i(85), f = i(55), g = i(0),
        p = i(39), v = g.default.getLogger("Thunder-Preview"), m = d.DownloadKernelTaskManager.getTaskManager();
    let y = class extends o.Vue {
        constructor() {
            super(...arguments), this.pageHeight = 0, this.eventOnShowDownAndPlayToast = -1, this.isAnimation = !1, this.eventOnXMPDisconnected = -1, this.isCurTaskPlayingMedia = !1, this.xmpMode = h.XmpMode.UNKNOWN_MODE, this.curViewId = null, this.eventOnXMPModeChanged = -1, this.beginForceLoading = !1, this.clickTaskId = -1, this.playByXmpPlugin = !0, this.showDownAndPlay = !0, this.showYunPlay = !1
        }

        OnCurCategoryidChange() {
            this.curCategoryid === l.DownloadKernel.CategroyViewID.Downloading ? this.showDownAndPlay = !0 : this.showDownAndPlay = !1
        }

        OnCurTaskChange() {
            let e = m.getTaskFromTaskId(this.curTaskId);
            if (e) {
                let t = e.getTaskBaseInfo(), i = e.getIsPrivate();
                -1 === t.categoryId ? this.showYunPlay = !1 : this.showYunPlay = !i
            }
            this.isAnimation = !1, this.checkUIChange(), setTimeout(() => {
                this.getXmpDivRect()
            }, 50)
        }

        OnCurViewChange() {
            this.checkUIChange()
        }

        checkUIChange() {
            this.$nextTick(() => a(this, void 0, void 0, function* () {
                yield this.checkPlayingMedia(), this.isCurTaskPlayingMedia || (this.isAnimation = !0)
            }))
        }

        callXmp(e, ...t) {
            return a(this, void 0, void 0, function* () {
                let i = yield r.client.callRemoteClientFunction(f.mainRendererContext, e, ...t).catch();
                return i && i.length > 0 ? i[0] : {}
            })
        }

        getCurrentMediaId() {
            return a(this, void 0, void 0, function* () {
                return this.callXmp(h.XmpPlayerFunction.getPlayingTaskId)
            })
        }

        get showPlay() {
            return !this.playByXmpPlugin || this.curTaskId !== this.clickTaskId && !this.isCurTaskPlayingMedia
        }

        checkPlayingMedia() {
            return a(this, void 0, void 0, function* () {
                let e = yield this.getCurrentMediaId();
                this.isCurTaskPlayingMedia = parseInt(e, 10) === this.curTaskId;
                let t = yield this.callXmp(h.XmpPlayerFunction.getLastPlayError);
                t && parseInt(t.taskId, 10) === this.curTaskId && (this.isCurTaskPlayingMedia = !0), v.information("checkPlayingMedia", "xmpMode", this.xmpMode, "curMediaId", e, "curTaskId", this.curTaskId, "isCurTaskPlayingMedia", this.isCurTaskPlayingMedia, "clickTaskId", this.clickTaskId), v.information("checkPlayingMedia", "lastPlayError", t)
            })
        }

        getXmpDivRect() {
            return a(this, void 0, void 0, function* () {
                this.$nextTick(() => a(this, void 0, void 0, function* () {
                    let e, t = document.querySelector("div.xly-file-detail div.td-tabs__pane"),
                        i = {width: 0, height: 0, x: 0, y: 0};
                    t && (e = t.getBoundingClientRect()), i.y = e.top > 42 ? e.top : 42, i.x = e.left, i.width = e.width, i.height = e.height, v.information("preview updateDownloadEmbedRect", JSON.stringify(i)), 0 !== i.x && 0 !== i.width && 0 !== i.height && (yield r.client.callServerFunction("UpdateDownloadEmbedRect", i), yield r.client.callServerFunction("ThunderResize"), v.information("play rect", i))
                }))
            })
        }

        play() {
            return a(this, void 0, void 0, function* () {
                this.beginForceLoading = !0, this.clickTaskId = this.curTaskId;
                let e = m.getTaskFromTaskId(this.curTaskId), t = e.getType(),
                    i = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryId);
                if (e.setUserRead(1), yield this.getXmpDivRect(), t === l.DownloadKernel.TaskType.Bt || t === l.DownloadKernel.TaskType.Group) r.client.callServerFunction("PlayBtOrGroupTask", this.curTaskId).then().catch(); else {
                    let t = "download_right_downloading_embed";
                    if (this.curCategoryid === l.DownloadKernel.CategroyViewID.Completed && (t = "download_right_complate_play_embed"), -1 !== i) {
                        let i = e.getIsPrivate();
                        t = i ? "download_private_space_bxbb_play" : "download_right_gettingback_play_click", this.curCategoryid === l.DownloadKernel.CategroyViewID.Completed && (t = i ? "download_private_space_local_play" : "download_right_gotback_play_click")
                    }
                    let n = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), a = n.split("."),
                        o = a[a.length - 1], s = "video";
                    p.TaskUtilHelper.getTaskFileType(n) === p.TaskUtilHelper.FileExtType.Music && (s = "music"), u.XLStatNS.trackEvent("pc_yunpan", "yunpan_consumption_click", "", 0, 0, 0, 0, "from=" + t + ",file_type=" + s + ",suffix=" + o), -1 === this.currentCategoryId && -1 !== e.getTaskBaseInfo().categoryId && (this.curCategoryid === l.DownloadKernel.CategroyViewID.Downloading ? t = "download_getbacking_play" : this.curCategoryid === l.DownloadKernel.CategroyViewID.Completed && (t = "download_getback_complete_play")), r.client.callServerFunction("OperateTask", this.curTaskId, "play", {playFrom: t}).then().catch()
                }
                yield this.checkPlayingMedia();
                let n = "current_tab=" + this.curCategoryid;
                if (0 !== this.curTaskId) {
                    n += `,task_type=${e.getTaskBaseInfo().categoryId === this.currentCategoryId ? "download" : "getback"}`
                }
                u.XLStatNS.trackEvent("download_detail", "dl_detail_play_btn_click", "", 0, 0, 0, 0, n)
            })
        }

        onShowDownAndPlayToast(e, ...t) {
            return a(this, void 0, void 0, function* () {
                yield this.checkPlayingMedia()
            })
        }

        attachPlayerEvent() {
            return a(this, void 0, void 0, function* () {
                [h.XmpEvent.onError, h.XmpEvent.onPlaying, h.XmpEvent.onPreOpen, h.XmpEvent.onPaused, h.XmpEvent.onPlayCompleted, h.XmpEvent.onPreStop, h.XmpEvent.onStop, h.XmpEvent.onXmpClose, h.XmpEvent.onClearError, h.XmpEvent.onOpenSucceeded].forEach(e => {
                    r.client.attachServerEvent(e, (t, ...i) => a(this, void 0, void 0, function* () {
                        switch (v.information("checkPlayingMedia", "xmpEvent", e), e) {
                            case h.XmpEvent.onPreOpen:
                            case h.XmpEvent.onPlaying:
                            case h.XmpEvent.onError:
                            case h.XmpEvent.onXmpClose:
                                this.beginForceLoading = !1, this.clickTaskId = -1
                        }
                        e === h.XmpEvent.onError && (yield this.checkPlayingMedia(), this.isCurTaskPlayingMedia && setTimeout(() => {
                            this.callXmp("showFloatWindow")
                        }, 200)), this.checkUIChange(), e === h.XmpEvent.onOpenSucceeded ? (s.server.fireClientEvent("CanShowStateByScroll", !0), yield this.getXmpDivRect().catch(), yield r.client.callServerFunction("ThunderResize")) : e !== h.XmpEvent.onPaused && e !== h.XmpEvent.onStop || s.server.fireClientEvent("CanShowStateByScroll", !1)
                    }))
                })
            })
        }

        attachUIEvent() {
            return a(this, void 0, void 0, function* () {
                r.client.attachServerEvent("OnCurNavChange", (e, t, i) => a(this, void 0, void 0, function* () {
                    this.curViewId = t
                }))
            })
        }

        OnXmpModeChanged(e, t, i) {
            this.getXmpDivRect().catch()
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.eventOnShowDownAndPlayToast = r.client.attachServerEvent("OnShowDownAndPlayToast", this.onShowDownAndPlayToast), this.attachPlayerEvent(), this.attachUIEvent(), this.curViewId = yield r.client.callServerFunction("GetCurrentNav").catch(), this.eventOnXMPModeChanged = r.client.attachServerEvent("OnXmpModeChanged", this.OnXmpModeChanged), this.playByXmpPlugin = "0" === (yield r.client.callServerFunction("GetConfigValue", "CompletedTaskPlay", "LanuchMediaPlayer", "0"))
            })
        }

        beforeDestroy() {
            this.pageHeight = window.innerHeight, r.client.detachServerEvent("OnShowDownAndPlayToast", this.eventOnShowDownAndPlayToast), r.client.detachServerEvent("OnXmpModeChanged", this.eventOnXMPModeChanged)
        }
    };
    n([o.Prop({default: 0})], y.prototype, "curTaskId", void 0), n([o.Prop()], y.prototype, "currentCategoryId", void 0), n([o.Prop()], y.prototype, "curCategoryid", void 0), n([o.Watch("curCategoryid", {immediate: !0})], y.prototype, "OnCurCategoryidChange", null), n([o.Prop()], y.prototype, "playingCurTask", void 0), n([o.Watch("curTaskId", {immediate: !0})], y.prototype, "OnCurTaskChange", null), n([o.Watch("curViewId", {immediate: !0})], y.prototype, "OnCurViewChange", null), y = n([o.Component({components: {VideoState: c.default}})], y), t.default = y
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(243), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(5), r = i(8), s = i(751), l = i(55), d = i(337), u = i(85), c = i(0).default.getLogger("video-state");
    let h = class extends r.Vue {
        constructor() {
            super(...arguments), this.xmpMediaState = u.XmpMediaState.Invalid, this.xmpMediaStateDesc = "", this.isYunBo = !1, this.isDownloadAndPlay = !1, this.isLocalPlay = !1, this.errorText = "", this.errorCode = 0, this.speedText = "0KB", this.xmpMode = u.XmpMode.UNKNOWN_MODE, this.isDownloadCodecEvent = !1, this.name = "", this.progress = 0, this.progressStye = "width:0%", this.isDownloadCodec = !1, this.xmpClose = !1, this.bufferPercent = 100, this.isNewVideo = !0, this.forceLoading = 0, this.codecTimeOut = null, this.preShowPage = ""
        }

        onPanFileIdChange() {
            this.isNewVideo = !0
        }

        onForceLoadingChange() {
            this.emitState()
        }

        onStateDescChange() {
            this.emitState()
        }

        onBufferPercentChange() {
            this.emitState()
        }

        onIsDownloadCodecChange() {
            this.emitState()
        }

        onXmpModeChange() {
            this.information("onXmpModeChange", this.xmpMode), this.$emit("xmp-mode-change", this.xmpMode)
        }

        onBeginForceLoadingChange() {
            this.emitState()
        }

        emitState() {
            let e = "";
            this.isDownloadCodec ? e = "codec" : this.isLoading ? e = "loading" : this.isBuffering ? e = "buffering" : this.isError ? e = "error" : this.isPlaying ? e = "playing" : this.xmpClose && (e = "close"), this.information("video-state-change", e, "desc", this.xmpMediaStateDesc, "buffer", this.bufferPercent, "forceloading", this.forceLoading), this.$emit("video-state-change", e)
        }

        information(...e) {
            this.loggerEnable && c.information(this.isEmbed ? "in preview" : "in float", this.isXmpEmbedPlay ? "embedplay" : "windowplay", "xmpState", this.xmpMediaState, "userHelper.isVip", s.default.isVip, "xmpMode", this.xmpMode, "beginForceloading", this.beginForceLoading, ...e)
        }

        get fileName() {
            return this.name
        }

        get downloadProgress() {
            return this.progress + "%"
        }

        attachDownloadCodecEvent() {
            o.client.attachServerEvent("OnDownloadCodec", () => {
                this.isDownloadCodecEvent = !0, this.isDownloadCodec = !0, this.checkXmpStateDesc(), this.codecTimeOut && (clearTimeout(this.codecTimeOut), this.codecTimeOut = null)
            }), o.client.attachServerEvent("OnDownloadCodecProgress", (e, t, i) => a(this, void 0, void 0, function* () {
                this.name = t, this.progress = i, this.progressStye = "width:" + i + "%", 100 === i ? this.codecTimeOut = setTimeout(() => {
                    this.isDownloadCodec = !1, this.checkXmpStateDesc()
                }, 1500) : this.codecTimeOut && (clearTimeout(this.codecTimeOut), this.codecTimeOut = null)
            })), o.client.callRemoteClientFunction(l.mainRendererContext, "OnGetCachedDownloadCodecInfo").then(e => {
                !this.isDownloadCodecEvent && e[0] && e[0].downloading && (this.isDownloadCodec = !0, this.name = e[0].name, this.progress = e[0].progress, this.progressStye = "width:" + e[0].progress + "%", this.checkXmpStateDesc())
            })
        }

        cancelDownload() {
            o.client.callRemoteClientFunction(l.mainRendererContext, "OnCancelDownloadCodecs"), o.client.callRemoteClientFunction(l.mainRendererContext, "XmpPlayerClose")
        }

        created() {
            return a(this, void 0, void 0, function* () {
                this.xmpMode = yield d.CommonNS.callXmp(u.XmpPlayerFunction.getXmpCurrentMode), this.information("this.xmpMode", this.xmpMode), this.forceLoading = yield d.CommonNS.callXmp("IsForceloading"), this.attachPlayerEvent(), yield this.checkXmpStateDesc(), yield this.checkPlayType(), this.emitState(), this.attachDownloadCodecEvent()
            })
        }

        attachPlayerEvent() {
            return a(this, void 0, void 0, function* () {
                [u.XmpEvent.onError, u.XmpEvent.onOpenSucceeded, u.XmpEvent.onPlaying, u.XmpEvent.onPreOpen, u.XmpEvent.onPaused, u.XmpEvent.onPlayCompleted, u.XmpEvent.onPreStop, u.XmpEvent.onStop, u.XmpEvent.onForceLoadingState, u.XmpEvent.onBuffer, u.XmpEvent.onXmpClose, u.XmpEvent.onAllStoped, u.XmpEvent.onClearError].forEach(e => {
                    o.client.attachServerEvent(e, (t, ...i) => a(this, void 0, void 0, function* () {
                        switch (e === u.XmpEvent.onXmpClose || e === u.XmpEvent.onStop ? this.xmpClose = !0 : this.xmpClose = !1, e) {
                            case u.XmpEvent.onPreOpen:
                                this.bufferPercent = 100, this.forceLoading = yield d.CommonNS.callXmp("IsForceloading"), this.checkPlayType();
                                break;
                            case u.XmpEvent.onError:
                                this.errorText = u.XmpErrorCodeNS.getErrorTextByErrorCode(i[1]), this.errorCode = i[1];
                                break;
                            case u.XmpEvent.onForceLoadingState:
                                this.forceLoading = i[0];
                                break;
                            case u.XmpEvent.onClearError:
                                this.isError && (this.errorCode = 0, this.xmpMediaStateDesc = "");
                                break;
                            case u.XmpEvent.onBuffer:
                                this.bufferPercent = Number(i[0])
                        }
                        this.information("onXmpEvent", e, t, ...i), this.checkXmpStateDesc(void 0, e), this.emitState()
                    }))
                }), o.client.attachServerEvent(u.ModeChangeEvent.onXmpModeChanged, (e, t, i, n) => a(this, void 0, void 0, function* () {
                    this.xmpMode = i, this.information("onXmpModeChanged", t, i)
                }))
            })
        }

        backToEmbed() {
            d.CommonNS.callXmp(u.XmpPlayerFunction.setXmpCurrentMode, u.XmpMode.EMBED_MODE), o.client.callServerFunction("TrackEvent", "core_event", "player_function_click", "", 0, 0, 0, 0, "button=embed_play,components_type=independent").catch()
        }

        get errCode() {
            let e = "0x0";
            return this.errorCode && (e = "0x" + this.errorCode.toString(16).toLocaleUpperCase()), e
        }

        get isError() {
            return "error" === this.xmpMediaStateDesc
        }

        get isLoading() {
            return !this.xmpClose && ("loading" === this.xmpMediaStateDesc || this.beginForceLoading)
        }

        get isBuffering() {
            return !this.xmpClose && (2 === this.forceLoading || 1 === this.forceLoading || 100 !== this.bufferPercent)
        }

        get isPlaying() {
            return "playing" === this.xmpMediaStateDesc
        }

        checkPlayType() {
            return a(this, void 0, void 0, function* () {
                this.isYunBo = yield d.CommonNS.isYunBo(), this.isDownloadAndPlay = yield d.CommonNS.isPlayAndDownload(), this.isLocalPlay = yield d.CommonNS.isLocalPlay(), this.information("checkPlayType", this.isYunBo, this.isDownloadAndPlay, this.isLocalPlay)
            })
        }

        checkXmpStateDesc(e, t) {
            return a(this, void 0, void 0, function* () {
                switch (this.xmpMediaState = e || (yield d.CommonNS.callXmp(u.XmpPlayerFunction.getState)), this.information("checkXmpStateDesc", this.xmpMediaState, this.bufferPercent), this.xmpMediaState) {
                    case u.XmpMediaState.PreOpen:
                    case u.XmpMediaState.Opening:
                        this.xmpMediaStateDesc = "loading";
                        break;
                    case u.XmpMediaState.Paused:
                    case u.XmpMediaState.Playing:
                    case u.XmpMediaState.Play:
                    case u.XmpMediaState.Pausing:
                        this.xmpMediaStateDesc = "playing";
                        break;
                    case u.XmpMediaState.Completed:
                        this.xmpMediaStateDesc = "stoped";
                        break;
                    case u.XmpMediaState.Stopped:
                        this.isError || (this.xmpMediaStateDesc = "stoped");
                        break;
                    case u.XmpMediaState.Error:
                        this.xmpMediaStateDesc = "error";
                        break;
                    default:
                        let t = yield d.CommonNS.callXmp(u.XmpPlayerFunction.getLastPlayError),
                            i = yield d.CommonNS.getCurrentTaskIdOrPanId();
                        t && t.taskId === i && (this.errorCode = t.error, this.errorText = u.XmpErrorCodeNS.getErrorTextByErrorCode(this.errorCode))
                }
                if (t === u.XmpEvent.onClearError && (this.xmpMediaStateDesc = "loading"), 0 !== this.errorCode && (this.xmpMediaStateDesc = "error"), this.xmpClose && !this.isError && (this.xmpMediaStateDesc = "close"), this.isBuffering && (this.xmpMediaStateDesc = "buffering"), this.isDownloadCodec && (this.xmpMediaStateDesc = "codec"), this.isLoading || this.isBuffering) {
                    this.speedText = "0KB";
                    let e = yield d.CommonNS.callXmp(u.XmpPlayerFunction.getDownloadAndPlayTaskData);
                    if (e) {
                        let t = e.speed / 1024;
                        t > 1024 ? (t /= 1024, this.speedText = `${t.toFixed(2)}MB`) : this.speedText = `${t.toFixed(0)}KB`;
                        let i = setTimeout(() => {
                            this.checkXmpStateDesc(), clearTimeout(i)
                        }, 1500)
                    }
                } else if ("" === this.xmpMediaStateDesc) {
                    let e = setTimeout(() => {
                        o.client.callRemoteClientFunction(l.mainRendererContext, "OnGetCachedDownloadCodecInfo").then(e => {
                            !this.isDownloadCodecEvent && e[0] && e[0].downloading && (this.isDownloadCodec = !0, this.name = e[0].name, this.progress = e[0].progress, this.progressStye = "width:" + e[0].progress + "%", this.checkXmpStateDesc())
                        }), this.checkXmpStateDesc(), clearTimeout(e)
                    }, 500)
                }
            })
        }

        onHangleRetry() {
            return a(this, void 0, void 0, function* () {
                c.warning(" onHangleRetry"), o.client.callServerFunction("TrackEvent", "core_event", "player_fail_play_click", "", 0, 0, 0, 0, `errorcode=${this.errCode}`).catch();
                let e = yield d.CommonNS.callXmp(u.ConfigFunction.getConfigValue, "APlayerConfig", "LastPlayMediaId", 0),
                    t = yield d.CommonNS.callXmp(u.XmpPlayerFunction.openMedia, e);
                c.warning(t)
            })
        }

        get isXmpEmbedPlay() {
            return !(this.xmpMode === u.XmpMode.INDEPENDENT_MODE)
        }

        openPayVip(e) {
            return a(this, void 0, void 0, function* () {
                e && this.trackOpenVipBtn(!1), d.CommonNS.callXmp("BufferClickVipBtn")
            })
        }

        trackOpenVipBtnEx() {
            return setTimeout(() => {
                this.trackOpenVipBtn(!0).catch()
            }, 0), !0
        }

        trackShowErrorPage() {
            return setTimeout(() => {
                o.client.callServerFunction("TrackEvent", "core_event", "player_fail_play_show", "", 0, 0, 0, 0, `errorcode=${this.errCode}`).catch()
            }, 0), !0
        }

        trackOpenVipBtn(e) {
            return a(this, void 0, void 0, function* () {
                let t = new Map;
                t.set("play_from", yield d.CommonNS.getStatPlayfrom()), t.set("components_type", this.isXmpEmbedPlay ? "embed" : "independent"), t.set("vip_type", s.default.vipType), t.set("btn_position", "play_buffer");
                let i = e ? "player_video_load_open_yunbo_btn_show" : "player_video_load_open_yunbo_btn_click";
                if (e) return void d.CommonNS.trackShowEvnet("core_event", i + "play_buffer", t);
                let n = function (e) {
                    let t = "";
                    return e.forEach((e, i) => {
                        "" !== t && (t += ","), t = t + i + "=" + e
                    }), t
                }(t);
                o.client.callServerFunction("TrackEvent", "core_event", i, "", 0, 0, 0, 0, n).catch()
            })
        }

        isCanShowPage1(e) {
            let t = !1;
            switch (e) {
                case"codec":
                    t = !1;
                    break;
                case"error":
                    t = this.isError;
                    break;
                case"yunbo_vip":
                    t = this.isLoading && this.isYunBo && s.default.isVip;
                    break;
                case"yobon_novip":
                    t = this.isLoading && this.isYunBo && !s.default.isVip;
                    break;
                case"play_and_download_vip":
                    t = this.isLoading && this.isDownloadAndPlay && s.default.isVip;
                    break;
                case"play_and_download_novip":
                    t = this.isLoading && this.isDownloadAndPlay && !s.default.isVip;
                    break;
                case"local_play":
                    t = this.isLoading && this.isLocalPlay;
                    break;
                case"back_to_embed":
                    t = !1
            }
            return t
        }

        isCanShowPage2(e) {
            let t = !1;
            switch (e) {
                case"codec":
                case"error":
                case"yunbo_vip":
                case"yobon_novip":
                case"play_and_download_vip":
                case"play_and_download_novip":
                case"local_play":
                    t = !1;
                    break;
                case"back_to_embed":
                    t = !0
            }
            return t
        }

        isCanShowPage3(e) {
            let t = !1;
            switch (e) {
                case"codec":
                    t = this.isDownloadCodec;
                    break;
                case"error":
                    t = !1;
                    break;
                case"yunbo_vip":
                    t = this.isNewVideo ? this.isBuffering && this.isYunBo && s.default.isVip : (this.isLoading || this.isBuffering) && this.isYunBo && s.default.isVip;
                    break;
                case"yobon_novip":
                    t = this.isNewVideo ? this.isBuffering && this.isYunBo && !s.default.isVip : (this.isLoading || this.isBuffering) && this.isYunBo && !s.default.isVip;
                    break;
                case"play_and_download_vip":
                    t = this.isBuffering && this.isDownloadAndPlay && s.default.isVip;
                    break;
                case"play_and_download_novip":
                    t = this.isBuffering && this.isDownloadAndPlay && !s.default.isVip;
                    break;
                case"local_play":
                case"back_to_embed":
                    t = !1
            }
            return t
        }

        isCanShowPage4(e) {
            let t = !1;
            switch (e) {
                case"codec":
                    t = this.isDownloadCodec;
                    break;
                case"error":
                    t = this.isError;
                    break;
                case"yunbo_vip":
                    t = (this.isLoading || this.isBuffering) && this.isYunBo && s.default.isVip;
                    break;
                case"yobon_novip":
                    t = (this.isLoading || this.isBuffering) && this.isYunBo && !s.default.isVip;
                    break;
                case"play_and_download_vip":
                    t = (this.isLoading || this.isBuffering) && this.isDownloadAndPlay && s.default.isVip;
                    break;
                case"play_and_download_novip":
                    t = (this.isLoading || this.isBuffering) && this.isDownloadAndPlay && !s.default.isVip;
                    break;
                case"local_play":
                    t = this.isLoading && this.isLocalPlay;
                    break;
                case"back_to_embed":
                    t = !1
            }
            return t
        }

        isCanShowPage(e) {
            let t = !1;
            if (t = this.isEmbed ? this.isXmpEmbedPlay ? this.isCanShowPage1(e) : this.isCanShowPage2(e) : this.isXmpEmbedPlay ? this.isCanShowPage3(e) : this.isCanShowPage4(e)) {
                if (this.information("showpage", e, this.isDownloadCodec), this.preShowPage !== e) switch (this.preShowPage = e, e) {
                    case"error":
                        this.trackShowErrorPage();
                        break;
                    case"yunbo_vip":
                        break;
                    case"yobon_novip":
                        this.trackOpenVipBtnEx()
                }
            } else "nothing" === e && (this.preShowPage = "");
            return t
        }

        isCanShowPageEx(e) {
            return this.preShowPage === e
        }
    };
    n([r.Prop({default: !1})], h.prototype, "isEmbed", void 0), n([r.Prop({default: ""})], h.prototype, "panFileId", void 0), n([r.Prop({default: !1})], h.prototype, "beginForceLoading", void 0), n([r.Prop({default: !0})], h.prototype, "loggerEnable", void 0), n([r.Watch("panFileId")], h.prototype, "onPanFileIdChange", null), n([r.Watch("forceLoading")], h.prototype, "onForceLoadingChange", null), n([r.Watch("xmpMediaStateDesc")], h.prototype, "onStateDescChange", null), n([r.Watch("bufferPercent")], h.prototype, "onBufferPercentChange", null), n([r.Watch("isDownloadCodec")], h.prototype, "onIsDownloadCodecChange", null), n([r.Watch("xmpMode")], h.prototype, "onXmpModeChange", null), n([r.Watch("beginForceLoading")], h.prototype, "onBeginForceLoadingChange", null), h = n([r.Component], h), t.default = h
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(245), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(8), r = i(3), s = i(12), l = i(15);
    let d = i(755);
    const u = i(13), c = a.default.getLogger("task-detail-Attribute"), h = s.DownloadKernelTaskManager.getTaskManager(),
        f = l.DownloadKernelEventManager.getEventManager();
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.eventOnTaskDetailChange = -1, this.myChart = null, this.originSize = 0, this.p2pSize = 0, this.p2sSize = 0, this.offlineSize = 0, this.channelSize = 0, this.downloadSize = 0, this.fileSize = 0
        }

        get originPercent() {
            return 0 === this.fileSize ? "0.00" : (this.originSize / this.fileSize * 100).toFixed(2)
        }

        get p2pPercent() {
            return 0 === this.fileSize ? "0.00" : (this.p2pSize / this.fileSize * 100).toFixed(2)
        }

        get p2sPercent() {
            return 0 === this.fileSize ? "0.00" : (this.p2sSize / this.fileSize * 100).toFixed(2)
        }

        get offlinePercent() {
            return 0 === this.fileSize ? "0.00" : (this.offlineSize / this.fileSize * 100).toFixed(2)
        }

        get undownloadSize() {
            return 0 === this.fileSize ? 1 : this.task.getTaskStatus() === r.DownloadKernel.TaskStatus.Seeding || this.task.getTaskStatus() === r.DownloadKernel.TaskStatus.Succeeded ? 0 : Math.max(this.fileSize - this.downloadSize, 0)
        }

        get undownloadPercent() {
            return 0 === this.fileSize ? "0.00" : (this.undownloadSize / this.fileSize * 100).toFixed(2)
        }

        get fileSizeFormat() {
            return this.formatSize(this.fileSize)
        }

        watchTaskInfoChange() {
            this.task = h.getTaskFromTaskId(this.curTaskId), this.drawTaskInfo(!1)
        }

        drawPie(e = !0) {
            if (null == this.myChart) return;
            let t = {
                legend: {orient: "vertical", left: 10},
                series: [{
                    type: "pie",
                    radius: ["80%", "100%"],
                    avoidLabelOverlap: !1,
                    hoverAnimation: !1,
                    animation: e,
                    itemStyle: {normal: {label: {show: !1}, labelLine: {show: !1}}},
                    color: ["#7ee09e", "#23D9D6", "#3980FA", "#FECB56", "#e6eeff"],
                    data: [{value: this.originSize}, {value: this.p2sSize}, {value: this.p2pSize}, {value: this.offlineSize}, {value: this.undownloadSize}]
                }]
            };
            t && "object" == typeof t && this.myChart.setOption(t, !0)
        }

        formatSize(e) {
            return u.ThunderUtil.formatSize(e)
        }

        init() {
            this.task = h.getTaskFromTaskId(this.curTaskId);
            let e = document.getElementById("chart");
            this.myChart = d.init(e), window.addEventListener("resize", () => {
                this.myChart.resize()
            }), this.drawTaskInfo(!1)
        }

        drawTaskInfo(e = !0) {
            let t = this.task.getTaskChannelInfo(), i = this.task.getTaskBaseInfo();
            this.originSize = t.originSize, this.p2pSize = t.p2pSize, this.p2sSize = t.p2sSize, this.offlineSize = t.offlineSize, this.channelSize = this.originSize + this.p2pSize + this.p2sSize + this.offlineSize, this.downloadSize = i.downloadSize, this.fileSize = i.fileSize, this.channelSize < this.downloadSize && (this.p2pSize > 0 ? this.p2pSize = this.p2pSize + this.downloadSize - this.channelSize : this.offlineSize > 0 ? this.offlineSize = this.offlineSize + this.downloadSize - this.channelSize : this.originSize > 0 ? this.originSize = this.originSize + this.downloadSize - this.channelSize : this.p2sSize > 0 && (this.p2sSize = this.p2sSize + this.downloadSize - this.channelSize)), this.drawPie(e)
        }

        updateTaskInfo(...e) {
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (i && i.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId) === this.curTaskId) {
                        this.task = i, this.drawTaskInfo();
                        break
                    }
                }
            } while (0)
        }

        mounted() {
            c.information("### attribute mounted"), this.init(), this.eventOnTaskDetailChange = f.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                this.updateTaskInfo(...e)
            })
        }

        beforeDestroy() {
            c.information("### attribute beforeDestroy"), f.detachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.eventOnTaskDetailChange)
        }
    };
    n([o.Prop({default: 0})], g.prototype, "curTaskId", void 0), n([o.Watch("curTaskId", {immediate: !0})], g.prototype, "watchTaskInfoChange", null), g = n([o.Component], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(247), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(757), a = i(28), o = i(26).DownloadKernelCategoryManager.getCategoryManager();
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            curTaskBase: (e, t) => {
                let i = null, n = t.curTaskId, a = t.currentCategoryId;
                if (-1 === a) {
                    for (let a = 0; a < e.DownloadListState.taskList.length; a++) if (e.DownloadListState.taskList[a].id === t.curCategoryid) {
                        i = e.DownloadListState.taskList[a].tasksMap[n];
                        break
                    }
                } else if (o.isPrivateCategory(a)) for (let a = 0; a < e.DownloadListState.taskListPrivate.length; a++) e.DownloadListState.taskListPrivate[a].id === t.curCategoryid && (i = e.DownloadListState.taskListPrivate[a].tasksMap[n]);
                return i
            },
            vipSpeedInfo: (e, t) => {
                let i = null, n = t.curTaskId;
                return i = e.VipSpeedState.vipSpeedMap[n] ? e.VipSpeedState.vipSpeedMap[n] : e.VipSpeedState.defaultStatus
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(249), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(0), r = i(4), s = i(3), l = i(12), d = i(15), u = i(41), c = i(66), h = i(346), f = i(758), g = i(8),
        p = i(13), v = i(347), m = i(23), y = i(10), k = i(39), T = d.DownloadKernelEventManager.getEventManager(),
        w = l.DownloadKernelTaskManager.getTaskManager(), C = o.default.getLogger("TaskChart");
    let S = class extends g.Vue {
        constructor() {
            super(...arguments), this.width = 0, this.height = 0, this.progress = 0, this.avgSpeed = 0, this.maxSpeed = 0, this.downloadSpeed = 0, this.vipSpeed = 0, this.taskSpeedInfo = {}, this.curTask = {}, this.speedCurveColor = {
                gradientColorEnd: "rgba(63,133,255,.1)",
                gradientColorStart: "rgba(63,133,255,.5)",
                lineColorEnd: "#3F85FF",
                lineColorStart: "#3F85FF"
            }, this.whiteVipSpeedCurveColor = {
                gradientColorEnd: "rgba(235,121,113,.1)",
                gradientColorStart: "rgba(240,134,127,.5)",
                lineColorEnd: "#eb7971",
                lineColorStart: "#eb7971"
            }, this.superVipSpeedCurveColor = {
                gradientColorEnd: "rgba(235,176,73,.1)",
                gradientColorStart: "rgba(235,176,73,.5)",
                lineColorEnd: "#ebb049",
                lineColorStart: "#ebb049"
            }, this.userSpeedCurveColor = {
                gradientColorEnd: "rgba(63,133,255,.1)",
                gradientColorStart: "rgba(63,133,255,.5)",
                lineColorEnd: "#3f85ff",
                lineColorStart: "#3f85ff"
            }, this.eventOnTaskDetailChange = -1, this.eventOnTaskStatusChange = -1, this.eventOnInsertToCategoryView = -1, this.options = [], this.lastPoint = 0, this.points = [], this.requireAnimation = -1, this.srcUsing = "0", this.srcTotal = "0", this.remain = "--:--:--", this.isBtOrGroup = !1, this.isSupportPlay = !1, this.vipInfo = {}, this.lastPoints = [], this.increasePoints = [], this.curveLeft = 0, this.curveTop = 155, this.downloadingPeriod = 1, this.lastData = [], this.curData = [], this.lastPointX = 0, this.lastPointY = 0, this.maxValue = 0, this.historyMaxValue = 0, this.lastMaxValue = 0, this.maxValueIncrease = 0, this.frame = 10, this.taskFileExist = !0, this.historyVipSpeedColorMap = {}, this.showCurveCutLine = !0
        }

        get curTaskStatus() {
            return this.curTaskBase && this.curTaskBase.taskStatus || s.DownloadKernel.TaskStatus.Unkown
        }

        get curTaskIsTryTask() {
            return (!this.vipInfo || "1" !== this.vipInfo.isVip) && (this.vipSpeedInfo && this.vipSpeedInfo.isShowVipSpeed)
        }

        onCurUserIdChange() {
            return a(this, void 0, void 0, function* () {
                if (this.userSpeedCurveColor = this.speedCurveColor, "" === this.curUserId) this.vipInfo = {}; else {
                    if (this.vipInfo = m.LoginHelperNS.loginHelper.getVipInfo(), "0" === this.vipInfo.isVip) return;
                    "3" === this.vipInfo.vasType || "2" === this.vipInfo.vasType ? this.userSpeedCurveColor = this.whiteVipSpeedCurveColor : "5" === this.vipInfo.vasType && (this.userSpeedCurveColor = this.superVipSpeedCurveColor)
                }
                let e = this.filteredData[0] ? [].concat(Object.values(Object.values(this.filteredData[0]))) : [];
                this.maxValue = this.getMaxValue(e), this.draw(!1)
            })
        }

        onTaskChange() {
            return a(this, void 0, void 0, function* () {
                if (0 === this.curTaskId) return;
                this.lastPoint = 0, this.curTask = w.getTaskFromTaskId(this.curTaskId), this.isDestroyed(), this.isSupportPlay = this.isTaskSupportPlay();
                let e = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                    t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                    i = this.curTask.getTaskStatus(), n = 0;
                0 !== t && 0 !== e && (n = i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding || e >= t ? 100 : Math.floor(e / t * 100)), this.taskSpeedInfo = yield this.getHistorySpeedInfo(this.curTaskId, n), yield this.getHistoryVipSpeedColor(), this.maxSpeed = this.taskSpeedInfo.maxSpeed;
                let a = this.curTask.getType();
                this.isBtOrGroup = a === s.DownloadKernel.TaskType.Bt || a === s.DownloadKernel.TaskType.Group, this.updateDownloadInfo();
                let o = this.filteredData[0] ? [].concat(Object.values(Object.values(this.filteredData[0]))) : [];
                this.maxValue = this.getMaxValue(o), this.draw(!1)
            })
        }

        updateOptions() {
            this.$set(this.options, 0, {
                speedCurveColor: this.speedCurveColor,
                data: this.taskSpeedInfo.historySpeedMap
            })
        }

        formatSize(e) {
            return p.ThunderUtil.formatSize(e)
        }

        trackEvent(e) {
            do {
                let t = "download_right_downloading_embed", i = this.curTask.getTaskBaseInfo().categoryId,
                    n = this.curTask.getIsPrivate();
                if (-1 === i || n) break;
                let a = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), o = a.split("."),
                    r = o[o.length - 1], l = "video";
                if (k.TaskUtilHelper.getTaskFileType(a) === k.TaskUtilHelper.FileExtType.Music && (l = "music"), "play" === e) t = "download_right_gotback_play_click"; else {
                    if ("bianxiabianbo" !== e) break;
                    t = "download_right_gettingback_play_click"
                }
                y.XLStatNS.trackEvent("pc_yunpan", "yunpan_consumption_click", "", 0, 0, 0, 0, "from=" + t + ",file_type=" + l + ",suffix=" + r)
            } while (0)
        }

        operate(e, t) {
            if (this.trackEvent(e), "play" === e) {
                this.$emit("tabChange", "Preview"), t || (t = {});
                let e = "download_right_complate_speed_embed";
                -1 === this.currentCategoryId && -1 !== this.curTaskBase.categoryId && (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading ? e = "download_getbacking_play" : this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && (e = "download_getback_complete_play")), t.playFrom = e
            }
            let i = "button=" + e + ",current_tab=" + this.currentCategoryViewId;
            if (0 !== this.curTaskId) {
                i += `,task_type=${this.curTask.getTaskBaseInfo().categoryId === this.currentCategoryId ? "download" : "getback"}`
            }
            y.XLStatNS.trackEvent("download_detail", "dl_detail_speed_btn_click", "", 0, 0, 0, 0, i), v.TaskOperate.operateTaskActions(this.curTaskId, e, t)
        }

        get isYunGetBackTask() {
            let e = !(!this.curTaskBase || -1 === this.curTaskBase.categoryId);
            return C.information("isYunGetBackTask curTaskBase", this.curTaskBase, "ret", e), e
        }

        get isFast() {
            return [8, 10].includes(this.curTaskStatus) && 1 === this.downloadingPeriod
        }

        get vipType() {
            let e = !1;
            if (this.curTaskIsTryTask && this.historyVipSpeedColorMap) {
                let t = Object.keys(this.historyVipSpeedColorMap), i = t[t.length - 1];
                if (!0 === (e = [1, 2].includes(+this.historyVipSpeedColorMap[i]))) return 1 == +this.historyVipSpeedColorMap[i] ? "is-vip" : "is-super"
            }
            return this.vipInfo ? 1 != +this.vipInfo.isVip || "3" !== this.vipInfo.vasType && "2" !== this.vipInfo.vasType ? 1 == +this.vipInfo.isVip && "5" === this.vipInfo.vasType ? "is-super" : "" : "is-vip" : ""
        }

        isDestroyed() {
            return a(this, void 0, void 0, function* () {
                let e = !0;
                this.curTaskStatus !== s.DownloadKernel.TaskStatus.Seeding && this.curTaskStatus !== s.DownloadKernel.TaskStatus.Succeeded || (e = yield u.TaskCtrlOperatorNS.isExistTaskFile(this.curTaskBase)), this.taskFileExist = e
            })
        }

        get curTaskErrorType() {
            if (0 === this.curTaskId || this.curTaskStatus !== s.DownloadKernel.TaskStatus.Failed) return null;
            let e = "未知错误";
            switch (this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode)) {
                case s.DownloadKernel.TaskError.Unkown:
                    e = "未知错误";
                    break;
                case s.DownloadKernel.TaskError.Create:
                    e = "任务创建失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.InvaldLink:
                    e = "任务链接失效, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.InvaldConfig:
                    e = "任务配置文件错误, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.Timeout:
                    e = "任务连接超时, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.VerifyData:
                    e = "任务校验失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.Forbidden:
                    e = "任务被禁止下载, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FilePathOverRanging:
                    e = "文件路径超出系统限制, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileCreate:
                    e = "文件创建失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileWrite:
                    e = "文件写入失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileRead:
                    e = "文件读取失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileRename:
                    e = "文件重命名失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileFull:
                    e = "磁盘空间不足, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileOccupied:
                    e = "文件被占用, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileAccessDenied:
                    e = "权限不足, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.BtUploadExist:
                    e = "BT任务已存在, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.ForbinddenResource:
                    e = "敏感资源, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.ForbinddenAccount:
                    e = "账号异常无法下载";
                    break;
                case s.DownloadKernel.TaskError.ForbinddenArea:
                case s.DownloadKernel.TaskError.ForbinddenCopyright:
                case s.DownloadKernel.TaskError.ForbinddenReaction:
                case s.DownloadKernel.TaskError.ForbinddenPorn:
                    e = "应版权方要求, 无法下载";
                    break;
                case s.DownloadKernel.TaskError.torrentFileNotExist:
                    e = "种子文件不存在, 无法继续下载";
                    break;
                default:
                    e = "未知错误"
            }
            return e
        }

        isTaskSupportPlay() {
            return this.curTask.isSupportPlay()
        }

        get filteredData() {
            return this.filterData(this.options) || []
        }

        transformedData() {
            return this.filteredData.map(e => this.transformData(e))
        }

        getMaxValue(e = []) {
            let t = 0;
            return e.forEach(e => {
                t = Math.max(t, parseInt(e, 10))
            }), t
        }

        filterData(e) {
            return e.map(e => {
                let t = {};
                return Object.keys(e.data).forEach((i, n, a) => {
                    i % this.step != 0 && i !== a.length || (t[i] = e.data[i])
                }), t
            })
        }

        draw(e = !0) {
            let t = this.$refs.dataChart;
            if (this.clearCanvas(), cancelAnimationFrame(this.requireAnimation), C.information("draw canvas: ", JSON.stringify(this.transformedData())), 0 === this.width && this.initCanvas(), t && t.getContext) {
                let i = t.getContext("2d");
                this.options.forEach((t, n) => {
                    let a = this.transformedData()[n], o = this.bSplineRender(a);
                    if (this.points = o, e ? this.lastPoint > (a[a.length - 1].xValue || 0) && (e = !0, this.lastData = a, this.lastMaxValue = this.maxValue, this.lastPoint = a[a.length - 1].xValue || 0, this.lastPointX = a[a.length - 1].x || 0, this.lastPointY = a[a.length - 1].y || 0) : (this.lastData = a, this.lastMaxValue = this.maxValue, this.lastPoint = a[a.length - 1].xValue || 0, this.lastPointX = a[a.length - 1].x || 0, this.lastPointY = a[a.length - 1].y || 0), i.setLineDash([]), !1 !== this.curTaskIsTryTask || e) {
                        if (!e && 0 === n) {
                            let e = [], t = [], n = {
                                0: {
                                    gradientColorEnd: "rgba(63,133,255,.1)",
                                    gradientColorStart: "rgba(63,133,255,.5)",
                                    lineColorEnd: "#3F85FF",
                                    lineColorStart: "#3F85FF"
                                },
                                1: {
                                    gradientColorEnd: "rgba(235,121,113,.1)",
                                    gradientColorStart: "rgba(240,134,127,.5)",
                                    lineColorEnd: "#eb7971",
                                    lineColorStart: "#eb7971"
                                },
                                2: {
                                    gradientColorEnd: "rgba(235,176,73,.1)",
                                    gradientColorStart: "rgba(235,176,73,.5)",
                                    lineColorEnd: "#ebb049",
                                    lineColorStart: "#ebb049"
                                }
                            }, a = this.transformedData()[0], o = this.bSplineRender(a);
                            Object.keys(this.historyVipSpeedColorMap || {}).forEach(i => {
                                let n = this.historyVipSpeedColorMap[i] || 0;
                                if (t[t.length - 1] !== n) {
                                    let o = a.find(e => e.xValue === +i);
                                    o && (e.push((o || {x: 0}).x), t.push(n))
                                }
                            });
                            for (let r = 0; r < e.length; r++) {
                                let s = [];
                                if (r === e.length - 1) s = o; else {
                                    let t = o.findIndex(t => t.x >= e[r + 1]);
                                    (s = o.splice(0, t - 1)).push(o[0])
                                }
                                i.setLineDash([]), this.drawLineAndGradient(i, a, n[t[r]].lineColorStart, n[t[r]].lineColorEnd, n[t[r]].gradientColorStart, n[t[r]].gradientColorEnd, 2, s)
                            }
                        }
                    } else this.drawLineAndGradient(i, a, this.userSpeedCurveColor.lineColorStart, this.userSpeedCurveColor.lineColorEnd, this.userSpeedCurveColor.gradientColorStart, this.userSpeedCurveColor.gradientColorEnd, 2, o)
                }), e && (this.requireAnimation = requestAnimationFrame(() => this.drawPoints(i, 0)))
            }
        }

        drawPoints(e, t) {
            if (!(t >= 60)) {
                if (t % (60 / this.frame) != 0) return t += 1, void (this.requireAnimation = requestAnimationFrame(() => this.drawPoints(e, t)));
                59 === t && (this.maxValue = this.lastMaxValue), this.options.forEach((i, n) => {
                    if (0 === t) {
                        this.maxValue = this.lastMaxValue;
                        let e = this.filteredData[0] ? [].concat(Object.values(Object.values(this.filteredData[0]))) : [];
                        this.historyMaxValue = this.getMaxValue(e.slice(0, e.length - 1));
                        let t = e[e.length - 1];
                        t <= this.historyMaxValue ? this.lastMaxValue > this.historyMaxValue ? this.maxValueIncrease = (this.historyMaxValue - this.lastMaxValue) / this.frame : this.maxValueIncrease = 0 : t > this.lastMaxValue && (this.maxValueIncrease = (t - this.lastMaxValue) / this.frame), this.lastMaxValue = this.getMaxValue(e)
                    }
                    this.maxValue += this.maxValueIncrease;
                    let a = Object.assign({}, this.filteredData[0]);
                    a[this.progress] = Math.min(a[this.progress], this.maxValue);
                    let o = this.transformData(a);
                    if (0 === o.length) return;
                    let r = o.length - 1;
                    0 === t ? (this.lastData = o.slice(0, r), this.lastPoint === o[r].xValue || 0 === r ? (this.xPoint = 0, this.lastData[r] = {
                        x: this.lastPointX,
                        y: this.lastPointY
                    }, this.yPoint = (o[r].y - this.lastPointY) / this.frame) : (this.xPoint = (o[r].x - o[r - 1].x) / this.frame, this.yPoint = (o[r].y - o[r - 1].y) / this.frame, this.lastData[r] = {
                        xValue: o[r - 1].xValue,
                        yValue: o[r - 1].yValue,
                        x: o[r - 1].x,
                        y: o[r - 1].y
                    }), this.lastPoint = o[r].xValue, this.lastPointX = o[r].x, this.lastPointY = o[r].y) : (o[r].x = this.lastData[r].x, o[r].y = this.lastData[r].y, this.lastData = o), this.lastData[r].x = this.lastData[r].x + this.xPoint, this.lastData[r].y = this.lastData[r].y + this.yPoint;
                    let s = this.bSplineRender(this.lastData);
                    if (this.clearCanvas(), !1 === this.curTaskIsTryTask) this.drawLineAndGradient(e, this.lastData, this.userSpeedCurveColor.lineColorStart, this.userSpeedCurveColor.lineColorEnd, this.userSpeedCurveColor.gradientColorStart, this.userSpeedCurveColor.gradientColorEnd, 2, s); else if (0 === n) {
                        let t = [], i = [], n = {
                            0: {
                                gradientColorEnd: "rgba(63,133,255,.1)",
                                gradientColorStart: "rgba(63,133,255,.5)",
                                lineColorEnd: "#3F85FF",
                                lineColorStart: "#3F85FF"
                            },
                            1: {
                                gradientColorEnd: "rgba(235,121,113,.1)",
                                gradientColorStart: "rgba(240,134,127,.5)",
                                lineColorEnd: "#eb7971",
                                lineColorStart: "#eb7971"
                            },
                            2: {
                                gradientColorEnd: "rgba(235,176,73,.1)",
                                gradientColorStart: "rgba(235,176,73,.5)",
                                lineColorEnd: "#ebb049",
                                lineColorStart: "#ebb049"
                            }
                        };
                        Object.keys(this.historyVipSpeedColorMap || {}).forEach(e => {
                            let n = this.historyVipSpeedColorMap[e] || 0;
                            if (i[i.length - 1] !== n) {
                                let a = this.lastData.find(t => t.xValue === +e);
                                a && (t.push((a || {x: 0}).x), i.push(n))
                            }
                        });
                        for (let a = 0; a < t.length; a++) {
                            let o = [];
                            if (a === t.length - 1) o = s; else {
                                let e = s.findIndex(e => e.x >= t[a + 1]);
                                (o = s.splice(0, e - 1)).push(s[0])
                            }
                            this.drawLineAndGradient(e, this.lastData, n[i[a]].lineColorStart, n[i[a]].lineColorEnd, n[i[a]].gradientColorStart, n[i[a]].gradientColorEnd, 2, o)
                        }
                    }
                }), t += 1, this.requireAnimation = requestAnimationFrame(() => this.drawPoints(e, t))
            }
        }

        transformData(e = {}) {
            return Object.keys(e).map(e => parseInt(e, 10)).sort((e, t) => e - t).map(t => ({
                xValue: t,
                yValue: parseInt(e[t], 10),
                x: this.width * t / 100,
                y: this.height * this.paddingTopPercent / 100 + this.height * (100 - this.paddingTopPercent - this.paddingBottomPercent) / 100 * (1 - parseInt(e[t], 10) / (this.maxValue || 1))
            }))
        }

        drawLineAndGradient(e, t, i, n, a, o, r, s) {
            if (!t.length || !s.length) return void (this.curveTop = 20);
            e.lineWidth = r * this.scale, e.beginPath(), e.moveTo((s[0] || t[0]).x, (s[0] || t[0]).y);
            let l = this.renderPath(e, s);
            s[l] ? (this.curveLeft = s[l].x / this.scale - 8, this.curveTop = s[l].y / this.scale + 10) : 0 === s.length && (this.curveLeft = 0, this.curveTop = this.height / this.scale);
            let d = e.createLinearGradient(0, 0, t[t.length - 1].x, 0);
            d.addColorStop(0, i), d.addColorStop(1, n), e.strokeStyle = d, e.stroke(), e.lineTo(s[l].x, this.height), e.lineTo(s[0].x, this.height), e.lineTo(s[0].x, s[0].y);
            let u = e.createLinearGradient(0, 0, 0, this.height);
            u.addColorStop(0, a), u.addColorStop(1, o), e.fillStyle = u, e.closePath(), e.fill()
        }

        drawLine(e, t, i, n, a, o) {
            if (!t.length) return;
            if (!o.length) return;
            e.lineWidth = a * this.scale, e.beginPath(), e.moveTo((o[0] || t[0]).x, (o[0] || t[0]).y), this.renderPath(e, o);
            let r = e.createLinearGradient(0, 0, t[t.length - 1].x, 0);
            r.addColorStop(0, i), r.addColorStop(1, n), e.strokeStyle = r, e.stroke()
        }

        drawGradient(e, t, i, n, a) {
            if (!t.length) return;
            if (!a.length) return;
            e.beginPath(), e.moveTo((a[0] || t[0]).x, (a[0] || t[0]).y);
            let o = this.renderPath(e, a);
            e.lineTo(a[o].x, this.height), e.lineTo(a[0].x, this.height), e.lineTo(a[0].x, a[0].y);
            let r = e.createLinearGradient(0, 0, 0, this.height);
            r.addColorStop(0, i), r.addColorStop(1, n), e.fillStyle = r, e.closePath(), e.fill()
        }

        renderPath(e, t) {
            if (0 === t.length) return 0;
            e.moveTo(t[0].x, t[0].y);
            let i = 0;
            for (let n = 1; n < t.length; n++) t[n] && (e.lineTo(t[n].x, t[n].y), i = n);
            return i
        }

        clearCanvas() {
            let e = this.$refs.dataChart;
            if (e && e.getContext) {
                e.getContext("2d").clearRect(0, 0, this.width, this.height)
            }
        }

        bSplineRender(e) {
            return new f.BSpline({
                degree: 3,
                points: e,
                tessellation: Math.round(this.width * this.progress / 100 * 1.5)
            }).curvePoints.map(([e, t]) => ({x: e, y: t}))
        }

        initCanvas() {
            let e = this.$refs.dataChart;
            if (this.$refs.canvasBox) if (this.width = Math.floor(this.$refs.canvasBox.clientWidth) * this.scale, this.height = Math.floor(this.$refs.canvasBox.clientHeight - 40 - this.topMargin) * this.scale, e.setAttribute("width", this.width), e.setAttribute("height", this.height), this.userSpeedCurveColor = this.speedCurveColor, "" === this.curUserId) this.vipInfo = {}; else {
                if (this.vipInfo = m.LoginHelperNS.loginHelper.getVipInfo(), "0" === this.vipInfo.isVip) return;
                "3" === this.vipInfo.vasType || "2" === this.vipInfo.vasType ? this.userSpeedCurveColor = this.whiteVipSpeedCurveColor : "5" === this.vipInfo.vasType && (this.userSpeedCurveColor = this.superVipSpeedCurveColor)
            }
        }

        updateDownloadInfo() {
            if (0 === this.curTaskId) return;
            this.downloadSpeed = this.curTask.getDownloadSpeed(), this.vipSpeed = this.curTask.getVipSpeed(), this.maxSpeed = Math.max(this.maxSpeed, this.downloadSpeed);
            let e = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
            t < 1 && (t = 1), this.downloadingPeriod = t, this.avgSpeed = Math.round(e / t), this.avgSpeed > this.maxSpeed && (this.maxSpeed = this.avgSpeed);
            let i = this.curTask.getTaskStatus();
            if (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) this.progress = 100; else {
                let t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize);
                if (0 !== t && (this.progress = e / t * 100, this.progress = Math.floor(this.progress), this.progress > 100 ? this.progress = 100 : this.progress < 0 && (this.progress = 0)), this.downloadSpeed > 0 && t > 0) {
                    let i = "--:--:--", n = t - e;
                    if (n > 0) {
                        let e = n / this.downloadSpeed;
                        i = c.TimeHelperNS.formatSeconds(e)
                    }
                    this.remain = i
                }
            }
            this.srcUsing = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing), this.srcTotal = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal), r.isNullOrUndefined(this.taskSpeedInfo) || (100 === this.progress && this.taskSpeedInfo.historySpeedMap[this.progress] || (this.taskSpeedInfo.historySpeedMap[this.progress] = this.downloadSpeed), this.updateOptions())
        }

        updateTaskInfo(...e) {
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (i && i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId) === this.curTaskId) {
                        this.updateDownloadInfo(), this.$nextTick(() => this.draw());
                        break
                    }
                }
            } while (0)
        }

        onResize() {
            this.lastPoint = 0, this.initCanvas(), this.draw(!1)
        }

        getHistoryVipSpeedColor() {
            return a(this, void 0, void 0, function* () {
                if (0 === this.curTaskId) return;
                let e = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                    t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                    i = this.curTask.getTaskStatus(), n = 0;
                0 !== t && 0 !== e && (n = i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding || e >= t ? 100 : Math.floor(e / t * 100));
                let a = yield this.getHistorySpeedInfo(this.curTaskId, n);
                this.historyVipSpeedColorMap = a.historyVipSpeedColorMap
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.eventOnTaskDetailChange = T.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, (...e) => a(this, void 0, void 0, function* () {
                    !e || e.length < 3 || 0 == (e[2] & s.DownloadKernel.TaskDetailChangedFlags.UserRead) && 0 == (e[2] & s.DownloadKernel.TaskDetailChangedFlags.PlayPosition) && (yield this.getHistoryVipSpeedColor(), this.updateTaskInfo(...e))
                })), this.eventOnInsertToCategoryView = T.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    if (e && e[0] === s.DownloadKernel.TaskEventType.InsertToCategoryView && e[1] && e[2] && e[3]) {
                        C.information("eventOnInsertToCategoryView", e[2]);
                        for (let t of e[3]) if (t && t.taskId === this.curTaskId) {
                            C.information("eventOnInsertToCategoryView call", e[2], this.curTaskId), this.onTaskChange();
                            break
                        }
                    }
                }), this.initCanvas(), window.addEventListener("resize", this.onResize), this.curveTop = this.height / this.scale
            })
        }

        beforeDestroy() {
            T.detachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, this.eventOnTaskDetailChange), T.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.eventOnTaskStatusChange), T.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.eventOnInsertToCategoryView), window.removeEventListener("resize", this.onResize)
        }

        getHistorySpeedInfo(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = {maxSpeed: 0, historySpeedMap: {}, historyIncreaseSpeedMap: {}},
                    n = yield h.HistoryTaskSpeedInfoNS.getTaskSpeedInfo(e);
                do {
                    if (!n) break;
                    if (!n.maxSpeed || n.maxSpeed < 0) break;
                    i.maxSpeed = n.maxSpeed;
                    let e = n.speedInfoMap;
                    if (!e) break;
                    void 0 === t && (t = 0), (!(t = parseInt(t.toString(), 10)) || t < 0) && (t = 0), t > 100 && (t = 100);
                    let a = {0: 0}, o = {0: 0}, r = {};
                    for (let i in e) if (void 0 !== e[i]) {
                        let n = parseInt(i, 10);
                        if (n <= t) {
                            let t = e[i];
                            a[n] = t.downloadSpeed, o[n] = t.addSpeed, r[n] = t.vipSpeedColor
                        }
                    }
                    i.historySpeedMap = a || {}, i.historyIncreaseSpeedMap = o || {}, i.historyVipSpeedColorMap = r || {}
                } while (0);
                return i
            })
        }
    };
    n([g.Prop()], S.prototype, "currentCategoryId", void 0), n([g.Prop()], S.prototype, "currentCategoryViewId", void 0), n([g.Prop({default: 8})], S.prototype, "paddingTopPercent", void 0), n([g.Prop({default: 0})], S.prototype, "paddingBottomPercent", void 0), n([g.Prop({default: Math.max(window.devicePixelRatio, 2)})], S.prototype, "scale", void 0), n([g.Prop({default: 1})], S.prototype, "step", void 0), n([g.Prop({default: 21})], S.prototype, "topMargin", void 0), n([g.Prop({default: 0})], S.prototype, "curTaskId", void 0), n([g.Prop({default: ""})], S.prototype, "curUserId", void 0), n([g.Prop({})], S.prototype, "curTaskBase", void 0), n([g.Prop()], S.prototype, "vipSpeedInfo", void 0), n([g.Watch("curUserId")], S.prototype, "onCurUserIdChange", null), n([g.Watch("curTaskId", {immediate: !0})], S.prototype, "onTaskChange", null), S = n([g.Component], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(251), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
        mounted() {
        }
    };
    n([a.Prop({default: ""})], o.prototype, "curTaskName", void 0), o = n([a.Component], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(253), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(18), s = i(32), l = i(3), d = i(12), u = i(5), c = i(16), h = i(66), f = i(23), g = i(119),
        p = i(10), v = i(6), m = i(0).default.getLogger("dltab_detail_detail"),
        y = d.DownloadKernelTaskManager.getTaskManager();
    let k = class extends o.Vue {
        constructor() {
            super(...arguments), this.showMore = !1, this.taskName = "", this.files = [], this.taskType = void 0, this.fileSize = 0, this.savePath = "", this.url = "", this.refUrl = "", this.signatureCode = "", this.createTime = "", this.downloadTime = 0, this.downloadTimeStr = "00:00:00", this.description = "", this.copyCodeSuccess = !1, this.serverModule = c.server, this.panFreeSpace = -1, this.panSavePathId = "", this.panFileId = "", this.panTaskId = "", this.panTaskData = {}, this.client = u.client, this.panTaskProgress = 100, this.saveStatus = T.pending, this.timeoutGetProcess = void 0, this.mediaType = "other", this.curTaskBase = {}, this.tracked = !1, this.panTaskType = 0
        }

        onTaskChange() {
            return a(this, void 0, void 0, function* () {
                if (m.information("XlDetail onTaskChange "), this.showMore = !1, clearTimeout(this.timeoutGetProcess), this.init(), 0 !== this.curTaskId) {
                    let e = y.getTaskFromTaskId(this.curTaskId);
                    this.curTaskBase = e.getTaskBaseInfo()
                }
                this.panTaskProgress = 100, this.saveStatus = T.complete, "" === this.curUserId ? (this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", this.getPanTaskType()) : this.queryTaskAndUpdate()
            })
        }

        onUserChange() {
            return a(this, void 0, void 0, function* () {
                clearTimeout(this.timeoutGetProcess), "" !== this.curUserId ? (this.refleshFreeSpace(!1), this.queryTaskAndUpdate()) : (this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", this.panFreeSpace = -1, this.panTaskProgress = 100, this.saveStatus = T.complete, this.getPanTaskType())
            })
        }

        onPanFileIdChange() {
            return a(this, void 0, void 0, function* () {
                if ("" !== this.panFileId) {
                    let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetFiles", [this.panFileId]);
                    e && e[0] && e[0].files.length > 0 && (this.mediaType = this.checkMediaType(e[0].files[0].file_extension), this.$nextTick(() => {
                        if (5 === this.panTaskType) {
                            let e = "";
                            e = this.isSupportPlay ? "play" : "look", this.statShow("show", e)
                        }
                    }))
                }
            })
        }

        get isYunGetBackTask() {
            return !(!this.curTaskBase || -1 === this.curTaskBase.categoryId || -1 !== this.currentCategoryId)
        }

        get isSupportPlay() {
            return "other" !== this.mediaType
        }

        queryTaskAndUpdate() {
            return a(this, void 0, void 0, function* () {
                let e = this.task && this.task.getType(), t = this.curTaskId;
                if (e === l.DownloadKernel.TaskType.Group) {
                    let e = yield g.ThunderPanTaskNS.queryTask(this.curTaskId, this.curUserId);
                    return void (t === this.curTaskId && this.updateGrouptask(e))
                }
                let i = yield g.ThunderPanTaskNS.queryTask(this.curTaskId, this.curUserId);
                if (t === this.curTaskId) {
                    if (i) {
                        if (m.information("### query task", i), i.length > 0 && (i = i[0]), i.FileId) {
                            let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetParentDirectoryPathById", {id: i.FileId});
                            if (t !== this.curTaskId) return void m.warning("queryTaskAndUpdate task changed", this.curTaskId, t);
                            if (m.information("### IpcGetParentDirectoryPathById", e), e && e[0] && "success" === e[0].status && e[0].path.length > 0) {
                                let t = "", n = "";
                                for (let i of e[0].path) t += "\\" + i.id, n += "\\" + i.title;
                                let a = JSON.parse(i.Data), o = {};
                                a.title !== n ? (o = Object.assign(a, {
                                    id: t.slice(1),
                                    title: n.slice(1)
                                }), g.ThunderPanTaskNS.updateTaskPath(i.FileId, JSON.stringify(o))) : o = a, this.panTaskData = o
                            } else if (null !== e[0] || null !== e[1]) {
                                if (!i.PanTaskId) return m.warning("### delete task", i, e), g.ThunderPanTaskNS.deleteTask(null, i.FileId), this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", void this.getPanTaskType();
                                g.ThunderPanTaskNS.updateTaskFileId(i.PanTaskId, ""), i.FileId = ""
                            }
                        }
                        return this.panTaskId = i.PanTaskId, this.panSavePathId = i.PathId, this.panFileId = i.FileId, this.panTaskData = JSON.parse(i.Data), this.getPanTaskProgress(), void this.getPanTaskType()
                    }
                    this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", this.getPanTaskType()
                } else m.warning("queryTaskAndUpdate task changed", this.curTaskId, t)
            })
        }

        onTaskStatusChange() {
            m.information("XlDetail onTaskStatusChange "), this.taskDownloadingInteval && clearInterval(this.taskDownloadingInteval), this.curTaskStatus === l.DownloadKernel.TaskStatus.Started && (this.taskDownloadingInteval = setInterval(() => {
                this.downloadTime += 1, this.downloadTimeStr = h.TimeHelperNS.formatSeconds(this.downloadTime)
            }, 1e3))
        }

        getPanTaskType() {
            "" === this.curUserId && this.curTaskStatus !== l.DownloadKernel.TaskStatus.Failed ? this.panTaskType = 1 : this.panTaskId || this.panFileId || 9 !== this.curTaskStatus ? this.panTaskId || this.panFileId || !(-1 === this.panFreeSpace || this.panFreeSpace >= this.fileSize) ? -1 !== this.panFreeSpace && this.panFreeSpace < this.fileSize ? this.panTaskType = 4 : (this.panTaskId || this.panFileId) && (this.panTaskType = 5) : this.panTaskType = 3 : this.panTaskType = 2
        }

        onPanTaskTypeChange(e, t) {
            e === t && void 0 !== e || (this.$nextTick(() => a(this, void 0, void 0, function* () {
                let e = "";
                1 === this.panTaskType ? e = "receive" : 2 === this.panTaskType ? e = "unsave" : 3 === this.panTaskType ? e = "save" : 4 === this.panTaskType && (e = "refresh"), e && this.statShow("show", e)
            })), c.server.fireClientEvent("OnPanTaskTypeChange", this.panTaskType))
        }

        onPanTaskDataChange() {
            c.server.fireClientEvent("OnPanTaskDataChange", this.panTaskData)
        }

        onSaveStatusChange() {
            c.server.fireClientEvent("UpdateSaveStatus", this.saveStatus)
        }

        showLoginWnd() {
            f.LoginHelperNS.loginHelper.showLoginDlg("TaskDetail"), this.statShow("click", "receive")
        }

        onClickPath() {
            return a(this, void 0, void 0, function* () {
                "" !== this.curUserId && this.curUserId ? (this.$emit("switchNav", "pan-plugin-view"), yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRedirectCurrentDirectoryById", {id: this.panFileId})) : yield f.LoginHelperNS.loginHelper.showLoginDlg("download_left_panel")
            })
        }

        consumePanTask(e, t, ...i) {
            return a(this, void 0, void 0, function* () {
                if ("0" === this.curUserId || "" === this.curUserId) return void f.LoginHelperNS.loginHelper.showLoginDlg("TaskDetail");
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetParentDirectoryPathById", {id: this.panFileId});
                e && null !== e[2] && void 0 !== e[2] && (this.task.getType() === l.DownloadKernel.TaskType.Group ? yield this.queryTaskAndUpdate() : (this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", this.saveStatus = T.complete, this.panTaskProgress = 100), this.getPanTaskType());
                let n = !1;
                if (i && void 0 !== i[0] && (n = i[0]), this.isSupportPlay) {
                    let e = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName).split("."),
                        i = e[e.length - 1];
                    t ? n || p.XLStatNS.trackEvent("pc_yunpan", "yunpan_consumption_click", "", 0, 0, 0, 0, `from=download_left_hanging_note,filetype=${this.mediaType},suffix=${i}`) : p.XLStatNS.trackEvent("pc_yunpan", "yunpan_consumption_click", "", 0, 0, 0, 0, `from=download_right_detail_play_click,filetype=${this.mediaType},suffix=${i}`);
                    let a = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "ShowFileDetail", {
                        fileId: this.panFileId,
                        isPlayInstantly: this.isSupportPlay && !n,
                        redirect: !0,
                        mode: "panel",
                        playFrom: "download_detail_yunpan_click"
                    });
                    if (a && a[0] && a[0].audit) {
                        let e = a[0].audit.status, t = a[0].audit.title;
                        "STATUS_OK" !== e && t && this.$message({message: t, type: "error", position: "middle"})
                    }
                } else this.$emit("switchNav", "pan-plugin-view"), this.task && this.task.getType() === l.DownloadKernel.TaskType.Group ? c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRedirectCurrentDirectoryById", {id: this.panFileId}) : c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRedirectCurrentDirectory", {
                    selectFileIdList: [this.panFileId],
                    titleList: this.panTaskData.title.split("\\"),
                    idList: this.panTaskData.id.split("\\")
                });
                t || this.statShow("click", this.isSupportPlay ? "play" : "look")
            })
        }

        getPanTaskProgress() {
            return a(this, void 0, void 0, function* () {
                if (!this.panTaskId) return this.saveStatus = T.complete, void (this.panTaskProgress = 100);
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetSingleUrlTask", this.panTaskId);
                if (m.information("### getPanTaskProgress", this.panTaskId, e, this.panFileId, this.panTaskProgress), e && null === e[0] && null === e[1]) this.timeoutGetProcess = setTimeout(this.getPanTaskProgress, 3e3); else {
                    if (!e || !e[0] && e[2]) return this.panFileId ? (g.ThunderPanTaskNS.updateTaskFileId("", this.panFileId), this.panTaskId = "") : (g.ThunderPanTaskNS.deleteTask(this.panTaskId), this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = ""), void this.getPanTaskType();
                    if (this.saveStatus = e[0].phase, this.saveStatus === T.error) return this.panFileId && g.ThunderPanTaskNS.updateTaskFileId(this.panTaskId, ""), this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", void this.getPanTaskType();
                    "" === e[0].file_id || this.panFileId || (this.panFileId = e[0].file_id, g.ThunderPanTaskNS.updateTaskFileId(this.panTaskId, this.panFileId)), this.saveStatus !== T.complete ? (100 === e[0].progress ? this.panTaskProgress = 99 : this.panTaskProgress = e[0].progress, this.timeoutGetProcess = setTimeout(this.getPanTaskProgress, 3e3)) : (this.panTaskProgress = 100, (yield this.checkPanFileExist(this.panFileId)) ? (g.ThunderPanTaskNS.updateTaskFileId("", this.panFileId), this.panTaskId = "") : g.ThunderPanTaskNS.deleteTask(null, this.panFileId), this.onPanFileIdChange()), this.getPanTaskType()
                }
            })
        }

        checkPanFileExist(e) {
            return a(this, void 0, void 0, function* () {
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetParentDirectoryPathById", {id: this.panFileId});
                return !e || null === e[2] || void 0 === e[2]
            })
        }

        onPanTaskProgressChange() {
            c.server.fireClientEvent("OnPanTaskUploadProgressChange", this.panTaskProgress)
        }

        clickSave(e, ...t) {
            return a(this, void 0, void 0, function* () {
                if (e || this.statShow("click", "save"), yield this.refleshFreeSpace(!1), this.panFreeSpace < this.fileSize) return;
                if (yield this.selectPanPath(), !this.panTaskData || !this.panTaskData.title) return;
                let t;
                if (this.task && this.task.getType() === l.DownloadKernel.TaskType.Group) {
                    let e = [], i = this.task.getExtraObject(), n = i.getSubTaskCount();
                    for (let t = 0; t < n; ++t) {
                        let n = i.getSubTaskByIndex(t);
                        n && e.push({
                            searchFrom: "",
                            url: n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskUrl),
                            name: n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                            path: this.panTaskData.title,
                            parentId: this.panSavePathId,
                            files: [],
                            from: "download_detail"
                        })
                    }
                    if (!(t = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcAddUrlTaskGroup", {
                        groupName: this.taskName,
                        urlTasks: e
                    })) || !t[0]) return void m.warning("wrong result");
                    for (let e of t[0]) e.task && g.ThunderPanTaskNS.insertTask(this.curTaskId, e.task.id, this.curUserId, JSON.stringify(this.panTaskData));
                    let a = yield g.ThunderPanTaskNS.queryTask(this.curTaskId, this.curUserId);
                    this.updateGrouptask(a)
                } else {
                    if (!((t = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", [{
                        name: this.taskName,
                        url: this.url || "magnet:?xt=urn:btih:" + this.signatureCode,
                        parentId: this.panSavePathId,
                        files: [...this.files],
                        path: this.panTaskData.title,
                        from: "download_detail"
                    }])) && t[0] && t[0][0] && t[0][0].task)) return void m.warning("wrong result");
                    this.panTaskId = t[0][0].task.id, g.ThunderPanTaskNS.insertTask(this.curTaskId, this.panTaskId, this.curUserId, JSON.stringify(this.panTaskData)), this.getPanTaskProgress(), this.getPanTaskType()
                }
            })
        }

        selectPanPath() {
            return a(this, void 0, void 0, function* () {
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcTreePath", {});
                if (!e || !e[0] || e[0].error) return;
                this.panSavePathId = e[0].parentId;
                let t = "", i = "";
                for (let n of e[0].path) t += "\\" + n.title, i += "\\" + n.id;
                this.panTaskData = {id: i.slice(1), title: t.slice(1)}
            })
        }

        refleshFreeSpace(e = !0) {
            return a(this, void 0, void 0, function* () {
                let t = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetDriveInfo");
                t && t[0] && (this.panFreeSpace = t[0].limit - t[0].usage, e && this.statShow("click", "reflesh"))
            })
        }

        handleShow() {
            return a(this, void 0, void 0, function* () {
                this.showMore ? (this.showMore = !1, this.statShow("click", "fold")) : (this.showMore = !0, this.statShow("click", "unfold"))
            })
        }

        setDescription() {
            if (!this.description) return;
            y.getTaskFromTaskId(this.curTaskId).setDescription(this.description)
        }

        copyLink(e, t = "url") {
            r.clipboard.writeText(e), this.statShow("click", "copy_link"), this.$message({
                message: "复制成功",
                type: "success",
                position: "middle"
            })
        }

        openUrl() {
            u.client.callServerFunction("OpenNewTab", this.refUrl).catch()
        }

        openDir() {
            return a(this, void 0, void 0, function* () {
                (yield v.FileSystemAWNS.dirExistsAW(this.savePath)) ? s.TaskOperatorNs.openTaskFolder(this.task.getTaskBaseInfo(), !0).catch() : this.$message({
                    message: "文件目录不存在",
                    type: "warning",
                    position: "middle"
                }), this.statShow("click", "open_folder")
            })
        }

        checkMediaType(e) {
            const t = e.toLocaleLowerCase();
            return [".asf", ".mpg", ".rmvb", ".rm", ".wmv", ".avi", ".mp4", ".mpeg", ".mkv", ".mov", ".ts", ".flv", ".3gp"].includes(t) ? "video" : "other"
        }

        init() {
            if (this.taskDownloadingInteval && clearInterval(this.taskDownloadingInteval), 0 !== this.curTaskId) {
                if (this.task = y.getTaskFromTaskId(this.curTaskId), this.taskName = this.task.getTaskName(), this.taskType = this.task && this.task.getType(), this.fileSize = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize), this.files = [], this.taskType === l.DownloadKernel.TaskType.Bt) {
                    let e = [], t = this.task.getExtraObject().getBtFileList();
                    for (let [, i] of t) i.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download) && e.push(String(i.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex)));
                    this.files = e
                }
                this.savePath = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), this.refUrl = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.RefUrl), this.url = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskUrl), this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Bt ? this.signatureCode = this.task.getExtraObject().getInfoId() : this.signatureCode = "", this.createTime = h.TimeHelperNS.formatDate(new Date(this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.CreateTime)), "yyyy-MM-dd hh:mm:ss"), this.downloadTime = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod), this.downloadTimeStr = h.TimeHelperNS.formatSeconds(this.downloadTime), this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Started && (this.taskDownloadingInteval = setInterval(() => {
                    this.downloadTime += 1, this.downloadTimeStr = h.TimeHelperNS.formatSeconds(this.downloadTime)
                }, 1e3)), this.description = this.task.getTaskBaseInfo().description, this.url && this.statShow("show", "copy_link"), this.tracked = !1, setTimeout(() => {
                    this.tracked || this.onPanTaskTypeChange()
                }, 50)
            } else this.files = []
        }

        updateGrouptask(e) {
            return a(this, void 0, void 0, function* () {
                if (this.panTaskProgress = 100, this.saveStatus = T.complete, !e) return this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", void this.getPanTaskType();
                e.hasOwnProperty("length") || (e = [e]);
                let t = "", i = !0, n = {};
                for (let a of e) if (a) if (a.FileId) {
                    if ("" === t) {
                        let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetParentDirectoryPathById", {id: a.FileId});
                        if (e && e[0] && "success" === e[0].status && e[0].path.length > 0) {
                            let i = "", o = "";
                            for (let t of e[0].path) i += "\\" + t.id, o += "\\" + t.title;
                            let r = JSON.parse(a.Data);
                            r.title !== o ? (n = Object.assign(r, {
                                id: i.slice(1),
                                title: o.slice(1)
                            }), g.ThunderPanTaskNS.updateTaskPath(a.FileId, JSON.stringify(n))) : n = r, t = a.FileId, this.saveStatus = T.complete, this.panFileId = a.FileId, this.panTaskData = n
                        } else null === e[0] && null === e[1] || (m.warning("### delete task", a, e), g.ThunderPanTaskNS.deleteTask(null, a.FileId))
                    }
                } else a.PanTaskId && (this.updatePanTask(a.PanTaskId).catch(), i = !1);
                "" === t && i && (this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = ""), this.getPanTaskType()
            })
        }

        updatePanTask(e) {
            return a(this, void 0, void 0, function* () {
                let t = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetSingleUrlTask", e);
                if (t && t[0] && t[0].phase !== T.error) {
                    if ("" !== t[0].file_id) {
                        let i = t[0].file_id;
                        g.ThunderPanTaskNS.updateTaskFileId(e, i), this.panFileId || (this.panFileId = i, this.panTaskId = e)
                    } else this.panTaskId || (this.panTaskId = e, this.getPanTaskProgress().catch());
                    this.getPanTaskType()
                } else g.ThunderPanTaskNS.deleteTask(this.panTaskId)
            })
        }

        savePlay(e, t, ...i) {
            return a(this, void 0, void 0, function* () {
                if ("" === this.curUserId || !this.curUserId) return void (yield f.LoginHelperNS.loginHelper.showLoginDlg("download_left_panel"));
                let e, t = !0;
                if (i && void 0 !== i[0] && (t = i[0]), yield this.refleshFreeSpace(!1), !(this.panFreeSpace < this.fileSize)) if (this.panSavePathId = "", this.panTaskData = {
                    title: "我的云盘",
                    id: ""
                }, this.task && this.task.getType() === l.DownloadKernel.TaskType.Group) {
                    let t = [], i = this.task.getExtraObject(), n = i.getSubTaskCount();
                    for (let e = 0; e < n; ++e) {
                        let n = i.getSubTaskByIndex(e);
                        n && t.push({
                            searchFrom: "",
                            url: n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskUrl),
                            name: n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                            path: this.panTaskData.title,
                            parentId: this.panSavePathId,
                            files: [],
                            from: "download/left/hanging_note"
                        })
                    }
                    if (!(e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcAddUrlTaskGroup", {
                        groupName: this.taskName,
                        urlTasks: t
                    })) || !e[0]) return void m.warning("wrong result");
                    for (let t of e[0]) t.task && g.ThunderPanTaskNS.insertTask(this.curTaskId, t.task.id, this.curUserId, JSON.stringify(this.panTaskData));
                    let a = yield g.ThunderPanTaskNS.queryTask(this.curTaskId, this.curUserId);
                    this.updateGrouptask(a)
                } else {
                    if (!((e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", [{
                        name: this.taskName,
                        url: this.url || "magnet:?xt=urn:btih:" + this.signatureCode,
                        parentId: this.panSavePathId,
                        files: [...this.files],
                        path: this.panTaskData.title,
                        from: "download/left/hanging_note",
                        play: t,
                        playFrom: "download_left_panel"
                    }])) && e[0] && e[0][0] && e[0][0].task)) return void m.warning("wrong result");
                    this.panTaskId = e[0][0].task.id, g.ThunderPanTaskNS.insertTask(this.curTaskId, this.panTaskId, this.curUserId, JSON.stringify(this.panTaskData)), this.getPanTaskProgress(), this.getPanTaskType()
                }
            })
        }

        mounted() {
            m.information("XlDetail mounted"), u.client.attachServerEvent("OnInsertThunderPanTask", (e, t, i, n) => {
                this.queryTaskAndUpdate()
            }), c.server.registerFunctions({
                DetailSaveTask: this.savePlay.bind(this),
                DetailShowFileDetail: this.consumePanTask.bind(this),
                DetailClickPath: this.onClickPath.bind(this)
            })
        }

        beforeDestroy() {
            clearTimeout(this.timeoutGetProcess), this.taskDownloadingInteval && clearInterval(this.taskDownloadingInteval)
        }

        statShow(e, t) {
            let i;
            i = "show" === e ? "btn_type=" : "clickid=", i += t, i += ",current_tab=" + this.curCategroyViewID, p.XLStatNS.trackEvent("download_detail", "dl_detail_yunpan_save_module_" + e, "", 0, 0, 0, 0, i)
        }
    };
    var T;
    n([o.Prop()], k.prototype, "currentCategoryId", void 0), n([o.Prop({default: -1})], k.prototype, "curTaskId", void 0), n([o.Prop({})], k.prototype, "curTaskStatus", void 0), n([o.Prop()], k.prototype, "curCategroyViewID", void 0), n([o.Prop({default: ""})], k.prototype, "curUserId", void 0), n([o.Watch("curTaskId", {immediate: !0})], k.prototype, "onTaskChange", null), n([o.Watch("curUserId")], k.prototype, "onUserChange", null), n([o.Watch("panFileId", {immediate: !0})], k.prototype, "onPanFileIdChange", null), n([o.Watch("curTaskStatus", {immediate: !0})], k.prototype, "onTaskStatusChange", null), n([o.Watch("panTaskType")], k.prototype, "onPanTaskTypeChange", null), n([o.Watch("panTaskData")], k.prototype, "onPanTaskDataChange", null), n([o.Watch("saveStatus")], k.prototype, "onSaveStatusChange", null), n([o.Watch("panTaskProgress")], k.prototype, "onPanTaskProgressChange", null), k = n([o.Component], k), t.default = k, function (e) {
        e.pending = "PHASE_TYPE_PENDING", e.running = "PHASE_TYPE_RUNNING", e.error = "PHASE_TYPE_ERROR", e.complete = "PHASE_TYPE_COMPLETE"
    }(T || (T = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(255), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(3), s = i(12), l = i(15), d = i(64), u = i(6), c = i(47), h = i(2), f = i(13), g = i(0),
        p = i(5), v = i(67), m = g.default.getLogger("task-detail-FileList"),
        y = l.DownloadKernelEventManager.getEventManager(), k = s.DownloadKernelTaskManager.getTaskManager(),
        T = (e, t) => e < t ? -1 : e === t ? 0 : 1;
    let w = class extends o.Vue {
        constructor() {
            super(...arguments), this.curTask = {}, this.eventBtSubFileDetailChanged = -1, this.eventGroupTaskSubFileDetailChanged = -1, this.subFiles = [], this.branchMap = {}, this.leafMap = {}, this.tree = [], this.disabledKeys = [], this.editingSelected = !1, this.checkedKeys = [], this.defaultCheckedKeys = [], this.originCheckedKeys = [], this.editingExpanded = [], this.expandedKeys = [], this.defaultExpandedKeys = [], this.selectedFailedSubFile = !1, this.selectedFileIndex = "", this.loading = !1, this.eventPlayBtOrGroupTask = -1, this.isAllSelectedAndFinished = !1, this.columns = [{
                label: "文件名称",
                prop: "name",
                sortable: !0,
                sorter: (e, t) => T(e.data.fileName.toLowerCase(), t.data.fileName.toLowerCase())
            }, {
                label: "大小",
                prop: "fileSize",
                width: 78,
                sortable: !0,
                sorter: (e, t) => T(e.data.fileSize, t.data.fileSize)
            }, {
                label: "进度",
                prop: "progress",
                width: 78,
                sortable: !0,
                sorter: (e, t) => T(this.getProgress(e), this.getProgress(t))
            }]
        }

        onCurTaskChange() {
            m.information("onCurTaskChange"), 0 === this.curTaskId ? this.uninit() : this.init()
        }

        get checkedKeysCache() {
            return this.checkedKeys.reduce((e, t) => (e[t] = !0, e), {})
        }

        get taskType() {
            return this.curTask.taskType
        }

        get selectedFailedSubFileRetryDownload() {
            let e = v(this.curTask, "status");
            return e = e ? parseInt(e, 10) : 0, !!(this.selectedFailedSubFile && e >= 7 && e <= 10)
        }

        isUnread(e) {
            return "leaf" === e.type && !e.data.userRead && e.data.isSupportPlay && this.isComplete(e)
        }

        onClickName(e) {
            ('"branch"' !== e.type || e.data.isAllDownloadItemFinished) && ("leaf" !== e.type || e.data.isNeedDownload && this.isComplete(e)) && (e.data.errMessage || ("leaf" === e.type ? e.data.isSupportPlay ? this.playFile(e) : this.openFile(e) : this.openDir(e)))
        }

        haveSelectItem(e) {
            let t = !1;
            if ("branch" === e.type) for (let i of e.children) t = t || this.haveSelectItem(i); else t = -1 !== this.checkedKeys.indexOf(e.key);
            return t
        }

        formatSize(e) {
            return f.ThunderUtil.formatSize(e)
        }

        rowIcon(e) {
            if (!e) return "xly-type-unknown";
            if ("leaf" !== e.type) return "xly-type-group";
            let t = e.name.substring(e.name.lastIndexOf(".") + 1);
            return -1 !== "avi|mp4|mkv|mpeg|mpg|wmv|rmvb|rm|mov|ts|m2ts|tp|3gp|flv".indexOf(t) ? "xly-type-mkv" : -1 !== "txt|doc|docx|xls|xlsx|csv|wps|rtf".indexOf(t) ? "xly-type-doc" : -1 !== "exe|msi|com|bat|cmd|py|vbs".indexOf(t) ? "xly-type-exe" : -1 !== "rar|zip|7z|cab|lzh|jar".indexOf(t) ? "xly-type-rar" : -1 !== "iso|img|bin|nrg|ccd|vcd|dts|cdi|gho|mds|mdf".indexOf(t) ? "xly-type-iso" : "pdf" === t ? "xly-type-pdf" : "xly-type-unknown"
        }

        isComplete(e) {
            return "leaf" === e.type ? this.taskType !== r.DownloadKernel.TaskType.Group ? e.data.downloadSize === e.data.fileSize && e.data.isNeedDownload && e.data.downloadSize && 3 === e.data.status : [r.DownloadKernel.TaskStatus.Succeeded, r.DownloadKernel.TaskStatus.Seeding].includes(e.data.status) : e.data.isAllDownloadItemFinished && 0 !== e.data.fileSize && e.data.fileSize === e.data.downloadSize
        }

        getProgress(e) {
            if (e && e.data && 0 === e.data.fileSize) return 0;
            if ("branch" === e.type) return e.data.downloadSize / e.data.fileSize;
            let t = this.subFiles[e.data.index].downloadSize / this.subFiles[e.data.index].fileSize;
            return (this.taskType !== r.DownloadKernel.TaskType.Group ? e.data.downloadSize === e.data.fileSize && e.data.isNeedDownload && e.data.downloadSize && 3 === e.data.status : [8, 10].includes(e.data.status)) || (t = 1 === t ? .9999 : t), t
        }

        parseFileList(e) {
            let t = {};
            this.branchMap = {}, this.leafMap = {}, this.setBranch("", ""), e.forEach(e => {
                const {filePath: i} = e;
                if (!t[i]) {
                    t[i] = !0;
                    let e = "";
                    i.split("\\").forEach(t => {
                        "" !== t && (this.setBranch(e, t), e = e ? `${e}\\${t}` : t)
                    })
                }
                this.setLeaf(i.slice(0, -1), e)
            }), this.updateTree(null), this.tree = Object.freeze(this.branchMap[""].children)
        }

        setBranch(e, t) {
            let i = this.branchMap[e], n = e ? `${e}\\${t}` : t, a = this.branchMap[n];
            return a || (a = this.branchMap[n] = {
                type: "branch",
                name: t,
                children: [],
                key: n,
                parent: i,
                data: {fileName: t}
            }, i && i.children.push(a)), a
        }

        updateTree(e) {
            this.disabledKeys = Object.values(this.leafMap).filter(e => e.data.downloadSize && e.data.downloadSize === e.data.fileSize && e.data.isNeedDownload).map(e => e.key), this.editingSelected ? this.defaultCheckedKeys = this.checkedKeys : this.checkedKeys = this.defaultCheckedKeys = this.originCheckedKeys = e || Object.keys(this.leafMap).filter(e => this.leafMap[e].data.isNeedDownload), this.editingExpanded ? this.defaultExpandedKeys = this.expandedKeys : this.expandedKeys = this.defaultExpandedKeys = [], this.caculateBranch();
            let t = Object.values(this.branchMap).filter(e => 0 !== e.data.fileSize && e.data.downloadSize === e.data.fileSize && e.data.isAllDownloadItemFinished).map(e => e.key);
            this.disabledKeys = this.disabledKeys.concat(t), this.curTask.taskStatus === r.DownloadKernel.TaskStatus.Seeding || this.curTask.taskStatus === r.DownloadKernel.TaskStatus.Succeeded ? this.isAllSelectedAndFinished = Object.values(this.leafMap).every(e => !!e.data.isNeedDownload && (this.taskType !== r.DownloadKernel.TaskType.Group ? e.data.downloadSize === e.data.fileSize && e.data.downloadSize && 3 === e.data.status : [8, 10].includes(e.data.status))) : this.isAllSelectedAndFinished = !1
        }

        caculateBranch() {
            this.caculateBranchProp(this.branchMap[""], ["fileSize", "downloadSize", "isAllDownloadItemFinished", "selectedFailedSubFile"], this.reduceFn.bind(this))
        }

        caculateBranchProp(e, t, i) {
            let n = e.children.reduce((e, n) => {
                if ("branch" === n.type && this.caculateBranchProp(n, t, i), "function" == typeof i) return i(t, e, n);
                {
                    let i = [];
                    for (let a = 0; a < t.length; ++a) i[a] = e[a] + ("branch" === n.type || this.checkedKeysCache[n.key] ? n.data[t[a]] : 0);
                    return i
                }
            }, new Array(t.length).fill(0));
            for (let i = 0; i < n.length; ++i) e.data[t[i]] = n[i]
        }

        reduceFn(e, t, i) {
            let n = [];
            for (let a = 0; a < e.length; ++a) "isAllDownloadItemFinished" === e[a] ? n[a] = this.isAllDownloadItemFinished(t[a], i) : "selectedFailedSubFile" === e[a] ? this.updateSelectedFailedSubFile(i) : n[a] = t[a] + ("branch" === i.type || this.checkedKeysCache[i.key] ? i.data[e[a]] : 0);
            return n
        }

        updateSelectedFailedSubFile(e) {
            this.selectedFailedSubFile || e.data.errMessage && e.data.isNeedDownload && (this.selectedFailedSubFile = !0)
        }

        isAllDownloadItemFinished(e, t) {
            let i = !1;
            if (!1 !== e) {
                let n = !1;
                n = !t.data.isNeedDownload || (4 !== this.taskType ? t.data.downloadSize === t.data.fileSize && t.data.downloadSize && 3 === t.data.status : [8, 10].includes(t.data.status)), i = 0 !== e ? n && e : n
            }
            return i
        }

        setLeaf(e, t) {
            let i = e ? `${e}\\${t.fileName}` : t.fileName, n = this.branchMap[e], a = this.leafMap[i];
            return a || (a = this.leafMap[i] = {
                type: "leaf",
                fullPath: i,
                name: t.fileName,
                key: i,
                parent: n,
                data: t
            }, n.children.push(a)), a
        }

        setUserRead(e) {
            e.data.userRead = 1;
            let t = k.getTaskFromTaskId(this.curTask.taskId);
            if (t && (t.setUserRead(1), "leaf" === e.type)) if (this.taskType === r.DownloadKernel.TaskType.Bt) {
                let i = t.getExtraObject().getBtFileList();
                for (let [, t] of i) if (t.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.RealIndex) === e.data.index) {
                    t.setUserRead(1);
                    break
                }
            } else if (this.taskType === r.DownloadKernel.TaskType.Group) {
                t.getExtraObject().getSubTaskByIndex(e.data.index).setUserRead(1)
            }
        }

        openFile(e) {
            return a(this, void 0, void 0, function* () {
                yield this.updateDstRect(), p.client.callServerFunction("OperateTask", this.curTaskId, "open", e.data.index), this.setUserRead(e)
            })
        }

        playFile(e) {
            return a(this, void 0, void 0, function* () {
                let t = document.querySelector("div#xly-task-detail-down__main");
                t && t.scrollTo(0, 0), yield this.updateDstRect();
                let i = "download_right_downloading_filelist";
                this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Completed ? i = "download_right_complate_filelist" : this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Recycle && (i = "download_right_recycle_filelist"), -1 !== this.curTask.categoryId && -1 !== this.currentCategoryId ? (i = "download_private_space_bxbb_play", this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Completed && (i = "download_private_space_local_play")) : -1 === this.currentCategoryId && -1 !== this.curTask.categoryId && (i = "download_getbacking_play", this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Completed && (i = "download_getback_complete_play")), p.client.callServerFunction("OperateTask", this.curTaskId, "play", {
                    fileIndex: e.data.index,
                    playFrom: i
                }).then().catch(), this.setUserRead(e), p.client.broadcastEvent("OnTabChange", "Preview")
            })
        }

        updateDstRect() {
            return a(this, void 0, void 0, function* () {
                let e, t = document.querySelector("div.xly-file-detail div.td-tabs__pane"),
                    i = {width: 0, height: 0, x: 0, y: 0};
                t && (e = t.getBoundingClientRect()), i.y = e.top > 42 ? e.top : 42, i.x = e.left, i.width = e.width, i.height = e.height, yield p.client.callServerFunction("UpdateDownloadEmbedRect", i), m.information("play rect", i)
            })
        }

        openDir(e) {
            let t = this.curTask.savePath, i = this.curTask.taskName;
            2 === this.taskType && i && "" !== i && (i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1)), t = h.join(t, i));
            let n = h.join(t, e.key);
            p.client.callServerFunction("ShellOpen", n).catch(), k.getTaskFromTaskId(this.curTask.taskId).setUserRead(1)
        }

        downloadSelected() {
            if (!this.selectedFailedSubFile && !this.editingSelected) return;
            let e = this.checkedKeys.filter(e => e in this.leafMap).map(e => this.leafMap[e].data.index),
                t = e.join("");
            if (this.selectedFileIndex === t) {
                if (!this.selectedFailedSubFile) return
            } else this.selectedFileIndex = t;
            this.loading = !0, this.operate("downloadSelectFiles", null, JSON.stringify(e)).then(() => {
                this.loading = !1, this.editingSelected = !1, this.updateTree(this.checkedKeys)
            })
        }

        isSupportPlay(e) {
            return "branch" !== e.type && (!!this.subFiles[e.data.index] && this.subFiles[e.data.index].isSupportPlay)
        }

        onCheckedChange(e) {
            let t = e.filter(e => e in this.leafMap).map(e => this.leafMap[e].data.index);
            t.length === this.originCheckedKeys.length && this.originCheckedKeys.every(e => t.includes(v(this.leafMap[e], "data", "index"))) ? this.editingSelected = !1 : this.editingSelected = !0, this.checkedKeys = e, this.caculateBranch()
        }

        getFileList(e) {
            return a(this, void 0, void 0, function* () {
                let t = "", i = !0, n = [], a = k.getTaskFromTaskId(e.taskId), o = e.taskType;
                if (o === r.DownloadKernel.TaskType.Bt) {
                    let o = a.getExtraObject().getBtFileList(), s = e.savePath, l = e.taskName;
                    void 0 !== l && "" !== l && l.indexOf(".") === l.length - 1 && (l = l.substring(0, l.length - 1));
                    let f = yield c.SingleBtTaskNS.isSingleBtTask(a);
                    for (let [, e] of o) {
                        let o = {};
                        o.index = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.RealIndex), o.filePath = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath), o.fileName = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), o.isNeedDownload = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Download), o.fileSize = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileSize), o.cid = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Cid), o.gcid = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Gcid), o.status = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileStatus), o.downloadSize = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.DownloadSize), o.errCode = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.ErrorCode), o.isSupportPlay = e.isSupportPlay(), o.userRead = e.getUserRead(), 0 !== o.errCode ? o.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(o.errCode) : o.errMessage = "", o.status === r.DownloadKernel.BtFileStatus.Complete ? (t = f ? c.SingleBtTaskNS.getSinleBtTaskFilePath(a) : h.join(s, l, o.filePath, o.fileName), i = yield u.FileSystemAWNS.existsAW(t), o.isDelete = !i) : o.isDelete = !1, n[o.index] = o
                    }
                } else if (o === r.DownloadKernel.TaskType.Group) {
                    let e = a.getExtraObject(), o = e.getSubTaskCount(), s = "";
                    for (let a = 0; a < o; ++a) {
                        let o = e.getSubTaskByIndex(a);
                        if (o) {
                            let e = {};
                            e.index = a, e.filePath = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.RelativePath), e.taskId = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), e.fileName = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), e.url = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.RefUrl), e.isNeedDownload = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize), e.cid = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.Cid), e.gcid = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.Gcid), e.status = o.getTaskStatus(), e.errCode = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode), e.isSupportPlay = o.isSupportPlay(), e.userRead = o.getUserRead(), e.status === r.DownloadKernel.TaskStatus.Failed ? e.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                            let l = o.getTaskChannelInfo();
                            e.dcdnStatus = l.dcdnStatus, s = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath), e.status === r.DownloadKernel.TaskStatus.Succeeded || e.status === r.DownloadKernel.TaskStatus.Seeding ? (t = h.join(s, e.fileName), i = yield u.FileSystemAWNS.existsAW(t), e.isDelete = !i) : e.isDelete = !1, n.push(e)
                        }
                    }
                }
                return n
            })
        }

        updateTreeStatus(e) {
            let t = this.leafMap["" === e.filePath ? e.fileName : `${e.filePath}${e.fileName}`];
            if (!t || !t.data) return void m.warning("error in updateTreeStatus", "node: ", t, "fileinfo: ", e);
            let i = t.data.downloadSize;
            if (this.$set(t, "data", e), t.parent && "" !== t.parent.key) {
                if (t = t.parent, this.$set(t.data, "downloadSize", e.downloadSize - i), 3 === e.status) {
                    let e = !0;
                    for (let i = 0; i < t.children.length; i++) if ("branch" === t.children[i].type && !1 === t.children[i].data.isAllDownloadItemFinished || "leaf" === t.children[i].type && 3 !== t.children[i].data.status) {
                        e = !1;
                        break
                    }
                    t.data.isAllDownloadItemFinished = e
                }
            } else ;
        }

        getBtSubFileList(e, t) {
            let i = [];
            do {
                let n = k.getTaskFromTaskId(e);
                if (!n) break;
                if (n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskType) !== r.DownloadKernel.TaskType.Bt) break;
                let a = n.getExtraObject();
                if (!a) break;
                for (let e = 0; e < t.length; ++e) {
                    let n = t[e], o = a.getBtFileByRealIndex(n.realIndex);
                    if (!o) continue;
                    let s = {};
                    s.index = n.realIndex, s.filePath = n.relativePath, s.fileName = o.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), s.isNeedDownload = o.getIsDownload(), s.isSupportPlay = o.isSupportPlay(), s.fileSize = n.fileSize, s.cid = n.cid, s.gcid = n.gcid, s.status = n.fileStatus, s.downloadSize = n.downloadSize, s.errCode = n.errorCode, s.userRead = o.getUserRead(), 0 !== s.errCode ? s.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(s.errCode) : s.errMessage = "", i.push(s)
                }
            } while (0);
            return i
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                let t = e[1];
                if (t !== this.curTaskId) break;
                let i = e[2], n = this.getBtSubFileList(t, i);
                for (let e of n) this.$set(this.subFiles, e.index, e), this.updateTreeStatus(e)
            } while (0)
        }

        getGroupTaskSubFileList(e) {
            let t = [];
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (n) {
                    let e = {};
                    e.filePath = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.RelativePath), e.index = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileIndex), e.taskId = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), e.fileName = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), e.url = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.RefUrl), e.isNeedDownload = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize), e.cid = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.Cid), e.gcid = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.Gcid), e.status = n.getTaskStatus(), e.errCode = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode), e.userRead = n.getUserRead(), e.isSupportPlay = n.isSupportPlay(), e.status === r.DownloadKernel.TaskStatus.Failed ? e.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                    let i = n.getTaskChannelInfo();
                    e.dcdnStatus = i.dcdnStatus, t.push(e)
                }
            }
            return t
        }

        onGroupTaskSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                if (!e[1]) break;
                e[1].forEach((e, t) => {
                    if (t === this.curTaskId) {
                        let t = this.getGroupTaskSubFileList(e);
                        for (let e of t) this.$set(this.subFiles, e.index, e), this.updateTreeStatus(e)
                    }
                })
            } while (0)
        }

        uninit() {
            -1 !== this.eventBtSubFileDetailChanged && (y.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.eventBtSubFileDetailChanged), this.eventBtSubFileDetailChanged = -1), -1 !== this.eventGroupTaskSubFileDetailChanged && (y.detachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.eventGroupTaskSubFileDetailChanged), this.eventGroupTaskSubFileDetailChanged = -1), this.curTask = {}, this.subFiles = [], this.branchMap = {}, this.leafMap = {}, this.tree = [], this.checkedKeys = [], this.disabledKeys = [], this.defaultCheckedKeys = [], this.originCheckedKeys = [], this.editingExpanded = [], this.expandedKeys = [], this.defaultExpandedKeys = []
        }

        init() {
            return a(this, void 0, void 0, function* () {
                m.information("init FileList"), this.curTask = k.getTaskFromTaskId(this.curTaskId).getTaskBaseInfo(), -1 !== this.eventBtSubFileDetailChanged && (y.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.eventBtSubFileDetailChanged), this.eventBtSubFileDetailChanged = -1), -1 !== this.eventGroupTaskSubFileDetailChanged && (y.detachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.eventGroupTaskSubFileDetailChanged), this.eventGroupTaskSubFileDetailChanged = -1), this.subFiles = yield this.getFileList(this.curTask), this.parseFileList(this.subFiles), this.taskType === r.DownloadKernel.TaskType.Bt ? this.eventBtSubFileDetailChanged = y.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }) : this.taskType === r.DownloadKernel.TaskType.Group && (this.eventGroupTaskSubFileDetailChanged = y.attachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    this.onGroupTaskSubFileDetailChanged(...e)
                }))
            })
        }

        playBtOrGroupTask(e, ...t) {
            return a(this, void 0, void 0, function* () {
                if (t.length < 1) return;
                if (parseInt(t[0], 10) !== this.curTaskId) return;
                let e = "download_right_downloading_embed";
                this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Completed && (e = "download_right_complated_embed"), -1 !== this.curTask.categoryId && -1 !== this.currentCategoryId ? (e = "download_private_space_bxbb_play", this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Completed && (e = "download_private_space_local_play")) : -1 === this.currentCategoryId && -1 !== this.curTask.categoryId && (this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Downloading ? e = "download_getbacking_play" : this.curCategroyViewID === r.DownloadKernel.CategroyViewID.Completed && (e = "download_getback_complete_play"));
                for (let t of Object.values(this.leafMap)) if (!t.data.errMessage && 1 === t.data.isNeedDownload && !0 !== t.data.isDelete && !0 === t.data.isSupportPlay) {
                    t.data.status, p.client.callServerFunction("OperateTask", this.curTaskId, "downAndPlay", {
                        fileIndex: t.data.index,
                        playFrom: e
                    }).then().catch(), this.setUserRead(t);
                    break
                }
            })
        }

        mounted() {
            this.eventPlayBtOrGroupTask = p.client.attachServerEvent("PlayBtOrGroupTask", this.playBtOrGroupTask.bind(this))
        }

        beforeDestroy() {
            this.uninit(), p.client.detachServerEvent("PlayBtOrGroupTask", this.eventPlayBtOrGroupTask)
        }
    };
    n([o.Prop()], w.prototype, "curTaskId", void 0), n([o.Prop()], w.prototype, "operate", void 0), n([o.Prop()], w.prototype, "playingCurTask", void 0), n([o.Prop()], w.prototype, "playingMediaIndex", void 0), n([o.Prop()], w.prototype, "curCategroyViewID", void 0), n([o.Prop()], w.prototype, "currentCategoryId", void 0), n([o.Prop()], w.prototype, "playstate", void 0), n([o.Watch("curTaskId", {immediate: !0})], w.prototype, "onCurTaskChange", null), w = n([o.Component], w), t.default = w
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(257), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(12), s = i(3), l = i(44), d = i(18), u = i(32), c = i(41), h = i(10),
        f = r.DownloadKernelTaskManager.getTaskManager();
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.hasErrorTask = !1, this.hasStopTask = !1, this.hasStartedTask = !1, this.hasUnRemoveTask = !1, this.showCopy = !1, this.removeText = "删除"
        }

        onTaskIdsChange() {
            return a(this, void 0, void 0, function* () {
                this.hasErrorTask = !1, this.hasStopTask = !1, this.hasStartedTask = !1;
                let e = !1;
                if (this.removeText = "删除", this.curCategoryid === s.DownloadKernel.CategroyViewID.Downloading) for (let t of this.taskIds) {
                    let i = f.getTaskFromTaskId(t);
                    if (!i) continue;
                    let n = i.getTaskStatus();
                    n === s.DownloadKernel.TaskStatus.Failed ? this.hasErrorTask = !0 : n === s.DownloadKernel.TaskStatus.Stopped || n === s.DownloadKernel.TaskStatus.StopPending ? this.hasStopTask = !0 : [3, 4, 5].includes(n) && (this.hasStartedTask = !0);
                    let a = i.getTaskBaseInfo(), o = i.getIsPrivate();
                    -1 === a.categoryId || o ? e = !0 : this.removeText = "彻底删除"
                } else if (this.curCategoryid === s.DownloadKernel.CategroyViewID.Completed) {
                    let t = !1;
                    for (let i of this.taskIds) {
                        let n = f.getTaskFromTaskId(i);
                        if (!n) continue;
                        let a = n.getTaskBaseInfo(), o = n.getIsPrivate();
                        -1 === a.categoryId || o ? e = !0 : this.removeText = "彻底删除";
                        let r = yield c.TaskCtrlOperatorNS.isExistTaskFile(a);
                        r && !t && (t = r)
                    }
                    this.hasUnRemoveTask = t
                }
                this.showCopy = !!e
            })
        }

        getSelectdTaskInfos() {
            let e = [];
            for (let t of this.taskIds) {
                let i = f.getTaskFromTaskId(t);
                if (!i) continue;
                let n = i.getTaskBaseInfo(), a = i.getIsPrivate();
                (-1 === n.categoryId || a) && e.push(n)
            }
            return e
        }

        getSelectdYunTaskInfos() {
            let e = [];
            for (let t of this.taskIds) {
                let i = f.getTaskFromTaskId(t);
                if (!i) continue;
                let n = i.getTaskBaseInfo();
                -1 !== n.categoryId && e.push(n)
            }
            return e
        }

        start() {
            l.DownloadDispatchNS.startTasks(this.taskIds), this.stat("all_download"), this.hasStartedTask = !0
        }

        stop() {
            f.batchStopTask(this.taskIds, s.DownloadKernel.TaskStopReason.Manual), this.stat("all_pause"), this.hasStartedTask = !1
        }

        remove() {
            let e = this.getSelectdTaskInfos(), t = this.getSelectdYunTaskInfos();
            e.length > 0 && u.TaskOperatorNs.deleteTasks(e), t.length > 0 && u.TaskOperatorNs.destroyTasks(t), this.stat("delete")
        }

        copyLinks() {
            let e = "";
            for (let t of this.taskIds) {
                let i = f.getTaskFromTaskId(t), n = i.getTaskBaseInfo(), a = i.getIsPrivate();
                if (-1 === n.categoryId || a) {
                    e += i.getTaskBaseInfo().url + "\r"
                }
            }
            d.clipboard.writeText(e), this.stat("copy_link")
        }

        move2Dir() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.move2Dir(e).catch(() => {
            }), this.stat("move")
        }

        copy2Dir() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.copy2Dir(e).catch(() => {
            }), this.stat("copy_file")
        }

        restore() {
            f.batchRecoverFromRecycle(this.taskIds), this.stat("recovery")
        }

        destroy() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.destroyTasks(e), this.stat("delete")
        }

        redownloadTask() {
            let e = this.getSelectdTaskInfos();
            if (e.length > 0) {
                let t = "";
                void 0 !== this.curCategoryid && this.curCategoryid === s.DownloadKernel.CategroyViewID.Completed ? t = "finished_rk_reload_click" : this.curCategoryid === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin_rk_reload_click"), c.TaskCtrlOperatorNS.redownloadTask(e, void 0, t).catch()
            }
            this.stat("retry_download")
        }

        stat(e) {
            let t = "clild_tab=" + this.curCategoryid + ",clickid=" + e;
            h.XLStatNS.trackEvent("download_detail", "dl_filelist_batch_operation_click", "", 0, 0, 0, 0, t)
        }
    };
    n([o.Prop()], g.prototype, "taskIds", void 0), n([o.Prop()], g.prototype, "curCategoryid", void 0), n([o.Watch("taskIds", {immediate: !0})], g.prototype, "onTaskIdsChange", null), g = n([o.Component({components: {MultiChosenItem: () => Promise.resolve().then(() => i(765))}})], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(259), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(39), r = i(12), s = i(3), l = i(13), d = i(66),
        u = r.DownloadKernelTaskManager.getTaskManager();
    let c = class extends a.Vue {
        constructor() {
            super(...arguments), this.taskName = ""
        }

        onTaskIdChange() {
            let e = u.getTaskFromTaskId(this.taskId).getTaskBaseInfo();
            this.taskName = e.taskName, 0 === e.taskType ? this.iconType = "xlx-icon-type-group" : this.iconType = o.TaskUtilHelper.getTaskIcon(e.taskName, e.taskType), this.fileSize = l.ThunderUtil.formatSize(e.fileSize), e.taskStatus === s.DownloadKernel.TaskStatus.Seeding || e.taskStatus === s.DownloadKernel.TaskStatus.Succeeded ? this.displayTime = d.TimeHelperNS.formatDate(new Date(e.completionTime), "yyyy-MM-dd hh:mm") : this.displayTime = d.TimeHelperNS.formatDate(new Date(e.createTime), "yyyy-MM-dd hh:mm")
        }

        created() {
        }
    };
    n([a.Prop()], c.prototype, "taskId", void 0), n([a.Watch("taskId", {immediate: !0})], c.prototype, "onTaskIdChange", null), c = n([a.Component], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(261), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(477), s = i(5), l = i(9), d = i(72), u = i(10);
    let c = class extends o.Vue {
        constructor() {
            super(...arguments), this.movieList = [], this.showMore = !1, this.showList = !0, this.movieConfig = {yingyuan_dl_recommend: 0}, this.isOpen = !0, this.seeIndex = 0
        }

        get filterRecommendList() {
            return this.movieList || []
        }

        onCurTaskIdChange() {
            return a(this, void 0, void 0, function* () {
                if (0 === this.movieConfig.yingyuan_dl_recommend) return;
                let e = yield r.MovieRecommendNS.recommend();
                e && (this.movieList = e, this.handleSee()), this.seeIndex = 0
            })
        }

        handleSee() {
            let e = "0";
            this.vipInfo && "1" === this.vipInfo.isVip && (e = this.vipInfo.vasType);
            let t = "";
            for (let e = 0; e < this.movieList.length; e++) {
                let i = this.filterRecommendList[e];
                t += `video_type=${"movie" === i.category ? "电影" : "电视剧"},video_id=${i.aid},video_name=${i.work_name},position=${e + 1};`
            }
            let i = encodeURIComponent(t);
            u.XLStatNS.trackEvent("download_detail", "dl_detail_vip_special_content_show", "", 0, 0, 0, 0, `is_login=${this.isLogined ? 1 : 0}\n      ,userid=${this.curUserId},usertype=${e},type=${this.showList ? "open" : "close"},referfrom=v_pc_xlx_ggong_dl_detail_vipsp,movielist=${i}`)
        }

        handleSeeItem(e) {
            this.seeIndex < e && (this.seeIndex = e)
        }

        handleShowMore() {
            this.showMore = !this.showMore;
            let e = "0";
            this.vipInfo && "1" === this.vipInfo.isVip && (e = this.vipInfo.vasType), u.XLStatNS.trackEvent("download_detail", "dl_detail_vip_special_button_click", "", 0, 0, 0, 0, `is_login=${this.isLogined ? 1 : 0}\n      ,userid=${this.curUserId},usertype=${e},referfrom=v_pc_xlx_ggong_dl_detail_vipsp,click_id=more`)
        }

        hideShowMore() {
            this.showMore = !1
        }

        showHomePage(e) {
            let t = `https://video-vip-ssl.xunlei.com/index_pc.html?referfrom=${e}`;
            s.client.callServerFunction("OpenNewTab", t).catch(), this.showMore = !1;
            let i = "0";
            this.vipInfo && "1" === this.vipInfo.isVip && (i = this.vipInfo.vasType), u.XLStatNS.trackEvent("download_detail", "dl_detail_vip_special_button_click", "", 0, 0, 0, 0, `is_login=${this.isLogined ? 1 : 0}\n      ,userid=${this.curUserId},usertype=${i},referfrom=v_pc_xlx_ggong_dl_detail_vipsp,click_id=more`)
        }

        openMoviePage(e, t) {
            let i = `${e}&referfrom=v_pc_xlx_ggong_dl_detail_vipsp`;
            s.client.callServerFunction("OpenNewTab", i).catch();
            let n = "0";
            this.vipInfo && "1" === this.vipInfo.isVip && (n = this.vipInfo.vasType);
            let a = this.filterRecommendList[t],
                o = encodeURIComponent(`video_type=${"movie" === a.category ? "电影" : "电视剧"},video_id=${a.aid},video_name=${a.work_name},position=${t + 1}`);
            u.XLStatNS.trackEvent("download_detail", "dl_detail_vip_special_content_click", "", 0, 0, 0, 0, `is_login=${this.isLogined ? 1 : 0}\n      ,userid=${this.curUserId},usertype=${n},referfrom=v_pc_xlx_ggong_dl_detail_vipsp,${o}`)
        }

        handleShowList() {
            let e = "0";
            this.vipInfo && "1" === this.vipInfo.isVip && (e = this.vipInfo.vasType), u.XLStatNS.trackEvent("download_detail", "dl_detail_vip_special_button_click", "", 0, 0, 0, 0, `is_login=${this.isLogined ? 1 : 0}\n      ,userid=${this.curUserId},usertype=${e},referfrom=v_pc_xlx_ggong_dl_detail_vipsp,click_id=${this.showList ? "close" : "open"}`), this.showList = !this.showList, this.showMore = !1, 3 === this.movieConfig.yingyuan_dl_recommend && l.ConfigNS.setValue("yingyuan_search_dl", "yingyuan_dl_recommend_open", this.showList)
        }

        created() {
            return a(this, void 0, void 0, function* () {
                d.default.isInited() ? this.handleRemoteConfig() : d.default.attachListener("OnRemoteGlobalConfigLoaded", () => a(this, void 0, void 0, function* () {
                    this.handleRemoteConfig()
                }))
            })
        }

        handleRemoteConfig() {
            return a(this, void 0, void 0, function* () {
                let e = d.default.getConfigValue("vip", "yingyuan_search_dl", null);
                e && void 0 !== e.yingyuan_dl_recommend && (this.movieConfig = e), 2 === this.movieConfig.yingyuan_dl_recommend ? (s.client.attachServerEvent("OnLoginSuc", () => {
                    this.showList = !0
                }), s.client.attachServerEvent("OnLogout", () => {
                    this.showList = !0
                })) : 3 === this.movieConfig.yingyuan_dl_recommend && (l.ConfigNS.isInitConfigFinished() ? this.handleLocalConfig() : l.ConfigNS.attachListener("event_config_init_finished", this.handleLocalConfig))
            })
        }

        handleLocalConfig() {
            this.isOpen = l.ConfigNS.getValue("yingyuan_search_dl", "yingyuan_dl_recommend_open", !0), this.isOpen || (this.showList = !1)
        }
    };
    n([o.Prop({default: 0})], c.prototype, "curTaskId", void 0), n([o.Prop()], c.prototype, "vipInfo", void 0), n([o.Prop()], c.prototype, "isLogined", void 0), n([o.Prop()], c.prototype, "curUserId", void 0), n([o.Watch("curTaskId")], c.prototype, "onCurTaskIdChange", null), c = n([o.Component], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(263), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(770), a = i(28);
    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",
            SELECT_PRE: "SELECT_PRE",
            SELECT_NEXT: "SELECT_NEXT",
            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
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(265), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(0), s = i(3), l = i(64), d = i(502), u = i(32), c = i(106), h = i(14), f = i(29), g = i(10),
        p = i(31), v = i(15), m = i(12), y = i(354), k = i(47), T = i(68), w = i(9), C = i(5), S = i(16), I = i(72),
        b = i(26), _ = i(67), D = v.DownloadKernelEventManager.getEventManager(),
        A = m.DownloadKernelTaskManager.getTaskManager(), N = b.DownloadKernelCategoryManager.getCategoryManager(),
        x = r.default.getLogger("DownloadList");
    let E = class extends o.Vue {
        constructor() {
            super(...arguments), this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.isHoverClass = !1, this.emptyHotwordList = [], this.delayStatTimer = null, this.panTaskProgress = 100, this.panTaskType = P.UnSaved, this.panTaskData = {}, this.sideNetdiskVasType = [3, 5], this.qrCodeConfig = {
                show: !0,
                text: "扫码加速"
            }, this.tabs = [{title: "下载中", key: s.DownloadKernel.CategroyViewID.Downloading}, {
                title: "已完成",
                key: s.DownloadKernel.CategroyViewID.Completed
            }, {
                title: "回收站",
                key: s.DownloadKernel.CategroyViewID.Recycle
            }], this.completedFilterTaskList = this.completedTaskList, this.completedFilter = "全部"
        }

        get showSideNetdisk() {
            let e = 0;
            return this.vipInfo && "1" === this.vipInfo.isVip && (e = Number(this.vipInfo.vasType)), this.sideNetdiskVasType.some(t => t === e)
        }

        handleTitleClick(e) {
            this.handleCollapseChange(e)
        }

        onCategoryChange(e) {
            f.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.$nextTick(() => {
                x.information("onCategoryChange nextTick"), this.completedListRestore()
            }), this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Downloading)
        }

        onCategoryViewChange(e, t) {
            t === s.DownloadKernel.CategroyViewID.Completed && this.completedListRestore()
        }

        onCompletedTaskListChange(e) {
            if (x.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([])
        }

        get isInPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        completedListRestore() {
            y.CompletedFilterNS.reset(), this.completedFilter = "全部", this.completedFilterTaskList = this.completedTaskList
        }

        onFilterMenuClick(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
        }

        showFilterMenu(e) {
            y.CompletedFilterNS.showMenu(this.$refs.filterMenu, this.currentCategoryId, (e, t) => {
                this.onFilterMenuClick(e, t)
            }).catch()
        }

        handleCollapseChange(e) {
            let t = e, i = "", n = "";
            t === s.DownloadKernel.CategroyViewID.Downloading ? (i = "downloading_click", n = "type=" + (this.hasDownloading ? "yes" : "no")) : t === s.DownloadKernel.CategroyViewID.Completed ? i = "finished_click" : t === s.DownloadKernel.CategroyViewID.Recycle && (i = "dustbin_click"), g.XLStatNS.trackEvent("download_leftpanel", i, "", 0, 0, 0, 0, n), this.UPDATE_CATEGORYVIEW(t)
        }

        handleDelete(e, t) {
            do {
                if (40 === e.keyCode) {
                    1 === this.currentSelectdTaskInfos.length && this.SELECT_NEXT();
                    break
                }
                if (38 === e.keyCode) {
                    1 === this.currentSelectdTaskInfos.length && this.SELECT_PRE();
                    break
                }
                if ("Delete" !== e.key) break;
                if (!l.TaskStatusHelper.canMoveSelectedTask(void 0, this.currentSelectdTaskInfos)) break;
                if (void 0 === t) if (-1 !== this.currentCategoryId) t = !0; else if (e.shiftKey) t = !0; else for (let e of this.currentSelectdTaskInfos) if (-1 !== e.categoryId) {
                    t = !0;
                    break
                }
                t ? u.TaskOperatorNs.destroyTasks(this.currentSelectdTaskInfos) : u.TaskOperatorNs.deleteTasks(this.currentSelectdTaskInfos)
            } while (0)
        }

        handlePauseAll() {
            -1 === this.currentCategoryId ? u.TaskOperatorNs.pauseAll(s.DownloadKernel.TaskStopReason.PauseAll).catch() : u.TaskOperatorNs.pauseCategoryAllTask(this.currentCategoryId, s.DownloadKernel.TaskStopReason.PauseAll), g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_button_click", "", 0, 0, 0, 0, "button=pause")
        }

        handleStartAll() {
            -1 === this.currentCategoryId ? u.TaskOperatorNs.startAll() : u.TaskOperatorNs.startCategoryAllTask(this.currentCategoryId), g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_button_click", "", 0, 0, 0, 0, "button=start")
        }

        get hasDownloading() {
            return this.downloadingTaskBaseList.length > 0
        }

        get isAllDownloading() {
            let e = !0;
            for (let t of this.downloadingTaskBaseList) if (t.taskStatus !== s.DownloadKernel.TaskStatus.StartWaiting && t.taskStatus !== s.DownloadKernel.TaskStatus.StartPending && t.taskStatus !== s.DownloadKernel.TaskStatus.Started) {
                e = !1;
                break
            }
            return e
        }

        onIsAllDownloadingChange(e) {
            this.hasDownloading && (this.delayStatTimer && clearTimeout(this.delayStatTimer), this.delayStatTimer = setTimeout(() => {
                g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_button_show", "", 0, 0, 0, 0, "button=" + (e ? "pause" : "start"))
            }, 1))
        }

        get downloadProgress() {
            let e = 0, t = 0, i = 0;
            for (let e of this.downloadingTaskBaseList) e.taskStatus !== s.DownloadKernel.TaskStatus.Failed && (t += e.fileSize, i += e.downloadSize);
            return t > 0 && (e = i / t), e > 1 && (e = 1), 100 * e
        }

        downloadingItemDbClick() {
            l.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos, s.DownloadKernel.TaskStopReason.Manual) : l.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos) : x.information("downloaditem dbclick do nothing")
        }

        handleHotwordsClick(e) {
            return a(this, void 0, void 0, function* () {
                if ("" === e.url) {
                    yield I.default.isInitedAW();
                    let t = I.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=58025142_4_oem_dg&wd=$word$");
                    t = t.replace("$word$", encodeURIComponent(e.word)), e.url = t
                }
                yield C.client.callServerFunction("OpenNewTab", e.url), g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_click", "", 0, 0, 0, 0, {
                    word: e.word,
                    is_ad: e.isAd ? 1 : 0
                })
            })
        }

        handleDownloadingItemMenu(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId, this.downloadingTaskList.length), c.downloadContextMenu.popMenu(c.DownloadMenuType.DownloadingItem, e)
        }

        handleCompletedItemMenu(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.CompletedItem, e)
        }

        handleRecycleItemMenu(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.RecycleItem, e)
        }

        handleDownloadingBlankMenu(e) {
            -1 === this.currentCategoryId && (0 === this.currentSelectdTaskInfos.length ? (c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.DownloadingBlank, e)) : this.handleDownloadingItemMenu(e))
        }

        handleRecycleBlankMenu(e) {
            0 === this.currentSelectdTaskInfos.length ? (c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.RecycleBlank, e)) : this.handleRecycleItemMenu(e)
        }

        handleDownloadingCategoryMore(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.DownloadingCategory, e)
        }

        handleDownloadingCategoryMenu(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading ? -1 === this.currentCategoryId && this.handleDownloadingCategoryMore(e) : this.handleCollapseChange(s.DownloadKernel.CategroyViewID.Downloading)
        }

        handleCompletedCategoryMore(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.CompletedCategory, e)
        }

        handleCompletedCategoryMenu(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed ? this.handleCompletedCategoryMore(e) : this.handleCollapseChange(s.DownloadKernel.CategroyViewID.Completed)
        }

        handleRecycleCategoryMore(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.RecycleCategory, e)
        }

        handleRecycleCategoryMenu(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle ? this.handleRecycleCategoryMore(e) : this.handleCollapseChange(s.DownloadKernel.CategroyViewID.Recycle)
        }

        selectAll() {
            let e = [], t = null;
            switch (this.currentCategoryViewId) {
                case s.DownloadKernel.CategroyViewID.Downloading:
                    t = this.UPDATE_DOWNLOADING_SELECTED_TASKS, e = [...this.downloadingTaskList];
                    break;
                case s.DownloadKernel.CategroyViewID.Completed:
                    t = this.UPDATE_COMPLETED_SELECTED_TASKS, e = [...this.completedFilterTaskList];
                    break;
                case s.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, i, n, a) {
            let o = i.indexOf(e);
            -1 !== o && (1 === n.length && n[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 === s.DownloadKernel.CategroyViewID.Downloading ? this.scrollToSpecified(t, "downloading", this.downloadingTaskList, this.downloadingSelectedIndexs, this.UPDATE_DOWNLOADING_SELECTED_TASKS) : e === s.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 === s.DownloadKernel.CategroyViewID.Recycle && this.scrollToSpecified(t, "dustbin", this.recycleTaskList, this.recycleSelectedTaskIndexs, this.UPDATE_RECYCLE_SELECTED_TASKS))
        }

        created() {
            this.attachTaskEvent(), c.downloadContextMenu.attachListener(h.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), c.downloadContextMenu.attachListener(h.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), c.downloadContextMenu.attachListener(h.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd), f.default.attachListener(h.NodeEventMesssageNS.evetDownloadMove2Tail, (e, t) => {
                this.MOVE_TO_BOTTOM([e]), t && this.$nextTick(() => {
                    t()
                })
            }), C.client.attachServerEvent("OnPanTaskTypeChange", (e, ...t) => {
                t && (this.panTaskType = t[0])
            }), C.client.attachServerEvent("OnPanTaskUploadProgressChange", (e, ...t) => {
                !t || t.length < 1 || (this.panTaskProgress = t[0])
            }), C.client.attachServerEvent("OnPanTaskDataChange", (e, ...t) => {
                !t || t.length < 1 || (this.panTaskData = t[0])
            })
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== s.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 === s.DownloadKernel.TaskStatus.StartPending || t.taskStatus === s.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== s.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                w.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.SORT_CATEGORY_HISTORY(), 0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Completed)
                })
            })
        }

        handleKeyDown(e) {
            if (e.ctrlKey && 68 === e.keyCode) this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos); else if (e.ctrlKey && 83 === e.keyCode) this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos, s.DownloadKernel.TaskStopReason.Manual); else if (e.ctrlKey && 69 === e.keyCode) 1 === this.currentSelectdTaskInfos.length && (u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0]).catch(e => {
                x.warning(e)
            }), this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(this.currentSelectdTaskInfos, 1)); else if (e.ctrlKey && 82 === e.keyCode) this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.recoverTask(this.currentSelectdTaskInfos); else if (e.ctrlKey && 13 === e.keyCode && (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle || this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed) && 1 === this.currentSelectdTaskInfos.length) {
                let e = this.currentSelectdTaskInfos[0].taskStatus;
                if (e === s.DownloadKernel.TaskStatus.Succeeded || e === s.DownloadKernel.TaskStatus.Seeding) {
                    let e = "";
                    if (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed ? e = "finished" : this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), this.currentSelectdTaskInfos[0].taskType === s.DownloadKernel.TaskType.Bt) {
                        let e = A.getTaskFromTaskId(this.currentSelectdTaskInfos[0].taskId);
                        k.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 === s.DownloadKernel.TaskType.Group) {
                        let e = A.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 => {
                        x.warning(e)
                    });
                    this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(this.currentSelectdTaskInfos, 1)
                }
            }
        }

        getHotwords() {
            return a(this, void 0, void 0, function* () {
                const e = yield i(20);
                e.defaults.adapter = i(21);
                let t = [], n = !1;
                try {
                    let i = yield e.request({method: "get", url: "http://static-xl.a.88cdn.com/json/hotwords.json"});
                    200 === i.status && i.data && (t = i.data, n = !0)
                } catch (e) {
                    x.information("request hotwords.json exception! e", e)
                }
                if (x.information("request hotwords.json data:", t), n || g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_update_fail"), t.length > 0) {
                    let e = yield T.AdHelperNS.getHotWordsAw(), i = _(e, "data", 0, "query");
                    x.information("getHotWordsAw adQueryWord:", i), i && i.length > 0 ? t[t.length - 1] = {
                        word: i,
                        url: "",
                        isAd: !0
                    } : g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_ad_update_fail");
                    for (let e = 0; e < t.length / 2; ++e) {
                        this.emptyHotwordList[e] = [];
                        for (let i = 0; i < 2 && 2 * e + i < t.length; ++i) this.emptyHotwordList[e][i] = t[2 * e + i]
                    }
                    x.information("this.emptyHotwordList:", this.emptyHotwordList), g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_show")
                }
            })
        }

        handleCategoryMore(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading ? this.handleDownloadingCategoryMore(e) : this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed ? this.handleCompletedCategoryMore(e) : this.handleRecycleCategoryMore(e)
        }

        getRecycleTaskBaseList() {
            return this.recycleTaskBaseList
        }

        registerFunctions() {
            return a(this, void 0, void 0, function* () {
                (yield C.client.checkServerFunction("GetRecycleTaskBaseList")) || S.server.registerFunctions({GetRecycleTaskBaseList: this.getRecycleTaskBaseList.bind(this)})
            })
        }

        mounted() {
            y.CompletedFilterNS.refresh((e, t) => {
                do {
                    if ("全部" === e) {
                        this.completedListRestore();
                        break
                    }
                    if (e && (this.completedFilter = e), t) {
                        let e = this.completedTaskList.filter(e => -1 !== t.indexOf(e));
                        this.completedFilterTaskList = e
                    }
                } while (0)
            }), this.statusChangedEventId = D.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];
                    if (x.verbose("StatusChanged groupId:", t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId), ", status:", t[0].getTaskStatus()), t.length > 0) {
                        let e = t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId);
                        if ((-1 === e || N.isPrivateCategory(e)) && e !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== s.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== s.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            let e = this.shouldChange2Complete(), t = this.shouldChangeCompleteSelect();
                            e && setTimeout(() => {
                                this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Completed), t && this.UPDATE_COMPLETED_SELECTED_TASKS([this.completedTaskList[0]])
                            }, 0)
                        })
                    }
                } while (0)
            }), A.isLoadStorageTaskFinish() ? this.bLoadDbFinish = !0 : (this.dataBaseLoadCookie = 0, p.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.insertToCategoryViewEventId = D.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];
                    if (void 0 !== e[4] && e[4] === s.DownloadKernel.TaskInsertReason.LoadTaskBasic && -1 !== t) break;
                    let i = e[2], n = e[3], a = e[4], o = n.map(e => e.getTaskBaseInfo());
                    this.INSERT_TO_CATEGORY_VIEW({
                        id: i,
                        categoryId: t,
                        tasks: o
                    }), this.bLoadDbFinish && -1 === t && i === s.DownloadKernel.CategroyViewID.Downloading && (a === s.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                        if (this.currentCategoryViewId !== s.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(s.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)
            }), setTimeout(() => {
                this.getHotwords().catch()
            }, 2e3), I.default.isInited() ? (this.sideNetdiskVasType = I.default.getConfigValue("main", "sideNetdisk", [3, 5]), this.qrCodeConfig = I.default.getConfigValue("main", "QRCode", {
                show: !0,
                text: "扫码加速"
            }), S.server.fireClientEvent("OnQrCodeConfigUpdate", this.qrCodeConfig)) : I.default.attachListener("OnRemoteGlobalConfigLoaded", () => {
                this.sideNetdiskVasType = I.default.getConfigValue("main", "sideNetdisk", [3, 5]), this.qrCodeConfig = I.default.getConfigValue("main", "QRCode", {
                    show: !0,
                    text: "扫码加速"
                }), S.server.fireClientEvent("OnQrCodeConfigUpdate", this.qrCodeConfig)
            })
        }

        destroyed() {
            c.downloadContextMenu.detachListener(h.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), c.downloadContextMenu.detachListener(h.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), c.downloadContextMenu.detachListener(h.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd), void 0 !== this.insertToCategoryViewEventId && D.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.statusChangedEventId && D.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, p.DownloadKernelManager.detachListener(h.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd))
        }
    };
    var P;
    n([o.Prop()], E.prototype, "vipInfo", void 0), n([o.Prop({})], E.prototype, "currentTabId", void 0), n([o.Prop({})], E.prototype, "currentCategoryId", void 0), n([o.Prop({})], E.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], E.prototype, "downloadingTaskList", void 0), n([o.Prop({})], E.prototype, "downloadingTaskBaseList", void 0), n([o.Prop({})], E.prototype, "completedTaskList", void 0), n([o.Prop({})], E.prototype, "completedTaskBaseList", void 0), n([o.Prop({})], E.prototype, "recycleTaskList", void 0), n([o.Prop({})], E.prototype, "recycleTaskBaseList", void 0), n([o.Prop({})], E.prototype, "downloadingSelectedIndexs", void 0), n([o.Prop({})], E.prototype, "completedSelectedTaskIndexs", void 0), n([o.Prop({})], E.prototype, "recycleSelectedTaskIndexs", void 0), n([o.Prop({})], E.prototype, "currentSelectdTaskInfos", void 0), n([o.Prop({})], E.prototype, "canStartAll", void 0), n([o.Prop({})], E.prototype, "UPDATE_CATEGORY", void 0), n([o.Prop({})], E.prototype, "UPDATE_CATEGORYVIEW", void 0), n([o.Prop({})], E.prototype, "SORT_CATEGORY_HISTORY", void 0), n([o.Prop({})], E.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), n([o.Prop({})], E.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), n([o.Prop({})], E.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), n([o.Prop({})], E.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), n([o.Prop({})], E.prototype, "MOVE_TO_TOP", void 0), n([o.Prop({})], E.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), n([o.Prop({})], E.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), n([o.Prop({})], E.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), n([o.Prop({})], E.prototype, "MOVE_TO_BOTTOM", void 0), n([o.Prop({})], E.prototype, "SELECT_PRE", void 0), n([o.Prop({})], E.prototype, "SELECT_NEXT", void 0), n([o.Prop({})], E.prototype, "INIT_CATEGORY_TASKLIST", void 0), n([o.Prop({})], E.prototype, "INSERT_TO_CATEGORY_VIEW", void 0), n([o.Prop({})], E.prototype, "UPDATE_TASK_STATUS", void 0), n([o.Prop({})], E.prototype, "attachTaskEvent", void 0), n([o.Prop({})], E.prototype, "selectTab", void 0), n([o.Watch("currentCategoryId")], E.prototype, "onCategoryChange", null), n([o.Watch("currentCategoryViewId")], E.prototype, "onCategoryViewChange", null), n([o.Watch("completedTaskList")], E.prototype, "onCompletedTaskListChange", null), n([o.Watch("completedFilter")], E.prototype, "onCompletedFilterChange", null), n([o.Watch("isAllDownloading", {immediate: !0})], E.prototype, "onIsAllDownloadingChange", null), E = n([o.Component({components: {DownloadCategory: d.default}})], E), t.default = E, function (e) {
        e[e.UnLogin = 1] = "UnLogin", e[e.ErrorTask = 2] = "ErrorTask", e[e.UnSaved = 3] = "UnSaved", e[e.needMoreSpace = 4] = "needMoreSpace", e[e.Saved = 5] = "Saved"
    }(P || (P = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(267), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(0), s = i(3), l = i(771), d = i(778), u = i(780), c = i(29), h = i(14), f = i(12), g = i(343),
        p = i(105), v = i(9), m = i(24), y = i(41), k = i(5), T = r.default.getLogger("DownloadCategory"),
        w = p.PluginWebviewMgrNS.getWebViewMgr(), C = f.DownloadKernelTaskManager.getTaskManager();
    let S = class extends o.Vue {
        constructor() {
            super(...arguments), this.enbaleVipPlugin = !1, this.observer = null, this.vipPluginAttachFunc = null, this.isFirstShowScanCode = !1, this.accelerationTimes = 0, this.days = 0, this.saveStatus = "PHASE_TYPE_PENDING", this.loadedIndex = 0, this.deleted = {}, this.opened = {}, this.dataChecking = {}, this.fileTransferTooltipVisible = {}, this.showFileTransferTipTaskId = void 0
        }

        get taskCount() {
            return this.tasklist.length
        }

        get loadedList() {
            let e = this.loadedIndex + 20;
            return e > this.taskCount && (e = this.taskCount), T.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-finish": !this.opened[e],
                        "is-check": this.dataChecking[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])
            }), this.updateShouleiFileTransferTip().catch()
        }

        onTasklistChange(e, t) {
            this.$nextTick(() => {
                this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && w.updateTaskAdWebview()
            })
        }

        handleCategoryShow(e) {
            return a(this, void 0, void 0, function* () {
                if (e === s.DownloadKernel.CategroyViewID.Completed && this.showFileTransferTipTaskId) {
                    let e = v.ConfigNS.getValue("ShouleiDownload", "AutoShowFileTransferToolTip", 1);
                    T.information("handleCategoryShow autoShowToolTip", e), 1 === e && v.ConfigNS.setValue("ShouleiDownload", "AutoShowFileTransferToolTip", 0)
                }
            })
        }

        updateShouleiFileTransferTip() {
            return a(this, void 0, void 0, function* () {
                this.taskCount > 0 && "CompletedItemContainer" === this.componentName && v.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => a(this, void 0, void 0, function* () {
                    let e = v.ConfigNS.getValue("ShouleiDownload", "AutoShowFileTransferToolTip", 1);
                    if (T.information("updateShouleiFileTransferTip autoShowToolTip", e), 1 === e) {
                        yield m.default.isInitedAw();
                        let e = m.default.getConfigInfo("shouleiDownload", "enableTransfer");
                        if (T.information("updateShouleiFileTransferTip enableTransfer", e), 0 !== e) {
                            let e = void 0;
                            for (let t = 0; t < this.loadedList.length; ++t) {
                                let i = this.loadedList[t];
                                if (yield y.TaskCtrlOperatorNS.isExistTaskFile(C.getTaskFromTaskId(i).getTaskBaseInfo())) {
                                    e = i;
                                    break
                                }
                            }
                            T.information("updateShouleiFileTransferTip", e), e !== this.showFileTransferTipTaskId && (this.showFileTransferTipTaskId && this.$set(this.fileTransferTooltipVisible, String(this.showFileTransferTipTaskId), !1), e && (this.$set(this.fileTransferTooltipVisible, String(e), !0), this.showFileTransferTipTaskId = e)), this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && this.showFileTransferTipTaskId && v.ConfigNS.setValue("ShouleiDownload", "AutoShowFileTransferToolTip", 0)
                        }
                    }
                }))
            })
        }

        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)
        }

        handleScroll(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && w.updateTaskAdWebview()
        }

        handleSorting() {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && (w.hideTaskAdWebview(), w.setSorting(!0))
        }

        handleSortEnd() {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && (w.setSorting(!1), w.updateTaskAdWebview())
        }

        handleItemDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleContextMenu(e) {
            this.$emit("contextmenu", e)
        }

        handleCancleActive(e) {
            T.information("receive eventShowHomePage", e);
            let t = C.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                e !== s.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, i = t.querySelectorAll(".td-draglist-item"), n = void 0,
                a = document.querySelector(".td-collapse,.xlx-side");
            void 0 !== a && null !== a && (n = -1 === this.currentCategoryId ? a.clientHeight - 95 : a.clientHeight - 70);
            do {
                if (null === i || void 0 === i || 0 === i.length) break;
                if (e < 0) break;
                if (e > i.length - 1) break;
                let a = 0, o = 0;
                for (let t of i) {
                    if (o === e) break;
                    a += 1, t.classList.contains("v-leave") || (o += 1)
                }
                a === i.length && (a -= 1);
                let r = i[a];
                T.information("scroll index & realIndex", e, a), g.ThunderWindowNS.autoAdaptScrollIntoView(r, t, n)
            } while (0)
        }

        onVipPluginLoaded(e) {
            this.enbaleVipPlugin = e
        }

        resizeHandler(e) {
            this.enbaleVipPlugin && this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && w.updateTaskAdWebview()
        }

        initScanCode() {
            return a(this, void 0, void 0, function* () {
                v.ConfigNS.isInitConfigFinished() ? this.isFirstShowScanCode = v.ConfigNS.getValue("ShouleiDownload", "isFirstShowScanCode", !0) : v.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.isFirstShowScanCode = v.ConfigNS.getValue("ShouleiDownload", "isFirstShowScanCode", !0)
                })
            })
        }

        updateFirstShowScanCode() {
            this.isFirstShowScanCode = !1
        }

        mounted() {
            c.default.attachListener(h.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive), this.enbaleVipPlugin = w.isVipPluginEnable(), this.vipPluginAttachFunc = this.onVipPluginLoaded.bind(this), w.on("vip_plugin_enable", this.vipPluginAttachFunc), window.addEventListener("resize", this.resizeHandler.bind(this)), this.observer = new MutationObserver(e => {
                this.enbaleVipPlugin && this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && w.updateTaskAdWebview()
            });
            this.observer.observe(this.$el, {
                attributes: !0,
                childList: !0,
                characterData: !0
            }), this.updateShouleiFileTransferTip().catch(), "DownloadingItemContainer" === this.componentName && (setTimeout(() => {
                this.initScanCode()
            }, 2e3), k.client.attachServerEvent("UpdateAccelerationTimes", (e, t, i) => {
                this.accelerationTimes = t, this.days = i
            }), k.client.attachServerEvent("UpdateSaveStatus", (e, t) => {
                this.saveStatus = t
            }), k.client.attachServerEvent("UpdateFirstShowScanCode", this.updateFirstShowScanCode.bind(this)))
        }

        destroyed() {
            this.observer && this.observer.disconnect(), c.default.detachListener(h.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive), w.removeListener("vip_plugin_enable", this.vipPluginAttachFunc), window.removeEventListener("resize", this.resizeHandler.bind(this))
        }
    };
    n([o.Prop({})], S.prototype, "pulseForRename", void 0), n([o.Prop({default: ""})], S.prototype, "sharedKeyWords", void 0), n([o.Prop({})], S.prototype, "itemType", void 0), n([o.Prop({})], S.prototype, "currentCategoryId", void 0), n([o.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], S.prototype, "componentName", void 0), n([o.Prop({})], S.prototype, "tasklist", void 0), n([o.Prop({})], S.prototype, "selectedTaskIds", void 0), n([o.Prop({default: !0})], S.prototype, "sortable", void 0), n([o.Prop({})], S.prototype, "COMMIT_SELECT", void 0), n([o.Prop({})], S.prototype, "COMMIT_UPDATE_TASKLIST", void 0), n([o.Prop({default: 100})], S.prototype, "panTaskProgress", void 0), n([o.Prop({default: 0})], S.prototype, "panTaskType", void 0), n([o.Prop({default: null})], S.prototype, "panTaskData", void 0), n([o.Prop()], S.prototype, "showSideNetdisk", void 0), n([o.Prop()], S.prototype, "qrCodeConfig", void 0), n([o.Prop()], S.prototype, "vipInfo", void 0), n([o.Watch("loadedList", {immediate: !0})], S.prototype, "onLoadedListChanged", null), n([o.Watch("tasklist")], S.prototype, "onTasklistChange", null), n([o.Watch("currentCategoryViewId")], S.prototype, "handleCategoryShow", null), S = n([o.Component({
        components: {
            DownloadingItemContainer: l.default,
            CompletedItemContainer: d.default,
            RecycleItemContainer: u.default
        }
    })], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(269), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(772), a = i(28), o = i(3), r = i(26).DownloadKernelCategoryManager.getCategoryManager();
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = t.taskId, a = t.currentCategoryId;
                if (-1 === a) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Downloading) {
                        i = e.DownloadListState.taskList[t].tasksMap[n];
                        break
                    }
                } else if (r.isPrivateCategory(a)) for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Downloading && (i = e.DownloadListState.taskListPrivate[t].tasksMap[n]);
                return i
            }, vipSpeedInfo: (e, t) => {
                let i = null, n = t.taskId;
                return i = e.VipSpeedState.vipSpeedMap[n] ? e.VipSpeedState.vipSpeedMap[n] : e.VipSpeedState.defaultStatus
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(271), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(3), s = i(12), l = i(13), d = i(66), u = i(39), c = i(64), h = i(14), f = i(32), g = i(29),
        p = i(10), v = i(15), m = i(44), y = i(0), k = i(503), T = i(98), w = i(105), C = i(484), S = i(5), I = i(53),
        b = i(16), _ = i(9), D = i(485), A = {margin: 0, width: 72}, N = w.PluginWebviewMgrNS.getWebViewMgr(),
        x = v.DownloadKernelEventManager.getEventManager(), E = s.DownloadKernelTaskManager.getTaskManager(),
        P = y.default.getLogger("DownloadPanel.DownloadingItem");
    var O;
    !function (e) {
        e[e.Unknown = 0] = "Unknown", e[e.Error = 1] = "Error", e[e.SaveAsNormal = 2] = "SaveAsNormal", e[e.SaveAsPlay = 3] = "SaveAsPlay", e[e.Saving = 4] = "Saving", e[e.Saved = 5] = "Saved", e[e.NoSpace = 6] = "NoSpace"
    }(O || (O = {}));
    let M = class extends o.Vue {
        constructor() {
            super(...arguments), this.btSubDetailCookie = -1, this.groupTaskStatusCookie = -1, this.groupTaskSubFileDetailChangedCookie = -1, this.p2spTaskDetailChangedCookie = -1, this.hover = !1, this.titleOverFlow = "", this.subTaskCount = 0, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.percentVisible = !1, this.isQuerying = !1, this.startStatusPrompt = void 0, this.playProgress = 0, this.taskExtraLoaded = !1, this.canAccelerate = !0, this.shortlink = "", this.isClickedAdd = !1, this.isDisabled = !1, this.dataValidating = !1, this.toolTip = {
                validating: "",
                remainTime: ""
            }, this.trackd = !1, this.netExpandType = O
        }

        get isVip() {
            return !(!this.vipInfo || "1" !== this.vipInfo.isVip)
        }

        get isSuperVipUser() {
            return !(!this.vipInfo || "1" !== this.vipInfo.isVip || "5" !== this.vipInfo.vasType)
        }

        onChosenChanged(e) {
            e && (this.percentVisible = !1), g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemChosen, r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, e, this.active)
        }

        onTaskBaseChanged() {
            let e = T.DownloadJammedNS.isValidatingFileData(this.taskId),
                t = T.DownloadJammedNS.isCorrectingData(this.taskId);
            if (e) {
                this.toolTip.validating = "正在校验文件...";
                let e = T.DownloadJammedNS.getValidationDuration(this.taskId);
                e && e.remainSeconds !== 1 / 0 ? this.toolTip.remainTime = "剩余" + d.TimeHelperNS.formatSeconds(e.remainSeconds) : this.toolTip.remainTime = "剩余--:--:--"
            } else t && (this.toolTip.validating = "检查到部分文件错误", this.toolTip.remainTime = "正在重新下载");
            this.dataValidating = e, this.$emit("update:dataChecking", e || t)
        }

        onEnableVipPlugin(e) {
            e && this.isShowExpand && this.$nextTick(() => {
                g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, this.$el)
            })
        }

        onShowCloudExpand() {
            return a(this, void 0, void 0, function* () {
                yield this.$nextTick(), this.isShowExpand && N.updateTaskAdWebview()
            })
        }

        onTaskFailedChange(e) {
            "search" !== this.itemType && this.enbaleVipPlugin && this.active && (e ? N.hideTaskAdWebview(this.taskId) : this.$nextTick(() => {
                N.showTaskAdWebview(this.taskId, this)
            }))
        }

        onOptionsChanged(e) {
            this.active && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, e === r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, this.$el), this.chosen && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemChosen, r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, e === r.DownloadKernel.CategroyViewID.Downloading, this.active)
        }

        onPanTaskTypeChange(e, t) {
            if ((e !== t || void 0 === e) && (this.trackd = !0, this.active && this.showSideNetdisk && !this.isNetdiskTask && 4 !== this.panTaskType && this.taskStatus !== r.DownloadKernel.TaskStatus.Failed)) {
                let e = "button=";
                !this.canPlay || 3 !== this.panTaskType && 1 !== this.panTaskType ? this.canPlay || 3 !== this.panTaskType && 1 !== this.panTaskType ? 5 === this.panTaskType && 100 !== this.panTaskProgress ? e += "adding" : 5 !== this.panTaskType || this.canPlay ? (5 === this.panTaskType && this.canPlay, e += "yunpan_play") : e += "see_detail" : e += "add_now" : e += "yunpan_play", p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_show", "", 0, 0, 0, 0, e)
            }
        }

        onTaskIdChanged(e, t) {
            void 0 !== t && (this.unInitialize(), this.initialize())
        }

        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 isNetdiskTask() {
            return !(!this.taskBase || -1 === this.taskBase.categoryId || -1 !== this.currentCategoryId)
        }

        get remindType() {
            let e = "none";
            do {
                if (!this.vipSpeedInfo) break;
                if (!this.vipSpeedInfo.remindType) break;
                e = this.vipSpeedInfo.remindType
            } while (0);
            return e
        }

        get remindShow() {
            return "online" === this.remindType || "fail" === this.remindType || "remind" === this.remindType || "reminded" === this.remindType || "online_read" === this.remindType
        }

        get remindClass() {
            let e = "";
            switch (this.remindType) {
                case"reminded":
                    e = "is-remind";
                    break;
                case"online":
                    e = "is-suc";
                    break;
                case"online_read":
                    e = "is-suc is-read";
                    break;
                case"fail":
                    e = "is-fail"
            }
            return e
        }

        get remindLabel() {
            let e = "";
            switch (this.remindType) {
                case"reminded":
                    e = "已提醒";
                    break;
                case"online":
                case"online_read":
                    e = "已上线";
                    break;
                case"fail":
                    e = "未成功"
            }
            return e
        }

        get canShowHuddle() {
            let e = !1;
            do {
                if (!this.active) break;
                if (this.taskStatus === r.DownloadKernel.TaskStatus.Failed) break;
                if (this.isGroup) break;
                e = !0
            } while (0);
            return e
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.taskError) break;
                if (this.taskBase.isMoving) break;
                if (!this.taskExtraLoaded) break;
                let t = E.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        get playProgressStyle() {
            return this.playCompleted ? "width: 0%;" : "width: " + 100 * this.playProgress + "%;"
        }

        get playCompleted() {
            return 1 === this.playProgress
        }

        get subTaskCountDesc() {
            return this.subTaskCount > 999 ? "999+文件" : this.subTaskCount + "个文件"
        }

        onActiveChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                "search" !== this.itemType && this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading && 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), this.$emit("active-task", this.taskBase.taskId), this.active ? (this.trackd = !1, setTimeout(() => {
                    this.trackd || this.onPanTaskTypeChange()
                }, 100), setTimeout(() => {
                    this.getShortLinkfunc().catch()
                }, 3e3), this.getShortLinkfunc().catch()) : (this.isFirstShowScanCode && "" !== this.shortlink && this.$emit("update:isFirstShowScanCode", !1), this.shortlink = "")
            })
        }

        getShortLinkfunc() {
            return a(this, void 0, void 0, function* () {
                if ("" === this.shortlink) {
                    if (this.active && !this.isVip && this.vipSpeedInfo && !this.vipSpeedInfo.isSensitive && !this.taskError && this.accelerationTimes > 0) {
                        let e = E.getTaskFromTaskId(this.taskBase.taskId),
                            t = {task_id: String(this.taskBase.taskId), task_infos: []};
                        if (this.taskBase.taskType === r.DownloadKernel.TaskType.Bt) {
                            let i = e.getExtraObject(), n = i.getInfoId(), a = i.getDisplayName();
                            t.infohash = n, t.bt_title = a;
                            let o = i.getBtFileList();
                            for (let [, e] of o) {
                                let i = {};
                                e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Download) && e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileStatus) < 3 && (i.url = "", i.gcid = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Gcid), i.cid = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Cid) || i.gcid, i.filename = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), i.filesize = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileSize), i.file_index = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.RealIndex), t.task_infos.push(i))
                            }
                        } else if (this.taskBase.taskType === r.DownloadKernel.TaskType.Group) ; else {
                            let e = {};
                            e.url = this.taskBase.url, e.gcid = this.taskBase.gcid, e.cid = this.taskBase.cid || this.taskBase.gcid, e.filename = this.taskBase.taskName, e.filesize = this.taskBase.fileSize, t.task_infos.push(e)
                        }
                        !this.isGroup && this.accelerationTimes > 0 && (this.shortlink = yield C.getShortlink(t)), this.shortlink && this.qrCodeConfig.show && (this.$nextTick(() => {
                            let e = this.$refs.canvas;
                            D.toCanvas(e, this.shortlink, A, e => {
                                P.information("QRCode.toCanvas error = ", e)
                            })
                        }), this.isFirstShowScanCode && (_.ConfigNS.setValue("ShouleiDownload", "isFirstShowScanCode", !1), p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_2d_code_show", "", 0, 0, 0, 0, `position=left,if_child_task_list=${this.isGroup || this.isBt ? 1 : 0},task_id=${this.taskId}`)), p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_icon_show", "", 0, 0, 0, 0, `if_child_tsak_list=${this.isBt || this.isGroup ? 1 : 0},task_id=${this.taskId}`))
                    } else this.shortlink = "";
                    this.active && b.server.fireClientEvent("UpdateShortLink", this.shortlink)
                }
            })
        }

        handleQRCodeHover() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_icon_hover", "", 0, 0, 0, 0, `task_id=${this.taskId}`), p.XLStatNS.trackEvent("download_leftpanel", "downloading_scan_accelerate_2d_code_show", "", 0, 0, 0, 0, `position=left,if_child_task_list=${this.isGroup || this.isBt ? 1 : 0},task_id=${this.taskId}`)
        }

        get taskError() {
            return this.taskBase.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        get isForbidden() {
            let e = !1;
            do {
                if (this.taskError) {
                    let t = 0, i = E.getTaskFromTaskId(this.taskBase.taskId);
                    if (null !== i && (t = i.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, i = E.getTaskFromTaskId(this.taskBase.taskId);
                null !== i && (t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), e = c.TaskStatusHelper.getTaskErrorInfoByCode(t)
            }
            return e
        }

        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
                }
                if (this.taskStatus === r.DownloadKernel.TaskStatus.Stopped) {
                    this.percentVisible = !1;
                    break
                }
                this.percentVisible = !0;
                break
            } while (0)
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, i = t.scrollHeight, n = t.offsetHeight;
            this.titleOverFlow = i > n ? this.taskBase.taskName : ""
        }

        handleIconMouseHover(e) {
            let t = T.DownloadJammedNS.isValidatingFileData(this.taskId);
            T.DownloadJammedNS.isCorrectingData(this.taskId) && !t && (P.information("mouse over media icon when data correcting"), p.XLStatNS.trackEvent("download_leftpanel", "data_error_correction_icon_hover", "", 0, 0, 0, 0, ""))
        }

        get fileTypeClass() {
            return u.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType, "xly-type-")
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSize() {
            return this.taskBase.fileSize
        }

        get fileSizeFormat() {
            return l.ThunderUtil.formatSizeCustom(this.taskBase.fileSize)
        }

        get downloadSize() {
            return this.taskBase.downloadSize
        }

        get downloadSizeFormat() {
            return l.ThunderUtil.formatSizeCustom(this.taskBase.downloadSize)
        }

        get progress() {
            let e = 0;
            return 0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), P.information("data in validating:", this.taskBase.downloadSize - this.taskBase.validDownloadSize, ", downloaded:", this.taskBase.downloadSize, ",progress:", e), 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.formatSizeCustom(t, 1, 4) + "/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 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 i = t / this.taskBase.downloadSpeed;
                        e = d.TimeHelperNS.formatSecondsCustom(i)
                    }
                }
            } else e = this.progressPercent;
            return e
        }

        get isFailed() {
            return this.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        get isShowExpand() {
            return this.taskStatus !== r.DownloadKernel.TaskStatus.Failed && ("search" !== this.itemType && this.active)
        }

        get isShowCloudExpand() {
            return this.active && this.showSideNetdisk && !this.isNetdiskTask && !this.taskError && this.cloudExpandType !== O.Unknown
        }

        get cloudExpandType() {
            let e = O.Unknown;
            do {
                if ("PHASE_TYPE_ERROR" === this.saveStatus) {
                    e = O.Error;
                    break
                }
                if (3 === this.panTaskType || 1 === this.panTaskType || 4 === this.panTaskType && !this.isClickedAdd) {
                    e = this.canPlay ? O.SaveAsPlay : O.SaveAsNormal;
                    break
                }
                if (5 === this.panTaskType && 100 !== this.panTaskProgress) {
                    e = O.Saving;
                    break
                }
                if (5 === this.panTaskType) {
                    e = O.Saved;
                    break
                }
                if (4 === this.panTaskType && this.isClickedAdd) {
                    e = O.NoSpace;
                    break
                }
            } while (0);
            return e
        }

        get isSuperVip() {
            let e = !1;
            return this.enbaleVipPlugin && this.vipSpeedInfo && (e = this.vipSpeedInfo.isShowSuperSpeed && this.vipSpeedInfo.isAcclerated), e
        }

        handleClickSensitive() {
            do {
                if (!this.vipSpeedInfo) break;
                if (!this.vipSpeedInfo.isSensitive) break;
                if (!this.vipSpeedInfo.sensitive) break;
                if (!this.vipSpeedInfo.sensitive.onAction) break;
                this.vipSpeedInfo.sensitive.onAction()
            } while (0)
        }

        onShowQueryTip(e) {
            if (e) {
                let e = k.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()), E.getTaskFromTaskId(this.taskBase.taskId) && f.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "bianxiabianbo", "downloading", this.currentCategoryId, !1, 0, !this.playCompleted).catch()
        }

        handleStartTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_continue_click", "", 0, 0, 0, 0, this.statExtData()), m.DownloadDispatchNS.startTask(this.taskBase.taskId)
        }

        handlePauseTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_pause_click", "", 0, 0, 0, 0, this.statExtData()), E.stopTask(this.taskBase.taskId, r.DownloadKernel.TaskStopReason.Manual)
        }

        handleDestroyTask() {
            f.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleGroupAccelerateClick() {
            this.vipSpeedInfo && this.vipSpeedInfo.huddle && this.vipSpeedInfo.huddle.onClick && this.vipSpeedInfo.huddle.onClick()
        }

        updateBtTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = [];
            t.getDownloadFile().forEach(e => {
                let n = t.getBtFileByRealIndex(e);
                if (n.isSupportPlay()) {
                    let e = 0, t = n.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Duration),
                        a = n.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.PlayPosition);
                    t && (e = a / t), i.push(e)
                }
            }), i.length && (this.playProgress = i.reduce(function (e, t, i, n) {
                return e + t
            }) / i.length)
        }

        updateGroupTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = [];
            for (let e = 0; e < this.subTaskCount; ++e) {
                let n = t.getSubTaskByIndex(e);
                if (n && n.isSupportPlay()) {
                    let e = 0, t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.Duration),
                        a = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.PlayPosition);
                    t && (e = a / t), i.push(e)
                }
            }
            i.length && (this.playProgress = i.reduce(function (e, t, i, n) {
                return e + t
            }) / i.length)
        }

        updateP2spTaskPlayProgress(e) {
            if (e.isSupportPlay()) {
                let t = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.Duration),
                    i = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.PlayPosition);
                t && (this.playProgress = i / t)
            }
        }

        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 = E.getTaskFromTaskId(this.taskBase.taskId), t = e.getExtraObject().getDownloadFile();
                    t.length !== this.subTaskCount && (this.subTaskCount = t.length), this.updateBtTaskPlayProgress(e)
                }
            } 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 i = t[e];
                    if (i.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId) === this.taskId) {
                        let e = i.getExtraObject();
                        this.subTaskCount = e.getDownloadTaskCount(), this.updateGroupTaskPlayProgress(i);
                        break
                    }
                }
            } while (0)
        }

        onGroupTaskSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                if (!e[1]) break;
                e[1].forEach((e, t) => {
                    if (t === this.taskId) {
                        let e = E.getTaskFromTaskId(t);
                        e && this.updateGroupTaskPlayProgress(e)
                    }
                })
            } while (0)
        }

        onP2spTaskDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.DetailChanged) break;
                if (!e[1]) break;
                let t = e[2];
                if (t & r.DownloadKernel.TaskDetailChangedFlags.PlayPosition || t & r.DownloadKernel.TaskDetailChangedFlags.Duration) {
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i && i.getId() === this.taskId) {
                            this.updateP2spTaskPlayProgress(i);
                            break
                        }
                    }
                }
            } while (0)
        }

        showDetail() {
            return a(this, void 0, void 0, function* () {
                this.isDisabled || (yield S.client.callServerFunction("SelectNav", I.NavViewID.Cloud).catch(), p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_click", "", 0, 0, 0, 0, "button=see_detail"), this.isDisabled = !0, setTimeout(() => this.isDisabled = !1, 1e3))
            })
        }

        consumePanTask() {
            return a(this, void 0, void 0, function* () {
                if (!this.isDisabled) {
                    let e = !1;
                    this.vipSpeedInfo && this.vipSpeedInfo.isSensitive && (e = !0), yield S.client.callServerFunction("DetailShowFileDetail", e), 100 !== this.panTaskProgress ? p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_click", "", 0, 0, 0, 0, "button=adding") : p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_click", "", 0, 0, 0, 0, `button=${this.canPlay ? "yunpan_play" : "see_detail"}`), this.isDisabled = !0, setTimeout(() => this.isDisabled = !1, 1e3)
                }
            })
        }

        clickPath() {
            return a(this, void 0, void 0, function* () {
                this.isDisabled || (yield S.client.callServerFunction("DetailClickPath"), p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_click", "", 0, 0, 0, 0, "button=adding"), this.isDisabled = !0, setTimeout(() => this.isDisabled = !1, 1e3))
            })
        }

        saveTask() {
            return a(this, void 0, void 0, function* () {
                if (!this.isDisabled) {
                    if (this.isClickedAdd = !0, 4 === this.panTaskType) return;
                    let e = !0;
                    this.vipSpeedInfo && this.vipSpeedInfo.isSensitive && (e = !1), yield S.client.callServerFunction("DetailSaveTask", e), this.canPlay ? p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_click", "", 0, 0, 0, 0, "button=yunpan_play") : p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_yunpan_paly_click", "", 0, 0, 0, 0, "button=add_now"), this.isDisabled = !0, setTimeout(() => this.isDisabled = !1, 1e3)
                }
            })
        }

        initialize() {
            return a(this, void 0, void 0, function* () {
                let e = E.getTaskFromTaskId(this.taskBase.taskId);
                if (this.taskBase.taskType === r.DownloadKernel.TaskType.Bt) {
                    this.btSubDetailCookie = x.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.onBtSubFileDetailChanged);
                    let t = e.getExtraObject().getDownloadFile();
                    this.subTaskCount = t.length, this.updateBtTaskPlayProgress(e)
                } else if (this.taskBase.taskType === r.DownloadKernel.TaskType.Group) {
                    this.groupTaskStatusCookie = x.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.onGroupTaskStatusChanged);
                    let t = e.getExtraObject();
                    this.subTaskCount = t.getDownloadTaskCount(), this.groupTaskSubFileDetailChangedCookie = x.attachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.onGroupTaskSubFileDetailChanged), this.updateGroupTaskPlayProgress(e)
                } else this.p2spTaskDetailChangedCookie = x.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.onP2spTaskDetailChanged), this.updateP2spTaskPlayProgress(e)
            })
        }

        unInitialize() {
            return a(this, void 0, void 0, function* () {
                -1 !== this.btSubDetailCookie && (x.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.btSubDetailCookie), this.btSubDetailCookie = -1), -1 !== this.groupTaskStatusCookie && (x.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.groupTaskStatusCookie), this.groupTaskStatusCookie = -1), -1 !== this.groupTaskSubFileDetailChangedCookie && (x.detachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.groupTaskSubFileDetailChangedCookie), this.groupTaskSubFileDetailChangedCookie = -1), -1 !== this.p2spTaskDetailChangedCookie && (x.detachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.p2spTaskDetailChangedCookie), this.p2spTaskDetailChangedCookie = -1)
            })
        }

        created() {
            if (this.isBt) {
                if (E.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().isBtFileLoadEnd()) this.taskExtraLoaded = !0; else {
                    let e = void 0, t = () => {
                        this.taskExtraLoaded = !0, x.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileLoaded, e), e = void 0
                    };
                    e = x.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileLoaded, t)
                }
            } else this.taskExtraLoaded = !0;
            this.initialize()
        }

        mounted() {
            this.onOptionsChanged(this.currentCategoryViewId)
        }

        destroyed() {
            this.unInitialize(), "search" !== this.itemType && (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))), this.chosen && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemChosen, r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, !1, !1))
        }
    };
    n([o.Prop()], M.prototype, "isFirstShowScanCode", void 0), n([o.Prop()], M.prototype, "vipInfo", void 0), n([o.Prop()], M.prototype, "showSideNetdisk", void 0), n([o.Prop({})], M.prototype, "enbaleVipPlugin", void 0), n([o.Prop({})], M.prototype, "vipSpeedInfo", void 0), n([o.Prop({})], M.prototype, "pulseForRename", void 0), n([o.Prop({default: ""})], M.prototype, "sharedKeyWords", void 0), n([o.Prop({})], M.prototype, "itemType", void 0), n([o.Prop({})], M.prototype, "index", void 0), n([o.Prop({})], M.prototype, "taskId", void 0), n([o.Prop({})], M.prototype, "taskBase", void 0), n([o.Prop({})], M.prototype, "currentCategoryId", void 0), n([o.Prop({})], M.prototype, "currentCategoryViewId", void 0), n([o.Prop()], M.prototype, "chosen", void 0), n([o.Prop()], M.prototype, "active", void 0), n([o.Prop()], M.prototype, "dataChecking", void 0), n([o.Prop({default: 0})], M.prototype, "accelerationTimes", void 0), n([o.Prop()], M.prototype, "panTaskProgress", void 0), n([o.Prop({default: 0})], M.prototype, "panTaskType", void 0), n([o.Prop({})], M.prototype, "panTaskData", void 0), n([o.Prop()], M.prototype, "qrCodeConfig", void 0), n([o.Prop()], M.prototype, "saveStatus", void 0), n([o.Watch("chosen")], M.prototype, "onChosenChanged", null), n([o.Watch("taskBase")], M.prototype, "onTaskBaseChanged", null), n([o.Watch("enbaleVipPlugin")], M.prototype, "onEnableVipPlugin", null), n([o.Watch("isShowCloudExpand")], M.prototype, "onShowCloudExpand", null), n([o.Watch("isFailed")], M.prototype, "onTaskFailedChange", null), n([o.Watch("currentCategoryViewId")], M.prototype, "onOptionsChanged", null), n([o.Watch("panTaskType")], M.prototype, "onPanTaskTypeChange", null), n([o.Watch("taskId", {immediate: !0})], M.prototype, "onTaskIdChanged", null), n([o.Watch("sharedKeyWords", {immediate: !0})], M.prototype, "onKeyWordsChange", null), n([o.Watch("pulseForRename", {immediate: !0})], M.prototype, "onRenamePulse", null), n([o.Watch("active")], M.prototype, "onActiveChanged", null), M = n([o.Component({
        components: {ItemVipSpeedPlugin: () => Promise.resolve().then(() => i(777))},
        watch: {}
    })], M), t.default = M
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(273), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(16), s = i(3), l = i(13);
    let d = class extends o.Vue {
        onHoverChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                r.server.fireClientEvent("on_task_item_hover", e, this.taskId, this.vipSpeedInfo, "hover")
            })
        }

        clickVipLink() {
            return a(this, void 0, void 0, function* () {
                r.server.fireClientEvent("on_vip_link_click", this.taskId, this.vipSpeedInfo, "hover")
            })
        }

        get taskId() {
            let e = void 0;
            return this.taskBase && (e = this.taskBase.taskId), e
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get isShowVipSpeed() {
            let e = !1;
            do {
                if (this.taskStatus !== s.DownloadKernel.TaskStatus.Started) break;
                if (this.startStatusPrompt) break;
                if (!this.vipSpeedInfo) break;
                if (!this.vipSpeedInfo.isShowVipSpeed) break;
                e = this.vipSpeedInfo.isShowVipSpeed
            } while (0);
            return e
        }

        get isShowSuperSpeed() {
            let e = !0;
            do {
                if (!this.vipSpeedInfo) break;
                if (void 0 === this.vipSpeedInfo.isShowSuperSpeed) break;
                e = this.vipSpeedInfo.isShowSuperSpeed
            } while (0);
            return e
        }

        get vipSpeed() {
            return "+" + l.ThunderUtil.formatSizeCustom(this.taskBase.vipSpeed, 1, 4) + "/s"
        }

        get isShowVipHover() {
            let e = !1;
            do {
                if (!this.isHover) break;
                this.vipSpeedInfo && this.vipSpeedInfo.isShowVipHover && (e = this.vipSpeedInfo.isShowVipHover)
            } while (0);
            return e
        }

        get isShowSuperHover() {
            let e = !1;
            do {
                if (!this.isHover) break;
                this.vipSpeedInfo && this.vipSpeedInfo.isShowSuperHover && (e = this.vipSpeedInfo.isShowSuperHover)
            } while (0);
            return e
        }

        get hoverText() {
            let e = "";
            do {
                if (!this.isHover) break;
                if (this.vipSpeedInfo && this.vipSpeedInfo.hoverText) {
                    e = this.vipSpeedInfo.hoverText;
                    break
                }
            } while (0);
            return e
        }

        get isHover() {
            let e = !1;
            do {
                if (this.active) break;
                if (!this.hover) break;
                e = !0
            } while (0);
            return e
        }
    };
    n([o.Prop({})], d.prototype, "vipSpeedInfo", void 0), n([o.Prop({})], d.prototype, "taskBase", void 0), n([o.Prop({})], d.prototype, "startStatusPrompt", void 0), n([o.Prop({})], d.prototype, "active", void 0), n([o.Prop({})], d.prototype, "hover", void 0), n([o.Watch("isHover")], d.prototype, "onHoverChanged", null), d = n([o.Component({components: {}})], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(275), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(779), a = i(28), o = i(3), r = i(26).DownloadKernelCategoryManager.getCategoryManager();
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = t.taskId, a = t.currentCategoryId;
                if (-1 === a) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Completed) {
                        i = e.DownloadListState.taskList[t].tasksMap[n];
                        break
                    }
                } else if (r.isPrivateCategory(a)) for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Completed && (i = e.DownloadListState.taskListPrivate[t].tasksMap[n]);
                return i
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(277), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(2), r = i(45), s = i(8), l = i(0), d = i(3), u = i(12), c = i(66), h = i(13), f = i(39), g = i(41),
        p = i(32), v = i(14), m = i(10), y = i(29), k = i(22), T = i(38), w = i(51), C = i(6), S = i(47), I = i(15),
        b = i(24), _ = i(37), D = l.default.getLogger("Thunder.Download.Completed"),
        A = u.DownloadKernelTaskManager.getTaskManager(), N = I.DownloadKernelEventManager.getEventManager();
    let x = class extends s.Vue {
        constructor() {
            super(...arguments), this.btSubDetailCookie = -1, this.groupTaskSubFileDetailChangedCookie = -1, this.p2spTaskDetailChangedCookie = -1, this.titleOverFlow = "", this.lastFullFileName = void 0, this.fileTypeClass = "", this.isInstallFileIcon = !1, this.installFileIcon = "", this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.playProgress = 0, this.taskExtraLoaded = !1, this.isShowShouleiFileTransfer = !1, this.enableShouleiFileTransfer = !1
        }

        onChosenChanged(e) {
            y.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemChosen, d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, e, this.active)
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && y.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onOptionsChanged(e, t) {
            this.active && y.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, e === d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, this.$el), this.chosen && y.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemChosen, d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, e === d.DownloadKernel.CategroyViewID.Completed, this.active)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== t && r.unwatchFile(t, this.handleWatchFile), this.handleWatchFile().catch(), e && 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 isNetdiskTask() {
            return !(!this.taskBase || -1 === this.taskBase.categoryId || -1 !== this.currentCategoryId)
        }

        get showShouleiFileTransferIcon() {
            return !(this.currentCategoryViewId !== d.DownloadKernel.CategroyViewID.Completed || this.deleted || !this.enableShouleiFileTransfer || !this.fileTransferTooltip && !this.isShowShouleiFileTransfer || this.taskBase.taskType === d.DownloadKernel.TaskType.Group)
        }

        onShouleiFileTransferIconShow(e) {
            e && m.XLStatNS.trackEvent("download_leftpanel", "send_file_to_shoulei_entry_icon_show")
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.deleted) break;
                if (this.taskBase.isMoving) break;
                if (!this.taskExtraLoaded) break;
                let t = A.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        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 i = "";
            return i = this.taskBase.taskType === d.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 && D.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)
            })
        }

        updateBtTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = [];
            t.getDownloadFile().forEach(e => {
                let n = t.getBtFileByRealIndex(e);
                if (n.isSupportPlay()) {
                    let e = 0, t = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Duration),
                        a = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.PlayPosition);
                    t && (e = a / t), D.information("play progress bt", n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName), a, t), i.push(e)
                }
            }), i.length && (this.playProgress = i.reduce(function (e, t, i, n) {
                return e + t
            }) / i.length, D.information("play progress bt2", this.playProgress, i))
        }

        updateGroupTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = t.getDownloadTaskCount(), n = [];
            for (let e = 0; e < i; ++e) {
                let i = t.getSubTaskByIndex(e);
                if (i && i.isSupportPlay()) {
                    let e = 0, t = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                        a = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                    t && (e = a / t), n.push(e)
                }
            }
            n.length && (this.playProgress = n.reduce(function (e, t, i, n) {
                return e + t
            }) / n.length)
        }

        updateP2spTaskPlayProgress(e) {
            if (e.isSupportPlay()) {
                let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                    i = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                t && (this.playProgress = i / t)
            }
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                if (e[1] === this.taskBase.taskId) {
                    let e = A.getTaskFromTaskId(this.taskBase.taskId);
                    this.updateBtTaskPlayProgress(e)
                }
            } while (0)
        }

        onGroupTaskStatusChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                let t = e[1];
                if (t[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                for (let e = 0; e < t.length; e++) {
                    let i = t[e];
                    if (i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId) === this.taskId) {
                        this.updateGroupTaskPlayProgress(i);
                        break
                    }
                }
            } while (0)
        }

        onGroupTaskSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                if (!e[1]) break;
                e[1].forEach((e, t) => {
                    if (t === this.taskId) {
                        let e = A.getTaskFromTaskId(t);
                        e && this.updateGroupTaskPlayProgress(e)
                    }
                })
            } while (0)
        }

        onP2spTaskDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.DetailChanged) break;
                if (!e[1]) break;
                let t = e[2];
                if (t & d.DownloadKernel.TaskDetailChangedFlags.PlayPosition || t & d.DownloadKernel.TaskDetailChangedFlags.Duration) {
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i && i.getId() === this.taskId) {
                            this.updateP2spTaskPlayProgress(i);
                            break
                        }
                    }
                }
            } while (0)
        }

        initialize() {
            return a(this, void 0, void 0, function* () {
                let e = A.getTaskFromTaskId(this.taskBase.taskId);
                this.taskBase.taskType === d.DownloadKernel.TaskType.Bt ? (this.btSubDetailCookie = N.attachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.onBtSubFileDetailChanged), this.updateBtTaskPlayProgress(e)) : this.taskBase.taskType === d.DownloadKernel.TaskType.Group ? (this.groupTaskSubFileDetailChangedCookie = N.attachTaskEvent(d.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.onGroupTaskSubFileDetailChanged), this.updateGroupTaskPlayProgress(e)) : (this.p2spTaskDetailChangedCookie = N.attachTaskEvent(d.DownloadKernel.TaskEventType.DetailChanged, this.onP2spTaskDetailChanged), this.updateP2spTaskPlayProgress(e))
            })
        }

        unInitialize() {
            return a(this, void 0, void 0, function* () {
                -1 !== this.btSubDetailCookie && (N.detachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.btSubDetailCookie), this.btSubDetailCookie = -1), -1 !== this.groupTaskSubFileDetailChangedCookie && (N.detachTaskEvent(d.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.groupTaskSubFileDetailChangedCookie), this.groupTaskSubFileDetailChangedCookie = -1), -1 !== this.p2spTaskDetailChangedCookie && (N.detachTaskEvent(d.DownloadKernel.TaskEventType.DetailChanged, this.p2spTaskDetailChangedCookie), this.p2spTaskDetailChangedCookie = -1)
            })
        }

        created() {
            if (this.isBt) {
                if (A.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().isBtFileLoadEnd()) this.taskExtraLoaded = !0; else {
                    let e = void 0, t = () => {
                        this.taskExtraLoaded = !0, this.$nextTick(() => {
                            this.handleWatchFile()
                        }), N.detachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileLoaded, e), e = void 0
                    };
                    e = N.attachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileLoaded, t)
                }
            } else this.taskExtraLoaded = !0;
            this.initialize(), b.default.isInitedAw().then(() => {
                this.enableShouleiFileTransfer = 0 !== b.default.getConfigInfo("shouleiDownload", "enableTransfer")
            }).catch()
        }

        destroyed() {
            this.unInitialize(), D.information("item destroyed"), r.unwatchFile(this.fullFileName, this.handleWatchFile), "search" !== this.itemType && (this.active && (y.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, !1, this.taskBase.taskId, this.$el), y.default.getNeedSelectNext() && (y.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index))), this.chosen && y.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemChosen, d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, !1, !1))
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskType !== d.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== d.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 = "xly-icon-type";
                if (e = e + " " + f.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType), this.isGroup) {
                    let t = A.getTaskFromTaskId(this.taskBase.taskId), i = this.getInstallFileName(t);
                    if (null !== i && void 0 !== i && "" !== i) {
                        let t = g.TaskCtrlOperatorNS.getSavePathByFileName(this.taskBase.taskId, i);
                        if (null !== t && void 0 !== t && "" !== t) {
                            if (yield C.FileSystemAWNS.existsAW(t)) {
                                let i = yield p.TaskOperatorNs.getFileIcon(t).catch();
                                null !== i && void 0 !== i && "" !== i && (this.isInstallFileIcon = !0, this.installFileIcon = i, e = "xly-icon-type")
                            }
                        }
                    }
                } else if (this.isExe && (yield C.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 = "xly-icon-type")
                }
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSizeFormat() {
            return h.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get completeTime() {
            let e = "", t = this.taskBase.completionTime;
            if (t > 0) {
                let i = new Date(t);
                e = c.TimeHelperNS.formatDate(i, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === d.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === d.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get playProgressStyle() {
            return this.playCompleted ? "width: 0%;" : "width: " + 100 * this.playProgress + "%;"
        }

        get playCompleted() {
            return 1 === this.playProgress
        }

        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(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Group) break;
                let i = e.getExtraObject().getUserData(w.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                if (void 0 === i || null === i || "" === i || "0" === i) break;
                t = i
            } 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, i = t.scrollHeight, n = t.offsetHeight;
            this.titleOverFlow = i > n ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handleFileTransferIconClick() {
            m.XLStatNS.trackEvent("download_leftpanel", "send_file_to_shoulei_entry_icon_click"), g.TaskCtrlOperatorNS.shouleiFileTransfer(this.taskBase).catch()
        }

        handleFileTransferTooltipClose() {
            this.fileTransferTooltip && this.$emit("update:fileTransferTooltip", !1)
        }

        handlePlayTask() {
            let e = this.statExtData();
            if (A.getTaskFromTaskId(this.taskBase.taskId)) {
                _.ThunderNewTask.selectTask(this.taskBase.taskId).catch();
                let t = "download_left_complate_btn_click";
                if (-1 !== this.currentCategoryId) t = "download_private_space_local_play", e = `${e},panel=finished,click_source=play`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, e); else if (-1 !== this.taskBase.categoryId) {
                    t = "download_getback_complete_play";
                    let e = this.taskBase.taskName.split("."), i = e[e.length - 1], n = "video";
                    f.TaskUtilHelper.getTaskFileType(this.taskBase.taskName) === f.TaskUtilHelper.FileExtType.Music && (n = "music"), m.XLStatNS.trackEvent("pc_yunpan", "yunpan_consumption_click", "", 0, 0, 0, 0, "from=download_left_gotback_play_click,file_type=" + n + ",suffix=" + i)
                }
                -1 === this.currentCategoryId && -1 !== this.taskBase.categoryId && (this.currentCategoryViewId === d.DownloadKernel.CategroyViewID.Downloading ? t = "download_getbacking_play" : this.currentCategoryViewId === d.DownloadKernel.CategroyViewID.Completed && (t = "download_getback_complete_play")), p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "play", "finished", this.taskBase.categoryId, !1, 0, !this.playCompleted, !1, t).catch(), p.TaskOperatorNs.markReadStatus([this.taskBase], 1)
            }
        }

        getOpenFolderExtData() {
            let e = "";
            if (this.taskBase.taskType === d.DownloadKernel.TaskType.Bt) e = "folder_type=bt"; else if (this.taskBase.taskType === d.DownloadKernel.TaskType.Group) e = "folder_type=task_group"; else {
                let t = o.extname(this.taskBase.taskName);
                t && t.length > 1 && (t = t.length > 10 ? "" : t.slice(1)), e = `folder_type=${t || ""}`
            }
            return e
        }

        handleOpenFile() {
            let e = this.getOpenFolderExtData();
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_openfiles_click", "", 0, 0, 0, 0, `folder_type=${e},${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) {
                    k.MessageBox.confirm({
                        title: "此文件已经被删除，是否需要重新下载？",
                        type: k.MessageBox.ConfirmType.Warning,
                        okText: "重新下载",
                        cancelText: "删除任务"
                    }).then(e => {
                        e.action === T.MessageBoxNS.Action.OK ? g.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === T.MessageBoxNS.Action.Cancel && p.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                    });
                    break
                }
                if (this.taskBase.taskType === d.DownloadKernel.TaskType.Bt) {
                    let e = A.getTaskFromTaskId(this.taskBase.taskId);
                    S.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                        if (e) {
                            let e = "download_left_complate_double_click";
                            -1 !== this.currentCategoryId ? e = "download_private_space_local_play" : -1 === this.currentCategoryId && -1 !== this.taskBase.categoryId && (e = "download_getback_complete_play"), p.TaskOperatorNs.openTaskItem(this.taskBase, void 0, void 0, void 0, void 0, void 0, e)
                        } else p.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.taskBase.taskType === d.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 {
                    let e = "download_left_complate_double_click";
                    if (-1 !== this.currentCategoryId ? e = "download_private_space_local_play" : -1 !== this.taskBase.categoryId && (e = "download_getback_complete_play"), this.canPlay) {
                        let t = "double_click", i = this.statExtData();
                        i = `${i},panel=finished,click_source=${t}`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, i), A.getTaskFromTaskId(this.taskBase.taskId) && p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, t, "finished", this.currentCategoryId, !1, 0, !this.playCompleted, !1, e).catch()
                    } else p.TaskOperatorNs.openTaskItem(this.taskBase, void 0, void 0, void 0, void 0, void 0, e)
                }
            } while (0)
        }
    };
    n([s.Prop({})], x.prototype, "fileTransferTooltip", void 0), n([s.Prop({})], x.prototype, "pulseForRename", void 0), n([s.Prop({})], x.prototype, "sharedKeyWords", void 0), n([s.Prop({})], x.prototype, "itemType", void 0), n([s.Prop({})], x.prototype, "index", void 0), n([s.Prop({})], x.prototype, "taskId", void 0), n([s.Prop({})], x.prototype, "taskBase", void 0), n([s.Prop({})], x.prototype, "currentCategoryId", void 0), n([s.Prop({})], x.prototype, "currentCategoryViewId", void 0), n([s.Prop()], x.prototype, "deleted", void 0), n([s.Prop()], x.prototype, "chosen", void 0), n([s.Prop()], x.prototype, "active", void 0), n([s.Watch("chosen")], x.prototype, "onChosenChanged", null), n([s.Watch("active")], x.prototype, "onActiveChanged", null), n([s.Watch("currentCategoryViewId")], x.prototype, "onOptionsChanged", null), n([s.Watch("fullFileName", {immediate: !0})], x.prototype, "onFullFileNameChange", null), n([s.Watch("opened", {immediate: !0})], x.prototype, "onOpenedChange", null), n([s.Watch("sharedKeyWords", {immediate: !0})], x.prototype, "onKeyWordsChange", null), n([s.Watch("pulseForRename", {immediate: !0})], x.prototype, "onRenamePulse", null), n([s.Watch("showShouleiFileTransferIcon", {immediate: !0})], x.prototype, "onShouleiFileTransferIconShow", null), x = n([s.Component], x), t.default = x
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(279), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(781), a = i(28), o = i(3);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = 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) {
                    i = e.DownloadListState.taskList[t].tasksMap[n];
                    break
                }
                return i
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(281), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(2), r = i(45), s = i(8), l = i(3), d = i(12), u = i(66), c = i(13), h = i(39), f = i(41), g = i(32),
        p = i(14), v = i(29), m = i(10), y = i(22), k = i(38), T = i(6), w = i(47),
        C = d.DownloadKernelTaskManager.getTaskManager();
    let S = 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 && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e === l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, this.$el), this.chosen && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemChosen, l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, e === l.DownloadKernel.CategroyViewID.Recycle, this.active)
        }

        onChosenChanged(e) {
            v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemChosen, l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, e, this.active)
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && v.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 i = "";
            return i = 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 T.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 i = new Date(t);
                e = u.TimeHelperNS.formatDate(i, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get canPlay() {
            let e = !1, t = C.getTaskFromTaskId(this.taskBase.taskId);
            return t && (e = t.isSupportPlay()), e
        }

        get isSingleTask() {
            let e = !0;
            if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                C.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, i = t.scrollHeight, n = t.offsetHeight;
            this.titleOverFlow = i > n ? 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()), C.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))) {
                            y.MessageBox.confirm({
                                title: "此文件已经被删除，是否需要重新下载？",
                                type: y.MessageBox.ConfirmType.Warning,
                                okText: "重新下载",
                                cancelText: "删除任务"
                            }).then(e => {
                                e.action === k.MessageBoxNS.Action.OK ? f.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === k.MessageBoxNS.Action.Cancel && g.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                            });
                            break
                        }
                        if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                            let e = C.getTaskFromTaskId(this.taskBase.taskId);
                            w.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                                e ? g.TaskOperatorNs.openTaskItem(this.taskBase, void 0, void 0, void 0, void 0, void 0, "download_left_recycle_double_click") : 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), C.getTaskFromTaskId(this.taskBase.taskId) && g.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "dustbin", this.currentCategoryId, !1, 0, !1, !1, "download_left_recycle_double_click").catch()
                        } else g.TaskOperatorNs.openTaskItem(this.taskBase, void 0, void 0, void 0, void 0, void 0, "download_left_recycle_double_click")
                    }
                } while (0)
            })
        }

        destroyed() {
            this.bAttachFile && (this.bAttachFile = !1, r.unwatchFile(this.fullFileName, this.handleWatchFile)), "search" !== this.itemType && (this.active && (v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, !1, this.taskBase.taskId, this.$el), v.default.getNeedSelectNext() && (v.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index))), this.chosen && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemChosen, l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, !1, !1))
        }
    };
    n([s.Prop({})], S.prototype, "pulseForRename", void 0), n([s.Prop({})], S.prototype, "sharedKeyWords", void 0), n([s.Prop({})], S.prototype, "itemType", void 0), n([s.Prop({})], S.prototype, "index", void 0), n([s.Prop({})], S.prototype, "taskId", void 0), n([s.Prop({})], S.prototype, "taskBase", void 0), n([s.Prop({})], S.prototype, "currentCategoryId", void 0), n([s.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([s.Prop()], S.prototype, "active", void 0), n([s.Prop()], S.prototype, "chosen", void 0), n([s.Prop()], S.prototype, "deleted", void 0), n([s.Watch("currentCategoryViewId")], S.prototype, "onOptionsChanged", null), n([s.Watch("chosen")], S.prototype, "onChosenChanged", null), n([s.Watch("active")], S.prototype, "onActiveChanged", null), n([s.Watch("taskId", {immediate: !0})], S.prototype, "onTaskIdChanged", null), n([s.Watch("sharedKeyWords", {immediate: !0})], S.prototype, "onKeyWordsChange", null), n([s.Watch("pulseForRename", {immediate: !0})], S.prototype, "onRenamePulse", null), n([s.Watch("fullFileName", {immediate: !0})], S.prototype, "onFullFileNameChange", null), S = n([s.Component], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(283), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(13), r = i(3);
    let s = class extends a.Vue {
        constructor() {
            super(...arguments), this.downloadingTaskList = [], this.completedTaskList = [], this.downloadingCount = 0, this.completedCount = 0, this.completedActive = window.__xadsSkeletonCompletedActive
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingCount && (e = e + "(" + this.downloadingCount + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completedCount && (e = e + "(" + this.completedCount + ")"), e
        }

        taskError(e) {
            return e.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        formatSizeCustom(e) {
            return o.ThunderUtil.formatSizeCustom(e)
        }

        progress(e) {
            return `width: ${e.fileSize ? e.downloadSize / e.fileSize * 100 : 0}%`
        }

        mounted() {
            do {
                let e = localStorage.getItem("skeleton_downloading");
                if (!e) break;
                let t = null;
                try {
                    t = JSON.parse(e)
                } catch (e) {
                    t = null
                }
                if (t && t.length > 0) {
                    let e = t[0];
                    e.count && !isNaN(Number(e.count)) && (this.downloadingCount = e.count), this.downloadingTaskList = t.slice(1)
                }
            } while (0);
            do {
                let e = localStorage.getItem("skeleton_completed");
                if (!e) break;
                let t = null;
                try {
                    t = JSON.parse(e)
                } catch (e) {
                    t = null
                }
                if (t && t.length > 0) {
                    let e = t[0];
                    e.count && !isNaN(Number(e.count)) && (this.completedCount = Number(e.count)), this.completedTaskList = t.slice(1)
                }
            } while (0);
            this.completedActive = 0 === this.downloadingTaskList.length && this.completedTaskList.length > 0
        }
    };
    s = n([a.Component], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(285), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(785), a = i(28);
    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: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(287), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(86), s = i(5), l = i(10);
    let d = 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.client.callServerFunction("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
            }
        }
    };
    n([o.Prop({})], d.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), n([o.Prop({})], d.prototype, "UPDATE_CATEGORYVIEW", void 0), d = n([o.Component], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(289), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(787), a = i(28);
    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
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(291), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(0), r = i(3), s = i(64), l = i(502), d = i(32), u = i(106), c = i(14), h = i(29), f = i(10),
        g = i(31), p = i(15), v = i(12), m = i(4), y = i(78), k = i(30),
        T = p.DownloadKernelEventManager.getEventManager(), w = v.DownloadKernelTaskManager.getTaskManager(),
        C = o.default.getLogger("DownloadList");
    let S = 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 i = 0; i < e.length; i++) e[i].trim().length > 0 && t.push(e[i].trim());
            return t
        }

        getArrayIntersection(e, t) {
            let i = [], n = new Set(t);
            return i = Array.from(new Set(e.filter(e => n.has(e))))
        }

        replaceSpecialKeyForDB(e) {
            return e !== (e = e.replace(/\/|'|\[|]|%|&|_|\(|\)/g, function (e) {
                return "/" + e
            })) && (this.escapeCode = "/"), e
        }

        internalSearch(e) {
            C.information("多关键字数组:", e);
            let t = [], i = [];
            for (let n = 0; n < e.length; n++) {
                let a = r.DownloadKernel.SearchKeyType.NameInclude;
                this.escapeCode = "";
                let o = this.replaceSpecialKeyForDB(e[n]);
                k.ThunderKernel.searchTask(a, o, -1, this.escapeCode, n => {
                    let a, o;
                    if (this.clearSearch(), i = n, t[t.length] = i, t.length === e.length) {
                        let e;
                        t.length > 0 && (e = t[0]);
                        for (let i = 1; i < t.length; i++) e = this.getArrayIntersection(e, t[i]);
                        this.resultCount = e.length;
                        for (let t = 0; t < e.length; t++) (a = w.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, i;
            this.currentSelSearchTaskIds = e, this.currentSelSearchTaskInfos = [];
            for (let n = 0; n < e.length; n++) t = (i = w.getTaskFromTaskId(e[n])).getTaskBaseInfo(), this.currentSelSearchTaskInfos.push(t);
            this.$el.focus()
        }

        handlePopInputMenu() {
            y.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 ? d.TaskOperatorNs.destroyTasks(this.currentSelSearchTaskInfos) : d.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) ? d.TaskOperatorNs.pauseTasks(this.currentSelSearchTaskInfos, r.DownloadKernel.TaskStopReason.Manual) : s.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? d.TaskOperatorNs.startTasks(this.currentSelSearchTaskInfos) : C.information("downloaditem dbclick do nothing")
        }

        recycleItemDbClick() {
            C.information("垃圾箱双击")
        }

        handleDownloadingItemMenu(e) {
            u.downloadContextMenu.setContextInfo(this, this.currentCategoryId, this.downloadingTaskList.length, !0);
            let t = u.DownloadMenuType.DownloadingItem;
            this.currentSelSearchTaskInfos.length > 1 && (t = u.DownloadMenuType.SearchMultiSel), u.downloadContextMenu.popMenu(t, e)
        }

        handleCompletedItemMenu(e) {
            u.downloadContextMenu.setContextInfo(this, this.currentCategoryId, null, !0);
            let t = u.DownloadMenuType.CompletedItem;
            this.currentSelSearchTaskInfos.length > 1 && (t = u.DownloadMenuType.SearchMultiSel), u.downloadContextMenu.popMenu(t, e)
        }

        handleRecycleItemMenu(e) {
            u.downloadContextMenu.setContextInfo(this, this.currentCategoryId, null, !0);
            let t = u.DownloadMenuType.RecycleItem;
            this.currentSelSearchTaskInfos.length > 1 && (t = u.DownloadMenuType.SearchMultiSel), u.downloadContextMenu.popMenu(t, e)
        }

        handleMenuClick(e, ...t) {
            e
        }

        focusEdit() {
            let e = this.$refs.input.$el.querySelector("input");
            e && e.focus()
        }

        keydownSearch(e) {
            this.curSearchKey = e, this.$nextTick(() => {
                this.startSearch()
            })
        }

        compositionStart(e) {
            this.inputFocus && (this.inputFlag = !1)
        }

        compositionEnd(e) {
            this.inputFocus && (this.inputFlag = !0, this.$nextTick(() => {
                this.startSearch()
            }))
        }

        created() {
            this.attachTaskEvent(), this.holderTextTip = "搜索下载记录", u.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 = T.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)
            }), w.isLoadStorageTaskFinish() ? this.bLoadDbFinish = !0 : (this.dataBaseLoadCookie = 0, g.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.removeFromCategoryViewEventId = T.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], i = e[3];
                    if (t === r.DownloadKernel.CategroyViewID.Downloading) {
                        if (!this.downloadingSearchArray) break;
                        for (let e of i) {
                            let t = e.getId(), i = this.downloadingSearchArray.indexOf(t);
                            -1 !== i && this.downloadingSearchArray.splice(i, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Completed) {
                        if (!this.completeSearchArray) break;
                        for (let e of i) {
                            let t = e.getId(), i = this.completeSearchArray.indexOf(t);
                            -1 !== i && this.completeSearchArray.splice(i, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Recycle) {
                        if (!this.recycleSearchArray) break;
                        for (let e of i) {
                            let t = e.getId(), i = this.recycleSearchArray.indexOf(t);
                            -1 !== i && this.recycleSearchArray.splice(i, 1)
                        }
                        break
                    }
                } while (0)
            }), this.insertToCategoryViewEventId = T.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], i = e[2], n = e[3], a = e[4];
                    n.map(e => e.getTaskBaseInfo()), this.$nextTick(() => {
                        this.startSearch()
                    }), this.bLoadDbFinish && i === 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 = T.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 = T.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() {
            u.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), document.removeEventListener("compositionstart", this.compositionStart), document.removeEventListener("compositionend", this.compositionEnd), this.clearSearch(), void 0 !== this.insertToCategoryViewEventId && T.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.removeFromCategoryViewEventId && T.detachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), void 0 !== this.statusChangedEventId && T.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, T.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, this.cookieOfTaskRenamed)), this.cookieOfTaskDestroyed && (this.cookieOfTaskDestroyed = void 0, T.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, this.cookieOfTaskDestroyed))
        }
    };
    n([a.Prop({})], S.prototype, "hasLeftBottomAd", void 0), n([a.Prop({})], S.prototype, "currentTabId", void 0), n([a.Prop({})], S.prototype, "currentCategoryId", void 0), n([a.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([a.Prop({})], S.prototype, "downloadingTaskList", void 0), n([a.Prop({})], S.prototype, "downloadingTaskBaseList", void 0), n([a.Prop({})], S.prototype, "completedTaskList", void 0), n([a.Prop({})], S.prototype, "completedTaskBaseList", void 0), n([a.Prop({})], S.prototype, "recycleTaskList", void 0), n([a.Prop({})], S.prototype, "recycleTaskBaseList", void 0), n([a.Prop({})], S.prototype, "downloadingSelectedIndexs", void 0), n([a.Prop({})], S.prototype, "completedSelectedTaskIndexs", void 0), n([a.Prop({})], S.prototype, "recycleSelectedTaskIndexs", void 0), n([a.Prop({})], S.prototype, "currentSelectdTaskInfos", void 0), n([a.Prop({})], S.prototype, "downloadingResultCount", void 0), n([a.Prop({})], S.prototype, "completedResultCount", void 0), n([a.Prop({})], S.prototype, "recycleResultCount", void 0), n([a.Prop({})], S.prototype, "UPDATE_CATEGORY", void 0), n([a.Prop({})], S.prototype, "UPDATE_CATEGORYVIEW", void 0), n([a.Prop({})], S.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), n([a.Prop({})], S.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), n([a.Prop({})], S.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), n([a.Prop({})], S.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), n([a.Prop({})], S.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), n([a.Prop({})], S.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), n([a.Prop({})], S.prototype, "UPDATE_TASK_STATUS", void 0), n([a.Prop({})], S.prototype, "attachTaskEvent", void 0), n([a.Prop({})], S.prototype, "selectTab", void 0), n([a.Watch("currentCategoryId")], S.prototype, "onCategoryChange", null), S = n([a.Component({components: {DownloadCategory: l.default}})], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(293), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(789), a = i(28);
    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"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(295), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(790), r = i(8), s = i(17), l = i(9), d = i(14), u = i(143), c = i(88), h = i(123), f = i(23),
        g = i(141), p = i(5), v = i(0).default.getLogger("setting-center-view"),
        m = u.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    let y = class extends r.Vue {
        constructor() {
            super(...arguments), this.userId = "", this.currenIndex = 0, this.scrollSumHeight = 0, this.autoScroll = !1, this.browserSettingPosition = [2, 1], 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 (null !== e && void 0 !== e) 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");
            if (null !== t && void 0 !== t) for (let i = 0; i < e; i++) this.scrollSumHeight += t[i].offsetHeight;
            this.autoScroll = !0, this.setScrollTop(this.scrollSumHeight)
        }

        handleConfChange(e, t = "") {
            if ("" === t || void 0 === this.formData[t]) return;
            let i = void 0 !== this.formData[t].isReleventUser ? this.userId : "",
                n = {section: this.formData[t].section, key: this.formData[t].key, value: e, name: t, userId: i};
            this.setConfigValue(n)
        }

        getUserID() {
            return a(this, void 0, void 0, function* () {
                return new Promise(e => {
                    f.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        v.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }

        created() {
            l.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.initSettingData()
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                (yield f.LoginHelperNS.loginHelper.isLoginedAw()) && (this.userId = yield this.getUserID()), this.confChangeEventId = s.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, i, n) => a(this, void 0, void 0, function* () {
                    if (void 0 !== this.formData[`${e}-${t}`] && this.setFormData({
                        section: e,
                        key: t,
                        value: n
                    }), "CompletedTaskPlay" === e && "LanuchMediaPlayer" === t && "1" === n) {
                        (yield g.default.installXmp()) || (this.setFormData({
                            section: e,
                            key: t,
                            value: "0"
                        }), p.client.callServerFunction("SetConfigValue", e, t, "0"))
                    }
                })), this.loginEventId = s.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    this.userId = e;
                    let t = l.ConfigNS.getValue("UserCommunitySet", `radio_id_${e}`, !0);
                    v.information("setting-center:handleConfChange", t), "1" === t ? t = !0 : "3" === t && (t = !1), this.handleConfChange(t, "UserCommunitySet-radio_id_")
                }), this.logoutEventId = s.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                    this.userId = ""
                }), m.on("selectMsgNotice", () => {
                    this.clickTab(3)
                }), c.SettingConfigHelperNS.configBrowserHelper.attachListener(d.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                    let e = c.SettingConfigHelperNS.configBrowserHelper.getConfigShowBrowsers();
                    v.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: 0
                    }), 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 td-button--other",
                            boxType: "browserGuideConfBox",
                            style: h.default().whetherShowEntry() ? "margin-left: 0" : "display: none",
                            extEles: [{
                                type: "confTip",
                                text: "由于技术原理的限制，迅雷默认提供的“接管浏览器”功能，未能有效接管HTTPS\n协议的下载请求。建议您手动更改浏览器默认下载方式，可以完美接管浏览器的\n所有下载请求！目前支持“360安全浏览器、搜狗浏览器、QQ浏览器”",
                                classes: "xly-icon-help",
                                style: h.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 && s.NativeCallModule.nativeCall.DetachNativeEvent("OnConfigValueChanaged", this.confChangeEventId), this.loginEventId && s.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.loginEventId), this.logoutEventId && s.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.logoutEventId), m.removeAllListeners("selectMsgNotice"), this.removeConfigData()
        }
    };
    n([r.Prop({})], y.prototype, "initSettingData", void 0), n([r.Prop({})], y.prototype, "formData", void 0), n([r.Prop({})], y.prototype, "confSchema", void 0), n([r.Prop({})], y.prototype, "removeConfigData", void 0), n([r.Prop({})], y.prototype, "setConfigValue", void 0), n([r.Prop({})], y.prototype, "setFormData", void 0), n([r.Prop({})], y.prototype, "addFormdataItem", void 0), n([r.Prop({})], y.prototype, "addSchemaItem", void 0), n([r.Prop({})], y.prototype, "addSelectItem", void 0), y = n([r.Component({components: {generatorView: o.default}})], y), t.default = y
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(297), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(791), o = i(795), r = i(92), s = i(152), l = i(797), d = i(798), u = i(151), c = i(799), h = i(504),
        f = i(150), g = i(800), p = i(8);
    let v = class extends p.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([p.Prop({})], v.prototype, "item", void 0), n([p.Prop({})], v.prototype, "formData", void 0), n([p.Prop()], v.prototype, "value", void 0), v = n([p.Component({
        components: {
            confCheckbox: a.default,
            confRadio: o.default,
            confSelect: r.default,
            confText: s.default,
            confCheckboxInput: l.default,
            confCheckboxSelect: d.default,
            confInput: u.default,
            confSpeedText: h.default,
            confTextarea: c.default,
            confBtn: f.default,
            confProxyList: g.default
        }
    })], v), t.default = v
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(299), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(149), s = i(111), l = i(150), d = i(92), u = i(151), c = i(793), h = i(794), f = i(152);
    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)
                }
            })
        }
    };
    n([o.Prop({})], g.prototype, "item", void 0), n([o.Prop({})], g.prototype, "formData", void 0), n([o.Prop()], g.prototype, "value", void 0), n([o.Prop()], g.prototype, "label", void 0), g = n([o.Component({
        components: {
            confTip: s.default,
            confBtn: l.default,
            confSelect: d.default,
            confInput: u.default,
            confSpeed: c.default,
            confSpeedTime: h.default,
            confText: f.default
        }
    })], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(301), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
    };
    n([a.Prop()], o.prototype, "classes", void 0), n([a.Prop()], o.prototype, "text", void 0), o = n([a.Component({})], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(303), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(149), s = i(22), l = i(38), d = i(13), u = i(17), c = i(111), h = i(504);
    let f = class extends o.Vue {
        popDialog(e) {
            switch (e.boxType) {
                case"speedConfBox":
                    u.NativeCallModule.nativeCall.CallNativeFunction("ShowCustomDownloadModeDlg", () => {
                    });
                    break;
                case"browserGuideConfBox":
                    u.NativeCallModule.nativeCall.CallNativeFunction("ShowBrowserGuideDlg", () => {
                    });
                    break;
                case"function":
                    e.handle();
                    break;
                case"pop":
                    this.messagePop(e)
            }
        }

        messagePop(e) {
            return a(this, void 0, void 0, function* () {
                let t = d.ThunderUtil.deepCopy(e.pop.formData);
                for (let i in t) t[i].value = yield r.ConfigHelperNS.getValue(e.pop.formData[i].section, e.pop.formData[i].key, e.pop.formData[i].value);
                s.MessageBox.pop({
                    title: e.pop.title,
                    size: e.pop.size,
                    schemas: e.pop.schema,
                    formData: t
                }, e.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()
            })
        }
    };
    n([o.Prop({})], f.prototype, "item", void 0), n([o.Prop()], f.prototype, "classes", void 0), n([o.Prop()], f.prototype, "text", void 0), n([o.Prop()], f.prototype, "disabled", void 0), n([o.Prop({})], f.prototype, "formData", void 0), f = n([o.Component({
        components: {
            confTip: c.default,
            confSpeedText: h.default
        }
    })], f), t.default = f
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(305), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(149);
    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
            })
        }
    };
    n([o.Prop({})], s.prototype, "item", void 0), n([o.Prop({})], s.prototype, "formData", void 0), n([o.Watch("formData", {
        immediate: !0,
        deep: !0
    })], s.prototype, "onFormDataChange", null), s = n([o.Component], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(307), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(11), s = i(367), l = i(505), d = i(16), u = i(0).default.getLogger("conf-select");
    let c = class extends o.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) {
            if (void 0 !== this.item.hasDeleteOption && e === this.item.deleteOptionText) return this.$emit("input", [], this.item.optionByName), void ("openThunderPan" === this.item.slotOption && d.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcClearRecentFolder"));
            this.tooltipVisible || this.item.blurUpdate || this.$emit("input", e, this.item.name), this.valueData = e
        }

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

        selectPath() {
            return a(this, void 0, void 0, function* () {
                let e = yield(yield r.asyncRemoteCall.getDialog()).showOpenDialog({
                    defaultPath: this.valueData,
                    properties: [this.fileType]
                });
                if (e.canceled) ; else {
                    let t = e.filePaths;
                    void 0 !== t && (void 0 !== this.name ? this.$emit("input", t[0], this.name) : this.$emit("input", t[0], this.item.name), this.valueData = t[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
        }

        handleChangePath(e) {
            return a(this, void 0, void 0, function* () {
                let t = "openDirectory";
                if ("openFile" === e ? t = "openFile" : "openThunderPan" === e && (t = "openThunderPan"), "openFile" === t || "openDirectory" === t) {
                    const e = yield r.asyncRemoteCall.getDialog();
                    let i = yield r.asyncRemoteCall.getCurrentWindow(),
                        n = yield e.showOpenDialog(i, {defaultPath: this.valueData, properties: [t]});
                    if (n.canceled) ; else {
                        let e = n.filePaths;
                        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]), this.$refs.root.focusEdit()
                    }
                } else if ("openThunderPan" === t) {
                    let e = yield d.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcTreePath", {});
                    if (!e || !e[0] || e[0].error) return;
                    let t = "", i = "";
                    for (let n of e[0].path) t += "\\" + n.title, i += "\\" + n.id;
                    i = i.slice(1), t = t.slice(1), void 0 !== this.name ? this.$emit("input", t, this.name) : this.$emit("input", t, this.item.name), this.valueData = t, d.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcSetDefaultSavePath", {
                        id: i,
                        name: t
                    })
                }
            })
        }

        validate(e) {
            u.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) => {
                u.information("errors", e), null === e ? this.tooltipVisible = !1 : (u.information("路径有误", e), this.tipContent = e[0].message, this.tooltipVisible = !0)
            })
        }

        created() {
            this.item.rules && (this.schema = new s.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()
        }
    };
    n([o.Prop({})], c.prototype, "item", void 0), n([o.Prop()], c.prototype, "label", void 0), n([o.Prop({})], c.prototype, "formData", void 0), n([o.Prop()], c.prototype, "options", void 0), n([o.Prop()], c.prototype, "value", void 0), n([o.Prop()], c.prototype, "disabled", void 0), n([o.Prop()], c.prototype, "classes", void 0), n([o.Prop()], c.prototype, "name", void 0), n([o.Prop()], c.prototype, "placeHolder", void 0), n([o.Watch("formData", {deep: !0})], c.prototype, "onFormDataChange", null), c = n([o.Component({components: {SelectNative: l.default}})], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(309), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8);
    let r = class extends o.Vue {
        onOptionsChanged() {
            return a(this, void 0, void 0, function* () {
            })
        }

        get filterOptions() {
            return this.options.filter(e => "separator" !== e)
        }

        onSelect(e) {
            this.$emit("input", e.srcElement.value, !0)
        }

        mounted() {
            let e = this.$refs.selectNative;
            if (e) for (let t in this.filterOptions) if (String(this.filterOptions[t]) === this.value) {
                e.selectedIndex = t;
                break
            }
        }

        focusEdit() {
            if (this.$refs.select) {
                let e = this.$refs.select.$el.querySelector("input");
                null !== e && void 0 !== e && e.focus()
            }
        }
    };
    n([o.Prop()], r.prototype, "value", void 0), n([o.Prop({default: () => []})], r.prototype, "options", void 0), n([o.Prop({default: !1})], r.prototype, "useNative", void 0), n([o.Prop({default: "bottom"})], r.prototype, "position", void 0), n([o.Watch("options")], r.prototype, "onOptionsChanged", null), r = n([o.Component], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(311), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(367), o = i(8), r = i(150);
    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 i = "Alt" === e.key || "Shift" === e.key || "Control" === e.key ? "" : t ? e.code[e.code.length - 1] : e.key;
                this.valueData = this.shortcutKey + i, "" !== i && (this.funKey = !0), this.shortcutKey + i !== i && "" !== i && (this.canRegister = !0, this.valueData = this.shortcutKey + i, 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}))
        }
    };
    n([o.Prop()], s.prototype, "item", void 0), n([o.Prop({})], s.prototype, "formData", void 0), n([o.Prop()], s.prototype, "disabled", void 0), n([o.Prop()], s.prototype, "value", void 0), n([o.Prop()], s.prototype, "name", void 0), n([o.Prop()], s.prototype, "label", void 0), s = n([o.Component({components: {confBtn: r.default}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(313), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(367), o = i(8);
    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}))
        }
    };
    n([o.Prop({})], r.prototype, "item", void 0), n([o.Prop()], r.prototype, "value", void 0), n([o.Prop()], r.prototype, "disabled", void 0), r = n([o.Component], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(315), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(505);
    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 i = this.value.slice(0), n = Object.assign({}, i[t]);
            n.value = e, i[t] = n, this.$emit("input", i, this.item.name)
        }
    };
    n([a.Prop({})], r.prototype, "item", void 0), n([a.Prop()], r.prototype, "value", void 0), n([a.Prop()], r.prototype, "disabled", void 0), r = n([a.Component({components: {SelectNative: o.default}})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(317), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(17);
    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 = ""
            }))
        }
    };
    n([a.Prop({})], r.prototype, "item", void 0), n([a.Prop()], r.prototype, "classes", void 0), n([a.Prop()], r.prototype, "extIndex", void 0), n([a.Prop()], r.prototype, "text", void 0), r = n([a.Component({})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(319), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(111), s = i(150), l = i(151), d = i(92), u = i(796), c = i(17), h = i(5);
    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.client.callServerFunction("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 = ""
                }))
            })
        }
    };
    n([o.Prop({})], f.prototype, "item", void 0), n([o.Prop({})], f.prototype, "formData", void 0), n([o.Prop()], f.prototype, "value", void 0), f = n([o.Component({
        components: {
            confTip: r.default,
            confBtn: s.default,
            confInput: l.default,
            confSelect: d.default,
            confContainer: u.default
        }
    })], f), t.default = f
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(321), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(92);
    let r = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([a.Prop({})], r.prototype, "item", void 0), n([a.Prop({})], r.prototype, "formData", void 0), n([a.Prop()], r.prototype, "value", void 0), n([a.Prop()], r.prototype, "disabled", void 0), r = n([a.Component({components: {confSelect: o.default}})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(323), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(111), r = i(151), s = i(152), l = i(92);
    let d = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([a.Prop({})], d.prototype, "item", void 0), n([a.Prop({})], d.prototype, "formData", void 0), d = n([a.Component({
        components: {
            confTip: o.default,
            confInput: r.default,
            confText: s.default,
            confSelect: l.default
        }
    })], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(325), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(111), r = i(152), s = i(92);
    let l = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([a.Prop({})], l.prototype, "item", void 0), n([a.Prop({})], l.prototype, "formData", void 0), l = n([a.Component({
        components: {
            confTip: o.default,
            confText: r.default,
            confSelect: s.default
        }
    })], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(327), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
        handleChange(e) {
            let t = e.target;
            this.$emit("input", t.value, this.item.name)
        }
    };
    n([a.Prop({})], o.prototype, "item", void 0), n([a.Prop({})], o.prototype, "formData", void 0), n([a.Prop()], o.prototype, "value", void 0), n([a.Prop()], o.prototype, "label", void 0), o = n([a.Component({components: {}})], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(329), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

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

        handleAddProxyResult(e, t, i, n, a, o) {
            let r = !1, s = {name: e, host: t, port: i, type: n, 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, i = e.args.host, n = e.args.port, a = e.args.type, o = e.args.userName,
                        r = e.args.passWord;
                    this.handleAddProxyResult(t, i, n, a, o, r)
                }
            }).catch()
        }

        handleModifyProxy() {
            this.selectedItem && 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 i = 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(), i === this.selectedItem.name)) {
                        let e = d.ProxyNS.ProxyType.Http;
                        "SOCKS5" === this.selectedItem.type && (e = d.ProxyNS.ProxyType.Sock5), d.ProxyNS.setProxy(e, this.selectedItem.host, this.selectedItem.port, this.selectedItem.userName, this.selectedItem.passWord)
                    }
                    break
                }
            })).catch()
        }

        handleDeleteProxy() {
            this.selectedItem && 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 i = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Http", "直接连接");
                    t === i && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Http"), t === (i = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Hub", "直接连接")) && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Hub"), t === (i = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Ftp", "直接连接")) && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Ftp");
                    break
                }
            })).catch()
        }

        handleApplyProxy() {
            this.selectedItem && (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 i = this.proxyList[t].name;
                i = (i = (i = (i = (i = i + ";" + this.proxyList[t].host) + ";" + this.proxyList[t].port) + ";" + this.proxyList[t].type) + ";" + this.proxyList[t].userName) + ";" + this.proxyList[t].passWord, e.push(i)
            }
            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 i = e[t].split(";"), n = {};
                    n.name = i[0], n.host = i[1], n.type = i[3], n.userName = void 0 !== i[4] ? i[4] : "", n.passWord = void 0 !== i[5] ? i[5] : "", i[2] ? n.port = Number(i[2]) ? Number(i[2]) : 80 : n.port = 80, this.proxyList.push(n)
                }
            })
        }

        mounted() {
            this.initProxys().catch()
        }
    };
    n([o.Prop({})], u.prototype, "item", void 0), n([o.Prop()], u.prototype, "value", void 0), n([o.Prop()], u.prototype, "disabled", void 0), u = n([o.Component({components: {}})], u), t.default = u
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(18), a = i(4), o = i(113), r = i(114), s = i(69);
    !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 i = void 0;
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("msg is null");
                        break
                    }
                    i = (t ? n.ipcRenderer.sendSync : n.ipcRenderer.send)(r.CommonIPCMessage.msgIPCSendToMain, {
                        msg: e,
                        senderInfo: this.currInfo
                    })
                } while (0);
                return i
            }

            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 i = [e].concat(t.args);
                    t.args = i, n.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, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(3), o = i(15), r = n.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 i = [];
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    if (!n) continue;
                    n.setCategoryViewId(this.categoryViewId);
                    let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    0 !== o && (this.tasks.set(o, n), i.push(n)), r.information("insertTask categoryId:", this.categoryId, ", catygoryViewId:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.categoryId, this.categoryViewId, i, t)
            }
        }

        removeTask(e) {
            if (null !== e) {
                let t = [];
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i];
                    if (!n) continue;
                    let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    this.tasks.has(o) && (this.tasks.delete(o), t.push(n)), r.information("removeTask catygoryView:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.categoryId, this.categoryViewId, t)
            }
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(544), o = {"Content-Type": "application/x-www-form-urlencoded"};

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

    var s, l = {
        adapter: ("undefined" != typeof XMLHttpRequest ? s = i(545) : "undefined" != typeof process && (s = i(21)), s),
        transformRequest: [function (e, t) {
            return a(t, "Content-Type"), n.isFormData(e) || n.isArrayBuffer(e) || n.isBuffer(e) || n.isStream(e) || n.isFile(e) || n.isBlob(e) ? e : n.isArrayBufferView(e) ? e.buffer : n.isURLSearchParams(e) ? (r(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : n.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, */*"}}, n.forEach(["delete", "get", "head"], function (e) {
        l.headers[e] = {}
    }), n.forEach(["post", "put", "patch"], function (e) {
        l.headers[e] = n.merge(o)
    }), e.exports = l
}, function (e, t, i) {
    "use strict";
    var n = i(439);
    e.exports = function (e, t, i, a, o) {
        var r = new Error(e);
        return n(r, t, i, a, o)
    }
}, function (e, t) {
    e.exports = require("https")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(40).DownloadKernelCategoryViewManager.getCategoryViewManager(),
        o = i(0).default.getLogger("TaskCtrlHelper.DownloadProgress");
    !function (e) {
        function t() {
            let e = -1, t = 0, i = 0, r = [], s = a.getCategoryViewFromId(n.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()) !== n.DownloadKernel.TaskStatus.PreDownloading && o !== n.DownloadKernel.TaskStatus.StartWaiting && o !== n.DownloadKernel.TaskStatus.StartPending && o !== n.DownloadKernel.TaskStatus.Started || (t += (l = e.getTaskBaseInfo()).fileSize, i += l.downloadSize, r.push(e.getId())));
                t > 0 && (e = i / t)
            }
            return r.length > 0 && -1 === e && (e = 0), e >= 1 && (e = 1), o.information("progress:", e), {
                progress: e,
                downloadingTaskIds: r,
                downSize: i,
                totalSize: t
            }
        }

        e.getDownloadDetails = t, e.getDownloadProgressPercent = function () {
            let e = t().progress, i = "0.01%";
            return i = (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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(2), r = i(7), s = i(35), l = i(13),
        d = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")), u = i(0).default.getLogger("errorcode-config");
    let {isDef: c} = l.ThunderUtil;
    var h;
    !function (e) {
        e.Download = "download", e.Speed = "speed", e.Dcdn = "dcdn"
    }(h = t.ErrorType || (t.ErrorType = {}));

    class f {
        constructor() {
            this.codeMap = new Map, this.codes = null, this.getConfigs().then(e => {
                e && 0 === e.result && e.task_info && e.task_info.pc_client && (this.codes = e.task_info.pc_client, this.codes.speed_code && this.setCodeMap(h.Speed, this.codes.speed_code), this.codes.download_code && this.setCodeMap(h.Download, this.codes.download_code), this.codes.dcdn_code && this.setCodeMap(h.Dcdn, this.codes.dcdn_code))
            }).catch()
        }

        getMessage(e, t) {
            let i = void 0, n = this.codeMap.get(e);
            return n && (i = n.get(t)), i
        }

        getData(e) {
            let t = void 0;
            return this.codes && this.codes[e] && (t = JSON.stringify(this.codes[e])), t
        }

        getConfigs() {
            return n(this, void 0, void 0, function* () {
                let e = (yield this.getThunderVersionNumber()) || 0, t = Math.floor((new Date).getTime() / 1e3),
                    n = Math.random(), o = "!@#$%^&*()QAZxl_pc" + e + t + n,
                    r = "client_name=xl_pc&client_version=" + e + "&ts=" + t + "&r=" + n + "&key=" + (o = (o = s.ToolsUtilitiesAWNS.genarateMd5(o)).toUpperCase());
                u.information("key", o);
                const l = `http://download.code.lixian.vip.xunlei.com/errcode?${r}`;
                u.information("url", l);
                let d = null;
                try {
                    a.default.defaults.adapter = i(21);
                    let e = yield a.default.get(l, {timeout: 15e3});
                    u.information("getConfigs res", e), 200 === e.status && c(e.data) && e.data instanceof Object && (d = e.data)
                } catch (e) {
                    u.warning(e)
                }
                return d
            })
        }

        setCodeMap(e, t) {
            let i = new Map;
            for (let e of t) if (e.code) {
                let t = e.code.length, n = e.code.search(/\-/);
                if (n > 0 && n < t - 1) {
                    let a = Number(e.code.substring(0, n)), o = Number(e.code.substring(n + 1, t));
                    for (let t = a; t <= o; t++) i.set(t, e.message)
                } else {
                    let t = Number(e.code);
                    i.set(t, e.message)
                }
            }
            this.codeMap.set(e, i)
        }

        getThunderVersionNumber() {
            return n(this, void 0, void 0, function* () {
                let e = o.join(__rootDir, "../../Thunder.exe"), t = 0, i = d.getFileVersion(e).split(".");
                if (i && 4 === i.length) {
                    let e = Number(i[0]).valueOf(), n = Number(i[1]).valueOf(), a = Number(i[2]).valueOf();
                    t = 128 * Math.pow(2, 24) + e * Math.pow(2, 16) + n * Math.pow(2, 8) + a
                }
                return t
            })
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(85), r = i(563), s = "main-renderer";
    !function (e) {
        function t(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = yield a.client.callRemoteClientFunction(s, e, ...t).catch();
                return i && i.length > 0 ? i[0] : {}
            })
        }

        function i() {
            return n(this, void 0, void 0, function* () {
                return yield t(o.XmpPlayerFunction.getXmpPlayType)
            })
        }

        function l() {
            return n(this, void 0, void 0, function* () {
                return (yield i()) === o.XmpPlayType.yunBo
            })
        }

        function d() {
            return n(this, void 0, void 0, function* () {
                return Number(yield t(o.XmpPlayerFunction.getPlayingTaskId))
            })
        }

        e.openPayVipUrl = function (e) {
            a.client.callRemoteClientFunction("vip-download-webview", "OpenPayVipUrl", e).catch()
        }, e.callXmp = t, e.getXmpPlayType = i, e.isYunBo = l, e.isPlayAndDownload = function () {
            return n(this, void 0, void 0, function* () {
                return (yield i()) === o.XmpPlayType.downloadAndPlay
            })
        }, e.isLocalPlay = function () {
            return n(this, void 0, void 0, function* () {
                return (yield i()) === o.XmpPlayType.localFile
            })
        }, e.getXmpCurrentMode = function () {
            return n(this, void 0, void 0, function* () {
                return t(o.XmpPlayerFunction.getXmpCurrentMode)
            })
        }, e.getCurrentTaskGcid = function () {
            return n(this, void 0, void 0, function* () {
                return t(o.XmpPlayerFunction.getCurrentMediaAttribute, o.XmpMediaAttr.Gcid)
            })
        }, e.getCurrentTaskId = d, e.getCurrentTaskIdOrPanId = function () {
            return n(this, void 0, void 0, function* () {
                return (yield l()) ? t(o.XmpPlayerFunction.getCurrentMediaAttribute, o.XmpMediaAttr.PanFileId) : t(o.XmpPlayerFunction.getPlayingTaskId)
            })
        }, e.getCurrentTaskStatus = function () {
            return n(this, void 0, void 0, function* () {
                let e = yield d();
                return r.default.getTaskStatus(e)
            })
        }, e.getStatPlayType = function () {
            return n(this, void 0, void 0, function* () {
                return t(o.XmpPlayerFunction.getCurrentMediaAttribute, o.XmpMediaAttr.PlayType)
            })
        }, e.getStatPlayfrom = function () {
            return n(this, void 0, void 0, function* () {
                return (yield t(o.XmpPlayerFunction.getCurrentMediaAttribute, o.XmpMediaAttr.PlayFrom)) || ""
            })
        }, e.getStatOpenFrom = function () {
            return n(this, void 0, void 0, function* () {
                return (yield t(o.XmpPlayerFunction.getCurrentMediaAttribute, o.XmpMediaAttr.OpenFrom)) || ""
            })
        }, e.trackShowEvnet = function (e, i, n) {
            t("TrackShowEvent", (new Date).getTime(), e, i, function (e) {
                let t = "";
                return e.forEach((e, i) => {
                    "" !== t && (t += ","), t = t + i + "=" + e
                }), t
            }(n)).catch()
        }
    }(t.CommonNS || (t.CommonNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = i(7), s = i(4), l = i(62),
        d = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")), u = a.default.getLogger("BaiduDWZ");
    let c = {};

    function h(e, t, i) {
        return n(this, void 0, void 0, function* () {
            return s.isNullOrUndefined(t) && (t = 120), s.isNullOrUndefined(i) && (i = "xdas_send2phone_qr"), l.fetchSlRes({
                url: "/xlppc.dljgo.api/v2/create",
                data: {url: e, timeout: t, source: i},
                method: "post"
            })
        })
    }

    t.getBaiduDWZ = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = "";
            u.information("getBaiduDWZ enter cacheDWZs = ", c);
            do {
                if (null === e || "" === e) break;
                if (-1 !== e.indexOf("&taskDownload=")) {
                    let t = e.match(/.*&taskDownload=(.*)&scheme=xunleiapp:.?/);
                    if (t && t.length > 0) {
                        let i = t[1];
                        d.isThunderPrivateUrl(i) || (i = d.makeThunderPrivateUrl(i), e = e.replace(t[1], i))
                    }
                }
                u.information("getBaiduDWZ url = ", e);
                let i = e;
                if (null !== c[i] && void 0 !== c[i]) {
                    t = c[i];
                    break
                }
                let n = "";
                try {
                    let t = yield h(e);
                    u.information("getBaiduDWZ res = ", t), 200 === t.status && t.data && "ok" === t.data.result && (n = t.data.dlj)
                } catch (e) {
                    n = ""
                }
                "" !== n && (c[i] = n), t = n
            } while (0);
            return u.information("getBaiduDWZ leave ret = ", t), t
        })
    }
}, 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, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g, p = {}.hasOwnProperty;
        l = i(127), d = i(128), t = i(125), n = i(126), u = i(124), h = i(133), f = i(134), c = i(135), a = i(129), o = i(131), r = i(130), s = i(132), g = i(452), e.exports = function (e) {
            function i(e) {
                i.__super__.constructor.call(this, e)
            }

            return function (e, t) {
                for (var i in t) p.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, g), i.prototype.document = function (e) {
                var t, i, a, o, r;
                for (this.textispresent = !1, o = "", i = 0, a = (r = e.children).length; i < a; i++) t = r[i], o += function () {
                    switch (!1) {
                        case!(t instanceof l):
                            return this.declaration(t);
                        case!(t instanceof d):
                            return this.docType(t);
                        case!(t instanceof n):
                            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
            }, i.prototype.attribute = function (e) {
                return " " + e.name + '="' + e.value + '"'
            }, i.prototype.cdata = function (e, t) {
                return this.space(t) + "<![CDATA[" + e.text + "]]>" + this.newline
            }, i.prototype.comment = function (e, t) {
                return this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.newline
            }, i.prototype.declaration = function (e, t) {
                var i;
                return i = this.space(t), i += '<?xml version="' + e.version + '"', null != e.encoding && (i += ' encoding="' + e.encoding + '"'), null != e.standalone && (i += ' standalone="' + e.standalone + '"'), i += this.spacebeforeslash + "?>", i += this.newline
            }, i.prototype.docType = function (e, i) {
                var l, d, u, h, f;
                if (i || (i = 0), h = this.space(i), 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, d = 0, u = (f = e.children).length; d < u; d++) l = f[d], h += function () {
                        switch (!1) {
                            case!(l instanceof a):
                                return this.dtdAttList(l, i + 1);
                            case!(l instanceof o):
                                return this.dtdElement(l, i + 1);
                            case!(l instanceof r):
                                return this.dtdEntity(l, i + 1);
                            case!(l instanceof s):
                                return this.dtdNotation(l, i + 1);
                            case!(l instanceof t):
                                return this.cdata(l, i + 1);
                            case!(l instanceof n):
                                return this.comment(l, i + 1);
                            case!(l instanceof c):
                                return this.processingInstruction(l, i + 1);
                            default:
                                throw new Error("Unknown DTD node type: " + l.constructor.name)
                        }
                    }.call(this);
                    h += "]"
                }
                return h += this.spacebeforeslash + ">", h += this.newline
            }, i.prototype.element = function (e, i) {
                var a, o, r, s, l, d, g, v, m, y, k, T, w;
                for (g in i || (i = 0), w = !1, this.textispresent ? (this.newline = "", this.pretty = !1) : (this.newline = this.newlinedefault, this.pretty = this.prettydefault), v = "", v += (T = this.space(i)) + "<" + e.name, m = e.attributes) p.call(m, g) && (a = m[g], v += this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? v += "></" + e.name + ">" + this.newline : v += this.spacebeforeslash + "/>" + this.newline; else if (this.pretty && 1 === e.children.length && null != e.children[0].value) v += ">", v += e.children[0].value, v += "</" + e.name + ">" + this.newline; else {
                    if (this.dontprettytextnodes) for (r = 0, l = (y = e.children).length; r < l; r++) if (null != (o = y[r]).value) {
                        this.textispresent++, w = !0;
                        break
                    }
                    for (this.textispresent && (this.newline = "", this.pretty = !1, T = this.space(i)), v += ">" + this.newline, s = 0, d = (k = e.children).length; s < d; s++) o = k[s], v += function () {
                        switch (!1) {
                            case!(o instanceof t):
                                return this.cdata(o, i + 1);
                            case!(o instanceof n):
                                return this.comment(o, i + 1);
                            case!(o instanceof u):
                                return this.element(o, i + 1);
                            case!(o instanceof h):
                                return this.raw(o, i + 1);
                            case!(o instanceof f):
                                return this.text(o, i + 1);
                            case!(o instanceof c):
                                return this.processingInstruction(o, i + 1);
                            default:
                                throw new Error("Unknown XML node type: " + o.constructor.name)
                        }
                    }.call(this);
                    w && this.textispresent--, this.textispresent || (this.newline = this.newlinedefault, this.pretty = this.prettydefault), v += T + "</" + e.name + ">" + this.newline
                }
                return v
            }, i.prototype.processingInstruction = function (e, t) {
                var i;
                return i = this.space(t) + "<?" + e.target, e.value && (i += " " + e.value), i += this.spacebeforeslash + "?>" + this.newline
            }, i.prototype.raw = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, i.prototype.text = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, i.prototype.dtdAttList = function (e, t) {
                var i;
                return i = this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType, "#DEFAULT" !== e.defaultValueType && (i += " " + e.defaultValueType), e.defaultValue && (i += ' "' + e.defaultValue + '"'), i += this.spacebeforeslash + ">" + this.newline
            }, i.prototype.dtdElement = function (e, t) {
                return this.space(t) + "<!ELEMENT " + e.name + " " + e.value + this.spacebeforeslash + ">" + this.newline
            }, i.prototype.dtdEntity = function (e, t) {
                var i;
                return i = this.space(t) + "<!ENTITY", e.pe && (i += " %"), i += " " + e.name, e.value ? i += ' "' + e.value + '"' : (e.pubID && e.sysID ? i += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (i += ' SYSTEM "' + e.sysID + '"'), e.nData && (i += " NDATA " + e.nData)), i += this.spacebeforeslash + ">" + this.newline
            }, i.prototype.dtdNotation = function (e, t) {
                var i;
                return i = this.space(t) + "<!NOTATION " + e.name, e.pubID && e.sysID ? i += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.pubID ? i += ' PUBLIC "' + e.pubID + '"' : e.sysID && (i += ' SYSTEM "' + e.sysID + '"'), i += this.spacebeforeslash + ">" + this.newline
            }, i.prototype.openNode = function (e, t) {
                var i, n, a, o;
                if (t || (t = 0), e instanceof u) {
                    for (n in a = this.space(t) + "<" + e.name, o = e.attributes) p.call(o, n) && (i = o[n], a += this.attribute(i));
                    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
            }, i.prototype.closeNode = function (e, t) {
                switch (t || (t = 0), !1) {
                    case!(e instanceof u):
                        return this.space(t) + "</" + e.name + ">" + this.newline;
                    case!(e instanceof d):
                        return this.space(t) + "]>" + this.newline
                }
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(101), o = i(137), r = i(24), s = i(4), l = i(25), d = i(10), u = i(46),
        c = i(0).default.getLogger("Thunder.BrowserControl"), h = [".xunlei.com", "h5-pccloud.onethingpcs.com"];

    class f {
        constructor() {
            this.privateNativeFunctionMap = [], this.limitNative = !1, this.accessibilityNatives = [], this.state = "loading"
        }

        setNativeOptions(e) {
            e && e.limit && (this.limitNative = !0, this.accessibilityNatives = e.methods || [])
        }

        trackBrowserEvent(e, t, i = "") {
            do {
                if (!t || "" === t) break;
                let n = u.parse(t);
                if (n.host && n.host.indexOf(".xunlei.com") < 0) break;
                i = i + (i.length > 0 ? "," : "") + "url=" + encodeURIComponent(t), d.XLStatNS.trackEvent("new_tab", e, "", 0, 0, 0, 0, i)
            } while (0)
        }

        createChromiumBrowser(e, t, i, r, l) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (c.information("[tbc] createChromiumBrowser", t), s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i) || s.isNullOrUndefined(r)) break;
                    o.BrowserSupportNS.browserIsInitFinish() || (this.trackBrowserEvent("browser_load_init", t), yield o.BrowserSupportNS.initTBC()), this.trackBrowserEvent("browser_load_create", t);
                    let n = new a.Browser;
                    if (n.init({rect: r, parent_window: e, is_popup: i, url: t, visible: !1}), n) {
                        this.browser = n, null !== l && void 0 !== l && l.length > 0 && this.attachListeners(l);
                        let e = {
                            eventName: "call-native-func", listener: (e, i, n, a) => {
                                let o = a && a.length > 0 ? a[0] : void 0;
                                a = a && a.length > 0 ? a.slice(1) : a, this.onJsCallNativeFunction(0, i, n, a, t, o)
                            }
                        };
                        this.attachListener(e), this.browser.on("init-done", () => {
                            c.information("[tbc] init-done", t)
                        }), this.browser.on("before-nav", (e, t, i, n) => {
                            t && (c.information("[tbc] before-nav", i), this.trackBrowserEvent("browser_load_before_navigation", i))
                        }), this.browser.on("load-start", (e, t, i, n) => {
                            t && (c.information("[tbc] load-start", i), this.state = "loading", this.trackBrowserEvent("browser_load_navigation_start", i))
                        }), this.browser.on("load-end", (e, t, i, n, a) => {
                            t && "error" !== this.state && (this.state = "loaded", this.trackBrowserEvent("browser_load_navigation_result", i, "result=success"))
                        }), this.browser.on("load-error", (e, t, i, n, a, o) => {
                            !0 === t && (-105 !== n && -21 !== n && -106 !== n && -118 !== n && -7 !== n && -101 !== n || (this.state = "error", this.trackBrowserEvent("browser_load_navigation_result", i, "result=fail")))
                        })
                    }
                } while (0);
                return c.information("[tbc] createChromiumBrowser end", t), null
            })
        }

        showDevTool(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e)) break;
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        navigate(e) {
            let t = !1;
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.navigate(e, "", "", !1), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e)) break;
                this.state = "loading", this.browser.refresh()
            } while (0);
            return !1
        }

        stop() {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.stop()
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e)) break;
                c.information("[tbc]destroyBrowser"), this.browser.destroy(e), this.browser.removeAllListeners()
            } while (0);
            return !1
        }

        attachListener(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e) || s.isNullOrUndefined(e.eventName) || s.isNullOrUndefined(e.listener)) break;
                this.browser.addListener(e.eventName, e.listener)
            } while (0)
        }

        detachListener(e) {
            let t = !1;
            do {
                if (s.isNullOrUndefined(e)) break;
                if (s.isNullOrUndefined(e.eventName) || "" === e.eventName) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.removeListener(e.eventName, e.listener), t = !0
            } while (0);
            return t
        }

        getBrowser() {
            return this.browser
        }

        getState() {
            return this.state
        }

        attachListeners(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                for (let t of e) s.isNullOrUndefined(t) || s.isNullOrUndefined(t.eventName) || s.isNullOrUndefined(t.listener) || this.browser.addListener(t.eventName, t.listener)
            } while (0)
        }

        registerNativeFunction(e, t, i) {
            let n = !1;
            do {
                if (s.isNullOrUndefined(e) || "" === e) break;
                if (s.isNullOrUndefined(t)) break;
                if (!0 === i) {
                    if (s.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    let i = this.privateNativeFunctionMap.filter(t => e === t.functionName);
                    if (s.isNullOrUndefined(i) || i.length <= 0) {
                        let i = {functionName: e, nativeFunc: t};
                        this.privateNativeFunctionMap.push(i), n = !0
                    }
                } else {
                    if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                    let i = f.nativeFunctionMap.filter(t => e === t.functionName);
                    if (s.isNullOrUndefined(i) || i.length <= 0) {
                        let i = {functionName: e, nativeFunc: t};
                        f.nativeFunctionMap.push(i), n = !0
                    }
                }
            } while (0);
            return n
        }

        unregisterNativeFunction(e, t) {
            let i = !1;
            do {
                if (s.isNullOrUndefined(e) || "" === e) break;
                if (!0 === t) {
                    if (s.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    for (let t in this.privateNativeFunctionMap) if (this.privateNativeFunctionMap[Number(t)].functionName === e) {
                        this.privateNativeFunctionMap.splice(Number(t), 1), i = !0;
                        break
                    }
                } else {
                    if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                    for (let t in f.nativeFunctionMap) if (f.nativeFunctionMap[Number(t)].functionName === e) {
                        f.nativeFunctionMap.splice(Number(t), 1), i = !0;
                        break
                    }
                }
            } while (0);
            return i
        }

        callNativeFunctionCallback(e, t, ...i) {
            let n = !1;
            do {
                if (s.isNullOrUndefined(t)) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.callJsFunctionById(t, ...i), n = !0
            } while (0);
            return n
        }

        callJSFunction(e, t, ...i) {
            let n = !1;
            do {
                if (s.isNullOrUndefined(t) || "" === t) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.callJsFunctionByName(t, ...i), n = !0
            } while (0);
            return n
        }

        fireEvent(e, ...t) {
            let i = !1;
            do {
                if (s.isNullOrUndefined(e) || "" === e) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.fireEvent(e, ...t), i = !0
            } while (0);
            return i
        }

        onJsCallNativeFunction(e, t, i, n, a, o) {
            let d = !1;
            do {
                if (s.isNullOrUndefined(e), s.isNullOrUndefined(t) || "" === t) break;
                if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                let u = r.default.getConfigInfo("nativeFunc", "domains") || h;
                if (!this.isUrlInDomains(a, u, o) && !s.isNullOrUndefined(this.browser)) {
                    this.browser.callJsFunctionById(i, l.NativeFunctionErrorCode.NotAllowed);
                    break
                }
                let c = f.nativeFunctionMap.filter(e => t === e.functionName);
                (s.isNullOrUndefined(c) || 0 === c.length || s.isNullOrUndefined(c[0].nativeFunc)) && (c = this.privateNativeFunctionMap.filter(e => t === e.functionName));
                let g = void 0, p = l.NativeFunctionErrorCode.Success;
                if (s.isNullOrUndefined(c) || 0 === c.length || s.isNullOrUndefined(c[0].nativeFunc)) {
                    if (p = l.NativeFunctionErrorCode.FunctionUnExist, s.isNullOrUndefined(i)) {
                        d = !0;
                        break
                    }
                    if (s.isNullOrUndefined(this.browser)) break;
                    this.browser.callJsFunctionById(i, p, g)
                } else this.limitNative && -1 === this.accessibilityNatives.indexOf(t) ? (p = l.NativeFunctionErrorCode.NotAllowed, this.browser.callJsFunctionById(i, p, g)) : c[0].nativeFunc(this, e, i, n)
            } while (0);
            return d
        }

        onJsCheckNativeFunction(e, t, i) {
            do {
                if (s.isNullOrUndefined(e), s.isNullOrUndefined(i)) break;
                if (s.isNullOrUndefined(t) || "" === t) break;
                if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                let n = f.nativeFunctionMap.filter(e => t === e.functionName), a = l.NativeFunctionErrorCode.Success;
                if ((s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || s.isNullOrUndefined(n[0].nativeFunc)) && (a = l.NativeFunctionErrorCode.FunctionUnExist), s.isNullOrUndefined(this.browser)) break;
                this.browser.callJsFunctionById(i, a)
            } 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 i = e[t].functionName, n = e[t].nativeFunc;
                    if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                    let a = f.nativeFunctionMap.filter(e => i === e.functionName);
                    if (s.isNullOrUndefined(a) || a.length <= 0) {
                        let e = {functionName: i, nativeFunc: n};
                        f.nativeFunctionMap.push(e)
                    }
                }
            } while (0)
        }

        isUrlInDomains(e, t, i) {
            let n = !1;
            for (let a = 0; a < t.length; ++a) if (e.includes(t[a]) || i && i.includes(t[a])) {
                n = !0;
                break
            }
            return n
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4);
    let o = !1, r = !1, s = 0;
    const l = 2, d = 2;
    !function (e) {
        function t(e) {
            do {
                if (o) break;
                if (!e) break;
                o = !0, r = e.getDPIAwareSupport(), s = e.getSysDPIFactor()
            } while (0)
        }

        function i(e, i) {
            t(e);
            let n = 1;
            return n = r && i ? e.getMonitorDPIFactor(i) : s
        }

        function u() {
            return window.document.querySelector(".xly-findpage .xly-browser-tab").getBoundingClientRect()
        }

        e.getDpiFactor = i, e.getBrowserWindowPosition = function (e, a) {
            return n(this, void 0, void 0, function* () {
                let n = {x: 0, y: 0, width: 0, height: 0};
                do {
                    if (!e || !a) break;
                    let o = (yield a.getNativeWindowHandle()).readUIntLE(0, 4);
                    t(e);
                    let r = i(e, o), s = u(), c = yield a.getContentSize();
                    n = {
                        x: s.left * r,
                        y: s.bottom * r,
                        width: (c[0] - s.left - l) * r,
                        height: (c[1] - s.bottom - d) * r
                    }
                } while (0);
                return n
            })
        }, e.getHeaderRect = u, e.isWindowShow = function () {
            let e = window.document.querySelector(".xly-findpage.is-show");
            return !!a.isNullOrUndefined(e)
        }
    }(t.BrowserWindowNS || (t.BrowserWindowNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(11), r = i(33);
    !function (e) {
        e.resizeToFitContent = function (e = 0, t = 0, i) {
            return n(this, void 0, void 0, function* () {
                let n = yield o.asyncRemoteCall.getCurrentWindow();
                if (e > 0 && t > 0) window.resizeTo(e, t); else {
                    let e = document.querySelector(".td-dialog");
                    window.resizeTo(e.offsetWidth, e.offsetHeight)
                }
                i && "function" == typeof i && i(), window.requestIdleCallback(() => {
                    n.show()
                })
            })
        }, e.autoAdaptScrollIntoView = function (e, t, i) {
            let n = t.scrollTop, a = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = a.bottom;
            void 0 !== i && "number" == typeof i && i > 0 && (r = a.top + i), o.top < a.top ? t.scrollTop = n - (a.top - o.top) : o.bottom > r && (t.scrollTop = n + (o.bottom - r))
        }, e.fitWindowPosInParent = function (e, t) {
            return n(this, void 0, void 0, function* () {
                e || (e = yield o.asyncRemoteCall.getCurrentWindow()), t || (t = yield e.getParentWindow());
                let i = (yield e.getNativeWindowHandle()).readUIntLE(0, 4),
                    n = (yield t.getNativeWindowHandle()).readUIntLE(0, 4);
                a.ipcRenderer.sendSync(r.ThunderChannelList.channelRMSetPosition, i, n)
            })
        }, e.getWindowsInParentCenterPos = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                i || "browser" === process.type || (i = yield o.asyncRemoteCall.getCurrentWindow());
                let n = "browser" !== process.type ? yield i.getPosition() : i.getPosition(),
                    r = "browser" !== process.type ? yield i.getSize() : i.getSize(),
                    s = "browser" !== process.type ? yield o.asyncRemoteCall.getScreen() : a.screen,
                    l = yield s.getCursorScreenPoint(), d = yield s.getDisplayNearestPoint(l), u = d.size.width,
                    c = d.size.height, h = r[0], f = r[1];
                n[0] + h > u && (h = u - n[0]), n[1] + f > c && (f = c - n[1]);
                let g = n[0] + (h - e) / 2, p = n[1] + (f - t) / 2;
                return g < 0 ? g = 0 : g > u - e && (g = u - e), p < 0 ? p = 0 : p > c - t && (p = c - t), [Math.round(g), Math.round(p)]
            })
        }, e.centerWnd = function (e, t, i) {
            do {
                if ("browser" !== process.type) break;
                if (!e || !t) break;
                let n = e.getNativeWindowHandle().readUIntLE(0, 4);
                if (!n) break;
                let o = t.getPosition(), r = t.getSize(), s = e.getSize(), l = a.screen.getCursorScreenPoint(),
                    d = a.screen.getDisplayNearestPoint(l), u = d.scaleFactor, c = d.size.width, h = d.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, v = o[1] + (g - s[1]) / 2;
                p < 0 ? p = 0 : p > c - s[0] && (p = c - s[0]), v < 0 ? v = 0 : v > h - s[1] && (v = h - s[1]), i.setWindowPos(n, 0, p * u, v * u, 0, 0, 5)
            } while (0)
        }, e.bringWindowToTop = function (e) {
            return n(this, void 0, void 0, function* () {
                if (!e) {
                    let t = yield(yield o.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle();
                    e = t.readUIntLE(0, 4)
                }
                a.ipcRenderer.send(r.ThunderChannelList.channelMRBringWindowToTop, e)
            })
        }
    }(t.ThunderWindowNS || (t.ThunderWindowNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(62), o = i(9), r = i(23), s = i(4);
    let l = void 0;
    !function (e) {
        function t() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        e.isAlreadySign = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                if (yield r.LoginHelperNS.loginHelper.isLoginedAw()) try {
                    let t = yield a.fetchSlRes({url: "/xlppc.movie.guess.api/api/query_coin", data: {}, method: "get"});
                    if (null !== t && void 0 !== t && 200 === t.status && !s.isNullOrUndefined(t.data)) {
                        let i = t.data;
                        s.isNullOrUndefined(i.data) || s.isNullOrUndefined(i.data.is_answered) || (e = i.data.is_answered)
                    }
                } catch (e) {
                }
                return e
            })
        }, e.isHaveSignQuestion = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (void 0 !== l && o.ConfigNS.getValue("sign", "getQuestionTime", "") === t()) {
                        e = !!l;
                        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, l = !0) : (e = !1, l = !1))
                    } catch (e) {
                    }
                    o.ConfigNS.setValue("sign", "getQuestionTime", t())
                } while (0);
                return e
            })
        }, e.actSwitch = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = {actSwitch: !1};
                try {
                    let i = yield a.fetchRequest({
                        method: "get",
                        url: "https://msg-vip-ssl.xunlei.com/xlact/conf",
                        data: {actid: e, source: 3e3}
                    });
                    if (null !== i && void 0 !== i && 200 === i.status && null !== i.data && void 0 !== i.data) {
                        let e = i.data;
                        if (0 === e.result && e.data) {
                            let i = e.data;
                            "on" === i.switch && (t = {actSwitch: !0, width: i.width, height: i.height})
                        }
                    }
                } catch (e) {
                }
                return t
            })
        }, e.getCurDate = t
    }(t.CommonSignFunctionNs || (t.CommonSignFunctionNs = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = i(3), l = i(64), d = i(12), u = i(346), c = i(41), h = i(47), f = i(75),
        g = i(4), p = i(35), v = i(24), m = i(51), y = i(140), k = i(39), T = i(459), w = i(34),
        C = o.default.getLogger("NativeFunction.TaskInfo"), S = d.DownloadKernelTaskManager.getTaskManager();

    class I {
        constructor() {
            u.HistoryTaskSpeedInfoNS.init().catch()
        }

        getHistoryTaskInfoString(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", i = yield this.getTaskInfo(e);
                if (i) {
                    "1111111111111111111111111111111111111111" === i.gcid && (i.gcid = "");
                    let n = S.getTaskFromTaskId(e);
                    if (n) {
                        let a = yield this.getFileList(n);
                        i.fileList = a;
                        let o = i.progress, r = yield this.getHistorySpeedInfo(e, o);
                        r && (r.maxSpeed && (i.maxSpeed = r.maxSpeed), r.historySpeedMap && (i.historySpeed = r.historySpeedMap), r.historyIncreaseSpeedMap && (i.historyIncreaseSpeed = r.historyIncreaseSpeedMap), r.historyVipSpeedColorMap && (i.historyVipSpeedColor = r.historyVipSpeedColorMap), t = JSON.stringify(i), C.information("taskInfo: ", t))
                    } else C.warning("task is null")
                } else C.warning("taskInfo is null");
                return t
            })
        }

        getTaskInfoString(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", i = yield this.getTaskInfo(e);
                return i ? (t = JSON.stringify(i), C.information("taskInfo: ", t)) : C.warning("taskInfo is null"), t
            })
        }

        getBtSubFileListString(e, t) {
            let i = [];
            do {
                let n = S.getTaskFromTaskId(e);
                if (!n) break;
                if (n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Bt) break;
                let a = n.getExtraObject();
                if (!a) break;
                for (let e = 0; e < t.length; ++e) {
                    let n = t[e], o = a.getBtFileByRealIndex(n.realIndex);
                    if (!o) continue;
                    let r = {};
                    r.index = n.realIndex, r.filePath = n.relativePath, r.fileName = o.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), r.isNeedDownload = o.getIsDownload(), r.isSupportPlay = o.isSupportPlay(), r.fileSize = n.fileSize, r.cid = n.cid, r.gcid = n.gcid, r.status = n.fileStatus, r.downloadSize = n.downloadSize, r.errCode = n.errorCode, r.userRead = n.userRead, 0 !== r.errCode ? r.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(r.errCode) : r.errMessage = "", i.push(r)
                }
            } while (0);
            return JSON.stringify(i)
        }

        getGroupTaskSubFileListString(e) {
            let t = [];
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (n) {
                    let e = {};
                    e.filePath = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), e.index = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileIndex), e.taskId = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), e.fileName = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), e.url = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.RefUrl), e.isNeedDownload = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), e.cid = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), e.gcid = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), e.status = n.getTaskStatus(), e.errCode = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), e.userRead = n.getUserRead(), e.isSupportPlay = n.isSupportPlay(), e.status === s.DownloadKernel.TaskStatus.Failed ? e.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                    let i = n.getTaskChannelInfo();
                    e.dcdnStatus = i.dcdnStatus, t.push(e)
                }
            }
            return JSON.stringify(t)
        }

        calcGroupTaskUniqueId(e) {
            let t = "", i = e.getExtraObject(), n = i.getSubTaskCount();
            if (n > 0) {
                let e = [];
                for (let t = 0; t < n; ++t) {
                    let n = i.getSubTaskByIndex(t).getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
                    g.isString(n) && n.length > 0 && e.push(n)
                }
                if (e.length > 0) {
                    e.sort();
                    let i = e.length, n = "#" + i + "#";
                    C.information("CalcGroupTaskUniqueID urlNum: ", i);
                    for (let t = 0; t < i; ++t) n += e[t] + "#";
                    let a = Buffer.alloc(n.length);
                    a.write(n), (t = p.ToolsUtilitiesAWNS.encryptSha1Buffer(a)) && (t = t.toUpperCase())
                }
            }
            return t
        }

        getTaskInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = {}, i = S.getTaskFromTaskId(e);
                if (i) {
                    let n = i.getTaskStatus(), o = 0;
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || (o = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.CompletionTime)), i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0 && (n = 20);
                    let r = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RefUrl),
                        d = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), u = "",
                        c = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType),
                        h = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                    c !== s.DownloadKernel.TaskType.P2sp && c !== s.DownloadKernel.TaskType.Emule || (u = a.extname(h)) && (u = u.substring(1));
                    let g = "";
                    if (c === s.DownloadKernel.TaskType.Bt) {
                        g = i.getExtraObject().getInfoId()
                    }
                    let p = "", v = i.getTaskChannelInfo(),
                        m = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                        k = v.offlineSize + v.originSize + v.p2pSize + v.p2sSize;
                    k < m && (v.p2pSize > 0 ? v.p2pSize = v.p2pSize + m - k : v.offlineSize > 0 ? v.offlineSize = v.offlineSize + m - k : v.originSize > 0 ? v.originSize = v.originSize + m - k : v.p2sSize > 0 && (v.p2sSize = v.p2sSize + m - k));
                    let T = "";
                    c === s.DownloadKernel.TaskType.P2sp || c === s.DownloadKernel.TaskType.Emule ? T = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid) : c === s.DownloadKernel.TaskType.Group && (C.information("calcGroupTaskUniqueId before"), T = this.calcGroupTaskUniqueId(i), C.information("calcGroupTaskUniqueId end, taskId: ", i.getId(), ", uniqueId: ", T));
                    let w = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                        S = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal),
                        I = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing),
                        b = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        _ = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime),
                        D = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                        A = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Description),
                        N = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode),
                        x = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Moving), E = yield this.getActions(i),
                        P = this.getProgress(i), O = this.getSpeedInfo(i),
                        M = yield y.VipPluginFunctionNS.getVipSpeedColor(e);
                    if (t.status = n, t.taskID = e, t.type = c, t.name = h, t.gcid = T, t.suffix = u, t.url = d, t.refUrl = r, t.isFromVest = !1, t.isMoving = x, "" !== d || "" !== g) {
                        let e = "" === d ? g : d, i = yield f.isVestUrl(e, "vestURL");
                        t.isFromVest = i
                    }
                    t.size = w, t.downloadSize = m, t.progress = P, t.allResourceCount = S, t.resourceCount = I, t.errCode = N, t.status === s.DownloadKernel.TaskStatus.Failed ? t.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(t.errCode) : t.errMessage = "", i.getStopReason() === s.DownloadKernel.TaskStopReason.SelectDownloadLists ? t.stopReason = "downloadSelected" : t.stopReason = "", t.actions = E, t.averageSpeed = O.averageSpeed, t.speed = O.speed, t.increaseSpeed = O.increaseSpeed, t.vipSpeedColor = M, t.channelInfo = v, t.savePath = D, t.infoId = g, t.duration = b, t.createTime = _, t.completeTime = o, t.md5 = p, t.note = A
                }
                return t
            })
        }

        isForbidden(e) {
            let t = !1;
            do {
                if (e.getTaskStatus() === s.DownloadKernel.TaskStatus.Failed) {
                    let i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode);
                    if (7 === i) {
                        t = !0;
                        break
                    }
                    if (i >= 700 && i <= 799) {
                        t = !0;
                        break
                    }
                }
            } while (0);
            return t
        }

        getActions(e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = !0;
                0 === v.default.getConfigInfo("shouleiDownload", "enable") && (i = !1);
                let n = e.getTaskStatus();
                do {
                    if (n !== s.DownloadKernel.TaskStatus.Failed && n !== s.DownloadKernel.TaskStatus.Unkown) {
                        if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Group) t.push("repost"); else {
                            let i = e.getExtraObject().getUserData(m.TaskUserDataGUID.guidDownloadGroupTask, "canRepost");
                            i && "true" === i && 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) {
                        let i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
                        if (i === 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 o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName),
                                    r = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath);
                                n = a.join(r, o), i !== s.DownloadKernel.TaskType.Emule && i !== s.DownloadKernel.TaskType.P2sp || k.TaskUtilHelper.isIsoExt(o) && w.ThunderHelper.isWindow8OrLater() && ("" !== (yield T.DiskImageHelperNS.getVirtualDiskPhysicalPath(n)) ? t.push("ejectiso") : t.push("mountiso"))
                            }
                            if (!(yield r.FileSystemAWNS.existsAW(n))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder"), i !== s.DownloadKernel.TaskType.Bt && t.push("open")
                        }
                        e.isSupportPlay() && (t.push("play"), t.push("subtitleDownload"), 1 === e.getVideoFileCount() && t.push("videoPreview"));
                        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"), 1 === e.getVideoFileCount() && t.push("videoPreview"))
                } while (0);
                if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Group) if (0 !== v.default.getConfigInfo("shouleiDownload", "enableTransfer")) {
                    let a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || !(yield c.TaskCtrlOperatorNS.isExistTaskFile(e.getTaskBaseInfo())) ? a === s.DownloadKernel.CategroyViewID.Downloading ? t.push("shouleiTransfer") : i && t.push("shouleiDownload") : t.push("shouleiTransfer")
                } else i && t.push("shouleiDownload");
                return t
            })
        }

        getProgress(e) {
            let t = 0, i = e.getTaskStatus(), n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
            return 0 !== n && 0 !== a && (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding || a >= n ? t = 100 : (t = a / n * 100, t = parseInt(t.toString(), 10))), t
        }

        getFileList(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", i = !0, n = [], o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
                if (o === s.DownloadKernel.TaskType.Bt) {
                    let o = e.getExtraObject().getBtFileList(),
                        d = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                        u = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                    void 0 !== u && "" !== u && u.indexOf(".") === u.length - 1 && (u = u.substring(0, u.length - 1));
                    let c = yield h.SingleBtTaskNS.isSingleBtTask(e);
                    for (let [, f] of o) {
                        let o = {};
                        o.index = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.RealIndex), o.filePath = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath), o.fileName = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), o.isNeedDownload = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download), o.fileSize = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileSize), o.cid = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Cid), o.gcid = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Gcid), o.status = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus), o.downloadSize = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.DownloadSize), o.errCode = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.ErrorCode), o.isSupportPlay = f.isSupportPlay(), o.userRead = f.getUserRead(), 0 !== o.errCode ? o.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(o.errCode) : o.errMessage = "", o.status === s.DownloadKernel.BtFileStatus.Complete ? (t = c ? h.SingleBtTaskNS.getSinleBtTaskFilePath(e) : a.join(d, u, o.filePath, o.fileName), i = yield r.FileSystemAWNS.existsAW(t), o.isDelete = !i) : o.isDelete = !1, n.push(o)
                    }
                } else if (o === s.DownloadKernel.TaskType.Group) {
                    let o = e.getExtraObject(), d = o.getSubTaskCount(), u = "";
                    for (let e = 0; e < d; ++e) {
                        let d = o.getSubTaskByIndex(e);
                        if (d) {
                            let o = {};
                            o.index = e, o.filePath = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), o.taskId = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), o.fileName = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), o.url = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), o.refUrl = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.RefUrl), o.isNeedDownload = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), o.fileSize = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), o.downloadSize = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), o.cid = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), o.gcid = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), o.status = d.getTaskStatus(), o.errCode = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), o.isSupportPlay = d.isSupportPlay(), o.userRead = d.getUserRead(), o.status === s.DownloadKernel.TaskStatus.Failed ? o.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(o.errCode) : o.errMessage = "";
                            let c = d.getTaskChannelInfo();
                            o.dcdnStatus = c.dcdnStatus, u = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath), o.status === s.DownloadKernel.TaskStatus.Succeeded || o.status === s.DownloadKernel.TaskStatus.Seeding ? (t = a.join(u, o.fileName), i = yield r.FileSystemAWNS.existsAW(t), o.isDelete = !i) : o.isDelete = !1, n.push(o)
                        }
                    }
                }
                return n
            })
        }

        getSpeedInfo(e) {
            let t = e.getDownloadSpeed(), i = 0, n = e.getVipSpeed(),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
            o < 1 && (o = 1), i = a / o, i = parseInt(i.toString(), 10);
            let r = {};
            return r.averageSpeed = i, r.speed = t, r.increaseSpeed = n, r
        }

        getHistorySpeedInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = {maxSpeed: 0, historySpeedMap: {}, historyIncreaseSpeedMap: {}},
                    n = yield u.HistoryTaskSpeedInfoNS.getTaskSpeedInfo(e);
                do {
                    if (!n) break;
                    if (!n.maxSpeed || n.maxSpeed < 0) break;
                    i.maxSpeed = n.maxSpeed;
                    let e = n.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 = {}, r = {};
                    for (let i in e) if (void 0 !== e[i]) {
                        let n = parseInt(i, 10);
                        if (n <= t) {
                            let t = e[i];
                            a[n] = t.downloadSpeed, o[n] = t.addSpeed, r[n] = t.vipSpeedColor
                        }
                    }
                    i.historySpeedMap = a, i.historyIncreaseSpeedMap = o, i.historyVipSpeedColorMap = r
                } while (0);
                return i
            })
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = i(3), l = i(15), d = i(12), u = i(4), c = i(140),
        h = o.default.getLogger("NativeFunction.TaskInfoHistory"), f = l.DownloadKernelEventManager.getEventManager(),
        g = d.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1
            }

            init() {
                return n(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)), f.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                        this.onTaskDetailChanged(...e)
                    }), f.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                        this.onTaskStatusChanged(...e)
                    }))
                })
            }

            getTaskSpeedInfo(e) {
                return n(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], i = e[2];
                    if (!t || !i) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = 0, a = 0, o = i.getDownloadSpeed(), r = i.getVipSpeed(),
                            l = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                            d = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            u = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        u < 1 && (u = 1), n = Math.round(d / u);
                        let c = i.getTaskStatus();
                        if (c === s.DownloadKernel.TaskStatus.Succeeded || c === s.DownloadKernel.TaskStatus.Seeding) a = 100; else {
                            let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize);
                            0 !== e && (a = d / e * 100, (a = parseInt(a.toString(), 10)) > 100 ? a = 100 : a < 0 && (a = 0))
                        }
                        this.updateProgress(l, n, a, o, r).catch(e => {
                            h.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 i = t[e];
                        if (!i) continue;
                        let n = i.getTaskStatus(), o = i.getTaskPreStatus();
                        if (n !== s.DownloadKernel.TaskStatus.StartWaiting && n !== s.DownloadKernel.TaskStatus.StartPending || o !== s.DownloadKernel.TaskStatus.StandBy) {
                            if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                                let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = this.taskSpeedMap.get(e);
                                if (t) {
                                    let n = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                                        a = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                                    a < 1 && (a = 1), t.aveSpeed = Math.round(n / a), this.checkTaskSpeedInfo(e, t)
                                }
                            } else if (n === s.DownloadKernel.TaskStatus.DestroyPending) {
                                let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = a.join(this.dataPath, "TaskInfoEx_" + e + ".txt");
                                h.information("destroy task taskId:", e, ", taskinfo file:", t), r.FileSystemAWNS.unlinkAW(t).catch(), this.taskSpeedMap.delete(e)
                            }
                        } else {
                            let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                t = this.taskSpeedMap.get(e);
                            t && (t.speedInfoMap = {}, this.taskSpeedMap.set(e, t), this.saveTaskSpeedInfo(e).catch(e => {
                                h.warning(e)
                            }))
                        }
                    }
                } while (0)
            }

            updateProgress(e, t, i, a, o) {
                return n(this, void 0, void 0, function* () {
                    let n = this.taskSpeedMap.get(e);
                    n || (n = this.newTaskSpeedInfo(e)), n.aveSpeed = t, a > n.maxSpeed && (n.maxSpeed = a), n.progress = i;
                    let r = yield c.VipPluginFunctionNS.getVipSpeedColor(e),
                        s = {progress: i, downloadSpeed: a, addSpeed: o, vipSpeedColor: r}, l = Math.floor(i);
                    100 === l && n.speedInfoMap[l] || (n.speedInfoMap[l] = s, this.taskSpeedMap.set(e, n), 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 n(this, void 0, void 0, function* () {
                    let t = !1, i = "TaskInfoEx_" + e.toString() + ".txt", n = a.join(this.dataPath, i);
                    if (yield r.FileSystemAWNS.existsAW(n)) {
                        let i = yield r.FileSystemAWNS.readFileAW(n);
                        if (i) {
                            let n = null;
                            try {
                                n = JSON.parse(i.toString())
                            } catch (e) {
                                h.warning(e)
                            }
                            null !== n && (this.taskSpeedMap.set(e, n), t = !0)
                        }
                    }
                    return t
                })
            }

            checkTaskSpeedInfo(e, t) {
                let i = g.getTaskFromTaskId(e);
                if (!i) return;
                let n = i.getTaskStatus(), a = !1;
                if (u.isNumber(t.aveSpeed) || (h.warning("checkTaskSpeedInfo bad aveSpeed", ", taskId: ", e), t.aveSpeed = 0, a = !0), u.isNumber(t.maxSpeed) || (h.warning("checkTaskSpeedInfo bad maxSpeed", ", taskId: ", e), t.maxSpeed = 0, a = !0), t.aveSpeed > t.maxSpeed && (h.warning("checkTaskSpeedInfo aveSpeed > maxSpeed", ", taskId: ", e), t.aveSpeed = t.maxSpeed, a = !0), n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                    h.information("checkTaskSpeedInfo check complete data");
                    let n = t.speedInfoMap[100], o = t.speedInfoMap[0];
                    if (!(u.isObject(n) && u.isObject(o) || 0 !== t.aveSpeed)) {
                        let n = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            o = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        o < 1 && (o = 1), t.aveSpeed = Math.round(n / o), h.information("checkTaskSpeedInfo recalc aveSpeed:", t.aveSpeed, ", taskId: ", e), a = !0
                    }
                }
                a && this.saveTaskSpeedInfo(e).catch()
            }

            saveTaskSpeedInfo(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = this.taskSpeedMap.get(e);
                    if (i) {
                        let n = JSON.stringify(i), o = "TaskInfoEx_" + e.toString() + ".txt",
                            s = a.join(this.dataPath, o);
                        t = yield r.FileSystemAWNS.writeFileAW(s, n)
                    }
                    return t
                })
            }
        };
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                yield t.init()
            })
        }, e.getTaskSpeedInfo = function (e) {
            return n(this, void 0, void 0, function* () {
                return yield t.getTaskSpeedInfo(e)
            })
        }
    }(t.HistoryTaskSpeedInfoNS || (t.HistoryTaskSpeedInfoNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(11), r = i(0), s = i(14), l = i(3), d = i(12), u = i(32), c = i(22), h = i(29), f = i(44),
        g = i(142), p = i(4), v = i(6), m = i(459), y = i(15), k = r.default.getLogger("Thunder.TaskOperator"),
        T = d.DownloadKernelTaskManager.getTaskManager(), w = g.SubtitleManagerNS.getSubtitleManger(),
        C = y.DownloadKernelEventManager.getEventManager();
    t.TaskOperate = class {
        static operateTaskActions(e, t, i) {
            return n(this, void 0, void 0, function* () {
                switch (t) {
                    case"play":
                        this.playTask(e, i);
                        break;
                    case"playfromPreview":
                        this.playFromPreview(e, i).catch();
                        break;
                    case"downAndPlay":
                        this.downloadAndPlayTask(e, i);
                        break;
                    case"dlnaPlay":
                        this.downloadAndPlayTask(e, i, !0);
                        break;
                    case"openFolder":
                        this.openFolder(e);
                        break;
                    case"open":
                        this.open(e, i);
                        break;
                    case"continue":
                        yield 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, i);
                        break;
                    case"downloadSelectFiles":
                        yield this.downloadSelectFiles(e, i);
                        break;
                    case"showHomePage":
                        this.showHomePage(e);
                        break;
                    case"install":
                        this.installFile(e, i);
                        break;
                    case"subtitleDownload":
                        this.openSubtitleDlg(e);
                        break;
                    case"repost":
                        this.createBirdKey(e);
                        break;
                    case"mountiso":
                        this.attachVirtualDisk(e).catch();
                        break;
                    case"ejectiso":
                        this.detachVirtualDisk(e).catch()
                }
            })
        }

        static getTaskBirdKeyData(e) {
            return u.TaskOperatorNs.getTaskBirdKeyData(e)
        }

        static playTask(e, t) {
            let i = T.getTaskFromTaskId(e);
            if (i) {
                if (p.isString(t)) try {
                    t = JSON.parse(t)
                } catch (e) {
                    k.warning(e)
                }
                if (null !== t && void 0 !== t && "object" == typeof t) {
                    let n = !0;
                    if ("finished" === t.panel && (n = !1), k.information("playTask extra", t, "isEmbed", n, "categoryId", t.categoryId), u.TaskOperatorNs.downloadAndPlay(e, t.fileIndex, void 0, t.panel, t.categoryId, !1, t.percent, !0, n, t.playFrom || "", t.showBackIcon).catch(), !p.isNullOrUndefined(t.fileIndex)) {
                        let e = i.getType();
                        if (e === l.DownloadKernel.TaskType.Bt) {
                            let e = i.getExtraObject().getBtFileByRealIndex(t.fileIndex);
                            e && e.setUserRead(1)
                        } else if (e === l.DownloadKernel.TaskType.Group) {
                            let e = i.getExtraObject().getSubTaskByIndex(t.fileIndex);
                            e && e.setUserRead(1)
                        }
                    }
                } else u.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, void 0, void 0, void 0, void 0, !0, !0, t && t.playFrom ? t.playFrom : "").catch();
                i.setUserRead(1)
            }
        }

        static playFromPreview(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = T.getTaskFromTaskId(e);
                if (!i) return void k.information("错误的任务ID,taskid=", e);
                let n, a = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryViewId),
                    o = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryId);
                p.isString(t) ? n = JSON.parse(t) : p.isObject(t) && (n = t);
                let r = -1, s = i.getType();
                if (s === l.DownloadKernel.TaskType.Bt) {
                    let e = i.getExtraObject().getBtFileList();
                    for (let [t, i] of e) if (i.isSupportPlay()) {
                        r = t;
                        break
                    }
                } else s === l.DownloadKernel.TaskType.Emule || s === l.DownloadKernel.TaskType.P2sp ? r = 0 : k.warning("不支持播放");
                let d = 0;
                n && void 0 !== n.posPercent && (d = n.posPercent), n && (n.fileIndex = r, n.panel = a, n.categoryId = o, n.percent = d), k.information("播放预览视频: fileIndex=", r, " panel=", a, " categoryId=", o, " percent=", d), this.playTask(e, n)
            })
        }

        static downloadAndPlayTask(e, t, i) {
            if (T.getTaskFromTaskId(e)) {
                if (p.isString(t)) try {
                    t = JSON.parse(t)
                } catch (e) {
                    k.warning(e)
                }
                null !== t && void 0 !== t && "object" == typeof t ? u.TaskOperatorNs.downloadAndPlay(e, t.fileIndex, void 0, t.panel, t.categoryId, i, void 0, !0, !0, t.playFrom || "").catch() : u.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, "downloading", void 0, i, void 0, !0, !0, t.playFrom || "").catch()
            }
        }

        static openFolder(e) {
            let t = T.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskBaseInfo();
                u.TaskOperatorNs.markReadStatus([e], 1), u.TaskOperatorNs.openTaskFolder(e, !0).catch()
            }
        }

        static open(e, t) {
            let i = T.getTaskFromTaskId(e);
            if (i) {
                let e = i.getTaskBaseInfo(), n = -1;
                if (n = null === t || void 0 === t || "" === t ? -1 : Number(t), u.TaskOperatorNs.openTaskItem(e, n, void 0, void 0, void 0, !0).catch(), n >= 0) {
                    let e = i.getType();
                    if (e === l.DownloadKernel.TaskType.Bt) {
                        let e = i.getExtraObject().getBtFileByRealIndex(n);
                        e && e.setUserRead(1)
                    } else if (e === l.DownloadKernel.TaskType.Group) {
                        let e = i.getExtraObject().getSubTaskByIndex(n);
                        e && e.setUserRead(1)
                    }
                }
                i.setUserRead(1)
            }
        }

        static startTask(e) {
            return n(this, void 0, void 0, function* () {
                yield f.DownloadDispatchNS.startTask(e)
            })
        }

        static stopTask(e) {
            T.stopTask(e, l.DownloadKernel.TaskStopReason.Manual)
        }

        static restoreTask(e) {
            T.recoverFromRecycle(e)
        }

        static deleteTask(e) {
            let t = T.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskBaseInfo();
                u.TaskOperatorNs.destroyTasks([e])
            }
        }

        static noteTask(e, t) {
            if (t) {
                let i = T.getTaskFromTaskId(e);
                i && i.setDescription(t)
            }
        }

        static downloadSelectFiles(e, t) {
            return n(this, void 0, void 0, function* () {
                (yield T.downloadTaskSelectFiles(e, t)) && (yield f.DownloadDispatchNS.startTask(e))
            })
        }

        static showHomePage(e) {
            h.default.fireEvent(s.NodeEventMesssageNS.eventShowHomePage, e)
        }

        static installFile(e, t) {
            if (null !== t && void 0 !== t && "" !== t) try {
                let i = JSON.parse(t), n = i.path, a = "";
                null !== i.runParams && void 0 !== i.runParams && "" !== i.runParams && (a = i.runParams);
                let o = T.getTaskFromTaskId(e);
                u.TaskOperatorNs.executeInstallFile(o, n, a).catch()
            } catch (e) {
            }
        }

        static openSubtitleDlg(e) {
            let t = T.getTaskFromTaskId(e);
            if (t) {
                let i = t.getTaskName(), n = t.getType(), o = "";
                t && (o = t.getSavePath()), n === l.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (o = a.join(o, i));
                let r = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryViewId), s = w.getDisaplayName(e),
                    d = 0;
                (d = s.length) > 1 ? c.MessageBox.custom("SubtitleTaskFilelist", {
                    size: "large",
                    taskId: e,
                    taskName: i,
                    taskType: n,
                    fileList: s,
                    saveDir: o,
                    categoryViewId: r
                }, {center: !0, width: 500, height: 329}).catch() : c.MessageBox.custom("SubtitleSearch", {
                    taskId: e,
                    taskName: i,
                    cid: s[0].cid,
                    saveDir: o,
                    from: "taskList",
                    categoryViewId: r
                }, {center: !0, width: 500, height: 323}).catch()
            }
        }

        static createBirdKey(e) {
            u.TaskOperatorNs.createBirdKey(e)
        }

        static attachVirtualDisk(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = T.getTaskFromTaskId(e);
                    if (!t) break;
                    let i = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                        n = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), r = a.join(n, i);
                    if (!(yield v.FileSystemAWNS.existsAW(r))) break;
                    let s = yield m.DiskImageHelperNS.attachVirtualDisk(r);
                    "" !== s && (yield(yield o.asyncRemoteCall.getShell()).showItemInFolder(s), C.fireTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, [t], l.DownloadKernel.TaskDetailChangedFlags.UnKnown))
                } while (0)
            })
        }

        static detachVirtualDisk(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = T.getTaskFromTaskId(e);
                    if (!t) break;
                    let i = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                        n = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), o = a.join(n, i);
                    if (!(yield v.FileSystemAWNS.existsAW(o))) break;
                    (yield m.DiskImageHelperNS.detachVirtualDisk(o)) && C.fireTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, [t], l.DownloadKernel.TaskDetailChangedFlags.UnKnown)
                } while (0)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(7).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.getXmpPath = function () {
            let e = "";
            return e = a.readRegString("HKEY_LOCAL_MACHINE", "SOFTWARE\\Thunder Network\\Xmp", "Path")
        }, e.getXmpReg = function (e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = "HKEY_LOCAL_MACHINE", n = "Software\\Thunder Network\\Xmp", o = e;
                t = a.queryRegValue(i, n, o);
                let r = a.getLongPathName(t);
                null !== r && void 0 !== r && "" !== r && (t = r)
            } while (0);
            return t
        }
    }(t.DownloadAndPlayNS || (t.DownloadAndPlayNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(3), r = i(12), s = i(15), l = i(31), d = i(14), u = i(63), c = i(6), h = i(34), f = i(39),
        g = i(5), p = i(61), v = i(32), m = i(43), y = i(0), k = r.DownloadKernelTaskManager.getTaskManager(),
        T = s.DownloadKernelEventManager.getEventManager(), w = y.default.getLogger("XmpUnionNS");
    !function (e) {
        function t(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let r = !1, l = 0;
                return !function (e) {
                    let t = !1;
                    do {
                        if (!e) break;
                        0 !== (e = e.toLowerCase()).indexOf("ed2k://") && 0 !== e.indexOf("http://") && 0 !== e.indexOf("https://") && 0 !== e.indexOf("ftp://") && 0 !== e.indexOf("thunder:") || (t = !0)
                    } while (0);
                    return t
                }(e) ? function (e) {
                    let t = !1;
                    do {
                        if (!e) break;
                        if (0 === (e = e.toLowerCase()).indexOf("magnet:?")) {
                            t = !0;
                            break
                        }
                    } while (0);
                    return t
                }(e) && (l = yield s(e)) : l = yield function (e, t, i) {
                    return n(this, void 0, void 0, function* () {
                        let n = 0;
                        do {
                            let a = yield g.client.callServerFunction("GetDownloadDir"), r = i;
                            r && "" !== r || (r = u.ParseUrlFileNameNS.getNameFromUrl(e));
                            let s = null, l = {savePath: a, taskName: r}, d = h.ThunderHelper.getTaskTypeFromUrl(e);
                            if (d === o.DownloadKernel.TaskType.P2sp) {
                                let i = {taskType: o.DownloadKernel.TaskType.P2sp, value: e},
                                    a = yield p.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                                if (a && a[0]) {
                                    n = a[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                                    let e = a[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.RecycleTime);
                                    e > 0 && k.recoverFromRecycle(n);
                                    break
                                }
                                let r = {url: e, refUrl: t || "", downloadSubTask: 1};
                                yield y(), s = yield k.createTask(o.DownloadKernel.TaskType.P2sp, {
                                    taskBaseInfo: l,
                                    p2spTaskInfo: r
                                })
                            } else if (d === o.DownloadKernel.TaskType.Emule) {
                                let t = m.Common.parseEd2kUrl(e);
                                if (null !== t) {
                                    let e = {taskType: o.DownloadKernel.TaskType.Emule, value: t.fileHash},
                                        i = yield p.TaskUtilitiesAWNS.batchFindTaskAW([e]);
                                    if (i && i[0]) {
                                        n = i[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                                        let e = i[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.RecycleTime);
                                        e > 0 && k.recoverFromRecycle(n);
                                        break
                                    }
                                }
                                let i = {url: e, downloadSubTask: 1};
                                yield y(), s = yield k.createTask(o.DownloadKernel.TaskType.Emule, {
                                    taskBaseInfo: l,
                                    emuleTaskInfo: i
                                })
                            }
                            null !== s && (n = s.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId))
                        } while (0);
                        return n
                    })
                }(e, i, t), l && a && (r = yield v.TaskOperatorNs.downloadAndPlay(l)), r
            })
        }

        function i(e, i) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e || !(yield c.FileSystemAWNS.existsAW(e))) break;
                    let n = yield c.FileSystemAWNS.readFileAW(e);
                    if (yield c.FileSystemAWNS.unlinkAW(e), null === n || void 0 === n || "" === n.toString()) {
                        w.information("parseUnionFileAndCreateTasks:读取内容 buf为null");
                        break
                    }
                    let a = n.toString(), o = (a += "\r\n").split("\r\n");
                    if (o.length <= 1) {
                        w.information("parseUnionFileAndCreateTasks:lines.length <= 1");
                        break
                    }
                    let r = new Map, s = new Map, l = new Map, d = [], u = [], h = [];
                    for (let e = 0; e < o.length; ++e) {
                        let t = o[e].split("=");
                        if (null !== t && 2 === t.length) {
                            let e = t[0].toLowerCase(), i = t[1];
                            if (null !== e && "" !== e) {
                                i = i.replace(/\+/g, "%20"), i = decodeURIComponent(i), w.information("parseUnionFileAndCreateTasks key, value:", e, i);
                                let t = e.match(/^tasks\[\d+\]/), n = "";
                                null !== t && void 0 !== t && (n = t[0]);
                                let a = /url/;
                                a.test(e) ? "" !== n ? r.set(n, i) : d.push(i) : (a = /referer/).test(e) ? "" !== n ? l.set(n, i) : h.push(i) : (a = /^tasks\[\d+\]\[name\]/).test(e) && ("" !== n ? s.set(n, i) : u.push(i))
                            }
                        }
                    }
                    w.information("parseUnionFileAndCreateTasks urlsInfo:", r);
                    let f = !1;
                    if (r.size > 0) for (let e of r) {
                        let n = e[0], a = e[1], o = void 0, r = l.get(n) || "";
                        null !== s && s.size > 0 && (o = s.get(n)), w.information("parseUnionFileAndCreateTasks name, url:", o, a), (f = yield t(a, o, r, !f && i)) && (i = !1)
                    }
                    if (w.information("parseUnionFileAndCreateTasks urllist:", d), d.length >= 1) for (let e = 0; e < d.length; ++e) w.information("parseUnionFileAndCreateTasks name, url:", u[e], d[e]), (f = yield t(d[e], u[e], h[e], !f && i)) && (i = !1)
                } while (0)
            })
        }

        function r(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = 0;
                do {
                    if (!e) break;
                    let n = yield p.TaskUtilitiesAWNS.parserBtFileInfoAW(e);
                    if (!n) break;
                    let a = {taskType: o.DownloadKernel.TaskType.Bt, value: n.infoId},
                        r = yield p.TaskUtilitiesAWNS.batchFindTaskAW([a]);
                    if (r && r[0]) {
                        i = r[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId), r[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.RecycleTime) > 0 && k.recoverFromRecycle(i);
                        break
                    }
                    let s = [];
                    for (let e = 0; e < n.fileLists.length; ++e) f.TaskUtilHelper.isVideoFileExt(n.fileLists[e].fileName) && s.push(n.fileLists[e].realIndex);
                    if (0 === s.length) break;
                    let l = n.trackerUrls.join("\n"), d = {
                        taskBaseInfo: {
                            savePath: yield g.client.callServerFunction("GetDownloadDir"),
                            taskName: t && "" !== t ? t : n.title
                        },
                        btTaskInfo: {
                            seedFile: e,
                            displayName: n.title,
                            fileRealIndexLists: s,
                            fileLists: n.fileLists,
                            infoId: n.infoId,
                            tracker: l
                        },
                        isBackground: !1
                    };
                    yield y();
                    let u = yield k.createTask(o.DownloadKernel.TaskType.Bt, d);
                    u && (i = u.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId))
                } while (0);
                return i
            })
        }

        function s(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = 0;
                {
                    let n = yield g.client.callServerFunction("GetDownloadDir"),
                        s = u.ParseUrlFileNameNS.parseMagnetUrl(e) + ".torrent", l = a.join(n, s), d = {
                            taskBaseInfo: {taskName: s, savePath: n},
                            magnetTaskInfo: {url: e, torrentFilePath: l},
                            isBackground: !0
                        };
                    yield y();
                    let h = yield k.createTask(o.DownloadKernel.TaskType.Magnet, d);
                    if (null !== h) {
                        let e = h.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        yield k.startTask(e), yield C(e, t)
                    }
                    (yield c.FileSystemAWNS.existsAW(l)) && (i = yield r(e, name))
                }
                return i
            })
        }

        function y() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    k.isLoadStorageTaskFinish() ? e() : l.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e()
                    })
                })
            })
        }

        function C(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = 0, n = !1;
                return new Promise(a => {
                    y().then(() => {
                        i = T.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                            do {
                                if (!t) break;
                                if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                                if (!t[1]) break;
                                let r = t[1];
                                for (let t = 0; t < r.length; ++t) {
                                    let s = r[t];
                                    if (!s) continue;
                                    let l = s.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                                    if (e === l) {
                                        s.getTaskStatus() === o.DownloadKernel.TaskStatus.Succeeded && (T.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, i), n || (n = !0, a(!0)));
                                        break
                                    }
                                }
                            } while (0)
                        })
                    }).catch(), t && setTimeout(() => {
                        n || (n = !0, a(!1))
                    }, t)
                })
            })
        }

        e.createUnionPlayTasks = function (e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e) break;
                    let n = e.indexOf("unionfile:");
                    n > -1 && (e = e.substring(n + 10)), yield i(decodeURIComponent(e), t)
                } while (0)
            })
        }, e.createDowndAndPlayTask = t
    }(t.DownloadAndPlayUnionNS || (t.DownloadAndPlayUnionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(6), o = i(57), r = i(3), s = i(15), l = i(4), d = i(5),
        u = s.DownloadKernelEventManager.getEventManager(), c = `${__profilesDir}/commonsites.json`, h = 3e4;

    class f {
        constructor() {
            this.inited = !1, this.needSave = !1, this.heartTimerId = void 0, this.allSites = {}, this.quitAttached = !1, this.commonly = void 0, this.allRefUrls = {}, this.allNameUrls = {}, this.searchKeywords = []
        }

        init() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.inited) break;
                    if (this.inited = !0, !(yield a.FileSystemAWNS.existsAW(c))) break;
                    let e = (yield a.FileSystemAWNS.readFileAW(c)).toString(), t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                    }
                    if (!t) break;
                    this.allSites = t.allSites || {}, this.allRefUrls = t.allRefUrls || {}, this.allNameUrls = t.allNameUrls || {}, this.searchKeywords = t.searchKeywords || [], this.filterSites(this.allSites), this.filterSites(this.allRefUrls), this.filterSites(this.allNameUrls), u.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskCreated, (...e) => {
                        do {
                            if (!e) break;
                            if (e[0] !== r.DownloadKernel.TaskEventType.TaskCreated) break;
                            let t = e[1];
                            if (!t) break;
                            for (let e of t) {
                                let t = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.RefUrl), i = e.getTaskName();
                                t && this.updateHost(t, this.allRefUrls), this.updateTaskName(i)
                            }
                            this.needSave = !0, this.save().catch()
                        } while (0)
                    })
                } while (0)
            })
        }

        save() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!this.needSave) break;
                    this.needSave = !1;
                    let e = {
                        allSites: this.allSites,
                        allNameUrls: this.allNameUrls,
                        allRefUrls: this.allRefUrls,
                        searchKeywords: this.searchKeywords
                    };
                    yield a.FileSystemAWNS.writeFileAW(c, JSON.stringify(e))
                } while (0)
            })
        }

        getMostCommonly() {
            return n(this, void 0, void 0, function* () {
                if (void 0 === this.commonly) {
                    yield this.init();
                    let e = Object.assign({}, this.allSites);
                    Object.values(this.allSites).forEach(t => {
                        t.name || delete e[t.url]
                    });
                    for (let t of Object.keys(this.allNameUrls)) e[t] && e[t].visit ? e[t].visit += this.allNameUrls[t].visit || 1 : e[t] = Object.assign({}, this.allNameUrls[t]);
                    for (let t of Object.keys(this.allRefUrls)) e[t] && e[t].visit ? e[t].visit += this.allRefUrls[t].visit || 1 : e[t] = Object.assign({}, this.allRefUrls[t]);
                    let t = Object.values(e);
                    t.sort((e, t) => e.visit !== t.visit ? t.visit - e.visit : t.date && e.date ? t.date - e.date : 0);
                    let i = yield d.client.callServerFunction("GetRemoteGlobalConfigValue", "search", "commonWebSiteFilterNum", 3);
                    "number" != typeof i && (i = 3), this.commonly = t.filter(e => {
                        let t = !0;
                        do {
                            if (!e.url) {
                                t = !1;
                                break
                            }
                            if (e.visit < i) {
                                t = !1;
                                break
                            }
                            if (-1 !== e.url.indexOf("xunlei.com")) {
                                t = -1 !== e.url.indexOf("movie.xunlei.com") || -1 !== e.url.indexOf("live.xunlei.com") || -1 !== e.url.indexOf("www.xunlei.com") || -1 !== e.url.indexOf("yingshiku.xunlei.com");
                                break
                            }
                            if (-1 !== e.url.indexOf("www.baidu.com")) {
                                t = !1;
                                break
                            }
                        } while (0);
                        return t
                    }), this.commonly.length > 6 && (this.commonly = this.commonly.slice(0, 6))
                }
                return this.commonly
            })
        }

        updateItem(e, t) {
            return n(this, void 0, void 0, function* () {
                if (-1 !== e.url.indexOf("xunlei.com")) {
                    if (-1 === e.url.indexOf("movie.xunlei.com") && -1 === e.url.indexOf("live.xunlei.com") && -1 === e.url.indexOf("www.xunlei.com") && -1 === e.url.indexOf("yingshiku.xunlei.com")) return
                } else if (-1 !== e.url.indexOf("www.baidu.com")) return;
                yield this.init();
                let i = this.allSites[e.url];
                ("OnAddressChange" === t || i) && (i ? ("OnAddressChange" === t && (e.visit = i.visit + 1, e.date = (new Date).getTime(), this.updateHost(e.url, this.allSites)), this.allSites[i.url] = Object.assign({}, i, e)) : (e.visit = 1, e.date = (new Date).getTime(), this.updateHost(e.url, this.allSites), this.allSites[e.url] = e), this.needSave = !0, void 0 === this.heartTimerId && (this.heartTimerId = setTimeout(() => n(this, void 0, void 0, function* () {
                    clearTimeout(this.heartTimerId), this.heartTimerId = void 0, yield this.save()
                }), h)), this.quitAttached || (this.quitAttached = !0, o.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                    this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0), yield this.save(), e(!0)
                })))))
            })
        }

        clear() {
            return n(this, void 0, void 0, function* () {
                yield a.FileSystemAWNS.unlinkAW(c), this.allSites = {}, this.allRefUrls = {}, this.allNameUrls = {}, this.commonly = [], this.needSave = !1, this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0)
            })
        }

        delete(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e) break;
                    if (delete this.allSites[e], delete this.allNameUrls[e], delete this.allRefUrls[e], !this.commonly || 0 === this.commonly.length) break;
                    for (let t = 0; t < this.commonly.length; t++) if (this.commonly[t].url === e) {
                        this.commonly.splice(t, 1);
                        break
                    }
                    this.needSave = !0, yield this.save()
                } while (0)
            })
        }

        filterSites(e) {
            let t = (new Date).getTime();
            if (Object.values(e).length < 100) return;
            let i = Object.values(e).sort((e, t) => l.isNullOrUndefined(e.visit) || l.isNullOrUndefined(t.visit) || e.visit === t.visit ? l.isNullOrUndefined(e.date) || l.isNullOrUndefined(t.date) ? void 0 : e.date - t.date : e.visit - t.visit);
            for (let n = 100; n < i.length; n++) {
                let a = i[n];
                a.date ? t - a.date > 2592e6 && delete e[a.url] : a.date = (new Date).getTime()
            }
        }

        getHost(e) {
            let t = "";
            do {
                if (!e) break;
                if (!(e = e.split("://")[1])) break;
                let i = e.split("/")[0];
                if (i === e) break;
                t = i
            } while (0);
            return t
        }

        updateHost(e, t) {
            let i = this.getHost(e);
            if (!i) return;
            let n = t[i];
            if (n) n.visit += 1, n.date = (new Date).getTime(); else {
                let e = {url: i, visit: 1, date: (new Date).getTime()};
                t[i] = e
            }
        }

        updateTaskName(e) {
            let t = new RegExp(/w{3}\.[\w|-]+(\.com.cn|\.net.cn|\.org.cn|\.edu\.cn|\.gov\.cn|\.com|\.net|\.cn|\.cc|\.tv|\.uk|\.jp|\.org|\.biz|\.edu|\.gov|\.mil|\.fr|\.au|\.de)/gi),
                i = e.match(t);
            if (!i) return;
            let n = i[0], a = this.allNameUrls[n];
            if (a) a.visit += 1, a.date = (new Date).getTime(); else {
                let e = {url: n, visit: 1, date: (new Date).getTime()};
                this.allNameUrls[n] = e
            }
        }

        getLatestSearchKeywords() {
            return this.searchKeywords
        }

        addSearchKeyword(e) {
            if ((l.isNullOrUndefined(e.keyword) || "" !== e.keyword) && (l.isNullOrUndefined(e.url) || "" !== e.url)) {
                if (this.searchKeywords) {
                    if (e.url && e.url.includes("://") && (e.url = e.url.split("://")[1]), this.searchKeywords.some(t => void 0 !== e.keyword && t.keyword === e.keyword || void 0 !== e.url && t.url === e.url)) return;
                    this.searchKeywords.splice(0, 0, e), this.searchKeywords.length > 20 && this.searchKeywords.pop(), this.needSave = !0
                }
                this.save().catch()
            }
        }

        deleteSearchKeyword(e) {
            this.searchKeywords && (this.searchKeywords.splice(e, 1), this.needSave = !0), this.save().catch()
        }

        clearSearchKeyword() {
            this.searchKeywords = [], this.needSave = !0, this.save().catch()
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(62), o = i(0).default.getLogger("community");
    t.getUnreadMsgNum = function (e) {
        return a.fetchSlRes({url: "/xlppc.notification.api/v2/msg/unread", data: {}})
    }, t.getUnreadNoticeNum = function (e) {
        return a.fetchSlRes({url: "/msgcenter/pc/unread_count", data: {_h: {"Chat-Version": 4}, user_id: e}})
    }, t.getUnreadCircleMsgNum = function (e) {
        return n(this, void 0, void 0, function* () {
            return a.fetchSlRes({url: "/xlppc.notification.api/msg/unread", data: {}})
        })
    }, t.getVideoPreviewInfo = function (e, t, i, o) {
        return n(this, void 0, void 0, function* () {
            let n = {type: e, res: t};
            return i && (n.index = i), a.fetchSlRes({
                url: "/xlppc.resinfo.api/v3/queryresinfo",
                data: n,
                method: "post"
            })
        })
    }, t.isResourceLegal = function (e, t, i) {
        return n(this, void 0, void 0, function* () {
            if (!i || !t) return !1;
            if (i.length <= 0 || t.length <= 0) return !1;
            let n = yield a.fetchRequest({
                url: "http://client.filter.hub.sandai.net/filter_task?type=" + t + "&from=" + i,
                data: e,
                method: "post"
            });
            if (o.information("isResourceLegal:,res", n), !n || !n.data) return !1;
            let r = !1;
            do {
                if ("string" == typeof n.data) try {
                    n.data = JSON.parse(n.data)
                } catch (e) {
                    r = !1;
                    break
                }
                "bt" === t ? r = 0 === n.data.ret_code || 1 === n.data.ret_code || 2 === n.data.ret_code : 1 === n.data.ret_code ? r = !0 : 0 === n.data.ret_code ? n.data.result && n.data.result[0] && 0 === n.data.result[0].ret_code && (r = !0) : r = !1
            } while (0);
            return r
        })
    }, t.getUnreadMsgs = function (e, t, i, n) {
        return a.fetchSlRes({
            url: "/xlppc.notification.api/v2/msg/comments",
            data: {reset_read_status: t, cursor: i || 0, size: n || 0}
        })
    }, t.getStarsMsg = function (e, t, i, n) {
        return a.fetchSlRes({
            url: "/xlppc.notification.api/v2/msg/stars",
            data: {reset_read_status: t, cursor: i, size: n}
        })
    }, t.getUserInfo = function (e) {
        return a.fetchSlRes({url: "/user_info/pc_info", data: {uid: e}})
    }, t.getUserSessionList = function (e, t = 60) {
        return a.fetchSlRes({url: "/chitchat/sessions", data: {uid: e, limit: t}})
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4), o = i(0), r = i(6), s = i(57), l = o.default.getLogger("History");
    let d = 3e3, u = 18e4, c = 15;
    const h = `${__profilesDir}/historys.json`;
    let f = new class {
        constructor() {
            this.inited = !1, this.heartTimerId = void 0, this.count = 0, this.needSave = !1, this.quitAttached = !1, this.records = {}, this.historys = {}
        }

        get length() {
            return this.count
        }

        getDayString(e) {
            let t = "";
            do {
                if (!e) break;
                let i = new Date(e);
                t = a.format("%d/%d/%d", i.getFullYear(), i.getMonth() + 1, i.getDate())
            } while (0);
            return t
        }

        isOverLongDays(e) {
            let t = !1, i = new Date(e), n = new Date(i.getFullYear(), i.getMonth(), i.getDate(), 0, 0, 0),
                a = new Date;
            return new Date(a.getFullYear(), a.getMonth(), a.getDate(), 0, 0, 0).getTime() - n.getTime() > 24 * (c - 1) * 60 * 60 * 1e3 && (t = !0), t
        }

        init() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.inited) break;
                    if (this.inited = !0, !(yield r.FileSystemAWNS.existsAW(h))) break;
                    let e = (yield r.FileSystemAWNS.readFileAW(h)).toString(), t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                    }
                    if (!t) break;
                    this.records = t;
                    for (let e in this.records) {
                        let t = this.records[e];
                        if (t.visits) for (let i = 0; i < t.visits.length;) {
                            let n = t.visits[i];
                            if (this.isOverLongDays(n)) {
                                l.information("history is longlong ago", e, n), t.visits.splice(0, 1), 0 === t.visits.length && delete this.records[e];
                                continue
                            }
                            let a = this.getDayString(n), o = `${e}_${a}`;
                            this.historys.hasOwnProperty(o) ? l.warning("daily url exist", this.historys[o].url, this.historys[o].accessTime) : this.count++, this.historys[o] = {
                                url: e,
                                accessTime: n,
                                name: t.name,
                                iconUrl: t.iconUrl,
                                date: a
                            }, i++
                        }
                    }
                } while (0)
            })
        }

        getAllHistory(e = !1) {
            let t = Object.values(this.historys);
            return t.sort((e, t) => t.accessTime - e.accessTime), e && t.length > 0 && (t = t.map(e => (this.records && this.records[e.url] && (e.iconUrl || (e.iconUrl = this.records[e.url].iconUrl), e.name || (e.name = this.records[e.url].name)), e))), t
        }

        stopSaveTimer() {
            this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0)
        }

        startSaveTimer() {
            void 0 === this.heartTimerId && (this.heartTimerId = setTimeout(() => n(this, void 0, void 0, function* () {
                clearTimeout(this.heartTimerId), this.heartTimerId = void 0, yield this.save()
            }), u)), this.quitAttached || (this.quitAttached = !0, s.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                this.stopSaveTimer(), yield this.save(), e(!0)
            }))))
        }

        save() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!this.needSave) {
                        l.information("save but flag is false");
                        break
                    }
                    if (this.needSave = !1, yield this.init(), this.count > d) {
                        let e = this.getAllHistory();
                        if (this.count !== e.length && l.warning("exception on save count not match historys length"), e.length > d) for (let t = d; t < e.length; t++) {
                            let i = e[t], n = this.records[i.url];
                            if (n && i) {
                                let e = n.visits.indexOf(i.accessTime);
                                -1 !== e && n.visits.splice(e, 1), 0 === n.visits.length && delete this.records[i.url];
                                let t = `${i.url}_${this.getDayString(i.accessTime)}`;
                                delete this.historys[t]
                            }
                        }
                    }
                    yield r.FileSystemAWNS.writeFileAW(h, JSON.stringify(this.records))
                } while (0)
            })
        }

        getRecentHistory() {
            return n(this, void 0, void 0, function* () {
                let e = [];
                yield this.init();
                let t = this.getAllHistory(!0);
                return e = t.length > d ? t.slice(0, d) : t
            })
        }

        clear() {
            return n(this, void 0, void 0, function* () {
                yield r.FileSystemAWNS.unlinkAW(h), this.records = {}, this.historys = {}, this.needSave = !1, this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0)
            })
        }

        delete(e) {
            return n(this, void 0, void 0, function* () {
                let t = this.records[e.url];
                if (t) {
                    let i = t.visits.indexOf(e.accessTime);
                    -1 !== i && (t.visits.splice(i, 1), this.needSave = !0, this.startSaveTimer()), 0 === t.visits.length && delete this.records[e.url]
                }
                let i = `${e.url}_${this.getDayString(e.accessTime)}`;
                delete this.historys[i]
            })
        }

        update(e, t) {
            return n(this, void 0, void 0, function* () {
                yield this.init();
                do {
                    if (!e.url) {
                        l.warning("update history exception url is null");
                        break
                    }
                    let i = (new Date).getTime(), n = this.getDayString(i), a = `${e.url}_${n}`,
                        o = this.records[e.url];
                    if (o) {
                        if ("OnAddressChange" === t) {
                            o.visitCount = o.visitCount + 1, o.lastAccessTime = i;
                            let t = this.historys[a];
                            if (t) {
                                let e = o.visits.indexOf(t.accessTime);
                                -1 !== e && (l.information("delete earlier this day", t.accessTime, i), o.visits.splice(e, 1), o.visits.push(i)), t.accessTime = i
                            } else o.visits.push(i), this.historys[a] = Object.assign({
                                accessTime: i,
                                date: n
                            }, e), this.count++
                        } else {
                            let t = this.historys[a];
                            t ? this.historys[a] = Object.assign({}, t, e) : l.warning("update exception")
                        }
                        e.iconUrl && (o.iconUrl = e.iconUrl), e.name && (o.name = e.name)
                    } else {
                        if ("OnAddressChange" !== t) {
                            l.warning("try to update history but never OnAddressChange");
                            break
                        }
                        this.records[e.url] = {
                            lastAccessTime: i,
                            visits: [i],
                            visitCount: 1,
                            iconUrl: e.iconUrl,
                            name: e.name
                        }, this.historys[a] = Object.assign({accessTime: i, date: n}, e), this.count++
                    }
                    this.needSave = !0, this.startSaveTimer()
                } while (0)
            })
        }

        search(e) {
            return n(this, void 0, void 0, function* () {
                if (yield this.init(), !this.records || 0 === Object.keys(this.records).length) return [];
                let t = [], i = Object.values(this.historys).sort((e, t) => e.accessTime - t.accessTime),
                    n = e.split(" ");
                for (let e = 0; e < i.length; e++) {
                    let a = !0;
                    for (let t = 0; t < n.length; t++) if (!(i[e].url.includes(n[t]) || i[e].name && i[e].name.includes(n[t]))) {
                        a = !1;
                        break
                    }
                    if (a && (t.push(i[e]), t.length >= 2)) return t
                }
                return t
            })
        }
    };
    t.historyManager = f
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(9), o = i(76), r = i(2), s = i(596), l = r.join(__rootDir, "../../download-complete.wav");
    !function (e) {
        function t(t, i) {
            let n;
            for (let a = 0; a < e.conf.sechema.length; ++a) if ((n = e.conf.sechema[a]).name === t) {
                if (!n.children) break;
                for (let t = 0; t < n.children.length; t++) if (n.children[t].name === i) {
                    n.children.splice(t, 1), e.conf.sechema[a] = n;
                    break
                }
                break
            }
        }

        function i(t, i, n) {
            let a;
            for (let o = 0; o < e.conf.sechema.length; ++o) if ((a = e.conf.sechema[o]).name === t) {
                if (!a.children) break;
                let t = a.children.length;
                for (let r = 0; r < t; r++) if (a.children[r].name === n) {
                    r === t - 1 ? a.children.push(i) : a.children.splice(r + 1 > t - 1 ? t - 1 : r + 1, 0, i), e.conf.sechema[o] = a;
                    break
                }
                break
            }
        }

        function d(t, i) {
            let n, a = !1;
            for (let o = 0; o < e.conf.sechema.length; ++o) if ((n = e.conf.sechema[o]).name === t) {
                if (!n.children) break;
                let e = n.children.length;
                for (let t = 0; t < e; t++) if (n.children[t].name === i) {
                    a = !0;
                    break
                }
                break
            }
            return a
        }

        e.conf = {
            sechema: [{
                name: "基本设置",
                children: [{
                    name: "ConfigNormalSession-ConfigNormal_AutoRun",
                    type: "confCheckbox",
                    label: "开机启动迅雷",
                    classes: ""
                }, {
                    name: "Others-AntiDisturb",
                    type: "confCheckbox",
                    label: "开启免打扰模式",
                    classes: "",
                    extEles: [{
                        type: "confTip",
                        classes: "xly-icon-help",
                        text: "免打扰模式下，当您运行全屏程序时，迅雷将\n自动帮您取消提示消息弹出，避免打扰您的其\n它体验。",
                        value: ""
                    }]
                }, {
                    name: "BossKey-BossKeySwitch",
                    type: "confCheckboxInput",
                    label: "启用老板键",
                    styles: "display: flex; align-items: center;",
                    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: "xly-input-size-1",
                        ShortcutKey: !0,
                        style: "padding-right: 3px"
                    }, {type: "confTip", text: "如果老板来了，按老板键，迅雷将自动隐身", classes: "xly-icon-help"}]
                }, {
                    name: "TaskDefaultSettings-NewTaskDlgWithoutMainWnd",
                    type: "confCheckbox",
                    label: "新建任务时显示主界面"
                }, {
                    name: "TaskDefaultSettings-downloadModel",
                    text: "下载模式",
                    type: "confText",
                    ulClasses: "xly-setting-content__vertical",
                    children: [{
                        name: "ConfigNet-ConfigNet_Type",
                        type: "confRadio",
                        label: "全速下载",
                        extEles: [{
                            type: "confTip",
                            text: "p2sp下载完的文件会通过p2p的方式上传分享，\n帮助其它网友加速下载，绝不会涉及任何用户隐\n私。下载和分享是通过智能带宽控制的技术，不\n会影响您的上网体验，请放心使用。",
                            classes: "xly-icon-help"
                        }, {
                            type: "confBtn",
                            text: "修改配置",
                            classes: "td-button--small td-button--other",
                            outerClass: "inline",
                            boxType: "speedConfBox",
                            extEles: [{type: "confSpeedText", classes: "xly-setting-content__description inline"}]
                        }],
                        extActiveValue: "0",
                        labels: ["全速下载", "限速下载"],
                        option: ["1", "0"]
                    }]
                }]
            }, {
                name: "云盘设置",
                classes: "xly-setting-cloud",
                children: [{
                    label: "云盘下载目录",
                    type: "confText",
                    text: "云盘下载目录",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex;",
                    children: [{
                        name: "ThunderPanPlugin-defaultSavePath",
                        type: "confSelect",
                        label: "",
                        optionByName: "ThunderPanPlugin-savePaths",
                        liClasses: "td-select xly-select-setting",
                        slotOption: "openThunderPan",
                        editable: !1,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史云盘下载目录",
                        maxOptionLen: 5,
                        blurUpdate: !0
                    }, {
                        name: "ThunderPanPlugin-lastUsePath",
                        type: "confCheckbox",
                        label: "自动修改为上次使用的目录",
                        linkItem: {
                            section: "ThunderPanPlugin",
                            key: "lastUsePath",
                            name: "ThunderPanPlugin-defaultSavePath"
                        }
                    }]
                }, {
                    label: "取回本地目录",
                    type: "confText",
                    text: "取回本地目录",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex;",
                    children: [{
                        name: "ThunderPanPlugin-defaultDownloadPath",
                        type: "confSelect",
                        label: "",
                        optionByName: "ThunderPanPlugin-downloadPaths",
                        liClasses: "td-select xly-select-setting",
                        slotOption: "openDirectory",
                        editable: !0,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史取回目录",
                        maxOptionLen: 5,
                        blurUpdate: !0,
                        rules: [["rule, value, callback", "let errors = [];\n                    do {\n                      let dir = '';\n                      let ip = '';\n                      if (/^[c-zC-Z]:\\\\/.test(value)) {\n                        dir = value.slice(3);\n                      } else {\n                        if (value.indexOf('\\\\\\\\') === 0) {\n                          let index = value.indexOf('\\\\', 2);\n                          if (index === -1 || index === value.length - 1) {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                          dir = value.slice(2);\n                          ip = dir.substr(0, index - 2);\n                          if (ip === '') {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                        } else {\n                          errors.push(new Error('不合法的存储路径'));\n                          break;\n                        }\n                      }\n                      if (/[\\*\\\"<>\\?:\\|]/i.test(dir)) {\n                        errors.push(new Error('下载目录名称不能包含下列任何字符：:|* ?“<>'));\n                        break;\n                      }\n                      if (value.length > 256) {\n                        errors.push(new Error('您输入的下载目录路径长度超过系统限制，请控制在256个字符以内'));\n                        break;\n                      }\n                      if (ip === '') {\n                        break;\n                      }\n                      let index = ip.indexOf('.ipv6-literal.net');\n                      if (index !== -1) {\n                        ip = ip.substr(0, index);\n                        index = ip.indexOf('%');\n                        if (index !== -1) {\n                          ip = ip.substr(0, index);\n                        }\n                        ip = ip.replace(/\\-/g, ':');\n                        if (!/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/.test(ip)) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      } else {\n                        if (\n                          !/(?=(\\b|\\D))(((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))\\.){3}((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))(?=(\\b|\\D))/.test(\n                            ip\n                          )\n                        ) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      }\n                    } while (false);\n                    callback(errors);"]]
                    }, {
                        name: "ThunderPanPlugin-useDefault",
                        type: "confCheckbox",
                        label: "取回时不再询问",
                        linkItem: {
                            section: "ThunderPanPlugin",
                            key: "defaultDownloadPath",
                            name: "ThunderPanPlugin-defaultDownloadPath"
                        }
                    }]
                }, {
                    label: "同时上传任务数",
                    type: "confText",
                    text: "同时上传任务数",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex; align-items: center;",
                    children: [{
                        name: "ThunderPanPlugin-MaxUploadTaskNum",
                        type: "confSelect",
                        label: "",
                        classes: "xly-select-size-1",
                        option: ["1", "2", "3", "4", "5"]
                    }]
                }, {
                    label: "同时取回任务数",
                    type: "confText",
                    text: "同时取回任务数",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex; align-items: center;",
                    children: [{
                        name: "ThunderPanPlugin-MaxDownloadTaskNum",
                        type: "confSelect",
                        label: "",
                        classes: "xly-select-size-1",
                        option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
                    }]
                }, {
                    name: "ThunderPanPlugin-StartCloudStopDownload",
                    type: "confCheckbox",
                    outerClass: "xly-setting-content__item xly-setting-content__title",
                    label: "开始云播时自动暂停下载和取回"
                }, {
                    name: "ThunderPanPlugin-SetVODCachePath",
                    type: "confCheckbox",
                    outerClass: "xly-setting-content__item xly-setting-content__title",
                    label: "开启智能缓存，改善云盘视频播放体验"
                }]
            }, {
                name: "接管设置",
                children: [{
                    name: "Monitor-MonitorClipBoard",
                    type: "confCheckbox",
                    label: "接管剪切板"
                }, {
                    name: "Motitor-MotitorAll",
                    type: "confCheckbox",
                    label: "接管所有浏览器",
                    ulClasses: "xly-setting-content__horizontal",
                    children: []
                }, {
                    name: "",
                    type: "confText",
                    text: "接管下载类型",
                    value: "xly-setting-content__text",
                    ulClasses: "xly-setting-content__horizontal",
                    children: [{
                        name: "Monitor-WatchTraditionLink",
                        type: "confCheckbox",
                        label: "传统下载",
                        option: []
                    }, {
                        name: "Monitor-ConfigWatch_Bt",
                        type: "confCheckbox",
                        label: "BT下载"
                    }, {
                        name: "EMuleGenericSettings-EMuleWatchLink",
                        type: "confCheckbox",
                        label: "eMule下载",
                        option: []
                    }, {name: "MagnetGenericSettings-MagnetWatchLink", type: "confCheckbox", label: "磁力链接下载"}]
                }, {
                    name: "",
                    text: "下载文件拓展名",
                    type: "confText",
                    liStyles: "display: flex; align-items: center;",
                    classes: "xly-setting-content__title",
                    children: [{
                        type: "confBtn",
                        label: "下载文件拓展名",
                        listEles: [{
                            text: "点击编辑",
                            bindName: "Monitor-WatchTraditionLink",
                            classes: "td-button td-button--small td-button--other",
                            boxType: "pop",
                            pop: {
                                title: "编辑下载文件扩展名",
                                maximizable: !1,
                                schema: [{
                                    type: "confText",
                                    classes: "xly-dialog-setting__tips",
                                    text: " 您可以编辑传统下载中的下载文件扩展名："
                                }, {type: "confTextarea", name: "Monitor-ExtendNames"}],
                                formData: {
                                    "Monitor-ExtendNames": {
                                        section: "Monitor",
                                        key: "ExtendNames",
                                        value: o.BHOConfigNS.getDefaultExtendNames()
                                    }
                                }
                            }
                        }]
                    }]
                }]
            }, {
                name: "下载设置",
                classes: "xly-setting-down",
                children: [{
                    name: "TaskDefaultSettings-OpenSilenceDownload",
                    type: "confCheckbox",
                    label: "一键下载",
                    extEles: [{
                        type: "confTip",
                        text: '"一键下载" 生效时,点击下载链接将直接建立下载任务,不会弹出新建任务面板',
                        classes: "xly-icon-help"
                    }]
                }, {
                    label: "下载目录",
                    type: "confText",
                    text: "下载目录",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    children: [{
                        name: "TaskDefaultSettings-DefaultPath",
                        type: "confSelect",
                        label: "",
                        optionByName: "PathAndCategory-historyDownloadPaths",
                        liClasses: "td-select xly-select-setting",
                        slotOption: "openDirectory",
                        editable: !0,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史下载目录",
                        maxOptionLen: 5,
                        blurUpdate: !0,
                        rules: [["rule, value, callback", "let errors = [];\n                    do {\n                      let dir = '';\n                      let ip = '';\n                      if (/^[c-zC-Z]:\\\\/.test(value)) {\n                        dir = value.slice(3);\n                      } else {\n                        if (value.indexOf('\\\\\\\\') === 0) {\n                          let index = value.indexOf('\\\\', 2);\n                          if (index === -1 || index === value.length - 1) {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                          dir = value.slice(2);\n                          ip = dir.substr(0, index - 2);\n                          if (ip === '') {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                        } else {\n                          errors.push(new Error('不合法的存储路径'));\n                          break;\n                        }\n                      }\n                      if (/[\\*\\\"<>\\?:\\|]/i.test(dir)) {\n                        errors.push(new Error('下载目录名称不能包含下列任何字符：:|* ?“<>'));\n                        break;\n                      }\n                      if (value.length > 256) {\n                        errors.push(new Error('您输入的下载目录路径长度超过系统限制，请控制在256个字符以内'));\n                        break;\n                      }\n                      if (ip === '') {\n                        break;\n                      }\n                      let index = ip.indexOf('.ipv6-literal.net');\n                      if (index !== -1) {\n                        ip = ip.substr(0, index);\n                        index = ip.indexOf('%');\n                        if (index !== -1) {\n                          ip = ip.substr(0, index);\n                        }\n                        ip = ip.replace(/\\-/g, ':');\n                        if (!/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/.test(ip)) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      } else {\n                        if (\n                          !/(?=(\\b|\\D))(((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))\\.){3}((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))(?=(\\b|\\D))/.test(\n                            ip\n                          )\n                        ) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      }\n                    } while (false);\n                    callback(errors);"]]
                    }, {
                        name: "TaskDefaultSettings-UseLastCatalog",
                        type: "confCheckbox",
                        label: "自动修改为上次使用的目录",
                        linkItem: {
                            section: "PathAndCategory",
                            key: "LastUsedPath",
                            name: "TaskDefaultSettings-DefaultPath"
                        }
                    }]
                }, {
                    name: "TaskDefaultSettings-OrignHostThreads",
                    type: "confSelect",
                    label: "原始地址线程数",
                    classes: "xly-select-size-1",
                    outerClass: "xly-setting-content__inline",
                    option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
                }, {
                    name: "TaskDefaultSettings-MaxResourceLimit",
                    type: "confCheckboxInput",
                    label: "限制全局最大同时下载资源数",
                    styles: "display: flex; align-items: center;",
                    extEles: [{
                        type: "confInput",
                        name: "TaskDefaultSettings-MaxResourceCount",
                        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: "xly-select-size-2"
                    }, {
                        type: "confTip",
                        text: "如果您在使用迅雷下载时，发现网络响应变慢或掉线等情况。\n这可能是由于您的路由器性能难以支撑较大的同时下载资源\n数。您可以尝试降低此项数值，从而降低路由器的负载。建\n议您在保持网络稳定的前提下，让此项数值尽可能的大",
                        classes: "xly-icon-help"
                    }]
                }, {
                    name: "TaskDefaultSettings-AwayModeEnabled",
                    type: "confCheckbox",
                    label: '启用"离开模式"',
                    extEles: [{
                        type: "confTip",
                        text: "启用“离开模式”后，在电脑处于“睡眠”状态时，\n迅雷仍然能帮您继续下载资源",
                        classes: "xly-icon-help"
                    }]
                }]
            }, {
                name: "任务管理",
                classes: "xly-setting-content__vertical",
                children: [{
                    name: "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask",
                    type: "confCheckbox",
                    label: "启动迅雷后自动开始未完成任务"
                }, {
                    name: "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount",
                    type: "confSelect",
                    label: "同时下载的最大任务数",
                    classes: "xly-select-size-1",
                    outerClass: "xly-setting-content__inline",
                    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: "ConfigNormalSession-ConfigNormal_AutoSlowTask2Tail",
                    type: "confCheckbox",
                    label: "自动将低速任务移动至列尾"
                }, {
                    name: "ConfigNoLimitDownload-TaskCountAutoAdd",
                    type: "confCheckboxInput",
                    label: "全局下载速度低于",
                    styles: "display: flex; align-items: center;",
                    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: "xly-input-size-1"
                    }, {
                        type: "confText",
                        classes: "xly-input-size",
                        text: " KB/s自动增加同时下载任务数",
                        style: "padding-right: 3px"
                    }, {
                        type: "confTip",
                        text: "当您使用迅雷进行排队下载时，开启本选项能够尽量\n充分利用您的网络带宽进行下载。本选项合理的设定\n值应为您的网络带宽最大下载速度的80%。假设您最\n大下载速度曾达到1000KB/s，则此项合理的设定值\n应为800KB/s。",
                        classes: "xly-icon-help"
                    }]
                }, {
                    name: "ConfigNoLimitDownload-OpenNoLimitDownload",
                    type: "confCheckboxSelect",
                    label: "优先下载小于",
                    extEles: [{
                        type: "confSelect",
                        classes: "xly-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: "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile",
                    type: "confCheckbox",
                    label: "自动删除“文件不存在”的任务"
                }, {name: "TaskDefaultSettings-OpenFile", type: "confCheckbox", label: "下载完成后自动打开"}]
            }, {
                name: "提醒",
                children: [{
                    name: "ConfigMsg-ConfigMsg_Finish",
                    type: "confCheckbox",
                    label: "下载完成时右下角弹窗提示"
                }, {
                    name: "ConfigMsg-ConfigMsg_FailSuggest",
                    type: "confCheckbox",
                    label: "下载失败时右下角弹窗提示"
                }, {
                    name: "ConfigMsg-ConfigMsg_PlayWaveWhileFinish",
                    type: "confCheckbox",
                    label: "下载完成后播放提示音"
                }, {
                    type: "confSelect",
                    name: "ConfigMsg-ConfigMsg_WavePath",
                    classes: "xly-select-setting--normal td-select xly-select-setting",
                    slotOption: "openFile",
                    outerClass: "td-checkbox",
                    editable: !0
                }, {name: "UserCommunitySet-radio_id_", type: "confCheckbox", label: "接收消息通知", isReleventUser: !0}]
            }, {
                name: "悬浮窗",
                classes: "xly-setting-content__vertical",
                children: [{
                    name: "ConfigFloatPanel-FloatPanelValue",
                    type: "confRadio",
                    label: "显示悬浮窗",
                    option: ["0", "1", "2"],
                    labels: ["显示悬浮窗", "下载时显示悬浮窗", "隐藏悬浮窗"],
                    ulClasses: "xly-setting-content__vertical"
                }]
            }, {
                name: "高级设置",
                classes: "xly-setting-content xly-setting-advanced",
                children: [{
                    name: "",
                    type: "confText",
                    ulClasses: "xly-setting-content__indentation",
                    text: "BT下载",
                    children: [{
                        name: "BtGenericSettings-AutoBTNewTask",
                        type: "confCheckbox",
                        label: "下载种子文件后自动打开新建面板"
                    }, {name: "BtGenericSettings-AssocTorrent", type: "confCheckbox", label: "启动时关联BT种子文件(.torrent文件)"}]
                }, {
                    name: "",
                    text: "下载磁盘缓存",
                    type: "confText",
                    tip: "磁盘缓存越大，下载速度越快，占用资源越多",
                    tipClass: "xly-setting-content__description",
                    children: [{
                        name: "DiskCache-DiskCacheSelect",
                        type: "confRadio",
                        label: "256",
                        ulClasses: "xly-setting-content__horizontal",
                        option: ["128", "256", "512"],
                        labels: ["128M", "256M", "512M"]
                    }]
                }, {
                    label: "下载加速",
                    text: "下载加速",
                    type: "confText",
                    ulClasses: "xly-setting-content__indentation xly-setting-content__break",
                    children: [{
                        name: "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启镜像服务器加速"
                    }, {
                        name: "",
                        text: "全网数据挖掘，自动匹配与原始资源相同的镜像供用户下载",
                        label: "",
                        type: "confText",
                        classes: "xly-setting-content__description"
                    }, {
                        name: "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启迅雷P2P加速"
                    }, {
                        name: "",
                        label: "",
                        text: "利用P2P技术进行用户间加速，该通道产生的上传流量会慢慢提升通道的健康度，从而提升通道加速效果",
                        type: "confText",
                        classes: "xly-setting-content__description"
                    }]
                }, {
                    text: "下载代理设置",
                    ulClasses: "xly-setting-content__vertical",
                    type: "confText",
                    tip: "该设置仅对下载生效，对网页浏览无效",
                    tipClass: "xly-setting-content__description",
                    children: [{
                        name: "ProxySetting-ConfigProxy_Type",
                        type: "confRadio",
                        ulClasses: "xly-setting-content__part",
                        extEles: [{type: "", label: " "}, {type: "", label: " "}, {
                            type: "confContainer",
                            label: "",
                            ulClasses: "xly-setting-advanced__config",
                            extEles: [{
                                name: "ProxySetting-ConnectType_Hub",
                                type: "confSelect",
                                label: "迅雷服务器连接",
                                classes: "xly-select-size-2 xly-setting-advanced__box",
                                updateByDataChange: !0,
                                optionByName: "ConnectType-ProxyName"
                            }, {
                                name: "ProxySetting-ConnectType_Http",
                                type: "confSelect",
                                label: "HTTP连接",
                                classes: "xly-select-size-2",
                                updateByDataChange: !0,
                                optionByName: "ConnectType-ProxyName"
                            }, {
                                name: "ProxySetting-ConnectType_Ftp",
                                type: "confSelect",
                                label: "FTP连接",
                                classes: "xly-select-size-2",
                                updateByDataChange: !0,
                                optionByName: "ConnectType-ProxyName"
                            }]
                        }],
                        extActiveValue: "2",
                        labels: ["不使用代理服务器", "使用IE代理服务器", "使用自定义代理服务器"],
                        option: ["0", "1", "2"]
                    }, {name: "", type: "confProxyList"}]
                }, {
                    text: "下载完成视频播放关联",
                    ulClasses: "xly-setting-content__vertical",
                    type: "confText",
                    tip: "该设置仅对下载完成的视频生效",
                    tipClass: "xly-setting-content__description",
                    children: [{
                        name: "CompletedTaskPlay-LanuchMediaPlayer",
                        type: "confRadio",
                        ulClasses: "xly-setting-content__part",
                        labels: ["播放组件", "迅雷影音", "系统默认"],
                        option: ["0", "1", "2"]
                    }]
                }]
            }], formData: {
                "ThunderPanPlugin-MaxUploadTaskNum": {section: "ThunderPanPlugin", key: "MaxUploadTaskNum", value: 2},
                "ThunderPanPlugin-MaxDownloadTaskNum": {
                    section: "ThunderPanPlugin",
                    key: "MaxDownloadTaskNum",
                    value: 5
                },
                "ThunderPanPlugin-defaultDownloadPath": {
                    section: "ThunderPanPlugin",
                    key: "defaultDownloadPath",
                    value: "C:\\迅雷下载"
                },
                "ThunderPanPlugin-downloadPaths": {section: "ThunderPanPlugin", key: "downloadPaths", value: []},
                "ThunderPanPlugin-useDefault": {section: "ThunderPanPlugin", key: "useDefault", value: !1},
                "ThunderPanPlugin-lastUsePath": {section: "ThunderPanPlugin", key: "lastUsePath", value: !1},
                "ThunderPanPlugin-defaultSavePath": {
                    section: "ThunderPanPlugin",
                    key: "defaultSavePath",
                    value: "我的云盘"
                },
                "ThunderPanPlugin-savePaths": {section: "ThunderPanPlugin", key: "savePaths", value: []},
                "ThunderPanPlugin-StartCloudStopDownload": {
                    section: "ThunderPanPlugin",
                    key: "StartCloudStopDownload",
                    value: !0
                },
                "ThunderPanPlugin-SetVODCachePath": {section: "ThunderPanPlugin", key: "SetVODCachePath", value: !0},
                "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"},
                "ProxySetting-ConfigProxy_Type": {section: "ProxySetting", key: "ConfigProxy_Type", value: "0"},
                "ProxySetting-ConnectType_Hub": {section: "ProxySetting", key: "ConnectType_Hub", value: "直接连接"},
                "ProxySetting-ConnectType_Http": {section: "ProxySetting", key: "ConnectType_Http", value: "直接连接"},
                "ProxySetting-ConnectType_Ftp": {section: "ProxySetting", key: "ConnectType_Ftp", value: "直接连接"},
                "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: l},
                "ConfigMsg-ConfigMsg_FailSuggest": {section: "ConfigMsg", key: "ConfigMsg_FailSuggest", value: !0},
                "ConfigMsg-ConfigMsg_TodayRecommend": {
                    section: "ConfigMsg",
                    key: "ConfigMsg_TodayRecommend",
                    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"
                },
                "TaskDefaultSettings-MaxResourceLimit": {
                    section: "TaskDefaultSettings",
                    key: "MaxResourceLimit",
                    value: !1
                },
                "TaskDefaultSettings-MaxResourceCount": {
                    section: "TaskDefaultSettings",
                    key: "MaxResourceCount",
                    value: "500"
                },
                "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: !1
                },
                "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"
                },
                "UserCommunitySet-radio_id_": {
                    section: "UserCommunitySet",
                    key: "radio_id_",
                    value: !0,
                    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
                },
                "CompletedTaskPlay-LanuchMediaPlayer": {
                    section: "CompletedTaskPlay",
                    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 i = 0; i < t.length; i++) {
                let n = "";
                if (void 0 !== t[i].optionToValue) {
                    let e = a.ConfigNS.getValue(t[i].section, t[i].key, t[i].optionToValue[t[i].value]);
                    for (let a in t[i].optionToValue) if (t[i].optionToValue[a] === e) {
                        n = a;
                        break
                    }
                } else n = a.ConfigNS.getValue(t[i].section, t[i].key, t[i].value);
                e.conf.formData[`${t[i].section}-${t[i].key}`].value = n
            }
        }, e.initConf = function () {
            return a.ConfigNS.init(r.join(__profilesDir, "config.json"))
        }, e.getConfSchema = function () {
            return e.conf.sechema
        }, e.getConfFormData = function () {
            return e.conf.formData
        }, e.addSettingItemData = function (t, i) {
            let n = !1;
            if (t.name && t.name.length > 0 && t.children) {
                let i = !1;
                for (let a = 0; a < e.conf.sechema.length; ++a) if (e.conf.sechema[a].name === t.name) {
                    i = !0;
                    let o = t.children[0], r = !1;
                    for (let t = 0; t < e.conf.sechema[a].children.length; ++t) {
                        let i = e.conf.sechema[a].children[t];
                        if (i.name === o.name) {
                            if (r = !0, n = !0, o.children.length > 0) for (let e = 0; e < o.children.length; ++e) if (i.children.length > 0) {
                                let t = !1;
                                for (let n = 0; n < i.children.length; ++n) if (o.children[e].name === i.children[n].name) {
                                    t = !0;
                                    break
                                }
                                t || i.children.push(o.children[e])
                            } else i.children.push(o.children[e]);
                            break
                        }
                    }
                    r || (n = !0, e.conf.sechema[a].children.push(t.children[0]));
                    break
                }
                i || (n = !0, e.conf.sechema.push(t))
            }
            for (let t in i) e.conf.formData[t] = i[t];
            return n
        }, e.removeSettingItemData = function (t, i) {
            let n = !1;
            if (t.name && t.name.length > 0 && t.children) for (let i = 0; i < e.conf.sechema.length; ++i) if (e.conf.sechema[i].name === t.name) {
                let a = t.children[0];
                for (let t = 0; t < e.conf.sechema[i].children.length; ++t) {
                    let o = e.conf.sechema[i].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) {
                            n = !0, o.children.splice(t, 1);
                            break
                        }
                        0 === o.children.length && (n = !0, e.conf.sechema[i].children.splice(t, 1));
                        break
                    }
                }
                0 === e.conf.sechema[i].children.length && (n = !0, e.conf.sechema.splice(i, 1));
                break
            }
            for (let t in i) e.conf.formData[t] && delete e.conf.formData[t];
            return n
        }, e.removeSettingItem = t, e.addSettingItem = i, e.isSettingItemExist = d, e.getConfSchemaEx = function () {
            return n(this, void 0, void 0, function* () {
                return yield s.confAdd.updateAssociate(t, d, i), e.conf.sechema
            })
        }
    }(t.SettingInit || (t.SettingInit = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(0), r = i(10), s = i(22), l = i(3), d = i(78), u = i(6), c = i(30), h = i(23),
        f = i(26).DownloadKernelCategoryManager.getCategoryManager(), g = o.default.getLogger("task filter");
    let p = "全部", v = void 0;
    const m = `${__profilesDir}/task-filters.json`;
    let y = !1;
    !function (e) {
        let t;
        !function (e) {
            e[e.Name = 1] = "Name", e[e.Filter = 2] = "Filter"
        }(t || (t = {}));
        const i = [{
                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"}],
            o = [{type: "checkbox", label: "全部", id: "all"}, {type: "separator"}, {
                type: "checkbox",
                label: "BT任务",
                taskType: l.DownloadKernel.TaskType.Bt
            }, {type: "checkbox", label: "任务组", taskType: l.DownloadKernel.TaskType.Group}, {
                type: "normal",
                label: "自定义",
                id: "custom"
            }];
        let k = [...o];

        function T() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (y) break;
                    if (y = !0, !(yield u.FileSystemAWNS.existsAW(m))) {
                        k.splice(2, 0, ...i);
                        break
                    }
                    let e = (yield u.FileSystemAWNS.readFileAW(m)).toString(), t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                    }
                    t ? t.length > 0 && k.splice(2, 0, ...t) : k.splice(2, 0, ...i)
                } while (0)
            })
        }

        function w() {
            return k.filter(e => "custom" === e.id || "checkbox" === e.type && !e.id && !e.taskType)
        }

        function C() {
            return n(this, void 0, void 0, function* () {
                let e = -1;
                do {
                    let t = yield h.LoginHelperNS.loginHelper.getUserInfoAw("userid");
                    if (!t) break;
                    let i = f.getCategoryFromUserId("ThunderPanPlugin", t, "ThunderPan Download Category");
                    i && (e = i.getId())
                } while (0);
                return e
            })
        }

        e.initFilter = T, e.saveFilter = function (e, i) {
            return n(this, void 0, void 0, function* () {
                e = e.map(e => ({
                    label: e.label,
                    extFilter: e.extFilter,
                    nameFilter: e.nameFilter
                })), (k = [...o]).splice(2, 0, ...e), yield u.FileSystemAWNS.writeFileAW(m, JSON.stringify(e));
                let n = [-1], a = yield C();
                -1 !== a && n.push(a);
                do {
                    if (!v) break;
                    if (!i || !i.reason) break;
                    if ("remove" === i.reason) {
                        i.data.label === p && (p = "全部", v("全部"));
                        break
                    }
                    if (!i.data) break;
                    if ("modify" === i.reason && i.data.type) {
                        if (i.data.lastSelect !== p) break;
                        if ((i.data.type & t.Name) === t.Name && i.data.lastSelect && (p = i.data.label, v(p)), (i.data.type & t.Filter) === t.Filter) {
                            let e = l.DownloadKernel.FilterKeyType.ExtEqual;
                            i.data.nameFilter && (e = l.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), c.ThunderKernel.filterTask(e, i.data.nameFilter ? i.data.nameFilter : "", i.data.extFilter ? i.data.extFilter : "", e => {
                                g.information("task filter", e), v(void 0, e)
                            }, n)
                        }
                        break
                    }
                } while (0)
            })
        }, e.reset = function () {
            p = "全部"
        }, e.refresh = function (e) {
            v = e
        }, e.getCustomOptions = w, e.getMenuOptions = function (e, t) {
            return n(this, void 0, void 0, function* () {
                yield T();
                let i = [], n = [e];
                if (-1 === e) {
                    let e = yield C();
                    -1 !== e && n.push(e)
                }
                for (let e of k) e.type = e.type ? e.type : "checkbox", "separator" === e.type ? i.push({type: e.type}) : i.push({
                    type: e.type,
                    label: e.label,
                    enabled: e.enabled,
                    icon: e.icon,
                    id: e.id,
                    checked: p === e.label,
                    click: i => {
                        let a = `category=${encodeURIComponent(i.label)}`;
                        r.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_click", "", 0, 0, 0, 0, a);
                        do {
                            if ("function" != typeof t) break;
                            if ("custom" === e.id) {
                                let e = w();
                                s.MessageBox.custom("custom-task-filter", {items: JSON.stringify(e)}, {
                                    width: 506,
                                    height: 390
                                }).catch();
                                break
                            }
                            if (i.label === p) {
                                g.information("select old item");
                                break
                            }
                            if (p = i.label, "all" === e.id) {
                                t(e);
                                break
                            }
                            let a = l.DownloadKernel.FilterKeyType.ExtEqual;
                            e.taskType ? a = l.DownloadKernel.FilterKeyType.TaskTypeEqual : e.nameFilter && "" !== e.nameFilter.trim() && (a = l.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), c.ThunderKernel.filterTask(a, e.nameFilter ? e.nameFilter : "", e.extFilter ? e.extFilter : "", i => {
                                g.information("task filter", i), t(e, i)
                            }, n, void 0, e.taskType)
                        } while (0)
                    }
                });
                return i
            })
        }, e.showMenu = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                r.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_show"), yield T();
                let n = [], o = [t];
                if (-1 === t) {
                    let e = yield C();
                    -1 !== e && o.push(e)
                }
                for (let e of k) e.type = e.type ? e.type : "checkbox", "separator" === e.type ? n.push({type: e.type}) : n.push({
                    type: e.type,
                    label: e.label,
                    enabled: e.enabled,
                    icon: e.icon,
                    id: e.id,
                    checked: p === e.label,
                    click: t => {
                        let n = `category=${encodeURIComponent(t.label)}`;
                        r.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_click", "", 0, 0, 0, 0, n);
                        do {
                            if ("function" != typeof i) break;
                            if ("custom" === e.id) {
                                let e = w();
                                s.MessageBox.custom("custom-task-filter", {items: JSON.stringify(e)}, {
                                    width: 506,
                                    height: 390
                                }).catch();
                                break
                            }
                            if (t.label === p) {
                                g.information("select old item");
                                break
                            }
                            if (p = t.label, "all" === e.id) {
                                i(e);
                                break
                            }
                            let n = l.DownloadKernel.FilterKeyType.ExtEqual;
                            e.taskType ? n = l.DownloadKernel.FilterKeyType.TaskTypeEqual : e.nameFilter && "" !== e.nameFilter.trim() && (n = l.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), c.ThunderKernel.filterTask(n, e.nameFilter ? e.nameFilter : "", e.extFilter ? e.extFilter : "", t => {
                                g.information("task filter", t), i(e, t)
                            }, o, void 0, e.taskType)
                        } while (0)
                    }
                });
                const u = yield a.asyncRemoteCall.getCurrentWindow(),
                    h = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                yield d.MenuSkinNS.setStyle(h, {});
                let f = e.getBoundingClientRect(), v = Math.round(f.left), m = Math.round(f.top);
                h.popup({window: u, x: v, y: m, async: !1})
            })
        }
    }(t.CompletedFilterNS || (t.CompletedFilterNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(9), r = i(14), s = i(24), l = i(23), d = i(0).default.getLogger("CommonLoginHelper");
    a.default.defaults.adapter = i(21);
    t.commonLoginHelper = new class {
        sendSmsAw(e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                do {
                    let i = yield this.getCommonParmAw();
                    if (null === i || void 0 === i) break;
                    null !== e && void 0 !== e && "" !== e && (i = `${i}&creditkey=${e}`);
                    let n = null, o = "https://xluser-ssl.xunlei.com/msg/v1.1/SendSms?";
                    o = `${o}${i}`;
                    try {
                        null !== (n = yield a.default.get(o, {timeout: 1e4})) && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data && "" !== n.data && (t = JSON.stringify(n.data))
                    } catch (e) {
                        d.information("sendSmsAw:error=", e);
                        break
                    }
                } while (0);
                return t
            })
        }

        checkSmsAw(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                do {
                    if (null === e || void 0 === e) {
                        d.information("checkSmsAw token有问题 token：", e);
                        break
                    }
                    if (null === t || void 0 === t) {
                        d.information("checkSmsAw code有问题 code：", t);
                        break
                    }
                    let n = yield this.getCommonParmAw();
                    if (null === n || void 0 === n) break;
                    let o = null, r = "https://xluser-ssl.xunlei.com/msg/v1.1/CheckSms?";
                    r = `${r}${n = `${n}&token=${e}&code=${t}`}`;
                    try {
                        null !== (o = yield a.default.get(r, {timeout: 1e4})) && void 0 !== o.status && 200 === o.status && void 0 !== o.data && null !== o.data && "" !== o.data && (i = JSON.stringify(o.data))
                    } catch (e) {
                        d.information("sendSmsAw:error=", e);
                        break
                    }
                } while (0);
                return i
            })
        }

        isAutoPopupLogin() {
            return n(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 n(this, void 0, void 0, function* () {
                let e = null;
                do {
                    let t = yield l.LoginHelperNS.loginHelper.isLoginedAw();
                    if (!0 !== t) {
                        d.information("getCommonParmAw 没有登陆 isLogin：", t);
                        break
                    }
                    let i = yield l.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === i || void 0 === i) {
                        d.information("getCommonParmAw userInfo有问题 userInfo:", i);
                        break
                    }
                    let n = i.sessionid;
                    if (null === n || void 0 === n || "" === n) {
                        d.information("getCommonParmAw sessionid有问题 sessionid:", n);
                        break
                    }
                    let a = i.deviceid, o = i.userid;
                    try {
                        let t = yield l.LoginHelperNS.loginSDKHelper.getInitData(), i = JSON.parse(t), r = i.appid,
                            s = "PC-" + i.package;
                        e = `deviceid=${a}&sessionid=${n}&userid=${o}&platformVersion=${i.platform}&appid=${r}&appName=${s}&scene=040`
                    } catch (e) {
                    }
                } while (0);
                return e
            })
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        getLoginWndShowConfigAw() {
            return n(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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(18), r = i(11), s = i(108), l = i(33), d = i(7), u = i(0), c = i(605),
        h = s.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        f = d.default(a.join(__rootDir, "../bin/ThunderHelper.node")), g = u.default.getLogger("notification");
    !function (e) {
        let t = null, i = null, a = !1, s = !1, d = !1, u = {};

        function p() {
            return n(this, void 0, void 0, function* () {
                if (s) return;
                s = !0, (yield r.asyncRemoteCall.getIpcMain()).on(l.ThunderChannelList.channelMRNotificationMsg, (e, ...i) => {
                    do {
                        if (g.information("notification-event"), null === i[0] || void 0 === i[0]) break;
                        let e = i[0];
                        switch (e) {
                            case"hover":
                                g.information("msg", e, i[1]), a = i[1];
                                break;
                            case"close":
                                if (g.information("msg", e), i && "close" === i[1]) {
                                    let e = t && u[t.id];
                                    if (e) {
                                        let t = e.data && e.data.exData;
                                        t.beforeClose && t.beforeClose()
                                    }
                                }
                                m().catch();
                                break;
                            case"click": {
                                let e = t && u[t.id];
                                if (e) {
                                    let t = e.data && e.data.exData;
                                    t.onClick && t.onClick(i[1])
                                }
                            }
                        }
                    } while (0)
                })
            })
        }

        function v(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => n(this, void 0, void 0, function* () {
                    o.ipcRenderer.once("notify-window-created", (i, a) => n(this, void 0, void 0, function* () {
                        d = !1;
                        let i = yield(yield r.asyncRemoteCall.getBrowserWindow()).fromId(a);
                        "CommonPushTip" === e.type && (u[a] = e), t(i)
                    })), d = !0, o.ipcRenderer.send("create-notify-window", JSON.parse(JSON.stringify(e)))
                }))
            })
        }

        function m() {
            return n(this, void 0, void 0, function* () {
                try {
                    g.information("close"), t && !(yield t.isDestroyed()) && t.close()
                } catch (e) {
                    g.warning(e)
                }
            })
        }

        function y(e) {
            g.information("setTimer..."), a = !1, e = e || 1e4, i && k(), i = setInterval(() => {
                a || (e -= 1e3) <= 0 && m().catch()
            }, 1e3)
        }

        function k() {
            i && (g.information("killTimer..."), clearInterval(i), i = null)
        }

        e.notify = function (e, i) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (f.IsInFullScreen()) break;
                    let o = "development" === process.env.RUN_ENV ? "http://localhost:9080/notification-renderer/" : `file:///${__dirname}/../notification-renderer/index.html`;
                    if (e.url && (o = e.url), "AdvertisementWebPageTips" !== e.type) {
                        yield p();
                        let n = yield v(e);
                        if (t && t.id === n.id) {
                            g.warning("get duplicate window", n.id);
                            break
                        }
                        t = n, (yield r.asyncRemoteCall.getIpcMain()).once("notification-init", i => {
                            n === t && (g.information("notification-init"), i.sender.send("notification-init-reply", JSON.parse(JSON.stringify(e))))
                        }), g.information("notification...", e), t.once("ready-to-show", () => {
                            n === t && (g.information("ready-to-show..."), t.showInactive(), t.setAlwaysOnTop(!1), y(e.duration), i && i("ready-to-show"))
                        }), t.once("closed", () => {
                            n === t && (g.information("closed..."), k(), delete u[t.id], t = null, h.deQueue())
                        }), t.loadURL(o).catch()
                    } else {
                        let s = (yield(yield r.asyncRemoteCall.getScreen()).getPrimaryDisplay()).workArea,
                            l = e.width || 300, d = e.height || 280, u = s.width - l, f = s.height - d, p = null;
                        c.default.createWebPageTipDlg(o, {
                            x: u,
                            y: f,
                            width: l,
                            height: d
                        }, null, e.title, (o, ...r) => {
                            if (g.information("callback", o, ...r), i && i(o, ...r), "webpage_loaded" === o) y(e.duration); else if ("mouse_hover" === o) a = !0; else if ("mouse_leave" === o) a = !1; else if ("webpage_load_failed" === o) ; else if ("click" === o) {
                                if (t) {
                                    t.hide();
                                    let e = t;
                                    p = setTimeout(() => n(this, void 0, void 0, function* () {
                                        (yield e.isDestroyed()) || e.close()
                                    }), 5e3)
                                }
                            } else "closed" === o && (p && (clearTimeout(p), p = null), t = null, k(), h.deQueue())
                        }).then(e => {
                            g.information("notifyWindow=", e), t = e
                        }).catch()
                    }
                } while (0)
            })
        }, e.close = m, e.getCurrentWindow = function () {
            return n(this, void 0, void 0, function* () {
                return g.information("waitCreateDone before", d), yield function () {
                    return n(this, void 0, void 0, function* () {
                        return new Promise(e => n(this, void 0, void 0, function* () {
                            d ? o.ipcRenderer.once("notify-window-created", (t, i) => n(this, void 0, void 0, function* () {
                                setTimeout(() => n(this, void 0, void 0, function* () {
                                    let t = yield(yield r.asyncRemoteCall.getBrowserWindow()).fromId(i);
                                    e(t)
                                }), 0)
                            })) : e(null)
                        }))
                    })
                }(), g.information("waitCreateDone end"), t
            })
        }
    }(t.NotificationNS || (t.NotificationNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(145), s = i(13), l = i(607), d = i(6), u = i(469), c = i(5),
        h = o.default.getLogger("Thunder.Skin");
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SkinHelperNS.defaultSkinInfo, this.isTemp = !1, this.lsatSkinInfo = r.SkinHelperNS.defaultSkinInfo, this.featuredSkinInfo = r.SkinHelperNS.defaultSkinInfo, this.cacheURL = `${__profilesDir}/skin-info.json`, this.userShakeURL = `${__profilesDir}/user-shake-info.json`, this.init().catch(e => {
                h.warning(e)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                {
                    let e;
                    try {
                        e = JSON.parse((yield d.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        h.warning("解析皮肤信息失败")
                    }
                    e && (this.lsatSkinInfo = e, yield this.setSkinInfo(e)), yield u.SpringFestivalSkinNS.init(), (yield u.SpringFestivalSkinNS.canShowSkin()) && u.SpringFestivalSkinNS.getSkin(!0).then(e => n(this, void 0, void 0, function* () {
                        h.information("SpringFestival skinInfo", e), e && (yield this.setSkinInfo(e))
                    })).catch()
                }
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        getIsTemp() {
            return this.isTemp
        }

        setSkinInfo(e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.isTemp = i, e.type !== r.SkinHelperNS.SkinType.Cool && (this.featuredSkinInfo = e), this.skinInfo.is_spring_festival ? this.skinInfo.colors = u.SpringFestivalSkinNS.getColor().colors : this.skinInfo.colors = l.SkinConfigNS.colorList.find(e => e.id === this.skinInfo.colorID).colors, this.emit("changeSkin", this.skinInfo, t, i), t && !e.is_spring_festival && ((yield c.client.callServerFunction("IsLogined")) || e.type === r.SkinHelperNS.SkinType.Default) && u.SpringFestivalSkinNS.disableSkin();
                    let n = yield u.SpringFestivalSkinNS.canShowSkin();
                    if (e.is_spring_festival && n && (e = this.lsatSkinInfo), s.ThunderUtil.isUndef(e)) return;
                    let a = Object.assign({}, e);
                    if (delete a.colors, !i && e.type !== r.SkinHelperNS.SkinType.Cool) try {
                        yield d.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(a))
                    } catch (e) {
                        h.warning("保存皮肤信息失败")
                    }
                }
            })
        }

        getShakeInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = void 0;
                do {
                    if (!e) break;
                    if (!(yield d.FileSystemAWNS.existsAW(this.userShakeURL))) break;
                    let i = (yield d.FileSystemAWNS.readFileAW(this.userShakeURL)).toString(), n = null;
                    try {
                        n = JSON.parse(i)
                    } catch (e) {
                    }
                    t = (n = n || {})[e]
                } while (0);
                return t
            })
        }

        handleShakeSave(e, t) {
            return n(this, void 0, void 0, function* () {
                if ("" !== e) {
                    let i = "{}", n = null;
                    if (yield d.FileSystemAWNS.existsAW(this.userShakeURL)) {
                        i = (yield d.FileSystemAWNS.readFileAW(this.userShakeURL)).toString() || "{}";
                        try {
                            n = JSON.parse(i)
                        } catch (e) {
                        }
                    }
                    n = n || {}, t ? n[e] = t : delete n[e], yield d.FileSystemAWNS.writeFileAW(this.userShakeURL, JSON.stringify(n))
                }
            })
        }

        getFeaturedSkinInfo() {
            return this.featuredSkinInfo
        }

        recoverSkin() {
            return n(this, void 0, void 0, function* () {
                this.lsatSkinInfo && (u.SpringFestivalSkinNS.disableSkin(), yield this.setSkinInfo(this.lsatSkinInfo))
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(0), r = i(13), s = i(6), l = i(5);
    let {isDef: d} = r.ThunderUtil;
    const u = 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 n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    let e = 1 === (yield l.client.callServerFunction("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) {
                                u.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        u.warning(e)
                    }
                    if (d(this.wallpapers)) break;
                    try {
                        this.wallpapers = JSON.parse(localStorage.getItem("wallpapers"))
                    } catch (e) {
                        u.warning(e)
                    }
                } while (0);
                let e = this.wallpapers || [], t = yield this.getSpringFestivalWallpaper();
                return t && (e = [...e, t]), e
            })
        }

        getCoolWallpapers() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    let e = "http://static-xl.a.88cdn.com/json/thunderx_superskins_skins.json";
                    try {
                        let t = yield a.default.get(e, {timeout: 1e4});
                        if (200 === t.status && t.data) {
                            this.coolWallpapers = t.data;
                            try {
                                u.information("get cool wallpapers", this.coolWallpapers), localStorage.setItem("coolWallpapers", JSON.stringify(this.coolWallpapers))
                            } catch (e) {
                                u.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        u.warning(e)
                    }
                    if (d(this.coolWallpapers)) break;
                    try {
                        this.coolWallpapers = JSON.parse(localStorage.getItem("coolWallpapers"))
                    } catch (e) {
                        u.warning(e)
                    }
                } while (0);
                return this.coolWallpapers || []
            })
        }

        getCoolShakes() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    let e = "https://static-xl.a.88cdn.com/json/thunderx_superskins_effects.json";
                    try {
                        let t = yield a.default.get(e, {timeout: 1e4});
                        if (200 === t.status && t.data) {
                            this.coolShakes = t.data;
                            try {
                                u.information("get cool wallpapers", this.coolShakes), localStorage.setItem("coolShakes", JSON.stringify(this.coolShakes))
                            } catch (e) {
                                u.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        u.warning(e)
                    }
                    if (d(this.coolShakes)) break;
                    try {
                        this.coolShakes = JSON.parse(localStorage.getItem("coolShakes"))
                    } catch (e) {
                        u.warning(e)
                    }
                } while (0);
                return this.coolShakes || []
            })
        }

        removeImage(e) {
            return n(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/skins/${e.id}`;
                return s.FileSystemAWNS.rmdirsAW(t)
            })
        }

        getImage(e) {
            return n(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 => {
                    u.information("update skin preview error", e)
                }), t) : (yield this.updateImage(e), t)
            })
        }

        updateImage(e) {
            return n(this, void 0, void 0, function* () {
                a.default.defaults.adapter = i(21);
                try {
                    let t = yield a.default.get(e.skin_link, {responseType: "arraybuffer"});
                    if (d(t) && 200 === t.status && d(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(() => i(139));
                        yield t.uncompressZipFile(`${__profilesDir}/skins/${e.id}/`, `${__profilesDir}/skins/${e.id}.zip`)
                    }
                } catch (e) {
                    u.warning(e)
                }
            })
        }

        getShakeRes(e) {
            return n(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/shake-skins/${e.id}/wallpaper.jpg`;
                return (yield s.FileSystemAWNS.existsAW(t)) ? (this.updateShakeRes(e).catch(), t) : (yield this.updateShakeRes(e), t)
            })
        }

        updateShakeRes(e) {
            return n(this, void 0, void 0, function* () {
                a.default.defaults.adapter = i(21);
                try {
                    let t = yield a.default.get(e.skin_link, {responseType: "arraybuffer"});
                    d(t) && 200 === t.status && d(t.data) && (yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/shake-skins`), yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/shake-skins/${e.id}`), yield s.FileSystemAWNS.writeFileAW(`${__profilesDir}/shake-skins/${e.id}/wallpaper.jpg`, t.data))
                } catch (e) {
                    u.warning(e)
                }
            })
        }

        getSpringFestivalWallpaper() {
            return n(this, void 0, void 0, function* () {
                let e = null;
                try {
                    let t = null;
                    try {
                        t = JSON.parse(localStorage.getItem("springFestivalSkinData"))
                    } catch (e) {
                        u.warning(e)
                    }
                    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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

        getSkins() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    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;
                    try {
                        this.skins = JSON.parse(localStorage.getItem("speedcurveSkins"))
                    } catch (e) {
                        l.warning(e)
                    }
                } while (0);
                return this.skins
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(0), r = i(19), s = o.default.getLogger("SyncMsgHelper");
    !function (e) {
        let t;
        !function (e) {
            e[e.Connecting = 0] = "Connecting", e[e.Connected = 1] = "Connected", e[e.Close = 2] = "Close", e[e.Error = 3] = "Error"
        }(t = e.SyncMsgState || (e.SyncMsgState = {}));
        let i = t.Close, o = null, l = null, d = void 0;

        function u() {
            return n(this, void 0, void 0, function* () {
                let e = yield a.client.isRemoteClientExist("User");
                return s.information("checkSyncMsg", e), e[0]
            })
        }

        function c() {
            return n(this, void 0, void 0, function* () {
                let e = yield a.client.callRemoteClientFunction("User", "SyncIsConnected");
                return s.information("syncIsConnected", e), e[0]
            })
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                if (o || (o = new r.EventEmitter), d = a.client.attachServerEvent("SyncEvent", (e, a) => n(this, void 0, void 0, function* () {
                    let n = null;
                    try {
                        n = JSON.parse(a)
                    } catch (e) {
                        s.warning("attachSyncEvent SyncEvent error", e)
                    }
                    if (s.information("attachSyncEvent SyncEvent", e, n), n) {
                        let e = i;
                        "connect" === n.subject ? e = t.Connected : "reconnect" === n.subject ? e = t.Connecting : "failed" === n.subject && (e = t.Close), e !== i && (i = e, o.emit("SyncMsgStateChange", i, n))
                    }
                })), yield u()) {
                    let e = yield a.client.callServerFunction("GetSyncMsgState");
                    s.information("state", e);
                    let n = i;
                    switch (e) {
                        case t.Connected:
                        case t.Connecting:
                        case t.Close:
                        case t.Error:
                            n = e
                    }
                    n !== i && (i = n, o.emit("SyncMsgStateChange", i, null))
                }
                l = setInterval(() => n(this, void 0, void 0, function* () {
                    let e = yield c(), n = i;
                    e ? n = t.Connected : i !== t.Connecting && (n = t.Close), n !== i && (i = n, o.emit("SyncMsgStateChange", i, null))
                }), 5e3)
            })
        }, e.uninit = function () {
            o && o.removeAllListeners(), d && (a.client.detachServerEvent("SyncEvent", d), d = void 0), l && (clearInterval(l), l = null)
        }, e.checkSyncMsg = u, e.getSyncMsgState = function () {
            return i
        }, e.syncIsConnected = c, e.attachSyncMsgStateChangeEvent = function (e) {
            return o || (o = new r.EventEmitter), o.addListener("SyncMsgStateChange", e), e
        }, e.detachSyncMsgStateChangeEvent = function (e) {
            o && o.removeListener("SyncMsgStateChange", e)
        }
    }(t.SyncMsgHelperNS || (t.SyncMsgHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(25), o = i(17);
    !function (e) {
        let t, i;
        !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"
        }(i = e.ProxyVerifyResult || (e.ProxyVerifyResult = {})), e.verifyProxy = function (e, t, r, s, l) {
            return n(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("VerifyProxy", e, t, r, s, l, (e, t) => {
                        e === a.NativeFunctionErrorCode.Success ? n(t) : n(i.Fall)
                    })
                })
            })
        }, e.setProxy = function (e, t, i, r, s) {
            return n(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("SetProxy", e, t, i, r, s, (e, t) => {
                        e === a.NativeFunctionErrorCode.Success ? n(t) : n(1)
                    })
                })
            })
        }
    }(t.ProxyNS || (t.ProxyNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(7), r = i(15), s = i(3), l = i(40), d = i(57), u = i(22), c = i(32), h = i(33), f = i(11),
        g = i(52), p = i(49), v = i(66), m = i(26), y = i(38), k = i(27), T = i(17), w = i(19),
        C = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        S = m.DownloadKernelCategoryManager.getCategoryManager(), I = r.DownloadKernelEventManager.getEventManager(),
        b = l.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        _ = g.ToastNotifyManagerNS.getToastNotifyManger();
    var D, A;
    !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"
    }(D = t.ScheduleCompleteTaskType || (t.ScheduleCompleteTaskType = {})), function (e) {
        e.Unknow = "Unknow", e.ScheduleTaskCountChange = "ScheduleTaskCountChange"
    }(A = t.ScheduleTaskEventType || (t.ScheduleTaskEventType = {})), function (e) {
        let t = D.UnKnown, i = null, a = -1, o = -1, r = -1, l = [], m = !1, N = !1;
        const x = new w.EventEmitter;

        function E() {
            i = I.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, K)
        }

        function P() {
            null !== i && (I.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, i), i = null)
        }

        function O() {
            P(), t = D.UnKnown
        }

        function M(e) {
            let t = 0, i = ["关机", "睡眠", "退出迅雷", "开始全部任务", "暂停全部任务"];
            for (let n = i.length - 1; n >= 0; --n) if (i[n] === e) {
                t = n;
                break
            }
            return t
        }

        function F() {
            let e = 300;
            r = setInterval(() => {
                (function () {
                    let e = !1, t = b.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks();
                    for (let [, i] of t) {
                        let t = i.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 = S.getCurrentPrivateCategory();
                    t && (e = c.TaskOperatorNs.hasCategoryStartTask(t.getId()));
                    return e
                }() ? e = 0 : e >= 300 ? (k.NativeCallHostModule.nativeCallHost.fireNativeEvent("getCurrentTabUrl", "callbackGetCurrentTabUrl"), T.NativeCallModule.nativeCall.AttachNativeEvent("callbackGetCurrentTabUrl", t => n(this, void 0, void 0, function* () {
                    t ? e = 0 : (m = !0, yield c.TaskOperatorNs.startAllPausedTask(), clearInterval(r), r = -1)
                }))) : e++
            }, 1e3)
        }

        function L(e) {
            return e && (e = !1, c.TaskOperatorNs.pauseAll(s.DownloadKernel.TaskStopReason.FreeDownload).catch(), -1 !== r && (clearInterval(r), r = -1), function () {
                let e = S.getCurrentPrivateCategory();
                e && c.TaskOperatorNs.pauseCategoryAllTask(e.getId(), s.DownloadKernel.TaskStopReason.FreeDownload)
            }()), e
        }

        function R(e) {
            let t = !1;
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (!n) continue;
                let a = n.getTaskStatus();
                if (a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding && a !== s.DownloadKernel.TaskStatus.Failed) continue;
                let o = n.getTaskBaseInfo(), r = n.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(), i = !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) {
                        i = !0;
                        break
                    }
                }
                if (i) break;
                e = !0
            } while (0);
            return e
        }

        function U(e) {
            return n(this, void 0, void 0, function* () {
                e === D.ShutDown ? C.shutDownMachine() : e === D.Sleep ? C.suspendMachine() : e === D.Exit ? yield d.quitPromises.run() : e === D.StartAll ? c.TaskOperatorNs.startAll() : e === D.StopAll && c.TaskOperatorNs.pauseAll(s.DownloadKernel.TaskStopReason.PauseAll).catch()
            })
        }

        function K(...e) {
            do {
                if (!e) break;
                if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                if (!R(e[1])) break;
                if (!B()) break;
                setTimeout(() => {
                    U(t).catch(), O()
                }, 1e4)
            } while (0)
        }

        e.getEventEmitter = function () {
            return x
        }, e.setDownloadCompleteTaskType = function (e) {
            do {
                if (e !== D.ShutDown && e !== D.Sleep && e !== D.Exit) break;
                if (t === e) break;
                O(), t = e, E();
                let i = "";
                switch (e) {
                    case D.ShutDown:
                        i = "已开启下载完成后关机";
                        break;
                    case D.Sleep:
                        i = "已开启下载完成后睡眠";
                        break;
                    case D.Exit:
                        i = "已开启下载完成后退出迅雷"
                }
                let n = _.showNotify(g.ToastNotifyManagerNS.notifyIdScheduleTaskComplete, p.ToastNotifyItemType.RedCancelNotify, i, 5e3);
                n && n.onCancel(() => {
                    O()
                })
            } while (0)
        }, e.getDownloadCompleteTaskType = function () {
            return t
        }, e.startDownloadCompleteMonitor = E, e.stopDownloadCompleteMonitor = P, e.cancelDownloadCompleteTask = O, e.showPlanTaskDlg = function () {
            u.MessageBox.custom("PlanTask", l, {width: 400, height: 132, center: !0}).catch()
        }, e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = yield f.asyncRemoteCall.getIpcMain();
                e.on(h.ThunderChannelList.channelRMCommitPlanTask, (e, t) => n(this, void 0, void 0, function* () {
                    l = t, -1 !== a && (clearInterval(a), a = -1), x.emit(A.ScheduleTaskCountChange, l.length), a = setInterval(() => {
                        for (let e = l.length - 1; e >= 0; --e) {
                            let t = l[e],
                                i = v.TimeHelperNS.convertTimeToMinutes(Number(t.hours), Number(t.minutes), Number(t.seconds));
                            if ((i -= 1) <= 0) {
                                U(M(t.operation)).catch(), l.splice(e, 1), x.emit(A.ScheduleTaskCountChange, l.length);
                                continue
                            }
                            let n = v.TimeHelperNS.convertMinuteToTime(i);
                            t.hours = n[0] + "", t.minutes = n[1] + "", t.seconds = n[2] + ""
                        }
                        l.length <= 0 && -1 !== a && (clearInterval(a), a = -1)
                    }, 1e3)
                })), e.on(h.ThunderChannelList.channelRMPerformePlanTask, (e, t) => n(this, void 0, void 0, function* () {
                    U(M(t)).catch()
                }))
            })
        }, e.getOperationIndex = M, e.getScheduleTaskCount = function () {
            return l.length
        }, e.popMessageBox = function (e) {
            N ? e() : u.MessageBox.confirm({
                title: "空闲下载",
                type: u.MessageBox.ConfirmType.Info,
                content: "当您长时间没有操作电脑时，迅雷会自动下载之前被暂停的任务",
                okText: "开启",
                cancelVisible: !1
            }, {width: 400, height: 177, center: !0}).then(t => {
                t.action === y.MessageBoxNS.Action.OK && (N = !0, e())
            }).catch()
        }, e.startFreeDownLoad = function () {
            let e = !1, t = 0;
            o = setInterval(() => {
                t = C.getFreeTime(), e ? t < 300 && (e = !1, m = L(m)) : t >= 300 && (e = !0, F())
            }, 2e3)
        }, e.closeFreeDownLoad = function () {
            -1 !== o && (clearInterval(o), o = -1), m = L(m)
        }, e.excuteTask = U
    }(t.ScheduleTaskNS || (t.ScheduleTaskNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(22), s = i(38), l = i(7), d = i(9), u = i(6), c = i(10), h = i(3), f = i(40),
        g = i(11), p = f.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        v = l.default(a.join(__rootDir, "../bin/ThunderHelper.node")), m = o.default.getLogger("quit-create-shortcut");
    !function (e) {
        class t {
            static isAlreadyCancel() {
                return d.ConfigNS.getValue("CreateDesktopIcon", "Cancel", !1)
            }

            static realPop() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.XLStatNS.trackEvent("core_event", "create_desktop_shortcut_tips_show"), r.MessageBox.confirm({
                            title: "您还没创建桌面快捷方式，是否要创建？",
                            type: r.MessageBox.ConfirmType.Warning,
                            fileName: "",
                            okText: "立即创建",
                            cancelText: "取消",
                            cancelVisible: !0
                        }).then(t => n(this, void 0, void 0, function* () {
                            if (t.action === s.MessageBoxNS.Action.OK) {
                                let t = yield g.asyncRemoteCall.getApp(),
                                    i = a.join(yield t.getPath("desktop"), "迅雷.lnk");
                                v.createShortcut(i, a.join(__rootDir, "../../ThunderStart.exe"), "-StartType:ExitDesktopIcon", a.join(__rootDir, "../../thunder11.ico"), t => {
                                    m.information("createShortcut result", t), e()
                                }), c.XLStatNS.trackEvent("core_event", "create_desktop_shortcut_tips_click", "", 0, 0, 0, 0, "button=ok")
                            } else t.action === s.MessageBoxNS.Action.Cancel ? (m.information("Cancel"), d.ConfigNS.setValue("CreateDesktopIcon", "Cancel", !0), c.XLStatNS.trackEvent("core_event", "create_desktop_shortcut_tips_click", "", 0, 0, 0, 0, "button=cancel"), e()) : t.action === s.MessageBoxNS.Action.Close && (m.information("Close"), d.ConfigNS.setValue("CreateDesktopIcon", "Cancel", !0), c.XLStatNS.trackEvent("core_event", "create_desktop_shortcut_tips_click", "", 0, 0, 0, 0, "button=close"), e())
                        })).catch(() => {
                            e()
                        })
                    })
                })
            }

            static popup() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (this.isAlreadyCancel()) break;
                        let t = yield g.asyncRemoteCall.getApp(), i = a.join(yield t.getPath("desktop"), "迅雷.lnk");
                        if (yield u.FileSystemAWNS.existsAW(i)) break;
                        yield this.realPop(), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class i {
            static realPop() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.XLStatNS.trackEvent("core_event", "exit_popup_show"), r.MessageBox.confirm({
                            title: "当前有正在下载的任务，确定退出吗？",
                            type: r.MessageBox.ConfirmType.Warning,
                            fileName: "",
                            okText: "确定",
                            cancelText: "取消",
                            cancelVisible: !0
                        }).then(t => n(this, void 0, void 0, function* () {
                            t.action === s.MessageBoxNS.Action.OK && c.XLStatNS.trackEvent("core_event", "exit_popup_click", "", 0, 0, 0, 0, "button=ok"), e(t.action)
                        })).catch(() => {
                            e(s.MessageBoxNS.Action.Cancel)
                        })
                    })
                })
            }

            static popup() {
                return n(this, void 0, void 0, function* () {
                    let e = !0;
                    {
                        let t = p.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading);
                        if (t) {
                            let i = t.getTasks();
                            for (let [, t] of i) if (t.getTaskStatus() === h.DownloadKernel.TaskStatus.Started) {
                                e = !1;
                                break
                            }
                        }
                        e || (e = (yield this.realPop()) === s.MessageBoxNS.Action.OK)
                    }
                    return e
                })
            }
        }

        e.popupCreateShortcutMessageBox = function () {
            return n(this, void 0, void 0, function* () {
                do {
                    if (yield t.popup()) break
                } while (0);
                return !0
            })
        }, e.popup = function () {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                do {
                    if (yield t.popup()) break;
                    if (!(yield i.popup())) {
                        e = !1;
                        break
                    }
                } while (0);
                return e
            })
        }
    }(t.QuitMessageBoxMgrNS || (t.QuitMessageBoxMgrNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(60), s = i(42), l = i(68), d = i(9), u = i(0), c = i(147), h = i(10),
        f = u.default.getLogger("AdLeftBottomHelper");
    t.adLeftBottomHelper = new class extends s.default {
        constructor() {
            super(...arguments), this.positionId = 1749, this.curAllOrders = [], this.adDataPicDir = void 0
        }

        fetchOrderAw() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    this.adDataPicDir = a.resolve(__profilesDir, "AdData/AdLeftBottom"), e = yield o.FileSystemAWNS.mkdirsAW(this.adDataPicDir);
                    let t = yield this.getshownOrderIdAw(), i = yield l.AdHelperNS.getAdDataAw(this.positionId, t, !0);
                    if (!(null !== i && void 0 !== i && null !== i.data && void 0 !== i.data && i.data.length > 0)) {
                        e = !1, f.information("获取数据失败", i);
                        break
                    }
                    if (this.curAllOrders = yield this.parseOrders(i.data), null === this.curAllOrders || void 0 === this.curAllOrders || this.curAllOrders.length <= 0) {
                        f.information("解析数据失败");
                        break
                    }
                    this.fireEvent(c.AdCommonNS.eventAdShow, c.AdCommonNS.AdName.AdLeftBottomVip, this.curAllOrders[0])
                } while (0);
                return e
            })
        }

        handleEvent(e) {
            f.information(e), "ad_show" === e ? (l.AdHelperNS.statServer(this.positionId, this.curAllOrders[0].orderId, 1).catch(), this.stat("ad_show")) : "content" === e ? (l.AdHelperNS.statServer(this.positionId, this.curAllOrders[0].orderId, 2).catch(), this.stat("ad_click", "clickid=body")) : "close" === e ? this.stat("ad_closed") : "nodisturb" === e && this.stat("ad_nodisplay_click")
        }

        setNoDisturb() {
            return n(this, void 0, void 0, function* () {
                yield l.AdHelperNS.onConfigInitAw(), d.ConfigNS.setValue("AdLeftBottom", "NoDisturb", !0)
            })
        }

        isNoDisturb() {
            return n(this, void 0, void 0, function* () {
                return yield l.AdHelperNS.onConfigInitAw(), d.ConfigNS.getValue("AdLeftBottom", "NoDisturb", !1)
            })
        }

        getshownOrderIdAw() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                return yield l.AdHelperNS.onConfigInitAw(), d.ConfigNS.getValue("AdLeftBottom", "TheDate", "") === l.AdHelperNS.getCurDate() && "" !== (e = d.ConfigNS.getValue("AdLeftBottom", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        parseOrders(e) {
            return n(this, void 0, void 0, function* () {
                let t = [];
                f.information("parseOrders: adData = ", e);
                for (let i = 0; i < e.length; ++i) {
                    let n = {}, o = e[i];
                    n.orderId = o.orderId, f.information("parseOrders: curOrderId = ", o.orderId);
                    let r = o.materials;
                    if (null === r || void 0 === r || r.length <= 0) {
                        f.information("parseOrders:materials 有问题");
                        continue
                    }
                    let s = r[0];
                    if (n.materialId = s.material_id, null === s.open_type || void 0 === s.open_type) {
                        f.information("parseOrders:material.open_type 有问题");
                        continue
                    }
                    n.openType = s.open_type, n.targetUrl = s.open_url;
                    let l = s.data;
                    if (null === l || void 0 === l || l.length <= 0) {
                        f.information("parseOrders:material.data 有问题");
                        continue
                    }
                    let d = 0, u = "";
                    for (let e = 0; e < l.length; ++e) {
                        let t = l[e];
                        if (10204 === t.asset && (n.iconUrl = t.value, n.iconUrl && "" !== n.iconUrl)) {
                            if (u = a.join(this.adDataPicDir, a.basename(n.iconUrl)), !(yield this.downloadResourcesAW(n.iconUrl, u))) break;
                            ++d, n.picFile = u
                        }
                    }
                    d < 1 ? f.information("素材数据不完整：ncount = ", d, ";materialId = ", s.material_id) : t.push(n)
                }
                return t
            })
        }

        downloadResourcesAW(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                return i = yield r.AxiosNS.downloadFileAW(e, t), f.information("下载图片：result = ", i, ";savePath = ", t), i
            })
        }

        stat(e, t) {
            let i = `${this.positionId}`,
                n = `orderid=${this.curAllOrders[0].orderId},materialid=${this.curAllOrders[0].materialId}`;
            null !== t && void 0 !== t && "" !== t && (n = `${n},${t}`), f.information(e, n), n = encodeURIComponent(n), h.XLStatNS.trackEvent("xlx_ad_event", e, i, 0, 0, 0, 0, n)
        }
    }
}, function (e, t) {
    t.L = {bit: 1}, t.M = {bit: 0}, t.Q = {bit: 3}, t.H = {bit: 2}, t.isValid = function (e) {
        return e && void 0 !== e.bit && e.bit >= 0 && e.bit < 4
    }, t.from = function (e, i) {
        if (t.isValid(e)) return e;
        try {
            return function (e) {
                if ("string" != typeof e) throw new Error("Param is not a string");
                switch (e.toLowerCase()) {
                    case"l":
                    case"low":
                        return t.L;
                    case"m":
                    case"medium":
                        return t.M;
                    case"q":
                    case"quartile":
                        return t.Q;
                    case"h":
                    case"high":
                        return t.H;
                    default:
                        throw new Error("Unknown EC Level: " + e)
                }
            }(e)
        } catch (e) {
            return i
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(112);

    function a() {
        this._state = 0, this._response = {
            host: "unknown",
            alive: !1,
            output: "unknown",
            time: "unknown",
            min: "unknown",
            max: "unknown",
            avg: "unknown",
            stddev: "unknown"
        }, this._times = [], this._lines = [], this._stripRegex = /[ ]*\r?\n?$/g
    }

    a.prototype.STATES = {INIT: 0, HEADER: 1, BODY: 2, FOOTER: 3, END: 4}, a.prototype._changeState = function (e) {
        if (n.values(this.STATES).indexOf(e) < 0) throw new Error("Unknown state");
        return this._state = e, this
    }, a.prototype._processHeader = function (e) {
        throw new Error("Subclass should implement this method")
    }, a.prototype._processBody = function (e) {
        throw new Error("Subclass should implement this method")
    }, a.prototype._processFooter = function (e) {
        throw new Error("Subclass should implement this method")
    }, a.prototype.eat = function (e) {
        var t = [this.STATES.INIT, this.STATES.HEADER];
        this._lines.push(e);
        var i = e.replace(this._stripRegex, "");
        if (0 === i.length) ; else if (t.indexOf(this._state) >= 0) this._processHeader(i); else if (this._state === this.STATES.BODY) this._processBody(i); else if (this._state === this.STATES.FOOTER) this._processFooter(i); else if (this._state !== this.STATES.END) throw new Error("Unknown state");
        return this
    }, a.prototype.getResult = function () {
        var e = n.extend({}, this._response);
        if (e.output = this._lines.join("\n"), e.alive = this._times.length > 0, e.alive && (e.time = this._response.time = this._times[0]), "unknown" === e.stddev && e.alive) {
            var t = this._times.length, i = n.reduce(this._times, function (t, i) {
                return t + Math.pow(i - e.avg, 2)
            }, 0) / t;
            e.stddev = Math.round(1e3 * Math.sqrt(i)) / 1e3
        }
        return n.each(["min", "avg", "max", "stddev"], function (t) {
            var i = e[t];
            n.isNumber(i) && (e[t] = i.toFixed(3))
        }), e
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(83), a = i.n(n), o = i(54), r = i.n(o), s = /%[sdj%]/g, l = function () {
    };

    function d() {
        for (var e = arguments.length, t = Array(e), i = 0; i < e; i++) t[i] = arguments[i];
        var n = 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 (n >= o) return e;
                switch (e) {
                    case"%s":
                        return String(t[n++]);
                    case"%d":
                        return Number(t[n++]);
                    case"%j":
                        try {
                            return JSON.stringify(t[n++])
                        } catch (e) {
                            return "[Circular]"
                        }
                        break;
                    default:
                        return e
                }
            }), l = t[n]; n < o; l = t[++n]) r += " " + l;
            return r
        }
        return a
    }

    function u(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, i) {
        var n = 0, a = e.length;
        !function o(r) {
            if (r && r.length) i(r); else {
                var s = n;
                n += 1, s < a ? t(e[s], o) : i([])
            }
        }([])
    }

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

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

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

    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 i in t) if (t.hasOwnProperty(i)) {
            var n = t[i];
            "object" === (void 0 === n ? "undefined" : r()(n)) && "object" === r()(e[i]) ? e[i] = a()({}, e[i], n) : e[i] = n
        }
        return e
    }

    var p = function (e, t, i, n, a, o) {
        !e.required || i.hasOwnProperty(e.field) && !u(t, o || e.type) || n.push(d(a.messages.required, e.fullField))
    };
    var v = function (e, t, i, n, a) {
        (/^\s+$/.test(t) || "" === t) && n.push(d(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
    }, y = {
        integer: function (e) {
            return y.number(e) && parseInt(e, 10) === e
        }, float: function (e) {
            return y.number(e) && !y.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)) && !y.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 k = "enum";
    var T = {
        required: p, whitespace: v, type: function (e, t, i, n, a) {
            if (e.required && void 0 === t) p(e, t, i, n, a); else {
                var o = e.type;
                ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"].indexOf(o) > -1 ? y[o](t) || n.push(d(a.messages.types[o], e.fullField, e.type)) : o && (void 0 === t ? "undefined" : r()(t)) !== e.type && n.push(d(a.messages.types[o], e.fullField, e.type))
            }
        }, range: function (e, t, i, n, a) {
            var o = "number" == typeof e.len, r = "number" == typeof e.min, s = "number" == typeof e.max, l = t,
                u = null, c = "number" == typeof t, h = "string" == typeof t, f = Array.isArray(t);
            if (c ? u = "number" : h ? u = "string" : f && (u = "array"), !u) return !1;
            f && (l = t.length), h && (l = t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length), o ? l !== e.len && n.push(d(a.messages[u].len, e.fullField, e.len)) : r && !s && l < e.min ? n.push(d(a.messages[u].min, e.fullField, e.min)) : s && !r && l > e.max ? n.push(d(a.messages[u].max, e.fullField, e.max)) : r && s && (l < e.min || l > e.max) && n.push(d(a.messages[u].range, e.fullField, e.min, e.max))
        }, enum: function (e, t, i, n, a) {
            e[k] = Array.isArray(e[k]) ? e[k] : [], -1 === e[k].indexOf(t) && n.push(d(a.messages[k], e.fullField, e[k].join(", ")))
        }, pattern: function (e, t, i, n, a) {
            e.pattern && (e.pattern instanceof RegExp ? (e.pattern.lastIndex = 0, e.pattern.test(t) || n.push(d(a.messages.pattern.mismatch, e.fullField, t, e.pattern))) : "string" == typeof e.pattern && (new RegExp(e.pattern).test(t) || n.push(d(a.messages.pattern.mismatch, e.fullField, t, e.pattern))))
        }
    };
    var w = "enum";
    var C = function (e, t, i, n, a) {
        var o = e.type, r = [];
        if (e.required || !e.required && n.hasOwnProperty(e.field)) {
            if (u(t, o) && !e.required) return i();
            T.required(e, t, n, r, a, o), u(t, o) || T.type(e, t, n, r, a)
        }
        i(r)
    }, S = {
        string: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t, "string") && !e.required) return i();
                T.required(e, t, n, o, a, "string"), u(t, "string") || (T.type(e, t, n, o, a), T.range(e, t, n, o, a), T.pattern(e, t, n, o, a), !0 === e.whitespace && T.whitespace(e, t, n, o, a))
            }
            i(o)
        }, method: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && T.type(e, t, n, o, a)
            }
            i(o)
        }, number: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, boolean: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && T.type(e, t, n, o, a)
            }
            i(o)
        }, regexp: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), u(t) || T.type(e, t, n, o, a)
            }
            i(o)
        }, integer: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, float: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, array: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t, "array") && !e.required) return i();
                T.required(e, t, n, o, a, "array"), u(t, "array") || (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, object: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && T.type(e, t, n, o, a)
            }
            i(o)
        }, enum: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), t && T[w](e, t, n, o, a)
            }
            i(o)
        }, pattern: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t, "string") && !e.required) return i();
                T.required(e, t, n, o, a), u(t, "string") || T.pattern(e, t, n, o, a)
            }
            i(o)
        }, date: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                if (T.required(e, t, n, o, a), !u(t)) {
                    var r = void 0;
                    r = "number" == typeof t ? new Date(t) : t, T.type(e, r, n, o, a), r && T.range(e, r.getTime(), n, o, a)
                }
            }
            i(o)
        }, url: C, hex: C, email: C, required: function (e, t, i, n, a) {
            var o = [], s = Array.isArray(t) ? "array" : void 0 === t ? "undefined" : r()(t);
            T.required(e, t, n, o, a, s), i(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 _(e) {
        this.rules = null, this._messages = b, this.define(e)
    }

    _.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, i = void 0;
            for (t in e) e.hasOwnProperty(t) && (i = e[t], this.rules[t] = Array.isArray(i) ? i : [i])
        }, validate: function (e) {
            var t = this, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = arguments[2],
                o = e, s = i, u = n;
            if ("function" == typeof s && (u = 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, v = void 0, m = {};
                (s.keys || Object.keys(this.rules)).forEach(function (i) {
                    p = t.rules[i], v = o[i], p.forEach(function (n) {
                        var r = n;
                        "function" == typeof r.transform && (o === e && (o = a()({}, o)), v = o[i] = r.transform(v)), (r = "function" == typeof r ? {validator: r} : a()({}, r)).validator = t.getValidationMethod(r), r.field = i, r.fullField = r.fullField || i, r.type = t.getType(r), r.validator && (m[i] = m[i] || [], m[i].push({
                            rule: r,
                            value: v,
                            source: o,
                            field: i
                        }))
                    })
                });
                var y = {};
                h(m, s, function (e, t) {
                    var i = e.rule,
                        n = !("object" !== i.type && "array" !== i.type || "object" !== r()(i.fields) && "object" !== r()(i.defaultField));

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

                    function u() {
                        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 && i.message && (r = [].concat(i.message)), r = r.map(f(i)), s.first && r.length) return y[i.field] = 1, t(r);
                        if (n) {
                            if (i.required && !e.value) return r = i.message ? [].concat(i.message).map(f(i)) : s.error ? [s.error(i, d(s.messages.required, i.field))] : [], t(r);
                            var u = {};
                            if (i.defaultField) for (var c in e.value) e.value.hasOwnProperty(c) && (u[c] = i.defaultField);
                            for (var h in u = a()({}, u, e.rule.fields)) if (u.hasOwnProperty(h)) {
                                var g = Array.isArray(u[h]) ? u[h] : [u[h]];
                                u[h] = g.map(o.bind(null, h))
                            }
                            var p = new _(u);
                            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)
                    }

                    n = n && (i.required || !i.required && e.value), i.field = e.field;
                    var c = i.validator(i, e.value, u, e.source, s);
                    c && c.then && c.then(function () {
                        return u()
                    }, function (e) {
                        return u(e)
                    })
                }, function (e) {
                    !function (e) {
                        var t, i = void 0, n = void 0, a = [], o = {};
                        for (i = 0; i < e.length; i++) t = e[i], Array.isArray(t) ? a = a.concat.apply(a, t) : a.push(t);
                        if (a.length) for (i = 0; i < a.length; i++) o[n = a[i].field] = o[n] || [], o[n].push(a[i]); else a = null, o = null;
                        u(a, o)
                    }(e)
                })
            } else u && u()
        }, getType: function (e) {
            if (void 0 === e.type && e.pattern instanceof RegExp && (e.type = "pattern"), "function" != typeof e.validator && e.type && !S.hasOwnProperty(e.type)) throw new Error(d("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), i = t.indexOf("message");
            return -1 !== i && t.splice(i, 1), 1 === t.length && "required" === t[0] ? S.required : S[this.getType(e)] || !1
        }
    }, _.register = function (e, t) {
        if ("function" != typeof t) throw new Error("Cannot register a validator by type, validator is not a function");
        S[e] = t
    }, _.messages = b;
    t.default = _
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xly-client", attrs: {id: "app"}, on: {
                dragstart: function (e) {
                    e.preventDefault()
                }
            }
        }, [t("main-left"), this._v(" "), t("main-body")], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-aside",
            class: {dragable: e.dragable}
        }, [i("login-area", {staticClass: "none-dragable"}), e._v(" "), i("div", {staticClass: "xly-aside-nav none-dragable"}, [i("ul", e._l(e.navList, function (t) {
            return i("li", {
                key: t.key,
                staticClass: "xly-aside-nav__item",
                class: e.curNav === t.key ? "is-active" : "",
                on: {
                    mousedown: function (i) {
                        e.select(t.key)
                    }
                }
            }, ["message-page" === t.key ? i("td-badge", {
                attrs: {
                    value: t.unReadNum < 10 ? t.unReadNum : 0,
                    max: 9,
                    isDot: t.unReadNum > 0,
                    hideSup: !t.showUnRead || t.unReadNum < 1
                }
            }, [i("i", {class: t.icon}), e._v(" "), i("span", [e._v(e._s(t.content))])]) : i("td-badge", {
                attrs: {
                    value: t.unReadNum < 10 ? t.unReadNum : 0,
                    max: 9,
                    hideSup: !t.showUnRead || t.unReadNum < 1 || t.unReadNum > 9
                }
            }, [i("i", {class: t.icon}), e._v(" "), i("span", [e._v(e._s(t.content))]), e._v(" "), t.unReadNum > 9 && t.showUnRead ? i("b", {staticClass: "xly-img-more"}) : e._e()])], 1)
        }))]), e._v(" "), i("system-buttons", {staticClass: "none-dragable"})], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-client__main"}, [i("main-top-container", {
            attrs: {
                isLogined: e.isLogined,
                settingTab: e.settingTab
            }, on: {close: e.closeSettingCenter}
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.settingTab,
                expression: "!settingTab"
            }], staticClass: "xly-client__content"
        }, [i("download-panel", {
            staticClass: "xly-client__page xly-down",
            class: {"is-show": !e.findPageStyle && !e.panStyle && !e.messagePageStyle}
        }), e._v(" "), i("pan-plugin-view", {
            staticClass: "xly-client__page xly-pan",
            class: {"is-show": e.panStyle}
        }), e._v(" "), i("find-page", {
            staticClass: "xly-client__page xly-findpage",
            class: {"is-show": e.findPageStyle}
        }), e._v(" "), e.isMessagePageLoaded ? i("message-page", {
            staticClass: "xly-client__page xly-message",
            class: {"is-show": e.messagePageStyle},
            attrs: {elementId: e.messageElementId, messagePageUrl: e.messagePageUrl}
        }) : e._e()], 1), e._v(" "), e.settingTab ? i("setting-view-container") : e._e()], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-aside-personal"}, [i("td-avatar", {
            ref: "userAvatar",
            attrs: {src: e.curLoginHeaderUrl, alt: "头像"},
            nativeOn: {
                mouseenter: function (t) {
                    e.enter("head")
                }, click: function (t) {
                    e.clickUserHeader("head")
                }
            }
        }, [e.isLogin ? e._e() : i("i", {staticClass: "xly-icon-logo"})]), e._v(" "), i("div", {staticClass: "xly-aside-personal__icon"}, [e.vipData ? i("vip-icon", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin,
                expression: "isLogin"
            }],
            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(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin && !e.isCanShowOpenVipBtn && !e.overflow,
                expression: "isLogin && !isCanShowOpenVipBtn && !overflow"
            }],
            class: e.userYearIcon,
            attrs: {href: "javascript:;", visible: e.isShowYearTip, title: this.yearTipsText},
            on: {
                click: function (t) {
                    e.onClick("nian_tip")
                }
            }
        })], 1), e._v(" "), i("p", {
            ref: "userNick",
            staticClass: "xly-aside-personal__user",
            class: e.strNickCss,
            on: {
                click: function (t) {
                    e.clickUserHeader("name")
                }
            }
        }, [e._v(e._s(e.userNick))]), e._v(" "), e.isLogin && e.canShowVipText ? i("td-badge", {
            attrs: {
                value: e.badge,
                hideSup: !e.badge
            }
        }, [i()], 1) : e._e(), e._v(" "), e.isLogin ? e._e() : i()], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement;
        return (this._self._c || e)("div", {attrs: {id: "pan-18BE0BEB-6C82-4D16-83C8-5566BE72D176"}})
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-aside-operate"}, [i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.configurableButton.isShow,
                expression: "configurableButton.isShow"
            }], attrs: {href: "javascript:;", title: e.configurableButton.title}, on: {click: e.clickConfigurableButton}
        }), e._v(" "), i("a", {
            attrs: {href: "javascript:;", title: "主菜单"},
            on: {click: e.showMenu}
        }, [i("i", {staticClass: "xly-icon-menu"})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-client__header",
            class: {dragable: e.dragable}
        }, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.settingTab && "message-page" !== e.curNav,
                expression: "!settingTab && curNav !== 'message-page'"
            }], staticClass: "xly-search none-dragable"
        }, [i("td-button", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogined && "pan-plugin-view" === e.curNav || "download-panel" === e.curNav,
                expression: "(isLogined && curNav === 'pan-plugin-view') || curNav === 'download-panel'"
            }], attrs: {secondary: ""}, on: {click: e.popupMenu}
        }, [i("i", {staticClass: "xly-icon-add"}), e._v(e._s(e.buttonText) + "\n    ")]), e._v(" "), i("td-badge", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogined && "pan-plugin-view" === e.curNav,
                expression: "(isLogined && curNav === 'pan-plugin-view')"
            }], attrs: {value: e.transferringTasksCount, max: 99, hideSup: e.transferringTasksCount <= 0}
        }, [i("td-button", {
            attrs: {secondary: ""},
            on: {click: e.handleTransport}
        }, [i("span", {
            staticClass: "xly-button__icon",
            class: {"is-animation": e.transferringTasksCount > 0}
        }, [i("i", {staticClass: "xly-icon-transport-up"}), e._v(" "), i("i", {staticClass: "xly-icon-transport-down"})]), e._v("传输\n      ")])], 1), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isPopupMenu,
                expression: "isPopupMenu"
            }],
            ref: "menuButton",
            staticClass: "xly-netdisk-menu",
            staticStyle: {top: "43px", "z-index": "99"},
            attrs: {tabindex: "0"},
            on: {blur: e.onBlur}
        }, [i("ul", [i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.uploadLocalFiles}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--upload"}), e._v(" "), i("span", [e._v("本地上传")])]), e._v(" "), e.allowUploadFolder ? i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.uploadLocalDir}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--folder"}), e._v(" "), i("span", [e._v("上传文件夹")])]) : e._e(), e._v(" "), i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.addLink}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--link"}), e._v(" "), i("span", [e._v("添加链接")])]), e._v(" "), i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.addBt}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--bt"}), e._v(" "), i("span", [e._v("添加BT")])]), e._v(" "), i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.createFolder}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--file"}), e._v(" "), i("span", [e._v("新建文件夹")])])])]), e._v(" "), i("find-page-main-top", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.settingTab,
                expression: "!settingTab"
            }], attrs: {isFindPage: e.isFindPage}
        })], 1), e._v(" "), e.settingTab ? i("div", {
            staticClass: "xly-client__back none-dragable",
            on: {
                click: function (t) {
                    e.closeSettingCenter()
                }
            }
        }, [i("i", {staticClass: "xly-icon-back"}), e._v(" 返回\n  ")]) : e._e(), e._v(" "), i("div", {staticClass: "xly-client-operate none-dragable"}, [i("a", {
            staticClass: "none-dragable",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;", title: "最小化"},
            on: {click: e.minizeMainWindow}
        }, [i("i", {staticClass: "xly-icon-minimize"})]), e._v(" "), i("a", {attrs: {href: "javascript:;"}}, [i("i", {
            staticClass: "none-dragable",
            class: {"disable-hover": e.disableHover, "xly-icon-reduce": e.maximized, "xly-icon-maximize": !e.maximized},
            attrs: {title: e.maximized ? "还原" : "最大化"},
            on: {click: e.toggleMaximizeMainWindow}
        })]), e._v(" "), i("a", {
            staticClass: "none-dragable",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.closeMainWindow}
        }, [i("i", {staticClass: "xly-icon-close"})])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticStyle: {width: "calc(100vw - 100px)"}}, [i("div", {
            staticClass: "xly-browser-tab",
            style: "" + e.browserTabStyle
        }, [i("td-browser-tab", {
            attrs: {
                tabs: e.tabs,
                "tab-style": e.tabStyle,
                "pinned-min-width": 180,
                "tabs-shape": "simple",
                "unpinned-width": 180,
                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.handleMiddleClick,
                "total-click": e.handleTotalClick
            },
            nativeOn: {
                click: function (t) {
                    return e.handleClick(t)
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var n = t.index, a = t.tab;
                    return [0 === n && 0 !== e.current && -1 === e.currentCategoryId ? [i("div", {
                        ref: "progress",
                        staticClass: "xlx-browser-tab__progress"
                    }, [i("span", {staticClass: "xlx-browser-tab__progress-inner"})]), e._v(" "), i("span", {staticClass: "xlx-browser-tab__text"}, [e._v(e._s(e.titleCue))])] : e._e(), e._v(" "), e.isTabLoading(n) ? i("i", {staticClass: "icon-tab-loading"}) : e._e(), e._v(" "), i("span", {
                        directives: [{
                            name: "show",
                            rawName: "v-show",
                            value: 0 !== n || 0 === e.current || -1 !== e.currentCategoryId,
                            expression: "index !== 0 || current === 0 || currentCategoryId !== -1"
                        }], attrs: {id: 0 === n ? "recommendTab" : "", tabindex: "0"}
                    }, [e._v(e._s(a.title))])]
                }
            }])
        })], 1), e._v(" "), i("div", {
            staticClass: "xly-find",
            staticStyle: {height: "calc(100vh - 74px)"}
        }, [e.isLoaded ? i("home-page", {style: e.homepageShow}) : e._e(), e._v(" "), i("browser-view-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.currentTabIsChromium,
                expression: "currentTabIsChromium"
            }]
        })], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticStyle: {height: "100%"}}, [t("webview", {
            ref: "messagePage",
            staticClass: "iframe-message",
            staticStyle: {height: "100%"},
            attrs: {id: this.elementId, nodeintegration: "", src: this.messagePageUrl, preload: this.preloadPath}
        })], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-down"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-client-side"}, [i("ad-platform-ctrl", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.adShow,
                expression: "adShow"
            }], on: {"ad-show": e.handleAdShow}
        }), e._v(" "), e.taskDbLoadFinished ? e._e() : i("download-list-skeleton"), e._v(" "), i("download-list-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.taskDbLoadFinished && !e.showPrivateSpaceOpenPage && !e.isSearch,
                expression: "taskDbLoadFinished && !showPrivateSpaceOpenPage && !isSearch"
            }], ref: "downloadlist", attrs: {"vip-info": e.vipInfo}, nativeOn: {
                keydown: function (t) {
                    return e.keydownShowSearchUI(t)
                }
            }
        }, [i("toast-notify")], 1), e._v(" "), e.showPrivateSpaceOpenPage ? i("private-space-open-page-container") : e._e(), e._v(" "), i("status-bar-container")], 1), e._v(" "), i("task-detail")], 1)
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticStyle: {
                position: "absolute",
                left: "-10000px",
                top: "142px",
                width: "540px",
                height: "28px",
                overflow: "hidden"
            }
        }, [t("div", {
            staticStyle: {
                position: "absolute",
                left: "-10000px",
                top: "142px",
                width: "540px",
                height: "28px"
            }, attrs: {id: "webview_container"}
        })])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "setting-center"}, [i("div", {
            ref: "settinContain",
            staticClass: "xly-setting",
            on: {scroll: e.handleScroll}
        }, [i("div", {staticClass: "xly-setting-nav"}, [i("ul", {attrs: {id: "navList"}}, e._l(e.confSchema, function (t, n) {
            return i("li", {
                key: n, staticClass: "xly-setting-nav__item", on: {
                    click: function (t) {
                        e.clickTab(n)
                    }
                }
            }, [i("a", {
                class: {"is-active": e.currenIndex === n},
                attrs: {href: "javascript:;"}
            }, [e._v(e._s(t.name))])])
        }))]), e._v(" "), i("div", {staticClass: "xly-setting-wrapper"}, e._l(e.confSchema, function (t, n) {
            return i("div", {
                key: n,
                staticClass: "xly-setting-content contain-tab",
                class: t.classes,
                staticStyle: {display: "block"}
            }, [i("h3", [e._v(e._s(t.name))]), e._v(" "), i("div", {staticClass: "xly-setting-content__box"}, [i("ul", {staticClass: "xly-setting-content__vertical"}, e._l(t.children, function (t, n) {
                return i("li", {
                    key: n,
                    class: [{"xly-setting-content__item": t.children}, t.liClasses],
                    style: t.liStyles || ""
                }, [i("generator-view", {
                    attrs: {item: t, formData: e.formData},
                    on: {input: e.handleConfChange}
                }), e._v(" "), t.children ? i("div", {staticClass: "xly-setting-content__box"}, [i("ul", {class: t.ulClasses || ""}, e._l(t.children, function (t, n) {
                    return i("li", {key: n, class: t.liClasses || ""}, [i("generator-view", {
                        attrs: {
                            item: t,
                            formData: e.formData
                        }, on: {input: e.handleConfChange}
                    })], 1)
                }))]) : e._e()], 1)
            }))])])
        }))])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xly-browser-search",
            class: {"is-normal": !this.isFindPage}
        }, [t("address-bar-container", {staticClass: "none-dragable", attrs: {isFindPage: this.isFindPage}})], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return "" === e.component ? i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.show,
                expression: "show"
            }], staticClass: "xly-down-bar", on: {mousemove: e.handleMouseMove, mouseout: e.handleMouseOut}
        }, [i("p", {staticClass: "xly-down-bar__text"}, [e._v("\n    " + e._s(e.message) + "\n  ")]), e._v(" "), i("div", {staticClass: "xly-down-bar__option"}, [e.cancel ? i("a", {
            staticClass: "xly-down-bar__button",
            attrs: {href: "javascript:;"},
            on: {click: e.handleCancel}
        }, [e._v(e._s(e.cancelText))]) : e._e(), e._v(" "), i("a", {
            staticClass: "xly-down-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.handleClose}
        }, [i("i", {staticClass: "td-icon-close"})])])]) : i(e.component, {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.show,
                expression: "show"
            }],
            tag: "component",
            attrs: {isUp: e.isUp, data: e.showNotifyItem},
            on: {close: e.handleClose, ok: e.handleClose},
            nativeOn: {
                mousemove: function (t) {
                    return e.handleMouseMove(t)
                }, mouseout: function (t) {
                    return e.handleMouseOut(t)
                }
            }
        })
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-down-bar xly-down-bar--normal",
            class: {"is-large": e.isLarge},
            style: e.adBackground
        }, [i("div", {staticClass: "xly-down-bar__media"}, [e.showProgress ? [i("td-progress", {
            attrs: {
                type: "circle",
                color: "#f1c37b",
                "outer-color": "#eeebe1",
                linecap: "round",
                value: e.progress,
                width: 32,
                "stroke-width": 2
            }
        }), e._v(" "), i("img", {attrs: {src: e.iconUrl, alt: ""}})] : i("img", {
            attrs: {
                src: e.iconUrl,
                alt: ""
            }
        })], 2), e._v(" "), i("p", {
            staticClass: "xly-down-bar__text", style: e.adPColor, on: {
                click: function (t) {
                    e.onClick("content")
                }
            }
        }, [e._v(e._s(e.content))]), e._v(" "), e.isLarge ? i("div", {
            staticClass: "xly-down-bar__detail",
            domProps: {innerHTML: e._s(e.secondary)}
        }) : e._e(), e._v(" "), i("div", {staticClass: "xly-down-bar__option"}, [i("a", {
            staticClass: "xly-down-bar__button",
            style: e.adOptionAStyle,
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("btn")
                }
            }
        }, [e._v(e._s(e.btnText))]), e._v(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.closeBtnVisible,
                expression: "closeBtnVisible"
            }],
            staticClass: "xly-down-bar__close",
            style: e.adOptionAStyle,
            attrs: {href: "javascript:;", title: "关闭"},
            on: {
                click: function (t) {
                    e.onClick("close")
                }
            }
        }, [i("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xlx-side-promotion",
            style: e.isSearch ? "position: absolute; bottom: 0" : ""
        }, [i("div", {staticClass: "xlx-side-promotion__option"}, [i("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("nodisturb")
                }
            }
        }, [e._v("不再展示")]), e._v(" "), i("a", {attrs: {href: "javascript:;"}}, [i("i", {
            staticClass: "xlx-icon-close",
            on: {
                click: function (t) {
                    e.onClick("close")
                }
            }
        })])]), e._v(" "), i("a", {
            staticClass: "xlx-side-promotion__inner",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("content")
                }
            }
        }, [i("img", {attrs: {src: e.picFile, alt: ""}})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "td-tabs xly-side"}, [i("div", {staticClass: "td-tabs__title"}, [i("div", {staticClass: "td-tabs__nav"}, [i("div", {
            staticClass: "td-tabs__item",
            class: {"is-active": !1 === e.completedActive}
        }, [e._v("\n          正在下载\n          "), i("span", {staticClass: "xly-side__number"}, [e._v(e._s(e.downloadingTaskList.length || ""))])]), e._v(" "), i("div", {
            staticClass: "td-tabs__item",
            class: {"is-active": e.completedActive}
        }, [e._v("\n          已完成\n          "), i("span", {staticClass: "xly-side__number"}, [e._v(e._s(e.completedTaskList.length || ""))])]), e._v(" "), i("div", {
            staticClass: "td-tabs__item",
            class: {"is-active": !1}
        }, [e._v("\n          回收站\n          "), i("span", {staticClass: "xly-side__number"})])]), e._v(" "), e._m(0)]), e._v(" "), i("div", {staticClass: "td-tabs__content"}, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !1 === e.completedActive,
                expression: "completedActive === false"
            }], staticClass: "td-tabs__pane"
        }, [i("ul", {
            staticClass: "td-draglist",
            staticStyle: {outline: "none"}
        }, e._l(e.downloadingTaskList, function (t) {
            return i("li", {
                key: t.taskId,
                staticClass: "td-draglist-item is-transition"
            }, [i("div", {staticClass: "xly-side-item"}, [i("div", {staticClass: "xly-side-wrapper"}, [i("div", {staticClass: "td-media"}, [i("div", {staticClass: "td-media__object"}), e._v(" "), i("div", {staticClass: "td-media__content"}, [i("p", {staticClass: "xly-file-name"}, [e._v("\n                    " + e._s(t.taskName) + "\n                  ")]), e._v(" "), e._m(1, !0), e._v(" "), i("div", {staticClass: "xly-file-info"}, [e.taskError(t) ? i("p", {staticClass: "xly-file-error"}, [e._v(" ")]) : i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__finish"}, [e._v(e._s(e.formatSizeCustom(t.downloadSize)))]), i("span", {staticClass: "xly-file-size__separator"}, [e._v("/")]), i("span", {staticClass: "xly-file-size__total"}, [e._v(e._s(e.formatSizeCustom(t.fileSize)))])])]), e._v(" "), i("div", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: !e.taskError(t),
                    expression: "!taskError(item)"
                }], staticClass: "td-progress td-progress--line"
            }, [i("div", {staticClass: "td-progress-bar"}, [i("div", {staticClass: "td-progress-bar__outer"}, [i("div", {
                staticClass: "td-progress-bar__inner",
                style: e.progress(t)
            })])])])])])])])])
        }))]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.completedActive,
                expression: "completedActive"
            }], staticClass: "td-tabs__pane"
        }, [i("ul", {
            staticClass: "td-draglist",
            staticStyle: {outline: "none"}
        }, e._l(e.completedTaskList, function (t) {
            return i("li", {
                key: t.taskId,
                staticClass: "td-draglist-item is-transition"
            }, [i("div", {staticClass: "xly-side-item"}, [i("div", {staticClass: "xly-side-wrapper"}, [i("div", {staticClass: "td-media"}, [i("div", {staticClass: "td-media__object"}), e._v(" "), i("div", {staticClass: "td-media__content"}, [i("p", {staticClass: "xly-file-name"}, [e._v("\n                  " + e._s(t.taskName) + "\n                ")]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__total"}, [e._v(e._s(e.formatSizeCustom(t.fileSize)))])])])])])])])])
        }))]), e._v(" "), i("div", {
            directives: [{name: "show", rawName: "v-show", value: !1, expression: "false"}],
            staticClass: "td-tabs__pane"
        })])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-tabs__extra"}, [t("a", {attrs: {href: "javascript:;"}}, [t("i", {staticClass: "xly-icon-more"})])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-side-operate"}, [t("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "下载"}
        }, [t("i", {staticClass: "xly-icon-download"})])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement;
        return (this._self._c || e)(this.item.type, {
            tag: "component",
            style: this.item.styles,
            attrs: {item: this.item, label: this.item.label, formData: this.formData, value: this.value},
            on: {input: this.handleInput}
        })
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticStyle: {height: "100%"}}, [t("webview", {
            ref: "webview",
            staticClass: "iframe-home",
            attrs: {id: this.elementId, nodeintegration: "", src: this.homePageUrl, preload: this.preloadPath}
        })], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-client-content",
            staticStyle: {position: "relative", height: "100%"}
        }, [e.isError ? i("div", {staticClass: "xly-error"}, [i("i", {staticClass: "xly-img-404"}), e._v(" "), i("p", [e._v("您的网站已飞到了外太空")]), e._v(" "), i("div", {staticClass: "xly-error__button"}, [i("td-button", {
            attrs: {
                secondary: "",
                disabled: !e.canGoBack,
                size: "small"
            }, on: {click: e.goBack}
        }, [e._v("返回")]), e._v(" "), i("td-button", {
            attrs: {size: "small"},
            on: {click: e.refresh}
        }, [e._v("刷新")])], 1)]) : e.isLoading ? i("Loading") : e._e()], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-nav"}, [e._l(e.toolbarButtons, function (t) {
            return ["xlx-icon-nav-vip" != t.id ? i("tool-bar-button-container", {
                key: t.id,
                attrs: {
                    id: t.id,
                    imgSrc: t.imgSrc,
                    redDot: t.redDot,
                    title: t.title,
                    newIcon: t.newIcon,
                    loading: t.loading,
                    tooltip: t.tooltip,
                    tooltipTitle: t.tooltipTitle,
                    tooltipSubTitle: t.tooltipSubTitle,
                    buttonClassFilter: t.filterClass,
                    click: t.onClick,
                    tooltipClose: t.onTooltipClose,
                    tooltipClick: t.onTooltipClick,
                    enter: t.onEnter
                }
            }) : 0 === e.vipButtonPluginEnable ? i("tool-bar-vip-button-container", {
                key: t.id,
                attrs: {id: t.id, title: t.title, buttonClassFilter: t.filterClass}
            }) : e._e()]
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-status"}, [i("div", {
            staticClass: "xly-plan",
            attrs: {tabindex: "0"},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("entry")
                }, blur: e.onPopUpBlur
            }
        }, [i("p", {
            staticClass: "xly-plan__text",
            class: {"is-limit": e.isLimit}
        }, [e._v(e._s(e.entryText))]), e._v(" "), i("div", {
            staticClass: "xly-plan-menu",
            style: e.popUp ? "display:block;" : "display:none"
        }, [i("ul", {staticClass: "xly-plan-menu__main"}, [i("li", {
            staticClass: "xly-plan-menu__item",
            class: {"is-limit": e.isLimit},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("limitSpeed")
                }
            }
        }, [i("div", {staticClass: "xly-plan-menu__content"}, [i("span", {staticClass: "xly-plan-menu__text"}, [e._v(e._s(e.limitSpeetMenuText))])])]), e._v(" "), e.isLimit ? i("li", {
            staticClass: "xly-plan-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("totalSpeed")
                }
            }
        }, [e._m(0)]) : e._e()]), e._v(" "), i("ul", {staticClass: "xly-plan-menu__main"}, [i("li", {
            staticClass: "xly-plan-menu__item",
            class: {"is-chosen": e.isFreeDownload},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("freeDownload")
                }
            }
        }, [e._m(1)]), e._v(" "), i("li", {
            staticClass: "xly-plan-menu__item", on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("scheduleTask")
                }
            }
        }, [i("div", {staticClass: "xly-plan-menu__content"}, [i("span", {staticClass: "xly-plan-menu__text"}, [e._v("计划任务")]), e._v(" "), e.scheduleTaskCount > 0 ? i("span", {staticClass: "xly-plan-menu__number"}, [e._v(e._s(e.scheduleTaskCount))]) : e._e()])])]), e._v(" "), i("ul", {staticClass: "xly-plan-menu__main"}, [i("li", {staticClass: "xly-plan-menu__item xly-plan-menu__item--option"}, [i("div", {staticClass: "xly-plan-menu__content"}, [i("i", {staticClass: "td-icon"}), e._v(" "), i("span", {staticClass: "xly-plan-menu__text"}, [e._v("下载完成后:")]), e._v(" "), i("ul", {staticClass: "xly-plan-menu__tag"}, [i("li", {
            class: {"is-chosen": 0 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("shutdown")
                }
            }
        }, [e._v("关机")]), e._v(" "), i("li", {
            class: {"is-chosen": 1 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("sleep")
                }
            }
        }, [e._v("睡眠")]), e._v(" "), i("li", {
            class: {"is-chosen": 2 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("exit")
                }
            }
        }, [e._v("退出")])])])])])])]), e._v(" "), i("span", {staticClass: "xly-line"}), e._v(" "), e.canShowKuainiaoInterface ? i("div", {staticClass: "xly-status-kn"}, [i("i", {
            staticClass: "xly-icon-bird",
            on: {
                click: function (t) {
                    e.onKuainiaoTextClick("fixed_icon")
                }
            }
        }), e._v(" "), i("span", {
            on: {
                click: function (t) {
                    e.onKuainiaoTextClick("text_link")
                }
            }
        }, [e._v(e._s(e.kuaiNiaoText))]), e._v(" "), e.canShowKuainiaoTip ? i("div", {staticClass: "xly-status-kn__tooltips"}, [i("i", {
            staticClass: "xly-icon-thunder",
            on: {click: e.onKuainiaoTipClick}
        }), e._v(" "), i("span", {on: {click: e.onKuainiaoTipClick}}, [e._v(e._s(e.kuaiNiaoTipText))])]) : e._e()]) : e._e(), e._v(" "), e.canShowKuainiaoInterface ? i("span", {staticClass: "xly-line"}) : e._e(), e._v(" "), i("div", {staticClass: "xly-status-speed"}, [i("div", {staticClass: "xly-status-speed__text"}, [i("p", {on: {mouseover: e.showPop}}, [e._v(e._s(e.curSpeed))])]), e._v(" "), i("div", {staticClass: "xly-speed-pop"}, [i("ul", [i("li", {staticClass: "xly-speed-pop__item"}, [i("i", {staticClass: "xly-icon-download"}), e._v(" "), i("p", [e._v("\n            下载速度：\n            "), i("em", [e._v(e._s(e.curHoverSpeed))])])]), e._v(" "), i("li", {staticClass: "xly-speed-pop__item"}, [i("i", {staticClass: "xly-icon-upload"}), e._v(" "), i("p", [e._v("\n            上传速度：\n            "), i("em", [e._v(e._s(e.curUpSpeed))])])])]), e._v(" "), i("td-button", {
            staticClass: "td-button--other",
            on: {click: e.viewMoreData}
        }, [e._v("查看更多数据")])], 1)]), e._v(" "), e.canShowDiskBusy ? i("span", {staticClass: "xly-line"}) : e._e(), e._v(" "), e.canShowDiskBusy ? i("div", {
            staticClass: "xly-status-disk",
            on: {
                mouseenter: function (t) {
                    e.hover()
                }
            }
        }, [i("span", {staticClass: "xly-status-plan__line"}), e._v(" "), e._m(2), e._v(" "), i("div", {staticClass: "xly-status-disk__pop"}, [e._m(3), e._v(" "), i("div", {staticClass: "xly-status-disk__content"}, [i("div", {staticClass: "xly-status-disk__progress"}, [i("ul", e._l(e.diskInfo, function (t) {
            return i("li", {key: t.name}, [i("p", {staticClass: "xly-status-disk__progress-text"}, [e._v("\n                磁盘 " + e._s(t.name) + ")繁忙度：\n                "), i("span", [e._v(e._s(t.percent) + "%")])]), e._v(" "), i("td-progress", {attrs: {value: t.percent}})], 1)
        }))]), e._v(" "), i("div", {staticClass: "xly-status-disk__detail"}, [i("p", [e._v("磁盘繁忙时可能出现以下情况：")]), e._v(" "), i("ul", [i("li", [e._v("1.下载速度变慢")]), e._v(" "), i("li", [e._v("2.电脑响应变慢")]), e._v(" "), i("li", [e._v("3.下载进度卡在99.9%")]), e._v(" "), this.taskIds.length < 3 ? i("li", [e._v("您无需执行任何操作，耐心等待即可！")]) : i("li", [e._v("建议您减少同时下载的任务数量！")])])])]), e._v(" "), i("td-button", {
            staticClass: "td-button--other",
            on: {
                click: function (t) {
                    e.openTab()
                }
            }
        }, [e._v("了解磁盘繁忙原因")])], 1)]) : e._e(), e._v(" "), i("div", {staticClass: "xly-status-operate"}, [i("div", {staticClass: "xly-status-operate__item xly-status-browser"}, [i("i", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showIcon,
                expression: "showIcon"
            }], staticClass: "xly-icon-browser", on: {click: e.showBrowserGuide}
        }), e._v(" "), i("p", {staticClass: "xly-tips"}, [e._v("浏览器支持")]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showBrowserTip,
                expression: "showBrowserTip"
            }], staticClass: "xly-status-operate__tooltips"
        }, [e._v("你的" + e._s(this.browserName) + "还没支持迅雷插件\n        "), i("td-button", {
            on: {
                click: function (t) {
                    e.startBrowserGuide()
                }
            }
        }, [e._v("一键开启")]), e._v(" "), i("a", {
            attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.closeTip()
                }
            }
        }, [i("i", {staticClass: "td-icon-close"})])], 1)]), e._v(" "), i("div", {
            staticClass: "xly-status-operate__item xly-status-secret",
            class: {"is-open": e.isInPrivateSpace},
            on: {click: e.handlePrivateSpace}
        }, [i("i", {staticClass: "xly-icon-secret"}), e._v(" "), i("p", {staticClass: "xly-tips"}, [e._v(e._s(e.isInPrivateSpace ? "退出" : "进入") + "私人空间")])])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-plan-menu__content"}, [t("span", {staticClass: "xly-plan-menu__text"}, [this._v("全速下载")])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-plan-menu__content"}, [t("span", {staticClass: "xly-plan-menu__text"}, [this._v("空闲下载")])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", {staticClass: "xly-status-disk__text"}, [t("i", {staticClass: "xly-icon-disk"})])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-status-disk__title"}, [t("p", [t("i", {staticClass: "xly-icon-note"}), this._v("检测到磁盘过于繁忙！\n        ")])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = 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("...")])])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xly-down-bar"}, [n("p", {staticClass: "xly-down-bar__text"}, [e._v(e._s(e.data.getMessage()))]), e._v(" "), n("div", {staticClass: "xly-down-bar__option"}, [n("p", {staticClass: "xly-down-bar__add"}, [n("img", {
            attrs: {
                src: i(704),
                alt: "金币"
            }
        }), e._v(e._s(e.coinCount))]), e._v(" "), n("a", {
            staticClass: "xly-down-bar__button",
            attrs: {href: "javascript:;"},
            on: {click: e.handlePrize}
        }, [e._v("领取")]), e._v(" "), n("a", {
            staticClass: "xly-down-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.handleClose}
        }, [n("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            ref: "downMain",
            staticClass: "xly-down__main",
            attrs: {id: "xly-task-detail-down__main"}
        }, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 1 === e.multiChosenTaskList.length && 0 !== e.curTaskId,
                expression: "multiChosenTaskList.length === 1 && curTaskId !== 0"
            }], staticClass: "xly-down-info"
        }, [i("XlHeader", {attrs: {curTaskName: e.curTaskName}}), e._v(" "), i("div", {staticClass: "xly-down-body"}, [i("XlTab", {
            attrs: {
                curTaskId: e.curTaskId,
                curUserId: e.curUserId,
                curCategoryid: e.currentCategoryViewId,
                currentCategoryId: e.currentCategoryId
            }
        }), e._v(" "), i("scan-code", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: "Downloading" === e.currentCategoryViewId,
                expression: "currentCategoryViewId === 'Downloading'"
            }],
            attrs: {
                curTaskId: e.curTaskId,
                currentCategoryId: e.currentCategoryId,
                curCategoryViewid: e.currentCategoryViewId,
                "vip-info": e.vipInfo
            }
        }), e._v(" "), i("FileList", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isBtOrGroup,
                expression: "isBtOrGroup"
            }],
            attrs: {
                curTaskId: e.curTaskId,
                curCategroyViewID: e.currentCategoryViewId,
                currentCategoryId: e.currentCategoryId,
                operate: e.operate,
                playingMediaIndex: e.playingMediaIndex,
                playingCurTask: e.playingCurTask,
                playstate: e.playState
            }
        }), e._v(" "), i("XlDetail", {
            attrs: {
                curTaskId: e.curTaskId,
                curTaskStatus: e.curTaskStatus,
                curUserId: e.curUserId,
                curCategroyViewID: e.currentCategoryViewId,
                currentCategoryId: e.currentCategoryId
            }, on: {switchNav: e.switchNav}
        }), e._v(" "), i("Recommend", {
            attrs: {
                curTaskId: e.curTaskId,
                curUserId: e.curUserId,
                isLogined: e.isLogined,
                vipInfo: e.vipInfo
            }
        })], 1)], 1), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.multiChosenTaskList.length > 1,
                expression: "multiChosenTaskList.length > 1"
            }], staticClass: "xly-down-detail"
        }, [i("MultiChosenTasks", {
            attrs: {
                taskIds: e.multiChosenTaskList,
                curCategoryid: e.currentCategoryViewId
            }
        })], 1), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 0 === e.curTaskId && 0 === e.multiChosenTaskList.length,
                expression: "curTaskId === 0 && multiChosenTaskList.length === 0"
            }], staticClass: "xly-empty"
        }, [i("i", {staticClass: "xly-icon-logo"})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-side"}, [i("div", {staticClass: "td-tabs"}, [i("div", {staticClass: "td-tabs__title"}, [i("div", {staticClass: "td-tabs__nav"}, [i("div", {
            staticClass: "td-tabs__item",
            class: {"is-active": "Downloading" === e.currentCategoryViewId},
            on: {
                click: function (t) {
                    e.handleTitleClick("Downloading")
                }
            }
        }, [i("div", [e._v("\n            " + e._s(-1 === e.currentCategoryId ? "下载中" : "私人下载") + "\n            "), i("span", {staticClass: "xly-side__number"}, [e._v(e._s(e.downloadingTaskList.length || ""))])])]), e._v(" "), i("div", {
            staticClass: "td-tabs__item",
            class: {"is-active": "Completed" === e.currentCategoryViewId},
            on: {
                click: function (t) {
                    e.handleTitleClick("Completed")
                }
            }
        }, [i("div", [e._v("\n            " + e._s(-1 === e.currentCategoryId ? "已完成" : "私人文件") + "\n            "), i("span", {staticClass: "xly-side__number"}, [e._v(e._s(e.completedTaskList.length || ""))])])]), e._v(" "), -1 === e.currentCategoryId ? i("div", {
            staticClass: "td-tabs__item",
            class: {"is-active": "Recycle" === e.currentCategoryViewId},
            on: {
                click: function (t) {
                    e.handleTitleClick("Recycle")
                }
            }
        }, [i("div", [e._v("\n            回收站\n            "), i("span", {staticClass: "xly-side__number"}, [e._v(e._s(e.recycleTaskList.length || ""))])])]) : e._e()]), e._v(" "), i("div", {staticClass: "td-tabs__extra"}, [i("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.handleCategoryMore}
        }, [i("i", {staticClass: "xly-icon-more"})])])]), e._v(" "), i("div", {staticClass: "td-tabs__content"}, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: "Downloading" === e.currentCategoryViewId,
                expression: "currentCategoryViewId === 'Downloading'"
            }], staticClass: "td-tabs__pane"
        }, [0 === e.downloadingTaskList.length ? i("div", {
            staticClass: "xly-side__empty",
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }
            }
        }, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", [e._v(e._s(-1 === e.currentCategoryId ? "没有正在下载任务" : "暂无任务"))])]) : i("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,
                panTaskProgress: e.panTaskProgress,
                panTaskType: e.panTaskType,
                panTaskData: e.panTaskData,
                "vip-info": e.vipInfo,
                showSideNetdisk: e.showSideNetdisk,
                qrCodeConfig: e.qrCodeConfig
            },
            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(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: "Completed" === e.currentCategoryViewId,
                expression: "currentCategoryViewId === 'Completed'"
            }], staticClass: "td-tabs__pane"
        }, [0 === e.completedTaskList.length ? i("div", {
            staticClass: "xly-side__empty",
            on: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }
            }
        }, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", [e._v("没有已完成任务")])]) : i("download-category", {
            ref: "completed",
            staticClass: "xly-side-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)
                }
            }
        })], 1), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: -1 === e.currentCategoryId && "Recycle" === e.currentCategoryViewId,
                expression: "currentCategoryId === -1 && currentCategoryViewId === 'Recycle'"
            }], staticClass: "td-tabs__pane"
        }, [0 === e.recycleTaskList.length ? i("div", {
            staticClass: "xly-side__empty", on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }
            }
        }, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", [e._v("没有回收站任务")])]) : i("download-category", {
            ref: "dustbin",
            staticClass: "xly-side-deleted",
            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._v(" "), e._t("default")], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-side is-secret"}, [i("div", {staticClass: "td-tabs is-active"}, [e._m(0), e._v(" "), i("div", {staticClass: "td-tabs__content"}, [i("div", {staticClass: "td-tabs__pane"}, [i("div", {staticClass: "xly-side__empty"}, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", {staticClass: "title"}, [e._v("私人空间")]), e._v(" "), i("p", [e._v("只有自己可以查看的下载任务")]), e._v(" "), i("button", {
            staticClass: "td-button",
            on: {click: e.openPrivateSpace}
        }, [e._v("开启私人空间")])])])])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-tabs__title"}, [t("div", {staticClass: "td-tabs__item is-active"}, [t("div", [this._v("\n        私人下载"), t("span", {staticClass: "xly-side__number"})])]), this._v(" "), t("div", {staticClass: "td-tabs__item"}, [t("div", [this._v("\n            私人文件"), t("span", {staticClass: "xly-side__number"})])])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xlx-side-search",
            style: {height: e.hasLeftBottomAd ? "calc(100% - 68px)" : "100%"},
            attrs: {tabindex: "0"}
        }, [i("div", {staticClass: "xlx-search-record"}, [i("label", {staticClass: "td-input"}, [i("td-input", {
            ref: "input",
            attrs: {placeholder: "搜索下载记录", autofocus: ""},
            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 ? i("p", {staticClass: "xlx-search-record__result"}, [i("span", [e._v(e._s(e.resultCount))]), e._v("个结果\n    ")]) : e._e(), e._v(" "), i("a", {
            staticClass: "xlx-search-record__clear is-danger",
            attrs: {href: "javascript:;", title: ""},
            on: {click: e.clickCloseSearch}
        }, [i("i", {staticClass: "td-icon-close"})])]), e._v(" "), i("div", {staticClass: "xlx-search-list"}, [this.inputFlag && e.resultCount < 1 && this.curSearchKey.trim().length > 0 ? i("div", {staticClass: "xlx-side__empty"}, [i("p", [e._v("没有搜索到相关内容")])]) : i("div", {
            staticClass: "td-collapse",
            staticStyle: {height: "100%"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [e.downloadingSearchList.length > 0 ? i("div", {
            staticClass: "td-collapse-item xlx-side-downloading",
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [i("div", {staticClass: "td-collapse-item__title"}, [e._v(e._s(e.downloadingCategoryTitle))]), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("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 ? i("div", {
            staticClass: "td-collapse-item xlx-side-completed",
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [i("div", {staticClass: "td-collapse-item__title"}, [e._v(e._s(e.completedCategoryTitle))]), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("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 ? i("div", {
            staticClass: "td-collapse-item xlx-side-deleted",
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [i("div", {staticClass: "td-collapse-item__title"}, [e._v(e._s(e.recycleCategoryTitle))]), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("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()])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("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 [i(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 ? i("p", {class: e.item.tipClass}, [e._v("\n    " + e._s(e.item.tip) + "\n  ")]) : e._e()], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [e.item.listEles ? [e._l(e.item.listEles, function (t) {
            return [i("td-button", {
                key: t.name,
                class: e.classes || t.classes,
                style: t.style || "",
                attrs: {disabled: e.disabled || t.bindName && !e.formData[t.bindName].value},
                on: {
                    click: function (i) {
                        e.popDialog(t)
                    }
                }
            }, [e._v(e._s(e.text || t.text))])]
        })] : [i("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: function (t) {
                    e.popDialog(e.item)
                }
            }
        }, [e._v(e._s(e.text || e.item.text))])], e._v(" "), e._l(e.item.extEles, function (t) {
            return [i(t.type, {
                key: t.name,
                tag: "component",
                class: t.classes,
                style: t.style || "",
                attrs: {item: t, text: t.text, formData: e.formData}
            })]
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.classes}, [i("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._s(e.maxDownloadSpeed) + "   \n    最大上传速度: " + e._s(e.maxUploadSpeed) + "\n  ")])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            class: e.item.outerClass,
            style: e.item.style
        }, ["" !== e.label ? i("span", [e._v(e._s(e.label))]) : e._e(), e._v(" "), i("td-tooltip", {
            attrs: {
                content: e.tipContent,
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [i("select-native", {
            ref: "root",
            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,
                disabled: e.disabled
            },
            on: {input: e.validate, blur: e.handleOutFocus, "choose-file": e.selectPath}
        }, ["openFile" === e.item.slotOption || "openDirectory" === e.item.slotOption || "openThunderPan" === e.item.slotOption ? i("a", {
            staticClass: "xly-select__file",
            attrs: {slot: "suffix", href: "javascript:;"},
            on: {
                click: function (t) {
                    e.handleChangePath(e.item.slotOption)
                }
            },
            slot: "suffix"
        }, [i("i", {staticClass: "xly-icon-file"})]) : e._e()])], 1)], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            class: e.item.outClasses,
            style: e.item.style
        }, [i("td-tooltip", {
            attrs: {
                content: e.item.toolTipsContent || "",
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [i("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 [i(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 = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("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   "), e.item.tip ? i("span", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("ul", {class: e.item.ulClasses}, e._l(e.item.option, function (t, n) {
            return i("li", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                    expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
                }], key: n, class: e.item.classes
            }, [i("td-radio", {
                attrs: {
                    name: e.item.key,
                    value: "" + e.formData[e.item.name].value,
                    label: t,
                    disabled: e.item.disableds && e.item.disableds[n]
                }, on: {input: e.handleInput}
            }, [e._v(e._s(e.item.labels[n] || e.lable))]), e._v(" "), e.item.extEles ? i(e.item.extEles[n].type, {
                tag: "component",
                attrs: {
                    text: e.item.extEles[n].text,
                    item: e.item.extEles[n],
                    label: e.item.extEles[n] && e.item.extEles[n].label,
                    classes: e.item.extEles[n].classes,
                    disabled: e.formData[e.item.name].value !== e.item.extActiveValue,
                    name: e.item.extEles[n].name,
                    value: e.formData[e.item.extEles[n].name],
                    formData: e.formData
                },
                on: {input: e.handleInput}
            }) : e._e()], 1)
        })), e._v(" "), e.item.tip ? i("p", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", [i("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, n) {
            return e.item.extEles ? i(t.type, {
                key: n,
                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 = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.classes}, [i("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, n) {
            return e.item.extEles ? i(t.type, {
                key: n,
                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 = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = 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 = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-setting-content__part"}, [i("p", {staticClass: "xly-setting-content__text"}, [e._v("代理管理")]), e._v(" "), i("div", {staticClass: "td-table td-table--border"}, [e._m(0), e._v(" "), i("div", {staticClass: "td-table__body-wrapper"}, [i("table", {staticClass: "td-table__body"}, [e._m(1), e._v(" "), i("tbody", e._l(e.proxyList, function (t, n) {
            return t.name && t.name.length > 0 ? i("tr", {
                key: n,
                class: {"is-chosen": t === e.selectedItem},
                on: {
                    click: function (i) {
                        e.selectedItem = t
                    }
                }
            }, [i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.name))])]), e._v(" "), i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.host))])]), e._v(" "), i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.port))])]), e._v(" "), i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.type))])])]) : e._e()
        }))])])]), e._v(" "), i("div", {staticClass: "xly-setting-content__button"}, [i("div", {staticClass: "botton-wrap"}, [i("a", {
            staticClass: "td-button td-button--small",
            attrs: {href: "javascript:;"},
            on: {click: e.handleAddProxy}
        }, [e._v("添加")]), e._v(" "), i("a", {
            staticClass: "td-button td-button--other td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleModifyProxy}
        }, [e._v("修改")]), e._v(" "), i("a", {
            staticClass: "td-button td-button--other td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleDeleteProxy}
        }, [e._v("删除")])]), e._v(" "), i("div", {staticClass: "botton-wrap"}, [i("a", {
            staticClass: "td-button td-button--other 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, i = e._self._c || t;
        return i("div", {staticClass: "td-table__header-wrapper"}, [i("table", {staticClass: "td-table__header"}, [i("colgroup", [i("col", {staticClass: "xly-setting__column-1"}), e._v(" "), i("col", {
            staticClass: "xly-setting__column-2",
            attrs: {width: "126"}
        }), e._v(" "), i("col", {
            staticClass: "xly-setting__column-3",
            attrs: {width: "116"}
        }), e._v(" "), i("col", {attrs: {width: "90"}})]), e._v(" "), i("thead", [i("tr", [i("th", [i("p", {staticClass: "td-table__text"}, [e._v("名称")])]), e._v(" "), i("th", [i("p", {staticClass: "td-table__text"}, [e._v("服务器")])]), e._v(" "), i("th", [i("p", {staticClass: "td-table__text"}, [e._v("端口")])]), e._v(" "), i("th", [i("p", {staticClass: "td-table__text"}, [e._v("类型")])])])])])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("colgroup", [t("col", {staticClass: "xly-setting__column-1"}), this._v(" "), t("col", {
            staticClass: "xly-setting__column-2",
            attrs: {width: "126"}
        }), this._v(" "), t("col", {
            staticClass: "xly-setting__column-3",
            attrs: {width: "116"}
        }), this._v(" "), t("col", {attrs: {width: "90"}})])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-file-detail"}, [i("td-tabs", {
            staticClass: "xly-file-detail",
            attrs: {tabs: e.tabs, "active-key": e.activeKey},
            on: {
                "update:activeKey": function (t) {
                    e.activeKey = t
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var n = t.tab;
                    return [i(n.key, {
                        tag: "component",
                        attrs: {
                            curTaskId: e.curTaskId,
                            curUserId: e.curUserId,
                            curCategoryid: e.curCategoryid,
                            currentCategoryId: e.currentCategoryId
                        },
                        on: {tabChange: e.onTabChange}
                    })]
                }
            }, {
                key: "title", fn: function (t) {
                    var n = t.tab;
                    return i("div", {domProps: {textContent: e._s(n.title)}})
                }
            }])
        })], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-down-header"}, [t("p", {staticClass: "xly-down-header__title"}, [this._v("\n    " + this._s(this.curTaskName) + "\n  ")])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-file-source",
            class: {"is-show": e.showMore}
        }, [i("ul", {staticClass: "xly-file-source__items"}, [e.isYunGetBackTask || "PHASE_TYPE_ERROR" !== e.saveStatus ? e.isYunGetBackTask || 1 !== e.panTaskType ? e.isYunGetBackTask || 2 !== e.panTaskType ? e.isYunGetBackTask || 3 !== e.panTaskType ? e.isYunGetBackTask || 4 !== e.panTaskType ? e.isYunGetBackTask || 5 !== e.panTaskType ? e._e() : i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [i("a", {
            staticClass: "address",
            attrs: {href: "javascript:;"},
            on: {click: e.onClickPath}
        }, [e._v(e._s(e.panTaskData.title))])]), e._v(" "), e.panFileId ? i("td-button", {
            attrs: {size: "small"},
            on: {click: e.consumePanTask}
        }, [e._v(e._s(e.isSupportPlay ? "极速云播" : "查看"))]) : e._e(), e._v(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 100 !== e.panTaskProgress,
                expression: "panTaskProgress !== 100"
            }], staticClass: "td-button td-button--secondary td-button--small", attrs: {href: "javascript:;"}
        }, [i("td-progress", {attrs: {value: e.panTaskProgress}}), e._v(" "), i("span", [e._v("保存中" + e._s(e.panTaskProgress) + "%")])], 1)], 1) : i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("我的云盘")]), e._v(" "), i("p", {staticClass: "warn"}, [e._v("\n        空间不足\n        "), i("i", {
            staticClass: "xly-icon-refresh",
            attrs: {title: "刷新"},
            on: {click: e.refleshFreeSpace}
        })])]) : i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("保存到云盘，可随时查看")]), e._v(" "), i("td-button", {
            attrs: {size: "small"},
            on: {click: e.clickSave}
        }, [e._v("立即保存")])], 1) : i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("该资源无法保存到云盘")]), e._v(" "), i("td-button", {
            attrs: {
                size: "small",
                disabled: ""
            }
        }, [e._v("立即保存")])], 1) : i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("登录领取云盘空间，可极速播放")]), e._v(" "), i("td-button", {
            attrs: {size: "small"},
            on: {click: e.showLoginWnd}
        }, [e._v("立即领取")])], 1) : i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("添加到云盘失败")]), e._v(" "), i("td-button", {
            attrs: {
                size: "small",
                disabled: ""
            }
        }, [e._v("立即保存")])], 1), e._v(" "), i("li", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.isYunGetBackTask,
                expression: "!isYunGetBackTask"
            }], staticClass: "xly-file-source__item"
        }, [i("p", {staticClass: "title"}, [e._v("下载链接")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.url || "暂无下载链接"))]), e._v(" "), "" !== e.url ? i("td-button", {
            staticClass: "td-button--other",
            attrs: {secondary: "", size: "small"},
            on: {
                click: function (t) {
                    e.copyLink(e.url)
                }
            }
        }, [e._v("复制链接")]) : e._e()], 1), e._v(" "), i("li", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.isYunGetBackTask,
                expression: "!isYunGetBackTask"
            }], staticClass: "xly-file-source__item"
        }, [i("p", {staticClass: "title"}, [e._v("网址记录")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.refUrl || "暂无网址记录"))]), e._v(" "), e.refUrl ? i("td-button", {
            staticClass: "td-button--other",
            attrs: {secondary: "", size: "small"},
            on: {click: e.openUrl}
        }, [e._v("打开网址")]) : e._e()], 1), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("保存目录")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.savePath))]), e._v(" "), i("td-button", {
            staticClass: "td-button--other",
            attrs: {secondary: "", size: "small"},
            on: {click: e.openDir}
        }, [e._v("打开目录")])], 1), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("创建时间")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.createTime))])]), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("下载历时")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.downloadTimeStr))])]), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("注释")]), e._v(" "), i("p", {staticClass: "detail"}, [i("td-input", {
            attrs: {
                maxlength: "450",
                placeholder: "未填写"
            }, on: {blur: e.setDescription}, model: {
                value: e.description, callback: function (t) {
                    e.description = t
                }, expression: "description"
            }
        })], 1)])]), e._v(" "), i("div", {staticClass: "xly-file-source__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.handleShow}
        })])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-file-list"}, [i("td-table", {
            ref: "table",
            attrs: {
                columns: e.columns,
                data: e.tree,
                "default-checked-keys": e.defaultCheckedKeys,
                "disabled-keys": e.disabledKeys,
                checkable: "",
                "tree-enabled": "",
                "footer-enabled": "",
                "all-selected-disabled": e.isAllSelectedAndFinished
            },
            on: {
                "checked-change": e.onCheckedChange, checkAll: function (e) {
                }
            },
            scopedSlots: e._u([{
                key: "icon", fn: function (t) {
                    t.prop, t.value;
                    var n = t.row;
                    return [i("i", {staticClass: "xly-icon-type is-small", class: e.rowIcon(n)})]
                }
            }, {
                key: "default", fn: function (t) {
                    var n = t.prop, a = (t.value, t.row);
                    return ["name" === n ? [i("span", {
                        class: {
                            "is-unread": e.isUnread(a) && !a.data.errMessage,
                            "is-active": e.isComplete(a) && !a.data.errMessage
                        }, attrs: {title: a.name}, on: {
                            click: function (t) {
                                e.onClickName(a)
                            }
                        }
                    }, [e._v(e._s(a.name))])] : "fileSize" === n ? [e._v(e._s(e.formatSize(a.data.fileSize)))] : "progress" === n ? [a.data.errMessage ? [i("span", {
                        staticClass: "xly-file-list__status is-error",
                        attrs: {title: a.data.errMessage}
                    }, [e._v("\n            失败\n            "), i("td-tooltip", {
                        attrs: {
                            content: a.data.errMessage,
                            trigger: "hover"
                        }
                    }, [i("i", {staticClass: "xly-icon-note"})])], 1)] : a.data.isDelete ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("已删除")])] : "branch" === a.type ? [e.haveSelectItem(a) ? [a.data.isAllDownloadItemFinished && 1 === e.getProgress(a) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("完成")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", {
                        staticClass: "xly-icon-open-small", attrs: {title: "打开文件夹"}, on: {
                            click: function (t) {
                                e.openDir(a)
                            }
                        }
                    })])] : 1 === e.getProgress(a) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("99.99%")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : e._e()])] : [i("span", {staticClass: "xly-file-list__status"}, [e._v(e._s((100 * e.getProgress(a) || 0).toFixed(2)) + "%")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : e._e()])]] : [i("span", {staticClass: "xly-file-list__status is-disabled"}, [e._v("不下载")])]] : e.isComplete(a) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("完成")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.playingCurTask && a.data.index === e.playingMediaIndex && e.playstate > 1 && e.playstate < 6 ? i("i", {staticClass: "xly-gif-playing"}) : e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", {
                        staticClass: "xly-icon-file-small", attrs: {title: "打开文件"}, on: {
                            click: function (t) {
                                e.openFile(a)
                            }
                        }
                    })])] : e.checkedKeys.includes(a.key) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v(e._s((100 * e.getProgress(a)).toFixed(2)) + "%")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) && e.playingCurTask && a.data.index === e.playingMediaIndex && e.playstate > 1 && e.playstate < 6 ? i("i", {staticClass: "xly-gif-playing"}) : e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : e._e()])] : [i("span", {staticClass: "xly-file-list__status is-disabled"}, [e._v("不下载")])]] : e._e()]
                }
            }])
        }, [i("td-button", {
            staticClass: "other",
            attrs: {
                slot: "footer",
                secondary: "",
                size: "small",
                disabled: !(e.selectedFailedSubFileRetryDownload || e.checkedKeys.length && e.editingSelected)
            },
            on: {click: e.downloadSelected},
            slot: "footer"
        }, [e._v("下载选中文件")])], 1)], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-down-detail"}, [e.taskIds.length > 1 ? i("div", {staticClass: "xly-download-file is-more"}, [e.taskIds.length > 2 ? i("multi-chosen-item", {
            staticClass: "is-secondary",
            attrs: {taskId: e.taskIds[e.taskIds.length - 3]}
        }) : e._e(), e._v(" "), i("multi-chosen-item", {
            staticClass: "is-first",
            attrs: {taskId: e.taskIds[e.taskIds.length - 2]}
        }), e._v(" "), i("multi-chosen-item", {
            staticClass: "is-show",
            attrs: {taskId: e.taskIds[e.taskIds.length - 1]}
        })], 1) : e._e(), e._v(" "), i("div", {staticClass: "xly-down-detail__text"}, [i("p", [e._v("已选择" + e._s(e.taskIds.length) + "个项目")])]), e._v(" "), "Downloading" === e.curCategoryid ? i("div", {staticClass: "xly-down-detail__button"}, [e.hasStartedTask ? e._e() : i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.start}
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 全部下载")]), e._v(" "), e.hasStartedTask ? i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.stop}
        }, [i("i", {staticClass: "xly-icon-pause"}), e._v(" 全部暂停")]) : e._e(), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.remove}
        }, [i("i", {staticClass: "xly-icon-delete"}), e._v(" " + e._s(this.removeText))]), e._v(" "), i("button", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showCopy,
                expression: "showCopy"
            }], staticClass: "td-button td-button--other td-button--small", on: {click: e.copyLinks}
        }, [i("i", {staticClass: "xly-icon-link-bold"}), e._v(" 复制链接")]), e._v(" "), i("div", {staticClass: "xly-down-detail__more"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-more-drop"}, [i("ul", [i("li", {on: {click: e.move2Dir}}, [e._v("移动文件到")]), e._v(" "), i("li", {on: {click: e.copy2Dir}}, [e._v("复制文件到")])])])])]) : "Completed" === e.curCategoryid ? i("div", {staticClass: "xly-down-detail__button"}, [i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.remove}
        }, [i("i", {staticClass: "xly-icon-delete"}), e._v(" 删除")]), e._v(" "), i("button", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showCopy,
                expression: "showCopy"
            }], staticClass: "td-button td-button--other td-button--small", on: {click: e.redownloadTask}
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 重新下载")]), e._v(" "), i("button", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showCopy,
                expression: "showCopy"
            }], staticClass: "td-button td-button--other td-button--small", on: {click: e.copyLinks}
        }, [i("i", {staticClass: "xly-icon-link-bold"}), e._v(" 复制链接")]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.hasUnRemoveTask,
                expression: "hasUnRemoveTask"
            }], staticClass: "xly-down-detail__more"
        }, [e._m(1), e._v(" "), i("div", {staticClass: "xly-more-drop"}, [i("ul", [i("li", {on: {click: e.move2Dir}}, [e._v("移动文件到")]), e._v(" "), i("li", {on: {click: e.copy2Dir}}, [e._v("复制文件到")])])])])]) : "Recycle" === e.curCategoryid ? i("div", {staticClass: "xly-down-detail__button"}, [i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.restore}
        }, [i("i", {staticClass: "xly-icon-restore"}), e._v(" 还原")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.destroy}
        }, [i("i", {staticClass: "xly-icon-delete"}), e._v(" 彻底删除")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.redownloadTask}
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 重新下载")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.copyLinks}
        }, [i("i", {staticClass: "xly-icon-link-bold"}), e._v(" 复制链接")])]) : e._e()])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("button", {staticClass: "td-button td-button--other td-button--small"}, [t("i", {staticClass: "xly-icon-more"}), this._v(" 更多")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("button", {staticClass: "td-button td-button--other td-button--small"}, [t("i", {staticClass: "xly-icon-more"}), this._v(" 更多")])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return 0 !== e.movieConfig.yingyuan_dl_recommend && e.filterRecommendList && 0 !== e.filterRecommendList.length ? i("div", {staticClass: "xly-recommend"}, [i("div", {staticClass: "xly-recommend__title"}, [i("h3", [e._v("为你推荐")]), e._v(" "), 1 === e.movieConfig.yingyuan_dl_recommend ? i("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.showHomePage("v_pc_xlx_ggong_dl_detail_vipsp")
                }
            }
        }, [e._v("查看更多>")]) : i("div", {
            staticClass: "xly-recommend__more",
            attrs: {outline: "0", tabindex: "0"},
            on: {blur: e.hideShowMore}
        }, [i("i", {
            staticClass: "xly-icon-more",
            on: {click: e.handleShowMore}
        }), e._v(" "), e.showMore ? i("div", {staticClass: "xly-more-drop"}, [i("ul", [i("li", {
            on: {
                click: function (t) {
                    e.showHomePage("v_pc_xlx_ggong_dl_detail_vipsp")
                }
            }
        }, [e._v("查看更多")]), e._v(" "), i("li", {on: {click: e.handleShowList}}, [e._v(e._s(e.showList ? "收起" : "展开"))])])]) : e._e()])]), e._v(" "), e.showList ? i("div", {staticClass: "xly-recommend__list"}, [i("ul", e._l(e.filterRecommendList, function (t, n) {
            return i("li", {
                key: t.xl_id || t.ctime, staticClass: "xly-recommend__item", on: {
                    click: function (i) {
                        e.openMoviePage(t.player_site, n)
                    }
                }
            }, [i("div", {staticClass: "xly-recommend__image"}, [i("img", {
                attrs: {
                    src: t.cover || t.hor_cover,
                    alt: t.title,
                    title: t.title
                }
            })]), e._v(" "), i("p", {staticClass: "xly-recommend__text"}, [e._v(e._s(t.work_name || ""))])])
        }))]) : e._e()]) : e._e()
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("td-list", {
            attrs: {
                list: e.loadedListWithKey,
                multiple: "",
                drop: "",
                sortable: e.sortable,
                sortByHandler: "",
                handleClassList: ["is-chosen", "is-active", "xly-side-operate", "xly-icon-type", "xly-file-error", "xly-file-size", "xly-file-percent", "xly-file-status", "xly-file-name"],
                "click-to-focus": e.sortable,
                "drag-selectable": "",
                "chosen-keys": e.selectedTaskIds,
                "load-more": e.loadMore,
                "scroll-speed": 6
            },
            on: {
                "update:chosenKeys": e.handleSelectChange,
                "update:list": e.handleListChange,
                "on-sorting": e.handleSorting,
                "on-sort-end": e.handleSortEnd
            },
            nativeOn: {
                scroll: function (t) {
                    return e.handleScroll(t)
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var n = t.item, a = t.index, o = t.chosen, r = t.active;
                    return [i(e.componentName, {
                        tag: "component",
                        attrs: {
                            enbaleVipPlugin: e.enbaleVipPlugin,
                            taskId: n.key,
                            itemType: e.itemType,
                            sharedKeyWords: e.sharedKeyWords,
                            pulseForRename: e.pulseForRename,
                            currentCategoryId: e.currentCategoryId,
                            currentCategoryViewId: e.currentCategoryViewId,
                            deleted: e.deleted[n.key],
                            opened: e.opened[n.key],
                            dataChecking: e.dataChecking[n.key],
                            chosen: o,
                            active: r,
                            index: a,
                            fileTransferTooltip: e.fileTransferTooltipVisible[n.key],
                            panTaskProgress: e.panTaskProgress,
                            panTaskType: e.panTaskType,
                            panTaskData: e.panTaskData,
                            showSideNetdisk: e.showSideNetdisk,
                            accelerationTimes: e.accelerationTimes,
                            isFirstShowScanCode: e.isFirstShowScanCode,
                            qrCodeConfig: e.qrCodeConfig,
                            "vip-info": e.vipInfo,
                            saveStatus: e.saveStatus
                        },
                        on: {
                            "update:deleted": function (t) {
                                e.$set(e.deleted, n.key, t)
                            },
                            "update:opened": function (t) {
                                e.$set(e.opened, n.key, t)
                            },
                            "update:dataChecking": function (t) {
                                e.$set(e.dataChecking, n.key, t)
                            },
                            "update:fileTransferTooltip": function (t) {
                                e.$set(e.fileTransferTooltipVisible, n.key, t)
                            },
                            "update:accelerationTimes": function (t) {
                                e.accelerationTimes = t
                            },
                            "update:isFirstShowScanCode": e.updateFirstShowScanCode,
                            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 = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement;
        return (this._self._c || e)("i", {class: this.classes, attrs: {title: this.text}})
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return e.useNative ? i("select", {
            ref: "selectNative",
            staticClass: "xly-select",
            on: {change: e.onSelect}
        }, e._l(e.filterOptions, function (t) {
            return i("option", {key: t, domProps: {value: t}}, [e._v(e._s(t))])
        })) : i("td-select", e._g(e._b({
            ref: "select",
            attrs: {value: e.value, options: e.filterOptions, position: e.position}
        }, "td-select", e.$attrs, !1), e.$listeners), [e._t("suffix", null, {slot: "suffix"}), e._v(" "), e._t("append", null, {slot: "append"})], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("td-slider", {
            attrs: {
                value: e.sliderValue,
                marks: e.item.marks,
                scales: e.item.scales,
                disabled: e.disabled
            }, on: {input: e.handleSliderUpdate}
        }), e._v(" "), i("div", {staticClass: "xlx-dialog-setting__speed-input"}, [i("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(" "), i("popup", {
            ref: "tooltip",
            staticClass: "td-tooltip",
            attrs: {direction: "top", display: e.tooltipVisible, padding: 10},
            on: {
                "update:display": function (t) {
                    e.tooltipVisible = t
                }
            }
        }, [i("p", {staticClass: "td-tooltip__inner"}, [e._v(e._s(e.tooltip))])]), e._v(" "), i("span", {staticClass: "xlx-setting__text"}, [e._v("KB/s")])], 1)], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-dialog-setting__speed-time"}, [i("ul", e._l(e.data, function (t) {
            return i("li", {
                key: t.label,
                staticClass: "xlx-dialog-setting__item"
            }, [i("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s(t.label))]), e._v(" "), e._l(t.options, function (t) {
                return i("div", {
                    key: t.index,
                    staticClass: "xlx-dialog-setting__option"
                }, [i("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,
                        useNative: !1
                    },
                    on: {
                        input: function (i) {
                            return e.handleInput(i, t.index)
                        }
                    }
                }), e._v(" "), i("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s("hour" === t.type ? "时" : "分"))])], 1)
            })], 2)
        }))])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("ul", {class: e.item.ulClasses}, e._l(e.item.extEles, function (t, n) {
            return i("li", {key: n, class: e.item.classes}, [t ? i(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 ? i("p", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-nav__item"}, [i("a", {
            staticClass: "xlx-nav-operate",
            class: {"is-disabled": e.disabled, "is-new": e.redDot},
            attrs: {href: "javascript:;", title: e.title},
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, ["" === e.customClass ? i("img", {attrs: {src: e.imgSrc}}) : i("i", {class: e.customClass}), e._v(" "), e.newIcon ? i("i", {staticClass: "xlx-icon-new1"}) : e._e()]), e._v(" "), e.loading ? i("div", {
            staticClass: "connecting",
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, [i("i", {staticClass: "xlx-icon-loading"})]) : e._e(), e._v(" "), e.tooltip ? i("div", {staticClass: "xlx-nav-tooltip"}, [i("div", {
            staticClass: "xlx-nav-tooltip__inner",
            on: {click: e.handleToolTipClick}
        }, [i("p", [e._v("\n        " + e._s(e.tooltipTitle) + "\n        "), i("br"), e._v(" "), i("span", [e._v(e._s(e.tooltipSubTitle))])])]), e._v(" "), i("a", {
            staticClass: "xlx-nav-tooltip__close",
            attrs: {href: "javascript:;"},
            on: {click: e.handleToolTipClose}
        }, [i("i", {staticClass: "td-icon-close"})])]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-nav__item"}, [i("a", {
            staticClass: "xlx-nav-operate",
            class: e.filterClass,
            attrs: {href: "javascript:;", title: e.handleTitle},
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, ["" == e.vipIcon ? i("i", {class: e.id}) : i("img", {
            attrs: {src: e.vipIcon},
            on: {error: e.handleError}
        })])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showScancode,
                expression: "showScancode"
            }]
        }, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.accelerationTimes > 0 && "" !== e.shortlink && !e.isAccelerating,
                expression: "accelerationTimes > 0 && shortlink !== '' && !isAccelerating"
            }], staticClass: "xly-detail-code", class: {"is-show": e.needShowMore}
        }, [i("div", {staticClass: "xly-detail-code__inner"}, [i("div", {staticClass: "xly-detail-code__main"}, [i("div", {
            staticClass: "xly-detail-code__image",
            on: {mouseenter: e.handleQRCodeHover}
        }, [e._v(e._s(e.qrcodeConfig.right_panel_text) + " \n          "), i("i", {staticClass: "xly-icon-code"}), e._v(" "), i("i", {staticClass: "xly-icon-arrow-right"}), e._v(" "), i("div", {staticClass: "xly-detail-code__drop"}, [i("canvas", {
            staticStyle: {
                height: "72px",
                width: "72px"
            }, attrs: {id: "hoverCodeAcceleration"}
        }), e._v(" "), i("p", [e._v(e._s(e.qrcodeConfig.text))])])])]), e._v(" "), i("div", {staticClass: "xly-detail-code__side"}, [e.days < 3 ? i("p", {staticClass: "is-note"}, [e._v(e._s(e.days) + "天后过期")]) : i("p", [e._v("本周加速次数剩余")]), e._v(" "), i("div", {staticClass: "xly-detail-code__tag"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-detail-code__number"}, [e._v(e._s(e.accelerationTimes))])]), e._v(" "), i("i", {
            staticClass: "xly-icon-help",
            on: {click: e.handleClickHelp}
        })])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__show"
        }, [i("canvas", {
            staticStyle: {height: "58px", width: "58px"},
            attrs: {id: "showCodeAcceleration"}
        }), e._v(" "), i("p", [e._v(e._s(e.qrcodeConfig.zerotype_text))])]), e._v(" "), i("div", {staticClass: "xly-detail-code__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.showMore}
        })])]), e._v(" "), e.curTaskStatus <= 5 && e.isAccelerating && "" === e.shortlink && !e.isHuddleOrTry ? i("div", {
            staticClass: "xly-detail-code",
            class: {"is-show": e.needShowMore}
        }, [i("div", {staticClass: "xly-detail-code__inner"}, [i("div", {staticClass: "xly-detail-code__main"}, [e._v(e._s(e.curTaskStatus > 3 ? "全力加速中..." : "准备加速中...")), !e.needShowMore && e.curTaskStatus > 3 ? i("b", {staticClass: "is-note"}, [e._v(e._s(e.vipSpeed))]) : e._e()]), e._v(" "), i("div", {staticClass: "xly-detail-code__side"}, [e.days < 3 ? i("p", {staticClass: "is-note"}, [e._v(e._s(e.days) + "天后过期")]) : i("p", [e._v("本周加速次数剩余")]), e._v(" "), i("div", {staticClass: "xly-detail-code__tag"}, [e._m(1), e._v(" "), i("div", {staticClass: "xly-detail-code__number"}, [e._v(e._s(e.accelerationTimes))])]), e._v(" "), i("i", {
            staticClass: "xly-icon-help",
            on: {click: e.handleClickHelp}
        })])]), e._v(" "), e.curTaskStatus <= 3 ? i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__show"
        }, [i("i", {staticClass: "xly-img-code"}), e._v(" "), i("p", [e._v("当前任务正在排队中, 稍后自动开启")])]) : i("ul", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__info"
        }, [i("li", [i("td-media", [i("i", {
            staticClass: "xly-icon-speed-1",
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", [e._v("加  速： "), i("b", [e._v(e._s(e.vipSpeed))])])])], 1), e._v(" "), i("li", [i("td-media", [i("i", {
            staticClass: "xly-icon-speed",
            attrs: {slot: "media"},
            slot: "media"
        }), e._v("\n          已用流量： "), i("td-progress", {attrs: {value: e.progress}}), e._v(" "), i("b", [e._v(e._s(e.offlineNumber) + "/" + e._s(e.allOfflineSize))])], 1)], 1)]), e._v(" "), i("div", {staticClass: "xly-detail-code__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.showMore}
        })])]) : [6, 7].includes(e.curTaskStatus) && e.isAccelerating && "" === e.shortlink && !e.isHuddleOrTry ? i("div", {
            staticClass: "xly-detail-code",
            class: {"is-show": e.needShowMore}
        }, [i("div", {staticClass: "xly-detail-code__inner"}, [i("div", {staticClass: "xly-detail-code__main"}, [e._v("加速已暂停")]), e._v(" "), i("div", {staticClass: "xly-detail-code__side"}, [e.days < 3 ? i("p", {staticClass: "is-note"}, [e._v(e._s(e.days) + "天后过期")]) : i("p", [e._v("本周加速次数剩余")]), e._v(" "), i("div", {staticClass: "xly-detail-code__tag"}, [e._m(2), e._v(" "), i("div", {staticClass: "xly-detail-code__number"}, [e._v(e._s(e.accelerationTimes))])]), e._v(" "), i("i", {
            staticClass: "xly-icon-help",
            on: {click: e.handleClickHelp}
        })])]), e._v(" "), i("ul", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__info"
        }, [i("li", [i("td-media", [i("i", {
            staticClass: "xly-icon-speed-1",
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", [e._v("加   速： "), i("b", [e._v("-")])])])], 1), e._v(" "), i("li", [i("td-media", [i("i", {
            staticClass: "xly-icon-speed",
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", [e._v("剩余流量： "), i("b", [e._v(e._s(e.remainSize) + "/" + e._s(e.allOfflineSize))])])])], 1)]), e._v(" "), i("div", {staticClass: "xly-detail-code__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.showMore}
        })])]) : e.curTaskStatus < 8 && e.hasAccelerated && "" === e.shortlink ? i("div", {
            staticClass: "xly-detail-code",
            class: {"is-show": e.needShowMore}
        }, [i("div", {staticClass: "xly-detail-code__inner"}, [i("div", {staticClass: "xly-detail-code__main"}, [e._v("加速完成"), e.needShowMore ? e._e() : i("span", {staticClass: "is-note"}, [e._v("节省了" + e._s(e.saveTimeStr))])]), e._v(" "), i("div", {staticClass: "xly-detail-code__side"}, [e.days < 3 ? i("p", {staticClass: "is-note"}, [e._v(e._s(e.days) + "天后过期")]) : i("p", [e._v("本周加速次数剩余")]), e._v(" "), i("div", {staticClass: "xly-detail-code__tag"}, [e._m(3), e._v(" "), i("div", {staticClass: "xly-detail-code__number"}, [e._v(e._s(e.accelerationTimes))])]), e._v(" "), i("i", {
            staticClass: "xly-icon-help",
            on: {click: e.handleClickHelp}
        })])]), e._v(" "), i("ul", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__info"
        }, [i("li", [i("td-media", [i("i", {
            staticClass: "xly-icon-time",
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", [e._v("节省时间： "), i("b", [e._v(e._s(e.saveTimeStr))])])])], 1), e._v(" "), i("li", [i("td-media", [i("i", {
            staticClass: "xly-icon-peak-download",
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", [e._v("峰值速度： "), i("b", [e._v(e._s(e.maxSpeedStr))])])])], 1)]), e._v(" "), i("div", {staticClass: "xly-detail-code__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.showMore}
        })])]) : "" === e.shortlink && e.isHuddleOrTry && e.isAccelerating ? i("div", {
            staticClass: "xly-detail-code",
            class: {"is-show": e.needShowMore}
        }, [i("div", {staticClass: "xly-detail-code__inner"}, [i("div", {staticClass: "xly-detail-code__main"}, [e._v("准备加速中")]), e._v(" "), i("div", {staticClass: "xly-detail-code__side"}, [e.days < 3 ? i("p", {staticClass: "is-note"}, [e._v(e._s(e.days) + "天后过期")]) : i("p", [e._v("本周加速次数剩余")]), e._v(" "), i("div", {staticClass: "xly-detail-code__tag"}, [e._m(4), e._v(" "), i("div", {staticClass: "xly-detail-code__number"}, [e._v(e._s(e.accelerationTimes))])]), e._v(" "), i("i", {
            staticClass: "xly-icon-help",
            on: {click: e.handleClickHelp}
        })])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__show"
        }, [i("i", {staticClass: "xly-img-code"}), e._v(" "), i("p", [e._v("其他加速结束后, 会重新帮您开启哦~")])]), e._v(" "), i("div", {staticClass: "xly-detail-code__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.showMore}
        })])]) : e.accelerationTimes <= 0 ? i("div", {
            staticClass: "xly-detail-code",
            class: {"is-show": e.needShowMore}
        }, [i("div", {staticClass: "xly-detail-code__inner"}, [i("div", {staticClass: "xly-detail-code__main"}, [e._v(e._s(e.qrcodeConfig.right_panel_text))]), e._v(" "), i("div", {staticClass: "xly-detail-code__side"}, [i("p", [e._v("本周次数已用完")]), e._v(" "), i("div", {staticClass: "xly-detail-code__tag"}, [e._m(5), e._v(" "), i("div", {staticClass: "xly-detail-code__number"}, [e._v(e._s(e.accelerationTimes))])]), e._v(" "), i("i", {
            staticClass: "xly-icon-help",
            on: {click: e.handleClickHelp}
        })])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.needShowMore,
                expression: "needShowMore"
            }], staticClass: "xly-detail-code__show"
        }, [i("i", {staticClass: "xly-img-code"}), e._v(" "), i("p", [e._v(e._s(e.nextDate))])]), e._v(" "), i("div", {staticClass: "xly-detail-code__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.showMore}
        })])]) : e._e()])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-detail-code__icon"}, [t("i")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-detail-code__icon"}, [t("i")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-detail-code__icon"}, [t("i")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-detail-code__icon"}, [t("i")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-detail-code__icon"}, [t("i")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-detail-code__icon"}, [t("i")])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            ref: "playerArea",
            staticClass: "xly-preview",
            attrs: {id: "xly-task-detail-preview"}
        }, [i("div", {
            directives: [{name: "show", rawName: "v-show", value: e.showPlay, expression: "showPlay"}],
            staticClass: "xly-preview__play",
            class: {"is-animation": e.isAnimation},
            on: {click: e.play}
        }, [i("i", {staticClass: "xly-icon-play-detail"}), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showDownAndPlay,
                expression: "showDownAndPlay"
            }], staticStyle: {display: "flex"}
        }, [i("span", {staticClass: "text-1"}, [e._v("边")]), e._v(" "), i("span", {staticClass: "text-2"}, [e._v("下")]), e._v(" "), i("span", {staticClass: "text-3"}, [e._v("边")]), e._v(" "), i("span", {staticClass: "text-4"}, [e._v("播")])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.showDownAndPlay,
                expression: "!showDownAndPlay"
            }], staticStyle: {display: "flex"}
        }, [i("span", {staticClass: "text-1"}, [e._v("立")]), e._v(" "), i("span", {staticClass: "text-2"}, [e._v("即")]), e._v(" "), i("span", {staticClass: "text-3"}, [e._v("播")]), e._v(" "), i("span", {staticClass: "text-4"}, [e._v("放")])]), e._v(" "), i("i", {staticClass: "line"})]), e._v(" "), i("VideoState", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.showPlay,
                expression: "!showPlay"
            }], attrs: {isEmbed: !0, beginForceLoading: e.beginForceLoading}, on: {
                "video-state-change": function (t) {
                    e.checkUIChange()
                }
            }
        })], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-attribute"}, [i("div", {staticClass: "xly-attribute__chart"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-attribute__chart-text"}, [i("p", {staticClass: "title"}, [e._v("文件大小")]), e._v(" "), i("p", {staticClass: "number"}, [e._v(e._s(e.formatSize(e.fileSize)))])])]), e._v(" "), i("div", {staticClass: "xly-attribute__detail"}, [i("ul", [i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--natural"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("原始资源")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.originPercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.originSize)))])]), e._v(" "), i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--mirror"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("镜像加速")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.p2sPercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.p2sSize)))])]), e._v(" "), i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--p2p"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("P2P加速")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.p2pPercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.p2pSize)))])]), e._v(" "), i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--vip"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("会员加速")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.offlinePercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.offlineSize)))])])])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xly-attribute-pei",
            staticStyle: {
                "-webkit-tap-highlight-color": "transparent",
                "user-select": "none",
                background: "transparent"
            },
            attrs: {id: "chart", _echarts_instance_: "ec_1591328778127"}
        }, [t("div", {
            staticStyle: {
                position: "relative",
                overflow: "hidden",
                width: "200px",
                height: "200px",
                padding: "0px",
                margin: "0px",
                "border-width": "0px"
            }
        }, [t("canvas", {
            staticStyle: {
                position: "absolute",
                left: "0px",
                top: "0px",
                width: "200px",
                height: "200px",
                "user-select": "none",
                "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)",
                padding: "0px",
                margin: "0px",
                "border-width": "0px"
            }, attrs: {width: "200", height: "200", "data-zr-dom-id": "zr_0"}
        })])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "td-media"}, [i("div", {staticClass: "td-media__object"}, [i("i", {
            staticClass: "xly-icon-type",
            class: e.iconType
        })]), e._v(" "), i("div", {staticClass: "td-media__content"}, [i("p", {staticClass: "xly-file-name"}, [e._v(e._s(e.taskName))]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [e._v(e._s(e.fileSize))]), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.displayTime))])])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: {"xmpc-player": e.isEmbed}}, [e.isCanShowPage("codec") ? i("div", {staticClass: "xmpc-loading"}, [i("div", {staticClass: "xmpc-loading-down"}, [i("p", [e._v("\n        正在下载解码器\n        "), i("span", [e._v(e._s(e.fileName))])]), e._v(" "), i("div", {staticClass: "xmpc-loading-progress"}, [i("div", {staticClass: "xmpc-loading-progress__outer"}, [i("div", {
            staticClass: "xmpc-loading-progress__inner",
            style: e.progressStye
        })]), e._v(" "), i("p", {staticClass: "xmpc-loading-progress__text"}, [e._v(e._s(e.downloadProgress))])]), e._v(" "), i("button", {
            staticClass: "xmpc-button xmpc-button--fail",
            on: {click: e.cancelDownload}
        }, [e._v("取消")])])]) : e.isCanShowPage("error") ? i("div", {staticClass: "xmpc-loading__fail"}, [i("p", {staticClass: "xmpc-loading__fail-title"}, [i("i", {staticClass: "xmpc-icon-note-bold"}), e._v("\n      " + e._s(e.errorText) + "\n    ")]), e._v(" "), i("p", {staticClass: "xmpc-loading__fail-detail"}, [e._v("\n      错误码：\n      "), i("span", [e._v(e._s(e.errCode))])]), e._v(" "), i("button", {
            staticClass: "xmpc-button xmpc-button--fail",
            on: {click: e.onHangleRetry}
        }, [e._v("重试")])]) : e.isCanShowPage("yunbo_vip") ? i("div", {staticClass: "xmpc-loading is-super"}, [i("div", {staticClass: "xmpc-loading__icon"}), e._v(" "), i("p", {staticClass: "xmpc-loading__text"}, [e._v("\n      正在尊享会员视频高速加载\n      "), i("span", [e._v("（" + e._s(e.speedText) + "/s ）")])]), e._v(" "), i("div", {staticClass: "xmpc-loading__progress"})]) : e.isCanShowPage("yobon_novip") ? i("div", {staticClass: "xmpc-loading"}, [i("div", {staticClass: "xmpc-loading__icon"}), e._v(" "), i("p", {staticClass: "xmpc-loading__text"}, [e._v("\n      正在努力加载视频\n      "), i("span", [e._v("（" + e._s(e.speedText) + "/s ）")])]), e._v(" "), i("div", {staticClass: "xmpc-loading__vip"}, [e._v("\n      会员尊享视频高速加载特权\n      "), i("button", {
            staticClass: "xmpc-button xmpc-button--small",
            on: {
                click: function (t) {
                    e.openPayVip(!0)
                }
            }
        }, [e._v("立即开通")])])]) : e.isCanShowPage("play_and_download_vip") ? i("div", {staticClass: "xmpc-loading"}) : e.isCanShowPage("play_and_download_novip") ? i("div", {staticClass: "xmpc-loading"}) : e.isCanShowPage("local_play") ? i("div", {staticClass: "xmpc-loading"}, [i("div", {staticClass: "xmpc-loading__icon"}), e._v(" "), i("p", {staticClass: "xmpc-loading__text"}, [e._v("播放启动中...")])]) : e.isCanShowPage("back_to_embed") ? i("div", {staticClass: "xmpc-loading"}, [i("div", {staticClass: "xmpc-loading__back"}, [i("p", [e._v("当前视频独立窗口播放中")]), e._v(" "), i("button", {
            staticClass: "xmpc-button",
            on: {click: e.backToEmbed}
        }, [i("i", {staticClass: "xmpc-icon-arrow"}), e._v(" 切回此处播放\n      ")])])]) : e.isCanShowPage("nothing") ? i("div") : e._e(), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isCanShowPageEx("play_and_download_vip"),
                expression: "isCanShowPageEx('play_and_download_vip')"
            }], staticClass: "xmpc-loading"
        }, [i("div", {staticClass: "xmpc-loading__icon"}), e._v(" "), i("p", {staticClass: "xmpc-loading__text"}, [e._v("\n      边下边播加载中\n      "), i("span", [e._v("（" + e._s(e.speedText) + "/s ）")])])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isCanShowPageEx("play_and_download_novip"),
                expression: "isCanShowPageEx('play_and_download_novip')"
            }], staticClass: "xmpc-loading"
        }, [i("div", {staticClass: "xmpc-loading__icon"}), e._v(" "), i("p", {staticClass: "xmpc-loading__text"}, [e._v("\n      正在努力加载视频\n      "), i("span", [e._v("（" + e._s(e.speedText) + "/s ）")])]), e._v(" "), i("div", {staticClass: "xmpc-loading__vip"}, [e._v("\n      会员尊享视频高速加载特权\n      "), i("button", {
            staticClass: "xmpc-button xmpc-button--small",
            on: {
                click: function (t) {
                    e.openPayVip(!1)
                }
            }
        }, [e._v("立即开通")])])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            ref: "canvasBox",
            staticClass: "xly-chart-curve",
            attrs: {id: "xly-chart-curve"},
            on: {
                mouseover: function (t) {
                    e.$emit("setShowHoverLabel", !0), e.showCurveCutLine = !0
                }, mouseleave: function (t) {
                    e.$emit("setShowHoverLabel", !1), e.showCurveCutLine = !1
                }
            }
        }, [i("div", {staticClass: "xly-chart-curve__canvas"}, [i("canvas", {
            ref: "dataChart",
            staticClass: "canvas-data",
            style: "transform: scale(" + 1 / e.scale + "); top: " + e.topMargin + "px",
            attrs: {id: "dataChart"}
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 5 === e.curTaskStatus,
                expression: "curTaskStatus === 5"
            }],
            staticClass: "xly-chart-curve__line",
            class: e.vipType,
            style: "left: " + e.curveLeft + "px; top: " + e.curveTop + "px"
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 5 === e.curTaskStatus,
                expression: "curTaskStatus === 5"
            }],
            staticClass: "xly-chart-curve__point",
            class: e.vipType,
            style: "left: " + e.curveLeft + "px; top: " + e.curveTop + "px"
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 5 === e.curTaskStatus,
                expression: "curTaskStatus === 5"
            }], staticClass: "xly-chart-curve__number", style: "top: " + e.curveTop + "px"
        }, [e._v("速度：" + e._s(e.formatSize(e.downloadSpeed)) + "/s")])]), e._v(" "), i("div", {staticClass: "xly-chart-curve__operate"}, [[7, 9].includes(e.curTaskStatus) && e.curTaskErrorType ? i("div", {staticClass: "xly-chart-curve__tips"}, [i("i", {staticClass: "xly-icon-note"}), e._v(" " + e._s(e.curTaskErrorType) + "\n    ")]) : "Recycle" === e.currentCategoryViewId ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("restore")
                }
            }
        }, [i("i", {staticClass: "xly-icon-restore"}), e._v(" 还原\n    ")]) : "Completed" !== e.currentCategoryViewId || e.taskFileExist ? "Downloading" === e.currentCategoryViewId && 7 === e.curTaskStatus ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("continue")
                }
            }
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 继续下载\n    ")]) : "Completed" === e.currentCategoryViewId && e.isSupportPlay ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("play")
                }
            }
        }, [i("i", {staticClass: "xly-icon-play"}), e._v(" 播放\n    ")]) : "Completed" !== e.currentCategoryViewId || e.isBtOrGroup ? "Completed" === e.currentCategoryViewId && e.isBtOrGroup ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("openFolder")
                }
            }
        }, [i("i", {staticClass: "xly-icon-open"}), e._v(" 打开文件夹\n    ")]) : e._e() : i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("open")
                }
            }
        }, [i("i", {staticClass: "xly-icon-open"}), e._v(" 打开文件\n    ")]) : i("div", {staticClass: "xly-chart-curve__tips"}, [i("i", {staticClass: "xly-icon-note"}), e._v(" 文件已删除\n    ")])]), e._v(" "), i("div", {staticClass: "xly-chart-curve__info"}, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !(e.isFast || e.showCurveCutLine && e.curTaskIsTryTask),
                expression: "!isFast && (!showCurveCutLine || !curTaskIsTryTask)"
            }], staticClass: "xly-chart-curve__data"
        }, [i("p", [e._v("下载进度"), i("span", [e._v(e._s(e.progress) + "%")])]), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), [8, 10].includes(e.curTaskStatus) ? i("p", [e._v("平均速度"), i("span", [e._v(" " + e._s(e.formatSize(e.avgSpeed)) + "/s ")])]) : i("p", {staticClass: "data-time"}, [e._v(e._s(e.remain))]), e._v(" "), i("i", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: [8, 10].includes(e.curTaskStatus) || !e.isYunGetBackTask,
                expression: "([8,10].includes(curTaskStatus) || !isYunGetBackTask)"
            }], staticClass: "xly-line"
        }), e._v(" "), [8, 10].includes(e.curTaskStatus) ? i("p", [e._v("峰值速度"), i("span", [e._v(" " + e._s(e.formatSize(e.maxSpeed)) + "/s ")])]) : e.isYunGetBackTask ? e._e() : i("p", [e._v("资源数"), i("span", [e._v(e._s(e.srcUsing) + "/" + e._s(e.srcTotal))])])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isFast && (!e.showCurveCutLine || !e.curTaskIsTryTask),
                expression: "isFast && (!showCurveCutLine || !curTaskIsTryTask)"
            }], staticClass: "xly-chart-curve__fast"
        }, [i("p", [e._v("恭喜你，解锁【秒下】成就")])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.curTaskIsTryTask && e.showCurveCutLine,
                expression: "curTaskIsTryTask && showCurveCutLine"
            }], staticClass: "xly-chart-curve__detail"
        }, [e._m(0), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), e._m(1), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), e._m(2)])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", [t("i", {staticClass: "tag-speed tag-speed--all"}), this._v("全部速度")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", [t("i", {staticClass: "tag-speed tag-speed--vip"}), this._v("白金会员")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", [t("i", {staticClass: "tag-speed tag-speed--super"}), this._v("超级会员")])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-side-item",
            class: {"is-vip": e.isSuperVip || e.isSuperVipUser && e.isNetdiskTask}
        }, [i("div", {staticClass: "xly-side-wrapper"}, [i("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)
                }
            }
        }, [i("template", {slot: "media"}, [e.active && "" !== e.shortlink && e.qrCodeConfig.show ? i("div", {
            staticClass: "xly-side-item__code",
            on: {mouseenter: e.handleQRCodeHover}
        }, [i("span", {staticClass: "xly-side-item__rocket"}, [i("i")]), e._v(" "), e.active && "" !== e.shortlink ? i("div", {
            staticClass: "xly-side-item__tips",
            class: {"is-show": e.isFirstShowScanCode}
        }, [i("canvas", {
            ref: "canvas",
            staticStyle: {height: "72px", width: "72px"}
        }), e._v(" "), i("p", [e._v(e._s(e.qrCodeConfig.text))]), e._v(" "), e.isFirstShowScanCode ? i("i", {
            staticClass: "td-icon-close",
            on: {
                click: function (t) {
                    e.$emit("update:isFirstShowScanCode", !1)
                }
            }
        }) : e._e()]) : e._e()]) : i("i", {
            staticClass: "xly-icon-type",
            class: e.fileTypeClass,
            on: {mouseover: e.handleIconMouseHover}
        }, [e.isNetdiskTask ? i("span", {
            staticClass: "xly-img-icon-retrieve",
            attrs: {title: "来自云盘取回"}
        }) : e._e()])]), e._v(" "), i("p", {
            staticClass: "xly-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {
                mouseover: function (t) {
                    return t.target !== t.currentTarget ? null : e.handleTaskNameMouseOver(t)
                }
            }
        }), e._v(" "), i("div", {staticClass: "xly-side-operate"}, [e.isForbidden ? [i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "彻底删除"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-clear"})])] : [i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canStart,
                expression: "canStart"
            }],
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "下载"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: e.handleStartTask
            }
        }, [i("i", {staticClass: "xly-icon-download"})]), e._v(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canPause,
                expression: "canPause"
            }],
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "暂停"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: e.handlePauseTask
            }
        }, [i("i", {staticClass: "xly-icon-pause"})])]], 2), e._v(" "), i("div", {staticClass: "xly-file-info"}, [e.taskError ? [i("p", {staticClass: "xly-file-error"}, [e._v(e._s(e.errInfo))])] : e.showStartTemplate ? [i("p", {staticClass: "xly-file-size"}, [i("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [i("span", {
            staticClass: "xly-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(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.remain))]), e._v(" "), i("div", {staticClass: "xly-file-speed"}, [i("span", {staticClass: "xly-file-speed__total"}, [e._v(e._s(e.taskStatusSpeedInfo))]), e._v(" "), e.dataValidating ? e._e() : [e.enbaleVipPlugin ? i("ItemVipSpeedPlugin", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                startStatusPrompt: e.startStatusPrompt,
                active: e.active,
                vipSpeedInfo: e.vipSpeedInfo
            }
        }) : e._e()], e._v(" "), e.vipSpeedInfo && e.vipSpeedInfo.isHuddle ? i("span", {
            staticClass: "xly-file-together",
            attrs: {title: "抱团下载中"}
        }) : e._e(), e._v(" "), e.vipSpeedInfo && e.vipSpeedInfo.isSensitive ? i("div", {staticClass: "xly-file-speed__note"}, [i("i", {staticClass: "xly-icon-note"}), e._v(" "), i("div", {
            staticClass: "xly-file-speed__tips",
            attrs: {slot: "content"},
            slot: "content"
        }, [e._v("\n                " + e._s(e.vipSpeedInfo.sensitive && e.vipSpeedInfo.sensitive.context || "") + " \n                "), i("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handleClickSensitive(t)
                }
            }
        }, [e._v("\n                  " + e._s(e.vipSpeedInfo.sensitive && e.vipSpeedInfo.sensitive.link || "") + "\n                ")])])]) : e._e()], 2)] : [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__finish"}, [e._v(e._s(e.downloadSizeFormat))]), i("span", {staticClass: "xly-file-size__separator"}, [e._v("/")]), i("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [i("span", {
            staticClass: "ly-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(" "), i("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.percentVisible,
                expression: "percentVisible"
            }], staticClass: "xly-file-percent"
        }, [e._v(e._s(e.progressPercent))]), e._v(" "), i("p", {staticClass: "xly-file-status"}, [e._v("\n            " + e._s(e.taskStatusSpeedInfo) + "\n            "), e.enbaleVipPlugin ? i("ItemVipSpeedPlugin", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                active: e.active,
                vipSpeedInfo: e.vipSpeedInfo
            }
        }) : e._e()], 1)]], 2), e._v(" "), i("td-progress", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.taskError,
                expression: "!taskError"
            }], attrs: {value: e.progress}
        })], 2), e._v(" "), e.isShowCloudExpand ? [e.cloudExpandType === e.netExpandType.Error ? i("div", {staticClass: "xly-side-netdisk"}, [i("p", {staticClass: "xly-side-netdisk__text is-disabled"}, [e._v("添加到云盘失败")])]) : e.cloudExpandType === e.netExpandType.SaveAsPlay ? i("div", {staticClass: "xly-side-netdisk"}, [i("p", {staticClass: "xly-side-netdisk__text"}, [e._v("添加到云盘，立享云盘播放")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.saveTask}
        }, [e._v("云盘播放")])]) : e.cloudExpandType === e.netExpandType.SaveAsNormal ? i("div", {staticClass: "xly-side-netdisk"}, [i("p", {staticClass: "xly-side-netdisk__text"}, [e._v("添加到云盘，节省电脑空间")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.saveTask}
        }, [e._v("立即添加")])]) : e.cloudExpandType === e.netExpandType.Saving ? i("div", {staticClass: "xly-side-netdisk"}, [i("p", {staticClass: "xly-side-netdisk__text"}, [e._v("正在添加到："), i("span", {on: {click: e.clickPath}}, [e._v(e._s(e.panTaskData && e.panTaskData.title || ""))])]), e._v(" "), i("span", {staticClass: "xly-side-netdisk__progress"}, [e._v("保存中" + e._s(e.panTaskProgress) + "%")])]) : e.cloudExpandType === e.netExpandType.Saved ? i("div", {staticClass: "xly-side-netdisk"}, [i("p", {staticClass: "xly-side-netdisk__text is-disabled"}, [e._v("已成功添加到："), i("span", {on: {click: e.clickPath}}, [e._v(e._s(e.panTaskData && e.panTaskData.title || ""))])]), e._v(" "), e.canPlay ? i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.consumePanTask}
        }, [e._v("云盘播放")]) : i("span", {
            staticClass: "xly-side-netdisk__link",
            on: {click: e.consumePanTask}
        }, [e._v("查看详情>")])]) : e.cloudExpandType === e.netExpandType.NoSpace ? i("div", {staticClass: "xly-side-netdisk"}, [i("p", {staticClass: "xly-side-netdisk__text is-disabled"}, [e._v("空间不足，无法添加到云盘")]), e._v(" "), i("span", {
            staticClass: "xly-side-netdisk__link",
            on: {click: e.showDetail}
        }, [e._v("查看详情>")])]) : e._e()] : e._e(), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowExpand,
                expression: "isShowExpand"
            }], staticClass: "xly-side-ad"
        }, [i("div", {
            staticClass: "xly-side-ad__image",
            attrs: {title: e.vipSpeedInfo && e.vipSpeedInfo.huddle && e.vipSpeedInfo.huddle.title || ""}
        }, [e.vipSpeedInfo && e.vipSpeedInfo.huddle && e.vipSpeedInfo.huddle.imgSrc ? i("img", {
            staticClass: "xly-side-ad__together",
            attrs: {src: e.vipSpeedInfo && e.vipSpeedInfo.huddle && e.vipSpeedInfo.huddle.imgSrc || ""},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handleGroupAccelerateClick(t)
                }, mousedown: function (e) {
                    e.stopPropagation()
                }
            }
        }) : e._e()]), e._v(" "), e.enbaleVipPlugin ? i("div", {
            staticClass: "xly-plugin-vip"
        }) : e._e()])], 2)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-side-item", on: {
                mouseenter: function (t) {
                    e.isShowShouleiFileTransfer = !0
                }, mouseleave: function (t) {
                    e.isShowShouleiFileTransfer = !1
                }
            }
        }, [i("div", {staticClass: "xly-side-wrapper"}, [i("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [i("i", {
            class: e.fileTypeClass,
            style: e.isInstallFileIcon ? {
                background: "url(" + e.installFileIcon + ")",
                "background-size": "100% 100%"
            } : {},
            attrs: {slot: "media"},
            slot: "media"
        }, [e.isNetdiskTask ? i("span", {
            staticClass: "xly-img-icon-retrieve",
            attrs: {title: "来自云盘取回"}
        }) : e._e()]), e._v(" "), i("p", {
            staticClass: "xly-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {
                mouseover: function (t) {
                    return t.target !== t.currentTarget ? null : e.handleTaskNameMouseOver(t)
                }
            }
        }), e._v(" "), i("div", {staticClass: "xly-side-operate"}, [e.canPlay ? i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "播放"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePlayTask(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-play"})]) : e._e(), e._v(" "), e.deleted ? i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "删除任务记录"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-clear"})]) : e.canPlay ? e._e() : i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "打开文件夹"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleOpenFile(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-open"})])]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.completeTime))]), e._v(" "), e.deleted ? i("p", {staticClass: "xly-file-status"}, [e._v("文件已移除")]) : e._e()])])], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-side-item"}, [i("div", {staticClass: "xly-side-wrapper"}, [i("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [i("i", {
            staticClass: "xly-icon-type",
            class: e.fileTypeClass,
            style: e.isFileIcon ? {background: "url(" + e.fileIcon + ")", "background-size": "100% 100%"} : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", {
            staticClass: "xly-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {
                mouseover: function (t) {
                    return t.target !== t.currentTarget ? null : e.handleTaskNameMouseOver(t)
                }
            }
        }), e._v(" "), i("div", {staticClass: "xly-side-operate"}, [i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "还原"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleRestore(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-restore"})])]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.creationTime))])])])], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return e.isShowVipSpeed ? i("a", {
            staticClass: "xly-file-speed__vip",
            attrs: {href: "javascript:;"}
        }, [e._v(e._s(e.vipSpeed))]) : i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowVipHover,
                expression: "isShowVipHover"
            }], staticClass: "xly-file-speed__vip-link", 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 = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(432), a = i(19);
    t.Parser = class extends a.EventEmitter {
        constructor() {
            super(), this.decoder = new n.StringDecoder("utf8"), this.jsonBuffer = ""
        }

        encode(e) {
            return JSON.stringify(e) + "\n"
        }

        feed(e) {
            let t = this.jsonBuffer, i = 0, n = (t += this.decoder.write(e)).indexOf("\n", i);
            for (; n >= 0;) {
                const e = t.slice(i, n), a = JSON.parse(e);
                this.emit("message", a), i = n + 1, n = t.indexOf("\n", i)
            }
            this.jsonBuffer = t.slice(i)
        }
    }
}, function (e, t) {
    e.exports = require("string_decoder")
}, function (e, t, i) {
    "use strict";
    var n;
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i;
        !function (e) {
            e.require = "AR_BROWSER_REQUIRE", e.builtIn = "AR_BROWSER_GET_BUILTIN", e.global = "AR_BROWSER_GET_GLOBAL", e.functionCall = "AR_BROWSER_FUNCTION_CALL", e.construct = "AR_BROWSER_CONSTRUCTOR", e.memberConstruct = "AR_BROWSER_MEMBER_CONSTRUCTOR", e.memberCall = "AR_BROWSER_MEMBER_CALL", e.memberSet = "AR_BROWSER_MEMBER_SET", e.memberGet = "AR_BROWSER_MEMBER_GET", e.currentWindow = "AR_BROWSER_CURRENT_WINDOW", e.currentWebContents = "AR_BROWSER_CURRENT_WEB_CONTENTS", e.clientWebContents = "AR_BROWSER_CLIENT_WEB_CONTENTS", e.webContents = "AR_BROWSER_WEB_CONTENTS", e.sync = "AR_BROWSER_SYNC", e.contextRelease = "AR_BROWSER_CONTEXT_RELEASE"
        }(t = e.browser || (e.browser = {})), function (e) {
            e.requireReturn = "AR_RENDERER_REQUIRE_RETURN", e.getBuiltInReturn = "AR_RENDERER_BUILTIN_RETURN", e.getGlobalReturn = "AR_RENDERER_GLOBAL_RETURN", e.functionCallReturn = "AR_RENDERER_FUNCTION_CALL_RETURN", e.memberConstructReturn = "AR_RENDERER_MEMBER_CONSTRUCTOR_RETURN", e.constructReturn = "AR_RENDERER_CONSTRUCTOR_RETURN", e.memberCallReturn = "AR_RENDERER_MEMBER_CALL_RETURN", e.memberSetReturn = "AR_RENDERER_MEMBER_SET_RETURN", e.memberGetReturn = "AR_RENDERER_MEMBER_GET_RETURN", e.currentWindowReturn = "AR_BROWSER_CURRENT_WINDOW_RETURN", e.currentWebContentsReturn = "AR_RENDERER_CURRENT_WEB_CONTENTS_RETURN", e.clientWebContentsReturn = "AR_RENDERER_CLIENT_WEB_CONTENTS_RETURN", e.webContentsReturn = "AR_RENDERER_WEB_CONTENTS_RETURN", e.syncReturn = "AR_RENDERER_SYNC_RETURN", e.callback = "AR_RENDERER_CALLBACK"
        }(i = e.renderer || (e.renderer = {}))
    }(n || (n = {})), t.default = n
}, function (e, t, i) {
    "use strict";
    var n;
    !function (e) {
        e.getRemoteObjectName = function (e) {
            let t = typeof e;
            if ("function" === t) t = e.name; else if ("object" === t) {
                let t = e.name;
                if ("string" != typeof t) {
                    let i = e.constructor;
                    t = i ? i.name : Object.toString.call(e)
                }
            }
            return t
        }, e.isPromise = function (e) {
            return e && e.then && e.then instanceof Function && e.constructor && e.constructor.reject && e.constructor.reject instanceof Function && e.constructor.resolve && e.constructor.resolve instanceof Function
        }
    }(n || (n = {})), e.exports = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(30), o = i(331), r = i(73), s = i(0).default.getLogger("DownloadKernel.Category");

    class l {
        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 i = 0; i < this.categoryViews.length; ++i) {
                let n = this.categoryViews[i];
                if (n) {
                    if (e === n.getCategoryViewId()) {
                        t = n;
                        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 = "", i = !1, n = null) {
            if (this.password = e, "" !== this.password && "" === t) {
                let e = r.createHash("md5");
                e.update(this.password), t = e.digest("hex")
            }
            this.passwordV2 = t, i && a.ThunderKernel.setCategoryPassword(this.id, this.password, this.passwordV2, n)
        }

        getPassword() {
            return this.password
        }

        getPasswordV2() {
            return this.passwordV2
        }

        setAccountPassword(e) {
            this.accountPassword !== e && (this.accountPassword = e)
        }

        getAccountPassword() {
            return this.accountPassword
        }

        getCategoryData() {
            return {
                categoryId: this.id,
                parentId: this.parentId,
                nextId: this.nextId,
                status: this.status,
                name: this.name,
                description: this.description,
                defaultPath: this.defaultPath,
                userName: this.userName,
                password: this.password,
                passwordV2: this.passwordV2,
                accountPassword: this.accountPassword
            }
        }
    }

    t.Category = l;

    class d extends l {
        constructor(e) {
            super(e);
            let t = new o.CategoryView(e, n.DownloadKernel.CategroyViewID.Downloading),
                i = new o.CategoryView(e, n.DownloadKernel.CategroyViewID.Completed),
                a = new o.CategoryView(e, n.DownloadKernel.CategroyViewID.Recycle);
            this.categoryViews.push(t), this.categoryViews.push(i), this.categoryViews.push(a)
        }

        static createCategoryFromData(e) {
            let t = e.categoryId;
            if (void 0 === t || t < 0) return null;
            s.information("createCategoryFromData ", e);
            let i = new d(t);
            return i.setName(e.name), i.setParentId(e.parentId), i.setNextId(e.nextId), i.setStatus(e.status), i.setDescription(e.description), i.setDefaultPath(e.defaultPath), i.setUserName(e.userName), i.setPassword(e.password, e.passwordV2), i.setAccountPassword(e.accountPassword), i
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20);
    !function (e) {
        let t = !1, o = [];
        e.initBtTaskTrackers = function () {
            return n(this, void 0, void 0, function* () {
                if (!t) {
                    t = !0;
                    let e = null;
                    try {
                        a.default.defaults.adapter = i(21), 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 i = e.data.trackers.tracker[t];
                        i && "" !== i && o.push(i)
                    }
                }
            })
        }, e.getExtraTracks = function () {
            return o
        }
    }(t.BTExtraTrackNS || (t.BTExtraTrackNS = {}))
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t) {
        return function () {
            for (var i = new Array(arguments.length), n = 0; n < i.length; n++) i[n] = arguments[n];
            return e.apply(t, i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(333);
    e.exports = function (e, t, i) {
        var a = i.config.validateStatus;
        i.status && a && !a(i.status) ? t(n("Request failed with status code " + i.status, i.config, null, i.request, i)) : e(i)
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t, i, n, a) {
        return e.config = t, i && (e.code = i), e.request = n, e.response = a, e
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);

    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, i) {
        if (!t) return e;
        var o;
        if (i) o = i(t); else if (n.isURLSearchParams(t)) o = t.toString(); else {
            var r = [];
            n.forEach(t, function (e, t) {
                null !== e && void 0 !== e && (n.isArray(e) ? t += "[]" : e = [e], n.forEach(e, function (e) {
                    n.isDate(e) ? e = e.toISOString() : n.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, i) {
    var n = i(46), a = i(96), o = i(334), r = i(442), s = i(97).Writable, l = i(550)("follow-redirects"),
        d = {GET: !0, HEAD: !0, OPTIONS: !0, TRACE: !0}, u = 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 i = this;
        if (this._onNativeResponse = function (e) {
            i._processResponse(e)
        }, !e.pathname && e.path) {
            var n = e.path.indexOf("?");
            n < 0 ? e.pathname = e.path : (e.pathname = e.path.substring(0, n), e.search = e.path.substring(n))
        }
        this._performRequest()
    }

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

    ["abort", "aborted", "error", "socket", "timeout"].forEach(function (e) {
        u[e] = function (t) {
            this._redirectable.emit(e, t)
        }
    }), c.prototype = Object.create(s.prototype), c.prototype.write = function (e, t, i) {
        this._requestBodyLength + e.length <= this._options.maxBodyLength ? (this._requestBodyLength += e.length, this._requestBodyBuffers.push({
            data: e,
            encoding: t
        }), this._currentRequest.write(e, t, i)) : (this.emit("error", new Error("Request body larger than maxBodyLength limit")), this.abort())
    }, c.prototype.end = function (e, t, i) {
        var n = this._currentRequest;
        e ? this.write(e, t, function () {
            n.end(null, null, i)
        }) : n.end(null, null, i)
    }, 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, i) {
            return this._currentRequest[e](t, i)
        }
    }), ["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 i = e.substr(0, e.length - 1);
            this._options.agent = this._options.agents[i]
        }
        var a = this._currentRequest = t.request(this._options, this._onNativeResponse);
        for (var o in this._currentUrl = n.format(this._options), a._redirectable = this, u) o && a.on(o, u[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 i, a = this._options.headers;
            if (307 !== e.statusCode && !(this._options.method in d)) for (i in this._options.method = "GET", this._requestBodyBuffers = [], a) /^content-/i.test(i) && delete a[i];
            if (!this._isRedirect) for (i in a) /^host$/i.test(i) && delete a[i];
            var o = n.resolve(this._currentUrl, t);
            l("redirecting to", o), Object.assign(this._options, n.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) {
    e.exports = require("assert")
}, function (e, t, i) {
    "use strict";
    e.exports = function (e) {
        return !(!e || !e.__CANCEL__)
    }
}, function (e, t, i) {
    "use strict";

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

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(10), r = i(13), s = i(0), {isDef: l} = r.ThunderUtil, d = i(75), u = i(34), c = i(3),
        h = i(5), f = i(63), g = i(31), p = s.default.getLogger("statCoreEvent");

    function v(e) {
        let t = "";
        do {
            if (void 0 === e || null === e || "" === e) break;
            let i = /^(xl_thunder_pc)\|([\d\.]+)\|(\d+)\|(.*)$/.exec(e);
            if (null === i) break;
            if (null === i[4] || void 0 === i[4]) break;
            t = i[4]
        } while (0);
        return t
    }

    function m(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
    }

    function y(e) {
        return n(this, void 0, void 0, function* () {
            let t = "";
            do {
                if (!e) break;
                let i = u.ThunderHelper.getDriveType(e);
                if (!i) break;
                if (i === u.ThunderHelper.DriverType.DRIVE_REMOTE) {
                    t = "share";
                    break
                }
                if (i === u.ThunderHelper.DriverType.DRIVE_REMOVABLE) {
                    t = "flash";
                    break
                }
                if (i === u.ThunderHelper.DriverType.DRIVE_FIXED) {
                    let i = yield u.ThunderHelper.getFixedDriveMediaType(e);
                    if (i === u.ThunderHelper.MediaType.HDD) {
                        t = "HD";
                        break
                    }
                    if (i === u.ThunderHelper.MediaType.SSD) {
                        t = "SSD";
                        break
                    }
                }
            } while (0);
            return t
        })
    }

    t.statCoreEvent = function (e, t, i) {
        return n(this, void 0, void 0, function* () {
            do {
                if (null === e) break;
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Origin);
                n = m(n);
                let r = v(e.getTaskAttribute(c.DownloadKernel.TaskAttribute.ProductInfo)), s = e.getId();
                const u = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                let k = `broswer=${r},taskid=${s}`, T = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType),
                    w = "";
                if (T === c.DownloadKernel.TaskType.P2sp) w = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), k = `${k},task_type=p2sp,download_info=${encodeURIComponent(w)}`; else if (T === c.DownloadKernel.TaskType.Bt) {
                    let t = e.getExtraObject().getInfoId();
                    k = `${k},task_type=bt,download_info=${t}`, w = t
                } else T === c.DownloadKernel.TaskType.Emule ? (w = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), k = `${k},task_type=emule,download_info=${encodeURIComponent(w)}`) : T === c.DownloadKernel.TaskType.Group ? k = `${k},task_type=group,download_info=` : T === c.DownloadKernel.TaskType.Magnet && (w = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), k = `${k},task_type=magnet,download_info=${encodeURIComponent(w)}`);
                let C = yield d.isVestUrl(w, "vestURL"), S = yield d.isVestUrl(w, "commonUrl"), I = "";
                C ? (I = n, n = "xl_password_vest") : S && (I = n, n = "xl_password_common");
                let b = 0;
                const _ = yield h.client.callServerFunction("IsLogined");
                let D = !1, A = 0, N = yield h.client.callServerFunction("GetUserInfo", 2);
                if (N) try {
                    N = JSON.parse(N)
                } catch (e) {
                    p.warning(e.message)
                }
                N && (A = Number(N.vasType).valueOf(), D = Boolean("1" === N.isVip)), _ && D && (b = 5 === A ? 7 : l(A) && A > 2 ? 3 : 2), k = `${k = `${k},source=${n},pwd_source=${I},is_login=${_ ? 1 : 0},is_vip=${D ? 1 : 0},vip_type=${b}`},disk_type=${yield y(e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath))}`;
                let x = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName), E = encodeURIComponent(x),
                    P = a.extname(x);
                "" !== (P = void 0 === P ? "" : P) && (P = P.substring(1)), f.ParseUrlFileNameNS.isUsualFileExtName(P) || (P = ""), k = `${k},filename=${E},filesize=${u},filesuffix=${P},libversion=${g.DownloadKernelManager.getDownloadSdkVersion()}`, void 0 !== i && (k = `${k},${i}`);
                let O = "core_event";
                p.information("trackEvent", O, t, k), o.XLStatNS.trackEvent(O, t, "", 0, 0, 0, 0, k)
            } while (0)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(12), s = i(15), l = a.default.getLogger("magnet-listener"),
        d = r.DownloadKernelTaskManager.getTaskManager(), u = 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 i = this.listenerMap[e];
            i.callbacks.push(t), i.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, d.stopTask(e, o.DownloadKernel.TaskStopReason.Manual), d.deleteTask(e, !1).catch(), delete this.listenerMap[e]) : l.information("release listener remain", t.counter)
            } while (0)
        }

        fireAll(e, t, i) {
            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 a of n.callbacks) a(e, t, i).catch(), this.release(e)
            } while (0)
        }

        attachTaskStatus(e) {
            let t = u.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => n(this, void 0, void 0, function* () {
                do {
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let i = t[1];
                    for (let t = 0; t < i.length; ++t) {
                        let n = i[t];
                        if (!n) continue;
                        let a = n.getTaskStatus(), r = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskType),
                            s = n.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, n.getTaskAttribute(o.DownloadKernel.TaskAttribute.ErrorCode)))
                    }
                } while (0)
            }));
            l.information("attachTaskEvent StatusChanged", t);
            let i = {cookie: t, counter: 0, callbacks: []};
            this.listenerMap[e] = i
        }

        detachTaskStatus(e) {
            l.information("detachTaskEvent StatusChanged", e), u.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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

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

        e.taskOptFileNameFixed = 2, 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;
                g = e
            } while (0)
        }, e.contructTaskByUrl = function (e, t, i, n) {
            let a = o(e, t, i, n);
            h.verbose(e);
            let r = 5;
            return {
                taskType: i,
                data: a,
                setting: {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: r = null !== a.thread && void 0 !== a.thread ? a.thread : g,
                    note: "",
                    openAfterDownload: !1
                },
                selected: !0
            }
        }, e.contructTaskByUrlData = function (e, t) {
            let i = void 0, n = u.ThunderHelper.getTaskTypeFromUrl(e.url);
            if (n === d.DownloadKernel.TaskType.Emule && (void 0 === e.fileHash || "" === e.fileHash)) {
                let t = c.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), e.fileName || (e.fileName = c.ParseUrlFileNameNS.getNameFromUrl(e.url)), e.fileName = e.fileName.replace(/[*?/\\:|<>\"]/g, "_"), !e.fileType) {
                let t = a.extname(e.fileName);
                "" !== t && (e.fileType = t.substring(1))
            }
            if (void 0 === t || null === t) {
                let i = 5;
                t = {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: i = null !== e.thread && void 0 !== e.thread ? e.thread : g,
                    note: "",
                    openAfterDownload: !1
                }
            }
            return i = {taskType: n, data: e, setting: t, selected: !0}
        }, e.getDesktopPath = function () {
            return f.getDesktopPath()
        }, e.getDocumentPath = function () {
            return f.getDocumentPath()
        }, e.queryFileExists = function (e) {
            return f.queryFileExists(e)
        }, e.isFilePathValid = function (e) {
            return f.isFilePathValid(e)
        }, e.getNewTaskDataByUrl = o, e.getDownloadResult = function (e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = {result: !1};
                return s.ipcRenderer.send(l.ThunderChannelList.channelRMNewTaskCreateNewTask, e, ...t), i = yield new Promise(e => {
                    s.ipcRenderer.once(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, (t, i, n) => {
                        e({result: i, message: n})
                    })
                })
            })
        }, e.readThunderUnionConfig = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = null, n = null;
                try {
                    const n = yield i(20);
                    n.defaults.adapter = i(21), t = yield n.get(e)
                } catch (e) {
                    h.information(e)
                }
                return null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && (n = t.data), n
            })
        }
    }(t.ThunderNewtaskHelperNS || (t.ThunderNewtaskHelperNS = {}))
}, function (e, t, i) {
    (function () {
        "use strict";
        var e, n, a, o, r = {}.hasOwnProperty;
        n = i(339), e = i(565), a = i(570), o = i(453), t.defaults = n.defaults, t.processors = o, t.ValidationError = function (e) {
            function t(e) {
                this.message = e
            }

            return function (e, t) {
                for (var i in t) r.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, 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 () {
        e.exports = function () {
            function e(e, t, i) {
                if (this.options = e.options, this.stringify = e.stringify, null == t) throw new Error("Missing attribute name of element " + e.name);
                if (null == i) throw new Error("Missing attribute value for attribute " + t + " of element " + e.name);
                this.name = this.stringify.attName(t), this.value = this.stringify.attValue(i)
            }

            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)
            }
        }, i = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var n, a, o;
                for (n in this.assertLegalChar = t(this.assertLegalChar, this), e || (e = {}), this.noDoubleEncoding = e.noDoubleEncoding, a = e.stringify || {}) i.call(a, n) && (o = a[n], this[n] = 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 i, n, a, o, r, s, l, d, u;
                for (i in e || (e = {}), this.pretty = e.pretty || !1, this.allowEmpty = null != (n = e.allowEmpty) && n, 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, d = e.writer || {}) t.call(d, i) && (u = d[i], this[i] = u)
            }

            return e.prototype.set = function (e) {
                var i, n, a;
                for (i 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, n = e.writer || {}) t.call(n, i) && (a = n[i], this[i] = 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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(100), r = i(9), s = i(0), l = i(17), d = i(23), u = i(10), c = i(344), h = i(14), f = i(24),
        g = i(20), p = i(577).UserHelperNS.getUserHelper(), v = s.default.getLogger("Sign"),
        m = "http://pc.xunlei.com/pages/#/sign";
    t.signObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "", this.url = m, this.width = 400, this.height = 460, this.curPopupType = "", this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.canAutoShow = !0, this.embeddedBrowserObj = new o.EmbeddedBrowser, this.attachListener().catch()
        }

        enableAutoShow(e) {
            this.canAutoShow = e
        }

        createSignDlg(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if ("auto" === e && !this.canAutoShow) {
                        v.information("自动弹出已被阻止");
                        break
                    }
                    if ("auto" === e && !1 === this.isPopup()) {
                        v.information("不满足auto弹出条件");
                        break
                    }
                    let i = yield c.CommonSignFunctionNs.isAlreadySign();
                    if ("auto" === e && i) {
                        v.information("用户已经答过");
                        break
                    }
                    if (yield this.isAlreadyShowTips()) {
                        v.information("createSignDlg 正在显示tips");
                        break
                    }
                    if (!1 === (yield c.CommonSignFunctionNs.isHaveSignQuestion())) {
                        v.information("不存在答题");
                        break
                    }
                    this.curPopupType = e;
                    let n = yield a.asyncRemoteCall.getCurrentWindow();
                    if ((yield n.isMinimized()) || !1 === (yield n.isVisible())) {
                        v.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}`)
                        }
                    }
                    "auto" === e ? (this.embeddedBrowserObj.setAutoShow(!1), this.url = `${this.url}?readyshow=1`) : (this.embeddedBrowserObj.setAutoShow(!0), this.url = `${this.url}?readyshow=0`), yield this.checkReadPack(), yield 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 n(this, void 0, void 0, function* () {
                let e = !0;
                return (yield this.isAlreadyShowTips()) ? (v.information("onWndShowResult 正在显示tips"), e = !1) : (this.writeConfig(), this.statSign("sign_popup_show").catch()), e
            })
        }

        closeDialog() {
            this.embeddedBrowserObj.closeWnd().catch()
        }

        show() {
            return n(this, void 0, void 0, function* () {
                do {
                    let e = yield a.asyncRemoteCall.getCurrentWindow();
                    if ((yield e.isMinimized()) || !1 === (yield e.isVisible())) {
                        v.information("窗口最小化或者不可见");
                        break
                    }
                    if (yield this.isAlreadyShowTips()) {
                        v.information("onWndShowResult 正在显示tips");
                        break
                    }
                    this.embeddedBrowserObj.showWnd().catch()
                } while (0)
            })
        }

        getWnd() {
            return this.embeddedBrowserObj.getWnd()
        }

        attachListener() {
            return n(this, void 0, void 0, function* () {
                l.NativeCallModule.nativeCall.AttachNativeEvent("showTipsWnd", () => {
                    v.information("showTipsWnd:"), this.embeddedBrowserObj.closeWnd().catch()
                }), (yield a.asyncRemoteCall.getIpcMain()).on(h.NodeEventMesssageNS.eventEmbeddedBrowserWndClick, (e, t, i) => {
                    if ("sign" === t) {
                        let e = "";
                        "btn_close" === i ? e = "sign_close" : "sign_nopop" === i && (e = "sign_nopop"), this.statSign("sign_detail_click", e).catch()
                    }
                })
            })
        }

        isAlreadyShowTips() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.NativeCallModule.nativeCall.CallNativeFunction("IsTipsWndShow", t => {
                        v.information("isAlreadyShowTips:", t), e(t)
                    })
                })
            })
        }

        setDefaultValue() {
            this.url = m;
            let e = r.ConfigNS.getValue("sign", "testUrl", "");
            e && "" !== e && (this.url = e), this.width = 400, this.height = 460
        }

        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 = !0;
            do {
                let t = this.getCurDate(), i = r.ConfigNS.getValue("ConfigPopUpPanel", "ShowDate", "");
                if (t === i) {
                    v.information("ShowDate:", i, "curDate:", t), e = !1;
                    break
                }
                let n = r.ConfigNS.getValue("ConfigPopUpPanel", "StartCount", 0),
                    a = r.ConfigNS.getValue("ConfigPopUpPanel", "ShowTime", 0),
                    o = Math.round((new Date).getTime() / 1e3);
                v.information("isPopup:", n, a, o), e = !(0 !== n && (1 === n ? o - a <= 604800 : 2 === n ? o - a <= 2592e3 : 3 !== n || o - a <= 7776e3))
            } while (0);
            return e
        }

        statSign(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = "";
                if (yield d.LoginHelperNS.loginHelper.isLoginedAw()) {
                    i = "is_login=1";
                    let e = 0;
                    "0" !== (yield d.LoginHelperNS.loginHelper.getUserInfoByKeyAw("isVip", "vip_xl")) && (e = 1), i = `${i},is_vip=${e}`
                } else i = "is_login=0";
                "sign_detail_click" === e && (i = `${i},button=${t}`), v.information("statSign:", e, i), u.XLStatNS.trackEvent("business", e, "", 0, 0, 0, 0, i)
            })
        }

        checkReadPack() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = "https://msg-vip-ssl.xunlei.com/xlact/conf?actid=vip2020redpack&client=xunlei_xds&source=guess_movie";
                    yield p.parseUserInfo(), t += "&userid=" + p.userId, t += "&sessionid=" + (yield p.getSessionId());
                    let n = null;
                    try {
                        g.default.defaults.adapter = i(21), n = yield g.default.get(t, {timeout: 5e3})
                    } catch (e) {
                        v.information(e);
                        break
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data && "" !== n.data) {
                        let t = n.data;
                        0 === t.result && t.data && t.data.valid && (this.width = Number(t.data.width), this.height = Number(t.data.height) + this.topMargin, this.url += "&redpack=" + encodeURIComponent(JSON.stringify(t.data)), e = !0)
                    }
                } while (0);
                return e || (this.url += "&redpack=" + encodeURI(JSON.stringify({valid: !1}))), e
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(342), o = i(56), r = i(7).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e, t, i, n, o, s, l) {
            let d = {x: 0, y: 0, width: 0, height: 0}, u = a.BrowserWindowNS.getDpiFactor(r, e);
            return d.x = Math.ceil(n * u), d.y = Math.ceil(s * u), d.width = Math.ceil((t - n - o) * u), d.height = Math.ceil((i - s - l) * u), d
        }

        e.resizeBrowserWindow = function (e, i, n, a, s, l, d, u = o.Uflag.SWP_SHOWWINDOW) {
            let c = !1;
            {
                let h = t(e, i, n, a, s, l, d);
                r.setWindowPos(e, o.OptionOfHWNDInAfter.HWND_TOP, Math.round(h.x), Math.round(h.y), Math.round(h.width), Math.round(h.height), u), c = !0
            }
            return c
        }, e.getBrowserWindowRect = t
    }(t.CommonFunctionNs || (t.CommonFunctionNs = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(100), o = i(17), r = i(580), s = i(9), l = i(24), d = i(10), u = i(2), c = i(7), h = i(35), f = i(0),
        g = i(4), p = f.default.getLogger("News-Popup"), v = c.default(u.join(__rootDir, "../bin/ThunderHelper.node")),
        m = "http://pc.xunlei.com/pages/#/news", y = 710, k = 612;
    t.newsPopupObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "迅雷，发现好电影", this.url = m, this.width = y, this.height = k, this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.idIndex = 1, this.adMap = new Map, this.startMoveMousePos = {
                x: 0,
                y: 0
            }, this.startMoveWindowPos = {x: 0, y: 0}, this.embeddedBrowserObj = new a.EmbeddedBrowser
        }

        createNewsPopupDlg(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (0 === l.default.getConfigInfo("newspopup", "enable")) break;
                    if (p.information("createNewsPopupDlg popupType:", e), !this.isPopup() && "auto" === e) {
                        p.information("this.isPopup() false!"), d.XLStatNS.trackEvent("setting_center", "popup_intercept");
                        break
                    }
                    this.setDefaultValue(), this.embeddedBrowserObj.setWindowTopLevel(!0), "hover" === e ? this.embeddedBrowserObj.setAutoShow(!0) : this.embeddedBrowserObj.setAutoShow(!1), yield this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "news-popup", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, this.onWndShowResult.bind(this), null), yield this.embeddedBrowserObj.setMinimizable(!0)
                } while (0)
            })
        }

        onWndShowResult() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                if (this.writeConfig(), yield this.isAlreadyShowTips()) p.information("onWndShowResult 正在显示tips"), e = !1; else {
                    let e = this.embeddedBrowserObj.getWnd();
                    g.isNullOrUndefined(e) || (yield h.ToolsUtilitiesAWNS.setForegroundWindow(v, e))
                }
                return e
            })
        }

        getWnd() {
            return this.embeddedBrowserObj.getWnd()
        }

        writeConfig() {
            let e = this.getCurDate();
            s.ConfigNS.setValue("ConfigNewsPopUp", "NewsShowDate", e)
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        close() {
            this.embeddedBrowserObj.closeWnd().catch()
        }

        setStartMoveMousePos(e, t) {
            return n(this, void 0, void 0, function* () {
                this.startMoveMousePos.x = e, this.startMoveMousePos.y = t;
                let i = yield this.embeddedBrowserObj.getWndPosition();
                this.startMoveWindowPos.x = i[0], this.startMoveWindowPos.y = i[1]
            })
        }

        setMoveMousePos(e, t) {
            this.embeddedBrowserObj.setWndPosition(e - this.startMoveMousePos.x + this.startMoveWindowPos.x, t - this.startMoveMousePos.y + this.startMoveWindowPos.y).catch()
        }

        minimize() {
            this.embeddedBrowserObj.minimizeWnd().catch()
        }

        setSize(e, t) {
            e && t && (this.width = e, this.height = t), this.embeddedBrowserObj.setWndSize(this.width, this.height).catch()
        }

        getSize() {
            return [this.width, this.height]
        }

        show() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (yield this.isAlreadyShowTips()) {
                        p.information("onWndShowResult 正在显示tips");
                        break
                    }
                    window.localStorage.setItem("NewsShowDate", this.getCurDate()), this.embeddedBrowserObj.showWnd().catch()
                } while (0)
            })
        }

        center() {
            this.embeddedBrowserObj.centerWnd().catch()
        }

        createAd(e) {
            let t = this.idIndex++, i = new r.NewsAdContainer(t);
            return this.adMap.set(t, i), p.information("createAd adType:", e, ", id:", t), t
        }

        showAd(e, t, i, n, a) {
            p.information("showAd x:", t, ", y:", i, ", width:", n, ", height:", a);
            let o = this.adMap.get(e);
            o && (o.move(t, i, n, a), o.show())
        }

        hideAd(e) {
            p.information("hideAd id:", e);
            let t = this.adMap.get(e);
            t && t.hide()
        }

        closeAd(e) {
            p.information("closeAd id:", e);
            let t = this.adMap.get(e);
            t && t.close()
        }

        isAlreadyShowTips() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("IsTipsWndShow", t => {
                        p.information("isAlreadyShowTips:", t), e(t)
                    })
                })
            })
        }

        setDefaultValue() {
            this.url = m, this.width = y, this.height = k
        }

        isPopup() {
            let e = !0;
            do {
                if (v.IsInFullScreen()) {
                    e = !1;
                    break
                }
                let t = s.ConfigNS.getValue("ConfigMsg", "ConfigMsg_TodayRecommend", !0);
                if (p.information("todayRecommendEnable:", t), !t) {
                    e = !1;
                    break
                }
                let i = this.getCurDate(), n = s.ConfigNS.getValue("ConfigNewsPopUp", "NewsShowDate", "");
                if (i === n || i === window.localStorage.getItem("NewsShowDate")) {
                    p.information("ShowDate:", n, "curDate:", i), e = !1;
                    break
                }
                let a = s.ConfigNS.getValue("ConfigNewsPopUp", "NewsShowTime", 0);
                if (Math.round((new Date).getTime() / 1e3) - a <= 604800) {
                    e = !1;
                    break
                }
                e = !0
            } while (0);
            return e
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(102), r = i(20), s = i(16), l = i(6), d = i(35), u = i(14), c = i(0), h = i(449), f = i(10),
        g = i(57), p = i(3), v = i(12), m = i(15), y = i(44), k = i(18), T = i(33),
        w = v.DownloadKernelTaskManager.getTaskManager(), C = m.DownloadKernelEventManager.getEventManager(),
        S = c.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.loadedPlugins = [], this.pluginStatusMap = {}, this.pluginGroupCache = {}, 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, g.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                    S.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.sendPluginStatEx(this.loadPluginsStat), this.loadPluginsStat = [], yield this.saveUpdatePluginsConfig(), yield this.saveUnzipConfig(), e(!0)
                })))
            }

            isPluginLoaded(e) {
                let t = !1;
                do {
                    if (-1 !== this.loadedPlugins.indexOf(e)) {
                        t = !0;
                        break
                    }
                    let i = this.getPluginStatus(e);
                    if (!i) break;
                    if ("loaded" === i.state) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            }

            setPluginLoaded(e) {
                -1 === this.loadedPlugins.indexOf(e) && (this.loadedPlugins.push(e), this.setPluginStatus(e, "loaded").catch())
            }

            clear(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!e || !t || !i) break;
                        if (0 !== i.indexOf(t)) break;
                        let n = `${this.currentDir}${e}`, o = yield l.FileSystemAWNS.readdirAW(n);
                        for (let e = 0; e < o.length; e++) {
                            let i = o[e], r = a.join(n, i), s = yield l.FileSystemAWNS.lstatAW(r);
                            s && (s.isDirectory() && i !== t ? l.FileSystemAWNS.rmdirsAW(r).catch() : s.isFile() && "config.json" !== i && l.FileSystemAWNS.unlinkAW(r).catch())
                        }
                    } while (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 i = 0;
                for (i = 0; i < e.length; ++i) if (e[i].name === t.name) {
                    e[i].version = t.version, e[i].state = t.state, e[i].errorCode = t.errorCode;
                    break
                }
                i >= e.length && e.push(t)
            }

            sendPluginStatEx(e) {
                let t = "", i = 0;
                const n = "plugin_stat";
                for (let a = 0; a < e.length; a++) e[a].outProcess && (t += `key=${e[a].name},version=${e[a].version},value=${e[a].state},errorCode=${e[a].errorCode};`, ++i >= 16 && (S.information("sendPluginStat", n, "plugin_load", t), t = encodeURIComponent(t), f.XLStatNS.trackEvent(n, "plugin_load", "", 0, 0, 0, 0, t), i = 0, t = ""));
                "" !== t && (S.information("sendPluginStat", n, "plugin_load", t), t = encodeURIComponent(t), f.XLStatNS.trackEvent(n, "plugin_load", "", 0, 0, 0, 0, t))
            }

            sendPluginStat(e, t) {
                S.information("sendPluginStat enter");
                let i = "", n = 0;
                for (let a = 0; a < e.length; ++a) i += `key=${e[a].name},version=${e[a].version},value=${e[a].state},errorCode=${e[a].errorCode};`, ++n >= 16 && (S.information("sendPluginStat", t, i), i = encodeURIComponent(i), f.XLStatNS.trackEvent("core_event", t, "", 0, 0, 0, 0, i), n = 0, i = "");
                "" !== i && (S.information("sendPluginStat", t, i), i = encodeURIComponent(i), f.XLStatNS.trackEvent("core_event", t, "", 0, 0, 0, 0, i))
            }

            saveUpdatePluginsConfig() {
                return n(this, void 0, void 0, function* () {
                    S.information("saveUpdatePluginsConfig enter", this.updatePlugins);
                    do {
                        if (null === this.updatePlugins || 0 === this.updatePlugins.data.length) break;
                        let e = (new h.Builder).buildObject(this.updatePlugins);
                        yield l.FileSystemAWNS.writeFileAW(`${this.updatePluginsConfig}`, e.toString())
                    } while (0)
                })
            }

            updateUpPlugins(e) {
                return n(this, void 0, void 0, function* () {
                    if (yield l.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 n(this, void 0, void 0, function* () {
                    S.information("loadUnzipConfig enter");
                    do {
                        if (this.isUnzipConfigLoad) break;
                        let e = yield l.FileSystemAWNS.readFileAW(`${this.unzipConfig}`);
                        if (null !== e) try {
                            this.unzipPlugins = JSON.parse(e.toString()), this.isUnzipConfigLoad = !0
                        } catch (e) {
                            S.warning(e)
                        }
                    } while (0);
                    return this.isUnzipConfigLoad
                })
            }

            saveUnzipConfig() {
                return n(this, void 0, void 0, function* () {
                    let e = void 0;
                    try {
                        e = JSON.stringify(this.unzipPlugins)
                    } catch (e) {
                        S.warning(e)
                    }
                    void 0 !== e && (S.information(e), yield l.FileSystemAWNS.writeFileAW(`${this.unzipConfig}`, e))
                })
            }

            isPluginUnzip(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = e.name;
                    return null !== this.unzipPlugins && null !== this.unzipPlugins[`${i}`] && void 0 !== this.unzipPlugins[`${i}`] && this.unzipPlugins[`${i}`].md5.toUpperCase() === e.md5.toUpperCase() && (t = this.unzipPlugins[`${i}`].unzipstate), t
                })
            }

            updatePluginUnzip(e, t) {
                let i = e.name;
                null !== this.unzipPlugins && (this.unzipPlugins[`${i}`] = t)
            }

            startDownloadPlugins(e, t, a, o, s, d) {
            }

            popPluginGroups(e) {
                let t = null;
                do {
                    if (!e) break;
                    e = e.toLowerCase(), t = this.pluginGroupCache[e], delete this.pluginGroupCache[e]
                } while (0);
                return t
            }

            getPluginStatus(e) {
                let t = null;
                do {
                    if (!e) break;
                    if (e = e.toLowerCase(), this.pluginStatusMap.hasOwnProperty(e)) {
                        t = this.pluginStatusMap[e];
                        break
                    }
                    for (let i in this.pluginStatusMap) {
                        let n = this.pluginStatusMap[i];
                        if (n.name === e) {
                            t = n;
                            break
                        }
                    }
                } while (0);
                return t
            }

            setPluginStatus(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = null;
                    do {
                        let n = this.pluginStatusMap[e.toLowerCase()];
                        if (n) {
                            n.state === t || "loaded" === n.state ? i = n : (i = Object.assign({}, n, {state: t}), this.pluginStatusMap[e.toLowerCase()] = i);
                            break
                        }
                        const a = `${this.currentDir}${e}/config.json`;
                        if (yield l.FileSystemAWNS.existsAW(`${a}`)) {
                            let n = null;
                            try {
                                n = require(a)
                            } catch (e) {
                                S.warning(e)
                            }
                            if (n && n.main) {
                                let o = `${this.currentDir}${e}/${n.main}`;
                                (yield l.FileSystemAWNS.existsAW(o)) && (i = {
                                    state: t,
                                    main: o,
                                    cfgPath: a,
                                    name: n.name.toLowerCase()
                                }, this.pluginStatusMap[e.toLowerCase()] = i, "ready" === t && (n.version && n.clear && this.clear(e, n.version, n.main).catch(), n.owner ? s.server.isRemoteClientExist(n.owner) ? (S.information("owner is running", n.owner, n.name), s.server.fireClientEvent("OnPluginReady", e, n.owner, i)) : (S.information("owner cache ", n.owner, n.name), this.pluginGroupCache.hasOwnProperty(n.owner.toLowerCase()) || (this.pluginGroupCache[n.owner.toLowerCase()] = {}), this.pluginGroupCache[n.owner.toLowerCase()][e.toLowerCase()] = i) : s.server.fireClientEvent("OnPluginReady", e, n.owner, i)))
                            }
                        } else {
                            const n = `${this.currentDir}${e}/index`;
                            (yield l.FileSystemAWNS.existsAW(`${n}.js`)) && (i = {
                                state: t,
                                main: `${n}.js`,
                                name: e.toLowerCase()
                            }, this.pluginStatusMap[e.toLowerCase()] = i, "ready" === t && s.server.fireClientEvent("OnPluginReady", e, void 0, i))
                        }
                    } while (0);
                    return i
                })
            }

            loadPlugin(e, t) {
                return n(this, void 0, void 0, function* () {
                    S.information("loadPlugin enter");
                    let i = null;
                    const n = `${this.currentDir}${e}/index`, a = `${this.currentDir}${e}/config.json`;
                    let r = yield l.FileSystemAWNS.existsAW(`${n}.js`), s = yield l.FileSystemAWNS.existsAW(`${a}`);
                    S.information("loadPlugin outProcess", a, s);
                    let d = yield l.FileSystemAWNS.existsAW(this.currentDir + e + "/plugin-config-file.xml");
                    if (this.isPluginLoaded(e)) i = {}; else {
                        if (s) {
                            if (t) return void (yield this.setPluginStatus(e, "ready"));
                            let n = null;
                            try {
                                n = require(a)
                            } catch (e) {
                                S.warning(e)
                            }
                            if (S.information("loadPlugin config", n), n && n.main) {
                                let t = `${this.currentDir}${e}/${n.main}`;
                                if (yield l.FileSystemAWNS.existsAW(t)) {
                                    let r = `${__rootDir}/out/plugin-boot.js`;
                                    if (yield l.FileSystemAWNS.existsAW(r)) {
                                        const i = o.fork(r, ["--type=xdas-plugin-process", `--xdas-plugin-config=${a}`, `--xdas-plugin-name=${e}`]);
                                        S.information("loadPlugin fork", i, e), k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, i.pid.toString(), t), i.once("exit", () => {
                                            k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, i.pid.toString())
                                        })
                                    } else {
                                        const i = o.fork(t, ["--type=xdas-plugin-process", `--xdas-plugin-name=${e}`]);
                                        S.information("loadPlugin fork", i), k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, i.pid.toString(), t), i.once("exit", () => {
                                            k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, i.pid.toString())
                                        })
                                    }
                                    i = {}, n.version && n.clear && this.clear(e, n.version, n.main).catch()
                                }
                            }
                        } else if (r) try {
                            i = require(n)
                        } catch (e) {
                            S.warning(e)
                        }
                        i && this.setPluginLoaded(e)
                    }
                    let u = this.getPluginFromName(e);
                    return u ? (i || d ? this.updateStat(this.loadPluginsStat, {
                        name: u.name,
                        version: u.version,
                        state: "success",
                        errorCode: 0,
                        outProcess: s
                    }) : this.updateStat(this.loadPluginsStat, {
                        name: u.name,
                        version: u.version,
                        state: "fail",
                        errorCode: -1,
                        outProcess: s
                    }), this.loadPluginsStat.length >= this.getPluginsCount() && (this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.sendPluginStatEx(this.loadPluginsStat), this.loadPluginsStat = []), S.information("loadPlugin leave", i), i) : i
                })
            }

            loadConfig(e, t) {
                return n(this, void 0, void 0, function* () {
                    if (S.information("loadConfig enter"), this.plugins = e, t) {
                        let t = void 0;
                        try {
                            t = JSON.stringify(e)
                        } catch (e) {
                            S.warning(e)
                        }
                        void 0 !== t && (S.information(t), yield l.FileSystemAWNS.writeFileAW(`${this.configName}`, t))
                    }
                    this.loadUnzipConfig().then(() => {
                        this.downloadPlugins()
                    }).catch()
                })
            }

            checkFile(e) {
                return n(this, void 0, void 0, function* () {
                    S.information("checkFile enter");
                    const t = `${this.currentDir}${e.name}.zip`;
                    let i = yield l.FileSystemAWNS.existsAW(t);
                    return i && (i = yield d.ToolsUtilitiesAWNS.matchFileMd5(t, e.md5)), i
                })
            }

            checkLoadPlugin(e) {
                return n(this, void 0, void 0, function* () {
                    S.information("checkLoadPlugin enter"), void 0 !== e.loadtype && (1 === e.loadtype && void 0 !== e.time && e.time >= 0 ? setTimeout(() => {
                        this.loadPlugin(e.name).catch()
                    }, 1e3 * e.time) : 2 === e.loadtype && (this.emitter && this.emitter.emit(u.NodeEventMesssageNS.eventPluginLoderPluginReady, e.name), yield this.setPluginStatus(e.name, "ready")))
                })
            }

            onDownloadPluginFinish(e, t) {
                return n(this, void 0, void 0, function* () {
                    S.information("onDownloadPluginFinish bSuccess:", e, "name:", t.name, "index:", this.handlePluginIndex);
                    const n = `${this.currentDir}${t.name}.zip`, a = `${this.currentDir}${t.name}/`;
                    let o = !1, r = !1, s = !1;
                    if (e) {
                        let e = yield l.FileSystemAWNS.existsAW(a);
                        if (e && (s = yield this.isPluginUnzip(t)), r = e, o = !s) {
                            const {UnzipUtilitiesAWNS: e} = yield Promise.resolve().then(() => i(139));
                            (r = yield e.uncompressZipFile(a, n)) ? (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 (r) {
                            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() && (S.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 n(this, void 0, void 0, function* () {
                    if (S.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] && (S.information("取消监听 ", this.taskStatusChangedEventTable[e]), C.detachTaskEvent(p.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
            }

            attachTaskStatusChangedEvent(e, t) {
                S.information("attachTaskStatusChangedEvent taskId: ", e), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = C.attachTaskEvent(p.DownloadKernel.TaskEventType.StatusChanged, (...i) => n(this, void 0, void 0, function* () {
                    let n = !1;
                    do {
                        if (!i) {
                            S.information("args is null");
                            break
                        }
                        if (i[0] !== p.DownloadKernel.TaskEventType.StatusChanged) {
                            S.information("args[0] is not StatusChanged");
                            break
                        }
                        let a = i[1];
                        if (!a) {
                            S.information("taskList is null");
                            break
                        }
                        for (let i = 0; i < a.length; ++i) {
                            let o = a[i];
                            if (!o) continue;
                            if (o.getId() !== e) continue;
                            let r = o.getTaskStatus();
                            S.information("get status ", r), r === p.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 === p.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)), n = !0
                        }
                    } while (0);
                    return n
                })))
            }

            downloadPlugin(e, t) {
                return n(this, void 0, void 0, function* () {
                    S.information("downloadPlugin enter");
                    let a = !1;
                    const o = `${this.currentDir}`, s = `${this.currentDir}${e.name}.zip`, d = `${e.name}.zip`;
                    do {
                        if (void 0 !== e.url) {
                            let t = null;
                            try {
                                r.default.defaults.adapter = i(21), t = yield r.default.get(e.url, {responseType: "arraybuffer"})
                            } catch (e) {
                                break
                            }
                            if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data) {
                                if (yield l.FileSystemAWNS.writeFileAW(s, 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 l.FileSystemAWNS.unlinkAW(s + ".xltd"), yield l.FileSystemAWNS.unlinkAW(s + ".xltd.cfg")) : l.FileSystemAWNS.unlinkAW(s).then(() => n(this, void 0, void 0, function* () {
                        let t = {
                            taskBaseInfo: {savePath: o, taskName: d},
                            p2spTaskInfo: {url: e.url, nameFixed: 1},
                            isBackground: !0
                        }, i = yield w.createTask(p.DownloadKernel.TaskType.P2sp, t);
                        if (null !== i) {
                            let t = i.getTaskAttribute(p.DownloadKernel.TaskAttribute.TaskId);
                            this.attachTaskStatusChangedEvent(t, e), yield y.DownloadDispatchNS.startTask(t)
                        }
                    })).catch()
                })
            }

            downloadPlugins() {
                if (S.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, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(27), o = i(345), r = i(36), s = i(25), l = i(3), d = i(15), u = i(12), c = i(14), h = i(29),
        f = i(5), g = n.default.getLogger("TaskDetail.TaskDetail"), p = o.TaskInfoManagerNS.getTaskInfoManager(),
        v = d.DownloadKernelEventManager.getEventManager(), m = u.DownloadKernelTaskManager.getTaskManager();
    var y;
    !function (e) {
        e.Comments = "comments", e.FileList = "files", e.Attribute = "detail"
    }(y = t.DetailIndex || (t.DetailIndex = {}));
    !function (e) {
        const t = new class {
            constructor() {
                this.isPageReady = !1, this.unFireTaskId = 0, this.unFireTaskData = "", this.unFireIndex = y.Comments, this.curTaskId = 0, this.curPannel = "", this.select = !1
            }

            init() {
                v.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.ChannelInfoChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskDescriptionChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskMovingStateChange, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    this.onGroupTaskSubFileDetailChanged(...e)
                }), h.default.attachListener(c.NodeEventMesssageNS.eventDownloadItemActive, (e, t, i, n, a, o) => {
                    t ? (this.curTaskId = i, this.select = !0, this.onTaskSelectChanged(e, o)) : (a || i === 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.NativeCallNS.registerNativeFunction(e)
            }

            pageReady() {
                this.isPageReady = !0, g.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 i = t[e];
                        if (!i) continue;
                        let n = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        n === this.curTaskId && (i.getTaskAttribute(l.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || p.getTaskInfoString(n).then(e => {
                            this.onTaskInfoChange(n, 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 i = e[2], n = p.getBtSubFileListString(t, i);
                    this.onSubFileInfoChange(t, n)
                } 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 i = p.getGroupTaskSubFileListString(e);
                            this.onSubFileInfoChange(t, i)
                        }
                    })
                } while (0)
            }

            onTaskSelectChanged(e, t) {
                let i = "";
                switch (e) {
                    case l.DownloadKernel.CategroyViewID.Downloading:
                        i = "downloading";
                        break;
                    case l.DownloadKernel.CategroyViewID.Completed:
                        i = "complete";
                        break;
                    case l.DownloadKernel.CategroyViewID.Recycle:
                        i = "trash"
                }
                this.curPannel = i;
                let n = {};
                n.pannel = i;
                let a = JSON.stringify(n);
                this.onCurTaskChange(this.curTaskId, a, t);
                let o = this.curTaskId;
                do {
                    let e = m.getTaskFromTaskId(this.curTaskId);
                    if (!e) break;
                    if (e.getType() !== l.DownloadKernel.TaskType.Bt) break;
                    let i = e.getExtraObject();
                    if (!i) break;
                    if (i.isBtFileLoadEnd()) break;
                    e.loadStorageBtTaskAW(e.getTaskBaseInfo()).then(() => {
                        o === this.curTaskId && this.onCurTaskChange(this.curTaskId, a, t)
                    }).catch()
                } while (0)
            }

            onCurTaskChange(e, t, i) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnCurTaskChange", e, t, i), f.client.callServerFunction("SelectTaskChange", e.toString()).catch(), this.isPageReady ? g.information("OnCurTaskChange", e, t, i) : (this.unFireTaskId = e, this.unFireTaskData = t, this.unFireIndex = i)
            }

            onTaskInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInfoChange", e, t)
            }

            onSubFileInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubFileInfoChange", e, t)
            }

            getCurTask(e, t, i) {
                do {
                    if (!e || !t || !i) break;
                    let n = {};
                    n.taskID = this.curTaskId, n.pannel = this.curPannel;
                    let a = JSON.stringify(n);
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, a)
                } while (0)
            }
        };
        e.init = function () {
            t.init()
        }, e.pageReady = function () {
            t.pageReady()
        }
    }(t.TaskDetailNS || (t.TaskDetailNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(7), r = i(0), s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        l = r.default.getLogger("diskimage-helper");
    !function (e) {
        e.attachVirtualDisk = function (e) {
            return n(this, void 0, void 0, function* () {
                return l.information("attachVirtualDisk imagePath:", e), new Promise(t => {
                    s.attachVirtualDisk(e, i => {
                        l.information("attachVirtualDisk imagePath:", e, "physicalPath:", i), t(i)
                    })
                })
            })
        }, e.detachVirtualDisk = function (e) {
            return n(this, void 0, void 0, function* () {
                return l.information("detachVirtualDisk imagePath:", e), new Promise(t => {
                    s.detachVirtualDisk(e, i => {
                        l.information("detachVirtualDisk imagePath:", e, "ret:", i), t(0 === i)
                    })
                })
            })
        }, e.getVirtualDiskPhysicalPath = function (e) {
            return n(this, void 0, void 0, function* () {
                return l.information("getVirtualDiskPhysicalPath imagePath:", e), new Promise(t => {
                    s.getVirtualDiskPhysicalPath(e, i => {
                        l.information("getVirtualDiskPhysicalPath imagePath:", e, "physicalPath:", i), t(i)
                    })
                })
            })
        }
    }(t.DiskImageHelperNS || (t.DiskImageHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4), o = i(5), r = i(0), s = i(65), l = i(16), d = i(6), u = i(53),
        c = r.default.getLogger("ThunderUnionYunFetchBackNS");
    !function (e) {
        function t(e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                try {
                    t = JSON.parse(e)
                } catch (t) {
                    c.warning("JSON.parse exception!", t, e)
                }
                a.isObject(t) ? yield function (e) {
                    return n(this, void 0, void 0, function* () {
                        do {
                            yield r();
                            let t = yield s.default(!1, !0, "yunfetchback");
                            if (!t || "" === t) {
                                c.warning("shouldLogin failed!", e);
                                break
                            }
                            if (!e.fromShare && e.userId !== t) {
                                if (c.information("userid not equal, SwitchAccount. ", e, t), o.client.callServerFunction("SwitchAccount").catch(), !(t = yield s.default(!1, !0, "yunfetchback")) || "" === t) {
                                    c.warning("SwitchAccount shouldLogin failed!", e);
                                    break
                                }
                                if (e.userId !== t) {
                                    c.warning("SwitchAccount userId illegal!", e, t);
                                    break
                                }
                            }
                            if (l.server.isRemoteClientExist("ThunderPanPluginWebview")) yield o.client.callServerFunction("BringMainWndToTop"), yield o.client.callServerFunction("SelectNav", u.NavViewID.Cloud), yield l.server.callClientFunctionByName("ThunderPanPluginWebview", "ExternalFetchBack", e); else {
                                c.information("ThunderPanPluginWebview not exist! wait for ready.");
                                let t = o.client.attachServerEvent("ThunderPanPluginReady", () => n(this, void 0, void 0, function* () {
                                    c.information("ThunderPanPluginReady"), o.client.detachServerEvent("ThunderPanPluginReady", t), yield o.client.callServerFunction("BringMainWndToTop"), yield o.client.callServerFunction("SelectNav", u.NavViewID.Cloud), yield l.server.callClientFunctionByName("ThunderPanPluginWebview", "ExternalFetchBack", e)
                                }))
                            }
                        } while (0)
                    })
                }(t) : c.warning("invalid fetch back data!", t)
            })
        }

        function i(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e || !(yield d.FileSystemAWNS.existsAW(e))) break;
                    let i = yield d.FileSystemAWNS.readFileAW(e);
                    if (yield d.FileSystemAWNS.unlinkAW(e), null === i || void 0 === i || "" === i.toString()) {
                        c.information("parseUnionFileAndCreateTasks:读取内容 buf为null");
                        break
                    }
                    let n = i.toString();
                    if (n.length <= 2) {
                        c.information("strContent.length <= 2", n);
                        break
                    }
                    yield t(n)
                } while (0)
            })
        }

        function r() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => n(this, void 0, void 0, function* () {
                    if (l.server.isRemoteClientExist("User")) e(!0); else {
                        let t = 0, i = setInterval(() => {
                            l.server.isRemoteClientExist("User") && (clearInterval(i), e(!0)), (t += 500) > 3e3 && (clearInterval(i), e(!1))
                        }, 500)
                    }
                }))
            })
        }

        e.createYunFetchBackTask = function (e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (c.information("createYunFetchBackTask", e), !e) break;
                    let t = e.indexOf("unionfile:");
                    t > -1 && (e = e.substring(t + 10)), yield i(decodeURIComponent(e))
                } while (0)
            })
        }, e.createTaskFromJsonString = t
    }(t.ThunderUnionYunFetchBackNS || (t.ThunderUnionYunFetchBackNS = {}))
}, function (e, t, i) {
    "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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(27), r = i(23), s = i(588), l = i(31), d = i(15), u = i(12), c = i(3), h = i(14), f = i(0),
        g = i(4), p = i(57), v = i(2), m = i(6), y = i(35), k = f.default.getLogger("DownloadDataManager"),
        T = u.DownloadKernelTaskManager.getTaskManager(), w = d.DownloadKernelEventManager.getEventManager();
    const C = new class {
        constructor() {
            this.reportTimerId = null, this.downloadDataRecord = {}, this.initDate = "", this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0, this.initDownloadSize = 0, this.initUploadSize = 0, this.initTotalBenifites = 0, this.initTotalProviders = 0, this.initMaxDownloadSpeed = 0, this.initMaxUploadSpeed = 0, this.initVipDownloadSize = 0, this.initDownloadFiles = 0, this.initVipSave = 0, this.downloadFinishFilesCur = 0, this.vipSaveCur = 0, this.curUid = "", this.downloadDataDir = v.join(__profilesDir, "DownloadData/"), this.downloadDataPath = v.join(__profilesDir, "DownloadData/UserDownloadData.dat"), this.downloadData = {
                totalDownloadSpeed: 0,
                totalUploadSpeed: 0,
                todayDownloadSize: 0,
                todayUploadSize: 0,
                totalDownloadSize: 0,
                totalUploadSize: 0,
                totalProviders: 0,
                totalBenifites: 0,
                maxDownloadSpeed: 0,
                maxUploadSpeed: 0,
                downloadFinishFiles: 0,
                vipAccPercent: 0,
                vipDonwloadSize: 0,
                vipSave: 0
            }, this.downloadDataBeforeLogin = {
                downloadSize: 0,
                uploadSize: 0,
                providers: 0,
                benifites: 0,
                vipDownloadSizePre: 0
            }, this.downloadTaskData = new Map, p.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                this.reportDownloadData().catch(), yield this.saveDownloadData(), e(!0)
            })))
        }

        getSessionID() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    r.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                        k.information("getSessionID:sessionid = ", t), e(t)
                    })
                })
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                k.information("init Enter");
                let e = !1;
                return (yield m.FileSystemAWNS.existsAW(`${this.downloadDataDir}`)) || (yield m.FileSystemAWNS.mkdirsAW(`${this.downloadDataDir}`)), (yield r.LoginHelperNS.loginHelper.isLoginedAw()) && (this.curUid = (yield this.getUserID()) || "", e = yield this.initDownloadData()), a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", t => n(this, void 0, void 0, function* () {
                    k.information("onLoginSuc userId:", t), this.curUid = t, this.downloadDataBeforeLogin.downloadSize = l.DownloadKernelManager.getTotalDownloadSize(), this.downloadDataBeforeLogin.uploadSize = l.DownloadKernelManager.getTotalUploadSize(), this.downloadDataBeforeLogin.benifites = yield this.getBenifites();
                    let i = this.getProvidersAndVipDownloadSize();
                    this.downloadDataBeforeLogin.providers = i[0], this.downloadDataBeforeLogin.vipDownloadSizePre = i[1], e = yield this.initDownloadData()
                })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => n(this, void 0, void 0, function* () {
                    k.information("onLogout userId = ", this.curUid), yield this.saveDownloadData(), this.curUid = "", this.killTimer()
                })), l.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, e => n(this, void 0, void 0, function* () {
                    "" !== this.curUid && (this.downloadData.totalDownloadSpeed = l.DownloadKernelManager.getTotalTaskDownloadSpeed(!1), this.downloadData.maxDownloadSpeed = this.downloadData.maxDownloadSpeed > this.downloadData.totalDownloadSpeed ? this.downloadData.maxDownloadSpeed : this.downloadData.totalDownloadSpeed, yield this.updateData())
                })), l.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, e => n(this, void 0, void 0, function* () {
                    "" !== this.curUid && (this.downloadData.totalUploadSpeed = e, this.downloadData.maxUploadSpeed = this.downloadData.maxUploadSpeed > e ? this.downloadData.maxUploadSpeed : e, yield this.updateData())
                })), w.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => n(this, void 0, void 0, function* () {
                    do {
                        if ("" === this.curUid) break;
                        if (!e) break;
                        if (e[0] !== c.DownloadKernel.TaskEventType.StatusChanged) break;
                        let t = e[1];
                        if (!t) break;
                        for (let e = 0; e < t.length; ++e) {
                            let i = t[e];
                            if (i && i.getTaskStatus() === c.DownloadKernel.TaskStatus.Succeeded) {
                                let e = 0;
                                if (!i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) {
                                    let t = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType);
                                    t === c.DownloadKernel.TaskType.Emule || t === c.DownloadKernel.TaskType.P2sp ? e = 1 : t === c.DownloadKernel.TaskType.Bt ? e = i.getExtraObject().getDownloadFile().length : t === c.DownloadKernel.TaskType.Group && (e = i.getExtraObject().getDownloadTaskCount())
                                }
                                this.downloadFinishFilesCur += e, this.calculateVipSaveTime(i)
                            }
                        }
                        yield this.updateData()
                    } while (0)
                })), e
            })
        }

        calculateVipSaveTime(e) {
            do {
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize), i = e.getTaskChannelInfo(),
                    n = i.offlineSize + i.dcdnSize;
                if (0 === n || t <= n) break;
                let a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod);
                a = 0 !== a ? a : 1;
                let o = Math.round(t * a / (t - n) - a);
                this.vipSaveCur += o
            } while (0)
        }

        initDownloadData() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                this.downloadFinishFilesCur = 0, this.vipSaveCur = 0, this.downloadTaskData.clear(), yield this.loadDownloadData();
                let t = yield s.getDownloadData({});
                return k.information("initDownloadData res = ", t), !t[1] && t[0] && (t[0].total_download && t[0].total_download > this.initDownloadSize && (this.initDownloadSize = t[0].total_download || 0, this.initUploadSize = t[0].total_upload || 0, this.initTotalBenifites = t[0].total_benefit || 0, this.initTotalProviders = t[0].total_provider || 0, this.initMaxDownloadSpeed = t[0].peak_downspeed || 0, this.initMaxUploadSpeed = t[0].peak_upspeed || 0, this.initVipDownloadSize = t[0].vip_download || 0, this.initVipSave = t[0].vip_save || 0, this.initDownloadFiles = t[0].download_file || 0), this.reportTimerId = setInterval(() => n(this, void 0, void 0, function* () {
                    this.reportDownloadData().catch(), yield this.saveDownloadData()
                }), 18e5), e = !0), this.downloadData.maxDownloadSpeed = this.initMaxDownloadSpeed, this.downloadData.maxUploadSpeed = this.initMaxUploadSpeed, yield this.updateData(), e
            })
        }

        reportDownloadData() {
            return n(this, void 0, void 0, function* () {
                let e = yield s.postDownloadData({
                    total_download: this.downloadData.totalDownloadSize,
                    total_upload: this.downloadData.totalUploadSize,
                    total_provider: this.downloadData.totalProviders,
                    total_benefit: this.downloadData.totalBenifites,
                    peak_downspeed: this.downloadData.maxDownloadSpeed,
                    peak_upspeed: this.downloadData.maxUploadSpeed,
                    vip_download: this.downloadData.vipDonwloadSize,
                    vip_save: this.downloadData.vipSave,
                    download_file: this.downloadData.downloadFinishFiles
                });
                k.information("reportDownloadData res = ", e)
            })
        }

        killTimer() {
            this.reportTimerId && (clearInterval(this.reportTimerId), this.reportTimerId = null)
        }

        getBenifites() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.DownloadKernelManager.getSumOfRemotePeerBeBenefited(t => {
                        e(t)
                    })
                })
            })
        }

        getProvidersAndVipDownloadSize() {
            let e = [0, 0], t = T.getStartTaskIDs();
            for (let e = 0; e < t.length; ++e) {
                let i = T.getTaskFromTaskId(t[e]);
                if (i && !i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) {
                    let n = i.getTotalAvailablePeer(), a = i.getVipDownloadSizeCur();
                    this.downloadTaskData.set(t[e], {providers: n, vipDownloadSize: a})
                }
            }
            for (let t of this.downloadTaskData.values()) e[0] += t.providers, e[1] += t.vipDownloadSize;
            return e
        }

        updateData() {
            return n(this, void 0, void 0, function* () {
                this.initDate !== this.getCurDate() && (this.initDate = this.getCurDate(), this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0, this.downloadDataBeforeLogin.downloadSize = l.DownloadKernelManager.getTotalDownloadSize(), this.downloadDataBeforeLogin.uploadSize = l.DownloadKernelManager.getTotalUploadSize()), this.downloadData.todayDownloadSize = this.initTodayDownloadSize + l.DownloadKernelManager.getTotalDownloadSize() - this.downloadDataBeforeLogin.downloadSize, this.downloadData.todayUploadSize = this.initTodayUploadSize + l.DownloadKernelManager.getTotalUploadSize() - this.downloadDataBeforeLogin.uploadSize, this.downloadData.totalDownloadSize = this.initDownloadSize + l.DownloadKernelManager.getTotalDownloadSize() - this.downloadDataBeforeLogin.downloadSize, this.downloadData.totalUploadSize = this.initUploadSize + l.DownloadKernelManager.getTotalUploadSize() - this.downloadDataBeforeLogin.uploadSize, this.downloadData.totalDownloadSize = this.downloadData.totalDownloadSize > this.downloadData.todayDownloadSize ? this.downloadData.totalDownloadSize : this.downloadData.todayDownloadSize, this.downloadData.totalUploadSize = this.downloadData.totalUploadSize > this.downloadData.todayUploadSize ? this.downloadData.totalUploadSize : this.downloadData.todayUploadSize;
                let e = yield this.getBenifites();
                this.downloadData.totalBenifites = this.initTotalBenifites + e - this.downloadDataBeforeLogin.benifites;
                let t = this.getProvidersAndVipDownloadSize();
                t[0] < this.downloadDataBeforeLogin.providers && (t[0] = this.downloadDataBeforeLogin.providers), t[1] < this.downloadDataBeforeLogin.vipDownloadSizePre && (t[1] = this.downloadDataBeforeLogin.vipDownloadSizePre), this.downloadData.totalProviders = this.initTotalProviders + t[0] - this.downloadDataBeforeLogin.providers, this.downloadData.vipDonwloadSize = this.initVipDownloadSize + t[1] - this.downloadDataBeforeLogin.vipDownloadSizePre, this.downloadData.vipDonwloadSize = this.downloadData.vipDonwloadSize > this.downloadData.totalDownloadSize ? this.downloadData.totalDownloadSize : this.downloadData.vipDonwloadSize, 0 === this.downloadData.totalDownloadSize ? this.downloadData.vipAccPercent = 0 : this.downloadData.vipAccPercent = this.downloadData.vipDonwloadSize / this.downloadData.totalDownloadSize, this.downloadData.vipSave = this.initVipSave + this.vipSaveCur, this.downloadData.downloadFinishFiles = this.initDownloadFiles + this.downloadFinishFilesCur, o.NativeCallHostModule.nativeCallHost.fireNativeEvent("download-data-update", JSON.stringify(this.downloadData))
            })
        }

        getDownloadData() {
            return this.downloadData
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}-${t.getMonth() + 1}-${t.getDate()}`
        }

        saveDownloadData() {
            return n(this, void 0, void 0, function* () {
                try {
                    "" !== this.curUid && (this.downloadDataRecord[this.curUid] = this.downloadDataRecord[this.curUid] || {}, this.downloadDataRecord[this.curUid].DownloadData = this.downloadData, this.downloadDataRecord[this.curUid].SaveDate = this.getCurDate()), k.information("saveDownloadData downloadData = ", this.downloadDataRecord);
                    let e = JSON.stringify(this.downloadDataRecord);
                    k.information("saveDownloadData bufStr:", e);
                    let t = new Buffer(e), i = y.ToolsUtilitiesAWNS.genarateMd5("thunderx").substr(0, 16).toUpperCase(),
                        n = y.ToolsUtilitiesAWNS.encryptBuffer(t, i);
                    yield m.FileSystemAWNS.writeFileAW(this.downloadDataPath, n)
                } catch (e) {
                    k.information(e)
                }
            })
        }

        clearInitData() {
            this.initDownloadSize = 0, this.initUploadSize = 0, this.initTotalBenifites = 0, this.initTotalProviders = 0, this.initMaxDownloadSpeed = 0, this.initMaxUploadSpeed = 0, this.initVipDownloadSize = 0, this.initVipSave = 0, this.initDownloadFiles = 0, this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0
        }

        loadDownloadData() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.clearInitData(), "" === this.curUid) break;
                    let e = yield m.FileSystemAWNS.readFileAW(`${this.downloadDataPath}`);
                    if (g.isNullOrUndefined(e) || "" === e.toString()) {
                        k.information("loadDownloadData buf is null");
                        break
                    }
                    let t = "";
                    try {
                        let i = y.ToolsUtilitiesAWNS.genarateMd5("thunderx").substr(0, 16).toUpperCase();
                        if (t = y.ToolsUtilitiesAWNS.decryptBuffer(e, i).toString(), g.isNullOrUndefined(t) || "" === t) {
                            k.information("loadDownloadData bufStr is null");
                            break
                        }
                        if (this.downloadDataRecord = JSON.parse(t), "" !== this.curUid && g.isNullOrUndefined(this.downloadDataRecord[this.curUid])) {
                            this.downloadDataRecord[this.curUid] = {};
                            break
                        }
                        this.initDate = this.downloadDataRecord[this.curUid].SaveDate, this.initDownloadSize = this.downloadDataRecord[this.curUid].DownloadData.totalDownloadSize || 0, this.initUploadSize = this.downloadDataRecord[this.curUid].DownloadData.totalUploadSize || 0, this.initTotalBenifites = this.downloadDataRecord[this.curUid].DownloadData.totalBenifites || 0, this.initTotalProviders = this.downloadDataRecord[this.curUid].DownloadData.totalProviders || 0, this.initMaxDownloadSpeed = this.downloadDataRecord[this.curUid].DownloadData.maxDownloadSpeed || 0, this.initMaxUploadSpeed = this.downloadDataRecord[this.curUid].DownloadData.maxUploadSpeed || 0, this.initVipDownloadSize = this.downloadDataRecord[this.curUid].DownloadData.vipDonwloadSize || 0, this.initVipSave = this.downloadDataRecord[this.curUid].DownloadData.vipSave || 0, this.initDownloadFiles = this.downloadDataRecord[this.curUid].DownloadData.downloadFinishFiles || 0, this.downloadDataRecord[this.curUid].SaveDate !== this.getCurDate() ? (this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0) : (this.initTodayDownloadSize = this.downloadDataRecord[this.curUid].DownloadData.todayDownloadSize || 0, this.initTodayUploadSize = this.downloadDataRecord[this.curUid].DownloadData.todayUploadSize || 0), k.information("loadDownloadData decryption downloadData:", this.downloadDataRecord, this.initMaxDownloadSpeed, this.initDownloadSize)
                    } catch (e) {
                        k.information("loadDownloadData exception", e)
                    }
                } while (0)
            })
        }

        getUserID() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    r.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        k.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }
    };
    t.default = C
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(20), r = i(60), s = i(6), l = i(63), d = i(0).default.getLogger("ShouleiInstallImg"),
        u = "http://static-xl.a.88cdn.com/json/mobile-pc.json";
    let c = "";
    t.getMobileImgSrc = function () {
        return n(this, void 0, void 0, function* () {
            let e = "";
            do {
                let t = null;
                try {
                    o.default.defaults.adapter = i(21), t = yield o.default.get(u)
                } catch (e) {
                    d.warning(e)
                }
                let n = "";
                if (null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && t.data.downloadQR && (n = t.data.downloadQR), !n) break;
                let h = l.ParseUrlFileNameNS.getNameFromUrl(n);
                if (!h) break;
                let f = a.resolve(__profilesDir, `mobile/${h}`);
                if (f === c && (yield s.FileSystemAWNS.existsAW(f))) {
                    e = f;
                    break
                }
                d.information("downloadFileAW", n, f), (yield r.AxiosNS.downloadFileAW(n, f)) && (c = f, e = f)
            } while (0);
            return e
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(11), r = i(2), s = i(4), l = i(0), d = i(35), u = i(7), c = i(27),
        h = u.default(r.join(__rootDir, "../bin/ThunderHelper.node")), f = l.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, i, r, l) {
                return n(this, void 0, void 0, function* () {
                    if (f.information("create TipsWnd:", t, e, l, i, r, this.tipsWnd), null === this.tipsWnd && !s.isNullOrUndefined(e)) {
                        if (this.isLoadFinish = !1, this.isReadyShow = !1, this.lastTipsWndShowState = t, s.isNullOrUndefined(i) && (i = 460), s.isNullOrUndefined(r) && (r = 360), s.isNullOrUndefined(this.tipsWnd)) {
                            let e = yield o.asyncRemoteCall.getCurrentWindow(),
                                t = yield o.asyncRemoteCall.getBrowserWindow();
                            this.tipsWnd = yield new t({
                                width: i,
                                height: r,
                                modal: !1,
                                resizable: !1,
                                skipTaskbar: !0,
                                frame: !1,
                                center: !0,
                                parent: e,
                                show: !1,
                                webPreferences: {spellcheck: !1, nodeIntegration: !0, webSecurity: !0}
                            })
                        }
                        this.tipsWnd.on("hide", () => n(this, void 0, void 0, function* () {
                            let e = yield o.asyncRemoteCall.getCurrentWindow();
                            if (e) {
                                let t = yield e.isMinimized(), i = yield e.isVisible();
                                !t && i && e.show()
                            }
                        })), this.tipsWnd.once("ready-to-show", () => {
                            this.isReadyShow = !0, f.information("create tipswindow ready-to-show:", this.isReadyShow), this.lastTipsWndShowState && (c.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), this.tipsWnd.show())
                        }), this.tipsWnd.webContents.once("did-finish-load", () => {
                            this.isLoadFinish = !0, f.information("create TipsWnd did-finish-load:", this.isLoadFinish)
                        }), this.tipsWnd.on("closed", () => n(this, void 0, void 0, function* () {
                            f.information("TipsWnd closed"), this.tipsWnd = null;
                            let e = yield o.asyncRemoteCall.getCurrentWindow();
                            if (e) {
                                let t = yield e.isMinimized(), i = yield e.isVisible();
                                !t && i && e.show()
                            }
                        })), a.ipcRenderer.send("create-shadow-window", this.tipsWnd.id), this.tipsWnd.loadURL(e).catch()
                    }
                })
            }

            closeTipsWnd() {
                f.information("closeTipsWnd"), null !== this.tipsWnd && (this.lastTipsWndShowState = !1, this.tipsWnd.close(), this.tipsWnd = null)
            }

            showOrHideTipsWnd(e, t, i, n, a) {
                if (f.information("updateTipsWnd:", e, t, i, n, this.tipsWnd), s.isNullOrUndefined(e) && (e = !1), s.isNullOrUndefined(this.tipsWnd)) {
                    if (null === t || void 0 === t || "" === t) return;
                    this.createTipsWnd(t, e, i, n, a).catch()
                } else this.lastTipsWndShowState = e, this.lastTipsWndShowState ? (c.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), f.information("updateLoginWnd:显示tips窗口"), this.tipsWnd.show(), d.ToolsUtilitiesAWNS.setForegroundWindow(h, this.tipsWnd).catch()) : this.tipsWnd.hide()
            }

            isMainWndShow() {
                return n(this, void 0, void 0, function* () {
                    f.information("getMainWndState");
                    let e = !0, t = yield o.asyncRemoteCall.getCurrentWindow();
                    return !(yield t.isMinimized()) && (yield t.isVisible()) || (e = !1), e
                })
            }

            isTipsWndShow() {
                f.information("getTipsWndState");
                let e = !1;
                return this.lastTipsWndShowState && (e = !0), e
            }
        }
    }(t.TipsHelperNS || (t.TipsHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(34), s = i(3), l = i(44), d = i(41), u = i(12), c = i(15),
        h = o.default.getLogger("sdk-download"), f = c.DownloadKernelEventManager.getEventManager();
    t.sdkDownloader = new class {
        constructor() {
            this.keyMap = {}, this.listenMap = {}, this.eventCookie = void 0
        }

        createTaskBySDK(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (!e) break;
                    let i = e.url;
                    if (!i) break;
                    let n = e.savePath;
                    if (!n) break;
                    let o = e.fileName;
                    if (!o) break;
                    let c = `${i}${n}${o}`;
                    if (this.keyMap.hasOwnProperty(c)) {
                        if (t = !0, e.onTaskFinish) {
                            let t = this.keyMap[c];
                            h.information("task is running", c, t), this.addListener(t, e.onTaskFinish)
                        }
                        break
                    }
                    let f = e.source ? e.source : "", g = {
                        taskBaseInfo: {
                            taskName: o,
                            savePath: n,
                            productInfo: d.TaskCtrlOperatorNS.constructProductInfo(e.browser),
                            origin: f
                        }, isBackground: !0
                    }, p = r.ThunderHelper.getTaskTypeFromUrl(i);
                    if (p === s.DownloadKernel.TaskType.Emule) {
                        let e = {url: i};
                        g.emuleTaskInfo = e
                    } else if (p === s.DownloadKernel.TaskType.P2sp) {
                        let e = {url: i, nameFixed: 1};
                        g.p2spTaskInfo = e
                    } else {
                        if (p !== s.DownloadKernel.TaskType.Magnet) break;
                        {
                            let e = {url: i, torrentFilePath: a.normalize(a.join(n, o))};
                            g.magnetTaskInfo = e
                        }
                    }
                    let v = yield u.DownloadKernelTaskManager.getTaskManager().createTask(p, g);
                    if (!v) break;
                    let m = v.getId();
                    t = yield l.DownloadDispatchNS.startTask(m, !0), h.information("sdk create task", m), t && (e.onTaskFinish && this.addListener(m, e.onTaskFinish), this.keyMap[c] = m, this.attachTaskStatus())
                } while (0);
                return t || e.onTaskFinish && e.onTaskFinish(!1), t
            })
        }

        addListener(e, t) {
            this.listenMap.hasOwnProperty(e) ? this.listenMap[e] = [...this.listenMap[e]].concat(t) : this.listenMap[e] = [].concat(t)
        }

        release(e) {
            delete this.listenMap[e];
            for (let t in this.keyMap) if (this.keyMap[t] === e) {
                delete this.keyMap[t];
                break
            }
        }

        attachTaskStatus() {
            do {
                if (this.eventCookie) break;
                this.eventCookie = f.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!e[1]) break;
                        let t = Object.values(this.keyMap);
                        if (!t || 0 === t.length) break;
                        let i = e[1];
                        for (let e = 0; e < i.length; ++e) {
                            let n = i[e];
                            if (!n) continue;
                            let a = n.getTaskStatus(), o = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                            -1 !== t.indexOf(o) && (a === s.DownloadKernel.TaskStatus.Succeeded || a === s.DownloadKernel.TaskStatus.Seeding ? (this.fireAll(o, !0, n), this.release(o)) : a === s.DownloadKernel.TaskStatus.Failed && (this.fireAll(o, !1), this.release(o)))
                        }
                        (t = Object.values(this.keyMap)) && 0 !== t.length || this.detachTaskStatus()
                    } while (0)
                }))
            } while (0)
        }

        fireAll(e, t, i) {
            do {
                if (!this.listenMap.hasOwnProperty(e)) break;
                let n = this.listenMap[e];
                if (!n || 0 === n.length) break;
                if (!t) {
                    for (let e = 0; e < n.length; e++) n[e](t);
                    break
                }
                if (!i) break;
                let o = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                    r = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), l = a.normalize(a.join(o, r));
                for (let e = 0; e < n.length; e++) n[e](t, l)
            } while (0)
        }

        detachTaskStatus() {
            h.information("detachTaskStatus", this.eventCookie), void 0 !== this.eventCookie && (f.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.eventCookie), this.eventCookie = void 0)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(4), r = i(17), s = i(65), l = i(467), d = i(468), u = i(89), c = i(36), h = i(25), f = i(9),
        g = i(10), p = i(104), v = d.GroupAccelerateManagerNS.getManager(),
        m = l.GroupAccelerateEventManagerNS.getEventManager(), y = u.TabEventManagerNS.getEventEmitter(),
        k = 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, k.information("constructor")
            }

            init(e) {
                k.information("init", " entryPage: ", e), e && (this.entryPage = e), m.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, (e, t, i) => {
                    k.information("init OnTaskStatusChange", " taskId: ", e, " taskStatus: ", t, " taskUniqueId: ", i), this.fireTaskStatusChangeEvent(e, t, i)
                }), m.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, (e, t, i, n, a) => {
                    k.information("init OnTaskSpeedChange", " taskId: ", e, " taskSpeed: ", t, " increaseSpeed: ", i, " extraStr: ", n, " taskUniqueId: ", a), this.fireTaskSpeedChangeEvent(e, t, i, n, a)
                }), y.on(u.TabEventManagerNS.EventType.RemoveTab, e => {
                    if ("组队加速" === e.tabInfo.title && "groupAccelerate" === e.tabInfo.tab.name) {
                        v.exitAllTeamNoTask();
                        for (let [t, i] of this.taskSpeedListenerMap) if (i.tab === e.tabInfo.tab) {
                            this.taskSpeedListenerMap.delete(t);
                            break
                        }
                        for (let [t, i] of this.taskStatusListenerMap) if (i.tab === e.tabInfo.tab) {
                            this.taskStatusListenerMap.delete(t);
                            break
                        }
                    }
                }), this.registerNativeFunction()
            }

            openGroupAccelerateTabByTaskId(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    k.information("openGroupAccelerateTabByTaskId", " taskId: ", e, " entry: ", t, " panel: ", i, " queryString: ", a);
                    let n = v.getTaskUniqueIdByTaskId(e);
                    k.information("openGroupAccelerateTabByTaskId", " taskUniqueId: ", n), n && "" !== n && this.openGroupAccelerateTabByTaskUniqueId(n, t, i, a).then(e => {
                        k.information("openGroupAccelerateTabByTaskId success")
                    }).catch(() => {
                        k.information("openGroupAccelerateTabByTaskId failed")
                    })
                })
            }

            openGroupAccelerateTabByTaskUniqueId(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    if (k.information("openGroupAccelerateTabByTaskUniqueId", " taskUniqueId: ", e, " entry: ", t, " panel: ", i, " queryString: ", a), !e) return void k.information("openGroupAccelerateTabByTaskUniqueId bad taskUniqueId");
                    o.isNullOrUndefined(t) && (t = ""), o.isNullOrUndefined(i) && (i = ""), o.isNullOrUndefined(a) && (a = "");
                    let n = yield s.default(!1, !0, "groupspeedup");
                    if (k.information("openGroupAccelerateTabByTaskUniqueId", " userId: ", n), n && "0" !== n) {
                        let o = Number(n);
                        if (!isNaN(o) && 0 !== o) {
                            let n = JSON.stringify({
                                title: "组队加速",
                                url: this.entryPage,
                                name: "groupAccelerate",
                                showUrl: !1
                            });
                            r.NativeCallModule.nativeCall.CallNativeFunction("GetTabIndexByTitleAndName", n, (o, s) => {
                                if (k.information("GetTabIndexByTitleAndName", n, o, s), o === h.NativeFunctionErrorCode.Success && s > -1) k.information("groupAccelerate nativeCall exists", s), r.NativeCallModule.nativeCall.CallNativeFunction("SelectTab", s), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e, t, i, a); else {
                                    let o = {};
                                    o.taskUniqueId = e, o.entry = t, o.panel = i, o.queryString = a, this.pendingShowTeamInfoArray.push(o), k.information("openGroupAccelerateTabByTaskUniqueId do opentab"), r.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", this.entryPage, n)
                                }
                            }), f.ConfigNS.setValue("GroupAccelerate", "unusecount", 0);
                            let o = (new Date).getTime();
                            f.ConfigNS.setValue("GroupAccelerate", "lastusetime", o), this.sendPageShowStat(e, t, i)
                        }
                    }
                })
            }

            fireTaskStatusChangeEvent(e, t, i) {
                this.taskStatusListenerMap.forEach((n, a) => {
                    n && n.tab && "nativeCallId" in n && n.callBackId && n.gcid === i && n.tab.callNativeFunctionCallback(n.nativeCallId, n.callBackId, e, t, i)
                })
            }

            fireTaskSpeedChangeEvent(e, t, i, n, 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, i, n, 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)}];
                c.NativeCallNS.registerNativeFunction(e)
            }

            externalOpenGroupAccelerateTab(e, t, i, n) {
                do {
                    if (k.information("externalOpenGroupAccelerateTab enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalOpenGroupAccelerateTab bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1]) || o.isNullOrUndefined(n[2]) || o.isNullOrUndefined(n[3])) {
                        k.information("externalOpenGroupAccelerateTab bad args"), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = n[2], l = n[3];
                    this.openGroupAccelerateTabByTaskId(a, r, s, l).then(e => {
                        k.information("externalOpenGroupAccelerateTab success")
                    }).catch(() => {
                        k.information("externalOpenGroupAccelerateTab failed")
                    }), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalGetTaskInfo(e, t, i, n) {
                do {
                    if (k.information("externalGetTaskInfo enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[1])) {
                        k.information("externalGetTaskInfo bad args"), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1];
                    k.information("externalGetTaskInfo", " taskId: ", a, " taskUniqueId: ", r);
                    let s = v.getTaskInfoJson(a, r);
                    k.information("externalGetTaskInfo", " taskInfoJson: ", s), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            externalJoinTeam(e, t, i, n) {
                do {
                    if (k.information("externalJoinTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[3])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = n[2], l = n[3], d = null;
                    try {
                        d = JSON.parse(s)
                    } catch (e) {
                        k.warning(e)
                    }
                    if (null === d) break;
                    let u = d.member_count;
                    u || (u = 0);
                    let c = d.group_name;
                    if (o.isNullOrUndefined(c) && (c = ""), k.information("externalJoinTeam", " taskId: ", a, " groupId: ", r, " opts: ", s, " taskUniqueId: ", l, " memberCount: ", u, " groupName: ", c), !r || !l) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    v.joinTeam(a, "" + r, c, u, l).catch();
                    let f = !1;
                    if ("1" !== p.DownloadModeNS.getCurrentDownloadMode()) {
                        p.DownloadModeNS.setFullDownloadMode(), f = !0;
                        let e = 0,
                            t = "taskid=" + (e = l && "" !== l ? v.getTaskIdByTaskUniqueId(l) : a) + ",gcid=" + l;
                        g.XLStatNS.trackEvent("download_pannel", "groupspeedup_fullspeed_change", "", 0, 0, 0, 0, t)
                    }
                    let m = JSON.stringify({hasChangeMode: f});
                    e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success, m)
                } while (0)
            }

            externalExitTeam(e, t, i, n) {
                do {
                    if (k.information("externalExitTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1]) || o.isNullOrUndefined(n[2])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = n[2];
                    v.exitTeam(a, r, s), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalTeamPageReady(e, t, i, n) {
                do {
                    if (k.information("externalTeamPageReady enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalGetTaskInfo bad external args");
                        break
                    }
                    for (let e of this.pendingShowTeamInfoArray) e && (k.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, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskSpeed(e, t, i, n) {
                do {
                    if (k.information("externalSubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalSubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[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, i, h.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskSpeed(e, t, i, n) {
                do {
                    if (k.information("externalUnsubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalUnsubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskStatus(e, t, i, n) {
                do {
                    if (k.information("externalSubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalSubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[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, i, h.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskStatus(e, t, i, n) {
                do {
                    if (k.information("externalUnsubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalUnsubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            sendPageShowStat(e, t, i) {
                do {
                    if (!e) break;
                    if (!t || !i) break;
                    let n = "entry=" + t + ",pannel=" + i + ",gcid=" + e;
                    g.XLStatNS.trackEvent("download_pannel", "groupspeedupdetail_show", "", 0, 0, 0, 0, n)
                } while (0)
            }
        }

        e.Manager = t;
        const i = new t;
        e.getManager = function () {
            return i
        }
    }(t.GroupAccelerateWebManagerNS || (t.GroupAccelerateWebManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(19);
    !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 i = new n.EventEmitter;
        e.getEventManager = function () {
            return i
        }
    }(t.GroupAccelerateEventManagerNS || (t.GroupAccelerateEventManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(10), r = i(2), s = i(6), l = i(17), d = i(62), u = i(14), c = i(3), h = i(31), f = i(15),
        g = i(12), p = i(40), v = i(26), m = i(467), y = i(23), k = i(4),
        T = m.GroupAccelerateEventManagerNS.getEventManager(), w = g.DownloadKernelTaskManager.getTaskManager(),
        C = f.DownloadKernelEventManager.getEventManager(),
        S = p.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        I = v.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(), w.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
                }), y.LoginHelperNS.loginHelper.getUserInfo("userid", e => {
                    if (b.information("getUserID:userid = ", e), e && "" !== e) {
                        let t = Number(e);
                        isNaN(t) || (this.currentUserId = t), w.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                            b.information("init getUserGroupAccelerateInfo")
                        }).catch(() => {
                            b.information("init getUserGroupAccelerateInfo failed")
                        })
                    }
                }), this.insertToCategoryViewEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.removeFromCategoryViewEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.RemoveFromCategoryView && this.onRemoveFromCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1])
                }), this.taskStatusChangedEventId = C.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(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                    this.updateTaskIdMap(), this.checkTaskGroupAccelerateStatus()
                })
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), this.insertToCategoryViewEventId = void 0), void 0 !== this.removeFromCategoryViewEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), this.removeFromCategoryViewEventId = void 0), void 0 !== this.detailChangedEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId), this.detailChangedEventId = void 0), void 0 !== this.taskStatusChangedEventId && (C.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 i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTask(i);
                    if (!n || "" === n) break;
                    let a = i.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 i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTask(i);
                    if (!n || "" === n) break;
                    let a = i.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    let o = this.getTaskGroupInfo(n);
                    o && o.taskId === e && (t = !0)
                } while (0);
                return t
            }

            joinTeam(e, t, i, a, o) {
                return n(this, void 0, void 0, function* () {
                    b.information("joinTeam", " taskId: ", e, " groupId:", t, " groupName:", i, " memberCount: ", a, " taskUniqueId: ", o);
                    let n = 0;
                    n = "" !== o ? this.taskIdMap.get(o) : e || 0, b.information("joinTeam", " realTaskId: ", n);
                    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 = i, e.taskId = n, e.currentIncreaseSize = 0, w.getTaskFromTaskId(n)) {
                            e.previousSpeed = this.getTaskAverageSpeed(n), (yield this.getIsVip()) ? this.setTaskPriority(n, 999) : this.setTaskPriority(n, 700), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, n, 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, i) {
                if (b.information("exitTeam", " taskId: ", e, " groupId: ", t, " taskUniqueId: ", i), "" !== i) {
                    let e = this.taskGroupInfoMap.get(i);
                    if (e) {
                        b.information("exitTeam", " taskGroupInfo.taskId: ", e.taskId);
                        let t = e.taskId;
                        this.taskGroupInfoMap.delete(i), 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), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, t, i)
                    } 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;
                    d.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 i = void 0;
                "" !== t && (i = this.taskIdMap.get(t)), b.information("getTaskInfoJson", " realTaskId: ", i), void 0 !== i && (e = i), b.information("getTaskInfoJson now", " taskId: ", e);
                let n = "null";
                do {
                    if (!e) {
                        n = "null";
                        break
                    }
                    let a = w.getTaskFromTaskId(i);
                    if (a) {
                        let e = {};
                        e.status = "" + a.getTaskBaseInfo().taskStatus, e.taskID = "" + i, 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 d = this.taskGroupInfoMap.get(t);
                        e.uploaded = d ? this.getUploadedSize() : 0, n = JSON.stringify(e)
                    } else n = "null"
                } while (0);
                return b.information("getTaskInfoJson", " taskInfoJson: ", n), n
            }

            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;
                    d.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 i = t[e].group_id, n = 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 = n, s.groupName = a) : setTimeout(() => {
                                    this.exitTeam(s.taskId, i, o)
                                }, 100))
                            }
                            T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated)
                        }
                    }).catch(() => {
                    })
                } while (0)
            }

            requestTaskTeamInfo(e) {
                do {
                    if (!e || "" === e) break;
                    b.information("requestTaskTeamInfo", " taskUniqueId: ", e), d.fetchSlRes({
                        url: "/group_accel/motorcade_list",
                        data: {task: e},
                        method: "get"
                    }).then(t => {
                        t && T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfoSuccess, e, t.data)
                    }).catch(() => {
                        T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfofailed, e)
                    })
                } while (0)
            }

            getTaskUniqueIdByTaskId(e) {
                b.information("getTaskUniqueIdByTaskId", " taskId: ", e);
                let t = "";
                if (e) {
                    let i = w.getTaskFromTaskId(e);
                    i && (t = this.getTaskUniqueIdByTask(i))
                }
                return b.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskUniqueIdByTask(e) {
                let t = "";
                if (e) {
                    switch (e.getTaskBaseInfo().taskType) {
                        case c.DownloadKernel.TaskType.Bt:
                            let i = e.getExtraObject().getInfoId();
                            b.information("getTaskUniqueIdByTaskBase bt task infoId:", i), t = i;
                            break;
                        case c.DownloadKernel.TaskType.P2sp:
                        case c.DownloadKernel.TaskType.Emule:
                            let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid);
                            b.information("getTaskUniqueIdByTaskBase p2sp or emule task gcid: ", n), t = n
                    }
                }
                return b.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskStatus(e) {
                b.information("getTaskStatus", " taskId: ", e);
                let t = c.DownloadKernel.TaskStatus.Unkown;
                if (e) {
                    let i = w.getTaskFromTaskId(e);
                    i && (t = i.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 i = this.getTaskUniqueIdByTask(e);
                    if ("" !== i) {
                        b.information("addTaskToExistingTeam", " taskUniqueId: ", i), this.taskIdMap.set(i, t);
                        let e = this.taskGroupInfoMap.get(i);
                        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, i).catch()))
                    }
                    let n = e.getTaskStatus();
                    T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, t, n, i)
                } while (0)
            }

            exitAllTeam(e, t = !0) {
                if (b.information("exitAllTeam", " userId: ", e), !e) return;
                let i = new Map;
                for (let [e, t] of this.taskGroupInfoMap) this.setTaskPriority(t.taskId, 0), i.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")
                    }), i.forEach((e, t) => {
                        T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                    })
                }).catch(() => {
                    b.information("exitAllTeam failed")
                }) : i.forEach((e, t) => {
                    T.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, i = this.getTaskUniqueIdByTask(e);
                        b.information("updateCategoryViewTaskIdMap", " taskId: ", t, " taskUniqueId: ", i), t && "" !== i && this.taskIdMap.set(i, 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 i = e.getCategoryViewFromId(t);
                        this.updateCategoryViewTaskIdMap(i)
                    }
                }
            }

            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 = S.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 i = e[t];
                        if (!i) continue;
                        let n = i.getTaskBaseInfo(), a = n.taskId;
                        if (!a) continue;
                        let o = this.getTaskUniqueIdByTask(i);
                        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(i), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, a, o));
                        let s = i.getDownloadSpeed(), l = this.getIncreaseSpeedInfo(a), d = l.increaseSpeed, u = {};
                        u.uploaded = this.getUploadedSize(), u.progress = n.fileSize > 0 ? 100 * n.downloadSize / n.fileSize : 0, u.progress > 100 && (u.progress = 100), u.increased = l.increaseSize;
                        let c = JSON.stringify(u);
                        b.information("onDetailChanged", " taskSpeed: ", s, " increaseSpeed: ", d, " extraInfoStr: ", c), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, a, s, d, c, o)
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    if (!i) continue;
                    let n = i.getId(), a = i.getTaskStatus();
                    i.getTaskPreStatus() === c.DownloadKernel.TaskStatus.StartPending && a === c.DownloadKernel.TaskStatus.Started && this.addTaskToExistingTeam(i);
                    let o = this.getTaskUniqueIdByTask(i);
                    if (!o || "" === o) continue;
                    let r = a;
                    if (b.information("onTaskStatusChanged", " taskId: ", n), b.information("onTaskStatusChanged", " taskUniqueId: ", o), b.information("onTaskStatusChanged", " status: ", r), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, n, 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 === n && (e.taskId = 0)
                    }
                    a !== c.DownloadKernel.TaskStatus.Succeeded && a !== c.DownloadKernel.TaskStatus.Seeding || this.sendFileCompleteStat(n)
                }
            }

            onInsertToCategoryView(e, t, i) {
                if (i) if (t === c.DownloadKernel.CategroyViewID.Downloading) {
                    b.information("onInsertToCategoryView Downloading number of taskList:", i.length);
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        if (!t) continue;
                        let n = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (b.information("onInsertToCategoryView taskId: ", n, "taskUniqueId: ", a), this.taskIdMap.get(a) || this.addTaskToExistingTeam(t))
                    }
                } else if (t === c.DownloadKernel.CategroyViewID.Recycle) {
                    b.information("onInsertToCategoryView Recycle number of taskList:", i.length);
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        if (!t) continue;
                        let n = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (b.information("onInsertToCategoryView", " taskId: ", n), b.information("onInsertToCategoryView", " taskUniqueId: ", a), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, n, 20, a))
                    }
                }
            }

            onRemoveFromCategoryView(e, t, i) {
                if (t === c.DownloadKernel.CategroyViewID.Recycle) do {
                    if (!i) break;
                    b.information("onRemoveFromCategoryView number of taskList:", i.length);
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        if (!t) continue;
                        let n = t.getId(), a = t.getTaskStatus(), o = this.getTaskUniqueIdByTask(t);
                        if (!o || "" === o) continue;
                        let r = a;
                        b.information("onRemoveFromCategoryView", " taskId: ", n), b.information("onRemoveFromCategoryView", " taskUniqueId: ", o), b.information("onRemoveFromCategoryView", " status: ", r), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, n, 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, i) => {
                        let n = {};
                        n.group_id = t.groupId, b.information("reportGroupAccelerateTaskInfo", " groupId: ", t.groupId), n.uid = this.currentUserId;
                        let a = t.taskId;
                        if (a) {
                            let e = w.getTaskFromTaskId(a);
                            if (e) {
                                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize),
                                    i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                                n.rate = Math.round(1e3 * t / i) / 10, n.ul_total = this.getUploadedSize(), n.ul_time = (new Date).getTime() - this.enterGroupAccelerateTimeStamp, n.dl_speed = this.getTaskAverageSpeed(a)
                            } else n.rate = 0, n.ul_total = 0, n.ul_time = 0, n.dl_speed = 0
                        } else n.rate = 0, n.ul_total = 0, n.ul_time = 0, n.dl_speed = 0;
                        b.information("reportGroupAccelerateTaskInfo", " group_id: ", n.group_id), b.information("reportGroupAccelerateTaskInfo", " rate: ", n.rate), b.information("reportGroupAccelerateTaskInfo", " ul_total: ", n.ul_total), b.information("reportGroupAccelerateTaskInfo", " ul_time: ", n.ul_time), b.information("reportGroupAccelerateTaskInfo", " dl_speed: ", n.dl_speed), e.push(n)
                    }), e.length <= 0) break;
                    d.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, i) => {
                            let n = e.taskId;
                            if (b.information("checkTaskGroupAccelerateStatus", " taskUniqueId: ", i, " taskId: ", n), n) {
                                w.getTaskFromTaskId(n) && i && "" !== i && (b.information("checkTaskGroupAccelerateStatus has task"), t.push(i))
                            }
                        }), t.length <= 0) break;
                        d.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 i = t.data.data;
                                for (let t = 0; t < i.length; t++) if (b.information("checkTaskGroupAccelerateStatus data[", t, "]:", i[t]), 1 === i[t].belong_status) {
                                    let n = i[t].group_id, a = i[t].member_count, o = i[t].group_name, r = i[t].task;
                                    e.forEach((e, t) => {
                                        if (e.groupId === n && t === r) {
                                            this.joinTeam(e.taskId, "" + n, o, a, t).catch();
                                            let i = this.taskGroupInfoMap.get(t);
                                            i && (i.memberCount = a, i.groupName = o)
                                        }
                                    })
                                }
                            }
                        }).catch(() => {
                            b.information("checkTaskGroupAccelerateStatus", " fetchSlRes failed")
                        })
                    } while (0)
                }).catch(() => {
                })
            }

            sendExitAllTeamCommand(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (!e) break;
                        let i = new Array;
                        this.taskGroupInfoMap.forEach((e, t) => {
                            i.push(e.groupId), b.information("sendExitAllTeamCommand", " groupId: ", e.groupId)
                        }), 0 === i.length && (b.information("sendExitAllTeamCommand no group"), t = !0), d.fetchSlRes({
                            url: "/group_accel/exit_batch",
                            data: {uid: this.currentUserId, group_ids: i},
                            method: "post"
                        }).then(e => {
                            b.information("sendExitAllTeamCommand success"), t = !0
                        }).catch(() => {
                            b.information("sendExitAllTeamCommand failed"), t = !1
                        })
                    } while (0);
                    return t
                })
            }

            getUserGroupAccelerateInfo() {
                return n(this, void 0, void 0, function* () {
                    b.information("getUserGroupAccelerateInfo this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && d.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 i = 0, n = 0, a = 5, o = 0;
                do {
                    if (t === c.DownloadKernel.TaskType.P2sp) i = 10, n = 40, a = 5; else if (t === c.DownloadKernel.TaskType.Bt) i = 30, n = 80, a = 10; else {
                        if (t !== c.DownloadKernel.TaskType.Emule) {
                            o = e;
                            break
                        }
                        i = 20, n = 60, a = 10
                    }
                    if (e) if (e < i || e > n) o = i + (n - i) * Math.random(); else {
                        let t = e - a;
                        t < i && (t = i);
                        let r = e + a;
                        r > n && (r = n), o = t + (r - t) * Math.random()
                    } else o = i + (n - i) * 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 i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    i.getExtraObject().setTaskPriorityLevel(-1, t), b.information("taskExtra.setTaskPriorityLevel taskId: ", e, ", index: -1, priority: ", t)
                } while (0)
            }

            getTaskAverageSpeed(e) {
                let t = w.getTaskFromTaskId(e);
                if (!t) return 0;
                let i = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize);
                0 === i && (i = 1);
                let a = Math.round(n / i);
                return b.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", a), b.information("getTaskAverageSpeed downloadSize:", n, ", downloadingPeriod:", i), a
            }

            getIncreaseSpeedInfo(e) {
                let t = {increaseSpeed: 0, increaseSize: 0};
                do {
                    if (!e) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTaskId(e);
                    if (!n || "" === n) break;
                    let a = this.taskGroupInfoMap.get(n);
                    if (!a) break;
                    let o = i.getTaskBaseInfo().taskType, r = a.currentPercent, s = this.getNewPercent(r, o);
                    a.currentPercent = s;
                    let l = this.getTaskP2PSpeedInfo(e), d = Math.round(s * l.p2pSpeed / 100),
                        u = Math.round(s * l.p2pSize / 100), c = a.currentIncreaseSize;
                    c += u, a.currentIncreaseSpeed = d, a.currentIncreaseSize = c, t.increaseSpeed = d, t.increaseSize = c
                } while (0);
                return t
            }

            getTaskP2PSpeedInfo(e) {
                let t = {p2pSpeed: 0, p2pSize: 0};
                do {
                    if (!e) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTask(i);
                    if (!n || "" === n) break;
                    let a = this.taskGroupInfoMap.get(n);
                    if (!a) break;
                    let o = i.getTaskBaseInfo().downloadingPeriod;
                    if (!o) break;
                    let r = i.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 d = o - a.lastDownloadingPeriod;
                    d < 0 && (d = 0), a.lastDownloadingPeriod = o;
                    let u = 0;
                    0 !== d && (u = Math.round(l / d));
                    let c = i.getTaskBaseInfo().downloadSpeed;
                    u > c && (u = c), t.p2pSpeed = u, 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 n(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 i = JSON.stringify([...this.taskGroupInfoMap]);
                    b.information("saveGroupAccelerateInfo", " strData: ", i), yield s.FileSystemAWNS.writeFileAW(t, i)
                })
            }

            loadGroupAccelerateInfo() {
                return n(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), i = null;
                    try {
                        let e = t.toString();
                        return b.information("loadGroupAccelerateInfo", " fileStr: ", e), i = new Map(JSON.parse(e))
                    } catch (e) {
                        return null
                    }
                })
            }

            sendFileCompleteStat(e) {
                do {
                    if (!e) break;
                    let t = w.getTaskFromTaskId(e);
                    if (!t) break;
                    let i = this.getTaskUniqueIdByTask(t);
                    if (!i || "" === i) break;
                    let n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                    if (!n || n < 104857600) break;
                    let a = this.taskGroupInfoMap.get(i);
                    if (!a) break;
                    let r = a.previousSpeed;
                    if (!r) break;
                    let s = "pannel=complete,taskid=" + e + ",gcid=" + i + ",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 n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        y.LoginHelperNS.loginHelper.getUserInfo("vipList", function (t) {
                            k.isArray(t) && t[0] ? e("1" === t[0].isVip) : e(!1)
                        })
                    })
                })
            }
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(0), r = i(13), s = i(145), l = i(9), d = i(14), u = i(358), c = i(140),
        h = i(5), {isDef: f} = r.ThunderUtil, g = o.default.getLogger("Thunder.Skin:spring-festival-skin");
    !function (e) {
        let t = void 0, o = !1;
        const r = 1e4;
        let p = null;
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                yield function () {
                    return n(this, void 0, void 0, function* () {
                        return new Promise(e => {
                            l.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                                e(!0)
                            })
                        })
                    })
                }();
                let e = null;
                try {
                    const t = "http://msg.vip.xunlei.com/xlact/conf";
                    g.information("init", "url", t);
                    let n = yield h.client.callServerFunction("GetPeerID");
                    a.default.defaults.adapter = i(21);
                    let s = yield c.VipPluginFunctionNS.getThunderVersionNumber(), l = yield a.default.get(t, {
                        params: {
                            actid: "vip2019redpack",
                            source: 3e3,
                            peerid: n,
                            inVersion: s
                        }, timeout: r
                    });
                    g.information("init res", l), 200 === l.status && f(l.data) && 0 === l.data.result && f(l.data.data) && (o = Boolean(l.data.data.is_spring_festival), e = l.data.data.skin, p = l.data.data.scroll_text)
                } catch (e) {
                    g.warning(e)
                }
                e = e || {}, localStorage.setItem("springFestivalSkinData", JSON.stringify(e))
            })
        }, e.canShowSkin = function () {
            return n(this, void 0, void 0, function* () {
                do {
                    let e = l.ConfigNS.getValue("Skin", "DisableSpringFestivalSkin", !1);
                    if (g.information("showSkin disable", e), e) {
                        t = !1;
                        break
                    }
                    t = o
                } while (0);
                return t
            })
        }, e.getSkin = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                do {
                    let i = yield u.default.getSpringFestivalWallpaper();
                    if (!i) break;
                    e && (yield u.default.removeImage(i));
                    let n = yield u.default.getImage(i);
                    t = {
                        type: s.SkinHelperNS.SkinType.Wallpaper,
                        colorID: i.color,
                        image: n,
                        opacity: i.transparency / 100,
                        opacityDesc: !0,
                        skinID: i.id,
                        is_spring_festival: !0
                    }
                } while (0);
                return t
            })
        }, 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 n(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 p && (t = e ? p.login : p.unlogin), t
        }
    }(t.SpringFestivalSkinNS || (t.SpringFestivalSkinNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(471), s = i(13), l = i(6), d = i(359),
        u = 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 => {
                u.warning(e)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                do {
                    let e;
                    (yield l.FileSystemAWNS.existsAW(c)) || (yield l.FileSystemAWNS.mkdirAW(c));
                    try {
                        e = JSON.parse((yield l.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        u.warning("解析皮肤信息失败")
                    }
                    if (s.ThunderUtil.isUndef(e)) break;
                    let t = null;
                    try {
                        t = JSON.parse(localStorage.getItem("speedcurveSkins"))
                    } catch (e) {
                        u.warning(e)
                    }
                    if (null === t && (t = (yield d.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, i = !1) {
            return n(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.emit("changeSkin", this.skinInfo, t, i);
                    try {
                        if (!i) {
                            let t = {id: e.id, type: e.type};
                            u.information("保存皮肤", JSON.stringify(t)), yield l.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(t))
                        }
                    } catch (e) {
                        u.warning("保存皮肤信息失败")
                    }
                }
            })
        }
    }
}, function (e, t, i) {
    "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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(473), s = i(13), l = i(6),
        d = o.default.getLogger("Thunder.suspension-skin.skin-manager"), u = r.SuspensionSkinHelperNS.cacheDir;
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SuspensionSkinHelperNS.defaultSkinInfo, this.init().catch(e => {
                d.warning(e)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                (yield l.FileSystemAWNS.existsAW(u)) || (yield l.FileSystemAWNS.mkdirAW(u)), yield this.setSkinInfo(this.skinInfo)
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                s.ThunderUtil.isDef(e) && (this.skinInfo = e, this.emit("changeSkin", this.skinInfo, t, i))
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Vip = 1] = "Vip"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {
            type: t.Default,
            id: 1,
            name: "默认皮肤"
        }, e.vipSkinInfo = {type: t.Vip, id: 2, name: "会员皮肤"}, e.cacheDir = `${__profilesDir}/suspension-skin`
    }(t.SuspensionSkinHelperNS || (t.SuspensionSkinHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(17), r = i(0), s = i(20), l = i(63), d = r.default.getLogger("vip-label-config");
    !function (e) {
        let t = void 0, i = void 0, r = new Map;

        function u() {
            return n(this, void 0, void 0, function* () {
                if (!t) {
                    let e = yield a.client.callServerFunction("GetThunderVersion"), i = e.lastIndexOf(".");
                    t = e.slice(0, i)
                }
                return t
            })
        }

        e.getConfig = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = r.get(e);
                return t || (t = yield function (e) {
                    return n(this, void 0, void 0, function* () {
                        let t = yield u(), o = yield function () {
                                return n(this, void 0, void 0, function* () {
                                    if (!i) {
                                        let e = 0, t = yield u(), n = t.split(".");
                                        if (n && 3 === n.length) {
                                            let t = Number(n[0]).valueOf(), i = Number(n[1]).valueOf(),
                                                a = Number(n[2]).valueOf(), o = 128;
                                            e = o * Math.pow(2, 24) + t * Math.pow(2, 16) + i * Math.pow(2, 8) + a
                                        }
                                        i = e
                                    }
                                    return i
                                })
                            }(), r = e, l = yield a.client.callServerFunction("GetPeerID"),
                            c = yield a.client.callServerFunction("GetTpPeerId"), h = "",
                            f = yield a.client.callServerFunction("GetUserID");
                        if ("0" !== f) {
                            let e = yield a.client.callServerFunction("GetSessionID");
                            h = `http://advertpay.vip.xunlei.com/xl11/advertisement?iver=${o}&over=${t}&userid=${f}&sessionid=${e}&scene=${r}&deviceid=${l}&cpeerid=${c}&timestamp=${Date.now()}`
                        } else h = `http://advertpay.vip.xunlei.com/xl11/advertisement?iver=${o}&over=${t}&scene=${r}&deviceid=${l}&cpeerid=${c}&timestamp=${Date.now()}`;
                        d.information(`geturl=${h}`);
                        let g = yield function (e) {
                            return n(this, void 0, void 0, function* () {
                                let t = new Promise(t => {
                                    s.default.get(e, {timeout: 1e4}).then(e => {
                                        let i = null;
                                        d.information("response vipData:", e), null !== e && 200 === e.status && null !== e.data && 0 === e.data.result && e.data.data && (i = e.data.data), t(i)
                                    }).catch(e => {
                                        d.warning("err:", e), t(null)
                                    })
                                });
                                return t
                            })
                        }(h);
                        return d.information("key", e, "configdata", g), g
                    })
                }(e), r.set(e, t)), t
            })
        }, function () {
            o.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => n(this, void 0, void 0, function* () {
                if ("vipinfo" === e) {
                    d.information("onUserInfoChange");
                    let e = !1;
                    try {
                        let t = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                        t && (e = Boolean(t.isVip))
                    } catch (e) {
                        d.warning(e)
                    }
                    e && r.clear()
                }
            })), o.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                d.information("onLoginStatusChange", "newStatus", t), "unlogin" === t || "offline" === t ? r.clear() : "online" === t && r.clear()
            })
        }(), e.getConfigUrl = function (e, t, i, n) {
            if (i) {
                let n = l.ParseUrlFileNameNS.parseDynamicUrlPath(i.toLowerCase()),
                    a = l.ParseUrlFileNameNS.parseDynamicUrlArgs(n.args), o = Object.getOwnPropertyNames(a), r = "";
                for (let i = 0; i < o.length; ++i) {
                    let n = o[i];
                    r += "referfrom" === n && e ? `&${n}=${e}` : "aidfrom" === n && t ? `&${n}=${t}` : `&${n}=${a[n]}`
                }
                return o.indexOf("referfrom") < 0 && (r += `&referfrom=${e}`), o.indexOf("aidfrom") < 0 && (r += `&aidfrom=${t}`), `${n.pageFileName}?${r.substr(1)}`
            }
            return n ? `${n}?referfrom=${e}&aidfrom${t}` : ""
        }
    }(t.VipLableConfigNS || (t.VipLableConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(13), r = i(0), s = i(19), l = i(5), d = i(73),
        u = r.default.getLogger("vip-plugin-switch-config");
    let {isDef: c, isUndef: h} = o.ThunderUtil;
    !function (e) {
        const t = "http://media.info.client.xunlei.com/VipPluginSwitchConfig.json";
        let r = new s.EventEmitter;
        r.setMaxListeners(0);
        let f = void 0, g = void 0, p = void 0;

        function v(e) {
            p = e, r.emit("OnVipRenewButtonEnable", p)
        }

        function m() {
            return n(this, void 0, void 0, function* () {
                if (!f) {
                    let e = yield l.client.callServerFunction("GetThunderVersion"), t = e.lastIndexOf(".");
                    f = e.slice(0, t)
                }
                return f
            })
        }

        (function () {
            return n(this, void 0, void 0, function* () {
                u.information("init");
                let e = yield function () {
                    return n(this, void 0, void 0, function* () {
                        let e = null, n = null;
                        try {
                            a.default.defaults.adapter = i(21), a.default.defaults.timeout = 2e3, n = yield a.default.get(t)
                        } catch (e) {
                            u.warning(e)
                        }
                        return null !== n && 200 === n.status && c(n.data) && (e = n.data), e
                    })
                }();
                u.information("OnGetConfigs", e);
                do {
                    if (h(e) || h(e.VipRenewButtonEnable)) break;
                    let t = e.VipRenewButtonEnable;
                    const i = t.version, n = t.peeridSha256;
                    if (!i || !n) break;
                    let a = yield m();
                    u.information("version", a);
                    let r = !1;
                    for (let e of i) if (2 === e.length && o.ThunderUtil.versionCompare(a, e[0]) >= 0 && o.ThunderUtil.versionCompare(a, e[1]) <= 0) {
                        r = !0;
                        break
                    }
                    const s = yield l.client.callServerFunction("GetPeerID");
                    if (u.information("peerid", s), !r || !s) break;
                    let c = d.createHash("sha256");
                    c.update(s);
                    let f = c.digest("hex"), g = f[f.length - 1];
                    u.information("hex", f, "char", g), g && (g = g.toUpperCase(), n.includes(g) && h(p) && v(1))
                } while (0);
                h(p) && v(0), c(e) && c(e.ToolbarVipButtonEnable) && (g = e.ToolbarVipButtonEnable), h(g) && (g = 0), r.emit("OnToolbarVipButtonEnable", g)
            })
        })().catch(), e.getToolbarVipButtonEnable = function () {
            return n(this, void 0, void 0, function* () {
                let e = null;
                return c(g) ? (e = g, u.information("getToolbarVipButtonEnable", e)) : e = new Promise(e => n(this, void 0, void 0, function* () {
                    r.once("OnToolbarVipButtonEnable", t => {
                        u.information("getToolbarVipButtonEnable", t), e(t)
                    })
                })), e
            })
        }, e.getVipRenewButtonEnable = function () {
            return n(this, void 0, void 0, function* () {
                let e = null;
                return c(p) ? (e = p, u.information("getVipRenewButtonEnable", e)) : e = new Promise(e => n(this, void 0, void 0, function* () {
                    r.once("OnVipRenewButtonEnable", t => {
                        u.information("getVipRenewButtonEnable", t), e(t)
                    })
                })), e
            })
        }
    }(t.VipPluginSwitchConfigNS || (t.VipPluginSwitchConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

    class r extends o.Config {
        constructor() {
            super(), this.isInit = !0
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
            })
        }

        save() {
            return n(this, void 0, void 0, function* () {
            })
        }

        saveSync() {
        }

        fireValueChangedEvent(e, t, i, n) {
            this.eventContainer.fireEvent(a.NodeEventMesssageNS.eventMemoryConfigValueChanged, e, t, i, n)
        }
    }

    t.MemoryConfig = r;
    const s = new r;
    !function (e) {
        e.getValue = function (e, t, i) {
            return s.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            s.setValue(e, t, i)
        }, e.removeValue = function (e, t) {
            s.removeValue(e, t)
        }, e.attachListener = function (e, t) {
            s.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            s.detachListener(e, t)
        }
    }(t.MemoryConfigNS || (t.MemoryConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(23), r = "https://api-u-ssl.xunlei.com";
    !function (e) {
        let t = "", i = "", s = "", l = "", d = {};
        e.recommend = function () {
            return n(this, void 0, void 0, function* () {
                let e = yield a.default.request({
                    url: "https://api-u-ssl.xunlei.com/videos/ProgramList",
                    method: "post",
                    data: {
                        category: "movie",
                        platform: "xlx",
                        page: 1,
                        show_type: 1,
                        num: 15,
                        pagefrom: "index_recommend"
                    },
                    headers: {"Content-Type": "text/plain"}
                }).catch();
                return 200 === e.status && e.data.data && e.data.data.list && e.data.data.list || null
            })
        }, e.search = function (e) {
            return n(this, void 0, void 0, function* () {
                let u = `${r}/videos/search`;
                a.default.defaults.headers["Content-Type"] = "application/json", yield function () {
                    return n(this, void 0, void 0, function* () {
                        let e = yield o.LoginHelperNS.loginHelper.getUserInfoAw();
                        null !== e && void 0 !== e && (t = void 0 === e.sessionid ? "" : e.sessionid, i = void 0 === e.deviceid ? "" : e.deviceid, s = void 0 === e.userid ? "" : e.userid, l = void 0 === e.usernick ? "" : e.usernick, d = {
                            Cookie: `userid=${s},sessionid=${t}`,
                            deviceid: i,
                            "Content-Type": "Content-Type: text/plain"
                        })
                    })
                }();
                let c = {
                    platform: "pc",
                    referfrom: "v_pc_xlx_ggong_vipspecial_dhl",
                    show_type: 0,
                    content: e,
                    app_id: "103",
                    userid: s,
                    sessionid: t,
                    deviceId: i,
                    appVersion: null,
                    session_type: 2,
                    nick_name: l,
                    refer: ""
                }, h = yield a.default.post(u, c, {headers: d}).catch();
                return 200 !== h.status ? null : h.data.data.list || null
            })
        }
    }(t.MovieRecommendNS || (t.MovieRecommendNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(7).default(a.join(__rootDir, "../bin/ThunderHelper.node")), r = 1;
    let s = new Map;

    function l(e, t, i, n, a) {
        o.createRegKey(e, t), o.writeRegValue(e, t, i, n, a)
    }

    function d(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let i = "Xunlei." + t[0] + ".6", n = a.join(__rootDir, "../../" + t[2]),
                o = a.join(__rootDir, "../../Thunder.exe"), d = "Software\\Classes\\." + e;
            l("HKEY_CURRENT_USER", d, "", i, r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i, "", t[1], r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i + "\\DefaultIcon", "", n, r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i + "\\Shell\\Open", "", t[3], r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i + "\\Shell\\Open\\command", "", '"' + o + '" "%1" -StartType:' + e, r)
        } while (0)
    }

    function u(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let i = "Software\\Classes\\." + e;
            o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Classes\\" + t[0], o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList", o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithProgids", o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\UserChoice", o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e, o.deleteRegKey("HKEY_CURRENT_USER", i), d(e), o.refreshIcon()
        } while (0)
    }

    function c(e) {
        do {
            let t = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList",
                i = o.readRegString("HKEY_CURRENT_USER", t, "MRUList");
            if (null === i || void 0 === i || "" === i) break;
            let n = i.substring(0, 1);
            null !== (i = o.readRegString("HKEY_CURRENT_USER", t, n)) && void 0 !== i && "" !== i && "Thunder.exe" !== i && u(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 i = "Xunlei." + t[0] + ".6";
                if (o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\." + e, "") === i) 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), d(e), o.refreshIcon()
            } while (0)
        }

        function i(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = '"' + a.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:' + e;
                    if (o.queryRegValue("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "") === i) 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", "", i, r), t = !0
                } while (0);
                return t
            })
        }

        e.checkAndRegisterFileType = t, e.checkAndRegisterTorrentFile = function () {
            {
                let e = a.join(__rootDir, "../../Thunder.exe"), i = "torrent",
                    n = o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\Xunlei.Bittorrent.6\\Shell\\Open\\command", "");
                n && "" !== n ? (n.includes(e) || t(i), c(i)) : t(i)
            }
        }, e.doAsynCheckAndRegisterProtocal = i, e.asynCheckAndAssociate = function () {
            return n(this, void 0, void 0, function* () {
                t("td"), t("downlist"), yield i("ed2k"), yield i("magnet"), yield i("thunder"), yield i("thunderx"), yield i("xlb")
            })
        }
    }(t.FileAssociationNS || (t.FileAssociationNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(46), a = i(96), o = i(0).default.getLogger("Thunder.shub-http.http-session"), r = i(334),
        s = i(13), {isDef: l} = s.ThunderUtil;
    var d;
    !function (e) {
        e.HTTP = "HTTP", e.HTTPS = "HTTPS"
    }(d = t.Protocol || (t.Protocol = {}));
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = void 0, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mCookie = void 0, this.mProtocol = d.HTTP, 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() {
            let e = void 0;
            return e = l(this.mPort) ? this.mPort : this.protocol === d.HTTPS ? 443 : 80
        }

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

        get path() {
            return this.mPath
        }

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

        get protocol() {
            return this.mProtocol
        }

        set protocol(e) {
            this.mProtocol = e
        }

        get url() {
            return this.mUrl
        }

        get cookie() {
            return this.mCookie
        }

        set cookie(e) {
            this.mCookie = e
        }

        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) {
            do {
                let i = this.body;
                if (!i) {
                    o.information("body is empty"), t(null);
                    break
                }
                let n = this.auth, a = this.accept, r = {
                    hostname: this.host,
                    port: this.port,
                    path: this.path || "/",
                    method: "POST",
                    auth: n || void 0,
                    headers: {"Content-Length": i ? i.length : 0, Cookie: this.cookie || "", Accept: a || "*/*"}
                };
                o.verbose("option", r);
                try {
                    this.postImpl(i, r, e, i => {
                        this.mCurRetries < this.retries ? (this.mCurRetries++, o.information("mCurRetries", this.mCurRetries), this.post(e, t)) : t(i)
                    })
                } catch (e) {
                    o.warning("error ", e), t(null)
                }
            } while (0)
        }

        get(e, t) {
            let i = null;
            if (this.url) {
                let e = n.parse(this.url, !0);
                e && "https:" === e.protocol ? this.protocol = d.HTTPS : this.protocol = d.HTTP, i = this.url
            } else {
                let e = this.auth, t = this.accept;
                i = {
                    hostname: this.host,
                    port: this.port,
                    path: this.path || "/",
                    method: "GET",
                    auth: e || void 0,
                    headers: {Cookie: this.cookie || "", Accept: t || "*/*"}
                }
            }
            o.verbose("option", i);
            try {
                this.getImpl(i, e, i => {
                    this.mCurRetries < this.retries ? (this.mCurRetries++, o.information("mCurRetries", this.mCurRetries), this.get(e, t)) : t(i)
                })
            } catch (e) {
                o.warning("error ", e), t(null)
            }
        }

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

        getImpl(e, t, i) {
            (this.protocol === d.HTTPS ? r : a).get(e, e => {
                let i = null;
                e.on("data", e => {
                    i = i ? Buffer.concat([i, e]) : e
                }), e.on("end", () => {
                    o.information("statusCode", e.statusCode), o.information("headers", e.headers), t({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: i
                    })
                })
            }).on("error", e => {
                i(e)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(57), o = i(32), r = i(37), s = i(10), l = i(0), d = i(363),
        u = l.default.getLogger("MenuContextHelper");
    const c = new class {
        constructor() {
            u.information("constructor MenuContextHelper object")
        }

        exitThunderX(e) {
            return n(this, void 0, void 0, function* () {
                (yield d.QuitMessageBoxMgrNS.popup()) && (yield a.quitPromises.run())
            })
        }

        showNewTaskPanel(e) {
            u.information("trackEvent", "core_event", "create_task_click", "click_source=other"), s.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=other"), r.ThunderNewTask.createPreNewTaskWindow(null)
        }

        importUncompleted(e) {
            o.TaskOperatorNs.importUncompleted().catch()
        }

        initAccelerator() {
            window.addEventListener("keyup", e => {
                "n" !== e.key && "N" !== e.key || !e.ctrlKey || this.showNewTaskPanel("system-menu")
            }, !0)
        }
    };
    t.default = c
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = i(13), l = o.default.getLogger("plugin-updater");

    class d {
        constructor(e) {
            this.dir = "", this.versionsDir = "", l.verbose("constructor", "dir", e), this.dir = e, this.versionsDir = a.join(e, "versions")
        }

        static getPluginUpdater(e) {
            return new d(e)
        }

        install(e, t) {
            return n(this, void 0, void 0, function* () {
                l.information("install", "version", e, "src", t);
                try {
                    const i = yield this.getCurVersion();
                    if (s.ThunderUtil.versionCompare(i, e) >= 0) return;
                    yield this.save(e, t), yield this.setCurVersion(e)
                } catch (e) {
                    l.warning(e)
                }
            })
        }

        active() {
            return n(this, void 0, void 0, function* () {
                l.information("active");
                try {
                    const e = yield this.getCurVersion();
                    yield this.clear(this.versionsDir, e)
                } catch (e) {
                    l.warning(e)
                }
            })
        }

        getCurFilePath() {
            return n(this, void 0, void 0, function* () {
                l.information("getCurFilePath");
                try {
                    const e = yield this.getCurVersion();
                    if (e) return a.join(this.versionsDir, e)
                } catch (e) {
                    l.warning(e)
                }
                return ""
            })
        }

        clear(e, t) {
            return n(this, void 0, void 0, function* () {
                return l.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 n(this, void 0, void 0, function* () {
                yield r.FileSystemAWNS.mkdirsAW(this.dir), yield r.FileSystemAWNS.mkdirsAW(this.versionsDir);
                const i = a.join(this.versionsDir, e);
                return r.FileSystemAWNS.copyDirsAW(t, i)
            })
        }

        getCurVersion() {
            return n(this, void 0, void 0, function* () {
                return (yield r.FileSystemAWNS.readFileAW(`${this.dir}/VERION.txt`)).toString()
            })
        }

        setCurVersion(e) {
            return n(this, void 0, void 0, function* () {
                return r.FileSystemAWNS.writeFileAW(`${this.dir}/VERION.txt`, e)
            })
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(7), s = i(3), l = i(26), d = i(701), u = i(31), c = i(14), h = i(40), f = i(42),
        g = i(43), p = i(6), v = o.default.getLogger("DownloadKernel.Upgrade"),
        m = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        y = l.DownloadKernelCategoryManager.getCategoryManager(), k = d.PrivateSpaceUpgradeNS.getUpgrade(),
        T = h.DownloadKernelCategoryViewManager.getCategoryViewManager();

    class w extends f.default {
        constructor() {
            super(...arguments), this.eventUpgradeProgress = "OnUpgradeProgress", this.totalTaskCount = 0, this.upgradeTaskCount = 0
        }

        upgradeP2sp(e) {
            let t = e.getSavePath(), i = e.getTaskName();
            return v.information("upgradeP2sp savePath:", t, ", taskName:", i), new Promise(e => {
                m.asyncUpgradeP2spTask(t, i, t => {
                    e(t)
                })
            })
        }

        upgradeBt(e) {
            let t = e.getExtraObject(), i = t.getFileCount(), o = t.getSeedFilePath(), r = a.parse(o), s = r.dir,
                l = r.name + r.ext, d = e.getSavePath(), u = t.getDisplayName(), c = "";
            if (1 !== i) d = a.join(d, u); else {
                let e = t.getBtFileInfoList();
                c = e[0].fileName
            }
            return v.information("upgradeBt savePath:", d, ", taskName:", u, ", fileCount:", i, ", seedFilePath:", o, ", seedFileName:", l), new Promise(e => {
                m.asyncUpgradeBtTask(d, l, s, t => n(this, void 0, void 0, function* () {
                    if (t && 1 === i) {
                        let e = a.join(d, u);
                        (yield p.FileSystemAWNS.existsAW(e)) || (yield p.FileSystemAWNS.mkdirAW(e));
                        let t = a.join(d, c), i = a.join(e, c);
                        t += ".bt.xltd", i += ".bt.xltd", (yield p.FileSystemAWNS.existsAW(i)) || (yield p.FileSystemAWNS.renameAW(t, i));
                        let n = a.join(d, l), o = a.join(e, l);
                        (yield p.FileSystemAWNS.existsAW(o)) || (yield p.FileSystemAWNS.renameAW(n, o))
                    }
                    e(t)
                }))
            })
        }

        upgradeEmule(e) {
            let t = e.getSavePath(), i = e.getTaskName(),
                n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
            return g.Common.isThunderPrivateUrl(n) && (n = g.Common.parseThunderPrivateUrl(n)), v.information("upgradeEmule url:", n, ", savePath:", t, ", taskName:", i), new Promise(e => {
                m.asyncUpgradeEmuleTask(n, t, i, t => {
                    e(t)
                })
            })
        }

        upgradeGroup(e) {
            return new Promise(t => {
                let i = e.getExtraObject(), n = i.getSubTaskCount();
                if (n > 0) for (let e = 0; e < n; e++) {
                    let n = i.getSubTaskByIndex(e);
                    n.getType() !== s.DownloadKernel.TaskType.Group && this.upgradeCategoryViewTask(n).then(e => {
                        t(e)
                    }).catch()
                } else t(!0)
            })
        }

        upgradeCategoryViewTask(e) {
            return n(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, v.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, v.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 k.upgradePrivateSpace(e)
        }

        startUpgrade() {
            this.totalTaskCount = 0, this.upgradeTaskCount = 0, u.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                let e = T.getCategoryViews();
                for (let t = 0; t < e.length; t++) {
                    let i = e[t], n = i.getCategoryViewId();
                    n !== s.DownloadKernel.CategroyViewID.Downloading && n !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(i)
                }
                let t = y.getCategorys();
                for (let [, e] of t) {
                    let t = e.getCategoryViews();
                    for (let e = 0; e < t.length; e++) {
                        let i = t[e], n = i.getCategoryViewId();
                        n !== s.DownloadKernel.CategroyViewID.Downloading && n !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(i)
                    }
                }
            })
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(42), r = i(35), s = i(6), l = i(68), d = i(147), u = i(9), c = i(60), h = i(0), f = i(10),
        g = i(27), p = i(16), v = h.default.getLogger("AdPlatform");
    var m;
    !function (e) {
        e.waiting = "waiting", e.abort = "abort", e.ready = "ready"
    }(m || (m = {}));
    t.adPlatform = new class extends o.default {
	}
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(62), o = i(5), r = i(0).default.getLogger("scancode"), s = i(7), l = i(2),
        d = s.default(l.join(__rootDir, "../bin/ThunderHelper.node"));
    let u = l.join(__rootDir, "../../Thunder.exe"), c = d.getFileVersion(u).split("."), h = c[c.length - 1], f = null,
        g = null;
    const p = "14";
    t.queryAccelerationTimes = function () {
        return n(this, void 0, void 0, function* () {
            f || (f = yield o.client.callServerFunction("GetDeviceIdOfWebSDKPlugin")), g || (g = yield o.client.callServerFunction("GetPeerID"));
            let e = yield o.client.callRemoteClientFunction("User", "UserGetAccessToken").catch(),
                t = {_h: {"Device-Id": f, "Peer-Id": g, Authorization: e && e[0]}}, i = yield a.fetchSlRes({
                    url: "/xlppc.scancode.acceleration/api/acceleration/times/inquiry",
                    data: t,
                    method: "get"
                }).catch();
            return r.warning("### queryAccelerationTimes", i, JSON.stringify(t)), 200 === i.status && i.data && "ok" === i.data.result ? i.data : {}
        })
    }, t.getShortlink = function (e) {
        return n(this, void 0, void 0, function* () {
            e.client_version = h, e.client_name = "xl_pc", e.release_version = "1.0.0", f || (f = yield o.client.callServerFunction("GetDeviceIdOfWebSDKPlugin"));
            let t = yield o.client.callRemoteClientFunction("User", "UserGetAccessToken").catch();
            e._h = {Authorization: t && "Bearer " + t[0]}, e.device_id = f, e.peer_id = g, e.app_id = p;
            let i = yield a.fetchSlRes({
                url: "/xlppc.scancode.acceleration/api/shortlink",
                data: e,
                method: "post"
            }).catch();
            return r.warning("### res", i, e), i && 200 === i.status && i.data && i.data.accelerated ? i.data.shortlink : ""
        })
    }, t.accelerateTask = function () {
        return n(this, void 0, void 0, function* () {
            return "ok"
        })
    }, t.accelerateTest = function (e) {
        return n(this, void 0, void 0, function* () {
            e.credential = "0978", e.device_id = f;
            let t = yield a.fetchSlRes({
                url: "/xlppc.scancode.acceleration/api/accelerate",
                data: e,
                method: "post"
            }).catch();
            r.warning("### accelerateTest", t)
        })
    }
}, function (e, t, i) {
    e.exports = i(711)
}, function (e, t, i) {
    var n = i(91), a = i(81), o = i(365), r = i(714), s = i(715), l = i(716), d = i(717), u = i(718), c = i(487),
        h = i(719), f = i(722), g = i(723), p = i(82), v = i(724), m = i(490);

    function y(e, t, i) {
        var n, a, o = e.size, r = g.getEncodedBits(t, i);
        for (n = 0; n < 15; n++) a = 1 == (r >> n & 1), n < 6 ? e.set(n, 8, a, !0) : n < 8 ? e.set(n + 1, 8, a, !0) : e.set(o - 15 + n, 8, a, !0), n < 8 ? e.set(8, o - n - 1, a, !0) : n < 9 ? e.set(8, 15 - n - 1 + 1, a, !0) : e.set(8, 15 - n - 1, a, !0);
        e.set(o - 8, 8, 1, !0)
    }

    function k(e, t, i) {
        var o = new r;
        i.forEach(function (t) {
            o.put(t.mode.bit, 4), o.put(t.getLength(), p.getCharCountIndicator(t.mode, e)), t.write(o)
        });
        var s = 8 * (a.getSymbolTotalCodewords(e) - c.getTotalCodewordsCount(e, t));
        for (o.getLengthInBits() + 4 <= s && o.put(0, 4); o.getLengthInBits() % 8 != 0;) o.putBit(0);
        for (var l = (s - o.getLengthInBits()) / 8, d = 0; d < l; d++) o.put(d % 2 ? 17 : 236, 8);
        return function (e, t, i) {
            for (var o = a.getSymbolTotalCodewords(t), r = c.getTotalCodewordsCount(t, i), s = o - r, l = c.getBlocksCount(t, i), d = l - o % l, u = Math.floor(o / l), f = Math.floor(s / l), g = f + 1, p = u - f, v = new h(p), m = 0, y = new Array(l), k = new Array(l), T = 0, w = new n(e.buffer), C = 0; C < l; C++) {
                var S = C < d ? f : g;
                y[C] = w.slice(m, m + S), k[C] = v.encode(y[C]), m += S, T = Math.max(T, S)
            }
            var I, b, _ = new n(o), D = 0;
            for (I = 0; I < T; I++) for (b = 0; b < l; b++) I < y[b].length && (_[D++] = y[b][I]);
            for (I = 0; I < p; I++) for (b = 0; b < l; b++) _[D++] = k[b][I];
            return _
        }(o, e, t)
    }

    function T(e, t, i, n) {
        var o;
        if (m(e)) o = v.fromArray(e); else {
            if ("string" != typeof e) throw new Error("Invalid data");
            var r = t;
            if (!r) {
                var c = v.rawSplit(e);
                r = f.getBestVersionForData(c, i)
            }
            o = v.fromString(e, r || 40)
        }
        var h = f.getBestVersionForData(o, i);
        if (!h) throw new Error("The amount of data is too big to be stored in a QR Code");
        if (t) {
            if (t < h) throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: " + h + ".\n")
        } else t = h;
        var g = k(t, i, o), p = a.getSymbolSize(t), T = new s(p);
        return function (e, t) {
            for (var i = e.size, n = d.getPositions(t), a = 0; a < n.length; a++) for (var o = n[a][0], r = n[a][1], s = -1; s <= 7; s++) if (!(o + s <= -1 || i <= o + s)) for (var l = -1; l <= 7; l++) r + l <= -1 || i <= r + l || (s >= 0 && s <= 6 && (0 === l || 6 === l) || l >= 0 && l <= 6 && (0 === s || 6 === s) || s >= 2 && s <= 4 && l >= 2 && l <= 4 ? e.set(o + s, r + l, !0, !0) : e.set(o + s, r + l, !1, !0))
        }(T, t), function (e) {
            for (var t = e.size, i = 8; i < t - 8; i++) {
                var n = i % 2 == 0;
                e.set(i, 6, n, !0), e.set(6, i, n, !0)
            }
        }(T), function (e, t) {
            for (var i = l.getPositions(t), n = 0; n < i.length; n++) for (var a = i[n][0], o = i[n][1], r = -2; r <= 2; r++) for (var s = -2; s <= 2; s++) -2 === r || 2 === r || -2 === s || 2 === s || 0 === r && 0 === s ? e.set(a + r, o + s, !0, !0) : e.set(a + r, o + s, !1, !0)
        }(T, t), y(T, i, 0), t >= 7 && function (e, t) {
            for (var i, n, a, o = e.size, r = f.getEncodedBits(t), s = 0; s < 18; s++) i = Math.floor(s / 3), n = s % 3 + o - 8 - 3, a = 1 == (r >> s & 1), e.set(i, n, a, !0), e.set(n, i, a, !0)
        }(T, t), function (e, t) {
            for (var i = e.size, n = -1, a = i - 1, o = 7, r = 0, s = i - 1; s > 0; s -= 2) for (6 === s && s--; ;) {
                for (var l = 0; l < 2; l++) if (!e.isReserved(a, s - l)) {
                    var d = !1;
                    r < t.length && (d = 1 == (t[r] >>> o & 1)), e.set(a, s - l, d), -1 == --o && (r++, o = 7)
                }
                if ((a += n) < 0 || i <= a) {
                    a -= n, n = -n;
                    break
                }
            }
        }(T, g), isNaN(n) && (n = u.getBestMask(T, y.bind(null, T, i))), u.applyMask(n, T), y(T, i, n), {
            modules: T,
            version: t,
            errorCorrectionLevel: i,
            maskPattern: n,
            segments: o
        }
    }

    t.create = function (e, t) {
        if (void 0 === e || "" === e) throw new Error("No input text");
        var i, n, r = o.M;
        return void 0 !== t && (r = o.from(t.errorCorrectionLevel, o.M), i = f.from(t.version), n = u.from(t.maskPattern), t.toSJISFunc && a.setToSJISFunction(t.toSJISFunc)), T(e, i, r, n)
    }
}, function (e, t, i) {
    var n = i(365),
        a = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2, 4, 4, 2, 4, 4, 4, 2, 4, 6, 5, 2, 4, 6, 6, 2, 5, 8, 8, 4, 5, 8, 8, 4, 5, 8, 11, 4, 8, 10, 11, 4, 9, 12, 16, 4, 9, 16, 16, 6, 10, 12, 18, 6, 10, 17, 16, 6, 11, 16, 19, 6, 13, 18, 21, 7, 14, 21, 25, 8, 16, 20, 25, 8, 17, 23, 25, 9, 17, 23, 34, 9, 18, 25, 30, 10, 20, 27, 32, 12, 21, 29, 35, 12, 23, 34, 37, 12, 25, 34, 40, 13, 26, 35, 42, 14, 28, 38, 45, 15, 29, 40, 48, 16, 31, 43, 51, 17, 33, 45, 54, 18, 35, 48, 57, 19, 37, 51, 60, 19, 38, 53, 63, 20, 40, 56, 66, 21, 43, 59, 70, 22, 45, 62, 74, 24, 47, 65, 77, 25, 49, 68, 81],
        o = [7, 10, 13, 17, 10, 16, 22, 28, 15, 26, 36, 44, 20, 36, 52, 64, 26, 48, 72, 88, 36, 64, 96, 112, 40, 72, 108, 130, 48, 88, 132, 156, 60, 110, 160, 192, 72, 130, 192, 224, 80, 150, 224, 264, 96, 176, 260, 308, 104, 198, 288, 352, 120, 216, 320, 384, 132, 240, 360, 432, 144, 280, 408, 480, 168, 308, 448, 532, 180, 338, 504, 588, 196, 364, 546, 650, 224, 416, 600, 700, 224, 442, 644, 750, 252, 476, 690, 816, 270, 504, 750, 900, 300, 560, 810, 960, 312, 588, 870, 1050, 336, 644, 952, 1110, 360, 700, 1020, 1200, 390, 728, 1050, 1260, 420, 784, 1140, 1350, 450, 812, 1200, 1440, 480, 868, 1290, 1530, 510, 924, 1350, 1620, 540, 980, 1440, 1710, 570, 1036, 1530, 1800, 570, 1064, 1590, 1890, 600, 1120, 1680, 1980, 630, 1204, 1770, 2100, 660, 1260, 1860, 2220, 720, 1316, 1950, 2310, 750, 1372, 2040, 2430];
    t.getBlocksCount = function (e, t) {
        switch (t) {
            case n.L:
                return a[4 * (e - 1) + 0];
            case n.M:
                return a[4 * (e - 1) + 1];
            case n.Q:
                return a[4 * (e - 1) + 2];
            case n.H:
                return a[4 * (e - 1) + 3];
            default:
                return
        }
    }, t.getTotalCodewordsCount = function (e, t) {
        switch (t) {
            case n.L:
                return o[4 * (e - 1) + 0];
            case n.M:
                return o[4 * (e - 1) + 1];
            case n.Q:
                return o[4 * (e - 1) + 2];
            case n.H:
                return o[4 * (e - 1) + 3];
            default:
                return
        }
    }
}, function (e, t) {
    t.isValid = function (e) {
        return !isNaN(e) && e >= 1 && e <= 40
    }
}, function (e, t) {
    var i = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",
        n = "(?:(?![A-Z0-9 $%*+\\-./:]|" + (i = i.replace(/u/g, "\\u")) + ")(?:.|[\r\n]))+";
    t.KANJI = new RegExp(i, "g"), t.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), t.BYTE = new RegExp(n, "g"), t.NUMERIC = new RegExp("[0-9]+", "g"), t.ALPHANUMERIC = new RegExp("[A-Z $%*+\\-./:]+", "g");
    var a = new RegExp("^" + i + "$"), o = new RegExp("^[0-9]+$"), r = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
    t.testKanji = function (e) {
        return a.test(e)
    }, t.testNumeric = function (e) {
        return o.test(e)
    }, t.testAlphanumeric = function (e) {
        return r.test(e)
    }
}, function (e, t) {
    var i = {}.toString;
    e.exports = Array.isArray || function (e) {
        return "[object Array]" == i.call(e)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(97), o = e.exports = function () {
        a.call(this), this._buffers = [], this._buffered = 0, this._reads = [], this._paused = !1, this._encoding = "utf8", this.writable = !0
    };
    n.inherits(o, a), o.prototype.read = function (e, t) {
        this._reads.push({length: Math.abs(e), allowLess: e < 0, func: t}), process.nextTick(function () {
            this._process(), this._paused && this._reads.length > 0 && (this._paused = !1, this.emit("drain"))
        }.bind(this))
    }, o.prototype.write = function (e, t) {
        return this.writable ? (i = Buffer.isBuffer(e) ? e : new Buffer(e, t || this._encoding), this._buffers.push(i), this._buffered += i.length, this._process(), this._reads && 0 === this._reads.length && (this._paused = !0), this.writable && !this._paused) : (this.emit("error", new Error("Stream not writable")), !1);
        var i
    }, o.prototype.end = function (e, t) {
        e && this.write(e, t), this.writable = !1, this._buffers && (0 === this._buffers.length ? this._end() : (this._buffers.push(null), this._process()))
    }, o.prototype.destroySoon = o.prototype.end, o.prototype._end = function () {
        this._reads.length > 0 && this.emit("error", new Error("There are some read requests waiting on finished stream")), this.destroy()
    }, o.prototype.destroy = function () {
        this._buffers && (this.writable = !1, this._reads = null, this._buffers = null, this.emit("close"))
    }, o.prototype._processReadAllowingLess = function (e) {
        this._reads.shift();
        var t = this._buffers[0];
        t.length > e.length ? (this._buffered -= e.length, this._buffers[0] = t.slice(e.length), e.func.call(this, t.slice(0, e.length))) : (this._buffered -= t.length, this._buffers.shift(), e.func.call(this, t))
    }, o.prototype._processRead = function (e) {
        this._reads.shift();
        for (var t = 0, i = 0, n = new Buffer(e.length); t < e.length;) {
            var a = this._buffers[i++], o = Math.min(a.length, e.length - t);
            a.copy(n, t, 0, o), t += o, o !== a.length && (this._buffers[--i] = a.slice(o))
        }
        i > 0 && this._buffers.splice(0, i), this._buffered -= e.length, e.func.call(this, n)
    }, o.prototype._process = function () {
        try {
            for (; this._buffered > 0 && this._reads && this._reads.length > 0;) {
                var e = this._reads[0];
                if (e.allowLess) this._processReadAllowingLess(e); else {
                    if (!(this._buffered >= e.length)) break;
                    this._processRead(e)
                }
            }
            this._buffers && this._buffers.length > 0 && null === this._buffers[0] && this._end()
        } catch (e) {
            this.emit("error", e)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(493), a = i(494);

    function o(e, t, i) {
        var n = e * t;
        return 8 !== i && (n = Math.ceil(n / (8 / i))), n
    }

    var r = e.exports = function (e, t) {
        var i = e.width, a = e.height, r = e.interlace, s = e.bpp, l = e.depth;
        if (this.read = t.read, this.write = t.write, this.complete = t.complete, this._imageIndex = 0, this._images = [], r) for (var d = n.getImagePasses(i, a), u = 0; u < d.length; u++) this._images.push({
            byteWidth: o(d[u].width, s, l),
            height: d[u].height,
            lineIndex: 0
        }); else this._images.push({byteWidth: o(i, s, l), height: a, lineIndex: 0});
        this._xComparison = 8 === l ? s : 16 === l ? 2 * s : 1
    };
    r.prototype.start = function () {
        this.read(this._images[this._imageIndex].byteWidth + 1, this._reverseFilterLine.bind(this))
    }, r.prototype._unFilterType1 = function (e, t, i) {
        for (var n = this._xComparison, a = n - 1, o = 0; o < i; o++) {
            var r = e[1 + o], s = o > a ? t[o - n] : 0;
            t[o] = r + s
        }
    }, r.prototype._unFilterType2 = function (e, t, i) {
        for (var n = this._lastLine, a = 0; a < i; a++) {
            var o = e[1 + a], r = n ? n[a] : 0;
            t[a] = o + r
        }
    }, r.prototype._unFilterType3 = function (e, t, i) {
        for (var n = this._xComparison, a = n - 1, o = this._lastLine, r = 0; r < i; r++) {
            var s = e[1 + r], l = o ? o[r] : 0, d = r > a ? t[r - n] : 0, u = Math.floor((d + l) / 2);
            t[r] = s + u
        }
    }, r.prototype._unFilterType4 = function (e, t, i) {
        for (var n = this._xComparison, o = n - 1, r = this._lastLine, s = 0; s < i; s++) {
            var l = e[1 + s], d = r ? r[s] : 0, u = s > o ? t[s - n] : 0, c = s > o && r ? r[s - n] : 0, h = a(u, d, c);
            t[s] = l + h
        }
    }, r.prototype._reverseFilterLine = function (e) {
        var t, i = e[0], n = this._images[this._imageIndex], a = n.byteWidth;
        if (0 === i) t = e.slice(1, a + 1); else switch (t = new Buffer(a), i) {
            case 1:
                this._unFilterType1(e, t, a);
                break;
            case 2:
                this._unFilterType2(e, t, a);
                break;
            case 3:
                this._unFilterType3(e, t, a);
                break;
            case 4:
                this._unFilterType4(e, t, a);
                break;
            default:
                throw new Error("Unrecognised filter type - " + i)
        }
        this.write(t), n.lineIndex++, n.lineIndex >= n.height ? (this._lastLine = null, this._imageIndex++, n = this._images[this._imageIndex]) : this._lastLine = t, n ? this.read(n.byteWidth + 1, this._reverseFilterLine.bind(this)) : (this._lastLine = null, this.complete())
    }
}, function (e, t, i) {
    "use strict";
    var n = [{x: [0], y: [0]}, {x: [4], y: [0]}, {x: [0, 4], y: [4]}, {x: [2, 6], y: [0, 4]}, {
        x: [0, 2, 4, 6],
        y: [2, 6]
    }, {x: [1, 3, 5, 7], y: [0, 2, 4, 6]}, {x: [0, 1, 2, 3, 4, 5, 6, 7], y: [1, 3, 5, 7]}];
    t.getImagePasses = function (e, t) {
        for (var i = [], a = e % 8, o = t % 8, r = (e - a) / 8, s = (t - o) / 8, l = 0; l < n.length; l++) {
            for (var d = n[l], u = r * d.x.length, c = s * d.y.length, h = 0; h < d.x.length && d.x[h] < a; h++) u++;
            for (h = 0; h < d.y.length && d.y[h] < o; h++) c++;
            u > 0 && c > 0 && i.push({width: u, height: c, index: l})
        }
        return i
    }, t.getInterlaceIterator = function (e) {
        return function (t, i, a) {
            var o = t % n[a].x.length, r = (t - o) / n[a].x.length * 8 + n[a].x[o], s = i % n[a].y.length;
            return 4 * r + ((i - s) / n[a].y.length * 8 + n[a].y[s]) * e * 4
        }
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t, i) {
        var n = e + t - i, a = Math.abs(n - e), o = Math.abs(n - t), r = Math.abs(n - i);
        return a <= o && a <= r ? e : o <= r ? t : i
    }
}, function (e, t, i) {
    "use strict";
    var n = i(110), a = i(496), o = e.exports = function (e, t) {
        this._options = e, e.checkCRC = !1 !== e.checkCRC, this._hasIHDR = !1, this._hasIEND = !1, this._palette = [], this._colorType = 0, this._chunks = {}, this._chunks[n.TYPE_IHDR] = this._handleIHDR.bind(this), this._chunks[n.TYPE_IEND] = this._handleIEND.bind(this), this._chunks[n.TYPE_IDAT] = this._handleIDAT.bind(this), this._chunks[n.TYPE_PLTE] = this._handlePLTE.bind(this), this._chunks[n.TYPE_tRNS] = this._handleTRNS.bind(this), this._chunks[n.TYPE_gAMA] = this._handleGAMA.bind(this), this.read = t.read, this.error = t.error, this.metadata = t.metadata, this.gamma = t.gamma, this.transColor = t.transColor, this.palette = t.palette, this.parsed = t.parsed, this.inflateData = t.inflateData, this.finished = t.finished
    };
    o.prototype.start = function () {
        this.read(n.PNG_SIGNATURE.length, this._parseSignature.bind(this))
    }, o.prototype._parseSignature = function (e) {
        for (var t = n.PNG_SIGNATURE, i = 0; i < t.length; i++) if (e[i] !== t[i]) return void this.error(new Error("Invalid file signature"));
        this.read(8, this._parseChunkBegin.bind(this))
    }, o.prototype._parseChunkBegin = function (e) {
        for (var t = e.readUInt32BE(0), i = e.readUInt32BE(4), o = "", r = 4; r < 8; r++) o += String.fromCharCode(e[r]);
        var s = Boolean(32 & e[4]);
        if (this._hasIHDR || i === n.TYPE_IHDR) {
            if (this._crc = new a, this._crc.write(new Buffer(o)), this._chunks[i]) return this._chunks[i](t);
            s ? this.read(t + 4, this._skipChunk.bind(this)) : this.error(new Error("Unsupported critical chunk type " + o))
        } else this.error(new Error("Expected IHDR on beggining"))
    }, o.prototype._skipChunk = function () {
        this.read(8, this._parseChunkBegin.bind(this))
    }, o.prototype._handleChunkEnd = function () {
        this.read(4, this._parseChunkEnd.bind(this))
    }, o.prototype._parseChunkEnd = function (e) {
        var t = e.readInt32BE(0), i = this._crc.crc32();
        this._options.checkCRC && i !== t ? this.error(new Error("Crc error - " + t + " - " + i)) : this._hasIEND || this.read(8, this._parseChunkBegin.bind(this))
    }, o.prototype._handleIHDR = function (e) {
        this.read(e, this._parseIHDR.bind(this))
    }, o.prototype._parseIHDR = function (e) {
        this._crc.write(e);
        var t = e.readUInt32BE(0), i = e.readUInt32BE(4), a = e[8], o = e[9], r = e[10], s = e[11], l = e[12];
        if (8 === a || 4 === a || 2 === a || 1 === a || 16 === a) if (o in n.COLORTYPE_TO_BPP_MAP) if (0 === r) if (0 === s) if (0 === l || 1 === l) {
            this._colorType = o;
            var d = n.COLORTYPE_TO_BPP_MAP[this._colorType];
            this._hasIHDR = !0, this.metadata({
                width: t,
                height: i,
                depth: a,
                interlace: Boolean(l),
                palette: Boolean(o & n.COLORTYPE_PALETTE),
                color: Boolean(o & n.COLORTYPE_COLOR),
                alpha: Boolean(o & n.COLORTYPE_ALPHA),
                bpp: d,
                colorType: o
            }), this._handleChunkEnd()
        } else this.error(new Error("Unsupported interlace method")); else this.error(new Error("Unsupported filter method")); else this.error(new Error("Unsupported compression method")); else this.error(new Error("Unsupported color type")); else this.error(new Error("Unsupported bit depth " + a))
    }, o.prototype._handlePLTE = function (e) {
        this.read(e, this._parsePLTE.bind(this))
    }, o.prototype._parsePLTE = function (e) {
        this._crc.write(e);
        for (var t = Math.floor(e.length / 3), i = 0; i < t; i++) this._palette.push([e[3 * i], e[3 * i + 1], e[3 * i + 2], 255]);
        this.palette(this._palette), this._handleChunkEnd()
    }, o.prototype._handleTRNS = function (e) {
        this.read(e, this._parseTRNS.bind(this))
    }, o.prototype._parseTRNS = function (e) {
        if (this._crc.write(e), this._colorType === n.COLORTYPE_PALETTE_COLOR) {
            if (0 === this._palette.length) return void this.error(new Error("Transparency chunk must be after palette"));
            if (e.length > this._palette.length) return void this.error(new Error("More transparent colors than palette size"));
            for (var t = 0; t < e.length; t++) this._palette[t][3] = e[t];
            this.palette(this._palette)
        }
        this._colorType === n.COLORTYPE_GRAYSCALE && this.transColor([e.readUInt16BE(0)]), this._colorType === n.COLORTYPE_COLOR && this.transColor([e.readUInt16BE(0), e.readUInt16BE(2), e.readUInt16BE(4)]), this._handleChunkEnd()
    }, o.prototype._handleGAMA = function (e) {
        this.read(e, this._parseGAMA.bind(this))
    }, o.prototype._parseGAMA = function (e) {
        this._crc.write(e), this.gamma(e.readUInt32BE(0) / n.GAMMA_DIVISION), this._handleChunkEnd()
    }, o.prototype._handleIDAT = function (e) {
        this.read(-e, this._parseIDAT.bind(this, e))
    }, o.prototype._parseIDAT = function (e, t) {
        if (this._crc.write(t), this._colorType === n.COLORTYPE_PALETTE_COLOR && 0 === this._palette.length) throw new Error("Expected palette not found");
        this.inflateData(t);
        var i = e - t.length;
        i > 0 ? this._handleIDAT(i) : this._handleChunkEnd()
    }, o.prototype._handleIEND = function (e) {
        this.read(e, this._parseIEND.bind(this))
    }, o.prototype._parseIEND = function (e) {
        this._crc.write(e), this._hasIEND = !0, this._handleChunkEnd(), this.finished && this.finished()
    }
}, function (e, t, i) {
    "use strict";
    var n = [];
    !function () {
        for (var e = 0; e < 256; e++) {
            for (var t = e, i = 0; i < 8; i++) 1 & t ? t = 3988292384 ^ t >>> 1 : t >>>= 1;
            n[e] = t
        }
    }();
    var a = e.exports = function () {
        this._crc = -1
    };
    a.prototype.write = function (e) {
        for (var t = 0; t < e.length; t++) this._crc = n[255 & (this._crc ^ e[t])] ^ this._crc >>> 8;
        return !0
    }, a.prototype.crc32 = function () {
        return -1 ^ this._crc
    }, a.crc32 = function (e) {
        for (var t = -1, i = 0; i < e.length; i++) t = n[255 & (t ^ e[i])] ^ t >>> 8;
        return -1 ^ t
    }
}, function (e, t, i) {
    "use strict";
    var n = i(493), a = {
        1: {0: 0, 1: 0, 2: 0, 3: 255},
        2: {0: 0, 1: 0, 2: 0, 3: 1},
        3: {0: 0, 1: 1, 2: 2, 3: 255},
        4: {0: 0, 1: 1, 2: 2, 3: 3}
    };

    function o(e, t, i, n, o, r) {
        for (var s = e.width, l = e.height, d = e.index, u = 0; u < l; u++) for (var c = 0; c < s; c++) {
            for (var h = i(c, u, d), f = 0; f < 4; f++) {
                var g = a[n][f];
                if (255 === g) t[h + f] = 255; else {
                    var p = g + r;
                    if (p === o.length) throw new Error("Ran out of data");
                    t[h + f] = o[p]
                }
            }
            r += n
        }
        return r
    }

    function r(e, t, i, n, o, r) {
        for (var s = e.width, l = e.height, d = e.index, u = 0; u < l; u++) {
            for (var c = 0; c < s; c++) for (var h = o.get(n), f = i(c, u, d), g = 0; g < 4; g++) {
                var p = a[n][g];
                t[f + g] = 255 !== p ? h[p] : r
            }
            o.resetAfterLine()
        }
    }

    t.dataToBitMap = function (e, t) {
        var i, a = t.width, s = t.height, l = t.depth, d = t.bpp, u = t.interlace;
        if (8 !== l) var c = function (e, t) {
            var i = [], n = 0;

            function a() {
                if (n === e.length) throw new Error("Ran out of data");
                var a, o, r, s, l, d, u, c, h = e[n];
                switch (n++, t) {
                    default:
                        throw new Error("unrecognised depth");
                    case 16:
                        u = e[n], n++, i.push((h << 8) + u);
                        break;
                    case 4:
                        u = 15 & h, c = h >> 4, i.push(c, u);
                        break;
                    case 2:
                        l = 3 & h, d = h >> 2 & 3, u = h >> 4 & 3, c = h >> 6 & 3, i.push(c, u, d, l);
                        break;
                    case 1:
                        a = 1 & h, o = h >> 1 & 1, r = h >> 2 & 1, s = h >> 3 & 1, l = h >> 4 & 1, d = h >> 5 & 1, u = h >> 6 & 1, c = h >> 7 & 1, i.push(c, u, d, l, s, r, o, a)
                }
            }

            return {
                get: function (e) {
                    for (; i.length < e;) a();
                    var t = i.slice(0, e);
                    return i = i.slice(e), t
                }, resetAfterLine: function () {
                    i.length = 0
                }, end: function () {
                    if (n !== e.length) throw new Error("extra data found")
                }
            }
        }(e, l);
        i = l <= 8 ? new Buffer(a * s * 4) : new Uint16Array(a * s * 4);
        var h, f, g = Math.pow(2, l) - 1, p = 0;
        if (u) h = n.getImagePasses(a, s), f = n.getInterlaceIterator(a, s); else {
            var v = 0;
            f = function () {
                var e = v;
                return v += 4, e
            }, h = [{width: a, height: s}]
        }
        for (var m = 0; m < h.length; m++) 8 === l ? p = o(h[m], i, f, d, e, p) : r(h[m], i, f, d, c, g);
        if (8 === l) {
            if (p !== e.length) throw new Error("extra data found")
        } else c.end();
        return i
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t) {
        var i = t.depth, n = t.width, a = t.height, o = t.colorType, r = t.transColor, s = t.palette, l = e;
        return 3 === o ? function (e, t, i, n, a) {
            for (var o = 0, r = 0; r < n; r++) for (var s = 0; s < i; s++) {
                var l = a[e[o]];
                if (!l) throw new Error("index " + e[o] + " not in palette");
                for (var d = 0; d < 4; d++) t[o + d] = l[d];
                o += 4
            }
        }(e, l, n, a, s) : (r && function (e, t, i, n, a) {
            for (var o = 0, r = 0; r < n; r++) for (var s = 0; s < i; s++) {
                var l = !1;
                if (1 === a.length ? a[0] === e[o] && (l = !0) : a[0] === e[o] && a[1] === e[o + 1] && a[2] === e[o + 2] && (l = !0), l) for (var d = 0; d < 4; d++) t[o + d] = 0;
                o += 4
            }
        }(e, l, n, a, r), 8 !== i && (16 === i && (l = new Buffer(n * a * 4)), function (e, t, i, n, a) {
            for (var o = Math.pow(2, a) - 1, r = 0, s = 0; s < n; s++) for (var l = 0; l < i; l++) {
                for (var d = 0; d < 4; d++) t[r + d] = Math.floor(255 * e[r + d] / o + .5);
                r += 4
            }
        }(e, l, n, a, i))), l
    }
}, function (e, t, i) {
    "use strict";
    var n = i(110), a = i(496), o = i(735), r = i(736), s = i(74), l = e.exports = function (e) {
        if (this._options = e, e.deflateChunkSize = e.deflateChunkSize || 32768, e.deflateLevel = null != e.deflateLevel ? e.deflateLevel : 9, e.deflateStrategy = null != e.deflateStrategy ? e.deflateStrategy : 3, e.inputHasAlpha = null == e.inputHasAlpha || e.inputHasAlpha, e.deflateFactory = e.deflateFactory || s.createDeflate, e.bitDepth = e.bitDepth || 8, e.colorType = "number" == typeof e.colorType ? e.colorType : n.COLORTYPE_COLOR_ALPHA, e.inputColorType = "number" == typeof e.inputColorType ? e.inputColorType : n.COLORTYPE_COLOR_ALPHA, -1 === [n.COLORTYPE_GRAYSCALE, n.COLORTYPE_COLOR, n.COLORTYPE_COLOR_ALPHA, n.COLORTYPE_ALPHA].indexOf(e.colorType)) throw new Error("option color type:" + e.colorType + " is not supported at present");
        if (-1 === [n.COLORTYPE_GRAYSCALE, n.COLORTYPE_COLOR, n.COLORTYPE_COLOR_ALPHA, n.COLORTYPE_ALPHA].indexOf(e.inputColorType)) throw new Error("option input color type:" + e.inputColorType + " is not supported at present");
        if (8 !== e.bitDepth && 16 !== e.bitDepth) throw new Error("option bit depth:" + e.bitDepth + " is not supported at present")
    };
    l.prototype.getDeflateOptions = function () {
        return {
            chunkSize: this._options.deflateChunkSize,
            level: this._options.deflateLevel,
            strategy: this._options.deflateStrategy
        }
    }, l.prototype.createDeflate = function () {
        return this._options.deflateFactory(this.getDeflateOptions())
    }, l.prototype.filterData = function (e, t, i) {
        var a = o(e, t, i, this._options), s = n.COLORTYPE_TO_BPP_MAP[this._options.colorType];
        return r(a, t, i, this._options, s)
    }, l.prototype._packChunk = function (e, t) {
        var i = t ? t.length : 0, n = new Buffer(i + 12);
        return n.writeUInt32BE(i, 0), n.writeUInt32BE(e, 4), t && t.copy(n, 8), n.writeInt32BE(a.crc32(n.slice(4, n.length - 4)), n.length - 4), n
    }, l.prototype.packGAMA = function (e) {
        var t = new Buffer(4);
        return t.writeUInt32BE(Math.floor(e * n.GAMMA_DIVISION), 0), this._packChunk(n.TYPE_gAMA, t)
    }, l.prototype.packIHDR = function (e, t) {
        var i = new Buffer(13);
        return i.writeUInt32BE(e, 0), i.writeUInt32BE(t, 4), i[8] = this._options.bitDepth, i[9] = this._options.colorType, i[10] = 0, i[11] = 0, i[12] = 0, this._packChunk(n.TYPE_IHDR, i)
    }, l.prototype.packIDAT = function (e) {
        return this._packChunk(n.TYPE_IDAT, e)
    }, l.prototype.packIEND = function () {
        return this._packChunk(n.TYPE_IEND, null)
    }
}, function (e, t, i) {
    "use strict";
    var n = e.exports = function (e) {
        this._buffer = e, this._reads = []
    };
    n.prototype.read = function (e, t) {
        this._reads.push({length: Math.abs(e), allowLess: e < 0, func: t})
    }, n.prototype.process = function () {
        for (; this._reads.length > 0 && this._buffer.length;) {
            var e = this._reads[0];
            if (!this._buffer.length || !(this._buffer.length >= e.length || e.allowLess)) break;
            this._reads.shift();
            var t = this._buffer;
            this._buffer = t.slice(e.length), e.func.call(this, t.slice(0, e.length))
        }
        return this._reads.length > 0 ? new Error("There are some read requests waitng on finished stream") : this._buffer.length > 0 ? new Error("unrecognised content at end of stream") : void 0
    }
}, function (e, t, i) {
    var n = i(148);

    function a(e, t) {
        var i = e.a / 255, n = t + '="' + e.hex + '"';
        return i < 1 ? n + " " + t + '-opacity="' + i.toFixed(2).slice(1) + '"' : n
    }

    function o(e, t, i) {
        var n = e + t;
        return void 0 !== i && (n += " " + i), n
    }

    t.render = function (e, t, i) {
        var r = n.getOptions(t), s = e.modules.size, l = e.modules.data, d = s + 2 * r.margin,
            u = r.color.light.a ? "<path " + a(r.color.light, "fill") + ' d="M0 0h' + d + "v" + d + 'H0z"/>' : "",
            c = "<path " + a(r.color.dark, "stroke") + ' d="' + function (e, t, i) {
                for (var n = "", a = 0, r = !1, s = 0, l = 0; l < e.length; l++) {
                    var d = Math.floor(l % t), u = Math.floor(l / t);
                    d || r || (r = !0), e[l] ? (s++, l > 0 && d > 0 && e[l - 1] || (n += r ? o("M", d + i, .5 + u + i) : o("m", a, 0), a = 0, r = !1), d + 1 < t && e[l + 1] || (n += o("h", s), s = 0)) : a++
                }
                return n
            }(l, s, r.margin) + '"/>', h = 'viewBox="0 0 ' + d + " " + d + '"',
            f = '<svg xmlns="http://www.w3.org/2000/svg" ' + (r.width ? 'width="' + r.width + '" height="' + r.width + '" ' : "") + h + ' shape-rendering="crispEdges">' + u + c + "</svg>\n";
        return "function" == typeof i && i(null, f), f
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(413), a = i(266);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(782);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-category.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(29), r = i(14), s = i(12), l = i(43), d = s.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        let t = null, s = -1, u = 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(() => n(this, void 0, void 0, function* () {
                    if (-1 !== s) {
                        let e = d.getTaskFromTaskId(s);
                        if (e) {
                            let t = e.getTaskBaseInfo();
                            if (t.gcid && "" !== t.gcid) return;
                            const {QueryTaskInfoHelperNS: n} = yield Promise.resolve().then(() => i(773));
                            if (t.taskType === a.DownloadKernel.TaskType.P2sp) {
                                let i = e.getExtraObject().getDisplayUrl();
                                "" === i && (i = t.url), l.Common.isThunderPrivateUrl(i) && (i = l.Common.parseThunderPrivateUrl(i)), n.queryResInfo("url", i).then(t => {
                                    t && 200 === t.status && null !== t.data && null !== t.data.result && "ok" === t.data.result && "" !== t.data.gcid && "1111111111111111111111111111111111111111" !== 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 i = t.url;
                                l.Common.isThunderPrivateUrl(i) && (i = l.Common.parseThunderPrivateUrl(i)), n.postRequestEd2kTaskInfoByEd2kLink(i).then(t => {
                                    t && t.gcid && "" !== t.gcid && "1111111111111111111111111111111111111111" !== t.gcid && e.setGcid(t.gcid)
                                }).catch()
                            }
                            if (t.taskType === a.DownloadKernel.TaskType.Group) {
                                let e = [], i = "", o = d.getTaskFromTaskId(t.taskId).getExtraObject(),
                                    r = o.getSubTaskCount(), s = new Map;
                                for (let t = 0; t < r; ++t) {
                                    let n = o.getSubTaskByIndex(t);
                                    if (n.getType() === a.DownloadKernel.TaskType.P2sp) {
                                        let a = n.getTaskBaseInfo();
                                        if (a.fileSize && a.fileSize > 0) continue;
                                        a.url && a.url.length > 0 && (i = a.url, l.Common.isThunderPrivateUrl(i) && (i = l.Common.parseThunderPrivateUrl(i)), e.push(i), s.set(i, t))
                                    }
                                }
                                e.length > 0 && !u && (u = t.taskId, n.asyncBatchQueryP2spTaskInfoByUrl(e, (e, t, i) => {
                                    o.setSubTaskFileSize(s.get(e), t.fileSize)
                                }, () => {
                                    u = null
                                }).catch())
                            }
                        }
                    }
                }), 100)) : s === r && (null !== t && (clearTimeout(t), t = null), s = -1)
            })
        }, e.getQueryTaskId = function () {
            return u
        }
    }(t.QueryTaskInfoNS || (t.QueryTaskInfoNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(397), a = i(304);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.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, i) {
    "use strict";
    i.r(t);
    var n = i(415), a = i(308);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\components\\select-native.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(102), o = i(59), r = i(859), s = i(112), l = i(507), d = i(864);
    t.probe = function (e, t) {
        var i = t || {}, u = r.defer(), c = null, h = o.platform(), f = l.createBuilder(h);
        c = a.spawn(l.getExecutablePath(h), f.getResult(e, i));
        var g = d.createParser(h);
        c.once("error", function () {
            var e = new Error(n.format("ping.probe: %s. %s", "there was an error while executing the ping program. ", "Check the path or permissions..."));
            u.reject(e)
        });
        var p = [];
        return c.stdout.on("data", function (e) {
            p.push(String(e))
        }), c.once("close", function () {
            var e = p.join("").split("\n");
            s.each(e, g.eat, g);
            var t = g.getResult();
            u.resolve(t)
        }), u.promise
    }
}, function (e, t, i) {
    "use strict";
    var n = i(112), a = i(4), o = i(861), r = i(862), s = i(863);

    function l() {
    }

    l.isLinux = function (e) {
        return ["aix", "linux"].indexOf(e) >= 0
    }, l.isMacOS = function (e) {
        return ["darwin", "freebsd"].indexOf(e) >= 0
    }, l.isWindow = function (e) {
        return e && null !== e.match(/^win/)
    }, l.isPlatformSupport = function (e) {
        return n.some([this.isWindow(e), this.isLinux(e), this.isMacOS(e)])
    }, l.getExecutablePath = function (e) {
        if (!this.isPlatformSupport(e)) throw new Error(a.format("Platform |%s| is not support", e));
        var t = null;
        return "aix" === e ? t = "/usr/sbin/ping" : l.isLinux(e) ? t = "/bin/ping" : l.isWindow(e) ? t = process.env.SystemRoot + "/system32/ping.exe" : l.isMacOS(e) && (t = "/sbin/ping"), t
    }, l.createBuilder = function (e) {
        if (!this.isPlatformSupport(e)) throw new Error(a.format("Platform |%s| is not support", e));
        var t = null;
        return l.isLinux(e) ? t = o : l.isWindow(e) ? t = s : l.isMacOS(e) && (t = r), t
    }, e.exports = l
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(112), o = i(366);

    function r() {
        o.call(this)
    }

    n.inherits(r, o), r.prototype._processHeader = function (e) {
        var t = e.split(" ");
        this._response.host = t[1], this._response.numeric_host = t[2].slice(1, -2), this._changeState(this.STATES.BODY)
    }, r.prototype._processBody = function (e) {
        if ((e.match(/=/g) || []).length >= 3) {
            var t = /([0-9\.]+)[ ]*ms/.exec(e);
            this._times.push(parseFloat(t[1], 10))
        }
        e.indexOf("---") >= 0 && this._changeState(this.STATES.FOOTER)
    }, r.prototype._processFooter = function (e) {
        if ((e.match(/[\/]/g) || []).length >= 3) {
            var t = /([0-9\.]+)/g, i = t.exec(e), n = t.exec(e), o = t.exec(e), r = t.exec(e);
            a.all([i, n, o, r]) && (this._response.min = parseFloat(i[1], 10), this._response.avg = parseFloat(n[1], 10), this._response.max = parseFloat(o[1], 10), this._response.stddev = parseFloat(r[1], 10), this._changeState(this.STATES.END)), this._changeState(this.STATES.END)
        }
    }, e.exports = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-loading"}, [t("svg", {
            staticClass: "xly-loading__svg",
            attrs: {viewBox: "0 0 52 52"}
        }, [t("polyline", {attrs: {points: "23.5,27.6 7.5,18.6 23.5,10.6 39.5,18.6 "}}), this._v(" "), t("polyline", {attrs: {points: "23.5,27.5 39.5,18.5 39.5,36.5 23.5,44.5 "}}), this._v(" "), t("polyline", {attrs: {points: "23.5,27.5 23.5,44.5 7.5,36.5 7.5,18.5 "}}), this._v(" "), t("path", {
            staticClass: "xly-path-out",
            attrs: {d: "M23.5,44.5l-16-8v-18l16-8l16,8v18L23.5,44.5z"}
        }), this._v(" "), t("polyline", {
            staticClass: "xly-path-inner-2",
            attrs: {points: "23.5,27.5 39.5,18.5 39.5,36.5 23.5,44.5 "}
        }), this._v(" "), t("polyline", {
            staticClass: "xly-path-inner-1",
            attrs: {points: "23.5,27.6 7.5,18.6 23.5,10.6 39.5,18.6 "}
        }), this._v(" "), t("polyline", {
            staticClass: "xly-path-inner-3",
            attrs: {points: "23.5,27.5 23.5,44.5 7.5,36.5 7.5,18.5 "}
        })])])
    };
    n._withStripped = !0;
    var a = {}, o = (i(677), i(1)), r = Object(o.a)(a, n, [], !1, null, "6d2ca8de", null);
    r.options.__file = "src\\common\\components\\loading.vue";
    t.default = r.exports
}, function (e, t, i) {
    i(511), e.exports = i(512)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(4), o = i(0), r = i(7), s = i(84), l = i(18), d = i(33),
        u = r.default(n.join(__rootDir, "../bin/ThunderHelper.node"));

    function c() {
        "console" === process.env.TL_OUTPUT ? o.default.outputLogger = o.outputLoggerConsole : o.default.outputLogger = function () {
            function e(e) {
                return function (...t) {
                    u.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 h() {
        let e = s.DevEnvHelperNS.isLogEnable();
        "1" === process.env.TL_ENABLE !== e && (process.env.TL_ENABLE = e ? "1" : "0", o.default.enableLogger = e, u.enableETWLogger(e));
        let t = s.DevEnvHelperNS.getLogOutput();
        t && t !== process.env.TL_OUTPUT && (process.env.TL_OUTPUT = t, c())
    }

    process.env.TL_ENABLE = "0", o.default.enableLogger = "1" === process.env.TL_ENABLE, c(), h(), "browser" === process.type ? l.ipcMain.on(d.ThunderChannelList.channelRMUpdateLogEnviroment, () => {
        l.BrowserWindow.getAllWindows().forEach(e => {
            e.isDestroyed() || e.webContents.send(d.ThunderChannelList.channelMRUpdateLogEnviroment)
        }), h()
    }) : "renderer" === process.type && l.ipcRenderer.on(d.ThunderChannelList.channelMRUpdateLogEnviroment, () => {
        h()
    })
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(69), o = i(330);
    o.CommonIPCRenderer.rendererCommunicator.initialize(a.CommonIPCBase.mainRendererContext), o.CommonIPCRenderer.rendererCommunicator.connect();
    let r = !1;
    const s = i(16);
    s.server.start({IsMainRendererReadyToShow: () => r});
    const l = i(5);
    l.client.start({name: a.CommonIPCBase.mainRendererContext});
    const d = i(516), u = i(17), c = i(18), h = i(2), f = i(2), g = i(19), p = i(117), v = i(0);
    i(525);
    const m = i(37), y = i(31), k = i(457), T = i(14), w = i(583), C = i(591), S = i(595), I = i(600), b = i(601),
        _ = i(602), D = i(603), A = i(90), N = i(606), x = i(608), E = i(609), P = i(610), O = i(611), M = i(612),
        F = i(27), L = i(613), R = i(614), B = i(615), U = i(616), K = i(617), V = i(618), W = i(619), G = i(620),
        H = i(621), z = i(458), j = i(33), X = i(32), $ = i(622), Y = i(98), q = i(44), J = i(23), Z = i(355),
        Q = i(29), ee = i(9), te = i(76), ie = i(623), ne = i(88), ae = i(103), oe = i(57), re = i(141), se = i(627),
        le = i(10), de = i(835), ue = i(836), ce = i(480), he = i(837), fe = i(478), ge = i(24), pe = i(72), ve = i(22),
        me = i(52), ye = i(49), ke = i(468), Te = i(466), we = i(481), Ce = i(142), Se = i(838), Ie = i(839), be = i(7),
        _e = be.default(f.join(__rootDir, "../bin/ThunderHelper.node")),
        De = be.default(f.join(__rootDir, "../bin/WeakReferences.node")), Ae = i(840), Ne = i(503), xe = i(845),
        Ee = i(846), Pe = i(145);
    i(847), i(849), i(336), i(850);
    const Oe = i(851), Me = i(87), Fe = i(99), Le = i(852), Re = i(853), Be = i(854), Ue = i(867), Ke = i(3),
        Ve = i(30), We = i(12);
    i(868);
    const Ge = i(869), He = i(870), ze = i(363), je = i(360), Xe = i(109), $e = i(871), Ye = i(36), qe = i(11),
        Je = i(6), Ze = i(13), Qe = We.DownloadKernelTaskManager.getTaskManager(),
        et = ke.GroupAccelerateManagerNS.getManager(), tt = Te.GroupAccelerateWebManagerNS.getManager(),
        it = me.ToastNotifyManagerNS.getToastNotifyManger();
    d.PerformanceMonitorStatNS.init("main-renderer"), c.ipcRenderer.send(j.ThunderChannelList.channelRMProcessSend, process.pid);
    const nt = v.default.getLogger("Thunder.MainRenderer");
    de.ThunderToolsNS.enableDevTools().catch(e => {
        nt.warning(e)
    });
    let at = !1, ot = !1, rt = "", st = !1, lt = !1;

    function dt() {
        return n(this, void 0, void 0, function* () {
            if (at) return;
            let e = (yield qe.asyncRemoteCall.getProcess()).argv;
            for (let t = 0; t < e.length; t++) {
                let i = e[t];
                if (0 === i.indexOf("-StartType:")) rt = i.substr("-StartType:".length); else if (0 === i.indexOf("thunderx://", 0)) {
                    let e = `newthunder=${encodeURIComponent(i)}`;
                    le.XLStatNS.trackEvent("core_operate", "newthunder_startup", "", 0, 0, 0, 0, e)
                } else "-silent" === i ? ot = !0 : i.indexOf("play:true") > -1 ? st = !0 : i.indexOf("unionfile") > -1 && (lt = !0)
            }
            at = !0
        })
    }

    dt().then(() => {
        ae.default.setStartArgs(rt)
    }).catch(), oe.quitPromises.add(function () {
        return new Promise(e => n(this, void 0, void 0, function* () {
            _e.setQuitEvent(), e(!0)
        }))
    }), oe.quitPromises.add(function () {
        return new Promise(e => n(this, void 0, void 0, function* () {
            yield he.default.saveMainWndData(), _e.stopListenLocalNet(), e(!0)
        }))
    }), oe.quitPromises.add(function () {
        return new Promise(e => {
            m.ThunderNewTask.uninit(), e(!0)
        })
    }), oe.quitPromises.addBefore(function () {
        return new Promise(e => n(this, void 0, void 0, function* () {
            yield X.TaskOperatorNs.pauseAll(Ke.DownloadKernel.TaskStopReason.Exit), e(!0)
        }))
    }), oe.quitPromises.addBefore(function () {
        return n(this, void 0, void 0, function* () {
            return je.SyncMsgHelperNS.uninit(), !0
        })
    }), oe.quitPromises.addBefore(function () {
        return n(this, void 0, void 0, function* () {
            return Xe.ShouleiListSyncNS.getMananger().uninit(), !0
        })
    }), oe.quitPromises.addAfter(function () {
        return n(this, void 0, void 0, function* () {
            return yield ee.ConfigNS.save(), yield te.BHOConfigNS.save(), !0
        })
    }), oe.quitPromises.add(function () {
        return new Promise(e => {
            e(!0)
        })
    }), oe.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return s.server.fireClientEvent("main-will-quit"), !0
        })
    }), oe.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return re.default.uninit(), !0
        })
    }), oe.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return yield Be.DownloadDetectHelperNS.uninit(), !0
        })
    }), oe.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return new Promise(e => {
                if (Ve.ThunderKernel.commitAllTransaction(), Ve.ThunderKernel.stopPushStorageCommand(), 0 === Ve.ThunderKernel.getStorageWaitingCommandSize()) e(!0); else {
                    let t = 0, i = null;
                    i = setInterval(() => {
                        t++;
                        let n = Ve.ThunderKernel.getStorageWaitingCommandSize();
                        0 === n || t > 100 ? (i && (clearInterval(i), i = null), e(!0)) : nt.information("WaitingCommandSize", n)
                    }, 100)
                }
            })
        })
    }), oe.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            let e = "";
            if (ee.ConfigNS.getValue("ThunderPanPlugin", "useDefault", !1)) e = ee.ConfigNS.getValue("ThunderPanPlugin", "defaultDownloadPath", "C:\\迅雷下载"); else {
                let t = ee.ConfigNS.getValue("ThunderPanPlugin", "downloadPaths", []);
                t && t.length > 0 && (e = t[0])
            }
            nt.information("quitDeleteTmpXmpDownloadFile panDir", e);
            let t = "";
            if (e && "" !== e) t = h.join(e, "云盘缓存"); else {
                let e = yield Ze.ThunderUtil.getThunderTempPath(!0);
                t = h.join(e, "云盘取回", "云盘缓存")
            }
            let i = yield Je.FileSystemAWNS.rmdirAW(t);
            return nt.information("quitDeleteTmpXmpDownloadFile rmdirsAW ret", i), !0
        })
    }), global.__homepageWebviewReady = !1, global.AsyncGetNativeCallModuleObj = function (e) {
        e(u.NativeCallModule)
    }, global.xlNativeCallModule = u.NativeCallModule, global.__xdasObjectLiftMonitor = De, ge.default.init().catch(e => {
        nt.warning(e)
    }), pe.default.init().catch(e => {
        nt.warning(e)
    }), _e.allowSetForegroundWindow(), w.NaviteFunctionNS.registerNativeFunction(), C.PluginFunctionNS.registerPluginFunction(), S.ConfigPluginFunctionNS.registerPluginFunction(), I.ConfigRemoteGlobalPluginFunctionNS.registerPluginFunction(), b.LoginPluginFunctionNS.registerPluginFunction(), _.TipsPluginFunctionNS.registerPluginFunction(), D.DkPluginFunctionNS.registerPluginFunction(), A.PluginFunctionUINS.registerPluginFunction(), N.SkinPluginFunctionNS.registerPluginFunction(), x.VipPluginFunctionNS.registerPluginFunction(), E.NotificationPluginFunctionNS.registerPluginFunction(), He.ScheduleTaskPluginFunctionNS.registerPluginFunction(), P.ShouleiConnectPluginFunctionNS.registerPluginFunction(), O.SearchPluginFunctionNS.registerPluginFunction(), M.XmpPluginFunctionNS.registerPluginFunction(), $e.clientProduct.init().catch(), ae.default.init().catch(), m.ThunderNewTask.init().catch(), p.default.config.ignoredElements = ["webview"], new p.default({
        components: {App: se.default},
        render: e => e("app")
    }).$mount("#app"), ee.ConfigNS.init(f.join(__profilesDir, "config.json")).catch(e => {
        nt.warning(e)
    }), te.BHOConfigNS.init().catch(e => {
        nt.warning(e)
    }), Se.BindConfigNS.init(), he.default.initMainRendererHelper(), B.ConfigNaviteFunctionNS.registerNativeFunction(), U.ConfigRemoteGlobalNaviteFunctionNS.registerNativeFunction(), V.SkinNaviteFunctionNS.registerNativeFunction(), L.LoginNaviteFunctionNS.registerNativeFunction(), xe.TipsNaviteFunctionNS.registerNativeFunction(), H.ShouleiConnectNaviteFunctionNS.registerNativeFunction(), c.ipcRenderer.on(j.ThunderChannelList.channelMRGetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                c.ipcRenderer.send(j.ThunderChannelList.channelRMGetConfigValueReject);
                break
            }
            let e = t[0], i = t[1], n = t[2], a = ee.ConfigNS.getValue(e, i, n);
            c.ipcRenderer.send(j.ThunderChannelList.channelRMGetConfigValueResolve, a)
        } while (0)
    }), c.ipcRenderer.on(j.ThunderChannelList.channelMRSetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                c.ipcRenderer.send(j.ThunderChannelList.channelRMSetConfigValueReject);
                break
            }
            let e = t[0], i = t[1], n = t[2];
            ee.ConfigNS.setValue(e, i, n), ee.ConfigNS.save().catch()
        } while (0)
    }), c.ipcRenderer.on(j.ThunderChannelList.channelMRTrayMenuClick, (e, t, i) => n(this, void 0, void 0, function* () {
        nt.verbose(e), "-task:newtask" === t ? (i = void 0 === i ? "other" : i, le.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=" + i), nt.information("trackEvent", "core_event", "create_task_click", "click_source=" + i), m.ThunderNewTask.createPreNewTaskWindow(null)) : "-task:startall" === t ? X.TaskOperatorNs.startAll() : "-task:pauseall" === t ? X.TaskOperatorNs.pauseAll(Ke.DownloadKernel.TaskStopReason.PauseAll).catch() : "-task:quitprocess" === t && (yield ze.QuitMessageBoxMgrNS.popup()) && (yield oe.quitPromises.run())
    })), c.ipcRenderer.on(j.ThunderChannelList.channelMRFileCopyResult, (e, t, i) => {
        nt.information("channelMRFileCopyResult", t, i), t && it.showNotify(me.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, ye.ToastNotifyItemType.GreenNotify, "复制成功", 3e3)
    }), function () {
        return n(this, void 0, void 0, function* () {
            (yield qe.asyncRemoteCall.getIpcMain()).on("onShowMessageBox", (e, t) => {
                nt.verbose(e), "retryLogin" === t && ve.MessageBox.confirm({
                    title: "登录失败，请检查网络是否正常",
                    type: ve.MessageBox.ConfirmType.Warning,
                    content: "如果通过代理访问网络，请确认代理已正确设置。<br>如果是办公网络，请确认网络是否限制迅雷登录。",
                    okText: "我知道了",
                    cancelVisible: !1
                }).catch()
            })
        })
    }().catch(), window.getPluginUpdater = we.default.getPluginUpdater, l.client.callServerFunction("GetSkinInfo").then(e => {
        nt.information("GetSkinInfo", e)
    }).catch(e => {
        nt.warning("GetSkinInfo Error", e)
    }), l.client.attachServerEvent("OnChangeSkin", (e, t) => {
        nt.information("OnChangeSkin", t)
    }), window.setSkinInfo = (() => {
        l.client.callServerFunction("SetSkinInfo", {type: Pe.SkinHelperNS.SkinType.Color, colorID: 1}).catch(e => {
            nt.warning("SetSkinInfo Error", e)
        })
    }), setTimeout(() => n(this, void 0, void 0, function* () {
        let e = ee.ConfigNS.getValue("Install", "PersonalUid", "");
        if (e && "" !== e) try {
            const t = yield i(20);
            t.defaults.adapter = i(21);
            let n = "https://msg-vip-ssl.xunlei.com/individuation/Clinetreport?userid=";
            n += e, n += "&param=active_user", n += "&peer_id=" + _e.getPeerID(), yield t.get(n, {responseType: "arraybuffer"})
        } catch (e) {
            nt.warning(e)
        }
    }), 5e3), c.ipcRenderer.on(j.ThunderChannelList.channelMRShowOrHideWindow, (e, t, i) => {
        "show" === t ? ee.ConfigNS.setValue("Consumption", "ShowMainWindowTime", i) : ee.ConfigNS.setValue("Consumption", "HideMainWindowTime", i)
    }), function () {
        return n(this, void 0, void 0, function* () {
            r = !0, Ye.NativeCallNS.init(), R.DKNaviteFunctionNS.registerNativeFunction(), W.VipNaviteFunctionNS.registerNativeFunction(), K.DownloadAndPlayNaviteFunctionNS.registerNativeFunction(), G.SubtitleManagerNaviteFunctionNS.registerNativeFunction(), Ee.NotificationNaviteFunctionNS.registerNativeFunction(), Ae.AdManageNS.init(), Oe.defaultNavite.registerDefaultNativeFunction(), s.server.fireClientEvent("main-renderer-ready-to-show"), ce.default.initAccelerator(), y.DownloadKernelManager.init().then(() => {
                l.client.attachServerEvent("OnVipTaskInfoChanged", (e, t, i) => {
                    if (!e || "vip-download-webview" !== e.name) return;
                    if (!i) return;
                    nt.information("onVipTaskInfoChanged taskId,taskInfo:", t, i);
                    let n = Qe.getTaskFromTaskId(t);
                    n && n.setAcclerating(i.enterStatus === Ue.VipDownloadDefineNS.VipTaskStatus.Acclerating)
                }), l.client.attachServerEvent("OnVipSubTaskInfoChanged", (e, t, i, n) => {
                    if (!e || "vip-download-webview" !== e.name) return;
                    if (!t) return;
                    let a = Qe.getTaskFromTaskId(t);
                    if (a && a.getType() === Ke.DownloadKernel.TaskType.Group && n && i) {
                        let e = null;
                        for (let t of i) (e = Qe.getTaskFromTaskId(t)) && e.setAcclerating(n.enterStatus === Ue.VipDownloadDefineNS.VipTaskStatus.Acclerating)
                    }
                })
            }).catch(e => {
                nt.warning(e)
            }), Q.default.trackWin7NewTrait(), de.ThunderToolsNS.enableDragOpenFile(!0), ie.ConfigHandlerNS.init(), ne.SettingConfigHelperNS.configBrowserHelper.init().catch(), $.TaskHelperNS.init(), q.DownloadDispatchNS.init(), Y.DownloadJammedNS.init(), z.TaskDetailNS.init(), fe.FileAssociationNS.asynCheckAndAssociate().catch(), Re.fullScreenCheckBegin(), oe.quitPromises.add(Re.fullScreenCheckEnd), setTimeout(() => {
                re.default.init().then().catch()
            }, 2e3), et.init(), tt.init("http://misc-xl9-ssl.xunlei.com/acc_xdas/dist/#/"), ue.ClipBoardNS.init(st && lt), Ne.QueryTaskInfoNS.init(), Ge.TaskP2spAutoRenameNS.init(), Ce.SubtitleManagerNS.init().catch(e => {
                nt.warning(e)
            }), _e.startListenLocalNet(e => {
                if (nt.information("startListenLocalNet, result = ", e), "OnInternetConnectSuc" === e || "OnInternetFallLine" === e) {
                    let t = 1, i = 1;
                    "OnInternetConnectSuc" === e ? (i = 1, t = 2) : (i = 2, t = 1), nt.information("返回值：0 初始化状态，1 在线状态， 2 断网状态 onInternetConnectChange:", t, i), F.NativeCallHostModule.nativeCallHost.fireNativeEvent("onInternetConnectChange", t, i)
                } else nt.information("返回数据错误！")
            }), setTimeout(() => {
                _e.startAutoUpdateWithUI()
            }, 3e4);
            let e = new g.EventEmitter;
            k.PluginLoaderNS.pluginLoader.loadPlugin("VipDownload").catch(), k.PluginLoaderNS.pluginLoader.loadPlugin("VipPluginController").catch(), yield k.PluginLoaderNS.pluginLoader.loadPlugin("User"), yield J.LoginHelperNS.loginSDKHelper.init(), u.NativeCallModule.nativeCall.AttachNativeEvent("onLoginPluginInited", () => n(this, void 0, void 0, function* () {
                J.LoginHelperNS.loginHelper.isAutologin(e => n(this, void 0, void 0, function* () {
                    let t = yield Z.commonLoginHelper.isAutoPopupLogin();
                    if (nt.information("isAutologin:", e, rt, t), !e && ("Install" === rt || t && "AutoRun" !== rt && !ot)) {
                        let e = "other";
                        "Install" === rt ? e = "Install" : t && (e = "auto"), J.LoginHelperNS.loginHelper.showLoginDlg(e, !0), t && !ot && "AutoRun" !== rt && Z.commonLoginHelper.setLoginWndShowConfig()
                    }
                }))
            })), yield k.PluginLoaderNS.pluginLoader.loadPlugin("ThunderXLogin"), k.PluginLoaderNS.pluginLoader.loadPlugin("VipRenewButton", "vip-plugin-controller").catch(), yield k.PluginLoaderNS.pluginLoader.loadPlugin("Centertip"), k.PluginLoaderNS.pluginLoader.loadPlugin("ThunderPanPlugin").catch(), k.PluginLoaderNS.pluginLoader.loadPlugin("ThunderIM").catch(), setTimeout(() => {
                k.PluginLoaderNS.pluginLoader.loadPlugin("XmpPlugin").catch()
            }, 1e3), k.PluginLoaderNS.pluginLoader.loadPlugin("Flash").catch(), setTimeout(() => {
                try {
                    let t = _e.getPeerID(), i = _e.getOSVersion(), n = f.join(__rootDir, "../../Thunder.exe"),
                        a = _e.getFileVersion(n), o = _e.getChannelID();
                    k.PluginLoaderNS.pluginLoader.startDownloadPlugins(t, i, "21", a, o, e)
                } catch (e) {
                }
            }, 1e4), e.on(T.NodeEventMesssageNS.eventPluginLoderPluginReady, e => n(this, void 0, void 0, function* () {
                if ("addTest4" === e) {
                    let t = yield k.PluginLoaderNS.pluginLoader.loadPlugin(e);
                    t && t.add && t.add("plugin loader")
                }
            })), setTimeout(() => {
                "Install" === rt && (ee.ConfigNS.getValue("ShowBrowser", "ShowBox", !1) || Fe.popMutual.setReady(Me.PopView.BROWSER_GUIDE, !1, "start"))
            }, 22e3), setTimeout(() => {
                Le.EmptyWorkingSetNS.init().catch()
            }, 5e3), setTimeout(() => {
                Ie.memoryWarningSupport().catch()
            }, 3e3), setTimeout(() => n(this, void 0, void 0, function* () {
                Be.DownloadDetectHelperNS.init().catch(), (yield qe.asyncRemoteCall.getCurrentObject("powerMonitor")).on("resume", () => {
                    F.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnPowerMonitorResume")
                }), yield je.SyncMsgHelperNS.init(), Xe.ShouleiListSyncNS.getMananger().init().catch()
            }), 2e3), yield dt()
        })
    }().catch(), window.addEventListener("keyup", e => {
        "F2" === e.key && e.ctrlKey && c.ipcRenderer.send(j.ThunderChannelList.channelRMUpdateLogEnviroment)
    })
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(45), a = i(93), o = i(19), r = i(514), s = i(55);
    t.Server = class extends o.EventEmitter {
        constructor() {
            super(), this.server = a.createServer(e => this.handleConnection(e)), this.productId = ""
        }

        getProductId() {
            return this.productId
        }

        listen(e, t) {
            let i = s.getSockPath(t);
            this.productId = t || s.getDefaultPrex(), n.existsSync(i) && n.unlinkSync(i), this.server.listen({
                path: i,
                readableAll: !0,
                writableAll: !0
            }, e)
        }

        handleConnection(e) {
            const t = new r.Client({socket: e});
            t.on("message", e => {
                this.handleRequest(e, t)
            }), t.on("end", () => {
                this.emit("end", t)
            }), t.on("error", e => {
                this.emit("error", t, e)
            }), this.emit("connect", t)
        }

        handleRequest(e, t) {
            this.emit("message", e, t)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(93), a = i(19), o = i(115), r = i(431), s = i(55);
    t.Client = class extends a.EventEmitter {
        constructor(e) {
            if (e = e || {}, super(), this.inprocess = !1, this.context = void 0, e.context && (this.context = Object.assign({}, e.context), this.context.productId = e.socketPrex), e.socket) this.socket = e.socket, this.bind(); else if (global.__xdasIPCServer && global.__xdasIPCServer.getProductId().toLowerCase() === e.socketPrex.toLowerCase()) this.inprocess = !0; else {
                let t = s.getSockPath(e.socketPrex);
                this.socket = n.connect(t), this.bind()
            }
        }

        isInprocess() {
            return this.inprocess
        }

        getContext() {
            return this.context
        }

        bind() {
            const e = new r.Parser, t = this.socket;
            t.on("data", t => {
                e.feed(t)
            }), t.on("connect", () => {
                this.emit("connect")
            }), t.on("end", () => {
                o.information("socket is ended"), this.socket = null, this.emit("end")
            }), t.on("error", e => {
                this.socket = null, this.emit("error", e)
            }), e.on("message", e => {
                this.emit("message", e)
            }), this.parser = e
        }

        send(e) {
            if (this.socket) try {
                this.socket.write(this.parser.encode(e))
            } catch (e) {
                o.error(e.message)
            } else o.information("This socket has been ended by the other party", this.context && this.context.name)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(93), a = i(19), o = i(115), r = i(431), s = i(55);
    t.Client = class extends a.EventEmitter {
        constructor(e) {
            if (e = e || {}, super(), this.inprocess = !1, this.context = void 0, e.context && (this.context = Object.assign({}, e.context), this.context.productId = e.socketPrex), e.socket) this.socket = e.socket, this.bind(); else if (global.__xdasIPCServer && global.__xdasIPCServer.getProductId().toLowerCase() === e.socketPrex.toLowerCase()) this.inprocess = !0; else {
                let t = s.getSockPath(e.socketPrex);
                this.socket = n.connect(t), this.bind()
            }
        }

        isInprocess() {
            return this.inprocess
        }

        getContext() {
            return this.context
        }

        bind() {
            const e = new r.Parser, t = this.socket;
            t.on("data", t => {
                e.feed(t)
            }), t.on("connect", () => {
                this.emit("connect")
            }), t.on("end", () => {
                o.information("socket is ended"), this.socket = null, this.emit("end")
            }), t.on("error", e => {
                this.socket = null, this.emit("error", e)
            }), e.on("message", e => {
                this.emit("message", e)
            }), this.parser = e
        }

        send(e) {
            if (this.socket) try {
                this.socket.write(this.parser.encode(e))
            } catch (e) {
                o.error(e.message)
            } else o.information("This socket has been ended by the other party", this.context && this.context.name)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(59), o = (i(45), i(2)), r = i(4);
    let s = null;
    const l = i(10), d = i(18), u = i(0), c = i(7), h = i(33), f = i(11), g = "xdas_profile_stat";
    let p = "", v = void 0, m = null, y = void 0, k = null,
        T = c.default(o.join(__rootDir, "../bin/ThunderHelper.node")), w = new Set;

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

    function S(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 I(e) {
        return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
    }

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

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

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

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

    !function (e) {
        e.init = function (e) {
            p = e
        }, e.trackColdStartUpEvent = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = T.iSColdStartUp() ? 1 : 0, i = a.release(), n = T.performanceMonitorReporter.getProcessUptime(),
                    o = yield _(), r = `key=${e},start_type=${o},cold_start_up=${t},os_version=${i},cost_time=${n}`;
                l.XLStatNS.trackEvent(g, "cold_start_up", "", 0, 0, 0, 0, r)
            })
        }
    }(t.PerformanceMonitorStatNS || (t.PerformanceMonitorStatNS = {})), function () {
        return n(this, void 0, void 0, function* () {
            if (process.on("uncaughtException", e => {
                console.error(e);
                let t = e || {};
                D("uncaughtException", t.code, t.message, t.stack).catch()
            }), "browser" === process.type) process.on("unhandledRejection", (e, t) => {
                A(e)
            }), d.ipcMain.on(h.ThunderChannelList.channelRMGetBrowserStartType, function (e) {
                return n(this, void 0, void 0, function* () {
                    let t = yield _();
                    e.sender.send(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, t)
                })
            }); else if ("browser" !== process.type) {
                window.addEventListener("unhandledrejection", e => {
                    A(e && e.reason || {})
                });
                let e = yield f.asyncRemoteCall.getCurrentWebContents();
                null !== e && void 0 !== e && e.once("did-finish-load", () => {
                    (function () {
                        return n(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 = T.iSColdStartUp() ? 1 : 0, t = a.release(), i = window.performance.timing,
                                    n = i.loadEventEnd - i.navigationStart, o = i.fetchStart - i.navigationStart,
                                    r = i.domainLookupEnd - i.domainLookupStart, s = i.connectEnd - i.connectStart,
                                    d = i.responseStart - i.requestStart, u = i.responseEnd - i.responseStart,
                                    c = i.domComplete - i.domLoading, h = yield _();
                                l.XLStatNS.trackEvent(g, "page_load_time", "", 0, 0, 0, 0, `start_type=${h},cold_start_up=${e},os_version=${t},load_time=${n},before_fetch_time=${o},domin_lookup_time=${r},connect_time=${s},first_response_time=${d},responseTime=${u},domTime=${c},process=${p}`)
                            } while (0)
                        })
                    })().catch()
                })
            }
            u.default.hook("beforeLog", (e, t, ...i) => {
                e === u.LogLevel.Critical && l.XLStatNS.trackEvent(g, "critical_error", "", 0, 0, 0, 0, `module_name=${t},messages=${i}`)
            })
        })
    }().catch()
}, function (e, t, i) {
    "use strict";
    const n = i(94);
    if ("renderer" === process.type) {
        if (n.info("client running"), !global.__xdasAsyncRemoteExports) {
            let e = {};
            global.__xdasAsyncRemoteExports = e;
            let t = i(518);
            e.require = t.remoteRequire, e.getCurrentWebContents = t.getCurrentWebContents, e.getCurrentWindow = t.getCurrentWindow, e.Interest = t.Interest, e.global = new Proxy({}, {get: (e, i, n) => t.getGlobal(i)}), e.electron = new Proxy({}, {get: (e, i, n) => t.getBuiltin(i)}), Object.defineProperty(e, "currentWindow", {get: () => t.getCurrentWindow()}), Object.defineProperty(e, "currentWebContents", {get: () => t.getCurrentWebContents()}), Object.defineProperty(e, "process", {get: () => t.getGlobal("process")}), Object.defineProperty(e, "webContents", {get: () => t.getWebContents()})
        }
    } else if ("browser" === process.type && (n.info("server running"), !global.__xdasAsyncRemoteExports)) {
        let e = {};
        global.__xdasAsyncRemoteExports = e;
        const t = i(522);
        t.startServer(), e.getObjectRegistry = t.getObjectRegistry
    }
    e.exports = global.__xdasAsyncRemoteExports
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.getWebContents = t.getCurrentWebContents = t.getCurrentWindow = t.getGlobal = t.getBuiltin = t.remoteRequire = t.Interest = void 0;
    const n = i(18), a = i(116), o = i(519), r = i(520), s = i(433), l = i(521), d = i(94), u = i(434),
        c = n.ipcRenderer, h = process.electronBinding("v8_util"), f = new o.default, g = h.createIDWeakMap(),
        p = h.getHiddenValue(global, "contextId");

    class v {
        constructor(e) {
            if ("object" == typeof e ? (this.on = "object" == typeof e.on ? e.on : {}, this.once = "object" == typeof e.once ? e.once : {}) : (this.on = {}, this.once = {}), !this.check()) throw new Error("unexpected param")
        }

        check() {
            let e = !0;
            do {
                let t = Object.getOwnPropertyNames(this.on);
                if (t.forEach(t => {
                    "function" != typeof this.on[t] && (e = !1)
                }), !e) break;
                (t = Object.getOwnPropertyNames(this.once)).forEach(t => {
                    "function" != typeof this.once[t] && (e = !1)
                })
            } while (0);
            return e
        }
    }

    function m(e, t = new Set) {
        const i = e => {
            if (t.has(e)) return {type: "value", value: null};
            let n = e;
            if (Array.isArray(e)) {
                t.add(e);
                let i = {type: "array", value: m(e, t)};
                return t.delete(e), i
            }
            if (ArrayBuffer.isView(n)) return {type: "buffer", value: a.Buffer.from(e)};
            if (e instanceof Date) return {type: "date", value: e.getTime()};
            if (null != e && "object" == typeof e) {
                if (u.isPromise(e)) return {
                    type: "promise", then: i(function (t, i) {
                        e.then(t, i)
                    })
                };
                if (h.getHiddenValue(e, "__remote_id__")) return {
                    type: "remote-object",
                    id: h.getHiddenValue(e, "__remote_id__")
                };
                let n = {
                    type: e instanceof v ? "interest" : "object",
                    name: e.constructor ? e.constructor.name : "",
                    members: []
                };
                t.add(e);
                for (let t in e) n.members.push({name: t, value: i(e[t])});
                return t.delete(e), n
            }
            if ("function" == typeof e) {
                return {
                    type: "function",
                    id: f.add(e),
                    location: h.getHiddenValue(e, "__remote_call_location__"),
                    length: e.length
                }
            }
            return {type: "value", value: e}
        };
        return e.map(i)
    }

    function y(e, t, i) {
        u.isPromise(e) ? e.then(e => {
            t(e)
        }, e => {
            i(e)
        }) : t(e)
    }

    function k(e, t, i, n = !1) {
        const a = t => {
            if (e.hasOwnProperty(t.name) && !n) return;
            let i, a = {enumerable: t.enumerable, configurable: !0};
            if ("method" === t.type) {
                if (t.value.refId) {
                    if (g.has(t.value.refId) && (i = g.get(t.value.refId)), null == i) throw new Error("member refId pointer to null" + t.value.refId + "name: " + t.name)
                } else i = S(t.value, e, t.name);
                a.get = (() => i), a.set = (e => i = e)
            } else "get" === t.type && (a.get = (() => i), t.writable && (a.set = (e => {
                i = e
            })), i = S(t.value));
            Object.defineProperty(e, t.name, a)
        };
        if (Array.isArray(i)) {
            let e = i.length;
            for (let t = 0; t < e; t++) a(i[t])
        }
    }

    function T(e, t, i) {
        if (i) {
            let t = S(i);
            Object.setPrototypeOf(e, t)
        }
    }

    function w(e, t) {
        h.setHiddenValue(e, "__remote_id__", t)
    }

    function C(e) {
        return h.getHiddenValue(e, "__remote_id__")
    }

    function S(e, t, i) {
        const n = {
            value: () => e.value,
            array: () => e.members.map(e => S(e)),
            buffer: () => a.Buffer.from(e.value),
            promise: () => Promise.resolve({then: S(e.then)}),
            error: () => (function (e) {
                const t = (() => "error" === e.type ? new Error : {})();
                for (let i = 0; i < e.members.length; i++) {
                    let {name: n, value: a} = e.members[i];
                    t[n] = a
                }
                return t
            })(e),
            date: () => new Date(e.value),
            exception: () => {
                throw new Error(`${e.message}\n${e.stack}`)
            }
        };
        let o;
        return e.type in n ? o = n[e.type]() : e.refId ? g.has(e.refId) ? (h.addRemoteObjectRef(p, e.refId), o = g.get(e.refId)) : (d.warn("[metaToValue] refId point to null" + e.refId), o = "function" === e.type ? () => {
        } : {}) : e.id ? g.has(e.id) ? (h.addRemoteObjectRef(p, e.id), k(o = g.get(e.id), e.id, e.members, !0), T(o, e.id, e.proto)) : (o = "function" === e.type ? t ? function (e, t, i) {
            if (g.has(i.id)) return g.get(i.id);
            let n = C(e), a = function (...e) {
                throw Error("never should come to a proxied function")
            };
            Object.defineProperty(a, "name", {value: t, writable: !1, enumerable: !0});
            let o = new Proxy(a, {
                apply: (e, i, a) => new Promise((e, o) => {
                    let d = C(i);
                    if (d || (d = C(i.__remoteObj_)), !d) throw Error("is this function was a bound function?");
                    let u = s.default.browser.memberCall, h = l.default(u), f = m(a);
                    c.send(u, p, h, d, n, t, f), r.default.add(h, t => {
                        try {
                            y(S(t), e, o)
                        } catch (e) {
                            o(e)
                        }
                    })
                }), construct: (e, i, a) => new Promise((e, a) => {
                    let o = s.default.browser.memberConstruct, d = l.default(o);
                    c.send(o, p, d, n, t, m(i)), r.default.add(d, t => {
                        try {
                            let i = S(t);
                            e(i)
                        } catch (e) {
                            a(e)
                        }
                    })
                })
            });
            return h.setHiddenValue(a, "__remote_id__", i.id), o
        }(t, i, e) : function (e) {
            let t = e.id;
            const i = function (...e) {
                throw new Error("Should Never com to a remoteFunction PlaceHolder")
            };
            return w(i, t), new Proxy(i, {
                apply: (e, i, n) => new Promise((e, a) => {
                    let o = s.default.browser.functionCall, d = l.default(o), u = C(i);
                    c.send(o, p, d, u, t, m(n)), r.default.add(d, t => {
                        try {
                            y(S(t), e, a)
                        } catch (e) {
                            a(e)
                        }
                    })
                }), construct: (e, i, n) => new Promise((e, n) => {
                    let a = s.default.browser.construct, o = l.default(a);
                    c.send(a, p, o, t, m(i)), r.default.add(o, t => {
                        try {
                            let i = S(t);
                            e(i)
                        } catch (e) {
                            n(e)
                        }
                    })
                })
            })
        }(e) : {}, h.setRemoteObjectFreer(o, p, e.id), g.set(e.id, o), h.setHiddenValue(o, "__remote_id__", e.id), h.addRemoteObjectRef(p, e.id), function (e) {
            let t = C(e);
            Object.defineProperties(e, {
                __set: {
                    enumerable: !1, writable: !1, value: function (i, n) {
                        if ("function" == typeof n) throw new Error("set a function to a remote member is dangerous");
                        return new Promise((a, o) => {
                            let d = s.default.browser.memberSet, u = l.default(d), h = m([n]);
                            c.send(d, p, u, t, i, h), r.default.add(u, t => {
                                try {
                                    let r = S(t);
                                    e[i] = n, a(r)
                                } catch (e) {
                                    o(e)
                                }
                            })
                        })
                    }
                }, __get: {
                    enumerable: !1, writable: !1, value: function (i) {
                        return new Promise((n, a) => {
                            let o = s.default.browser.memberGet, d = l.default(o);
                            c.send(o, p, d, t, i), r.default.add(d, t => {
                                try {
                                    const o = S(t);
                                    e[i] = o, n(o)
                                } catch (e) {
                                    a(e)
                                }
                            })
                        })
                    }
                }, __sync: {
                    enumerable: !1, writable: !1, value: function () {
                        return new Promise((e, i) => {
                            let n = s.default.browser.sync, a = l.default(n);
                            c.send(n, p, a, t), r.default.add(a, n => {
                                try {
                                    if (n.id !== t) throw Error("SYNC_RETURN: remote id not match");
                                    let a = S(n);
                                    e(a)
                                } catch (e) {
                                    i(e)
                                }
                            })
                        })
                    }
                }
            })
        }(o), k(o, e.id, e.members), T(o, e.id, e.proto), Object.defineProperty(o.constructor, "name", {value: e.name}), e.extendedMemberNames && e.extendedMemberNames.forEach((e, t) => {
            let i = o[e], n = o.__proto__;
            for (; n;) {
                if (Object.prototype.hasOwnProperty.call(n, e)) {
                    delete n[e];
                    break
                }
                n = n.__proto__
            }
            Object.defineProperty(o, e, {value: i, enumerable: !1, writable: !1, configurable: !0})
        })) : d.error("no id of meta:", e), o
    }

    t.Interest = v;

    class I {
        constructor(...e) {
            if (this.__resolved_ = !1, this.__promise_ = null, this.__remoteObj_ = null, this.__what_ = "", this.__name_ = "", "string" === typeof arguments[0]) {
                let e = arguments[0], t = arguments[1];
                this.__what_ = e, this.__name_ = t || e, this.__resolved_ = !1, this.__remoteObj_ = null, this.__promise_ = new Promise((i, n) => {
                    let a = this.getChannel(e), o = l.default(a);
                    c.send(a, p, o, t), r.default.add(o, e => {
                        try {
                            let t = S(e);
                            this.__remoteObj_ = t, this.__resolved_ = !0, i(t)
                        } catch (e) {
                            n(e)
                        }
                    })
                })
            } else this.__remoteObj_ = arguments[0], this.__resolved_ = !0, this.__promise_ = null
        }

        getChannel(e) {
            let t = "";
            switch (e) {
                case"module":
                    t = s.default.browser.require;
                    break;
                case"builtin":
                    t = s.default.browser.builtIn;
                    break;
                case"global":
                    t = s.default.browser.global;
                    break;
                case"current_window":
                    t = s.default.browser.currentWindow;
                    break;
                case"current_web_contents":
                    t = s.default.browser.currentWebContents;
                    break;
                case"client_web_contents":
                    t = s.default.browser.clientWebContents;
                    break;
                case"web_contents":
                    t = s.default.browser.webContents
            }
            return t
        }

        __resolve() {
            let e = this.__promise_;
            if (null !== e) ; else {
                if (!this.__resolved_) throw Error("missing the promise for ayncnomously get remote object");
                e = new Promise((e, t) => {
                    e(this.__remoteObj_)
                }), this.__promise_ = e
            }
            return e
        }

        __isResolved() {
            return this.__resolved_
        }
    }

    function b(e, t, i) {
        try {
            r.default.invoke(t, i).remove(t)
        } finally {
            r.default.remove(t)
        }
    }

    c.on(s.default.renderer.requireReturn, b), c.on(s.default.renderer.getBuiltInReturn, b), c.on(s.default.renderer.getGlobalReturn, b), c.on(s.default.renderer.currentWindowReturn, b), c.on(s.default.renderer.currentWebContentsReturn, b), c.on(s.default.renderer.functionCallReturn, b), c.on(s.default.renderer.constructReturn, b), c.on(s.default.renderer.memberCallReturn, b), c.on(s.default.renderer.memberSetReturn, b), c.on(s.default.renderer.memberGetReturn, b), c.on(s.default.renderer.memberConstructReturn, b), c.on(s.default.renderer.callback, (e, t, i) => {
        f.apply(t, S(i))
    }), c.on(s.default.renderer.syncReturn, b), c.on("ELECTRON_RENDERER_RELEASE_CALLBACK", (e, t) => {
        d.info("[RELEASE_CALLBACK]: callbackId:", t), f.remove(t)
    }), process.on("exit", () => {
        c.send(s.default.browser.contextRelease)
    });
    const _ = ["__resolve", "__isResolved"], D = ["__promise_", "__resolved_", "__remoteObj_", "__name_", "__what_"],
        A = e => {
            if (!e.__isResolved()) throw Error("Can not access the property of a remote module which has not Resolved yet.")
        };

    function N(e) {
        const t = function () {
        };
        Object.defineProperty(t, "name", {value: e.__name_}), Object.defineProperty(t, "what", {
            enumerable: !1,
            value: e.__what_
        });
        let i = new Proxy(t, {
            getPrototypeOf: t => (A(e), Reflect.getPrototypeOf(e.__remoteObj_)),
            setPrototypeOf: (e, t) => {
                throw new Error("changing prototype of remote object is forbidden")
            },
            isExtensible: t => (A(e), Reflect.isExtensible(e.__remoteObj_)),
            preventExtensions: t => (A(e), Reflect.preventExtensions(e)),
            getOwnPropertyDescriptor: (t, i) => (A(e), Reflect.getOwnPropertyDescriptor(e.__remoteObj_, i)),
            has: (t, i) => (A(e), Reflect.has(e.__remoteObj_, i)),
            deleteProperty: (t, i) => (A(t), Reflect.deleteProperty(e.__remoteObj_, i)),
            defineProperty: (t, i, n) => (A(e), Reflect.defineProperty(e.__remoteObj_, i, n)),
            get: (t, i, n) => {
                if ("string" == typeof i) {
                    if (String.prototype.includes.call(D, i)) {
                        return e[i]
                    }
                    if (String.prototype.includes.call(_, i)) {
                        return e[i]
                    }
                }
                return A(e), Reflect.get(e.__remoteObj_, i)
            },
            set: (t, i, n, a) => (A(e), Reflect.set(e.__remoteObj_, i, n, a)),
            ownKeys: t => (A(e), Reflect.ownKeys(e.__remoteObj_)),
            apply: (t, i, n) => {
                A(e), Reflect.apply(e.__remoteObj_, i, n)
            },
            construct: (t, i, n) => {
                if (A(e), "function" != typeof e.__remoteObj_) throw Error("operator new ONLY used for function");
                return new Promise((t, n) => {
                    let a = s.default.browser.construct, o = l.default(a),
                        d = h.getHiddenValue(e.__remoteObj_, "__remote_id__");
                    c.send(a, p, o, d, m(i)), r.default.add(o, e => {
                        try {
                            t(S(e))
                        } catch (e) {
                            n(e)
                        }
                    })
                })
            }
        });
        return e.__promise_.then(e => {
            let t = typeof e;
            if ("function" === t || "object" === t) {
                let t = C(e);
                t && w(i, t)
            }
        }), i
    }

    t.remoteRequire = function (e) {
        return N(new I("module", e))
    }, t.getBuiltin = function (e) {
        return N(new I("builtin", e))
    }, t.getGlobal = function (e) {
        return N(new I("global", e))
    }, t.getCurrentWindow = function () {
        return N(new I("current_window"))
    }, t.getCurrentWebContents = function () {
        return N(new I("current_web_contents"))
    }, t.getWebContents = function () {
        return N(new I("web_contents"))
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = process.electronBinding("v8_util");
    t.default = class {
        constructor() {
            this.nextId = 0, this.callbacks = {}
        }

        add(e) {
            let t = n.getHiddenValue(e, "__remote_callback_id__");
            if (null != t) return t;
            t = this.nextId -= 1;
            const i = /at (.*)/gi, a = (new Error).stack;
            let o, r = i.exec(a);
            for (; null !== r;) {
                const e = r[1];
                if (!e.includes("native") && !e.includes("electron.asar")) {
                    o = /([^/^)]*)\)?$/gi.exec(e)[1];
                    break
                }
                r = i.exec(a)
            }
            return this.callbacks[t] = e, n.setHiddenValue(e, "__remote_callback_id__", t), n.setHiddenValue(e, "__remote_call_location__", o), t
        }

        get(e) {
            return this.callbacks[e] || function () {
            }
        }

        apply(e, ...t) {
            return this.get(e).apply(global, ...t)
        }

        remove(e) {
            const t = this.callbacks[e];
            t && (n.deleteHiddenValue(t, "__remote_callback_id__"), delete this.callbacks[e])
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(94);
    var a;
    !function (e) {
        let t = {};
        e.add = function (e, i, n) {
            t[e] = {func: i, thisArg: n}
        }, e.invoke = function (i, ...a) {
            let o = t[i];
            return o ? o.thisArg ? o.func.apply(o.thisArg, ...a) : o.func(...a) : n.error(`Cannot invoke function by unrecognize id. ${i}`), e
        }, e.remove = function (e) {
            delete t[e]
        }
    }(a || (a = {})), t.default = a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    let n = 0;
    t.default = function (e) {
        return e ? e.concat(".").concat(String(++n)) : String(++n)
    }
}, function (e, t, i) {
    "use strict";
    const n = i(18), a = i(523), o = i(433), r = i(524), s = i(94), l = i(434), d = n.ipcMain,
        u = process.electronBinding("v8_util");
    let c = u.createDoubleIDWeakMap();
    const h = new a.default;

    function f(e, t, i, n, a, o) {
        let r, l = !1, d = null, u = !1;
        do {
            try {
                r = t[n]
            } catch (e) {
                l = !0
            }
            if (l) try {
                r = i.value[n], l = !1, i.meta.extendedMemberNames.push(n), u = !0
            } catch (e) {
                s.error(`property ${n} untouchable, even try root[name]`)
            }
            if (l) break;
            let a = Object.getOwnPropertyDescriptor(t, n);
            if (void 0 === a) {
                s.warn(`descriptor of property ${n} is undefined`);
                break
            }
            d = {
                name: n,
                enumerable: a.enumerable,
                writable: !1,
                type: "get"
            }, void 0 === a.get && "function" == typeof r ? d.type = "method" : ((a.set || a.writable) && (d.writable = !0), d.type = "get"), u ? (d.configurable = !0, d.value = v(e, r, o, !1, null)) : d.value = v(e, r, o, !1, i)
        } while (0);
        return d
    }

    function g(e, t, i, n = null) {
        let a = Object.getOwnPropertyNames(t);
        "function" == typeof t && (a = a.filter(function (e) {
            return !String.prototype.includes.call(r.propertiesOfFunction, e)
        }));
        let o = [];
        do {
            if (0 === a.length) break;
            let r = a.length;
            for (let s = 0; s < r; s++) {
                let r = f(e, t, i, a[s], 0, n);
                r && o.push(r)
            }
        } while (0);
        return o
    }

    function p(e, t, i, n = null) {
        let a = null, o = Object.getPrototypeOf(t);
        return a = null === o || o === Object.prototype || o === Function.prototype ? null : v(e, o, n, !1, i)
    }

    function v(e, t, i = null, n = !1, a = null) {
        i = null === i ? {} : i;
        const o = {type: typeof t};
        "object" === o.type && (o.type = function (e, t) {
            let i = typeof e;
            if ("object" !== i) throw new Error("incorrect arg at index 0. non-object");
            return null === e ? i = "value" : ArrayBuffer.isView(e) ? i = "buffer" : Array.isArray(e) ? i = "array" : e instanceof Error ? i = "error" : e instanceof Date ? i = "date" : l.isPromise(e) ? i = "promise" : Object.prototype.hasOwnProperty.call(e, "callee") && null != e.length ? i = "array" : t && u.getHiddenValue(e, "simple") && (i = "value"), i
        }(t, n));
        do {
            if ("object" === o.type || "function" === o.type) {
                let n = h.getIdOfObject(t);
                if (n && i[n]) {
                    o.refId = n, h.add(e, t);
                    break
                }
            }
            "array" === o.type ? o.members = t.map(t => v(e, t, i)) : "object" === o.type || "function" === o.type ? (null == a && (o.extendedMemberNames = [], a = {
                value: t,
                meta: o
            }), o.name = t.constructor ? t.constructor.name : "", o.id = h.add(e, t), i[o.id] = !0, o.members = g(e, t, a, i), o.proto = p(e, t, a, i)) : "buffer" === o.type ? o.value = Buffer.from(t) : "promise" === o.type ? (t.then(function () {
            }, function () {
            }), o.then = v(e, function (e, i) {
                t.then(e, i)
            })) : "error" === o.type ? (o.members = m(t), o.members.push({
                name: "name",
                value: t.name
            })) : "date" === o.type ? o.value = t.getTime() : (o.type = "value", o.value = t)
        } while (0);
        return o
    }

    function m(e) {
        return Object.getOwnPropertyNames(e).map(t => ({name: t, value: e[t]}))
    }

    function y(e, t, i, a) {
        const r = function (a) {
            let l, d, f = 0, g = 0;
            switch (a.type) {
                case"value":
                    return a.value;
                case"remote-object":
                    return h.get(a.id);
                case"array":
                    return y(e, t, i, a.value);
                case"buffer":
                    return Buffer.from(a.value);
                case"date":
                    return new Date(a.value);
                case"promise":
                    return Promise.resolve({then: r(a.then)});
                case"object":
                case"interest": {
                    let e = {};
                    for (Object.defineProperty(e.constructor, "name", {value: a.name}), f = 0, g = (d = a.members).length; f < g; f++) e[(l = d[f]).name] = r(l.value);
                    return e
                }
                case"function": {
                    const r = e.id, l = [i, a.id];
                    if (s.info("renderer function id:" + l), c.has(l)) return c.get(l);
                    let d = function (...t) {
                        s.info("[CALLBACK] args", t);
                        let i = [...t];
                        e.isDestroyed() || r !== e.id ? function (e, t, i) {
                            let a = "Attempting to call a function in a renderer window that has been closed or released." + `\nFunction provided here: ${e.location}`;
                            if (t.length > 0 && t[0].sender && t[0].sender instanceof n.webContents.constructor) {
                                const {sender: e} = t[0], n = e.eventNames().filter(t => {
                                    let n = e.listeners(t), a = !1;
                                    return n.forEach(e => {
                                        e === i && (a = !0)
                                    }), a
                                });
                                n.length > 0 && (a += `\nRemote event names: ${n.join(", ")}`, n.forEach(t => {
                                    Object.getPrototypeOf(e).removeListener.call(e, t, i)
                                }))
                            }
                            s.warn(a)
                        }(a, i, d) : e.send(o.default.renderer.callback, a.id, v(e, i))
                    };
                    return Object.defineProperty(d, "length", {value: a.length}), u.setRemoteCallbackFreer(d, t, i, a.id, e), c.set(l, d), d
                }
                default:
                    throw new TypeError(`Unknown type: ${a.type}`)
            }
        };
        return a.map(r)
    }

    function k(e, t, i, n) {
        let a, o;
        try {
            return t.apply(i, n)
        } catch (e) {
            return o = t.name, new Error(`Could not call remote function '${a = null != o ? o : "anonymous"}'. Check that the function signature is correct. Underlying error: ${e.message}`)
        }
    }

    function T(e) {
        return {type: "exception", message: e.message, stack: e.stack || e}
    }

    function w(e) {
        const t = new Error(e);
        throw Object.defineProperty(t, "code", {value: "EBADRPC"}), Object.defineProperty(t, "errno", {value: -72}), t
    }

    var C;
    !function (e) {
        const t = (e, t, ...i) => {
            const n = e.sender;
            n.isDestroyed() ? s.warn("webcontext is destroyed.") : n.send(t, ...i)
        };
        e.startServer = function () {
            d.on(o.default.browser.require, (e, i, n, a) => {
                s.info(`[REQUIRE] module=${a} `);
                let r = process.mainModule.require(a), l = v(e.sender, r);
                t(e, o.default.renderer.requireReturn, n, l)
            }), d.on(o.default.browser.builtIn, (e, i, a, r) => {
                s.info(`[BUILTIN]: property=${r} contextId=${i}`);
                let l = n[r], d = v(e.sender, l);
                s.info(`[BUILTIN]: returns remoteId:${d.id}, type: ${typeof l}`), t(e, o.default.renderer.getBuiltInReturn, a, d)
            }), d.on(o.default.browser.global, (e, i, n, a) => {
                s.info(`[GLOBAL]: proerty:${a} contextId=${i}`);
                let r, l = global[a];
                r = v(e.sender, l), s.info(`[GLOBAL]: returns remoteid=${r.id}, obj=` + typeof l), t(e, o.default.renderer.getGlobalReturn, n, r)
            }), d.on(o.default.browser.currentWindow, (e, i, n, a) => {
                s.info(`[CURRENT_WINDOW]: property=${a} contextId=${i}`);
                let r = e.sender.getOwnerBrowserWindow.call(e.sender), l = v(e.sender, r);
                s.info(`[CURRENT_WINDOW]: returns remoteid=${l.id}, obj=` + r), t(e, o.default.renderer.currentWindowReturn, n, l)
            }), d.on(o.default.browser.currentWebContents, (e, i, n, a) => {
                t(e, o.default.renderer.currentWebContentsReturn, n, v(e.sender, e.sender))
            }), d.on(o.default.browser.webContents, (e, i, a, r) => {
                s.info(`[WebContents]: proerty:${r} contextId=${i}`);
                let l, d = n.webContents;
                l = v(e.sender, d), s.info(`[WebContents]: returns remoteid=${l.id}, obj=` + typeof d), t(e, o.default.renderer.webContentsReturn, a, l)
            });
            const e = (e, t) => {
                const i = (t, i) => {
                    t && Object.getOwnPropertyNames(t).forEach(n => {
                        i ? e.once(n, t[n]) : e.on(n, t[n])
                    })
                };
                t.on && i(t.on, !1), t.once && i(t.once, !0)
            };
            d.on(o.default.browser.construct, (i, n, a, r, l) => {
                let d, u = null;
                try {
                    s.info(`[CONSTRUCTOR]: remoteId=${r} `);
                    let c = l.length > 0 ? l[l.length - 1] : null;
                    l = y(i.sender, i.frameId, n, l);
                    let f = h.get(r);
                    null == f && w(`Cannot call constructor on missing remote object ${r}`), c && "interest" === c.type && (u = l.pop());
                    let g = new (Function.prototype.bind.apply(f, [null, ...l]));
                    g && u && e(g, u), d = v(i.sender, g, null, !1), s.info(`[CONSTRUCTOR]: returns remoteId =${d.id} name=${f.name} `)
                } catch (e) {
                    d = T(e)
                } finally {
                    t(i, o.default.renderer.constructReturn, a, d)
                }
            }), d.on(o.default.browser.functionCall, function (e, i, n, a, r, l) {
                let d;
                try {
                    s.info(`[FUNCTION_CALL]: remoteId=${r}`), l = y(e.sender, e.frameId, i, l);
                    let u = h.get(r);
                    if (null == u) s.error(`Cannot call function on missing remote object ${r}`), d = v(e.sender, void 0); else {
                        let t = a ? h.get(a) : global;
                        if (t) {
                            let i = k(0, u, t, l);
                            d = v(e.sender, i)
                        } else s.error(`Cannot call function(${r}) on missing context(${a})`), d = v(e.sender, void 0)
                    }
                    s.info(`[FUNCTION_CALL]: name=${u.name}`)
                } catch (e) {
                    d = T(e)
                } finally {
                    t(e, o.default.renderer.functionCallReturn, n, d)
                }
            }), d.on(o.default.browser.memberCall, function (e, i, n, a, r, l, d) {
                let u;
                s.info(`[MEMBER_CALL]: thisArg=${a}, remoteId=${r}, method=${l}, args count=${d.length}`);
                try {
                    d = y(e.sender, e.frameId, i, d);
                    let c = h.get(r);
                    null == c && w(`Cannot call function '${l}' on missing remote object ${r}`);
                    let f = a ? h.get(a) : c;
                    if (f) {
                        let t = k(0, c[l], f, d);
                        u = v(e.sender, t), s.info("[MEMBER_CALL]: return=" + t)
                    } else u = v(e.sender, void 0)
                } catch (e) {
                    u = T(e)
                } finally {
                    t(e, o.default.renderer.memberCallReturn, n, u)
                }
            }), d.on(o.default.browser.memberGet, function (e, i, n, a, r) {
                let l;
                try {
                    s.info(`[MEMBER_GET]: remoteId=${a}, property=`, r);
                    let i = h.get(a);
                    null == i && w(`Cannot get property '${Object.toString.call(r)}' on missing remote object ${a}`);
                    let d = i[r];
                    l = v(e.sender, d)
                } catch (e) {
                    l = T(e)
                } finally {
                    t(e, o.default.renderer.memberGetReturn, n, l)
                }
            }), d.on(o.default.browser.memberSet, function (e, i, n, a, r, l) {
                try {
                    s.info(`[MEMBER_SET]: remoteId=${a}, property=` + r), l = y(e.sender, e.frameId, i, l);
                    let d = h.get(a);
                    null == d && w(`Cannot set property '${Object.toString.call(r)}' on missing remote object ${a}`), d[r] = l[0], t(e, o.default.renderer.memberSetReturn, n, {
                        type: "value",
                        value: !0
                    })
                } catch (i) {
                    t(e, o.default.renderer.memberSetReturn, n, T(i))
                }
            }), d.on(o.default.browser.memberConstruct, function (i, n, a, r, l, d) {
                let u, c = null;
                try {
                    s.info(`[MEMBER_CONSTRUCTOR]: regId=${r}, method=${l}`);
                    let f = d.length > 0 ? d[d.length - 1] : null;
                    d = y(i.sender, i.frameId, n, d);
                    let g = h.get(r);
                    null == g && w(`Cannot call constructor '${l}' on missing remote object ${r}`), f && "interest" === f.type && (c = d.pop());
                    let p = g[l], m = new (Function.prototype.bind.apply(p, [null, ...d]));
                    m && c && e(m, c), u = v(i.sender, m)
                } catch (e) {
                    u = T(e)
                } finally {
                    t(i, o.default.renderer.memberConstructReturn, a, u)
                }
            }), d.on(o.default.browser.sync, function (e, i, n, a) {
                let r = h.get(a);
                t(e, o.default.renderer.syncReturn, n, v(e.sender, r))
            }), d.on("ELECTRON_BROWSER_DEREFERENCE", function (e, t) {
                let i = h.get(t);
                if (n.ipcMain.emit("log_to_renderer", "ELECTRON_BROWSER_DEREFERENCE", t, typeof i), i) {
                    let n = i.name;
                    n || (n = i.constructor ? i.constructor.name : ""), h.remove(e.sender.id, t)
                } else t < 0 && s.warn("remote id reference to nothing:", t)
            }), d.on(o.default.browser.contextRelease, e => {
                h.clear(e.sender.id)
            })
        }, e.getObjectRegistry = function () {
            return h
        }
    }(C || (C = {})), e.exports = C
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(94), a = -1 * Math.pow(2, 31), o = process.electronBinding("v8_util");
    t.default = class {
        constructor() {
            this.nextId = 0, this.storage = new Map, this.owners = new Map
        }

        add(e, t) {
            const i = this.saveToStorage(t), n = e.id;
            let a = this.owners.get(n);
            return a || (a = new Set, this.owners.set(n, a), this.registerDeleteListener(e, n)), a.has(i) || (a.add(i), this.storage.get(i).count++), i
        }

        getIdOfObject(e) {
            return o.getHiddenValue(e, "__remote_id__")
        }

        get(e) {
            const t = this.storage.get(e);
            if (void 0 !== t) return t.object
        }

        remove(e, t) {
            this.dereference(t);
            let i = this.owners.get(e);
            i && i.delete(t)
        }

        clear(e) {
            let t = this.owners.get(e);
            if (t) {
                for (let e of t) this.dereference(e);
                this.owners.delete(e)
            }
        }

        getStorageSize() {
            return this.storage.size
        }

        saveToStorage(e) {
            let t = o.getHiddenValue(e, "__remote_id__");
            if (!t) {
                if ((t = --this.nextId) <= a) throw new Error("object registry id overflow");
                this.storage.set(t, {object: e, count: 0}), o.setHiddenValue(e, "__remote_id__", t)
            }
            return t
        }

        dereference(e) {
            let t = this.storage.get(e);
            null != t && (t.count -= 1, 0 === t.count && (o.deleteHiddenValue(t.object, "__remote_id__"), this.storage.delete(e)))
        }

        registerDeleteListener(e, t) {
            const i = e.getProcessId(), a = (o, r) => {
                r === i && (n.info("render-view-deleted: processid=" + i), (() => {
                    n.info("before clear. objectsRegistry capacity=" + this.storage.size, "owners size:" + this.owners.size)
                })(), e.removeListener("render-view-deleted", a), this.clear(t))
            };
            e.on("render-view-deleted", a)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n;
    !function (e) {
        e.propertiesOfFunction = ["length", "name", "arguments", "caller", "prototype", "apply", "bind", "call", "toString"]
    }(n || (n = {})), e.exports = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(526), a = i(527), o = i(117);
    i(528);
    const r = i(529);
    i(530), i(873);
    const s = i(531), l = i(532);
    o.default.directive("visibility", n.default), o.default.directive("opacity", a.default), o.default.use(r.default), o.default.use(s), o.default.use(l.default)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        bind(e, {value: t}, i) {
            e.__vOriginalVisibility = e.style.visiblity, e.style.visibility = t ? "visible" : "hidden"
        }, update(e, {value: t, oldValue: i}, n) {
            t !== i && (e.style.visibility = t ? "visible" : "hidden")
        }, unbind(e, t, i, n, a) {
            a || (e.style.visiblity = e.__vOriginalVisibility)
        }
    };
    t.default = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        bind(e, {value: t}, i) {
            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: i}, n) {
            t !== i && (e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none")
        }, unbind(e, t, i, n, a) {
            a || (e.style.opacity = e.__vOriginalOpacity, e.style.pointerEvents = e.__vOriginalPointerEvents)
        }
    };
    t.default = n
}, function (e, t, i) {
    e.exports = i(58)(211)
}, function (e, t, i) {
    e.exports = i(58)(135)
}, function (e, t) {
    !function (e) {
        var t,
            i = '<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>',
            n = 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 i = function () {
                    document.removeEventListener("DOMContentLoaded", i, !1), t()
                };
                document.addEventListener("DOMContentLoaded", i, !1)
            } else document.attachEvent && function (e, t) {
                var i = e.document, n = !1, a = function () {
                    n || (n = !0, t())
                }, o = function () {
                    try {
                        i.documentElement.doScroll("left")
                    } catch (e) {
                        return void setTimeout(o, 50)
                    }
                    a()
                };
                o(), i.onreadystatechange = function () {
                    "complete" == i.readyState && (i.onreadystatechange = null, a())
                }
            }(e, t)
        }(function () {
            var e, t;
            (e = document.createElement("div")).innerHTML = i, i = 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", n(t, document.body))
        })
    }(window)
}, function (e, t, i) {
    e.exports = function (e) {
        function t(n) {
            if (i[n]) return i[n].exports;
            var a = i[n] = {i: n, l: !1, exports: {}};
            return e[n].call(a.exports, a, a.exports, t), a.l = !0, a.exports
        }

        var i = {};
        return t.m = e, t.c = i, t.i = function (e) {
            return e
        }, t.d = function (e, i, n) {
            t.o(e, i) || Object.defineProperty(e, i, {configurable: !1, enumerable: !0, get: n})
        }, t.n = function (e) {
            var i = e && e.__esModule ? function () {
                return e.default
            } : function () {
                return e
            };
            return t.d(i, "a", i), i
        }, 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, i) {
                var n = i.context.$refs[t.arg];
                n && n.addItem({el: e, value: t.value})
            }, unbind: function (e, t, i) {
                var n = i.context.$refs[t.arg];
                n && n.removeItem({el: e, value: t.value})
            }
        }
    }, function (e, t, i) {
        var n = i(5)(i(2), i(6), null, null, null);
        e.exports = n.exports
    }, function (e, t, i) {
        "use strict";
        Object.defineProperty(t, "__esModule", {value: !0});
        var n = i(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) || [],
                        i = this.secondDirection ? e.exec(this.secondDirection)[0] : "", n = t[0] || "";
                    return "" === i ? "popup-" + n : "popup-" + i
                }, 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 = i.i(n.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 i = 0, n = 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) ? (i = t.left + (t.width - e.width) / 2, "bottomStart" !== this.direction && "topStart" !== this.direction || (i = t.left), "bottomEnd" !== this.direction && "topEnd" !== this.direction || (i = t.left - e.width + t.width), i < 0 ? (i = 0, this.arrowStyle = {left: (t.left + t.right) / 2 + "px"}) : i + e.width > window.innerWidth ? (i = window.innerWidth - e.width, this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}) : this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}, "top" === this.direction || "topStart" === this.direction || "topEnd" === this.direction ? a < 0 && r + e.height <= window.innerHeight ? (n = r, this.secondDirection = "bottom", "topStart" === this.direction && (this.secondDirection = "bottomStart", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}), "topEnd" === this.direction && (this.secondDirection = "bottomEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"})) : (n = a, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}) : r + e.height > window.innerHeight && a >= 0 ? (n = a, this.secondDirection = "top", "bottomStart" === this.direction && (this.secondDirection = "topStart", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}), "bottomEnd" === this.direction && (this.secondDirection = "topEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"})) : (n = r, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"})) : /(left)|(right)/i.test(this.direction) && (n = t.top + (t.height - e.height) / 2, "leftStart" !== this.direction && "rightStart" !== this.direction || (n = t.top), "leftEnd" !== this.direction && "rightEnd" !== this.direction || (n = t.top - e.height + t.height), n < 0 ? (n = 0, this.arrowStyle = {top: (t.top + t.bottom) / 2 + "px"}) : n + e.height > window.innerHeight ? (n = window.innerHeight - e.height, this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}) : this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}, "left" === this.direction || "leftStart" === this.direction || "leftEnd" === this.direction ? s < 0 && o + e.width <= window.innerWidth ? (i = o, this.secondDirection = "right", "leftStart" === this.direction && (this.secondDirection = "rightStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}), "leftEnd" === this.direction && (this.secondDirection = "rightEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"})) : (i = s, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}) : o + e.width > window.innerWidth && s >= 0 ? (i = s, this.secondDirection = "left", "rightStart" === this.direction && (this.secondDirection = "leftStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}), "rightEnd" === this.direction && (this.secondDirection = "leftEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"})) : (i = o, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"})), this.top = n, this.left = i
                }, handleVisible: function (e, t, i) {
                    var n = this;
                    if ("click" === this.trigger && this.display && !0 !== i) 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 () {
                            n.computePosition(n.$el, n.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, i) {
        "use strict";
        t.a = function (e, t) {
            var i = this, n = 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 - n > t && (e.apply(i, o), n = s)
            }
        }
    }, function (e, t, i) {
        var n = i(0), a = i(1);
        a.install = function (e) {
            e.directive("popup", n), e.component(a.name, a)
        }, e.exports = a
    }, function (e, t) {
        e.exports = function (e, t, i, n, a) {
            var o, r = e = e || {}, s = typeof e.default;
            "object" !== s && "function" !== s || (o = e, r = e.default);
            var l, d = "function" == typeof r ? r.options : r;
            if (t && (d.render = t.render, d.staticRenderFns = t.staticRenderFns), n && (d._scopeId = n), 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__), i && i.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
            }, d._ssrRegister = l) : i && (l = i), l) {
                var u = d.functional, c = u ? d.render : d.beforeCreate;
                u ? d.render = function (e, t) {
                    return l.call(t), c(e, t)
                } : d.beforeCreate = c ? [].concat(c, l) : [l]
            }
            return {esModule: o, exports: r, options: d}
        }
    }, function (e, t) {
        e.exports = {
            render: function () {
                var e = this, t = e.$createElement, i = e._self._c || t;
                return i("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(" "), i("span", {
                    staticClass: "popup-arrow",
                    class: e.arrowClass,
                    style: e.arrowStyle
                })], 2)
            }, staticRenderFns: []
        }
    }])
}, function (e, t, i) {
    var n;
    n = function () {
        return function (e) {
            var t = {};

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

            return i.m = e, i.c = t, i.i = function (e) {
                return e
            }, i.d = function (e, t, n) {
                i.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: n})
            }, i.n = function (e) {
                var t = e && e.__esModule ? function () {
                    return e.default
                } : function () {
                    return e
                };
                return i.d(t, "a", t), t
            }, i.o = function (e, t) {
                return Object.prototype.hasOwnProperty.call(e, t)
            }, i.p = "", i(i.s = 3)
        }([function (e, t, i) {
            "use strict";
            t.a = function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = "", i = "";
                if (!e || 0 === e.length) return {isVip: !1};
                var n = e.filter(function (e) {
                    return e && 2 === (e.vasId || e.vasID)
                })[0];
                if (i = n.vIPLevel || n.VIPLevel || 0, n) {
                    var a = {2: "", 3: "p", 5: "s"}[n.vasType] || "";
                    return t = "vip-icon-" + a + "vip" + i, {
                        isVip: "1" === n.isVIP,
                        isStop: "2" === n.isVIP,
                        isYear: "1" === n.isYear,
                        type: n.vasType,
                        level: i,
                        vipClass: t
                    }
                }
                return {isVip: !1}
            }
        }, function (e, t, i) {
            "use strict";
            var n = i(4), a = i.n(n);
            a.a.install = function (e) {
                e.component(a.a.name, a.a)
            }, t.a = a.a
        }, function (e, t, i) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var n = i(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 i.i(n.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, i) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var n = i(1), a = i(0);
            i.d(t, "vipInfo", function () {
                return a.a
            });
            /**
             * vip
             * (c) 2018 shijianan
             * @license MIT
             */
            var o = {
                install: function (e, t) {
                    e.use(n.a), e.prototype.$vipInfo = function (e) {
                        return i.i(a.a)(e)
                    }
                }
            };
            t.default = o
        }, function (e, t, i) {
            var n = i(5)(i(2), i(6), null, null, null);
            n.options.__file = "/Users/nancy/Desktop/work/@xunlei/vip/src/vip-icon/VipIcon.vue", n.esModule && Object.keys(n.esModule).some(function (e) {
                return "default" !== e && "__" !== e.substr(0, 2)
            }) && console.error("named exports are not supported in *.vue files."), n.options.functional && console.error("[vue-loader] VipIcon.vue: functional components are not supported with templates, they should use render functions."), e.exports = n.exports
        }, function (e, t) {
            e.exports = function (e, t, i, n, a) {
                var o, r = e = e || {}, s = typeof e.default;
                "object" !== s && "function" !== s || (o = e, r = e.default);
                var l, d = "function" == typeof r ? r.options : r;
                if (t && (d.render = t.render, d.staticRenderFns = t.staticRenderFns), n && (d._scopeId = n), 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__), i && i.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
                }, d._ssrRegister = l) : i && (l = i), l) {
                    var u = d.functional, c = u ? d.render : d.beforeCreate;
                    u ? d.render = function (e, t) {
                        return l.call(t), c(e, t)
                    } : d.beforeCreate = c ? [].concat(c, l) : [l]
                }
                return {esModule: o, exports: r, options: d}
            }
        }, function (e, t, i) {
            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 = n()
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(4), s = i(6), l = i(3), d = i(30), u = i(534), c = i(536), h = i(538), f = i(539),
        g = i(95), p = i(15), v = i(43), m = i(26), y = i(436), k = i(47), T = i(7), w = i(39), C = i(51), S = i(34),
        I = o.default.getLogger("DownloadKernel.Task"), b = p.DownloadKernelEventManager.getEventManager(),
        _ = m.DownloadKernelCategoryManager.getCategoryManager(),
        D = T.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    var A;
    !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"
    }(A || (A = {}));
    t.Task = class {
        constructor() {
            this.taskId = 0, this.virtualTaskId = 0, this.isBackground = !1, this.taskType = l.DownloadKernel.TaskType.Unkown, this.preStatus = l.DownloadKernel.TaskStatus.Stopped, this.taskStatus = l.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.dcdnFileIndex = -1, this.taskStatusChangedReason = l.DownloadKernel.TaskStopReason.Unknown, this.batchSetTaskAttribute = !1, this.batchDetailChangedFlags = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.detailChangedFlags = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.nTotalAvailablePeer = 0, this.vipDownloadSizeCur = 0, this.bAcclerating = !1, this.shiftChannelSize = 0, this.resourceLegal = -1, this.downloadStrategy = l.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_NORMALDOWNLOAD, this.serverResourceInfos = new Map, this.attribute = new Map;
            for (let e = l.DownloadKernel.TaskAttribute.NumberStrart; e < l.DownloadKernel.TaskAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = l.DownloadKernel.TaskAttribute.BooleanStart; e < l.DownloadKernel.TaskAttribute.BooleanEnd; ++e) this.attribute.set(e, !1);
            for (let e = l.DownloadKernel.TaskAttribute.StringStart; e < l.DownloadKernel.TaskAttribute.StringEnd; ++e) this.attribute.set(e, "");
            for (let e = l.DownloadKernel.TaskAttribute.ObjectStart; e < l.DownloadKernel.TaskAttribute.ObjectEnd; ++e) this.attribute.set(e, null);
            this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, -1), this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryViewId, l.DownloadKernel.CategroyViewID.Unkown), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, l.DownloadKernel.TaskType.Unkown), this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, l.DownloadKernel.TaskError.Unkown), this.attribute.set(l.DownloadKernel.TaskAttribute.NameType, 1), this.attribute.set(l.DownloadKernel.TaskAttribute.CreateTime, (new Date).getTime()), this.channelInfo = {
                originSize: 0,
                p2pSize: 0,
                p2sSize: 0,
                offlineSize: 0,
                dcdnSize: 0,
                dcdnStatus: l.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 n(this, void 0, void 0, function* () {
                do {
                    if (!e || "" === e) break;
                    let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                    if (t === e) break;
                    let i = !1;
                    if (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                        if (!(yield k.SingleBtTaskNS.isSingleBtTask(this)) && this.taskType !== l.DownloadKernel.TaskType.Group) {
                            let i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath), n = a.join(i, t),
                                o = a.join(i, e), r = yield s.FileSystemAWNS.existsAW(n);
                            r && (o = v.Common.getMaxFilePath(o), yield s.FileSystemAWNS.renameAW(n, o), (r = yield s.FileSystemAWNS.existsAW(o)) && (e = a.basename(o)))
                        }
                        i = !0
                    } else this.taskStatus === l.DownloadKernel.TaskStatus.StandBy ? i = !0 : this.taskStatus === l.DownloadKernel.TaskStatus.Started && this.taskType === l.DownloadKernel.TaskType.P2sp && d.ThunderKernel.renameP2spTaskFile(this.virtualTaskId, e);
                    i && (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName, e), this.fireTaskEvent(l.DownloadKernel.TaskEventType.TaskRenamed))
                } while (0)
            })
        }

        setUserRead(e) {
            0 !== e && (e = 1), e !== this.attribute.get(l.DownloadKernel.TaskAttribute.UserRead) && (this.attribute.set(l.DownloadKernel.TaskAttribute.UserRead, e), this.saveTaskInfo(this.taskId, g.StatementType.SetTaskUserRead, g.ValueType.ValueInt, e), this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.UserRead))
        }

        getUserRead() {
            return this.attribute.get(l.DownloadKernel.TaskAttribute.UserRead)
        }

        setDescription(e) {
            let t = this.attribute.get(l.DownloadKernel.TaskAttribute.Description);
            e && t !== e && (this.attribute.set(l.DownloadKernel.TaskAttribute.Description, e), this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDescription, g.ValueType.ValueString, e), this.fireTaskEvent(l.DownloadKernel.TaskEventType.TaskDescriptionChanged))
        }

        setOriginThreadCount(e) {
            this.taskType === l.DownloadKernel.TaskType.P2sp && this.getExtraObject().setOriginThreadCount(e)
        }

        setOriginOnlyStrategy(e) {
            if (this.taskType === l.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 === l.DownloadKernel.TaskType.P2sp && 1 === this.getExtraObject().getUseOriginOnly() && (e = !0), e
        }

        setDispatchStrategy(e) {
            this.dispatchStrategy = e
        }

        setDownloadStrategy(e) {
            this.virtualTaskId && this.virtualTaskId > 0 ? d.ThunderKernel.setDownloadStrategy(this.virtualTaskId, e) : this.downloadStrategy = e
        }

        setFreeFromSchedule(e) {
            this.freeFromSchedule !== e && (this.freeFromSchedule = e)
        }

        setOpenOnComplete(e) {
            this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, e), this.saveTaskInfo(this.taskId, g.StatementType.SetTaskOpenOnCompelete, g.ValueType.ValueInt, e)
        }

        setTaskMovingState(e) {
            this.attribute.get(l.DownloadKernel.TaskAttribute.Moving) !== e && (this.attribute.set(l.DownloadKernel.TaskAttribute.Moving, e), this.fireTaskEvent(l.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
        }

        getTotalAvailablePeer() {
            return this.nTotalAvailablePeer
        }

        getVipDownloadSizeCur() {
            return this.vipDownloadSizeCur
        }

        setAcclerating(e) {
            this.bAcclerating = e
        }

        getAcclerating() {
            return this.bAcclerating
        }

        getShiftChannelSize() {
            return this.shiftChannelSize
        }

        getTaskAttribute(e) {
            return this.attribute.get(e)
        }

        getIsBackground() {
            return !0 === this.isBackground
        }

        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(l.DownloadKernel.TaskAttribute.Moving), e.savePath = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath), e.createTime = this.attribute.get(l.DownloadKernel.TaskAttribute.CreateTime), e.url = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = this.attribute.get(l.DownloadKernel.TaskAttribute.RefUrl), e.cid = this.attribute.get(l.DownloadKernel.TaskAttribute.Cid), e.gcid = this.attribute.get(l.DownloadKernel.TaskAttribute.Gcid), e.taskName = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), e.description = this.attribute.get(l.DownloadKernel.TaskAttribute.Description), e.nameType = this.attribute.get(l.DownloadKernel.TaskAttribute.NameType), e.categoryId = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId), e.userRead = this.attribute.get(l.DownloadKernel.TaskAttribute.UserRead), e.openOnComplete = this.attribute.get(l.DownloadKernel.TaskAttribute.OpenOnComplete), e.ownerProduct = this.attribute.get(l.DownloadKernel.TaskAttribute.OwnerProduct), e.downloadingPeriod = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadingPeriod), e.errorCode = this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode), e.groupTaskId = this.attribute.get(l.DownloadKernel.TaskAttribute.GroupTaskId), e.downloadSubTask = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadSubTask), e.productInfo = this.attribute.get(l.DownloadKernel.TaskAttribute.ProductInfo), e.origin = this.attribute.get(l.DownloadKernel.TaskAttribute.Origin), e.fileCreated = this.attribute.get(l.DownloadKernel.TaskAttribute.FileCreated), e.recycleTime = this.attribute.get(l.DownloadKernel.TaskAttribute.RecycleTime), e.forbidden = this.attribute.get(l.DownloadKernel.TaskAttribute.Forbidden), e.fileSize = this.attribute.get(l.DownloadKernel.TaskAttribute.FileSize), e.receiveSize = this.attribute.get(l.DownloadKernel.TaskAttribute.ReceivedSize), e.downloadSize = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadSize), e.srcTotal = this.attribute.get(l.DownloadKernel.TaskAttribute.SrcTotal), e.srcUsing = this.attribute.get(l.DownloadKernel.TaskAttribute.SrcUsing), e.completionTime = this.attribute.get(l.DownloadKernel.TaskAttribute.CompletionTime), e.nTotalAvailablePeer = this.getTotalAvailablePeer(), e.isBackground = this.getIsBackground(), e.playPosition = this.attribute.get(l.DownloadKernel.TaskAttribute.PlayPosition), e.duration = this.attribute.get(l.DownloadKernel.TaskAttribute.Duration), e.channelInfo = this.getTaskChannelInfo(), e.realDownloadSize = this.attribute.get(l.DownloadKernel.TaskAttribute.RealDownloadSize) || 0, e.validDownloadSize = this.attribute.get(l.DownloadKernel.TaskAttribute.ValidDownloadSize) || 0, e
        }

        isSupportPlay() {
            let e = !1;
            if (this.taskStatus === l.DownloadKernel.TaskStatus.Failed) {
                let t = this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode);
                e = !(t && t > 700) && this.isVideoFile()
            } else e = this.isVideoFile();
            return e
        }

        setResourceLegalStatus(e) {
            this.resourceLegal = e
        }

        getResourceLegalStatus() {
            return this.resourceLegal
        }

        getVideoFileCount() {
            let e = 0;
            if (this.taskType === l.DownloadKernel.TaskType.P2sp || this.taskType === l.DownloadKernel.TaskType.Emule) e = this.isVideoFile() ? 1 : 0; else if (this.taskType === l.DownloadKernel.TaskType.Bt) {
                let t = this.getExtraObject();
                if (t.getDownloadFile().length <= 0) e = 0; else {
                    let i = !1, n = t.getBtFileList();
                    for (let [, t] of n) {
                        let n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download),
                            a = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                        1 === n && (i = w.TaskUtilHelper.isVideoFileExt(a)) && e++
                    }
                }
            } else if (this.taskType === l.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject();
                if (null !== t && void 0 !== t) {
                    let i = !1, n = t.getSubTaskCount();
                    for (let a = 0; a < n; ++a) {
                        let n = t.getSubTaskByIndex(a), o = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName);
                        1 === n.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask) && (i = w.TaskUtilHelper.isVideoFileExt(o)) && e++
                    }
                }
            }
            return e
        }

        isFreeFromSchedule() {
            return this.freeFromSchedule
        }

        getPlayUrl(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.virtualTaskId && this.virtualTaskId > 0 ? d.ThunderKernel.queryPlayInfo(this.virtualTaskId, e, (i, n) => {
                        e === i && t(n)
                    }) : t(void 0)
                })
            })
        }

        enableDcdnWithVipCert(e, t = -1) {
            if (I.information("enableDcdnWithVipCert", this.taskId, e, t), this.vipCert = e, this.dcdnFileIndex = t, this.taskType === l.DownloadKernel.TaskType.Group) {
                let i = this.getExtraObject(), n = i.getSubTaskCount();
                for (let a = 0; a < n; ++a) {
                    let n = i.getSubTaskByIndex(a);
                    n && n.enableDcdnWithVipCert(e, t)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, t, e)
        }

        updateDcdnWithVipCert(e, t = -1) {
            if (I.information("updateDcdnWithVipCert", this.taskId, e, t), this.vipCert = e, this.dcdnFileIndex = t, this.taskType === l.DownloadKernel.TaskType.Group) {
                let i = this.getExtraObject(), n = i.getSubTaskCount();
                for (let a = 0; a < n; ++a) {
                    let n = i.getSubTaskByIndex(a);
                    n && n.updateDcdnWithVipCert(e, t)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.updateDcdnWithVipCert(this.virtualTaskId, t, e)
        }

        disableDcdnWithVipCert(e = -1) {
            if (I.information("disableDcdnWithVipCert", this.taskId, e), this.vipCert = void 0, this.dcdnFileIndex = -1, this.taskType === l.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject(), i = t.getSubTaskCount();
                for (let n = 0; n < i; ++n) {
                    let i = t.getSubTaskByIndex(n);
                    i && i.disableDcdnWithVipCert(e)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.disableDcdnWithVipCert(this.virtualTaskId, e)
        }

        start(e) {
            return n(this, void 0, void 0, function* () {
                I.information("start this.taskStatus:", this.taskStatus, ", this.taskType:", this.taskType);
                let t = !1, i = !0;
                if (this.taskStatus === l.DownloadKernel.TaskStatus.Stopped || this.taskStatus === l.DownloadKernel.TaskStatus.StartWaiting || this.taskStatus === l.DownloadKernel.TaskStatus.Failed || this.taskStatus === l.DownloadKernel.TaskStatus.Unkown || e) if (this.taskType === l.DownloadKernel.TaskType.Group) (t = yield this.getExtraObject().start(e)) && (t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StartPending)); else {
                    let e = yield this.createDownloadSdkTask();
                    i = 0 === e, t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StartPending), i || (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ErrorCode, e), this.updateTaskStatus(l.DownloadKernel.TaskStatus.Failed), this.fireTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged), this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.ErrorCode))
                }
                return e && (t = !0), t && i
            })
        }

        startWaiting() {
            I.information("startWaiting this.taskStatus:", this.taskStatus);
            let e = !1;
            return this.taskStatus !== l.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== l.DownloadKernel.TaskStatus.Failed && this.taskStatus !== l.DownloadKernel.TaskStatus.Unkown || (e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StartWaiting)), e
        }

        stop(e) {
            I.information("stop reason", e);
            let t = !1;
            if (this.taskStatus === l.DownloadKernel.TaskStatus.StartWaiting) t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Stopped); else if (this.taskType === l.DownloadKernel.TaskType.Group) {
                let i = this.getExtraObject();
                if (t = i.stop(e)) {
                    let e = i.getTaskStatus();
                    e !== l.DownloadKernel.TaskStatus.Succeeded && e !== l.DownloadKernel.TaskStatus.Seeding && e !== l.DownloadKernel.TaskStatus.Stopped && (t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StopPending))
                }
            } else this.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskStatus !== l.DownloadKernel.TaskStatus.Seeding && this.taskStatus !== l.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== l.DownloadKernel.TaskStatus.Failed && (this.virtualTaskId && this.virtualTaskId > 0 ? (t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StopPending), d.ThunderKernel.setTaskExtStat(this.virtualTaskId, -1, "stopreason", String(e)), d.ThunderKernel.stopTask(this.virtualTaskId)) : t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Stopped));
            return t && this.setStopReason(e), t
        }

        deleteFile() {
            return n(this, void 0, void 0, function* () {
                I.information("delete");
                let e = !1;
                return e = this.taskType === l.DownloadKernel.TaskType.Group ? yield this.getExtraObject().deleteFile() : yield this.destroy()
            })
        }

        commit() {
        }

        updateTaskStatus(e) {
            let t = !1;
            return this.taskStatus !== e && (this.taskStatus === l.DownloadKernel.TaskStatus.StartPending ? e === l.DownloadKernel.TaskStatus.Stopped || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : this.taskStatus === l.DownloadKernel.TaskStatus.StopPending ? e === l.DownloadKernel.TaskStatus.Started || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding) && e !== l.DownloadKernel.TaskStatus.Stopped && e !== l.DownloadKernel.TaskStatus.DestroyPending || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0)), e !== l.DownloadKernel.TaskStatus.Started && (this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = []), t && (this.startTime = 0, this.downloadingPeriod = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadingPeriod), this.taskStatus !== l.DownloadKernel.TaskStatus.DestroyPending && this.saveTaskInfo(this.taskId, g.StatementType.SetTaskStatus, g.ValueType.ValueInt, this.taskStatus)), t
        }

        createP2spTask(e, t, i, n) {
            return this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.P2sp, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.url || ""), this.attribute.set(l.DownloadKernel.TaskAttribute.RefUrl, i.refUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, i.origin), this.attribute.set(l.DownloadKernel.TaskAttribute.Cookie, i.cookie), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(l.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === i.downloadSubTask && this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSubTask, 1), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n), t.fileSize && this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, t.fileSize), t.gcid && this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new u.P2spTask(this, !e, i.useOriginResourceOnly, i.originResourceThreadCount, i.nameFixed || 0), this.taskId
        }

        createBtTask(e, t, i, o) {
            return n(this, void 0, void 0, function* () {
                this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Bt, t.taskName || (t.taskName = i.displayName), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.originUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.RefUrl, i.refUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), r.isNumber(o) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, o);
                let n = a.join(__profilesDir, "Torrents"), u = yield s.FileSystemAWNS.existsAW(n);
                u || (yield s.FileSystemAWNS.mkdirsAW(n));
                let h = i.infoId + ".torrent", f = a.join(n, h);
                yield s.FileSystemAWNS.copyFileAW(i.seedFile, f), (u = yield s.FileSystemAWNS.existsAW(f)) && (i.seedFile = f), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new c.BtTask(this, !e, i);
                let g = this.getExtraObject().getFileSize();
                this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, g), this.saveAttribute(l.DownloadKernel.TaskAttribute.FileSize, g)
            })
        }

        createEmuleTask(e, t, i, n) {
            if (this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Emule, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.url), this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, i.origin), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(l.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === i.downloadSubTask && this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSubTask, 1), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n), t.fileSize) this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, t.fileSize); else {
                let e = v.Common.parseEd2kUrl(i.url);
                e && e.fileSize && this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, e.fileSize)
            }
            return t.gcid && this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new h.EmuleTask(this, !e), this.taskId
        }

        createGroupTask(e, t, i, n) {
            this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Group, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n);
            let a = 0;
            for (let e = 0; e < i.subTaskList.length; ++e) {
                let t = i.subTaskList[e].taskBaseInfo.fileSize;
                t && (a += t)
            }
            return a && this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, a), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new f.GroupTask(this, !e), this.taskId
        }

        createMagnetTask(e, t, i, n) {
            return this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Magnet, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.url), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, i.torrentFilePath), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskId
        }

        loadStorageP2spTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new u.P2spTask(this, !1, 0, 5, 0)
        }

        loadStorageBtTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new c.BtTask(this, !1, null), this.taskExtra.loadBtTask(e => {
                if (e) {
                    let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                    void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                }
                b.fireTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileLoaded, this.taskId, []), b.fireTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [])
            })
        }

        loadStorageBtTaskAW(e) {
            return new Promise(t => n(this, void 0, void 0, function* () {
                this.setTaskBaseInfo(e), this.taskExtra = new c.BtTask(this, !1, null), this.getExtraObject().loadBtTask(e => {
                    if (e) {
                        let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                    }
                    b.fireTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, []), t()
                })
            }))
        }

        loadStorageEmuleTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new h.EmuleTask(this, !1)
        }

        loadStorageGroupTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new f.GroupTask(this, !1)
        }

        updateTaskSavePath(e) {
            this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath, e)
        }

        updateTaskRelativePath(e) {
            this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RelativePath, e)
        }

        updateTaskName(e) {
            this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName, e)
        }

        updateDownloadSubTask(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask, e)
        }

        queryTaskInfo(e, t, i) {
            let n = !1;
            switch (this.taskType) {
                case l.DownloadKernel.TaskType.P2sp:
                    n = this.queryP2spTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Bt:
                    n = this.queryBtTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Emule:
                    n = this.queryEmuleTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Group:
                    n = this.queryGroupTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Magnet:
                    n = this.queryMagnetTaskInfo(e, t, i)
            }
            return n
        }

        updateTaskInfo(e, t, i) {
            let n = 0, a = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, o = 0, r = 0;
            if (this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode) === l.DownloadKernel.TaskError.DownloadSDKCrash) return n;
            if (0 === e.virtualId) return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ErrorCode, e.taskError) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ErrorCode), this.updateTaskStatus(l.DownloadKernel.TaskStatus.Failed), n |= 1, t(this), n |= 2, this.detailChangedFlags = a, i(this, a), n;
            if (void 0 !== e.originalName && "" !== e.originalName && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.OriginName, e.originalName) && (a |= l.DownloadKernel.TaskDetailChangedFlags.OriginName), void 0 !== e.httpContentType && "" !== e.httpContentType && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.HTTPContentType, e.httpContentType) && (a |= l.DownloadKernel.TaskDetailChangedFlags.HTTPContentType), void 0 !== e.finalName && "" !== e.finalName && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName, e.finalName) && (a |= l.DownloadKernel.TaskDetailChangedFlags.TaskName), a |= this.updateDownloadSpeed(e.downloadSize), e.downloadSize) {
                let t = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize);
                this.getTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize) === e.fileSize && t > e.downloadSize || (o = e.downloadSize - t, this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize) && (a |= l.DownloadKernel.TaskDetailChangedFlags.DownloadSize))
            }
            if (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RealDownloadSize, e.downloadSize), "number" == typeof e.validDownloadSize) {
                let t = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize);
                r = e.validDownloadSize - t, t !== e.validDownloadSize && (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize, e.validDownloadSize), a |= l.DownloadKernel.TaskDetailChangedFlags.ValidDownloadSize)
            } else if ("number" == typeof e.downloadSize) {
                let t = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize);
                r = e.downloadSize - t, I.information("use download size to set valid size", this.getId()), this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize, e.downloadSize)
            } else {
                let e = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize);
                e ? I.information("use old valid size. ", e, this.getId()) : (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize, 0), I.information("no download size and valid size, set it to 0", this.getId()))
            }
            e.receivedSize && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ReceivedSize, e.receivedSize) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), e.fileSize && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize, e.fileSize) && (a |= l.DownloadKernel.TaskDetailChangedFlags.FileSize), this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ErrorCode, e.taskError) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ErrorCode), e.cid && "" !== e.cid && this.updateCid(e.cid) && (a |= l.DownloadKernel.TaskDetailChangedFlags.Cid), e.gcid && "" !== e.gcid && this.updateGcid(e.gcid) && (a |= l.DownloadKernel.TaskDetailChangedFlags.Gcid), "number" == typeof e.srcTotal && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcTotal, e.srcTotal) && (a |= l.DownloadKernel.TaskDetailChangedFlags.SrcTotal), "number" == typeof e.srcUsing && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcUsing, e.srcUsing) && (a |= l.DownloadKernel.TaskDetailChangedFlags.SrcUsing), e.taskStatus !== A.Error || e.taskError !== l.DownloadKernel.TaskError.FileCreate ? this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileCreated, 1) : this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileCreated, 0);
            let s = this.changeToDownloadKernelTaskStatus(e.taskStatus), d = this.updateTaskStatus(s),
                u = e.channelInfo;
            return u && this.updateChannelInfo(u, r, o) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), d && (n |= 1, t(this)), this.detailChangedFlags = a, a !== l.DownloadKernel.TaskDetailChangedFlags.UnKnown && (n |= 2, i(this, a)), "number" == typeof e.totalAvailablePeer && (this.nTotalAvailablePeer = e.totalAvailablePeer), n
        }

        updateCid(e) {
            let t = !1, i = this.attribute.get(l.DownloadKernel.TaskAttribute.Cid);
            return i && "" !== i || (i !== e && (this.saveAttribute(l.DownloadKernel.TaskAttribute.Cid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, e)), t
        }

        updateGcid(e) {
            let t = !1, i = this.attribute.get(l.DownloadKernel.TaskAttribute.Gcid);
            return i && "" !== i || (i !== e && (this.saveAttribute(l.DownloadKernel.TaskAttribute.Gcid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, e)), t
        }

        onFinish() {
            let e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Succeeded);
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.CompletionTime, (new Date).getTime()), this.virtualTaskId > 0 && (d.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onStop() {
            let e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Stopped);
            return this.virtualTaskId > 0 && (d.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onFail() {
            let e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Failed);
            return this.virtualTaskId > 0 && (d.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        moveToRecycle() {
            let e = (new Date).getTime();
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RecycleTime, e)
        }

        recover() {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RecycleTime, 0)
        }

        destroy() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                switch (this.taskType) {
                    case l.DownloadKernel.TaskType.P2sp:
                        e = yield this.deleteP2spTaskFile();
                        break;
                    case l.DownloadKernel.TaskType.Bt:
                        e = yield this.deleteBtTaskFile();
                        break;
                    case l.DownloadKernel.TaskType.Emule:
                        e = yield this.deleteEmuleTaskFile();
                        break;
                    case l.DownloadKernel.TaskType.Group:
                        e = yield this.deleteGroupTaskFile()
                }
                return e
            })
        }

        setSavePath(e) {
            this.taskStatus !== l.DownloadKernel.TaskStatus.StartPending && this.taskStatus !== l.DownloadKernel.TaskStatus.Started && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath, e)
        }

        setCategoryViewId(e) {
            this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryViewId, e)
        }

        getIsPrivate() {
            let e = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId);
            return !!(void 0 !== e && e > -1 && _.isPrivateCategory(e))
        }

        getUserName() {
            let e = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId);
            if (void 0 !== e && e > -1) {
                let t = _.getCategoryFromId(e);
                if (t) return t.getUserName()
            }
            return ""
        }

        setCategoryId(e) {
            this.isBackground || (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryId, e), d.ThunderKernel.setCategoryId(e, this.taskId))
        }

        getTaskName() {
            return this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName)
        }

        getSavePath() {
            return this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath)
        }

        fireTaskDetailChanged(e) {
            this.detailChangedFlags = e;
            let t = this.attribute.get(l.DownloadKernel.TaskAttribute.GroupTaskId);
            if (t > 0) {
                let e = new Map;
                e.set(t, [this]), b.fireTaskEvent(l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            } else this.fireTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, e)
        }

        getVirtualTaskId() {
            return this.virtualTaskId
        }

        setStopReason(e) {
            this.taskStatusChangedReason = e
        }

        getStopReason() {
            return this.taskStatusChangedReason
        }

        internalSetTaskSpeed(e, t) {
            let i = !1;
            return e = Math.round(e), t = Math.round(t), this.speed !== e && (i = !0, this.speed = e), this.vipSpeed !== t && (i = !0, this.vipSpeed = t), i
        }

        internalSetFileSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize, e)
        }

        internalSetGcid(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.Gcid, e)
        }

        internalSetDownloadingPeriod(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod, e)
        }

        internalSetDownloadSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize, e)
        }

        internalSetReceivedSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ReceivedSize, e)
        }

        internalSetSrcUsing(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcUsing, e)
        }

        internalSetSrcTotal(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcTotal, e)
        }

        internalSetFileIndex(e) {
            return this.setTaskAttribute(l.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, this.taskType === l.DownloadKernel.TaskType.Group && (this.historyChannelInfo = {
                originSize: 0,
                p2pSize: 0,
                p2sSize: 0,
                offlineSize: 0,
                dcdnSize: 0
            }), d.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize), !0)
        }

        internalSetTotalDownloadSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TotalDownloadSize, e)
        }

        setFileSize(e) {
            let t = this.internalSetFileSize(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.FileSize : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.FileSize)), t
        }

        setGcid(e) {
            I.information("setGcid", e, this.taskId);
            let t = this.internalSetGcid(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.Gcid : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.Gcid)), t
        }

        setDownloadingPeriod(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)), t
        }

        setDownloadSize(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.DownloadSize : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.DownloadSize)), t
        }

        setPlayPosition(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.PlayPosition, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.PlayPosition : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.PlayPosition)), t
        }

        setDuration(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.Duration, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.Duration : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.Duration)), t
        }

        addServer(e, t) {
            I.information("addServer fileIndex:", e, "serverResourceInfo:", t);
            let i = this.serverResourceInfos.get(e);
            i ? (I.information("update serverinfo", i, t), Object.assign(i, t)) : this.serverResourceInfos.set(e, t), this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.addServer(this.virtualTaskId, e, t)
        }

        discardServer(e, t) {
            this.serverResourceInfos.delete(e), this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.discardServer(this.virtualTaskId, e, t)
        }

        setTaskUrl(e) {
            let t = !1;
            do {
                let i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl);
                if (i && "" !== i) break;
                this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, e), this.saveAttribute(l.DownloadKernel.TaskAttribute.TaskUrl, e), t = !0
            } while (0);
            return t
        }

        setReceivedSize(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ReceivedSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.ReceivedSize : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.ReceivedSize)), t
        }

        setSrcUsing(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcUsing, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.SrcUsing : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.SrcUsing)), t
        }

        setSrcTotal(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcTotal, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.SrcTotal : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.SrcTotal)), t
        }

        beginBatchSetTaskAttribute() {
            I.information("beginBatchSetTaskAttribute taskId:", this.taskId), this.batchSetTaskAttribute = !0
        }

        commitBatchSetTaskAttribute() {
            if (this.batchSetTaskAttribute && (this.batchSetTaskAttribute = !1, I.information("commitBatchSetTaskAttribute taskId:", this.taskId), this.batchDetailChangedFlags !== l.DownloadKernel.TaskDetailChangedFlags.UnKnown)) {
                let e = this.batchDetailChangedFlags;
                this.batchDetailChangedFlags = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.fireTaskDetailChanged(e)
            }
        }

        createDownloadSdkTask() {
            return n(this, void 0, void 0, function* () {
                let e = 0;
                switch (this.taskType) {
                    case l.DownloadKernel.TaskType.P2sp: {
                        let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl),
                            i = this.attribute.get(l.DownloadKernel.TaskAttribute.RefUrl),
                            n = this.attribute.get(l.DownloadKernel.TaskAttribute.Cookie),
                            a = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                            o = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        e = yield new Promise(e => {
                            this.virtualTaskId = d.ThunderKernel.createP2spTask(t, i, n, a, o, t => {
                                I.information("createP2spTask result:", t), e(t)
                            }), this.virtualTaskId <= 0 && e(-1)
                        }), I.information("createP2spTask virtualTaskId:", this.virtualTaskId, ", ret:", e, ", url:", t, ", refUrl: ", i, ", cookie:", n, ", savePath:", a, ", fileName:", o)
                    }
                        break;
                    case l.DownloadKernel.TaskType.Bt: {
                        let t = this.getExtraObject(), i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                            n = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        (yield k.SingleBtTaskNS.isSingleBtTask(this)) || 1 === t.getFileCount() && (yield k.SingleBtTaskNS.getCorrectSingleBtFolder(this)) || (i = a.join(i, n)), t.isBtFileLoadEnd() || (yield this.loadStorageBtTaskAW(this.getTaskBaseInfo()));
                        let o = t.getSeedFilePath();
                        if (!(yield s.FileSystemAWNS.existsAW(o))) {
                            this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, l.DownloadKernel.TaskError.torrentFileNotExist);
                            break
                        }
                        let r = t.getDownloadFile();
                        e = yield new Promise(e => {
                            this.virtualTaskId = d.ThunderKernel.createBtTask(o, i, r, t => {
                                I.information("createP2spTask result:", t), e(t)
                            }), this.virtualTaskId <= 0 && e(-1)
                        }), I.information("createBtTask virtualTaskId:", this.virtualTaskId, ", ret:", e, ", torrentFilePath:", o, ", savePath: ", i, ", downloadIndexs:", r)
                    }
                        break;
                    case l.DownloadKernel.TaskType.Emule: {
                        let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl),
                            i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                            n = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        e = yield new Promise(e => {
                            this.virtualTaskId = d.ThunderKernel.createEmuleTask(t, i, n, t => {
                                I.information("createP2spTask result:", t), e(t)
                            }), this.virtualTaskId <= 0 && e(-1)
                        }), I.information("createEmuleTask virtualTaskId:", this.virtualTaskId, ", ret:", e, ", url:", t, ", savePath: ", i, ", fileName:", n)
                    }
                        break;
                    case l.DownloadKernel.TaskType.Magnet: {
                        let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl),
                            i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath);
                        e = yield new Promise(e => {
                            this.virtualTaskId = d.ThunderKernel.createMagnetTask(t, i, t => {
                                I.information("createP2spTask result:", t), e(t)
                            }), this.virtualTaskId <= 0 && e(-1)
                        }), I.information("createMagnetTask virtualTaskId:", this.virtualTaskId, ", ret:", e, ", url:", t, ", savePath: ", i)
                    }
                }
                return I.information("createDownloadSdkTask virtualTaskId:", this.virtualTaskId), this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId), this.setStartInfo(), e
            })
        }

        setStatusAndErrorCode(e, t) {
            this.taskStatus = e, this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, t)
        }

        setStartInfo() {
            if (this.virtualTaskId && this.virtualTaskId > 0) {
                if (this.taskType === l.DownloadKernel.TaskType.P2sp) {
                    let e = this.getExtraObject(), t = e.getThreadCount();
                    void 0 !== this.originOnlyStrategy && e.setUseOriginOnly(this.originOnlyStrategy), 1 === this.originOnlyStrategy ? d.ThunderKernel.setTaskStrategy(this.virtualTaskId, 1) : void 0 !== this.dispatchStrategy && d.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), void 0 !== this.originThreadCount ? d.ThunderKernel.setTaskThreadCount(this.virtualTaskId, this.originThreadCount) : d.ThunderKernel.setTaskThreadCount(this.virtualTaskId, t)
                } else if (void 0 !== this.dispatchStrategy && d.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), this.taskType === l.DownloadKernel.TaskType.Bt) {
                    let e = y.BTExtraTrackNS.getExtraTracks();
                    e.length > 0 && d.ThunderKernel.setBTExtraTrackers(this.virtualTaskId, e)
                }
                this.setTaskExtInfoBeforeStart(), this.addHttpHeaderFieldBeforeStart(), this.setupNetDiskFetchTaskFlagBeforeStart(), this.taskExtra && this.taskExtra.setTaskPriorityLevel(-1), this.serverResourceInfos.forEach((e, t) => {
                    d.ThunderKernel.addServer(this.virtualTaskId, t, e)
                }), this.downloadStrategy !== l.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_NORMALDOWNLOAD && (d.ThunderKernel.setDownloadStrategy(this.virtualTaskId, this.downloadStrategy), this.downloadStrategy = l.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_NORMALDOWNLOAD), d.ThunderKernel.startTask(this.virtualTaskId), void 0 !== this.vipCert && d.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, this.dcdnFileIndex, this.vipCert)
            } else I.warning("setStartInfo failed! virtualTaskId:", this.virtualTaskId)
        }

        queryP2spTaskInfo(e, t, i) {
            let n = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (n = d.ThunderKernel.queryTaskInfo(this.virtualTaskId, n => {
                null !== n && this.updateTaskInfo(n, e, t), i()
            })), n
        }

        queryBtTaskInfo(e, t, i) {
            let n = !1;
            if (this.virtualTaskId && this.virtualTaskId > 0) n = d.ThunderKernel.queryBtTaskInfo(this.virtualTaskId, n => {
                null !== n && (this.updateTaskInfo(n, e, t), this.getExtraObject().updateSubFileInfo(n.fileLists)), i()
            }); else if (0 === this.virtualTaskId && this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode) === l.DownloadKernel.TaskError.torrentFileNotExist) {
                let n = {virtualId: 0, taskError: l.DownloadKernel.TaskError.torrentFileNotExist};
                this.updateTaskInfo(n, e, t), i()
            }
            return n
        }

        queryEmuleTaskInfo(e, t, i) {
            let n = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (n = d.ThunderKernel.queryTaskInfo(this.virtualTaskId, n => {
                null !== n && this.updateTaskInfo(n, e, t), i()
            })), n
        }

        queryGroupTaskInfo(e, t, i) {
            let n = !1;
            return this.taskExtra && (n = this.getExtraObject().querySubTaskInfo(e, t, i)), n
        }

        queryMagnetTaskInfo(e, t, i) {
            let n = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (n = d.ThunderKernel.queryTaskInfo(this.virtualTaskId, n => {
                null !== n && this.updateTaskInfo(n, e, t), i()
            })), n
        }

        setTaskBaseInfo(e) {
            e && (this.taskId = e.taskId, this.taskType = e.taskType, this.taskStatus = e.taskStatus, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, e.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, e.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.FileCreated, e.fileCreated), this.attribute.set(l.DownloadKernel.TaskAttribute.RecycleTime, e.recycleTime), this.attribute.set(l.DownloadKernel.TaskAttribute.Forbidden, e.forbidden), this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, e.fileSize), this.attribute.set(l.DownloadKernel.TaskAttribute.ReceivedSize, e.receiveSize), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize), this.attribute.set(l.DownloadKernel.TaskAttribute.CreateTime, e.createTime), this.attribute.set(l.DownloadKernel.TaskAttribute.CompletionTime, e.completionTime), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadingPeriod, e.downloadingPeriod), this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, e.errorCode), this.attribute.set(l.DownloadKernel.TaskAttribute.NameType, e.nameType), this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, e.categoryId), this.attribute.set(l.DownloadKernel.TaskAttribute.UserRead, e.userRead), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, e.openOnComplete), this.attribute.set(l.DownloadKernel.TaskAttribute.OwnerProduct, e.ownerProduct), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSubTask, e.downloadSubTask), this.attribute.set(l.DownloadKernel.TaskAttribute.GroupTaskId, e.groupTaskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, e.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, e.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, e.url), this.attribute.set(l.DownloadKernel.TaskAttribute.RefUrl, e.refUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, e.description), this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, e.productInfo), this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, e.origin), this.attribute.set(l.DownloadKernel.TaskAttribute.UserData, e.userData), this.attribute.set(l.DownloadKernel.TaskAttribute.PlayPosition, e.playPosition), this.attribute.set(l.DownloadKernel.TaskAttribute.Duration, e.duration), "0000000000000000000000000000000000000000" === e.cid ? this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, e.cid), "0000000000000000000000000000000000000000" === e.gcid ? this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, e.gcid), e.channelInfo && (this.historyChannelInfo = e.channelInfo))
        }

        setTaskAttribute(e, t) {
            let i = !1;
            return this.getTaskAttribute(e) !== t && void 0 !== t && (this.attribute.set(e, t), i = !0, this.saveAttribute(e, t)), i
        }

        updateDownloadSpeed(e) {
            let t = l.DownloadKernel.TaskDetailChangedFlags.UnKnown;
            if (e) {
                let i = e - this.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize);
                (0 === e || i < 0) && (i = 0);
                let n = this.calculateDownloadSpeed(i);
                (n = Math.round(n)) !== this.speed && (this.speed = n, t |= l.DownloadKernel.TaskDetailChangedFlags.TaskSpeed)
            }
            if (this.taskStatus === l.DownloadKernel.TaskStatus.Started) if (0 === this.startTime) this.startTime = (new Date).getTime(); else {
                let e = ((new Date).getTime() - this.startTime) / 1e3, i = this.downloadingPeriod + Math.round(e);
                this.saveAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod, i), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadingPeriod, i), this.attribute.get(l.DownloadKernel.TaskAttribute.GroupTaskId) < 1 && (t |= l.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            }
            return t
        }

        saveAttribute(e, t) {
            switch (e) {
                case l.DownloadKernel.TaskAttribute.TaskUrl:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskUrl, g.ValueType.ValueString, t);
                    break;
                case l.DownloadKernel.TaskAttribute.TaskName:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskName, g.ValueType.ValueString, t);
                    break;
                case l.DownloadKernel.TaskAttribute.SavePath:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskSavePath, g.ValueType.ValueString, t);
                    break;
                case l.DownloadKernel.TaskAttribute.ReceivedSize:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskReceiveSize, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.DownloadSize:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDownloadSize, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.FileSize:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskFileSize, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.RecycleTime:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskRemovingToRecycleTime, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.FileCreated:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskFileCreated, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.CompletionTime:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskCompletionTime, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.DownloadingPeriod:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDownloadingPeriod, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.ErrorCode:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskFailureErrorCode, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.Cid:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskCid, g.ValueType.ValueBlob, t);
                    break;
                case l.DownloadKernel.TaskAttribute.Gcid:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskGcid, g.ValueType.ValueBlob, t);
                    break;
                case l.DownloadKernel.TaskAttribute.DownloadSubTask:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDownload, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.PlayPosition:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskPlayPosition, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.Duration:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDuration, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.YunTaskId:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetYunTaskId, g.ValueType.ValueString, t)
            }
        }

        insertStorageTaskBase() {
            let e = this.getTaskBaseInfo();
            d.ThunderKernel.insertTaskBase(e)
        }

        deleteStorageTask() {
            d.ThunderKernel.deleteStorageTask(this.taskId, g.StatementType.DestroyTaskBase);
            let e = g.StatementType.StatementBengin;
            switch (this.taskType) {
                case l.DownloadKernel.TaskType.P2sp:
                    e = g.StatementType.DestroyP2spTask;
                    break;
                case l.DownloadKernel.TaskType.Bt:
                    e = g.StatementType.DestroyBtTask, this.getExtraObject().deleteStorageBtFile();
                    break;
                case l.DownloadKernel.TaskType.Emule:
                    e = g.StatementType.DestroyEmuleTask;
                    break;
                case l.DownloadKernel.TaskType.Group:
                    e = g.StatementType.DestroyGroupTask, this.getExtraObject().deleteStorageTask();
                    break;
                case l.DownloadKernel.TaskType.Magnet:
                    e = g.StatementType.DestroyMagnetTask
            }
            e !== g.StatementType.StatementBengin && d.ThunderKernel.deleteStorageTask(this.taskId, e)
        }

        saveTaskInfo(e, t, i, n) {
            this.isBackground || d.ThunderKernel.saveTaskBaseInfo(e, t, i, n)
        }

        shiftChannelInfo(e, t) {
            e.p2pSize += t, e.dcdnSize -= t, e.dcdnSize < 0 && (e.dcdnSize = 0, e.offlineSize -= t - e.dcdnSize, e.offlineSize = e.offlineSize > 0 ? e.offlineSize : 0)
        }

        updateChannelInfo(e, t = 0, i = 0) {
            let n = !1;
            if (this.shiftChannelInfo(e, this.shiftChannelSize), (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) && (n = !0, e.offlineSize > 0 || e.dcdnSize > 0)) {
                let t = e.offlineSize - this.channelInfo.offlineSize + (e.dcdnSize - this.channelInfo.dcdnSize);
                t > 0 && !this.bAcclerating && (this.shiftChannelInfo(e, t), this.shiftChannelSize += t), (t < 0 || !this.bAcclerating) && (t = 0), this.vipDownloadSizeCur += t;
                let i = this.calculateVipSpeed(t);
                i = Math.round(i), this.vipSpeed !== i && (this.vipSpeed = i)
            }
            let a = !1, o = e.dcdnStatus;
            if (this.channelInfo.dcdnStatus !== o && (a = !0), this.taskStatus === l.DownloadKernel.TaskStatus.Stopped || this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                this.channelInfo = {
                    originSize: 0,
                    p2pSize: 0,
                    p2sSize: 0,
                    offlineSize: 0,
                    dcdnSize: 0
                }, this.shiftChannelSize = 0;
                let t = this.historyChannelInfo.originSize + e.originSize,
                    i = this.historyChannelInfo.p2pSize + e.p2pSize, n = this.historyChannelInfo.p2sSize + e.p2sSize,
                    a = this.historyChannelInfo.offlineSize + e.offlineSize,
                    o = this.historyChannelInfo.dcdnSize + e.dcdnSize;
                this.historyChannelInfo = {originSize: t, p2pSize: i, p2sSize: n, offlineSize: a, dcdnSize: o}
            } else this.channelInfo = e;
            return n && this.saveChannelInfo(), a && this.fireTaskEvent(l.DownloadKernel.TaskEventType.DcdnStatusChanged), n
        }

        saveChannelInfo() {
            let e = this.getTaskChannelInfo();
            d.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize)
        }

        shareDeleteFile(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    0 !== D.asynDeleteFile(e, (i, a) => n(this, void 0, void 0, function* () {
                        if (i) t(i); else {
                            let n = [200, 300, 200, 300, 500, 500, 1e3];
                            do {
                                if (yield S.ThunderHelper.sleep(n.pop()), yield s.FileSystemAWNS.unlinkAW(e)) {
                                    i = !0;
                                    break
                                }
                            } while (n.length > 0);
                            t(i)
                        }
                    })) && t(!1)
                })
            })
        }

        deleteP2spTaskFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                    i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), n = a.join(t, i);
                if (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding || this.taskStatus === l.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === l.DownloadKernel.TaskStatus.Succeeded || this.preStatus === l.DownloadKernel.TaskStatus.Seeding) (yield s.FileSystemAWNS.existsAW(n)) && (e = yield this.shareDeleteFile(n)); else {
                    let t = n + ".xltd", i = n + ".xltd.cfg";
                    (yield s.FileSystemAWNS.existsAW(t)) && (e = yield this.shareDeleteFile(t)), (yield s.FileSystemAWNS.existsAW(i)) && (e = (yield this.shareDeleteFile(i)) && e)
                }
                return e
            })
        }

        deleteBtTaskFile() {
            return n(this, void 0, void 0, function* () {
                function e(e, t) {
                    return n(this, void 0, void 0, function* () {
                        let i = a.normalize(a.join(t, e));
                        "\\" === (t = a.normalize(t))[t.length - 1] && (t = t.slice(0, t.length - 1));
                        let n = i;
                        for (; n !== t && (!(yield s.FileSystemAWNS.existsAW(n)) || (yield s.FileSystemAWNS.rmdirAW(n)));) n = a.dirname(n)
                    })
                }

                let t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                    i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName),
                    o = a.join(__profilesDir, "Torrents"), r = this.getExtraObject().getInfoId(), d = r + ".xlbt.cfg",
                    u = r + ".xlbt.dat", c = r + ".torrent", h = a.join(t, i), f = a.join(o, d), g = a.join(o, u),
                    p = !0;
                if (yield k.SingleBtTaskNS.isSingleBtTask(this)) yield this.deleteSingleBtTaskFile(); else if (yield s.FileSystemAWNS.existsAW(h)) {
                    let e = a.join(h, c);
                    (yield s.FileSystemAWNS.existsAW(e)) && (p = (yield this.shareDeleteFile(e)) && p), p = (yield this.deleteBtSubFile()) && p
                } else do {
                    let i = this.getExtraObject();
                    if (1 !== i.getFileCount()) break;
                    let n = a.join(t, c);
                    (yield s.FileSystemAWNS.existsAW(n)) && (p = (yield this.shareDeleteFile(n)) && p);
                    let o = i.getBtFileList(), r = void 0, d = void 0;
                    for (let [, e] of o) {
                        r = e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FilePath), d = e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                        break
                    }
                    if (!r || !d) break;
                    let u = a.join(t, r);
                    if (!(yield s.FileSystemAWNS.dirExistsAW(u))) break;
                    let h = a.join(u, d);
                    (yield s.FileSystemAWNS.existsAW(h)) ? p = (yield this.shareDeleteFile(h)) && p : (h += ".bt.xltd", (yield s.FileSystemAWNS.existsAW(h)) && (p = (yield this.shareDeleteFile(h)) && p)), yield e(r, t)
                } while (0);
                return (yield s.FileSystemAWNS.existsAW(f)) && (p = (yield this.shareDeleteFile(f)) && p), (yield s.FileSystemAWNS.existsAW(g)) && (p = (yield this.shareDeleteFile(g)) && p), p
            })
        }

        deleteBtSubFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0, t = this.getExtraObject().getBtFileInfoList();
                if (t.length > 0) {
                    let i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                        n = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), o = a.join(i, n), r = [o];
                    for (let i = 0; i < t.length; ++i) {
                        let n = t[i], l = a.join(o, n.filePath);
                        if (!(yield s.FileSystemAWNS.existsAW(l))) continue;
                        let d = a.join(l, n.fileName);
                        for ((yield s.FileSystemAWNS.existsAW(d)) ? e = (yield this.shareDeleteFile(d)) && e : (d += ".bt.xltd", (yield s.FileSystemAWNS.existsAW(d)) && (e = (yield this.shareDeleteFile(d)) && e)); l.length > o.length && !r.includes(l);) r = r.concat([l]), l = a.parse(l).dir
                    }
                    r.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), I.information("task.deleteBtSubFile savePaths:", r);
                    for (let e = 0; e < r.length; ++e) {
                        let t = r[e];
                        (yield s.FileSystemAWNS.existsAW(t)) && (yield s.FileSystemAWNS.rmdirAW(t))
                    }
                }
                return e
            })
        }

        deleteEmuleTaskFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                    i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), n = a.join(t, i);
                if (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding || this.taskStatus === l.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === l.DownloadKernel.TaskStatus.Succeeded || this.preStatus === l.DownloadKernel.TaskStatus.Seeding) (yield s.FileSystemAWNS.existsAW(n)) && (e = yield this.shareDeleteFile(n)); else {
                    let t = n + ".emule.xltd", i = n + ".xlemule.cfg";
                    (yield s.FileSystemAWNS.existsAW(t)) && (e = yield this.shareDeleteFile(t)), (yield s.FileSystemAWNS.existsAW(i)) && (e = (yield this.shareDeleteFile(i)) && e)
                }
                return e
            })
        }

        deleteGroupTaskFile() {
            return n(this, void 0, void 0, function* () {
                return yield this.getExtraObject().destroy()
            })
        }

        deleteSingleBtTaskFile() {
            return n(this, void 0, void 0, function* () {
                let e = k.SingleBtTaskNS.getSinleBtTaskFilePath(this);
                if (this.preStatus !== l.DownloadKernel.TaskStatus.Failed && (yield s.FileSystemAWNS.existsAW(e))) yield this.shareDeleteFile(e); else {
                    let t = e + ".bt.xltd";
                    (yield s.FileSystemAWNS.existsAW(t)) ? yield this.shareDeleteFile(t) : (t = e + ".bt.td", yield this.shareDeleteFile(t))
                }
                let t = this.getExtraObject().getInfoId(), i = this.getSavePath(), n = t + ".torrent", o = a.join(i, n);
                yield this.shareDeleteFile(o)
            })
        }

        fireTaskEvent(e, ...t) {
            b.fireTaskEvent(e, [this], ...t)
        }

        getDetailChangedFlags() {
            return this.detailChangedFlags
        }

        isVideoFile() {
            let e = !1;
            do {
                let t = "";
                if (this.taskType === l.DownloadKernel.TaskType.P2sp || this.taskType === l.DownloadKernel.TaskType.Emule) t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), e = w.TaskUtilHelper.isVideoFileExt(t); else if (this.taskType === l.DownloadKernel.TaskType.Bt) {
                    let t = this.getExtraObject();
                    if (t.getDownloadFile().length <= 0) break;
                    let i = t.getBtFileList();
                    for (let [, t] of i) {
                        let i = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download),
                            n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                        if (1 === i && (e = w.TaskUtilHelper.isVideoFileExt(n))) break
                    }
                } else if (this.taskType === l.DownloadKernel.TaskType.Group) {
                    let t = this.getExtraObject();
                    if (null !== t && void 0 !== t) {
                        let i = t.getSubTaskCount();
                        for (let n = 0; n < i; ++n) {
                            let i = t.getSubTaskByIndex(n),
                                a = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName);
                            if (1 === i.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask) && (e = w.TaskUtilHelper.isVideoFileExt(a))) break
                        }
                    }
                }
            } while (0);
            return e
        }

        setTaskExtInfoBeforeStart() {
            if (this.virtualTaskId > 0) {
                let e = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskId),
                    t = this.attribute.get(l.DownloadKernel.TaskAttribute.Origin);
                this.attribute.get(l.DownloadKernel.TaskAttribute.Background) && (t = "background");
                let i = "parentid=" + e.toString();
                i = i + ",taskorigin=" + t, d.ThunderKernel.setTaskExtInfo(this.virtualTaskId, i)
            }
        }

        addHttpHeaderFieldBeforeStart() {
            if (this.taskType === l.DownloadKernel.TaskType.P2sp && this.virtualTaskId > 0) {
                let e = "Authorization",
                    t = this.getExtraObject().getUserData(C.TaskUserDataGUID.guidHttpHeaderField, e);
                void 0 !== t && null !== t && d.ThunderKernel.addHttpHeaderField(this.virtualTaskId, e, t)
            }
        }

        setupNetDiskFetchTaskFlagBeforeStart() {
            let e = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId);
            do {
                if (-1 === e || _.isPrivateCategory(e)) break;
                d.ThunderKernel.setupNetDiskFetchTaskFlag(this.virtualTaskId)
            } while (0)
        }

        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 i = t / this.downloadSizeList.length;
            return this.taskStatus !== l.DownloadKernel.TaskStatus.Started && (i = 0, this.downloadSizeList = []), i
        }

        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 i = t / this.vipSizeList.length;
            return this.taskStatus !== l.DownloadKernel.TaskStatus.Started && (i = 0, this.vipSizeList = []), i
        }

        changeToDownloadKernelTaskStatus(e) {
            let t = this.taskStatus;
            switch (e) {
                case A.None:
                case A.Create:
                case A.StartPending:
                    break;
                case A.Downloading:
                case A.StopPending:
                case A.CompletePending:
                case A.ErrorStopPending:
                    t = l.DownloadKernel.TaskStatus.Started;
                    break;
                case A.Pause:
                    t = l.DownloadKernel.TaskStatus.Stopped;
                    break;
                case A.Complete:
                    t = l.DownloadKernel.TaskStatus.Succeeded;
                    break;
                case A.Error:
                    t = l.DownloadKernel.TaskStatus.Failed;
                    break;
                default:
                    t = l.DownloadKernel.TaskStatus.Unkown
            }
            return t
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(30), o = i(95), r = i(118), s = i(4);
    t.P2spTask = class {
        constructor(e, t, i, l, d) {
            this.task = e, this.downloadSpeedLimit = 0, this.threadCount = l || 5, this.useOriginOnly = i || 0, s.isNumber(d) ? this.nameFixed = d : this.nameFixed = 0, this.taskId = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.TaskId), this.cookie = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.Cookie), this.displayUrl = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.TaskUrl), t ? a.ThunderKernel.insertP2spTask(this.taskId, this.downloadSpeedLimit, this.nameFixed, this.useOriginOnly, this.threadCount, void 0 === this.cookie ? "" : this.cookie, this.displayUrl) : a.ThunderKernel.loadStorageTask(this.taskId, o.StatementType.LoadP2spTask, e => {
                0 !== e.taskId && (this.useOriginOnly = e.originOnly, this.threadCount = e.threadCount, this.downloadSpeedLimit = e.speedLimit, this.nameFixed = e.nameFixed, this.displayUrl = e.displayUrl, this.cookie = e.cookie, 1 === this.useOriginOnly && this.task.setDispatchStrategy(n.DownloadKernel.DispatchStrategy.DispatchStrategyOrigin))
            });
            let u = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.UserData);
            this.userData = new r.TaskUserData(e, u)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            s.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let i = this.task.getVirtualTaskId();
            i && i > 0 && !s.isNullOrUndefined(t) && a.ThunderKernel.setTaskPriorityLevel(i, e, t)
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        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
        }

        getNameFixed() {
            return this.nameFixed
        }

        getDisplayUrl() {
            return this.displayUrl
        }

        getCookie() {
            return this.cookie
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4);
    !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 i {
            constructor(e) {
                this.type = t.LowerBound, this.type = e
            }

            getType() {
                return this.type
            }
        }

        e.BencodeObject = i;

        class a extends i {
            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"
            }

            toJs() {
                return this.value
            }
        }

        e.BencodeInteger = a;

        class o extends i {
            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, i = 0;
                for (; i < e.length; i++) {
                    if (!(e[i] >= "0" && e[i] <= "9")) {
                        if (":" !== e[i]) return -1;
                        break
                    }
                    t = 10 * t + parseInt(e[i], 10)
                }
                return t + i + 1 > e.length ? -1 : (this.value = e.substr(i + 1, t), t + i + 1)
            }

            encode(e) {
                return e += this.value.length, e += ":", e += this.value
            }

            toJs() {
                return this.value
            }
        }

        e.BencodeString = o;

        class r extends i {
            constructor() {
                super(t.List), this.value = []
            }

            getItemList() {
                return this.value
            }

            getValue() {
                return this.value
            }

            decode(e) {
                return 0
            }

            encode(e) {
                return e
            }

            toJs() {
                let e = [];
                for (let t = 0; t < this.value.length; ++t) e.push(this.value[t].toJs());
                return e
            }
        }

        e.BencodeList = r;

        class s extends i {
            constructor() {
                super(t.Map), this.value = new Map
            }

            getValue() {
                return this.value
            }

            getItem(e) {
                return this.value.get(e)
            }

            addMapItem(e) {
                let i = null, n = this.value.get(e);
                return n && n.getType() === t.Map ? i = n : (i = new s, this.value.set(e, i)), i
            }

            addItem(e, i) {
                let r = !1;
                if (n.isNumber(i)) {
                    let n = null, o = this.value.get(e);
                    o && o.getType() === t.Integer ? n = o : (n = new a, this.value.set(e, n)), n.setValue(i), r = !0
                } else if (n.isString(i)) {
                    let n = null, a = this.value.get(e);
                    a && a.getType() === t.String ? n = a : (n = new o, this.value.set(e, n)), n.setValue(i), r = !0
                } else if (n.isObject(i)) {
                    let n = null, a = this.value.get(e);
                    a && a.getType() === t.Map ? n = a : (n = new s, this.value.set(e, n));
                    for (let e in i) n.addItem(e);
                    r = !0
                }
                return r
            }

            removeItem(e) {
                let i = this.value.get(e);
                if (i) {
                    let n = !0;
                    if (i.getType() === t.Map) {
                        0 === i.getValue().size && (n = !0)
                    }
                    return this.value.delete(e), n
                }
                return !1
            }

            decode(e) {
                if (!e) return -1;
                let t = e.length;
                if (t < 2 || "d" !== e[0]) return -1;
                let i = 1, n = new o, r = null, l = -1, d = -1;
                for (; i < t && "e" !== e[i];) {
                    if (!((l = n.decode(e.substr(i))) >= 0)) return -1;
                    if ("i" === e[i += l]) {
                        let t = new a;
                        d = t.decode(e.substr(i)), r = t
                    } else if ("d" === e[i]) {
                        let t = new s;
                        d = t.decode(e.substr(i)), r = t
                    } else {
                        let t = new o;
                        d = t.decode(e.substr(i)), r = t
                    }
                    if (!(d >= 0)) return -1;
                    i += d, this.value.set(n.getValue(), r)
                }
                return i < t && "e" === e[i] ? i + 1 : -1
            }

            encode(e) {
                e += "d";
                let t = new o;
                return this.value.forEach(function (i, n) {
                    t.setValue(n), e = t.encode(e), e = i.encode(e)
                }), e += "e"
            }

            toJs() {
                let e = {};
                return this.value.forEach(function (t, i) {
                    e[i] = t.toJs()
                }), 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, i = -1, n = 0, l = e.length;
                for (; n < l; n++) (i = (t = "i" === e[n] ? new a : "l" === e[n] ? new r : "d" === e[n] ? new s : new o).decode(e.substr(n))) >= 0 && (n += i, this.objectList.push(t));
                return e
            }
        }
    }(t.BencodeMap || (t.BencodeMap = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(3), r = i(30), s = i(95), l = i(537), d = i(15), u = i(118), c = i(4), h = i(6), f = i(0),
        g = d.DownloadKernelEventManager.getEventManager(), p = f.default.getLogger("DownloadKernel.TaskBt");
    t.BtTask = class {
        constructor(e, t, i) {
            this.subError = !1, this.fileLists = new Map, this.priorityMap = new Map, this.downloadIndexLists = [], this.task = e;
            let n = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
            if (i) {
                this.infoId = i.infoId, this.tracker = i.tracker, this.seedFile = i.seedFile, this.displayName = i.displayName, this.downloadIndexLists = i.fileRealIndexLists, this.loadSubFileEnd = t, t && r.ThunderKernel.insertBtTask(n, this.infoId, this.tracker, this.seedFile, this.displayName);
                let e = i.fileLists, a = r.ThunderKernel.beginTransaction();
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i], a = n.realIndex, o = 0;
                    this.downloadIndexLists.indexOf(a) > -1 && (o = 1);
                    let r = new l.BtFile(this);
                    r.saveBtFileInfo(t, o, n), this.fileLists.set(a, r)
                }
                r.ThunderKernel.commitTransaction(a)
            }
            let a = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.UserData);
            this.userData = new u.TaskUserData(e, a)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            c.isNullOrUndefined(t) ? t = this.priorityMap.get(e) : this.priorityMap.set(e, t);
            let i = this.task.getVirtualTaskId();
            if (i && i > 0 && !c.isNullOrUndefined(t)) if (-1 === e) for (let e = 0; e < this.downloadIndexLists.length; ++e) r.ThunderKernel.setTaskPriorityLevel(i, this.downloadIndexLists[e], t); else r.ThunderKernel.setTaskPriorityLevel(i, e, t)
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        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 i = t[1];
                if (1 === i.getIsDownload()) {
                    let t = i.getBtFileAttribute(o.DownloadKernel.BtFileAttribute.FileSize);
                    t && (e += t)
                }
            }
            return e
        }

        setDownloadFile(e) {
            let t = 0;
            for (let i of this.fileLists) {
                let n = i[1], a = n.getFileIndex();
                if (e.indexOf(a) > -1) {
                    n.setIsDownload(1);
                    let e = n.getBtFileAttribute(o.DownloadKernel.BtFileAttribute.DownloadSize);
                    e && e > 0 && (t += e)
                } else n.setIsDownload(0)
            }
            this.downloadIndexLists = e, p.information("setDownloadFile", t), this.task.setDownloadSize(t)
        }

        getBtFileList() {
            return this.fileLists
        }

        getBtFileInfoList() {
            let e = [];
            for (let t of this.fileLists) {
                let i = t[1].getBtFileInfo();
                e.push(i)
            }
            return e
        }

        updateSubFileInfo(e) {
            if (e && e.length > 0) {
                let t = !1, i = !1, n = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t], a = i.realIndex, r = this.fileLists.get(a), s = this.getFileStatus(i.fileStatus),
                        l = i.errorCode;
                    0 !== l && (s = l > 700 ? o.DownloadKernel.BtFileStatus.Forbidden : o.DownloadKernel.BtFileStatus.Error, r && n.push(a)), i.fileStatus = s, r && r.updateFileInfo(i)
                }
                if (n.length > 0) {
                    let e = this.getDownloadFile();
                    for (let a = 0; a < n.length; ++a) for (let r = 0; r < e.length; ++r) if (e[r] === n[a]) {
                        this.subError || (this.subError = !0, i = !0);
                        let e = n[a], r = this.fileLists.get(e);
                        r && r.getBtFileAttribute(o.DownloadKernel.BtFileAttribute.ErrorCode) > 700 && (t = !0);
                        break
                    }
                }
                let a = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                if (g.fireTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDetailChanged, a, e), i) {
                    let e = "Error";
                    t && (e = "Forbidden"), g.fireTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileForbidden, a, e)
                }
            }
        }

        deleteStorageBtFile() {
            let e = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
            r.ThunderKernel.deleteStorageTask(e, s.StatementType.DestroyBtFile)
        }

        loadBtTask(e) {
            let t = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
            r.ThunderKernel.loadStorageTask(t, s.StatementType.LoadBtTask, i => {
                i ? (this.infoId = i.infoId, this.tracker = i.tracker, this.seedFile = i.seedFile, this.displayName = i.displayName, r.ThunderKernel.loadStorageTask(t, s.StatementType.LoadBtFile, t => {
                    if (t) for (let e = 0; e < t.length; ++e) {
                        let i = t[e], n = new l.BtFile(this);
                        n.setFileData(i), this.fileLists.set(i.realIndex, n), 1 === i.download && this.downloadIndexLists.push(i.realIndex)
                    }
                    this.loadSubFileEnd = !0, e(i, t)
                }), this.updateSeedFile().catch()) : e(null, null)
            })
        }

        updateSeedFile() {
            return n(this, void 0, void 0, function* () {
                if (this.seedFile && !(yield h.FileSystemAWNS.existsAW(this.seedFile))) {
                    let e = a.basename(this.seedFile), t = a.join(__profilesDir, "Torrents"), i = a.join(t, e);
                    if (yield h.FileSystemAWNS.existsAW(i)) {
                        this.seedFile = i;
                        let e = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        r.ThunderKernel.saveBtTaskSeedFile(e, i)
                    }
                }
            })
        }

        isBtFileLoadEnd() {
            return this.loadSubFileEnd
        }

        getFileStatus(e) {
            let t = o.DownloadKernel.BtFileStatus.Stopped;
            switch (e) {
                case 0:
                    break;
                case 1:
                    t = o.DownloadKernel.BtFileStatus.Stopped;
                    break;
                case 2:
                    t = o.DownloadKernel.BtFileStatus.Started;
                    break;
                case 3:
                    t = o.DownloadKernel.BtFileStatus.Complete
            }
            return t
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(30), o = i(15), r = i(39), s = o.DownloadKernelEventManager.getEventManager();
    t.BtFile = class {
        constructor(e) {
            this.attribute = new Map;
            for (let e = n.DownloadKernel.BtFileAttribute.NumberStrart; e < n.DownloadKernel.BtFileAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = n.DownloadKernel.BtFileAttribute.StringStart; e < n.DownloadKernel.BtFileAttribute.StringEnd; ++e) this.attribute.set(e, "");
            this.attribute.set(n.DownloadKernel.BtFileAttribute.DcdnStatus, n.DownloadKernel.DcdnStatusCode.Unkown), this.btTask = e;
            let t = this.btTask.getTask().getTaskAttribute(n.DownloadKernel.TaskAttribute.TaskId);
            this.taskId = t, this.attribute.set(n.DownloadKernel.BtFileAttribute.TaskId, t)
        }

        getBtFileAttribute(e) {
            return this.attribute.get(e)
        }

        updateFileInfo(e) {
            this.realIndex = e.realIndex, this.attribute.set(n.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.EnableDcdn, e.enableDcdn), this.setAttribute(n.DownloadKernel.BtFileAttribute.ErrorCode, e.errorCode) && a.ThunderKernel.setBtFileFailureErrorCode(this.realIndex, this.taskId, this.attribute.get(n.DownloadKernel.BtFileAttribute.ErrorCode)), e.relativePath && this.attribute.set(n.DownloadKernel.BtFileAttribute.RelativePath, e.relativePath), e.finalName && "" !== e.finalName && (this.attribute.set(n.DownloadKernel.BtFileAttribute.FinalName, e.finalName), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileName, e.finalName));
            let t = this.setAttribute(n.DownloadKernel.BtFileAttribute.FileStatus, e.fileStatus),
                i = this.setAttribute(n.DownloadKernel.BtFileAttribute.DownloadSize, e.downloadSize);
            (t || i) && a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(n.DownloadKernel.BtFileAttribute.DownloadSize)), e.cid && "" !== e.cid && e.gcid && "" !== e.gcid && this.updateCidAndGcid(e.cid, e.gcid);
            let o = this.attribute.get(n.DownloadKernel.BtFileAttribute.DcdnStatus);
            if (o !== e.dcdnStatus) {
                this.attribute.set(n.DownloadKernel.BtFileAttribute.DcdnStatus, e.dcdnStatus);
                let t = this.btTask.getTask().getId();
                s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, t, this.realIndex, e.dcdnStatus, o)
            }
        }

        saveBtFileInfo(e, t, i) {
            if (this.download = t, this.realIndex = i.realIndex, this.attribute.set(n.DownloadKernel.BtFileAttribute.Download, t), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileSize, i.fileSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, i.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, i.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileOffset, i.fileOffset), i.fileName && this.attribute.set(n.DownloadKernel.BtFileAttribute.FileName, i.fileName), i.filePath && this.attribute.set(n.DownloadKernel.BtFileAttribute.FilePath, i.filePath), e) {
                let e = {
                    taskId: this.taskId,
                    status: 0,
                    realIndex: i.realIndex,
                    visible: 1,
                    download: t,
                    fileSize: i.fileSize,
                    fileOffset: i.fileOffset,
                    filePath: void 0 === i.filePath ? "" : i.filePath,
                    fileName: void 0 === i.fileName ? "" : i.fileName
                };
                a.ThunderKernel.insertBtFile(this.taskId, e)
            }
        }

        getBtFileInfo() {
            let e = {};
            return e.fileSize = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileSize), e.realIndex = this.attribute.get(n.DownloadKernel.BtFileAttribute.RealIndex), e.fileOffset = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileOffset), e.fileName = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileName), e.filePath = this.attribute.get(n.DownloadKernel.BtFileAttribute.FilePath), e
        }

        getBtDownloadFileInfo() {
            return {
                realIndex: this.attribute.get(n.DownloadKernel.BtFileAttribute.RealIndex),
                fileStatus: this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus),
                downloadSize: this.attribute.get(n.DownloadKernel.BtFileAttribute.DownloadSize),
                fileSize: this.attribute.get(n.DownloadKernel.BtFileAttribute.FileSize),
                enableDcdn: this.attribute.get(n.DownloadKernel.BtFileAttribute.EnableDcdn),
                errorCode: this.attribute.get(n.DownloadKernel.BtFileAttribute.ErrorCode),
                dcdnStatus: this.attribute.get(n.DownloadKernel.BtFileAttribute.DcdnStatus),
                relativePath: this.attribute.get(n.DownloadKernel.BtFileAttribute.RelativePath),
                finalName: this.attribute.get(n.DownloadKernel.BtFileAttribute.FinalName),
                cid: this.attribute.get(n.DownloadKernel.BtFileAttribute.Cid),
                gcid: this.attribute.get(n.DownloadKernel.BtFileAttribute.Gcid),
                userRead: this.attribute.get(n.DownloadKernel.BtFileAttribute.UserRead),
                playPosition: this.attribute.get(n.DownloadKernel.BtFileAttribute.PlayPosition),
                duration: this.attribute.get(n.DownloadKernel.BtFileAttribute.Duration)
            }
        }

        getIsDownload() {
            return this.download
        }

        setIsDownload(e) {
            this.download !== e && (this.download = e, this.attribute.set(n.DownloadKernel.BtFileAttribute.Download, e), a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(n.DownloadKernel.BtFileAttribute.DownloadSize)))
        }

        getUserRead() {
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.UserRead)
        }

        setUserRead(e) {
            0 !== e && (e = 1);
            let t = !1;
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.UserRead) !== e && (this.attribute.set(n.DownloadKernel.BtFileAttribute.UserRead, e), a.ThunderKernel.saveBtFileUserRead(this.taskId, this.realIndex, e), s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [this.getBtDownloadFileInfo()]), t = !0), t
        }

        setPlayPosition(e) {
            let t = !1;
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.PlayPosition) !== e && (this.attribute.set(n.DownloadKernel.BtFileAttribute.PlayPosition, e), a.ThunderKernel.setBtFilePlayPosition(this.taskId, this.realIndex, e), s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [this.getBtDownloadFileInfo()]), t = !0), t
        }

        setDuration(e) {
            let t = !1;
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.Duration) !== e && (this.attribute.set(n.DownloadKernel.BtFileAttribute.Duration, e), a.ThunderKernel.setBtFileDuration(this.taskId, this.realIndex, e), s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [this.getBtDownloadFileInfo()]), t = !0), t
        }

        isSupportPlay() {
            let e = !1;
            if (this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus) === n.DownloadKernel.BtFileStatus.Forbidden) e = !1; else {
                let t = this.attribute.get(n.DownloadKernel.BtFileAttribute.Download),
                    i = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileName);
                1 === t && (e = r.TaskUtilHelper.isVideoFileExt(i))
            }
            return e
        }

        getFileIndex() {
            return this.realIndex
        }

        setFileData(e) {
            this.download = e.download, this.taskId = e.taskId, this.realIndex = e.realIndex, this.attribute.set(n.DownloadKernel.BtFileAttribute.TaskId, e.taskId), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileOffset, e.fileOffset), this.attribute.set(n.DownloadKernel.BtFileAttribute.DownloadSize, e.receivedSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileStatus, e.status), this.attribute.set(n.DownloadKernel.BtFileAttribute.Visible, e.visible), this.attribute.set(n.DownloadKernel.BtFileAttribute.Download, e.download), e.filePath && this.attribute.set(n.DownloadKernel.BtFileAttribute.FilePath, e.filePath), e.fileName && this.attribute.set(n.DownloadKernel.BtFileAttribute.FileName, e.fileName), e.cid && this.attribute.set(n.DownloadKernel.BtFileAttribute.Cid, e.cid), e.gcid && this.attribute.set(n.DownloadKernel.BtFileAttribute.Gcid, e.gcid), e.userRead && this.attribute.set(n.DownloadKernel.BtFileAttribute.UserRead, e.userRead), e.playPosition && this.attribute.set(n.DownloadKernel.BtFileAttribute.PlayPosition, e.playPosition), e.duration && this.attribute.set(n.DownloadKernel.BtFileAttribute.Duration, e.duration), this.attribute.set(n.DownloadKernel.BtFileAttribute.ErrorCode, e.failureErrorCode)
        }

        updateCidAndGcid(e, t) {
            let i = !1, o = this.attribute.get(n.DownloadKernel.BtFileAttribute.Cid),
                r = this.attribute.get(n.DownloadKernel.BtFileAttribute.Gcid);
            o && "" !== o || ("0000000000000000000000000000000000000000" === e ? this.setAttribute(n.DownloadKernel.BtFileAttribute.Cid, "") : this.setAttribute(n.DownloadKernel.BtFileAttribute.Cid, e), o = e, i = !0), r && "" !== r || ("0000000000000000000000000000000000000000" === t ? this.setAttribute(n.DownloadKernel.BtFileAttribute.Gcid, "") : this.setAttribute(n.DownloadKernel.BtFileAttribute.Gcid, t), r = t, i = !0), i && a.ThunderKernel.saveBtFileCid(this.taskId, this.realIndex, o, r)
        }

        setAttribute(e, t) {
            let i = !1;
            return this.attribute.get(e) !== t && void 0 !== t && (this.attribute.set(e, t), i = !0), i
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(43), a = i(3), o = i(30), r = i(95), s = i(118), l = i(4), d = i(2);
    t.EmuleTask = class {
        constructor(e, t) {
            if (this.task = e, this.configPath = d.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);
                n.Common.isThunderPrivateUrl(t) && (t = n.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 i = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.UserData);
            this.userData = new s.TaskUserData(e, i)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            l.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let i = this.task.getVirtualTaskId();
            i && i > 0 && !l.isNullOrUndefined(t) && o.ThunderKernel.setTaskPriorityLevel(i, e, t)
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(3), s = i(30), l = i(95), d = i(15), u = i(118), c = i(0),
        h = d.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 i = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.UserData);
            this.userData = new u.TaskUserData(e, i)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            if (-1 === e) for (let e = 0; e < this.subTasks.length; ++e) {
                let i = this.subTasks[e].getExtraObject();
                i && i.setTaskPriorityLevel(-1, t)
            } else {
                let i = this.getSubTaskByIndex(e);
                if (i) {
                    let e = i.getExtraObject();
                    e && e.setTaskPriorityLevel(-1, t)
                }
            }
        }

        setSubTaskFileSize(e, t) {
            let i = !1, n = this.subTasks[e];
            if (n && (i = n.setFileSize(t))) {
                let e = 0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    if (i) {
                        if (0 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                        let t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize);
                        t && (e += t)
                    }
                }
                this.task.setFileSize(e)
            }
            return i
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        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 i = this.subTasks[t];
                i && 1 === i.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) {
            return n(this, void 0, void 0, function* () {
                let t = !1, i = 0, n = 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)) {
                        n++;
                        continue
                    }
                    let s = o.getTaskStatus();
                    if (s !== r.DownloadKernel.TaskStatus.Succeeded && s !== r.DownloadKernel.TaskStatus.Seeding) if (s !== r.DownloadKernel.TaskStatus.Failed) {
                        if ((yield o.start(e)) && (t = !0, ++i >= this.startTaskCount)) break
                    } else (yield o.start(e)) && (t = !0); else n++
                }
                return n === this.subTasks.length && (t = !0), e && (t = !0), t
            })
        }

        stop(e) {
            let t = !1;
            for (let i = 0; i < this.subTasks.length; ++i) {
                let n = this.subTasks[i];
                if (!n) continue;
                let a = n.getTaskStatus();
                a !== r.DownloadKernel.TaskStatus.Succeeded && a !== r.DownloadKernel.TaskStatus.Seeding && n.stop(e) && (t = !0)
            }
            return t
        }

        deleteStorageTask() {
            for (let e = 0; e < this.subTasks.length; ++e) {
                let t = this.subTasks[e];
                t && t.deleteStorageTask()
            }
        }

        deleteFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    i && (e = (yield i.deleteFile()) && e)
                }
                let t = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath), n = [t];
                for (let e = 0; e < this.subTasks.length; ++e) {
                    let i = this.subTasks[e];
                    if (i) {
                        let e = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                        for (; e.length > t.length && !n.includes(e);) n = n.concat([e]), e = a.parse(e).dir
                    }
                }
                n.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), f.information("task.delete savePaths:", n);
                for (let t = 0; t < n.length; ++t) {
                    let i = n[t];
                    (yield o.FileSystemAWNS.existsAW(i)) && (e = (yield o.FileSystemAWNS.rmdirAW(i)) && e)
                }
                const {TaskUserDataGUID: s} = yield Promise.resolve().then(() => i(51));
                let l = this.getUserData(s.guidNotSavePath, "notSavePath");
                if (l && (t = a.normalize(t), l = a.normalize(l), 0 === t.indexOf(l))) {
                    let e = l.indexOf(":\\");
                    if (-1 !== e) {
                        let t = l.substr(0, e + ":\\".length);
                        t && o.FileSystemAWNS.deleteEmptySubDirs(l, t).catch()
                    }
                }
                return e
            })
        }

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

        querySubTaskInfo(e, t, i) {
            let a = !1, o = 0, l = 0, d = !1, u = [];
            for (let c = 0; c < this.subTasks.length; ++c) {
                let f = this.subTasks[c];
                if (!f) continue;
                let g = f.getTaskStatus();
                if (g === r.DownloadKernel.TaskStatus.Stopped || g === r.DownloadKernel.TaskStatus.Succeeded || g === r.DownloadKernel.TaskStatus.Seeding || g === r.DownloadKernel.TaskStatus.Failed) continue;
                let p = f.getTaskAttribute(r.DownloadKernel.TaskAttribute.VirtualId);
                p < 1 || (o++, a = s.ThunderKernel.queryTaskInfo(p, a => n(this, void 0, void 0, function* () {
                    if (l++, null !== a) {
                        let i = f.updateTaskInfo(a, e, t);
                        1 & i && (d = !0), i > 0 && u.push(f)
                    }
                    if (o === l && (this.updateTaskDetail(), d && (yield this.checkSubTaskStatus()), this.updateTaskStatus() && e(this.task), i(), u.length > 0)) {
                        let e = new Map;
                        e.set(this.taskId, u), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
                    }
                })))
            }
            return 0 === o && (this.subTasks.length > 0 && e(this.subTasks[0]), this.updateTaskDetail(), this.updateTaskStatus(), i()), a
        }

        getErrorCodes() {
            let e = [];
            do {
                if (this.task.getTaskStatus() !== r.DownloadKernel.TaskStatus.Failed) break;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    if (0 !== i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask) && i.getTaskStatus() === r.DownloadKernel.TaskStatus.Failed) {
                        let t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode);
                        -1 === e.indexOf(t) && e.push(t)
                    }
                }
            } while (0);
            return e
        }

        getTaskStatus() {
            let e = 0, t = 0, i = 0, n = 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 d = 0;
            for (let l = 0; l < this.subTasks.length; ++l) {
                let u = this.subTasks[l], c = !1;
                if (u) {
                    if (0 === u.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                        d++;
                        continue
                    }
                    switch (u.getTaskStatus()) {
                        case r.DownloadKernel.TaskStatus.Unkown:
                            e++;
                            break;
                        case r.DownloadKernel.TaskStatus.Started:
                            i++, c = !0;
                            break;
                        case r.DownloadKernel.TaskStatus.StartPending:
                            n++;
                            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 u = !1;
            l !== r.DownloadKernel.TaskStatus.StopPending && (i > 0 ? (l = r.DownloadKernel.TaskStatus.Started, u = !0) : n > 0 && l !== r.DownloadKernel.TaskStatus.Started && (l = r.DownloadKernel.TaskStatus.StartPending, u = !0));
            let c = this.subTasks.length - d;
            return u || (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.Succeeded : t > 0 && l !== r.DownloadKernel.TaskStatus.Started && (l = r.DownloadKernel.TaskStatus.Stopped)), l
        }

        setDownloadTask(e) {
            let t = 0, i = [];
            for (let n = 0; n < this.subTasks.length; ++n) {
                let a = this.subTasks[n], o = !1, s = !1;
                for (let i = 0; i < e.length; ++i) if (n === e[i]) {
                    s = a.updateDownloadSubTask(1), o = !0;
                    let e = a.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize);
                    e && e > 0 && (t += e);
                    break
                }
                o || (s = a.updateDownloadSubTask(0)), s && i.push(a)
            }
            if (t && this.updateTaskDetail(), i.length > 0) {
                let e = new Map;
                e.set(this.taskId, i), 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 i = this.subTasks[t];
                if (i) {
                    if (0 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                    let t = i.getDownloadSpeed(), n = i.getVipSpeed(),
                        a = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize),
                        o = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize),
                        s = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ReceivedSize),
                        l = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcUsing),
                        d = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcTotal), u = i.getTaskChannelInfo();
                    u && (e.channelInfo.p2pSize += u.p2pSize, e.channelInfo.p2sSize += u.p2sSize, e.channelInfo.offlineSize += u.offlineSize, e.channelInfo.originSize += u.originSize, e.channelInfo.dcdnSize += u.dcdnSize), t && (e.downloadSpeed += t), n && (e.vipSpeed += n), a && (e.fileSize += a), o && (e.downloadSize += o), s && (e.receivedSize += s), l && (e.usingResCount += l), d && (e.totalResCount += d)
                }
            }
            if (e.downloadSize) {
                let t = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.TotalDownloadSize);
                void 0 !== t && 0 !== t && (e.downloadSpeed = e.downloadSize - t), this.task.internalSetTotalDownloadSize(e.downloadSize)
            }
            return e.downloadSpeed < 0 && (e.downloadSpeed = 0), e
        }

        updateTaskStatus() {
            let e = this.getTaskStatus();
            return this.task.updateTaskStatus(e)
        }

        checkSubTaskStatus() {
            return n(this, void 0, void 0, function* () {
                let e = this.task.getTaskStatus();
                e !== r.DownloadKernel.TaskStatus.Stopped && e !== r.DownloadKernel.TaskStatus.StopPending && (yield this.startWaittingTasks())
            })
        }

        startWaittingTasks() {
            return n(this, void 0, void 0, function* () {
                let e = 0, t = 0;
                for (let i = 0; i < this.subTasks.length; ++i) {
                    let n = this.subTasks[i];
                    if (!n) continue;
                    if (0 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                    let a = n.getTaskStatus();
                    a !== r.DownloadKernel.TaskStatus.Started && a !== r.DownloadKernel.TaskStatus.StartPending || (e++, t = i)
                }
                if (e < this.startTaskCount && t < this.subTasks.length) for (let i = t + 1; i < this.subTasks.length; ++i) {
                    let t = this.subTasks[i];
                    if (!t) continue;
                    if (0 === t.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                    let n = t.getTaskStatus();
                    if (n !== r.DownloadKernel.TaskStatus.Succeeded && n !== r.DownloadKernel.TaskStatus.Seeding && n !== r.DownloadKernel.TaskStatus.Failed && (yield 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, i = this.downloadingPeriod + Math.round(t);
                this.task.internalSetDownloadingPeriod(i) && (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, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(3), o = i(331), r = i(435), s = n.default.getLogger("DownloadKernel.PrivateCategory");

    class l extends r.Category {
        constructor(e) {
            super(e);
            let t = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Downloading),
                i = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Completed);
            this.categoryViews.push(t), this.categoryViews.push(i)
        }

        static createCategoryFromData(e) {
            let t = e.categoryId;
            if (void 0 === t || t < 0) return null;
            s.information("createCategoryFromData ", e);
            let i = new l(t);
            return i.setName(e.name), i.setParentId(e.parentId), i.setNextId(e.nextId), i.setStatus(e.status), i.setDescription(e.description), i.setDefaultPath(e.defaultPath), i.setUserName(e.userName), i.setPassword(e.password, e.passwordV2), i.setAccountPassword(e.accountPassword), i
        }
    }

    t.PrivateCategory = l
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(437), o = i(543), r = i(332);

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

    var l = s(r);
    l.Axios = o, l.create = function (e) {
        return s(n.merge(r, e))
    }, l.Cancel = i(444), l.CancelToken = i(559), l.isCancel = i(443), l.all = function (e) {
        return Promise.all(e)
    }, l.spread = i(560), e.exports = l, e.exports.default = l
}, function (e, t) {
    function i(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 && (i(e) || function (e) {
            return "function" == typeof e.readFloatLE && "function" == typeof e.slice && i(e.slice(0, 0))
        }(e) || !!e._isBuffer)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(332), a = i(48), o = i(554), r = i(555);

    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(n, {method: "get"}, this.defaults, e)).method = e.method.toLowerCase();
        var t = [r, void 0], i = 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;) i = i.then(t.shift(), t.shift());
        return i
    }, a.forEach(["delete", "get", "head", "options"], function (e) {
        s.prototype[e] = function (t, i) {
            return this.request(a.merge(i || {}, {method: e, url: t}))
        }
    }), a.forEach(["post", "put", "patch"], function (e) {
        s.prototype[e] = function (t, i, n) {
            return this.request(a.merge(n || {}, {method: e, url: t, data: i}))
        }
    }), e.exports = s
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = function (e, t) {
        n.forEach(e, function (i, n) {
            n !== t && n.toUpperCase() === t.toUpperCase() && (e[t] = i, delete e[n])
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(438), o = i(440), r = i(546), s = i(547), l = i(333),
        d = "undefined" != typeof window && window.btoa && window.btoa.bind(window) || i(548);
    e.exports = function (e) {
        return new Promise(function (t, u) {
            var c = e.data, h = e.headers;
            n.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 v = e.auth.username || "", m = e.auth.password || "";
                h.Authorization = "Basic " + d(v + ":" + 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 i = "getAllResponseHeaders" in f ? r(f.getAllResponseHeaders()) : null, n = {
                        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: i,
                        config: e,
                        request: f
                    };
                    a(t, u, n), f = null
                }
            }, f.onerror = function () {
                u(l("Network Error", e, null, f)), f = null
            }, f.ontimeout = function () {
                u(l("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", f)), f = null
            }, n.isStandardBrowserEnv()) {
                var y = i(549),
                    k = (e.withCredentials || s(e.url)) && e.xsrfCookieName ? y.read(e.xsrfCookieName) : void 0;
                k && (h[e.xsrfHeaderName] = k)
            }
            if ("setRequestHeader" in f && n.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(), u(e), f = null)
            }), void 0 === c && (c = null), f.send(c)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48),
        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, i, o, r = {};
        return e ? (n.forEach(e.split("\n"), function (e) {
            if (o = e.indexOf(":"), t = n.trim(e.substr(0, o)).toLowerCase(), i = n.trim(e.substr(o + 1)), t) {
                if (r[t] && a.indexOf(t) >= 0) return;
                r[t] = "set-cookie" === t ? (r[t] ? r[t] : []).concat([i]) : r[t] ? r[t] + ", " + i : i
            }
        }), r) : r
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = n.isStandardBrowserEnv() ? function () {
        var e, t = /(msie|trident)/i.test(navigator.userAgent), i = document.createElement("a");

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

        return e = a(window.location.href), function (t) {
            var i = n.isString(t) ? a(t) : t;
            return i.protocol === e.protocol && i.host === e.host
        }
    }() : function () {
        return !0
    }
}, function (e, t, i) {
    "use strict";
    var n = "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, i, o = String(e), r = "", s = 0, l = n; o.charAt(0 | s) || (l = "=", s % 1); r += l.charAt(63 & t >> 8 - s % 1 * 8)) {
            if ((i = o.charCodeAt(s += .75)) > 255) throw new a;
            t = t << 8 | i
        }
        return r
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = n.isStandardBrowserEnv() ? {
        write: function (e, t, i, a, o, r) {
            var s = [];
            s.push(e + "=" + encodeURIComponent(t)), n.isNumber(i) && s.push("expires=" + new Date(i).toGMTString()), n.isString(a) && s.push("path=" + a), n.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, i) {
    function n() {
        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 = i(551)).log = function () {
        return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments)
    }, t.formatArgs = function (e) {
        var i = this.useColors;
        if (e[0] = (i ? "%c" : "") + this.namespace + (i ? " %c" : " ") + e[0] + (i ? "%c " : " ") + "+" + t.humanize(this.diff), !i) return;
        var n = "color: " + this.color;
        e.splice(1, 0, n, "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, n)
    }, t.save = function (e) {
        try {
            null == e ? t.storage.removeItem("debug") : t.storage.debug = e
        } catch (e) {
        }
    }, t.load = n, 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(n())
}, function (e, t, i) {
    function n(e) {
        var i;

        function n() {
            if (n.enabled) {
                var e = n, a = +new Date, o = a - (i || a);
                e.diff = o, e.prev = i, e.curr = a, i = 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 (i, n) {
                    if ("%%" === i) return i;
                    l++;
                    var a = t.formatters[n];
                    if ("function" == typeof a) {
                        var o = r[l];
                        i = a.call(e, o), r.splice(l, 1), l--
                    }
                    return i
                }), t.formatArgs.call(e, r), (n.log || t.log || console.log.bind(console)).apply(e, r)
            }
        }

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

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

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

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

    e.exports = function (e, t) {
        t = t || {};
        var l, d = typeof e;
        if ("string" === d && 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 * n;
                case"seconds":
                case"second":
                case"secs":
                case"sec":
                case"s":
                    return s * i;
                case"milliseconds":
                case"millisecond":
                case"msecs":
                case"msec":
                case"ms":
                    return s;
                default:
                    return
            }
        }(e);
        if ("number" === d && !1 === isNaN(e)) return t.long ? s(l = e, o, "day") || s(l, a, "hour") || s(l, n, "minute") || s(l, i, "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 >= n) return Math.round(e / n) + "m";
            if (e >= i) return Math.round(e / i) + "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:\\thunder11\\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:\\thunder11\\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, i) {
    "use strict";
    var n = i(48);

    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) {
        n.forEach(this.handlers, function (t) {
            null !== t && e(t)
        })
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(556), o = i(443), r = i(332), s = i(557), l = i(558);

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

    e.exports = function (e) {
        return d(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 = n.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {}), n.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
            delete e.headers[t]
        }), (e.adapter || r.adapter)(e).then(function (t) {
            return d(e), t.data = a(t.data, t.headers, e.transformResponse), t
        }, function (t) {
            return o(t) || (d(e), t && t.response && (t.response.data = a(t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = function (e, t, i) {
        return n.forEach(i, function (i) {
            e = i(e, t)
        }), e
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e) {
        return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t) {
        return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
    }
}, function (e, t, i) {
    "use strict";
    var n = i(444);

    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 i = this;
        e(function (e) {
            i.reason || (i.reason = new n(e), t(i.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, i) {
    "use strict";
    e.exports = function (e) {
        return function (t) {
            return e.apply(null, t)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = new class {
        getUserInfo(e, t) {
            let i = "string" == typeof e ? e : "", n = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "userinfo", function (e) {
                if (e) {
                    let t = "" !== i ? e[i] : e;
                    n && n(t)
                } else n && n(null)
            })
        }

        getAllUserInfo(e, t) {
            let i = "string" == typeof e ? e : "", n = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "allUserInfo", function (e) {
                if (e) {
                    let t = "" !== i ? e[i] : e;
                    n && n(t)
                } else n && n(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, i) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("SaveLoginData", e, t, i, 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 i = t || [];
                if (0 == i.length) e(!1); else {
                    let t = i[0];
                    e(!!t.xl_autologin)
                }
            })
        }

        getXdasDatas(e, t, i) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("LoadLoginData", e, t, function (e, t) {
                let n = "" !== t ? JSON.parse(t) : null;
                i && i(n)
            })
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(6), o = i(24), r = i(14), s = i(9), l = i(120), d = i(0).default.getLogger("Activity");
    t.activityObj = new class {
        constructor() {
            this.activityEnable = !1, this.activityCssPath = "", this.activityUrl = ""
        }

        getActiveConfig() {
            return n(this, void 0, void 0, function* () {
                do {
                    this.activityEnable = !1, yield o.default.isInitedAw();
                    let e = o.default.getConfigInfo("activity", "enable");
                    if (d.information("getActiveConfig activityEnable:", e), null === e || void 0 === e) break;
                    if (1 !== e) break;
                    let t = o.default.getConfigInfo("activity", "url");
                    if (null === t || void 0 === t || "" === t) {
                        d.information("活动url为空");
                        break
                    }
                    let i = `${__rootDir}/static/activity/css/xlx-login-act.css`;
                    if (yield a.FileSystemAWNS.existsAW(i)) {
                        this.activityEnable = !0, this.activityCssPath = i, this.activityUrl = t;
                        let e = {
                            priority: l.LoginOptionNS.Priority.High,
                            perpetual: !0,
                            tabUrl: this.activityUrl,
                            stat: {logfrom: "activity_vip_get"}
                        };
                        l.LoginOptionNS.loginOption.setOption(e)
                    } else d.information("活动css不存在：", i), this.activityEnable = !1, this.activityCssPath = ""
                } while (0);
                d.information("getActiveConfig:", this.activityEnable, this.activityCssPath, this.activityUrl)
            })
        }

        isHaverActivityAw(e) {
            return n(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 n(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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(564), o = i(19), r = i(5), s = i(0).default.getLogger("xmp-vip-download-kernel-helper");
    var l;
    !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"
    }(l = t.DkEventNS || (t.DkEventNS = {}));

    class d extends o.EventEmitter {
        constructor() {
            super(), this.mPeerId = void 0, this.init()
        }

        init() {
            this.setMaxListeners(0)
        }

        getTpPeerId() {
            return n(this, void 0, void 0, function* () {
                if (this.mPeerId) return this.mPeerId;
                {
                    let e = yield r.client.callServerFunction("GetTpPeerId");
                    return e && "" !== e && (this.mPeerId = e), this.mPeerId || ""
                }
            })
        }

        getCurrentCategoryId() {
            return n(this, void 0, void 0, function* () {
                return yield r.client.callServerFunction("GetCurrentCategoryId")
            })
        }

        getTaskBaseInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = null, i = yield r.client.callServerFunction("GetTaskBaseInfo", e);
                if (i) try {
                    t = JSON.parse(i)
                } catch (e) {
                    s.warning(e)
                }
                return t
            })
        }

        getTaskGcid(e) {
            return n(this, void 0, void 0, function* () {
                let t = yield this.getTaskBaseInfo(e), i = "";
                return t && t.gcid && (i = t.gcid), i
            })
        }

        getTaskStatus(e) {
            return n(this, void 0, void 0, function* () {
                return yield r.client.callServerFunction("GetTaskStatus", e)
            })
        }

        IsTaskExist(e) {
            return n(this, void 0, void 0, function* () {
                return yield r.client.callServerFunction("IsTaskExist", e)
            })
        }

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

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

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

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

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

        enableDcdnWithVipCert(e, t) {
            return n(this, void 0, void 0, function* () {
                s.information("enableDcdnWithVipCert", "taskId", e, "vipCert", t), yield r.client.callServerFunction("EnableDcdnWithVipCert", e, t)
            })
        }

        updateDcdnWithVipCert(e, t) {
            return n(this, void 0, void 0, function* () {
                s.information("updateDcdnWithVipCert", "taskId", e, "vipCert", t), yield r.client.callServerFunction("UpdateDcdnWithVipCert", e, t)
            })
        }

        disableDcdnWithVipCert(e) {
            return n(this, void 0, void 0, function* () {
                s.information("disableDcdnWithVipCert", "taskId", e), yield r.client.callServerFunction("DisableDcdnWithVipCert", e)
            })
        }

        getDownloadingActiveTaskId() {
            return n(this, void 0, void 0, function* () {
                return yield r.client.callServerFunction("GetDownloadingActiveTaskId")
            })
        }

        attachDkEvents() {
            r.client.attachServerEvent("OnTaskInserted", this.onTaskInserted.bind(this)), r.client.attachServerEvent("OnTaskRemoved", this.onTaskRemoved.bind(this)), r.client.attachServerEvent("OnTaskStatusChanged", (e, t) => {
                {
                    let e = null;
                    try {
                        e = JSON.parse(t)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== e) for (let t in e) {
                        let i = e[t];
                        this.onTaskStatusChanged(Number(t), i)
                    }
                }
            }), r.client.attachServerEvent("OnTaskDetailChanged", (e, t, i) => {
                t.forEach(e => n(this, void 0, void 0, function* () {
                    this.onTaskDetailChanged(Number(e), yield this.getTaskBaseInfo(e))
                }))
            }), r.client.attachServerEvent("OnTaskDcdnStatusChanged", (e, t) => {
                if (null !== t) for (let e in t) {
                    let i = t[e];
                    this.onTaskDcdnStatusChanged(Number(e), i)
                }
            }), r.client.attachServerEvent("OnBtSubFileDcdnStatusChanged", this.onBtSubFileDcdnStatusChanged.bind(this)), r.client.attachServerEvent("OnBtSubFileDetailChanged", (e, t, i) => {
                {
                    let e = null;
                    try {
                        e = JSON.parse(i)
                    } catch (e) {
                        s.warning(e)
                    }
                    null !== e && this.onBtSubFileDetailChanged(t, e)
                }
            })
        }

        operateTask(e, t, i) {
            r.client.callServerFunction("OperateTask", e, t, i).catch()
        }

        onTaskInserted(e, t, i, n) {
            if (s.information("onTaskInserted categoryId:", t, ", categoryViewId:", i), null !== n) switch (i) {
                case a.DownloadKernel.CategroyViewID.Downloading:
                    n.forEach(e => {
                        this.emit(l.taskInserted, e)
                    });
                    break;
                case a.DownloadKernel.CategroyViewID.Completed:
                    n.forEach(e => {
                        this.emit(l.taskCompleted, e)
                    })
            }
        }

        onTaskRemoved(e, t, i, n) {
            if (s.information("onTaskRemoved categoryId:", t, ", categoryViewId:", i), n) switch (i) {
                case a.DownloadKernel.CategroyViewID.Downloading:
                case a.DownloadKernel.CategroyViewID.Completed:
                    n.forEach(e => {
                        this.emit(l.taskRemoved, e)
                    })
            }
        }

        onTaskStatusChanged(e, t) {
            this.emit(l.taskStatusChanged, e, t)
        }

        onTaskDetailChanged(e, t) {
            this.emit(l.taskDetailChanged, e, t)
        }

        onTaskDcdnStatusChanged(e, t) {
            this.emit(l.taskDcdnStatusChanged, e, t)
        }

        onBtSubFileDcdnStatusChanged(e, t, i, n) {
            this.emit(l.btSubFileDcdnStatusChanged, t, i, n)
        }

        onBtSubFileDetailChanged(e, t) {
            this.emit(l.btSubFileDetailChanged, e, t)
        }
    }

    t.DkHelper = d, t.default = new d
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i, n, a, o, r, s, l, d, u, c, h, f, g, p, v, m, y, k;
        !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"
        }(i = 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"
        }(n = 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"
        }(d = 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"
        }(u = 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"
        }(v = 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"
        }(y = 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"
        }(k = e.TaskStopReason || (e.TaskStopReason = {}))
    }(t.DownloadKernel || (t.DownloadKernel = {}))
}, function (e, t, i) {
    (function () {
        "use strict";
        var e, n, a, o, r, s = {}.hasOwnProperty;
        e = i(566), n = i(339).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, i, a;
                for (t in this.options = {}, i = n[.2]) s.call(i, t) && (a = i[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 i, a, l, d, u, c;
                return i = this.options.attrkey, a = this.options.charkey, 1 === Object.keys(t).length && this.options.rootName === n[.2].rootName ? t = t[u = Object.keys(t)[0]] : u = this.options.rootName, c = this, l = function (e, t) {
                    var n, d, u, 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 d = t[h]) u = d[f], e = l(e.ele(f), u).up()
                    } else for (f in t) if (s.call(t, f)) if (d = t[f], f === i) {
                        if ("object" == typeof d) for (n in d) g = d[n], e = e.att(n, g)
                    } else if (f === a) e = c.options.cdata && o(d) ? e.raw(r(d)) : e.txt(d); else if (Array.isArray(d)) for (h in d) s.call(d, h) && (e = "string" == typeof (u = d[h]) ? c.options.cdata && o(u) ? e.ele(f).raw(r(u)).up() : e.ele(f, u).up() : l(e.ele(f), u).up()); else "object" == typeof d ? e = l(e.ele(f), d).up() : "string" == typeof d && c.options.cdata && o(d) ? e = e.ele(f).raw(r(d)).up() : (null == d && (d = ""), e = e.ele(f, d.toString()).up());
                    return e
                }, d = e.create(u, this.options.xmldec, this.options.doctype, {
                    headless: this.options.headless,
                    allowSurrogateChars: this.options.allowSurrogateChars
                }), l(d, t).end(this.options.renderOpts)
            }, t
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l;
        l = i(70), r = l.assign, s = l.isFunction, t = i(567), n = i(568), o = i(340), a = i(569), e.exports.create = function (e, i, n, a) {
            var o, s;
            if (null == e) throw new Error("Root element needs a name");
            return a = r({}, i, n, 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, i, a) {
            var o;
            return s(e) && (i = (o = [e, i])[0], a = o[1], e = {}), i ? new n(e, i, 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, i) {
    (function () {
        var t, n, a, o, r = {}.hasOwnProperty;
        o = i(70).isPlainObject, t = i(50), a = i(451), n = i(340), e.exports = function (e) {
            function i(e) {
                i.__super__.constructor.call(this, null), e || (e = {}), e.writer || (e.writer = new n), this.options = e, this.stringify = new a(e), this.isDocument = !0
            }

            return function (e, t) {
                for (var i in t) r.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, t), i.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)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).document(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g, p, v, m, y, k, T, w = {}.hasOwnProperty;
        T = i(70), y = T.isObject, m = T.isFunction, k = T.isPlainObject, c = i(124), n = i(125), a = i(126), f = i(133), v = i(134), h = i(135), d = i(127), u = i(128), o = i(129), s = i(130), r = i(131), l = i(132), t = i(450), p = i(451), g = i(340), e.exports = function () {
            function e(e, t, i) {
                var n;
                e || (e = {}), e.writer ? k(e.writer) && (n = e.writer, e.writer = new g(n)) : e.writer = new g(e), this.options = e, this.writer = e.writer, this.stringify = new p(e), this.onDataCallback = t || function () {
                }, this.onEndCallback = i || 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, i) {
                var n;
                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(), y(t) || (i = (n = [t, i])[0], t = n[1]), this.currentNode = new c(this, e, t), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, null != i && this.text(i), this
            }, e.prototype.element = function (e, t, i) {
                return this.currentNode && this.currentNode instanceof u ? this.dtdElement.apply(this, arguments) : this.node(e, t, i)
            }, e.prototype.attribute = function (e, i) {
                var n, 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()), y(e)) for (n in e) w.call(e, n) && (a = e[n], this.attribute(n, a)); else m(i) && (i = i.apply()), this.options.skipNullAttributes && null == i || (this.currentNode.attributes[e] = new t(this, e, i));
                return this
            }, e.prototype.text = function (e) {
                var t;
                return this.openCurrent(), t = new v(this, e), this.onData(this.writer.text(t, this.currentLevel + 1)), this
            }, e.prototype.cdata = function (e) {
                var t;
                return this.openCurrent(), t = new n(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 i, n, a, o, r;
                if (this.openCurrent(), null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (i = 0, o = e.length; i < o; i++) n = e[i], this.instruction(n); else if (y(e)) for (n in e) w.call(e, n) && (a = e[n], this.instruction(n, 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, i) {
                var n;
                if (this.openCurrent(), this.documentStarted) throw new Error("declaration() must be the first node");
                return n = new d(this, e, t, i), this.onData(this.writer.declaration(n, this.currentLevel + 1)), this
            }, e.prototype.doctype = function (e, t, i) {
                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 u(this, t, i), this.currentNode.rootNodeName = e, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this
            }, e.prototype.dtdElement = function (e, t) {
                var i;
                return this.openCurrent(), i = new r(this, e, t), this.onData(this.writer.dtdElement(i, this.currentLevel + 1)), this
            }, e.prototype.attList = function (e, t, i, n, a) {
                var r;
                return this.openCurrent(), r = new o(this, e, t, i, n, a), this.onData(this.writer.dtdAttList(r, this.currentLevel + 1)), this
            }, e.prototype.entity = function (e, t) {
                var i;
                return this.openCurrent(), i = new s(this, !1, e, t), this.onData(this.writer.dtdEntity(i, this.currentLevel + 1)), this
            }, e.prototype.pEntity = function (e, t) {
                var i;
                return this.openCurrent(), i = new s(this, !0, e, t), this.onData(this.writer.dtdEntity(i, this.currentLevel + 1)), this
            }, e.prototype.notation = function (e, t) {
                var i;
                return this.openCurrent(), i = new l(this, e, t), this.onData(this.writer.dtdNotation(i, 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, i) {
                return this.node(e, t, i)
            }, 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, i) {
                return this.declaration(e, t, i)
            }, e.prototype.dtd = function (e, t, i) {
                return this.doctype(e, t, i)
            }, e.prototype.e = function (e, t, i) {
                return this.element(e, t, i)
            }, e.prototype.n = function (e, t, i) {
                return this.node(e, t, i)
            }, 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 u ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.a = function () {
                return this.currentNode && this.currentNode instanceof u ? 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, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g, p = {}.hasOwnProperty;
        l = i(127), d = i(128), t = i(125), n = i(126), u = i(124), h = i(133), f = i(134), c = i(135), a = i(129), o = i(131), r = i(130), s = i(132), g = i(452), e.exports = function (e) {
            function i(e, t) {
                i.__super__.constructor.call(this, t), this.stream = e
            }

            return function (e, t) {
                for (var i in t) p.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, g), i.prototype.document = function (e) {
                var t, i, a, o, r, s, u, h;
                for (i = 0, o = (s = e.children).length; i < o; i++) (t = s[i]).isLastRootNode = !1;
                for (e.children[e.children.length - 1].isLastRootNode = !0, h = [], a = 0, r = (u = e.children).length; a < r; a++) switch (t = u[a], !1) {
                    case!(t instanceof l):
                        h.push(this.declaration(t));
                        break;
                    case!(t instanceof d):
                        h.push(this.docType(t));
                        break;
                    case!(t instanceof n):
                        h.push(this.comment(t));
                        break;
                    case!(t instanceof c):
                        h.push(this.processingInstruction(t));
                        break;
                    default:
                        h.push(this.element(t))
                }
                return h
            }, i.prototype.attribute = function (e) {
                return this.stream.write(" " + e.name + '="' + e.value + '"')
            }, i.prototype.cdata = function (e, t) {
                return this.stream.write(this.space(t) + "<![CDATA[" + e.text + "]]>" + this.endline(e))
            }, i.prototype.comment = function (e, t) {
                return this.stream.write(this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.endline(e))
            }, i.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))
            }, i.prototype.docType = function (e, i) {
                var l, d, u, h;
                if (i || (i = 0), this.stream.write(this.space(i)), 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)), d = 0, u = (h = e.children).length; d < u; d++) switch (l = h[d], !1) {
                        case!(l instanceof a):
                            this.dtdAttList(l, i + 1);
                            break;
                        case!(l instanceof o):
                            this.dtdElement(l, i + 1);
                            break;
                        case!(l instanceof r):
                            this.dtdEntity(l, i + 1);
                            break;
                        case!(l instanceof s):
                            this.dtdNotation(l, i + 1);
                            break;
                        case!(l instanceof t):
                            this.cdata(l, i + 1);
                            break;
                        case!(l instanceof n):
                            this.comment(l, i + 1);
                            break;
                        case!(l instanceof c):
                            this.processingInstruction(l, i + 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))
            }, i.prototype.element = function (e, i) {
                var a, o, r, s, l, d, g, v;
                for (l in i || (i = 0), v = this.space(i), this.stream.write(v + "<" + e.name), d = e.attributes) p.call(d, l) && (a = d[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, i + 1);
                            break;
                        case!(o instanceof n):
                            this.comment(o, i + 1);
                            break;
                        case!(o instanceof u):
                            this.element(o, i + 1);
                            break;
                        case!(o instanceof h):
                            this.raw(o, i + 1);
                            break;
                        case!(o instanceof f):
                            this.text(o, i + 1);
                            break;
                        case!(o instanceof c):
                            this.processingInstruction(o, i + 1);
                            break;
                        default:
                            throw new Error("Unknown XML node type: " + o.constructor.name)
                    }
                    this.stream.write(v + "</" + e.name + ">")
                }
                return this.stream.write(this.endline(e))
            }, i.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))
            }, i.prototype.raw = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, i.prototype.text = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, i.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))
            }, i.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))
            }, i.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))
            }, i.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))
            }, i.prototype.endline = function (e) {
                return e.isLastRootNode ? "" : this.newline
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        "use strict";
        var e, n, a, o, r, s, l, d, u = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, c = {}.hasOwnProperty;
        l = i(571), a = i(19), e = i(572), s = i(453), d = i(573).setImmediate, n = i(339).defaults, o = function (e) {
            return "object" == typeof e && null != e && 0 === Object.keys(e).length
        }, r = function (e, t, i) {
            var n, a;
            for (n = 0, a = e.length; n < a; n++) t = (0, e[n])(t, i);
            return t
        }, t.Parser = function (i) {
            function h(e) {
                var i, a, o;
                if (this.parseString = u(this.parseString, this), this.reset = u(this.reset, this), this.assignOrPush = u(this.assignOrPush, this), this.processAsync = u(this.processAsync, this), !(this instanceof t.Parser)) return new t.Parser(e);
                for (i in this.options = {}, a = n[.2]) c.call(a, i) && (o = a[i], this.options[i] = o);
                for (i in e) c.call(e, i) && (o = e[i], this.options[i] = 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 i in t) c.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, 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), d(this.processAsync))
                } catch (e) {
                    if (t = e, !this.saxParser.errThrown) return this.saxParser.errThrown = !0, this.emit(t)
                }
            }, h.prototype.assignOrPush = function (e, t, i) {
                return t in e ? (e[t] instanceof Array || (e[t] = [e[t]]), e[t].push(i)) : this.options.explicitArray ? e[t] = [i] : e[t] = i
            }, h.prototype.reset = function () {
                var e, t, i, n, 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, n = [], e = this.options.attrkey, t = this.options.charkey, this.saxParser.onopentag = function (i) {
                    return function (a) {
                        var o, s, l, d, u;
                        if ((l = {})[t] = "", !i.options.ignoreAttrs) for (o in u = a.attributes) c.call(u, o) && (e in l || i.options.mergeAttrs || (l[e] = {}), s = i.options.attrValueProcessors ? r(i.options.attrValueProcessors, a.attributes[o], o) : a.attributes[o], d = i.options.attrNameProcessors ? r(i.options.attrNameProcessors, o) : o, i.options.mergeAttrs ? i.assignOrPush(l, d, s) : l[e][d] = s);
                        return l["#name"] = i.options.tagNameProcessors ? r(i.options.tagNameProcessors, a.name) : a.name, i.options.xmlns && (l[i.options.xmlnskey] = {
                            uri: a.uri,
                            local: a.local
                        }), n.push(l)
                    }
                }(this), this.saxParser.onclosetag = function (e) {
                    return function () {
                        var i, a, s, l, d, u, h, f, g, p;
                        if (u = n.pop(), d = u["#name"], e.options.explicitChildren && e.options.preserveChildrenOrder || delete u["#name"], !0 === u.cdata && (i = u.cdata, delete u.cdata), g = n[n.length - 1], u[t].match(/^\s*$/) && !i ? (a = u[t], delete u[t]) : (e.options.trim && (u[t] = u[t].trim()), e.options.normalize && (u[t] = u[t].replace(/\s{2,}/g, " ").trim()), u[t] = e.options.valueProcessors ? r(e.options.valueProcessors, u[t], d) : u[t], 1 === Object.keys(u).length && t in u && !e.EXPLICIT_CHARKEY && (u = u[t])), o(u) && (u = "" !== e.options.emptyTag ? e.options.emptyTag : a), null != e.options.validator && (p = "/" + function () {
                            var e, t, i;
                            for (i = [], e = 0, t = n.length; e < t; e++) l = n[e], i.push(l["#name"]);
                            return i
                        }().concat(d).join("/"), function () {
                            var t;
                            try {
                                u = e.options.validator(p, g && g[d], u)
                            } catch (i) {
                                return t = i, e.emit("error", t)
                            }
                        }()), e.options.explicitChildren && !e.options.mergeAttrs && "object" == typeof u) if (e.options.preserveChildrenOrder) {
                            if (g) {
                                for (s in g[e.options.childkey] = g[e.options.childkey] || [], h = {}, u) c.call(u, s) && (h[s] = u[s]);
                                g[e.options.childkey].push(h), delete u["#name"], 1 === Object.keys(u).length && t in u && !e.EXPLICIT_CHARKEY && (u = u[t])
                            }
                        } else l = {}, e.options.attrkey in u && (l[e.options.attrkey] = u[e.options.attrkey], delete u[e.options.attrkey]), !e.options.charsAsChildren && e.options.charkey in u && (l[e.options.charkey] = u[e.options.charkey], delete u[e.options.charkey]), Object.getOwnPropertyNames(u).length > 0 && (l[e.options.childkey] = u), u = l;
                        return n.length > 0 ? e.assignOrPush(g, d, u) : (e.options.explicitRoot && (f = u, (u = {})[d] = f), e.resultObject = u, e.saxParser.ended = !0, e.emit("end", e.resultObject))
                    }
                }(this), i = function (e) {
                    return function (i) {
                        var a, o;
                        if (o = n[n.length - 1]) return o[t] += i, e.options.explicitChildren && e.options.preserveChildrenOrder && e.options.charsAsChildren && (e.options.includeWhiteChars || "" !== i.replace(/\\n/g, "").trim()) && (o[e.options.childkey] = o[e.options.childkey] || [], (a = {"#name": "__text__"})[t] = i, e.options.normalize && (a[t] = a[t].replace(/\s{2,}/g, " ").trim()), o[e.options.childkey].push(a)), o
                    }
                }(this), this.saxParser.ontext = i, this.saxParser.oncdata = function (e) {
                    var t;
                    if (t = i(e)) return t.cdata = !0
                }
            }, h.prototype.parseString = function (t, i) {
                var n;
                null != i && "function" == typeof i && (this.on("end", function (e) {
                    return this.reset(), i(null, e)
                }), this.on("error", function (e) {
                    return this.reset(), i(e)
                }));
                try {
                    return "" === (t = t.toString()).trim() ? (this.emit("end", null), !0) : (t = e.stripBOM(t), this.options.async ? (this.remaining = t, d(this.processAsync), this.saxParser) : this.saxParser.write(t).close())
                } catch (e) {
                    if (n = e, !this.saxParser.errThrown && !this.saxParser.ended) return this.emit("error", n), this.saxParser.errThrown = !0;
                    if (this.saxParser.ended) throw n
                }
            }, h
        }(), t.parseString = function (e, i, n) {
            var a, o;
            return null != n ? ("function" == typeof n && (a = n), "object" == typeof i && (o = i)) : ("function" == typeof i && (a = i), o = {}), new t.Parser(o).parseString(e, a)
        }
    }).call(this)
}, function (e, t, i) {
    !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,
            n = ["comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script"];

        function a(t, i) {
            if (!(this instanceof a)) return new a(t, i);
            !function (e) {
                for (var t = 0, i = n.length; t < i; t++) e[n[t]] = ""
            }(this), this.q = this.c = "", this.bufferCheckPosition = e.MAX_BUFFER_LENGTH, this.opt = i || {}, 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), _(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 i in e) e.hasOwnProperty(i) && t.push(i);
            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 i = 0, a = "";
                for (; a = K(t, i++), 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;
                        U(this, a);
                        continue;
                    case I.BEGIN_WHITESPACE:
                        U(this, a);
                        continue;
                    case I.TEXT:
                        if (this.sawRoot && !this.closedRoot) {
                            for (var o = i - 1; a && "<" !== a && "&" !== a;) (a = K(t, i++)) && this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++);
                            this.textNode += t.substring(o, i - 1)
                        }
                        "<" !== a || this.sawRoot && this.closedRoot && !this.strict ? (v(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 (v(a)) ; else if (k(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 ? (D(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 ? (D(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, D(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 = N(this.opt, this.comment), this.comment && D(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 && D(this, "oncdata", this.cdata), D(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 : v(a) ? this.state = I.PROC_INST_BODY : this.procInstName += a;
                        continue;
                    case I.PROC_INST_BODY:
                        if (!this.procInstBody && v(a)) continue;
                        "?" === a ? this.state = I.PROC_INST_ENDING : this.procInstBody += a;
                        continue;
                    case I.PROC_INST_ENDING:
                        ">" === a ? (D(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:
                        k(f, a) ? this.tagName += a : (O(this), ">" === a ? L(this) : "/" === a ? this.state = I.OPEN_TAG_SLASH : (v(a) || P(this, "Invalid character in tag name"), this.state = I.ATTRIB));
                        continue;
                    case I.OPEN_TAG_SLASH:
                        ">" === a ? (L(this, !0), R(this)) : (P(this, "Forward-slash in opening tag not followed by >"), this.state = I.ATTRIB);
                        continue;
                    case I.ATTRIB:
                        if (v(a)) continue;
                        ">" === a ? L(this) : "/" === a ? this.state = I.OPEN_TAG_SLASH : k(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, F(this), L(this)) : v(a) ? this.state = I.ATTRIB_NAME_SAW_WHITE : k(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 (v(a)) continue;
                            P(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", D(this, "onattribute", {
                                name: this.attribName,
                                value: ""
                            }), this.attribName = "", ">" === a ? L(this) : k(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 (v(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
                        }
                        F(this), this.q = "", this.state = I.ATTRIB_VALUE_CLOSED;
                        continue;
                    case I.ATTRIB_VALUE_CLOSED:
                        v(a) ? this.state = I.ATTRIB : ">" === a ? L(this) : "/" === a ? this.state = I.OPEN_TAG_SLASH : k(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 (!y(a)) {
                            "&" === a ? this.state = I.ATTRIB_VALUE_ENTITY_U : this.attribValue += a;
                            continue
                        }
                        F(this), ">" === a ? L(this) : this.state = I.ATTRIB;
                        continue;
                    case I.CLOSE_TAG:
                        if (this.tagName) ">" === a ? R(this) : k(f, a) ? this.tagName += a : this.script ? (this.script += "</" + this.tagName, this.tagName = "", this.state = I.SCRIPT) : (v(a) || P(this, "Invalid tagname in closing tag"), this.state = I.CLOSE_TAG_SAW_WHITE); else {
                            if (v(a)) continue;
                            T(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 (v(a)) continue;
                        ">" === a ? R(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 d, u;
                        switch (this.state) {
                            case I.TEXT_ENTITY:
                                d = I.TEXT, u = "textNode";
                                break;
                            case I.ATTRIB_VALUE_ENTITY_Q:
                                d = I.ATTRIB_VALUE_QUOTED, u = "attribValue";
                                break;
                            case I.ATTRIB_VALUE_ENTITY_U:
                                d = I.ATTRIB_VALUE_UNQUOTED, u = "attribValue"
                        }
                        ";" === a ? (this[u] += B(this), this.entity = "", this.state = d) : k(this.entity.length ? p : g, a) ? this.entity += a : (P(this, "Invalid character in entity name"), this[u] += "&" + this.entity + a, this.entity = "", this.state = d);
                        continue;
                    default:
                        throw new Error(this, "Unknown state: " + this.state)
                }
                this.position >= this.bufferCheckPosition && function (t) {
                    for (var i = Math.max(e.MAX_BUFFER_LENGTH, 10), a = 0, o = 0, r = n.length; o < r; o++) {
                        var s = t[n[o]].length;
                        if (s > i) switch (n[o]) {
                            case"textNode":
                                A(t);
                                break;
                            case"cdata":
                                D(t, "oncdata", t.cdata), t.cdata = "";
                                break;
                            case"script":
                                D(t, "onscript", t.script), t.script = "";
                                break;
                            default:
                                x(t, "Max buffer length exceeded: " + n[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;
                A(e = this), "" !== e.cdata && (D(e, "oncdata", e.cdata), e.cdata = ""), "" !== e.script && (D(e, "onscript", e.script), e.script = "")
            }
        };
        try {
            t = i(97).Stream
        } catch (e) {
            t = function () {
            }
        }
        var o = e.EVENTS.filter(function (e) {
            return "error" !== e && "end" !== e
        });

        function r(e, i) {
            if (!(this instanceof r)) return new r(e, i);
            t.apply(this), this._parser = new a(e, i), this.writable = !0, this.readable = !0;
            var n = this;
            this._parser.onend = function () {
                n.emit("end")
            }, this._parser.onerror = function (e) {
                n.emit("error", e), n._parser.error = null
            }, this._decoder = null, o.forEach(function (e) {
                Object.defineProperty(n, "on" + e, {
                    get: function () {
                        return n._parser["on" + e]
                    }, set: function (t) {
                        if (!t) return n.removeAllListeners(e), n._parser["on" + e] = t, t;
                        n.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 = i(432).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, i) {
            var n = this;
            return n._parser["on" + e] || -1 === o.indexOf(e) || (n._parser["on" + e] = function () {
                var t = 1 === arguments.length ? [arguments[0]] : Array.apply(null, arguments);
                t.splice(0, 0, e), n.emit.apply(n, t)
            }), t.prototype.on.call(n, e, i)
        };
        var s = "[CDATA[", l = "DOCTYPE", d = "http://www.w3.org/XML/1998/namespace",
            u = "http://www.w3.org/2000/xmlns/", c = {xml: d, xmlns: u},
            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 v(e) {
            return " " === e || "\n" === e || "\r" === e || "\t" === e
        }

        function m(e) {
            return '"' === e || "'" === e
        }

        function y(e) {
            return ">" === e || v(e)
        }

        function k(e, t) {
            return e.test(t)
        }

        function T(e, t) {
            return !k(e, t)
        }

        var w, C, S, 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 i = e.ENTITIES[t], n = "number" == typeof i ? String.fromCharCode(i) : i;
            e.ENTITIES[t] = n
        }), e.STATE) e.STATE[e.STATE[b]] = b;

        function _(e, t, i) {
            e[t] && e[t](i)
        }

        function D(e, t, i) {
            e.textNode && A(e), _(e, t, i)
        }

        function A(e) {
            e.textNode = N(e.opt, e.textNode), e.textNode && _(e, "ontext", e.textNode), e.textNode = ""
        }

        function N(e, t) {
            return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t
        }

        function x(e, t) {
            return A(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = new Error(t), e.error = t, _(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"), A(e), e.c = "", e.closed = !0, _(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 O(e) {
            e.strict || (e.tagName = e.tagName[e.looseCase]());
            var t = e.tags[e.tags.length - 1] || e, i = e.tag = {name: e.tagName, attributes: {}};
            e.opt.xmlns && (i.ns = t.ns), e.attribList.length = 0, D(e, "onopentagstart", i)
        }

        function M(e, t) {
            var i = e.indexOf(":") < 0 ? ["", e] : e.split(":"), n = i[0], a = i[1];
            return t && "xmlns" === e && (n = "xmlns", a = ""), {prefix: n, local: a}
        }

        function F(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 = M(e.attribName, !0), i = t.prefix, n = t.local;
                    if ("xmlns" === i) if ("xml" === n && e.attribValue !== d) P(e, "xml: prefix must be bound to " + d + "\nActual: " + e.attribValue); else if ("xmlns" === n && e.attribValue !== u) P(e, "xmlns: prefix must be bound to " + u + "\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[n] = e.attribValue
                    }
                    e.attribList.push([e.attribName, e.attribValue])
                } else e.tag.attributes[e.attribName] = e.attribValue, D(e, "onattribute", {
                    name: e.attribName,
                    value: e.attribValue
                });
                e.attribName = e.attribValue = ""
            }
        }

        function L(e, t) {
            if (e.opt.xmlns) {
                var i = e.tag, n = M(e.tagName);
                i.prefix = n.prefix, i.local = n.local, i.uri = i.ns[n.prefix] || "", i.prefix && !i.uri && (P(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), i.uri = n.prefix);
                var a = e.tags[e.tags.length - 1] || e;
                i.ns && a.ns !== i.ns && Object.keys(i.ns).forEach(function (t) {
                    D(e, "onopennamespace", {prefix: t, uri: i.ns[t]})
                });
                for (var o = 0, r = e.attribList.length; o < r; o++) {
                    var s = e.attribList[o], l = s[0], d = s[1], u = M(l, !0), c = u.prefix, h = u.local,
                        f = "" === c ? "" : i.ns[c] || "", g = {name: l, value: d, 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, D(e, "onattribute", g)
                }
                e.attribList.length = 0
            }
            e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), D(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 R(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);
                D(e, "onscript", e.script), e.script = ""
            }
            var t = e.tags.length, i = e.tagName;
            e.strict || (i = i[e.looseCase]());
            for (var n = i; t--;) {
                if (e.tags[t].name === n) 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 = i;
            for (var a = e.tags.length; a-- > t;) {
                var o = e.tag = e.tags.pop();
                e.tagName = e.tag.name, D(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 i = o.ns[t];
                    D(e, "onclosenamespace", {prefix: t, uri: i})
                })
            }
            0 === t && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = I.TEXT
        }

        function B(e) {
            var t, i = e.entity, n = i.toLowerCase(), a = "";
            return e.ENTITIES[i] ? e.ENTITIES[i] : e.ENTITIES[n] ? e.ENTITIES[n] : ("#" === (i = n).charAt(0) && ("x" === i.charAt(1) ? (i = i.slice(2), a = (t = parseInt(i, 16)).toString(16)) : (i = i.slice(1), a = (t = parseInt(i, 10)).toString(10))), i = i.replace(/^0+/, ""), isNaN(t) || a.toLowerCase() !== i ? (P(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(t))
        }

        function U(e, t) {
            "<" === t ? (e.state = I.OPEN_WAKA, e.startTagPosition = e.position) : v(t) || (P(e, "Non-whitespace before first tag."), e.textNode = t, e.state = I.TEXT)
        }

        function K(e, t) {
            var i = "";
            return t < e.length && (i = e.charAt(t)), i
        }

        I = e.STATE, String.fromCodePoint || (w = String.fromCharCode, C = Math.floor, S = function () {
            var e, t, i = [], n = -1, a = arguments.length;
            if (!a) return "";
            for (var o = ""; ++n < a;) {
                var r = Number(arguments[n]);
                if (!isFinite(r) || r < 0 || r > 1114111 || C(r) !== r) throw RangeError("Invalid code point: " + r);
                r <= 65535 ? i.push(r) : (e = 55296 + ((r -= 65536) >> 10), t = r % 1024 + 56320, i.push(e, t)), (n + 1 === a || i.length > 16384) && (o += w.apply(null, i), i.length = 0)
            }
            return o
        }, Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
            value: S,
            configurable: !0,
            writable: !0
        }) : String.fromCodePoint = S)
    }(t)
}, 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, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = "\n", a = "\r\n", o = /^\s*\[(.+?)\]\s*$/, r = /^\s*([^#].*?)\s*=\s*(.*?)\s*$/;
    !function (e) {
        e.stringify = function (e) {
            let t = "";
            for (let i in e) {
                let n = e[i];
                if (!n) break;
                t += "[" + i + "]" + a;
                for (let e in n) {
                    let i = n[e];
                    if (void 0 === i || null === i) break;
                    t += e + "=" + i + a
                }
            }
            return t + n
        }, e.parse = function (e) {
            let t, i = {}, n = e.split(/\r\n|\r|\n/), a = {};
            for (let e = 0; e < n.length; ++e) {
                let s = n[e];
                (t = s.match(o)) ? i[t[1]] = a = i[t[1]] || {} : a && (t = s.match(r)) && (a[t[1]] = t[2])
            }
            return i
        }
    }(t.IniNS || (t.IniNS = {}))
}, function (e, t) {
    function i(e) {
        var t = new Error("Cannot find module '" + e + "'");
        throw t.code = "MODULE_NOT_FOUND", t
    }

    i.keys = function () {
        return []
    }, i.resolve = i, e.exports = i, i.id = 575
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.NONE = 0] = "NONE", e[e.FAILED = -2] = "FAILED", e[e.ABORTED = -3] = "ABORTED", e[e.INVALID_ARGUMENT = -4] = "INVALID_ARGUMENT", e[e.INVALID_HANDLE = -5] = "INVALID_HANDLE", e[e.FILE_NOT_FOUND = -6] = "FILE_NOT_FOUND", e[e.TIMED_OUT = -7] = "TIMED_OUT", e[e.FILE_TOO_BIG = -8] = "FILE_TOO_BIG", e[e.UNEXPECTED = -9] = "UNEXPECTED", e[e.ACCESS_DENIED = -10] = "ACCESS_DENIED", e[e.NOT_IMPLEMENTED = -11] = "NOT_IMPLEMENTED", e[e.CONNECTION_CLOSED = -100] = "CONNECTION_CLOSED", e[e.CONNECTION_RESET = -101] = "CONNECTION_RESET", e[e.CONNECTION_REFUSED = -102] = "CONNECTION_REFUSED", e[e.CONNECTION_ABORTED = -103] = "CONNECTION_ABORTED", e[e.CONNECTION_FAILED = -104] = "CONNECTION_FAILED", e[e.NAME_NOT_RESOLVED = -105] = "NAME_NOT_RESOLVED", e[e.INTERNET_DISCONNECTED = -106] = "INTERNET_DISCONNECTED", e[e.SSL_PROTOCOL_ERROR = -107] = "SSL_PROTOCOL_ERROR", e[e.ADDRESS_INVALID = -108] = "ADDRESS_INVALID", e[e.ADDRESS_UNREACHABLE = -109] = "ADDRESS_UNREACHABLE", e[e.SSL_CLIENT_AUTH_CERT_NEEDED = -110] = "SSL_CLIENT_AUTH_CERT_NEEDED", e[e.TUNNEL_CONNECTION_FAILED = -111] = "TUNNEL_CONNECTION_FAILED", e[e.NO_SSL_VERSIONS_ENABLED = -112] = "NO_SSL_VERSIONS_ENABLED", e[e.SSL_VERSION_OR_CIPHER_MISMATCH = -113] = "SSL_VERSION_OR_CIPHER_MISMATCH", e[e.SSL_RENEGOTIATION_REQUESTED = -114] = "SSL_RENEGOTIATION_REQUESTED", e[e.CERT_COMMON_NAME_INVALID = -200] = "CERT_COMMON_NAME_INVALID", e[e.CERT_BEGIN = -200] = "CERT_BEGIN", e[e.CERT_DATE_INVALID = -201] = "CERT_DATE_INVALID", e[e.CERT_AUTHORITY_INVALID = -202] = "CERT_AUTHORITY_INVALID", e[e.CERT_CONTAINS_ERRORS = -203] = "CERT_CONTAINS_ERRORS", e[e.CERT_NO_REVOCATION_MECHANISM = -204] = "CERT_NO_REVOCATION_MECHANISM", e[e.CERT_UNABLE_TO_CHECK_REVOCATION = -205] = "CERT_UNABLE_TO_CHECK_REVOCATION", e[e.CERT_REVOKED = -206] = "CERT_REVOKED", e[e.CERT_INVALID = -207] = "CERT_INVALID", e[e.CERT_WEAK_SIGNATURE_ALGORITHM = -208] = "CERT_WEAK_SIGNATURE_ALGORITHM", e[e.CERT_NON_UNIQUE_NAME = -210] = "CERT_NON_UNIQUE_NAME", e[e.CERT_WEAK_KEY = -211] = "CERT_WEAK_KEY", e[e.CERT_NAME_CONSTRAINT_VIOLATION = -212] = "CERT_NAME_CONSTRAINT_VIOLATION", e[e.CERT_VALIDITY_TOO_LONG = -213] = "CERT_VALIDITY_TOO_LONG", e[e.CERT_END = -213] = "CERT_END", e[e.INVALID_URL = -300] = "INVALID_URL", e[e.DISALLOWED_URL_SCHEME = -301] = "DISALLOWED_URL_SCHEME", e[e.UNKNOWN_URL_SCHEME = -302] = "UNKNOWN_URL_SCHEME", e[e.TOO_MANY_REDIRECTS = -310] = "TOO_MANY_REDIRECTS", e[e.UNSAFE_REDIRECT = -311] = "UNSAFE_REDIRECT", e[e.UNSAFE_PORT = -312] = "UNSAFE_PORT", e[e.INVALID_RESPONSE = -320] = "INVALID_RESPONSE", e[e.INVALID_CHUNKED_ENCODING = -321] = "INVALID_CHUNKED_ENCODING", e[e.METHOD_NOT_SUPPORTED = -322] = "METHOD_NOT_SUPPORTED", e[e.UNEXPECTED_PROXY_AUTH = -323] = "UNEXPECTED_PROXY_AUTH", e[e.EMPTY_RESPONSE = -324] = "EMPTY_RESPONSE", e[e.RESPONSE_HEADERS_TOO_BIG = -325] = "RESPONSE_HEADERS_TOO_BIG", e[e.CACHE_MISS = -400] = "CACHE_MISS", e[e.INSECURE_RESPONSE = -501] = "INSECURE_RESPONSE"
    }(t.ErrorCode || (t.ErrorCode = {})), function (e) {
        e[e.UNKNOWN = 0] = "UNKNOWN", e[e.CURRENT_TAB = 1] = "CURRENT_TAB", e[e.SINGLETON_TAB = 2] = "SINGLETON_TAB", e[e.NEW_FOREGROUND_TAB = 3] = "NEW_FOREGROUND_TAB", e[e.NEW_BACKGROUND_TAB = 4] = "NEW_BACKGROUND_TAB", e[e.NEW_POPUP = 5] = "NEW_POPUP", e[e.NEW_WINDOW = 6] = "NEW_WINDOW", e[e.SAVE_TO_DISK = 7] = "SAVE_TO_DISK", e[e.OFF_THE_RECORD = 8] = "OFF_THE_RECORD", e[e.IGNORE_ACTION = 9] = "IGNORE_ACTION"
    }(t.WindowOpenDisposition || (t.WindowOpenDisposition = {})), function (e) {
        e[e.LINK = 0] = "LINK", e[e.EXPLICIT = 1] = "EXPLICIT", e[e.AUTO_SUBFRAME = 3] = "AUTO_SUBFRAME", e[e.MANUAL_SUBFRAME = 4] = "MANUAL_SUBFRAME", e[e.FORM_SUBMIT = 7] = "FORM_SUBMIT", e[e.RELOAD = 8] = "RELOAD", e[e.SOURCE_MASK = 255] = "SOURCE_MASK", e[e.BLOCKED_FLAG = 8388608] = "BLOCKED_FLAG", e[e.FORWARD_BACK_FLAG = 16777216] = "FORWARD_BACK_FLAG", e[e.CHAIN_START_FLAG = 268435456] = "CHAIN_START_FLAG", e[e.CHAIN_END_FLAG = 536870912] = "CHAIN_END_FLAG", e[e.CLIENT_REDIRECT_FLAG = 1073741824] = "CLIENT_REDIRECT_FLAG", e[e.SERVER_REDIRECT_FLAG = 2147483648] = "SERVER_REDIRECT_FLAG", e[e.IS_REDIRECT_MASK = 3221225472] = "IS_REDIRECT_MASK", e[e.QUALIFIER_MASK = 4294967040] = "QUALIFIER_MASK"
    }(t.TransitionType || (t.TransitionType = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.LEFT_DOWN = 16] = "LEFT_DOWN", e[e.MIDDLE_DOWN = 32] = "MIDDLE_DOWN", e[e.RIGHT_DOWN = 64] = "RIGHT_DOWN"
    }(t.MouseModifiers || (t.MouseModifiers = {})), function (e) {
        e[e.F5 = 116] = "F5", e[e.R = 82] = "R", e[e.T = 84] = "T", e[e.W = 87] = "W"
    }(t.Key || (t.Key = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.CAPS_LOCK_ON = 1] = "CAPS_LOCK_ON", e[e.SHIFT_DOWN = 2] = "SHIFT_DOWN", e[e.CTRL_DOWN = 4] = "CTRL_DOWN", e[e.ALT_DOWN = 8] = "ALT_DOWN"
    }(t.KeyModifiers || (t.KeyModifiers = {})), 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.PopupElemTypeFlag || (t.PopupElemTypeFlag = {})), 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.MediaElemType || (t.MediaElemType = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.PAUSED = 2] = "PAUSED", e[e.MUTED = 4] = "MUTED", e[e.LOOP = 8] = "LOOP", e[e.CAN_SAVE = 16] = "CAN_SAVE", e[e.HAS_AUDIO = 32] = "HAS_AUDIO", e[e.HAS_VIDEO = 64] = "HAS_VIDEO", e[e.CONTROL_ROOT_ELEMENT = 128] = "CONTROL_ROOT_ELEMENT", e[e.CAN_PRINT = 256] = "CAN_PRINT", e[e.CAN_ROTATE = 512] = "CAN_ROTATE"
    }(t.MediaElemStateFlag || (t.MediaElemStateFlag = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.CAN_UNDO = 1] = "CAN_UNDO", e[e.CAN_REDO = 2] = "CAN_REDO", e[e.ESFG_CAN_CUT = 4] = "ESFG_CAN_CUT", e[e.CAN_COPY = 8] = "CAN_COPY", e[e.CAN_PASTE = 16] = "CAN_PASTE", e[e.CAN_DELETE = 32] = "CAN_DELETE", e[e.CAN_SELECT_ALL = 64] = "CAN_SELECT_ALL", e[e.CAN_TRANSLATE = 128] = "CAN_TRANSLATE"
    }(t.EditStateFlag || (t.EditStateFlag = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

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

    class o {
        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.mExpireDate = "", this.mThunderVersionStr = void 0, this.mThunderVersionNumber = void 0
        }

        get expireDate() {
            return this.mExpireDate
        }

        get thunderVersionNumber() {
            return this.mThunderVersionNumber
        }

        get thunderVersionString() {
            return this.mThunderVersionStr
        }

        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
        }

        getSessionId() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : a.client.callServerFunction("GetSessionID").then(t => {
                        this.mSessionId = t, e(this.mSessionId || "0")
                    }).catch()
                })
            })
        }

        getPeerId() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : a.client.callServerFunction("GetPeerID").then(t => {
                        this.mPeerId = t, e(this.mPeerId || "")
                    }).catch()
                })
            })
        }

        getUserinfo() {
            return n(this, void 0, void 0, function* () {
                return yield a.client.callServerFunction("GetAllUserInfo")
            })
        }

        parseUserInfo() {
            return n(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()), e.vipList[0].expireDate && (this.mExpireDate = e.vipList[0].expireDate)
                } else this.mIsVip = !1
            })
        }

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

        onLogin() {
            return n(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 = o, function (e) {
        const t = new o;
        e.getUserHelper = function () {
            return t
        }
    }(t.UserHelperNS || (t.UserHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(454), a = i(5), o = i(4), r = i(25);
    t.signNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "CloseDialog", nativeFunc: this.closeDialog}, {
                functionName: "ShowLoginPanel",
                nativeFunc: this.showLoginPanel
            }, {functionName: "PageReady", nativeFunc: this.pageReady}]
        }

        closeDialog(e, t, i, a) {
            n.signObject.closeDialog(), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
        }

        showLoginPanel(e, t, i, n) {
            a.client.callServerFunction("ShowLoginDlg", "sign").catch(), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
        }

        pageReady(e, t, i, a) {
            do {
                if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) break;
                n.signObject.show().catch(), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(25), a = i(138);
    t.phoneAuthNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "HideWebDlg", nativeFunc: this.hideWebDlg}]
        }

        hideWebDlg(e, t, i, 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, i, n.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(7), o = i(0).default.getLogger("News-Popup.AdContainer"),
        r = a.default(n.join(__rootDir, "../bin/ThunderHelper.node")), s = 1125, l = 16;
    t.NewsAdContainer = class {
        constructor(e) {
            this.hwnd = 0, this.rect = null, this.id = e
        }

        getId() {
            return this.id
        }

        show() {
            o.information("show id:", this.id);
            do {
                if (!this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                r.showWindow(this.hwnd, 5)
            } while (0)
        }

        hide() {
            o.information("hide id:", this.id);
            do {
                if (!this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                r.showWindow(this.hwnd, 0)
            } while (0)
        }

        close() {
            o.information("close id:", this.id);
            do {
                if (!this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                r.postMessage(this.hwnd, l, 0, 0)
            } while (0)
        }

        move(e, t, i, n) {
            do {
                if (this.rect = {
                    x: e,
                    y: t,
                    width: i,
                    height: n
                }, o.information("move id:", this.id, ", hwnd: ", this.hwnd, ", this.rect:", this.rect), !this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                let a = (65535 & e) << 16 | 65535 & t, l = (65535 & i) << 16 | 65535 & n;
                r.postMessage(this.hwnd, s, a, l)
            } while (0)
        }

        onCreate(e) {
            this.hwnd = e
        }

        onClose() {
            this.hwnd = 0
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(456), a = i(9), o = i(4), r = i(0), s = i(25), l = r.default.getLogger("NativeFunction.News-Popup");
    t.newsPopupNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "PageReady", nativeFunc: this.pageReady}, {
                functionName: "Close",
                nativeFunc: this.close
            }, {
                functionName: "SetStartMoveMousePos",
                nativeFunc: this.setStartMoveMousePos
            }, {functionName: "SetMoveMousePos", nativeFunc: this.setMoveMousePos}, {
                functionName: "Minimize",
                nativeFunc: this.minimize
            }, {functionName: "CreateAd", nativeFunc: this.createAd}, {
                functionName: "ShowAd",
                nativeFunc: this.showAd
            }, {functionName: "HideAd", nativeFunc: this.hideAd}, {
                functionName: "CloseAd",
                nativeFunc: this.closeAd
            }, {functionName: "SetConfigValue", nativeFunc: this.setConfigValue}]
        }

        pageReady(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0]) || !o.isNumber(a[1])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0], l = a[1], d = n.newsPopupObject.getSize();
                d[0] === r && d[1] === l || (n.newsPopupObject.setSize(r, l), n.newsPopupObject.center()), n.newsPopupObject.show().catch(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        close(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                l.information("close"), n.newsPopupObject.close(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        setStartMoveMousePos(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0]) || !o.isNumber(a[1])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0], d = a[1];
                n.newsPopupObject.setStartMoveMousePos(r, d).catch(), l.information("setStartMoveMousePos x:", r, ", y:", d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        setMoveMousePos(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                let r = a[0], d = a[1];
                n.newsPopupObject.setMoveMousePos(r, d), l.information("setMoveMousePos x:", r, ", y:", d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        minimize(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                l.information("minimize"), n.newsPopupObject.minimize(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        createAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                let r = "";
                a.length > 0 && o.isString(a[0]) && (r = a[0]);
                let d = n.newsPopupObject.createAd(r);
                l.information("createAd adType:", r, ", id:", d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, d)
            } while (0)
        }

        showAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!(a && o.isNumber(a[0]) && o.isNumber(a[1]) && o.isNumber(a[2]) && o.isNumber(a[3]) && o.isNumber(a[4]))) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0], d = a[1], u = a[2], c = a[3], h = a[4];
                n.newsPopupObject.showAd(r, d, u, c, h), l.information("showAd id:", r, ", x:", d, ", y:", u, ", width:", c, ", height:", h), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        hideAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0];
                n.newsPopupObject.hideAd(r), l.information("hideAd id:", r), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        closeAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0];
                l.information("closeAd id:", r), n.newsPopupObject.closeAd(r), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        setConfigValue(e, t, i, n) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!(n && o.isString(n[0]) && o.isString(n[1]) && o.isString(n[2]))) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = n[0], l = n[1], d = n[2];
                a.ConfigNS.setValue(r, l, d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(2), o = i(7).default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        r = n.default.getLogger("HistoryDataNS");
    let s = a.resolve(__profilesDir, "mainWndData.ini"), l = 1060, d = 680;
    !function (e) {
        e.getMainWndSizeHistoryData = function () {
            let e = null;
            r.information(s);
            let t = o.readINI(s, "MainBody", "ExitState"), i = o.readINI(s, "MainBody", "MainWndLastWidth"),
                n = o.readINI(s, "MainBody", "MainWndLastHeight");
            if (r.information(t, i, n), "" !== i && "" !== n) {
                let a = Number(i), o = Number(n);
                (a < l || o < d) && (a = l, o = d), (e = {}).width = a, e.height = o, e.exitState = t
            }
            return null === e && ((e = {}).exitState = "normal", e.width = l, e.height = d), e
        }, e.setExitType = function (e) {
            o.writeINI(s, "MainBody", "ExitType", e)
        }, e.getExitType = function () {
            return o.readINI(s, "MainBody", "ExitType")
        }
    }(t.HistoryDataNS || (t.HistoryDataNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = i(2), s = i(35), l = i(36), d = i(25), u = i(458), c = i(345), h = i(347), f = i(32),
        g = i(10), p = i(77), v = i(3), m = i(75), y = i(29), k = i(14), T = i(4), w = i(103), C = i(37), S = i(143),
        I = i(34), b = i(27), _ = i(104), D = i(64), A = i(7), N = i(123), x = i(9), E = i(6), P = i(13), O = i(136),
        M = i(138), F = i(461), L = i(350), R = i(338), B = i(462), U = i(122), K = i(60), V = i(589), W = i(22),
        G = i(12), H = i(51), z = i(590), j = i(352), X = i(30), $ = i(463), Y = i(11), q = i(5), J = i(56), Z = i(16),
        Q = i(69), ee = G.DownloadKernelTaskManager.getTaskManager(),
        te = A.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        ie = S.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(),
        ne = a.default.getLogger("NativeFunction"), ae = 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: "ShowOpenDialog",
                        nativeFunc: this.showOpenDialog
                    }, {functionName: "ShowSaveDialog", nativeFunc: this.showSaveDialog}, {
                        functionName: "GetFileMd5",
                        nativeFunc: this.getFileMd5
                    }, {functionName: "GetPeerID", nativeFunc: this.getPeerID}, {
                        functionName: "GetDeviceID",
                        nativeFunc: this.getDeviceID
                    }, {functionName: "GetCpuID", nativeFunc: this.getCpuID}, {
                        functionName: "GetDmideCode",
                        nativeFunc: this.getDmideCode
                    }, {
                        functionName: "GetThunderVersion",
                        nativeFunc: this.getThunderVersion
                    }, {functionName: "TrackEvent", nativeFunc: this.trackEvent}, {
                        functionName: "GetCurrentCategoryId",
                        nativeFunc: this.getCurrentCategoryId
                    }, {
                        functionName: "GetCurrentCategoryView",
                        nativeFunc: this.getCurrentCategoryView
                    }, {
                        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: "GetCommonlySites",
                        nativeFunc: this.getCommonlySites
                    }, {
                        functionName: "ClearCommonlySites",
                        nativeFunc: this.clearCommonlySites
                    }, {
                        functionName: "DeleteCommonlySites",
                        nativeFunc: this.deleteCommonlySites
                    }, {
                        functionName: "TopBookmarksItem",
                        nativeFunc: this.topBookmarksItem
                    }, {
                        functionName: "EditBookmarksItemAW",
                        nativeFunc: this.editBookmarksItemAW
                    }, {
                        functionName: "GetRecentHistorys",
                        nativeFunc: this.getRecentHistorys
                    }, {
                        functionName: "ClearHistorys",
                        nativeFunc: this.clearHistorys
                    }, {
                        functionName: "DeleteHistoryItem",
                        nativeFunc: this.deleteHistoryItem
                    }, {
                        functionName: "GetBaiduDWZ",
                        nativeFunc: this.getBaiduDWZ
                    }, {
                        functionName: "GetInitDownloadData",
                        nativeFunc: this.getInitDownloadData
                    }, {functionName: "BringMainWndToTop", nativeFunc: this.bringMainWndToTop}, {
                        functionName: "Log",
                        nativeFunc: this.log
                    }, {
                        functionName: "IsFilePathExist",
                        nativeFunc: this.isFilePathExist
                    }, {
                        functionName: "GetTaskBirdKeyData",
                        nativeFunc: this.getTaskBirdKeyData
                    }, {
                        functionName: "GetShouleiShareLink",
                        nativeFunc: this.getShouleiShareLink
                    }, {
                        functionName: "GetShouleiShareLinkDlj",
                        nativeFunc: this.getShouleiShareLinkDlj
                    }, {
                        functionName: "GetShouleiShareLink2",
                        nativeFunc: this.getShouleiShareLink2
                    }, {
                        functionName: "GetShouleiShareLinkDlj2",
                        nativeFunc: this.getShouleiShareLinkDlj2
                    }, {
                        functionName: "GetShouleiFileTransferLink",
                        nativeFunc: this.getShouleiFileTransferLink
                    }, {
                        functionName: "GetShouleiFileTransferDlj",
                        nativeFunc: this.getShouleiFileTransferDlj
                    }, {
                        functionName: "GetVideoPreViews",
                        nativeFunc: this.getVideoPreViews
                    }, {
                        functionName: "CreateWebShortcut",
                        nativeFunc: this.createWebShortcut
                    }, {
                        functionName: "MessageBoxPop",
                        nativeFunc: this.messageBoxPop.bind(this)
                    }, {
                        functionName: "MessageBoxConfirm",
                        nativeFunc: this.messageBoxConfirm.bind(this)
                    }, {
                        functionName: "MessageBoxCustom",
                        nativeFunc: this.messageBoxCustom.bind(this)
                    }, {
                        functionName: "GetTaskBirdKeyOfTaskId",
                        nativeFunc: this.getTaskBirdKeyOfTaskId.bind(this)
                    }, {
                        functionName: "PromptShare",
                        nativeFunc: this.promptShare
                    }, {
                        functionName: "PopupDownloadShoulei",
                        nativeFunc: this.popupDownloadShoulei
                    }, {functionName: "SetPlayerPosition", nativeFunc: this.setPlayerPosition}];
                    l.NativeCallNS.registerNativeFunction(e)
                }
            }

            pageReady(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    "taskDetail" === a ? (u.TaskDetailNS.pageReady(), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)) : "community" === a ? (ie.emit("community.pageReady"), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskInfo(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[2]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    "taskDetail" === n[2] ? ae.getHistoryTaskInfoString(a).then(n => {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    }).catch() : e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            operateTask(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = a[2];
                        yield h.TaskOperate.operateTaskActions(n, o, r), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            shellOpen(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    f.TaskOperatorNs.asyncOpenItem(a).catch(), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openFolderWithSelectFile(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0];
                        yield(yield Y.asyncRemoteCall.getShell()).showItemInFolder(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            showOpenDialog(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        const n = yield Y.asyncRemoteCall.getDialog();
                        let o = null;
                        if (a[0]) try {
                            o = JSON.parse(a[0])
                        } catch (e) {
                            ne.warning("showOpenDialog param error", a[0], e)
                        }
                        o || (o = {properties: ["openDirectory"]});
                        let r = yield Y.asyncRemoteCall.getCurrentWindow();
                        n.showOpenDialog(r, o).then(n => {
                            let a = n.canceled ? void 0 : n.filePaths;
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a ? JSON.stringify(a) : a)
                        }).catch()
                    } while (0)
                })
            }

            showSaveDialog(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        const n = yield Y.asyncRemoteCall.getDialog();
                        let o = null;
                        if (a[0]) try {
                            o = JSON.parse(a[0])
                        } catch (e) {
                            ne.warning("showSaveDialog param error", a[0], e)
                        }
                        let r = yield Y.asyncRemoteCall.getCurrentWindow();
                        n.showSaveDialog(r, o).then(n => {
                            let a = n.filePath;
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                        }).catch()
                    } while (0)
                })
            }

            getFileMd5(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    s.ToolsUtilitiesAWNS.calculateFileMd5(a).then(n => {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            getPeerID(e, t, i, n) {
                ne.information(n);
                let a = te.getPeerID();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getDeviceID(e, t, i, n) {
                ne.information(n);
                let a = te.getPeerID();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getCpuID(e, t, i, n) {
                let a = te.getCpuID();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getDmideCode(e, t, i, n) {
                let a = te.getDmideCode();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getThunderVersion(e, t, i, n) {
                ne.information(n);
                let a = o.join(__rootDir, "../../Thunder.exe"), r = te.getFileVersion(a);
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, r)
            }

            trackEvent(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information(a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = void 0 === a[1] ? "" : a[1], r = void 0 === a[2] ? "" : a[2],
                            s = void 0 === a[3] ? 0 : a[3], l = void 0 === a[4] ? 0 : a[4],
                            u = void 0 === a[5] ? 0 : a[5], c = void 0 === a[6] ? 0 : a[6],
                            h = void 0 === a[7] ? "" : a[7], f = void 0 === a[8] ? 0 : a[8],
                            p = yield g.XLStatNS.asyncTrackEvent(n, o, r, s, l, u, c, h, f);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, p)
                    } while (0)
                })
            }

            getCurrentCategoryId(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let n = y.default.getCurrentCategoryId();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            getCurrentCategoryView(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let n = y.default.getCurrentCategoryView();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            switchCategoryView(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0]) || T.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = void 0;
                    void 0 !== n[2] && (r = n[2]);
                    let s = n[3];
                    ne.information(a, o, r), y.default.fireEvent(k.NodeEventMesssageNS.eventDownloadSwitchCategory, a, o, r, s)
                } while (0)
            }

            dragOpenFile(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    if (void 0 === a || null === a || "" === a) break;
                    w.default.onCommand("path", a, "file_drag").catch()
                } while (0)
            }

            dragOpenUrl(e, t, i, n) {
                do {
                    if (void 0 === e || null === e) break;
                    if (void 0 === t || null === t) break;
                    if (void 0 === i || null === i) break;
                    let a = n[0];
                    if (void 0 === a || null === a || "" === a) break;
                    let o = I.ThunderHelper.getTaskTypeFromUrl(a);
                    o === v.DownloadKernel.TaskType.P2sp || o === v.DownloadKernel.TaskType.Emule ? C.ThunderNewTask.createPreNewTaskWindow([a], "url_drag") : o !== v.DownloadKernel.TaskType.Bt && o !== v.DownloadKernel.TaskType.Magnet || C.ThunderNewTask.createBtTaskWindow({
                        url: a,
                        type: "url"
                    }, {source: "url_drag"})
                } while (0)
            }

            getCurInternetState(e, t, i, n) {
                do {
                    if (ne.information(n), T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let a = te.getCurInternetState();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getCurPlatform(e, t, i, n) {
                do {
                    if (ne.information(n), T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let a = "pc-xdas";
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            createNewTask(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let a = n[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        ne.warning(e)
                    }
                    if (ne.information("createNewTask", o), T.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 = []), ne.information("createNewTask url", o[t].url);
                                let i = o[t].url.split("%0A");
                                if (1 === i.length && (i = o[t].url.split(/[\n\r\n]/)), ne.information("createNewTask urls", i), 1 === i.length) e.push({
                                    url: o[t].url,
                                    referer: o[t].refer,
                                    fileName: o[t].name,
                                    statClick: o[t].stat ? o[t].stat : "outline",
                                    browser: o[t].browser ? o[t].browser : "xlbrowser.exe"
                                }); else for (let n of i) e.push({
                                    url: n,
                                    referer: o[t].refer,
                                    statClick: o[t].stat ? o[t].stat : "outline",
                                    browser: o[t].browser ? o[t].browser : "xlbrowser.exe"
                                })
                            }
                            C.ThunderNewTask.createPreNewTaskWindow(e);
                            break
                        }
                        if ("bt" === t.type) {
                            let e = t.url;
                            C.ThunderNewTask.createBtTaskWindow({
                                url: e,
                                type: "url"
                            }, {
                                source: t.stat ? t.stat : "outline",
                                browser: t.browser ? t.browser : "xlbrowser.exe",
                                referer: t.refer
                            });
                            break
                        }
                        "bird" === t.type && p.URLHelperNS.isBirdKey(t.url) && m.openBirdKeyDecodeDialog(t.url, {from: t.stat || "outline"})
                    }
                } while (0)
            }

            createNewTaskEx(e, t, i, n) {
                do {
                    if (ne.information("createNewTaskEx 接口 enter 第一个参数:", n[0]), T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n[0])) break;
                    let a = null;
                    try {
                        a = JSON.parse(n[0])
                    } catch (e) {
                        break
                    }
                    let o = [];
                    for (let e in a) {
                        let t = a[e];
                        if (p.URLHelperNS.isBirdKey(t.url)) {
                            m.openBirdKeyDecodeDialog(t.url, {from: t.stat});
                            continue
                        }
                        let i = I.ThunderHelper.getTaskTypeFromUrl(t.url);
                        if (ne.information(" createNewTaskEx", t.url, " type:", i), i === v.DownloadKernel.TaskType.P2sp || i === v.DownloadKernel.TaskType.Emule) o.push({
                            url: a[e].url,
                            referer: a[e].refer,
                            fileName: a[e].name,
                            statClick: a[e].stat,
                            birdkeyChars: a[e].birdkeyChars
                        }); else if (i === v.DownloadKernel.TaskType.Bt || i === v.DownloadKernel.TaskType.Magnet) {
                            let i = t.url;
                            C.ThunderNewTask.createBtTaskWindow({
                                url: i,
                                type: "url",
                                birdkeyChars: a[e].birdkeyChars
                            }, {source: t.stat, referer: t.refer})
                        } else t.url.includes("taskGroupName") && C.ThunderNewTask.createThunderxTask(t.url, t.stat, !1).catch()
                    }
                    o.length > 0 && C.ThunderNewTask.createPreNewTaskWindow(o)
                } while (0)
            }

            fireEventFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    b.NativeCallHostModule.nativeCallHost.fireNativeEvent("onWebEvent", ...n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showCustomDownloadModeDlg(e, t, i) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    _.DownloadModeNS.showCustomDownloadModeDlg().catch(), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showBrowserGuideDlg(e, t, i) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    N.default().popUpBrowserGuide(!0).catch()
                } while (0)
            }

            getTaskStartStatusPrompt(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(n[0]), o = D.TaskStatusHelper.getTaskStartStatusPrompt(a);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                    } catch (n) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError)
                    }
                } while (0)
            }

            openURLByIEorDefault(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = te.openURLByIEorDefault(n[0]);
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getDownloadDir(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = "";
                        do {
                            if (x.ConfigNS.getValue("TaskDefaultSettings", "UseLastCatalog", !0) && (n = x.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "")) || (n = x.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), void 0 !== n && null !== n && "" !== n && (yield E.FileSystemAWNS.mkdirsAW(n))) break;
                            n = P.ThunderUtil.getDefaultDownloadDir()
                        } while (0);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            showPersonalPage(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (T.isNullOrUndefined(a) || T.isNullOrUndefined(a[0])) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = 0, o = a[0];
                        if (!this.isPersonalPageTrackEvent) {
                            this.isPersonalPageTrackEvent = !0;
                            let e = x.ConfigNS.getValue("Install", "PersonalUid", "");
                            void 0 !== e && null !== e || (e = "");
                            let t = "uid=" + e + ",start_page=" + (o ? "Individualization_home_page" : "official_home_page");
                            n = yield g.XLStatNS.asyncTrackEvent("core_event", "startup_page", "", 0, 0, 0, 0, t)
                        }
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            showWebWnd(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (T.isNullOrUndefined(a) || T.isNullOrUndefined(a[0])) {
                            e.callNativeFunctionCallback(t, i, d.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] = (() => n(this, void 0, void 0, function* () {
                                return new Promise(i => {
                                    b.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e), i(!0)
                                })
                            }))
                        }
                        if (null !== a[11] && void 0 !== a[11]) {
                            let e = a[11];
                            a[11] = (() => n(this, void 0, void 0, function* () {
                                b.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                            }))
                        }
                        yield O.EmbeddedBrowserManagerNs.showWebWnd(o, ...a), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            createWebWnd(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (T.isNullOrUndefined(a) || T.isNullOrUndefined(a[0])) {
                            e.callNativeFunctionCallback(t, i, d.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] = (() => n(this, void 0, void 0, function* () {
                                return new Promise(i => {
                                    b.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e), i(!0)
                                })
                            }))
                        }
                        if (null !== a[11] && void 0 !== a[11]) {
                            let e = a[11];
                            a[11] = (() => n(this, void 0, void 0, function* () {
                                b.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                            }))
                        }
                        if (null !== a[12] && void 0 !== a[12]) {
                            let e = a[12];
                            a[12] = ((i, ...a) => n(this, void 0, void 0, function* () {
                                b.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e, i, ...a)
                            }))
                        }
                        yield O.EmbeddedBrowserManagerNs.createWebWnd(o, ...a), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            registerWebFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = n[2];
                    if (null === o || void 0 === o || "" === o) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === r || void 0 === r) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    O.EmbeddedBrowserManagerNs.registerWebFunction(a, o, (e, ...i) => {
                        b.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, r, void 0, ...i)
                    }), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            callBackWebFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = n[2], s = n[3];
                    if (null === a || void 0 === a || "" === a) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === o || void 0 === o) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === r || void 0 === r) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    O.EmbeddedBrowserManagerNs.callBackWebFunction(a, o, r, s), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            fireEventWebFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    if (null === a || void 0 === a || "" === a) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    n.splice(0, 1), O.EmbeddedBrowserManagerNs.fireEventWebFunction(a, ...n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isPhoneAuth(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    M.phoneAuthObject.isPhoneAuthAw().then(n => {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            getSearchRecommends(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let n = F.SearchConfigNS.getRecommends();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSearchRecommends(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    F.SearchConfigNS.setRecommends(a), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            getCommonlySites(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield L.CommonSitesMgrNS.getInstance().getMostCommonly();
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(n))
                    } while (0)
                })
            }

            clearCommonlySites(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        yield L.CommonSitesMgrNS.getInstance().clear()
                    } while (0)
                })
            }

            deleteCommonlySites(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        yield L.CommonSitesMgrNS.getInstance().delete(a[0])
                    } while (0)
                })
            }

            topBookmarksItem(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    ie.emit("bookmarks.top", n[0]), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            editBookmarksItemAW(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0];
                        if (!n.url || !n.title || !n.state) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = yield(yield Y.asyncRemoteCall.getCurrentWindow()).getBounds(),
                            r = {y: o.y + 48, x: o.x + (o.width - 400) / 2, modal: !1},
                            s = yield W.MessageBox.custom("BookMarks", {state: n.state, title: n.title}, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s), ie.emit("bookmarks.editfinish", s, n)
                    } while (0)
                })
            }

            getRecentHistorys(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield j.historyManager.getRecentHistory();
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(n))
                    } while (0)
                })
            }

            clearHistorys(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield j.historyManager.clear();
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(n))
                    } while (0)
                })
            }

            deleteHistoryItem(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = a[0];
                        if (!n) break;
                        let o = null;
                        try {
                            o = JSON.parse(n)
                        } catch (e) {
                        }
                        if (!o) break;
                        yield j.historyManager.delete(o), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            getBaiduDWZ(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = yield R.getBaiduDWZ(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                    } while (0)
                })
            }

            getShouleiShareLink(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = "pic";
                        T.isString(a[1]) && (o = a[1]);
                        let r = "";
                        T.isString(a[2]) && (r = a[2]);
                        let s = yield U.getShouleiShareLink(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            getShouleiShareLinkDlj(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = "pic";
                        T.isString(a[1]) && (o = a[1]);
                        let r = "";
                        T.isString(a[2]) && (r = a[2]);
                        let s = yield U.getShouleiShareLinkDlj(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            getShouleiShareLink2(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = a[2], s = a[3], l = a[4], u = a[5], c = "pic";
                        T.isString(a[6]) && (c = a[6]);
                        let h = "";
                        T.isString(a[7]) && (h = a[7]);
                        let f = yield U.getShouleiShareLink2(n, o, r, s, l, u, c, h);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, f)
                    } while (0)
                })
            }

            getShouleiShareLinkDlj2(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = a[2], s = a[3], l = a[4], u = a[5], c = "pic";
                        T.isString(a[6]) && (c = a[6]);
                        let h = "";
                        T.isString(a[7]) && (h = a[7]);
                        let f = yield U.getShouleiShareLinkDlj2(n, o, r, s, l, u, c, h);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, f)
                    } while (0)
                })
            }

            getShouleiFileTransferLink(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0], r = "pic";
                        T.isString(a[1]) && (r = a[1]);
                        let s = "";
                        T.isString(a[2]) && (s = a[2]), X.ThunderKernel.getSubNetUploader((a, l) => n(this, void 0, void 0, function* () {
                            if (ne.information("getSubNetUploader result", a, l), 0 === a && l) {
                                let n = yield U.getShouleiFileTransferLink(o, l, r, s);
                                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                            } else e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.CallFailed)
                        }))
                    } while (0)
                })
            }

            getShouleiFileTransferDlj(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0], r = "pic";
                        T.isString(a[1]) && (r = a[1]);
                        let s = "";
                        T.isString(a[2]) && (s = a[2]), X.ThunderKernel.getSubNetUploader((a, l) => n(this, void 0, void 0, function* () {
                            if (ne.information("getSubNetUploader result", a, l), 0 === a && l) {
                                let n = yield U.getShouleiFileTransferDlj(o, l, r, s);
                                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                            } else e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.CallFailed)
                        }))
                    } while (0)
                })
            }

            getVideoPreViews(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = a[0], o = a[1];
                        o || (o = "picPreview");
                        let r = yield V.videoPreviewData.getVideoPreview(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, r)
                    } while (0)
                })
            }

            getInitDownloadData(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = JSON.stringify(B.default.getDownloadData());
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            bringMainWndToTop(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = !1, a = yield Y.asyncRemoteCall.getCurrentWindow();
                        a && ((yield a.isMinimized()) && (yield a.restore()), yield a.show(), yield s.ToolsUtilitiesAWNS.setForegroundWindow(te, a), n = !0), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            log(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || n.length < 3) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = n[0], r = n[1], s = null;
                    s = T.isString(o) && o.length > 0 ? a.default.getLogger(o) : ne;
                    let l = !0;
                    switch (r) {
                        case"verbose":
                            s.verbose(n.splice(2));
                            break;
                        case"information":
                            s.information(n.splice(2));
                            break;
                        case"warning":
                            s.warning(n.splice(2));
                            break;
                        case"error":
                            s.error(n.splice(2));
                            break;
                        case"critical":
                            s.critical(n.splice(2));
                            break;
                        default:
                            l = !1
                    }
                    e.callNativeFunctionCallback(t, i, l ? d.NativeFunctionErrorCode.Success : d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            isFilePathExist(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !T.isString(a[0])) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = yield E.FileSystemAWNS.existsAW(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                    } while (0)
                })
            }

            getTaskBirdKeyData(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = h.TaskOperate.getTaskBirdKeyData(a);
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            createWebShortcut(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("createWebShortcut");
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = !1, s = a[0], l = null;
                        try {
                            l = JSON.parse(s)
                        } catch (e) {
                            ne.warning("error", e)
                        }
                        if (l && l.name && l.url && l.iconUrl) {
                            let n = l.name.replace(/[*?/\\:|<>\"]/g, "_"), a = yield Y.asyncRemoteCall.getApp(),
                                s = r.join(yield a.getPath("desktop"), `${n}.lnk`), u = l.runParams || "";
                            ne.information("lnkPath", s), ne.information("runParams", u), ne.information("iconUrl", l.iconUrl);
                            let c = "", h = encodeURI(l.iconUrl), f = te.getRoamingAppDataPath(),
                                g = o.join(f, "XLWebPageGame/IconDir"), p = n + ".ico";
                            c = o.join(g, p);
                            let v = yield K.AxiosNS.downloadFileAW(h, c);
                            if (ne.information("downloadFileAW", v), ne.information("url", l.url), ne.information("iconPath", c), v) {
                                te.createShortcut(s, l.url, u, c, n => {
                                    ne.information("createShortcut result", n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                                });
                                break
                            }
                        }
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            messageBoxPop(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxPop args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = null;
                        try {
                            n = JSON.parse(a[0])
                        } catch (n) {
                            ne.warning(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = null;
                        if (a[1]) try {
                            o = JSON.parse(a[1])
                        } catch (e) {
                            ne.warning(e)
                        }
                        let r = yield W.MessageBox.pop(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            messageBoxConfirm(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxConfirm args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = null;
                        try {
                            n = JSON.parse(a[0])
                        } catch (n) {
                            ne.warning(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = null;
                        if (a[1]) try {
                            o = JSON.parse(a[1])
                        } catch (e) {
                            ne.warning(e)
                        }
                        let r = yield W.MessageBox.confirm(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            messageBoxCustom(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxCustom args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = null;
                        try {
                            o = JSON.parse(a[1])
                        } catch (n) {
                            ne.warning(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let r = null;
                        if (a[1]) try {
                            r = JSON.parse(a[2])
                        } catch (e) {
                            ne.warning(e)
                        }
                        let s = yield W.MessageBox.custom(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(s))
                    } while (0)
                })
            }

            getTaskBirdKeyOfTaskId(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxConfirm args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = ee.getTaskFromTaskId(Number(n));
                        if (!o) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let r = void 0;
                        r = o.getExtraObject().getUserData(H.TaskUserDataGUID.guidBirdKey, "birdKey"), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, r)
                    } while (0)
                })
            }

            promptShare(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        z.ShareToastListenerNS.addListener(a[0], a[1])
                    } while (0)
                })
            }

            setPlayerPosition(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("native setPlayerPosition openFrom", a[8]);
                    let e = x.ConfigNS.getValue("PopBox", "AutoPop", !0),
                        t = yield q.client.callServerFunction("getPlayTaskDetailShow");
                    do {
                        if (("backup" === a[8] || "scroll" === a[8]) && !t) break;
                        if (!e && "showDetail" === a[8]) {
                            let e = (yield Z.server.callClientFunctionByName(Q.CommonIPCBase.mainProcessContext, "getXmpShowMode"))[0];
                            if (ne.information("get xmp mode", e), e !== J.XMPShowMode.MINI_MODE && e !== J.XMPShowMode.UNKNOWN_MODE) break
                        }
                    } while (0)
                })
            }

            popupDownloadShoulei(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield $.getMobileImgSrc();
                        if (!n) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.CallFailed);
                            break
                        }
                        let o = yield W.MessageBox.custom("img-dlg", {src: n, width: 400, height: 276}, {
                            width: 400,
                            height: 276
                        });
                        if (e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(o)), !a) break
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NaviteFunctionNS || (t.NaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(16), r = i(3), s = i(15), l = i(12), d = i(0), u = i(69), c = i(57), h = i(56), f = i(55),
        g = l.DownloadKernelTaskManager.getTaskManager(), p = s.DownloadKernelEventManager.getEventManager(),
        v = d.default.getLogger("Thunder.DownloadAndPlayNodeIPC");
    !function (e) {
        let t, i, s, l, d = void 0;

        function m(e, ...t) {
            return n(this, void 0, void 0, function* () {
                return null
            })
        }

        function y(e, t, i) {
            a.client.callServerFunction("BringMainWndToTop").catch(), a.client.callServerFunction("OpenNewTab", i).catch()
        }

        function k(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield a.client.callServerFunction("SetPlayingTaskId", i.toString(), h.XmpPlaySoure.PLAY_BY_DOWNLOAD)
            })
        }

        function T(e, t, i) {
            v.information("[NewStat]... 获取任务信息，taskId=", i), "string" == typeof i && (i = parseInt(i, 10));
            let n = g.getTaskFromTaskId(i);
            if (!n) return;
            let a = n.getTaskChannelInfo();
            if (!a) return;
            let o = 0, r = n.getTaskBaseInfo();
            r && (o = r.downloadSize || 0);
            let s = a.dcdnSize || 0, l = a.offlineSize || 0, d = {
                taskId: n.getId(),
                dcdnDownloadSized: s + l,
                taskStatus: n.getTaskStatus(),
                downloadSize: o,
                channelInfo: a
            };
            return v.information("[NewStat]... 得到任务信息对象,obj=", d), d
        }

        function w(e, t, i) {
            v.information("setOrderDownload taskId:", i);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                e.setDownloadStrategy(r.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_DOWNLOADINGPLAYING)
            } while (0)
        }

        function C(e, t, i) {
            v.information("setDisorderDownload taskId:", i);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                e.setDownloadStrategy(r.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_NORMALDOWNLOAD)
            } while (0)
        }

        function S(e, t, i) {
            v.information("onStopPlay taskId:", i)
        }

        function I(e, t, i, n) {
            v.information("onPlayCompleted taskId:", i, "fileIndex", n);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                if (e.getType() === r.DownloadKernel.TaskType.Bt) {
                    let t = e.getExtraObject().getBtFileByRealIndex(n);
                    if (t) {
                        let e = t.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Duration);
                        t.setPlayPosition(e)
                    }
                } else {
                    let t = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.Duration);
                    e.setPlayPosition(t)
                }
            } while (0)
        }

        function b(e, t, i, n, a, o) {
            v.information("onUpdateDurationAndPosition taskId:", i, "fileIndex", n, "duration:", a, "position:", o);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                if (e.getType() === r.DownloadKernel.TaskType.Bt) {
                    let t = e.getExtraObject().getBtFileByRealIndex(n);
                    t && (t.setDuration(a), t.setPlayPosition(o))
                } else e.setDuration(a), e.setPlayPosition(o)
            } while (0)
        }

        e.init = function () {
            o.server.registerFunctions({
                SetOrderDownload: w,
                SetDisorderDownload: C,
                OnStopPlay: S,
                OnPlayCompleted: I,
                OnUpdateDurationAndPosition: b,
                OpenURL: y,
                UpdatePlayTaskId: k,
                GetTaskInfoById: T
            }), d = p.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    e[1].forEach(e => n(this, void 0, void 0, function* () {
                        let t = e.getTaskStatus();
                        t === r.DownloadKernel.TaskStatus.StopPending ? m("OnTaskStopPending", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Stopped ? yield o.server.callClientFunctionByName(f.mainRendererContext, "OnTaskStopped", e.getId()) : t === r.DownloadKernel.TaskStatus.Started ? m("OnTaskStarted", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Succeeded || t === r.DownloadKernel.TaskStatus.Seeding ? m("OnTaskSuccess", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.DestroyPending ? m("OnTaskDestroyPending", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Failed && m("OnTaskFailed", e.getId()).catch()
                    }))
                } while (0)
            }), t = p.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (e, t, i, n) => {
                if (e !== r.DownloadKernel.TaskEventType.InsertToCategoryView) return;
                let a = [];
                for (let e = 0; e < n.length; e++) {
                    let t = n[e].getId();
                    t && a.push(t)
                }
                m("OnTaskInserted", t, i, a).catch()
            }), i = p.attachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, (e, t, i, n) => {
                if (e !== r.DownloadKernel.TaskEventType.RemoveFromCategoryView) return;
                let a = [];
                for (let e = 0; e < n.length; e++) {
                    let t = n[e].getId();
                    t && a.push(t)
                }
                m("OnTaskRemoved", t, i, a).catch()
            }), s = p.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, (e, t, i) => {
                if (e !== r.DownloadKernel.TaskEventType.DetailChanged) return;
                let n = [];
                for (let e = 0; e < t.length; e++) {
                    let i = t[e].getId();
                    i && n.push(i)
                }
                m("OnTaskDetailChanged", n, i).catch()
            }), l = p.attachTaskEvent(r.DownloadKernel.TaskEventType.DcdnStatusChanged, (e, t) => {
                if (e !== r.DownloadKernel.TaskEventType.DcdnStatusChanged) return;
                let i = {};
                for (let e = 0; e < t.length; ++e) {
                    let n = t[e];
                    if (!n) continue;
                    let a = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId),
                        o = n.getTaskChannelInfo().dcdnStatus;
                    i[a] = o
                }
                m("OnTaskDcdnStatusChanged", i).catch()
            }), c.quitPromises.addBefore(() => new Promise(e => n(this, void 0, void 0, function* () {
                v.information("callClientFunctionByName getXmpShowMode begin");
                let t = (yield o.server.callClientFunctionByName(u.CommonIPCBase.mainProcessContext, "getXmpShowMode"))[0];
                v.information("callClientFunctionByName getXmpShowMode end"), v.information("quitPromises showMode", t), t === h.XMPShowMode.EMBED_CHILD_MODE && (yield o.server.callClientFunctionByName(u.CommonIPCBase.mainProcessContext, "showPlayerWindow", h.CmdShow.SW_HIDE), v.information("callClientFunctionByName OnUnbindAndExit begin"), yield m("OnUnbindAndExit"), v.information("callClientFunctionByName OnUnbindAndExit end")), e(!0)
            })))
        }, e.uninit = function () {
            void 0 !== d && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, d), d = void 0), t && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, t), t = void 0), i && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, t), i = void 0), s && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, t), s = void 0), l && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.DcdnStatusChanged, l), l = void 0)
        }, e.nofityXMP = m
    }(t.DownloadAndPlayNodeIPCNS || (t.DownloadAndPlayNodeIPCNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(42);
    const a = new class extends n.default {
    };
    t.default = a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(3), o = i(31), r = i(12), s = i(15), l = i(26), d = i(40), u = i(61), c = i(9), h = i(23),
        f = i(17), g = i(7), p = i(5);
    !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 = d.DownloadKernelCategoryViewManager.getCategoryViewManager(), e.taskUtilities = u.TaskUtilitiesAWNS, e.config = c.ConfigNS, e.logHelper = h.LoginHelperNS, e.thunderHelper = g.default(n.join(__rootDir, "../bin/ThunderHelper.node")), e.nativeCallModule = f.NativeCallModule, e.clientModule = p.client
    }(t.DownloadKernelTestNS || (t.DownloadKernelTestNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(3), o = i(15), r = i(12), s = i(26), l = i(17),
        d = r.DownloadKernelTaskManager.getTaskManager(), u = o.DownloadKernelEventManager.getEventManager(),
        c = s.DownloadKernelCategoryManager.getCategoryManager(), h = n.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 = u.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = u.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1], e[2])
                }), this.taskStatusChangedEventId = u.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, u.detachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId)), void 0 !== this.detailChangedEventId && (this.detailChangedEventId = void 0, u.detachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId)), void 0 !== this.taskStatusChangedEventId && (this.taskStatusChangedEventId = void 0, u.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, i = this.taskInfoMap.get(e);
                if (i) if (-1 === i.categoryId) t = this.getTaskAverageSpeed(i.taskId); else {
                    let e = c.getCurrentPrivateCategory();
                    e && e.getId() === i.categoryId && (t = this.getTaskAverageSpeed(i.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 i = [];
                        e[t].getTasks().forEach(e => {
                            i.push(e)
                        }), this.updateTaskInfo(i)
                    }
                }
            }

            onUserLogout() {
                h.information("onUserLogout");
                let e = new Map;
                this.taskInfoMap.forEach((t, i) => {
                    -1 !== t.categoryId && e.set(i, t)
                }), e.forEach((e, t) => {
                    -1 !== e.categoryId && this.taskInfoMap.delete(t)
                })
            }

            onInsertToCategoryView(e, t, i) {
                do {
                    if (!i) break;
                    h.information("onInsertToCategoryView number of taskList:", i.length), this.updateTaskInfo(i)
                } while (0)
            }

            onDetailChanged(e, t) {
                do {
                    if (!e || !t) break;
                    h.information("onDetailChanged number of taskList:", e.length, ", detailChangedFlags:", t);
                    for (let i = 0; i < e.length; ++i) {
                        let n = e[i];
                        n && ((t & a.DownloadKernel.TaskDetailChangedFlags.TaskName || t & a.DownloadKernel.TaskDetailChangedFlags.Gcid) && this.updateTaskInfo([n]))
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    if (i && i.getTaskStatus() === a.DownloadKernel.TaskStatus.DestroyPending) {
                        let e = this.getTaskUniqueIDByTask(i);
                        e && "" !== e && (h.information("onTaskStatusChanged delete taskInfoMap uniqueId:", e), this.taskInfoMap.delete(e))
                    }
                }
            }

            updateTaskInfo(e) {
                let t = c.getCurrentPrivateCategory();
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i];
                    if (!n) continue;
                    let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryId);
                    if (-1 !== o && (!t || t.getId() !== o)) continue;
                    let r = this.getTaskUniqueIDByTask(n);
                    if (r && "" !== r) {
                        let e = this.getTaskNameByTask(n), t = n.getTaskBaseInfo().taskId,
                            i = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryViewId);
                        h.information("updateTaskInfo uniqueId:", r, ", taskId:", t, ", taskName:", e, ", categoryId:", o, ", categoryViewId:", i);
                        let s = {taskId: t, taskName: e, categoryId: o, categoryViewId: i};
                        this.taskInfoMap.set(r, s)
                    }
                }
            }

            getTaskAverageSpeed(e) {
                let t = d.getTaskFromTaskId(e);
                if (!t) return 0;
                let i = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    n = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadSize);
                0 === i && (i = 0);
                let o = Math.round(n / i);
                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 i = 0, n = e;
                for (; n > 1024 && !(i >= 5);) n /= 1024, i += 1;
                let a = Math.pow(10, t);
                return Math.round(n * a) / a + ["B", "KB", "MB", "GB", "TB", "PB"][i]
            }

            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 i = e.getExtraObject().getInfoId();
                        h.information("getTaskUniqueIDByTask bt task infoId:", i), t = i;
                        break;
                    case a.DownloadKernel.TaskType.P2sp:
                    case a.DownloadKernel.TaskType.Emule:
                        let n = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.Gcid);
                        h.information("getTaskUniqueIDByTask p2sp or emule task gcid: ", n), t = n
                }
                return t
            }
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5);
    t.postDownloadData = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = null;
            return t = yield a.client.callRemoteClientFunction("User", "Request", "/fn/dlstatisc/1zb3oxs", {
                method: "POST",
                body: e,
                withCredentials: !0
            })
        })
    }, t.getDownloadData = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = null;
            return t = yield a.client.callRemoteClientFunction("User", "Request", "/fn/dlstatisc/1zb3oxs", {
                method: "GET",
                body: e,
                withCredentials: !0
            })
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(43), r = i(12), s = i(0), l = i(351), d = i(2), u = i(6), c = i(60),
        h = i(15).DownloadKernelEventManager.getEventManager(), f = r.DownloadKernelTaskManager.getTaskManager(),
        g = s.default.getLogger("Preview-Data");
    t.videoPreviewData = new class {
        constructor() {
            this.previewDataMap = new Map, this.netRequestMap = new Map, this.previewCachePath = `${__profilesDir}/videoPreview/cache.json`, this.isSavingData = !1
        }

        init() {
            h.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (e, t, i, n) => {
                if (e === a.DownloadKernel.TaskEventType.InsertToCategoryView && i === a.DownloadKernel.CategroyViewID.Recycle) if (n instanceof Array) for (let e = 0; e < n.length; e++) this.deleteTaskCache(n[e].getId()).catch(); else g.warning("传递数据错误")
            })
        }

        queryResInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                let i, n = "", r = "", s = void 0, d = f.getTaskFromTaskId(e);
                if (d) {
                    if (0 === d.getVideoFileCount()) return;
                    let e = d.getType();
                    if (e === a.DownloadKernel.TaskType.P2sp || e === a.DownloadKernel.TaskType.Magnet) n = "url", r = d.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl); else if (e === a.DownloadKernel.TaskType.Emule) n = "emule", r = d.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl); else if (e === a.DownloadKernel.TaskType.Bt) {
                        n = "bt";
                        let e = d.getExtraObject(), t = e.getBtFileList();
                        for (let [e, i] of t) if (i.isSupportPlay()) {
                            s = e;
                            break
                        }
                        r = e.getInfoId()
                    }
                }
                return o.Common.isThunderPrivateUrl(r) && (r = o.Common.parseThunderPrivateUrl(r)), (i = yield l.getVideoPreviewInfo(n, r, s, t)) && i.data && !i.error ? i && 200 === i.status && (this.netRequestMap.get(e) ? g.information("本地已有文件记载") : (this.setPreviewData(e, i), this.saveLocalData().catch())) : this.netRequestMap.set(e, !1), g.information("getVideoPreviewInfo 网络获取  index=", s, " type=", n, " res=", i, " resInfo=", r), i
            })
        }

        getRealPath(e) {
            let t = e.indexOf("file:///");
            if (-1 === t) return e;
            let i = t + "file:///".length;
            return i > e.length - 1 ? e : e.substring(i)
        }

        getVideoPreview(e, t) {
            return n(this, void 0, void 0, function* () {
                if (!e) return;
                let i, n = yield this.queryResInfo(e, t);
                n && (i = n.data), yield this.getLocalData();
                let a = this.getPreviewData(e);
                if (a) {
                    g.information("使用本地");
                    let e = a.data;
                    return e && i && (e.total_time = i.total_time, g.information("[Test] 更新时间 total_time=", i.total_time)), a
                }
                return g.information("使用网络"), n
            })
        }

        isPreviewShow(e) {
            return n(this, void 0, void 0, function* () {
                let t = yield this.getVideoPreview(e);
                if (!t) return !1;
                let i = {};
                try {
                    "object" == typeof t.data ? i = t.data : "string" == typeof t.data && (i = JSON.parse(t.data))
                } catch (e) {
                    return !1
                }
                return !!i && !!i.pictures && 0 === i.code && i.pictures instanceof Array && i.pictures.length > 0
            })
        }

        setPreviewData(e, t) {
            g.information("taskid:", e), this.previewDataMap.set(e, t)
        }

        getPreviewData(e) {
            return this.previewDataMap.get(e)
        }

        deleteTaskCache(e) {
            return n(this, void 0, void 0, function* () {
                if (!e) return void g.warning("错误taskid");
                let t = `${__profilesDir}/videoPreview/${e}`;
                (yield u.FileSystemAWNS.existsAW(t)) ? (u.FileSystemAWNS.rmdirsAW(t).catch(), g.information("删除任务, taskId=", e), this.previewDataMap.delete(e), this.saveLocalData().catch()) : g.information("当前任务无缓存目录, taskId=", e)
            })
        }

        objectDeepClone(e, t) {
            if ("object" == typeof t) {
                e || (e = {});
                for (const i in t) t.hasOwnProperty(i) && (t[i] instanceof Array ? (e[i] || (e[i] = []), t[i].forEach(t => {
                    e[i].push(t)
                })) : t[i] instanceof Object ? (e[i] || (e[i] = {}), this.objectDeepClone(e[i], t[i])) : e[i] = t[i])
            }
        }

        getTimePercent(e) {
            if (e) {
                let t = new RegExp(/.*_([0-9]+)\.[a-zA-Z0-9]{1,4}?.*/), i = e.match(t);
                return i && i[1] ? parseFloat(i[1]) : void 0
            }
        }

        saveLocalData() {
            return n(this, void 0, void 0, function* () {
                g.information("saveLocalData enter"), this.isSavingData = !0;
                let e = new Map, t = `${__profilesDir}/videoPreview/`;
                (yield u.FileSystemAWNS.existsAW(t)) || (yield u.FileSystemAWNS.mkdirAW(t));
                let i, n = "";
                for (let a of this.previewDataMap.keys()) {
                    let o = {};
                    if (i = this.previewDataMap.get(a), g.information("get key=", a, " value=", i), !i) continue;
                    if (this.objectDeepClone(o, i.data), !o) continue;
                    if (!o.pictures) continue;
                    if ("object" != typeof o.pictures) continue;
                    if (o.pictures.length < 1) continue;
                    let r = {
                        "User-Agent": navigator.userAgent,
                        "Content-Type": "",
                        Accept: "image/jpeg",
                        "Accept-Encoding": "gzip, deflate",
                        "Accept-Language": "zh-CN,zh;q=0.9",
                        "Cache-Control": "no-cache",
                        Pragma: "no-cache",
                        Connection: "keep-alive"
                    }, s = "", l = ".png", h = [".jpg", ".jpeg", ".png", ".bmp", ".gif"], f = "", p = !1, v = 0;
                    n = t + a + "/";
                    let m = 0;
                    (yield u.FileSystemAWNS.existsAW(n)) || (yield u.FileSystemAWNS.mkdirAW(n));
                    let y = 0;
                    for (let e = 0; e < o.pictures.length; e++) o.pictures[e].startsWith("file:///") ? y++ : ((v = o.pictures[e].indexOf("?")) >= 0 && (f = d.extname(o.pictures[e].substring(0, v))), -1 !== h.indexOf(f) && (l = f), void 0 === (m = this.getTimePercent(o.pictures[e])) && (m = e), s = n + a + "_" + m + l, p = yield c.AxiosNS.downloadFileAW(o.pictures[e], s, r), g.information("下载文件,url=", o.pictures[e], " filePath=", s, " 结果,ret=", p), p && (o.pictures[e] = "file:///" + s, y++));
                    this.netRequestMap.set(a, 6 === y), g.information("saveMap key=", a, " data=", o), e.set(a, {
                        data: o,
                        status: i.status
                    }), o = void 0
                }
                if (g.information("saveMap size=", e.size), e.size > 0) {
                    let t = this.mapToJson(e);
                    yield u.FileSystemAWNS.writeFileAW(this.previewCachePath, t)
                }
                e.clear(), this.isSavingData = !1, g.information("saveLocalData leave")
            })
        }

        stringifyEx(e) {
            let t = [], i = JSON.stringify(e, (e, i) => {
                if ("object" == typeof i && null !== i) {
                    if (-1 !== t.indexOf(i)) return null;
                    t.push(i)
                }
                return i
            });
            return t = [], i
        }

        getLocalData() {
            return n(this, void 0, void 0, function* () {
                if (this.isSavingData) return void g.warning("正在保存数据...");
                let e, t = yield u.FileSystemAWNS.readFileAW(this.previewCachePath);
                if (t) {
                    try {
                        e = this.jsonToMap(t.toString())
                    } catch (e) {
                        g.warning("获取本地缓存失败, error=", e)
                    }
                    e ? (g.information("得到缓存,map=", e), this.previewDataMap = e) : g.warning("没有缓存,map=", e)
                } else g.information("读文件失败, buf=", t, " path=", this.previewCachePath)
            })
        }

        mapToObject(e) {
            let t = Object.create(null);
            for (let [i, n] of e) 0 !== i && (t[i] = n);
            return t
        }

        mapToJson(e) {
            let t = "";
            try {
                t = JSON.stringify(this.mapToObject(e))
            } catch (e) {
                g.warning("mapToJson error")
            }
            return t
        }

        objectToMap(e) {
            let t = new Map;
            for (let i of Object.keys(e)) t.set(parseInt(i, 10), e[i]);
            return t
        }

        jsonToMap(e) {
            return this.objectToMap(JSON.parse(e))
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(18), a = i(10), o = i(77), r = i(34), s = i(3), l = i(49), d = i(52),
        u = d.ToastNotifyManagerNS.getToastNotifyManger(), c = 18e4;
    const h = new class {
        constructor() {
            this.currentWords = "", this.toastTimerId = void 0
        }

        getContentType(e) {
            let t = void 0;
            return r.ThunderHelper.getTaskTypeFromUrl(e) === s.DownloadKernel.TaskType.Unkown ? o.URLHelperNS.isBirdKey(e) && (t = "bird") : t = "link", t
        }

        addListener(e, t) {
            do {
                if (void 0 === e && (e = n.clipboard.readText()), !e) break;
                if (e === this.currentWords) break;
                if (void 0 === t && (t = this.getContentType(e)), void 0 === t) break;
                this.toastTimerId && (clearTimeout(this.toastTimerId), this.toastTimerId = void 0), this.currentWords = e, this.toastTimerId = setTimeout(() => {
                    clearTimeout(this.toastTimerId), this.toastTimerId = void 0;
                    let e = n.clipboard.readText();
                    e === this.currentWords && (a.XLStatNS.trackEvent("download_leftpanel", "shear_plate_toast_show", "", 0, 0, 0, 0, `content=${encodeURIComponent(e)}`), u.showNotify(d.ToastNotifyManagerNS.notifyIdTaskOperatorCopyLink, l.ToastNotifyItemType.GreenNotify, "bird" === t ? "剪贴板有一个口令哦，去粘贴～" : "剪贴板有一个链接哦，去粘贴～", 3e3))
                }, c)
            } while (0)
        }
    };
    !function (e) {
        e.addListener = function (e, t) {
            h.addListener(e, t)
        }
    }(t.ShareToastListenerNS || (t.ShareToastListenerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(2), r = i(4), s = i(0), l = i(5), d = i(16), u = i(69), c = i(592), h = i(10), f = i(13),
        g = i(77), p = i(457), v = i(84), m = i(338), y = i(34), k = i(7), T = i(3), w = i(6), C = i(103), S = i(9),
        I = i(14), b = i(35), _ = i(75), D = i(461), A = i(448), N = i(104), x = i(25), E = i(347), P = i(32),
        O = i(138), M = i(123), F = i(37), L = i(29), R = i(64), B = i(345), U = i(136), K = i(27), V = i(336),
        W = i(36), G = i(122), H = i(89), z = i(22), j = i(593), X = i(99), $ = i(349), Y = i(53),
        q = s.default.getLogger("plugin-function"), J = B.TaskInfoManagerNS.getTaskInfoManager(),
        Z = k.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        Q = j.fileMediaInfoOssMangerNS.getfileMediaInfoOssManger();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, this.isPersonalPageTrackEvent = !1, this.clientWebExternalMap = {}
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetTaskInfo: this.getTaskInfo,
                        OperateTask: this.operateTask,
                        ShellOpen: this.shellOpen,
                        OpenFolderWithSelectFile: this.openFolderWithSelectFile,
                        ShowOpenDialog: this.showOpenDialog,
                        ShowSaveDialog: this.showSaveDialog,
                        GetFileMd5: this.getFileMd5,
                        GetPeerID: this.getPeerID,
                        GetDeviceID: this.getDeviceID,
                        GetCpuID: this.getCpuID,
                        GetDmideCode: this.getDmideCode,
                        GetThunderVersion: this.getThunderVersion,
                        TrackEvent: this.trackEvent,
                        GetCurrentCategoryId: this.getCurrentCategoryId,
                        GetCurrentTabId: this.getCurrentTabId,
                        SelectCategoryView: this.switchCategoryView,
                        GetCurInternetState: this.getCurInternetState,
                        DropOpenFile: this.dragOpenFile,
                        DropOpenUrl: this.dragOpenUrl,
                        GetCurPlatform: this.getCurPlatform,
                        CreateNewTask: this.createNewTask,
                        CreateNewTaskEx: this.createNewTaskEx,
                        AddUrls2Cloud: this.addUrls2Cloud,
                        AddBt2Cloud: this.addBt2Cloud,
                        FireEventFunction: this.fireEventFunction,
                        ShowCustomDownloadModeDlg: this.showCustomDownloadModeDlg,
                        GetTaskStartStatusPrompt: this.getTaskStartStatusPrompt,
                        ShowBrowserGuideDlg: this.showBrowserGuideDlg,
                        OpenURLByIEorDefault: this.openURLByIEorDefault,
                        OpenURLByDefault: this.openURLByDefault,
                        GetDownloadDir: this.getDownloadDir,
                        GetProfilesDir: this.getProfilesDir,
                        ShowPersonalPage: this.showPersonalPage.bind(this),
                        ShowWebWnd: this.showWebWnd,
                        CreateWebWnd: this.createWebWnd,
                        CreateWebWndEx: this.createWebWndEx,
                        CloseWebWnd: this.closeWebWnd,
                        ExistWebWnd: this.existWebWnd,
                        VisibleWebWnd: this.visibleWebWnd,
                        BringWebWndToTop: this.bringWebWndToTop,
                        EnableSignAutoShow: this.enableSignAutoShow,
                        RegisterWebFunction: this.registerWebFunction,
                        RegisterWebExternal: this.registerWebExternal.bind(this),
                        CallBackWebFunction: this.callBackWebFunction,
                        FireEventWebFunction: this.fireEventWebFunction,
                        IsPhoneAuth: this.isPhoneAuth,
                        GetSearchRecommends: this.getSearchRecommends,
                        SetSearchRecommends: this.setSearchRecommends,
                        GetBaiduDWZ: this.getBaiduDWZ,
                        GetShouleiShareLink: this.getShouleiShareLink,
                        GetShouleiShareLinkDlj: this.getShouleiShareLinkDlj,
                        GetShouleiShareLink2: this.getShouleiShareLink2,
                        GetShouleiShareLinkDlj2: this.getShouleiShareLinkDlj2,
                        GetShouleiFileTransferLink: this.getShouleiFileTransferLink,
                        GetShouleiFileTransferDlj: this.getShouleiFileTransferDlj,
                        GetShouleiFileTransferLink2: this.getShouleiFileTransferLink2,
                        GetShouleiFileTransferDlj2: this.getShouleiFileTransferDlj2,
                        Log: this.log,
                        IsDevToolsEnable: this.isDevToolsEnable,
                        IsMainWndVisible: this.isMainWndVisible,
                        IsInFullScreen: this.isInFullScreen,
                        SwitchDetail: this.switchDetail,
                        Utf8StringEncodeToBinary: this.utf8StringEncodeToBinary,
                        Utf8StringDecodeFromBinary: this.utf8StringDecodeFromBinary,
                        GetErrorCodeConfigMessage: this.getErrorCodeConfigMessage,
                        GetErrorCodeConfigData: this.getErrorCodeConfigData,
                        GetMainWndHandle: this.getMainWndHandle,
                        GetPluginStatus: this.getPluginStatus,
                        SetPluginStatus: this.setPluginStatus,
                        PopPluginGroups: this.popPluginGroups,
                        GetInitUserLoginParam: this.getInitUserLoginParam,
                        BringMainWndToTop: this.bringMainWndToTop,
                        MessageBoxPop: this.messageBoxPop,
                        MessageBoxConfirm: this.messageBoxConfirm,
                        MessageBoxCustom: this.messageBoxCustom,
                        FlashFrame: this.flashFrame,
                        SetTrayImage: this.setTrayImage,
                        FlashTray: this.flashTray,
                        GetMainWindowStates: this.getMainWindowStates,
                        ShowAniCover: this.showAniCover,
                        CloseAniCover: this.closeAniCover,
                        setPopMutual: this.setPopMutual,
                        ClosePopMutual: this.closePopMutual,
                        PopFileSelect: this.popFileSelect,
                        PopFilesSelect: this.popFilesSelect,
                        GetMediaInfo: this.getMediaInfo,
                        CaclGcid: this.caclGcid,
                        CaclCid: this.caclCid,
                        CaclBCid: this.caclBCid,
                        GetUploadProg: this.getUploadProg,
                        UploadFileToOss: this.uploadFileToOss,
                        CancelUpload: this.cancelUpload,
                        PopFileSelectAndGetInfo: this.popFileSelectAndGetInfo,
                        PopFilesSelectAndGetInfo: this.popFilesSelectAndGetInfo,
                        ResumeUpload: this.resumeUpload,
                        PostUpload: this.postUpload,
                        PauseUpload: this.pauseUpload,
                        CreateDownloadAndPlayTask: this.createDownloadAndPlayTask,
                        CreateBtTaskWindow: this.createBtTaskWindow,
                        CreateTaskDirectly: this.createTaskDirectly,
                        PlayBtOrGroupTask: this.playBtOrGroupTask,
                        GetTaskBirdKeyData: this.getTaskBirdKeyData
                    };
                    d.server.registerFunctions(e), d.server.on("end", e => {
                        let t = [];
                        for (let i in this.clientWebExternalMap) this.clientWebExternalMap[i] === e && (delete this.clientWebExternalMap[i], t.push(i));
                        t.length > 0 && (q.information("client end to remove native function", ...t), W.NativeCallNS.unregisterNativeFunction(t))
                    })
                }
            }

            getTaskBirdKeyData(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (!e) break;
                        if (!i || !i[0]) break;
                        let n = i[0];
                        t = E.TaskOperate.getTaskBirdKeyData(n)
                    } while (0);
                    return t
                })
            }

            getTaskInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (!e) break;
                        if (!i || !i[0] || !i[2]) break;
                        let n = i[0];
                        if ("taskDetail" !== i[2]) break;
                        t = yield J.getHistoryTaskInfoString(n)
                    } while (0);
                    return t
                })
            }

            operateTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !0;
                    do {
                        if (!e) break;
                        if (!i || !i[0] || !i[1]) {
                            t = !1;
                            break
                        }
                        let n = i[0], a = i[1], o = i[2];
                        yield E.TaskOperate.operateTaskActions(n, a, o)
                    } while (0);
                    return t
                })
            }

            playBtOrGroupTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (!i || !i[0]) break;
                        let t = i[0];
                        d.server.fireClientEvent("PlayBtOrGroupTask", t)
                    } while (0)
                })
            }

            shellOpen(e, t, ...i) {
                let n = !0;
                do {
                    if (!e) break;
                    if (!i || !i[0]) {
                        n = !1;
                        break
                    }
                    let t = i[0];
                    P.TaskOperatorNs.asyncOpenItem(t).catch()
                } while (0);
                return n
            }

            openFolderWithSelectFile(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !0;
                    do {
                        if (!e) break;
                        if (!i || !i[0]) {
                            t = !1;
                            break
                        }
                        let n = i[0];
                        t = yield(yield a.asyncRemoteCall.getShell()).showItemInFolder(n)
                    } while (0);
                    return t
                })
            }

            showOpenDialog(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        do {
                            if (!e) {
                                t(void 0);
                                break
                            }
                            const n = yield a.asyncRemoteCall.getDialog();
                            let o = i[0];
                            o || (o = {properties: ["openDirectory"]});
                            let r = yield a.asyncRemoteCall.getCurrentWindow(), s = yield n.showOpenDialog(r, o);
                            s.canceled ? t(void 0) : t(s.filePaths)
                        } while (0)
                    }))
                })
            }

            showSaveDialog(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        do {
                            if (!e) {
                                t(void 0);
                                break
                            }
                            const n = yield a.asyncRemoteCall.getDialog();
                            let o = i[0], r = yield a.asyncRemoteCall.getCurrentWindow();
                            n.showSaveDialog(r, o).then(e => {
                                e.canceled ? t("") : t(e.filePath)
                            })
                        } while (0)
                    }))
                })
            }

            getFileMd5(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (!e) break;
                        if (!i || !i[0]) break;
                        let n = i[0];
                        t = yield b.ToolsUtilitiesAWNS.calculateFileMd5(n)
                    } while (0);
                    return t
                })
            }

            getPeerID(e, t, ...i) {
                return Z.getPeerID()
            }

            getDeviceID(e, t, ...i) {
                return Z.getPeerID()
            }

            getCpuID(e, t, ...i) {
                return Z.getCpuID()
            }

            getDmideCode(e, t, ...i) {
                return Z.getDmideCode()
            }

            getThunderVersion(e, t, ...i) {
                let n = o.join(__rootDir, "../../Thunder.exe");
                return Z.getFileVersion(n)
            }

            trackEvent(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = void 0 === i[1] ? "" : i[1], o = 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], u = void 0 === i[6] ? 0 : i[6],
                            c = void 0 === i[7] ? "" : i[7], f = void 0 === i[8] ? 0 : i[8];
                        t = yield h.XLStatNS.asyncTrackEvent(n, a, o, s, l, d, u, c, f)
                    } while (0);
                    return t
                })
            }

            getCurrentCategoryId(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = L.default.getCurrentCategoryId()
                } while (0);
                return n
            }

            getCurrentTabId(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = H.getCurrentTabID()
                } while (0);
                return n
            }

            switchCategoryView(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], n = i[1], a = void 0;
                    void 0 !== i[2] && (a = i[2]);
                    let o = i[3];
                    q.information(t, n, a), L.default.fireEvent(I.NodeEventMesssageNS.eventDownloadSwitchCategory, t, n, a, o)
                } while (0)
            }

            getCurInternetState(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = Z.getCurInternetState()
                } while (0);
                return n
            }

            dragOpenFile(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = i[0];
                    if (void 0 === t || null === t || "" === t) break;
                    let n = i[1];
                    C.default.onCommand("path", t, n || "file_drag").catch()
                } while (0)
            }

            dragOpenUrl(e, t, ...i) {
                do {
                    if (void 0 === e || null === e) break;
                    let t = i[0];
                    if (void 0 === t || null === t || "" === t) break;
                    let n = i[1], a = y.ThunderHelper.getTaskTypeFromUrl(t);
                    a === T.DownloadKernel.TaskType.P2sp || a === T.DownloadKernel.TaskType.Emule ? F.ThunderNewTask.createPreNewTaskWindow([t], n || "url_drag") : a !== T.DownloadKernel.TaskType.Bt && a !== T.DownloadKernel.TaskType.Magnet || F.ThunderNewTask.createBtTaskWindow({
                        url: t,
                        type: "url"
                    }, {source: n || "url_drag"})
                } while (0)
            }

            getCurPlatform(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = "pc-xdas"
                } while (0);
                return n
            }

            createNewTask(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    let t = i[0], n = null;
                    try {
                        n = JSON.parse(t)
                    } catch (e) {
                        q.warning(e)
                    }
                    if (q.information("createNewTask", n), r.isNullOrUndefined(n)) break;
                    for (let e in n) {
                        let t = n[e];
                        if ("com" === t.type) {
                            let e = void 0;
                            for (let t in n) {
                                void 0 === e && (e = []), q.information("createNewTask url", n[t].url);
                                let i = n[t].url.split("%0A");
                                if (1 === i.length && (i = n[t].url.split(/[\n\r\n]/)), q.information("createNewTask urls", i), 1 === i.length) e.push({
                                    url: n[t].url,
                                    referer: n[t].refer,
                                    fileName: n[t].name,
                                    nameFixedFlag: n[t].name ? A.ThunderNewtaskHelperNS.taskOptFileNameFixed : void 0,
                                    statClick: n[t].stat ? n[t].stat : "outline",
                                    browser: n[t].browser ? n[t].browser : "xlbrowser.exe",
                                    fileSize: n[t].fileSize ? n[t].fileSize : 0
                                }); else for (let a of i) e.push({
                                    url: a,
                                    referer: n[t].refer,
                                    statClick: n[t].stat ? n[t].stat : "outline",
                                    browser: n[t].browser ? n[t].browser : "xlbrowser.exe"
                                })
                            }
                            F.ThunderNewTask.createPreNewTaskWindow(e);
                            break
                        }
                        if ("bt" === t.type) {
                            let e = t.url;
                            F.ThunderNewTask.createBtTaskWindow({
                                url: e,
                                type: "url"
                            }, {
                                source: t.stat ? t.stat : "outline",
                                browser: t.browser ? t.browser : "xlbrowser.exe",
                                referer: t.refer
                            });
                            break
                        }
                        "bird" === t.type && g.URLHelperNS.isBirdKey(t.url) && _.openBirdKeyDecodeDialog(t.url, {from: t.stat || "outline"})
                    }
                } while (0)
            }

            createNewTaskEx(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = i[0], n = [];
                    for (let e in t) {
                        let i = t[e];
                        if (g.URLHelperNS.isBirdKey(i.url)) {
                            _.openBirdKeyDecodeDialog(i.url, {from: i.stat});
                            continue
                        }
                        let a = y.ThunderHelper.getTaskTypeFromUrl(i.url);
                        if (q.information("createNewTaskEx", i.url, "type:", a), a === T.DownloadKernel.TaskType.P2sp || a === T.DownloadKernel.TaskType.Emule) n.push({
                            url: t[e].url,
                            referer: t[e].refer,
                            fileName: t[e].name,
                            statClick: t[e].stat
                        }); else if (a === T.DownloadKernel.TaskType.Bt || a === T.DownloadKernel.TaskType.Magnet) {
                            let e = i.url;
                            F.ThunderNewTask.createBtTaskWindow({url: e, type: "url"}, {
                                source: i.stat,
                                referer: i.refer
                            })
                        } else i.url.includes("taskGroupName") && F.ThunderNewTask.createThunderxTask(i.url, i.stat, !1).catch()
                    }
                    n.length > 0 && F.ThunderNewTask.createPreNewTaskWindow(n)
                } while (0)
            }

            addUrls2Cloud(e, t, ...i) {
                F.ThunderNewTask.addUrls2Cloud(i[0], i[1], i[2], i[3], i[4], i[5]).catch()
            }

            addBt2Cloud(e, t, ...i) {
                F.ThunderNewTask.addBt2Cloud(i[0], i[1], i[2], i[3]).catch()
            }

            showCustomDownloadModeDlg(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    N.DownloadModeNS.showCustomDownloadModeDlg().catch()
                } while (0)
            }

            getTaskStartStatusPrompt(e, t, ...i) {
                let n = "";
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = null;
                    try {
                        t = JSON.parse(i[0])
                    } catch (e) {
                    }
                    t && (n = R.TaskStatusHelper.getTaskStartStatusPrompt(t)), N.DownloadModeNS.showCustomDownloadModeDlg().catch()
                } while (0);
                return n
            }

            showBrowserGuideDlg(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    M.default().popUpBrowserGuide(!0).catch()
                } while (0)
            }

            openURLByIEorDefault(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    n = Z.openURLByIEorDefault(i[0])
                } while (0);
                return n
            }

            openURLByDefault(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    n = Z.openURLByDefault(i[0])
                } while (0);
                return n
            }

            getDownloadDir(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        do {
                            if (S.ConfigNS.getValue("TaskDefaultSettings", "UseLastCatalog", !0) && (t = S.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "")) || (t = S.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), void 0 !== t && null !== t && "" !== t && (yield w.FileSystemAWNS.mkdirsAW(t))) break;
                            t = f.ThunderUtil.getDefaultDownloadDir()
                        } while (0)
                    } while (0);
                    return t
                })
            }

            getProfilesDir(e, t, ...i) {
                return __profilesDir
            }

            showPersonalPage(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                        let n = i[0];
                        if (!this.isPersonalPageTrackEvent) {
                            this.isPersonalPageTrackEvent = !0;
                            let e = S.ConfigNS.getValue("Install", "PersonalUid", "");
                            void 0 !== e && null !== e || (e = "");
                            let i = "uid=" + e + ",start_page=" + (n ? "Individualization_home_page" : "official_home_page");
                            t = yield h.XLStatNS.asyncTrackEvent("core_event", "startup_page", "", 0, 0, 0, 0, i)
                        }
                    } while (0);
                    return t
                })
            }

            showWebWnd(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        if (null !== i[10] && void 0 !== i[10]) {
                            let e = i[10];
                            i[10] = (() => n(this, void 0, void 0, function* () {
                                return (yield e())[0]
                            }))
                        }
                        let t = i[0];
                        i.splice(0, 1), yield U.EmbeddedBrowserManagerNs.showWebWnd(t, ...i)
                    } while (0)
                })
            }

            createWebWnd(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        if (null !== i[10] && void 0 !== i[10]) {
                            let e = i[10];
                            i[10] = (() => n(this, void 0, void 0, function* () {
                                let t = yield e();
                                return q.information("embed createWebWnd showCallback", ...t), t[0]
                            }))
                        }
                        let t = i[0];
                        i.splice(0, 1), yield U.EmbeddedBrowserManagerNs.createWebWnd(t, ...i)
                    } while (0)
                })
            }

            createWebWndEx(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let t = i[0];
                        if (!t || !t.business) break;
                        if (null !== t.onShowCallback && void 0 !== t.onShowCallback) {
                            let e = t.onShowCallback;
                            t.onShowCallback = (() => n(this, void 0, void 0, function* () {
                                let t = yield e();
                                return q.information("embed createWebWndEx showCallback", ...t), t[0]
                            }))
                        }
                        yield U.EmbeddedBrowserManagerNs.createWebWndEx(t)
                    } while (0)
                })
            }

            closeWebWnd(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if ("" === t) break;
                    U.EmbeddedBrowserManagerNs.closeWebWnd(t)
                } while (0)
            }

            existWebWnd(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if ("" === t) break;
                    n = U.EmbeddedBrowserManagerNs.existWebWnd(t)
                } while (0);
                return n
            }

            visibleWebWnd(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if ("" === t) break;
                    n = U.EmbeddedBrowserManagerNs.visibleWebWnd(t, i[1], i[2])
                } while (0);
                return n
            }

            bringWebWndToTop(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    n = U.EmbeddedBrowserManagerNs.bringWebWndToTop(t)
                } while (0);
                return n
            }

            enableSignAutoShow(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i) break;
                    let t = i[0];
                    U.EmbeddedBrowserManagerNs.enableSignAutoShow(t)
                } while (0)
            }

            registerWebFunction(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = i[1], o = i[2];
                    if (!a) break;
                    if (!o) break;
                    U.EmbeddedBrowserManagerNs.registerWebFunction(t, a, (e, t, i, a) => n(this, void 0, void 0, function* () {
                        let n = yield o(...a);
                        e.callNativeFunctionCallback(t, i, x.NativeFunctionErrorCode.Success, n[0])
                    }))
                } while (0)
            }

            registerWebExternal(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i) break;
                    let t = i[0];
                    if (!t) break;
                    if ("object" != typeof t) break;
                    let a = [];
                    for (let i in t) {
                        if (!i) continue;
                        let o = t[i];
                        o && (W.NativeCallNS.checkNativeFunction(i) || (a.push({
                            functionName: i,
                            nativeFunc: (e, t, i, a) => n(this, void 0, void 0, function* () {
                                let n = yield o(...a);
                                e.callNativeFunctionCallback(t, i, x.NativeFunctionErrorCode.Success, n[0])
                            })
                        }), this.clientWebExternalMap[i] = e))
                    }
                    a.length > 0 && W.NativeCallNS.registerNativeFunction(a)
                } while (0)
            }

            fireEventFunction(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    K.NativeCallHostModule.nativeCallHost.fireNativeEvent("onWebEvent", ...i)
                } while (0)
            }

            callBackWebFunction(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], n = i[1], a = i[2], o = i[3];
                    if (!t) break;
                    if (void 0 === n || null === n) break;
                    if (void 0 === a || null === a) break;
                    U.EmbeddedBrowserManagerNs.callBackWebFunction(t, n, a, o)
                } while (0)
            }

            fireEventWebFunction(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    i.splice(0, 1), U.EmbeddedBrowserManagerNs.fireEventWebFunction(t, ...i)
                } while (0)
            }

            isPhoneAuth(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = yield O.phoneAuthObject.isPhoneAuthAw()
                    } while (0);
                    return t
                })
            }

            getSearchRecommends(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = D.SearchConfigNS.getRecommends()
                } while (0);
                return n
            }

            setSearchRecommends(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    D.SearchConfigNS.setRecommends(t)
                } while (0)
            }

            getBaiduDWZ(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0];
                        t = yield m.getBaiduDWZ(n)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLink(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = "pic";
                        r.isString(i[1]) && (a = i[1]);
                        let o = "";
                        r.isString(i[2]) && (o = i[2]), t = yield G.getShouleiShareLink(n, a, o)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLinkDlj(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = "pic";
                        r.isString(i[1]) && (a = i[1]);
                        let o = "";
                        r.isString(i[2]) && (o = i[2]), t = yield G.getShouleiShareLinkDlj(n, a, o)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLink2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = "pic";
                        r.isString(i[6]) && (u = i[6]);
                        let c = "";
                        r.isString(i[7]) && (c = i[7]), t = yield G.getShouleiShareLink2(n, a, o, s, l, d, u, c)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLinkDlj2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = "pic";
                        r.isString(i[6]) && (u = i[6]);
                        let c = "";
                        r.isString(i[7]) && (c = i[7]), t = yield G.getShouleiShareLinkDlj2(n, a, o, s, l, d, u, c)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferLink(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || i[1]) break;
                        let n = i[0], a = i[1], o = "pic";
                        r.isString(i[2]) && (o = i[2]);
                        let s = "";
                        r.isString(i[3]) && (s = i[3]), t = yield G.getShouleiFileTransferLink(n, a, o, s)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferDlj(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[1]) break;
                        let n = i[0], a = i[1], o = "pic";
                        r.isString(i[2]) && (o = i[2]);
                        let s = "";
                        r.isString(i[3]) && (s = i[3]), t = yield G.getShouleiFileTransferDlj(n, a, o, s)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferLink2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[6]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = i[6], c = "pic";
                        r.isString(i[7]) && (c = i[7]);
                        let h = "";
                        r.isString(i[8]) && (h = i[8]), t = yield G.getShouleiFileTransferLink2(n, a, o, s, l, d, u, c, h)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferDlj2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[6]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = i[6], c = "pic";
                        r.isString(i[7]) && (c = i[7]);
                        let h = "";
                        r.isString(i[8]) && (h = i[8]), t = yield G.getShouleiFileTransferDlj2(n, a, o, s, l, d, u, c, h)
                    } while (0);
                    return t
                })
            }

            log(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || i.length < 3) break;
                    let t = i[0], n = i[1], a = null;
                    switch (a = r.isString(t) && t.length > 0 ? s.default.getLogger(t) : q, n) {
                        case"verbose":
                            a.verbose(...i.splice(2));
                            break;
                        case"information":
                            a.information(...i.splice(2));
                            break;
                        case"warning":
                            a.warning(...i.splice(2));
                            break;
                        case"error":
                            a.error(...i.splice(2));
                            break;
                        case"critical":
                            a.critical(...i.splice(2))
                    }
                } while (0)
            }

            isDevToolsEnable(e, t, ...i) {
                return v.DevEnvHelperNS.isDevToolsEnable()
            }

            isMainWndVisible(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let i = yield a.asyncRemoteCall.getCurrentWindow(), n = yield i.isMinimized(),
                            o = yield i.isVisible();
                        i && !n && o && (t = !0)
                    } while (0);
                    return t
                })
            }

            isInFullScreen(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = Z.IsInFullScreen()
                    } while (0);
                    return t
                })
            }

            switchDetail(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                        let t = i[0], n = i[1];
                        yield F.ThunderNewTask.selectTask(t), n && setTimeout(() => {
                            K.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", t, n), d.server.fireClientEvent("OnTabChange", n)
                        }, 100), l.client.callServerFunction("SelectNav", Y.NavViewID.Download).catch()
                    } while (0)
                })
            }

            utf8StringEncodeToBinary(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = i[1];
                    n = Z.utf8StringEncodeToBinary(t, a)
                } while (0);
                return n
            }

            utf8StringDecodeFromBinary(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = i[1];
                    n = Z.utf8StringDecodeFromBinary(t, a)
                } while (0);
                return n
            }

            getErrorCodeConfigMessage(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = i[1];
                    n = V.default.getMessage(t, a)
                } while (0);
                return n
            }

            getErrorCodeConfigData(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = i[0];
                    n = V.default.getData(t)
                } while (0);
                return n
            }

            getMainWndHandle(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = (yield(yield a.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle()).readUIntLE(0, 4)
                    } while (0);
                    return t
                })
            }

            getPluginStatus(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    let t = i[0];
                    if (!t) break;
                    n = p.PluginLoaderNS.pluginLoader.getPluginStatus(t)
                } while (0);
                return n
            }

            setPluginStatus(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let n = i[0];
                        if (!n) break;
                        let a = i[1];
                        if (!a) break;
                        if ("ready" !== a && "loaded" !== a) break;
                        t = yield p.PluginLoaderNS.pluginLoader.setPluginStatus(n, a)
                    } while (0);
                    return t
                })
            }

            popPluginGroups(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    let t = i[0];
                    if (!t) break;
                    n = p.PluginLoaderNS.pluginLoader.popPluginGroups(t)
                } while (0);
                return n
            }

            getInitUserLoginParam(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let i = yield(yield a.asyncRemoteCall.getCurrentWebContents()).session.getUserAgent(),
                            n = "XW-G4v1H72tgfJym", o = "Qbaferw2knfQKqxa25EYJGtZ2_6755CMwzXBN3ctW54",
                            s = "https://xluser-ssl.xunlei.com";
                        1 === S.ConfigNS.getValue("UserLoginConfig", "TestServer", 0) && (n = "XXDfQA-ruQKfza9f", o = "jXD0dQ-nm_yybCfqj7EqUKQtp6sc5q1kzodIj96Gfq0", s = "https://dev-xluser-ssl.xunlei.com"), t = {
                            clientId: n,
                            clientSecret: o,
                            apiOrigin: s,
                            userAgent: i
                        }
                    } while (0);
                    return t
                })
            }

            bringMainWndToTop(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let t = yield a.asyncRemoteCall.getCurrentWindow();
                        t && ((yield t.isMinimized()) && (yield t.restore()), yield t.show(), yield b.ToolsUtilitiesAWNS.setForegroundWindow(Z, t))
                    } while (0)
                })
            }

            messageBoxPop(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    q.information("messageBoxPop args:", i);
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[1]) break;
                        let n = i[0], a = i[1];
                        if ("object" != typeof n || "object" != typeof a) break;
                        t = yield z.MessageBox.pop(n, a)
                    } while (0);
                    return t
                })
            }

            messageBoxConfirm(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    q.information("messageBoxConfirm args:", i);
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[1]) break;
                        let n = i[0], a = i[1];
                        if ("object" != typeof n || "object" != typeof a) break;
                        t = yield z.MessageBox.confirm(n, a)
                    } while (0);
                    return t
                })
            }

            messageBoxCustom(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    q.information("messageBoxPop args:", i);
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = i[1] || {}, o = i[2] || {};
                        t = yield z.MessageBox.custom(n, a, o)
                    } while (0);
                    return t
                })
            }

            flashFrame(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = yield a.asyncRemoteCall.getCurrentWindow();
                    e && (yield e.flashFrame(!0), e.on("focus", function t() {
                        e.flashFrame(!1), i && i[0] && i[0](), e.removeListener("focus", t)
                    }))
                })
            }

            setTrayImage(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        yield d.server.callClientFunctionByName(u.CommonIPCBase.mainProcessContext, "SetTrayImage", i[0])
                    } while (0)
                })
            }

            flashTray(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i) break;
                        yield l.client.callRemoteClientFunction(u.CommonIPCBase.mainProcessContext, "FlashTray", ...i)
                    } while (0)
                })
            }

            getMainWindowStates(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    function t() {
                        let e = Z.getForegroundProcessName(), t = !1;
                        return (e.toLowerCase().indexOf("thunder.exe") > -1 || e.toLowerCase().indexOf("xlbrowser.exe") > -1) && (t = !0), t
                    }

                    let i = {};
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let n = yield a.asyncRemoteCall.getCurrentWindow();
                        if (!n) break;
                        i = {
                            visible: yield n.isVisible(),
                            alwaysOnTop: yield n.isAlwaysOnTop(),
                            destroyed: yield n.isDestroyed(),
                            focused: yield n.isFocused(),
                            fullScreen: yield n.isFullScreen(),
                            maximized: yield n.isMaximized(),
                            minimized: yield n.isMinimized(),
                            modal: yield n.isModal(),
                            foreground: t()
                        }
                    } while (0);
                    return i
                })
            }

            showAniCover(e, t, ...i) {
                let n = void 0;
                do {
                    if (!i || !i[0]) break;
                    n = c.MatteNS.pop("MatteAni", i[0], {customClass: i[1] || "td-cover--ordinary"})
                } while (0);
                return n
            }

            closeAniCover(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    c.MatteNS.close("MatteAni", i[0])
                } while (0)
            }

            popFileSelect(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (r.isNullOrUndefined(Q)) break;
                        e = yield Q.popFileSelect()
                    } while (0);
                    return e
                })
            }

            popFilesSelect(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = [];
                    do {
                        if (r.isNullOrUndefined(Q)) break;
                        e = yield Q.popFileSelects()
                    } while (0);
                    return e
                })
            }

            getMediaInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (!i || !i[0] || r.isNullOrUndefined(Q)) break;
                        e = i[0]
                    } while (0);
                    return Q.getMediaInfo(e)
                })
            }

            caclGcid(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (!i || !i[0] || r.isNullOrUndefined(Q)) break;
                        e = i[0]
                    } while (0);
                    return Q.caclGCid(e)
                })
            }

            caclCid(e, t, ...i) {
                let n = "";
                do {
                    if (!i || !i[0] || r.isNullOrUndefined(Q)) break;
                    n = i[0]
                } while (0);
                return Q.caclCid(n)
            }

            caclBCid(e, t, ...i) {
                let n = "";
                do {
                    if (!i || !i[0] || r.isNullOrUndefined(Q)) break;
                    n = i[0]
                } while (0);
                return Q.caclBCid(n)
            }

            uploadFileToOss(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "", t = "", n = void 0;
                    do {
                        if (!i || !i[0] || !i[1] || !i[2] || r.isNullOrUndefined(Q)) break;
                        if (e = i[0], t = i[1], !(n = i[2]).regin && n.endpoint) {
                            let e = n.endpoint.indexOf(".aliyuncs.com");
                            -1 !== e && (n.region = n.endpoint.slice(0, e))
                        }
                    } while (0);
                    return Q.uploadFileToOss(e, t, n)
                })
            }

            getUploadProg(e, t, ...i) {
                let n = "";
                do {
                    if (!i || !i[0]) break;
                    n = i[0]
                } while (0);
                return Q.getProg(n)
            }

            cancelUpload(e, t, ...i) {
                Q.cancelUpload()
            }

            pauseUpload(e, t, ...i) {
                Q.pauseUpload()
            }

            createDownloadAndPlayTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return !!(i && i[0] && i[1]) && $.DownloadAndPlayUnionNS.createDowndAndPlayTask(i[0], i[1], i[2], !0)
                })
            }

            popFileSelectAndGetInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = [], t = yield Q.popFileSelect();
                    return w.FileSystemAWNS.existsAW(t) && e.push({
                        filePath: t,
                        fileInfo: yield Q.getMediaInfo(t),
                        fileSize: yield w.FileSystemAWNS.getFileSize(t)
                    }), e
                })
            }

            popFilesSelectAndGetInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = [], t = yield Q.popFileSelects(!0);
                    for (let i of t) w.FileSystemAWNS.existsAW(i) && e.push({
                        filePath: i,
                        fileInfo: yield Q.getMediaInfo(i),
                        fileSize: yield w.FileSystemAWNS.getFileSize(i)
                    });
                    return e
                })
            }

            resumeUpload(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "", t = "", n = void 0;
                    do {
                        if (!i || !i[0] || !i[1] || !i[2] || r.isNullOrUndefined(Q)) break;
                        if (e = i[0], t = i[1], !(n = i[2]).regin && n.endpoint) {
                            let e = n.endpoint.indexOf(".aliyuncs.com");
                            -1 !== e && (n.region = n.endpoint.slice(0, e))
                        }
                    } while (0);
                    return Q.resumeUpload(e, t, n)
                })
            }

            postUpload(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "", t = {}, n = "";
                    do {
                        if (!i || !i[0] || !i[1] || r.isNullOrUndefined(Q)) break;
                        n = i[0], e = i[1], t = i[2]
                    } while (0);
                    return Q.postUpload(n, e, t)
                })
            }

            setPopMutual(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    X.popMutual.setReady(i[0])
                } while (0)
            }

            closePopMutual(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    X.popMutual.setFinish(i[0])
                } while (0)
            }

            createBtTaskWindow(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    let e = i[0];
                    if (e && e.length > 0) for (let t of e) F.ThunderNewTask.createBtTaskWindow({
                        url: t.url,
                        type: "url",
                        birdkeyChars: t.birdkeyChars
                    }, {source: t.statClick || "newwindow_url", referer: t.referer, clickFrom: i[1]})
                } while (0)
            }

            createTaskDirectly(e, t, ...i) {
                let n = i[0];
                F.ThunderNewTask.createP2spEmuleTasksDirectly(n).catch()
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.PluginFunctionNS || (t.PluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(19);
    !function (e) {
        const t = new class extends n.EventEmitter {
            constructor() {
                super(...arguments), this.index = 0
            }

            pop(e, t, i) {
                return this.index++, this.emit("matte-pop", e, t, i, this.index), this.index
            }

            close(e, t) {
                this.emit("matte-close", e, t)
            }
        };
        e.getInstance = function () {
            return t
        }, e.pop = function (e, i, n) {
            return t.pop(e, i, n)
        }, e.close = function (e, i) {
            return t.close(e, i)
        }
    }(t.MatteNS || (t.MatteNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(2), r = i(7), s = i(0), l = i(102), d = i(11), u = i(6), c = i(5), h = i(4), f = i(594),
        g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")), p = s.default.getLogger("FileMediaInfoOss");
    var v;
    !function (e) {
        e[e.UploadUnknown = 0] = "UploadUnknown", e[e.UploadSuccess = 1] = "UploadSuccess", e[e.UploadFail = 2] = "UploadFail", e[e.UploadPause = 3] = "UploadPause", e[e.UploadCancel = 4] = "UploadCancel"
    }(v || (v = {}));

    class m {
        constructor() {
            this.progress = new Map, this.inited = !1
        }

        getProg(e) {
            if ("" === e) return 0;
            let t = this.progress.get(e);
            return h.isNullOrUndefined(t) && (t = 0), t
        }

        popFileSelect() {
            return n(this, void 0, void 0, function* () {
                const e = yield d.asyncRemoteCall.getDialog();
                let t = yield d.asyncRemoteCall.getCurrentWindow(), i = yield e.showOpenDialog(t, {
                    title: "打开",
                    properties: ["openFile"],
                    filters: [{name: "All Files", extensions: ["*"]}]
                });
                if (i.canceled) return "";
                {
                    let e = i.filePaths;
                    return e ? e[0] : ""
                }
            })
        }

        popFileSelects(e = !1) {
            return n(this, void 0, void 0, function* () {
                const e = yield d.asyncRemoteCall.getDialog();
                let t = yield d.asyncRemoteCall.getCurrentWindow(), i = e.showOpenDialog(t, {
                    title: "打开",
                    properties: ["multiSelections"],
                    filters: [{name: "All Files", extensions: ["*"]}]
                });
                if (i.canceled) return [];
                {
                    let e = i.filePaths;
                    return e || []
                }
            })
        }

        caclGCid(e) {
            return n(this, void 0, void 0, function* () {
                return yield new Promise(t => {
                    g.calculateFileGCID(e, e => {
                        p.information("getVideoMediaInfo calculateFileGCID result", e), t(e)
                    })
                })
            })
        }

        caclCid(e) {
            return n(this, void 0, void 0, function* () {
                return yield new Promise(t => {
                    g.calculateFileCID(e, e => {
                        p.information("getVideoMediaInfo calculateFileCID result", e), t(e)
                    })
                })
            })
        }

        caclBCid(e) {
            return n(this, void 0, void 0, function* () {
                let t = "";
                return p.information("caclBcid filePath ", e), t = yield new Promise(t => {
                    g.calculateFileBCID(e, e => {
                        p.information("getVideoMediaInfo calculateFileCID result", e), t(e)
                    })
                })
            })
        }

        getMediaInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = "";
                return "" !== e && (t = yield new Promise(t => {
                    g.getMediaInfo(e, e => {
                        p.information("getVideoMediaInfo result", e), t(e)
                    })
                })), t
            })
        }

        getBlockSize(e) {
            let t = 0;
            do {
                if (e <= 0) {
                    t = 0;
                    break
                }
                if (e >= 0 && e <= 128 << 20) {
                    t = 262144;
                    break
                }
                if (e > 128 << 20 && e <= 256 << 20) {
                    t = 524288;
                    break
                }
                if (e > 256 << 20 && e <= 512 << 20) {
                    t = 1048576;
                    break
                }
                t = 2097152
            } while (0);
            return t
        }

        getFileMediaInfo() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.popFileSelect();
                if (!e) return null;
                let t = o.basename(e), i = o.extname(e), n = yield u.FileSystemAWNS.getFileSize(e),
                    a = this.getBlockSize(n), r = {
                        mediaName: t,
                        mediaSuffix: i,
                        mediaGcid: "",
                        mediaBcid: "",
                        mediaCid: "",
                        mediaPath: e,
                        mediaSize: n.toString(),
                        mediaBlockSize: a.toString()
                    };
                do {
                    let t = yield this.getMediaInfo(e);
                    if (!t) {
                        p.information("getVideoMediaInfo result failed");
                        break
                    }
                    Object.assign(r, this.decodeMediaInfo(t)), r.mediaCid = yield this.caclCid(e), p.information("getVideoMediaInfo mediaInfo", r), r.mediaGcid = yield this.caclGCid(e), r.mediaBcid = yield this.caclBCid(e), p.information("getVideoMediaInfo mediaInfo gcid", r)
                } while (0);
                return r
            })
        }

        getFileMediaInfos() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.popFileSelects();
                if (e.length < 1) return null;
                let t = [];
                for (let i in e) {
                    let e = o.basename(i), n = o.extname(i), a = yield u.FileSystemAWNS.getFileSize(i),
                        r = this.getBlockSize(a), s = {
                            mediaName: e,
                            mediaSuffix: n,
                            mediaGcid: "",
                            mediaBcid: "",
                            mediaCid: "",
                            mediaPath: i,
                            mediaSize: a.toString(),
                            mediaBlockSize: r.toString()
                        };
                    do {
                        let e = yield this.getMediaInfo(i);
                        if (!e) {
                            p.information("getVideoMediaInfo result failed");
                            break
                        }
                        Object.assign(s, this.decodeMediaInfo(e)), s.mediaCid = yield this.caclCid(i), p.information("getVideoMediaInfo mediaInfo", s), s.mediaGcid = yield this.caclGCid(i), s.mediaBcid = yield this.caclBCid(i), t.push(s), p.information("getVideoMediaInfo mediaInfo gcid", s)
                    } while (0)
                }
                return t
            })
        }

        timeStringToNumber(e) {
            let t = e.split(" "), i = 0;
            for (let e of t) {
                let t = e.indexOf("h");
                -1 === t ? -1 === (t = e.indexOf("mn")) ? -1 === (t = e.indexOf("ms")) ? -1 === (t = e.indexOf("s")) || (i += 1e3 * Number(e.substr(0, t))) : i += Number(e.substr(0, t)) : i += 60 * Number(e.substr(0, t)) * 1e3 : i += 60 * Number(e.substr(0, t)) * 60 * 1e3
            }
            return i
        }

        decodeMediaInfo(e) {
            let t = {}, i = e.split("\r\n"), n = "";
            for (let e of i) -1 !== e.indexOf("时长 =") && (n = e.substring(e.indexOf("时长 =") + "时长 =".length, e.length - 2), t.mediaTime = this.timeStringToNumber(n).toString()), -1 !== e.indexOf("画面宽度 =") && (t.mediaWidth = e.substring(e.indexOf("画面宽度 =") + "画面宽度 =".length, e.indexOf("pixels")).replace(/\s*/g, "")), -1 !== e.indexOf("画面高度 =") && (t.mediaHeight = e.substring(e.indexOf("画面高度 =") + "画面高度 =".length, e.indexOf("pixels")).replace(/\s*/g, "")), -1 !== e.indexOf("总体码率 =") && (t.mediaVideoBit = e.substring(e.indexOf("总体码率 =") + "总体码率 =".length, e.indexOf("Kbps")).replace(/\s*/g, ""));
            return t
        }

        cancelUpload() {
            c.client.broadcastEvent("cancelUpload", !0)
        }

        pauseUpload() {
            c.client.broadcastEvent("cancelUpload", !1)
        }

        initConfig() {
            return n(this, void 0, void 0, function* () {
                this.inited || (yield f.UploadConfigNS.init(a.join(__profilesDir, "uploadConfig.json")), this.inited = !0)
            })
        }

        getValue(e, t, i) {
            return n(this, void 0, void 0, function* () {
                return yield this.initConfig(), f.UploadConfigNS.getValue(e, t, i)
            })
        }

        deleteValue(e, t) {
            return n(this, void 0, void 0, function* () {
                return yield this.initConfig(), f.UploadConfigNS.removeValue(e, t)
            })
        }

        setValue(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.initConfig(), f.UploadConfigNS.setValue(e, t, i)
            })
        }

        getState(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let e = v.UploadUnknown, a = 0;
                return yield this.initConfig(), e = yield new Promise(e => {
                    a = c.client.attachServerEvent("cancelUpload", (a, o) => n(this, void 0, void 0, function* () {
                        o && (yield this.deleteValue(t, "checkpoint"), e(v.UploadCancel)), i.kill(), e(v.UploadPause)
                    })), i.on("message", i => n(this, void 0, void 0, function* () {
                        i.progress && this.progress.set(t, Math.floor(100 * Number(i.progress))), i.cpt && (yield this.setValue(t, "checkpoint", i.cpt)), i.result && (200 === i.result.res.status ? (this.progress.set(t, 100), e(v.UploadSuccess)) : (this.progress.delete(t), e(v.UploadFail)), p.warning("uploadFileToOss result: ", i.result, i.result.res.status)), i.error && (this.progress.delete(t), p.warning("uploadFileToOss error: ", i.error), e(v.UploadFail))
                    }))
                }), c.client.detachServerEvent("CancelUpload", a), c.client.broadcastEvent("UploadFileToOssState", e), e
            })
        }

        resumeUpload(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if ("" !== e && "" !== t && !h.isNullOrUndefined(i)) {
                    this.progress.set(e, 0);
                    let n = `${__rootDir}/out/upload-oss.js`,
                        a = l.fork(n, ["--type=xdas-plugin-process", "--xdas-plugin-name=upload-oss"]),
                        o = yield this.getValue(t, "checkpoint", void 0);
                    a.send({filePath: e, key: t, checkpoint: o, token: i}), this.getState(e, t, a).catch()
                }
                return !0
            })
        }

        postUpload(e, t, i = {}) {
            return n(this, void 0, void 0, function* () {
                let a;
                return function (e) {
                    e[e.success = 0] = "success", e[e.fail = 1] = "fail", e[e.not_exist = 2] = "not_exist"
                }(a || (a = {})), new Promise(o => {
                    if ("" !== e && "" !== t && u.FileSystemAWNS.existsAW(t)) {
                        let r = `${__rootDir}/out/post-upload-oss`,
                            s = l.fork(r, ["--type=xdas-plugin-process", "--xdas-plugin-name=post-upload-oss"]);
                        s.send({
                            postUrl: e,
                            filePath: t,
                            params: i
                        }), s.on("message", e => n(this, void 0, void 0, function* () {
                            o(e ? a.success : a.fail)
                        }))
                    } else o(a.not_exist)
                })
            })
        }

        uploadFileToOss(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if ("" !== e && "" !== t && !h.isNullOrUndefined(i)) {
                    this.progress.set(e, 0);
                    let n = `${__rootDir}/out/upload-oss.js`,
                        a = l.fork(n, ["--type=xdas-plugin-process", "--xdas-plugin-name=upload-oss"]), o = void 0;
                    a.send({filePath: e, key: t, checkpoint: o, token: i}), this.getState(e, t, a).catch()
                }
                return !0
            })
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(45), o = i(0), r = i(42), s = i(6), l = i(14), d = o.default.getLogger("UploadConfig");

    class u {
        constructor() {
            this.isInit = !1, this.configData = {}, this.configPath = void 0, this.configBakPath = void 0, this.eventContainer = new r.default, this.changed = !1, this.timer = null, this.eventContainer.setMaxListeners(0)
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    this.configPath = e, this.configBakPath = e + ".bak";
                    let t = null, i = yield s.FileSystemAWNS.existsAW(e);
                    if (i) {
                        let i = yield s.FileSystemAWNS.readFileAW(e);
                        if (i && i.length > 0) try {
                            t = JSON.parse(i.toString())
                        } catch (e) {
                            d.warning(e)
                        }
                    }
                    if (!t) if (i = yield s.FileSystemAWNS.existsAW(this.configBakPath)) {
                        let e = yield s.FileSystemAWNS.readFileAW(this.configBakPath);
                        if (e && e.length > 0) try {
                            t = JSON.parse(e.toString())
                        } catch (e) {
                            d.warning(e)
                        }
                    } else a.openSync(this.configPath, "w+");
                    t && this.mergeConfigData(t), this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventUploadConfigInitFinished)
                }
                this.timer || (this.timer = setInterval(() => {
                    this.changed && (this.changed = !1, this.save().catch())
                }, 5e3))
            })
        }

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

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

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

        isInitConfigFinished() {
            return this.isInit
        }

        save() {
            return n(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), yield s.FileSystemAWNS.writeFileAW(this.configBakPath, e)
                }
            })
        }

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

        attachListener(e, t) {
            do {
                if (e === l.NodeEventMesssageNS.eventUploadConfigInitFinished) {
                    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 i = e[t];
                if (!i) break;
                for (let e in i) {
                    let n = i[e], a = this.configData[t];
                    if (a) a[e] = n; else {
                        let i = {};
                        i[e] = n, this.configData[t] = i
                    }
                }
            }
        }

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

    t.UploadConfig = u;
    const c = new u;
    !function (e) {
        e.init = function (e) {
            return n(this, void 0, void 0, function* () {
                yield c.init(e)
            })
        }, e.isInitConfigFinished = function () {
            return c.isInitConfigFinished()
        }, e.save = function () {
            return n(this, void 0, void 0, function* () {
                yield c.save()
            })
        }, e.saveSync = function () {
            c.saveSync()
        }, e.getValue = function (e, t, i) {
            return c.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            c.setValue(e, t, i)
        }, e.removeValue = function (e, t) {
            c.removeValue(e, t)
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.UploadConfigNS || (t.UploadConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4), o = i(16), r = i(9), s = i(14), l = i(24), d = i(353), u = i(86), c = i(88), h = i(354);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                    o.server.fireClientEvent("OnConfigValueChanged", e, t, i, n), o.server.fireClientEvent("OnConfigValueChanaged", e, t, i, n)
                }), r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    o.server.fireClientEvent("OnConfigInitFinished")
                })
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        Save: this.save,
                        GetValue: this.getValue,
                        SetValue: this.setValue,
                        SaveConfig: this.save,
                        GetConfigValue: this.getValue,
                        SetConfigValue: this.setValue,
                        IsConfigInitFinish: this.isConfigInitFinish,
                        WaitForConfigInitFinish: this.isConfigInitFinish,
                        GetConfigModules: this.getConfigModules,
                        IsConfigBrowserInitFinish: this.isConfigBrowserInitFinish,
                        WaitForConfigBrowserInitFinish: this.isConfigBrowserInitFinish,
                        GetInstallBrowserInfo: this.getInstallBrowserInfo,
                        AddConfigSettingItemData: this.addConfigSettingItemData,
                        RemoveConfigSettingItemData: this.removeConfigSettingItemData,
                        SaveTaskFilters: this.saveTaskFilters,
                        GetPrivateSavePath: this.getPrivateSavePath
                    };
                    o.server.registerFunctions(e)
                }
            }

            save(e, t, ...i) {
                do {
                    if (!e) break;
                    r.ConfigNS.save().catch()
                } while (0)
            }

            getValue(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], o = i[1], s = i[2];
                    n = r.ConfigNS.getValue(t, o, s)
                } while (0);
                return n
            }

            setValue(e, t, ...i) {
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], n = i[1], o = i[2];
                    r.ConfigNS.setValue(t, n, o)
                } while (0)
            }

            isConfigInitFinish(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise((t, i) => {
                        do {
                            if (!e) {
                                i(new Error("client is undefined"));
                                break
                            }
                            r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                                t(!0)
                            })
                        } while (0)
                    })
                })
            }

            getConfigModules(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    let t = "", a = "";
                    i && (i[0] && (t = i[0]), i[1] && (a = i[1]), n = l.default.getConfigInfo(t, a))
                } while (0);
                return n
            }

            isConfigBrowserInitFinish(e, t, ...i) {
                return new Promise((t, i) => {
                    do {
                        if (!e) {
                            i(new Error("client is undefined"));
                            break
                        }
                        c.SettingConfigHelperNS.configBrowserHelper.attachListener(s.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                            t(!0)
                        })
                    } while (0)
                })
            }

            getInstallBrowserInfo(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) break;
                    if ("" === i[0]) break;
                    let t = i[0];
                    n = c.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName(t)
                } while (0);
                return n
            }

            addConfigSettingItemData(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], o = i[1];
                    if ("string" == typeof i[0]) try {
                        t = JSON.parse(i[0])
                    } catch (e) {
                    }
                    if ("string" == typeof i[1]) try {
                        o = JSON.parse(i[1])
                    } catch (e) {
                    }
                    t && o && (n = d.SettingInit.addSettingItemData(t, o))
                } while (0);
                return n
            }

            removeConfigSettingItemData(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], o = i[1];
                    if ("string" == typeof i[0]) try {
                        t = JSON.parse(i[0])
                    } catch (e) {
                    }
                    if ("string" == typeof i[1]) try {
                        o = JSON.parse(i[1])
                    } catch (e) {
                    }
                    t && o && (n = d.SettingInit.removeSettingItemData(t, o))
                } while (0);
                return n
            }

            saveTaskFilters(e, t, ...i) {
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) break;
                    let t = i[0];
                    h.CompletedFilterNS.saveFilter(t, i[1]).catch()
                } while (0)
            }

            getPrivateSavePath(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (!e) break;
                        if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) break;
                        let n = i[0];
                        t = yield u.PrivateSpaceHelperNS.getPrivateSavePath(n)
                    } while (0);
                    return t
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ConfigPluginFunctionNS || (t.ConfigPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(43), o = i(6), r = i(2);
    t.confAdd = new class {
        isXmpExist() {
            return n(this, void 0, void 0, function* () {
                let e = a.Common.getXmpPath();
                return o.FileSystemAWNS.existsAW(e)
            })
        }

        isXmpLiteExist() {
            return n(this, void 0, void 0, function* () {
                let e = r.join(__rootDir, "../../XMP/XMP.exe");
                return o.FileSystemAWNS.existsAW(e)
            })
        }

        updateAssociate(e, t, i) {
            return n(this, void 0, void 0, function* () {
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(598), a = i(599);
    !function (e) {
        e.getWindowPreference = function (e = !1) {
            let t = a.default(), i = {};
            return t && t.colors && "string" == typeof t.colors.colorPrimaryControl1 && (i.hoverBackgroundColor = e ? parseInt(n.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1), 16) : n.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1)), i
        }
    }(t.WindowPreferenceNS || (t.WindowPreferenceNS = {}))
}, function (e, t, i) {
    "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 i(e, i, n, a) {
            return "0x" + t(a) + t(e) + t(i) + t(n)
        }

        e.rgbaStringToHexWith0xBegin = function (e) {
            if (void 0 !== e) {
                let t = e.split(",");
                return i(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 = i
    }(t.ColorUtilNS || (t.ColorUtilNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(0), r = i(5), s = o.default.getLogger("GetSkinInfo");
    let l;
    (function () {
        return n(this, void 0, void 0, function* () {
            "renderer" === process.type ? (s.information("renderer process"), r.client.callServerFunction("GetSkinInfo").then(e => {
                l = e, s.information("send OnChangeSkin", e)
            }).catch(e => {
                s.warning(e)
            }), r.client.attachServerEvent("OnChangeSkin", (e, t) => {
                l = t, s.information("send OnChangeSkin", t)
            })) : "browser" === process.type && (s.information("main process"), a.ipcMain.on("OnChangeSkin", (e, t) => {
                s.information("OnChangeSkin", t), l = t
            }))
        })
    })().catch(e => {
        s.information(e)
    }), t.default = function () {
        return l
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(72), o = i(16), r = n.default.getLogger("ConfigRemoteGlobalPluginFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, a.default.attachListener("OnRemoteGlobalConfigLoaded", e => {
                    r.information("OnRemoteGlobalConfigLoaded ret:", e), o.server.fireClientEvent("OnRemoteGlobalConfigLoaded", e)
                }), a.default.attachListener("OnRemoteGlobalConfigUpdated", e => {
                    r.information("OnRemoteGlobalConfigUpdated ret:", e), o.server.fireClientEvent("OnRemoteGlobalConfigUpdated", e)
                })
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetRemoteGlobalConfigValue: this.getRemoteGlobalConfigValue,
                        IsRemoteGlobalConfigInitFinish: this.isRemoteGlobalConfigInitFinish
                    };
                    o.server.registerFunctions(e)
                }
            }

            getRemoteGlobalConfigValue(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0], o = void 0;
                    i.length >= 2 && (o = i[1]);
                    let r = i[2];
                    n = a.default.getConfigValue(t, o, r)
                } while (0);
                return n
            }

            isRemoteGlobalConfigInitFinish(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    n = a.default.isInited()
                } while (0);
                return n
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ConfigRemoteGlobalPluginFunctionNS || (t.ConfigRemoteGlobalPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(23), r = i(4), s = i(0), l = i(17), d = i(344), u = i(120), c = i(355),
        h = s.default.getLogger("plugin-function-Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetUserID: this.getUserID,
                        GetSessionID: this.getSessionID,
                        GetLoginOption: this.getLoginOption,
                        IsLogined: this.isLogined,
                        GetAllUserInfo: this.getAllUserInfo,
                        GetUserInfo: this.getUserInfo,
                        ShowLoginDlg: this.showLoginDlg,
                        Logout: this.logout,
                        IsAlreadySign: this.isAlreadySign,
                        IsHaveSignQuestion: this.isHaveSignQuestion,
                        GetSessionIDAw: this.getSessionIDAw,
                        GetUserInfoAw: this.getUserInfoAw,
                        GetUserInfoEx: this.getUserInfoEx,
                        GetAllUserInfoAw: this.getAllUserInfoAw,
                        GetUserInfoByKeyAw: this.getUserInfoByKeyAw,
                        Login: this.login,
                        SwitchAccount: this.switchAccount,
                        IsAutoLoginAw: this.isAutoLoginAw,
                        Channel: this.channel,
                        GetVipInfo: this.getVipInfo,
                        GetLoginDeviceID: this.getLoginDeviceID,
                        SendSms: this.sendSms,
                        CheckSms: this.checkSms,
                        RetryLogIn: this.retryLogIn,
                        GetLoginInfo: this.getLoginInfo
                    };
                    a.server.registerFunctions(e), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                        o.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                            do {
                                if (null === e || void 0 === e) break;
                                a.server.fireClientEvent("OnLoginSuc", e)
                            } while (0)
                        })
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                        a.server.fireClientEvent("OnLogout")
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onGetUserInfoFinished", () => {
                        a.server.fireClientEvent("OnGetUserInfoFinished")
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onUserDetailInfoChange", e => {
                        a.server.fireClientEvent("OnUserDetailInfoChange", e)
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginUpdate", (e, t) => {
                        a.server.fireClientEvent("OnLoginUpdate", e, t)
                    })
                }
            }

            getUserID(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.getUserInfo("userid", t => {
                            h.information("getUserID:userid = ", t), null !== t && void 0 !== t && "" !== t || (t = "0"), e(t)
                        })
                    })
                })
            }

            getSessionID(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.getUserInfo("sessionid", t => {
                            h.information("getSessionID:sessionid = ", t), e(t)
                        })
                    })
                })
            }

            getLoginOption(e, t, ...i) {
                return u.LoginOptionNS.loginOption.getOption()
            }

            getSessionIDAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getSessionIDAw()
                })
            }

            getUserInfoAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getUserInfoAw()
                })
            }

            getUserInfoEx(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    if (!i) return;
                    if (2 !== i.length) return;
                    let e = i[0], t = i[1];
                    o.LoginHelperNS.loginHelper.getUserInfoEx(e, e => {
                        t(e)
                    })
                })
            }

            getAllUserInfoAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getAllUserInfoAw()
                })
            }

            getUserInfoByKeyAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getUserInfoByKeyAw(i[0], i[1])
                })
            }

            isLogined(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.isLogined(t => {
                            e(t)
                        })
                    })
                })
            }

            getAllUserInfo(e, t, ...i) {
                return new Promise(e => {
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) o.LoginHelperNS.loginHelper.getAllUserInfo(t => {
                        e(t)
                    }); else {
                        let t = i[0];
                        o.LoginHelperNS.loginHelper.getAllUserInfo(t, t => {
                            e(t)
                        })
                    }
                })
            }

            getUserInfo(e, t, ...i) {
                return h.information(i), new Promise(e => {
                    let t = 0;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) t = 0; else {
                        let e = i[0];
                        t = null === e || void 0 === e || "" === e ? 0 : Number(e)
                    }
                    o.LoginHelperNS.loginHelper.getUserInfoEx(t, t => {
                        e(t)
                    })
                })
            }

            showLoginDlg(e, t, ...i) {
                let n, a = "other", s = !0;
                r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || (a = i[0]), r.isNullOrUndefined(i) || r.isNullOrUndefined(i[1]) || (s = i[1]), r.isNullOrUndefined(i) || r.isNullOrUndefined(i[2]) || (n = i[2]), o.LoginHelperNS.loginHelper.showLoginDlg(a, s, n)
            }

            logout(e, t, ...i) {
                o.LoginHelperNS.loginHelper.logout()
            }

            login(e, t, ...i) {
                let n;
                i && (n = i[0]), o.LoginHelperNS.loginHelper.logIn(n)
            }

            switchAccount(e, t, ...i) {
                let n;
                i && (n = i[0]), o.LoginHelperNS.loginHelper.switchAccount(n)
            }

            isAutoLoginAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.isAutologin(t => {
                            e(t)
                        })
                    })
                })
            }

            channel(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                })
            }

            getVipInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getVipInfo()
                })
            }

            isAlreadySign(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return d.CommonSignFunctionNs.isAlreadySign()
                })
            }

            isHaveSignQuestion(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return d.CommonSignFunctionNs.isHaveSignQuestion()
                })
            }

            getLoginDeviceID(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield o.LoginHelperNS.loginSDKHelper.getDeviceID()
                })
            }

            sendSms(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    return null !== i && void 0 !== i && i.length > 0 && (e = i[0]), yield c.commonLoginHelper.sendSmsAw(e)
                })
            }

            checkSms(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = void 0;
                    do {
                        if (null === i || void 0 === i || i.length < 2) break;
                        let t = i[0], n = i[1];
                        e = yield c.commonLoginHelper.checkSmsAw(t, n)
                    } while (0);
                    return e
                })
            }

            retryLogIn(e, t, ...i) {
                o.LoginHelperNS.loginHelper.logIn("retryLogIn")
            }

            getLoginInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        if (i[0]) {
                            let t = i[0];
                            o.LoginHelperNS.loginHelper.getUserInfo(t, function (t) {
                                e(t)
                            })
                        } else o.LoginHelperNS.loginHelper.getUserInfo(function (t) {
                            e(t)
                        })
                    })
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.LoginPluginFunctionNS || (t.LoginPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(16), r = i(4), s = i(464), l = i(27), d = i(17),
        u = a.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        AttachCallbackEvent: this.attachCallbackEvent,
                        IsTipsWndShow: this.isTipsWndShow,
                        IsMainWndShow: this.isMainWndShow,
                        CreateTipsWnd: this.createTipsWnd,
                        CloseTipsWnd: this.closeTipsWnd,
                        ShowOrHideTipsWnd: this.showOrHideTipsWnd
                    };
                    o.server.registerFunctions(e)
                }
            }

            attachCallbackEvent(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let e = i[0], t = i[1];
                    d.NativeCallModule.nativeCall.AttachNativeEvent(e, (...e) => {
                        l.NativeCallHostModule.nativeCallHost.fireNativeEvent(t, ...e)
                    })
                } while (0)
            }

            createTipsWnd(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(i)) break;
                    if (r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let e = i[0], t = i[1], n = "", a = null, o = null;
                    r.isNullOrUndefined(i[2]) || (a = i[2]), r.isNullOrUndefined(i[3]) || (o = i[3]), r.isNullOrUndefined(i[4]) || (n = i[4]), s.TipsHelperNS.tipsUIHelper.createTipsWnd(e, t, a, o, n).catch()
                } while (0)
            }

            isTipsWndShow(e, t, ...i) {
                return s.TipsHelperNS.tipsUIHelper.isTipsWndShow()
            }

            isMainWndShow(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield s.TipsHelperNS.tipsUIHelper.isMainWndShow()
                })
            }

            closeTipsWnd(e, t, ...i) {
                s.TipsHelperNS.tipsUIHelper.closeTipsWnd()
            }

            showOrHideTipsWnd(e, t, ...i) {
                u.information("showOrHideTipsWnd", ...i);
                let n = !1, a = null, o = null, l = null, d = null;
                r.isNullOrUndefined(i[0]) || (n = i[0]), r.isNullOrUndefined(i[1]) || (a = i[1]), r.isNullOrUndefined(i[2]) || (o = i[2]), r.isNullOrUndefined(i[3]) || (l = i[3]), r.isNullOrUndefined(i[4]) || (d = i[4]), s.TipsHelperNS.tipsUIHelper.showOrHideTipsWnd(n, a, o, l, d)
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.TipsPluginFunctionNS || (t.TipsPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(5), r = i(4), s = i(0), l = i(3), d = i(31), u = i(12), c = i(15), h = i(40), f = i(30),
        g = i(6), p = i(51), v = i(14), m = i(29), y = i(465), k = i(37), T = i(61), w = i(47), C = i(335), S = i(41),
        I = i(26), b = i(119), _ = s.default.getLogger("DKNativeFunction"),
        D = u.DownloadKernelTaskManager.getTaskManager(), A = c.DownloadKernelEventManager.getEventManager(),
        N = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        x = I.DownloadKernelCategoryManager.getCategoryManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, A.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.onTaskDetailChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.DcdnStatusChanged, (...e) => {
                    this.onTaskDcdnStatusChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileLoaded, (...e) => {
                    this.onBtSubFileLoaded(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileForbidden, (...e) => {
                    this.onBtSubFileForbidden(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, (...e) => {
                    this.onBtSubFileDcdnStatusChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    this.onTaskInserted(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    this.onTaskRemoved(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...e) => {
                    this.onTaskCategoryMovedEnd(...e)
                }), d.DownloadKernelManager.attachListener(v.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                    this.onGlobalDownloadSpeedChanged(...e)
                }), m.default.attachListener(v.NodeEventMesssageNS.eventDownloadItemActive, this.onDownloadItemActive.bind(this)), m.default.attachListener(v.NodeEventMesssageNS.eventDownloadItemChosen, this.onDownloadItemChosen.bind(this))
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetTaskBaseInfo: this.getTaskBaseInfo,
                        GetTaskBaseInfo2: this.getTaskBaseInfo2,
                        GetTaskBaseInfos: this.getTaskBaseInfos,
                        GetTaskStatus: this.getTaskStatus,
                        IsTaskExist: this.isTaskExist,
                        EnableDcdnWithVipCert: this.enableDcdnWithVipCert,
                        UpdateDcdnWithVipCert: this.updateDcdnWithVipCert,
                        DisableDcdnWithVipCert: this.disableDcdnWithVipCert,
                        GetTpPeerId: this.getPeerId,
                        ExecSqlite: this.execSqlite,
                        QuerySqlite: this.querySqlite,
                        ExecSqliteEx: this.execSqliteEx,
                        QuerySqliteEx: this.querySqliteEx,
                        GetCategoryViewTaskList: this.getCategoryViewTaskList,
                        GetCategoryViewTaskListForSuspensionWnd: this.getCategoryViewTaskListForSuspensionWnd,
                        IsLoadStorageTaskFinish: this.isLoadStorageTaskFinish,
                        SetTaskExtStat: this.setTaskExtStat,
                        DownloadBySDK: this.asynRequestFile,
                        QueryGlobalInfo: this.queryGlobalInfo,
                        IsFileSizeSetterWorking: this.isFileSizeSetterWorking,
                        LaunchFileAssistant: this.launchFileAssistant,
                        GetTaskProfileLog: this.getTaskProfileLog,
                        GetSubNetUploader: this.getSubNetUploader,
                        GetPrivateSpaceInfo: this.getPrivateSpaceInfo,
                        IsSingleBtTask: this.isSingleBtTask,
                        IsSupportPlay: this.isSupportPlay,
                        IsSupportInstall: this.isSupportInstall,
                        ImportTorrent: this.importTorrent,
                        GetDownloadProgress: this.getDownloadProgressPercent,
                        GetDownloadDetails: this.getDownloadDetails,
                        GetDownloadProgressNumber: this.getDownloadProgress,
                        CreateTask: this.createTask,
                        CreateBatchTask: this.createBatchTask,
                        StartTask: this.startTask,
                        StartWaitingTask: this.startWaitingTask,
                        StopTask: this.stopTask,
                        DeleteTask: this.deleteTask,
                        RemoveToRecycle: this.removeToRecycle,
                        RecoverFromRecycle: this.recoverFromRecycle,
                        BatchStartTask: this.batchStartTask,
                        BatchStartWaitingTask: this.batchStartWaitingTask,
                        BatchStopTask: this.batchStopTask,
                        BatchDeleteTask: this.batchDeleteTask,
                        BatchRemoveToRecycle: this.batchRemoveToRecycle,
                        BatchRecoverFromRecycle: this.batchRecoverFromRecycle,
                        BatchFindTaskAsync: this.batchFindTaskAsync,
                        IsCategoryLoaded: this.isCategoryLoaded,
                        GetCategoryFromUserId: this.getCategoryFromUserId,
                        GetCategoryById: this.getCategoryById,
                        GetCategoryByName: this.getCategoryByName,
                        GetCategoryTaskCount: this.getCategoryTaskCount,
                        GetCategoryTaskList: this.getCategoryTaskList,
                        AddServer: this.addServer,
                        DiscardServer: this.discardServer,
                        GetUserData: this.getUserData,
                        SetUserData: this.setUserData,
                        SetTaskUrl: this.setTaskUrl,
                        GetTaskAttribute: this.getTaskAttribute,
                        InsertPanTaskReference: this.insertPanTaskReference
                    };
                    a.server.registerFunctions(e)
                }
            }

            getTaskBaseInfo(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    if (a) {
                        let e = a.getTaskBaseInfo();
                        n = JSON.stringify(e)
                    }
                } while (0);
                return n
            }

            getTaskBaseInfo2(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    a && (n = a.getTaskBaseInfo())
                } while (0);
                return n
            }

            getTaskBaseInfos(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !r.isArray(i[0])) break;
                    i[0].forEach(e => {
                        let t = D.getTaskFromTaskId(e);
                        if (t) {
                            let e = t.getTaskBaseInfo();
                            n.push(e)
                        }
                    })
                } while (0);
                return n
            }

            getTaskStatus(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    a && (n = a.getTaskStatus())
                } while (0);
                return n
            }

            isTaskExist(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    D.getTaskFromTaskId(t) && (n = !0)
                } while (0);
                return n
            }

            enableDcdnWithVipCert(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0] || !i[1]) break;
                    let t = i[0], n = D.getTaskFromTaskId(t);
                    if (n) {
                        let e = -1;
                        r.isNumber(i[2]) && (e = i[2]), n.enableDcdnWithVipCert(i[1], e)
                    }
                } while (0)
            }

            updateDcdnWithVipCert(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0] || !i[1]) break;
                    let t = i[0], n = D.getTaskFromTaskId(t);
                    if (n) {
                        let e = -1;
                        r.isNumber(i[2]) && (e = i[2]), n.updateDcdnWithVipCert(i[1], e)
                    }
                } while (0)
            }

            disableDcdnWithVipCert(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], n = D.getTaskFromTaskId(t);
                    if (n) {
                        let e = -1;
                        r.isNumber(i[1]) && (e = i[1]), n.disableDcdnWithVipCert(e)
                    }
                } while (0)
            }

            getPeerId(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        _.verbose(i), d.DownloadKernelManager.getPeerId().then(e => {
                            t(e)
                        }).catch()
                    } while (0)
                })
            }

            execSqlite(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) {
                            t(-1);
                            break
                        }
                        if (!i || !i[0]) {
                            t(-2);
                            break
                        }
                        f.ThunderKernel.execSqlite(i[0], (e, i) => {
                            t(e)
                        })
                    } while (0)
                })
            }

            querySqlite(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        f.ThunderKernel.querySqlite(i[0], (e, i, n) => {
                            t(i)
                        })
                    } while (0)
                })
            }

            execSqliteEx(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) {
                            t({result: -1, msg: "client is null or undefined!"});
                            break
                        }
                        if (!i || !i[0]) {
                            t({result: -2, msg: "invalid args!"});
                            break
                        }
                        f.ThunderKernel.execSqliteEx(i[0], (e, i) => {
                            t({result: e, msg: i})
                        })
                    } while (0)
                })
            }

            querySqliteEx(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) {
                            t({result: -1, infos: [], msg: "client is null or undefined!"});
                            break
                        }
                        if (!i || !i[0]) {
                            t({result: -2, infos: [], msg: "invalid args!"});
                            break
                        }
                        f.ThunderKernel.querySqliteEx(i[0], (e, i, n) => {
                            t({result: e, infos: i, msg: n})
                        })
                    } while (0)
                })
            }

            getCategoryViewTaskList(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = N.getCategoryViewFromId(i[0]);
                    if (!t) break;
                    let a = t.getTasks();
                    if (a) for (let e of a) {
                        let t = e[0];
                        n.push(t)
                    }
                } while (0);
                return n
            }

            getCategoryViewTaskListForSuspensionWnd(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = N.getCategoryViewFromId(i[0]);
                    if (!t) break;
                    {
                        let e = t.getTasks();
                        if (e) {
                            n = [];
                            for (let [, t] of e) {
                                let e = t.getTaskBaseInfo();
                                n.push(e)
                            }
                        }
                    }
                } while (0);
                return n
            }

            isLoadStorageTaskFinish(e, t, ...i) {
                return new Promise(e => {
                    d.DownloadKernelManager.attachListener(v.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e(!0)
                    })
                })
            }

            setTaskExtStat(e, t, ...i) {
                let n = void 0, a = i[0], o = D.getTaskFromTaskId(a);
                if (o) {
                    let e = i[1], t = i[2], a = i[3], r = o.getTaskAttribute(l.DownloadKernel.TaskAttribute.VirtualId);
                    n = f.ThunderKernel.setTaskExtStat(r, e, t, a)
                }
                return n
            }

            asynRequestFile(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    {
                        if (!i) throw new Error("call AsynRequestFile expected args which is undefined");
                        let e = i[0];
                        if (!e.url) throw new Error("call AsynRequestFile expected url which is undefined");
                        if (!e.savePath) throw new Error("call AsynRequestFile expected savePath which is undefined");
                        if (!e.fileName) throw new Error("call AsynRequestFile expected fileName which is undefined");
                        let t = i[1];
                        return t && (e.onTaskFinish = t), y.sdkDownloader.createTaskBySDK(e)
                    }
                })
            }

            queryGlobalInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        f.ThunderKernel.queryGlobalInfo(0, t => {
                            e(t)
                        })
                    })
                })
            }

            isFileSizeSetterWorking(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        0 !== f.ThunderKernel.isFileSizeSetterWorking(t => {
                            e(t)
                        }) && e(!1)
                    })
                })
            }

            launchFileAssistant(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        let t = f.ThunderKernel.launchFileAssistant(t => {
                            e(t)
                        });
                        0 !== t && e(t)
                    })
                })
            }

            getTaskProfileLog(e, t, ...i) {
                let n = -1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    if (a) {
                        let e = i[1], t = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.VirtualId);
                        n = f.ThunderKernel.getTaskProfileLog(t, e, (e, t) => {
                            null !== i[2] && void 0 !== i[2] && (0, i[2])()
                        })
                    }
                } while (0);
                return n
            }

            getSubNetUploader(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = yield new Promise(e => {
                            0 !== f.ThunderKernel.getSubNetUploader((t, i) => n(this, void 0, void 0, function* () {
                                _.information("getSubNetUploader result", t, i), 0 === t && e(i)
                            })) && e(null)
                        })
                    } while (0);
                    return t
                })
            }

            getPrivateSpaceInfo(e, t, ...i) {
                let n = !0, a = x.getCurrentPrivateCategory();
                if (a) {
                    let e = a.getPassword();
                    e && "" !== e && (n = !0)
                }
                return {privateOpen: n, currentCategoryId: m.default.getCurrentCategoryId()}
            }

            isSingleBtTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = i[0], t = D.getTaskFromTaskId(e);
                    return yield w.SingleBtTaskNS.isSingleBtTask(t)
                })
            }

            isSupportPlay(e, t, ...i) {
                let n = !1;
                do {
                    if (!i[0]) break;
                    let e = i[0], t = D.getTaskFromTaskId(e);
                    t && (n = t.isSupportPlay())
                } while (0);
                return n
            }

            isSupportInstall(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = {support: !1};
                    do {
                        if (!i[0]) break;
                        let t = i[0], n = D.getTaskFromTaskId(t);
                        if (!n) break;
                        if (n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Group) {
                            let i = n.getExtraObject(),
                                a = i.getUserData(p.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                            if (a && "0" !== a) {
                                let n = S.TaskCtrlOperatorNS.getSavePathByFileName(t, a);
                                if (yield g.FileSystemAWNS.existsAW(n)) {
                                    e = {
                                        support: !0,
                                        savePath: n,
                                        runParams: i.getUserData(p.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams")
                                    };
                                    break
                                }
                            }
                        }
                    } while (0);
                    return e
                })
            }

            importTorrent(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = i[0], t = yield o.client.callServerFunction("ShowOpenDialog", {
                        properties: ["openFile"],
                        filters: [{name: "BT种子文件（*.torrent）", extensions: ["torrent"]}]
                    });
                    if (e = e || {}, void 0 !== t) {
                        let i = t[0], n = yield T.TaskUtilitiesAWNS.parserBtFileInfoAW(i);
                        if (null === n) k.ThunderNewTask.createBtTaskWindow({
                            type: "file",
                            seedFile: i
                        }, Object.assign({}, e)); else {
                            let t = JSON.stringify(n);
                            k.ThunderNewTask.createBtTaskWindow({
                                data: t,
                                type: "file",
                                seedFile: i
                            }, Object.assign({}, e))
                        }
                    }
                    return t
                })
            }

            getDownloadProgressPercent(e, t, ...i) {
                return C.DownloadProgressNS.getDownloadProgressPercent()
            }

            getDownloadProgress(e, t, ...i) {
                return C.DownloadProgressNS.getDownloadProgress()
            }

            getDownloadDetails(e, t, ...i) {
                return C.DownloadProgressNS.getDownloadDetails()
            }

            createTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 2 || !r.isNumber(i[0]) || !r.isObject(i[1])) {
                            _.warning("createTask failed, args invalid! (TaskType: number, newTaskInfo: INewTaskInfo) => Promise<number>", i);
                            break
                        }
                        let n = i[0], a = i[1], o = yield D.createTask(n, a);
                        if (!o) break;
                        t = o.getId()
                    } while (0);
                    return t
                })
            }

            createBatchTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            _.warning("createBatchTask failed, args invalid! (newTaskInfos: INewTaskInfo[], groupTaskId?: number) => Promise<number[]>", i);
                            break
                        }
                        let n = i[0], a = null;
                        if (i.length >= 2 && r.isNumber(i[1])) {
                            let e = i[1];
                            a = D.getTaskFromTaskId(e)
                        }
                        let o = yield D.createBatchTask(n, a);
                        if (!o) break;
                        t = [], o.forEach(e => {
                            t.push(e.getId())
                        })
                    } while (0);
                    return t
                })
            }

            startTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isNumber(i[0])) {
                            _.warning("startTask failed, args invalid! (taskId: number) => void", i);
                            break
                        }
                        let n = i[0];
                        t = yield D.startTask(n)
                    } while (0);
                    return t
                })
            }

            startWaitingTask(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        _.warning("startWaitingTask failed, args invalid! (taskId: number) => boolean", i);
                        break
                    }
                    let t = i[0];
                    n = D.startWaitingTask(t)
                } while (0);
                return n
            }

            stopTask(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        _.warning("stopTask failed, args invalid! (taskId: number, stopReason?: TaskStopReason) => void", i);
                        break
                    }
                    let t = i[0], n = l.DownloadKernel.TaskStopReason.Unknown;
                    i.length >= 2 && r.isNumber(i[1]) && (n = i[1]), D.stopTask(t, n)
                } while (0)
            }

            deleteTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isNumber(i[0]) || !r.isBoolean(i[1])) {
                            _.warning("deleteTask failed, args invalid! (taskId: number, deleteFile: boolean) => Promise<boolean>", i);
                            break
                        }
                        let n = i[0], a = i[1];
                        t = yield D.deleteTask(n, a)
                    } while (0);
                    return t
                })
            }

            removeToRecycle(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isNumber(i[0])) {
                            _.warning("removeToRecycle failed, args invalid! (taskId: number) => Promise<void>", i);
                            break
                        }
                        let t = i[0];
                        yield D.removeToRecycle(t)
                    } while (0)
                })
            }

            recoverFromRecycle(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        _.warning("recoverFromRecycle failed, args invalid! (taskId: number) => Promise<boolean>", i);
                        break
                    }
                    let t = i[0];
                    n = D.recoverFromRecycle(t)
                } while (0);
                return n
            }

            batchStartTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            _.warning("batchStartTask failed, args invalid! (taskId: number) => void", i);
                            break
                        }
                        t = !0;
                        let n = i[0];
                        if (n) for (let e of n) t = (yield D.startTask(e)) && t
                    } while (0);
                    return t
                })
            }

            batchStartWaitingTask(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        _.warning("batchStartWaitingTask failed, args invalid! (taskIds: number[]) => boolean", i);
                        break
                    }
                    let t = i[0];
                    n = D.startWaitingTasks(t)
                } while (0);
                return n
            }

            batchStopTask(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        _.warning("stopTask failed, args invalid! (taskIds: number[], stopReason?: TaskStopReason) => void", i);
                        break
                    }
                    let t = i[0], n = l.DownloadKernel.TaskStopReason.Unknown;
                    i.length >= 2 && r.isNumber(i[1]) && (n = i[1]), D.batchStopTask(t, n)
                } while (0)
            }

            batchDeleteTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0]) || !r.isBoolean(i[1])) {
                            _.warning("batchDeleteTask failed, args invalid! (taskIds: number[], deleteFile: boolean) => Promise<boolean>", i);
                            break
                        }
                        let n = i[0], a = i[1];
                        t = yield D.deleteBatchTask(n, a)
                    } while (0);
                    return t
                })
            }

            batchRemoveToRecycle(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            _.warning("batchRemoveToRecycle failed, args invalid! (taskIds: number[]) => Promise<void>", i);
                            break
                        }
                        let t = i[0];
                        yield D.batchRemoveToRecycle(t)
                    } while (0)
                })
            }

            batchRecoverFromRecycle(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        _.warning("batchRecoverFromRecycle failed, args invalid! (taskIds: number[]) => boolean", i);
                        break
                    }
                    let t = i[0];
                    D.batchRecoverFromRecycle(t), n = !0
                } while (0);
                return n
            }

            batchFindTaskAsync(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = [];
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            _.warning("batchFindTaskAsync failed, args invalid! (keyInfos: IKeyInfo[]) => Promise<ITaskBase[]>", i);
                            break
                        }
                        let n = i[0], a = yield D.batchFindTaskAsync(n);
                        if (!a) break;
                        a.forEach(e => {
                            t.push(e.getTaskBaseInfo())
                        })
                    } while (0);
                    return t
                })
            }

            isCategoryLoaded(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        yield x.init()
                    } while (0);
                    return !0
                })
            }

            getCategoryFromUserId(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isString(i[0]) || !r.isString(i[1])) {
                        _.warning("getCategoryFromUserId failed, args invalid! (categoryName: string, userId: string) => ICategoryData[]", i);
                        break
                    }
                    let t = i[0], a = i[1], o = void 0;
                    i.length >= 3 && (o = i[2]);
                    let s = x.getCategoryFromUserId(t, a, o);
                    s && (n = s.getCategoryData())
                } while (0);
                return n
            }

            getCategoryById(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        _.warning("getCategoryById failed, args invalid! (categoryId: number) => ICategoryData", i);
                        break
                    }
                    let t = i[0], a = x.getCategoryFromId(t);
                    a && (n = a.getCategoryData())
                } while (0);
                return n
            }

            getCategoryByName(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isString(i[0])) {
                        _.warning("getCategoryByName failed, args invalid! (categoryName: string) => ICategoryData[]", i);
                        break
                    }
                    let t = i[0], a = x.getCategoryByName(t);
                    a && a.size > 0 && a.forEach(e => {
                        n.push(e.getCategoryData())
                    })
                } while (0);
                return n
            }

            getCategoryTaskCount(e, t, ...i) {
                let n = 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        _.warning("getCategoryTaskCount failed, args invalid! (categoryId: number, categoryViewId: CategoryViewID) => number", i);
                        break
                    }
                    let t = i[0], a = i[1], o = x.getCategoryFromId(t);
                    if (!o) break;
                    let s = o.getCategoryViewFromId(a);
                    if (!s) break;
                    n = s.getTaskCount()
                } while (0);
                return n
            }

            getCategoryTaskList(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        _.warning("getCategoryTaskList failed, args invalid! (categoryId: number, categoryViewId: CategoryViewID) => Promise<number[]>", i);
                        break
                    }
                    let t = i[0], a = i[1], o = x.getCategoryFromId(t);
                    if (!o) break;
                    let s = o.getCategoryViewFromId(a);
                    if (!s) break;
                    let l = s.getTasks();
                    if (!l) break;
                    l.forEach(e => {
                        n.push(e.getId())
                    })
                } while (0);
                return n
            }

            addServer(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 3 || !r.isNumber(i[0]) || !r.isNumber(i[1]) || !r.isObject(i[2])) {
                        _.warning("addServer failed, args invalid! (taskId: number, fileIndex: number, serverResourceInfo: IXLServerResourceInfo) => boolean", i);
                        break
                    }
                    let t = i[0], a = i[1], o = i[2], s = D.getTaskFromTaskId(t);
                    if (!s) break;
                    s.addServer(a, o), n = !0
                } while (0);
                return n
            }

            discardServer(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 3 || !r.isNumber(i[0]) || !r.isNumber(i[1]) || !r.isString(i[2])) {
                        _.warning("discardServer failed, args invalid! (taskId: number, fileIndex: number, url: string) => boolean", i);
                        break
                    }
                    let t = i[0], a = i[1], o = i[2], s = D.getTaskFromTaskId(t);
                    if (!s) break;
                    s.discardServer(a, o), n = !0
                } while (0);
                return n
            }

            getUserData(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        _.warning("getUserData failed, args invalid! (taskId: number, guid: string, key?: string) => string | number | {[key: string]: any}", i);
                        break
                    }
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    if (!a) break;
                    let o = i[1], s = i[2], l = a.getExtraObject().getUserData(o, s);
                    if (r.isNullOrUndefined(l)) break;
                    if (r.isNumber(l) || r.isString(l)) n = l; else if (r.isArray(l)) {
                        let e = l, t = [];
                        for (let i = 0; i < e.length; ++i) t.push(e[i].toJs());
                        n = t
                    } else if (r.isObject(l)) {
                        let e = {};
                        l.forEach(function (t, i) {
                            e[i] = t.toJs()
                        }), n = e
                    }
                } while (0);
                return n
            }

            setUserData(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 3 || !r.isNumber(i[0]) || !r.isString(i[1]) || !r.isString(i[2]) || !r.isString(i[3]) && !r.isNumber(i[3]) && !r.isObject(i[3])) {
                        _.warning("setUserData failed, args invalid! (taskId: number, guid: string, key: string, value: string | number | {[key: string]: any}) => boolean", i);
                        break
                    }
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    if (!a) break;
                    let o = i[1], s = i[2], l = i[3];
                    n = a.getExtraObject().setUserData(o, s, l)
                } while (0);
                return n
            }

            setTaskUrl(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        _.warning("setTaskUrl failed, args invalid! (taskId: number, url: string) => boolean", i);
                        break
                    }
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    if (!a) break;
                    let o = i[1];
                    n = a.setTaskUrl(o)
                } while (0);
                return n
            }

            getTaskAttribute(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isNumber(i[1])) {
                        _.warning("getTaskAttribute failed, args invalid! (taskId: number, attr: DownloadKernel.TaskAttribute) => any", i);
                        break
                    }
                    let t = i[0], a = D.getTaskFromTaskId(t);
                    if (!a) break;
                    let o = i[1];
                    n = a.getTaskAttribute(o)
                } while (0);
                return n
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let a = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId), o = i.getTaskBaseInfo();
                        n[a] = o
                    }
                    a.server.fireClientEvent("OnTaskDetailChanged", JSON.stringify(n), i)
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskStatus();
                        i[n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId)] = a
                    }
                    a.server.fireClientEvent("OnTaskStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onTaskDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.DcdnStatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId),
                            o = n.getTaskChannelInfo().dcdnStatus;
                        i[a] = o
                    }
                    a.server.fireClientEvent("OnTaskDcdnStatusChanged", JSON.stringify(i))
                } 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], i = D.getTaskFromTaskId(t);
                    if (!i) break;
                    let n = e[2], o = i.getTaskBaseInfo();
                    a.server.fireClientEvent("OnBtSubFileDetailChanged", t, JSON.stringify(n), JSON.stringify(o))
                } while (0)
            }

            onBtSubFileLoaded(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileLoaded) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = D.getTaskFromTaskId(t);
                    if (!n) break;
                    let o = n.getTaskBaseInfo();
                    a.server.fireClientEvent("OnBtSubFileLoaded", t, JSON.stringify(i), JSON.stringify(o))
                } while (0)
            }

            onBtSubFileForbidden(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileForbidden) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2];
                    a.server.fireClientEvent("OnBtSubFileForbidden", t, i)
                } while (0)
            }

            onBtSubFileDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.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], i = e[2], n = e[3], o = e[4];
                    a.server.fireClientEvent("OnBtSubFileDcdnStatusChanged", t, i, n, o)
                } while (0)
            }

            onTaskInserted(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], o = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    a.server.fireClientEvent("OnTaskInserted", t, i, r)
                } while (0)
            }

            onTaskRemoved(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], o = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    a.server.fireClientEvent("OnTaskRemoved", t, i, r)
                } while (0)
            }

            onTaskCategoryMovedEnd(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                    if (!e[1]) break;
                    let t = e[1], i = [];
                    for (let e of t) if (e) {
                        let t = e.getTaskBaseInfo();
                        i.push(t)
                    }
                    let n = JSON.stringify(i);
                    a.server.fireClientEvent("OnTaskCategoryMovedEnd", n)
                } while (0)
            }

            onGlobalDownloadSpeedChanged(...e) {
                let t = d.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1),
                    i = d.DownloadKernelManager.getTotalTaskVipSpeed(!1, !1);
                a.server.fireClientEvent("OnGlobalDownloadSpeedChanged", t, i)
            }

            onDownloadItemActive(e, t, i, n, o, r) {
                if (n && t) {
                    let s = n.__vue__;
                    s ? s.$nextTick(() => {
                        _.information("active fire", t, i), a.server.fireClientEvent("OnDownloadItemActive", e, t, i, o, r)
                    }) : a.server.fireClientEvent("OnDownloadItemActive", e, t, i, o, r)
                } else a.server.fireClientEvent("OnDownloadItemActive", e, t, i, o, r)
            }

            onDownloadItemChosen(e, t, i, n) {
                a.server.fireClientEvent("OnDownloadItemChosen", e, i, t, n)
            }

            insertPanTaskReference(e, t, ...i) {
                !i || i.length < 4 || b.ThunderPanTaskNS.insertTask(i[0], i[1], i[2], i[3])
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.DkPluginFunctionNS || (t.DkPluginFunctionNS = {}))
}, function (e, t, i) {
    "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.contextMenuPlayFile = "context_menu_play_file", e.contextMenuDownloadFile = "context_menu_download_file", e.contextMenuDownloadOpenAs = "context_menu_download_open_as", 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.contextMenuDownloadShare = "context_menu_download_share", 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", e.contextMenuShouleiFileTransfer = "context_menu_shoulei_file_transfer", e.contextMenuPanUpload = "context_menu_pan_upload", e.contextMenuPanAddLink = "context_menu_pan_add_link", e.contextMenuPanAddBt = "context_menu_pan_add_Bt", e.contextMenuPanCreateFolder = "context_menu_pan_create_folder"
    }(t.ContextMenuIdsNS || (t.ContextMenuIdsNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(100), r = i(0).default.getLogger("WebPageTip");
    const s = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "", this.url = "http://static1.ssp.xunlei.com/iframe/fx.html", this.width = 300, this.height = 280, this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.x = 0, this.y = 0, this.callback = null, this.embeddedBrowserObj = new o.EmbeddedBrowser
        }

        createWebPageTipDlg(e, t, i, o, s) {
            return n(this, void 0, void 0, function* () {
                r.information("createWebPageTipDlg url:", e, t);
                {
                    void 0 !== e && null !== e && "" !== e && (this.url = e), this.title = o, this.width = t.width || this.width, this.height = t.height || this.height, this.x = t.x || this.x, this.y = t.y || this.y, this.callback = s;
                    let r = (e, t) => {
                        "click_close" === t ? this.callback && s("click_close") : this.callback && s(t)
                    };
                    (yield a.asyncRemoteCall.getIpcMain()).on("ad-webpagetip", r);
                    let l = !1;
                    this.embeddedBrowserObj.setBrowserEventHandler((e, ...t) => {
                        if ("OnBeforeNavigate" === e) this.callback && this.callback("webpage_loading", ...t); else if ("OnLoadEnd" === e) l || this.callback && this.callback("webpage_loaded", ...t); else if ("OnLoadError" === e) l = !0, this.callback && this.callback("webpage_load_failed", ...t); else if ("OnNewBrowserPopup" === e) return this.callback && this.callback("click", ...t), !0;
                        return !1
                    }), this.embeddedBrowserObj.setWindowTopLevel(!0), this.embeddedBrowserObj.setToolWindow(!0), yield this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "ad-webpagetip", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, i, this.onWndShowResult.bind(this), () => n(this, void 0, void 0, function* () {
                        (yield a.asyncRemoteCall.getIpcMain()).removeListener("ad-webpagetip", r), this.callback && s("closed")
                    }))
                }
                return this.embeddedBrowserObj.getWnd()
            })
        }

        onWndShowResult() {
            return n(this, void 0, void 0, function* () {
                if (this.embeddedBrowserObj) {
                    let e = this.embeddedBrowserObj.getWnd();
                    e && (yield e.setBounds({x: this.x, y: this.y, width: this.width, height: this.height}))
                }
                return !0
            })
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(5), r = i(0), s = i(4), l = i(13), d = i(357), u = i(470), c = i(472), h = i(359), f = i(22),
        g = i(24), p = i(2), v = i(7), m = r.default.getLogger("SkinNaviteFunction"),
        y = v.default(p.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, d.default.on("changeSkin", this.onChangeSkin), u.default.on("changeSkin", this.onChangeSpeedCurveSkin), c.default.on("changeSkin", this.onChangeSuspensionSkin)
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetSkinInfo: this.getSkinInfo,
                        SetSkinInfo: this.setSkinInfo,
                        GetSpeedCurveSkinInfo: this.getSpeedCurveSkinInfo,
                        SetSpeedCurveSkinInfo: this.setSpeedCurveSkinInfo,
                        GetAllSpeedCurveSkinInfos: this.getAllSpeedCurveSkinInfos,
                        ClickSpeedCurveIcon: this.clickSpeedCurveIcon,
                        ShowIndividuation: this.showIndividuation,
                        GetSuspensionSkinInfo: this.getSuspensionSkinInfo,
                        SetSuspensionSkinInfo: this.setSuspensionSkinInfo,
                        GetSkinInfoDetail: this.getSkinInfoDetail,
                        SetShakeInfo: this.setShakeInfo,
                        GetShakeInfo: this.getShakeInfo
                    };
                    a.server.registerFunctions(e)
                }
            }

            getSkinInfo(e, t, ...i) {
                let n = null;
                do {
                    if (s.isNullOrUndefined(e)) break;
                    n = d.default.getSkinInfo(), m.information(n)
                } while (0);
                return n
            }

            setSkinInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        if (s.isNullOrUndefined(i) || s.isNullOrUndefined(i[0])) break;
                        try {
                            yield d.default.setSkinInfo(i[0], i[1], i[2])
                        } catch (e) {
                            m.warning(e);
                            break
                        }
                    } while (0)
                })
            }

            onChangeSkin(e, t) {
                do {
                    if (l.ThunderUtil.isUndef(e)) break;
                    m.information(e), a.server.fireClientEvent("OnChangeSkin", e, t)
                } while (0)
            }

            getSpeedCurveSkinInfo(e, t, ...i) {
                let n = null;
                do {
                    if (s.isNullOrUndefined(e)) break;
                    n = u.default.getSkinInfo(), m.information(n)
                } while (0);
                return n
            }

            setSpeedCurveSkinInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        if (s.isNullOrUndefined(i) || s.isNullOrUndefined(i[0])) break;
                        try {
                            yield u.default.setSkinInfo(i[0], i[1], i[2])
                        } catch (e) {
                            m.warning(e);
                            break
                        }
                    } while (0)
                })
            }

            getAllSpeedCurveSkinInfos(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = [];
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        t = yield h.default.getSkins()
                    } while (0);
                    return t
                })
            }

            clickSpeedCurveIcon(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        try {
                            yield o.client.callServerFunction("ShowIndividuation", {
                                activeKey: "skin",
                                skinActiveKey: "speedcurve"
                            })
                        } catch (e) {
                            break
                        }
                    } while (0)
                })
            }

            onChangeSpeedCurveSkin(e, t, i) {
                do {
                    if (l.ThunderUtil.isUndef(e)) break;
                    m.information("onChangeSpeedCurveSkin", e), a.server.fireClientEvent("OnChangeSpeedCurveSkin", e, t, i)
                } while (0)
            }

            onChangeSuspensionSkin(e, t, i) {
                do {
                    if (l.ThunderUtil.isUndef(e)) break;
                    m.information("onChangeSuspensionSkin", e), a.server.fireClientEvent("OnChangeSuspensionSkin", e, t, i)
                } while (0)
            }

            showIndividuation(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        if (s.isNullOrUndefined(i)) break;
                        try {
                            t = yield f.MessageBox.customIndividuation("Individuation", Object.assign({
                                singleton: !0,
                                version: y.getFileVersion(p.join(__rootDir, "../../Thunder.exe")),
                                dynamicSkinVersion: g.default.getConfigInfo("dynamicSkinVersion")
                            }, i[0] || {}), {
                                modal: !1,
                                webPreferences: {spellcheck: !1, nodeIntegration: !0, webSecurity: !1}
                            })
                        } catch (e) {
                            break
                        }
                    } while (0);
                    return t
                })
            }

            getSuspensionSkinInfo(e, t, ...i) {
                return c.default.getSkinInfo()
            }

            setSuspensionSkinInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!i || !i[0]) break;
                        yield c.default.setSkinInfo(i[0], i[1], i[2])
                    } while (0)
                })
            }

            getSkinInfoDetail(e, t, ...i) {
                return {skinInfo: d.default.getSkinInfo(), temp: d.default.getIsTemp()}
            }

            setShakeInfo(e, t, ...i) {
                a.server.fireClientEvent("OnChangeShake", i[0], i[1])
            }

            getShakeInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield d.default.getShakeInfo(i[0])
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.SkinPluginFunctionNS || (t.SkinPluginFunctionNS = {}))
}, function (e, t, i) {
    "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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(474), r = i(475);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetToolbarVipButtonEnable: this.getToolbarVipButtonEnable,
                        GetVipRenewButtonEnable: this.getVipRenewButtonEnable,
                        GetVipLabelConfig: this.getVipLabelConfig
                    };
                    a.server.registerFunctions(e)
                }
            }

            getToolbarVipButtonEnable(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return r.VipPluginSwitchConfigNS.getToolbarVipButtonEnable()
                })
            }

            getVipRenewButtonEnable(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return r.VipPluginSwitchConfigNS.getVipRenewButtonEnable()
                })
            }

            getVipLabelConfig(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = i[0];
                    return yield o.VipLableConfigNS.getConfig(e)
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.VipPluginFunctionNS || (t.VipPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(13), r = i(146), s = i(0).default.getLogger("NotificationPluginFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {ShowNotification: this.showNotification};
                    a.server.registerFunctions(e)
                }
            }

            showNotification(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (o.ThunderUtil.isUndef(i) || o.ThunderUtil.isUndef(i[0])) break;
                        try {
                            let t = JSON.parse(i[0]);
                            if (s.information("showNotification", "options", t), !t) break;
                            let n = i[1], a = null;
                            s.information("notificationCallBackId", n), o.ThunderUtil.isDef(n) && (a = ((...e) => {
                                n(...e)
                            })), r.NotificationHelper.notify(t, a), e = !0
                        } catch (e) {
                            s.warning("showNotification error", e);
                            break
                        }
                    } while (0);
                    return e
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.NotificationPluginFunctionNS || (t.NotificationPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(16), a = i(109).ShouleiListSyncNS.getMananger();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, a.attachEvent("OnConnectStateChanged", e => {
                    n.server.fireClientEvent("OnShouleiConnectStateChanged", e)
                })
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {GetShouleiConnectState: this.getShouleiConnectState};
                    n.server.registerFunctions(e)
                }
            }

            getShouleiConnectState(e, t, ...i) {
                let n = "offline";
                do {
                    if (!e) break;
                    n = a.getState()
                } while (0);
                return n
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ShouleiConnectPluginFunctionNS || (t.ShouleiConnectPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(5), r = i(53), s = i(350), l = i(3), d = i(30), u = i(352), c = i(12), h = i(4), f = i(477),
        g = c.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetCommonlySites: this.getCommonlySites,
                        DeleteCommonlySites: this.deleteCommonlySites,
                        ClearCommonlySites: this.clearCommonlySites,
                        GetLatestSearchKeywords: this.getLatestSearchKeywords,
                        AddSearchKeyword: this.addSearchKeyword,
                        DeleteSearchKeyword: this.deleteSearchKeyword,
                        ClearSearchKeyword: this.clearSearchKeyword,
                        SearchTask: this.searchTask,
                        SearchHistory: this.searchHistory,
                        SearchPanTask: this.searchPanTask,
                        IpcRedirectCurrentDirectoryById: this.ipcRedirectCurrentDirectoryById,
                        Recommend: this.recommend,
                        SearchMovie: this.searchMovie
                    };
                    a.server.registerFunctions(e)
                }
            }

            recommend() {
                return n(this, void 0, void 0, function* () {
                    return yield f.MovieRecommendNS.recommend()
                })
            }

            searchMovie(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    return i ? yield f.MovieRecommendNS.search(i) : null
                })
            }

            getCommonlySites(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield s.CommonSitesMgrNS.getInstance().getMostCommonly()
                })
            }

            deleteCommonlySites(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!e || !i || h.isNullOrUndefined(i[0])) break;
                        s.CommonSitesMgrNS.getInstance().delete(i[0]).catch()
                    } while (0)
                })
            }

            clearCommonlySites(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    yield s.CommonSitesMgrNS.getInstance().clear()
                })
            }

            getLatestSearchKeywords(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return s.CommonSitesMgrNS.getInstance().getLatestSearchKeywords()
                })
            }

            addSearchKeyword(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    i && i[0] && s.CommonSitesMgrNS.getInstance().addSearchKeyword(i[0])
                })
            }

            deleteSearchKeyword(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    i && !h.isNullOrUndefined(i[0]) && s.CommonSitesMgrNS.getInstance().deleteSearchKeyword(i[0])
                })
            }

            clearSearchKeyword(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    s.CommonSitesMgrNS.getInstance().clearSearchKeyword()
                })
            }

            searchTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = l.DownloadKernel.SearchKeyType.NameInclude, t = [];
                    if (!i || !i[0]) return t;
                    let n = i[0].split(" ");
                    for (let i of n) if (yield new Promise(n => {
                        d.ThunderKernel.searchTask(e, i, -1, "", e => {
                            t = 0 === t.length ? e : t.filter(t => e.includes(t)), n()
                        })
                    }), 0 === t.length) return t;
                    let a, o = [];
                    for (let e of t) {
                        let t = g.getTaskFromTaskId(e);
                        t && (a = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryViewId)) !== l.DownloadKernel.CategroyViewID.Recycle && o.push(e)
                    }
                    return o
                })
            }

            searchHistory(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return i && i[0] ? u.historyManager.search(i[0]) : []
                })
            }

            searchPanTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return i && i[0] ? (yield a.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcSearchFileByName", {keyword: i[0]}))[0] : []
                })
            }

            ipcRedirectCurrentDirectoryById(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    if (!i || !i[0]) return [];
                    a.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRedirectCurrentDirectoryById", {id: i[0]}).catch(), o.client.callServerFunction("SelectNav", r.NavViewID.Cloud).catch()
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.SearchPluginFunctionNS || (t.SearchPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(16), a = i(19), o = i(0).default.getLogger("plugin-function"), r = ["XmpPlugin"];

    class s extends a.EventEmitter {
        constructor() {
            super(), this.isRegister = !1, this.isRegister = !1
        }

        registerPluginFunction() {
            if (!this.isRegister) {
                this.isRegister = !0;
                let e = {LoadNoneWebviewPlugin: this.loadNoneWebviewPlugin.bind(this)};
                n.server.registerFunctions(e)
            }
        }

        loadNoneWebviewPlugin(e, t, ...i) {
            if (!i || i.length < 2) return;
            let n = i[0];
            if (-1 === r.indexOf(n)) return void o.warning("not support current bid, bid name ", n);
            let a, s = i[1];
            try {
                a = require(s.src)
            } catch (e) {
                o.warning(e)
            }
            o.information("loadPlugin result", a)
        }
    }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(36), r = i(4), s = i(27), l = i(25), d = i(344), u = i(23), c = i(120), h = i(87), f = i(99),
        g = i(355), p = a.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: "FireLoginEvent", nativeFunc: this.fireLoginEvent}, {
                        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
                    }];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            fireEvent(e, t, i, n) {
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                let a = n[0];
                p.information("fireEvent eventName:", a), n.splice(0, 1), s.NativeCallHostModule.nativeCallHost.fireNativeEvent(a, ...n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getUserID(e, t, i, n) {
                p.information("getUserID:", n), u.LoginHelperNS.loginHelper.getUserInfo("userid", function (n) {
                    p.information("getUserID:userid = ", n), null !== n && void 0 !== n && "" !== n || (n = "0"), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            getSessionID(e, t, i, n) {
                p.information("getSessionID:", n), u.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (n) {
                    p.information("getSessionID:sessionid = ", n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            getLoginOption(e, t, i, n) {
                let a = c.LoginOptionNS.loginOption.getOption(), o = void 0;
                a && (o = JSON.stringify(a)), p.information("getLoginOption:option = ", o), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, o)
            }

            showLoginDlg(e, t, i, n) {
                p.information(n);
                let a = "other", o = !0, s = null;
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) || (a = n[0]), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[1]) || (o = n[1]), !r.isNullOrUndefined(n) && !r.isNullOrUndefined(n[2])) {
                    let e = n[2];
                    try {
                        s = JSON.parse(e)
                    } catch (e) {
                        p.warning(e)
                    }
                }
                u.LoginHelperNS.loginHelper.showLoginDlg(a, o, s), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getLoginInfo(e, t, i, n) {
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) u.LoginHelperNS.loginHelper.getUserInfo(function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }); else {
                    let a = n[0];
                    u.LoginHelperNS.loginHelper.getUserInfo(a, function (n) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    })
                }
            }

            getUserInfo(e, t, i, n) {
                p.information(n), (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                let a = 0;
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) a = 0; else {
                    let e = n[0];
                    a = null === e || void 0 === e || "" === e ? 0 : Number(e)
                }
                u.LoginHelperNS.loginHelper.getUserInfoEx(a, function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            getAllUserInfo(e, t, i, n) {
                if (p.information(n), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) u.LoginHelperNS.loginHelper.getAllUserInfo(function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }); else {
                    let a = n[0];
                    u.LoginHelperNS.loginHelper.getAllUserInfo(a, function (n) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    })
                }
            }

            isLogined(e, t, i, n) {
                p.information(n), (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError), u.LoginHelperNS.loginHelper.isLogined(function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            logout(e, t, i, n) {
                p.information(n), u.LoginHelperNS.loginHelper.logout(), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            saveLoginData(e, t, i, n) {
                do {
                    if (p.information("saveLoginData", e, t, i), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1]) || r.isNullOrUndefined(n[2])) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = n[2];
                    u.LoginHelperNS.loginSDKHelper.saveData(a, o, s).then(n => {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    }).catch(() => {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.CallFailed)
                    })
                } while (0)
            }

            loadLoginData(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    let n = null;
                    do {
                        if (p.information("loadLoginData", e, t, i), r.isNullOrUndefined(a) || r.isNullOrUndefined(a[0]) || r.isNullOrUndefined(a[1])) {
                            e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0], s = a[1];
                        n = "memory" === o && "initconfig" === s ? yield u.LoginHelperNS.loginSDKHelper.getInitData() : u.LoginHelperNS.loginSDKHelper.loadData(o, s), p.information("loadLoginData:data = ", n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            fireLoginEvent(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(a) || !Array.isArray(a)) {
                            e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if ("string" != typeof a[0]) {
                            e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], s = yield u.LoginHelperNS.loginSDKHelper.fireEvent(n, o);
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, JSON.stringify(s))
                    } while (0)
                })
            }

            createLoginWnd(e, t, i, n) {
                do {
                    if (p.information("createLoginWnd", e, t, i), r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i) || r.isNullOrUndefined(n)) {
                        p.information("createLoginWnd 失败");
                        break
                    }
                    if (r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1])) {
                        p.information("createLoginWnd 失败 参数错误"), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = "", d = null, u = null;
                    r.isNullOrUndefined(n[2]) || (s = n[2]), r.isNullOrUndefined(n[3]) || (d = n[3]), r.isNullOrUndefined(n[4]) || (u = n[4]), f.popMutual.setReady(h.PopView.LOGIN, a, o, s, d, u), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
                } while (0)
            }

            closeLoginWnd(e, t, i, n) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i) || r.isNullOrUndefined(n)) break;
                    if (r.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    u.LoginHelperNS.loginUIHelper.closeLoginWnd(a)
                } while (0)
            }

            updateLoginWnd(e, t, i, n) {
                p.information("updateLoginWnd", e, t, i);
                let a = !1, o = null, s = null, d = null, c = null;
                r.isNullOrUndefined(n[0]) || (a = n[0]), r.isNullOrUndefined(n[1]) || (o = n[1]), r.isNullOrUndefined(n[2]) || (s = n[2]), r.isNullOrUndefined(n[3]) || (d = n[3]), r.isNullOrUndefined(n[4]) || (c = n[4]), u.LoginHelperNS.loginUIHelper.updateLoginWnd(a, o, s, d, c), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getLoginDeviceID(e, t, i, n) {
                p.information("getDeviceID", e, t, i), u.LoginHelperNS.loginSDKHelper.getDeviceID().then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.CallFailed, n)
                })
            }

            retryLogIn(e, t, i, n) {
                p.information("retryLogIn"), u.LoginHelperNS.loginHelper.logIn("retryLogIn"), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            showModifierUserInfoWnd(e, t, i, n) {
                p.information("showModifierUserInfoWnd", e, t, i);
                let a = "";
                a = r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) ? "" : n[0], u.LoginHelperNS.loginUIHelper.createModifierUserInfoWnd(a), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getUserHeaderByUserID(e, t, i, n) {
                if (p.information("getUserHeaderByUserID", e, t, i), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                let a = u.LoginHelperNS.loginHelper.getUserHeader(n[0]);
                e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, a)
            }

            isAlreadySign(e, t, i, n) {
                p.information("isAlreadySign", e, t, i), d.CommonSignFunctionNs.isAlreadySign().then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            isHaveSignQuestion(e, t, i, n) {
                p.information("isHaveSignQuestion", e, t, i), d.CommonSignFunctionNs.isHaveSignQuestion().then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            sendSms(e, t, i, n) {
                p.information("sendSms", e, t, i);
                let a = "";
                null !== n && void 0 !== n && n.length > 0 && (a = n[0]), g.commonLoginHelper.sendSmsAw(a).then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            checkSms(e, t, i, n) {
                p.information("checkSms", e, t, i);
                do {
                    if (null === n || void 0 === n || n.length < 2) {
                        p.information("checkSms args存在问题 args：", n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1];
                    g.commonLoginHelper.checkSmsAw(a, o).then(n => {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.LoginNaviteFunctionNS || (t.LoginNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(31), s = i(12), l = i(15), d = i(40), u = i(36), c = i(25), h = i(27), f = i(30),
        g = i(14), p = i(41), v = i(6), m = i(51), y = i(335), k = i(47), T = i(465), w = i(361), C = i(4),
        S = a.default.getLogger("DKNativeFunction"), I = s.DownloadKernelTaskManager.getTaskManager(),
        b = l.DownloadKernelEventManager.getEventManager(),
        _ = d.DownloadKernelCategoryViewManager.getCategoryViewManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, b.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.onTaskDetailChanged(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChanged(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.DcdnStatusChanged, (...e) => {
                    this.onTaskDcdnStatusChanged(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileLoaded, (...e) => {
                    this.onBtSubFileLoaded(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileForbidden, (...e) => {
                    this.onBtSubFileForbidden(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, (...e) => {
                    this.onBtSubFileDcdnStatusChanged(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    this.onTaskInserted(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    this.onTaskRemoved(...e)
                }), b.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...e) => {
                    this.onTaskCategoryMovedEnd(...e)
                }), r.DownloadKernelManager.attachListener(g.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: "ExecSqliteEx", nativeFunc: this.execSqliteEx}, {
                        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
                    }, {
                        functionName: "DownloadBySDK",
                        nativeFunc: this.asynRequestFile
                    }, {
                        functionName: "IsFileSizeSetterWorking",
                        nativeFunc: this.isFileSizeSetterWorking
                    }, {functionName: "LaunchFileAssistant", nativeFunc: this.launchFileAssistant}];
                    u.NativeCallNS.registerNativeFunction(e)
                }
            }

            getTaskChannelInfo(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getTaskChannelInfo(), a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskAttribute(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = I.getTaskFromTaskId(a);
                    if (r) {
                        let n = r.getTaskAttribute(o), a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfo(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getTaskBaseInfo(), a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfos(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        S.warning(e)
                    }
                    if (o) {
                        let n = [];
                        for (let e = 0; e < o.length; ++e) {
                            let t = I.getTaskFromTaskId(o[e]);
                            if (t) {
                                let e = t.getTaskBaseInfo();
                                n.push(e)
                            }
                        }
                        let a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskDownloadSpeed(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getDownloadSpeed();
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskStatus(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getTaskStatus();
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            findTask(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = {keyType: n[0], keyValue: n[1], keyFilter: o.DownloadKernel.KeyFilter.All};
                    I.batchFindTaskAsync([a]).then(n => {
                        if (n && n.length > 0) {
                            let a = n[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0, a)
                        } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1, 0)
                    }).catch()
                } while (0)
            }

            isTaskExist(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    I.getTaskFromTaskId(a) ? e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0) : e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            isSupportPlay(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.isSupportPlay();
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            enableDcdnWithVipCert(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let a = -1;
                        C.isNumber(n[2]) && (a = n[2]), o.enableDcdnWithVipCert(n[1], a), e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            updateDcdnWithVipCert(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let a = -1;
                        C.isNumber(n[2]) && (a = n[2]), o.updateDcdnWithVipCert(n[1], a), e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            disableDcdnWithVipCert(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = I.getTaskFromTaskId(a);
                    if (o) {
                        let a = -1;
                        C.isNumber(n[1]) && (a = n[1]), o.disableDcdnWithVipCert(a), e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getPeerId(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    S.verbose(n), r.DownloadKernelManager.getPeerId().then(n => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            execSqlite(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    f.ThunderKernel.execSqlite(n[0], (n, a) => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n, a)
                    })
                } while (0)
            }

            execSqliteEx(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    f.ThunderKernel.execSqliteEx(n[0], (n, a) => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n, a)
                    })
                } while (0)
            }

            querySqlite(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    f.ThunderKernel.querySqlite(n[0], (n, a, o) => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n, a, o)
                    })
                } while (0)
            }

            getCategoryViewTaskList(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError), S.warning("getCategoryViewTaskList args", n);
                        break
                    }
                    let a = _.getCategoryViewFromId(n[0]);
                    if (a) {
                        let n = [], o = a.getTasks();
                        if (o) for (let e of o) {
                            let t = e[0];
                            n.push(t)
                        }
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getCategoryViewTaskListForSuspensionWnd(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = _.getCategoryViewFromId(n[0]);
                    if (a) {
                        let n = a.getTasks(), o = "", r = [];
                        if (n) {
                            for (let [, e] of n) {
                                let t = e.getTaskBaseInfo();
                                r.push(t)
                            }
                            o = JSON.stringify(r)
                        }
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, o)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            isLoadStorageTaskFinish(e, t, i) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    r.DownloadKernelManager.attachListener(g.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId), r = i.getTaskBaseInfo();
                        n[a] = r
                    }
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDetailChanged", JSON.stringify(n), i)
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskStatus();
                        i[n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId)] = a
                    }
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onTaskDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.DcdnStatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId),
                            r = n.getTaskChannelInfo().dcdnStatus;
                        i[a] = r
                    }
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDcdnStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = I.getTaskFromTaskId(t);
                    if (!i) break;
                    let n = e[2], a = i.getTaskBaseInfo();
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDetailChanged", t, JSON.stringify(n), JSON.stringify(a))
                } while (0)
            }

            onBtSubFileLoaded(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileLoaded) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = I.getTaskFromTaskId(t);
                    if (!n) break;
                    let a = n.getTaskBaseInfo();
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileLoaded", t, JSON.stringify(i), JSON.stringify(a))
                } while (0)
            }

            onBtSubFileForbidden(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileForbidden) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2];
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileForbidden", t, i)
                } while (0)
            }

            onBtSubFileDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.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], i = e[2], n = e[3], a = e[4];
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDcdnStatusChanged", t, i, n, a)
                } while (0)
            }

            onTaskInserted(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], a = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        a.push(t)
                    }
                    let r = JSON.stringify(a);
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInserted", t, i, r)
                } while (0)
            }

            onTaskRemoved(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], a = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        a.push(t)
                    }
                    let r = JSON.stringify(a);
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskRemoved", t, i, r)
                } while (0)
            }

            onTaskCategoryMovedEnd(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                    if (!e[1]) break;
                    let t = e[1], i = [];
                    for (let e of t) if (e) {
                        let t = e.getTaskBaseInfo();
                        i.push(t)
                    }
                    let n = JSON.stringify(i);
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskCategoryMovedEnd", n)
                } while (0)
            }

            onGlobalDownloadSpeedChanged(...e) {
                let t = r.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1),
                    i = r.DownloadKernelManager.getTotalTaskVipSpeed(!1, !1);
                h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnGlobalDownloadSpeedChanged", t, i)
            }

            isSupportInstall(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = I.getTaskFromTaskId(a);
                    if (!r) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (r.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskType) === o.DownloadKernel.TaskType.Group) {
                        let n = r.getExtraObject(),
                            o = n.getUserData(m.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 !== o && null !== o && "" !== o && "0" !== o) {
                            let r = p.TaskCtrlOperatorNS.getSavePathByFileName(a, o);
                            v.FileSystemAWNS.existsAW(r).then(a => {
                                if (a) {
                                    let a = n.getUserData(m.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0, r, a)
                                } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                            }).catch()
                        } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            getDownloadProgressPercent(e, t, i, n) {
                let a = y.DownloadProgressNS.getDownloadProgressPercent();
                e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
            }

            getDownloadProgress(e, t, i, n) {
                let a = y.DownloadProgressNS.getDownloadProgress();
                e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
            }

            isSingleBtTask(e, t, i, n) {
                let a = n[0], o = I.getTaskFromTaskId(a);
                k.SingleBtTaskNS.isSingleBtTask(o).then(n => {
                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            verifyProxy(e, t, i, n) {
                let a = n[0], o = n[1], r = n[2], s = n[3], l = n[4];
                0 !== f.ThunderKernel.verifyProxy(a, o, r, s, l, n => {
                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                }) && e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, w.ProxyNS.ProxyVerifyResult.ParamError)
            }

            setProxy(e, t, i, n) {
                let a = n[0], o = n[1], r = n[2], s = n[3], l = n[4], d = f.ThunderKernel.setProxy(a, o, r, s, l);
                e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, d)
            }

            setTaskExtStat(e, t, i, n) {
                let a = n[0], r = I.getTaskFromTaskId(a);
                if (r) {
                    let a = n[1], s = n[2], l = n[3], d = r.getTaskAttribute(o.DownloadKernel.TaskAttribute.VirtualId),
                        u = f.ThunderKernel.setTaskExtStat(d, a, s, l);
                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, u)
                } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
            }

            asynRequestFile(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0];
                        if ("string" == typeof o) try {
                            o = JSON.parse(a[0])
                        } catch (e) {
                            S.warning(e)
                        }
                        if (!o) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if (!o.url) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if (!o.savePath) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if (!o.fileName) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let r = a[1];
                        void 0 !== r && null !== r && (o.onTaskFinish = ((i, a) => n(this, void 0, void 0, function* () {
                            e.callNativeFunctionCallback(t, r, i, a)
                        })));
                        let s = yield T.sdkDownloader.createTaskBySDK(o);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            isFileSizeSetterWorking(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!a) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = f.ThunderKernel.isFileSizeSetterWorking(n => {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                        });
                        0 !== n && e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.CallFailed, n)
                    } while (0)
                })
            }

            launchFileAssistant(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!a) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = f.ThunderKernel.launchFileAssistant(n => {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                        });
                        0 !== n && e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.CallFailed, n)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DKNaviteFunctionNS || (t.DKNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(14), o = i(36), r = i(25), s = i(27), l = i(9), d = i(353), u = i(24), c = i(88), h = i(4),
        f = i(18), g = i(33), p = n.default.getLogger("ConfigNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                    f.ipcRenderer.send(g.ThunderChannelList.channelRMConfigValueChanged, e, t, i, n), s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigValueChanaged", e, t, i, n)
                }), l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    f.ipcRenderer.send(g.ThunderChannelList.channelRMConfigInitFinished), 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.NativeCallNS.registerNativeFunction(e)
                }
            }

            save(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    p.verbose(n), l.ConfigNS.save().then(() => {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    }).catch()
                } while (0)
            }

            getValue(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = n[2], d = l.ConfigNS.getValue(a, o, s);
                    p.information("getValue section:", a, "key:", o, "ret: ", d), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, d)
                } while (0)
            }

            setValue(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = n[2];
                    l.ConfigNS.setValue(a, o, s), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isConfigInitFinish(e, t, i) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getConfigModules(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    let a = "", o = "";
                    null !== n && void 0 !== n && (null !== n[0] && void 0 !== n[0] && "" !== n[0] && (a = n[0]), null !== n[1] && void 0 !== n[1] && "" !== n[1] && (o = n[1]));
                    let s = u.default.getConfigInfo(a, o);
                    e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            isConfigBrowserInitFinish(e, t, i) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    c.SettingConfigHelperNS.configBrowserHelper.attachListener(a.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getInstallBrowserInfo(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    if (null === n || void 0 === n || n.length <= 0 || void 0 === n[0] || null === n[0] || "" === n[0]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = c.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName(a);
                    e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            addConfigSettingItemData(e, t, i, n) {
                {
                    let a = null, o = null;
                    if (n[0] && n[1]) try {
                        a = JSON.parse(n[0]), o = JSON.parse(n[1])
                    } catch (e) {
                    }
                    if (a && o) {
                        let n = d.SettingInit.addSettingItemData(a, o);
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError)
                }
            }

            removeConfigSettingItemData(e, t, i, n) {
                {
                    let a = null, o = null;
                    if (n[0] && n[1]) try {
                        a = JSON.parse(n[0]), o = JSON.parse(n[1])
                    } catch (e) {
                    }
                    if (a && o) {
                        let n = d.SettingInit.removeSettingItemData(a, o);
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError)
                }
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ConfigNaviteFunctionNS || (t.ConfigNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(36), o = i(25), r = i(27), s = i(72), l = i(4),
        d = n.default.getLogger("ConfigRemoteGlobalNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, s.default.attachListener("OnRemoteGlobalConfigLoaded", e => {
                    d.information("OnRemoteGlobalConfigLoaded ret:", e), r.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnRemoteGlobalConfigLoaded", e)
                }), s.default.attachListener("OnRemoteGlobalConfigUpdated", e => {
                    d.information("OnRemoteGlobalConfigUpdated ret:", e), r.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnRemoteGlobalConfigUpdated", e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetRemoteGlobalConfigValue",
                        nativeFunc: this.getRemoteGlobalConfigValue
                    }, {
                        functionName: "IsRemoteGlobalConfigInitFinish",
                        nativeFunc: this.isRemoteGlobalConfigInitFinish
                    }];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            getRemoteGlobalConfigValue(e, t, i, n) {
                do {
                    if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = void 0;
                    n.length >= 2 && (r = n[1]);
                    let u = void 0;
                    if (n.length >= 3 && (u = n[2], l.isString(u))) try {
                        u = JSON.parse(u)
                    } catch (e) {
                        d.warning(e), u = n[2]
                    }
                    let c = void 0, h = s.default.getConfigValue(a, r, u);
                    if (!l.isNullOrUndefined(h)) try {
                        c = JSON.stringify(h)
                    } catch (e) {
                        d.warning(e), c = h
                    }
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, c)
                } while (0)
            }

            isRemoteGlobalConfigInitFinish(e, t, i) {
                do {
                    if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, s.default.isInited())
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ConfigRemoteGlobalNaviteFunctionNS || (t.ConfigRemoteGlobalNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(36), a = i(4), o = i(141), r = i(348), s = i(25), l = i(349);
    !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: "CreateDownloadAndPlayTask",
                        nativeFunc: this.createDownloadAndPlayTask
                    }, {
                        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
                    }];
                    n.NativeCallNS.registerNativeFunction(e)
                }
            }

            installXmp(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.installXmp().then(() => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                }).catch()
            }

            openXmp(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    let r = "";
                    a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0]) || (r = n[0]), o.default.openXmp(r).then(n => {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            createDownloadAndPlayTask(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    l.DownloadAndPlayUnionNS.createDowndAndPlayTask(n[0], n[1], n[2], !0).then(n => {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            getXmpCoreVersion(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.getXmpCoreVersion().then(n => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            getXmpBuildNum(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.getXmpBuildNum().then(n => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            getXmpPath(e, t, i, n) {
                if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) return;
                let o = r.DownloadAndPlayNS.getXmpPath();
                e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, o)
            }

            getXmpReg(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    if (a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = n[0];
                    if (a.isNullOrUndefined(o) || "" === o) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let l = r.DownloadAndPlayNS.getXmpReg(o);
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            getXmpUserDataPath(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.getXmpUserDataPath().then(n => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                }).catch()
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DownloadAndPlayNaviteFunctionNS || (t.DownloadAndPlayNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(36), r = i(25), s = i(13), l = i(357), d = i(470), u = i(472), c = i(27), h = i(18),
        f = i(22), g = i(5), p = i(24), v = i(2), m = i(7), y = a.default.getLogger("SkinNaviteFunction"),
        k = m.default(v.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.default.on("changeSkin", this.onChangeSkin), d.default.on("changeSkin", this.onChangeSpeedCurveSkin), u.default.on("changeSkin", this.onChangeSuspensionSkin)
            }

            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: "SetShakeInfo", nativeFunc: this.setShakeInfo}, {
                        functionName: "GetShakeInfo",
                        nativeFunc: this.getShakeInfo
                    }, {
                        functionName: "ClickSpeedCurveIcon",
                        nativeFunc: this.clickSpeedCurveIcon
                    }, {
                        functionName: "ShowIndividuation",
                        nativeFunc: this.showIndividuation
                    }, {
                        functionName: "GetSuspensionSkinInfo",
                        nativeFunc: this.getSuspensionSkinInfo
                    }, {functionName: "SetSuspensionSkinInfo", nativeFunc: this.setSuspensionSkinInfo}];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            getSkinInfo(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    let n = l.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(n)) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.information(n), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSkinInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield l.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSkin(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    y.information(e), c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSkin", e, t, i), h.ipcRenderer.send("OnChangeSkin", e)
                } while (0)
            }

            getSpeedCurveSkinInfo(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    let n = d.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(n)) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.information(n), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSpeedCurveSkinInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield d.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            setShakeInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a)) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeShake", a[0], a[1])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            getShakeInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        let n = yield l.default.getShakeInfo(a[0]);
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            clickSpeedCurveIcon(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        try {
                            yield g.client.callServerFunction("ShowIndividuation", {
                                activeKey: "skin",
                                skinActiveKey: "speedcurve"
                            })
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSpeedCurveSkin(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    y.information("onChangeSpeedCurveSkin", e), c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSpeedCurveSkin", e, t, i)
                } while (0)
            }

            showIndividuation(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a)) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n;
                        try {
                            let o = a[0];
                            "string" == typeof o && (o = JSON.parse(o)), n = yield f.MessageBox.customIndividuation("Individuation", Object.assign({
                                singleton: !0,
                                version: k.getFileVersion(v.join(__rootDir, "../../Thunder.exe")),
                                dynamicSkinVersion: p.default.getConfigInfo("dynamicSkinVersion")
                            }, o || {}), {
                                modal: !1,
                                alwaysOnTop: !0,
                                webPreferences: {spellcheck: !1, nodeIntegration: !0, webSecurity: !1}
                            })
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            getSuspensionSkinInfo(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    let n = u.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(n)) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.information(n), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSuspensionSkinInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield u.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSuspensionSkin(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    y.information("onChangeSuspensionSkin", e), c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSuspensionSkin", e, t, i)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.SkinNaviteFunctionNS || (t.SkinNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(36), o = i(25), r = i(13), s = i(140), l = i(474);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetVipTaskInfo",
                        nativeFunc: this.getVipTaskInfo
                    }, {
                        functionName: "GetVipSubTaskInfo",
                        nativeFunc: this.getVipSubTaskInfo
                    }, {
                        functionName: "GetVipLabelConfig",
                        nativeFunc: this.getVipLabelConfig
                    }, {functionName: "ClickTryAcclerateBtn", nativeFunc: this.clickTryAcclerateBtn}];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            getVipTaskInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = void 0, l = a[0], d = yield s.VipPluginFunctionNS.getVipTaskInfo(l);
                        d && (n = JSON.stringify(d)), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            getVipSubTaskInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || r.ThunderUtil.isUndef(a[0]) || r.ThunderUtil.isUndef(a[1])) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = void 0, l = a[0], d = a[1], u = yield s.VipPluginFunctionNS.getVipSubTaskInfo(l, d);
                        u && (n = JSON.stringify(u)), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            getVipLabelConfig(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || r.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], s = yield l.VipLableConfigNS.getConfig(n), d = void 0;
                        s && (d = JSON.stringify(s)), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, d)
                    } while (0)
                })
            }

            clickTryAcclerateBtn(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], l = a[1];
                        yield s.VipPluginFunctionNS.clickTryAcclerateBtn(n, l), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.VipNaviteFunctionNS || (t.VipNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(11), r = i(0), s = i(36), l = i(4), d = i(25), u = i(142), c = i(3), h = i(12), f = i(7),
        g = i(27), p = r.default.getLogger("NativeFunction.Login"), v = u.SubtitleManagerNS.getSubtitleManger(),
        m = h.DownloadKernelTaskManager.getTaskManager(), y = f.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "SubtitleQuerySubtitleByCid",
                        nativeFunc: this.querySubtitleByCid
                    }, {
                        functionName: "SubtitleQuerySubtitleByName",
                        nativeFunc: this.querySubtitleByName
                    }, {
                        functionName: "SubtitleGetFileList",
                        nativeFunc: this.getFileList
                    }, {
                        functionName: "SubtitleDownload",
                        nativeFunc: this.downloadSubtitle
                    }, {functionName: "SubtitleOpen", nativeFunc: this.openSubtitle}];
                    s.NativeCallNS.registerNativeFunction(e), v.attachListener(u.SubtitleManagerNS.SubtitleEvent.DownloadSuccess, (e, t, i) => {
                        g.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubtitleDownloadSuccess", e, t, JSON.stringify(i))
                    }), v.attachListener(u.SubtitleManagerNS.SubtitleEvent.DownloadFail, (e, t, i) => {
                        g.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubtitleDownloadFail", e, t, JSON.stringify(i))
                    })
                }
            }

            querySubtitleByCid(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = yield v.querySubtitleByCid(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            querySubtitleByName(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = yield v.querySubtitleByName(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            getFileList(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = v.getDisaplayName(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(o))
                    } while (0)
                })
            }

            downloadSubtitle(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!(a && a[0] && a[1] && a[2])) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = null;
                        try {
                            n = JSON.parse(a[0])
                        } catch (e) {
                            p.warning("downloadSubtitle invalid param! JSON parse failed! e:", e)
                        }
                        if (!n) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[1], r = a[2], s = yield v.downloadSubtitle(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            openSubtitle(e, t, i, r) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!r || !r[0] || !r[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = r[0], s = r[1], u = m.getTaskFromTaskId(n);
                        if (!u) break;
                        let h = u.getTaskName(), f = u.getType(), g = u.getSavePath();
                        f === c.DownloadKernel.TaskType.Bt && u.getExtraObject().getDownloadFile().length > 1 && (g = a.join(g, h));
                        let p = y.shellExecute(0, "open", a.join(g, s), null, null, "SW_SHOW");
                        if (p <= 32) {
                            let e = g + "\\.";
                            yield(yield o.asyncRemoteCall.getShell()).showItemInFolder(e)
                        }
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, p)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.SubtitleManagerNaviteFunctionNS || (t.SubtitleManagerNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4), a = i(36), o = i(27), r = i(109), s = i(25), l = r.ShouleiListSyncNS.getMananger();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.attachEvent("OnConnectStateChanged", e => {
                    o.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnShouleiConnectStateChanged", e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "GetShouleiConnectState", nativeFunc: this.getShouleiConnectState}];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            getShouleiConnectState(e, t, i, a) {
                do {
                    if (n.isNullOrUndefined(e) || n.isNullOrUndefined(t) || n.isNullOrUndefined(i)) break;
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, l.getState())
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ShouleiConnectNaviteFunctionNS || (t.ShouleiConnectNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(9), s = i(14), l = i(32), d = i(446), u = i(98), c = i(3), h = i(31), f = i(15),
        g = i(107), p = i(356), v = i(11), m = i(0), y = i(79), k = i(108), T = i(51), w = i(44), C = i(52), S = i(49),
        I = i(10), b = i(23), _ = i(40), D = i(103), A = i(7), N = i(5), x = i(41), E = i(22), P = i(38), O = i(26),
        M = A.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        F = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        L = f.DownloadKernelEventManager.getEventManager(), R = m.default.getLogger("task-helper"),
        B = C.ToastNotifyManagerNS.getToastNotifyManger(), U = y.MsgQueueNS.MsgPriority.Download,
        K = _.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        V = O.DownloadKernelCategoryManager.getCategoryManager();
    const W = new class {
        init() {
            this.attachConfigInitFinished(), this.attachTaskStatusChanged(), this.attachTaskCreated()
        }

        calculateSurplusTime(e) {
            let t = [9, 12, 20, 21, 22, 23], i = {surplusTime: -9999, taskTye: 2}, n = new Date, a = n.getHours(),
                o = n.getMinutes(), r = n.getSeconds(), s = 0, l = new Date(e);
            do {
                if (a >= 23) break;
                if (0 !== e && l.getTime() + 12096e5 > n.getTime()) {
                    R.information("consumptionTips is in 14day", l.getTime(), n.getTime());
                    break
                }
                if (0 === o && 0 === r) {
                    for (s = 0; s < t.length; ++s) if (a === t[s]) {
                        i.surplusTime = 0, 9 === t[s] ? i.taskTye = 0 : 20 !== t[s] && 21 !== t[s] && 22 !== t[s] || (i.taskTye = 1);
                        break
                    }
                } else {
                    for (s = 0; s < t.length && !(a < t[s]); ++s) ;
                    9 === t[s] ? i.taskTye = 0 : 20 !== t[s] && 21 !== t[s] && 22 !== t[s] || (i.taskTye = 1), i.surplusTime = 1e3 * (60 - r + 60 * (60 - o - 1) + 60 * (t[s] - a - 1) * 60)
                }
            } while (0);
            return i
        }

        attachShowConsumptionTips() {
            let e = "", t = 0;
            if (e = "task_cnt_tag=" + (t = this.getCompletedTaskInfo().totalNumber), I.XLStatNS.trackEvent("business", "downloaded_check_cnt", "", 0, 0, 0, 0, e), R.information("trackEvent", "business", "downloaded_check_cnt", e), e = "task_cnt_tag=" + (t = this.getDownloadingTaskInfo().totalNumber), I.XLStatNS.trackEvent("business", "downloading_check_cnt", "", 0, 0, 0, 0, e), R.information("trackEvent", "business", "downloading_check_cnt", e), "AutoRun" !== D.default.getStartArgs()) return;
            let i = r.ConfigNS.getValue("Consumption", "ShowMainWindowTime", 0),
                a = r.ConfigNS.getValue("Consumption", "HideMainWindowTime", 0),
                o = r.ConfigNS.getValue("Consumption", "ShowTipsTime", 0);
            do {
                if ((i > 0 || a > 0) && Math.abs(i - a) >= 2592e5) {
                    let e = {surplusTime: -1, taskTye: 1};
                    if ((e = this.calculateSurplusTime(o)).surplusTime < 0) break;
                    R.information("consumptionTips calculateSurplusTime", e.surplusTime, e.taskTye), setTimeout(() => n(this, void 0, void 0, function* () {
                        yield 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() {
            h.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                this.autoStartUnfinishTask(), setTimeout(() => {
                    this.autoDeleteNonExistTasks().catch()
                }, 1e4)
            })
        }

        autoDeleteNonExistTasks() {
            return n(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 + "个文件不存在的任务";
                        R.information(t), B.showNotify(C.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, S.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        autoStartUnfinishTask() {
            let e = r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
            w.DownloadDispatchNS.setStartTaskCount(e), r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoStartUnFinishedTask", !1) && l.TaskOperatorNs.startAll()
        }

        statJsSdkEvent(e, t, i) {
            do {
                if (null === e) break;
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) !== c.DownloadKernel.TaskType.Group) break;
                if ("ThunderUnion" !== e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Origin)) break;
                let n = e.getId();
                const a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                let o = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName), r = encodeURIComponent(o),
                    s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid), l = e.getExtraObject();
                if (null === l || void 0 === l) break;
                let d = `taskid=${n},filesize=${a},filename=${r},gcid=${s},filenum=${l.getSubTaskCount()}`;
                if ("js_grouptask_download_success" === t) {
                    if (null !== a && void 0 !== a && a >= 1048576) {
                        let t = 0, i = 0, n = 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 && (i = this.getSizeFormat(o.p2sSize)), null !== o.p2pSize && void 0 !== o.p2pSize && (n = 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=${i},P2P=${n},hyjs=${a = this.getSizeFormat(e)}`
                        }
                    }
                } else if ("js_grouptask_download_fail" === t) {
                    let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.ErrorCode);
                    d = 0 === t ? `${d},errorcode=${l.getErrorCodes().join(";")}` : `${d},errorcode=${t}`
                }
                void 0 !== i && (d = `${d},${i}`);
                let u = "core_operate";
                R.information("trackEvent", u, t, d), I.XLStatNS.trackEvent(u, 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() {
            L.attachTaskEvent(c.DownloadKernel.TaskEventType.TaskCreated, (...e) => n(this, void 0, void 0, function* () {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.TaskCreated) break;
                    let t = e[1];
                    if (!t) break;
                    let i = yield N.client.callServerFunction("GetTpPeerId");
                    for (let e of t) {
                        let t = "location=", n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                        if (-1 !== n) if (V.isPrivateCategory(n)) t += "private"; else {
                            let e = V.getCategoryFromId(n);
                            e && (t += e.getName())
                        } else {
                            let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath),
                                n = yield v.asyncRemoteCall.getApp(), a = yield n.getPath("desktop"),
                                o = yield n.getPath("documents"),
                                s = r.ConfigNS.getValue("TaskDefaultSettings", "InitPath", "");
                            "\\" === i[i.length - 1] && (i = i.slice(0, i.length - 1)), "\\" === s[s.length - 1] && (s = s.slice(0, s.length - 1)), i.toUpperCase() === a.toUpperCase() ? t += "desk" : i.toUpperCase() === o.toUpperCase() ? t += "my_file" : i.toUpperCase() === s.toUpperCase() ? t += "xl_download" : t += "other"
                        }
                        let a = e.getExtraObject();
                        if (a) {
                            let e = a.getUserData(T.TaskUserDataGUID.guidBirdKey, "birdKey");
                            if (e) {
                                let i = e.match(/[Xx]([0-9a-zA-Z])+/g);
                                i && i.length > 0 && (t += `,pass_word=${i[0]}`)
                            }
                            let i = a.getUserData(T.TaskUserDataGUID.guidSearchFrom, "searchFrom");
                            i && (t += `,search_from=${i}`)
                        }
                        t += `,cpeerid=${i}`, d.statCoreEvent(e, "createtask", t).catch(), this.statJsSdkEvent(e, "js_grouptask_create", t)
                    }
                } while (0)
            }))
        }

        attachTaskStatusChanged() {
            L.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = i.getTaskStatus();
                        if (i.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                            n === c.DownloadKernel.TaskStatus.Succeeded && this.checkOpenOnFinish(i).catch();
                            continue
                        }
                        let a = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background);
                        if (n === c.DownloadKernel.TaskStatus.Succeeded) {
                            let e = `task_stop_type=success,errorcode=0,gcid=${i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid)},is_retry=${u.DownloadJammedNS.isJammedOnce(i.getId()) ? 1 : 0}`;
                            d.statCoreEvent(i, "download_task_result", e).catch();
                            let t = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.CreateTime);
                            e = `downloadtime=${(i.getTaskAttribute(c.DownloadKernel.TaskAttribute.CompletionTime) - t) / 1e3}`, this.statJsSdkEvent(i, "js_grouptask_download_success", e), a || this.onTaskFinished(i).catch()
                        } else if (n === c.DownloadKernel.TaskStatus.Failed) {
                            let e = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid),
                                t = `task_stop_type=fail,errorcode=${i.getTaskAttribute(c.DownloadKernel.TaskAttribute.ErrorCode)},gcid=${e},is_retry=0`;
                            d.statCoreEvent(i, "download_task_result", t).catch(), this.statJsSdkEvent(i, "js_grouptask_download_fail"), a || this.onTaskFailed(i).catch()
                        }
                    }
                } while (0)
            }), L.attachTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroying, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.TaskDestroying) break;
                    let t = e[1];
                    if (!t) break;
                    let i = e[2];
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (n) {
                            if (n.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) break;
                            n.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || this.onTaskDestroy(n, i).catch()
                        }
                    }
                } while (0)
            }), L.attachTaskEvent(c.DownloadKernel.TaskEventType.TaskMovedEnd, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.TaskMovedEnd) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i) {
                            if (i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) break;
                            i.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || this.onTaskMoveEnd(i).catch()
                        }
                    }
                } while (0)
            })
        }

        getTaskUrl(e) {
            let t = "", i = e.getType();
            return i === c.DownloadKernel.TaskType.Bt ? t = e.getExtraObject().getSeedFilePath() : i !== c.DownloadKernel.TaskType.Emule && i !== c.DownloadKernel.TaskType.P2sp || (t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl)), t
        }

        getDownloadFileReportedData(e) {
            let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize),
                i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Cid), n = this.getTaskUrl(e), a = 0, o = 0,
                r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize),
                s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod),
                l = e.getTaskChannelInfo().originSize;
            R.information("getDownloadFileReportedData fileSize=", t, ";cid=", i, ";url=", n, ";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: i, url: n, deadLinks: a, saveTime: o}
            });
            return R.information("getDownloadFileReportedData data=", d), d
        }

        onTaskFinished(e) {
            return n(this, void 0, void 0, function* () {
                let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
                const i = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_Finish", !0),
                    n = yield v.asyncRemoteCall.getCurrentWindow(), a = n.isMinimized(), o = n.isVisible(),
                    s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                    d = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize), u = e.getTaskBaseInfo(),
                    h = u.taskType === c.DownloadKernel.TaskType.Group, f = e.getIsPrivate();
                let m = !1;
                const y = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                let k = V.getCategoryFromId(y);
                k && k.getName() === O.CategoryManager.panCategoryName && (m = !0);
                const w = null !== (yield(yield v.asyncRemoteCall.getBrowserWindow()).getFocusedWindow());
                if (b.LoginHelperNS.loginHelper.channel(this.getDownloadFileReportedData(e)), t || this.playTaskFinishedSound().catch(), this.openFinishedTask(e).catch(), h) {
                    let t = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall");
                    null !== t && void 0 !== t && "1" === t && l.TaskOperatorNs.executeInstallFile(e).catch(), this.createShortcut(e).catch()
                }
                if (!t && i && (a || !o || !w) && s && !f) {
                    if (h && d < 10485760) return;
                    R.information("DownloadComplete", F), F.enQueue({
                        callback: () => {
                            R.information("trackEvent", "download_leftpanel", "dl_finished_tips_show", "panel_type=mypc"), I.XLStatNS.trackEvent("download_leftpanel", "dl_finished_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), p.NotificationNS.notify({
                                type: g.Notification.TipsType.DownloadComplete,
                                data: {exData: {isPanDownload: m}, taskBase: u},
                                width: 400,
                                height: 205
                            }).catch()
                        }, name: "download", priority: U
                    }), (yield p.NotificationNS.getCurrentWindow()) ? F.getCurrentProperty() < U && (yield p.NotificationNS.close()) : F.deQueue()
                }
            })
        }

        onTaskDestroy(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!t) break;
                    if (e.getTaskBaseInfo().taskType !== c.DownloadKernel.TaskType.Group) break;
                    if (e.getTaskStatus() !== c.DownloadKernel.TaskStatus.Succeeded) break;
                    let i = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                    if (!i || i.length <= 0) break;
                    let n = null;
                    try {
                        n = JSON.parse(i)
                    } catch (e) {
                        R.warning(e)
                    }
                    if (!n || !n.name || !n.targetFile) {
                        R.information("invalid createShortcut", n);
                        break
                    }
                    let r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId),
                        s = x.TaskCtrlOperatorNS.getSavePathByFileName(r, n.targetFile);
                    if (!(yield o.FileSystemAWNS.existsAW(s))) {
                        R.warning("targetFile not exist!", s);
                        break
                    }
                    let l = n.name.replace(/[*?/\\:|<>\"]/g, "_"), d = yield v.asyncRemoteCall.getApp(),
                        u = a.join(yield d.getPath("desktop"), `${l}.lnk`);
                    (yield o.FileSystemAWNS.existsAW(u)) && (yield o.FileSystemAWNS.unlinkAW(u))
                } while (0)
            })
        }

        onTaskMoveEnd(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (e.getTaskBaseInfo().taskType !== c.DownloadKernel.TaskType.Group) break;
                    if (e.getTaskStatus() !== c.DownloadKernel.TaskStatus.Succeeded) break;
                    let t = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                    if (!t || t.length <= 0) break;
                    let i = null;
                    try {
                        i = JSON.parse(t)
                    } catch (e) {
                        R.warning(e)
                    }
                    if (!i || !i.name || !i.targetFile) {
                        R.information("invalid createShortcut", i);
                        break
                    }
                    let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId),
                        r = x.TaskCtrlOperatorNS.getSavePathByFileName(n, i.targetFile);
                    if (!(yield o.FileSystemAWNS.existsAW(r))) {
                        R.warning("targetFile not exist!", r);
                        break
                    }
                    let s = i.name.replace(/[*?/\\:|<>\"]/g, "_"), l = yield v.asyncRemoteCall.getApp(),
                        d = a.join(yield l.getPath("desktop"), `${s}.lnk`);
                    (yield o.FileSystemAWNS.existsAW(d)) && (yield o.FileSystemAWNS.unlinkAW(d), R.information("createShortcut", i, "lnkPath", d), yield new Promise(e => {
                        M.createShortcut(d, r, i.runParams || "", r, t => {
                            R.information("createShortcut result", t), e(t)
                        })
                    }))
                } while (0)
            })
        }

        getCompletedTaskInfo() {
            let e = [], t = 0, i = K.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed).getTasks(),
                n = new Date;
            for (let [, a] of i) if (null !== a && a.getTaskStatus() === c.DownloadKernel.TaskStatus.Succeeded) {
                let i = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.CompletionTime),
                    o = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.UserRead);
                if (n.getTime() - i <= 2592e6 && 0 === o) {
                    let i = a.getTaskBaseInfo().taskName;
                    t < 3 && e.push({taskName: i, percent: ""}), t += 1
                }
            }
            return {taskList: e, totalNumber: t}
        }

        getDownloadingTaskInfo() {
            let e = [], t = 0, i = K.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n] of i) {
                if (null !== n && n.getTaskStatus() === c.DownloadKernel.TaskStatus.Stopped) {
                    const t = n.getTaskBaseInfo();
                    let i = 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: i, percent: o})
                }
                t += 1
            }
            return {taskList: e, totalNumber: t}
        }

        onConsumptionNotifiy(e) {
            return n(this, void 0, void 0, function* () {
                let t = {taskList: [], totalNumber: 0}, i = 4, a = "downloaded_notcheck_popup_show", o = "task_cnt=";
                0 === e ? (t = this.getDownloadingTaskInfo(), a = "not_downloaded_popup_show") : 1 === e ? (t = this.getCompletedTaskInfo(), i = 3) : (t = this.getCompletedTaskInfo(), i = 3, 0 === t.totalNumber && (i = 4, a = "not_downloaded_popup_show", t = this.getDownloadingTaskInfo()));
                do {
                    if (0 === t.totalNumber) break;
                    o += t.totalNumber;
                    let e = new Date;
                    F.enQueue({
                        callback: () => {
                            R.information("trackEvent", "business", a, o), I.XLStatNS.trackEvent("business", a, "", 0, 0, 0, 0, o);
                            let s = "亲,";
                            b.LoginHelperNS.loginHelper.getAllUserInfo(a => n(this, void 0, void 0, function* () {
                                (yield N.client.callServerFunction("IsLogined")) && (s = a.nickName), R.information("consumpiton consumptionMsgType,taskInfo", i, t), p.NotificationNS.notify({
                                    type: g.Notification.TipsType.ConsumptionTips,
                                    data: {msgType: i, userName: s, fileCountNumber: t.totalNumber, exData: t.taskList},
                                    width: 400,
                                    height: 272
                                }).catch(), M.IsInFullScreen() ? this.attachShowConsumptionTips() : r.ConfigNS.setValue("Consumption", "ShowTipsTime", e.getTime())
                            }))
                        }, name: "download", priority: U
                    }), (yield p.NotificationNS.getCurrentWindow()) ? F.getCurrentProperty() < U && (yield p.NotificationNS.close()) : F.deQueue()
                } while (0)
            })
        }

        showAuthorizationDlg(e) {
            do {
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) !== c.DownloadKernel.TaskType.P2sp) break;
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), i = new URL(t),
                    a = i.protocol + "//" + i.host;
                E.MessageBox.custom("http-auth-login", {site: a}, {
                    width: 450,
                    height: 240
                }).then(t => n(this, void 0, void 0, function* () {
                    if (t.action === P.MessageBoxNS.Action.OK) {
                        let i = t.args.username, n = t.args.password || "";
                        if (i) {
                            let t = "Authorization", a = "Basic " + window.btoa(`${encodeURIComponent(i)}:${n}`);
                            e.getExtraObject().setUserData(T.TaskUserDataGUID.guidHttpHeaderField, t, a), R.information("http auth", t, a);
                            let o = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
                            yield w.DownloadDispatchNS.startTask(o)
                        }
                    }
                })).catch()
            } while (0)
        }

        onTaskFailed(e) {
            return n(this, void 0, void 0, function* () {
                let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
                const i = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_FailSuggest", !0),
                    n = yield v.asyncRemoteCall.getCurrentWindow(), a = n.isMinimized(), o = n.isVisible(),
                    s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                    l = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize), d = e.getTaskBaseInfo(),
                    u = d.taskType === c.DownloadKernel.TaskType.Group, h = e.getIsPrivate(),
                    f = null !== (yield(yield v.asyncRemoteCall.getBrowserWindow()).getFocusedWindow());
                401 === e.getTaskAttribute(c.DownloadKernel.TaskAttribute.ErrorCode) && this.showAuthorizationDlg(e);
                let m = !1;
                const y = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                let k = V.getCategoryFromId(y);
                if (k && k.getName() === O.CategoryManager.panCategoryName && (m = !0), !t && i && (a || !o || !f) && s && !h) {
                    if (u && l < 10485760) return;
                    F.enQueue({
                        callback: () => {
                            R.information("trackEvent", "download_leftpanel", "dl_fail_tips_show", "panel_type=mypc"), I.XLStatNS.trackEvent("download_leftpanel", "dl_fail_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), p.NotificationNS.notify({
                                type: g.Notification.TipsType.DownloadFail,
                                data: {exData: {isPanDownload: m}, taskBase: d},
                                width: 400,
                                height: 180
                            }).catch()
                        }, name: "download", priority: U
                    }), (yield p.NotificationNS.getCurrentWindow()) ? F.getCurrentProperty() < U && (yield p.NotificationNS.close()) : F.deQueue()
                }
            })
        }

        playTaskFinishedSound() {
            return n(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 n(this, void 0, void 0, function* () {
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName);
                if (".torrent" === a.extname(t)) {
                    let t = r.ConfigNS.getValue("BtGenericSettings", "AutoBTNewTask", !0);
                    if (1 === e.getTaskAttribute(c.DownloadKernel.TaskAttribute.OpenOnComplete) || t) {
                        let t = e.getTaskBaseInfo();
                        yield l.TaskOperatorNs.openTaskItem(t)
                    }
                } else if (1 === e.getTaskAttribute(c.DownloadKernel.TaskAttribute.OpenOnComplete)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                }
            })
        }

        openFinishedTask(e) {
            return n(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()
            })
        }

        createShortcut(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                    if (!i || i.length <= 0) break;
                    let n = null;
                    try {
                        n = JSON.parse(i)
                    } catch (e) {
                        R.warning(e)
                    }
                    if (!n || !n.name || !n.targetFile) {
                        R.information("invalid createShortcut", n);
                        break
                    }
                    let r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId),
                        s = x.TaskCtrlOperatorNS.getSavePathByFileName(r, n.targetFile);
                    if (!(yield o.FileSystemAWNS.existsAW(s))) {
                        R.warning("targetFile not exist!", s);
                        break
                    }
                    let l = n.name.replace(/[*?/\\:|<>\"]/g, "_"), d = yield v.asyncRemoteCall.getApp(),
                        u = a.join(yield d.getPath("desktop"), `${l}.lnk`);
                    (yield o.FileSystemAWNS.existsAW(u)) && (yield o.FileSystemAWNS.unlinkAW(u)), R.information("createShortcut", n, "lnkPath", u), t = yield new Promise(e => {
                        M.createShortcut(u, s, n.runParams || "", s, t => {
                            R.information("createShortcut result", t), e(t)
                        })
                    })
                } while (0);
                return t
            })
        }
    };
    !function (e) {
        e.init = function () {
            W.init()
        }
    }(t.TaskHelperNS || (t.TaskHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(59), o = i(2), r = i(7), s = i(0), l = i(10), d = i(14), u = i(9), c = i(76), h = i(5), f = i(31),
        g = i(478), p = i(104), v = i(32), m = i(44), y = i(52), k = i(49), T = i(88), w = i(362), C = i(18), S = i(33),
        I = i(361), b = i(30), _ = i(624), D = i(43), A = i(24), N = i(6), x = i(626),
        E = s.default.getLogger("ConfigHandler"), P = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        O = y.ToastNotifyManagerNS.getToastNotifyManger();
    let M = "";
    const F = new class {
        init() {
            this.attachConfigInitFinished(), x.default.init(), u.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                switch (e) {
                    case"ConfigNormalSession":
                        this.onConfigNormalSessionChanged(t, i, n);
                        break;
                    case"TaskDefaultSettings":
                        this.onTaskDefaultSettingsChanged(t, i, n);
                        break;
                    case"ConfigNet":
                        this.onConfigNetChanged(t, i, n);
                        break;
                    case"ConfigMsg":
                        this.onConfigMsgChanged(t, i, n);
                        break;
                    case"Monitor":
                        this.onMonitorChanged(t, i, n);
                        break;
                    case"Proxy":
                        this.onProxyChanged(t, i, n);
                        break;
                    case"BtGenericSettings":
                        this.onBtGenericSettingsChanged(t, i, n);
                        break;
                    case"ConfigNoLimitDownload":
                        this.onConfigNoLimitDownloadChanged(t, i, n);
                        break;
                    case"Others":
                        this.onOthersChanged(t, i, n);
                        break;
                    case"IdleDownload":
                        this.onIdleDownloadChanged(t, i, n);
                        break;
                    case"EMuleGenericSettings":
                        this.onEMuleGenericSettingsChanged(t, i, n);
                        break;
                    case"MagnetGenericSettings":
                        this.onMagnetGenericSettingsChanged(t, i, n);
                        break;
                    case"BossKey":
                        this.onBossKeyChanged(t, i, n);
                        break;
                    case"DiskCache":
                        this.onDiskCacheChanged(t, i, n);
                        break;
                    case"Motitor":
                        this.onMotitorChanged(t, i, n);
                        break;
                    case"ProxySetting":
                        this.onProxySettingChanged(t, i, n);
                        break;
                    case"ThunderPanPlugin":
                        this.onThunderPanPluginChanged(t, i, n).catch()
                }
            }), c.BHOConfigNS.attachListener(d.NodeEventMesssageNS.eventBHOConfigValueChanged, (e, t, i, n) => {
                switch (e) {
                    case"Monitor":
                        this.onBHOConfigMonitorSessionChanged(t, i, n);
                        break;
                    case"EMuleGenericSettings":
                        "EMuleWatchLink" === t && this.handleWatchEmuleLink(i, n);
                        break;
                    case"MagnetGenericSettings":
                        "MagnetWatchLink" === t && this.handleWatchMagnetLink(i, n)
                }
            })
        }

        attachConfigInitFinished() {
            u.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished().catch()
            })
        }

        updateVodCachePath() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                (e = u.ConfigNS.getValue("ThunderPanPlugin", "SetVODCachePath", !0) ? yield u.ConfigNS.getNetDiscVODCachePath() : "") !== M && (M = e, E.information("updateNetDiscVODCachePath", e), b.ThunderKernel.updateNetDiscVODCachePath(e))
            })
        }

        onConfigInitFinished() {
            return n(this, void 0, void 0, function* () {
                this.updateVodCachePath().catch();
                let e = u.ConfigNS.getValue("DiskCache", "DiskCacheSelect", 256);
                f.DownloadKernelManager.setCacheSize(e);
                let t = u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
                if (m.DownloadDispatchNS.setStartTaskCount(t), u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1)) {
                    let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                    e = Number(e), !isNaN(e) && e > 0 && m.DownloadDispatchNS.setAutoAddTask(!0, e)
                }
                u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoSlowTask2Tail", !1) ? (this.handleAutoSlowTask2Tail(void 0, !0), l.XLStatNS.trackEvent("core_event", "setting_check", "", 0, 0, 0, 0, "auto_move2last=1")) : l.XLStatNS.trackEvent("core_event", "setting_check", "", 0, 0, 0, 0, "auto_move2last=0"), f.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                    let e = u.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
                    if (this.handleDownloadMode(void 0, e), u.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1)) {
                        let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                        m.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                    }
                    if (u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceLimit", !1)) {
                        let e = Number(u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceCount", "500"));
                        e && b.ThunderKernel.setGlobalConnectionLimit(e), l.XLStatNS.trackEvent("setting_center", "set_max_download_resources_cnt", "", 0, 0, 0, 0, `is_set=1,cnt=${e}`)
                    } else {
                        const e = 4294967295;
                        b.ThunderKernel.setGlobalConnectionLimit(e), l.XLStatNS.trackEvent("setting_center", "set_max_download_resources_cnt", "", 0, 0, 0, 0, "is_set=0")
                    }
                }), f.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadSDKRecover, e => {
                    if (0 === e) {
                        let e = u.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
                        this.handleDownloadMode(void 0, e)
                    }
                });
                let i = u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0),
                    n = P.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
                if (i && "" === n ? u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 0) : i || "" === n || u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 1), u.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1) && w.ScheduleTaskNS.startFreeDownLoad(), u.ConfigNS.getValue("BtGenericSettings", "AssocTorrent", !0) && g.FileAssociationNS.checkAndRegisterTorrentFile(), 0 === u.ConfigNS.getValue("GenericSettings", "CheckCpu", 0)) {
                    u.ConfigNS.setValue("GenericSettings", "CheckCpu", 1);
                    let e = P.getCpuProcessors();
                    P.getCpuFrequency(t => {
                        let i = "0";
                        i = 1 === e ? "0" : 2 === e || 3 === e ? t < 3500 ? "0" : "1" : 4 === e && t < 3e3 ? "0" : "1", u.ConfigNS.setValue("GenericSettings", "AnimationLevel", i);
                        let n = "cpu_processors=" + e.toString();
                        n += ",cpu_frequency=", n += t.toString(), l.XLStatNS.trackEvent("xdas_client_pro", "cpu_info", "", 0, 0, 0, 0, n)
                    })
                }
                let a = u.ConfigNS.getValue("ProxySetting", "ConfigProxy_Type", "0");
                this.handleProxyTypeChanged(void 0, a), _.BHOConfigHttpServerNS.init().catch(), this.fixBHOFilterSitesForUI(), h.client.attachServerEvent("OnPlayVideo", (e, t) => {
                }), yield A.default.isInitedAw();
                let o = u.ConfigNS.getValue("ConfigNet", "ConfigNet_OpenMirrorImageIncreaseSpeed", !0);
                f.DownloadKernelManager.enableCommonP2sChannel(o);
                let r = u.ConfigNS.getValue("ConfigNet", "ConfigNet_OpenXunleiP2PIncreaseSpeed", !0);
                f.DownloadKernelManager.enableCommonP2pChannel(r)
            })
        }

        isXmpExist() {
            return n(this, void 0, void 0, function* () {
                let e = D.Common.getXmpPath();
                return N.FileSystemAWNS.existsAW(e)
            })
        }

        isXmpLiteExist() {
            return n(this, void 0, void 0, function* () {
                let e = o.join(__rootDir, "../../XMP/XMP.exe");
                return N.FileSystemAWNS.existsAW(e)
            })
        }

        fixBHOFilterSitesForUI() {
            let e = c.BHOConfigNS.getDefaultFilterSitesForUI(), t = e.replace(/\r\n/g, "||");
            t = t.replace(/\n/g, "||");
            let i = c.BHOConfigNS.getValue("Monitor", "FilterSitesForUI", t),
                n = u.ConfigNS.getValue("Monitor", "FilterSitesForUI", e);
            (n = (n = n.replace(/\r\n/g, "||")).replace(/\n/g, "||")) !== i && u.ConfigNS.setValue("Monitor", "FilterSitesForUI", i.replace(/\|\|/g, "\n"))
        }

        onConfigNormalSessionChanged(e, t, i) {
            switch (e) {
                case"ConfigNormal_AutoRun":
                    this.handleAutoRun(t, i);
                    break;
                case"ConfigNormal_AutoStartUnFinishedTask":
                    break;
                case"ConfigNormal_MaxRunningTaskCount":
                    this.handleSetMaxRunningTaskCount(t, i);
                    break;
                case"TaskCountTotalSpeed":
                    break;
                case"ConfigNormal_AutoSlowTask2Tail":
                    this.handleAutoSlowTask2Tail(t, i);
                    break;
                case"ConfigNormal_AutoDeleteNotExistFile":
                    this.handleAutoDeleteNonExistTasks(t, i).catch()
            }
        }

        onTaskDefaultSettingsChanged(e, t, i) {
            switch (e) {
                case"DefaultPath":
                case"UseLastCatalog":
                case"Win7Libraries":
                case"NewTaskStartMode":
                case"OpenFile":
                case"OpenSilenceDownload":
                    break;
                case"AwayModeEnabled":
                    this.handleAwayMode(t, i);
                    break;
                case"NewTaskDlgWithoutMainWnd":
                    this.handleNewTaskDlgWithoutMainWnd(t, i);
                    break;
                case"OrignHostThreads":
                    this.handleSetThreadCount(t, i);
                    break;
                case"MaxResourceLimit":
                    if (i) {
                        let e = Number(u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceCount", "500"));
                        e && b.ThunderKernel.setGlobalConnectionLimit(e)
                    } else {
                        const e = 4294967295;
                        b.ThunderKernel.setGlobalConnectionLimit(e)
                    }
                    break;
                case"MaxResourceCount":
                    u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceLimit", !1) && Number(i) && b.ThunderKernel.setGlobalConnectionLimit(Number(i))
            }
        }

        onConfigNetChanged(e, t, i) {
            switch (e) {
                case"ConfigNet_Type":
                    this.handleDownloadMode(t, i);
                    break;
                case"ConfigNet_Custom_DownloadSpeedChk":
                    (i = i) ? m.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : m.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":
                    E.information("onConfigNetChanged DownloadMode handleCustomDownloadMode"), p.DownloadModeNS.handleCustomDownloadMode();
                    break;
                case"ConfigNet_OpenMirrorImageIncreaseSpeed":
                    this.handleOpenMirrorImageIncreaseSpeed(t, i);
                    break;
                case"ConfigNet_OpenXunleiP2PIncreaseSpeed":
                    this.handleOpenXunleiP2PIncreaseSpeed(t, i);
                    break;
                case"ConfigNet_IdleDownload":
                    this.handleSetFreedown(t, i)
            }
        }

        onConfigMsgChanged(e, t, i) {
            switch (e) {
                case"ConfigMsg_Finish":
                    break;
                case"ConfigMsg_PlayWaveWhileFinish":
                    this.handlePlayWaveWhileFinish(t, i);
                    break;
                case"ConfigMsg_WavePath":
                case"ConfigMsg_FailSuggest":
                    break;
                case"ConfigMsg_TodayRecommend":
                    E.information("trackEvent", "setting_center", "message_setting", "today_recommend=" + (i ? 1 : 0)), l.XLStatNS.trackEvent("setting_center", "message_setting", "", 0, 0, 0, 0, "today_recommend=" + (i ? 1 : 0))
            }
        }

        onMonitorChanged(e, t, i) {
            switch (e) {
                case"MonitorClipBoard":
                    this.handleMonitorClipBoard(t, i);
                    break;
                case"ShortcutMonitor":
                    break;
                case"WatchTraditionLink":
                    c.BHOConfigNS.setValue("Monitor", "WatchTraditionLink", i ? 1 : 0), c.BHOConfigNS.save().catch();
                    break;
                case"ConfigWatch_Bt":
                    c.BHOConfigNS.setValue("Monitor", "ConfigWatch_Bt", i ? 1 : 0), c.BHOConfigNS.save().catch();
                    break;
                case"ExtendNames":
                    if (t !== i) {
                        let e = i.trim();
                        c.BHOConfigNS.setValue("Monitor", "ExtendNames", e), c.BHOConfigNS.save().catch()
                    }
                    break;
                case"FilterSitesForUI":
                    if (t !== i) {
                        let e = i.trim();
                        e = (e = e.replace(/\r\n/g, "||")).replace(/\n/g, "||"), c.BHOConfigNS.setValue("Monitor", "FilterSitesForUI", e), c.BHOConfigNS.save().then(() => {
                            let e = P.notifyBrowserConfigChanged();
                            E.information("notifyBrowserConfigChanged notify:", e)
                        }).catch()
                    }
            }
        }

        handleSetFreedown(e, t) {
            E.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && h.client.callServerFunction("ShowMessageToast", {
                message: "已开启空闲下载",
                type: "success"
            }).catch()
        }

        onMotitorChanged(e, t, i) {
            E.information("onMotitorChanged:", e, t, i);
            do {
                if ("MotitorAll" === e) break;
                let t = T.SettingConfigHelperNS.configBrowserHelper.getWriteIniConfigShowBrowsers();
                c.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", t), T.SettingConfigHelperNS.configBrowserHelper.savaMotiorBrowserToConfig()
            } while (0)
        }

        onProxySettingChanged(e, t, i) {
            switch (E.information("onProxySettingChanged:", e, t, i), e) {
                case"ConfigProxy_Type":
                    this.handleProxyTypeChanged(t, i);
                    break;
                case"ConnectType_Http":
                    this.handleSetProxy(t, i)
            }
        }

        onProxyChanged(e, t, i) {
            switch (e) {
                case"UseProxy":
                    this.handleUseProxy(t, i)
            }
        }

        onBtGenericSettingsChanged(e, t, i) {
            switch (e) {
                case"AutoBTNewTask":
                case"AssocTorrent":
                    break;
                case"ConfigBt_SetPortType":
                    this.handleSetPortType(t, i)
            }
        }

        onConfigNoLimitDownloadChanged(e, t, i) {
            switch (e) {
                case"TaskCountAutoAdd":
                    this.handleAutoAddTask(t, i);
                    break;
                case"TaskCountAutoAddRate":
                    u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1) && t !== i && m.DownloadDispatchNS.setAutoAddTask(!0, Number(i));
                    break;
                case"OpenNoLimitDownload":
                    this.handleOpenNoLimitDownload(t, i);
                    break;
                case"NoLimitDownloadFileSize":
                    u.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1) && t !== i && m.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(i))
            }
        }

        onOthersChanged(e, t, i) {
            switch (e) {
                case"AntiDisturb":
                    this.handleAntiDisturb(t, i)
            }
        }

        onIdleDownloadChanged(e, t, i) {
            switch (e) {
                case"isOpen":
                    this.handleOpenIdleDownload(t, i)
            }
        }

        onEMuleGenericSettingsChanged(e, t, i) {
            switch (e) {
                case"EMuleWatchLink":
                    c.BHOConfigNS.setValue("EMuleGenericSettings", "EMuleWatchLink", i ? 1 : 0), c.BHOConfigNS.save().catch()
            }
        }

        onMagnetGenericSettingsChanged(e, t, i) {
            switch (e) {
                case"MagnetWatchLink":
                    c.BHOConfigNS.setValue("MagnetGenericSettings", "MagnetWatchLink", i ? 1 : 0), c.BHOConfigNS.save().catch()
            }
        }

        onBossKeyChanged(e, t, i) {
            switch (e) {
                case"BossKeySwitch":
                    this.handleBossKeySwitch(t, i)
            }
        }

        onDiskCacheChanged(e, t, i) {
            switch (e) {
                case"DiskCacheSelect":
                    this.handleDiskCacheSelect(t, i)
            }
        }

        handleAutoRun(e, t) {
            if (E.verbose("handleAutoRun preValue:", e, "; newValue:", t), t) {
                let e = o.join(__rootDir, "../../Thunder.exe") + " -silent -StartType:AutoRun";
                P.writeRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder", e, 1)
            } else P.deleteRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder")
        }

        handleSetMaxRunningTaskCount(e, t) {
            E.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && m.DownloadDispatchNS.setStartTaskCount(t)
        }

        handleAutoSlowTask2Tail(e, t) {
            m.DownloadDispatchNS.setAutoTail(t)
        }

        handleAutoDeleteNonExistTasks(e, t) {
            return n(this, void 0, void 0, function* () {
                if (t) {
                    let e = yield v.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        E.information(t), O.showNotify(y.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, k.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        handleSetThreadCount(e, t) {
            E.verbose("handleSetThreadCount preValue:", e, "; newValue:", t)
        }

        handleDownloadMode(e, t) {
            E.verbose("handleDownloadMode preValue:", e, "; newValue:", t), "1" === String(t) ? (E.information("handleDownloadMode DownloadMode setFullDownloadMode"), p.DownloadModeNS.setFullDownloadMode(), m.DownloadDispatchNS.setAutoAddTaskAvailable(!0)) : "0" === String(t) && (u.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0) ? m.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : m.DownloadDispatchNS.setAutoAddTaskAvailable(!0), E.information("handleDownloadMode DownloadMode handleCustomDownloadMode"), p.DownloadModeNS.handleCustomDownloadMode())
        }

        handleOpenMirrorImageIncreaseSpeed(e, t) {
            E.verbose("handleOpenMirrorImageIncreaseSpeed preValue:", e, "; newValue:", t), f.DownloadKernelManager.enableCommonP2sChannel(t)
        }

        handleOpenXunleiP2PIncreaseSpeed(e, t) {
            E.verbose("handleOpenXunleiP2PIncreaseSpeed preValue:", e, "; newValue:", t), f.DownloadKernelManager.enableCommonP2pChannel(t)
        }

        handleMonitorClipBoard(e, t) {
            E.verbose("handleMonitorClipBoard preValue:", e, "; newValue:", t)
        }

        handleUseProxy(e, t) {
            E.verbose("handleUseProxy preValue:", e, "; newValue:", t)
        }

        handleProxyTypeChanged(e, t) {
            E.verbose("handleUseProxy preValue:", e, "; newValue:", t);
            let i = "1", n = "null";
            if ("0" === t) void 0 !== e && b.ThunderKernel.setProxy(I.ProxyNS.ProxyType.None, "", 0, "", ""); else if ("1" === t) this.useIEProxy(), i = "0", n = "IE"; else if ("2" === t) {
                let e = u.ConfigNS.getValue("ProxySetting", "ConnectType_Http", "直接连接");
                "直接连接" !== e ? this.useCostomProxy(e) : b.ThunderKernel.setProxy(I.ProxyNS.ProxyType.None, "", 0, "", ""), i = "0", n = "custom"
            }
            let a = "download_agent=" + i;
            a = a + ",agent=" + n, E.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) {
            E.verbose("handlePlayWaveWhileFinish preValue:", e, "; newValue:", t)
        }

        handleSetPortType(e, t) {
            E.verbose("handleSetPortType preValue:", e, "; newValue:", t)
        }

        handleOpenNoLimitDownload(e, t) {
            E.verbose("handleOpenNoLimitDownload preValue:", e, "; newValue:", t);
            do {
                if (e === t) break;
                if (t) {
                    let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                    m.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                } else m.DownloadDispatchNS.setFreeFromScheduleOpen(!1)
            } while (0)
        }

        handleAutoAddTask(e, t) {
            do {
                if (e === t) break;
                if (t) {
                    let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                    m.DownloadDispatchNS.setAutoAddTask(!0, Number(e))
                } else m.DownloadDispatchNS.setAutoAddTask(!1)
            } while (0)
        }

        handleAntiDisturb(e, t) {
            E.verbose("handleAntiDisturb preValue:", e, "; newValue:", t)
        }

        handleOpenIdleDownload(e, t) {
            E.verbose("handleOpenIdleDownload preValue:", e, "; newValue:", t)
        }

        handleWatchEmuleLink(e, t) {
            E.verbose("handleWatchEmuleLink preValue:", e, "; newValue:", t);
            let i = '"' + o.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:ed2k';
            if (E.information("emuleValue: ", i), 1 === t) P.createRegKey("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command"), P.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "", i, 1), E.information("writeRegValue HKEY_CURRENT_USER Software\\Classes\\ed2k\\Shell\\Open\\command ", i); else {
                let e = P.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "");
                E.information("oldEmuleValue: ", e), e === i && (P.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "", "", 1), E.information("remove HKEY_CURRENT_USER Software\\Classes\\ed2k\\Shell\\Open\\command"))
            }
        }

        handleWatchMagnetLink(e, t) {
            E.verbose("handleWatchMagnetLink preValue:", e, "; newValue:", t);
            let i = '"' + o.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:magnet';
            if (E.information("magnetValue: ", i), 1 === t) P.createRegKey("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command"), P.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "", i, 1), E.information("writeRegValue HKEY_CURRENT_USER Software\\Classes\\magnet\\Shell\\Open\\command ", i); else {
                let e = P.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "");
                E.information("oldMagnetValue: ", e), e === i && (P.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "", "", 1), E.information("remove HKEY_CURRENT_USER Software\\Classes\\magnet\\Shell\\Open\\command"))
            }
        }

        handleBossKeySwitch(e, t) {
            E.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t)
        }

        handleDiskCacheSelect(e, t) {
            E.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t), f.DownloadKernelManager.setCacheSize(t)
        }

        onBHOConfigMonitorSessionChanged(e, t, i) {
            switch (c.BHOConfigNS.saveSync(), e) {
                case"ConfigBrowsers":
                case"FilterSitesForUI":
                    this.handleBHOConfigMonitorBrowserChanged(t, i)
            }
        }

        handleBHOConfigMonitorBrowserChanged(e, t) {
            P.notifyBrowserConfigChanged(), E.verbose("handleBHOConfigMonitorBrowserChanged preValue:", e, "; newValue:", t)
        }

        handleNewTaskDlgWithoutMainWnd(e, t) {
            e !== t && u.ConfigNS.saveSync()
        }

        setAwayMode(e) {
            let t = o.join(__rootDir, "../../ThunderCmd.exe");
            C.ipcRenderer.send(S.ThunderChannelList.channelRMExecute, "AwayMode", "runas", t, e, "", "SW_HIDE"), C.ipcRenderer.once(S.ThunderChannelList.channelMRExecuteResult, (t, i, n) => {
                if ("AwayMode" === i) if (n > 32) {
                    let t = !0;
                    "-CloseLeaveMode" === e && (t = !1), u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                } else {
                    let t = !1;
                    "-CloseLeaveMode" === e && (t = !0), u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                }
            })
        }

        handleAwayMode(e, t) {
            let i = t, n = a.release(), o = n.indexOf(".", 0), r = n.substring(0, o);
            if (null !== r && void 0 !== r && Number(r) >= 6) {
                let e = P.queryRegValue("HKEY_LOCAL_MACHINE", "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", "AwayModeEnabled");
                E.information("设置离开模式:", i, e), i ? 1 !== e ? this.setAwayMode("-OpenLeaveMode") : u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !0) : 1 === e ? this.setAwayMode("-CloseLeaveMode") : u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !1)
            }
        }

        useCostomProxy(e) {
            if (E.verbose("useCostomProxy proxyName:", e), "直接连接" === e) return void b.ThunderKernel.setProxy(I.ProxyNS.ProxyType.None, "", 0, "", "");
            let t = {}, i = u.ConfigNS.getValue("ProxyList", "proxys", []);
            if (i.length > 0) for (let n = 0; n < i.length; ++n) {
                let a = i[n].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 = I.ProxyNS.ProxyType.None;
                "HTTP" === t.type ? e = I.ProxyNS.ProxyType.Http : "SOCKS5" === t.type && (e = I.ProxyNS.ProxyType.Sock5), b.ThunderKernel.setProxy(e, t.host, t.port, t.userName, t.passWord)
            }
        }

        useIEProxy() {
            let e = this.getIEProxy();
            if (e.host && e.port) {
                let t = I.ProxyNS.ProxyType.None;
                "HTTP" === e.type ? t = I.ProxyNS.ProxyType.Http : "SOCKS5" === e.type && (t = I.ProxyNS.ProxyType.Sock5), b.ThunderKernel.setProxy(t, e.host, e.port, e.userName, e.passWord)
            }
        }

        getIEProxy() {
            let e = {}, t = P.getIEProxy();
            if (t && "" !== t) {
                let i = t.indexOf("http=");
                if (e.type = "HTTP", i > 0) {
                    let e = (t = t.substr(i, t.length - (i + 5))).indexOf(";");
                    e > 0 && (t = t.substr(0, t.length - e))
                } else if ((i = t.indexOf("socks=")) > 0) {
                    e.type = "SOCKS5";
                    let n = (t = t.substr(i, t.length - (i + 6))).indexOf(",");
                    n > 0 && (t = t.substr(0, t.length - n))
                }
                if (t && t.length > 0 && t.indexOf(":") > 0 && t.indexOf("=") < 0) {
                    i = t.indexOf(":");
                    let n = t.substr(0, i), a = t.substr(i + 1, t.length - (i + 1));
                    n && a && Number(a) && (e.host = n, e.port = Number(a))
                }
            }
            return e
        }

        onThunderPanPluginChanged(e, t, i) {
            return n(this, void 0, void 0, function* () {
                switch (e) {
                    case"StartCloudStopDownload":
                        x.default.onConfigSwitch(t, i);
                        break;
                    case"defaultDownloadPath":
                    case"downloadPaths":
                    case"SetVODCachePath":
                        this.updateVodCachePath().catch()
                }
            })
        }
    };
    !function (e) {
        e.init = function () {
            F.init()
        }
    }(t.ConfigHandlerNS || (t.ConfigHandlerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(96), o = i(46), r = i(625), s = i(76), l = i(4), d = i(0), u = i(9),
        c = d.default.getLogger("BHOConfigHttpServer");
    !function (e) {
        class t {
            constructor() {
                this.server = null
            }

            getBHOConfig(e, t, i, n) {
                if (t && i && l.isString(t) && l.isString(i)) {
                    let a = s.BHOConfigNS.getValue(t, i, n);
                    e.writeHead(200, {"Content-Type": "application/json"});
                    let o = {code: 0};
                    o.value = a, e.write(JSON.stringify(o))
                } else e.writeHead(400)
            }

            setBHOConfig(e, t, i, n) {
                if (t && i && l.isString(t) && l.isString(i) && !l.isNullOrUndefined(n)) {
                    c.information("setBHOConfig", t, i, n), s.BHOConfigNS.setValue(t, i, n), e.writeHead(200, {"Content-Type": "application/json"});
                    let a = {code: 0};
                    e.write(JSON.stringify(a))
                } else e.writeHead(400)
            }

            setConfig(e, t, i, n) {
                if (t && i && l.isString(t) && l.isString(i) && !l.isNullOrUndefined(n)) {
                    c.information("setConfig", t, i, n), u.ConfigNS.setValue(t, i, n), e.writeHead(200, {"Content-Type": "application/json"});
                    let a = {code: 0};
                    e.write(JSON.stringify(a))
                } else e.writeHead(400)
            }

            onRequest(e, t) {
                let i = "";
                e.on("readable", () => {
                    let t = e.read();
                    t && (i += t)
                }), e.on("end", () => {
                    let n = o.parse(e.url, !0);
                    const a = n.pathname;
                    let s = null;
                    if ("GET" === e.method) s = n.query; else if ("POST" === e.method) try {
                        s = JSON.parse(i)
                    } catch (e) {
                        s = r.parse(i)
                    }
                    c.information("onRequest end", a, s, i), "/getbhoconfig" === a ? this.getBHOConfig(t, s.section, s.key, s.default) : "/setbhoconfig" === a ? this.setBHOConfig(t, s.section, s.key, s.value) : "/setconfig" === a ? this.setConfig(t, s.section, s.key, s.value) : t.writeHead(404), t.end()
                })
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (this.server) break;
                        this.server = a.createServer(this.onRequest.bind(this)), this.server.listen(5021)
                    } while (0)
                })
            }
        }

        let i = null;
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                i || (i = new t), yield i.init()
            })
        }
    }(t.BHOConfigHttpServerNS || (t.BHOConfigHttpServerNS = {}))
}, function (e, t) {
    e.exports = require("querystring")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(34), r = i(56), s = i(5), l = i(12).DownloadKernelTaskManager.getTaskManager(), d = i(9),
        u = i(0), c = i(337), h = i(85), f = u.default.getLogger("StartCloudStopDownload");
    var g;
    !function (e) {
        e[e.start = 1] = "start", e[e.pause = 2] = "pause", e[e.autoStart = 3] = "autoStart", e[e.autoPause = 4] = "autoPause"
    }(g || (g = {}));

    class p {
        constructor() {
            this.switch = void 0, this.panFileId = void 0, this.taskStatus = new Map, this.onTaskStatusChangedCookie = void 0, this.cloudRetrieveId = void 0
        }

        init() {
            [r.XmpEvent.onPreOpen, r.XmpEvent.onOpenSucceeded, r.XmpEvent.onPreStop, r.XmpEvent.onStop].forEach(e => {
                s.client.attachServerEvent(e, (t, ...i) => n(this, void 0, void 0, function* () {
                    do {
                        if (f.information("xmpEvent", e), !(yield c.CommonNS.isYunBo())) break;
                        let t = yield c.CommonNS.callXmp(h.XmpPlayerFunction.getCurrentMediaAttribute, h.XmpMediaAttr.PanFileId);
                        switch (e) {
                            case r.XmpEvent.onPreOpen:
                            case r.XmpEvent.onOpenSucceeded:
                                yield this.onYunBoPreOpen(t);
                                break;
                            case r.XmpEvent.onPreStop:
                            case r.XmpEvent.onStop:
                                yield this.onYunBoPreStop(t)
                        }
                    } while (0)
                }))
            })
        }

        onConfigSwitch(e, t) {
            this.switch = t, this.taskStatus.clear()
        }

        onYunBoPreOpen(e) {
            return n(this, void 0, void 0, function* () {
                f.information("onYunBoPreOpen", e);
                do {
                    if (this.panFileId === e) break;
                    if (!this.isSwitch) break;
                    this.panFileId = e, this.cloudRetrieveId || (yield this.getDownloadingTask(), yield this.stopTasks())
                } while (0)
            })
        }

        onYunBoPreStop(e) {
            return n(this, void 0, void 0, function* () {
                f.information("onYunBoPreStop");
                do {
                    if (this.panFileId !== e) break;
                    if (!this.isSwitch) break;
                    yield this.continueTasks(1e3, e)
                } while (0)
            })
        }

        onTaskStatusChanged(e, t) {
            return n(this, void 0, void 0, function* () {
                {
                    let e = null;
                    try {
                        e = JSON.parse(t)
                    } catch (e) {
                        f.error(e)
                    }
                    if (null !== e) for (let t in e) {
                        if (!this.taskStatus.has(Number(t))) continue;
                        switch (e[t]) {
                            case a.DownloadKernel.TaskStatus.Started:
                            case a.DownloadKernel.TaskStatus.StartWaiting:
                            case a.DownloadKernel.TaskStatus.StartPending:
                                this.taskStatus.delete(Number(t))
                        }
                    }
                }
            })
        }

        stopTasks() {
            return n(this, void 0, void 0, function* () {
                this.onTaskStatusChangedCookie && (s.client.detachServerEvent("OnTaskStatusChanged", this.onTaskStatusChangedCookie), this.onTaskStatusChangedCookie = void 0), this.taskStatus.forEach((e, t) => n(this, void 0, void 0, function* () {
                    yield s.client.callServerFunction("OperateTask", t, "pause")
                }));
                let e = yield s.client.callRemoteClientFunction("ThunderPanPluginWebview", "IpcAllRetrieveTaskControl", g.autoPause);
                this.cloudRetrieveId = e[0], this.onTaskStatusChangedCookie = s.client.attachServerEvent("OnTaskStatusChanged", this.onTaskStatusChanged.bind(this))
            })
        }

        getDownloadingTask() {
            return n(this, void 0, void 0, function* () {
                (yield s.client.callServerFunction("GetCategoryViewTaskList", "Downloading")).forEach(e => {
                    do {
                        let t = l.getTaskFromTaskId(e);
                        if (!t) break;
                        let i = t.getTaskBaseInfo();
                        if (!i) break;
                        if (i.isBackground) break;
                        switch (t.getTaskStatus()) {
                            case a.DownloadKernel.TaskStatus.PreDownloading:
                            case a.DownloadKernel.TaskStatus.StartWaiting:
                            case a.DownloadKernel.TaskStatus.StartPending:
                            case a.DownloadKernel.TaskStatus.Started:
                                this.taskStatus.set(e, t.getTaskStatus())
                        }
                    } while (0)
                })
            })
        }

        continueTasks(e, t) {
            return n(this, void 0, void 0, function* () {
                yield o.ThunderHelper.sleep(e), t === this.panFileId ? (this.panFileId = void 0, this.taskStatus.forEach((e, t) => n(this, void 0, void 0, function* () {
                    e === a.DownloadKernel.TaskStatus.Started && (yield s.client.callServerFunction("OperateTask", t, "continue"))
                })), this.taskStatus.forEach((e, t) => n(this, void 0, void 0, function* () {
                    e !== a.DownloadKernel.TaskStatus.Started && (yield s.client.callServerFunction("OperateTask", t, "continue"))
                })), yield s.client.callRemoteClientFunction("ThunderPanPluginWebview", "IpcAllRetrieveTaskControl", g.autoStart, this.cloudRetrieveId), this.cloudRetrieveId = void 0) : f.information("continueTasks return")
            })
        }

        get isSwitch() {
            return void 0 === this.switch && (this.switch = d.ConfigNS.getValue("ThunderPanPlugin", "StartCloudStopDownload", !0)), this.switch
        }
    }

    t.StartCloudStopDownload = p, t.default = new p
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(368), a = i(154);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(804), i(805), i(806), i(807), i(808), i(809), i(810), i(811), i(812), i(813), i(814), i(815), i(816), i(817), i(818), i(819), i(820), i(821), i(822), i(823), i(824), i(825), i(826), i(827), i(828), i(829), i(830), i(831), i(832), i(833), i(834);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\app.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(156);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-left\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(369), a = i(158);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(658);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-left\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(371), a = i(160);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-left\\login-area\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(9), o = i(42), r = i(632), s = i(0).default.getLogger("login-prompt"), l = i(17);
    let d = new r.DataHelper;
    var u;
    !function (e) {
        e.promptDataGet = "OnpromptDataGet"
    }(u = t.LoginPromptManagerEventNS || (t.LoginPromptManagerEventNS = {}));

    class c extends o.default {
        constructor() {
            super(...arguments), this.dataList = null
        }

        init() {
            return n(this, void 0, void 0, function* () {
                s.information("init---\x3e"), this.setMaxListeners(1), this.fireEvent(u.promptDataGet, !0), s.information("1 fire prompt data get event"), (yield d.init()) && d.httpLoadDataInfo((e, t) => {
                    e && (this.dataList = t, s.information("datalist len", this.dataList.length), this.fireEvent(u.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 i = this.dataList[t];
                if (!e.includes(String(i.id))) return i
            }
            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(u.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", () => n(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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(479), o = i(0).default.getLogger("login-prompt"), r = i(2), s = i(6), l = i(60);
    t.DataHelper = class extends a.HttpSession {
        constructor() {
            super(...arguments), this.dataList = [], this.adDataDir = r.resolve(__profilesDir, "LoginPrompt/")
        }

        init() {
            return n(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 = "static-xl.a.88cdn.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 i = this.parseResponse(t.body);
                    this.downLoadResource(i, e).then().catch()
                }
            }, t => {
                o.information("error", t), e(!1, null)
            }), o.information("<---httpLoadDataInfo")
        }

        downLoadResource(e, t) {
        }

        parseResponse(e) {
            if (!e) return null;
            let t = e.toString(), i = null;
            try {
                i = JSON.parse(t)
            } catch (e) {
                o.warning(e)
            }
            return o.information("jsonstr", t), o.information("resObj", i), i || null
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(23), o = i(634), r = i(42), s = i(5), l = i(637), d = i(6), u = i(2),
        c = i(0).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 = u.resolve(__profilesDir, "vipicon/"), this.iconData = null, this.iconUrl = null
        }

        get $hasCash() {
            return this.hasCash
        }

        get $iconData() {
            return this.iconData
        }

        initDataDir() {
            return n(this, void 0, void 0, function* () {
                let e = yield d.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, i;
            e = this.vipData.expireDate.substring(0, 4), t = this.vipData.expireDate.substring(4, 6), i = this.vipData.expireDate.substring(6, 8);
            let n = new Date(e + "-" + t + "-" + i + " 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((n - l) / 86400)
        }

        updateUserVipData(e) {
            return n(this, void 0, void 0, function* () {
                c.information("updateUserData---\x3e"), c.information("vipData", e), this.clear(), yield this.querySettingInfo(), this.vipData = e, null !== this.vipData ? (c.information("expirerange", this.expiredRange), c.information("userType", this.userType), c.information("cashHover", this.cashHover), yield this.queryCashInfo(), yield this.queryUserTagInfo()) : c.information("vipData is null")
            })
        }

        onLogout() {
            this.clear(), this.fireEvent(h.userTypeChanged, this.userType)
        }

        clear() {
            this.cashHover = !1, this.vipData = null, this.expiredRange = 7, this.userType = 0, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.iconUrl = null, this.iconData = null
        }

        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.client.callServerFunction("OpenNewTab", e).catch()
        }

        onIconClick() {
            if (c.information("onIconClick---\x3e"), this.openNewTab(), null === this.vipData) return void c.information("vipData is null");
            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() {
            if (c.information("onIconShow---\x3e"), null === this.vipData) return void c.information("vipData is null");
            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 n(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 && this.vipData) if (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) if (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 n(this, void 0, void 0, function* () {
                c.information("queryUserTagInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), i = yield this.getSessionID();
                c.information("userId", t), c.information("sessionId", i), this.isQueryTagsBack = !1;
                let n = yield e.queryUserTags(t, i);
                c.information("response :", n), this.checkUserType(n), this.isQueryTagsBack = !0, c.information("usertype", this.userType), this.isQueryCashBack && (this.setIconData(), this.fireEvent(h.userTypeChanged, this.userType)), c.information("<---queryUserTagInfo")
            })
        }

        queryCashInfo() {
            return n(this, void 0, void 0, function* () {
                c.information("queryCashInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), i = yield this.getSessionID();
                c.information("userId", t), c.information("sessionId", i), this.isQueryCashBack = !1;
                let n = yield e.queryCashInfo(t, i);
                c.information("response", n), c.information("this.cashHover", this.cashHover), n && 0 === n.result && n.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 n(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 n(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, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(635), o = i(636), r = i(0).default.getLogger("vip-renewicon.http-session");
    t.UserHttpSession = class extends a.HttpSession {
        querySettingInfo() {
            return n(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 i = null;
                        200 === t.statusCode && t.body && (i = o.UserHttpPackageNS.praseSettingBuffer(t.body)), e(i)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryCashInfo(e, t) {
            return n(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 i = null;
                        200 === t.statusCode && t.body && (i = o.UserHttpPackageNS.praseCashBuffer(t.body)), e(i)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryUserTags(e, t) {
            return n(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 i = null;
                        200 === t.statusCode && t.body && (i = o.UserHttpPackageNS.praseTagBuffer(t.body)), e(i)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(96);
    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 i = {hostname: this.host, port: this.port, path: this.path || "/", method: "GET"};
            this.getImpl(i, e, i => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, this.get(e, t)) : t(i)
            })
        }

        getImpl(e, t, i) {
            n.get(e, e => {
                let i = null;
                e.on("data", e => {
                    i = i ? Buffer.concat([i, e]) : e
                }), e.on("end", () => {
                    t({statusCode: e.statusCode, headers: e.headers, body: i})
                })
            }).on("error", e => {
                i(e)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0).default.getLogger("vip-renewicon.http-package");
    !function (e) {
        e.praseSettingBuffer = function (e) {
            n.information("--\x3epraseSettingBuffer");
            let t = null;
            if (e) {
                let i = e.toString();
                if (i) {
                    n.information("jsonStr :", i);
                    try {
                        let e = JSON.parse(i);
                        n.information("resobj", e);
                        let a = [];
                        for (let t = 6; t <= 14; t++) if (e[t] && e[t].url) {
                            let i = e[t];
                            i.id = t, n.information("node", i), a.push(i)
                        }
                        t = {cash_hover: Number(e.cash_hover), expired_day: Number(e.expired_day), settings: a}
                    } catch (e) {
                        n.information(e), n.information("parser json error")
                    }
                }
            }
            return n.information("<--praseSettingBuffer"), t
        }, e.praseCashBuffer = function (e) {
            n.information("--\x3epraseCashBuffer");
            let t = null;
            if (e) {
                let i = e.toString();
                if (i) {
                    n.information("jsonStr :", i);
                    try {
                        let e = JSON.parse(i);
                        t = {
                            result: Number(e.result),
                            msg: e.msg,
                            totalnum: Number(e.data.total_num),
                            expirenum: Number(e.data.expire_num)
                        }
                    } catch (e) {
                        n.information("parser json error")
                    }
                }
            }
            return n.information("<--praseCashBuffer"), t
        }, e.praseTagBuffer = function (e) {
            n.information("--\x3epraseTagBuffer");
            let t = null;
            if (e) {
                let i = e.toString();
                if (i) {
                    n.information("jsonStr :", i);
                    try {
                        let e = JSON.parse(i);
                        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) {
                        n.information("parser json error")
                    }
                }
            }
            return n.information("<--praseTagBuffer"), t
        }
    }(t.UserHttpPackageNS || (t.UserHttpPackageNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(5), a = i(0).default.getLogger("vip-renewicon.stat-utilities");
    !function (e) {
        e.trackEvent = function (e, t) {
            let i = (t = t || {}).attribute1 || "", o = t.attribute2 || "", r = function (e) {
                let t = "";
                return e.forEach((e, i) => {
                    "" !== t && (t += ","), t = t + i + "=" + e
                }), t
            }(t.extData || new Map);
            a.information("key : ", e), a.information("attribute1 : ", i), a.information("attribute2 ：", o), a.information("extData ： ", r), r = encodeURIComponent(r), n.client.callServerFunction("TrackEvent", e, i, o, 0, 0, 0, 0, r).catch()
        }
    }(t.StatUtilitiesNS || (t.StatUtilitiesNS = {}))
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(162);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-left\\system-buttons-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(373), a = i(164);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(643);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-left\\system-buttons.vue", t.default = s.exports
}, function (e, t) {
    e.exports = "../imgs/thunderPan--code.png"
}, function (e, t, i) {
    "use strict";
    var n = i(882);
    i.n(n).a
}, function (e, t, i) {
    e.exports = i(58)(210)
}, function (e, t, i) {
    e.exports = i(58)(189)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(71), o = i(137), r = i(56), s = i(2), l = i(0), d = i(7), u = i(4), c = i(77), h = i(37), f = i(35),
        g = i(5), p = i(89), v = i(9), m = i(11), y = l.default.getLogger("Thunder.MainRenderer.stroe.Tabs"),
        k = d.default(s.join(__rootDir, "../bin/ThunderHelper.node")), T = p.TabEventManagerNS.getEventEmitter();
    let w = p.createXDASTab({title: "推荐", showUrl: !1, name: "recommend", pinned: !0});
    u.isNullOrUndefined(w) && y.warning(w);
    let C = 1,
        S = ["http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", "http://pc.xunlei.com/pages/#/new-tab"];
    const I = {
        tabs: [{title: w.getTitle(), tab: w, pinned: w.getPinned(), key: C++}],
        current: 0,
        curBrowserWndHandle: 0,
        hideTabs: []
    };

    function b(e, t, i) {
        return n(this, void 0, void 0, function* () {
            do {
                if (y.information("Remove_TAb_CTRL param:", i), u.isNullOrUndefined(i) || u.isNullOrUndefined(i.index) || u.isNullOrUndefined(i.tabInfo) || u.isNullOrUndefined(i.tabInfo.tab)) {
                    y.warning(i);
                    break
                }
                t.tabs.splice(i.index, 1), "设置中心" === i.tabInfo.title && v.ConfigNS.save().catch();
                let a = i.tabInfo.tab.getBrowser();
                if (a) {
                    let e = a.getWindowHandle();
                    k.isWindowHandle(e) && (y.information("doRemoveTabCtrl hide page"), k.showWindow(e, r.CmdShow.SW_HIDE))
                }
                t.current === i.index && i.index > 0 ? e.commit("UPDATE_CURRENT", i.index - 1) : t.current > i.index && e.commit("UPDATE_CURRENT", t.current - 1);
                let s = t.tabs[t.current];
                (u.isNullOrUndefined(s) || u.isNullOrUndefined(s.tab)) && y.warning(s);
                let l = s.tab.getBrowser();
                if (1 === t.tabs.length && setTimeout(() => n(this, void 0, void 0, function* () {
                    let e = yield m.asyncRemoteCall.getCurrentWindow();
                    yield f.ToolsUtilitiesAWNS.setForegroundWindow(k, e)
                }), 100), u.isNullOrUndefined(l)) {
                    T.emit(p.TabEventManagerNS.EventType.RemoveTab, i);
                    break
                }
                let d = l.getWindowHandle();
                if (!1 === k.isWindowHandle(d)) {
                    y.warning(d), T.emit(p.TabEventManagerNS.EventType.RemoveTab, i);
                    break
                }
                let c = t.tabs[t.current].tab;
                c.isErrorPage || c.isLoadingPage ? (y.information("doRemoveTabCtrl hide error page"), k.showWindow(d, r.CmdShow.SW_HIDE)) : "find-page" === e.getters.currentNav && i.tabInfo && !i.tabInfo.tab.hideUI && (y.information("[tbc] doRemoveTabCtrl showWindow", d), k.showWindow(d, r.CmdShow.SW_SHOW), o.BrowserSupportNS.resizeBrowserWindow(d).catch()), 0 !== t.curBrowserWndHandle && t.curBrowserWndHandle !== d && (y.information("doRemoveTabCtrl hide other page"), k.showWindow(t.curBrowserWndHandle, r.CmdShow.SW_HIDE)), k.setWindowFocus(d, !0), t.curBrowserWndHandle = d, T.emit(p.TabEventManagerNS.EventType.RemoveTab, i)
            } while (0)
        })
    }

    function _(e, t) {
        let i = null, n = null;
        for (let a = 0; a < e.length; ++a) n = e[a].tab.getBrowser(), u.isNullOrUndefined(n) || t === n && (i = e[a]);
        return i
    }

    function D(e, t, i) {
        return n(this, void 0, void 0, function* () {
            y.information("[tbc] doCreateNewTab createTabParam", i);
            let e = yield p.createNewTab(i.tabType, i.tabParam);
            y.information("[tbc] newTab", e), u.isNullOrUndefined(e) ? y.warning(e) : (i.tabType === a.TabType.XDAS && (k.isWindowHandle(t.curBrowserWndHandle) && (y.information("doCreateNewTab hide page"), k.showWindow(t.curBrowserWndHandle, r.CmdShow.SW_HIDE)), t.curBrowserWndHandle = 0), T.emit(p.TabEventManagerNS.EventType.CreateNewTab, e, i))
        })
    }

    function A(e, t, i) {
        return n(this, void 0, void 0, function* () {
            let t = i.tabInfo;
            e.commit("UPDATE_CURRENT", i.index), T.emit(p.TabEventManagerNS.EventType.SelectTab, i.index, t);
            let n = t.tab.getBrowser();
            u.isNullOrUndefined(n) || n.on("init-done", () => {
                e.commit("ON_BROWSER_CREATE", i)
            })
        })
    }

    const N = {
        SHOW_OR_HIDE_BROWSER(e, t) {
            do {
                if (u.isNullOrUndefined(t)) break;
                if (t) {
                    let t = e.tabs[e.current];
                    if (u.isNullOrUndefined(t)) break;
                    let i = t.tab;
                    if (u.isNullOrUndefined(i)) break;
                    if (i.getTabType() === a.TabType.Chromium) {
                        let t = i.getBrowser();
                        if (u.isNullOrUndefined(t)) break;
                        let n = t.getWindowHandle();
                        if (!1 === k.isWindowHandle(n)) {
                            y.warning(n);
                            break
                        }
                        let a = e.tabs[e.current].tab;
                        a.isErrorPage || a.isLoadingPage || o.BrowserSupportNS.resizeBrowserWindow(n).catch(), k.isWindowHandle(n) && (i.isErrorPage ? (y.information("SHOW_OR_HIDE_BROWSER hide page"), k.showWindow(n, r.CmdShow.SW_HIDE), t.refresh()) : i.isLoadingPage ? (y.information("SHOW_OR_HIDE_BROWSER hide page"), k.showWindow(n, r.CmdShow.SW_HIDE)) : (y.information("SHOW_OR_HIDE_BROWSER show page"), k.showWindow(n, r.CmdShow.SW_SHOW), k.setWindowFocus(n, !0)))
                    }
                } else y.information("SHOW_OR_HIDE_BROWSER hide page"), k.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE)
            } while (0)
        }, CREATE_NEW_TAB(e, t) {
            {
                y.information("[tbc] CREATE_NEW_TAB", t), t.tabType !== a.TabType.Chromium || t.tabParam.hideUI || (y.information("[tbc] SELECT_NAV", "find-page"), this.commit("SELECT_NAV", "find-page", {root: !0})), t.tabType !== a.TabType.Chromium || t.tabParam.hideUI || (t.tabParam.rect = {
                    x: 0,
                    y: 0,
                    width: 0,
                    height: 0
                });
                let i = -1, n = e.tabs.concat(e.hideTabs);
                t.tabParam.name && (i = n.findIndex(e => e.tab.name === t.tabParam.name)), y.information("[tbc] CREATE_NEW_TAB tabIndex", i), -1 !== i ? (n[i].tab.hideUI || this.commit("SELECT_TAB", i), t.tabParam.url && n[i].tab.navigate(t.tabParam.url)) : D(0, e, t).catch()
            }
        }, SELECT_TAB(e, t) {
            y.information("SELECT_TAB index: " + t);
            do {
                if (u.isNullOrUndefined(t)) break;
                if (t < 0) break;
                if (t >= e.tabs.length) break;
                let i = e.tabs[t];
                if (u.isNullOrUndefined(i)) break;
                let n = {tabInfo: i, index: t}, s = n.tabInfo.tab;
                if (u.isNullOrUndefined(s)) break;
                if (s.getTabType() === a.TabType.Chromium) {
                    let t = s.getBrowser();
                    if (u.isNullOrUndefined(t)) {
                        A(this, 0, n).catch();
                        break
                    }
                    let i = t.getWindowHandle();
                    if (!1 === k.isWindowHandle(i)) {
                        y.warning(i);
                        break
                    }
                    if (y.information("SELECT_TAB hwnd: " + i + " curBrowserWndHandle: " + e.curBrowserWndHandle), i === e.curBrowserWndHandle) break;
                    let a = e.tabs[n.index].tab;
                    a.isErrorPage || a.isLoadingPage || o.BrowserSupportNS.resizeBrowserWindow(i).catch(), k.isWindowHandle(i) && (s.isErrorPage ? (y.information("SELECT_TAB hide page: isErrorPage"), k.showWindow(i, r.CmdShow.SW_HIDE), t.refresh()) : s.isLoadingPage ? (y.information("SELECT_TAB hide page: isLoadingPage"), k.showWindow(i, r.CmdShow.SW_HIDE)) : "find-page" === this.getters.currentNav && (y.information("SELECT_TAB show page"), k.showWindow(i, r.CmdShow.SW_SHOW), k.setWindowFocus(i, !0))), k.isWindowHandle(e.curBrowserWndHandle) && (y.information("SELECT_TAB hide page: isWindowHandle(curBrowserWndHandle)"), k.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE)), e.curBrowserWndHandle = i
                } else s.getTabType() === a.TabType.IE ? y.information("ie") : s.getTabType() === a.TabType.XDAS && (k.isWindowHandle(e.curBrowserWndHandle) && (y.information("SELECT_TAB hide page: isWindowHandle(curBrowserWndHandle)2"), k.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE)), e.curBrowserWndHandle = 0);
                this.commit("UPDATE_CURRENT", n.index), T.emit(p.TabEventManagerNS.EventType.SelectTab, t, s)
            } while (0)
        }, ON_BIND_WND_HANDLE(e, t) {
            y.information("ON_BIND_WND_HANDLE");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.hwnd)) {
                    y.warning(t);
                    break
                }
                if (!1 === k.isWindowHandle(t.hwnd)) {
                    y.warning(t.hwnd);
                    break
                }
                if (t.browser) {
                    let i = _(e.hideTabs, t.browser);
                    if (i && i.tab && i.tab.hideUI) {
                        y.information("ON_BIND_WND_HANDLE hide page"), k.showWindow(t.hwnd, r.CmdShow.SW_HIDE);
                        break
                    }
                }
                let i = e.tabs[e.current].tab;
                if (!i) break;
                if (i.getTabType() === a.TabType.XDAS) {
                    y.information("ON_BIND_WND_HANDLE hide page"), k.showWindow(t.hwnd, r.CmdShow.SW_HIDE);
                    break
                }
                if (i.getTabType() === a.TabType.Chromium) {
                    let e = i.getBrowser();
                    if (e && e !== t.browser) {
                        y.information("ON_BIND_WND_HANDLE hide page"), k.showWindow(t.hwnd, r.CmdShow.SW_HIDE);
                        break
                    }
                }
                if (e.curBrowserWndHandle === t.hwnd) break;
                if (k.isWindowHandle(t.hwnd) && !k.isWindowVisible(t.hwnd)) break;
                let n = e.tabs[e.current].tab;
                n.isErrorPage || n.isLoadingPage ? (y.information("ON_BIND_WND_HANDLE hide page"), k.showWindow(t.hwnd, r.CmdShow.SW_HIDE)) : (o.BrowserSupportNS.resizeBrowserWindow(t.hwnd).catch(), "find-page" !== this.getters.currentNav ? (y.information("ON_BIND_WND_HANDLE hide page"), k.showWindow(t.hwnd, r.CmdShow.SW_HIDE)) : (y.information("ON_BIND_WND_HANDLE show page"), k.showWindow(t.hwnd, r.CmdShow.SW_SHOW))), k.isWindowHandle(e.curBrowserWndHandle) && (y.information("ON_BIND_WND_HANDLE hide page"), k.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE)), e.curBrowserWndHandle = t.hwnd
            } while (0)
        }, ON_NEW_TAB_CREATE(e, t) {
            let i = t.newTab, n = t.createTabParam, a = "index" in n.tabParam ? n.tabParam.index : e.current + 1;
            if (!i.getPinned()) {
                let t = 0;
                for (let i = 0; i < e.tabs.length; ++i) {
                    if (!e.tabs[i].tab.getPinned()) break;
                    t++
                }
                a < t && (a = t)
            }
            if (n.tabParam.hideUI) e.hideTabs.splice(0, 0, {
                title: i.getTitle(),
                tab: i,
                pinned: i.getPinned(),
                key: C++
            }); else {
                e.tabs.splice(a, 0, {
                    title: i.getTitle(),
                    tab: i,
                    pinned: i.getPinned(),
                    key: C++
                }), !1 !== n.tabParam.visible && this.commit("UPDATE_CURRENT", a), T.emit(p.TabEventManagerNS.EventType.AddTab, n)
            }
        }, ON_NEW_BROWSER_POPUP(e, t) {
            let i = e.current + 1;
            e.tabs.splice(i, 0, {
                title: t.getTitle(),
                tab: t,
                pinned: t.getPinned(),
                key: C++
            }), this.commit("UPDATE_CURRENT", i), T.emit(p.TabEventManagerNS.EventType.AddTab)
        }, ON_NEW_BROWSER_POPUP_COMPLETED(e, t) {
            y.information("ON_NEW_BROWSER_POPUP_COMPLETED");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) break
                }
            } while (0)
        }, ON_TITLE_CHANGE(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser) || u.isNullOrUndefined(t.title)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.title = t.title, i.tab.setTitle(t.title);
                        break
                    }
                }
            } while (0)
        }, ON_FAV_ICON_GET(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser) || u.isNullOrUndefined(t.iconUrl)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.tab.setIconUrl(t.iconUrl);
                        break
                    }
                }
            } while (0)
        }, ON_ORIGINAL_URL_CHANGE(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser) || u.isNullOrUndefined(t.originalUrl)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.tab.originalUrl = t.originalUrl;
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_START(e, t) {
            return n(this, void 0, void 0, function* () {
                y.information("ON_LOAD_START");
                do {
                    if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                        y.warning(t);
                        break
                    }
                    for (let i of e.tabs) {
                        if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                        let n = i.tab.getBrowser();
                        if (!u.isNullOrUndefined(n) && (n === t.browser && !0 === t.isMainFrame)) {
                            if (i.tab.state = "loading", i.tab.isErrorPage = !1, i.tab.isLoadingPage = !1, i.tab === e.tabs[e.current].tab) {
                                let a = yield g.client.callServerFunction("IsSettingCenterOpened");
                                y.information("ON_LOAD_START current tab", i, t);
                                let s = n.getWindowHandle();
                                k.isWindowHandle(s) && (o.BrowserSupportNS.resizeBrowserWindow(s).catch(), "find-page" !== this.getters.currentNav || a ? (y.information("ON_LOAD_START hide page"), k.showWindow(s, r.CmdShow.SW_HIDE)) : (y.information("ON_LOAD_START show page"), k.showWindow(s, r.CmdShow.SW_SHOW)), e.curBrowserWndHandle = s)
                            }
                            break
                        }
                    }
                } while (0)
            })
        }, ON_LOAD_END(e, t) {
            y.information("ON_LOAD_END");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame)) {
                        "error" !== i.tab.state && (i.tab.state = "loaded", i.tab.isErrorPage = !1);
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_STATUS_CHANGE(e, t) {
            y.information("ON_LOAD_STATUS_CHANGE");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.tab.canGoBack = t.canGoBack, i.tab.canGoForward = t.canGoForward, t.isLoading && (i.tab.isErrorPage = !1);
                        break
                    }
                }
            } while (0)
        }, ON_ADDRESS_CHANGE(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame)) {
                        i.tab.url = t.url, i.tab.setCurUrl(t.url), "community" !== i.tab.name && (S.includes(t.url) ? i.tab.setShowUrl(!1) : i.tab.setShowUrl(!0));
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_ERROR(e, t) {
            y.warning("ON_LOAD_ERROR ", t.errorCode);
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame && (-105 === t.err || -21 === t.err || -106 === t.err || -118 === t.err || -7 === t.err || -101 === t.err))) {
                        i.tab.state = "error", i.tab.url = t.failedUrl, i.tab.isErrorPage = !0, i.tab.isLoadingPage = !1;
                        let n = e.getWindowHandle();
                        if (0 === n) break;
                        y.warning("ON_LOAD_ERROR HIDE hwnd: ", n), k.isWindowHandle(n) && (y.information("ON_LOAD_ERROR hide page"), k.showWindow(n, r.CmdShow.SW_HIDE));
                        break
                    }
                }
            } while (0)
        }, ON_APP_QUIT(e) {
            y.information(e);
            for (let t of e.tabs) u.isNullOrUndefined(t) || u.isNullOrUndefined(t.tab) || t.tab.getTabType() === a.TabType.Chromium && t.tab.destroyBrowser(!0)
        }, REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(e.tabs[0]) || u.isNullOrUndefined(e.tabs[0].tab)) break;
                let i = e.tabs[0].tab.registerNativeFunction(t.functionName, t.nativeFunc);
                !1 === i && y.warning(i)
            } while (0)
        }, UN_REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(e.tabs) || u.isNullOrUndefined(e.tabs[0].tab)) break
            } while (0);
            e.tabs[0].tab.unregisterNativeFunction(t)
        }, CLOSE_TAB(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.index) || u.isNullOrUndefined(t.tabInfo) || u.isNullOrUndefined(t.tabInfo.tab)) {
                    y.warning(t);
                    break
                }
                let i = t.tabInfo.tab;
                if (i.getTabType() === a.TabType.Chromium) {
                    i.destroyBrowser(!0) || b(this, e, t).catch()
                } else b(this, e, t).catch()
            } while (0)
        }, CLOSE_TAB_BY_NAME(e, t) {
            do {
                if (u.isNullOrUndefined(t)) {
                    y.warning(t);
                    break
                }
                let i = -1;
                for (let n = 0; n < e.tabs.length; n++) if (t === e.tabs[n].tab.name) {
                    i = n;
                    break
                }
                if (-1 !== i) {
                    let t = e.tabs[i].tab, n = t.getTabType(), o = {tabInfo: e.tabs[i], index: i};
                    if (n === a.TabType.Chromium) {
                        t.destroyBrowser(!0) || b(this, e, o).catch()
                    } else b(this, e, o).catch()
                } else {
                    i = -1;
                    for (let n = 0; n < e.hideTabs.length; n++) if (t === e.hideTabs[n].tab.name) {
                        i = n;
                        break
                    }
                    if (-1 === i) break;
                    let n = e.hideTabs[i].tab;
                    n.getTabType() === a.TabType.Chromium && n.destroyBrowser(!0), e.hideTabs.splice(i, 1)
                }
            } while (0)
        }, Remove_TAb_CTRL(e, t) {
            b(this, e, t).catch()
        }, ON_CHROMIUM_CALL_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.functionName) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        !1 === i.tab.onJsCallNativeFunction(0, t.functionName, t.callBackId, t.args) && y.warning("ON_CHROMIUM_CALL_NATIVE_FUNCTION failed", t)
                    }
                }
            } while (0)
        }, ON_CHROMIUM_CHECK_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.functionName) || u.isNullOrUndefined(t.browser)) {
                    y.warning(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        !1 === i.tab.onJsCheckNativeFunction(0, t.functionName, t.callBackId) && y.warning(t)
                    }
                }
            } while (0)
        }, ON_BROWSER_CREATE(e, t) {
            do {
                if (!t || !t.tabInfo) break;
                let i = t.tabInfo.tab;
                if (!i) break;
                if (e.tabs[e.current].tab !== i) break;
                let n = i.getBrowser();
                if (!n) break;
                let a = n.getWindowHandle();
                if (!1 === k.isWindowHandle(a)) {
                    y.warning(a);
                    break
                }
                k.isWindowHandle(a) && (i.isErrorPage ? (y.information("ON_BROWSER_CREATE hide page"), k.showWindow(a, r.CmdShow.SW_HIDE), n.refresh()) : "find-page" === this.getters.currentNav && (y.information("ON_BROWSER_CREATE show page"), k.showWindow(a, r.CmdShow.SW_SHOW), k.setWindowFocus(a, !0))), k.isWindowHandle(e.curBrowserWndHandle) && (y.information("ON_BROWSER_CREATE hide page"), k.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE)), e.curBrowserWndHandle = a;
                let s = e.tabs[e.current].tab;
                s.isErrorPage || s.isLoadingPage || o.BrowserSupportNS.resizeBrowserWindow(e.curBrowserWndHandle).catch()
            } while (0)
        }, UPDATE_TAB_TITLE(e, t) {
            do {
                if (!t || !t.title || void 0 === t.index) break;
                let i = e.tabs[t.index];
                if (!i) break;
                i.title = t.title, i.tab.setTitle(t.title)
            } while (0)
        }, UPDATE_CURRENT(e, t) {
            let i = e.current;
            t >= e.tabs.length || (e.current = t, i !== e.current && (p.setCurrentTabID(e.current), T.emit(p.TabEventManagerNS.EventType.ChangeTab, e.current, e.tabs[e.current])))
        }, UPDATE_TABS(e, t) {
            e.tabs = t
        }
    }, x = {
        selectTab({commit: e}, t) {
            e("SELECT_TAB", t)
        }, closeTab({commit: e}, t) {
            e("CLOSE_TAB", t)
        }, closeTabByName({commit: e}, t) {
            e("CLOSE_TAB_BY_NAME", 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 n(this, void 0, void 0, function* () {
                y.information("ON_NEW_BROWSER_POPUP");
                do {
                    if (u.isNullOrUndefined(t)) {
                        y.warning(t);
                        break
                    }
                    if (yield c.URLHelperNS.isCustomProtocol(t.url)) {
                        let e = "";
                        do {
                            if (!t.extData) break;
                            let i = null;
                            try {
                                i = JSON.parse(t.extData)
                            } catch (e) {
                            }
                            i && i.search_from && (e = i.search_from)
                        } while (0);
                        h.ThunderNewTask.createTaskByUrl(t.url, {
                            searchFrom: e,
                            referer: t.refUrl,
                            browser: "xlbrowser.exe"
                        });
                        break
                    }
                    let i = {isFromPopup: !0, url: t.url, extData: t.extData}, n = a.TabType.Chromium,
                        o = yield p.createNewTab(n, i, t.ev);
                    if (u.isNullOrUndefined(o)) {
                        y.warning(o);
                        break
                    }
                    e("ON_NEW_BROWSER_POPUP", o)
                } while (0)
            })
        }, onCreateNewTab({commit: e}, t) {
            e("ON_NEW_TAB_CREATE", t)
        }
    }, E = {
        currentTab: e => {
            let t = null;
            do {
                if (u.isNullOrUndefined(e) || u.isNullOrUndefined(e.current) || u.isNullOrUndefined(e.tabs)) {
                    y.warning(e);
                    break
                }
                let i = e.tabs[e.current];
                if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) break;
                t = i
            } while (0);
            return t
        }, allTabs: e => e.tabs.concat(e.hideTabs)
    };
    t.default = {state: I, mutations: N, actions: x, getters: E}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(9), a = i(353), o = i(117), r = i(0).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 i = 0;
                i = 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(i, 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 i = `${t.section}-${t.key}`;
            void 0 === e.formData[i] && o.default.set(e.formData, i, t)
        }, ADD_SELECT_ITEM(e, t) {
            let i = e.formData[t.target];
            r.information("targetItem", i), i.selectItems.includes(t.from) || (i.selectItems.push(t.from), o.default.set(e.formData[t.target], "selectItems", i.selectItems))
        }, SET_CONFIG_VALUE(e, t) {
            if (void 0 !== e.formData[t.name].optionToValue) {
                let i = t.value;
                n.ConfigNS.setValue(t.section, `${t.key}`, e.formData[t.name].optionToValue[i]), "" !== t.userId && n.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e.formData[t.name].optionToValue[i])
            } else if (e.formData[t.name].type && "number" === e.formData[t.name].type) {
                let e = Number(t.value);
                n.ConfigNS.setValue(t.section, `${t.key}`, e), "" !== t.userId && n.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e)
            } else n.ConfigNS.setValue(t.section, `${t.key}`, t.value), "" !== t.userId && n.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, t.value);
            void 0 !== e.formData[t.name].immediatelySave && n.ConfigNS.saveSync(), function (e, t) {
                let i = e.formData[t.name];
                void 0 !== i.selectItems && i.selectItems.map(i => {
                    let a = t.value;
                    e.formData[i].type && "number" === e.formData[i].type && (a = Number(t.value)), n.ConfigNS.setValue(e.formData[i].section, e.formData[i].key, a)
                });
                if (void 0 !== i.selectAllName) {
                    let i = e.formData[t.name].selectAllName, a = e.formData[i];
                    if (t.value) {
                        let t = !0;
                        a.selectItems.map(i => {
                            t = n.ConfigNS.getValue(e.formData[i].section, e.formData[i].key, !1) && t
                        }), t && n.ConfigNS.setValue(a.section, a.key, !0)
                    } else {
                        let e = n.ConfigNS.getValue(a.section, a.key, "");
                        e && n.ConfigNS.setValue(a.section, a.key, !1)
                    }
                }
            }(e, t)
        }, SET_FOMR_DATA(e, t) {
            let i = `${t.section}-${t.key}`;
            if (void 0 === e.formData[i]) return;
            let n = t.value;
            if (void 0 !== e.formData[i] && void 0 !== e.formData[i].optionToValue) {
                let a = e.formData[i];
                for (let e in a.optionToValue) if (a.optionToValue[e] === t.value) {
                    n = e;
                    break
                }
            } else void 0 !== e.formData[`${t.section}-${t.key}`] && (n = t.value);
            e.formData[`${t.section}-${t.key}`].value = n
        }
    }, l = {
        initSettingData({commit: e}) {
            a.SettingInit.setBaseConf();
            let t = null;
            a.SettingInit.getConfSchemaEx().then(i => {
                (i => {
                    let n = a.SettingInit.getConfFormData();
                    try {
                        t = JSON.parse(JSON.stringify(i))
                    } catch (e) {
                    }
                    null === t && (t = a.SettingInit.getConfSchema()), e("SET_CONF_SCHEMA", t), e("SET_CONFIG_DATA", n)
                })(i)
            }).catch()
        }
    };
    t.default = {state: {confSchema: [], formData: {}}, mutations: s, actions: l}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(8), a = i(0), o = i(3), r = i(15), s = i(40), l = i(26), d = i(12), u = i(29), c = i(121),
        h = a.default.getLogger("DownloadStore"), f = d.DownloadKernelTaskManager.getTaskManager(),
        g = r.DownloadKernelEventManager.getEventManager(),
        p = s.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        v = l.DownloadKernelCategoryManager.getCategoryManager(), m = {
            currentCategoryId: -1,
            currentPrivateCategoryId: Number.MIN_VALUE,
            currentCategoryViewId: window.__xadsSkeletonCompletedActive ? o.DownloadKernel.CategroyViewID.Completed : 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: []}]
        }, y = {
            UNINIT_PAN_CATEGORY_TASKLIST(e) {
                let t = e.taskList;
                for (let e = 0; e < t.length; e++) {
                    let i = t[e], n = [...Object.values(i.tasksMap)];
                    i.tasksMap = {}, (n = n.filter(e => (-1 === e.categoryId && (i.tasksMap[e.taskId] = e), -1 === e.categoryId))).sort(c.SortNS.getSortFuncByConfig(i.id, i.categoryId)), i.taskIds = n.map(e => e.taskId), i.selected = i.selected.filter(e => i.tasksMap[e])
                }
            }, INIT_PAN_CATEGORY_TASKLIST(e, t) {
                h.information("INIT_Pan_CATEGORY_TASKLIST categoryId:", t);
                let i = e.taskList;
                for (let n = 0; n < i.length; n++) {
                    let a = i[n], o = v.getCategoryView(t, a.id);
                    if (!o) continue;
                    let r = o.getTasks(), s = {};
                    for (let [e, t] of r) s[e] = t.getTaskBaseInfo();
                    Object.assign(s, e.taskList[n].tasksMap);
                    let l = [...Object.values(s)];
                    l.sort(c.SortNS.getSortFuncByConfig(a.id, a.categoryId)), i[n].tasksMap = {}, i[n].tasksMap = Object.assign({}, s), i[n].taskIds = l.map(e => e.taskId)
                }
                h.information("INIT_Pan_CATEGORY_TASKLIST end")
            }, INIT_CATEGORY_TASKLIST(e) {
                h.information("INIT_CATEGORY_TASKLIST state.currentCategoryId:", e.currentCategoryId);
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let i = 0; i < t.length; i++) {
                    let n = t[i], a = null;
                    if (!(a = -1 === e.currentCategoryId ? p.getCategoryViewFromId(n.id) : v.getCategoryView(e.currentCategoryId, n.id))) {
                        n.tasksMap = null, n.selected = [], n.taskIds = [], n.tasksMap = {};
                        continue
                    }
                    let o = a.getTasks();
                    t[i].tasksMap = null, t[i].tasksMap = {}, t[i].selected = [], t[i].categoryId = e.currentCategoryId;
                    let r = {};
                    for (let [e, t] of o) r[e] = t.getTaskBaseInfo();
                    let s = [...Object.values(r)];
                    s.sort(c.SortNS.getSortFuncByConfig(n.id, n.categoryId)), t[i].tasksMap = Object.assign({}, r), t[i].taskIds = s.map(e => e.taskId)
                }
                h.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 i = [...Object.values(t[e].tasksMap)];
                    i.sort(c.SortNS.getSortFuncByConfig(t[e].id, t[e].categoryId)), t[e].taskIds = i.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 i = [...Object.values(e.taskList[t.index].tasksMap)];
                        i.sort(t.compareFn), e.taskList[t.index].taskIds = i.map(e => e.taskId)
                    } else {
                        let i = [...Object.values(e.taskListPrivate[t.index].tasksMap)];
                        i.sort(t.compareFn), e.taskListPrivate[t.index].taskIds = i.map(e => e.taskId)
                    }
                } while (0)
            }, UPDATE_CATEGORYVIEW(e, t) {
                e.currentCategoryViewId !== t && (e.currentCategoryViewId = t, u.default.setCurrentCategoryView(t))
            }, INSERT_TO_CATEGORY_VIEW(e, t) {
                h.information("insert INSERT_TO_CATEGORY_VIEW in ");
                let i = e.taskList;
                -1 !== t.categoryId && v.isPrivateCategory(t.categoryId) && (i = e.taskListPrivate);
                for (let e = 0; e < i.length; e++) if (i[e].id === t.id) {
                    let n = [], a = {};
                    for (let e of t.tasks) a[e.taskId] = Object.assign({}, e), n.push(e.taskId);
                    i[e].tasksMap = Object.assign({}, i[e].tasksMap, a), n.length > 0 && i[e].taskIds.splice(0, 0, ...n);
                    break
                }
                h.information("insert INSERT_TO_CATEGORY_VIEW end ")
            }, REMOVE_FROM_CATEGORY_VIEW(e, t) {
                let i = e.taskList;
                -1 !== t.categoryId && v.isPrivateCategory(t.categoryId) && (i = e.taskListPrivate);
                for (let e = 0; e < i.length; e++) if (i[e].id === t.categoryViewId) {
                    let n = Object.assign({}, i[e].tasksMap), a = Object.assign([], i[e].taskIds),
                        o = Object.assign([], i[e].selected);
                    for (let e of t.tasks) {
                        let t = e.taskId;
                        delete n[t];
                        let i = a.indexOf(t);
                        -1 !== i && a.splice(i, 1);
                        let r = o.indexOf(t);
                        -1 !== r && o.splice(r, 1)
                    }
                    i[e].tasksMap = n, i[e].taskIds = a, i[e].selected = o;
                    break
                }
            }, UPDATE_TASK_INFO(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    for (let i of t) {
                        let t = 0;
                        e.taskList[t].tasksMap.hasOwnProperty(String(i.taskId)) ? Object.assign(e.taskList[t].tasksMap[i.taskId], i) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(i.taskId)) ? Object.assign(e.taskListPrivate[t].tasksMap[i.taskId], i) : (t = 1, e.taskList[t].tasksMap.hasOwnProperty(String(i.taskId)) ? (h.information("update task info not find in downloading", i), Object.assign(e.taskList[t].tasksMap[i.taskId], i)) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(i.taskId)) ? Object.assign(e.taskListPrivate[t].tasksMap[i.taskId], i) : (t = 2, e.taskList[t].tasksMap.hasOwnProperty(String(i.taskId)) && (h.information("update task info not find in downloading & complete", i), Object.assign(e.taskList[t].tasksMap[i.taskId], i))))
                    }
                } while (0)
            }, UPDATE_TASK_READED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_RENAME(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].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 i = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (i = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_MOVED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (i = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_STATUS(e, t) {
                do {
                    if (!t || 0 === t.length) break;
                    h.information("update status in", t.length, t[0].taskStatus, t[0].taskId);
                    let i = 0, n = {}, a = void 0, o = t[0];
                    if (e.taskList[i].tasksMap.hasOwnProperty(String(o.taskId)) ? a = !1 : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(o.taskId)) && (a = !0), void 0 === a) break;
                    for (let e of t) n[e.taskId] = e;
                    h.information("update status "), a ? e.taskListPrivate[i].tasksMap = Object.assign({}, e.taskListPrivate[i].tasksMap, n) : e.taskList[i].tasksMap = Object.assign({}, e.taskList[i].tasksMap, n), h.information("update status end")
                } while (0)
            }, 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 i = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[0].taskIds);
                    let n = [];
                    for (let e of t) {
                        let t = i.indexOf(e);
                        -1 !== t && n.push(t)
                    }
                    n.sort((e, t) => e - t);
                    let a = [];
                    for (let e = n.length - 1; e >= 0; e--) a.unshift(i.splice(n[e], 1)[0]);
                    i.splice(0, 0, ...a)
                } while (0)
            }, MOVE_TO_BOTTOM(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[0].taskIds);
                    let n = [];
                    for (let e of t) {
                        let t = i.indexOf(e);
                        -1 !== t && n.push(t)
                    }
                    n.sort((e, t) => e - t);
                    let a = [];
                    for (let e = n.length - 1; e >= 0; e--) a.unshift(i.splice(n[e], 1)[0]);
                    i.splice(i.length, 0, ...a)
                } while (0)
            }, SELECT_PRE(e) {
                let t = null, i = [], n = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? 1 === e.taskList[0].selected.length && (t = e.taskList[0], n = e.taskList[0].taskIds, i = e.taskList[0].selected) : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0], i = e.taskListPrivate[0].selected, n = e.taskListPrivate[0].taskIds) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? (t = e.taskList[1], n = e.taskList[1].taskIds, i = e.taskList[1].selected) : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1], n = e.taskListPrivate[1].taskIds, i = e.taskListPrivate[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2], n = e.taskList[2].taskIds, i = e.taskList[2].selected), 1 === i.length) {
                    let e = i[0], a = n.indexOf(e);
                    -1 !== a && 0 !== a && (t.selected = [n[a - 1]])
                }
            }, SELECT_NEXT(e) {
                let t = null, i = [], n = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? 1 === e.taskList[0].selected.length && (t = e.taskList[0], n = e.taskList[0].taskIds, i = e.taskList[0].selected) : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0], i = e.taskListPrivate[0].selected, n = e.taskListPrivate[0].taskIds) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? (t = e.taskList[1], n = e.taskList[1].taskIds, i = e.taskList[1].selected) : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1], n = e.taskListPrivate[1].taskIds, i = e.taskListPrivate[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2], n = e.taskList[2].taskIds, i = e.taskList[2].selected), 1 === i.length) {
                    let e = i[0], a = n.indexOf(e);
                    -1 !== a && a !== n.length - 1 && (t.selected = [n[a + 1]])
                }
            }, UPDATE_CATEGORY(e, t) {
                if (e.currentCategoryId !== t) {
                    if (e.currentCategoryId = t, -1 !== t && e.currentPrivateCategoryId !== t) {
                        e.currentPrivateCategoryId = t;
                        for (let i = 0; i < e.taskListPrivate.length; i++) e.taskListPrivate[i].categoryId = t, e.taskListPrivate[i].tasksMap = null, e.taskListPrivate[i].tasksMap = {}, e.taskListPrivate[i].taskIds = [], e.taskListPrivate[i].selected = [];
                        this.commit("INIT_CATEGORY_TASKLIST")
                    }
                    u.default.setCurrentCategoryId(t)
                }
            }, UPDATE_DOWNLOADING_TASKLIST(e, t) {
                if (t.length > 0) {
                    let i = 0, n = null;
                    (n = -1 === e.currentCategoryId ? e.taskList[i] : e.taskListPrivate[i]).taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_COMPLETED_TASKLIST(e, t) {
                if (t.length > 0) {
                    let i = 1, n = null;
                    (n = -1 === e.currentCategoryId ? e.taskList[i] : e.taskListPrivate[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)
            }
        }, k = {
            attachTaskEvent({commit: e}) {
                g.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                        if (!t[1]) break;
                        let i = t[1].map(e => e.getTaskBaseInfo()), n = t[2];
                        n & o.DownloadKernel.TaskDetailChangedFlags.UserRead && e("UPDATE_TASK_READED", i), n !== o.DownloadKernel.TaskDetailChangedFlags.UserRead && e("UPDATE_TASK_INFO", i)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovingStateChange, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovingStateChange) break;
                        if (!t[1]) break;
                        let i = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_MOVING_STATE_CHANGE", i)
                    } while (0)
                }), g.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 i = t[1];
                        if (t[2].length > 0) break;
                        let n = f.getTaskFromTaskId(i);
                        if (!n) break;
                        e("UPDATE_TASK_INFO", [n.getTaskBaseInfo()])
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskRenamed, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskRenamed) break;
                        if (!t[1]) break;
                        let i = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_RENAME", i)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovedEnd) break;
                        if (!t[1]) break;
                        let i = t[1], n = [];
                        for (let e of i) null !== e && n.push(e.getTaskBaseInfo());
                        n.length > 0 && e("UPDATE_TASK_MOVED", n)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                        if (!t[1]) break;
                        let i = t[1], n = [];
                        for (let e of i) null !== e && n.push(e.getTaskBaseInfo());
                        n.length > 0 && e("UPDATE_TASK_MOVED", n)
                    } while (0)
                }), g.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 i = t[1], n = t[2], a = t[3].map(e => e.getTaskBaseInfo());
                        e("REMOVE_FROM_CATEGORY_VIEW", {categoryId: i, categoryViewId: n, tasks: a})
                    } while (0)
                })
            }
        }, 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 = [], i = null, n = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? (i = e.taskList[0].tasksMap, n = e.taskList[0].selected) : e.currentCategoryId === e.taskListPrivate[0].categoryId && (i = e.taskListPrivate[0].tasksMap, n = e.taskListPrivate[0].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? (i = e.taskList[1].tasksMap, n = e.taskList[1].selected) : e.currentCategoryId === e.taskListPrivate[1].categoryId && (i = e.taskListPrivate[1].tasksMap, n = e.taskListPrivate[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (i = e.taskList[2].tasksMap, n = e.taskList[2].selected), null !== i) for (let e of n) void 0 !== i[e] && null !== i[e] ? t.push(i[e]) : h.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 i = e.taskList[0].tasksMap;
                    for (let e in i) {
                        if (i[e].isMoving) {
                            t = !1;
                            break
                        }
                    }
                }
                return t
            }, downloadingTaskBaseList: e => {
                let t = [], i = {};
                return -1 === e.currentCategoryId ? i = e.taskList[0].tasksMap : e.currentCategoryId === e.taskListPrivate[0].categoryId && (i = e.taskListPrivate[0].tasksMap), t = [...Object.values(i)]
            }, completedTaskBaseList: e => {
                let t = [], i = {};
                return -1 === e.currentCategoryId ? i = e.taskList[1].tasksMap : e.currentCategoryId === e.taskListPrivate[1].categoryId && (i = e.taskListPrivate[1].tasksMap), t = [...Object.values(i)]
            }, recycleTaskBaseList: e => {
                let t = [], i = {};
                return -1 === e.currentCategoryId && (i = e.taskList[2].tasksMap), t = [...Object.values(i)]
            }, startTaskCount: e => {
                let t = 0, i = {};
                i = -1 === e.currentCategoryId ? e.taskList[0].tasksMap : e.taskListPrivate[0].tasksMap;
                for (let e in i) {
                    let n = i[e];
                    n.taskStatus !== o.DownloadKernel.TaskStatus.StartPending && n.taskStatus !== o.DownloadKernel.TaskStatus.Started || (t += 1)
                }
                return t
            }
        };
    t.default = {state: m, mutations: y, actions: k, getters: T}
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(0), r = i(3), s = i(37), l = i(64), d = i(12), u = i(32), c = i(41), h = i(40), f = i(10),
        g = i(90), p = i(106), v = i(47), m = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        y = o.default.getLogger("download-tool-bar"), k = d.DownloadKernelTaskManager.getTaskManager();
    let T = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_newtask_click"), f.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=dltab_menu"), s.ThunderNewTask.createPreNewTaskWindow(null)
    }, w = () => "", C = e => {
        let t = "";
        return e.showPrivateSpaceOpenPage && (t = "is-disabled"), t
    }, S = (e, t) => {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        i === r.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.startTasks(n) : y.warning("toolbar start tasks but not in downloading category")
    }, I = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = "is-disabled";
        return !e.showPrivateSpaceOpenPage && l.TaskStatusHelper.canStartSelectedTask(t, i) && (n = ""), n
    }, b = (e, t) => {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        i === r.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.pauseTasks(n, r.DownloadKernel.TaskStopReason.Manual) : y.warning("toolbar pause tasks but not in downloading category")
    }, _ = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = "is-disabled";
        return !e.showPrivateSpaceOpenPage && l.TaskStatusHelper.canStopSelectedTask(t, i) && (n = ""), n
    }, D = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let i = t.currentSelectdTaskInfos, n = !1;
        e.shiftKey && (n = !0), n ? u.TaskOperatorNs.destroyTasks(i) : u.TaskOperatorNs.deleteTasks(i)
    }, A = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let i = t.currentSelectdTaskInfos;
        u.TaskOperatorNs.destroyTasks(i)
    }, N = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = "is-disabled";
        return !e.showPrivateSpaceOpenPage && l.TaskStatusHelper.canDeleteSelectedTask(t, i) && (n = ""), n
    }, x = (e, t) => n(this, void 0, void 0, function* () {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        do {
            if (i === r.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== n.length) break;
            let e = n[0].taskType;
            if (e === r.DownloadKernel.TaskType.Bt) {
                let e = k.getTaskFromTaskId(n[0].taskId);
                (yield v.SingleBtTaskNS.isSingleBtTask(e)) ? yield u.TaskOperatorNs.openTaskItem(n[0]) : yield u.TaskOperatorNs.openTaskFolder(n[0], !0)
            } else if (e === r.DownloadKernel.TaskType.Group) if (i === r.DownloadKernel.CategroyViewID.Completed) {
                let e = k.getTaskFromTaskId(n[0].taskId);
                (yield u.TaskOperatorNs.executeInstallFile(e)) || (yield u.TaskOperatorNs.openTaskFolder(n[0], !0))
            } else yield u.TaskOperatorNs.openTaskFolder(n[0], !0); else {
                let e = "";
                i === r.DownloadKernel.CategroyViewID.Completed ? e = "finished" : i === r.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), yield u.TaskOperatorNs.openTaskItem(n[0], void 0, void 0, e)
            }
            i === r.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(n, 1)
        } while (0)
    }), E = (e, t) => n(this, void 0, void 0, function* () {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        do {
            if (i === r.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== n.length) break;
            yield u.TaskOperatorNs.openTaskFolder(n[0]), i === r.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(n, 1)
        } while (0)
    }), P = e => n(this, void 0, void 0, function* () {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = e.showPrivateSpaceOpenPage,
            a = "is-disabled";
        do {
            if (n || t !== r.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === i.length) {
                if (!(yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(i[0]))) break;
                a = ""
            }
        } while (0);
        return a
    }), O = e => n(this, void 0, void 0, function* () {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = e.showPrivateSpaceOpenPage,
            a = "is-disabled";
        do {
            if (n || t !== r.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === i.length) {
                if (!(yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(i[0]))) break;
                a = ""
            }
        } while (0);
        return a
    }), M = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = e.showPrivateSpaceOpenPage;
        y.verbose(t);
        let a = "is-disabled";
        return !n && i.length > 0 && (a = ""), a
    }, F = e => {
        let t = "";
        return e.showPrivateSpaceOpenPage && (t = "is-disabled"), t
    }, L = (e, t) => n(this, void 0, void 0, function* () {
    }), R = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_more_click"), y.information("open more"), y.verbose(e), p.downloadContextMenu.setContextInfo(t, t.currentCategoryId), p.downloadContextMenu.popMenu(p.DownloadMenuType.ToolbarMore, e).catch()
    }, B = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_private_setting_click"), p.downloadContextMenu.setContextInfo(t, t.currentCategoryId), p.downloadContextMenu.popMenu(p.DownloadMenuType.PrivateSpaceHome, e).catch()
    };
    const U = {
        downloadingButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: I}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: b,
            filterClass: _
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: D, filterClass: N}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-more", title: "更多", onClick: R, filterClass: C}],
        completedButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: x, filterClass: P}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: E,
            filterClass: O
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: D, filterClass: N}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-more", title: "更多", onClick: R, filterClass: C}],
        recycleButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {
            id: "xlx-icon-nav-restore", title: "还原", onClick: (e, t) => {
                f.XLStatNS.trackEvent("download_leftpanel", "top_undo_click"), y.verbose(e);
                let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
                i === r.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.recoverTask(n)
            }, filterClass: M
        }, {
            id: "xlx-icon-nav-clear", title: "彻底删除", onClick: (e, t) => {
                y.verbose(e), f.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
                let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
                i === r.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.destroyTasks(n)
            }, filterClass: M
        }, {
            id: "xlx-icon-nav-rubbish", title: "清空回收站", onClick: () => {
                f.XLStatNS.trackEvent("download_leftpanel", "top_clear_click"), u.TaskOperatorNs.clearRecycle()
            }, filterClass: e => {
                let t = e.showPrivateSpaceOpenPage,
                    i = m.getCategoryViewFromId(r.DownloadKernel.CategroyViewID.Recycle).getTasks().size,
                    n = "is-disabled";
                return !t && i > 0 && (n = ""), n
            }
        }, {id: "xlx-icon-nav-vip", title: "会员", onClick: L, filterClass: w}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: R,
            filterClass: C
        }],
        privateDownloadingButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: I}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: b,
            filterClass: _
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: A, filterClass: N}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-home", title: "私人空间设置", onClick: B, filterClass: F}],
        privateCompletedButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: x, filterClass: P}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: E,
            filterClass: O
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: A, filterClass: N}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-home", title: "私人空间设置", onClick: B, filterClass: F}]
    };

    function K(e, t) {
        let i = !1;
        for (let n of e) if (n.id === t.id) {
            i = !0;
            break
        }
        t.position || (t.position = e.length), t.position < 0 && (t.position = e.length + 1 + t.position), i || e.splice(t.position, 0, t)
    }

    function V(e, t) {
        for (let i = 0; i < e.length; i++) {
            if (e[i].id === t.id) {
                let n = Object.assign({}, e[i], t);
                a.Vue.set(e, String(i), Object.assign({}, n));
                break
            }
        }
    }

    function W(e, t) {
        for (let i = 0; i < e.length; i++) {
            if (e[i].id === t) {
                a.Vue.delete(e, String(i));
                break
            }
        }
    }

    const G = {
        ADD_BUTTON(e, t) {
            K(e.downloadingButtons, t), K(e.completedButtons, t), K(e.recycleButtons, t), K(e.privateDownloadingButtons, t), K(e.privateCompletedButtons, t)
        }, UPDATE_BUTTON(e, t) {
            V(e.downloadingButtons, t), V(e.completedButtons, t), V(e.recycleButtons, t), V(e.privateDownloadingButtons, t), V(e.privateCompletedButtons, t)
        }, REMOVE_BUTTON(e, t) {
            W(e.downloadingButtons, t), W(e.completedButtons, t), W(e.recycleButtons, t), W(e.privateDownloadingButtons, t), W(e.privateCompletedButtons, t)
        }
    }, H = {
        attachToolbarEvent({commit: e}) {
            g.PluginFunctionUINS.on("add_toolbar_button", t => {
                e("ADD_BUTTON", t)
            }), g.PluginFunctionUINS.on("update_toolbar_button", t => {
                e("UPDATE_BUTTON", t)
            }), g.PluginFunctionUINS.on("remove_toolbar_button", t => {
                e("REMOVE_BUTTON", t)
            })
        }
    };
    t.default = {state: U, mutations: G, actions: H, getters: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        UPDATE_VIP_SPEED_STATUS(e, t) {
            do {
                if (!t) break;
                let i = Object.assign({}, e.vipSpeedMap);
                for (let n in t) {
                    let a = t[n];
                    if (a) if (i.hasOwnProperty(String(n))) {
                        let e = i[n];
                        i[n] = Object.assign({}, e, a)
                    } else e.defaultStatus ? i[n] = Object.assign({}, e.defaultStatus, a) : i[n] = a; else delete i[n]
                }
                e.vipSpeedMap = Object.assign({}, i)
            } while (0)
        }, UPDATE_DEFAULT_SPEED_STATUS(e, t) {
            e.defaultStatus ? e.defaultStatus = Object.assign({}, e.defaultStatus, t) : e.defaultStatus = Object.assign({}, t)
        }
    };
    t.default = {state: {defaultStatus: null, vipSpeedMap: {}}, mutations: n}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        ON_MOUNTED(e, t) {
            e.homePageUrl = t
        }
    };
    t.default = {state: {homePageUrl: ""}, mutations: n, actions: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(351), o = n.default.getLogger("CommunityStore");
    o.verbose("enter");
    const r = {
        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
        }, ADD_UNREAD_MESSAGES(e, t) {
            e.messages = e.messages.concat(t)
        }, ADD_UNREAD_STARS(e, t) {
            e.stars = e.stars.concat(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_CIRCLE_NUM(e, t) {
            e.unreadNums.circle = t
        }, SET_MINE_ID(e, t) {
            e.mineId = t
        }
    }, s = {
        getUnreadNums: ({
                            commit: e,
                            state: t,
                            rootState: i
                        }, n) => (o.information("getUnreadNums"), a.getUnreadMsgNum(n).then(t => {
            t.error || "ok" !== t.data.result || (o.information("获取未读数消息", t), e("SET_UNREAD_NUMS", {
                star: t.data.data.unread_like_msg_cnt,
                comment: t.data.data.unread_reply_msg_cnt,
                chat: t.data.data.chitchat
            }))
        }).catch(e => {
            o.information("getUnreadNums error")
        })),
        getUnreadCircleMsgNum: ({commit: e, state: t, rootState: i}, n) => a.getUnreadCircleMsgNum(n).then(t => {
            o.information("获取圈子未读消息数", t), t.error || "ok" !== t.data.result || e("SET_UNREAD_NUMS", {circle: t.data.unread_reply_msg_count + t.data.unread_like_msg_count})
        }).catch(e => {
            o.information("getUnreadCircleMsgNum error")
        }),
        getUnreadNoticeNum: ({
                                 commit: e,
                                 state: t,
                                 rootState: i
                             }, n) => (o.information("getUnreadNoticeNum"), a.getUnreadNoticeNum(n).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")
        })),
        getUserInfo: ({
                          commit: e,
                          state: t,
                          rootState: i
                      }, n) => (o.information("getUserInfo", n), void 0 !== t.chatUsersInfo[n] ? (o.information("用户信息已存在"), Promise.resolve({data: {result: "ok"}})) : a.getUserInfo(n).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: i}, n) => a.getUserSessionList(n).then(i => {
            if (o.information("获取用户会话列表", i), !i.error && "ok" === i.data.result) {
                let a = 0, r = [];
                o.information("getUserSessionList userId: ", n, ", sessions:", i.data.sessions);
                for (let e = 0; e < i.data.sessions.length; e++) o.information("mineId--", t.mineId), i.data.sessions[e].user_id === t.mineId || r.includes(i.data.sessions[e].record.sender) || (a += i.data.sessions[e].unread, r.push(i.data.sessions[e].record.sender));
                a > 0 && e("SET_CHATS_NUM", a), o.information("私信未读数 chatNum", a)
            }
        }).catch(e => {
            o.information("getUserSessionList error")
        })
    }, l = {
        totalUnread(e, t, i) {
            let {star: n, comment: a, notice: o, chat: r, circle: s} = e.unreadNums;
            return n + a + o + r + s
        },
        UnreadMsgsLen: (e, t, i) => (o.information("UnreadMsgsLen", e.messages.length + e.stars.length + e.chatMsgs.length), e.messages.length + e.stars.length + e.chatMsgs.length),
        chatUnread: (e, t, i) => e.unreadNums.chat
    };
    t.default = {
        state: {
            unreadNums: {star: 0, comment: 0, notice: 0, chat: 0, circle: 0},
            showMessageButton: !0,
            messages: [],
            stars: [],
            chatUserId: 0,
            chatMsgs: [],
            chatUsersInfo: {},
            mineId: 0
        }, mutations: r, actions: s, getters: l
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        SHOW_PRIVATE_SPACE_OPEN_PAGE(e, t) {
            e.showPrivateSpaceOpenPage = t
        }
    };
    t.default = {state: {showPrivateSpaceOpenPage: !1}, mutations: n, actions: {}, getters: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        SHOW_UPGRADE_TASK(e, t) {
            e.showUpgradeTask !== t && (e.showUpgradeTask = t)
        }
    };
    t.default = {state: {showUpgradeTask: !1}, mutations: n, actions: {}, getters: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(45), a = i(2), o = i(9), r = i(8), s = i(0).default.getLogger("book-marks-store"), l = i(67),
        d = a.join(__profilesDir, "XLBrowserApp", "bookmarks"), u = 1, c = {
            ADD_BOOK_MARKS_ITEM(e, t) {
                e.bookMarks = Object.assign({}, e.bookMarks, t);
                let i = JSON.stringify(e.bookMarks);
                o.ConfigNS.setValue("book-marks-section", "book-marks-key", i)
            }, 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 i = JSON.stringify(e.bookMarks);
                    o.ConfigNS.setValue("book-marks-section", "book-marks-key", i)
                }
            }, SET_BOOK_MARKS_STATE(e, t) {
                e.bookMarks = t
            }, UPDATE_BOOK_MARKS_ICONURL(e, t) {
                for (let i in e.bookMarks) {
                    let n = e.bookMarks[i];
                    if (n.url === t.url) {
                        n.iconUrl = t.iconUrl;
                        let i = JSON.stringify(e.bookMarks);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", i);
                        break
                    }
                }
            }, SET_BOOK_MARKS_ITEM_TOP(e, t) {
                for (let i in e.bookMarks) {
                    let n = e.bookMarks[i];
                    if (n.url === t.url) {
                        t.top ? (n.top = !0, n.toptime = (new Date).getTime()) : (delete n.top, delete n.toptime);
                        let i = JSON.stringify(e.bookMarks);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", i);
                        break
                    }
                }
            }
        }, h = {
            initBookMarks: ({commit: e, state: t, rootState: i}) => new Promise((e, t) => {
                let i = o.ConfigNS.getValue("book-marks-section", "book-marks-key", "/");
                if ("/" !== i) try {
                    let n = JSON.parse(i);
                    e(n)
                } catch (e) {
                    t(new Error("JSON parse book marks error"))
                } else n.readFile(`${d}`, "utf8", (i, n) => {
                    if (i) s.information("读取书签文件出错,书签路径..", d), 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 i = {};
                            for (let e = 0; e < t.length; e++) l(t[e], "bmType") === u && void 0 === i[l(t[e], "url")] ? i[l(t[e], "url")] = {
                                url: l(t[e], "url"),
                                name: l(t[e], "name"),
                                iconUrl: l(t[e], "iconUrl") || ""
                            } : f(t[e], i);
                            return i
                        }(JSON.parse(n)), i = JSON.stringify(t);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", i), 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 i = l(e, "itemlist");
        for (let e = 0; e < i.length; e++) l(i[e], "bmType") === u && void 0 === t[l(t[e], "url")] ? t[l(i[e], "url")] = {
            url: l(i[e], "url"),
            name: l(i[e], "name")
        } : f(i[e], t)
    }

    t.default = {state: {bookMarks: {}}, mutations: c, actions: h}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(20), o = n.default.getLogger("groupStore"), r = {
        SET_GROUP_DATA(e, t) {
            e.all = t
        }
    }, s = {
        getGroupData({commit: e, state: t, rootState: n}) {
            try {
                return a.default.defaults.adapter = i(21), a.default.get("http://static-xl.a.88cdn.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)
                })
            } catch (e) {
                return e
            }
        }
    };
    t.default = {state: {all: {}}, mutations: r, actions: s}
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(52), o = i(49), r = i(3), s = i(15), l = i(9), d = i(11), u = i(89), c = i(5), h = i(0), f = i(62),
        g = i(4), p = i(17), v = i(53), m = a.ToastNotifyManagerNS.getToastNotifyManger(),
        y = s.DownloadKernelEventManager.getEventManager(), k = u.TabEventManagerNS.getEventEmitter(),
        T = h.default.getLogger("GetCoinPrizeToast");

    class w {
        constructor() {
            this.taskStatusChangedEventId = void 0, this.checkMainWindowStateListener = null, this.loginEventId = void 0
        }

        onTaskStatusChanged(e) {
            let t = !1;
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (!n) continue;
                let a = n.getTaskStatus();
                if (a === r.DownloadKernel.TaskStatus.Succeeded || a === r.DownloadKernel.TaskStatus.Seeding) {
                    T.information("onTaskStatusChanged", a), t = !0;
                    break
                }
            }
            t ? setTimeout(() => n(this, void 0, void 0, function* () {
                (yield this.canPopState()) && 1 === (yield this.getCurrentPopTimes()) && this.toastNotify().catch()
            }), 3e3) : T.information("canPopState false")
        }

        toastNotify() {
            return n(this, void 0, void 0, function* () {
                if (yield this.canPopToday()) {
                    let e = m.getTopNotify();
                    if (e && e.getId() === a.ToastNotifyManagerNS.notifyIdGetCoinPrize) T.information("get-coin-prize toast pop now"); else if (yield this.hasCoinPrize()) {
                        let t = yield this.getToastTime();
                        T.information("toast time", t), t > 0 && ((e = m.getTopNotify()) && e.getId() === a.ToastNotifyManagerNS.notifyIdGetCoinPrize ? T.information("get-coin-prize toast pop now2") : (m.showNotify(a.ToastNotifyManagerNS.notifyIdGetCoinPrize, o.ToastNotifyItemType.Custom, "恭喜完成每日下载任务", t, "get-coin-prize-toast"), this.addPopTimes().catch()))
                    } else T.information("hasCoinPrize false")
                } else T.information("canPopToday false")
            })
        }

        hasCoinPrize() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                try {
                    let t = yield f.fetchSlRes({url: "/xlppc.coin.task/api/v2/get_task_info", data: {}, method: "get"});
                    if (null !== t && void 0 !== t && 200 === t.status) {
                        let i = t.data;
                        T.information("data", i), 0 !== i.code || g.isNullOrUndefined(i.data) || g.isNullOrUndefined(i.data.task1010) || 1 !== i.data.task1010.status || (e = !0)
                    }
                } catch (e) {
                }
                return e
            })
        }

        canPopState() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = yield d.asyncRemoteCall.getCurrentWindow();
                    if (!t || (yield t.isDestroyed())) break;
                    if ((yield t.isMinimized()) || !(yield t.isVisible())) {
                        T.information("mainWindow minimized or hide");
                        break
                    }
                    let i = yield c.client.callServerFunction("GetCurrentNav");
                    if (i !== v.NavViewID.Download) {
                        T.information("GetCurrentNav", i);
                        break
                    }
                    e = !0
                } while (0);
                return e
            })
        }

        canPopToday() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (!(yield c.client.callServerFunction("IsLogined"))) {
                        T.information("not login");
                        break
                    }
                    let t = yield c.client.callServerFunction("GetUserID");
                    if (!t || "" === t || "0" === t) {
                        T.information("userId invalid");
                        break
                    }
                    let i = l.ConfigNS.getValue("Toast", "GetCoinPrizePopDate" + t, "");
                    if ((new Date).toLocaleDateString() === i) {
                        if (l.ConfigNS.getValue("Toast", "GetCoinPrizePopClick" + t, !1)) {
                            T.information("toast clicked.");
                            break
                        }
                        let e = l.ConfigNS.getValue("Toast", "GetCoinPrizePopTimes" + t, 0);
                        if (e >= 2) {
                            T.information("canPopToday false, pop times today", e);
                            break
                        }
                    }
                    e = !0
                } while (0);
                return e
            })
        }

        getCurrentPopTimes() {
            return n(this, void 0, void 0, function* () {
                let e = -1;
                do {
                    if (!(yield c.client.callServerFunction("IsLogined"))) {
                        T.information("not login");
                        break
                    }
                    let t = yield c.client.callServerFunction("GetUserID");
                    if (!t || "" === t || "0" === t) {
                        T.information("userId invalid");
                        break
                    }
                    let i = l.ConfigNS.getValue("Toast", "GetCoinPrizePopDate" + t, "");
                    if ((new Date).toLocaleDateString() === i) {
                        if (l.ConfigNS.getValue("Toast", "GetCoinPrizePopClick" + t, !1)) {
                            T.information("pop clicked.");
                            break
                        }
                        let i = l.ConfigNS.getValue("Toast", "GetCoinPrizePopTimes" + t, 0);
                        if (1 === i) {
                            T.information("isSecondTimePop, pop times today", i), e = 2;
                            break
                        }
                    }
                    e = 1
                } while (0);
                return e
            })
        }

        getToastTime() {
            return n(this, void 0, void 0, function* () {
                let e = 0;
                do {
                    let t = yield c.client.callServerFunction("GetUserID");
                    if (!t || "" === t || "0" === t) {
                        T.information("userId invalid");
                        break
                    }
                    let i = l.ConfigNS.getValue("Toast", "GetCoinPrizePopDate" + t, "");
                    if ("" === i) {
                        e = 6e4;
                        break
                    }
                    if ((new Date).toLocaleDateString() === i) {
                        if (l.ConfigNS.getValue("Toast", "GetCoinPrizePopClick" + t, !1)) {
                            T.information("pop clicked.");
                            break
                        }
                        let i = l.ConfigNS.getValue("Toast", "GetCoinPrizePopTimes" + t, 0);
                        T.information("pop times today", i), 1 === i ? e = 1e4 : 0 === i && (e = 6e4)
                    } else e = 6e4
                } while (0);
                return e
            })
        }

        addPopTimes() {
            return n(this, void 0, void 0, function* () {
                do {
                    let e = yield c.client.callServerFunction("GetUserID");
                    if (!e || "" === e || "0" === e) break;
                    let t = 0, i = l.ConfigNS.getValue("Toast", "GetCoinPrizePopDate" + e, ""),
                        n = (new Date).toLocaleDateString();
                    "" !== i && n === i && (t = l.ConfigNS.getValue("Toast", "GetCoinPrizePopTimes" + e, 0)), l.ConfigNS.setValue("Toast", "GetCoinPrizePopDate" + e, n), l.ConfigNS.setValue("Toast", "GetCoinPrizePopTimes" + e, t + 1), l.ConfigNS.setValue("Toast", "GetCoinPrizePopClick" + e, !1)
                } while (0)
            })
        }

        onCheckMainWindowState() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!(yield this.canPopState())) {
                        T.information("onCheckMainWindowState canPopState || getCurrentPopTimes false");
                        break
                    }
                    this.toastNotify().catch()
                } while (0)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                this.taskStatusChangedEventId = y.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === r.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                });
                let e = yield d.asyncRemoteCall.getCurrentWindow();
                this.checkMainWindowStateListener = this.onCheckMainWindowState.bind(this), e.on("show", this.checkMainWindowStateListener), e.on("restore", this.checkMainWindowStateListener), k.on(u.TabEventManagerNS.EventType.ChangeTab, this.checkMainWindowStateListener), (yield this.canPopState()) && this.toastNotify().catch(), this.loginEventId = p.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => n(this, void 0, void 0, function* () {
                    (yield this.canPopState()) && this.toastNotify().catch()
                }))
            })
        }

        uninit() {
            return n(this, void 0, void 0, function* () {
                this.taskStatusChangedEventId && (y.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId), this.taskStatusChangedEventId = void 0);
                let e = yield d.asyncRemoteCall.getCurrentWindow();
                e.removeListener("show", this.checkMainWindowStateListener), e.removeListener("restore", this.checkMainWindowStateListener), k.removeListener(u.TabEventManagerNS.EventType.ChangeTab, this.checkMainWindowStateListener), this.checkMainWindowStateListener = null, this.loginEventId && (p.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.loginEventId), this.loginEventId = void 0)
            })
        }
    }

    let C = null;
    t.initGetCoinPrizeToast = function () {
        C || (C = new w), C.init().catch()
    }, t.uninitGetCoinPrizeToast = function () {
        C && C.uninit().catch()
    }
}, function (e, t, i) {
    "use strict";
    var n = i(884);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(166);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(370), a = i(168);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(803);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(170);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\search-view\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(374), a = i(172);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(667);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\search-view\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(379), a = i(174);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(666);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\address-bar\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(176);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\address-bar\\address-bar-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(406), a = i(178);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\address-bar\\address-bar.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(888);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(890);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(180);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(375), a = i(182);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(184);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\home-page\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(385), a = i(186);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(672);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "02fe07d9", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\home-page\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(892);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = a.default.getLogger("Thunder.renderer.contextmenu"), s = i(4), l = i(6), d = i(18),
        u = i(7), c = i(72), h = i(101), f = i(5), g = i(43), p = i(37), v = i(3), m = i(34), y = i(11),
        k = u.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        T = ".asf;.avi;.exe;.iso;.mp3;.mp4;.mkv;.mpeg;.mpg;.mpga;.ra;.rar;||.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf;",
        w = ["http://", "https://", "ftp://"], C = ["thunder://", "thunders://", "ed2k://", "magnet:"];

    function S(e) {
        let t = !1;
        if (e) for (let i = 0; i < w.length; ++i) {
            let n = w[i];
            if (0 === e.indexOf(n)) {
                t = !0;
                break
            }
        }
        return t
    }

    function I(e) {
        let t = !1;
        if (e) for (let i = 0; i < C.length; ++i) {
            let n = C[i];
            if (0 === e.indexOf(n)) {
                t = !0;
                break
            }
        }
        return t
    }

    function b(e) {
        let t = [], i = e;
        if (g.Common.isThunderPrivateUrl(i) && (i = g.Common.parseThunderPrivateUrl(i)), function (e) {
            let t = !1;
            do {
                if (!e) break;
                if (S(e)) {
                    let i = o.extname(e);
                    if (!i || i.length <= 0) break;
                    i += ";", T.indexOf(i) > -1 && (t = !0)
                } else I(e) && (t = !0)
            } while (0);
            return t
        }(i)) {
            let n = m.ThunderHelper.getTaskTypeFromUrl(i);
            if (n === v.DownloadKernel.TaskType.P2sp || n === v.DownloadKernel.TaskType.Emule) t.push(e); else if (n === v.DownloadKernel.TaskType.Magnet || n === v.DownloadKernel.TaskType.Bt) return p.ThunderNewTask.createBtTaskWindow({
                url: e,
                type: "url"
            }, {browser: "xlbrowser.exe"}), !0
        }
        return t.length > 0 && (p.ThunderNewTask.createPreNewTaskWindow(t), !0)
    }

    function _(e, t) {
        return n(this, void 0, void 0, function* () {
            let n = null, a = !1;
            try {
                n = yield(yield i(20)).get(e)
            } catch (e) {
            }
            return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (a = yield l.FileSystemAWNS.writeFileAW(t, n.data)), a
        })
    }

    function D(e) {
        do {
            if (s.isNullOrUndefined(e)) break;
            let t = e;
            !1 === N(e) && (t = (t = c.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=48021271_21_hao_pg&wd=$word$")).replace("$word$", e)), f.client.callServerFunction("openNewTab", t).catch()
        } while (0)
    }

    t.contextMenuPage = [{
        label: "返回", onclick: function (e, t) {
            r.information("goBack"), e.goBack()
        }, onadded: (e, t, i, n) => {
            e.isBackwardEnable() || i.setEnable(t, !1)
        }
    }, {
        label: "前进", onclick: function (e, t) {
            e.goForward()
        }, onadded: (e, t, i, n) => {
            e.isForwardEnable() || i.setEnable(t, !1)
        }
    }, {
        label: "重新加载", onclick: function (e, t) {
            e.refresh()
        }
    }, {
        label: "另存为", onclick: function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (b(t.linkURL)) return;
                let e = yield y.asyncRemoteCall.getCurrentWindow(), i = yield y.asyncRemoteCall.getDialog();
                i.showSaveDialog(e, {
                    defaultPath: "新建网页.html",
                    filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
                }).then(e => {
                    if (e.canceled) return;
                    let i = e.filePath;
                    if (void 0 === i || "" === i) return;
                    let n = o.extname(i);
                    ".html" !== n.toLowerCase() && (i += ".html"), setTimeout(() => {
                        _(t.pageURL, i).catch()
                    }, 0)
                }).catch()
            })
        }
    }, {
        label: "查看网页源代码", onclick: function (e, t) {
            f.client.callServerFunction("OpenNewTab", "view-source:" + t.pageURL).catch()
        }
    }], t.contextMenuDownloadableLink = [{label: "在新标签页打开链接", onclick: x}, {
        label: "链接另存为",
        onclick: E
    }, {
        label: "复制链接地址", onclick: function (e, t) {
            k.copyTextToClipBoard(t.linkURL)
        }
    }], t.contextMenuMedia = [{
        label: "在新标签页中打开图片", onclick: function (e, t) {
            D(t.sourceURL)
        }
    }, {
        label: "图片另存为", onclick: function (e, t) {
            return n(this, void 0, void 0, function* () {
                let e = o.basename(t.sourceURL), a = o.extname(e);
                "" === e && (e = function () {
                    let e = "";
                    for (let t = 1; t <= 32; t++) {
                        let i = Math.floor(16 * Math.random()).toString(16);
                        e += i, 8 !== t && 12 !== t && 16 !== t && 20 !== t || (e += "-")
                    }
                    return e
                }() + a);
                let r = void 0;
                r = "" !== a ? {
                    defaultPath: e,
                    filters: [{name: "图片（*" + a + "）", extensions: [a]}, {name: "所有文件", extensions: ["*"]}]
                } : {defaultPath: e, filters: [{name: "所有文件", extensions: ["*"]}]};
                let s = yield y.asyncRemoteCall.getCurrentWindow(), d = yield y.asyncRemoteCall.getDialog();
                d.showSaveDialog(s, r).then(e => {
                    let a = e.filePath;
                    void 0 !== a && "" !== a && setTimeout(() => {
                        (function (e, t) {
                            return n(this, void 0, void 0, function* () {
                                let n = null, a = !1;
                                try {
                                    n = yield(yield i(20)).get(e, {responseType: "arraybuffer"})
                                } catch (e) {
                                }
                                return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (a = yield l.FileSystemAWNS.writeFileAW(t, n.data)), a
                            })
                        })(t.sourceURL, a).catch()
                    }, 0)
                }).catch()
            })
        }
    }, {
        label: "复制图片", onclick: function (e, t) {
            setTimeout(() => {
                (function (e) {
                    return n(this, void 0, void 0, function* () {
                        let t = null, n = !1;
                        try {
                            t = yield(yield i(20)).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 = i(18).nativeImage.createFromDataURL(e);
                            d.clipboard.clear(), d.clipboard.writeImage(a), n = !0
                        }
                        return n
                    })
                })(t.sourceURL).catch()
            }, 0)
        }
    }, {
        label: "复制图片地址", onclick: function (e, t) {
            k.copyTextToClipBoard(t.sourceURL)
        }
    }], t.contextMenuSelection = [{
        label: "复制", onclick: function (e, t) {
            e.editCopy()
        }
    }, {
        label: "用百度搜索", onclick: function (e, t) {
            let i = c.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=48021271_21_hao_pg&wd=$word$");
            i = i.replace("$word$", t.selectionText), f.client.callServerFunction("OpenNewTab", i).catch()
        }
    }], t.contextMenuEditable = [{
        label: "撤销", onclick: function (e, t) {
            e.editUndo()
        }
    }, {
        label: "剪切", onclick: function (e, t) {
            e.editCut()
        }
    }, {
        label: "复制", onclick: function (e, t) {
            e.editCopy()
        }
    }, {
        label: "粘贴", onclick: function (e, t) {
            e.editPaste()
        }
    }, {
        label: "删除", onclick: function (e, t) {
            e.editDelete()
        }
    }, {
        label: "全选", onclick: function (e, t) {
            e.editSelectAll()
        }
    }], t.contextMenuLink = [{label: "在新标签页打开链接", onclick: x}, {label: "链接另存为", onclick: E}, {
        label: "复制链接地址",
        onclick: function (e, t) {
            k.copyTextToClipBoard(t.linkURL), b(t.linkURL) && r.information(t.linkURL)
        }
    }];
    let A = {
        page: t.contextMenuPage,
        selection: t.contextMenuSelection,
        edit: t.contextMenuEditable,
        link: t.contextMenuLink,
        media: t.contextMenuMedia
    };

    function N(e) {
        let t = !1;
        do {
            let i = e.trim();
            if (s.isNullOrUndefined(i)) break;
            if (t = /([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test(i)) {
                t = 1 === k.isPingHostValid(i)
            }
        } while (0);
        return t
    }

    function x(e, t) {
        b(t.linkURL) ? r.information(t.linkURL) : D(t.linkURL)
    }

    function E(e, t) {
        return n(this, void 0, void 0, function* () {
            if (b(t.linkURL)) return;
            let e = yield y.asyncRemoteCall.getCurrentWindow();
            (yield y.asyncRemoteCall.getDialog()).showSaveDialog(e, {
                defaultPath: "新建网页.html",
                filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
            }).then(e => {
                if (e.canceled) return;
                let i = e.filePath;
                void 0 !== i && "" !== i && (".html" !== o.extname(i).toLowerCase() && (i += ".html"), setTimeout(() => {
                    _(t.linkURL, i).catch()
                }, 0))
            }).catch()
        })
    }

    t.registerContextMenu = function (e) {
        e && (e.on("before-context-menu", (e, t, i, n) => {
            let a = e.target, o = [];
            n.elemTypeFlag & h.PopupElemTypeFlag.EDITABLE ? o.push(...A.edit) : (n.elemTypeFlag & h.PopupElemTypeFlag.MEDIA && o.push(...A.media), n.elemTypeFlag & h.PopupElemTypeFlag.LINK && o.push(...A.link), n.elemTypeFlag & h.PopupElemTypeFlag.SELECTION && o.push(...A.selection)), n.elemTypeFlag & h.PopupElemTypeFlag.PAGE && 0 === o.length && o.push(...A.page);
            let r = new Map;
            o.forEach((t, a) => {
                if ("separate" === t.type) i.addSeparator(); else {
                    let a = i.addItem(t.label);
                    t.onadded && t.onadded(e.target, a, i, n), r.set(a, t)
                }
            }), a.curRegistryMap = r, a.curMenuParam = n
        }), e.on("context-menu-command", (e, t, i) => {
            let n = e.target, a = n.curRegistryMap, o = n.curMenuParam;
            n.curRegistryMap = null, n.curMenuParam = null;
            let s = a.get(i);
            null !== s ? s.onclick(e.target, o) : r.warning("unknown menu command", i, a)
        }))
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.unread = function (e) {
        return e > 99 ? "..." : e ? String(e) : ""
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(188);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\browser-view\\browser-view-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(386), a = i(190);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(678), i(679);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "6f847208", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\browser-view\\browser-view.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(894);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(896);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(899);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(192);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\message-view\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(376), a = i(194);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(682);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "0302fe79", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\message-view\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(901);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(372), a = i(196);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(684);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\pan-view.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(903);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(198);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(377), a = i(200);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(202);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(387), a = i(204);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(206);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-button-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(419), a = i(208);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-button.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(210);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-vip-button-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(420), a = i(212);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-vip-button.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(10), r = i(20), s = i(2), l = i(6), d = i(60),
        u = i(0).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 n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (t, i) => {
                        0 === t && (this.mSessionId = i), e(this.mSessionId || "0")
                    }) : e(this.mSessionId || "0")
                })
            })
        }

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

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

        parseUserInfo() {
            return n(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 n(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 n(this, void 0, void 0, function* () {
                try {
                    r.default.defaults.adapter = i(21), r.default.get("http://act.vip.xunlei.com/vip/2018/ssi/vipiconData.js", {timeout: 1e4}).then(e => n(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();
                            u.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 => {
                        u.warning(e)
                    })
                } catch (e) {
                    u.information(e)
                }
            })
        }

        sendStat(e, t, i = "") {
            let n = 0;
            this.mUserHelper.isLogin && (n = 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=${n},test_type=${this.mModel}`;
            "" !== i && (r = `${r},${i}`), u.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 n(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 => {
                            u.warning(e), this.updateUIDefault()
                        })
                    } catch (e) {
                        u.information(e), this.updateUIDefault()
                    } else e()
                } else this.mIsFirstLoad ? (this.mIsFirstLoad = !1, setTimeout(() => n(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, i;
            e = this.mUserHelper.vipData.expireDate.substring(0, 4), t = this.mUserHelper.vipData.expireDate.substring(4, 6), i = this.mUserHelper.vipData.expireDate.substring(6, 8);
            let n = new Date(e + "-" + t + "-" + i + " 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 - n) / 86400)
        }

        updateUIPrivate(e, t) {
            u.information(`updateUIPrivate: updateType=${e}, cfgType=${t}`), this.mUpdateType = e;
            let i = Date.now(), o = i;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].online && (o = new Date(this.mVipIconData[e].online).getTime());
            let r = i;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].offline && (r = new Date(this.mVipIconData[e].offline).getTime()), u.information("updateUIPrivate, curDate=" + String(i) + ", onlineDate=" + String(o) + ", offlineDate=" + String(r)), o >= i || i >= r || a.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "ToolBarButtonVipIcon", t, "", (i, a) => n(this, void 0, void 0, function* () {
                let n = "";
                0 === i && (n = 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 = n !== 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), i = c, n = String(1e6 * Math.random()).valueOf();
                    i.indexOf("?") >= 0 ? i += "&rd=" + n : i += "?rd=" + n, d.AxiosNS.downloadFileAW(i, t).then(i => {
                        u.information("下载图片：result = ", i, ";fileName = ", e), this.mVueObj.vipIcon = i ? "file://" + t : ""
                    }).catch(e => {
                        u.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 n(this, void 0, void 0, function* () {
                try {
                    let n = `http://soa.vip.xunlei.com/xlvip.common.mooseapi/querytags?userid=${e}&sessionid=${t}&tags=usedToBeDLVip&platform=xlx`;
                    return r.default.defaults.adapter = i(21), r.default.get(n, {timeout: 1e4})
                } catch (e) {
                    return e
                }
            })
        }

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

        attachUserEvents() {
            a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(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) => n(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 n(this, void 0, void 0, function* () {
                u.information("vipicon --\x3eonUserInfoChange"), "vipinfo" === e && this.updateUI().catch(), u.information("<--onUserInfoChange")
            })
        }

        onLoginStatusChange(e) {
            u.information("vipicon --\x3eonLoginStatusChange", "newStatus", e), "offline" === e && (this.mUserHelper.onLogout(), this.updateUI().catch()), u.information("<--onLoginStatusChange")
        }
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(214);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\status-bar-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(388), a = i(216);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\status-bar.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(9), a = i(31), o = i(57);
    !function (e) {
        let t = 0, i = 0, r = "", s = 0, l = 0;

        function d() {
            let e = new Date;
            return e.getFullYear() + "." + (e.getMonth() + 1) + "." + e.getDate()
        }

        function u() {
            let e = !0;
            return d() === r && (e = !1), e
        }

        function c() {
            return n.ConfigNS.getValue("FlowMonitor", "DownloadSize", 0)
        }

        function h() {
            return n.ConfigNS.getValue("FlowMonitor", "UploadSize", 0)
        }

        function f(e, t) {
            n.ConfigNS.setValue("FlowMonitor", "DownloadSize", e), n.ConfigNS.setValue("FlowMonitor", "UploadSize", t), n.ConfigNS.setValue("FlowMonitor", "Date", d())
        }

        e.isDateChange = u, e.getDownloadSizeFromFile = c, e.getUploadSizeFromFile = h, e.setFlowData = f, e.startMonitor = function () {
            t = c(), i = h(), r = n.ConfigNS.getValue("FlowMonitor", "Date", ""), u() && (t = 0, i = 0, f(0, 0)), s = t, l = i, o.quitPromises.add(function () {
                return new Promise(e => {
                    f(s, l), n.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 = i + e
        }, e.getCurrentDownloadSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskDownloadSpeed(!1)
        }, e.getCurrentVipSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskVipSpeed(!1)
        }
    }(t.FlowMonitorNS || (t.FlowMonitorNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(2), r = i(0), s = i(5), l = i(6),
        d = a.default(o.resolve(__rootDir, "../bin/ThunderHelper.node")),
        u = r.default.getLogger("Browser.Config.Helper");
    !function (e) {
        const t = new class {
            constructor() {
                this.browserNames = ["360se", "chrome", "msedge", "QQBrowser", "360chrome"], this.showMoreSupport = !1, this.browserList = [], this.crxPath = "", this.xunleiKey = "ncennffkjdiamlpmcbajkmaiiiddgioo", this.browserInfos = new Map, this.title = "360安全浏览器"
            }

            getInstallBrowserInfo(e) {
                return n(this, void 0, void 0, function* () {
                    return yield s.client.callServerFunction("GetInstallBrowserInfo", e)
                })
            }

            is360AddonsInstalled(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    return e = o.join(e, this.xunleiKey), t = yield l.FileSystemAWNS.existsAW(e), u.information("is360AddonsInstalled ret", t, "addnPath", e), t
                })
            }

            isAddonsOpened(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = "", n = yield l.FileSystemAWNS.readFileAW(e), a = null;
                    if (n && n.length > 0) {
                        i = n.toString();
                        try {
                            1 === (a = JSON.parse(i)).extensions.settings.ncennffkjdiamlpmcbajkmaiiiddgioo.state && (t = !0)
                        } catch (e) {
                            return u.warning(e), t
                        }
                    }
                    return u.information("isEdgeAndChromeAddonsOpened open", t, "path", e), t
                })
            }

            isEdgeAndChromeAddonsInstalled(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = "", n = yield l.FileSystemAWNS.readFileAW(e);
                    if (n && n.length > 0) try {
                        i = n.toString()
                    } catch (e) {
                        return u.warning(e), t
                    }
                    return -1 !== i.indexOf(this.xunleiKey) && (t = !0), u.information("isEdgeAndChromeAddonsInstalled ret", t, "path", e), t
                })
            }

            getBrowserPath(e, t) {
                let i = "";
                if (t) {
                    (i = d.queryRegValue(t.reg.regRoot, t.reg.regKey, t.reg.regName)) || ("chrome" === e && (i = d.queryRegValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Google Chrome", "DisplayIcon")), "msedge" === e && (i = d.queryRegValue("HKEY_LOCAL_MACHINE", "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\msedge.exe", "")));
                    let n = i.indexOf(",");
                    -1 !== n && (i = i.slice(0, n)), i = d.getLongPathName(i), d.queryFileExists(i) || (i = "")
                }
                return i
            }

            getDefaultBrowserPath() {
                return d.getDefaultBrowserPath()
            }

            getCanShowIcon() {
                return n(this, void 0, void 0, function* () {
                    let e = !0;
                    do {
                        if (yield this.getInstallBrowserInfo("360安全浏览器")) break;
                        if (yield this.getInstallBrowserInfo("360极速浏览器")) break;
                        if (yield this.getInstallBrowserInfo("QQ浏览器")) break;
                        if (yield this.getInstallBrowserInfo("Edge浏览器")) break;
                        if (yield this.getInstallBrowserInfo("Chrome")) break;
                        e = !1
                    } while (0);
                    return e
                })
            }

            getShowTipInfo(e) {
                return n(this, void 0, void 0, function* () {
                    let t = {}, i = this.getDefaultBrowserPath().split("\\"), n = "";
                    i && i.length > 0 && (n = i[i.length - 1]);
                    let a = o.basename(n, ".exe"),
                        r = {icon: "", name: "", default: !1, install: !1, open: !1, exeName: ""};
                    if (-1 === this.browserNames.indexOf(a)) for (let i of this.browserNames) {
                        let n = e.get(i);
                        if (n && n.browserExist) {
                            n.browserAddonInstall && n.browserAddonOpen || (t.browserInfo = n, t.title = n.browserTitle, t.show = !0);
                            break
                        }
                    } else {
                        let i = e.get(a);
                        if (i) {
                            let e = i.browserAddonInstall;
                            r = {
                                icon: i.icon,
                                name: i.browserTitle,
                                default: !0,
                                install: i.browserAddonInstall,
                                open: i.browserAddonOpen,
                                exeName: a
                            }, this.browserList.push(r), !i.browserExist || i.browserAddonInstall && i.browserAddonOpen || (t.browserInfo = i, t.title = i.browserTitle, t.show = !0), u.information("installed", e)
                        }
                    }
                    return t
                })
            }

            findProcessAw(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => {
                        d.asyncFindProcess(e, e => {
                            let i = e && e.length > 0;
                            t(i)
                        })
                    })
                })
            }

            getInfos(e = !1) {
                return n(this, void 0, void 0, function* () {
                    let t = this.getDefaultBrowserPath().split("\\"), i = "";
                    t && t.length > 0 && (i = t[t.length - 1]);
                    let n = d.getInstallDir();
                    this.crxPath = o.join(n, "../BHO/xl_ext_chrome.crx"), u.information("installDir", n);
                    let a = yield this.getInstallBrowserInfo("360安全浏览器"),
                        r = yield this.getInstallBrowserInfo("360极速浏览器"), s = yield this.getInstallBrowserInfo("QQ浏览器"),
                        l = yield this.getInstallBrowserInfo("Edge浏览器"), c = yield this.getInstallBrowserInfo("Chrome"),
                        h = d.getEdgeAddonsPath(), f = yield this.isEdgeAndChromeAddonsInstalled(h),
                        g = yield this.isAddonsOpened(h), p = d.getChromeAddonsPath(),
                        v = yield this.isEdgeAndChromeAddonsInstalled(p), m = yield this.isAddonsOpened(p),
                        y = d.get360SafeAddonsPath(), k = yield this.is360AddonsInstalled(y),
                        T = d.get360QuickAddonsPath(), w = yield this.is360AddonsInstalled(T), C = d.getQQAddonsPath(),
                        S = yield this.is360AddonsInstalled(C), I = d.getRoamingAppDataPath(),
                        b = d.getAppDataLocalPath(), _ = o.join(I, "360se6/User Data/Default/Preferences"),
                        D = yield this.isAddonsOpened(_),
                        A = o.join(b, "360Chrome/Chrome/User Data/Default/Preferences"),
                        N = yield this.isAddonsOpened(A),
                        x = o.join(b, "Tencent/QQBrowser/User Data/Default/Preferences"),
                        E = yield this.isAddonsOpened(x), P = "360se.exe", O = yield this.findProcessAw(P),
                        M = "https://ext.se.360.cn/webstore/detail/ncennffkjdiamlpmcbajkmaiiiddgioo",
                        F = "--https://e://extensions/", L = this.getBrowserPath("360se", a),
                        R = null !== a && "" !== L, B = {
                            browserData: a,
                            browserExist: R,
                            browserPath: L,
                            browserAddonPath: y,
                            browserAddonInstall: k,
                            installCmdLine: M,
                            openCmdLine: F,
                            browserTitle: "360安全浏览器",
                            icon: "xly-img-icon-360",
                            browserAddonOpen: D,
                            browserAddonConfigPath: _
                        };
                    e ? this.browserInfos.set("360se", B) : k && !D && O || this.browserInfos.set("360se", B), P = "chrome.exe", O = yield this.findProcessAw(P), M = "https://chrome.google.com/webstore/detail/%E8%BF%85%E9%9B%B7%E4%B8%8B%E8%BD%BD%E6%94%AF%E6%8C%81/ncennffkjdiamlpmcbajkmaiiiddgioo?hl=zh-CN", F = "https://chrome.google.com/webstore/detail/%E8%BF%85%E9%9B%B7%E4%B8%8B%E8%BD%BD%E6%94%AF%E6%8C%81/ncennffkjdiamlpmcbajkmaiiiddgioo?hl=zh-CN", L = this.getBrowserPath("chrome", c), B = {
                        browserData: c,
                        browserExist: R = null !== c && "" !== L,
                        browserPath: L,
                        browserAddonPath: p,
                        browserAddonInstall: v,
                        installCmdLine: M,
                        openCmdLine: F,
                        browserTitle: "Chrome浏览器",
                        icon: "xly-img-icon-chrome",
                        browserAddonOpen: m,
                        browserAddonConfigPath: p
                    }, e ? this.browserInfos.set("chrome", B) : !v || v && !m && O || this.browserInfos.set("chrome", B), L = this.getBrowserPath("msedge", l), F = M = "https://microsoftedge.microsoft.com/addons/detail/%E8%BF%85%E9%9B%B7%E4%B8%8B%E8%BD%BD%E6%94%AF%E6%8C%81/popomkonnjgcdagdhgcpcekbdeoibglc?hl=zh-CN", B = {
                        browserData: l,
                        browserExist: R = null !== l && "" !== L,
                        browserPath: L,
                        browserAddonPath: h,
                        browserAddonInstall: f,
                        installCmdLine: M,
                        openCmdLine: F,
                        browserTitle: "Edge浏览器",
                        icon: "xly-img-icon-edge",
                        browserAddonOpen: g,
                        browserAddonConfigPath: h
                    }, this.browserInfos.set("msedge", B), M = "https://chrome.google.com/webstore/detail/%E8%BF%85%E9%9B%B7%E4%B8%8B%E8%BD%BD%E6%94%AF%E6%8C%81/ncennffkjdiamlpmcbajkmaiiiddgioo?hl=zh-CN", F = "qqbrowser://extensions/manage", L = this.getBrowserPath("QQBrowser", s), B = {
                        browserData: s,
                        browserExist: R = null !== s && "" !== L,
                        browserPath: L,
                        browserAddonPath: C,
                        browserAddonInstall: S,
                        installCmdLine: M,
                        openCmdLine: F,
                        browserTitle: "QQ浏览器",
                        icon: "xly-img-icon-qq",
                        browserAddonOpen: E,
                        browserAddonConfigPath: C
                    }, e ? this.browserInfos.set("QQBrowser", B) : S && this.browserInfos.set("QQBrowser", B), F = M = '"' + this.crxPath + '"', L = this.getBrowserPath("360chrome", r), B = {
                        browserData: r,
                        browserExist: R = null !== r && "" !== L,
                        browserPath: L,
                        browserAddonPath: T,
                        browserAddonInstall: w,
                        installCmdLine: M,
                        openCmdLine: F,
                        browserTitle: "360极速浏览器",
                        icon: "xly-img-icon-360js",
                        browserAddonOpen: N,
                        browserAddonConfigPath: A
                    }, this.browserInfos.set("360chrome", B), u.information("browserInfos", this.browserInfos);
                    let U = o.basename(i, ".exe"),
                        K = {icon: "", name: "", default: !1, install: !1, open: !1, exeName: ""};
                    if (-1 === this.browserNames.indexOf(U)) for (let e of this.browserNames) {
                        let t = this.browserInfos.get(e);
                        if (t && t.browserExist) break
                    } else {
                        let e = this.browserInfos.get(U);
                        if (e) {
                            let t = e.browserAddonInstall;
                            K = {
                                icon: e.icon,
                                name: e.browserTitle,
                                default: !0,
                                install: e.browserAddonOpen,
                                open: e.browserAddonInstall,
                                exeName: U
                            }, this.browserList.push(K), u.information("installed", t)
                        }
                    }
                    return this.browserInfos.forEach((e, t) => {
                        (!this.browserList || this.browserList.length < 1 || t !== this.browserList[0].exeName) && (K = {
                            icon: e.icon,
                            name: e.browserTitle,
                            default: !1,
                            install: e.browserAddonInstall,
                            open: e.browserAddonOpen,
                            exeName: t
                        }, this.browserList.push(K))
                    }), this.browserInfos
                })
            }
        };
        e.getInfos = function (e = !1) {
            return n(this, void 0, void 0, function* () {
                return t.getInfos(e)
            })
        }, e.getDefaultBrowserPath = function () {
            return t.getDefaultBrowserPath()
        }, e.getShowTipInfo = function (e = !1) {
            return n(this, void 0, void 0, function* () {
                let i = yield t.getInfos(e);
                return t.getShowTipInfo(i)
            })
        }, e.getCanShowIcon = function () {
            return n(this, void 0, void 0, function* () {
                return t.getCanShowIcon()
            })
        }
    }(t.BrowserHelperNs || (t.BrowserHelperNs = {}))
}, 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, i) {
    "use strict";
    i.r(t);
    var n = i(218);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\upgrade-task-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(389), a = i(220);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\upgrade-task.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(12), s = i(26), l = i(61), d = i(9), u = i(4),
        c = a.default.getLogger("PrivateSpace.Upgrade"), h = r.DownloadKernelTaskManager.getTaskManager(),
        f = s.DownloadKernelCategoryManager.getCategoryManager();

    class g {
        insertTaskToNewPrivateSpace(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1, a = yield l.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                return (!a || a.length <= 0) && (c.information("insertTaskToNewPrivateSpace taskId:", t.getId(), ", findInfo:", i), n = h.moveCategoryTask(t.getId(), e.getId())), n
            })
        }

        getOldPrivateSpaceTaskList() {
            let e = [], t = f.getCategorys();
            for (let [, i] of t) {
                let t = i.getName(), n = i.getUserName();
                if (t === s.CategoryManager.privateCategoryName && "0" === n) {
                    let t = i.getCategoryViews();
                    for (let i = 0; i < t.length; i++) {
                        let n = t[i].getTasks();
                        for (let [, t] of n) e.push(t)
                    }
                }
            }
            return e
        }

        insertTaskListToNewPrivateSpace(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1, i = this.getOldPrivateSpaceTaskList();
                for (let n = 0; n < i.length; n++) {
                    let a = i[n], r = a.getType();
                    if (c.information("addTaskListToNewPrivateSpace taskType:", r), r === o.DownloadKernel.TaskType.P2sp) {
                        let i = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskUrl),
                            n = {taskType: o.DownloadKernel.TaskType.P2sp, value: i};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, n)
                    } else if (r === o.DownloadKernel.TaskType.Bt) {
                        let i = a.getExtraObject().getInfoId(), n = {taskType: o.DownloadKernel.TaskType.Bt, value: i};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, n)
                    } else if (r === o.DownloadKernel.TaskType.Emule) {
                        let i = a.getExtraObject().getFileHash(),
                            n = {taskType: o.DownloadKernel.TaskType.Emule, value: i};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, n)
                    }
                }
                return t
            })
        }

        upgradePrivateSpace(e) {
            let t = !1, i = d.ConfigNS.getValue("TaskUpgrading", "UpgradedUsers", "");
            if (u.isString(i) || (i = ""), -1 === i.indexOf(e + ", ")) {
                let n = f.getPrivateCategoryFromUserId(e);
                n && (this.insertTaskListToNewPrivateSpace(n).catch(), i += e + ", ", d.ConfigNS.setValue("TaskUpgrading", "UpgradedUsers", i), 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, i) {
    "use strict";
    i.r(t);
    var n = i(380), a = i(222);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\toast-notify\\toast-notify.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(390), a = i(224);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\toast-notify\\get-coin-prize-toast.vue", t.default = s.exports
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(381), a = i(226);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\ad-platform\\ad-platform.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(382), a = i(228);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\ad-platform\\ad-left-bottom.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(230);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(391), a = i(232);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(768);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "109c4717", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(234);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\scan-code-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(421), a = i(236);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\scancode.vue", t.default = s.exports
}, function (e, t, i) {
    var n = i(712), a = i(486), o = i(730), r = i(742), s = i(743), l = i(744);

    function d(e, t, i) {
        if (void 0 === e) throw new Error("String required as first argument");
        if (void 0 === i && (i = t, t = {}), "function" != typeof i) {
            if (!n()) throw new Error("Callback required as last argument");
            t = i || {}, i = null
        }
        return {opts: t, cb: i}
    }

    function u(e) {
        switch (e) {
            case"svg":
                return l;
            case"txt":
            case"utf8":
                return r;
            case"png":
            case"image/png":
            default:
                return o
        }
    }

    function c(e, t, i) {
        if (!i.cb) return new Promise(function (n, o) {
            try {
                var r = a.create(t, i.opts);
                return e(r, i.opts, function (e, t) {
                    return e ? o(e) : n(t)
                })
            } catch (e) {
                o(e)
            }
        });
        try {
            var n = a.create(t, i.opts);
            return e(n, i.opts, i.cb)
        } catch (e) {
            i.cb(e)
        }
    }

    t.create = a.create, t.toCanvas = i(745).toCanvas, t.toString = function (e, t, i) {
        var n = d(e, t, i);
        return c(function (e) {
            switch (e) {
                case"svg":
                    return l;
                case"terminal":
                    return s;
                case"utf8":
                default:
                    return r
            }
        }(n.opts.type).render, e, n)
    }, t.toDataURL = function (e, t, i) {
        var n = d(e, t, i);
        return c(u(n.opts.type).renderToDataURL, e, n)
    }, t.toBuffer = function (e, t, i) {
        var n = d(e, t, i);
        return c(u(n.opts.type).renderToBuffer, e, n)
    }, t.toFile = function (e, t, i, a) {
        if ("string" != typeof e || "string" != typeof t && "object" != typeof t) throw new Error("Invalid argument");
        if (arguments.length < 3 && !n()) throw new Error("Too few arguments provided");
        var o = d(t, i, a);
        return c(u(o.opts.type || function (e) {
            return e.slice(2 + (e.lastIndexOf(".") - 1 >>> 0)).toLowerCase()
        }(e)).renderToFile.bind(null, e), t, o)
    }, t.toFileStream = function (e, t, i) {
        if (arguments.length < 2) throw new Error("Too few arguments provided");
        var n = d(t, i, e.emit.bind(e, "error"));
        c(u("png").renderToFileStream.bind(null, e), t, n)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(713);
    e.exports = function () {
        return "function" == typeof n.Promise && "function" == typeof n.Promise.prototype.then
    }
}, function (e, t, i) {
    "use strict";
    e.exports = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || this
}, function (e, t) {
    function i() {
        this.buffer = [], this.length = 0
    }

    i.prototype = {
        get: function (e) {
            var t = Math.floor(e / 8);
            return 1 == (this.buffer[t] >>> 7 - e % 8 & 1)
        }, put: function (e, t) {
            for (var i = 0; i < t; i++) this.putBit(1 == (e >>> t - i - 1 & 1))
        }, getLengthInBits: function () {
            return this.length
        }, putBit: function (e) {
            var t = Math.floor(this.length / 8);
            this.buffer.length <= t && this.buffer.push(0), e && (this.buffer[t] |= 128 >>> this.length % 8), this.length++
        }
    }, e.exports = i
}, function (e, t, i) {
    var n = i(91);

    function a(e) {
        if (!e || e < 1) throw new Error("BitMatrix size must be defined and greater than 0");
        this.size = e, this.data = new n(e * e), this.data.fill(0), this.reservedBit = new n(e * e), this.reservedBit.fill(0)
    }

    a.prototype.set = function (e, t, i, n) {
        var a = e * this.size + t;
        this.data[a] = i, n && (this.reservedBit[a] = !0)
    }, a.prototype.get = function (e, t) {
        return this.data[e * this.size + t]
    }, a.prototype.xor = function (e, t, i) {
        this.data[e * this.size + t] ^= i
    }, a.prototype.isReserved = function (e, t) {
        return this.reservedBit[e * this.size + t]
    }, e.exports = a
}, function (e, t, i) {
    var n = i(81).getSymbolSize;
    t.getRowColCoords = function (e) {
        if (1 === e) return [];
        for (var t = Math.floor(e / 7) + 2, i = n(e), a = 145 === i ? 26 : 2 * Math.ceil((i - 13) / (2 * t - 2)), o = [i - 7], r = 1; r < t - 1; r++) o[r] = o[r - 1] - a;
        return o.push(6), o.reverse()
    }, t.getPositions = function (e) {
        for (var i = [], n = t.getRowColCoords(e), a = n.length, o = 0; o < a; o++) for (var r = 0; r < a; r++) 0 === o && 0 === r || 0 === o && r === a - 1 || o === a - 1 && 0 === r || i.push([n[o], n[r]]);
        return i
    }
}, function (e, t, i) {
    var n = i(81).getSymbolSize;
    t.getPositions = function (e) {
        var t = n(e);
        return [[0, 0], [t - 7, 0], [0, t - 7]]
    }
}, function (e, t) {
    t.Patterns = {
        PATTERN000: 0,
        PATTERN001: 1,
        PATTERN010: 2,
        PATTERN011: 3,
        PATTERN100: 4,
        PATTERN101: 5,
        PATTERN110: 6,
        PATTERN111: 7
    };
    var i = 3, n = 3, a = 40, o = 10;

    function r(e, i, n) {
        switch (e) {
            case t.Patterns.PATTERN000:
                return (i + n) % 2 == 0;
            case t.Patterns.PATTERN001:
                return i % 2 == 0;
            case t.Patterns.PATTERN010:
                return n % 3 == 0;
            case t.Patterns.PATTERN011:
                return (i + n) % 3 == 0;
            case t.Patterns.PATTERN100:
                return (Math.floor(i / 2) + Math.floor(n / 3)) % 2 == 0;
            case t.Patterns.PATTERN101:
                return i * n % 2 + i * n % 3 == 0;
            case t.Patterns.PATTERN110:
                return (i * n % 2 + i * n % 3) % 2 == 0;
            case t.Patterns.PATTERN111:
                return (i * n % 3 + (i + n) % 2) % 2 == 0;
            default:
                throw new Error("bad maskPattern:" + e)
        }
    }

    t.isValid = function (e) {
        return null != e && "" !== e && !isNaN(e) && e >= 0 && e <= 7
    }, t.from = function (e) {
        return t.isValid(e) ? parseInt(e, 10) : void 0
    }, t.getPenaltyN1 = function (e) {
        for (var t = e.size, n = 0, a = 0, o = 0, r = null, s = null, l = 0; l < t; l++) {
            a = o = 0, r = s = null;
            for (var d = 0; d < t; d++) {
                var u = e.get(l, d);
                u === r ? a++ : (a >= 5 && (n += i + (a - 5)), r = u, a = 1), (u = e.get(d, l)) === s ? o++ : (o >= 5 && (n += i + (o - 5)), s = u, o = 1)
            }
            a >= 5 && (n += i + (a - 5)), o >= 5 && (n += i + (o - 5))
        }
        return n
    }, t.getPenaltyN2 = function (e) {
        for (var t = e.size, i = 0, a = 0; a < t - 1; a++) for (var o = 0; o < t - 1; o++) {
            var r = e.get(a, o) + e.get(a, o + 1) + e.get(a + 1, o) + e.get(a + 1, o + 1);
            4 !== r && 0 !== r || i++
        }
        return i * n
    }, t.getPenaltyN3 = function (e) {
        for (var t = e.size, i = 0, n = 0, o = 0, r = 0; r < t; r++) {
            n = o = 0;
            for (var s = 0; s < t; s++) n = n << 1 & 2047 | e.get(r, s), s >= 10 && (1488 === n || 93 === n) && i++, o = o << 1 & 2047 | e.get(s, r), s >= 10 && (1488 === o || 93 === o) && i++
        }
        return i * a
    }, t.getPenaltyN4 = function (e) {
        for (var t = 0, i = e.data.length, n = 0; n < i; n++) t += e.data[n];
        return Math.abs(Math.ceil(100 * t / i / 5) - 10) * o
    }, t.applyMask = function (e, t) {
        for (var i = t.size, n = 0; n < i; n++) for (var a = 0; a < i; a++) t.isReserved(a, n) || t.xor(a, n, r(e, a, n))
    }, t.getBestMask = function (e, i) {
        for (var n = Object.keys(t.Patterns).length, a = 0, o = 1 / 0, r = 0; r < n; r++) {
            i(r), t.applyMask(r, e);
            var s = t.getPenaltyN1(e) + t.getPenaltyN2(e) + t.getPenaltyN3(e) + t.getPenaltyN4(e);
            t.applyMask(r, e), s < o && (o = s, a = r)
        }
        return a
    }
}, function (e, t, i) {
    var n = i(91), a = i(720);

    function o(e) {
        this.genPoly = void 0, this.degree = e, this.degree && this.initialize(this.degree)
    }

    o.prototype.initialize = function (e) {
        this.degree = e, this.genPoly = a.generateECPolynomial(this.degree)
    }, o.prototype.encode = function (e) {
        if (!this.genPoly) throw new Error("Encoder not initialized");
        var t = new n(this.degree);
        t.fill(0);
        var i = n.concat([e, t], e.length + this.degree), o = a.mod(i, this.genPoly), r = this.degree - o.length;
        if (r > 0) {
            var s = new n(this.degree);
            return s.fill(0), o.copy(s, r), s
        }
        return o
    }, e.exports = o
}, function (e, t, i) {
    var n = i(91), a = i(721);
    t.mul = function (e, t) {
        var i = new n(e.length + t.length - 1);
        i.fill(0);
        for (var o = 0; o < e.length; o++) for (var r = 0; r < t.length; r++) i[o + r] ^= a.mul(e[o], t[r]);
        return i
    }, t.mod = function (e, t) {
        for (var i = new n(e); i.length - t.length >= 0;) {
            for (var o = i[0], r = 0; r < t.length; r++) i[r] ^= a.mul(t[r], o);
            for (var s = 0; s < i.length && 0 === i[s];) s++;
            i = i.slice(s)
        }
        return i
    }, t.generateECPolynomial = function (e) {
        for (var i = new n([1]), o = 0; o < e; o++) i = t.mul(i, [1, a.exp(o)]);
        return i
    }
}, function (e, t, i) {
    var n = i(91);
    if (n.alloc) var a = n.alloc(512), o = n.alloc(256); else a = new n(512), o = new n(256);
    !function () {
        for (var e = 1, t = 0; t < 255; t++) a[t] = e, o[e] = t, 256 & (e <<= 1) && (e ^= 285);
        for (t = 255; t < 512; t++) a[t] = a[t - 255]
    }(), t.log = function (e) {
        if (e < 1) throw new Error("log(" + e + ")");
        return o[e]
    }, t.exp = function (e) {
        return a[e]
    }, t.mul = function (e, t) {
        return 0 === e || 0 === t ? 0 : a[o[e] + o[t]]
    }
}, function (e, t, i) {
    var n = i(81), a = i(487), o = i(365), r = i(82), s = i(488), l = i(490), d = n.getBCHDigit(7973);

    function u(e, t) {
        return r.getCharCountIndicator(e, t) + 4
    }

    function c(e, t) {
        var i = 0;
        return e.forEach(function (e) {
            var n = u(e.mode, t);
            i += n + e.getBitsLength()
        }), i
    }

    t.from = function (e, t) {
        return s.isValid(e) ? parseInt(e, 10) : t
    }, t.getCapacity = function (e, t, i) {
        if (!s.isValid(e)) throw new Error("Invalid QR Code version");
        void 0 === i && (i = r.BYTE);
        var o = 8 * (n.getSymbolTotalCodewords(e) - a.getTotalCodewordsCount(e, t));
        if (i === r.MIXED) return o;
        var l = o - u(i, e);
        switch (i) {
            case r.NUMERIC:
                return Math.floor(l / 10 * 3);
            case r.ALPHANUMERIC:
                return Math.floor(l / 11 * 2);
            case r.KANJI:
                return Math.floor(l / 13);
            case r.BYTE:
            default:
                return Math.floor(l / 8)
        }
    }, t.getBestVersionForData = function (e, i) {
        var n, a = o.from(i, o.M);
        if (l(e)) {
            if (e.length > 1) return function (e, i) {
                for (var n = 1; n <= 40; n++) if (c(e, n) <= t.getCapacity(n, i, r.MIXED)) return n
            }(e, a);
            if (0 === e.length) return 1;
            n = e[0]
        } else n = e;
        return function (e, i, n) {
            for (var a = 1; a <= 40; a++) if (i <= t.getCapacity(a, n, e)) return a
        }(n.mode, n.getLength(), a)
    }, t.getEncodedBits = function (e) {
        if (!s.isValid(e) || e < 7) throw new Error("Invalid QR Code version");
        for (var t = e << 12; n.getBCHDigit(t) - d >= 0;) t ^= 7973 << n.getBCHDigit(t) - d;
        return e << 12 | t
    }
}, function (e, t, i) {
    var n = i(81), a = n.getBCHDigit(1335);
    t.getEncodedBits = function (e, t) {
        for (var i = e.bit << 3 | t, o = i << 10; n.getBCHDigit(o) - a >= 0;) o ^= 1335 << n.getBCHDigit(o) - a;
        return 21522 ^ (i << 10 | o)
    }
}, function (e, t, i) {
    var n = i(82), a = i(725), o = i(726), r = i(727), s = i(728), l = i(489), d = i(81), u = i(729);

    function c(e) {
        return unescape(encodeURIComponent(e)).length
    }

    function h(e, t, i) {
        for (var n, a = []; null !== (n = e.exec(i));) a.push({
            data: n[0],
            index: n.index,
            mode: t,
            length: n[0].length
        });
        return a
    }

    function f(e) {
        var t, i, a = h(l.NUMERIC, n.NUMERIC, e), o = h(l.ALPHANUMERIC, n.ALPHANUMERIC, e);
        return d.isKanjiModeEnabled() ? (t = h(l.BYTE, n.BYTE, e), i = h(l.KANJI, n.KANJI, e)) : (t = h(l.BYTE_KANJI, n.BYTE, e), i = []), a.concat(o, t, i).sort(function (e, t) {
            return e.index - t.index
        }).map(function (e) {
            return {data: e.data, mode: e.mode, length: e.length}
        })
    }

    function g(e, t) {
        switch (t) {
            case n.NUMERIC:
                return a.getBitsLength(e);
            case n.ALPHANUMERIC:
                return o.getBitsLength(e);
            case n.KANJI:
                return s.getBitsLength(e);
            case n.BYTE:
                return r.getBitsLength(e)
        }
    }

    function p(e, t) {
        var i, l = n.getBestModeForData(e);
        if ((i = n.from(t, l)) !== n.BYTE && i.bit < l.bit) throw new Error('"' + e + '" cannot be encoded with mode ' + n.toString(i) + ".\n Suggested mode is: " + n.toString(l));
        switch (i !== n.KANJI || d.isKanjiModeEnabled() || (i = n.BYTE), i) {
            case n.NUMERIC:
                return new a(e);
            case n.ALPHANUMERIC:
                return new o(e);
            case n.KANJI:
                return new s(e);
            case n.BYTE:
                return new r(e)
        }
    }

    t.fromArray = function (e) {
        return e.reduce(function (e, t) {
            return "string" == typeof t ? e.push(p(t, null)) : t.data && e.push(p(t.data, t.mode)), e
        }, [])
    }, t.fromString = function (e, i) {
        for (var a = function (e, t) {
            for (var i = {}, a = {start: {}}, o = ["start"], r = 0; r < e.length; r++) {
                for (var s = e[r], l = [], d = 0; d < s.length; d++) {
                    var u = s[d], c = "" + r + d;
                    l.push(c), i[c] = {node: u, lastCount: 0}, a[c] = {};
                    for (var h = 0; h < o.length; h++) {
                        var f = o[h];
                        i[f] && i[f].node.mode === u.mode ? (a[f][c] = g(i[f].lastCount + u.length, u.mode) - g(i[f].lastCount, u.mode), i[f].lastCount += u.length) : (i[f] && (i[f].lastCount = u.length), a[f][c] = g(u.length, u.mode) + 4 + n.getCharCountIndicator(u.mode, t))
                    }
                }
                o = l
            }
            for (h = 0; h < o.length; h++) a[o[h]].end = 0;
            return {map: a, table: i}
        }(function (e) {
            for (var t = [], i = 0; i < e.length; i++) {
                var a = e[i];
                switch (a.mode) {
                    case n.NUMERIC:
                        t.push([a, {data: a.data, mode: n.ALPHANUMERIC, length: a.length}, {
                            data: a.data,
                            mode: n.BYTE,
                            length: a.length
                        }]);
                        break;
                    case n.ALPHANUMERIC:
                        t.push([a, {data: a.data, mode: n.BYTE, length: a.length}]);
                        break;
                    case n.KANJI:
                        t.push([a, {data: a.data, mode: n.BYTE, length: c(a.data)}]);
                        break;
                    case n.BYTE:
                        t.push([{data: a.data, mode: n.BYTE, length: c(a.data)}])
                }
            }
            return t
        }(f(e, d.isKanjiModeEnabled())), i), o = u.find_path(a.map, "start", "end"), r = [], s = 1; s < o.length - 1; s++) r.push(a.table[o[s]].node);
        return t.fromArray(function (e) {
            return e.reduce(function (e, t) {
                var i = e.length - 1 >= 0 ? e[e.length - 1] : null;
                return i && i.mode === t.mode ? (e[e.length - 1].data += t.data, e) : (e.push(t), e)
            }, [])
        }(r))
    }, t.rawSplit = function (e) {
        return t.fromArray(f(e, d.isKanjiModeEnabled()))
    }
}, function (e, t, i) {
    var n = i(82);

    function a(e) {
        this.mode = n.NUMERIC, this.data = e.toString()
    }

    a.getBitsLength = function (e) {
        return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0)
    }, a.prototype.getLength = function () {
        return this.data.length
    }, a.prototype.getBitsLength = function () {
        return a.getBitsLength(this.data.length)
    }, a.prototype.write = function (e) {
        var t, i, n;
        for (t = 0; t + 3 <= this.data.length; t += 3) i = this.data.substr(t, 3), n = parseInt(i, 10), e.put(n, 10);
        var a = this.data.length - t;
        a > 0 && (i = this.data.substr(t), n = parseInt(i, 10), e.put(n, 3 * a + 1))
    }, e.exports = a
}, function (e, t, i) {
    var n = i(82),
        a = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", " ", "$", "%", "*", "+", "-", ".", "/", ":"];

    function o(e) {
        this.mode = n.ALPHANUMERIC, this.data = e
    }

    o.getBitsLength = function (e) {
        return 11 * Math.floor(e / 2) + e % 2 * 6
    }, o.prototype.getLength = function () {
        return this.data.length
    }, o.prototype.getBitsLength = function () {
        return o.getBitsLength(this.data.length)
    }, o.prototype.write = function (e) {
        var t;
        for (t = 0; t + 2 <= this.data.length; t += 2) {
            var i = 45 * a.indexOf(this.data[t]);
            i += a.indexOf(this.data[t + 1]), e.put(i, 11)
        }
        this.data.length % 2 && e.put(a.indexOf(this.data[t]), 6)
    }, e.exports = o
}, function (e, t, i) {
    var n = i(91), a = i(82);

    function o(e) {
        this.mode = a.BYTE, this.data = new n(e)
    }

    o.getBitsLength = function (e) {
        return 8 * e
    }, o.prototype.getLength = function () {
        return this.data.length
    }, o.prototype.getBitsLength = function () {
        return o.getBitsLength(this.data.length)
    }, o.prototype.write = function (e) {
        for (var t = 0, i = this.data.length; t < i; t++) e.put(this.data[t], 8)
    }, e.exports = o
}, function (e, t, i) {
    var n = i(82), a = i(81);

    function o(e) {
        this.mode = n.KANJI, this.data = e
    }

    o.getBitsLength = function (e) {
        return 13 * e
    }, o.prototype.getLength = function () {
        return this.data.length
    }, o.prototype.getBitsLength = function () {
        return o.getBitsLength(this.data.length)
    }, o.prototype.write = function (e) {
        var t;
        for (t = 0; t < this.data.length; t++) {
            var i = a.toSJIS(this.data[t]);
            if (i >= 33088 && i <= 40956) i -= 33088; else {
                if (!(i >= 57408 && i <= 60351)) throw new Error("Invalid SJIS character: " + this.data[t] + "\nMake sure your charset is UTF-8");
                i -= 49472
            }
            i = 192 * (i >>> 8 & 255) + (255 & i), e.put(i, 13)
        }
    }, e.exports = o
}, function (e, t, i) {
    "use strict";
    var n = {
        single_source_shortest_paths: function (e, t, i) {
            var a = {}, o = {};
            o[t] = 0;
            var r, s, l, d, u, c, h, f = n.PriorityQueue.make();
            for (f.push(t, 0); !f.empty();) for (l in s = (r = f.pop()).value, d = r.cost, u = e[s] || {}) u.hasOwnProperty(l) && (c = d + u[l], h = o[l], (void 0 === o[l] || h > c) && (o[l] = c, f.push(l, c), a[l] = s));
            if (void 0 !== i && void 0 === o[i]) {
                var g = ["Could not find a path from ", t, " to ", i, "."].join("");
                throw new Error(g)
            }
            return a
        }, extract_shortest_path_from_predecessor_list: function (e, t) {
            for (var i = [], n = t; n;) i.push(n), e[n], n = e[n];
            return i.reverse(), i
        }, find_path: function (e, t, i) {
            var a = n.single_source_shortest_paths(e, t, i);
            return n.extract_shortest_path_from_predecessor_list(a, i)
        }, PriorityQueue: {
            make: function (e) {
                var t, i = n.PriorityQueue, a = {};
                for (t in e = e || {}, i) i.hasOwnProperty(t) && (a[t] = i[t]);
                return a.queue = [], a.sorter = e.sorter || i.default_sorter, a
            }, default_sorter: function (e, t) {
                return e.cost - t.cost
            }, push: function (e, t) {
                var i = {value: e, cost: t};
                this.queue.push(i), this.queue.sort(this.sorter)
            }, pop: function () {
                return this.queue.shift()
            }, empty: function () {
                return 0 === this.queue.length
            }
        }
    };
    e.exports = n
}, function (e, t, i) {
    var n = i(45), a = i(731).PNG, o = i(148);
    t.render = function (e, t) {
        var i = o.getOptions(t), n = i.rendererOpts, r = o.getImageWidth(e.modules.size, i);
        n.width = r, n.height = r;
        var s = new a(n);
        return o.qrToImageData(s.data, e, i), s
    }, t.renderToDataURL = function (e, i, n) {
        void 0 === n && (n = i, i = void 0), t.renderToBuffer(e, i, function (e, t) {
            e && n(e);
            var i = "data:image/png;base64,";
            i += t.toString("base64"), n(null, i)
        })
    }, t.renderToBuffer = function (e, i, n) {
        void 0 === n && (n = i, i = void 0);
        var a = t.render(e, i), o = [];
        a.on("error", n), a.on("data", function (e) {
            o.push(e)
        }), a.on("end", function () {
            n(null, Buffer.concat(o))
        }), a.pack()
    }, t.renderToFile = function (e, i, a, o) {
        void 0 === o && (o = a, a = void 0);
        var r = n.createWriteStream(e);
        r.on("error", o), r.on("close", o), t.renderToFileStream(r, i, a)
    }, t.renderToFileStream = function (e, i, n) {
        t.render(i, n).pack().pipe(e)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(97), o = i(732), r = i(734), s = i(737), l = t.PNG = function (e) {
        a.call(this), e = e || {}, this.width = 0 | e.width, this.height = 0 | e.height, this.data = this.width > 0 && this.height > 0 ? new Buffer(4 * this.width * this.height) : null, e.fill && this.data && this.data.fill(0), this.gamma = 0, this.readable = this.writable = !0, this._parser = new o(e), this._parser.on("error", this.emit.bind(this, "error")), this._parser.on("close", this._handleClose.bind(this)), this._parser.on("metadata", this._metadata.bind(this)), this._parser.on("gamma", this._gamma.bind(this)), this._parser.on("parsed", function (e) {
            this.data = e, this.emit("parsed", e)
        }.bind(this)), this._packer = new r(e), this._packer.on("data", this.emit.bind(this, "data")), this._packer.on("end", this.emit.bind(this, "end")), this._parser.on("close", this._handleClose.bind(this)), this._packer.on("error", this.emit.bind(this, "error"))
    };
    n.inherits(l, a), l.sync = s, l.prototype.pack = function () {
        return this.data && this.data.length ? (process.nextTick(function () {
            this._packer.pack(this.data, this.width, this.height, this.gamma)
        }.bind(this)), this) : (this.emit("error", "No data provided"), this)
    }, l.prototype.parse = function (e, t) {
        var i, n;
        t && (i = function (e) {
            this.removeListener("error", n), this.data = e, t(null, this)
        }.bind(this), n = function (e) {
            this.removeListener("parsed", i), t(e, null)
        }.bind(this), this.once("parsed", i), this.once("error", n));
        return this.end(e), this
    }, l.prototype.write = function (e) {
        return this._parser.write(e), !0
    }, l.prototype.end = function (e) {
        this._parser.end(e)
    }, l.prototype._metadata = function (e) {
        this.width = e.width, this.height = e.height, this.emit("metadata", e)
    }, l.prototype._gamma = function (e) {
        this.gamma = e
    }, l.prototype._handleClose = function () {
        this._parser.writable || this._packer.readable || this.emit("close")
    }, l.bitblt = function (e, t, i, n, a, o, r, s) {
        if (n |= 0, a |= 0, o |= 0, r |= 0, s |= 0, (i |= 0) > e.width || n > e.height || i + a > e.width || n + o > e.height) throw new Error("bitblt reading outside image");
        if (r > t.width || s > t.height || r + a > t.width || s + o > t.height) throw new Error("bitblt writing outside image");
        for (var l = 0; l < o; l++) e.data.copy(t.data, (s + l) * t.width + r << 2, (n + l) * e.width + i << 2, (n + l) * e.width + i + a << 2)
    }, l.prototype.bitblt = function (e, t, i, n, a, o, r) {
        return l.bitblt(this, e, t, i, n, a, o, r), this
    }, l.adjustGamma = function (e) {
        if (e.gamma) {
            for (var t = 0; t < e.height; t++) for (var i = 0; i < e.width; i++) for (var n = e.width * t + i << 2, a = 0; a < 3; a++) {
                var o = e.data[n + a] / 255;
                o = Math.pow(o, 1 / 2.2 / e.gamma), e.data[n + a] = Math.round(255 * o)
            }
            e.gamma = 0
        }
    }, l.prototype.adjustGamma = function () {
        l.adjustGamma(this)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(74), o = i(491), r = i(733), s = i(495), l = i(497), d = i(498), u = e.exports = function (e) {
        o.call(this), this._parser = new s(e, {
            read: this.read.bind(this),
            error: this._handleError.bind(this),
            metadata: this._handleMetaData.bind(this),
            gamma: this.emit.bind(this, "gamma"),
            palette: this._handlePalette.bind(this),
            transColor: this._handleTransColor.bind(this),
            finished: this._finished.bind(this),
            inflateData: this._inflateData.bind(this)
        }), this._options = e, this.writable = !0, this._parser.start()
    };
    n.inherits(u, o), u.prototype._handleError = function (e) {
        this.emit("error", e), this.writable = !1, this.destroy(), this._inflate && this._inflate.destroy && this._inflate.destroy(), this._filter && (this._filter.destroy(), this._filter.on("error", function () {
        })), this.errord = !0
    }, u.prototype._inflateData = function (e) {
        if (!this._inflate) if (this._bitmapInfo.interlace) this._inflate = a.createInflate(), this._inflate.on("error", this.emit.bind(this, "error")), this._filter.on("complete", this._complete.bind(this)), this._inflate.pipe(this._filter); else {
            var t = (1 + (this._bitmapInfo.width * this._bitmapInfo.bpp * this._bitmapInfo.depth + 7 >> 3)) * this._bitmapInfo.height,
                i = Math.max(t, a.Z_MIN_CHUNK);
            this._inflate = a.createInflate({chunkSize: i});
            var n = t, o = this.emit.bind(this, "error");
            this._inflate.on("error", function (e) {
                n && o(e)
            }), this._filter.on("complete", this._complete.bind(this));
            var r = this._filter.write.bind(this._filter);
            this._inflate.on("data", function (e) {
                n && (e.length > n && (e = e.slice(0, n)), n -= e.length, r(e))
            }), this._inflate.on("end", this._filter.end.bind(this._filter))
        }
        this._inflate.write(e)
    }, u.prototype._handleMetaData = function (e) {
        this.emit("metadata", e), this._bitmapInfo = Object.create(e), this._filter = new r(this._bitmapInfo)
    }, u.prototype._handleTransColor = function (e) {
        this._bitmapInfo.transColor = e
    }, u.prototype._handlePalette = function (e) {
        this._bitmapInfo.palette = e
    }, u.prototype._finished = function () {
        this.errord || (this._inflate ? this._inflate.end() : this.emit("error", "No Inflate block"), this.destroySoon())
    }, u.prototype._complete = function (e) {
        if (!this.errord) {
            try {
                var t = l.dataToBitMap(e, this._bitmapInfo), i = d(t, this._bitmapInfo);
                t = null
            } catch (e) {
                return void this._handleError(e)
            }
            this.emit("parsed", i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(491), o = i(492), r = e.exports = function (e) {
        a.call(this);
        var t = [], i = this;
        this._filter = new o(e, {
            read: this.read.bind(this), write: function (e) {
                t.push(e)
            }, complete: function () {
                i.emit("complete", Buffer.concat(t))
            }
        }), this._filter.start()
    };
    n.inherits(r, a)
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(97), o = i(110), r = i(499), s = e.exports = function (e) {
        a.call(this);
        var t = e || {};
        this._packer = new r(t), this._deflate = this._packer.createDeflate(), this.readable = !0
    };
    n.inherits(s, a), s.prototype.pack = function (e, t, i, n) {
        this.emit("data", new Buffer(o.PNG_SIGNATURE)), this.emit("data", this._packer.packIHDR(t, i)), n && this.emit("data", this._packer.packGAMA(n));
        var a = this._packer.filterData(e, t, i);
        this._deflate.on("error", this.emit.bind(this, "error")), this._deflate.on("data", function (e) {
            this.emit("data", this._packer.packIDAT(e))
        }.bind(this)), this._deflate.on("end", function () {
            this.emit("data", this._packer.packIEND()), this.emit("end")
        }.bind(this)), this._deflate.end(a)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(110);
    e.exports = function (e, t, i, a) {
        var o, r = -1 !== [n.COLORTYPE_COLOR_ALPHA, n.COLORTYPE_ALPHA].indexOf(a.colorType);
        if (a.colorType === a.inputColorType) {
            var s = (o = new ArrayBuffer(2), new DataView(o).setInt16(0, 256, !0), 256 !== new Int16Array(o)[0]);
            if (8 === a.bitDepth || 16 === a.bitDepth && s) return e
        }
        var l = 16 !== a.bitDepth ? e : new Uint16Array(e.buffer), d = 255,
            u = n.COLORTYPE_TO_BPP_MAP[a.inputColorType];
        4 != u || a.inputHasAlpha || (u = 3);
        var c = n.COLORTYPE_TO_BPP_MAP[a.colorType];
        16 === a.bitDepth && (d = 65535, c *= 2);
        var h = new Buffer(t * i * c), f = 0, g = 0, p = a.bgColor || {};

        function v(e, t) {
            var i, o, s, l = d;
            switch (a.inputColorType) {
                case n.COLORTYPE_COLOR_ALPHA:
                    l = e[t + 3], i = e[t], o = e[t + 1], s = e[t + 2];
                    break;
                case n.COLORTYPE_COLOR:
                    i = e[t], o = e[t + 1], s = e[t + 2];
                    break;
                case n.COLORTYPE_ALPHA:
                    l = e[t + 1], o = i = e[t], s = i;
                    break;
                case n.COLORTYPE_GRAYSCALE:
                    o = i = e[t], s = i;
                    break;
                default:
                    throw new Error("input color type:" + a.inputColorType + " is not supported at present")
            }
            return a.inputHasAlpha && (r || (l /= d, i = Math.min(Math.max(Math.round((1 - l) * p.red + l * i), 0), d), o = Math.min(Math.max(Math.round((1 - l) * p.green + l * o), 0), d), s = Math.min(Math.max(Math.round((1 - l) * p.blue + l * s), 0), d))), {
                red: i,
                green: o,
                blue: s,
                alpha: l
            }
        }

        void 0 === p.red && (p.red = d), void 0 === p.green && (p.green = d), void 0 === p.blue && (p.blue = d);
        for (var m = 0; m < i; m++) for (var y = 0; y < t; y++) {
            var k = v(l, f);
            switch (a.colorType) {
                case n.COLORTYPE_COLOR_ALPHA:
                case n.COLORTYPE_COLOR:
                    8 === a.bitDepth ? (h[g] = k.red, h[g + 1] = k.green, h[g + 2] = k.blue, r && (h[g + 3] = k.alpha)) : (h.writeUInt16BE(k.red, g), h.writeUInt16BE(k.green, g + 2), h.writeUInt16BE(k.blue, g + 4), r && h.writeUInt16BE(k.alpha, g + 6));
                    break;
                case n.COLORTYPE_ALPHA:
                case n.COLORTYPE_GRAYSCALE:
                    var T = (k.red + k.green + k.blue) / 3;
                    8 === a.bitDepth ? (h[g] = T, r && (h[g + 1] = k.alpha)) : (h.writeUInt16BE(T, g), r && h.writeUInt16BE(k.alpha, g + 2))
            }
            f += u, g += c
        }
        return h
    }
}, function (e, t, i) {
    "use strict";
    var n = i(494);
    var a = {
        0: function (e, t, i, n, a) {
            for (var o = 0; o < i; o++) n[a + o] = e[t + o]
        }, 1: function (e, t, i, n, a, o) {
            for (var r = 0; r < i; r++) {
                var s = r >= o ? e[t + r - o] : 0, l = e[t + r] - s;
                n[a + r] = l
            }
        }, 2: function (e, t, i, n, a) {
            for (var o = 0; o < i; o++) {
                var r = t > 0 ? e[t + o - i] : 0, s = e[t + o] - r;
                n[a + o] = s
            }
        }, 3: function (e, t, i, n, a, o) {
            for (var r = 0; r < i; r++) {
                var s = r >= o ? e[t + r - o] : 0, l = t > 0 ? e[t + r - i] : 0, d = e[t + r] - (s + l >> 1);
                n[a + r] = d
            }
        }, 4: function (e, t, i, a, o, r) {
            for (var s = 0; s < i; s++) {
                var l = s >= r ? e[t + s - r] : 0, d = t > 0 ? e[t + s - i] : 0,
                    u = t > 0 && s >= r ? e[t + s - (i + r)] : 0, c = e[t + s] - n(l, d, u);
                a[o + s] = c
            }
        }
    }, o = {
        0: function (e, t, i) {
            for (var n = 0, a = t + i, o = t; o < a; o++) n += Math.abs(e[o]);
            return n
        }, 1: function (e, t, i, n) {
            for (var a = 0, o = 0; o < i; o++) {
                var r = o >= n ? e[t + o - n] : 0, s = e[t + o] - r;
                a += Math.abs(s)
            }
            return a
        }, 2: function (e, t, i) {
            for (var n = 0, a = t + i, o = t; o < a; o++) {
                var r = t > 0 ? e[o - i] : 0, s = e[o] - r;
                n += Math.abs(s)
            }
            return n
        }, 3: function (e, t, i, n) {
            for (var a = 0, o = 0; o < i; o++) {
                var r = o >= n ? e[t + o - n] : 0, s = t > 0 ? e[t + o - i] : 0, l = e[t + o] - (r + s >> 1);
                a += Math.abs(l)
            }
            return a
        }, 4: function (e, t, i, a) {
            for (var o = 0, r = 0; r < i; r++) {
                var s = r >= a ? e[t + r - a] : 0, l = t > 0 ? e[t + r - i] : 0,
                    d = t > 0 && r >= a ? e[t + r - (i + a)] : 0, u = e[t + r] - n(s, l, d);
                o += Math.abs(u)
            }
            return o
        }
    };
    e.exports = function (e, t, i, n, r) {
        var s;
        if ("filterType" in n && -1 !== n.filterType) {
            if ("number" != typeof n.filterType) throw new Error("unrecognised filter types");
            s = [n.filterType]
        } else s = [0, 1, 2, 3, 4];
        16 === n.bitDepth && (r *= 2);
        for (var l = t * r, d = 0, u = 0, c = new Buffer((l + 1) * i), h = s[0], f = 0; f < i; f++) {
            if (s.length > 1) for (var g = 1 / 0, p = 0; p < s.length; p++) {
                var v = o[s[p]](e, u, l, r);
                v < g && (h = s[p], g = v)
            }
            c[d] = h, d++, a[h](e, u, l, c, d, r), d += l, u += l
        }
        return c
    }
}, function (e, t, i) {
    "use strict";
    var n = i(738), a = i(741);
    t.read = function (e, t) {
        return n(e, t || {})
    }, t.write = function (e, t) {
        return a(e, t)
    }
}, function (e, t, i) {
    "use strict";
    var n = !0, a = i(74), o = i(739);
    a.deflateSync || (n = !1);
    var r = i(500), s = i(740), l = i(495), d = i(497), u = i(498);
    e.exports = function (e, t) {
        if (!n) throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");
        var i, c, h;
        var f = [];
        var g = new r(e);
        if (new l(t, {
            read: g.read.bind(g), error: function (e) {
                i = e
            }, metadata: function (e) {
                c = e
            }, gamma: function (e) {
                h = e
            }, palette: function (e) {
                c.palette = e
            }, transColor: function (e) {
                c.transColor = e
            }, inflateData: function (e) {
                f.push(e)
            }
        }).start(), g.process(), i) throw i;
        var p, v = Buffer.concat(f);
        if (f.length = 0, c.interlace) p = a.inflateSync(v); else {
            var m = (1 + (c.width * c.bpp * c.depth + 7 >> 3)) * c.height;
            p = o(v, {chunkSize: m, maxLength: m})
        }
        if (v = null, !p || !p.length) throw new Error("bad png - invalid inflate data response");
        var y = s.process(p, c);
        v = null;
        var k = d.dataToBitMap(y, c);
        y = null;
        var T = u(k, c);
        return c.data = T, c.gamma = h || 0, c
    }
}, function (e, t, i) {
    "use strict";
    var n = i(442).ok, a = i(74), o = i(4), r = i(116).kMaxLength;

    function s(e) {
        if (!(this instanceof s)) return new s(e);
        e && e.chunkSize < a.Z_MIN_CHUNK && (e.chunkSize = a.Z_MIN_CHUNK), a.Inflate.call(this, e), this._offset = void 0 === this._offset ? this._outOffset : this._offset, this._buffer = this._buffer || this._outBuffer, e && null != e.maxLength && (this._maxLength = e.maxLength)
    }

    function l(e, t) {
        t && process.nextTick(t), e._handle && (e._handle.close(), e._handle = null)
    }

    function d(e, t) {
        return function (e, t) {
            if ("string" == typeof t && (t = Buffer.from(t)), !(t instanceof Buffer)) throw new TypeError("Not a string or buffer");
            var i = e._finishFlushFlag;
            return null == i && (i = a.Z_FINISH), e._processChunk(t, i)
        }(new s(t), e)
    }

    s.prototype._processChunk = function (e, t, i) {
        if ("function" == typeof i) return a.Inflate._processChunk.call(this, e, t, i);
        var o, s = this, d = e && e.length, u = this._chunkSize - this._offset, c = this._maxLength, h = 0, f = [],
            g = 0;

        function p(e, t) {
            if (!s._hadError) {
                var i = u - t;
                if (n(i >= 0, "have should not go down"), i > 0) {
                    var a = s._buffer.slice(s._offset, s._offset + i);
                    if (s._offset += i, a.length > c && (a = a.slice(0, c)), f.push(a), g += a.length, 0 === (c -= a.length)) return !1
                }
                return (0 === t || s._offset >= s._chunkSize) && (u = s._chunkSize, s._offset = 0, s._buffer = Buffer.allocUnsafe(s._chunkSize)), 0 === t && (h += d - e, d = e, !0)
            }
        }

        this.on("error", function (e) {
            o = e
        }), n(this._handle, "zlib binding closed");
        do {
            var v = this._handle.writeSync(t, e, h, d, this._buffer, this._offset, u);
            v = v || this._writeState
        } while (!this._hadError && p(v[0], v[1]));
        if (this._hadError) throw o;
        if (g >= r) throw l(this), new RangeError("Cannot create final Buffer. It would be larger than 0x" + r.toString(16) + " bytes");
        var m = Buffer.concat(f, g);
        return l(this), m
    }, o.inherits(s, a.Inflate), e.exports = t = d, t.Inflate = s, t.createInflate = function (e) {
        return new s(e)
    }, t.inflateSync = d
}, function (e, t, i) {
    "use strict";
    var n = i(500), a = i(492);
    t.process = function (e, t) {
        var i = [], o = new n(e);
        return new a(t, {
            read: o.read.bind(o), write: function (e) {
                i.push(e)
            }, complete: function () {
            }
        }).start(), o.process(), Buffer.concat(i)
    }
}, function (e, t, i) {
    "use strict";
    var n = !0, a = i(74);
    a.deflateSync || (n = !1);
    var o = i(110), r = i(499);
    e.exports = function (e, t) {
        if (!n) throw new Error("To use the sync capability of this library in old node versions, please pin pngjs to v2.3.0");
        var i = new r(t || {}), s = [];
        s.push(new Buffer(o.PNG_SIGNATURE)), s.push(i.packIHDR(e.width, e.height)), e.gamma && s.push(i.packGAMA(e.gamma));
        var l = i.filterData(e.data, e.width, e.height), d = a.deflateSync(l, i.getDeflateOptions());
        if (l = null, !d || !d.length) throw new Error("bad png - invalid compressed data response");
        return s.push(i.packIDAT(d)), s.push(i.packIEND()), Buffer.concat(s)
    }
}, function (e, t, i) {
    var n = i(148), a = {WW: " ", WB: "▄", BB: "█", BW: "▀"};
    t.render = function (e, t, i) {
        var o = e.modules.size, r = e.modules.data, s = n.getOptions(t), l = "",
            d = Array(o + 2 * s.margin + 1).join(a.WW);
        d = Array(s.margin / 2 + 1).join(d + "\n");
        var u, c, h = Array(s.margin + 1).join(a.WW);
        l += d;
        for (var f = 0; f < o; f += 2) {
            l += h;
            for (var g = 0; g < o; g++) {
                var p = r[f * o + g], v = r[(f + 1) * o + g];
                l += (c = v, (u = p) && c ? a.BB : u && !c ? a.BW : !u && c ? a.WB : a.WW)
            }
            l += h + "\n"
        }
        return l += d.slice(0, -1), "function" == typeof i && i(null, l), l
    }, t.renderToFile = function (e, n, a, o) {
        void 0 === o && (o = a, a = void 0);
        var r = i(45), s = t.render(n, a);
        r.writeFile(e, s, o)
    }
}, function (e, t) {
    t.render = function (e, t, i) {
        var n = e.modules.size, a = e.modules.data, o = "[47m  [0m", r = "", s = Array(n + 3).join(o),
            l = Array(2).join(o);
        r += s + "\n";
        for (var d = 0; d < n; ++d) {
            r += o;
            for (var u = 0; u < n; u++) r += a[d * n + u] ? "[40m  [0m" : o;
            r += l + "\n"
        }
        return r += s + "\n", "function" == typeof i && i(null, r), r
    }
}, function (e, t, i) {
    var n = i(501);
    t.render = n.render, t.renderToFile = function (e, n, a, o) {
        void 0 === o && (o = a, a = void 0);
        var r = i(45),
            s = '<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">' + t.render(n, a);
        r.writeFile(e, s, o)
    }
}, function (e, t, i) {
    var n = i(746), a = i(486), o = i(747), r = i(501);

    function s(e, t, i, o, r) {
        var s = [].slice.call(arguments, 1), l = s.length, d = "function" == typeof s[l - 1];
        if (!d && !n()) throw new Error("Callback required as last argument");
        if (!d) {
            if (l < 1) throw new Error("Too few arguments provided");
            return 1 === l ? (i = t, t = o = void 0) : 2 !== l || t.getContext || (o = i, i = t, t = void 0), new Promise(function (n, r) {
                try {
                    var s = a.create(i, o);
                    n(e(s, t, o))
                } catch (e) {
                    r(e)
                }
            })
        }
        if (l < 2) throw new Error("Too few arguments provided");
        2 === l ? (r = i, i = t, t = o = void 0) : 3 === l && (t.getContext && void 0 === r ? (r = o, o = void 0) : (r = o, o = i, i = t, t = void 0));
        try {
            var u = a.create(i, o);
            r(null, e(u, t, o))
        } catch (e) {
            r(e)
        }
    }

    t.create = a.create, t.toCanvas = s.bind(null, o.render), t.toDataURL = s.bind(null, o.renderToDataURL), t.toString = s.bind(null, function (e, t, i) {
        return r.render(e, i)
    })
}, function (e, t) {
    e.exports = function () {
        return "function" == typeof Promise && Promise.prototype && Promise.prototype.then
    }
}, function (e, t, i) {
    var n = i(148);
    t.render = function (e, t, i) {
        var a = i, o = t;
        void 0 !== a || t && t.getContext || (a = t, t = void 0), t || (o = function () {
            try {
                return document.createElement("canvas")
            } catch (e) {
                throw new Error("You need to specify a canvas element")
            }
        }()), a = n.getOptions(a);
        var r = n.getImageWidth(e.modules.size, a), s = o.getContext("2d"), l = s.createImageData(r, r);
        return n.qrToImageData(l.data, e, a), function (e, t, i) {
            e.clearRect(0, 0, t.width, t.height), t.style || (t.style = {}), t.height = i, t.width = i, t.style.height = i + "px", t.style.width = i + "px"
        }(s, o, r), s.putImageData(l, 0, 0), o
    }, t.renderToDataURL = function (e, i, n) {
        var a = n;
        void 0 !== a || i && i.getContext || (a = i, i = void 0), a || (a = {});
        var o = t.render(e, i, a), r = a.type || "image/png", s = a.rendererOpts || {};
        return o.toDataURL(r, s.quality)
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(407), a = i(238);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\XlTab.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(422), a = i(240);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\Preview.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(425), a = i(242);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(752), i(753);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\xmp-vip\\view\\video-state.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(5), r = i(0).default.getLogger("UserHelper");
    var s;
    !function (e) {
        e.login = "OnLogin", e.logout = "OnLogout", e.authorityChanged = "OnAuthorityChanged"
    }(s = t.UserEventNS || (t.UserEventNS = {}));

    class l extends a.EventEmitter {
        constructor() {
            super(), this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0, this.mIsYear = !1, this.mPreUserIsVip = !1, this.init()
        }

        init() {
            this.setMaxListeners(0), this.attachUserEvents().catch()
        }

        getPeerId() {
            return n(this, void 0, void 0, function* () {
                if (this.mPeerId) return this.mPeerId;
                {
                    let e = yield o.client.callServerFunction("GetPeerID");
                    return e && "" !== e && (this.mPeerId = e), this.mPeerId || ""
                }
            })
        }

        getSessionId() {
            return n(this, void 0, void 0, function* () {
                if (this.mSessionId) return this.mSessionId;
                {
                    let e = yield o.client.callServerFunction("GetSessionID");
                    return e && "" !== e && (this.mSessionId = e), this.mSessionId || "0"
                }
            })
        }

        getUserinfo() {
            return n(this, void 0, void 0, function* () {
                return yield o.client.callServerFunction("GetAllUserInfo")
            })
        }

        get jumpKey() {
            return ""
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPreUserIsVip() {
            return this.mPreUserIsVip
        }

        get isYear() {
            return this.mIsYear
        }

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

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

        get vipLevel() {
            return this.mVipLevel
        }

        get vasType() {
            return this.mVasType
        }

        get userLevel() {
            return 1
        }

        get vipType() {
            let e = 0;
            return this.isSuperVip ? e = 5 : this.isPlatinumVip ? e = 3 : this.isVip && (e = 2), e
        }

        get authority() {
            return this.isVip
        }

        get offlineAuthority() {
            return this.isLogin
        }

        authorityChanged(e, t) {
            this.emit(s.authorityChanged, e, t)
        }

        attachUserEvents() {
            return n(this, void 0, void 0, function* () {
                let e = yield o.client.callServerFunction("IsLogined");
                if (null === e) {
                    let t = setInterval(() => n(this, void 0, void 0, function* () {
                        (e = yield o.client.callServerFunction("IsLogined")) && this.onLogin().catch(), null !== e && (clearInterval(t), o.client.attachServerEvent("onUserInfoChange", this.onUserInfoChange.bind(this)), o.client.attachServerEvent("onLoginStatusChange", this.onLoginStatusChange.bind(this)))
                    }), 50)
                } else e && this.onLogin().catch(), o.client.attachServerEvent("onUserInfoChange", this.onUserInfoChange.bind(this)), o.client.attachServerEvent("onLoginStatusChange", this.onLoginStatusChange.bind(this))
            })
        }

        onLogin() {
            return n(this, void 0, void 0, function* () {
                r.information("--\x3eonLogin"), this.mPreUserIsVip = this.mIsVip, this.clear(), this.mIsLogin = !0, yield this.parseUserInfo(), this.emit(s.login), this.authorityChanged(this.authority), r.information("<--onLogin")
            })
        }

        onLogout() {
            r.information("--\x3eonLogout"), this.mPreUserIsVip = this.mIsVip, this.clear(), this.emit(s.logout), this.authorityChanged(!1), r.information("<--onLogout")
        }

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

        onLoginStatusChange(e, t, i) {
            r.information("--\x3eonLoginStatusChange", "newStatus", i), "unlogin" === i || "offline" === i ? this.onLogout() : "online" === i && this.onLogin().catch(), r.information("<--onLoginStatusChange")
        }

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

        parseUserInfo() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (r.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;
                    if (e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf()), e.vipList[0].isYear) {
                        let t = Number(e.vipList[0].isYear).valueOf();
                        this.mIsYear = 1 === t
                    }
                } else this.mIsVip = !1
            })
        }
    }

    t.UserHelper = l, t.default = new l
}, function (e, t, i) {
    "use strict";
    var n = i(909);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(911);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(423), a = i(244);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\Attribute.vue", t.default = s.exports
}, function (e, t, i) {
    !function (e) {
        "use strict";
        var t, i = 2311, n = function () {
                return i++
            }, a = "object" == typeof wx && "function" == typeof wx.getSystemInfoSync ? {
                browser: {},
                os: {},
                node: !1,
                wxa: !0,
                canvasSupported: !0,
                svgSupported: !1,
                touchEventsSupported: !0,
                domSupported: !1
            } : "undefined" == typeof document && "undefined" != typeof self ? {
                browser: {},
                os: {},
                node: !1,
                worker: !0,
                canvasSupported: !0,
                domSupported: !1
            } : "undefined" == typeof navigator ? {
                browser: {},
                os: {},
                node: !0,
                worker: !1,
                canvasSupported: !0,
                svgSupported: !0,
                domSupported: !1
            } : function (e) {
                var t = {}, i = e.match(/Firefox\/([\d.]+)/),
                    n = e.match(/MSIE\s([\d.]+)/) || e.match(/Trident\/.+?rv:(([\d.]+))/), a = e.match(/Edge\/([\d.]+)/),
                    o = /micromessenger/i.test(e);
                return i && (t.firefox = !0, t.version = i[1]), n && (t.ie = !0, t.version = n[1]), a && (t.edge = !0, t.version = a[1]), o && (t.weChat = !0), {
                    browser: t,
                    os: {},
                    node: !1,
                    canvasSupported: !!document.createElement("canvas").getContext,
                    svgSupported: "undefined" != typeof SVGRect,
                    touchEventsSupported: "ontouchstart" in window && !t.ie && !t.edge,
                    pointerEventsSupported: "onpointerdown" in window && (t.edge || t.ie && 11 <= t.version),
                    domSupported: "undefined" != typeof document
                }
            }(navigator.userAgent), o = {
                "[object Function]": 1,
                "[object RegExp]": 1,
                "[object Date]": 1,
                "[object Error]": 1,
                "[object CanvasGradient]": 1,
                "[object CanvasPattern]": 1,
                "[object Image]": 1,
                "[object Canvas]": 1
            }, r = {
                "[object Int8Array]": 1,
                "[object Uint8Array]": 1,
                "[object Uint8ClampedArray]": 1,
                "[object Int16Array]": 1,
                "[object Uint16Array]": 1,
                "[object Int32Array]": 1,
                "[object Uint32Array]": 1,
                "[object Float32Array]": 1,
                "[object Float64Array]": 1
            }, s = Object.prototype.toString, l = Array.prototype, d = l.forEach, u = l.filter, c = l.slice, h = l.map,
            f = l.reduce, g = {};

        function p(e, i) {
            "createCanvas" === e && (t = null), g[e] = i
        }

        function v(e) {
            if (null == e || "object" != typeof e) return e;
            var t = e, i = s.call(e);
            if ("[object Array]" === i) {
                if (!J(e)) {
                    t = [];
                    for (var n = 0, a = e.length; n < a; n++) t[n] = v(e[n])
                }
            } else if (r[i]) {
                if (!J(e)) {
                    var l = e.constructor;
                    if (e.constructor.from) t = l.from(e); else for (t = new l(e.length), n = 0, a = e.length; n < a; n++) t[n] = v(e[n])
                }
            } else if (!o[i] && !J(e) && !K(e)) for (var d in t = {}, e) e.hasOwnProperty(d) && (t[d] = v(e[d]));
            return t
        }

        function m(e, t, i) {
            if (!R(t) || !R(e)) return i ? v(t) : e;
            for (var n in t) if (t.hasOwnProperty(n)) {
                var a = e[n], o = t[n];
                !R(o) || !R(a) || M(o) || M(a) || K(o) || K(a) || B(o) || B(a) || J(o) || J(a) ? !i && n in e || (e[n] = v(t[n])) : m(a, o, i)
            }
            return e
        }

        function y(e, t) {
            for (var i = e[0], n = 1, a = e.length; n < a; n++) i = m(i, e[n], t);
            return i
        }

        function k(e, t) {
            for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
            return e
        }

        function T(e, t, i) {
            for (var n in t) t.hasOwnProperty(n) && (i ? null != t[n] : null == e[n]) && (e[n] = t[n]);
            return e
        }

        function w() {
            return g.createCanvas()
        }

        function C() {
            return t = t || w().getContext("2d")
        }

        function S(e, t) {
            if (e) {
                if (e.indexOf) return e.indexOf(t);
                for (var i = 0, n = e.length; i < n; i++) if (e[i] === t) return i
            }
            return -1
        }

        function I(e, t) {
            var i = e.prototype;

            function n() {
            }

            for (var a in n.prototype = t.prototype, e.prototype = new n, i) i.hasOwnProperty(a) && (e.prototype[a] = i[a]);
            (e.prototype.constructor = e).superClass = t
        }

        function b(e, t, i) {
            T(e = "prototype" in e ? e.prototype : e, t = "prototype" in t ? t.prototype : t, i)
        }

        function _(e) {
            if (e) return "string" != typeof e && "number" == typeof e.length
        }

        function D(e, t, i) {
            if (e && t) if (e.forEach && e.forEach === d) e.forEach(t, i); else if (e.length === +e.length) for (var n = 0, a = e.length; n < a; n++) t.call(i, e[n], n, e); else for (var o in e) e.hasOwnProperty(o) && t.call(i, e[o], o, e)
        }

        function A(e, t, i) {
            if (e && t) {
                if (e.map && e.map === h) return e.map(t, i);
                for (var n = [], a = 0, o = e.length; a < o; a++) n.push(t.call(i, e[a], a, e));
                return n
            }
        }

        function N(e, t, i, n) {
            if (e && t) {
                if (e.reduce && e.reduce === f) return e.reduce(t, i, n);
                for (var a = 0, o = e.length; a < o; a++) i = t.call(n, i, e[a], a, e);
                return i
            }
        }

        function x(e, t, i) {
            if (e && t) {
                if (e.filter && e.filter === u) return e.filter(t, i);
                for (var n = [], a = 0, o = e.length; a < o; a++) t.call(i, e[a], a, e) && n.push(e[a]);
                return n
            }
        }

        function E(e, t, i) {
            if (e && t) for (var n = 0, a = e.length; n < a; n++) if (t.call(i, e[n], n, e)) return e[n]
        }

        function P(e, t) {
            var i = c.call(arguments, 2);
            return function () {
                return e.apply(t, i.concat(c.call(arguments)))
            }
        }

        function O(e) {
            var t = c.call(arguments, 1);
            return function () {
                return e.apply(this, t.concat(c.call(arguments)))
            }
        }

        function M(e) {
            return "[object Array]" === s.call(e)
        }

        function F(e) {
            return "function" == typeof e
        }

        function L(e) {
            return "[object String]" === s.call(e)
        }

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

        function B(e) {
            return !!o[s.call(e)]
        }

        function U(e) {
            return !!r[s.call(e)]
        }

        function K(e) {
            return "object" == typeof e && "number" == typeof e.nodeType && "object" == typeof e.ownerDocument
        }

        function V(e) {
            return e != e
        }

        function W(e) {
            for (var t = 0, i = arguments.length; t < i; t++) if (null != arguments[t]) return arguments[t]
        }

        function G(e, t) {
            return null != e ? e : t
        }

        function H(e, t, i) {
            return null != e ? e : null != t ? t : i
        }

        function z() {
            return Function.call.apply(c, arguments)
        }

        function j(e) {
            if ("number" == typeof e) return [e, e, e, e];
            var t = e.length;
            return 2 === t ? [e[0], e[1], e[0], e[1]] : 3 === t ? [e[0], e[1], e[2], e[1]] : e
        }

        function X(e, t) {
            if (!e) throw new Error(t)
        }

        function $(e) {
            return null == e ? null : "function" == typeof e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
        }

        g.createCanvas = function () {
            return document.createElement("canvas")
        };
        var Y = "__ec_primitive__";

        function q(e) {
            e[Y] = !0
        }

        function J(e) {
            return e[Y]
        }

        function Z(e) {
            var t = M(e);
            this.data = {};
            var i = this;

            function n(e, n) {
                t ? i.set(e, n) : i.set(n, e)
            }

            e instanceof Z ? e.each(n) : e && D(e, n)
        }

        function Q(e) {
            return new Z(e)
        }

        function ee(e, t) {
            for (var i = new e.constructor(e.length + t.length), n = 0; n < e.length; n++) i[n] = e[n];
            var a = e.length;
            for (n = 0; n < t.length; n++) i[n + a] = t[n];
            return i
        }

        function te() {
        }

        Z.prototype = {
            constructor: Z, get: function (e) {
                return this.data.hasOwnProperty(e) ? this.data[e] : null
            }, set: function (e, t) {
                return this.data[e] = t
            }, each: function (e, t) {
                for (var i in void 0 !== t && (e = P(e, t)), this.data) this.data.hasOwnProperty(i) && e(this.data[i], i)
            }, removeKey: function (e) {
                delete this.data[e]
            }
        };
        var ie = (Object.freeze || Object)({
            $override: p,
            clone: v,
            merge: m,
            mergeAll: y,
            extend: k,
            defaults: T,
            createCanvas: w,
            getContext: C,
            indexOf: S,
            inherits: I,
            mixin: b,
            isArrayLike: _,
            each: D,
            map: A,
            reduce: N,
            filter: x,
            find: E,
            bind: P,
            curry: O,
            isArray: M,
            isFunction: F,
            isString: L,
            isObject: R,
            isBuiltInObject: B,
            isTypedArray: U,
            isDom: K,
            eqNaN: V,
            retrieve: W,
            retrieve2: G,
            retrieve3: H,
            slice: z,
            normalizeCssArray: j,
            assert: X,
            trim: $,
            setAsPrimitive: q,
            isPrimitive: J,
            createHashMap: Q,
            concatArray: ee,
            noop: te
        }), ne = "undefined" == typeof Float32Array ? Array : Float32Array;

        function ae(e, t) {
            var i = new ne(2);
            return null == e && (e = 0), null == t && (t = 0), i[0] = e, i[1] = t, i
        }

        function oe(e, t) {
            return e[0] = t[0], e[1] = t[1], e
        }

        function re(e) {
            var t = new ne(2);
            return t[0] = e[0], t[1] = e[1], t
        }

        function se(e, t, i) {
            return e[0] = t, e[1] = i, e
        }

        function le(e, t, i) {
            return e[0] = t[0] + i[0], e[1] = t[1] + i[1], e
        }

        function de(e, t, i, n) {
            return e[0] = t[0] + i[0] * n, e[1] = t[1] + i[1] * n, e
        }

        function ue(e, t, i) {
            return e[0] = t[0] - i[0], e[1] = t[1] - i[1], e
        }

        function ce(e) {
            return Math.sqrt(fe(e))
        }

        var he = ce;

        function fe(e) {
            return e[0] * e[0] + e[1] * e[1]
        }

        var ge = fe;

        function pe(e, t, i) {
            return e[0] = t[0] * i, e[1] = t[1] * i, e
        }

        function ve(e, t) {
            var i = ce(t);
            return 0 === i ? (e[0] = 0, e[1] = 0) : (e[0] = t[0] / i, e[1] = t[1] / i), e
        }

        function me(e, t) {
            return Math.sqrt((e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1]))
        }

        var ye = me;

        function ke(e, t) {
            return (e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1])
        }

        var Te = ke;

        function we(e, t, i, n) {
            return e[0] = t[0] + n * (i[0] - t[0]), e[1] = t[1] + n * (i[1] - t[1]), e
        }

        function Ce(e, t, i) {
            var n = t[0], a = t[1];
            return e[0] = i[0] * n + i[2] * a + i[4], e[1] = i[1] * n + i[3] * a + i[5], e
        }

        function Se(e, t, i) {
            return e[0] = Math.min(t[0], i[0]), e[1] = Math.min(t[1], i[1]), e
        }

        function Ie(e, t, i) {
            return e[0] = Math.max(t[0], i[0]), e[1] = Math.max(t[1], i[1]), e
        }

        var be = (Object.freeze || Object)({
            create: ae,
            copy: oe,
            clone: re,
            set: se,
            add: le,
            scaleAndAdd: de,
            sub: ue,
            len: ce,
            length: he,
            lenSquare: fe,
            lengthSquare: ge,
            mul: function (e, t, i) {
                return e[0] = t[0] * i[0], e[1] = t[1] * i[1], e
            },
            div: function (e, t, i) {
                return e[0] = t[0] / i[0], e[1] = t[1] / i[1], e
            },
            dot: function (e, t) {
                return e[0] * t[0] + e[1] * t[1]
            },
            scale: pe,
            normalize: ve,
            distance: me,
            dist: ye,
            distanceSquare: ke,
            distSquare: Te,
            negate: function (e, t) {
                return e[0] = -t[0], e[1] = -t[1], e
            },
            lerp: we,
            applyTransform: Ce,
            min: Se,
            max: Ie
        });

        function _e() {
            this.on("mousedown", this._dragStart, this), this.on("mousemove", this._drag, this), this.on("mouseup", this._dragEnd, this)
        }

        function De(e, t) {
            return {target: e, topTarget: t && t.topTarget}
        }

        _e.prototype = {
            constructor: _e, _dragStart: function (e) {
                for (var t = e.target; t && !t.draggable;) t = t.parent;
                t && ((this._draggingTarget = t).dragging = !0, this._x = e.offsetX, this._y = e.offsetY, this.dispatchToElement(De(t, e), "dragstart", e.event))
            }, _drag: function (e) {
                var t = this._draggingTarget;
                if (t) {
                    var i = e.offsetX, n = e.offsetY, a = i - this._x, o = n - this._y;
                    this._x = i, this._y = n, t.drift(a, o, e), this.dispatchToElement(De(t, e), "drag", e.event);
                    var r = this.findHover(i, n, t).target, s = this._dropTarget;
                    t !== (this._dropTarget = r) && (s && r !== s && this.dispatchToElement(De(s, e), "dragleave", e.event), r && r !== s && this.dispatchToElement(De(r, e), "dragenter", e.event))
                }
            }, _dragEnd: function (e) {
                var t = this._draggingTarget;
                t && (t.dragging = !1), this.dispatchToElement(De(t, e), "dragend", e.event), this._dropTarget && this.dispatchToElement(De(this._dropTarget, e), "drop", e.event), this._draggingTarget = null, this._dropTarget = null
            }
        };
        var Ae = Array.prototype.slice, Ne = function (e) {
            this._$handlers = {}, this._$eventProcessor = e
        };

        function xe(e, t, i, n, a, o) {
            var r = e._$handlers;
            if ("function" == typeof i && (a = n, n = i, i = null), !n || !t) return e;
            i = function (e, t) {
                var i = e._$eventProcessor;
                return null != t && i && i.normalizeQuery && (t = i.normalizeQuery(t)), t
            }(e, i), r[t] || (r[t] = []);
            for (var s = 0; s < r[t].length; s++) if (r[t][s].h === n) return e;
            var l = {h: n, one: o, query: i, ctx: a || e, callAtLast: n.zrEventfulCallAtLast}, d = r[t].length - 1,
                u = r[t][d];
            return u && u.callAtLast ? r[t].splice(d, 0, l) : r[t].push(l), e
        }

        Ne.prototype = {
            constructor: Ne, one: function (e, t, i, n) {
                return xe(this, e, t, i, n, !0)
            }, on: function (e, t, i, n) {
                return xe(this, e, t, i, n, !1)
            }, isSilent: function (e) {
                var t = this._$handlers;
                return !t[e] || !t[e].length
            }, off: function (e, t) {
                var i = this._$handlers;
                if (!e) return this._$handlers = {}, this;
                if (t) {
                    if (i[e]) {
                        for (var n = [], a = 0, o = i[e].length; a < o; a++) i[e][a].h !== t && n.push(i[e][a]);
                        i[e] = n
                    }
                    i[e] && 0 === i[e].length && delete i[e]
                } else delete i[e];
                return this
            }, trigger: function (e) {
                var t = this._$handlers[e], i = this._$eventProcessor;
                if (t) {
                    var n = arguments, a = n.length;
                    3 < a && (n = Ae.call(n, 1));
                    for (var o = t.length, r = 0; r < o;) {
                        var s = t[r];
                        if (i && i.filter && null != s.query && !i.filter(e, s.query)) r++; else {
                            switch (a) {
                                case 1:
                                    s.h.call(s.ctx);
                                    break;
                                case 2:
                                    s.h.call(s.ctx, n[1]);
                                    break;
                                case 3:
                                    s.h.call(s.ctx, n[1], n[2]);
                                    break;
                                default:
                                    s.h.apply(s.ctx, n)
                            }
                            s.one ? (t.splice(r, 1), o--) : r++
                        }
                    }
                }
                return i && i.afterTrigger && i.afterTrigger(e), this
            }, triggerWithContext: function (e) {
                var t = this._$handlers[e], i = this._$eventProcessor;
                if (t) {
                    var n = arguments, a = n.length;
                    4 < a && (n = Ae.call(n, 1, n.length - 1));
                    for (var o = n[n.length - 1], r = t.length, s = 0; s < r;) {
                        var l = t[s];
                        if (i && i.filter && null != l.query && !i.filter(e, l.query)) s++; else {
                            switch (a) {
                                case 1:
                                    l.h.call(o);
                                    break;
                                case 2:
                                    l.h.call(o, n[1]);
                                    break;
                                case 3:
                                    l.h.call(o, n[1], n[2]);
                                    break;
                                default:
                                    l.h.apply(o, n)
                            }
                            l.one ? (t.splice(s, 1), r--) : s++
                        }
                    }
                }
                return i && i.afterTrigger && i.afterTrigger(e), this
            }
        };
        var Ee = Math.log(2);

        function Pe(e, t, i, n, a, o) {
            var r = n + "-" + a, s = e.length;
            if (o.hasOwnProperty(r)) return o[r];
            if (1 === t) {
                var l = Math.round(Math.log((1 << s) - 1 & ~a) / Ee);
                return e[i][l]
            }
            for (var d = n | 1 << i, u = i + 1; n & 1 << u;) u++;
            for (var c = 0, h = 0, f = 0; h < s; h++) {
                var g = 1 << h;
                g & a || (c += (f % 2 ? -1 : 1) * e[i][h] * Pe(e, t - 1, u, d, a | g, o), f++)
            }
            return o[r] = c
        }

        function Oe(e, t) {
            var i = [[e[0], e[1], 1, 0, 0, 0, -t[0] * e[0], -t[0] * e[1]], [0, 0, 0, e[0], e[1], 1, -t[1] * e[0], -t[1] * e[1]], [e[2], e[3], 1, 0, 0, 0, -t[2] * e[2], -t[2] * e[3]], [0, 0, 0, e[2], e[3], 1, -t[3] * e[2], -t[3] * e[3]], [e[4], e[5], 1, 0, 0, 0, -t[4] * e[4], -t[4] * e[5]], [0, 0, 0, e[4], e[5], 1, -t[5] * e[4], -t[5] * e[5]], [e[6], e[7], 1, 0, 0, 0, -t[6] * e[6], -t[6] * e[7]], [0, 0, 0, e[6], e[7], 1, -t[7] * e[6], -t[7] * e[7]]],
                n = {}, a = Pe(i, 8, 0, 0, 0, n);
            if (0 !== a) {
                for (var o = [], r = 0; r < 8; r++) for (var s = 0; s < 8; s++) null == o[s] && (o[s] = 0), o[s] += ((r + s) % 2 ? -1 : 1) * Pe(i, 7, 0 === r ? 1 : 0, 1 << r, 1 << s, n) / a * t[r];
                return function (e, t, i) {
                    var n = t * o[6] + i * o[7] + 1;
                    e[0] = (t * o[0] + i * o[1] + o[2]) / n, e[1] = (t * o[3] + i * o[4] + o[5]) / n
                }
            }
        }

        var Me = "___zrEVENTSAVED", Fe = [];

        function Le(e, t, i, n, o) {
            if (t.getBoundingClientRect && a.domSupported && !Re(t)) {
                var r = t[Me] || (t[Me] = {}), s = function (e, t, i) {
                    for (var n = i ? "invTrans" : "trans", a = t[n], o = t.srcCoords, r = !0, s = [], l = [], d = 0; d < 4; d++) {
                        var u = e[d].getBoundingClientRect(), c = 2 * d, h = u.left, f = u.top;
                        s.push(h, f), r = r && o && h === o[c] && f === o[1 + c], l.push(e[d].offsetLeft, e[d].offsetTop)
                    }
                    return r && a ? a : (t.srcCoords = s, t[n] = i ? Oe(l, s) : Oe(s, l))
                }(function (e, t) {
                    var i = t.markers;
                    if (i) return i;
                    i = t.markers = [];
                    for (var n = ["left", "right"], a = ["top", "bottom"], o = 0; o < 4; o++) {
                        var r = document.createElement("div"), s = r.style, l = o % 2, d = (o >> 1) % 2;
                        s.cssText = ["position: absolute", "visibility: hidden", "padding: 0", "margin: 0", "border-width: 0", "user-select: none", "width:0", "height:0", n[l] + ":0", a[d] + ":0", n[1 - l] + ":auto", a[1 - d] + ":auto", ""].join("!important;"), e.appendChild(r), i.push(r)
                    }
                    return i
                }(t, r), r, o);
                if (s) return s(e, i, n), !0
            }
            return !1
        }

        function Re(e) {
            return "CANVAS" === e.nodeName.toUpperCase()
        }

        var Be = "undefined" != typeof window && !!window.addEventListener,
            Ue = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, Ke = [];

        function Ve(e, t, i, n) {
            return i = i || {}, n || !a.canvasSupported ? We(e, t, i) : a.browser.firefox && null != t.layerX && t.layerX !== t.offsetX ? (i.zrX = t.layerX, i.zrY = t.layerY) : null != t.offsetX ? (i.zrX = t.offsetX, i.zrY = t.offsetY) : We(e, t, i), i
        }

        function We(e, t, i) {
            if (a.domSupported && e.getBoundingClientRect) {
                var n = t.clientX, o = t.clientY;
                if (Re(e)) {
                    var r = e.getBoundingClientRect();
                    return i.zrX = n - r.left, void (i.zrY = o - r.top)
                }
                if (Le(Ke, e, n, o)) return i.zrX = Ke[0], void (i.zrY = Ke[1])
            }
            i.zrX = i.zrY = 0
        }

        function Ge(e) {
            return e || window.event
        }

        function He(e, t, i) {
            if (null != (t = Ge(t)).zrX) return t;
            var n = t.type;
            if (n && 0 <= n.indexOf("touch")) {
                var a = "touchend" !== n ? t.targetTouches[0] : t.changedTouches[0];
                a && Ve(e, a, t, i)
            } else Ve(e, t, t, i), t.zrDelta = t.wheelDelta ? t.wheelDelta / 120 : -(t.detail || 0) / 3;
            var o = t.button;
            return null == t.which && void 0 !== o && Ue.test(t.type) && (t.which = 1 & o ? 1 : 2 & o ? 3 : 4 & o ? 2 : 0), t
        }

        function ze(e, t, i, n) {
            Be ? e.addEventListener(t, i, n) : e.attachEvent("on" + t, i)
        }

        var je = Be ? function (e) {
            e.preventDefault(), e.stopPropagation(), e.cancelBubble = !0
        } : function (e) {
            e.returnValue = !1, e.cancelBubble = !0
        };

        function Xe(e) {
            return 2 === e.which || 3 === e.which
        }

        function $e() {
            this._track = []
        }

        function Ye(e) {
            var t = e[1][0] - e[0][0], i = e[1][1] - e[0][1];
            return Math.sqrt(t * t + i * i)
        }

        $e.prototype = {
            constructor: $e, recognize: function (e, t, i) {
                return this._doTrack(e, t, i), this._recognize(e)
            }, clear: function () {
                return this._track.length = 0, this
            }, _doTrack: function (e, t, i) {
                var n = e.touches;
                if (n) {
                    for (var a = {points: [], touches: [], target: t, event: e}, o = 0, r = n.length; o < r; o++) {
                        var s = n[o], l = Ve(i, s, {});
                        a.points.push([l.zrX, l.zrY]), a.touches.push(s)
                    }
                    this._track.push(a)
                }
            }, _recognize: function (e) {
                for (var t in qe) if (qe.hasOwnProperty(t)) {
                    var i = qe[t](this._track, e);
                    if (i) return i
                }
            }
        };
        var qe = {
            pinch: function (e, t) {
                var i = e.length;
                if (i) {
                    var n = (e[i - 1] || {}).points, a = (e[i - 2] || {}).points || n;
                    if (a && 1 < a.length && n && 1 < n.length) {
                        var o = Ye(n) / Ye(a);
                        isFinite(o) || (o = 1), t.pinchScale = o;
                        var r = function (e) {
                            return [(e[0][0] + e[1][0]) / 2, (e[0][1] + e[1][1]) / 2]
                        }(n);
                        return t.pinchX = r[0], t.pinchY = r[1], {type: "pinch", target: e[0].target, event: t}
                    }
                }
            }
        }, Je = "silent";

        function Ze() {
            je(this.event)
        }

        function Qe() {
        }

        function et(e, t, i, n) {
            Ne.call(this), this.storage = e, this.painter = t, this.painterRoot = n, i = i || new Qe, this.proxy = null, this._hovered = {}, this._lastTouchMoment, this._lastX, this._lastY, this._gestureMgr, _e.call(this), this.setHandlerProxy(i)
        }

        Qe.prototype.dispose = function () {
        };
        var tt = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"];

        function it(e, t, i) {
            if (e[e.rectHover ? "rectContain" : "contain"](t, i)) {
                for (var n, a = e; a;) {
                    if (a.clipPath && !a.clipPath.contain(t, i)) return !1;
                    a.silent && (n = !0), a = a.parent
                }
                return !n || Je
            }
            return !1
        }

        function nt(e, t, i) {
            var n = e.painter;
            return t < 0 || t > n.getWidth() || i < 0 || i > n.getHeight()
        }

        et.prototype = {
            constructor: et, setHandlerProxy: function (e) {
                this.proxy && this.proxy.dispose(), e && (D(tt, function (t) {
                    e.on && e.on(t, this[t], this)
                }, this), e.handler = this), this.proxy = e
            }, mousemove: function (e) {
                var t = e.zrX, i = e.zrY, n = nt(this, t, i), a = this._hovered, o = a.target;
                o && !o.__zr && (o = (a = this.findHover(a.x, a.y)).target);
                var r = this._hovered = n ? {x: t, y: i} : this.findHover(t, i), s = r.target, l = this.proxy;
                l.setCursor && l.setCursor(s ? s.cursor : "default"), o && s !== o && this.dispatchToElement(a, "mouseout", e), this.dispatchToElement(r, "mousemove", e), s && s !== o && this.dispatchToElement(r, "mouseover", e)
            }, mouseout: function (e) {
                var t = e.zrEventControl, i = e.zrIsToLocalDOM;
                "only_globalout" !== t && this.dispatchToElement(this._hovered, "mouseout", e), "no_globalout" !== t && (i || this.trigger("globalout", {
                    type: "globalout",
                    event: e
                }))
            }, resize: function (e) {
                this._hovered = {}
            }, dispatch: function (e, t) {
                var i = this[e];
                i && i.call(this, t)
            }, dispose: function () {
                this.proxy.dispose(), this.storage = this.proxy = this.painter = null
            }, setCursorStyle: function (e) {
                var t = this.proxy;
                t.setCursor && t.setCursor(e)
            }, dispatchToElement: function (e, t, i) {
                var n = (e = e || {}).target;
                if (!n || !n.silent) {
                    for (var a = "on" + t, o = function (e, t, i) {
                        return {
                            type: e,
                            event: i,
                            target: t.target,
                            topTarget: t.topTarget,
                            cancelBubble: !1,
                            offsetX: i.zrX,
                            offsetY: i.zrY,
                            gestureEvent: i.gestureEvent,
                            pinchX: i.pinchX,
                            pinchY: i.pinchY,
                            pinchScale: i.pinchScale,
                            wheelDelta: i.zrDelta,
                            zrByTouch: i.zrByTouch,
                            which: i.which,
                            stop: Ze
                        }
                    }(t, e, i); n && (n[a] && (o.cancelBubble = n[a].call(n, o)), n.trigger(t, o), n = n.parent, !o.cancelBubble);) ;
                    o.cancelBubble || (this.trigger(t, o), this.painter && this.painter.eachOtherLayer(function (e) {
                        "function" == typeof e[a] && e[a].call(e, o), e.trigger && e.trigger(t, o)
                    }))
                }
            }, findHover: function (e, t, i) {
                for (var n = this.storage.getDisplayList(), a = {x: e, y: t}, o = n.length - 1; 0 <= o; o--) {
                    var r;
                    if (n[o] !== i && !n[o].ignore && (r = it(n[o], e, t)) && (a.topTarget || (a.topTarget = n[o]), r !== Je)) {
                        a.target = n[o];
                        break
                    }
                }
                return a
            }, processGesture: function (e, t) {
                this._gestureMgr || (this._gestureMgr = new $e);
                var i = this._gestureMgr;
                "start" === t && i.clear();
                var n = i.recognize(e, this.findHover(e.zrX, e.zrY, null).target, this.proxy.dom);
                if ("end" === t && i.clear(), n) {
                    var a = n.type;
                    e.gestureEvent = a, this.dispatchToElement({target: n.target}, a, n.event)
                }
            }
        }, D(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function (e) {
            et.prototype[e] = function (t) {
                var i, n, a = t.zrX, o = t.zrY, r = nt(this, a, o);
                if ("mouseup" === e && r || (n = (i = this.findHover(a, o)).target), "mousedown" === e) this._downEl = n, this._downPoint = [t.zrX, t.zrY], this._upEl = n; else if ("mouseup" === e) this._upEl = n; else if ("click" === e) {
                    if (this._downEl !== this._upEl || !this._downPoint || 4 < ye(this._downPoint, [t.zrX, t.zrY])) return;
                    this._downPoint = null
                }
                this.dispatchToElement(i, e, t)
            }
        }), b(et, Ne), b(et, _e);
        var at = "undefined" == typeof Float32Array ? Array : Float32Array;

        function ot() {
            var e = new at(6);
            return rt(e), e
        }

        function rt(e) {
            return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e
        }

        function st(e, t) {
            return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e
        }

        function lt(e, t, i) {
            var n = t[0] * i[0] + t[2] * i[1], a = t[1] * i[0] + t[3] * i[1], o = t[0] * i[2] + t[2] * i[3],
                r = t[1] * i[2] + t[3] * i[3], s = t[0] * i[4] + t[2] * i[5] + t[4],
                l = t[1] * i[4] + t[3] * i[5] + t[5];
            return e[0] = n, e[1] = a, e[2] = o, e[3] = r, e[4] = s, e[5] = l, e
        }

        function dt(e, t, i) {
            return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4] + i[0], e[5] = t[5] + i[1], e
        }

        function ut(e, t, i) {
            var n = t[0], a = t[2], o = t[4], r = t[1], s = t[3], l = t[5], d = Math.sin(i), u = Math.cos(i);
            return e[0] = n * u + r * d, e[1] = -n * d + r * u, e[2] = a * u + s * d, e[3] = -a * d + u * s, e[4] = u * o + d * l, e[5] = u * l - d * o, e
        }

        function ct(e, t, i) {
            var n = i[0], a = i[1];
            return e[0] = t[0] * n, e[1] = t[1] * a, e[2] = t[2] * n, e[3] = t[3] * a, e[4] = t[4] * n, e[5] = t[5] * a, e
        }

        function ht(e, t) {
            var i = t[0], n = t[2], a = t[4], o = t[1], r = t[3], s = t[5], l = i * r - o * n;
            return l ? (l = 1 / l, e[0] = r * l, e[1] = -o * l, e[2] = -n * l, e[3] = i * l, e[4] = (n * s - r * a) * l, e[5] = (o * a - i * s) * l, e) : null
        }

        function ft(e) {
            var t = ot();
            return st(t, e), t
        }

        var gt = (Object.freeze || Object)({
            create: ot,
            identity: rt,
            copy: st,
            mul: lt,
            translate: dt,
            rotate: ut,
            scale: ct,
            invert: ht,
            clone: ft
        }), pt = rt;

        function vt(e) {
            return 5e-5 < e || e < -5e-5
        }

        var mt = function (e) {
            (e = e || {}).position || (this.position = [0, 0]), null == e.rotation && (this.rotation = 0), e.scale || (this.scale = [1, 1]), this.origin = this.origin || null
        }, yt = mt.prototype;
        yt.transform = null, yt.needLocalTransform = function () {
            return vt(this.rotation) || vt(this.position[0]) || vt(this.position[1]) || vt(this.scale[0] - 1) || vt(this.scale[1] - 1)
        };
        var kt = [];
        yt.updateTransform = function () {
            var e = this.parent, t = e && e.transform, i = this.needLocalTransform(), n = this.transform;
            if (i || t) {
                n = n || ot(), i ? this.getLocalTransform(n) : pt(n), t && (i ? lt(n, e.transform, n) : st(n, e.transform)), this.transform = n;
                var a = this.globalScaleRatio;
                if (null != a && 1 !== a) {
                    this.getGlobalScale(kt);
                    var o = kt[0] < 0 ? -1 : 1, r = kt[1] < 0 ? -1 : 1, s = ((kt[0] - o) * a + o) / kt[0] || 0,
                        l = ((kt[1] - r) * a + r) / kt[1] || 0;
                    n[0] *= s, n[1] *= s, n[2] *= l, n[3] *= l
                }
                this.invTransform = this.invTransform || ot(), ht(this.invTransform, n)
            } else n && pt(n)
        }, yt.getLocalTransform = function (e) {
            return mt.getLocalTransform(this, e)
        }, yt.setTransform = function (e) {
            var t = this.transform, i = e.dpr || 1;
            t ? e.setTransform(i * t[0], i * t[1], i * t[2], i * t[3], i * t[4], i * t[5]) : e.setTransform(i, 0, 0, i, 0, 0)
        }, yt.restoreTransform = function (e) {
            var t = e.dpr || 1;
            e.setTransform(t, 0, 0, t, 0, 0)
        };
        var Tt = [], wt = ot();
        yt.setLocalTransform = function (e) {
            if (e) {
                var t = e[0] * e[0] + e[1] * e[1], i = e[2] * e[2] + e[3] * e[3], n = this.position, a = this.scale;
                vt(t - 1) && (t = Math.sqrt(t)), vt(i - 1) && (i = Math.sqrt(i)), e[0] < 0 && (t = -t), e[3] < 0 && (i = -i), n[0] = e[4], n[1] = e[5], a[0] = t, a[1] = i, this.rotation = Math.atan2(-e[1] / i, e[0] / t)
            }
        }, yt.decomposeTransform = function () {
            if (this.transform) {
                var e = this.parent, t = this.transform;
                e && e.transform && (lt(Tt, e.invTransform, t), t = Tt);
                var i = this.origin;
                i && (i[0] || i[1]) && (wt[4] = i[0], wt[5] = i[1], lt(Tt, t, wt), Tt[4] -= i[0], Tt[5] -= i[1], t = Tt), this.setLocalTransform(t)
            }
        }, yt.getGlobalScale = function (e) {
            var t = this.transform;
            return e = e || [], t ? (e[0] = Math.sqrt(t[0] * t[0] + t[1] * t[1]), e[1] = Math.sqrt(t[2] * t[2] + t[3] * t[3]), t[0] < 0 && (e[0] = -e[0]), t[3] < 0 && (e[1] = -e[1])) : (e[0] = 1, e[1] = 1), e
        }, yt.transformCoordToLocal = function (e, t) {
            var i = [e, t], n = this.invTransform;
            return n && Ce(i, i, n), i
        }, yt.transformCoordToGlobal = function (e, t) {
            var i = [e, t], n = this.transform;
            return n && Ce(i, i, n), i
        }, mt.getLocalTransform = function (e, t) {
            pt(t = t || []);
            var i = e.origin, n = e.scale || [1, 1], a = e.rotation || 0, o = e.position || [0, 0];
            return i && (t[4] -= i[0], t[5] -= i[1]), ct(t, t, n), a && ut(t, t, a), i && (t[4] += i[0], t[5] += i[1]), t[4] += o[0], t[5] += o[1], t
        };
        var Ct = {
            linear: function (e) {
                return e
            }, quadraticIn: function (e) {
                return e * e
            }, quadraticOut: function (e) {
                return e * (2 - e)
            }, quadraticInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1)
            }, cubicIn: function (e) {
                return e * e * e
            }, cubicOut: function (e) {
                return --e * e * e + 1
            }, cubicInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2)
            }, quarticIn: function (e) {
                return e * e * e * e
            }, quarticOut: function (e) {
                return 1 - --e * e * e * e
            }, quarticInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e * e * e : -.5 * ((e -= 2) * e * e * e - 2)
            }, quinticIn: function (e) {
                return e * e * e * e * e
            }, quinticOut: function (e) {
                return --e * e * e * e * e + 1
            }, quinticInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e * e * e * e : .5 * ((e -= 2) * e * e * e * e + 2)
            }, sinusoidalIn: function (e) {
                return 1 - Math.cos(e * Math.PI / 2)
            }, sinusoidalOut: function (e) {
                return Math.sin(e * Math.PI / 2)
            }, sinusoidalInOut: function (e) {
                return .5 * (1 - Math.cos(Math.PI * e))
            }, exponentialIn: function (e) {
                return 0 === e ? 0 : Math.pow(1024, e - 1)
            }, exponentialOut: function (e) {
                return 1 === e ? 1 : 1 - Math.pow(2, -10 * e)
            }, exponentialInOut: function (e) {
                return 0 === e ? 0 : 1 === e ? 1 : (e *= 2) < 1 ? .5 * Math.pow(1024, e - 1) : .5 * (2 - Math.pow(2, -10 * (e - 1)))
            }, circularIn: function (e) {
                return 1 - Math.sqrt(1 - e * e)
            }, circularOut: function (e) {
                return Math.sqrt(1 - --e * e)
            }, circularInOut: function (e) {
                return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
            }, elasticIn: function (e) {
                var t, i = .1;
                return 0 === e ? 0 : 1 === e ? 1 : (t = !i || i < 1 ? (i = 1, .1) : .4 * Math.asin(1 / i) / (2 * Math.PI), -i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / .4))
            }, elasticOut: function (e) {
                var t, i = .1;
                return 0 === e ? 0 : 1 === e ? 1 : (t = !i || i < 1 ? (i = 1, .1) : .4 * Math.asin(1 / i) / (2 * Math.PI), i * Math.pow(2, -10 * e) * Math.sin((e - t) * (2 * Math.PI) / .4) + 1)
            }, elasticInOut: function (e) {
                var t, i = .1;
                return 0 === e ? 0 : 1 === e ? 1 : (t = !i || i < 1 ? (i = 1, .1) : .4 * Math.asin(1 / i) / (2 * Math.PI), (e *= 2) < 1 ? i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / .4) * -.5 : i * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / .4) * .5 + 1)
            }, backIn: function (e) {
                return e * e * (2.70158 * e - 1.70158)
            }, backOut: function (e) {
                return --e * e * (2.70158 * e + 1.70158) + 1
            }, backInOut: function (e) {
                var t = 2.5949095;
                return (e *= 2) < 1 ? e * e * ((1 + t) * e - t) * .5 : .5 * ((e -= 2) * e * ((1 + t) * e + t) + 2)
            }, bounceIn: function (e) {
                return 1 - Ct.bounceOut(1 - e)
            }, bounceOut: function (e) {
                return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
            }, bounceInOut: function (e) {
                return e < .5 ? .5 * Ct.bounceIn(2 * e) : .5 * Ct.bounceOut(2 * e - 1) + .5
            }
        };

        function St(e) {
            this._target = e.target, this._life = e.life || 1e3, this._delay = e.delay || 0, this._initialized = !1, this.loop = null != e.loop && e.loop, this.gap = e.gap || 0, this.easing = e.easing || "Linear", this.onframe = e.onframe, this.ondestroy = e.ondestroy, this.onrestart = e.onrestart, this._pausedTime = 0, this._paused = !1
        }

        function It() {
            this.head = null, this.tail = null, this._len = 0
        }

        St.prototype = {
            constructor: St, step: function (e, t) {
                if (this._initialized || (this._startTime = e + this._delay, this._initialized = !0), this._paused) this._pausedTime += t; else {
                    var i = (e - this._startTime - this._pausedTime) / this._life;
                    if (!(i < 0)) {
                        i = Math.min(i, 1);
                        var n = this.easing, a = "string" == typeof n ? Ct[n] : n,
                            o = "function" == typeof a ? a(i) : i;
                        return this.fire("frame", o), 1 === i ? this.loop ? (this.restart(e), "restart") : (this._needsRemove = !0, "destroy") : null
                    }
                }
            }, restart: function (e) {
                var t = (e - this._startTime - this._pausedTime) % this._life;
                this._startTime = e - t + this.gap, this._pausedTime = 0, this._needsRemove = !1
            }, fire: function (e, t) {
                this[e = "on" + e] && this[e](this._target, t)
            }, pause: function () {
                this._paused = !0
            }, resume: function () {
                this._paused = !1
            }
        };
        var bt = It.prototype;

        function _t(e) {
            this._list = new It, this._map = {}, this._maxSize = e || 10, this._lastRemovedEntry = null
        }

        bt.insert = function (e) {
            var t = new Dt(e);
            return this.insertEntry(t), t
        }, bt.insertEntry = function (e) {
            this.head ? ((this.tail.next = e).prev = this.tail, e.next = null, this.tail = e) : this.head = this.tail = e, this._len++
        }, bt.remove = function (e) {
            var t = e.prev, i = e.next;
            t ? t.next = i : this.head = i, i ? i.prev = t : this.tail = t, e.next = e.prev = null, this._len--
        }, bt.len = function () {
            return this._len
        }, bt.clear = function () {
            this.head = this.tail = null, this._len = 0
        };
        var Dt = function (e) {
            this.value = e, this.next, this.prev
        }, At = _t.prototype;
        At.put = function (e, t) {
            var i = this._list, n = this._map, a = null;
            if (null == n[e]) {
                var o = i.len(), r = this._lastRemovedEntry;
                if (o >= this._maxSize && 0 < o) {
                    var s = i.head;
                    i.remove(s), delete n[s.key], a = s.value, this._lastRemovedEntry = s
                }
                r ? r.value = t : r = new Dt(t), r.key = e, i.insertEntry(r), n[e] = r
            }
            return a
        }, At.get = function (e) {
            var t = this._map[e], i = this._list;
            if (null != t) return t !== i.tail && (i.remove(t), i.insertEntry(t)), t.value
        }, At.clear = function () {
            this._list.clear(), this._map = {}
        };
        var Nt = {
            transparent: [0, 0, 0, 0],
            aliceblue: [240, 248, 255, 1],
            antiquewhite: [250, 235, 215, 1],
            aqua: [0, 255, 255, 1],
            aquamarine: [127, 255, 212, 1],
            azure: [240, 255, 255, 1],
            beige: [245, 245, 220, 1],
            bisque: [255, 228, 196, 1],
            black: [0, 0, 0, 1],
            blanchedalmond: [255, 235, 205, 1],
            blue: [0, 0, 255, 1],
            blueviolet: [138, 43, 226, 1],
            brown: [165, 42, 42, 1],
            burlywood: [222, 184, 135, 1],
            cadetblue: [95, 158, 160, 1],
            chartreuse: [127, 255, 0, 1],
            chocolate: [210, 105, 30, 1],
            coral: [255, 127, 80, 1],
            cornflowerblue: [100, 149, 237, 1],
            cornsilk: [255, 248, 220, 1],
            crimson: [220, 20, 60, 1],
            cyan: [0, 255, 255, 1],
            darkblue: [0, 0, 139, 1],
            darkcyan: [0, 139, 139, 1],
            darkgoldenrod: [184, 134, 11, 1],
            darkgray: [169, 169, 169, 1],
            darkgreen: [0, 100, 0, 1],
            darkgrey: [169, 169, 169, 1],
            darkkhaki: [189, 183, 107, 1],
            darkmagenta: [139, 0, 139, 1],
            darkolivegreen: [85, 107, 47, 1],
            darkorange: [255, 140, 0, 1],
            darkorchid: [153, 50, 204, 1],
            darkred: [139, 0, 0, 1],
            darksalmon: [233, 150, 122, 1],
            darkseagreen: [143, 188, 143, 1],
            darkslateblue: [72, 61, 139, 1],
            darkslategray: [47, 79, 79, 1],
            darkslategrey: [47, 79, 79, 1],
            darkturquoise: [0, 206, 209, 1],
            darkviolet: [148, 0, 211, 1],
            deeppink: [255, 20, 147, 1],
            deepskyblue: [0, 191, 255, 1],
            dimgray: [105, 105, 105, 1],
            dimgrey: [105, 105, 105, 1],
            dodgerblue: [30, 144, 255, 1],
            firebrick: [178, 34, 34, 1],
            floralwhite: [255, 250, 240, 1],
            forestgreen: [34, 139, 34, 1],
            fuchsia: [255, 0, 255, 1],
            gainsboro: [220, 220, 220, 1],
            ghostwhite: [248, 248, 255, 1],
            gold: [255, 215, 0, 1],
            goldenrod: [218, 165, 32, 1],
            gray: [128, 128, 128, 1],
            green: [0, 128, 0, 1],
            greenyellow: [173, 255, 47, 1],
            grey: [128, 128, 128, 1],
            honeydew: [240, 255, 240, 1],
            hotpink: [255, 105, 180, 1],
            indianred: [205, 92, 92, 1],
            indigo: [75, 0, 130, 1],
            ivory: [255, 255, 240, 1],
            khaki: [240, 230, 140, 1],
            lavender: [230, 230, 250, 1],
            lavenderblush: [255, 240, 245, 1],
            lawngreen: [124, 252, 0, 1],
            lemonchiffon: [255, 250, 205, 1],
            lightblue: [173, 216, 230, 1],
            lightcoral: [240, 128, 128, 1],
            lightcyan: [224, 255, 255, 1],
            lightgoldenrodyellow: [250, 250, 210, 1],
            lightgray: [211, 211, 211, 1],
            lightgreen: [144, 238, 144, 1],
            lightgrey: [211, 211, 211, 1],
            lightpink: [255, 182, 193, 1],
            lightsalmon: [255, 160, 122, 1],
            lightseagreen: [32, 178, 170, 1],
            lightskyblue: [135, 206, 250, 1],
            lightslategray: [119, 136, 153, 1],
            lightslategrey: [119, 136, 153, 1],
            lightsteelblue: [176, 196, 222, 1],
            lightyellow: [255, 255, 224, 1],
            lime: [0, 255, 0, 1],
            limegreen: [50, 205, 50, 1],
            linen: [250, 240, 230, 1],
            magenta: [255, 0, 255, 1],
            maroon: [128, 0, 0, 1],
            mediumaquamarine: [102, 205, 170, 1],
            mediumblue: [0, 0, 205, 1],
            mediumorchid: [186, 85, 211, 1],
            mediumpurple: [147, 112, 219, 1],
            mediumseagreen: [60, 179, 113, 1],
            mediumslateblue: [123, 104, 238, 1],
            mediumspringgreen: [0, 250, 154, 1],
            mediumturquoise: [72, 209, 204, 1],
            mediumvioletred: [199, 21, 133, 1],
            midnightblue: [25, 25, 112, 1],
            mintcream: [245, 255, 250, 1],
            mistyrose: [255, 228, 225, 1],
            moccasin: [255, 228, 181, 1],
            navajowhite: [255, 222, 173, 1],
            navy: [0, 0, 128, 1],
            oldlace: [253, 245, 230, 1],
            olive: [128, 128, 0, 1],
            olivedrab: [107, 142, 35, 1],
            orange: [255, 165, 0, 1],
            orangered: [255, 69, 0, 1],
            orchid: [218, 112, 214, 1],
            palegoldenrod: [238, 232, 170, 1],
            palegreen: [152, 251, 152, 1],
            paleturquoise: [175, 238, 238, 1],
            palevioletred: [219, 112, 147, 1],
            papayawhip: [255, 239, 213, 1],
            peachpuff: [255, 218, 185, 1],
            peru: [205, 133, 63, 1],
            pink: [255, 192, 203, 1],
            plum: [221, 160, 221, 1],
            powderblue: [176, 224, 230, 1],
            purple: [128, 0, 128, 1],
            red: [255, 0, 0, 1],
            rosybrown: [188, 143, 143, 1],
            royalblue: [65, 105, 225, 1],
            saddlebrown: [139, 69, 19, 1],
            salmon: [250, 128, 114, 1],
            sandybrown: [244, 164, 96, 1],
            seagreen: [46, 139, 87, 1],
            seashell: [255, 245, 238, 1],
            sienna: [160, 82, 45, 1],
            silver: [192, 192, 192, 1],
            skyblue: [135, 206, 235, 1],
            slateblue: [106, 90, 205, 1],
            slategray: [112, 128, 144, 1],
            slategrey: [112, 128, 144, 1],
            snow: [255, 250, 250, 1],
            springgreen: [0, 255, 127, 1],
            steelblue: [70, 130, 180, 1],
            tan: [210, 180, 140, 1],
            teal: [0, 128, 128, 1],
            thistle: [216, 191, 216, 1],
            tomato: [255, 99, 71, 1],
            turquoise: [64, 224, 208, 1],
            violet: [238, 130, 238, 1],
            wheat: [245, 222, 179, 1],
            white: [255, 255, 255, 1],
            whitesmoke: [245, 245, 245, 1],
            yellow: [255, 255, 0, 1],
            yellowgreen: [154, 205, 50, 1]
        };

        function xt(e) {
            return (e = Math.round(e)) < 0 ? 0 : 255 < e ? 255 : e
        }

        function Et(e) {
            return e < 0 ? 0 : 1 < e ? 1 : e
        }

        function Pt(e) {
            return e.length && "%" === e.charAt(e.length - 1) ? xt(parseFloat(e) / 100 * 255) : xt(parseInt(e, 10))
        }

        function Ot(e) {
            return e.length && "%" === e.charAt(e.length - 1) ? Et(parseFloat(e) / 100) : Et(parseFloat(e))
        }

        function Mt(e, t, i) {
            return i < 0 ? i += 1 : 1 < i && (i -= 1), 6 * i < 1 ? e + (t - e) * i * 6 : 2 * i < 1 ? t : 3 * i < 2 ? e + (t - e) * (2 / 3 - i) * 6 : e
        }

        function Ft(e, t, i) {
            return e + (t - e) * i
        }

        function Lt(e, t, i, n, a) {
            return e[0] = t, e[1] = i, e[2] = n, e[3] = a, e
        }

        function Rt(e, t) {
            return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e
        }

        var Bt = new _t(20), Ut = null;

        function Kt(e, t) {
            Ut && Rt(Ut, t), Ut = Bt.put(e, Ut || t.slice())
        }

        function Vt(e, t) {
            if (e) {
                t = t || [];
                var i = Bt.get(e);
                if (i) return Rt(t, i);
                var n, a = (e += "").replace(/ /g, "").toLowerCase();
                if (a in Nt) return Rt(t, Nt[a]), Kt(e, t), t;
                if ("#" === a.charAt(0)) return 4 === a.length ? 0 <= (n = parseInt(a.substr(1), 16)) && n <= 4095 ? (Lt(t, (3840 & n) >> 4 | (3840 & n) >> 8, 240 & n | (240 & n) >> 4, 15 & n | (15 & n) << 4, 1), Kt(e, t), t) : void Lt(t, 0, 0, 0, 1) : 7 === a.length ? 0 <= (n = parseInt(a.substr(1), 16)) && n <= 16777215 ? (Lt(t, (16711680 & n) >> 16, (65280 & n) >> 8, 255 & n, 1), Kt(e, t), t) : void Lt(t, 0, 0, 0, 1) : void 0;
                var o = a.indexOf("("), r = a.indexOf(")");
                if (-1 !== o && r + 1 === a.length) {
                    var s = a.substr(0, o), l = a.substr(o + 1, r - (o + 1)).split(","), d = 1;
                    switch (s) {
                        case"rgba":
                            if (4 !== l.length) return void Lt(t, 0, 0, 0, 1);
                            d = Ot(l.pop());
                        case"rgb":
                            return 3 !== l.length ? void Lt(t, 0, 0, 0, 1) : (Lt(t, Pt(l[0]), Pt(l[1]), Pt(l[2]), d), Kt(e, t), t);
                        case"hsla":
                            return 4 !== l.length ? void Lt(t, 0, 0, 0, 1) : (l[3] = Ot(l[3]), Wt(l, t), Kt(e, t), t);
                        case"hsl":
                            return 3 !== l.length ? void Lt(t, 0, 0, 0, 1) : (Wt(l, t), Kt(e, t), t);
                        default:
                            return
                    }
                }
                Lt(t, 0, 0, 0, 1)
            }
        }

        function Wt(e, t) {
            var i = (parseFloat(e[0]) % 360 + 360) % 360 / 360, n = Ot(e[1]), a = Ot(e[2]),
                o = a <= .5 ? a * (n + 1) : a + n - a * n, r = 2 * a - o;
            return Lt(t = t || [], xt(255 * Mt(r, o, i + 1 / 3)), xt(255 * Mt(r, o, i)), xt(255 * Mt(r, o, i - 1 / 3)), 1), 4 === e.length && (t[3] = e[3]), t
        }

        function Gt(e, t) {
            var i = Vt(e);
            if (i) {
                for (var n = 0; n < 3; n++) i[n] = t < 0 ? i[n] * (1 - t) | 0 : (255 - i[n]) * t + i[n] | 0, 255 < i[n] ? i[n] = 255 : e[n] < 0 && (i[n] = 0);
                return Jt(i, 4 === i.length ? "rgba" : "rgb")
            }
        }

        function Ht(e) {
            var t = Vt(e);
            if (t) return ((1 << 24) + (t[0] << 16) + (t[1] << 8) + +t[2]).toString(16).slice(1)
        }

        function zt(e, t, i) {
            if (t && t.length && 0 <= e && e <= 1) {
                i = i || [];
                var n = e * (t.length - 1), a = Math.floor(n), o = Math.ceil(n), r = t[a], s = t[o], l = n - a;
                return i[0] = xt(Ft(r[0], s[0], l)), i[1] = xt(Ft(r[1], s[1], l)), i[2] = xt(Ft(r[2], s[2], l)), i[3] = Et(Ft(r[3], s[3], l)), i
            }
        }

        var jt = zt;

        function Xt(e, t, i) {
            if (t && t.length && 0 <= e && e <= 1) {
                var n = e * (t.length - 1), a = Math.floor(n), o = Math.ceil(n), r = Vt(t[a]), s = Vt(t[o]), l = n - a,
                    d = Jt([xt(Ft(r[0], s[0], l)), xt(Ft(r[1], s[1], l)), xt(Ft(r[2], s[2], l)), Et(Ft(r[3], s[3], l))], "rgba");
                return i ? {color: d, leftIndex: a, rightIndex: o, value: n} : d
            }
        }

        var $t = Xt;

        function Yt(e, t, i, n) {
            if (e = Vt(e)) return e = function (e) {
                if (e) {
                    var t, i, n = e[0] / 255, a = e[1] / 255, o = e[2] / 255, r = Math.min(n, a, o),
                        s = Math.max(n, a, o), l = s - r, d = (s + r) / 2;
                    if (0 == l) i = t = 0; else {
                        i = d < .5 ? l / (s + r) : l / (2 - s - r);
                        var u = ((s - n) / 6 + l / 2) / l, c = ((s - a) / 6 + l / 2) / l, h = ((s - o) / 6 + l / 2) / l;
                        n === s ? t = h - c : a === s ? t = 1 / 3 + u - h : o === s && (t = 2 / 3 + c - u), t < 0 && (t += 1), 1 < t && (t -= 1)
                    }
                    var f = [360 * t, i, d];
                    return null != e[3] && f.push(e[3]), f
                }
            }(e), null != t && (e[0] = function (e) {
                return (e = Math.round(e)) < 0 ? 0 : 360 < e ? 360 : e
            }(t)), null != i && (e[1] = Ot(i)), null != n && (e[2] = Ot(n)), Jt(Wt(e), "rgba")
        }

        function qt(e, t) {
            if ((e = Vt(e)) && null != t) return e[3] = Et(t), Jt(e, "rgba")
        }

        function Jt(e, t) {
            if (e && e.length) {
                var i = e[0] + "," + e[1] + "," + e[2];
                return "rgba" !== t && "hsva" !== t && "hsla" !== t || (i += "," + e[3]), t + "(" + i + ")"
            }
        }

        var Zt = (Object.freeze || Object)({
            parse: Vt,
            lift: Gt,
            toHex: Ht,
            fastLerp: zt,
            fastMapToColor: jt,
            lerp: Xt,
            mapToColor: $t,
            modifyHSL: Yt,
            modifyAlpha: qt,
            stringify: Jt
        }), Qt = Array.prototype.slice;

        function ei(e, t) {
            return e[t]
        }

        function ti(e, t, i) {
            e[t] = i
        }

        function ii(e, t, i) {
            return (t - e) * i + e
        }

        function ni(e, t, i) {
            return .5 < i ? t : e
        }

        function ai(e, t, i, n, a) {
            var o = e.length;
            if (1 === a) for (var r = 0; r < o; r++) n[r] = ii(e[r], t[r], i); else {
                var s = o && e[0].length;
                for (r = 0; r < o; r++) for (var l = 0; l < s; l++) n[r][l] = ii(e[r][l], t[r][l], i)
            }
        }

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

        function ri(e, t, i) {
            if (e === t) return !0;
            var n = e.length;
            if (n !== t.length) return !1;
            if (1 === i) {
                for (var a = 0; a < n; a++) if (e[a] !== t[a]) return !1
            } else {
                var o = e[0].length;
                for (a = 0; a < n; a++) for (var r = 0; r < o; r++) if (e[a][r] !== t[a][r]) return !1
            }
            return !0
        }

        function si(e, t, i, n, a, o, r, s, l) {
            var d = e.length;
            if (1 === l) for (var u = 0; u < d; u++) s[u] = li(e[u], t[u], i[u], n[u], a, o, r); else {
                var c = e[0].length;
                for (u = 0; u < d; u++) for (var h = 0; h < c; h++) s[u][h] = li(e[u][h], t[u][h], i[u][h], n[u][h], a, o, r)
            }
        }

        function li(e, t, i, n, a, o, r) {
            var s = .5 * (i - e), l = .5 * (n - t);
            return (2 * (t - i) + s + l) * r + (-3 * (t - i) - 2 * s - l) * o + s * a + t
        }

        function di(e) {
            if (_(e)) {
                var t = e.length;
                if (_(e[0])) {
                    for (var i = [], n = 0; n < t; n++) i.push(Qt.call(e[n]));
                    return i
                }
                return Qt.call(e)
            }
            return e
        }

        function ui(e) {
            return e[0] = Math.floor(e[0]), e[1] = Math.floor(e[1]), e[2] = Math.floor(e[2]), "rgba(" + e.join(",") + ")"
        }

        function ci(e, t, i, n, a, o) {
            var r = e._getter, s = e._setter, l = "spline" === t, d = n.length;
            if (d) {
                var u, c = _(n[0].value), h = !1, f = !1, g = c ? function (e) {
                    var t = e[e.length - 1].value;
                    return _(t && t[0]) ? 2 : 1
                }(n) : 0;
                n.sort(function (e, t) {
                    return e.time - t.time
                }), u = n[d - 1].time;
                for (var p = [], v = [], m = n[0].value, y = !0, k = 0; k < d; k++) {
                    p.push(n[k].time / u);
                    var T = n[k].value;
                    if (c && ri(T, m, g) || !c && T === m || (y = !1), "string" == typeof (m = T)) {
                        var w = Vt(T);
                        w ? (T = w, h = !0) : f = !0
                    }
                    v.push(T)
                }
                if (o || !y) {
                    var C = v[d - 1];
                    for (k = 0; k < d - 1; k++) c ? oi(v[k], C, g) : !isNaN(v[k]) || isNaN(C) || f || h || (v[k] = C);
                    c && oi(r(e._target, a), C, g);
                    var S, I, b, D, A, N = 0, x = 0;
                    if (h) var E = [0, 0, 0, 0];
                    var P = new St({
                        target: e._target,
                        life: u,
                        loop: e._loop,
                        delay: e._delay,
                        onframe: function (e, t) {
                            var i;
                            if (t < 0) i = 0; else if (t < x) {
                                for (i = Math.min(N + 1, d - 1); 0 <= i && !(p[i] <= t); i--) ;
                                i = Math.min(i, d - 2)
                            } else {
                                for (i = N; i < d && !(p[i] > t); i++) ;
                                i = Math.min(i - 1, d - 2)
                            }
                            x = t;
                            var n = p[(N = i) + 1] - p[i];
                            if (0 != n) if (S = (t - p[i]) / n, l) if (b = v[i], I = v[0 === i ? i : i - 1], D = v[d - 2 < i ? d - 1 : i + 1], A = v[d - 3 < i ? d - 1 : i + 2], c) si(I, b, D, A, S, S * S, S * S * S, r(e, a), g); else {
                                if (h) o = si(I, b, D, A, S, S * S, S * S * S, E, 1), o = ui(E); else {
                                    if (f) return ni(b, D, S);
                                    o = li(I, b, D, A, S, S * S, S * S * S)
                                }
                                s(e, a, o)
                            } else if (c) ai(v[i], v[i + 1], S, r(e, a), g); else {
                                var o;
                                if (h) ai(v[i], v[i + 1], S, E, 1), o = ui(E); else {
                                    if (f) return ni(v[i], v[i + 1], S);
                                    o = ii(v[i], v[i + 1], S)
                                }
                                s(e, a, o)
                            }
                        },
                        ondestroy: i
                    });
                    return t && "spline" !== t && (P.easing = t), P
                }
            }
        }

        function hi(e, t, i, n) {
            this._tracks = {}, this._target = e, this._loop = t || !1, this._getter = i || ei, this._setter = n || ti, this._clipCount = 0, this._delay = 0, this._doneList = [], this._onframeList = [], this._clipList = []
        }

        hi.prototype = {
            when: function (e, t) {
                var i = this._tracks;
                for (var n in t) if (t.hasOwnProperty(n)) {
                    if (!i[n]) {
                        i[n] = [];
                        var a = this._getter(this._target, n);
                        if (null == a) continue;
                        0 !== e && i[n].push({time: 0, value: di(a)})
                    }
                    i[n].push({time: e, value: t[n]})
                }
                return this
            }, during: function (e) {
                return this._onframeList.push(e), this
            }, pause: function () {
                for (var e = 0; e < this._clipList.length; e++) this._clipList[e].pause();
                this._paused = !0
            }, resume: function () {
                for (var e = 0; e < this._clipList.length; e++) this._clipList[e].resume();
                this._paused = !1
            }, isPaused: function () {
                return !!this._paused
            }, _doneCallback: function () {
                this._tracks = {}, this._clipList.length = 0;
                for (var e = this._doneList, t = e.length, i = 0; i < t; i++) e[i].call(this)
            }, start: function (e, t) {
                function i() {
                    --o || a._doneCallback()
                }

                var n, a = this, o = 0;
                for (var r in this._tracks) if (this._tracks.hasOwnProperty(r)) {
                    var s = ci(this, e, i, this._tracks[r], r, t);
                    s && (this._clipList.push(s), o++, this.animation && this.animation.addClip(s), n = s)
                }
                if (n) {
                    var l = n.onframe;
                    n.onframe = function (e, t) {
                        l(e, t);
                        for (var i = 0; i < a._onframeList.length; i++) a._onframeList[i](e, t)
                    }
                }
                return o || this._doneCallback(), this
            }, stop: function (e) {
                for (var t = this._clipList, i = this.animation, n = 0; n < t.length; n++) {
                    var a = t[n];
                    e && a.onframe(this._target, 1), i && i.removeClip(a)
                }
                t.length = 0
            }, delay: function (e) {
                return this._delay = e, this
            }, done: function (e) {
                return e && this._doneList.push(e), this
            }, getClips: function () {
                return this._clipList
            }
        };
        var fi = 1;
        "undefined" != typeof window && (fi = Math.max(window.devicePixelRatio || 1, 1));
        var gi = fi;

        function pi() {
            this.animators = []
        }

        var vi = function () {
        };

        function mi(e, t, i, n, a, o, r, s) {
            L(n) ? (o = a, a = n, n = 0) : F(a) ? (o = a, a = "linear", n = 0) : F(n) ? (o = n, n = 0) : i = F(i) ? (o = i, 500) : i || 500, e.stopAnimation(), function e(t, i, n, a, o, r, s) {
                var l = {}, d = 0;
                for (var u in a) a.hasOwnProperty(u) && (null != n[u] ? R(a[u]) && !_(a[u]) ? e(t, i ? i + "." + u : u, n[u], a[u], o, r, s) : (s ? (l[u] = n[u], yi(t, i, u, a[u])) : l[u] = a[u], d++) : null == a[u] || s || yi(t, i, u, a[u]));
                0 < d && t.animate(i, !1).when(null == o ? 500 : o, l).delay(r || 0)
            }(e, "", e, t, i, n, s);
            var l = e.animators.slice(), d = l.length;

            function u() {
                --d || o && o()
            }

            d || o && o();
            for (var c = 0; c < l.length; c++) l[c].done(u).start(a, r)
        }

        function yi(e, t, i, n) {
            if (t) {
                var a = {};
                a[t] = {}, a[t][i] = n, e.attr(a)
            } else e.attr(i, n)
        }

        pi.prototype = {
            constructor: pi, animate: function (e, t) {
                var i, n = !1, a = this, o = this.__zr;
                if (e) {
                    var r = e.split("."), s = a;
                    n = "shape" === r[0];
                    for (var l = 0, d = r.length; l < d; l++) s = s && s[r[l]];
                    s && (i = s)
                } else i = a;
                if (i) {
                    var u = a.animators, c = new hi(i, t);
                    return c.during(function (e) {
                        a.dirty(n)
                    }).done(function () {
                        u.splice(S(u, c), 1)
                    }), u.push(c), o && o.animation.addAnimator(c), c
                }
                vi('Property "' + e + '" is not existed in element ' + a.id)
            }, stopAnimation: function (e) {
                for (var t = this.animators, i = t.length, n = 0; n < i; n++) t[n].stop(e);
                return t.length = 0, this
            }, animateTo: function (e, t, i, n, a, o) {
                mi(this, e, t, i, n, a, o)
            }, animateFrom: function (e, t, i, n, a, o) {
                mi(this, e, t, i, n, a, o, !0)
            }
        };
        var ki = function (e) {
            mt.call(this, e), Ne.call(this, e), pi.call(this, e), this.id = e.id || n()
        };
        ki.prototype = {
            type: "element", name: "", __zr: null, ignore: !1, clipPath: null, isGroup: !1, drift: function (e, t) {
                switch (this.draggable) {
                    case"horizontal":
                        t = 0;
                        break;
                    case"vertical":
                        e = 0
                }
                var i = this.transform;
                (i = i || (this.transform = [1, 0, 0, 1, 0, 0]))[4] += e, i[5] += t, this.decomposeTransform(), this.dirty(!1)
            }, beforeUpdate: function () {
            }, afterUpdate: function () {
            }, update: function () {
                this.updateTransform()
            }, traverse: function (e, t) {
            }, attrKV: function (e, t) {
                if ("position" === e || "scale" === e || "origin" === e) {
                    if (t) {
                        var i = this[e];
                        (i = i || (this[e] = []))[0] = t[0], i[1] = t[1]
                    }
                } else this[e] = t
            }, hide: function () {
                this.ignore = !0, this.__zr && this.__zr.refresh()
            }, show: function () {
                this.ignore = !1, this.__zr && this.__zr.refresh()
            }, attr: function (e, t) {
                if ("string" == typeof e) this.attrKV(e, t); else if (R(e)) for (var i in e) e.hasOwnProperty(i) && this.attrKV(i, e[i]);
                return this.dirty(!1), this
            }, setClipPath: function (e) {
                var t = this.__zr;
                t && e.addSelfToZr(t), this.clipPath && this.clipPath !== e && this.removeClipPath(), (this.clipPath = e).__zr = t, (e.__clipTarget = this).dirty(!1)
            }, removeClipPath: function () {
                var e = this.clipPath;
                e && (e.__zr && e.removeSelfFromZr(e.__zr), e.__zr = null, e.__clipTarget = null, this.clipPath = null, this.dirty(!1))
            }, addSelfToZr: function (e) {
                this.__zr = e;
                var t = this.animators;
                if (t) for (var i = 0; i < t.length; i++) e.animation.addAnimator(t[i]);
                this.clipPath && this.clipPath.addSelfToZr(e)
            }, removeSelfFromZr: function (e) {
                this.__zr = null;
                var t = this.animators;
                if (t) for (var i = 0; i < t.length; i++) e.animation.removeAnimator(t[i]);
                this.clipPath && this.clipPath.removeSelfFromZr(e)
            }
        }, b(ki, pi), b(ki, mt), b(ki, Ne);
        var Ti, wi, Ci, Si, Ii = Ce, bi = Math.min, _i = Math.max;

        function Di(e, t, i, n) {
            i < 0 && (e += i, i = -i), n < 0 && (t += n, n = -n), this.x = e, this.y = t, this.width = i, this.height = n
        }

        Di.prototype = {
            constructor: Di, union: function (e) {
                var t = bi(e.x, this.x), i = bi(e.y, this.y);
                this.width = _i(e.x + e.width, this.x + this.width) - t, this.height = _i(e.y + e.height, this.y + this.height) - i, this.x = t, this.y = i
            }, applyTransform: (Ti = [], wi = [], Ci = [], Si = [], function (e) {
                if (e) {
                    Ti[0] = Ci[0] = this.x, Ti[1] = Si[1] = this.y, wi[0] = Si[0] = this.x + this.width, wi[1] = Ci[1] = this.y + this.height, Ii(Ti, Ti, e), Ii(wi, wi, e), Ii(Ci, Ci, e), Ii(Si, Si, e), this.x = bi(Ti[0], wi[0], Ci[0], Si[0]), this.y = bi(Ti[1], wi[1], Ci[1], Si[1]);
                    var t = _i(Ti[0], wi[0], Ci[0], Si[0]), i = _i(Ti[1], wi[1], Ci[1], Si[1]);
                    this.width = t - this.x, this.height = i - this.y
                }
            }), calculateTransform: function (e) {
                var t = e.width / this.width, i = e.height / this.height, n = ot();
                return dt(n, n, [-this.x, -this.y]), ct(n, n, [t, i]), dt(n, n, [e.x, e.y]), n
            }, intersect: function (e) {
                if (!e) return !1;
                e instanceof Di || (e = Di.create(e));
                var t = this, i = t.x, n = t.x + t.width, a = t.y, o = t.y + t.height, r = e.x, s = e.x + e.width,
                    l = e.y, d = e.y + e.height;
                return !(n < r || s < i || o < l || d < a)
            }, contain: function (e, t) {
                var i = this;
                return e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height
            }, clone: function () {
                return new Di(this.x, this.y, this.width, this.height)
            }, copy: function (e) {
                this.x = e.x, this.y = e.y, this.width = e.width, this.height = e.height
            }, plain: function () {
                return {x: this.x, y: this.y, width: this.width, height: this.height}
            }
        }, Di.create = function (e) {
            return new Di(e.x, e.y, e.width, e.height)
        };
        var Ai = function (e) {
            for (var t in e = e || {}, ki.call(this, e), e) e.hasOwnProperty(t) && (this[t] = e[t]);
            this._children = [], this.__storage = null, this.__dirty = !0
        };
        Ai.prototype = {
            constructor: Ai, isGroup: !0, type: "group", silent: !1, children: function () {
                return this._children.slice()
            }, childAt: function (e) {
                return this._children[e]
            }, childOfName: function (e) {
                for (var t = this._children, i = 0; i < t.length; i++) if (t[i].name === e) return t[i]
            }, childCount: function () {
                return this._children.length
            }, add: function (e) {
                return e && e !== this && e.parent !== this && (this._children.push(e), this._doAdd(e)), this
            }, addBefore: function (e, t) {
                if (e && e !== this && e.parent !== this && t && t.parent === this) {
                    var i = this._children, n = i.indexOf(t);
                    0 <= n && (i.splice(n, 0, e), this._doAdd(e))
                }
                return this
            }, _doAdd: function (e) {
                e.parent && e.parent.remove(e);
                var t = (e.parent = this).__storage, i = this.__zr;
                t && t !== e.__storage && (t.addToStorage(e), e instanceof Ai && e.addChildrenToStorage(t)), i && i.refresh()
            }, remove: function (e) {
                var t = this.__zr, i = this.__storage, n = this._children, a = S(n, e);
                return a < 0 || (n.splice(a, 1), e.parent = null, i && (i.delFromStorage(e), e instanceof Ai && e.delChildrenFromStorage(i)), t && t.refresh()), this
            }, removeAll: function () {
                var e, t, i = this._children, n = this.__storage;
                for (t = 0; t < i.length; t++) e = i[t], n && (n.delFromStorage(e), e instanceof Ai && e.delChildrenFromStorage(n)), e.parent = null;
                return i.length = 0, this
            }, eachChild: function (e, t) {
                for (var i = this._children, n = 0; n < i.length; n++) {
                    var a = i[n];
                    e.call(t, a, n)
                }
                return this
            }, traverse: function (e, t) {
                for (var i = 0; i < this._children.length; i++) {
                    var n = this._children[i];
                    e.call(t, n), "group" === n.type && n.traverse(e, t)
                }
                return this
            }, addChildrenToStorage: function (e) {
                for (var t = 0; t < this._children.length; t++) {
                    var i = this._children[t];
                    e.addToStorage(i), i instanceof Ai && i.addChildrenToStorage(e)
                }
            }, delChildrenFromStorage: function (e) {
                for (var t = 0; t < this._children.length; t++) {
                    var i = this._children[t];
                    e.delFromStorage(i), i instanceof Ai && i.delChildrenFromStorage(e)
                }
            }, dirty: function () {
                return this.__dirty = !0, this.__zr && this.__zr.refresh(), this
            }, getBoundingRect: function (e) {
                for (var t = null, i = new Di(0, 0, 0, 0), n = e || this._children, a = [], o = 0; o < n.length; o++) {
                    var r = n[o];
                    if (!r.ignore && !r.invisible) {
                        var s = r.getBoundingRect(), l = r.getLocalTransform(a);
                        l ? (i.copy(s), i.applyTransform(l), (t = t || i.clone()).union(i)) : (t = t || s.clone()).union(s)
                    }
                }
                return t || i
            }
        }, I(Ai, ki);
        var Ni = 32, xi = 7;

        function Ei(e, t, i, n) {
            var a = t + 1;
            if (a === i) return 1;
            if (n(e[a++], e[t]) < 0) {
                for (; a < i && n(e[a], e[a - 1]) < 0;) a++;
                !function (e, t, i) {
                    for (i--; t < i;) {
                        var n = e[t];
                        e[t++] = e[i], e[i--] = n
                    }
                }(e, t, a)
            } else for (; a < i && 0 <= n(e[a], e[a - 1]);) a++;
            return a - t
        }

        function Pi(e, t, i, n, a) {
            for (n === t && n++; n < i; n++) {
                for (var o, r = e[n], s = t, l = n; s < l;) a(r, e[o = s + l >>> 1]) < 0 ? l = o : s = 1 + o;
                var d = n - s;
                switch (d) {
                    case 3:
                        e[s + 3] = e[s + 2];
                    case 2:
                        e[s + 2] = e[s + 1];
                    case 1:
                        e[s + 1] = e[s];
                        break;
                    default:
                        for (; 0 < d;) e[s + d] = e[s + d - 1], d--
                }
                e[s] = r
            }
        }

        function Oi(e, t, i, n, a, o) {
            var r = 0, s = 0, l = 1;
            if (0 < o(e, t[i + a])) {
                for (s = n - a; l < s && 0 < o(e, t[i + a + l]);) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s), r += a, l += a
            } else {
                for (s = a + 1; l < s && o(e, t[i + a - l]) <= 0;) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s);
                var d = r;
                r = a - l, l = a - d
            }
            for (r++; r < l;) {
                var u = r + (l - r >>> 1);
                0 < o(e, t[i + u]) ? r = u + 1 : l = u
            }
            return l
        }

        function Mi(e, t, i, n, a, o) {
            var r = 0, s = 0, l = 1;
            if (o(e, t[i + a]) < 0) {
                for (s = a + 1; l < s && o(e, t[i + a - l]) < 0;) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s);
                var d = r;
                r = a - l, l = a - d
            } else {
                for (s = n - a; l < s && 0 <= o(e, t[i + a + l]);) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s), r += a, l += a
            }
            for (r++; r < l;) {
                var u = r + (l - r >>> 1);
                o(e, t[i + u]) < 0 ? l = u : r = u + 1
            }
            return l
        }

        function Fi(e, t, i, n) {
            i = i || 0;
            var a = (n = n || e.length) - i;
            if (!(a < 2)) {
                var o = 0;
                if (a < Ni) Pi(e, i, n, i + (o = Ei(e, i, n, t)), t); else {
                    var r = new function (e, t) {
                        var i, n, a = xi, o = 0, r = [];

                        function s(s) {
                            var l = i[s], d = n[s], u = i[s + 1], c = n[s + 1];
                            n[s] = d + c, s === o - 3 && (i[s + 1] = i[s + 2], n[s + 1] = n[s + 2]), o--;
                            var h = Mi(e[u], e, l, d, 0, t);
                            l += h, 0 != (d -= h) && 0 !== (c = Oi(e[l + d - 1], e, u, c, c - 1, t)) && (d <= c ? function (i, n, o, s) {
                                var l = 0;
                                for (l = 0; l < n; l++) r[l] = e[i + l];
                                var d = 0, u = o, c = i;
                                if (e[c++] = e[u++], 0 != --s) {
                                    if (1 === n) {
                                        for (l = 0; l < s; l++) e[c + l] = e[u + l];
                                        return e[c + s] = r[d]
                                    }
                                    for (var h, f, g, p = a; ;) {
                                        f = h = 0, g = !1;
                                        do {
                                            if (t(e[u], r[d]) < 0) {
                                                if (e[c++] = e[u++], f++, (h = 0) == --s) {
                                                    g = !0;
                                                    break
                                                }
                                            } else if (e[c++] = r[d++], h++, f = 0, 1 == --n) {
                                                g = !0;
                                                break
                                            }
                                        } while ((h | f) < p);
                                        if (g) break;
                                        do {
                                            if (0 !== (h = Mi(e[u], r, d, n, 0, t))) {
                                                for (l = 0; l < h; l++) e[c + l] = r[d + l];
                                                if (c += h, d += h, (n -= h) <= 1) {
                                                    g = !0;
                                                    break
                                                }
                                            }
                                            if (e[c++] = e[u++], 0 == --s) {
                                                g = !0;
                                                break
                                            }
                                            if (0 !== (f = Oi(r[d], e, u, s, 0, t))) {
                                                for (l = 0; l < f; l++) e[c + l] = e[u + l];
                                                if (c += f, u += f, 0 == (s -= f)) {
                                                    g = !0;
                                                    break
                                                }
                                            }
                                            if (e[c++] = r[d++], 1 == --n) {
                                                g = !0;
                                                break
                                            }
                                            p--
                                        } while (xi <= h || xi <= f);
                                        if (g) break;
                                        p < 0 && (p = 0), p += 2
                                    }
                                    if ((a = p) < 1 && (a = 1), 1 === n) {
                                        for (l = 0; l < s; l++) e[c + l] = e[u + l];
                                        e[c + s] = r[d]
                                    } else {
                                        if (0 === n) throw new Error;
                                        for (l = 0; l < n; l++) e[c + l] = r[d + l]
                                    }
                                } else for (l = 0; l < n; l++) e[c + l] = r[d + l]
                            }(l, d, u, c) : function (i, n, o, s) {
                                var l = 0;
                                for (l = 0; l < s; l++) r[l] = e[o + l];
                                var d = i + n - 1, u = s - 1, c = o + s - 1, h = 0, f = 0;
                                if (e[c--] = e[d--], 0 != --n) {
                                    if (1 === s) {
                                        for (f = 1 + (c -= n), h = 1 + (d -= n), l = n - 1; 0 <= l; l--) e[f + l] = e[h + l];
                                        return e[c] = r[u]
                                    }
                                    for (var g = a; ;) {
                                        var p = 0, v = 0, m = !1;
                                        do {
                                            if (t(r[u], e[d]) < 0) {
                                                if (e[c--] = e[d--], p++, (v = 0) == --n) {
                                                    m = !0;
                                                    break
                                                }
                                            } else if (e[c--] = r[u--], v++, p = 0, 1 == --s) {
                                                m = !0;
                                                break
                                            }
                                        } while ((p | v) < g);
                                        if (m) break;
                                        do {
                                            if (0 != (p = n - Mi(r[u], e, i, n, n - 1, t))) {
                                                for (n -= p, f = 1 + (c -= p), h = 1 + (d -= p), l = p - 1; 0 <= l; l--) e[f + l] = e[h + l];
                                                if (0 === n) {
                                                    m = !0;
                                                    break
                                                }
                                            }
                                            if (e[c--] = r[u--], 1 == --s) {
                                                m = !0;
                                                break
                                            }
                                            if (0 != (v = s - Oi(e[d], r, 0, s, s - 1, t))) {
                                                for (s -= v, f = 1 + (c -= v), h = 1 + (u -= v), l = 0; l < v; l++) e[f + l] = r[h + l];
                                                if (s <= 1) {
                                                    m = !0;
                                                    break
                                                }
                                            }
                                            if (e[c--] = e[d--], 0 == --n) {
                                                m = !0;
                                                break
                                            }
                                            g--
                                        } while (xi <= p || xi <= v);
                                        if (m) break;
                                        g < 0 && (g = 0), g += 2
                                    }
                                    if ((a = g) < 1 && (a = 1), 1 === s) {
                                        for (f = 1 + (c -= n), h = 1 + (d -= n), l = n - 1; 0 <= l; l--) e[f + l] = e[h + l];
                                        e[c] = r[u]
                                    } else {
                                        if (0 === s) throw new Error;
                                        for (h = c - (s - 1), l = 0; l < s; l++) e[h + l] = r[l]
                                    }
                                } else for (h = c - (s - 1), l = 0; l < s; l++) e[h + l] = r[l]
                            }(l, d, u, c))
                        }

                        i = [], n = [], this.mergeRuns = function () {
                            for (; 1 < o;) {
                                var e = o - 2;
                                if (1 <= e && n[e - 1] <= n[e] + n[e + 1] || 2 <= e && n[e - 2] <= n[e] + n[e - 1]) n[e - 1] < n[e + 1] && e--; else if (n[e] > n[e + 1]) break;
                                s(e)
                            }
                        }, this.forceMergeRuns = function () {
                            for (; 1 < o;) {
                                var e = o - 2;
                                0 < e && n[e - 1] < n[e + 1] && e--, s(e)
                            }
                        }, this.pushRun = function (e, t) {
                            i[o] = e, n[o] = t, o += 1
                        }
                    }(e, t), s = function (e) {
                        for (var t = 0; Ni <= e;) t |= 1 & e, e >>= 1;
                        return e + t
                    }(a);
                    do {
                        if ((o = Ei(e, i, n, t)) < s) {
                            var l = a;
                            s < l && (l = s), Pi(e, i, i + l, i + o, t), o = l
                        }
                        r.pushRun(i, o), r.mergeRuns(), a -= o, i += o
                    } while (0 !== a);
                    r.forceMergeRuns()
                }
            }
        }

        function Li(e, t) {
            return e.zlevel === t.zlevel ? e.z === t.z ? e.z2 - t.z2 : e.z - t.z : e.zlevel - t.zlevel
        }

        function Ri() {
            this._roots = [], this._displayList = [], this._displayListLen = 0
        }

        Ri.prototype = {
            constructor: Ri, traverse: function (e, t) {
                for (var i = 0; i < this._roots.length; i++) this._roots[i].traverse(e, t)
            }, getDisplayList: function (e, t) {
                return t = t || !1, e && this.updateDisplayList(t), this._displayList
            }, updateDisplayList: function (e) {
                this._displayListLen = 0;
                for (var t = this._roots, i = this._displayList, n = 0, o = t.length; n < o; n++) this._updateAndAddDisplayable(t[n], null, e);
                i.length = this._displayListLen, a.canvasSupported && Fi(i, Li)
            }, _updateAndAddDisplayable: function (e, t, i) {
                if (!e.ignore || i) {
                    e.beforeUpdate(), e.__dirty && e.update(), e.afterUpdate();
                    var n = e.clipPath;
                    if (n) {
                        t = t ? t.slice() : [];
                        for (var a = n, o = e; a;) a.parent = o, a.updateTransform(), t.push(a), a = (o = a).clipPath
                    }
                    if (e.isGroup) {
                        for (var r = e._children, s = 0; s < r.length; s++) {
                            var l = r[s];
                            e.__dirty && (l.__dirty = !0), this._updateAndAddDisplayable(l, t, i)
                        }
                        e.__dirty = !1
                    } else e.__clipPaths = t, this._displayList[this._displayListLen++] = e
                }
            }, addRoot: function (e) {
                e.__storage !== this && (e instanceof Ai && e.addChildrenToStorage(this), this.addToStorage(e), this._roots.push(e))
            }, delRoot: function (e) {
                if (null == e) {
                    for (var t = 0; t < this._roots.length; t++) {
                        var i = this._roots[t];
                        i instanceof Ai && i.delChildrenFromStorage(this)
                    }
                    return this._roots = [], this._displayList = [], void (this._displayListLen = 0)
                }
                if (e instanceof Array) {
                    t = 0;
                    for (var n = e.length; t < n; t++) this.delRoot(e[t])
                } else {
                    var a = S(this._roots, e);
                    0 <= a && (this.delFromStorage(e), this._roots.splice(a, 1), e instanceof Ai && e.delChildrenFromStorage(this))
                }
            }, addToStorage: function (e) {
                return e && (e.__storage = this, e.dirty(!1)), this
            }, delFromStorage: function (e) {
                return e && (e.__storage = null), this
            }, dispose: function () {
                this._renderList = this._roots = null
            }, displayableSortFunc: Li
        };
        var Bi = {
                shadowBlur: 1,
                shadowOffsetX: 1,
                shadowOffsetY: 1,
                textShadowBlur: 1,
                textShadowOffsetX: 1,
                textShadowOffsetY: 1,
                textBoxShadowBlur: 1,
                textBoxShadowOffsetX: 1,
                textBoxShadowOffsetY: 1
            }, Ui = function (e, t, i) {
                return Bi.hasOwnProperty(t) ? i * e.dpr : i
            }, Ki = {NONE: 0, STYLE_BIND: 1, PLAIN_TEXT: 2}, Vi = 9,
            Wi = [["shadowBlur", 0], ["shadowOffsetX", 0], ["shadowOffsetY", 0], ["shadowColor", "#000"], ["lineCap", "butt"], ["lineJoin", "miter"], ["miterLimit", 10]],
            Gi = function (e) {
                this.extendFrom(e, !1)
            };
        Gi.prototype = {
            constructor: Gi,
            fill: "#000",
            stroke: null,
            opacity: 1,
            fillOpacity: null,
            strokeOpacity: null,
            lineDash: null,
            lineDashOffset: 0,
            shadowBlur: 0,
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            lineWidth: 1,
            strokeNoScale: !1,
            text: null,
            font: null,
            textFont: null,
            fontStyle: null,
            fontWeight: null,
            fontSize: null,
            fontFamily: null,
            textTag: null,
            textFill: "#000",
            textStroke: null,
            textWidth: null,
            textHeight: null,
            textStrokeWidth: 0,
            textLineHeight: null,
            textPosition: "inside",
            textRect: null,
            textOffset: null,
            textAlign: null,
            textVerticalAlign: null,
            textDistance: 5,
            textShadowColor: "transparent",
            textShadowBlur: 0,
            textShadowOffsetX: 0,
            textShadowOffsetY: 0,
            textBoxShadowColor: "transparent",
            textBoxShadowBlur: 0,
            textBoxShadowOffsetX: 0,
            textBoxShadowOffsetY: 0,
            transformText: !1,
            textRotation: 0,
            textOrigin: null,
            textBackgroundColor: null,
            textBorderColor: null,
            textBorderWidth: 0,
            textBorderRadius: 0,
            textPadding: null,
            rich: null,
            truncate: null,
            blend: null,
            bind: function (e, t, i) {
                var n = this, a = i && i.style, o = !a || e.__attrCachedBy !== Ki.STYLE_BIND;
                e.__attrCachedBy = Ki.STYLE_BIND;
                for (var r = 0; r < Wi.length; r++) {
                    var s = Wi[r], l = s[0];
                    !o && n[l] === a[l] || (e[l] = Ui(e, l, n[l] || s[1]))
                }
                if (!o && n.fill === a.fill || (e.fillStyle = n.fill), !o && n.stroke === a.stroke || (e.strokeStyle = n.stroke), !o && n.opacity === a.opacity || (e.globalAlpha = null == n.opacity ? 1 : n.opacity), !o && n.blend === a.blend || (e.globalCompositeOperation = n.blend || "source-over"), this.hasStroke()) {
                    var d = n.lineWidth;
                    e.lineWidth = d / (this.strokeNoScale && t && t.getLineScale ? t.getLineScale() : 1)
                }
            },
            hasFill: function () {
                var e = this.fill;
                return null != e && "none" !== e
            },
            hasStroke: function () {
                var e = this.stroke;
                return null != e && "none" !== e && 0 < this.lineWidth
            },
            extendFrom: function (e, t) {
                if (e) for (var i in e) !e.hasOwnProperty(i) || !0 !== t && (!1 === t ? this.hasOwnProperty(i) : null == e[i]) || (this[i] = e[i])
            },
            set: function (e, t) {
                "string" == typeof e ? this[e] = t : this.extendFrom(e, !0)
            },
            clone: function () {
                var e = new this.constructor;
                return e.extendFrom(this, !0), e
            },
            getGradient: function (e, t, i) {
                for (var n = ("radial" === t.type ? function (e, t, i) {
                    var n = i.width, a = i.height, o = Math.min(n, a), r = null == t.x ? .5 : t.x,
                        s = null == t.y ? .5 : t.y, l = null == t.r ? .5 : t.r;
                    return t.global || (r = r * n + i.x, s = s * a + i.y, l *= o), e.createRadialGradient(r, s, 0, r, s, l)
                } : function (e, t, i) {
                    var n = null == t.x ? 0 : t.x, a = null == t.x2 ? 1 : t.x2, o = null == t.y ? 0 : t.y,
                        r = null == t.y2 ? 0 : t.y2;
                    return t.global || (n = n * i.width + i.x, a = a * i.width + i.x, o = o * i.height + i.y, r = r * i.height + i.y), n = isNaN(n) ? 0 : n, a = isNaN(a) ? 1 : a, o = isNaN(o) ? 0 : o, r = isNaN(r) ? 0 : r, e.createLinearGradient(n, o, a, r)
                })(e, t, i), a = t.colorStops, o = 0; o < a.length; o++) n.addColorStop(a[o].offset, a[o].color);
                return n
            }
        };
        for (var Hi = Gi.prototype, zi = 0; zi < Wi.length; zi++) {
            var ji = Wi[zi];
            ji[0] in Hi || (Hi[ji[0]] = ji[1])
        }

        function Xi(e, t) {
            this.image = e, this.repeat = t, this.type = "pattern"
        }

        function $i() {
            return !1
        }

        function Yi(e, t, i) {
            var n = w(), a = t.getWidth(), o = t.getHeight(), r = n.style;
            return r && (r.position = "absolute", r.left = 0, r.top = 0, r.width = a + "px", r.height = o + "px", n.setAttribute("data-zr-dom-id", e)), n.width = a * i, n.height = o * i, n
        }

        function qi(e, t, i) {
            var n;
            i = i || gi, "string" == typeof e ? n = Yi(e, t, i) : R(e) && (e = (n = e).id), this.id = e;
            var a = (this.dom = n).style;
            a && (n.onselectstart = $i, a["-webkit-user-select"] = "none", a["user-select"] = "none", a["-webkit-touch-callout"] = "none", a["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)", a.padding = 0, a.margin = 0, a["border-width"] = 0), this.domBack = null, this.ctxBack = null, this.painter = t, this.config = null, this.clearColor = 0, this.motionBlur = !1, this.lastFrameAlpha = .7, this.dpr = i
        }

        Gi.getGradient = Hi.getGradient, qi.prototype = {
            constructor: qi, __dirty: !0, __used: !(Xi.prototype.getCanvasPattern = function (e) {
                return e.createPattern(this.image, this.repeat || "repeat")
            }), __drawIndex: 0, __startIndex: 0, __endIndex: 0, incremental: !1, getElementCount: function () {
                return this.__endIndex - this.__startIndex
            }, initContext: function () {
                this.ctx = this.dom.getContext("2d"), this.ctx.dpr = this.dpr
            }, createBackBuffer: function () {
                var e = this.dpr;
                this.domBack = Yi("back-" + this.id, this.painter, e), this.ctxBack = this.domBack.getContext("2d"), 1 !== e && this.ctxBack.scale(e, e)
            }, resize: function (e, t) {
                var i = this.dpr, n = this.dom, a = n.style, o = this.domBack;
                a && (a.width = e + "px", a.height = t + "px"), n.width = e * i, n.height = t * i, o && (o.width = e * i, o.height = t * i, 1 !== i && this.ctxBack.scale(i, i))
            }, clear: function (e, t) {
                var i, n = this.dom, a = this.ctx, o = n.width, r = n.height,
                    s = (t = t || this.clearColor, this.motionBlur && !e), l = this.lastFrameAlpha, d = this.dpr;
                if (s && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(n, 0, 0, o / d, r / d)), a.clearRect(0, 0, o, r), t && "transparent" !== t && (t.colorStops ? (i = t.__canvasGradient || Gi.getGradient(a, t, {
                    x: 0,
                    y: 0,
                    width: o,
                    height: r
                }), t.__canvasGradient = i) : t.image && (i = Xi.prototype.getCanvasPattern.call(t, a)), a.save(), a.fillStyle = i || t, a.fillRect(0, 0, o, r), a.restore()), s) {
                    var u = this.domBack;
                    a.save(), a.globalAlpha = l, a.drawImage(u, 0, 0, o, r), a.restore()
                }
            }
        };
        var Ji = "undefined" != typeof window && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (e) {
            setTimeout(e, 16)
        }, Zi = new _t(50);

        function Qi(e) {
            if ("string" != typeof e) return e;
            var t = Zi.get(e);
            return t && t.image
        }

        function en(e, t, i, n, a) {
            if (e) {
                if ("string" != typeof e) return e;
                if (t && t.__zrImageSrc === e || !i) return t;
                var o = Zi.get(e), r = {hostEl: i, cb: n, cbPayload: a};
                return o ? nn(t = o.image) || o.pending.push(r) : ((t = new Image).onload = t.onerror = tn, Zi.put(e, t.__cachedImgObj = {
                    image: t,
                    pending: [r]
                }), t.src = t.__zrImageSrc = e), t
            }
            return t
        }

        function tn() {
            var e = this.__cachedImgObj;
            this.onload = this.onerror = this.__cachedImgObj = null;
            for (var t = 0; t < e.pending.length; t++) {
                var i = e.pending[t], n = i.cb;
                n && n(this, i.cbPayload), i.hostEl.dirty()
            }
            e.pending.length = 0
        }

        function nn(e) {
            return e && e.width && e.height
        }

        var an = {}, on = 0, rn = 5e3, sn = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g, ln = "12px sans-serif", dn = {};

        function un(e, t) {
            var i = e + ":" + (t = t || ln);
            if (an[i]) return an[i];
            for (var n, a, o = (e + "").split("\n"), r = 0, s = 0, l = o.length; s < l; s++) r = Math.max((n = o[s], a = t, dn.measureText(n, a)).width, r);
            return rn < on && (on = 0, an = {}), on++, an[i] = r
        }

        function cn(e, t, i, n, a, o, r, s) {
            return r ? function (e, t, i, n, a, o, r, s) {
                var l = wn(e, {rich: r, truncate: s, font: t, textAlign: i, textPadding: a, textLineHeight: o}),
                    d = l.outerWidth, u = l.outerHeight, c = hn(0, d, i), h = fn(0, u, n);
                return new Di(c, h, d, u)
            }(e, t, i, n, a, o, r, s) : function (e, t, i, n, a, o, r) {
                var s = Tn(e, t, a, o, r), l = un(e, t);
                a && (l += a[1] + a[3]);
                var d = s.outerHeight, u = hn(0, l, i), c = fn(0, d, n), h = new Di(u, c, l, d);
                return h.lineHeight = s.lineHeight, h
            }(e, t, i, n, a, o, s)
        }

        function hn(e, t, i) {
            return "right" === i ? e -= t : "center" === i && (e -= t / 2), e
        }

        function fn(e, t, i) {
            return "middle" === i ? e -= t / 2 : "bottom" === i && (e -= t), e
        }

        function gn(e, t, i) {
            var n = t.textPosition, a = t.textDistance, o = i.x, r = i.y;
            a = a || 0;
            var s = i.height, l = i.width, d = s / 2, u = "left", c = "top";
            switch (n) {
                case"left":
                    o -= a, r += d, u = "right", c = "middle";
                    break;
                case"right":
                    o += a + l, r += d, c = "middle";
                    break;
                case"top":
                    o += l / 2, r -= a, u = "center", c = "bottom";
                    break;
                case"bottom":
                    o += l / 2, r += s + a, u = "center";
                    break;
                case"inside":
                    o += l / 2, r += d, u = "center", c = "middle";
                    break;
                case"insideLeft":
                    o += a, r += d, c = "middle";
                    break;
                case"insideRight":
                    o += l - a, r += d, u = "right", c = "middle";
                    break;
                case"insideTop":
                    o += l / 2, r += a, u = "center";
                    break;
                case"insideBottom":
                    o += l / 2, r += s - a, u = "center", c = "bottom";
                    break;
                case"insideTopLeft":
                    o += a, r += a;
                    break;
                case"insideTopRight":
                    o += l - a, r += a, u = "right";
                    break;
                case"insideBottomLeft":
                    o += a, r += s - a, c = "bottom";
                    break;
                case"insideBottomRight":
                    o += l - a, r += s - a, u = "right", c = "bottom"
            }
            return (e = e || {}).x = o, e.y = r, e.textAlign = u, e.textVerticalAlign = c, e
        }

        function pn(e, t, i, n, a) {
            if (!t) return "";
            var o = (e + "").split("\n");
            a = vn(t, i, n, a);
            for (var r = 0, s = o.length; r < s; r++) o[r] = mn(o[r], a);
            return o.join("\n")
        }

        function vn(e, t, i, n) {
            (n = k({}, n)).font = t, i = G(i, "..."), n.maxIterations = G(n.maxIterations, 2);
            var a = n.minChar = G(n.minChar, 0);
            n.cnCharWidth = un("国", t);
            var o = n.ascCharWidth = un("a", t);
            n.placeholder = G(n.placeholder, "");
            for (var r = e = Math.max(0, e - 1), s = 0; s < a && o <= r; s++) r -= o;
            var l = un(i, t);
            return r < l && (i = "", l = 0), r = e - l, n.ellipsis = i, n.ellipsisWidth = l, n.contentWidth = r, n.containerWidth = e, n
        }

        function mn(e, t) {
            var i = t.containerWidth, n = t.font, a = t.contentWidth;
            if (!i) return "";
            var o = un(e, n);
            if (o <= i) return e;
            for (var r = 0; ; r++) {
                if (o <= a || r >= t.maxIterations) {
                    e += t.ellipsis;
                    break
                }
                var s = 0 === r ? yn(e, a, t.ascCharWidth, t.cnCharWidth) : 0 < o ? Math.floor(e.length * a / o) : 0;
                o = un(e = e.substr(0, s), n)
            }
            return "" === e && (e = t.placeholder), e
        }

        function yn(e, t, i, n) {
            for (var a = 0, o = 0, r = e.length; o < r && a < t; o++) {
                var s = e.charCodeAt(o);
                a += 0 <= s && s <= 127 ? i : n
            }
            return o
        }

        function kn(e) {
            return un("国", e)
        }

        function Tn(e, t, i, n, a) {
            null != e && (e += "");
            var o = G(n, kn(t)), r = e ? e.split("\n") : [], s = r.length * o, l = s, d = !0;
            if (i && (l += i[0] + i[2]), e && a) {
                d = !1;
                var u = a.outerHeight, c = a.outerWidth;
                if (null != u && u < l) e = "", r = []; else if (null != c) for (var h = vn(c - (i ? i[1] + i[3] : 0), t, a.ellipsis, {
                    minChar: a.minChar,
                    placeholder: a.placeholder
                }), f = 0, g = r.length; f < g; f++) r[f] = mn(r[f], h)
            }
            return {lines: r, height: s, outerHeight: l, lineHeight: o, canCacheByTextString: d}
        }

        function wn(e, t) {
            var i = {lines: [], width: 0, height: 0};
            if (null != e && (e += ""), !e) return i;
            for (var n, a = sn.lastIndex = 0; null != (n = sn.exec(e));) {
                var o = n.index;
                a < o && Cn(i, e.substring(a, o)), Cn(i, n[2], n[1]), a = sn.lastIndex
            }
            a < e.length && Cn(i, e.substring(a, e.length));
            var r = i.lines, s = 0, l = 0, d = [], u = t.textPadding, c = t.truncate, h = c && c.outerWidth,
                f = c && c.outerHeight;
            u && (null != h && (h -= u[1] + u[3]), null != f && (f -= u[0] + u[2]));
            for (var g = 0; g < r.length; g++) {
                for (var p = r[g], v = 0, m = 0, y = 0; y < p.tokens.length; y++) {
                    var k = (N = p.tokens[y]).styleName && t.rich[N.styleName] || {}, T = N.textPadding = k.textPadding,
                        w = N.font = k.font || t.font, C = N.textHeight = G(k.textHeight, kn(w));
                    if (T && (C += T[0] + T[2]), N.height = C, N.lineHeight = H(k.textLineHeight, t.textLineHeight, C), N.textAlign = k && k.textAlign || t.textAlign, N.textVerticalAlign = k && k.textVerticalAlign || "middle", null != f && s + N.lineHeight > f) return {
                        lines: [],
                        width: 0,
                        height: 0
                    };
                    N.textWidth = un(N.text, w);
                    var S = k.textWidth, I = null == S || "auto" === S;
                    if ("string" == typeof S && "%" === S.charAt(S.length - 1)) N.percentWidth = S, d.push(N), S = 0; else {
                        if (I) {
                            S = N.textWidth;
                            var b = k.textBackgroundColor, _ = b && b.image;
                            _ && nn(_ = Qi(_)) && (S = Math.max(S, _.width * C / _.height))
                        }
                        var D = T ? T[1] + T[3] : 0;
                        S += D;
                        var A = null != h ? h - m : null;
                        null != A && A < S && (!I || A < D ? (N.text = "", N.textWidth = S = 0) : (N.text = pn(N.text, A - D, w, c.ellipsis, {minChar: c.minChar}), N.textWidth = un(N.text, w), S = N.textWidth + D))
                    }
                    m += N.width = S, k && (v = Math.max(v, N.lineHeight))
                }
                p.width = m, s += p.lineHeight = v, l = Math.max(l, m)
            }
            for (i.outerWidth = i.width = G(t.textWidth, l), i.outerHeight = i.height = G(t.textHeight, s), u && (i.outerWidth += u[1] + u[3], i.outerHeight += u[0] + u[2]), g = 0; g < d.length; g++) {
                var N, x = (N = d[g]).percentWidth;
                N.width = parseInt(x, 10) / 100 * l
            }
            return i
        }

        function Cn(e, t, i) {
            for (var n = "" === t, a = t.split("\n"), o = e.lines, r = 0; r < a.length; r++) {
                var s = a[r], l = {styleName: i, text: s, isLineHolder: !s && !n};
                if (r) o.push({tokens: [l]}); else {
                    var d = (o[o.length - 1] || (o[0] = {tokens: []})).tokens, u = d.length;
                    1 === u && d[0].isLineHolder ? d[0] = l : !s && u && !n || d.push(l)
                }
            }
        }

        function Sn(e) {
            var t = (e.fontSize || e.fontFamily) && [e.fontStyle, e.fontWeight, (e.fontSize || 12) + "px", e.fontFamily || "sans-serif"].join(" ");
            return t && $(t) || e.textFont || e.font
        }

        function In(e, t) {
            var i, n, a, o, r, s = t.x, l = t.y, d = t.width, u = t.height, c = t.r;
            d < 0 && (s += d, d = -d), u < 0 && (l += u, u = -u), "number" == typeof c ? i = n = a = o = c : c instanceof Array ? 1 === c.length ? i = n = a = o = c[0] : 2 === c.length ? (i = a = c[0], n = o = c[1]) : 3 === c.length ? (i = c[0], n = o = c[1], a = c[2]) : (i = c[0], n = c[1], a = c[2], o = c[3]) : i = n = a = o = 0, d < i + n && (i *= d / (r = i + n), n *= d / r), d < a + o && (a *= d / (r = a + o), o *= d / r), u < n + a && (n *= u / (r = n + a), a *= u / r), u < i + o && (i *= u / (r = i + o), o *= u / r), e.moveTo(s + i, l), e.lineTo(s + d - n, l), 0 !== n && e.arc(s + d - n, l + n, n, -Math.PI / 2, 0), e.lineTo(s + d, l + u - a), 0 !== a && e.arc(s + d - a, l + u - a, a, 0, Math.PI / 2), e.lineTo(s + o, l + u), 0 !== o && e.arc(s + o, l + u - o, o, Math.PI / 2, Math.PI), e.lineTo(s, l + i), 0 !== i && e.arc(s + i, l + i, i, Math.PI, 1.5 * Math.PI)
        }

        dn.measureText = function (e, t) {
            var i = C();
            return i.font = t || ln, i.measureText(e)
        };
        var bn = ln, _n = {left: 1, right: 1, center: 1}, Dn = {top: 1, bottom: 1, middle: 1},
            An = [["textShadowBlur", "shadowBlur", 0], ["textShadowOffsetX", "shadowOffsetX", 0], ["textShadowOffsetY", "shadowOffsetY", 0], ["textShadowColor", "shadowColor", "transparent"]],
            Nn = {}, xn = {};

        function En(e) {
            return Pn(e), D(e.rich, Pn), e
        }

        function Pn(e) {
            if (e) {
                e.font = Sn(e);
                var t = e.textAlign;
                "middle" === t && (t = "center"), e.textAlign = null == t || _n[t] ? t : "left";
                var i = e.textVerticalAlign || e.textBaseline;
                "center" === i && (i = "middle"), e.textVerticalAlign = null == i || Dn[i] ? i : "top", e.textPadding && (e.textPadding = j(e.textPadding))
            }
        }

        function On(e, t, i, n, a, o) {
            n.rich ? function (e, t, i, n, a, o) {
                o !== Vi && (t.__attrCachedBy = Ki.NONE);
                var r = e.__textCotentBlock;
                r && !e.__dirtyText || (r = e.__textCotentBlock = wn(i, n)), function (e, t, i, n, a) {
                    var o = i.width, r = i.outerWidth, s = i.outerHeight, l = n.textPadding, d = Un(xn, e, n, a),
                        u = d.baseX, c = d.baseY, h = d.textAlign, f = d.textVerticalAlign;
                    Mn(t, n, a, u, c);
                    var g = hn(u, r, h), p = fn(c, s, f), v = g, m = p;
                    l && (v += l[3], m += l[0]);
                    var y = v + o;
                    Ln(n) && Rn(e, t, n, g, p, r, s);
                    for (var k = 0; k < i.lines.length; k++) {
                        for (var T, w = i.lines[k], C = w.tokens, S = C.length, I = w.lineHeight, b = w.width, _ = 0, D = v, A = y, N = S - 1; _ < S && (!(T = C[_]).textAlign || "left" === T.textAlign);) Fn(e, t, T, n, I, m, D, "left"), b -= T.width, D += T.width, _++;
                        for (; 0 <= N && "right" === (T = C[N]).textAlign;) Fn(e, t, T, n, I, m, A, "right"), b -= T.width, A -= T.width, N--;
                        for (D += (o - (D - v) - (y - A) - b) / 2; _ <= N;) T = C[_], Fn(e, t, T, n, I, m, D + T.width / 2, "center"), D += T.width, _++;
                        m += I
                    }
                }(e, t, r, n, a)
            }(e, t, i, n, a, o) : function (e, t, i, n, a, o) {
                var r, s = Ln(n), l = !1, d = t.__attrCachedBy === Ki.PLAIN_TEXT;
                o !== Vi ? (o && (r = o.style, l = !s && d && r), t.__attrCachedBy = s ? Ki.NONE : Ki.PLAIN_TEXT) : d && (t.__attrCachedBy = Ki.NONE);
                var u = n.font || bn;
                l && u === (r.font || bn) || (t.font = u);
                var c = e.__computedFont;
                e.__styleFont !== u && (e.__styleFont = u, c = e.__computedFont = t.font);
                var h = n.textPadding, f = n.textLineHeight, g = e.__textCotentBlock;
                g && !e.__dirtyText || (g = e.__textCotentBlock = Tn(i, c, h, f, n.truncate));
                var p = g.outerHeight, v = g.lines, m = g.lineHeight, y = Un(xn, e, n, a), k = y.baseX, T = y.baseY,
                    w = y.textAlign || "left", C = y.textVerticalAlign;
                Mn(t, n, a, k, T);
                var S = fn(T, p, C), I = k, b = S;
                if (s || h) {
                    var _ = un(i, c);
                    h && (_ += h[1] + h[3]);
                    var D = hn(k, _, w);
                    s && Rn(e, t, n, D, S, _, p), h && (I = Hn(k, w, h), b += h[0])
                }
                t.textAlign = w, t.textBaseline = "middle", t.globalAlpha = n.opacity || 1;
                for (var A = 0; A < An.length; A++) {
                    var N = An[A], x = N[0], E = N[1], P = n[x];
                    l && P === r[x] || (t[E] = Ui(t, E, P || N[2]))
                }
                b += m / 2;
                var O = n.textStrokeWidth, M = l ? r.textStrokeWidth : null, F = !l || O !== M,
                    L = !l || F || n.textStroke !== r.textStroke, R = Vn(n.textStroke, O), B = Wn(n.textFill);
                if (R && (F && (t.lineWidth = O), L && (t.strokeStyle = R)), B && (l && n.textFill === r.textFill || (t.fillStyle = B)), 1 === v.length) R && t.strokeText(v[0], I, b), B && t.fillText(v[0], I, b); else for (A = 0; A < v.length; A++) R && t.strokeText(v[A], I, b), B && t.fillText(v[A], I, b), b += m
            }(e, t, i, n, a, o)
        }

        function Mn(e, t, i, n, a) {
            if (i && t.textRotation) {
                var o = t.textOrigin;
                "center" === o ? (n = i.width / 2 + i.x, a = i.height / 2 + i.y) : o && (n = o[0] + i.x, a = o[1] + i.y), e.translate(n, a), e.rotate(-t.textRotation), e.translate(-n, -a)
            }
        }

        function Fn(e, t, i, n, a, o, r, s) {
            var l = n.rich[i.styleName] || {};
            l.text = i.text;
            var d = i.textVerticalAlign, u = o + a / 2;
            "top" === d ? u = o + i.height / 2 : "bottom" === d && (u = o + a - i.height / 2), !i.isLineHolder && Ln(l) && Rn(e, t, l, "right" === s ? r - i.width : "center" === s ? r - i.width / 2 : r, u - i.height / 2, i.width, i.height);
            var c = i.textPadding;
            c && (r = Hn(r, s, c), u -= i.height / 2 - c[2] - i.textHeight / 2), Kn(t, "shadowBlur", H(l.textShadowBlur, n.textShadowBlur, 0)), Kn(t, "shadowColor", l.textShadowColor || n.textShadowColor || "transparent"), Kn(t, "shadowOffsetX", H(l.textShadowOffsetX, n.textShadowOffsetX, 0)), Kn(t, "shadowOffsetY", H(l.textShadowOffsetY, n.textShadowOffsetY, 0)), Kn(t, "textAlign", s), Kn(t, "textBaseline", "middle"), Kn(t, "font", i.font || bn);
            var h = Vn(l.textStroke || n.textStroke, g), f = Wn(l.textFill || n.textFill),
                g = G(l.textStrokeWidth, n.textStrokeWidth);
            h && (Kn(t, "lineWidth", g), Kn(t, "strokeStyle", h), t.strokeText(i.text, r, u)), f && (Kn(t, "fillStyle", f), t.fillText(i.text, r, u))
        }

        function Ln(e) {
            return !!(e.textBackgroundColor || e.textBorderWidth && e.textBorderColor)
        }

        function Rn(e, t, i, n, a, o, r) {
            var s = i.textBackgroundColor, l = i.textBorderWidth, d = i.textBorderColor, u = L(s);
            if (Kn(t, "shadowBlur", i.textBoxShadowBlur || 0), Kn(t, "shadowColor", i.textBoxShadowColor || "transparent"), Kn(t, "shadowOffsetX", i.textBoxShadowOffsetX || 0), Kn(t, "shadowOffsetY", i.textBoxShadowOffsetY || 0), u || l && d) {
                t.beginPath();
                var c = i.textBorderRadius;
                c ? In(t, {x: n, y: a, width: o, height: r, r: c}) : t.rect(n, a, o, r), t.closePath()
            }
            if (u) if (Kn(t, "fillStyle", s), null != i.fillOpacity) {
                var h = t.globalAlpha;
                t.globalAlpha = i.fillOpacity * i.opacity, t.fill(), t.globalAlpha = h
            } else t.fill(); else if (R(s)) {
                var f = s.image;
                (f = en(f, null, e, Bn, s)) && nn(f) && t.drawImage(f, n, a, o, r)
            }
            l && d && (Kn(t, "lineWidth", l), Kn(t, "strokeStyle", d), null != i.strokeOpacity ? (h = t.globalAlpha, t.globalAlpha = i.strokeOpacity * i.opacity, t.stroke(), t.globalAlpha = h) : t.stroke())
        }

        function Bn(e, t) {
            t.image = e
        }

        function Un(e, t, i, n) {
            var a = i.x || 0, o = i.y || 0, r = i.textAlign, s = i.textVerticalAlign;
            if (n) {
                var l = i.textPosition;
                if (l instanceof Array) a = n.x + Gn(l[0], n.width), o = n.y + Gn(l[1], n.height); else {
                    var d = t && t.calculateTextPosition ? t.calculateTextPosition(Nn, i, n) : gn(Nn, i, n);
                    a = d.x, o = d.y, r = r || d.textAlign, s = s || d.textVerticalAlign
                }
                var u = i.textOffset;
                u && (a += u[0], o += u[1])
            }
            return (e = e || {}).baseX = a, e.baseY = o, e.textAlign = r, e.textVerticalAlign = s, e
        }

        function Kn(e, t, i) {
            return e[t] = Ui(e, t, i), e[t]
        }

        function Vn(e, t) {
            return null == e || t <= 0 || "transparent" === e || "none" === e ? null : e.image || e.colorStops ? "#000" : e
        }

        function Wn(e) {
            return null == e || "none" === e ? null : e.image || e.colorStops ? "#000" : e
        }

        function Gn(e, t) {
            return "string" == typeof e ? 0 <= e.lastIndexOf("%") ? parseFloat(e) / 100 * t : parseFloat(e) : e
        }

        function Hn(e, t, i) {
            return "right" === t ? e - i[1] : "center" === t ? e + i[3] / 2 - i[1] / 2 : e + i[3]
        }

        function zn(e, t) {
            return null != e && (e || t.textBackgroundColor || t.textBorderWidth && t.textBorderColor || t.textPadding)
        }

        function jn() {
        }

        var Xn = new Di;

        function $n(e) {
            for (var t in e = e || {}, ki.call(this, e), e) e.hasOwnProperty(t) && "style" !== t && (this[t] = e[t]);
            this.style = new Gi(e.style, this), this._rect = null, this.__clipPaths = null
        }

        function Yn(e) {
            $n.call(this, e)
        }

        $n.prototype = {
            constructor: $n,
            type: "displayable",
            __dirty: !0,
            invisible: !(jn.prototype = {
                constructor: jn, drawRectText: function (e, t) {
                    var i = this.style;
                    t = i.textRect || t, this.__dirty && En(i);
                    var n = i.text;
                    if (null != n && (n += ""), zn(n, i)) {
                        e.save();
                        var a = this.transform;
                        i.transformText ? this.setTransform(e) : a && (Xn.copy(t), Xn.applyTransform(a), t = Xn), On(this, e, n, i, t, Vi), e.restore()
                    }
                }
            }),
            z: 0,
            z2: 0,
            zlevel: 0,
            draggable: !1,
            dragging: !1,
            silent: !1,
            culling: !1,
            cursor: "pointer",
            rectHover: !1,
            progressive: !1,
            incremental: !1,
            globalScaleRatio: 1,
            beforeBrush: function (e) {
            },
            afterBrush: function (e) {
            },
            brush: function (e, t) {
            },
            getBoundingRect: function () {
            },
            contain: function (e, t) {
                return this.rectContain(e, t)
            },
            traverse: function (e, t) {
                e.call(t, this)
            },
            rectContain: function (e, t) {
                var i = this.transformCoordToLocal(e, t);
                return this.getBoundingRect().contain(i[0], i[1])
            },
            dirty: function () {
                this.__dirty = this.__dirtyText = !0, this._rect = null, this.__zr && this.__zr.refresh()
            },
            animateStyle: function (e) {
                return this.animate("style", e)
            },
            attrKV: function (e, t) {
                "style" !== e ? ki.prototype.attrKV.call(this, e, t) : this.style.set(t)
            },
            setStyle: function (e, t) {
                return this.style.set(e, t), this.dirty(!1), this
            },
            useStyle: function (e) {
                return this.style = new Gi(e, this), this.dirty(!1), this
            },
            calculateTextPosition: null
        }, I($n, ki), b($n, jn), Yn.prototype = {
            constructor: Yn, type: "image", brush: function (e, t) {
                var i = this.style, n = i.image;
                i.bind(e, this, t);
                var a = this._image = en(n, this._image, this, this.onload);
                if (a && nn(a)) {
                    var o = i.x || 0, r = i.y || 0, s = i.width, l = i.height, d = a.width / a.height;
                    if (null == s && null != l ? s = l * d : null == l && null != s ? l = s / d : null == s && null == l && (s = a.width, l = a.height), this.setTransform(e), i.sWidth && i.sHeight) {
                        var u = i.sx || 0, c = i.sy || 0;
                        e.drawImage(a, u, c, i.sWidth, i.sHeight, o, r, s, l)
                    } else if (i.sx && i.sy) {
                        var h = s - (u = i.sx), f = l - (c = i.sy);
                        e.drawImage(a, u, c, h, f, o, r, s, l)
                    } else e.drawImage(a, o, r, s, l);
                    null != i.text && (this.restoreTransform(e), this.drawRectText(e, this.getBoundingRect()))
                }
            }, getBoundingRect: function () {
                var e = this.style;
                return this._rect || (this._rect = new Di(e.x || 0, e.y || 0, e.width || 0, e.height || 0)), this._rect
            }
        }, I(Yn, $n);
        var qn = 314159;

        function Jn(e) {
            return parseInt(e, 10)
        }

        var Zn = new Di(0, 0, 0, 0), Qn = new Di(0, 0, 0, 0);

        function ea(e, t, i) {
            this.type = "canvas";
            var n = !e.nodeName || "CANVAS" === e.nodeName.toUpperCase();
            this._opts = i = k({}, i || {}), this.dpr = i.devicePixelRatio || gi, this._singleCanvas = n;
            var a = (this.root = e).style;
            a && (a["-webkit-tap-highlight-color"] = "transparent", a["-webkit-user-select"] = a["user-select"] = a["-webkit-touch-callout"] = "none", e.innerHTML = ""), this.storage = t;
            var o = this._zlevelList = [], r = this._layers = {};
            if (this._layerConfig = {}, this._needsManuallyCompositing = !1, n) {
                var s = e.width, l = e.height;
                null != i.width && (s = i.width), null != i.height && (l = i.height), this.dpr = i.devicePixelRatio || 1, e.width = s * this.dpr, e.height = l * this.dpr, this._width = s, this._height = l;
                var d = new qi(e, this, this.dpr);
                d.__builtin__ = !0, d.initContext(), (r[qn] = d).zlevel = qn, o.push(qn), this._domRoot = e
            } else {
                this._width = this._getSize(0), this._height = this._getSize(1);
                var u = this._domRoot = function (e, t) {
                    var i = document.createElement("div");
                    return i.style.cssText = ["position:relative", "width:" + e + "px", "height:" + t + "px", "padding:0", "margin:0", "border-width:0"].join(";") + ";", i
                }(this._width, this._height);
                e.appendChild(u)
            }
            this._hoverlayer = null, this._hoverElements = []
        }

        function ta(e) {
            e = e || {}, this.stage = e.stage || {}, this.onframe = e.onframe || function () {
            }, this._clips = [], this._running = !1, this._time, this._pausedTime, this._pauseStart, this._paused = !1, Ne.call(this)
        }

        ea.prototype = {
            constructor: ea, getType: function () {
                return "canvas"
            }, isSingleCanvas: function () {
                return this._singleCanvas
            }, getViewportRoot: function () {
                return this._domRoot
            }, getViewportRootOffset: function () {
                var e = this.getViewportRoot();
                if (e) return {offsetLeft: e.offsetLeft || 0, offsetTop: e.offsetTop || 0}
            }, refresh: function (e) {
                var t = this.storage.getDisplayList(!0), i = this._zlevelList;
                this._redrawId = Math.random(), this._paintList(t, e, this._redrawId);
                for (var n = 0; n < i.length; n++) {
                    var a = i[n], o = this._layers[a];
                    if (!o.__builtin__ && o.refresh) {
                        var r = 0 === n ? this._backgroundColor : null;
                        o.refresh(r)
                    }
                }
                return this.refreshHover(), this
            }, addHover: function (e, t) {
                if (!e.__hoverMir) {
                    var i = new e.constructor({style: e.style, shape: e.shape, z: e.z, z2: e.z2, silent: e.silent});
                    return (i.__from = e).__hoverMir = i, t && i.setStyle(t), this._hoverElements.push(i), i
                }
            }, removeHover: function (e) {
                var t = e.__hoverMir, i = this._hoverElements, n = S(i, t);
                0 <= n && i.splice(n, 1), e.__hoverMir = null
            }, clearHover: function (e) {
                for (var t = this._hoverElements, i = 0; i < t.length; i++) {
                    var n = t[i].__from;
                    n && (n.__hoverMir = null)
                }
                t.length = 0
            }, refreshHover: function () {
                var e = this._hoverElements, t = e.length, i = this._hoverlayer;
                if (i && i.clear(), t) {
                    Fi(e, this.storage.displayableSortFunc);
                    var n = {};
                    (i = i || (this._hoverlayer = this.getLayer(1e5))).ctx.save();
                    for (var a = 0; a < t;) {
                        var o = e[a], r = o.__from;
                        r && r.__zr ? (a++, r.invisible || (o.transform = r.transform, o.invTransform = r.invTransform, o.__clipPaths = r.__clipPaths, this._doPaintEl(o, i, !0, n))) : (e.splice(a, 1), r.__hoverMir = null, t--)
                    }
                    i.ctx.restore()
                }
            }, getHoverLayer: function () {
                return this.getLayer(1e5)
            }, _paintList: function (e, t, i) {
                if (this._redrawId === i) {
                    t = t || !1, this._updateLayerStatus(e);
                    var n = this._doPaintList(e, t);
                    if (this._needsManuallyCompositing && this._compositeManually(), !n) {
                        var a = this;
                        Ji(function () {
                            a._paintList(e, t, i)
                        })
                    }
                }
            }, _compositeManually: function () {
                var e = this.getLayer(qn).ctx, t = this._domRoot.width, i = this._domRoot.height;
                e.clearRect(0, 0, t, i), this.eachBuiltinLayer(function (n) {
                    n.virtual && e.drawImage(n.dom, 0, 0, t, i)
                })
            }, _doPaintList: function (e, t) {
                for (var i = [], n = 0; n < this._zlevelList.length; n++) {
                    var o = this._zlevelList[n];
                    (l = this._layers[o]).__builtin__ && l !== this._hoverlayer && (l.__dirty || t) && i.push(l)
                }
                for (var r = !0, s = 0; s < i.length; s++) {
                    var l, d = (l = i[s]).ctx, u = {};
                    d.save();
                    var c = t ? l.__startIndex : l.__drawIndex, h = !t && l.incremental && Date.now,
                        f = h && Date.now(), g = l.zlevel === this._zlevelList[0] ? this._backgroundColor : null;
                    if (l.__startIndex === l.__endIndex) l.clear(!1, g); else if (c === l.__startIndex) {
                        var p = e[c];
                        p.incremental && p.notClear && !t || l.clear(!1, g)
                    }
                    -1 === c && (console.error("For some unknown reason. drawIndex is -1"), c = l.__startIndex);
                    for (var v = c; v < l.__endIndex; v++) {
                        var m = e[v];
                        if (this._doPaintEl(m, l, t, u), m.__dirty = m.__dirtyText = !1, h && 15 < Date.now() - f) break
                    }
                    l.__drawIndex = v, l.__drawIndex < l.__endIndex && (r = !1), u.prevElClipPaths && d.restore(), d.restore()
                }
                return a.wxa && D(this._layers, function (e) {
                    e && e.ctx && e.ctx.draw && e.ctx.draw()
                }), r
            }, _doPaintEl: function (e, t, i, n) {
                var a = t.ctx, o = e.transform;
                if ((t.__dirty || i) && !e.invisible && 0 !== e.style.opacity && (!o || o[0] || o[3]) && (!e.culling || !function (e, t, i) {
                    return Zn.copy(e.getBoundingRect()), e.transform && Zn.applyTransform(e.transform), Qn.width = t, Qn.height = i, !Zn.intersect(Qn)
                }(e, this._width, this._height))) {
                    var r = e.__clipPaths, s = n.prevElClipPaths;
                    s && !function (e, t) {
                        if (e === t) return !1;
                        if (!e || !t || e.length !== t.length) return !0;
                        for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !0;
                        return !1
                    }(r, s) || (s && (a.restore(), n.prevElClipPaths = null, n.prevEl = null), r && (a.save(), function (e, t) {
                        for (var i = 0; i < e.length; i++) {
                            var n = e[i];
                            n.setTransform(t), t.beginPath(), n.buildPath(t, n.shape), t.clip(), n.restoreTransform(t)
                        }
                    }(r, a), n.prevElClipPaths = r)), e.beforeBrush && e.beforeBrush(a), e.brush(a, n.prevEl || null), (n.prevEl = e).afterBrush && e.afterBrush(a)
                }
            }, getLayer: function (e, t) {
                this._singleCanvas && !this._needsManuallyCompositing && (e = qn);
                var i = this._layers[e];
                return i || ((i = new qi("zr_" + e, this, this.dpr)).zlevel = e, i.__builtin__ = !0, this._layerConfig[e] ? m(i, this._layerConfig[e], !0) : this._layerConfig[e - .01] && m(i, this._layerConfig[e - .01], !0), t && (i.virtual = t), this.insertLayer(e, i), i.initContext()), i
            }, insertLayer: function (e, t) {
                var i = this._layers, n = this._zlevelList, a = n.length, o = null, r = -1, s = this._domRoot;
                if (i[e]) vi("ZLevel " + e + " has been used already"); else if (function (e) {
                    return !!e && (!!e.__builtin__ || "function" == typeof e.resize && "function" == typeof e.refresh)
                }(t)) {
                    if (0 < a && e > n[0]) {
                        for (r = 0; r < a - 1 && !(n[r] < e && n[r + 1] > e); r++) ;
                        o = i[n[r]]
                    }
                    if (n.splice(r + 1, 0, e), !(i[e] = t).virtual) if (o) {
                        var l = o.dom;
                        l.nextSibling ? s.insertBefore(t.dom, l.nextSibling) : s.appendChild(t.dom)
                    } else s.firstChild ? s.insertBefore(t.dom, s.firstChild) : s.appendChild(t.dom)
                } else vi("Layer of zlevel " + e + " is not valid")
            }, eachLayer: function (e, t) {
                var i, n, a = this._zlevelList;
                for (n = 0; n < a.length; n++) i = a[n], e.call(t, this._layers[i], i)
            }, eachBuiltinLayer: function (e, t) {
                var i, n, a, o = this._zlevelList;
                for (a = 0; a < o.length; a++) n = o[a], (i = this._layers[n]).__builtin__ && e.call(t, i, n)
            }, eachOtherLayer: function (e, t) {
                var i, n, a, o = this._zlevelList;
                for (a = 0; a < o.length; a++) n = o[a], (i = this._layers[n]).__builtin__ || e.call(t, i, n)
            }, getLayers: function () {
                return this._layers
            }, _updateLayerStatus: function (e) {
                function t(e) {
                    a && (a.__endIndex !== e && (a.__dirty = !0), a.__endIndex = e)
                }

                if (this.eachBuiltinLayer(function (e, t) {
                    e.__dirty = e.__used = !1
                }), this._singleCanvas) for (var i = 1; i < e.length; i++) if ((r = e[i]).zlevel !== e[i - 1].zlevel || r.incremental) {
                    this._needsManuallyCompositing = !0;
                    break
                }
                var n, a = null, o = 0;
                for (i = 0; i < e.length; i++) {
                    var r, s, l = (r = e[i]).zlevel;
                    n !== l && (n = l, o = 0), r.incremental ? ((s = this.getLayer(l + .001, this._needsManuallyCompositing)).incremental = !0, o = 1) : s = this.getLayer(l + (0 < o ? .01 : 0), this._needsManuallyCompositing), s.__builtin__ || vi("ZLevel " + l + " has been used by unkown layer " + s.id), s !== a && (s.__used = !0, s.__startIndex !== i && (s.__dirty = !0), s.__startIndex = i, s.incremental ? s.__drawIndex = -1 : s.__drawIndex = i, t(i), a = s), r.__dirty && (s.__dirty = !0, s.incremental && s.__drawIndex < 0 && (s.__drawIndex = i))
                }
                t(i), this.eachBuiltinLayer(function (e, t) {
                    !e.__used && 0 < e.getElementCount() && (e.__dirty = !0, e.__startIndex = e.__endIndex = e.__drawIndex = 0), e.__dirty && e.__drawIndex < 0 && (e.__drawIndex = e.__startIndex)
                })
            }, clear: function () {
                return this.eachBuiltinLayer(this._clearLayer), this
            }, _clearLayer: function (e) {
                e.clear()
            }, setBackgroundColor: function (e) {
                this._backgroundColor = e
            }, configLayer: function (e, t) {
                if (t) {
                    var i = this._layerConfig;
                    i[e] ? m(i[e], t, !0) : i[e] = t;
                    for (var n = 0; n < this._zlevelList.length; n++) {
                        var a = this._zlevelList[n];
                        a !== e && a !== e + .01 || m(this._layers[a], i[e], !0)
                    }
                }
            }, delLayer: function (e) {
                var t = this._layers, i = this._zlevelList, n = t[e];
                n && (n.dom.parentNode.removeChild(n.dom), delete t[e], i.splice(S(i, e), 1))
            }, resize: function (e, t) {
                if (this._domRoot.style) {
                    var i = this._domRoot;
                    i.style.display = "none";
                    var n = this._opts;
                    if (null != e && (n.width = e), null != t && (n.height = t), e = this._getSize(0), t = this._getSize(1), i.style.display = "", this._width !== e || t !== this._height) {
                        for (var a in i.style.width = e + "px", i.style.height = t + "px", this._layers) this._layers.hasOwnProperty(a) && this._layers[a].resize(e, t);
                        D(this._progressiveLayers, function (i) {
                            i.resize(e, t)
                        }), this.refresh(!0)
                    }
                    this._width = e, this._height = t
                } else {
                    if (null == e || null == t) return;
                    this._width = e, this._height = t, this.getLayer(qn).resize(e, t)
                }
                return this
            }, clearLayer: function (e) {
                var t = this._layers[e];
                t && t.clear()
            }, dispose: function () {
                this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._layers = null
            }, getRenderedCanvas: function (e) {
                if (e = e || {}, this._singleCanvas && !this._compositeManually) return this._layers[qn].dom;
                var t = new qi("image", this, e.pixelRatio || this.dpr);
                if (t.initContext(), t.clear(!1, e.backgroundColor || this._backgroundColor), e.pixelRatio <= this.dpr) {
                    this.refresh();
                    var i = t.dom.width, n = t.dom.height, a = t.ctx;
                    this.eachLayer(function (e) {
                        e.__builtin__ ? a.drawImage(e.dom, 0, 0, i, n) : e.renderToCanvas && (t.ctx.save(), e.renderToCanvas(t.ctx), t.ctx.restore())
                    })
                } else for (var o = {}, r = this.storage.getDisplayList(!0), s = 0; s < r.length; s++) {
                    var l = r[s];
                    this._doPaintEl(l, t, !0, o)
                }
                return t.dom
            }, getWidth: function () {
                return this._width
            }, getHeight: function () {
                return this._height
            }, _getSize: function (e) {
                var t = this._opts, i = ["width", "height"][e], n = ["clientWidth", "clientHeight"][e],
                    a = ["paddingLeft", "paddingTop"][e], o = ["paddingRight", "paddingBottom"][e];
                if (null != t[i] && "auto" !== t[i]) return parseFloat(t[i]);
                var r = this.root, s = document.defaultView.getComputedStyle(r);
                return (r[n] || Jn(s[i]) || Jn(r.style[i])) - (Jn(s[a]) || 0) - (Jn(s[o]) || 0) | 0
            }, pathToImage: function (e, t) {
                t = t || this.dpr;
                var i = document.createElement("canvas"), n = i.getContext("2d"), a = e.getBoundingRect(), o = e.style,
                    r = o.shadowBlur * t, s = o.shadowOffsetX * t, l = o.shadowOffsetY * t,
                    d = o.hasStroke() ? o.lineWidth : 0, u = Math.max(d / 2, r - s), c = Math.max(d / 2, s + r),
                    h = Math.max(d / 2, r - l), f = Math.max(d / 2, l + r), g = a.width + u + c, p = a.height + h + f;
                i.width = g * t, i.height = p * t, n.scale(t, t), n.clearRect(0, 0, g, p), n.dpr = t;
                var v = {position: e.position, rotation: e.rotation, scale: e.scale};
                e.position = [u - a.x, h - a.y], e.rotation = 0, e.scale = [1, 1], e.updateTransform(), e && e.brush(n);
                var m = new Yn({style: {x: 0, y: 0, image: i}});
                return null != v.position && (m.position = e.position = v.position), null != v.rotation && (m.rotation = e.rotation = v.rotation), null != v.scale && (m.scale = e.scale = v.scale), m
            }
        }, ta.prototype = {
            constructor: ta, addClip: function (e) {
                this._clips.push(e)
            }, addAnimator: function (e) {
                e.animation = this;
                for (var t = e.getClips(), i = 0; i < t.length; i++) this.addClip(t[i])
            }, removeClip: function (e) {
                var t = S(this._clips, e);
                0 <= t && this._clips.splice(t, 1)
            }, removeAnimator: function (e) {
                for (var t = e.getClips(), i = 0; i < t.length; i++) this.removeClip(t[i]);
                e.animation = null
            }, _update: function () {
                for (var e = (new Date).getTime() - this._pausedTime, t = e - this._time, i = this._clips, n = i.length, a = [], o = [], r = 0; r < n; r++) {
                    var s = i[r], l = s.step(e, t);
                    l && (a.push(l), o.push(s))
                }
                for (r = 0; r < n;) i[r]._needsRemove ? (i[r] = i[n - 1], i.pop(), n--) : r++;
                for (n = a.length, r = 0; r < n; r++) o[r].fire(a[r]);
                this._time = e, this.onframe(t), this.trigger("frame", t), this.stage.update && this.stage.update()
            }, _startLoop: function () {
                var e = this;
                this._running = !0, Ji(function t() {
                    e._running && (Ji(t), e._paused || e._update())
                })
            }, start: function () {
                this._time = (new Date).getTime(), this._pausedTime = 0, this._startLoop()
            }, stop: function () {
                this._running = !1
            }, pause: function () {
                this._paused || (this._pauseStart = (new Date).getTime(), this._paused = !0)
            }, resume: function () {
                this._paused && (this._pausedTime += (new Date).getTime() - this._pauseStart, this._paused = !1)
            }, clear: function () {
                this._clips = []
            }, isFinished: function () {
                return !this._clips.length
            }, animate: function (e, t) {
                var i = new hi(e, (t = t || {}).loop, t.getter, t.setter);
                return this.addAnimator(i), i
            }
        }, b(ta, Ne);
        var ia, na, aa = a.domSupported, oa = (na = {
            pointerdown: 1,
            pointerup: 1,
            pointermove: 1,
            pointerout: 1
        }, {
            mouse: ia = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"],
            touch: ["touchstart", "touchend", "touchmove"],
            pointer: A(ia, function (e) {
                var t = e.replace("mouse", "pointer");
                return na.hasOwnProperty(t) ? t : e
            })
        }), ra = {mouse: ["mousemove", "mouseup"], pointer: ["pointermove", "pointerup"]};

        function sa(e) {
            return "mousewheel" === e && a.browser.firefox ? "DOMMouseScroll" : e
        }

        function la(e) {
            var t = e.pointerType;
            return "pen" === t || "touch" === t
        }

        function da(e) {
            e && (e.zrByTouch = !0)
        }

        function ua(e, t) {
            for (var i = t, n = !1; i && 9 !== i.nodeType && !(n = i.domBelongToZr || i !== t && i === e.painterRoot);) i = i.parentNode;
            return n
        }

        function ca(e, t) {
            this.type = t.type, this.target = this.currentTarget = e.dom, this.pointerType = t.pointerType, this.clientX = t.clientX, this.clientY = t.clientY
        }

        var ha = ca.prototype;
        ha.stopPropagation = ha.stopImmediatePropagation = ha.preventDefault = te;
        var fa = {
            mousedown: function (e) {
                e = He(this.dom, e), this._mayPointerCapture = [e.zrX, e.zrY], this.trigger("mousedown", e)
            }, mousemove: function (e) {
                e = He(this.dom, e);
                var t = this._mayPointerCapture;
                !t || e.zrX === t[0] && e.zrY === t[1] || ma(this, !0), this.trigger("mousemove", e)
            }, mouseup: function (e) {
                e = He(this.dom, e), ma(this, !1), this.trigger("mouseup", e)
            }, mouseout: function (e) {
                e = He(this.dom, e), this._pointerCapturing && (e.zrEventControl = "no_globalout");
                var t = e.toElement || e.relatedTarget;
                e.zrIsToLocalDOM = ua(this, t), this.trigger("mouseout", e)
            }, touchstart: function (e) {
                da(e = He(this.dom, e)), this._lastTouchMoment = new Date, this.handler.processGesture(e, "start"), fa.mousemove.call(this, e), fa.mousedown.call(this, e)
            }, touchmove: function (e) {
                da(e = He(this.dom, e)), this.handler.processGesture(e, "change"), fa.mousemove.call(this, e)
            }, touchend: function (e) {
                da(e = He(this.dom, e)), this.handler.processGesture(e, "end"), fa.mouseup.call(this, e), +new Date - this._lastTouchMoment < 300 && fa.click.call(this, e)
            }, pointerdown: function (e) {
                fa.mousedown.call(this, e)
            }, pointermove: function (e) {
                la(e) || fa.mousemove.call(this, e)
            }, pointerup: function (e) {
                fa.mouseup.call(this, e)
            }, pointerout: function (e) {
                la(e) || fa.mouseout.call(this, e)
            }
        };
        D(["click", "mousewheel", "dblclick", "contextmenu"], function (e) {
            fa[e] = function (t) {
                t = He(this.dom, t), this.trigger(e, t)
            }
        });
        var ga = {
            pointermove: function (e) {
                la(e) || ga.mousemove.call(this, e)
            }, pointerup: function (e) {
                ga.mouseup.call(this, e)
            }, mousemove: function (e) {
                this.trigger("mousemove", e)
            }, mouseup: function (e) {
                var t = this._pointerCapturing;
                ma(this, !1), this.trigger("mouseup", e), t && (e.zrEventControl = "only_globalout", this.trigger("mouseout", e))
            }
        };

        function pa(e, t, i, n) {
            e.mounted[t] = i, e.listenerOpts[t] = n, ze(e.domTarget, sa(t), i, n)
        }

        function va(e) {
            var t, i, n, a, o = e.mounted;
            for (var r in o) o.hasOwnProperty(r) && (t = e.domTarget, i = sa(r), n = o[r], a = e.listenerOpts[r], Be ? t.removeEventListener(i, n, a) : t.detachEvent("on" + i, n));
            e.mounted = {}
        }

        function ma(e, t) {
            if (e._mayPointerCapture = null, aa && e._pointerCapturing ^ t) {
                e._pointerCapturing = t;
                var i = e._globalHandlerScope;
                t ? function (e, t) {
                    function i(i) {
                        pa(t, i, function (n) {
                            n = Ge(n), ua(e, n.target) || (n = function (e, t) {
                                return He(e.dom, new ca(e, t), !0)
                            }(e, n), t.domHandlers[i].call(e, n))
                        }, {capture: !0})
                    }

                    a.pointerEventsSupported ? D(ra.pointer, i) : a.touchEventsSupported || D(ra.mouse, i)
                }(e, i) : va(i)
            }
        }

        function ya(e, t) {
            this.domTarget = e, this.domHandlers = t, this.mounted = {}, this.listenerOpts = {}, this.touchTimer = null, this.touching = !1
        }

        function ka(e, t) {
            var i, n, o;
            Ne.call(this), this.dom = e, this.painterRoot = t, this._localHandlerScope = new ya(e, fa), aa && (this._globalHandlerScope = new ya(document, ga)), this._pointerCapturing = !1, this._mayPointerCapture = null, i = this, n = this._localHandlerScope, o = n.domHandlers, a.pointerEventsSupported ? D(oa.pointer, function (e) {
                pa(n, e, function (t) {
                    o[e].call(i, t)
                })
            }) : (a.touchEventsSupported && D(oa.touch, function (e) {
                pa(n, e, function (t) {
                    o[e].call(i, t), function (e) {
                        e.touching = !0, null != e.touchTimer && (clearTimeout(e.touchTimer), e.touchTimer = null), e.touchTimer = setTimeout(function () {
                            e.touching = !1, e.touchTimer = null
                        }, 700)
                    }(n)
                })
            }), D(oa.mouse, function (e) {
                pa(n, e, function (t) {
                    t = Ge(t), n.touching || o[e].call(i, t)
                })
            }))
        }

        var Ta = ka.prototype;
        Ta.dispose = function () {
            va(this._localHandlerScope), aa && va(this._globalHandlerScope)
        }, Ta.setCursor = function (e) {
            this.dom.style && (this.dom.style.cursor = e || "default")
        }, b(ka, Ne);
        var wa = !a.canvasSupported, Ca = {canvas: ea}, Sa = {};

        function Ia(e, t) {
            var i = new _a(n(), e, t);
            return Sa[i.id] = i
        }

        function ba(e, t) {
            Ca[e] = t
        }

        var _a = function (e, t, i) {
            i = i || {}, this.dom = t, this.id = e;
            var n = this, o = new Ri, r = i.renderer;
            if (wa) {
                if (!Ca.vml) throw new Error("You need to require 'zrender/vml/vml' to support IE8");
                r = "vml"
            } else r && Ca[r] || (r = "canvas");
            var s = new Ca[r](t, o, i, e);
            this.storage = o, this.painter = s;
            var l = a.node || a.worker ? null : new ka(s.getViewportRoot(), s.root);
            this.handler = new et(o, s, l, s.root), this.animation = new ta({stage: {update: P(this.flush, this)}}), this.animation.start(), this._needsRefresh;
            var d = o.delFromStorage, u = o.addToStorage;
            o.delFromStorage = function (e) {
                d.call(o, e), e && e.removeSelfFromZr(n)
            }, o.addToStorage = function (e) {
                u.call(o, e), e.addSelfToZr(n)
            }
        };
        _a.prototype = {
            constructor: _a, getId: function () {
                return this.id
            }, add: function (e) {
                this.storage.addRoot(e), this._needsRefresh = !0
            }, remove: function (e) {
                this.storage.delRoot(e), this._needsRefresh = !0
            }, configLayer: function (e, t) {
                this.painter.configLayer && this.painter.configLayer(e, t), this._needsRefresh = !0
            }, setBackgroundColor: function (e) {
                this.painter.setBackgroundColor && this.painter.setBackgroundColor(e), this._needsRefresh = !0
            }, refreshImmediately: function () {
                this._needsRefresh = this._needsRefreshHover = !1, this.painter.refresh(), this._needsRefresh = this._needsRefreshHover = !1
            }, refresh: function () {
                this._needsRefresh = !0
            }, flush: function () {
                var e;
                this._needsRefresh && (e = !0, this.refreshImmediately()), this._needsRefreshHover && (e = !0, this.refreshHoverImmediately()), e && this.trigger("rendered")
            }, addHover: function (e, t) {
                if (this.painter.addHover) {
                    var i = this.painter.addHover(e, t);
                    return this.refreshHover(), i
                }
            }, removeHover: function (e) {
                this.painter.removeHover && (this.painter.removeHover(e), this.refreshHover())
            }, clearHover: function () {
                this.painter.clearHover && (this.painter.clearHover(), this.refreshHover())
            }, refreshHover: function () {
                this._needsRefreshHover = !0
            }, refreshHoverImmediately: function () {
                this._needsRefreshHover = !1, this.painter.refreshHover && this.painter.refreshHover()
            }, resize: function (e) {
                e = e || {}, this.painter.resize(e.width, e.height), this.handler.resize()
            }, clearAnimation: function () {
                this.animation.clear()
            }, getWidth: function () {
                return this.painter.getWidth()
            }, getHeight: function () {
                return this.painter.getHeight()
            }, pathToImage: function (e, t) {
                return this.painter.pathToImage(e, t)
            }, setCursorStyle: function (e) {
                this.handler.setCursorStyle(e)
            }, findHover: function (e, t) {
                return this.handler.findHover(e, t)
            }, on: function (e, t, i) {
                this.handler.on(e, t, i)
            }, off: function (e, t) {
                this.handler.off(e, t)
            }, trigger: function (e, t) {
                this.handler.trigger(e, t)
            }, clear: function () {
                this.storage.delRoot(), this.painter.clear()
            }, dispose: function () {
                var e;
                this.animation.stop(), this.clear(), this.storage.dispose(), this.painter.dispose(), this.handler.dispose(), this.animation = this.storage = this.painter = this.handler = null, e = this.id, delete Sa[e]
            }
        };
        var Da = (Object.freeze || Object)({
            version: "4.3.1", init: Ia, dispose: function (e) {
                if (e) e.dispose(); else {
                    for (var t in Sa) Sa.hasOwnProperty(t) && Sa[t].dispose();
                    Sa = {}
                }
                return this
            }, getInstance: function (e) {
                return Sa[e]
            }, registerPainter: ba
        }), Aa = D, Na = R, xa = M, Ea = "series\0";

        function Pa(e) {
            return e instanceof Array ? e : null == e ? [] : [e]
        }

        function Oa(e, t, i) {
            if (e) {
                e[t] = e[t] || {}, e.emphasis = e.emphasis || {}, e.emphasis[t] = e.emphasis[t] || {};
                for (var n = 0, a = i.length; n < a; n++) {
                    var o = i[n];
                    !e.emphasis[t].hasOwnProperty(o) && e[t].hasOwnProperty(o) && (e.emphasis[t][o] = e[t][o])
                }
            }
        }

        var Ma = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "rich", "tag", "color", "textBorderColor", "textBorderWidth", "width", "height", "lineHeight", "align", "verticalAlign", "baseline", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];

        function Fa(e) {
            return !Na(e) || xa(e) || e instanceof Date ? e : e.value
        }

        function La(e, t) {
            t = (t || []).slice();
            var i = A(e || [], function (e, t) {
                return {exist: e}
            });
            return Aa(t, function (e, n) {
                if (Na(e)) {
                    for (var a = 0; a < i.length; a++) if (!i[a].option && null != e.id && i[a].exist.id === e.id + "") return i[a].option = e, void (t[n] = null);
                    for (a = 0; a < i.length; a++) {
                        var o = i[a].exist;
                        if (!(i[a].option || null != o.id && null != e.id || null == e.name || Ua(e) || Ua(o) || o.name !== e.name + "")) return i[a].option = e, void (t[n] = null)
                    }
                }
            }), Aa(t, function (e, t) {
                if (Na(e)) {
                    for (var n = 0; n < i.length; n++) {
                        var a = i[n].exist;
                        if (!i[n].option && !Ua(a) && null == e.id) {
                            i[n].option = e;
                            break
                        }
                    }
                    n >= i.length && i.push({option: e})
                }
            }), i
        }

        function Ra(e) {
            var t = Q();
            Aa(e, function (e, i) {
                var n = e.exist;
                n && t.set(n.id, e)
            }), Aa(e, function (e, i) {
                var n = e.option;
                X(!n || null == n.id || !t.get(n.id) || t.get(n.id) === e, "id duplicates: " + (n && n.id)), n && null != n.id && t.set(n.id, e), e.keyInfo || (e.keyInfo = {})
            }), Aa(e, function (e, i) {
                var n = e.exist, a = e.option, o = e.keyInfo;
                if (Na(a)) {
                    if (o.name = null != a.name ? a.name + "" : n ? n.name : Ea + i, n) o.id = n.id; else if (null != a.id) o.id = a.id + ""; else for (var r = 0; o.id = "\0" + o.name + "\0" + r++, t.get(o.id);) ;
                    t.set(o.id, e)
                }
            })
        }

        function Ba(e) {
            var t = e.name;
            return !(!t || !t.indexOf(Ea))
        }

        function Ua(e) {
            return Na(e) && e.id && 0 === (e.id + "").indexOf("\0_ec_\0")
        }

        function Ka(e, t) {
            return null != t.dataIndexInside ? t.dataIndexInside : null != t.dataIndex ? M(t.dataIndex) ? A(t.dataIndex, function (t) {
                return e.indexOfRawIndex(t)
            }) : e.indexOfRawIndex(t.dataIndex) : null != t.name ? M(t.name) ? A(t.name, function (t) {
                return e.indexOfName(t)
            }) : e.indexOfName(t.name) : void 0
        }

        function Va() {
            var e = "__\0ec_inner_" + Wa++ + "_" + Math.random().toFixed(5);
            return function (t) {
                return t[e] || (t[e] = {})
            }
        }

        var Wa = 0;

        function Ga(e, t, i) {
            if (L(t)) {
                var n = {};
                n[t + "Index"] = 0, t = n
            }
            var a = i && i.defaultMainType;
            !a || Ha(t, a + "Index") || Ha(t, a + "Id") || Ha(t, a + "Name") || (t[a + "Index"] = 0);
            var o = {};
            return Aa(t, function (n, a) {
                if (n = t[a], "dataIndex" !== a && "dataIndexInside" !== a) {
                    var r = a.match(/^(\w+)(Index|Id|Name)$/) || [], s = r[1], l = (r[2] || "").toLowerCase();
                    if (!(!s || !l || null == n || "index" === l && "none" === n || i && i.includeMainTypes && S(i.includeMainTypes, s) < 0)) {
                        var d = {mainType: s};
                        "index" === l && "all" === n || (d[l] = n);
                        var u = e.queryComponents(d);
                        o[s + "Models"] = u, o[s + "Model"] = u[0]
                    }
                } else o[a] = n
            }), o
        }

        function Ha(e, t) {
            return e && e.hasOwnProperty(t)
        }

        function za(e, t, i) {
            e.setAttribute ? e.setAttribute(t, i) : e[t] = i
        }

        function ja(e) {
            return "auto" === e ? a.domSupported ? "html" : "richText" : e || "html"
        }

        function Xa(e, t) {
            var i = Q(), n = [];
            return D(e, function (e) {
                var a = t(e);
                (i.get(a) || (n.push(a), i.set(a, []))).push(e)
            }), {keys: n, buckets: i}
        }

        var $a = ".", Ya = "___EC__COMPONENT__CONTAINER___";

        function qa(e) {
            var t = {main: "", sub: ""};
            return e && (e = e.split($a), t.main = e[0] || "", t.sub = e[1] || ""), t
        }

        function Ja(e) {
            (e.$constructor = e).extend = function (e) {
                function t() {
                    e.$constructor ? e.$constructor.apply(this, arguments) : i.apply(this, arguments)
                }

                var i = this;
                return k(t.prototype, e), t.extend = this.extend, t.superCall = eo, t.superApply = to, I(t, this), t.superClass = i, t
            }
        }

        var Za = 0;

        function Qa(e) {
            var t = ["__\0is_clz", Za++, Math.random().toFixed(3)].join("_");
            e.prototype[t] = !0, e.isInstance = function (e) {
                return !(!e || !e[t])
            }
        }

        function eo(e, t) {
            var i = z(arguments, 2);
            return this.superClass.prototype[t].apply(e, i)
        }

        function to(e, t, i) {
            return this.superClass.prototype[t].apply(e, i)
        }

        function io(e, t) {
            t = t || {};
            var i = {};
            if (e.registerClass = function (e, t) {
                return t && (function (e) {
                    X(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e), 'componentType "' + e + '" illegal')
                }(t), (t = qa(t)).sub ? t.sub !== Ya && ((function (e) {
                    var t = i[e.main];
                    return t && t[Ya] || ((t = i[e.main] = {})[Ya] = !0), t
                }(t))[t.sub] = e) : i[t.main] = e), e
            }, e.getClass = function (e, t, n) {
                var a = i[e];
                if (a && a[Ya] && (a = t ? a[t] : null), n && !a) throw new Error(t ? "Component " + e + "." + (t || "") + " not exists. Load it first." : e + ".type should be specified.");
                return a
            }, e.getClassesByMainType = function (e) {
                e = qa(e);
                var t = [], n = i[e.main];
                return n && n[Ya] ? D(n, function (e, i) {
                    i !== Ya && t.push(e)
                }) : t.push(n), t
            }, e.hasClass = function (e) {
                return e = qa(e), !!i[e.main]
            }, e.getAllClassMainTypes = function () {
                var e = [];
                return D(i, function (t, i) {
                    e.push(i)
                }), e
            }, e.hasSubTypes = function (e) {
                e = qa(e);
                var t = i[e.main];
                return t && t[Ya]
            }, e.parseClassType = qa, t.registerWhenExtend) {
                var n = e.extend;
                n && (e.extend = function (t) {
                    var i = n.call(this, t);
                    return e.registerClass(i, t.type)
                })
            }
            return e
        }

        function no(e) {
            for (var t = 0; t < e.length; t++) e[t][1] || (e[t][1] = e[t][0]);
            return function (t, i, n) {
                for (var a = {}, o = 0; o < e.length; o++) {
                    var r = e[o][1];
                    if (!(i && 0 <= S(i, r) || n && S(n, r) < 0)) {
                        var s = t.getShallow(r);
                        null != s && (a[e[o][0]] = s)
                    }
                }
                return a
            }
        }

        var ao = no([["lineWidth", "width"], ["stroke", "color"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]),
            oo = {
                getLineStyle: function (e) {
                    var t = ao(this, e);
                    return t.lineDash = this.getLineDash(t.lineWidth), t
                }, getLineDash: function (e) {
                    null == e && (e = 1);
                    var t = this.get("type"), i = Math.max(e, 2), n = 4 * e;
                    return "solid" !== t && null != t && ("dashed" === t ? [n, n] : [i, i])
                }
            },
            ro = no([["fill", "color"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["opacity"], ["shadowColor"]]),
            so = {
                getAreaStyle: function (e, t) {
                    return ro(this, e, t)
                }
            }, lo = Math.pow, uo = Math.sqrt, co = 1e-8, ho = 1e-4, fo = uo(3), go = 1 / 3, po = ae(), vo = ae(),
            mo = ae();

        function yo(e) {
            return -co < e && e < co
        }

        function ko(e) {
            return co < e || e < -co
        }

        function To(e, t, i, n, a) {
            var o = 1 - a;
            return o * o * (o * e + 3 * a * t) + a * a * (a * n + 3 * o * i)
        }

        function wo(e, t, i, n, a) {
            var o = 1 - a;
            return 3 * (((t - e) * o + 2 * (i - t) * a) * o + (n - i) * a * a)
        }

        function Co(e, t, i, n, a) {
            var o = 6 * i - 12 * t + 6 * e, r = 9 * t + 3 * n - 3 * e - 9 * i, s = 3 * t - 3 * e, l = 0;
            if (yo(r)) ko(o) && 0 <= (u = -s / o) && u <= 1 && (a[l++] = u); else {
                var d = o * o - 4 * r * s;
                if (yo(d)) a[0] = -o / (2 * r); else if (0 < d) {
                    var u, c = uo(d), h = (-o - c) / (2 * r);
                    0 <= (u = (-o + c) / (2 * r)) && u <= 1 && (a[l++] = u), 0 <= h && h <= 1 && (a[l++] = h)
                }
            }
            return l
        }

        function So(e, t, i, n, a, o) {
            var r = (t - e) * a + e, s = (i - t) * a + t, l = (n - i) * a + i, d = (s - r) * a + r, u = (l - s) * a + s,
                c = (u - d) * a + d;
            o[0] = e, o[1] = r, o[2] = d, o[3] = c, o[4] = c, o[5] = u, o[6] = l, o[7] = n
        }

        function Io(e, t, i, n) {
            var a = 1 - n;
            return a * (a * e + 2 * n * t) + n * n * i
        }

        function bo(e, t, i, n) {
            return 2 * ((1 - n) * (t - e) + n * (i - t))
        }

        function _o(e, t, i) {
            var n = e + i - 2 * t;
            return 0 == n ? .5 : (e - t) / n
        }

        function Do(e, t, i, n, a) {
            var o = (t - e) * n + e, r = (i - t) * n + t, s = (r - o) * n + o;
            a[0] = e, a[1] = o, a[2] = s, a[3] = s, a[4] = r, a[5] = i
        }

        var Ao = Math.min, No = Math.max, xo = Math.sin, Eo = Math.cos, Po = 2 * Math.PI, Oo = ae(), Mo = ae(),
            Fo = ae();

        function Lo(e, t, i) {
            if (0 !== e.length) {
                var n, a = e[0], o = a[0], r = a[0], s = a[1], l = a[1];
                for (n = 1; n < e.length; n++) a = e[n], o = Ao(o, a[0]), r = No(r, a[0]), s = Ao(s, a[1]), l = No(l, a[1]);
                t[0] = o, t[1] = s, i[0] = r, i[1] = l
            }
        }

        function Ro(e, t, i, n, a, o) {
            a[0] = Ao(e, i), a[1] = Ao(t, n), o[0] = No(e, i), o[1] = No(t, n)
        }

        var Bo = [], Uo = [];

        function Ko(e, t, i, n, a, o, r, s, l, d) {
            var u, c = Co, h = To, f = c(e, i, a, r, Bo);
            for (l[0] = 1 / 0, l[1] = 1 / 0, d[0] = -1 / 0, d[1] = -1 / 0, u = 0; u < f; u++) {
                var g = h(e, i, a, r, Bo[u]);
                l[0] = Ao(g, l[0]), d[0] = No(g, d[0])
            }
            for (f = c(t, n, o, s, Uo), u = 0; u < f; u++) {
                var p = h(t, n, o, s, Uo[u]);
                l[1] = Ao(p, l[1]), d[1] = No(p, d[1])
            }
            l[0] = Ao(e, l[0]), d[0] = No(e, d[0]), l[0] = Ao(r, l[0]), d[0] = No(r, d[0]), l[1] = Ao(t, l[1]), d[1] = No(t, d[1]), l[1] = Ao(s, l[1]), d[1] = No(s, d[1])
        }

        function Vo(e, t, i, n, a, o, r, s, l) {
            var d = Se, u = Ie, c = Math.abs(a - o);
            if (c % Po < 1e-4 && 1e-4 < c) return s[0] = e - i, s[1] = t - n, l[0] = e + i, void (l[1] = t + n);
            if (Oo[0] = Eo(a) * i + e, Oo[1] = xo(a) * n + t, Mo[0] = Eo(o) * i + e, Mo[1] = xo(o) * n + t, d(s, Oo, Mo), u(l, Oo, Mo), (a %= Po) < 0 && (a += Po), (o %= Po) < 0 && (o += Po), o < a && !r ? o += Po : a < o && r && (a += Po), r) {
                var h = o;
                o = a, a = h
            }
            for (var f = 0; f < o; f += Math.PI / 2) a < f && (Fo[0] = Eo(f) * i + e, Fo[1] = xo(f) * n + t, d(s, Fo, s), u(l, Fo, l))
        }

        var Wo = {M: 1, L: 2, C: 3, Q: 4, A: 5, Z: 6, R: 7}, Go = [], Ho = [], zo = [], jo = [], Xo = Math.min,
            $o = Math.max, Yo = Math.cos, qo = Math.sin, Jo = Math.sqrt, Zo = Math.abs,
            Qo = "undefined" != typeof Float32Array, er = function (e) {
                this._saveData = !e, this._saveData && (this.data = []), this._ctx = null
            };

        function tr(e, t, i, n, a, o, r) {
            if (0 === a) return !1;
            var s = a, l = 0;
            if (t + s < r && n + s < r || r < t - s && r < n - s || e + s < o && i + s < o || o < e - s && o < i - s) return !1;
            if (e === i) return Math.abs(o - e) <= s / 2;
            var d = (l = (t - n) / (e - i)) * o - r + (e * n - i * t) / (e - i);
            return d * d / (l * l + 1) <= s / 2 * s / 2
        }

        function ir(e, t, i, n, a, o, r, s, l, d, u) {
            if (0 === l) return !1;
            var c = l;
            return !(t + c < u && n + c < u && o + c < u && s + c < u || u < t - c && u < n - c && u < o - c && u < s - c || e + c < d && i + c < d && a + c < d && r + c < d || d < e - c && d < i - c && d < a - c && d < r - c) && function (e, t, i, n, a, o, r, s, l, d, u) {
                var c, h, f, g, p, v = .005, m = 1 / 0;
                po[0] = l, po[1] = d;
                for (var y = 0; y < 1; y += .05) vo[0] = To(e, i, a, r, y), vo[1] = To(t, n, o, s, y), (g = Te(po, vo)) < m && (c = y, m = g);
                m = 1 / 0;
                for (var k = 0; k < 32 && !(v < ho); k++) h = c - v, f = c + v, vo[0] = To(e, i, a, r, h), vo[1] = To(t, n, o, s, h), g = Te(vo, po), 0 <= h && g < m ? (c = h, m = g) : (mo[0] = To(e, i, a, r, f), mo[1] = To(t, n, o, s, f), p = Te(mo, po), f <= 1 && p < m ? (c = f, m = p) : v *= .5);
                return uo(m)
            }(e, t, i, n, a, o, r, s, d, u) <= c / 2
        }

        function nr(e, t, i, n, a, o, r, s, l) {
            if (0 === r) return !1;
            var d = r;
            return !(t + d < l && n + d < l && o + d < l || l < t - d && l < n - d && l < o - d || e + d < s && i + d < s && a + d < s || s < e - d && s < i - d && s < a - d) && function (e, t, i, n, a, o, r, s, l) {
                var d, u = .005, c = 1 / 0;
                po[0] = r, po[1] = s;
                for (var h = 0; h < 1; h += .05) vo[0] = Io(e, i, a, h), vo[1] = Io(t, n, o, h), (v = Te(po, vo)) < c && (d = h, c = v);
                c = 1 / 0;
                for (var f = 0; f < 32 && !(u < ho); f++) {
                    var g = d - u, p = d + u;
                    vo[0] = Io(e, i, a, g), vo[1] = Io(t, n, o, g);
                    var v = Te(vo, po);
                    if (0 <= g && v < c) d = g, c = v; else {
                        mo[0] = Io(e, i, a, p), mo[1] = Io(t, n, o, p);
                        var m = Te(mo, po);
                        p <= 1 && m < c ? (d = p, c = m) : u *= .5
                    }
                }
                return uo(c)
            }(e, t, i, n, a, o, s, l) <= d / 2
        }

        er.prototype = {
            constructor: er,
            _xi: 0,
            _yi: 0,
            _x0: 0,
            _y0: 0,
            _ux: 0,
            _uy: 0,
            _len: 0,
            _lineDash: null,
            _dashOffset: 0,
            _dashIdx: 0,
            _dashSum: 0,
            setScale: function (e, t, i) {
                i = i || 0, this._ux = Zo(i / gi / e) || 0, this._uy = Zo(i / gi / t) || 0
            },
            getContext: function () {
                return this._ctx
            },
            beginPath: function (e) {
                return (this._ctx = e) && e.beginPath(), e && (this.dpr = e.dpr), this._saveData && (this._len = 0), this._lineDash && (this._lineDash = null, this._dashOffset = 0), this
            },
            moveTo: function (e, t) {
                return this.addData(Wo.M, e, t), this._ctx && this._ctx.moveTo(e, t), this._x0 = e, this._y0 = t, this._xi = e, this._yi = t, this
            },
            lineTo: function (e, t) {
                var i = Zo(e - this._xi) > this._ux || Zo(t - this._yi) > this._uy || this._len < 5;
                return this.addData(Wo.L, e, t), this._ctx && i && (this._needsDash() ? this._dashedLineTo(e, t) : this._ctx.lineTo(e, t)), i && (this._xi = e, this._yi = t), this
            },
            bezierCurveTo: function (e, t, i, n, a, o) {
                return this.addData(Wo.C, e, t, i, n, a, o), this._ctx && (this._needsDash() ? this._dashedBezierTo(e, t, i, n, a, o) : this._ctx.bezierCurveTo(e, t, i, n, a, o)), this._xi = a, this._yi = o, this
            },
            quadraticCurveTo: function (e, t, i, n) {
                return this.addData(Wo.Q, e, t, i, n), this._ctx && (this._needsDash() ? this._dashedQuadraticTo(e, t, i, n) : this._ctx.quadraticCurveTo(e, t, i, n)), this._xi = i, this._yi = n, this
            },
            arc: function (e, t, i, n, a, o) {
                return this.addData(Wo.A, e, t, i, i, n, a - n, 0, o ? 0 : 1), this._ctx && this._ctx.arc(e, t, i, n, a, o), this._xi = Yo(a) * i + e, this._yi = qo(a) * i + t, this
            },
            arcTo: function (e, t, i, n, a) {
                return this._ctx && this._ctx.arcTo(e, t, i, n, a), this
            },
            rect: function (e, t, i, n) {
                return this._ctx && this._ctx.rect(e, t, i, n), this.addData(Wo.R, e, t, i, n), this
            },
            closePath: function () {
                this.addData(Wo.Z);
                var e = this._ctx, t = this._x0, i = this._y0;
                return e && (this._needsDash() && this._dashedLineTo(t, i), e.closePath()), this._xi = t, this._yi = i, this
            },
            fill: function (e) {
                e && e.fill(), this.toStatic()
            },
            stroke: function (e) {
                e && e.stroke(), this.toStatic()
            },
            setLineDash: function (e) {
                if (e instanceof Array) {
                    this._lineDash = e;
                    for (var t = this._dashIdx = 0, i = 0; i < e.length; i++) t += e[i];
                    this._dashSum = t
                }
                return this
            },
            setLineDashOffset: function (e) {
                return this._dashOffset = e, this
            },
            len: function () {
                return this._len
            },
            setData: function (e) {
                var t = e.length;
                this.data && this.data.length === t || !Qo || (this.data = new Float32Array(t));
                for (var i = 0; i < t; i++) this.data[i] = e[i];
                this._len = t
            },
            appendPath: function (e) {
                e instanceof Array || (e = [e]);
                for (var t = e.length, i = 0, n = this._len, a = 0; a < t; a++) i += e[a].len();
                for (Qo && this.data instanceof Float32Array && (this.data = new Float32Array(n + i)), a = 0; a < t; a++) for (var o = e[a].data, r = 0; r < o.length; r++) this.data[n++] = o[r];
                this._len = n
            },
            addData: function (e) {
                if (this._saveData) {
                    var t = this.data;
                    this._len + arguments.length > t.length && (this._expandData(), t = this.data);
                    for (var i = 0; i < arguments.length; i++) t[this._len++] = arguments[i];
                    this._prevCmd = e
                }
            },
            _expandData: function () {
                if (!(this.data instanceof Array)) {
                    for (var e = [], t = 0; t < this._len; t++) e[t] = this.data[t];
                    this.data = e
                }
            },
            _needsDash: function () {
                return this._lineDash
            },
            _dashedLineTo: function (e, t) {
                var i, n, a = this._dashSum, o = this._dashOffset, r = this._lineDash, s = this._ctx, l = this._xi,
                    d = this._yi, u = e - l, c = t - d, h = Jo(u * u + c * c), f = l, g = d, p = r.length;
                for (o < 0 && (o = a + o), f -= (o %= a) * (u /= h), g -= o * (c /= h); 0 < u && f <= e || u < 0 && e <= f || 0 === u && (0 < c && g <= t || c < 0 && t <= g);) f += u * (i = r[n = this._dashIdx]), g += c * i, this._dashIdx = (n + 1) % p, 0 < u && f < l || u < 0 && l < f || 0 < c && g < d || c < 0 && d < g || s[n % 2 ? "moveTo" : "lineTo"](0 <= u ? Xo(f, e) : $o(f, e), 0 <= c ? Xo(g, t) : $o(g, t));
                u = f - e, c = g - t, this._dashOffset = -Jo(u * u + c * c)
            },
            _dashedBezierTo: function (e, t, i, n, a, o) {
                var r, s, l, d, u, c = this._dashSum, h = this._dashOffset, f = this._lineDash, g = this._ctx,
                    p = this._xi, v = this._yi, m = To, y = 0, k = this._dashIdx, T = f.length, w = 0;
                for (h < 0 && (h = c + h), h %= c, r = 0; r < 1; r += .1) s = m(p, e, i, a, r + .1) - m(p, e, i, a, r), l = m(v, t, n, o, r + .1) - m(v, t, n, o, r), y += Jo(s * s + l * l);
                for (; k < T && !(h < (w += f[k])); k++) ;
                for (r = (w - h) / y; r <= 1;) d = m(p, e, i, a, r), u = m(v, t, n, o, r), k % 2 ? g.moveTo(d, u) : g.lineTo(d, u), r += f[k] / y, k = (k + 1) % T;
                k % 2 != 0 && g.lineTo(a, o), s = a - d, l = o - u, this._dashOffset = -Jo(s * s + l * l)
            },
            _dashedQuadraticTo: function (e, t, i, n) {
                var a = i, o = n;
                i = (i + 2 * e) / 3, n = (n + 2 * t) / 3, e = (this._xi + 2 * e) / 3, t = (this._yi + 2 * t) / 3, this._dashedBezierTo(e, t, i, n, a, o)
            },
            toStatic: function () {
                var e = this.data;
                e instanceof Array && (e.length = this._len, Qo && (this.data = new Float32Array(e)))
            },
            getBoundingRect: function () {
                Go[0] = Go[1] = zo[0] = zo[1] = Number.MAX_VALUE, Ho[0] = Ho[1] = jo[0] = jo[1] = -Number.MAX_VALUE;
                for (var e, t, i, n, a, o, r, s, l, d, u, c, h, f, g = this.data, p = 0, v = 0, m = 0, y = 0, k = 0; k < g.length;) {
                    var T = g[k++];
                    switch (1 === k && (m = p = g[k], y = v = g[k + 1]), T) {
                        case Wo.M:
                            p = m = g[k++], v = y = g[k++], zo[0] = m, zo[1] = y, jo[0] = m, jo[1] = y;
                            break;
                        case Wo.L:
                            Ro(p, v, g[k], g[k + 1], zo, jo), p = g[k++], v = g[k++];
                            break;
                        case Wo.C:
                            Ko(p, v, g[k++], g[k++], g[k++], g[k++], g[k], g[k + 1], zo, jo), p = g[k++], v = g[k++];
                            break;
                        case Wo.Q:
                            e = p, t = v, i = g[k++], n = g[k++], a = g[k], o = g[k + 1], r = zo, s = jo, d = l = void 0, d = Io, u = No(Ao((l = _o)(e, i, a), 1), 0), c = No(Ao(l(t, n, o), 1), 0), h = d(e, i, a, u), f = d(t, n, o, c), r[0] = Ao(e, a, h), r[1] = Ao(t, o, f), s[0] = No(e, a, h), s[1] = No(t, o, f), p = g[k++], v = g[k++];
                            break;
                        case Wo.A:
                            var w = g[k++], C = g[k++], S = g[k++], I = g[k++], b = g[k++], _ = g[k++] + b;
                            k += 1;
                            var D = 1 - g[k++];
                            1 === k && (m = Yo(b) * S + w, y = qo(b) * I + C), Vo(w, C, S, I, b, _, D, zo, jo), p = Yo(_) * S + w, v = qo(_) * I + C;
                            break;
                        case Wo.R:
                            Ro(m = p = g[k++], y = v = g[k++], m + g[k++], y + g[k++], zo, jo);
                            break;
                        case Wo.Z:
                            p = m, v = y
                    }
                    Se(Go, Go, zo), Ie(Ho, Ho, jo)
                }
                return 0 === k && (Go[0] = Go[1] = Ho[0] = Ho[1] = 0), new Di(Go[0], Go[1], Ho[0] - Go[0], Ho[1] - Go[1])
            },
            rebuildPath: function (e) {
                for (var t, i, n, a, o, r, s = this.data, l = this._ux, d = this._uy, u = this._len, c = 0; c < u;) {
                    var h = s[c++];
                    switch (1 === c && (t = n = s[c], i = a = s[c + 1]), h) {
                        case Wo.M:
                            t = n = s[c++], i = a = s[c++], e.moveTo(n, a);
                            break;
                        case Wo.L:
                            o = s[c++], r = s[c++], (Zo(o - n) > l || Zo(r - a) > d || c === u - 1) && (e.lineTo(o, r), n = o, a = r);
                            break;
                        case Wo.C:
                            e.bezierCurveTo(s[c++], s[c++], s[c++], s[c++], s[c++], s[c++]), n = s[c - 2], a = s[c - 1];
                            break;
                        case Wo.Q:
                            e.quadraticCurveTo(s[c++], s[c++], s[c++], s[c++]), n = s[c - 2], a = s[c - 1];
                            break;
                        case Wo.A:
                            var f = s[c++], g = s[c++], p = s[c++], v = s[c++], m = s[c++], y = s[c++], k = s[c++],
                                T = s[c++], w = v < p ? p : v, C = v < p ? 1 : p / v, S = v < p ? v / p : 1, I = m + y;
                            .001 < Math.abs(p - v) ? (e.translate(f, g), e.rotate(k), e.scale(C, S), e.arc(0, 0, w, m, I, 1 - T), e.scale(1 / C, 1 / S), e.rotate(-k), e.translate(-f, -g)) : e.arc(f, g, w, m, I, 1 - T), 1 === c && (t = Yo(m) * p + f, i = qo(m) * v + g), n = Yo(I) * p + f, a = qo(I) * v + g;
                            break;
                        case Wo.R:
                            t = n = s[c], i = a = s[c + 1], e.rect(s[c++], s[c++], s[c++], s[c++]);
                            break;
                        case Wo.Z:
                            e.closePath(), n = t, a = i
                    }
                }
            }
        }, er.CMD = Wo;
        var ar = 2 * Math.PI;

        function or(e) {
            return (e %= ar) < 0 && (e += ar), e
        }

        var rr = 2 * Math.PI;

        function sr(e, t, i, n, a, o, r, s, l) {
            if (0 === r) return !1;
            var d = r;
            s -= e, l -= t;
            var u = Math.sqrt(s * s + l * l);
            if (i < u - d || u + d < i) return !1;
            if (Math.abs(n - a) % rr < 1e-4) return !0;
            if (o) {
                var c = n;
                n = or(a), a = or(c)
            } else n = or(n), a = or(a);
            a < n && (a += rr);
            var h = Math.atan2(l, s);
            return h < 0 && (h += rr), n <= h && h <= a || n <= h + rr && h + rr <= a
        }

        function lr(e, t, i, n, a, o) {
            if (t < o && n < o || o < t && o < n) return 0;
            if (n === t) return 0;
            var r = n < t ? 1 : -1, s = (o - t) / (n - t);
            1 != s && 0 != s || (r = n < t ? .5 : -.5);
            var l = s * (i - e) + e;
            return l === a ? 1 / 0 : a < l ? r : 0
        }

        var dr = er.CMD, ur = 2 * Math.PI, cr = 1e-4, hr = [-1, -1, -1], fr = [-1, -1];

        function gr(e, t, i, n, a, o, r, s, l, d) {
            if (t < d && n < d && o < d && s < d || d < t && d < n && d < o && d < s) return 0;
            var u, c = function (e, t, i, n, a, o) {
                var r = n + 3 * (t - i) - e, s = 3 * (i - 2 * t + e), l = 3 * (t - e), d = e - a, u = s * s - 3 * r * l,
                    c = s * l - 9 * r * d, h = l * l - 3 * s * d, f = 0;
                if (yo(u) && yo(c)) yo(s) ? o[0] = 0 : 0 <= (I = -l / s) && I <= 1 && (o[f++] = I); else {
                    var g = c * c - 4 * u * h;
                    if (yo(g)) {
                        var p = c / u, v = -p / 2;
                        0 <= (I = -s / r + p) && I <= 1 && (o[f++] = I), 0 <= v && v <= 1 && (o[f++] = v)
                    } else if (0 < g) {
                        var m = uo(g), y = u * s + 1.5 * r * (-c + m), k = u * s + 1.5 * r * (-c - m);
                        0 <= (I = (-s - ((y = y < 0 ? -lo(-y, go) : lo(y, go)) + (k = k < 0 ? -lo(-k, go) : lo(k, go)))) / (3 * r)) && I <= 1 && (o[f++] = I)
                    } else {
                        var T = (2 * u * s - 3 * r * c) / (2 * uo(u * u * u)), w = Math.acos(T) / 3, C = uo(u),
                            S = Math.cos(w), I = (-s - 2 * C * S) / (3 * r),
                            b = (v = (-s + C * (S + fo * Math.sin(w))) / (3 * r), (-s + C * (S - fo * Math.sin(w))) / (3 * r));
                        0 <= I && I <= 1 && (o[f++] = I), 0 <= v && v <= 1 && (o[f++] = v), 0 <= b && b <= 1 && (o[f++] = b)
                    }
                }
                return f
            }(t, n, o, s, d, hr);
            if (0 === c) return 0;
            for (var h, f, g = 0, p = -1, v = 0; v < c; v++) {
                var m = hr[v], y = 0 === m || 1 === m ? .5 : 1;
                To(e, i, a, r, m) < l || (p < 0 && (p = Co(t, n, o, s, fr), fr[1] < fr[0] && 1 < p && (u = fr[0], fr[0] = fr[1], fr[1] = u), h = To(t, n, o, s, fr[0]), 1 < p && (f = To(t, n, o, s, fr[1]))), 2 === p ? m < fr[0] ? g += h < t ? y : -y : m < fr[1] ? g += f < h ? y : -y : g += s < f ? y : -y : m < fr[0] ? g += h < t ? y : -y : g += s < h ? y : -y)
            }
            return g
        }

        function pr(e, t, i, n, a, o, r, s) {
            if (t < s && n < s && o < s || s < t && s < n && s < o) return 0;
            var l = function (e, t, i, n, a) {
                var o = e - 2 * t + i, r = 2 * (t - e), s = e - n, l = 0;
                if (yo(o)) ko(r) && 0 <= (u = -s / r) && u <= 1 && (a[l++] = u); else {
                    var d = r * r - 4 * o * s;
                    if (yo(d)) 0 <= (u = -r / (2 * o)) && u <= 1 && (a[l++] = u); else if (0 < d) {
                        var u, c = uo(d), h = (-r - c) / (2 * o);
                        0 <= (u = (-r + c) / (2 * o)) && u <= 1 && (a[l++] = u), 0 <= h && h <= 1 && (a[l++] = h)
                    }
                }
                return l
            }(t, n, o, s, hr);
            if (0 === l) return 0;
            var d = _o(t, n, o);
            if (0 <= d && d <= 1) {
                for (var u = 0, c = Io(t, n, o, d), h = 0; h < l; h++) {
                    var f = 0 === hr[h] || 1 === hr[h] ? .5 : 1;
                    Io(e, i, a, hr[h]) < r || (hr[h] < d ? u += c < t ? f : -f : u += o < c ? f : -f)
                }
                return u
            }
            return f = 0 === hr[0] || 1 === hr[0] ? .5 : 1, Io(e, i, a, hr[0]) < r ? 0 : o < t ? f : -f
        }

        function vr(e, t, i, n, a, o, r, s) {
            if (i < (s -= t) || s < -i) return 0;
            var l = Math.sqrt(i * i - s * s);
            hr[0] = -l, hr[1] = l;
            var d = Math.abs(n - a);
            if (d < 1e-4) return 0;
            if (d % ur < 1e-4) {
                a = ur;
                var u = o ? 1 : -1;
                return r >= hr[n = 0] + e && r <= hr[1] + e ? u : 0
            }
            o ? (l = n, n = or(a), a = or(l)) : (n = or(n), a = or(a)), a < n && (a += ur);
            for (var c = 0, h = 0; h < 2; h++) {
                var f = hr[h];
                if (r < f + e) {
                    var g = Math.atan2(s, f);
                    u = o ? 1 : -1, g < 0 && (g = ur + g), (n <= g && g <= a || n <= g + ur && g + ur <= a) && (g > Math.PI / 2 && g < 1.5 * Math.PI && (u = -u), c += u)
                }
            }
            return c
        }

        function mr(e, t, i, n, a) {
            for (var o = 0, r = 0, s = 0, l = 0, d = 0, u = 0; u < e.length;) {
                var c = e[u++];
                switch (c === dr.M && 1 < u && (i || (o += lr(r, s, l, d, n, a))), 1 === u && (l = r = e[u], d = s = e[u + 1]), c) {
                    case dr.M:
                        r = l = e[u++], s = d = e[u++];
                        break;
                    case dr.L:
                        if (i) {
                            if (tr(r, s, e[u], e[u + 1], t, n, a)) return !0
                        } else o += lr(r, s, e[u], e[u + 1], n, a) || 0;
                        r = e[u++], s = e[u++];
                        break;
                    case dr.C:
                        if (i) {
                            if (ir(r, s, e[u++], e[u++], e[u++], e[u++], e[u], e[u + 1], t, n, a)) return !0
                        } else o += gr(r, s, e[u++], e[u++], e[u++], e[u++], e[u], e[u + 1], n, a) || 0;
                        r = e[u++], s = e[u++];
                        break;
                    case dr.Q:
                        if (i) {
                            if (nr(r, s, e[u++], e[u++], e[u], e[u + 1], t, n, a)) return !0
                        } else o += pr(r, s, e[u++], e[u++], e[u], e[u + 1], n, a) || 0;
                        r = e[u++], s = e[u++];
                        break;
                    case dr.A:
                        var h = e[u++], f = e[u++], g = e[u++], p = e[u++], v = e[u++], m = e[u++];
                        u += 1;
                        var y = 1 - e[u++], k = Math.cos(v) * g + h, T = Math.sin(v) * p + f;
                        1 < u ? o += lr(r, s, k, T, n, a) : (l = k, d = T);
                        var w = (n - h) * p / g + h;
                        if (i) {
                            if (sr(h, f, p, v, v + m, y, t, w, a)) return !0
                        } else o += vr(h, f, p, v, v + m, y, w, a);
                        r = Math.cos(v + m) * g + h, s = Math.sin(v + m) * p + f;
                        break;
                    case dr.R:
                        if (l = r = e[u++], d = s = e[u++], k = l + e[u++], T = d + e[u++], i) {
                            if (tr(l, d, k, d, t, n, a) || tr(k, d, k, T, t, n, a) || tr(k, T, l, T, t, n, a) || tr(l, T, l, d, t, n, a)) return !0
                        } else o += lr(k, d, k, T, n, a), o += lr(l, T, l, d, n, a);
                        break;
                    case dr.Z:
                        if (i) {
                            if (tr(r, s, l, d, t, n, a)) return !0
                        } else o += lr(r, s, l, d, n, a);
                        r = l, s = d
                }
            }
            return i || function (e, t) {
                return Math.abs(e - t) < cr
            }(s, d) || (o += lr(r, s, l, d, n, a) || 0), 0 !== o
        }

        var yr = Xi.prototype.getCanvasPattern, kr = Math.abs, Tr = new er(!0);

        function wr(e) {
            $n.call(this, e), this.path = null
        }

        function Cr(e) {
            return Math.sqrt(e[0] * e[0] + e[1] * e[1])
        }

        wr.prototype = {
            constructor: wr,
            type: "path",
            __dirtyPath: !0,
            strokeContainThreshold: 5,
            segmentIgnoreThreshold: 0,
            subPixelOptimize: !1,
            brush: function (e, t) {
                var i, n = this.style, a = this.path || Tr, o = n.hasStroke(), r = n.hasFill(), s = n.fill,
                    l = n.stroke, d = r && !!s.colorStops, u = o && !!l.colorStops, c = r && !!s.image,
                    h = o && !!l.image;
                n.bind(e, this, t), this.setTransform(e), this.__dirty && (d && (i = i || this.getBoundingRect(), this._fillGradient = n.getGradient(e, s, i)), u && (i = i || this.getBoundingRect(), this._strokeGradient = n.getGradient(e, l, i))), d ? e.fillStyle = this._fillGradient : c && (e.fillStyle = yr.call(s, e)), u ? e.strokeStyle = this._strokeGradient : h && (e.strokeStyle = yr.call(l, e));
                var f = n.lineDash, g = n.lineDashOffset, p = !!e.setLineDash, v = this.getGlobalScale();
                if (a.setScale(v[0], v[1], this.segmentIgnoreThreshold), this.__dirtyPath || f && !p && o ? (a.beginPath(e), f && !p && (a.setLineDash(f), a.setLineDashOffset(g)), this.buildPath(a, this.shape, !1), this.path && (this.__dirtyPath = !1)) : (e.beginPath(), this.path.rebuildPath(e)), r) if (null != n.fillOpacity) {
                    var m = e.globalAlpha;
                    e.globalAlpha = n.fillOpacity * n.opacity, a.fill(e), e.globalAlpha = m
                } else a.fill(e);
                f && p && (e.setLineDash(f), e.lineDashOffset = g), o && (null != n.strokeOpacity ? (m = e.globalAlpha, e.globalAlpha = n.strokeOpacity * n.opacity, a.stroke(e), e.globalAlpha = m) : a.stroke(e)), f && p && e.setLineDash([]), null != n.text && (this.restoreTransform(e), this.drawRectText(e, this.getBoundingRect()))
            },
            buildPath: function (e, t, i) {
            },
            createPathProxy: function () {
                this.path = new er
            },
            getBoundingRect: function () {
                var e = this._rect, t = this.style, i = !e;
                if (i) {
                    var n = this.path;
                    n = n || (this.path = new er), this.__dirtyPath && (n.beginPath(), this.buildPath(n, this.shape, !1)), e = n.getBoundingRect()
                }
                if (this._rect = e, t.hasStroke()) {
                    var a = this._rectWithStroke || (this._rectWithStroke = e.clone());
                    if (this.__dirty || i) {
                        a.copy(e);
                        var o = t.lineWidth, r = t.strokeNoScale ? this.getLineScale() : 1;
                        t.hasFill() || (o = Math.max(o, this.strokeContainThreshold || 4)), 1e-10 < r && (a.width += o / r, a.height += o / r, a.x -= o / r / 2, a.y -= o / r / 2)
                    }
                    return a
                }
                return e
            },
            contain: function (e, t) {
                var i = this.transformCoordToLocal(e, t), n = this.getBoundingRect(), a = this.style;
                if (e = i[0], t = i[1], n.contain(e, t)) {
                    var o = this.path.data;
                    if (a.hasStroke()) {
                        var r = a.lineWidth, s = a.strokeNoScale ? this.getLineScale() : 1;
                        if (1e-10 < s && (a.hasFill() || (r = Math.max(r, this.strokeContainThreshold)), function (e, t, i, n) {
                            return mr(e, t, !0, i, n)
                        }(o, r / s, e, t))) return !0
                    }
                    if (a.hasFill()) return function (e, t, i) {
                        return mr(e, 0, !1, t, i)
                    }(o, e, t)
                }
                return !1
            },
            dirty: function (e) {
                null == e && (e = !0), e && (this.__dirtyPath = e, this._rect = null), this.__dirty = this.__dirtyText = !0, this.__zr && this.__zr.refresh(), this.__clipTarget && this.__clipTarget.dirty()
            },
            animateShape: function (e) {
                return this.animate("shape", e)
            },
            attrKV: function (e, t) {
                "shape" === e ? (this.setShape(t), this.__dirtyPath = !0, this._rect = null) : $n.prototype.attrKV.call(this, e, t)
            },
            setShape: function (e, t) {
                var i = this.shape;
                if (i) {
                    if (R(e)) for (var n in e) e.hasOwnProperty(n) && (i[n] = e[n]); else i[e] = t;
                    this.dirty(!0)
                }
                return this
            },
            getLineScale: function () {
                var e = this.transform;
                return e && 1e-10 < kr(e[0] - 1) && 1e-10 < kr(e[3] - 1) ? Math.sqrt(kr(e[0] * e[3] - e[2] * e[1])) : 1
            }
        }, wr.extend = function (e) {
            function t(t) {
                wr.call(this, t), e.style && this.style.extendFrom(e.style, !1);
                var i = e.shape;
                if (i) {
                    this.shape = this.shape || {};
                    var n = this.shape;
                    for (var a in i) !n.hasOwnProperty(a) && i.hasOwnProperty(a) && (n[a] = i[a])
                }
                e.init && e.init.call(this, t)
            }

            for (var i in I(t, wr), e) "style" !== i && "shape" !== i && (t.prototype[i] = e[i]);
            return t
        }, I(wr, $n);
        var Sr = er.CMD, Ir = [[], [], []], br = Math.sqrt, _r = Math.atan2, Dr = function (e, t) {
            var i, n, a, o, r, s = e.data, l = Sr.M, d = Sr.C, u = Sr.L, c = Sr.R, h = Sr.A, f = Sr.Q;
            for (o = a = 0; a < s.length;) {
                switch (i = s[a++], o = a, n = 0, i) {
                    case l:
                    case u:
                        n = 1;
                        break;
                    case d:
                        n = 3;
                        break;
                    case f:
                        n = 2;
                        break;
                    case h:
                        var g = t[4], p = t[5], v = br(t[0] * t[0] + t[1] * t[1]), m = br(t[2] * t[2] + t[3] * t[3]),
                            y = _r(-t[1] / m, t[0] / v);
                        s[a] *= v, s[a++] += g, s[a] *= m, s[a++] += p, s[a++] *= v, s[a++] *= m, s[a++] += y, s[a++] += y, o = a += 2;
                        break;
                    case c:
                        k[0] = s[a++], k[1] = s[a++], Ce(k, k, t), s[o++] = k[0], s[o++] = k[1], k[0] += s[a++], k[1] += s[a++], Ce(k, k, t), s[o++] = k[0], s[o++] = k[1]
                }
                for (r = 0; r < n; r++) {
                    var k;
                    (k = Ir[r])[0] = s[a++], k[1] = s[a++], Ce(k, k, t), s[o++] = k[0], s[o++] = k[1]
                }
            }
        }, Ar = Math.sqrt, Nr = Math.sin, xr = Math.cos, Er = Math.PI, Pr = function (e, t) {
            return (e[0] * t[0] + e[1] * t[1]) / (Cr(e) * Cr(t))
        }, Or = function (e, t) {
            return (e[0] * t[1] < e[1] * t[0] ? -1 : 1) * Math.acos(Pr(e, t))
        };

        function Mr(e, t, i, n, a, o, r, s, l, d, u) {
            var c = l * (Er / 180), h = xr(c) * (e - i) / 2 + Nr(c) * (t - n) / 2,
                f = -1 * Nr(c) * (e - i) / 2 + xr(c) * (t - n) / 2, g = h * h / (r * r) + f * f / (s * s);
            1 < g && (r *= Ar(g), s *= Ar(g));
            var p = (a === o ? -1 : 1) * Ar((r * r * (s * s) - r * r * (f * f) - s * s * (h * h)) / (r * r * (f * f) + s * s * (h * h))) || 0,
                v = p * r * f / s, m = p * -s * h / r, y = (e + i) / 2 + xr(c) * v - Nr(c) * m,
                k = (t + n) / 2 + Nr(c) * v + xr(c) * m, T = Or([1, 0], [(h - v) / r, (f - m) / s]),
                w = [(h - v) / r, (f - m) / s], C = [(-1 * h - v) / r, (-1 * f - m) / s], S = Or(w, C);
            Pr(w, C) <= -1 && (S = Er), 1 <= Pr(w, C) && (S = 0), 0 === o && 0 < S && (S -= 2 * Er), 1 === o && S < 0 && (S += 2 * Er), u.addData(d, y, k, r, s, T, S, c, o)
        }

        var Fr = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi, Lr = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;

        function Rr(e, t) {
            var i = function (e) {
                if (!e) return new er;
                for (var t, i = 0, n = 0, a = i, o = n, r = new er, s = er.CMD, l = e.match(Fr), d = 0; d < l.length; d++) {
                    for (var u, c = l[d], h = c.charAt(0), f = c.match(Lr) || [], g = f.length, p = 0; p < g; p++) f[p] = parseFloat(f[p]);
                    for (var v = 0; v < g;) {
                        var m, y, k, T, w, C, S, I = i, b = n;
                        switch (h) {
                            case"l":
                                i += f[v++], n += f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"L":
                                i = f[v++], n = f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"m":
                                i += f[v++], n += f[v++], u = s.M, r.addData(u, i, n), a = i, o = n, h = "l";
                                break;
                            case"M":
                                i = f[v++], n = f[v++], u = s.M, r.addData(u, i, n), a = i, o = n, h = "L";
                                break;
                            case"h":
                                i += f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"H":
                                i = f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"v":
                                n += f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"V":
                                n = f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"C":
                                u = s.C, r.addData(u, f[v++], f[v++], f[v++], f[v++], f[v++], f[v++]), i = f[v - 2], n = f[v - 1];
                                break;
                            case"c":
                                u = s.C, r.addData(u, f[v++] + i, f[v++] + n, f[v++] + i, f[v++] + n, f[v++] + i, f[v++] + n), i += f[v - 2], n += f[v - 1];
                                break;
                            case"S":
                                m = i, y = n;
                                var _ = r.len(), D = r.data;
                                t === s.C && (m += i - D[_ - 4], y += n - D[_ - 3]), u = s.C, I = f[v++], b = f[v++], i = f[v++], n = f[v++], r.addData(u, m, y, I, b, i, n);
                                break;
                            case"s":
                                m = i, y = n, _ = r.len(), D = r.data, t === s.C && (m += i - D[_ - 4], y += n - D[_ - 3]), u = s.C, I = i + f[v++], b = n + f[v++], i += f[v++], n += f[v++], r.addData(u, m, y, I, b, i, n);
                                break;
                            case"Q":
                                I = f[v++], b = f[v++], i = f[v++], n = f[v++], u = s.Q, r.addData(u, I, b, i, n);
                                break;
                            case"q":
                                I = f[v++] + i, b = f[v++] + n, i += f[v++], n += f[v++], u = s.Q, r.addData(u, I, b, i, n);
                                break;
                            case"T":
                                m = i, y = n, _ = r.len(), D = r.data, t === s.Q && (m += i - D[_ - 4], y += n - D[_ - 3]), i = f[v++], n = f[v++], u = s.Q, r.addData(u, m, y, i, n);
                                break;
                            case"t":
                                m = i, y = n, _ = r.len(), D = r.data, t === s.Q && (m += i - D[_ - 4], y += n - D[_ - 3]), i += f[v++], n += f[v++], u = s.Q, r.addData(u, m, y, i, n);
                                break;
                            case"A":
                                k = f[v++], T = f[v++], w = f[v++], C = f[v++], S = f[v++], Mr(I = i, b = n, i = f[v++], n = f[v++], C, S, k, T, w, u = s.A, r);
                                break;
                            case"a":
                                k = f[v++], T = f[v++], w = f[v++], C = f[v++], S = f[v++], Mr(I = i, b = n, i += f[v++], n += f[v++], C, S, k, T, w, u = s.A, r)
                        }
                    }
                    "z" !== h && "Z" !== h || (u = s.Z, r.addData(u), i = a, n = o), t = u
                }
                return r.toStatic(), r
            }(e);
            return (t = t || {}).buildPath = function (e) {
                if (e.setData) e.setData(i.data), (t = e.getContext()) && e.rebuildPath(t); else {
                    var t = e;
                    i.rebuildPath(t)
                }
            }, t.applyTransform = function (e) {
                Dr(i, e), this.dirty(!0)
            }, t
        }

        function Br(e, t) {
            return new wr(Rr(e, t))
        }

        var Ur = function (e) {
            $n.call(this, e)
        };

        function Kr(e) {
            return a.browser.ie && 11 <= a.browser.version ? function () {
                var t, i = this.__clipPaths, n = this.style;
                if (i) for (var a = 0; a < i.length; a++) {
                    var o = i[a], r = o && o.shape, s = o && o.type;
                    if (r && ("sector" === s && r.startAngle === r.endAngle || "rect" === s && (!r.width || !r.height))) {
                        for (var l = 0; l < Wr.length; l++) Wr[l][2] = n[Wr[l][0]], n[Wr[l][0]] = Wr[l][1];
                        t = !0;
                        break
                    }
                }
                if (e.apply(this, arguments), t) for (l = 0; l < Wr.length; l++) n[Wr[l][0]] = Wr[l][2]
            } : e
        }

        Ur.prototype = {
            constructor: Ur, type: "text", brush: function (e, t) {
                var i = this.style;
                this.__dirty && En(i), i.fill = i.stroke = i.shadowBlur = i.shadowColor = i.shadowOffsetX = i.shadowOffsetY = null;
                var n = i.text;
                null != n && (n += ""), zn(n, i) ? (this.setTransform(e), On(this, e, n, i, null, t), this.restoreTransform(e)) : e.__attrCachedBy = Ki.NONE
            }, getBoundingRect: function () {
                var e = this.style;
                if (this.__dirty && En(e), !this._rect) {
                    var t = e.text;
                    null != t ? t += "" : t = "";
                    var i = cn(e.text + "", e.font, e.textAlign, e.textVerticalAlign, e.textPadding, e.textLineHeight, e.rich);
                    if (i.x += e.x || 0, i.y += e.y || 0, Vn(e.textStroke, e.textStrokeWidth)) {
                        var n = e.textStrokeWidth;
                        i.x -= n / 2, i.y -= n / 2, i.width += n, i.height += n
                    }
                    this._rect = i
                }
                return this._rect
            }
        }, I(Ur, $n);
        var Vr = wr.extend({
                type: "circle", shape: {cx: 0, cy: 0, r: 0}, buildPath: function (e, t, i) {
                    i && e.moveTo(t.cx + t.r, t.cy), e.arc(t.cx, t.cy, t.r, 0, 2 * Math.PI, !0)
                }
            }), Wr = [["shadowBlur", 0], ["shadowColor", "#000"], ["shadowOffsetX", 0], ["shadowOffsetY", 0]],
            Gr = wr.extend({
                type: "sector",
                shape: {cx: 0, cy: 0, r0: 0, r: 0, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0},
                brush: Kr(wr.prototype.brush),
                buildPath: function (e, t) {
                    var i = t.cx, n = t.cy, a = Math.max(t.r0 || 0, 0), o = Math.max(t.r, 0), r = t.startAngle,
                        s = t.endAngle, l = t.clockwise, d = Math.cos(r), u = Math.sin(r);
                    e.moveTo(d * a + i, u * a + n), e.lineTo(d * o + i, u * o + n), e.arc(i, n, o, r, s, !l), e.lineTo(Math.cos(s) * a + i, Math.sin(s) * a + n), 0 !== a && e.arc(i, n, a, s, r, l), e.closePath()
                }
            }), Hr = wr.extend({
                type: "ring", shape: {cx: 0, cy: 0, r: 0, r0: 0}, buildPath: function (e, t) {
                    var i = t.cx, n = t.cy, a = 2 * Math.PI;
                    e.moveTo(i + t.r, n), e.arc(i, n, t.r, 0, a, !1), e.moveTo(i + t.r0, n), e.arc(i, n, t.r0, 0, a, !0)
                }
            });

        function zr(e, t, i, n, a, o, r) {
            var s = .5 * (i - e), l = .5 * (n - t);
            return (2 * (t - i) + s + l) * r + (-3 * (t - i) - 2 * s - l) * o + s * a + t
        }

        function jr(e, t, i) {
            var n = t.points, a = t.smooth;
            if (n && 2 <= n.length) {
                if (a && "spline" !== a) {
                    var o = function (e, t, i, n) {
                        var a, o, r, s, l = [], d = [], u = [], c = [];
                        if (n) {
                            r = [1 / 0, 1 / 0], s = [-1 / 0, -1 / 0];
                            for (var h = 0, f = e.length; h < f; h++) Se(r, r, e[h]), Ie(s, s, e[h]);
                            Se(r, r, n[0]), Ie(s, s, n[1])
                        }
                        for (h = 0, f = e.length; h < f; h++) {
                            var g = e[h];
                            if (i) a = e[h ? h - 1 : f - 1], o = e[(h + 1) % f]; else {
                                if (0 === h || h === f - 1) {
                                    l.push(re(e[h]));
                                    continue
                                }
                                a = e[h - 1], o = e[h + 1]
                            }
                            ue(d, o, a), pe(d, d, t);
                            var p = me(g, a), v = me(g, o), m = p + v;
                            0 !== m && (p /= m, v /= m), pe(u, d, -p), pe(c, d, v);
                            var y = le([], g, u), k = le([], g, c);
                            n && (Ie(y, y, r), Se(y, y, s), Ie(k, k, r), Se(k, k, s)), l.push(y), l.push(k)
                        }
                        return i && l.push(l.shift()), l
                    }(n, a, i, t.smoothConstraint);
                    e.moveTo(n[0][0], n[0][1]);
                    for (var r = n.length, s = 0; s < (i ? r : r - 1); s++) {
                        var l = o[2 * s], d = o[2 * s + 1], u = n[(s + 1) % r];
                        e.bezierCurveTo(l[0], l[1], d[0], d[1], u[0], u[1])
                    }
                } else {
                    "spline" === a && (n = function (e, t) {
                        for (var i = e.length, n = [], a = 0, o = 1; o < i; o++) a += me(e[o - 1], e[o]);
                        var r = a / 2;
                        for (r = r < i ? i : r, o = 0; o < r; o++) {
                            var s, l, d, u = o / (r - 1) * (t ? i : i - 1), c = Math.floor(u), h = u - c, f = e[c % i];
                            d = t ? (s = e[(c - 1 + i) % i], l = e[(c + 1) % i], e[(c + 2) % i]) : (s = e[0 === c ? c : c - 1], l = e[i - 2 < c ? i - 1 : c + 1], e[i - 3 < c ? i - 1 : c + 2]);
                            var g = h * h, p = h * g;
                            n.push([zr(s[0], f[0], l[0], d[0], h, g, p), zr(s[1], f[1], l[1], d[1], h, g, p)])
                        }
                        return n
                    }(n, i)), e.moveTo(n[0][0], n[0][1]), s = 1;
                    for (var c = n.length; s < c; s++) e.lineTo(n[s][0], n[s][1])
                }
                i && e.closePath()
            }
        }

        var Xr = wr.extend({
            type: "polygon",
            shape: {points: null, smooth: !1, smoothConstraint: null},
            buildPath: function (e, t) {
                jr(e, t, !0)
            }
        }), $r = wr.extend({
            type: "polyline",
            shape: {points: null, smooth: !1, smoothConstraint: null},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                jr(e, t, !1)
            }
        }), Yr = Math.round;

        function qr(e, t, i) {
            if (t) {
                var n = t.x1, a = t.x2, o = t.y1, r = t.y2;
                e.x1 = n, e.x2 = a, e.y1 = o, e.y2 = r;
                var s = i && i.lineWidth;
                s && (Yr(2 * n) === Yr(2 * a) && (e.x1 = e.x2 = Zr(n, s, !0)), Yr(2 * o) === Yr(2 * r) && (e.y1 = e.y2 = Zr(o, s, !0)))
            }
        }

        function Jr(e, t, i) {
            if (t) {
                var n = t.x, a = t.y, o = t.width, r = t.height;
                e.x = n, e.y = a, e.width = o, e.height = r;
                var s = i && i.lineWidth;
                s && (e.x = Zr(n, s, !0), e.y = Zr(a, s, !0), e.width = Math.max(Zr(n + o, s, !1) - e.x, 0 === o ? 0 : 1), e.height = Math.max(Zr(a + r, s, !1) - e.y, 0 === r ? 0 : 1))
            }
        }

        function Zr(e, t, i) {
            if (!t) return e;
            var n = Yr(2 * e);
            return (n + Yr(t)) % 2 == 0 ? n / 2 : (n + (i ? 1 : -1)) / 2
        }

        var Qr = {}, es = wr.extend({
            type: "rect", shape: {r: 0, x: 0, y: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i, n, a, o;
                this.subPixelOptimize ? (Jr(Qr, t, this.style), i = Qr.x, n = Qr.y, a = Qr.width, o = Qr.height, Qr.r = t.r, t = Qr) : (i = t.x, n = t.y, a = t.width, o = t.height), t.r ? In(e, t) : e.rect(i, n, a, o), e.closePath()
            }
        }), ts = {}, is = wr.extend({
            type: "line",
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, percent: 1},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i, n, a, o;
                o = this.subPixelOptimize ? (qr(ts, t, this.style), i = ts.x1, n = ts.y1, a = ts.x2, ts.y2) : (i = t.x1, n = t.y1, a = t.x2, t.y2);
                var r = t.percent;
                0 !== r && (e.moveTo(i, n), r < 1 && (a = i * (1 - r) + a * r, o = n * (1 - r) + o * r), e.lineTo(a, o))
            },
            pointAt: function (e) {
                var t = this.shape;
                return [t.x1 * (1 - e) + t.x2 * e, t.y1 * (1 - e) + t.y2 * e]
            }
        }), ns = [];

        function as(e, t, i) {
            var n = e.cpx2, a = e.cpy2;
            return null === n || null === a ? [(i ? wo : To)(e.x1, e.cpx1, e.cpx2, e.x2, t), (i ? wo : To)(e.y1, e.cpy1, e.cpy2, e.y2, t)] : [(i ? bo : Io)(e.x1, e.cpx1, e.x2, t), (i ? bo : Io)(e.y1, e.cpy1, e.y2, t)]
        }

        function os(e) {
            this.colorStops = e || []
        }

        var rs = wr.extend({
            type: "bezier-curve",
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, cpx1: 0, cpy1: 0, percent: 1},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i = t.x1, n = t.y1, a = t.x2, o = t.y2, r = t.cpx1, s = t.cpy1, l = t.cpx2, d = t.cpy2,
                    u = t.percent;
                0 !== u && (e.moveTo(i, n), null == l || null == d ? (u < 1 && (Do(i, r, a, u, ns), r = ns[1], a = ns[2], Do(n, s, o, u, ns), s = ns[1], o = ns[2]), e.quadraticCurveTo(r, s, a, o)) : (u < 1 && (So(i, r, l, a, u, ns), r = ns[1], l = ns[2], a = ns[3], So(n, s, d, o, u, ns), s = ns[1], d = ns[2], o = ns[3]), e.bezierCurveTo(r, s, l, d, a, o)))
            },
            pointAt: function (e) {
                return as(this.shape, e, !1)
            },
            tangentAt: function (e) {
                var t = as(this.shape, e, !0);
                return ve(t, t)
            }
        }), ss = wr.extend({
            type: "arc",
            shape: {cx: 0, cy: 0, r: 0, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = Math.max(t.r, 0), o = t.startAngle, r = t.endAngle, s = t.clockwise,
                    l = Math.cos(o), d = Math.sin(o);
                e.moveTo(l * a + i, d * a + n), e.arc(i, n, a, o, r, !s)
            }
        }), ls = wr.extend({
            type: "compound", shape: {paths: null}, _updatePathDirty: function () {
                for (var e = this.__dirtyPath, t = this.shape.paths, i = 0; i < t.length; i++) e = e || t[i].__dirtyPath;
                this.__dirtyPath = e, this.__dirty = this.__dirty || e
            }, beforeBrush: function () {
                this._updatePathDirty();
                for (var e = this.shape.paths || [], t = this.getGlobalScale(), i = 0; i < e.length; i++) e[i].path || e[i].createPathProxy(), e[i].path.setScale(t[0], t[1], e[i].segmentIgnoreThreshold)
            }, buildPath: function (e, t) {
                for (var i = t.paths || [], n = 0; n < i.length; n++) i[n].buildPath(e, i[n].shape, !0)
            }, afterBrush: function () {
                for (var e = this.shape.paths || [], t = 0; t < e.length; t++) e[t].__dirtyPath = !1
            }, getBoundingRect: function () {
                return this._updatePathDirty(), wr.prototype.getBoundingRect.call(this)
            }
        });

        function ds(e, t, i, n, a, o) {
            this.x = null == e ? 0 : e, this.y = null == t ? 0 : t, this.x2 = null == i ? 1 : i, this.y2 = null == n ? 0 : n, this.type = "linear", this.global = o || !1, os.call(this, a)
        }

        function us(e, t, i, n, a) {
            this.x = null == e ? .5 : e, this.y = null == t ? .5 : t, this.r = null == i ? .5 : i, this.type = "radial", this.global = a || !1, os.call(this, n)
        }

        function cs(e) {
            $n.call(this, e), this._displayables = [], this._temporaryDisplayables = [], this._cursor = 0, this.notClear = !0
        }

        os.prototype = {
            constructor: os, addColorStop: function (e, t) {
                this.colorStops.push({offset: e, color: t})
            }
        }, ds.prototype = {constructor: ds}, I(ds, os), us.prototype = {constructor: us}, I(us, os), cs.prototype.incremental = !0, cs.prototype.clearDisplaybles = function () {
            this._displayables = [], this._temporaryDisplayables = [], this._cursor = 0, this.dirty(), this.notClear = !1
        }, cs.prototype.addDisplayable = function (e, t) {
            t ? this._temporaryDisplayables.push(e) : this._displayables.push(e), this.dirty()
        }, cs.prototype.addDisplayables = function (e, t) {
            t = t || !1;
            for (var i = 0; i < e.length; i++) this.addDisplayable(e[i], t)
        }, cs.prototype.eachPendingDisplayable = function (e) {
            for (var t = this._cursor; t < this._displayables.length; t++) e && e(this._displayables[t]);
            for (t = 0; t < this._temporaryDisplayables.length; t++) e && e(this._temporaryDisplayables[t])
        }, cs.prototype.update = function () {
            this.updateTransform();
            for (var e = this._cursor; e < this._displayables.length; e++) (t = this._displayables[e]).parent = this, t.update(), t.parent = null;
            for (e = 0; e < this._temporaryDisplayables.length; e++) {
                var t;
                (t = this._temporaryDisplayables[e]).parent = this, t.update(), t.parent = null
            }
        }, cs.prototype.brush = function (e, t) {
            for (var i = this._cursor; i < this._displayables.length; i++) (n = this._displayables[i]).beforeBrush && n.beforeBrush(e), n.brush(e, i === this._cursor ? null : this._displayables[i - 1]), n.afterBrush && n.afterBrush(e);
            for (this._cursor = i, i = 0; i < this._temporaryDisplayables.length; i++) {
                var n;
                (n = this._temporaryDisplayables[i]).beforeBrush && n.beforeBrush(e), n.brush(e, 0 === i ? null : this._temporaryDisplayables[i - 1]), n.afterBrush && n.afterBrush(e)
            }
            this._temporaryDisplayables = [], this.notClear = !0
        };
        var hs = [];
        cs.prototype.getBoundingRect = function () {
            if (!this._rect) {
                for (var e = new Di(1 / 0, 1 / 0, -1 / 0, -1 / 0), t = 0; t < this._displayables.length; t++) {
                    var i = this._displayables[t], n = i.getBoundingRect().clone();
                    i.needLocalTransform() && n.applyTransform(i.getLocalTransform(hs)), e.union(n)
                }
                this._rect = e
            }
            return this._rect
        }, cs.prototype.contain = function (e, t) {
            var i = this.transformCoordToLocal(e, t);
            if (this.getBoundingRect().contain(i[0], i[1])) for (var n = 0; n < this._displayables.length; n++) if (this._displayables[n].contain(e, t)) return !0;
            return !1
        }, I(cs, $n);
        var fs = Math.max, gs = Math.min, ps = {}, vs = 1,
            ms = {color: "textFill", textBorderColor: "textStroke", textBorderWidth: "textStrokeWidth"},
            ys = "emphasis", ks = "normal", Ts = 1, ws = {}, Cs = {};

        function Ss(e) {
            return wr.extend(e)
        }

        function Is(e, t) {
            Cs[e] = t
        }

        function bs(e) {
            if (Cs.hasOwnProperty(e)) return Cs[e]
        }

        function _s(e, t, i, n) {
            var a = Br(e, t);
            return i && ("center" === n && (i = As(i, a.getBoundingRect())), xs(a, i)), a
        }

        function Ds(e, t, i) {
            var n = new Yn({
                style: {image: e, x: t.x, y: t.y, width: t.width, height: t.height}, onload: function (e) {
                    if ("center" === i) {
                        var a = {width: e.width, height: e.height};
                        n.setStyle(As(t, a))
                    }
                }
            });
            return n
        }

        function As(e, t) {
            var i, n = t.width / t.height, a = e.height * n;
            return i = a <= e.width ? e.height : (a = e.width) / n, {
                x: e.x + e.width / 2 - a / 2,
                y: e.y + e.height / 2 - i / 2,
                width: a,
                height: i
            }
        }

        var Ns = function (e, t) {
            for (var i = [], n = e.length, a = 0; a < n; a++) {
                var o = e[a];
                o.path || o.createPathProxy(), o.__dirtyPath && o.buildPath(o.path, o.shape, !0), i.push(o.path)
            }
            var r = new wr(t);
            return r.createPathProxy(), r.buildPath = function (e) {
                e.appendPath(i);
                var t = e.getContext();
                t && e.rebuildPath(t)
            }, r
        };

        function xs(e, t) {
            if (e.applyTransform) {
                var i = e.getBoundingRect().calculateTransform(t);
                e.applyTransform(i)
            }
        }

        var Es = Zr;

        function Ps(e) {
            return null != e && "none" !== e
        }

        var Os = Q(), Ms = 0;

        function Fs(e) {
            var t = e.__hoverStl;
            if (t && !e.__highlighted) {
                var i = e.__zr, n = e.useHoverLayer && i && "canvas" === i.painter.type;
                if (e.__highlighted = n ? "layer" : "plain", !(e.isGroup || !i && e.useHoverLayer)) {
                    var a = e, o = e.style;
                    n && (o = (a = i.addHover(e)).style), il(o), n || function (e) {
                        if (e.__hoverStlDirty) {
                            e.__hoverStlDirty = !1;
                            var t = e.__hoverStl;
                            if (t) {
                                var i = e.__cachedNormalStl = {};
                                e.__cachedNormalZ2 = e.z2;
                                var n = e.style;
                                for (var a in t) null != t[a] && (i[a] = n[a]);
                                i.fill = n.fill, i.stroke = n.stroke
                            } else e.__cachedNormalStl = e.__cachedNormalZ2 = null
                        }
                    }(a), o.extendFrom(t), Ls(o, t, "fill"), Ls(o, t, "stroke"), tl(o), n || (e.dirty(!1), e.z2 += vs)
                }
            }
        }

        function Ls(e, t, i) {
            !Ps(t[i]) && Ps(e[i]) && (e[i] = function (e) {
                if ("string" != typeof e) return e;
                var t = Os.get(e);
                return t || (t = Gt(e, -.1), Ms < 1e4 && (Os.set(e, t), Ms++)), t
            }(e[i]))
        }

        function Rs(e) {
            var t = e.__highlighted;
            if (t && (e.__highlighted = !1, !e.isGroup)) if ("layer" === t) e.__zr && e.__zr.removeHover(e); else {
                var i = e.style, n = e.__cachedNormalStl;
                n && (il(i), e.setStyle(n), tl(i));
                var a = e.__cachedNormalZ2;
                null != a && e.z2 - a === vs && (e.z2 = a)
            }
        }

        function Bs(e, t, i) {
            var n, a = ks, o = ks;
            e.__highlighted && (a = ys, n = !0), t(e, i), e.__highlighted && (o = ys, n = !0), e.isGroup && e.traverse(function (e) {
                e.isGroup || t(e, i)
            }), n && e.__highDownOnUpdate && e.__highDownOnUpdate(a, o)
        }

        function Us(e, t) {
            t = e.__hoverStl = !1 !== t && (e.hoverStyle || t || {}), e.__hoverStlDirty = !0, e.__highlighted && (e.__cachedNormalStl = null, Rs(e), Fs(e))
        }

        function Ks(e) {
            Hs(this, e) || this.__highByOuter || Bs(this, Fs)
        }

        function Vs(e) {
            Hs(this, e) || this.__highByOuter || Bs(this, Rs)
        }

        function Ws(e) {
            this.__highByOuter |= 1 << (e || 0), Bs(this, Fs)
        }

        function Gs(e) {
            (this.__highByOuter &= ~(1 << (e || 0))) || Bs(this, Rs)
        }

        function Hs(e, t) {
            return e.__highDownSilentOnTouch && t.zrByTouch
        }

        function zs(e, t) {
            js(e, !0), Bs(e, Us, t)
        }

        function js(e, t) {
            var i = !1 === t;
            if (e.__highDownSilentOnTouch = e.highDownSilentOnTouch, e.__highDownOnUpdate = e.highDownOnUpdate, !i || e.__highDownDispatcher) {
                var n = i ? "off" : "on";
                e[n]("mouseover", Ks)[n]("mouseout", Vs), e[n]("emphasis", Ws)[n]("normal", Gs), e.__highByOuter = e.__highByOuter || 0, e.__highDownDispatcher = !i
            }
        }

        function Xs(e) {
            return !(!e || !e.__highDownDispatcher)
        }

        function $s(e) {
            var t = ws[e];
            return null == t && Ts <= 32 && (t = ws[e] = Ts++), t
        }

        function Ys(e, t, i, n, a, o, r) {
            var s, l = (a = a || ps).labelFetcher, d = a.labelDataIndex, u = a.labelDimIndex, c = a.labelProp,
                h = i.getShallow("show"), f = n.getShallow("show");
            (h || f) && (l && (s = l.getFormattedLabel(d, "normal", null, u, c)), null == s && (s = F(a.defaultText) ? a.defaultText(d, a) : a.defaultText));
            var g = h ? s : null, p = f ? G(l ? l.getFormattedLabel(d, "emphasis", null, u, c) : null, s) : null;
            null == g && null == p || (Js(e, i, o, a), Js(t, n, r, a, !0)), e.text = g, t.text = p
        }

        function qs(e, t, i) {
            var n = e.style;
            t && (il(n), e.setStyle(t), tl(n)), n = e.__hoverStl, i && n && (il(n), k(n, i), tl(n))
        }

        function Js(e, t, i, n, a) {
            return Zs(e, t, n, a), i && k(e, i), e
        }

        function Zs(e, t, i, n) {
            if ((i = i || ps).isRectText) {
                var a;
                i.getTextPosition ? a = i.getTextPosition(t, n) : "outside" === (a = t.getShallow("position") || (n ? null : "inside")) && (a = "top"), e.textPosition = a, e.textOffset = t.getShallow("offset");
                var o = t.getShallow("rotate");
                null != o && (o *= Math.PI / 180), e.textRotation = o, e.textDistance = G(t.getShallow("distance"), n ? null : 5)
            }
            var r, s = t.ecModel, l = s && s.option.textStyle, d = function (e) {
                for (var t; e && e !== e.ecModel;) {
                    var i = (e.option || ps).rich;
                    if (i) for (var n in t = t || {}, i) i.hasOwnProperty(n) && (t[n] = 1);
                    e = e.parentModel
                }
                return t
            }(t);
            if (d) for (var u in r = {}, d) if (d.hasOwnProperty(u)) {
                var c = t.getModel(["rich", u]);
                Qs(r[u] = {}, c, l, i, n)
            }
            return e.rich = r, Qs(e, t, l, i, n, !0), i.forceRich && !i.textStyle && (i.textStyle = {}), e
        }

        function Qs(e, t, i, n, a, o) {
            i = !a && i || ps, e.textFill = el(t.getShallow("color"), n) || i.color, e.textStroke = el(t.getShallow("textBorderColor"), n) || i.textBorderColor, e.textStrokeWidth = G(t.getShallow("textBorderWidth"), i.textBorderWidth), a || (o && (e.insideRollbackOpt = n, tl(e)), null == e.textFill && (e.textFill = n.autoColor)), e.fontStyle = t.getShallow("fontStyle") || i.fontStyle, e.fontWeight = t.getShallow("fontWeight") || i.fontWeight, e.fontSize = t.getShallow("fontSize") || i.fontSize, e.fontFamily = t.getShallow("fontFamily") || i.fontFamily, e.textAlign = t.getShallow("align"), e.textVerticalAlign = t.getShallow("verticalAlign") || t.getShallow("baseline"), e.textLineHeight = t.getShallow("lineHeight"), e.textWidth = t.getShallow("width"), e.textHeight = t.getShallow("height"), e.textTag = t.getShallow("tag"), o && n.disableBox || (e.textBackgroundColor = el(t.getShallow("backgroundColor"), n), e.textPadding = t.getShallow("padding"), e.textBorderColor = el(t.getShallow("borderColor"), n), e.textBorderWidth = t.getShallow("borderWidth"), e.textBorderRadius = t.getShallow("borderRadius"), e.textBoxShadowColor = t.getShallow("shadowColor"), e.textBoxShadowBlur = t.getShallow("shadowBlur"), e.textBoxShadowOffsetX = t.getShallow("shadowOffsetX"), e.textBoxShadowOffsetY = t.getShallow("shadowOffsetY")), e.textShadowColor = t.getShallow("textShadowColor") || i.textShadowColor, e.textShadowBlur = t.getShallow("textShadowBlur") || i.textShadowBlur, e.textShadowOffsetX = t.getShallow("textShadowOffsetX") || i.textShadowOffsetX, e.textShadowOffsetY = t.getShallow("textShadowOffsetY") || i.textShadowOffsetY
        }

        function el(e, t) {
            return "auto" !== e ? e : t && t.autoColor ? t.autoColor : null
        }

        function tl(e) {
            var t, i = e.textPosition, n = e.insideRollbackOpt;
            if (n && null == e.textFill) {
                var a = n.autoColor, o = n.isRectText, r = n.useInsideStyle,
                    s = !1 !== r && (!0 === r || o && i && "string" == typeof i && 0 <= i.indexOf("inside")),
                    l = !s && null != a;
                (s || l) && (t = {
                    textFill: e.textFill,
                    textStroke: e.textStroke,
                    textStrokeWidth: e.textStrokeWidth
                }), s && (e.textFill = "#fff", null == e.textStroke && (e.textStroke = a, null == e.textStrokeWidth && (e.textStrokeWidth = 2))), l && (e.textFill = a)
            }
            e.insideRollback = t
        }

        function il(e) {
            var t = e.insideRollback;
            t && (e.textFill = t.textFill, e.textStroke = t.textStroke, e.textStrokeWidth = t.textStrokeWidth, e.insideRollback = null)
        }

        function nl(e, t) {
            var i = t && t.getModel("textStyle");
            return $([e.fontStyle || i && i.getShallow("fontStyle") || "", e.fontWeight || i && i.getShallow("fontWeight") || "", (e.fontSize || i && i.getShallow("fontSize") || 12) + "px", e.fontFamily || i && i.getShallow("fontFamily") || "sans-serif"].join(" "))
        }

        function al(e, t, i, n, a, o) {
            if ("function" == typeof a && (o = a, a = null), n && n.isAnimationEnabled()) {
                var r = e ? "Update" : "", s = n.getShallow("animationDuration" + r),
                    l = n.getShallow("animationEasing" + r), d = n.getShallow("animationDelay" + r);
                "function" == typeof d && (d = d(a, n.getAnimationDelayParams ? n.getAnimationDelayParams(t, a) : null)), "function" == typeof s && (s = s(a)), 0 < s ? t.animateTo(i, s, d || 0, l, o, !!o) : (t.stopAnimation(), t.attr(i), o && o())
            } else t.stopAnimation(), t.attr(i), o && o()
        }

        function ol(e, t, i, n, a) {
            al(!0, e, t, i, n, a)
        }

        function rl(e, t, i, n, a) {
            al(!1, e, t, i, n, a)
        }

        function sl(e, t) {
            for (var i = rt([]); e && e !== t;) lt(i, e.getLocalTransform(), i), e = e.parent;
            return i
        }

        function ll(e, t, i) {
            return t && !_(t) && (t = mt.getLocalTransform(t)), i && (t = ht([], t)), Ce([], e, t)
        }

        function dl(e, t, i) {
            var n = 0 === t[4] || 0 === t[5] || 0 === t[0] ? 1 : Math.abs(2 * t[4] / t[0]),
                a = 0 === t[4] || 0 === t[5] || 0 === t[2] ? 1 : Math.abs(2 * t[4] / t[2]),
                o = ["left" === e ? -n : "right" === e ? n : 0, "top" === e ? -a : "bottom" === e ? a : 0];
            return o = ll(o, t, i), Math.abs(o[0]) > Math.abs(o[1]) ? 0 < o[0] ? "right" : "left" : 0 < o[1] ? "bottom" : "top"
        }

        function ul(e, t, i, n) {
            if (e && t) {
                var a, o = (a = {}, e.traverse(function (e) {
                    !e.isGroup && e.anid && (a[e.anid] = e)
                }), a);
                t.traverse(function (e) {
                    if (!e.isGroup && e.anid) {
                        var t = o[e.anid];
                        if (t) {
                            var n = r(e);
                            e.attr(r(t)), ol(e, n, i, e.dataIndex)
                        }
                    }
                })
            }

            function r(e) {
                var t = {position: re(e.position), rotation: e.rotation};
                return e.shape && (t.shape = k({}, e.shape)), t
            }
        }

        function cl(e, t) {
            return A(e, function (e) {
                var i = e[0];
                i = fs(i, t.x), i = gs(i, t.x + t.width);
                var n = e[1];
                return n = fs(n, t.y), [i, n = gs(n, t.y + t.height)]
            })
        }

        function hl(e, t, i) {
            var n = (t = k({rectHover: !0}, t)).style = {strokeNoScale: !0};
            if (i = i || {
                x: -1,
                y: -1,
                width: 2,
                height: 2
            }, e) return 0 === e.indexOf("image://") ? (n.image = e.slice(8), T(n, i), new Yn(t)) : _s(e.replace("path://", ""), t, i, "center")
        }

        function fl(e, t, i, n, a) {
            for (var o = 0, r = a[a.length - 1]; o < a.length; o++) {
                var s = a[o];
                if (gl(e, t, i, n, s[0], s[1], r[0], r[1])) return !0;
                r = s
            }
        }

        function gl(e, t, i, n, a, o, r, s) {
            var l = i - e, d = n - t, u = r - a, c = s - o, h = pl(u, c, l, d);
            var f = e - a, g = t - o, p = pl(f, g, l, d) / h;
            if (p < 0 || 1 < p) return !1;
            var v = pl(f, g, u, c) / h;
            return !(v < 0 || 1 < v)
        }

        function pl(e, t, i, n) {
            return e * n - i * t
        }

        Is("circle", Vr), Is("sector", Gr), Is("ring", Hr), Is("polygon", Xr), Is("polyline", $r), Is("rect", es), Is("line", is), Is("bezierCurve", rs), Is("arc", ss);
        var vl = (Object.freeze || Object)({
                Z2_EMPHASIS_LIFT: vs,
                CACHED_LABEL_STYLE_PROPERTIES: ms,
                extendShape: Ss,
                extendPath: function (e, t) {
                    return function (e, t) {
                        return wr.extend(Rr(e, t))
                    }(e, t)
                },
                registerShape: Is,
                getShapeClass: bs,
                makePath: _s,
                makeImage: Ds,
                mergePath: Ns,
                resizePath: xs,
                subPixelOptimizeLine: function (e) {
                    return qr(e.shape, e.shape, e.style), e
                },
                subPixelOptimizeRect: function (e) {
                    return Jr(e.shape, e.shape, e.style), e
                },
                subPixelOptimize: Es,
                setElementHoverStyle: Us,
                setHoverStyle: zs,
                setAsHighDownDispatcher: js,
                isHighDownDispatcher: Xs,
                getHighlightDigit: $s,
                setLabelStyle: Ys,
                modifyLabelStyle: qs,
                setTextStyle: Js,
                setText: function (e, t, i) {
                    var n, a = {isRectText: !0};
                    !1 === i ? n = !0 : a.autoColor = i, Zs(e, t, a, n)
                },
                getFont: nl,
                updateProps: ol,
                initProps: rl,
                getTransform: sl,
                applyTransform: ll,
                transformDirection: dl,
                groupTransition: ul,
                clipPointsByRect: cl,
                clipRectByRect: function (e, t) {
                    var i = fs(e.x, t.x), n = gs(e.x + e.width, t.x + t.width), a = fs(e.y, t.y),
                        o = gs(e.y + e.height, t.y + t.height);
                    if (i <= n && a <= o) return {x: i, y: a, width: n - i, height: o - a}
                },
                createIcon: hl,
                linePolygonIntersect: fl,
                lineLineIntersect: gl,
                Group: Ai,
                Image: Yn,
                Text: Ur,
                Circle: Vr,
                Sector: Gr,
                Ring: Hr,
                Polygon: Xr,
                Polyline: $r,
                Rect: es,
                Line: is,
                BezierCurve: rs,
                Arc: ss,
                IncrementalDisplayable: cs,
                CompoundPath: ls,
                LinearGradient: ds,
                RadialGradient: us,
                BoundingRect: Di
            }), ml = ["textStyle", "color"], yl = {
                getTextColor: function (e) {
                    var t = this.ecModel;
                    return this.getShallow("color") || (!e && t ? t.get(ml) : null)
                }, getFont: function () {
                    return nl({
                        fontStyle: this.getShallow("fontStyle"),
                        fontWeight: this.getShallow("fontWeight"),
                        fontSize: this.getShallow("fontSize"),
                        fontFamily: this.getShallow("fontFamily")
                    }, this.ecModel)
                }, getTextRect: function (e) {
                    return cn(e, this.getFont(), this.getShallow("align"), this.getShallow("verticalAlign") || this.getShallow("baseline"), this.getShallow("padding"), this.getShallow("lineHeight"), this.getShallow("rich"), this.getShallow("truncateText"))
                }
            },
            kl = no([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"], ["textPosition"], ["textAlign"]]),
            Tl = {
                getItemStyle: function (e, t) {
                    var i = kl(this, e, t), n = this.getBorderLineDash();
                    return n && (i.lineDash = n), i
                }, getBorderLineDash: function () {
                    var e = this.get("borderType");
                    return "solid" === e || null == e ? null : "dashed" === e ? [5, 5] : [1, 1]
                }
            }, wl = b, Cl = Va();

        function Sl(e, t, i) {
            this.parentModel = t, this.ecModel = i, this.option = e
        }

        function Il(e, t, i) {
            for (var n = 0; n < t.length && (!t[n] || null != (e = e && "object" == typeof e ? e[t[n]] : null)); n++) ;
            return null == e && i && (e = i.get(t)), e
        }

        function bl(e, t) {
            var i = Cl(e).getParent;
            return i ? i.call(e, t) : e.parentModel
        }

        Sl.prototype = {
            constructor: Sl, init: null, mergeOption: function (e) {
                m(this.option, e, !0)
            }, get: function (e, t) {
                return null == e ? this.option : Il(this.option, this.parsePath(e), !t && bl(this, e))
            }, getShallow: function (e, t) {
                var i = this.option, n = null == i ? i : i[e], a = !t && bl(this, e);
                return null == n && a && (n = a.getShallow(e)), n
            }, getModel: function (e, t) {
                var i;
                return new Sl(null == e ? this.option : Il(this.option, e = this.parsePath(e)), t = t || (i = bl(this, e)) && i.getModel(e), this.ecModel)
            }, isEmpty: function () {
                return null == this.option
            }, restoreData: function () {
            }, clone: function () {
                return new this.constructor(v(this.option))
            }, setReadOnly: function (e) {
            }, parsePath: function (e) {
                return "string" == typeof e && (e = e.split(".")), e
            }, customizeGetParent: function (e) {
                Cl(this).getParent = e
            }, isAnimationEnabled: function () {
                if (!a.node) {
                    if (null != this.option.animation) return !!this.option.animation;
                    if (this.parentModel) return this.parentModel.isAnimationEnabled()
                }
            }
        }, Ja(Sl), Qa(Sl), wl(Sl, oo), wl(Sl, so), wl(Sl, yl), wl(Sl, Tl);
        var _l = 0;

        function Dl(e) {
            return [e || "", _l++, Math.random().toFixed(5)].join("_")
        }

        var Al = 1e-4;

        function Nl(e, t, i, n) {
            var a = t[1] - t[0], o = i[1] - i[0];
            if (0 == a) return 0 == o ? i[0] : (i[0] + i[1]) / 2;
            if (n) if (0 < a) {
                if (e <= t[0]) return i[0];
                if (e >= t[1]) return i[1]
            } else {
                if (e >= t[0]) return i[0];
                if (e <= t[1]) return i[1]
            } else {
                if (e === t[0]) return i[0];
                if (e === t[1]) return i[1]
            }
            return (e - t[0]) / a * o + i[0]
        }

        function xl(e, t) {
            switch (e) {
                case"center":
                case"middle":
                    e = "50%";
                    break;
                case"left":
                case"top":
                    e = "0%";
                    break;
                case"right":
                case"bottom":
                    e = "100%"
            }
            return "string" == typeof e ? function (e) {
                return e.replace(/^\s+|\s+$/g, "")
            }(e).match(/%$/) ? parseFloat(e) / 100 * t : parseFloat(e) : null == e ? NaN : +e
        }

        function El(e, t, i) {
            return null == t && (t = 10), t = Math.min(Math.max(0, t), 20), e = (+e).toFixed(t), i ? e : +e
        }

        function Pl(e) {
            return e.sort(function (e, t) {
                return e - t
            }), e
        }

        function Ol(e) {
            if (e = +e, isNaN(e)) return 0;
            for (var t = 1, i = 0; Math.round(e * t) / t !== e;) t *= 10, i++;
            return i
        }

        function Ml(e) {
            var t = e.toString(), i = t.indexOf("e");
            if (0 < i) {
                var n = +t.slice(i + 1);
                return n < 0 ? -n : 0
            }
            var a = t.indexOf(".");
            return a < 0 ? 0 : t.length - 1 - a
        }

        function Fl(e, t) {
            var i = Math.log, n = Math.LN10, a = Math.floor(i(e[1] - e[0]) / n),
                o = Math.round(i(Math.abs(t[1] - t[0])) / n), r = Math.min(Math.max(-a + o, 0), 20);
            return isFinite(r) ? r : 20
        }

        function Ll(e, t, i) {
            if (!e[t]) return 0;
            var n = N(e, function (e, t) {
                return e + (isNaN(t) ? 0 : t)
            }, 0);
            if (0 === n) return 0;
            for (var a = Math.pow(10, i), o = A(e, function (e) {
                return (isNaN(e) ? 0 : e) / n * a * 100
            }), r = 100 * a, s = A(o, function (e) {
                return Math.floor(e)
            }), l = N(s, function (e, t) {
                return e + t
            }, 0), d = A(o, function (e, t) {
                return e - s[t]
            }); l < r;) {
                for (var u = Number.NEGATIVE_INFINITY, c = null, h = 0, f = d.length; h < f; ++h) d[h] > u && (u = d[h], c = h);
                ++s[c], d[c] = 0, ++l
            }
            return s[t] / a
        }

        var Rl = 9007199254740991;

        function Bl(e) {
            var t = 2 * Math.PI;
            return (e % t + t) % t
        }

        function Ul(e) {
            return -Al < e && e < Al
        }

        var Kl = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;

        function Vl(e) {
            if (e instanceof Date) return e;
            if ("string" != typeof e) return null == e ? new Date(NaN) : new Date(Math.round(e));
            var t = Kl.exec(e);
            if (!t) return new Date(NaN);
            if (t[8]) {
                var i = +t[4] || 0;
                return "Z" !== t[8].toUpperCase() && (i -= t[8].slice(0, 3)), new Date(Date.UTC(+t[1], +(t[2] || 1) - 1, +t[3] || 1, i, +(t[5] || 0), +t[6] || 0, +t[7] || 0))
            }
            return new Date(+t[1], +(t[2] || 1) - 1, +t[3] || 1, +t[4] || 0, +(t[5] || 0), +t[6] || 0, +t[7] || 0)
        }

        function Wl(e) {
            return Math.pow(10, Gl(e))
        }

        function Gl(e) {
            if (0 === e) return 0;
            var t = Math.floor(Math.log(e) / Math.LN10);
            return 10 <= e / Math.pow(10, t) && t++, t
        }

        function Hl(e, t) {
            var i = Gl(e), n = Math.pow(10, i), a = e / n;
            return e = (t ? a < 1.5 ? 1 : a < 2.5 ? 2 : a < 4 ? 3 : a < 7 ? 5 : 10 : a < 1 ? 1 : a < 2 ? 2 : a < 3 ? 3 : a < 5 ? 5 : 10) * n, -20 <= i ? +e.toFixed(i < 0 ? -i : 0) : e
        }

        function zl(e) {
            e.sort(function (e, t) {
                return function e(t, i, n) {
                    return t.interval[n] < i.interval[n] || t.interval[n] === i.interval[n] && (t.close[n] - i.close[n] == (n ? -1 : 1) || !n && e(t, i, 1))
                }(e, t, 0) ? -1 : 1
            });
            for (var t = -1 / 0, i = 1, n = 0; n < e.length;) {
                for (var a = e[n].interval, o = e[n].close, r = 0; r < 2; r++) a[r] <= t && (a[r] = t, o[r] = r ? 1 : 1 - i), t = a[r], i = o[r];
                a[0] === a[1] && o[0] * o[1] != 1 ? e.splice(n, 1) : n++
            }
            return e
        }

        function jl(e) {
            return 0 <= e - parseFloat(e)
        }

        var Xl = (Object.freeze || Object)({
            linearMap: Nl,
            parsePercent: xl,
            round: El,
            asc: Pl,
            getPrecision: Ol,
            getPrecisionSafe: Ml,
            getPixelPrecision: Fl,
            getPercentWithPrecision: Ll,
            MAX_SAFE_INTEGER: Rl,
            remRadian: Bl,
            isRadianAroundZero: Ul,
            parseDate: Vl,
            quantity: Wl,
            quantityExponent: Gl,
            nice: Hl,
            quantile: function (e, t) {
                var i = (e.length - 1) * t + 1, n = Math.floor(i), a = +e[n - 1], o = i - n;
                return o ? a + o * (e[n] - a) : a
            },
            reformIntervals: zl,
            isNumeric: jl
        });

        function $l(e) {
            return isNaN(e) ? "-" : (e = (e + "").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (1 < e.length ? "." + e[1] : "")
        }

        function Yl(e, t) {
            return e = (e || "").toLowerCase().replace(/-(.)/g, function (e, t) {
                return t.toUpperCase()
            }), t && e && (e = e.charAt(0).toUpperCase() + e.slice(1)), e
        }

        var ql = j, Jl = /([&<>"'])/g, Zl = {"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;"};

        function Ql(e) {
            return null == e ? "" : (e + "").replace(Jl, function (e, t) {
                return Zl[t]
            })
        }

        function ed(e, t) {
            return "{" + e + (null == t ? "" : t) + "}"
        }

        var td = ["a", "b", "c", "d", "e", "f", "g"];

        function id(e, t, i) {
            M(t) || (t = [t]);
            var n = t.length;
            if (!n) return "";
            for (var a = t[0].$vars || [], o = 0; o < a.length; o++) {
                var r = td[o];
                e = e.replace(ed(r), ed(r, 0))
            }
            for (var s = 0; s < n; s++) for (var l = 0; l < a.length; l++) {
                var d = t[s][a[l]];
                e = e.replace(ed(td[l], s), i ? Ql(d) : d)
            }
            return e
        }

        function nd(e, t, i) {
            return D(t, function (t, n) {
                e = e.replace("{" + n + "}", i ? Ql(t) : t)
            }), e
        }

        function ad(e, t) {
            var i = (e = L(e) ? {color: e, extraCssText: t} : e || {}).color, n = e.type,
                a = (t = e.extraCssText, e.renderMode || "html"), o = e.markerId || "X";
            return i ? "html" === a ? "subItem" === n ? '<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:' + Ql(i) + ";" + (t || "") + '"></span>' : '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + Ql(i) + ";" + (t || "") + '"></span>' : {
                renderMode: a,
                content: "{marker" + o + "|}  ",
                style: {color: i}
            } : ""
        }

        function od(e, t) {
            return "0000".substr(0, t - (e += "").length) + e
        }

        function rd(e, t, i) {
            "week" !== e && "month" !== e && "quarter" !== e && "half-year" !== e && "year" !== e || (e = "MM-dd\nyyyy");
            var n = Vl(t), a = i ? "UTC" : "", o = n["get" + a + "FullYear"](), r = n["get" + a + "Month"]() + 1,
                s = n["get" + a + "Date"](), l = n["get" + a + "Hours"](), d = n["get" + a + "Minutes"](),
                u = n["get" + a + "Seconds"](), c = n["get" + a + "Milliseconds"]();
            return e = e.replace("MM", od(r, 2)).replace("M", r).replace("yyyy", o).replace("yy", o % 100).replace("dd", od(s, 2)).replace("d", s).replace("hh", od(l, 2)).replace("h", l).replace("mm", od(d, 2)).replace("m", d).replace("ss", od(u, 2)).replace("s", u).replace("SSS", od(c, 3))
        }

        function sd(e) {
            return e ? e.charAt(0).toUpperCase() + e.substr(1) : e
        }

        var ld = pn;

        function dd(e, t) {
            if ("_blank" === t || "blank" === t) {
                var i = window.open();
                i.opener = null, i.location = e
            } else window.open(e, t)
        }

        var ud = (Object.freeze || Object)({
                addCommas: $l,
                toCamelCase: Yl,
                normalizeCssArray: ql,
                encodeHTML: Ql,
                formatTpl: id,
                formatTplSimple: nd,
                getTooltipMarker: ad,
                formatTime: rd,
                capitalFirst: sd,
                truncateText: ld,
                getTextBoundingRect: function (e) {
                    return cn(e.text, e.font, e.textAlign, e.textVerticalAlign, e.textPadding, e.textLineHeight, e.rich, e.truncate)
                },
                getTextRect: function (e, t, i, n, a, o, r, s) {
                    return cn(e, t, i, n, a, s, o, r)
                },
                windowOpen: dd
            }), cd = D, hd = ["left", "right", "top", "bottom", "width", "height"],
            fd = [["width", "left", "right"], ["height", "top", "bottom"]];

        function gd(e, t, i, n, a) {
            var o = 0, r = 0;
            null == n && (n = 1 / 0), null == a && (a = 1 / 0);
            var s = 0;
            t.eachChild(function (l, d) {
                var u, c, h = l.position, f = l.getBoundingRect(), g = t.childAt(d + 1), p = g && g.getBoundingRect();
                if ("horizontal" === e) {
                    var v = f.width + (p ? -p.x + f.x : 0);
                    s = n < (u = o + v) || l.newline ? (o = 0, u = v, r += s + i, f.height) : Math.max(s, f.height)
                } else {
                    var m = f.height + (p ? -p.y + f.y : 0);
                    s = a < (c = r + m) || l.newline ? (o += s + i, r = 0, c = m, f.width) : Math.max(s, f.width)
                }
                l.newline || (h[0] = o, h[1] = r, "horizontal" === e ? o = u + i : r = c + i)
            })
        }

        var pd = gd;

        function vd(e, t, i) {
            i = ql(i || 0);
            var n = t.width, a = t.height, o = xl(e.left, n), r = xl(e.top, a), s = xl(e.right, n), l = xl(e.bottom, a),
                d = xl(e.width, n), u = xl(e.height, a), c = i[2] + i[0], h = i[1] + i[3], f = e.aspect;
            switch (isNaN(d) && (d = n - s - h - o), isNaN(u) && (u = a - l - c - r), null != f && (isNaN(d) && isNaN(u) && (n / a < f ? d = .8 * n : u = .8 * a), isNaN(d) && (d = f * u), isNaN(u) && (u = d / f)), isNaN(o) && (o = n - s - d - h), isNaN(r) && (r = a - l - u - c), e.left || e.right) {
                case"center":
                    o = n / 2 - d / 2 - i[3];
                    break;
                case"right":
                    o = n - d - h
            }
            switch (e.top || e.bottom) {
                case"middle":
                case"center":
                    r = a / 2 - u / 2 - i[0];
                    break;
                case"bottom":
                    r = a - u - c
            }
            o = o || 0, r = r || 0, isNaN(d) && (d = n - h - o - (s || 0)), isNaN(u) && (u = a - c - r - (l || 0));
            var g = new Di(o + i[3], r + i[0], d, u);
            return g.margin = i, g
        }

        function md(e, t, i, n, a) {
            var o = !a || !a.hv || a.hv[0], r = !a || !a.hv || a.hv[1], s = a && a.boundingMode || "all";
            if (o || r) {
                var l;
                if ("raw" === s) l = "group" === e.type ? new Di(0, 0, +t.width || 0, +t.height || 0) : e.getBoundingRect(); else if (l = e.getBoundingRect(), e.needLocalTransform()) {
                    var d = e.getLocalTransform();
                    (l = l.clone()).applyTransform(d)
                }
                t = vd(T({width: l.width, height: l.height}, t), i, n);
                var u = e.position, c = o ? t.x - l.x : 0, h = r ? t.y - l.y : 0;
                e.attr("position", "raw" === s ? [c, h] : [u[0] + c, u[1] + h])
            }
        }

        function yd(e, t, i) {
            R(i) || (i = {});
            var n = i.ignoreSize;
            M(n) || (n = [n, n]);
            var a = r(fd[0], 0), o = r(fd[1], 1);

            function r(i, a) {
                var o = {}, r = 0, d = {}, u = 0;
                if (cd(i, function (t) {
                    d[t] = e[t]
                }), cd(i, function (e) {
                    s(t, e) && (o[e] = d[e] = t[e]), l(o, e) && r++, l(d, e) && u++
                }), n[a]) return l(t, i[1]) ? d[i[2]] = null : l(t, i[2]) && (d[i[1]] = null), d;
                if (2 !== u && r) {
                    if (2 <= r) return o;
                    for (var c = 0; c < i.length; c++) {
                        var h = i[c];
                        if (!s(o, h) && s(e, h)) {
                            o[h] = e[h];
                            break
                        }
                    }
                    return o
                }
                return d
            }

            function s(e, t) {
                return e.hasOwnProperty(t)
            }

            function l(e, t) {
                return null != e[t] && "auto" !== e[t]
            }

            function d(e, t, i) {
                cd(e, function (e) {
                    t[e] = i[e]
                })
            }

            d(fd[0], e, a), d(fd[1], e, o)
        }

        function kd(e) {
            return Td({}, e)
        }

        function Td(e, t) {
            return t && e && cd(hd, function (i) {
                t.hasOwnProperty(i) && (e[i] = t[i])
            }), e
        }

        O(gd, "vertical"), O(gd, "horizontal");
        var wd, Cd, Sd, Id = Va(), bd = Sl.extend({
            type: "component",
            id: "",
            name: "",
            mainType: "",
            subType: "",
            componentIndex: 0,
            defaultOption: null,
            ecModel: null,
            dependentModels: [],
            uid: null,
            layoutMode: null,
            $constructor: function (e, t, i, n) {
                Sl.call(this, e, t, i, n), this.uid = Dl("ec_cpt_model")
            },
            init: function (e, t, i, n) {
                this.mergeDefaultAndTheme(e, i)
            },
            mergeDefaultAndTheme: function (e, t) {
                var i = this.layoutMode, n = i ? kd(e) : {};
                m(e, t.getTheme().get(this.mainType)), m(e, this.getDefaultOption()), i && yd(e, n, i)
            },
            mergeOption: function (e, t) {
                m(this.option, e, !0);
                var i = this.layoutMode;
                i && yd(this.option, e, i)
            },
            optionUpdated: function (e, t) {
            },
            getDefaultOption: function () {
                var e = Id(this);
                if (!e.defaultOption) {
                    for (var t = [], i = this.constructor; i;) {
                        var n = i.prototype.defaultOption;
                        n && t.push(n), i = i.superClass
                    }
                    for (var a = {}, o = t.length - 1; 0 <= o; o--) a = m(a, t[o], !0);
                    e.defaultOption = a
                }
                return e.defaultOption
            },
            getReferringComponents: function (e) {
                return this.ecModel.queryComponents({
                    mainType: e,
                    index: this.get(e + "Index", !0),
                    id: this.get(e + "Id", !0)
                })
            }
        });

        function _d(e, t) {
            return e[t] || (e[t] = {predecessor: [], successor: []}), e[t]
        }

        io(bd, {registerWhenExtend: !0}), Cd = {}, (wd = bd).registerSubTypeDefaulter = function (e, t) {
            e = qa(e), Cd[e.main] = t
        }, wd.determineSubType = function (e, t) {
            var i = t.type;
            if (!i) {
                var n = qa(e).main;
                wd.hasSubTypes(e) && Cd[n] && (i = Cd[n](t))
            }
            return i
        }, Sd = function (e) {
            var t = [];
            return D(bd.getClassesByMainType(e), function (e) {
                t = t.concat(e.prototype.dependencies || [])
            }), t = A(t, function (e) {
                return qa(e).main
            }), "dataset" !== e && S(t, "dataset") <= 0 && t.unshift("dataset"), t
        }, bd.topologicalTravel = function (e, t, i, n) {
            if (e.length) {
                var a = function (e) {
                    var t = {}, i = [];
                    return D(e, function (n) {
                        var a = _d(t, n), o = function (e, t) {
                            var i = [];
                            return D(e, function (e) {
                                0 <= S(t, e) && i.push(e)
                            }), i
                        }(a.originalDeps = Sd(n), e);
                        a.entryCount = o.length, 0 === a.entryCount && i.push(n), D(o, function (e) {
                            S(a.predecessor, e) < 0 && a.predecessor.push(e);
                            var i = _d(t, e);
                            S(i.successor, e) < 0 && i.successor.push(n)
                        })
                    }), {graph: t, noEntryList: i}
                }(t), o = a.graph, r = a.noEntryList, s = {};
                for (D(e, function (e) {
                    s[e] = !0
                }); r.length;) {
                    var l = r.pop(), d = o[l], u = !!s[l];
                    u && (i.call(n, l, d.originalDeps.slice()), delete s[l]), D(d.successor, u ? h : c)
                }
                D(s, function () {
                    throw new Error("Circle dependency may exists")
                })
            }

            function c(e) {
                o[e].entryCount--, 0 === o[e].entryCount && r.push(e)
            }

            function h(e) {
                s[e] = !0, c(e)
            }
        }, b(bd, {
            getBoxLayoutParams: function () {
                return {
                    left: this.get("left"),
                    top: this.get("top"),
                    right: this.get("right"),
                    bottom: this.get("bottom"),
                    width: this.get("width"),
                    height: this.get("height")
                }
            }
        });
        var Dd = "";
        "undefined" != typeof navigator && (Dd = navigator.platform || "");
        var Ad = {
                color: ["#c23531", "#2f4554", "#61a0a8", "#d48265", "#91c7ae", "#749f83", "#ca8622", "#bda29a", "#6e7074", "#546570", "#c4ccd3"],
                gradientColor: ["#f6efa6", "#d88273", "#bf444c"],
                textStyle: {
                    fontFamily: Dd.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
                    fontSize: 12,
                    fontStyle: "normal",
                    fontWeight: "normal"
                },
                blendMode: null,
                animation: "auto",
                animationDuration: 1e3,
                animationDurationUpdate: 300,
                animationEasing: "exponentialOut",
                animationEasingUpdate: "cubicOut",
                animationThreshold: 2e3,
                progressiveThreshold: 3e3,
                progressive: 400,
                hoverLayerThreshold: 3e3,
                useUTC: !1
            }, Nd = Va(), xd = {
                clearColorPalette: function () {
                    Nd(this).colorIdx = 0, Nd(this).colorNameMap = {}
                }, getColorFromPalette: function (e, t, i) {
                    var n = Nd(t = t || this), a = n.colorIdx || 0, o = n.colorNameMap = n.colorNameMap || {};
                    if (o.hasOwnProperty(e)) return o[e];
                    var r = Pa(this.get("color", !0)), s = this.get("colorLayer", !0),
                        l = null != i && s ? function (e, t) {
                            for (var i = e.length, n = 0; n < i; n++) if (e[n].length > t) return e[n];
                            return e[i - 1]
                        }(s, i) : r;
                    if ((l = l || r) && l.length) {
                        var d = l[a];
                        return e && (o[e] = d), n.colorIdx = (a + 1) % l.length, d
                    }
                }
            }, Ed = "original", Pd = "arrayRows", Od = "objectRows", Md = "keyedColumns", Fd = "unknown", Ld = "typedArray",
            Rd = "column", Bd = "row";

        function Ud(e) {
            this.fromDataset = e.fromDataset, this.data = e.data || (e.sourceFormat === Md ? {} : []), this.sourceFormat = e.sourceFormat || Fd, this.seriesLayoutBy = e.seriesLayoutBy || Rd, this.dimensionsDefine = e.dimensionsDefine, this.encodeDefine = e.encodeDefine && Q(e.encodeDefine), this.startIndex = e.startIndex || 0, this.dimensionsDetectCount = e.dimensionsDetectCount
        }

        Ud.seriesDataToSource = function (e) {
            return new Ud({data: e, sourceFormat: U(e) ? Ld : Ed, fromDataset: !1})
        }, Qa(Ud);
        var Kd = {Must: 1, Might: 2, Not: 3}, Vd = Va();

        function Wd(e) {
            var t = e.option, i = t.data, n = U(i) ? Ld : Ed, a = !1, o = t.seriesLayoutBy, r = t.sourceHeader,
                s = t.dimensions, l = Xd(e);
            if (l) {
                var d = l.option;
                i = d.source, n = Vd(l).sourceFormat, a = !0, o = o || d.seriesLayoutBy, null == r && (r = d.sourceHeader), s = s || d.dimensions
            }
            var u = function (e, t, i, n, a) {
                if (!e) return {dimensionsDefine: Gd(a)};
                var o, r;
                if (t === Pd) "auto" === n || null == n ? Hd(function (e) {
                    null != e && "-" !== e && (L(e) ? null == r && (r = 1) : r = 0)
                }, i, e, 10) : r = n ? 1 : 0, a || 1 !== r || (a = [], Hd(function (e, t) {
                    a[t] = null != e ? e : ""
                }, i, e)), o = a ? a.length : i === Bd ? e.length : e[0] ? e[0].length : null; else if (t === Od) a = a || function (e) {
                    for (var t, i = 0; i < e.length && !(t = e[i++]);) ;
                    if (t) {
                        var n = [];
                        return D(t, function (e, t) {
                            n.push(t)
                        }), n
                    }
                }(e); else if (t === Md) a || (a = [], D(e, function (e, t) {
                    a.push(t)
                })); else if (t === Ed) {
                    var s = Fa(e[0]);
                    o = M(s) && s.length || 1
                }
                return {startIndex: r, dimensionsDefine: Gd(a), dimensionsDetectCount: o}
            }(i, n, o, r, s);
            Vd(e).source = new Ud({
                data: i,
                fromDataset: a,
                seriesLayoutBy: o,
                sourceFormat: n,
                dimensionsDefine: u.dimensionsDefine,
                startIndex: u.startIndex,
                dimensionsDetectCount: u.dimensionsDetectCount,
                encodeDefine: t.encode
            })
        }

        function Gd(e) {
            if (e) {
                var t = Q();
                return A(e, function (e, i) {
                    if (null == (e = k({}, R(e) ? e : {name: e})).name) return e;
                    e.name += "", null == e.displayName && (e.displayName = e.name);
                    var n = t.get(e.name);
                    return n ? e.name += "-" + n.count++ : t.set(e.name, {count: 1}), e
                })
            }
        }

        function Hd(e, t, i, n) {
            if (null == n && (n = 1 / 0), t === Bd) for (var a = 0; a < i.length && a < n; a++) e(i[a] ? i[a][0] : null, a); else {
                var o = i[0] || [];
                for (a = 0; a < o.length && a < n; a++) e(o[a], a)
            }
        }

        function zd(e, t, i) {
            var n = {}, a = Xd(t);
            if (!a || !e) return n;
            var o, r, s = [], l = [], d = t.ecModel, u = Vd(d).datasetMap, c = a.uid + "_" + i.seriesLayoutBy;
            D(e = e.slice(), function (t, i) {
                R(t) || (e[i] = {name: t}), "ordinal" === t.type && null == o && (r = g(e[o = i])), n[t.name] = []
            });
            var h = u.get(c) || u.set(c, {categoryWayDim: r, valueWayDim: 0});

            function f(e, t, i) {
                for (var n = 0; n < i; n++) e.push(t + n)
            }

            function g(e) {
                var t = e.dimsDef;
                return t ? t.length : 1
            }

            return D(e, function (e, t) {
                var i = e.name, a = g(e);
                if (null == o) {
                    var r = h.valueWayDim;
                    f(n[i], r, a), f(l, r, a), h.valueWayDim += a
                } else o === t ? (f(n[i], 0, a), f(s, 0, a)) : (r = h.categoryWayDim, f(n[i], r, a), f(l, r, a), h.categoryWayDim += a)
            }), s.length && (n.itemName = s), l.length && (n.seriesName = l), n
        }

        function jd(e, t, i) {
            var n = {};
            if (!Xd(e)) return n;
            var a, o = t.sourceFormat, r = t.dimensionsDefine;
            o !== Od && o !== Md || D(r, function (e, t) {
                "name" === (R(e) ? e.name : e) && (a = t)
            });
            var s = function () {
                for (var e = {}, n = {}, s = [], l = 0, d = Math.min(5, i); l < d; l++) {
                    var u = $d(t.data, o, t.seriesLayoutBy, r, t.startIndex, l);
                    s.push(u);
                    var c = u === Kd.Not;
                    if (c && null == e.v && l !== a && (e.v = l), null != e.n && e.n !== e.v && (c || s[e.n] !== Kd.Not) || (e.n = l), h(e) && s[e.n] !== Kd.Not) return e;
                    c || (u === Kd.Might && null == n.v && l !== a && (n.v = l), null != n.n && n.n !== n.v || (n.n = l))
                }

                function h(e) {
                    return null != e.v && null != e.n
                }

                return h(e) ? e : h(n) ? n : null
            }();
            if (s) {
                n.value = s.v;
                var l = null != a ? a : s.n;
                n.itemName = [l], n.seriesName = [l]
            }
            return n
        }

        function Xd(e) {
            var t = e.option;
            if (!t.data) return e.ecModel.getComponent("dataset", t.datasetIndex || 0)
        }

        function $d(e, t, i, n, a, o) {
            var r, s, l;
            if (U(e)) return Kd.Not;
            if (n) {
                var d = n[o];
                R(d) ? (s = d.name, l = d.type) : L(d) && (s = d)
            }
            if (null != l) return "ordinal" === l ? Kd.Must : Kd.Not;
            if (t === Pd) if (i === Bd) {
                for (var u = e[o], c = 0; c < (u || []).length && c < 5; c++) if (null != (r = p(u[a + c]))) return r
            } else for (c = 0; c < e.length && c < 5; c++) {
                var h = e[a + c];
                if (h && null != (r = p(h[o]))) return r
            } else if (t === Od) {
                if (!s) return Kd.Not;
                for (c = 0; c < e.length && c < 5; c++) if ((f = e[c]) && null != (r = p(f[s]))) return r
            } else if (t === Md) {
                if (!s) return Kd.Not;
                if (!(u = e[s]) || U(u)) return Kd.Not;
                for (c = 0; c < u.length && c < 5; c++) if (null != (r = p(u[c]))) return r
            } else if (t === Ed) for (c = 0; c < e.length && c < 5; c++) {
                var f, g = Fa(f = e[c]);
                if (!M(g)) return Kd.Not;
                if (null != (r = p(g[o]))) return r
            }

            function p(e) {
                var t = L(e);
                return null != e && isFinite(e) && "" !== e ? t ? Kd.Might : Kd.Not : t && "-" !== e ? Kd.Must : void 0
            }

            return Kd.Not
        }

        var Yd = "\0_ec_inner", qd = Sl.extend({
            init: function (e, t, i, n) {
                i = i || {}, this.option = null, this._theme = new Sl(i), this._optionManager = n
            }, setOption: function (e, t) {
                X(!(Yd in e), "please use chart.getOption()"), this._optionManager.setOption(e, t), this.resetOption(null)
            }, resetOption: function (e) {
                var t = !1, i = this._optionManager;
                if (!e || "recreate" === e) {
                    var n = i.mountOption("recreate" === e);
                    this.option && "recreate" !== e ? (this.restoreData(), this.mergeOption(n)) : function (e) {
                        e = e, this.option = {}, this.option[Yd] = 1, this._componentsMap = Q({series: []}), this._seriesIndices, this._seriesIndicesMap, function (e, t) {
                            var i = e.color && !e.colorLayer;
                            D(t, function (t, n) {
                                "colorLayer" === n && i || bd.hasClass(n) || ("object" == typeof t ? e[n] = e[n] ? m(e[n], t, !1) : v(t) : null == e[n] && (e[n] = t))
                            })
                        }(e, this._theme.option), m(e, Ad, !1), this.mergeOption(e)
                    }.call(this, n), t = !0
                }
                if ("timeline" !== e && "media" !== e || this.restoreData(), !e || "recreate" === e || "timeline" === e) {
                    var a = i.getTimelineOption(this);
                    a && (this.mergeOption(a), t = !0)
                }
                if (!e || "recreate" === e || "media" === e) {
                    var o = i.getMediaOption(this, this._api);
                    o.length && D(o, function (e) {
                        this.mergeOption(e, t = !0)
                    }, this)
                }
                return t
            }, mergeOption: function (e) {
                var t = this.option, i = this._componentsMap, n = [];
                Vd(this).datasetMap = Q(), D(e, function (e, i) {
                    null != e && (bd.hasClass(i) ? i && n.push(i) : t[i] = null == t[i] ? v(e) : m(t[i], e, !0))
                }), bd.topologicalTravel(n, bd.getAllClassMainTypes(), function (n, a) {
                    var o = Pa(e[n]), r = La(i.get(n), o);
                    Ra(r), D(r, function (e, t) {
                        var i = e.option;
                        R(i) && (e.keyInfo.mainType = n, e.keyInfo.subType = function (e, t, i) {
                            return t.type ? t.type : i ? i.subType : bd.determineSubType(e, t)
                        }(n, i, e.exist))
                    });
                    var s = function (e, t) {
                        M(t) || (t = t ? [t] : []);
                        var i = {};
                        return D(t, function (t) {
                            i[t] = (e.get(t) || []).slice()
                        }), i
                    }(i, a);
                    t[n] = [], i.set(n, []), D(r, function (e, a) {
                        var o = e.exist, r = e.option;
                        if (X(R(r) || o, "Empty component definition"), r) {
                            var l = bd.getClass(n, e.keyInfo.subType, !0);
                            if (o && o.constructor === l) o.name = e.keyInfo.name, o.mergeOption(r, this), o.optionUpdated(r, !1); else {
                                var d = k({dependentModels: s, componentIndex: a}, e.keyInfo);
                                k(o = new l(r, this, this, d), d), o.init(r, this, this, d), o.optionUpdated(null, !0)
                            }
                        } else o.mergeOption({}, this), o.optionUpdated({}, !1);
                        i.get(n)[a] = o, t[n][a] = o.option
                    }, this), "series" === n && Jd(this, i.get("series"))
                }, this), this._seriesIndicesMap = Q(this._seriesIndices = this._seriesIndices || [])
            }, getOption: function () {
                var e = v(this.option);
                return D(e, function (t, i) {
                    if (bd.hasClass(i)) {
                        for (var n = (t = Pa(t)).length - 1; 0 <= n; n--) Ua(t[n]) && t.splice(n, 1);
                        e[i] = t
                    }
                }), delete e[Yd], e
            }, getTheme: function () {
                return this._theme
            }, getComponent: function (e, t) {
                var i = this._componentsMap.get(e);
                if (i) return i[t || 0]
            }, queryComponents: function (e) {
                var t = e.mainType;
                if (!t) return [];
                var i, n = e.index, a = e.id, o = e.name, r = this._componentsMap.get(t);
                if (!r || !r.length) return [];
                if (null != n) M(n) || (n = [n]), i = x(A(n, function (e) {
                    return r[e]
                }), function (e) {
                    return !!e
                }); else if (null != a) {
                    var s = M(a);
                    i = x(r, function (e) {
                        return s && 0 <= S(a, e.id) || !s && e.id === a
                    })
                } else if (null != o) {
                    var l = M(o);
                    i = x(r, function (e) {
                        return l && 0 <= S(o, e.name) || !l && e.name === o
                    })
                } else i = r.slice();
                return Zd(i, e)
            }, findComponents: function (e) {
                var t, i, n, a, o, r = e.query, s = e.mainType,
                    l = (i = s + "Index", n = s + "Id", a = s + "Name", !(t = r) || null == t[i] && null == t[n] && null == t[a] ? null : {
                        mainType: s,
                        index: t[i],
                        id: t[n],
                        name: t[a]
                    }), d = l ? this.queryComponents(l) : this._componentsMap.get(s);
                return o = Zd(d, e), e.filter ? x(o, e.filter) : o
            }, eachComponent: function (e, t, i) {
                var n = this._componentsMap;
                "function" == typeof e ? (i = t, t = e, n.each(function (e, n) {
                    D(e, function (e, a) {
                        t.call(i, n, e, a)
                    })
                })) : L(e) ? D(n.get(e), t, i) : R(e) && D(this.findComponents(e), t, i)
            }, getSeriesByName: function (e) {
                return x(this._componentsMap.get("series"), function (t) {
                    return t.name === e
                })
            }, getSeriesByIndex: function (e) {
                return this._componentsMap.get("series")[e]
            }, getSeriesByType: function (e) {
                return x(this._componentsMap.get("series"), function (t) {
                    return t.subType === e
                })
            }, getSeries: function () {
                return this._componentsMap.get("series").slice()
            }, getSeriesCount: function () {
                return this._componentsMap.get("series").length
            }, eachSeries: function (e, t) {
                D(this._seriesIndices, function (i) {
                    var n = this._componentsMap.get("series")[i];
                    e.call(t, n, i)
                }, this)
            }, eachRawSeries: function (e, t) {
                D(this._componentsMap.get("series"), e, t)
            }, eachSeriesByType: function (e, t, i) {
                D(this._seriesIndices, function (n) {
                    var a = this._componentsMap.get("series")[n];
                    a.subType === e && t.call(i, a, n)
                }, this)
            }, eachRawSeriesByType: function (e, t, i) {
                return D(this.getSeriesByType(e), t, i)
            }, isSeriesFiltered: function (e) {
                return null == this._seriesIndicesMap.get(e.componentIndex)
            }, getCurrentSeriesIndices: function () {
                return (this._seriesIndices || []).slice()
            }, filterSeries: function (e, t) {
                var i = x(this._componentsMap.get("series"), e, t);
                Jd(this, i)
            }, restoreData: function (e) {
                var t = this._componentsMap;
                Jd(this, t.get("series"));
                var i = [];
                t.each(function (e, t) {
                    i.push(t)
                }), bd.topologicalTravel(i, bd.getAllClassMainTypes(), function (i, n) {
                    D(t.get(i), function (t) {
                        "series" === i && function (e, t) {
                            if (t) {
                                var i = t.seiresIndex, n = t.seriesId, a = t.seriesName;
                                return null != i && e.componentIndex !== i || null != n && e.id !== n || null != a && e.name !== a
                            }
                        }(t, e) || t.restoreData()
                    })
                })
            }
        });

        function Jd(e, t) {
            e._seriesIndicesMap = Q(e._seriesIndices = A(t, function (e) {
                return e.componentIndex
            }) || [])
        }

        function Zd(e, t) {
            return t.hasOwnProperty("subType") ? x(e, function (e) {
                return e.subType === t.subType
            }) : e
        }

        b(qd, xd);
        var Qd = ["getDom", "getZr", "getWidth", "getHeight", "getDevicePixelRatio", "dispatchAction", "isDisposed", "on", "off", "getDataURL", "getConnectedDataURL", "getModel", "getOption", "getViewOfComponentModel", "getViewOfSeriesModel"];

        function eu(e) {
            D(Qd, function (t) {
                this[t] = P(e[t], e)
            }, this)
        }

        var tu = {};

        function iu() {
            this._coordinateSystems = []
        }

        iu.prototype = {
            constructor: iu, create: function (e, t) {
                var i = [];
                D(tu, function (n, a) {
                    var o = n.create(e, t);
                    i = i.concat(o || [])
                }), this._coordinateSystems = i
            }, update: function (e, t) {
                D(this._coordinateSystems, function (i) {
                    i.update && i.update(e, t)
                })
            }, getCoordinateSystems: function () {
                return this._coordinateSystems.slice()
            }
        }, iu.register = function (e, t) {
            tu[e] = t
        }, iu.get = function (e) {
            return tu[e]
        };
        var nu = D, au = v, ou = A, ru = m, su = /^(min|max)?(.+)$/;

        function lu(e) {
            this._api = e, this._timelineOptions = [], this._mediaList = [], this._mediaDefault, this._currentMediaIndices = [], this._optionBackup, this._newBaseOption
        }

        function du(e, t, i) {
            var n = {width: t, height: i, aspectratio: t / i}, a = !0;
            return D(e, function (e, t) {
                var i = t.match(su);
                if (i && i[1] && i[2]) {
                    i[1];
                    var o = i[2].toLowerCase();
                    !function (e, t, i) {
                        return e === t
                    }(n[o], e) && (a = !1)
                }
            }), a
        }

        lu.prototype = {
            constructor: lu, setOption: function (e, t) {
                e && D(Pa(e.series), function (e) {
                    e && e.data && U(e.data) && q(e.data)
                }), e = au(e);
                var i = this._optionBackup, n = function (e, t, i) {
                    var n, a, o = [], r = [], s = e.timeline;
                    if (e.baseOption && (a = e.baseOption), (s || e.options) && (a = a || {}, o = (e.options || []).slice()), e.media) {
                        a = a || {};
                        var l = e.media;
                        nu(l, function (e) {
                            e && e.option && (e.query ? r.push(e) : n = n || e)
                        })
                    }
                    return (a = a || e).timeline || (a.timeline = s), nu([a].concat(o).concat(A(r, function (e) {
                        return e.option
                    })), function (e) {
                        nu(t, function (t) {
                            t(e, i)
                        })
                    }), {baseOption: a, timelineOptions: o, mediaDefault: n, mediaList: r}
                }.call(this, e, t, !i);
                this._newBaseOption = n.baseOption, i ? (function (e, t) {
                    nu(t = t || {}, function (t, i) {
                        if (null != t) {
                            var n = e[i];
                            if (bd.hasClass(i)) {
                                t = Pa(t);
                                var a = La(n = Pa(n), t);
                                e[i] = ou(a, function (e) {
                                    return e.option && e.exist ? ru(e.exist, e.option, !0) : e.exist || e.option
                                })
                            } else e[i] = ru(n, t, !0)
                        }
                    })
                }(i.baseOption, n.baseOption), n.timelineOptions.length && (i.timelineOptions = n.timelineOptions), n.mediaList.length && (i.mediaList = n.mediaList), n.mediaDefault && (i.mediaDefault = n.mediaDefault)) : this._optionBackup = n
            }, mountOption: function (e) {
                var t = this._optionBackup;
                return this._timelineOptions = ou(t.timelineOptions, au), this._mediaList = ou(t.mediaList, au), this._mediaDefault = au(t.mediaDefault), this._currentMediaIndices = [], au(e ? t.baseOption : this._newBaseOption)
            }, getTimelineOption: function (e) {
                var t, i = this._timelineOptions;
                if (i.length) {
                    var n = e.getComponent("timeline");
                    n && (t = au(i[n.getCurrentIndex()], !0))
                }
                return t
            }, getMediaOption: function (e) {
                var t = this._api.getWidth(), i = this._api.getHeight(), n = this._mediaList, a = this._mediaDefault,
                    o = [], r = [];
                if (!n.length && !a) return r;
                for (var s = 0, l = n.length; s < l; s++) du(n[s].query, t, i) && o.push(s);
                return !o.length && a && (o = [-1]), o.length && !function (e, t) {
                    return e.join(",") === t.join(",")
                }(o, this._currentMediaIndices) && (r = ou(o, function (e) {
                    return au(-1 === e ? a.option : n[e].option)
                })), this._currentMediaIndices = o, r
            }
        };
        var uu = D, cu = R,
            hu = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];

        function fu(e) {
            var t = e && e.itemStyle;
            if (t) for (var i = 0, n = hu.length; i < n; i++) {
                var a = hu[i], o = t.normal, r = t.emphasis;
                o && o[a] && (e[a] = e[a] || {}, e[a].normal ? m(e[a].normal, o[a]) : e[a].normal = o[a], o[a] = null), r && r[a] && (e[a] = e[a] || {}, e[a].emphasis ? m(e[a].emphasis, r[a]) : e[a].emphasis = r[a], r[a] = null)
            }
        }

        function gu(e, t, i) {
            if (e && e[t] && (e[t].normal || e[t].emphasis)) {
                var n = e[t].normal, a = e[t].emphasis;
                n && (i ? (e[t].normal = e[t].emphasis = null, T(e[t], n)) : e[t] = n), a && (e.emphasis = e.emphasis || {}, e.emphasis[t] = a)
            }
        }

        function pu(e) {
            gu(e, "itemStyle"), gu(e, "lineStyle"), gu(e, "areaStyle"), gu(e, "label"), gu(e, "labelLine"), gu(e, "upperLabel"), gu(e, "edgeLabel")
        }

        function vu(e, t) {
            var i = cu(e) && e[t], n = cu(i) && i.textStyle;
            if (n) for (var a = 0, o = Ma.length; a < o; a++) t = Ma[a], n.hasOwnProperty(t) && (i[t] = n[t])
        }

        function mu(e) {
            e && (pu(e), vu(e, "label"), e.emphasis && vu(e.emphasis, "label"))
        }

        function yu(e) {
            return M(e) ? e : e ? [e] : []
        }

        function ku(e) {
            return (M(e) ? e[0] : e) || {}
        }

        function Tu(e) {
            D(wu, function (t) {
                t[0] in e && !(t[1] in e) && (e[t[1]] = e[t[0]])
            })
        }

        var wu = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]],
            Cu = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"],
            Su = function (e, t) {
                (function (e, t) {
                    uu(yu(e.series), function (e) {
                        cu(e) && function (e) {
                            if (cu(e)) {
                                fu(e), pu(e), vu(e, "label"), vu(e, "upperLabel"), vu(e, "edgeLabel"), e.emphasis && (vu(e.emphasis, "label"), vu(e.emphasis, "upperLabel"), vu(e.emphasis, "edgeLabel")), (i = e.markPoint) && (fu(i), mu(i)), (n = e.markLine) && (fu(n), mu(n));
                                var t = e.markArea;
                                t && mu(t);
                                var i, n, a = e.data;
                                if ("graph" === e.type) {
                                    a = a || e.nodes;
                                    var o = e.links || e.edges;
                                    if (o && !U(o)) for (var r = 0; r < o.length; r++) mu(o[r]);
                                    D(e.categories, function (e) {
                                        pu(e)
                                    })
                                }
                                if (a && !U(a)) for (r = 0; r < a.length; r++) mu(a[r]);
                                if ((i = e.markPoint) && i.data) {
                                    var s = i.data;
                                    for (r = 0; r < s.length; r++) mu(s[r])
                                }
                                if ((n = e.markLine) && n.data) {
                                    var l = n.data;
                                    for (r = 0; r < l.length; r++) M(l[r]) ? (mu(l[r][0]), mu(l[r][1])) : mu(l[r])
                                }
                                "gauge" === e.type ? (vu(e, "axisLabel"), vu(e, "title"), vu(e, "detail")) : "treemap" === e.type ? (gu(e.breadcrumb, "itemStyle"), D(e.levels, function (e) {
                                    pu(e)
                                })) : "tree" === e.type && pu(e.leaves)
                            }
                        }(e)
                    });
                    var i = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
                    t && i.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"), uu(i, function (t) {
                        uu(yu(e[t]), function (e) {
                            e && (vu(e, "axisLabel"), vu(e.axisPointer, "label"))
                        })
                    }), uu(yu(e.parallel), function (e) {
                        var t = e && e.parallelAxisDefault;
                        vu(t, "axisLabel"), vu(t && t.axisPointer, "label")
                    }), uu(yu(e.calendar), function (e) {
                        gu(e, "itemStyle"), vu(e, "dayLabel"), vu(e, "monthLabel"), vu(e, "yearLabel")
                    }), uu(yu(e.radar), function (e) {
                        vu(e, "name")
                    }), uu(yu(e.geo), function (e) {
                        cu(e) && (mu(e), uu(yu(e.regions), function (e) {
                            mu(e)
                        }))
                    }), uu(yu(e.timeline), function (e) {
                        mu(e), gu(e, "label"), gu(e, "itemStyle"), gu(e, "controlStyle", !0);
                        var t = e.data;
                        M(t) && D(t, function (e) {
                            R(e) && (gu(e, "label"), gu(e, "itemStyle"))
                        })
                    }), uu(yu(e.toolbox), function (e) {
                        gu(e, "iconStyle"), uu(e.feature, function (e) {
                            gu(e, "iconStyle")
                        })
                    }), vu(ku(e.axisPointer), "label"), vu(ku(e.tooltip).axisPointer, "label")
                })(e, t), e.series = Pa(e.series), D(e.series, function (e) {
                    if (R(e)) {
                        var t = e.type;
                        if ("line" === t) null != e.clipOverflow && (e.clip = e.clipOverflow); else if ("pie" === t || "gauge" === t) null != e.clockWise && (e.clockwise = e.clockWise); else if ("gauge" === t) {
                            var i = function (e, t) {
                                t = t.split(",");
                                for (var i = e, n = 0; n < t.length && null != (i = i && i[t[n]]); n++) ;
                                return i
                            }(e, "pointer.color");
                            null != i && function (e, t, i, n) {
                                t = t.split(",");
                                for (var a, o = e, r = 0; r < t.length - 1; r++) null == o[a = t[r]] && (o[a] = {}), o = o[a];
                                null != o[t[r]] || (o[t[r]] = i)
                            }(e, "itemStyle.color", i)
                        }
                        Tu(e)
                    }
                }), e.dataRange && (e.visualMap = e.dataRange), D(Cu, function (t) {
                    var i = e[t];
                    i && (M(i) || (i = [i]), D(i, function (e) {
                        Tu(e)
                    }))
                })
            };

        function Iu(e) {
            D(e, function (t, i) {
                var n = [], a = [NaN, NaN], o = [t.stackResultDimension, t.stackedOverDimension], r = t.data,
                    s = t.isStackedByIndex, l = r.map(o, function (o, l, d) {
                        var u, c, h = r.get(t.stackedDimension, d);
                        if (isNaN(h)) return a;
                        s ? c = r.getRawIndex(d) : u = r.get(t.stackedByDimension, d);
                        for (var f = NaN, g = i - 1; 0 <= g; g--) {
                            var p = e[g];
                            if (s || (c = p.data.rawIndexOf(p.stackedByDimension, u)), 0 <= c) {
                                var v = p.data.getByRawIndex(p.stackResultDimension, c);
                                if (0 <= h && 0 < v || h <= 0 && v < 0) {
                                    h += v, f = v;
                                    break
                                }
                            }
                        }
                        return n[0] = h, n[1] = f, n
                    });
                r.hostModel.setData(l), t.data = l
            })
        }

        function bu(e, t) {
            Ud.isInstance(e) || (e = Ud.seriesDataToSource(e)), this._source = e;
            var i = this._data = e.data, n = e.sourceFormat;
            n === Ld && (this._offset = 0, this._dimSize = t, this._data = i), k(this, Du[n === Pd ? n + "_" + e.seriesLayoutBy : n])
        }

        var _u = bu.prototype;
        _u.pure = !1;
        var Du = {
            arrayRows_column: {
                pure: _u.persistent = !0, count: function () {
                    return Math.max(0, this._data.length - this._source.startIndex)
                }, getItem: function (e) {
                    return this._data[e + this._source.startIndex]
                }, appendData: xu
            },
            arrayRows_row: {
                pure: !0, count: function () {
                    var e = this._data[0];
                    return e ? Math.max(0, e.length - this._source.startIndex) : 0
                }, getItem: function (e) {
                    e += this._source.startIndex;
                    for (var t = [], i = this._data, n = 0; n < i.length; n++) {
                        var a = i[n];
                        t.push(a ? a[e] : null)
                    }
                    return t
                }, appendData: function () {
                    throw new Error('Do not support appendData when set seriesLayoutBy: "row".')
                }
            },
            objectRows: {pure: !0, count: Au, getItem: Nu, appendData: xu},
            keyedColumns: {
                pure: !0, count: function () {
                    var e = this._source.dimensionsDefine[0].name, t = this._data[e];
                    return t ? t.length : 0
                }, getItem: function (e) {
                    for (var t = [], i = this._source.dimensionsDefine, n = 0; n < i.length; n++) {
                        var a = this._data[i[n].name];
                        t.push(a ? a[e] : null)
                    }
                    return t
                }, appendData: function (e) {
                    var t = this._data;
                    D(e, function (e, i) {
                        for (var n = t[i] || (t[i] = []), a = 0; a < (e || []).length; a++) n.push(e[a])
                    })
                }
            },
            original: {count: Au, getItem: Nu, appendData: xu},
            typedArray: {
                persistent: !(_u.getSource = function () {
                    return this._source
                }), pure: !0, count: function () {
                    return this._data ? this._data.length / this._dimSize : 0
                }, getItem: function (e, t) {
                    e -= this._offset, t = t || [];
                    for (var i = this._dimSize * e, n = 0; n < this._dimSize; n++) t[n] = this._data[i + n];
                    return t
                }, appendData: function (e) {
                    this._data = e
                }, clean: function () {
                    this._offset += this.count(), this._data = null
                }
            }
        };

        function Au() {
            return this._data.length
        }

        function Nu(e) {
            return this._data[e]
        }

        function xu(e) {
            for (var t = 0; t < e.length; t++) this._data.push(e[t])
        }

        var Eu = {
            arrayRows: Pu, objectRows: function (e, t, i, n) {
                return null != i ? e[n] : e
            }, keyedColumns: Pu, original: function (e, t, i, n) {
                var a = Fa(e);
                return null != i && a instanceof Array ? a[i] : a
            }, typedArray: Pu
        };

        function Pu(e, t, i, n) {
            return null != i ? e[i] : e
        }

        var Ou = {
            arrayRows: Mu, objectRows: function (e, t, i, n) {
                return Fu(e[t], this._dimensionInfos[t])
            }, keyedColumns: Mu, original: function (e, t, i, n) {
                var a = e && (null == e.value ? e : e.value);
                return !this._rawData.pure && function (e) {
                    return Na(e) && !(e instanceof Array)
                }(e) && (this.hasItemOption = !0), Fu(a instanceof Array ? a[n] : a, this._dimensionInfos[t])
            }, typedArray: function (e, t, i, n) {
                return e[n]
            }
        };

        function Mu(e, t, i, n) {
            return Fu(e[n], this._dimensionInfos[t])
        }

        function Fu(e, t) {
            var i = t && t.type;
            if ("ordinal" !== i) return "time" === i && "number" != typeof e && null != e && "-" !== e && (e = +Vl(e)), null == e || "" === e ? NaN : +e;
            var n = t && t.ordinalMeta;
            return n ? n.parseAndCollect(e) : e
        }

        function Lu(e, t, i) {
            if (e) {
                var n = e.getRawDataItem(t);
                if (null != n) {
                    var a, o, r = e.getProvider().getSource().sourceFormat, s = e.getDimensionInfo(i);
                    return s && (a = s.name, o = s.index), Eu[r](n, t, o, a)
                }
            }
        }

        function Ru(e, t, i) {
            if (e) {
                var n = e.getProvider().getSource().sourceFormat;
                if (n === Ed || n === Od) {
                    var a = e.getRawDataItem(t);
                    return n !== Ed || R(a) || (a = null), a ? a[i] : void 0
                }
            }
        }

        var Bu = /\{@(.+?)\}/g, Uu = {
            getDataParams: function (e, t) {
                var i = this.getData(t), n = this.getRawValue(e, t), a = i.getRawIndex(e), o = i.getName(e),
                    r = i.getRawDataItem(e), s = i.getItemVisual(e, "color"), l = i.getItemVisual(e, "borderColor"),
                    d = this.ecModel.getComponent("tooltip"), u = ja(d && d.get("renderMode")), c = this.mainType,
                    h = "series" === c, f = i.userOutput;
                return {
                    componentType: c,
                    componentSubType: this.subType,
                    componentIndex: this.componentIndex,
                    seriesType: h ? this.subType : null,
                    seriesIndex: this.seriesIndex,
                    seriesId: h ? this.id : null,
                    seriesName: h ? this.name : null,
                    name: o,
                    dataIndex: a,
                    data: r,
                    dataType: t,
                    value: n,
                    color: s,
                    borderColor: l,
                    dimensionNames: f ? f.dimensionNames : null,
                    encode: f ? f.encode : null,
                    marker: ad({color: s, renderMode: u}),
                    $vars: ["seriesName", "name", "value"]
                }
            }, getFormattedLabel: function (e, t, i, n, a) {
                t = t || "normal";
                var o = this.getData(i), r = o.getItemModel(e), s = this.getDataParams(e, i);
                null != n && s.value instanceof Array && (s.value = s.value[n]);
                var l = r.get("normal" === t ? [a || "label", "formatter"] : [t, a || "label", "formatter"]);
                return "function" == typeof l ? (s.status = t, s.dimensionIndex = n, l(s)) : "string" == typeof l ? id(l, s).replace(Bu, function (t, i) {
                    var n = i.length;
                    return "[" === i.charAt(0) && "]" === i.charAt(n - 1) && (i = +i.slice(1, n - 1)), Lu(o, e, i)
                }) : void 0
            }, getRawValue: function (e, t) {
                return Lu(this.getData(t), e)
            }, formatTooltip: function () {
            }
        };

        function Ku(e) {
            return new Vu(e)
        }

        function Vu(e) {
            e = e || {}, this._reset = e.reset, this._plan = e.plan, this._count = e.count, this._onDirty = e.onDirty, this._dirty = !0, this.context
        }

        var Wu = Vu.prototype;
        Wu.perform = function (e) {
            var t, i = this._upstream, n = e && e.skip;
            if (this._dirty && i) {
                var a = this.context;
                a.data = a.outputData = i.context.outputData
            }
            this.__pipeline && (this.__pipeline.currentTask = this), this._plan && !n && (t = this._plan(this.context));
            var o, r = u(this._modBy), s = this._modDataCount || 0, l = u(e && e.modBy), d = e && e.modDataCount || 0;

            function u(e) {
                return 1 <= e || (e = 1), e
            }

            r === l && s === d || (t = "reset"), !this._dirty && "reset" !== t || (this._dirty = !1, o = function (e, t) {
                var i, n;
                e._dueIndex = e._outputDueEnd = e._dueEnd = 0, e._settedOutputEnd = null, !t && e._reset && ((i = e._reset(e.context)) && i.progress && (n = i.forceFirstProgress, i = i.progress), M(i) && !i.length && (i = null)), e._progress = i, e._modBy = e._modDataCount = null;
                var a = e._downstream;
                return a && a.dirty(), n
            }(this, n)), this._modBy = l, this._modDataCount = d;
            var c = e && e.step;
            if (this._dueEnd = i ? i._outputDueEnd : this._count ? this._count(this.context) : 1 / 0, this._progress) {
                var h = this._dueIndex, f = Math.min(null != c ? this._dueIndex + c : 1 / 0, this._dueEnd);
                if (!n && (o || h < f)) {
                    var g = this._progress;
                    if (M(g)) for (var p = 0; p < g.length; p++) Zu(this, g[p], h, f, l, d); else Zu(this, g, h, f, l, d)
                }
                this._dueIndex = f;
                var v = null != this._settedOutputEnd ? this._settedOutputEnd : f;
                this._outputDueEnd = v
            } else this._dueIndex = this._outputDueEnd = null != this._settedOutputEnd ? this._settedOutputEnd : this._dueEnd;
            return this.unfinished()
        };
        var Gu, Hu, zu, ju, Xu, $u, Yu = $u = {
            reset: function (e, t, i, n) {
                Hu = e, Gu = t, zu = i, ju = n, Xu = Math.ceil(ju / zu), $u.next = 1 < zu && 0 < ju ? Ju : qu
            }
        };

        function qu() {
            return Hu < Gu ? Hu++ : null
        }

        function Ju() {
            var e = Hu % Xu * zu + Math.ceil(Hu / Xu), t = Gu <= Hu ? null : e < ju ? e : Hu;
            return Hu++, t
        }

        function Zu(e, t, i, n, a, o) {
            Yu.reset(i, n, a, o), e._callingProgress = t, e._callingProgress({
                start: i,
                end: n,
                count: n - i,
                next: Yu.next
            }, e.context)
        }

        Wu.dirty = function () {
            this._dirty = !0, this._onDirty && this._onDirty(this.context)
        }, Wu.unfinished = function () {
            return this._progress && this._dueIndex < this._dueEnd
        }, Wu.pipe = function (e) {
            this._downstream === e && !this._dirty || ((this._downstream = e)._upstream = this, e.dirty())
        }, Wu.dispose = function () {
            this._disposed || (this._upstream && (this._upstream._downstream = null), this._downstream && (this._downstream._upstream = null), this._dirty = !1, this._disposed = !0)
        }, Wu.getUpstream = function () {
            return this._upstream
        }, Wu.getDownstream = function () {
            return this._downstream
        }, Wu.setOutputEnd = function (e) {
            this._outputDueEnd = this._settedOutputEnd = e
        };
        var Qu = Va(), ec = bd.extend({
            type: "series.__base__",
            seriesIndex: 0,
            coordinateSystem: null,
            defaultOption: null,
            legendVisualProvider: null,
            visualColorAccessPath: "itemStyle.color",
            visualBorderColorAccessPath: "itemStyle.borderColor",
            layoutMode: null,
            init: function (e, t, i, n) {
                this.seriesIndex = this.componentIndex, this.dataTask = Ku({
                    count: ic,
                    reset: nc
                }), this.dataTask.context = {model: this}, this.mergeDefaultAndTheme(e, i), Wd(this);
                var a = this.getInitialData(e, i);
                oc(a, this), this.dataTask.context.data = a, Qu(this).dataBeforeProcessed = a, tc(this)
            },
            mergeDefaultAndTheme: function (e, t) {
                var i = this.layoutMode, n = i ? kd(e) : {}, a = this.subType;
                bd.hasClass(a) && (a += "Series"), m(e, t.getTheme().get(this.subType)), m(e, this.getDefaultOption()), Oa(e, "label", ["show"]), this.fillDataTextStyle(e.data), i && yd(e, n, i)
            },
            mergeOption: function (e, t) {
                e = m(this.option, e, !0), this.fillDataTextStyle(e.data);
                var i = this.layoutMode;
                i && yd(this.option, e, i), Wd(this);
                var n = this.getInitialData(e, t);
                oc(n, this), this.dataTask.dirty(), this.dataTask.context.data = n, Qu(this).dataBeforeProcessed = n, tc(this)
            },
            fillDataTextStyle: function (e) {
                if (e && !U(e)) for (var t = ["show"], i = 0; i < e.length; i++) e[i] && e[i].label && Oa(e[i], "label", t)
            },
            getInitialData: function () {
            },
            appendData: function (e) {
                this.getRawData().appendData(e.data)
            },
            getData: function (e) {
                var t = sc(this);
                if (t) {
                    var i = t.context.data;
                    return null == e ? i : i.getLinkedData(e)
                }
                return Qu(this).data
            },
            setData: function (e) {
                var t = sc(this);
                if (t) {
                    var i = t.context;
                    i.data !== e && t.modifyOutputEnd && t.setOutputEnd(e.count()), i.outputData = e, t !== this.dataTask && (i.data = e)
                }
                Qu(this).data = e
            },
            getSource: function () {
                return Vd(this).source
            },
            getRawData: function () {
                return Qu(this).dataBeforeProcessed
            },
            getBaseAxis: function () {
                var e = this.coordinateSystem;
                return e && e.getBaseAxis && e.getBaseAxis()
            },
            formatTooltip: function (e, t, i, n) {
                var a = this, o = "html" === (n = n || "html") ? "<br/>" : "\n", r = "richText" === n, s = {}, l = 0,
                    d = this.getData(), u = d.mapDimension("defaultedTooltip", !0), c = u.length,
                    h = this.getRawValue(e), f = M(h), g = d.getItemVisual(e, "color");
                R(g) && g.colorStops && (g = (g.colorStops[0] || {}).color), g = g || "transparent";
                var p = (1 < c || f && !c ? function (i) {
                        var o = N(i, function (e, t, i) {
                            var n = d.getDimensionInfo(i);
                            return e | (n && !1 !== n.tooltip && null != n.displayName)
                        }, 0), c = [];

                        function h(e, i) {
                            var u = d.getDimensionInfo(i);
                            if (u && !1 !== u.otherDims.tooltip) {
                                var h = u.type, f = "sub" + a.seriesIndex + "at" + l,
                                    p = ad({color: g, type: "subItem", renderMode: n, markerId: f}),
                                    v = "string" == typeof p ? p : p.content,
                                    m = (o ? v + Ql(u.displayName || "-") + ": " : "") + Ql("ordinal" === h ? e + "" : "time" === h ? t ? "" : rd("yyyy/MM/dd hh:mm:ss", e) : $l(e));
                                m && c.push(m), r && (s[f] = g, ++l)
                            }
                        }

                        u.length ? D(u, function (t) {
                            h(Lu(d, e, t), t)
                        }) : D(i, h);
                        var f = o ? r ? "\n" : "<br/>" : "", p = f + c.join(f || ", ");
                        return {renderMode: n, content: p, style: s}
                    }(h) : function (e) {
                        return {renderMode: n, content: Ql($l(e)), style: s}
                    }(c ? Lu(d, e, u[0]) : f ? h[0] : h)).content, v = a.seriesIndex + "at" + l,
                    m = ad({color: g, type: "item", renderMode: n, markerId: v});
                s[v] = g, ++l;
                var y = d.getName(e), k = this.name;
                Ba(this) || (k = ""), k = k ? Ql(k) + (t ? ": " : o) : "";
                var T = "string" == typeof m ? m : m.content;
                return {html: t ? T + k + p : k + T + (y ? Ql(y) + ": " + p : p), markers: s}
            },
            isAnimationEnabled: function () {
                if (a.node) return !1;
                var e = this.getShallow("animation");
                return e && this.getData().count() > this.getShallow("animationThreshold") && (e = !1), e
            },
            restoreData: function () {
                this.dataTask.dirty()
            },
            getColorFromPalette: function (e, t, i) {
                var n = this.ecModel, a = xd.getColorFromPalette.call(this, e, t, i);
                return a = a || n.getColorFromPalette(e, t, i)
            },
            coordDimToDataDim: function (e) {
                return this.getRawData().mapDimension(e, !0)
            },
            getProgressive: function () {
                return this.get("progressive")
            },
            getProgressiveThreshold: function () {
                return this.get("progressiveThreshold")
            },
            getAxisTooltipData: null,
            getTooltipPosition: null,
            pipeTask: null,
            preventIncremental: null,
            pipelineContext: null
        });

        function tc(e) {
            var t = e.name;
            Ba(e) || (e.name = function (e) {
                var t = e.getRawData(), i = t.mapDimension("seriesName", !0), n = [];
                return D(i, function (e) {
                    var i = t.getDimensionInfo(e);
                    i.displayName && n.push(i.displayName)
                }), n.join(" ")
            }(e) || t)
        }

        function ic(e) {
            return e.model.getRawData().count()
        }

        function nc(e) {
            var t = e.model;
            return t.setData(t.getRawData().cloneShallow()), ac
        }

        function ac(e, t) {
            t.outputData && e.end > t.outputData.count() && t.model.getRawData().cloneShallow(t.outputData)
        }

        function oc(e, t) {
            D(e.CHANGABLE_METHODS, function (i) {
                e.wrapMethod(i, O(rc, t))
            })
        }

        function rc(e) {
            var t = sc(e);
            t && t.setOutputEnd(this.count())
        }

        function sc(e) {
            var t = (e.ecModel || {}).scheduler, i = t && t.getPipeline(e.uid);
            if (i) {
                var n = i.currentTask;
                if (n) {
                    var a = n.agentStubMap;
                    a && (n = a.get(e.uid))
                }
                return n
            }
        }

        b(ec, Uu), b(ec, xd);
        var lc = function () {
            this.group = new Ai, this.uid = Dl("viewComponent")
        };
        lc.prototype = {
            constructor: lc, init: function (e, t) {
            }, render: function (e, t, i, n) {
            }, dispose: function () {
            }, filterForExposedEvent: null
        };
        var dc = lc.prototype;

        function uc() {
            var e = Va();
            return function (t) {
                var i = e(t), n = t.pipelineContext, a = i.large, o = i.progressiveRender, r = i.large = n && n.large,
                    s = i.progressiveRender = n && n.progressiveRender;
                return !!(a ^ r || o ^ s) && "reset"
            }
        }

        dc.updateView = dc.updateLayout = dc.updateVisual = function (e, t, i, n) {
        }, Ja(lc), io(lc, {registerWhenExtend: !0});
        var cc = Va(), hc = uc();

        function fc() {
            this.group = new Ai, this.uid = Dl("viewChart"), this.renderTask = Ku({
                plan: mc,
                reset: yc
            }), this.renderTask.context = {view: this}
        }

        var gc = fc.prototype = {
            type: "chart",
            init: function (e, t) {
            },
            render: function (e, t, i, n) {
            },
            highlight: function (e, t, i, n) {
                vc(e.getData(), n, "emphasis")
            },
            downplay: function (e, t, i, n) {
                vc(e.getData(), n, "normal")
            },
            remove: function (e, t) {
                this.group.removeAll()
            },
            dispose: function () {
            },
            incrementalPrepareRender: null,
            incrementalRender: null,
            updateTransform: null,
            filterForExposedEvent: null
        };

        function pc(e, t, i) {
            if (e && (e.trigger(t, i), e.isGroup && !Xs(e))) for (var n = 0, a = e.childCount(); n < a; n++) pc(e.childAt(n), t, i)
        }

        function vc(e, t, i) {
            var n = Ka(e, t), a = t && null != t.highlightKey ? $s(t.highlightKey) : null;
            null != n ? D(Pa(n), function (t) {
                pc(e.getItemGraphicEl(t), i, a)
            }) : e.eachItemGraphicEl(function (e) {
                pc(e, i, a)
            })
        }

        function mc(e) {
            return hc(e.model)
        }

        function yc(e) {
            var t = e.model, i = e.ecModel, n = e.api, a = e.payload, o = t.pipelineContext.progressiveRender,
                r = e.view, s = a && cc(a).updateMethod, l = o ? "incrementalPrepareRender" : s && r[s] ? s : "render";
            return "render" !== l && r[l](t, i, n, a), kc[l]
        }

        gc.updateView = gc.updateLayout = gc.updateVisual = function (e, t, i, n) {
            this.render(e, t, i, n)
        }, Ja(fc), io(fc, {registerWhenExtend: !0}), fc.markUpdateMethod = function (e, t) {
            cc(e).updateMethod = t
        };
        var kc = {
            incrementalPrepareRender: {
                progress: function (e, t) {
                    t.view.incrementalRender(e, t.model, t.ecModel, t.api, t.payload)
                }
            }, render: {
                forceFirstProgress: !0, progress: function (e, t) {
                    t.view.render(t.model, t.ecModel, t.api, t.payload)
                }
            }
        }, Tc = "\0__throttleOriginMethod", wc = "\0__throttleRate", Cc = "\0__throttleType";

        function Sc(e, t, i) {
            var n, a, o, r, s, l = 0, d = 0, u = null;

            function c() {
                d = (new Date).getTime(), u = null, e.apply(o, r || [])
            }

            function h() {
                n = (new Date).getTime(), o = this, r = arguments;
                var e = s || t, h = s || i;
                s = null, a = n - (h ? l : d) - e, clearTimeout(u), h ? u = setTimeout(c, e) : 0 <= a ? c() : u = setTimeout(c, -a), l = n
            }

            return t = t || 0, h.clear = function () {
                u && (clearTimeout(u), u = null)
            }, h.debounceNextCall = function (e) {
                s = e
            }, h
        }

        function Ic(e, t, i, n) {
            var a = e[t];
            if (a) {
                var o = a[Tc] || a, r = a[Cc];
                if (a[wc] !== i || r !== n) {
                    if (null == i || !n) return e[t] = o;
                    (a = e[t] = Sc(o, i, "debounce" === n))[Tc] = o, a[Cc] = n, a[wc] = i
                }
                return a
            }
        }

        function bc(e, t) {
            var i = e[t];
            i && i[Tc] && (e[t] = i[Tc])
        }

        var _c = {
            createOnAllSeries: !0, performRawSeries: !0, reset: function (e, t) {
                var i = e.getData(), n = (e.visualColorAccessPath || "itemStyle.color").split("."), a = e.get(n),
                    o = !F(a) || a instanceof os ? null : a;
                a && !o || (a = e.getColorFromPalette(e.name, null, t.getSeriesCount())), i.setVisual("color", a);
                var r = (e.visualBorderColorAccessPath || "itemStyle.borderColor").split("."), s = e.get(r);
                if (i.setVisual("borderColor", s), !t.isSeriesFiltered(e)) return o && i.each(function (t) {
                    i.setItemVisual(t, "color", o(e.getDataParams(t)))
                }), {
                    dataEach: i.hasItemOption ? function (e, t) {
                        var i = e.getItemModel(t), a = i.get(n, !0), o = i.get(r, !0);
                        null != a && e.setItemVisual(t, "color", a), null != o && e.setItemVisual(t, "borderColor", o)
                    } : null
                }
            }
        }, Dc = {
            legend: {selector: {all: "全选", inverse: "反选"}},
            toolbox: {
                brush: {
                    title: {
                        rect: "矩形选择",
                        polygon: "圈选",
                        lineX: "横向选择",
                        lineY: "纵向选择",
                        keep: "保持选择",
                        clear: "清除选择"
                    }
                },
                dataView: {title: "数据视图", lang: ["数据视图", "关闭", "刷新"]},
                dataZoom: {title: {zoom: "区域缩放", back: "区域缩放还原"}},
                magicType: {title: {line: "切换为折线图", bar: "切换为柱状图", stack: "切换为堆叠", tiled: "切换为平铺"}},
                restore: {title: "还原"},
                saveAsImage: {title: "保存为图片", lang: ["右键另存为图片"]}
            },
            series: {
                typeNames: {
                    pie: "饼图",
                    bar: "柱状图",
                    line: "折线图",
                    scatter: "散点图",
                    effectScatter: "涟漪散点图",
                    radar: "雷达图",
                    tree: "树图",
                    treemap: "矩形树图",
                    boxplot: "箱型图",
                    candlestick: "K线图",
                    k: "K线图",
                    heatmap: "热力图",
                    map: "地图",
                    parallel: "平行坐标图",
                    lines: "线图",
                    graph: "关系图",
                    sankey: "桑基图",
                    funnel: "漏斗图",
                    gauge: "仪表盘图",
                    pictorialBar: "象形柱图",
                    themeRiver: "主题河流图",
                    sunburst: "旭日图"
                }
            },
            aria: {
                general: {withTitle: "这是一个关于“{title}”的图表。", withoutTitle: "这是一个图表，"},
                series: {
                    single: {
                        prefix: "",
                        withName: "图表类型是{seriesType}，表示{seriesName}。",
                        withoutName: "图表类型是{seriesType}。"
                    },
                    multiple: {
                        prefix: "它由{seriesCount}个图表系列组成。",
                        withName: "第{seriesId}个系列是一个表示{seriesName}的{seriesType}，",
                        withoutName: "第{seriesId}个系列是一个{seriesType}，",
                        separator: {middle: "；", end: "。"}
                    }
                },
                data: {
                    allData: "其数据是——",
                    partialData: "其中，前{displayCnt}项是——",
                    withName: "{name}的数据是{value}",
                    withoutName: "{value}",
                    separator: {middle: "，", end: ""}
                }
            }
        }, Ac = function (e, t) {
            var i = t.getModel("aria");
            if (i.get("show")) if (i.get("description")) e.setAttribute("aria-label", i.get("description")); else {
                var n = 0;
                t.eachSeries(function (e, t) {
                    ++n
                }, this);
                var a, o = i.get("data.maxCount") || 10, r = i.get("series.maxCount") || 10, s = Math.min(n, r);
                if (!(n < 1)) {
                    var l = function () {
                        var e = t.getModel("title").option;
                        return e && e.length && (e = e[0]), e && e.text
                    }();
                    a = l ? u(c("general.withTitle"), {title: l}) : c("general.withoutTitle");
                    var d = [];
                    a += u(c(1 < n ? "series.multiple.prefix" : "series.single.prefix"), {seriesCount: n}), t.eachSeries(function (e, t) {
                        if (t < s) {
                            var i, a = e.get("name"), r = "series." + (1 < n ? "multiple" : "single") + ".";
                            i = u(i = c(a ? r + "withName" : r + "withoutName"), {
                                seriesId: e.seriesIndex,
                                seriesName: e.get("name"),
                                seriesType: function (e) {
                                    return Dc.series.typeNames[e] || "自定义图"
                                }(e.subType)
                            });
                            var l = e.getData();
                            (window.data = l).count() > o ? i += u(c("data.partialData"), {displayCnt: o}) : i += c("data.allData");
                            for (var h = [], f = 0; f < l.count(); f++) if (f < o) {
                                var g = l.getName(f), p = Lu(l, f);
                                h.push(u(c(g ? "data.withName" : "data.withoutName"), {name: g, value: p}))
                            }
                            i += h.join(c("data.separator.middle")) + c("data.separator.end"), d.push(i)
                        }
                    }), a += d.join(c("series.multiple.separator.middle")) + c("series.multiple.separator.end"), e.setAttribute("aria-label", a)
                }
            }

            function u(e, t) {
                if ("string" != typeof e) return e;
                var i = e;
                return D(t, function (e, t) {
                    i = i.replace(new RegExp("\\{\\s*" + t + "\\s*\\}", "g"), e)
                }), i
            }

            function c(e) {
                var t = i.get(e);
                if (null != t) return t;
                for (var n = e.split("."), a = Dc.aria, o = 0; o < n.length; ++o) a = a[n[o]];
                return a
            }
        }, Nc = Math.PI;

        function xc(e, t, i, n) {
            this.ecInstance = e, this.api = t, this.unfinished, i = this._dataProcessorHandlers = i.slice(), n = this._visualHandlers = n.slice(), this._allHandlers = i.concat(n), this._stageTaskMap = Q()
        }

        var Ec = xc.prototype;

        function Pc(e, t, i, n, a) {
            var o;

            function r(e, t) {
                return e.setDirty && (!e.dirtyMap || e.dirtyMap.get(t.__pipeline.id))
            }

            a = a || {}, D(t, function (t, s) {
                if (!a.visualType || a.visualType === t.visualType) {
                    var l = e._stageTaskMap.get(t.uid), d = l.seriesTaskMap, u = l.overallTask;
                    if (u) {
                        var c, h = u.agentStubMap;
                        h.each(function (e) {
                            r(a, e) && (e.dirty(), c = !0)
                        }), c && u.dirty(), Oc(u, n);
                        var f = e.getPerformArgs(u, a.block);
                        h.each(function (e) {
                            e.perform(f)
                        }), o |= u.perform(f)
                    } else d && d.each(function (s, l) {
                        r(a, s) && s.dirty();
                        var d = e.getPerformArgs(s, a.block);
                        d.skip = !t.performRawSeries && i.isSeriesFiltered(s.context.model), Oc(s, n), o |= s.perform(d)
                    })
                }
            }), e.unfinished |= o
        }

        Ec.restoreData = function (e, t) {
            e.restoreData(t), this._stageTaskMap.each(function (e) {
                var t = e.overallTask;
                t && t.dirty()
            })
        }, Ec.getPerformArgs = function (e, t) {
            if (e.__pipeline) {
                var i = this._pipelineMap.get(e.__pipeline.id), n = i.context,
                    a = !t && i.progressiveEnabled && (!n || n.progressiveRender) && e.__idxInPipeline > i.blockIndex ? i.step : null,
                    o = n && n.modDataCount;
                return {step: a, modBy: null != o ? Math.ceil(o / a) : null, modDataCount: o}
            }
        }, Ec.getPipeline = function (e) {
            return this._pipelineMap.get(e)
        }, Ec.updateStreamModes = function (e, t) {
            var i = this._pipelineMap.get(e.uid), n = e.getData().count(),
                a = i.progressiveEnabled && t.incrementalPrepareRender && n >= i.threshold,
                o = e.get("large") && n >= e.get("largeThreshold"),
                r = "mod" === e.get("progressiveChunkMode") ? n : null;
            e.pipelineContext = i.context = {progressiveRender: a, modDataCount: r, large: o}
        }, Ec.restorePipelines = function (e) {
            var t = this, i = t._pipelineMap = Q();
            e.eachSeries(function (e) {
                var n = e.getProgressive(), a = e.uid;
                i.set(a, {
                    id: a,
                    head: null,
                    tail: null,
                    threshold: e.getProgressiveThreshold(),
                    progressiveEnabled: n && !(e.preventIncremental && e.preventIncremental()),
                    blockIndex: -1,
                    step: Math.round(n || 700),
                    count: 0
                }), Gc(t, e, e.dataTask)
            })
        }, Ec.prepareStageTasks = function () {
            var e = this._stageTaskMap, t = this.ecInstance.getModel(), i = this.api;
            D(this._allHandlers, function (n) {
                var a = e.get(n.uid) || e.set(n.uid, []);
                n.reset && function (e, t, i, n, a) {
                    var o = i.seriesTaskMap || (i.seriesTaskMap = Q()), r = t.seriesType, s = t.getTargetSeries;

                    function l(i) {
                        var r = i.uid, s = o.get(r) || o.set(r, Ku({plan: Bc, reset: Uc, count: Wc}));
                        s.context = {
                            model: i,
                            ecModel: n,
                            api: a,
                            useClearVisual: t.isVisual && !t.isLayout,
                            plan: t.plan,
                            reset: t.reset,
                            scheduler: e
                        }, Gc(e, i, s)
                    }

                    t.createOnAllSeries ? n.eachRawSeries(l) : r ? n.eachRawSeriesByType(r, l) : s && s(n, a).each(l);
                    var d = e._pipelineMap;
                    o.each(function (e, t) {
                        d.get(t) || (e.dispose(), o.removeKey(t))
                    })
                }(this, n, a, t, i), n.overallReset && function (e, t, i, n, a) {
                    var o = i.overallTask = i.overallTask || Ku({reset: Mc});
                    o.context = {ecModel: n, api: a, overallReset: t.overallReset, scheduler: e};
                    var r = o.agentStubMap = o.agentStubMap || Q(), s = t.seriesType, l = t.getTargetSeries, d = !0,
                        u = t.modifyOutputEnd;

                    function c(t) {
                        var i = t.uid, n = r.get(i);
                        n || (n = r.set(i, Ku({reset: Fc, onDirty: Rc})), o.dirty()), n.context = {
                            model: t,
                            overallProgress: d,
                            modifyOutputEnd: u
                        }, n.agent = o, n.__block = d, Gc(e, t, n)
                    }

                    s ? n.eachRawSeriesByType(s, c) : l ? l(n, a).each(c) : (d = !1, D(n.getSeries(), c));
                    var h = e._pipelineMap;
                    r.each(function (e, t) {
                        h.get(t) || (e.dispose(), o.dirty(), r.removeKey(t))
                    })
                }(this, n, a, t, i)
            }, this)
        }, Ec.prepareView = function (e, t, i, n) {
            var a = e.renderTask, o = a.context;
            o.model = t, o.ecModel = i, o.api = n, a.__block = !e.incrementalPrepareRender, Gc(this, t, a)
        }, Ec.performDataProcessorTasks = function (e, t) {
            Pc(this, this._dataProcessorHandlers, e, t, {block: !0})
        }, Ec.performVisualTasks = function (e, t, i) {
            Pc(this, this._visualHandlers, e, t, i)
        }, Ec.performSeriesTasks = function (e) {
            var t;
            e.eachSeries(function (e) {
                t |= e.dataTask.perform()
            }), this.unfinished |= t
        }, Ec.plan = function () {
            this._pipelineMap.each(function (e) {
                var t = e.tail;
                do {
                    if (t.__block) {
                        e.blockIndex = t.__idxInPipeline;
                        break
                    }
                    t = t.getUpstream()
                } while (t)
            })
        };
        var Oc = Ec.updatePayload = function (e, t) {
            "remain" !== t && (e.context.payload = t)
        };

        function Mc(e) {
            e.overallReset(e.ecModel, e.api, e.payload)
        }

        function Fc(e, t) {
            return e.overallProgress && Lc
        }

        function Lc() {
            this.agent.dirty(), this.getDownstream().dirty()
        }

        function Rc() {
            this.agent && this.agent.dirty()
        }

        function Bc(e) {
            return e.plan && e.plan(e.model, e.ecModel, e.api, e.payload)
        }

        function Uc(e) {
            e.useClearVisual && e.data.clearAllVisual();
            var t = e.resetDefines = Pa(e.reset(e.model, e.ecModel, e.api, e.payload));
            return 1 < t.length ? A(t, function (e, t) {
                return Vc(t)
            }) : Kc
        }

        var Kc = Vc(0);

        function Vc(e) {
            return function (t, i) {
                var n = i.data, a = i.resetDefines[e];
                if (a && a.dataEach) for (var o = t.start; o < t.end; o++) a.dataEach(n, o); else a && a.progress && a.progress(t, n)
            }
        }

        function Wc(e) {
            return e.data.count()
        }

        function Gc(e, t, i) {
            var n = t.uid, a = e._pipelineMap.get(n);
            a.head || (a.head = i), a.tail && a.tail.pipe(i), (a.tail = i).__idxInPipeline = a.count++, i.__pipeline = a
        }

        xc.wrapStageHandler = function (e, t) {
            return F(e) && (e = {
                overallReset: e, seriesType: function (e) {
                    Hc = null;
                    try {
                        e(zc, jc)
                    } catch (e) {
                    }
                    return Hc
                }(e)
            }), e.uid = Dl("stageHandler"), t && (e.visualType = t), e
        };
        var Hc, zc = {}, jc = {};

        function Xc(e, t) {
            for (var i in t.prototype) e[i] = te
        }

        function $c() {
            return {
                axisLine: {lineStyle: {color: Jc}},
                axisTick: {lineStyle: {color: Jc}},
                axisLabel: {textStyle: {color: Jc}},
                splitLine: {lineStyle: {type: "dashed", color: "#aaa"}},
                splitArea: {areaStyle: {color: Jc}}
            }
        }

        Xc(zc, qd), Xc(jc, eu), zc.eachSeriesByType = zc.eachRawSeriesByType = function (e) {
            Hc = e
        }, zc.eachComponent = function (e) {
            "series" === e.mainType && e.subType && (Hc = e.subType)
        };
        var Yc = ["#37A2DA", "#32C5E9", "#67E0E3", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#E062AE", "#E690D1", "#e7bcf3", "#9d96f5", "#8378EA", "#96BFFF"],
            qc = {
                color: Yc,
                colorLayer: [["#37A2DA", "#ffd85c", "#fd7b5f"], ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], Yc]
            }, Jc = "#eee",
            Zc = ["#dd6b66", "#759aa0", "#e69d87", "#8dc1a9", "#ea7e53", "#eedd78", "#73a373", "#73b9bc", "#7289ab", "#91ca8c", "#f49f42"],
            Qc = {
                color: Zc,
                backgroundColor: "#333",
                tooltip: {axisPointer: {lineStyle: {color: Jc}, crossStyle: {color: Jc}, label: {color: "#000"}}},
                legend: {textStyle: {color: Jc}},
                textStyle: {color: Jc},
                title: {textStyle: {color: Jc}},
                toolbox: {iconStyle: {normal: {borderColor: Jc}}},
                dataZoom: {textStyle: {color: Jc}},
                visualMap: {textStyle: {color: Jc}},
                timeline: {
                    lineStyle: {color: Jc},
                    itemStyle: {normal: {color: Zc[1]}},
                    label: {normal: {textStyle: {color: Jc}}},
                    controlStyle: {normal: {color: Jc, borderColor: Jc}}
                },
                timeAxis: $c(),
                logAxis: $c(),
                valueAxis: $c(),
                categoryAxis: $c(),
                line: {symbol: "circle"},
                graph: {color: Zc},
                gauge: {title: {textStyle: {color: Jc}}},
                candlestick: {
                    itemStyle: {
                        normal: {
                            color: "#FD1050",
                            color0: "#0CF49B",
                            borderColor: "#FD1050",
                            borderColor0: "#0CF49B"
                        }
                    }
                }
            };
        Qc.categoryAxis.splitLine.show = !1, bd.extend({
            type: "dataset",
            defaultOption: {seriesLayoutBy: Rd, sourceHeader: null, dimensions: null, source: null},
            optionUpdated: function () {
                !function (e) {
                    var t = e.option.source, i = Fd;
                    if (U(t)) i = Ld; else if (M(t)) {
                        0 === t.length && (i = Pd);
                        for (var n = 0, a = t.length; n < a; n++) {
                            var o = t[n];
                            if (null != o) {
                                if (M(o)) {
                                    i = Pd;
                                    break
                                }
                                if (R(o)) {
                                    i = Od;
                                    break
                                }
                            }
                        }
                    } else if (R(t)) {
                        for (var r in t) if (t.hasOwnProperty(r) && _(t[r])) {
                            i = Md;
                            break
                        }
                    } else if (null != t) throw new Error("Invalid data");
                    Vd(e).sourceFormat = i
                }(this)
            }
        }), lc.extend({type: "dataset"});
        var eh = wr.extend({
            type: "ellipse", shape: {cx: 0, cy: 0, rx: 0, ry: 0}, buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = t.rx, o = t.ry, r = .5522848 * a, s = .5522848 * o;
                e.moveTo(i - a, n), e.bezierCurveTo(i - a, n - s, i - r, n - o, i, n - o), e.bezierCurveTo(i + r, n - o, i + a, n - s, i + a, n), e.bezierCurveTo(i + a, n + s, i + r, n + o, i, n + o), e.bezierCurveTo(i - r, n + o, i - a, n + s, i - a, n), e.closePath()
            }
        }), th = /[\s,]+/;

        function ih(e) {
            for (L(e) && (e = (new DOMParser).parseFromString(e, "text/xml")), 9 === e.nodeType && (e = e.firstChild); "svg" !== e.nodeName.toLowerCase() || 1 !== e.nodeType;) e = e.nextSibling;
            return e
        }

        function nh() {
            this._defs = {}, this._root = null, this._isDefine = !1, this._isText = !1
        }

        nh.prototype.parse = function (e, t) {
            t = t || {};
            var i = ih(e);
            if (!i) throw new Error("Illegal svg");
            var n = new Ai;
            this._root = n;
            var a = i.getAttribute("viewBox") || "", o = parseFloat(i.getAttribute("width") || t.width),
                r = parseFloat(i.getAttribute("height") || t.height);
            isNaN(o) && (o = null), isNaN(r) && (r = null), dh(i, n, null, !0);
            for (var s, l, d = i.firstChild; d;) this._parseNode(d, n), d = d.nextSibling;
            if (a) {
                var u = $(a).split(th);
                4 <= u.length && (s = {
                    x: parseFloat(u[0] || 0),
                    y: parseFloat(u[1] || 0),
                    width: parseFloat(u[2]),
                    height: parseFloat(u[3])
                })
            }
            if (s && null != o && null != r && (l = gh(s, o, r), !t.ignoreViewBox)) {
                var c = n;
                (n = new Ai).add(c), c.scale = l.scale.slice(), c.position = l.position.slice()
            }
            return t.ignoreRootClip || null == o || null == r || n.setClipPath(new es({
                shape: {
                    x: 0,
                    y: 0,
                    width: o,
                    height: r
                }
            })), {root: n, width: o, height: r, viewBoxRect: s, viewBoxTransform: l}
        }, nh.prototype._parseNode = function (e, t) {
            var i, n, a = e.nodeName.toLowerCase();
            if ("defs" === a ? this._isDefine = !0 : "text" === a && (this._isText = !0), this._isDefine) {
                if (n = oh[a]) {
                    var o = n.call(this, e), r = e.getAttribute("id");
                    r && (this._defs[r] = o)
                }
            } else (n = ah[a]) && (i = n.call(this, e, t), t.add(i));
            for (var s = e.firstChild; s;) 1 === s.nodeType && this._parseNode(s, i), 3 === s.nodeType && this._isText && this._parseText(s, i), s = s.nextSibling;
            "defs" === a ? this._isDefine = !1 : "text" === a && (this._isText = !1)
        }, nh.prototype._parseText = function (e, t) {
            if (1 === e.nodeType) {
                var i = e.getAttribute("dx") || 0, n = e.getAttribute("dy") || 0;
                this._textX += parseFloat(i), this._textY += parseFloat(n)
            }
            var a = new Ur({
                style: {text: e.textContent, transformText: !0},
                position: [this._textX || 0, this._textY || 0]
            });
            rh(t, a), dh(e, a, this._defs);
            var o = a.style.fontSize;
            o && o < 9 && (a.style.fontSize = 9, a.scale = a.scale || [1, 1], a.scale[0] *= o / 9, a.scale[1] *= o / 9);
            var r = a.getBoundingRect();
            return this._textX += r.width, t.add(a), a
        };
        var ah = {
            g: function (e, t) {
                var i = new Ai;
                return rh(t, i), dh(e, i, this._defs), i
            }, rect: function (e, t) {
                var i = new es;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    x: parseFloat(e.getAttribute("x") || 0),
                    y: parseFloat(e.getAttribute("y") || 0),
                    width: parseFloat(e.getAttribute("width") || 0),
                    height: parseFloat(e.getAttribute("height") || 0)
                }), i
            }, circle: function (e, t) {
                var i = new Vr;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    cx: parseFloat(e.getAttribute("cx") || 0),
                    cy: parseFloat(e.getAttribute("cy") || 0),
                    r: parseFloat(e.getAttribute("r") || 0)
                }), i
            }, line: function (e, t) {
                var i = new is;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    x1: parseFloat(e.getAttribute("x1") || 0),
                    y1: parseFloat(e.getAttribute("y1") || 0),
                    x2: parseFloat(e.getAttribute("x2") || 0),
                    y2: parseFloat(e.getAttribute("y2") || 0)
                }), i
            }, ellipse: function (e, t) {
                var i = new eh;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    cx: parseFloat(e.getAttribute("cx") || 0),
                    cy: parseFloat(e.getAttribute("cy") || 0),
                    rx: parseFloat(e.getAttribute("rx") || 0),
                    ry: parseFloat(e.getAttribute("ry") || 0)
                }), i
            }, polygon: function (e, t) {
                var i = e.getAttribute("points");
                i = i && sh(i);
                var n = new Xr({shape: {points: i || []}});
                return rh(t, n), dh(e, n, this._defs), n
            }, polyline: function (e, t) {
                var i = new wr;
                rh(t, i), dh(e, i, this._defs);
                var n = e.getAttribute("points");
                return n = n && sh(n), new $r({shape: {points: n || []}})
            }, image: function (e, t) {
                var i = new Yn;
                return rh(t, i), dh(e, i, this._defs), i.setStyle({
                    image: e.getAttribute("xlink:href"),
                    x: e.getAttribute("x"),
                    y: e.getAttribute("y"),
                    width: e.getAttribute("width"),
                    height: e.getAttribute("height")
                }), i
            }, text: function (e, t) {
                var i = e.getAttribute("x") || 0, n = e.getAttribute("y") || 0, a = e.getAttribute("dx") || 0,
                    o = e.getAttribute("dy") || 0;
                this._textX = parseFloat(i) + parseFloat(a), this._textY = parseFloat(n) + parseFloat(o);
                var r = new Ai;
                return rh(t, r), dh(e, r, this._defs), r
            }, tspan: function (e, t) {
                var i = e.getAttribute("x"), n = e.getAttribute("y");
                null != i && (this._textX = parseFloat(i)), null != n && (this._textY = parseFloat(n));
                var a = e.getAttribute("dx") || 0, o = e.getAttribute("dy") || 0, r = new Ai;
                return rh(t, r), dh(e, r, this._defs), this._textX += a, this._textY += o, r
            }, path: function (e, t) {
                var i = Br(e.getAttribute("d") || "");
                return rh(t, i), dh(e, i, this._defs), i
            }
        }, oh = {
            lineargradient: function (e) {
                var t = parseInt(e.getAttribute("x1") || 0, 10), i = parseInt(e.getAttribute("y1") || 0, 10),
                    n = parseInt(e.getAttribute("x2") || 10, 10), a = parseInt(e.getAttribute("y2") || 0, 10),
                    o = new ds(t, i, n, a);
                return function (e, t) {
                    for (var i = e.firstChild; i;) {
                        if (1 === i.nodeType) {
                            var n = i.getAttribute("offset");
                            n = 0 < n.indexOf("%") ? parseInt(n, 10) / 100 : n ? parseFloat(n) : 0;
                            var a = i.getAttribute("stop-color") || "#000000";
                            t.addColorStop(n, a)
                        }
                        i = i.nextSibling
                    }
                }(e, o), o
            }, radialgradient: function (e) {
            }
        };

        function rh(e, t) {
            e && e.__inheritedStyle && (t.__inheritedStyle || (t.__inheritedStyle = {}), T(t.__inheritedStyle, e.__inheritedStyle))
        }

        function sh(e) {
            for (var t = $(e).split(th), i = [], n = 0; n < t.length; n += 2) {
                var a = parseFloat(t[n]), o = parseFloat(t[n + 1]);
                i.push([a, o])
            }
            return i
        }

        var lh = {
            fill: "fill",
            stroke: "stroke",
            "stroke-width": "lineWidth",
            opacity: "opacity",
            "fill-opacity": "fillOpacity",
            "stroke-opacity": "strokeOpacity",
            "stroke-dasharray": "lineDash",
            "stroke-dashoffset": "lineDashOffset",
            "stroke-linecap": "lineCap",
            "stroke-linejoin": "lineJoin",
            "stroke-miterlimit": "miterLimit",
            "font-family": "fontFamily",
            "font-size": "fontSize",
            "font-style": "fontStyle",
            "font-weight": "fontWeight",
            "text-align": "textAlign",
            "alignment-baseline": "textBaseline"
        };

        function dh(e, t, i, n) {
            var a = t.__inheritedStyle || {}, o = "text" === t.type;
            if (1 === e.nodeType && (function (e, t) {
                var i = e.getAttribute("transform");
                if (i) {
                    var n = null, a = [];
                    (i = i.replace(/,/g, " ")).replace(hh, function (e, t, i) {
                        a.push(t, i)
                    });
                    for (var o = a.length - 1; 0 < o; o -= 2) {
                        var r = a[o], s = a[o - 1];
                        switch (n = n || ot(), s) {
                            case"translate":
                                r = $(r).split(th), dt(n, n, [parseFloat(r[0]), parseFloat(r[1] || 0)]);
                                break;
                            case"scale":
                                r = $(r).split(th), ct(n, n, [parseFloat(r[0]), parseFloat(r[1] || r[0])]);
                                break;
                            case"rotate":
                                r = $(r).split(th), ut(n, n, parseFloat(r[0]));
                                break;
                            case"skew":
                                r = $(r).split(th), console.warn("Skew transform is not supported yet");
                                break;
                            case"matrix":
                                r = $(r).split(th), n[0] = parseFloat(r[0]), n[1] = parseFloat(r[1]), n[2] = parseFloat(r[2]), n[3] = parseFloat(r[3]), n[4] = parseFloat(r[4]), n[5] = parseFloat(r[5])
                        }
                    }
                    t.setLocalTransform(n)
                }
            }(e, t), k(a, function (e) {
                var t = e.getAttribute("style"), i = {};
                if (!t) return i;
                var n, a = {};
                for (fh.lastIndex = 0; null != (n = fh.exec(t));) a[n[1]] = n[2];
                for (var o in lh) lh.hasOwnProperty(o) && null != a[o] && (i[lh[o]] = a[o]);
                return i
            }(e)), !n)) for (var r in lh) if (lh.hasOwnProperty(r)) {
                var s = e.getAttribute(r);
                null != s && (a[lh[r]] = s)
            }
            var l = o ? "textFill" : "fill", d = o ? "textStroke" : "stroke";
            t.style = t.style || new Gi;
            var u = t.style;
            null != a.fill && u.set(l, ch(a.fill, i)), null != a.stroke && u.set(d, ch(a.stroke, i)), D(["lineWidth", "opacity", "fillOpacity", "strokeOpacity", "miterLimit", "fontSize"], function (e) {
                var t = "lineWidth" === e && o ? "textStrokeWidth" : e;
                null != a[e] && u.set(t, parseFloat(a[e]))
            }), a.textBaseline && "auto" !== a.textBaseline || (a.textBaseline = "alphabetic"), "alphabetic" === a.textBaseline && (a.textBaseline = "bottom"), "start" === a.textAlign && (a.textAlign = "left"), "end" === a.textAlign && (a.textAlign = "right"), D(["lineDashOffset", "lineCap", "lineJoin", "fontWeight", "fontFamily", "fontStyle", "textAlign", "textBaseline"], function (e) {
                null != a[e] && u.set(e, a[e])
            }), a.lineDash && (t.style.lineDash = $(a.lineDash).split(th)), u[d] && "none" !== u[d] && (t[d] = !0), t.__inheritedStyle = a
        }

        var uh = /url\(\s*#(.*?)\)/;

        function ch(e, t) {
            var i = t && e && e.match(uh);
            return i ? t[$(i[1])] : e
        }

        var hh = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g, fh = /([^\s:;]+)\s*:\s*([^:;]+)/g;

        function gh(e, t, i) {
            var n = t / e.width, a = i / e.height, o = Math.min(n, a);
            return {scale: [o, o], position: [-(e.x + e.width / 2) * o + t / 2, -(e.y + e.height / 2) * o + i / 2]}
        }

        var ph = Q(), vh = {
            registerMap: function (e, t, i) {
                var n;
                return D(n = M(t) ? t : t.svg ? [{
                    type: "svg",
                    source: t.svg,
                    specialAreas: t.specialAreas
                }] : (t.geoJson && !t.features && (i = t.specialAreas, t = t.geoJson), [{
                    type: "geoJSON",
                    source: t,
                    specialAreas: i
                }]), function (e) {
                    var t = e.type;
                    "geoJson" === t && (t = e.type = "geoJSON"), (0, mh[t])(e)
                }), ph.set(e, n)
            }, retrieveMap: function (e) {
                return ph.get(e)
            }
        }, mh = {
            geoJSON: function (e) {
                var t = e.source;
                e.geoJSON = L(t) ? "undefined" != typeof JSON && JSON.parse ? JSON.parse(t) : new Function("return (" + t + ");")() : t
            }, svg: function (e) {
                e.svgXML = ih(e.source)
            }
        }, yh = X, kh = D, Th = F, wh = R, Ch = bd.parseClassType, Sh = {
            PROCESSOR: {FILTER: 1e3, SERIES_FILTER: 800, STATISTIC: 5e3},
            VISUAL: {
                LAYOUT: 1e3,
                PROGRESSIVE_LAYOUT: 1100,
                GLOBAL: 2e3,
                CHART: 3e3,
                POST_CHART_LAYOUT: 3500,
                COMPONENT: 4e3,
                BRUSH: 5e3
            }
        }, Ih = "__flagInMainProcess", bh = "__optionUpdated", _h = /^[a-zA-Z0-9_]+$/;

        function Dh(e, t) {
            return function (i, n, a) {
                !t && this._disposed || (i = i && i.toLowerCase(), Ne.prototype[e].call(this, i, n, a))
            }
        }

        function Ah() {
            Ne.call(this)
        }

        function Nh(e, t, i) {
            i = i || {}, "string" == typeof t && (t = Qh[t]), this.id, this.group, this._dom = e;
            var n = this._zr = Ia(e, {
                renderer: i.renderer || "canvas",
                devicePixelRatio: i.devicePixelRatio,
                width: i.width,
                height: i.height
            });
            this._throttledZrFlush = Sc(P(n.flush, n), 17), (t = v(t)) && Su(t, !0), this._theme = t, this._chartsViews = [], this._chartsMap = {}, this._componentsViews = [], this._componentsMap = {}, this._coordSysMgr = new iu;
            var a = this._api = function (e) {
                var t = e._coordSysMgr;
                return k(new eu(e), {
                    getCoordinateSystems: P(t.getCoordinateSystems, t),
                    getComponentByElement: function (t) {
                        for (; t;) {
                            var i = t.__ecComponentInfo;
                            if (null != i) return e._model.getComponent(i.mainType, i.index);
                            t = t.parent
                        }
                    }
                })
            }(this);

            function o(e, t) {
                return e.__prio - t.__prio
            }

            Fi(Zh, o), Fi(Yh, o), this._scheduler = new xc(this, a, Yh, Zh), Ne.call(this, this._ecEventProcessor = new jh), this._messageCenter = new Ah, this._initEvents(), this.resize = P(this.resize, this), this._pendingActions = [], n.animation.on("frame", this._onframe, this), function (e, t) {
                e.on("rendered", function () {
                    t.trigger("rendered"), !e.animation.isFinished() || t[bh] || t._scheduler.unfinished || t._pendingActions.length || t.trigger("finished")
                })
            }(n, this), q(this)
        }

        Ah.prototype.on = Dh("on", !0), Ah.prototype.off = Dh("off", !0), Ah.prototype.one = Dh("one", !0), b(Ah, Ne);
        var xh = Nh.prototype;

        function Eh(e, t, i) {
            if (!this._disposed) {
                var n, a = this._model, o = this._coordSysMgr.getCoordinateSystems();
                t = Ga(a, t);
                for (var r = 0; r < o.length; r++) {
                    var s = o[r];
                    if (s[e] && null != (n = s[e](a, t, i))) return n
                }
            }
        }

        xh._onframe = function () {
            if (!this._disposed) {
                var e = this._scheduler;
                if (this[bh]) {
                    var t = this[bh].silent;
                    this[Ih] = !0, Oh(this), Ph.update.call(this), this[Ih] = !1, this[bh] = !1, Rh.call(this, t), Bh.call(this, t)
                } else if (e.unfinished) {
                    var i = 1, n = this._model;
                    this._api;
                    e.unfinished = !1;
                    do {
                        var a = +new Date;
                        e.performSeriesTasks(n), e.performDataProcessorTasks(n), Fh(this, n), e.performVisualTasks(n), Wh(this, this._model, 0, "remain"), i -= +new Date - a
                    } while (0 < i && e.unfinished);
                    e.unfinished || this._zr.flush()
                }
            }
        }, xh.getDom = function () {
            return this._dom
        }, xh.getZr = function () {
            return this._zr
        }, xh.setOption = function (e, t, i) {
            if (!this._disposed) {
                var n;
                if (wh(t) && (i = t.lazyUpdate, n = t.silent, t = t.notMerge), this[Ih] = !0, !this._model || t) {
                    var a = new lu(this._api), o = this._theme, r = this._model = new qd;
                    r.scheduler = this._scheduler, r.init(null, null, o, a)
                }
                this._model.setOption(e, qh), i ? (this[bh] = {silent: n}, this[Ih] = !1) : (Oh(this), Ph.update.call(this), this._zr.flush(), this[bh] = !1, this[Ih] = !1, Rh.call(this, n), Bh.call(this, n))
            }
        }, xh.setTheme = function () {
            console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")
        }, xh.getModel = function () {
            return this._model
        }, xh.getOption = function () {
            return this._model && this._model.getOption()
        }, xh.getWidth = function () {
            return this._zr.getWidth()
        }, xh.getHeight = function () {
            return this._zr.getHeight()
        }, xh.getDevicePixelRatio = function () {
            return this._zr.painter.dpr || window.devicePixelRatio || 1
        }, xh.getRenderedCanvas = function (e) {
            if (a.canvasSupported) return (e = e || {}).pixelRatio = e.pixelRatio || 1, e.backgroundColor = e.backgroundColor || this._model.get("backgroundColor"), this._zr.painter.getRenderedCanvas(e)
        }, xh.getSvgDataURL = function () {
            if (a.svgSupported) {
                var e = this._zr;
                return D(e.storage.getDisplayList(), function (e) {
                    e.stopAnimation(!0)
                }), e.painter.toDataURL()
            }
        }, xh.getDataURL = function (e) {
            if (!this._disposed) {
                var t = (e = e || {}).excludeComponents, i = this._model, n = [], a = this;
                kh(t, function (e) {
                    i.eachComponent({mainType: e}, function (e) {
                        var t = a._componentsMap[e.__viewId];
                        t.group.ignore || (n.push(t), t.group.ignore = !0)
                    })
                });
                var o = "svg" === this._zr.painter.getType() ? this.getSvgDataURL() : this.getRenderedCanvas(e).toDataURL("image/" + (e && e.type || "png"));
                return kh(n, function (e) {
                    e.group.ignore = !1
                }), o
            }
        }, xh.getConnectedDataURL = function (e) {
            if (!this._disposed && a.canvasSupported) {
                var t = "svg" === e.type, i = this.group, n = Math.min, o = Math.max;
                if (nf[i]) {
                    var r = 1 / 0, s = 1 / 0, l = -1 / 0, d = -1 / 0, u = [], c = e && e.pixelRatio || 1;
                    D(tf, function (a, c) {
                        if (a.group === i) {
                            var h = t ? a.getZr().painter.getSvgDom().innerHTML : a.getRenderedCanvas(v(e)),
                                f = a.getDom().getBoundingClientRect();
                            r = n(f.left, r), s = n(f.top, s), l = o(f.right, l), d = o(f.bottom, d), u.push({
                                dom: h,
                                left: f.left,
                                top: f.top
                            })
                        }
                    });
                    var h = (l *= c) - (r *= c), f = (d *= c) - (s *= c), g = w(),
                        p = Ia(g, {renderer: t ? "svg" : "canvas"});
                    if (p.resize({width: h, height: f}), t) {
                        var m = "";
                        return kh(u, function (e) {
                            var t = e.left - r, i = e.top - s;
                            m += '<g transform="translate(' + t + "," + i + ')">' + e.dom + "</g>"
                        }), p.painter.getSvgRoot().innerHTML = m, e.connectedBackgroundColor && p.painter.setBackgroundColor(e.connectedBackgroundColor), p.refreshImmediately(), p.painter.toDataURL()
                    }
                    return e.connectedBackgroundColor && p.add(new es({
                        shape: {x: 0, y: 0, width: h, height: f},
                        style: {fill: e.connectedBackgroundColor}
                    })), kh(u, function (e) {
                        var t = new Yn({style: {x: e.left * c - r, y: e.top * c - s, image: e.dom}});
                        p.add(t)
                    }), p.refreshImmediately(), g.toDataURL("image/" + (e && e.type || "png"))
                }
                return this.getDataURL(e)
            }
        }, xh.convertToPixel = O(Eh, "convertToPixel"), xh.convertFromPixel = O(Eh, "convertFromPixel"), xh.containPixel = function (e, t) {
            var i;
            if (!this._disposed) return D(e = Ga(this._model, e), function (e, n) {
                0 <= n.indexOf("Models") && D(e, function (e) {
                    var a = e.coordinateSystem;
                    if (a && a.containPoint) i |= !!a.containPoint(t); else if ("seriesModels" === n) {
                        var o = this._chartsMap[e.__viewId];
                        o && o.containPoint && (i |= o.containPoint(t, e))
                    }
                }, this)
            }, this), !!i
        }, xh.getVisual = function (e, t) {
            var i = (e = Ga(this._model, e, {defaultMainType: "series"})).seriesModel.getData(),
                n = e.hasOwnProperty("dataIndexInside") ? e.dataIndexInside : e.hasOwnProperty("dataIndex") ? i.indexOfRawIndex(e.dataIndex) : null;
            return null != n ? i.getItemVisual(n, t) : i.getVisual(t)
        }, xh.getViewOfComponentModel = function (e) {
            return this._componentsMap[e.__viewId]
        }, xh.getViewOfSeriesModel = function (e) {
            return this._chartsMap[e.__viewId]
        };
        var Ph = {
            prepareAndUpdate: function (e) {
                Oh(this), Ph.update.call(this, e)
            }, update: function (e) {
                var t = this._model, i = this._api, n = this._zr, o = this._coordSysMgr, r = this._scheduler;
                if (t) {
                    r.restoreData(t, e), r.performSeriesTasks(t), o.create(t, i), r.performDataProcessorTasks(t, e), Fh(this, t), o.update(t, i), Kh(t), r.performVisualTasks(t, e), Vh(this, t, i, e);
                    var s = t.get("backgroundColor") || "transparent";
                    if (a.canvasSupported) n.setBackgroundColor(s); else {
                        var l = Vt(s);
                        s = Jt(l, "rgb"), 0 === l[3] && (s = "transparent")
                    }
                    Gh(t, i)
                }
            }, updateTransform: function (e) {
                var t = this._model, i = this, n = this._api;
                if (t) {
                    var a = [];
                    t.eachComponent(function (o, r) {
                        var s = i.getViewOfComponentModel(r);
                        if (s && s.__alive) if (s.updateTransform) {
                            var l = s.updateTransform(r, t, n, e);
                            l && l.update && a.push(s)
                        } else a.push(s)
                    });
                    var o = Q();
                    t.eachSeries(function (a) {
                        var r = i._chartsMap[a.__viewId];
                        if (r.updateTransform) {
                            var s = r.updateTransform(a, t, n, e);
                            s && s.update && o.set(a.uid, 1)
                        } else o.set(a.uid, 1)
                    }), Kh(t), this._scheduler.performVisualTasks(t, e, {
                        setDirty: !0,
                        dirtyMap: o
                    }), Wh(i, t, 0, e, o), Gh(t, this._api)
                }
            }, updateView: function (e) {
                var t = this._model;
                t && (fc.markUpdateMethod(e, "updateView"), Kh(t), this._scheduler.performVisualTasks(t, e, {setDirty: !0}), Vh(this, this._model, this._api, e), Gh(t, this._api))
            }, updateVisual: function (e) {
                Ph.update.call(this, e)
            }, updateLayout: function (e) {
                Ph.update.call(this, e)
            }
        };

        function Oh(e) {
            var t = e._model, i = e._scheduler;
            i.restorePipelines(t), i.prepareStageTasks(), Uh(e, "component", t, i), Uh(e, "chart", t, i), i.plan()
        }

        function Mh(e, t, i, n, a) {
            var o = e._model;
            if (n) {
                var r = {};
                r[n + "Id"] = i[n + "Id"], r[n + "Index"] = i[n + "Index"], r[n + "Name"] = i[n + "Name"];
                var s = {mainType: n, query: r};
                a && (s.subType = a);
                var l = i.excludeSeriesId;
                null != l && (l = Q(Pa(l))), o && o.eachComponent(s, function (t) {
                    l && null != l.get(t.id) || d(e["series" === n ? "_chartsMap" : "_componentsMap"][t.__viewId])
                }, e)
            } else kh(e._componentsViews.concat(e._chartsViews), d);

            function d(n) {
                n && n.__alive && n[t] && n[t](n.__model, o, e._api, i)
            }
        }

        function Fh(e, t) {
            var i = e._chartsMap, n = e._scheduler;
            t.eachSeries(function (e) {
                n.updateStreamModes(e, i[e.__viewId])
            })
        }

        function Lh(e, t) {
            var i = e.type, n = e.escapeConnect, a = Xh[i], o = a.actionInfo, r = (o.update || "update").split(":"),
                s = r.pop();
            r = null != r[0] && Ch(r[0]), this[Ih] = !0;
            var l = [e], d = !1;
            e.batch && (d = !0, l = A(e.batch, function (t) {
                return (t = T(k({}, t), e)).batch = null, t
            }));
            var u, c = [], h = "highlight" === i || "downplay" === i;
            kh(l, function (e) {
                (u = (u = a.action(e, this._model, this._api)) || k({}, e)).type = o.event || u.type, c.push(u), h ? Mh(this, s, e, "series") : r && Mh(this, s, e, r.main, r.sub)
            }, this), "none" === s || h || r || (this[bh] ? (Oh(this), Ph.update.call(this, e), this[bh] = !1) : Ph[s].call(this, e)), u = d ? {
                type: o.event || i,
                escapeConnect: n,
                batch: c
            } : c[0], this[Ih] = !1, t || this._messageCenter.trigger(u.type, u)
        }

        function Rh(e) {
            for (var t = this._pendingActions; t.length;) {
                var i = t.shift();
                Lh.call(this, i, e)
            }
        }

        function Bh(e) {
            e || this.trigger("updated")
        }

        function Uh(e, t, i, n) {
            for (var a = "component" === t, o = a ? e._componentsViews : e._chartsViews, r = a ? e._componentsMap : e._chartsMap, s = e._zr, l = e._api, d = 0; d < o.length; d++) o[d].__alive = !1;

            function u(e) {
                var t = "_ec_" + e.id + "_" + e.type, d = r[t];
                if (!d) {
                    var u = Ch(e.type);
                    (d = new (a ? lc.getClass(u.main, u.sub) : fc.getClass(u.sub))).init(i, l), r[t] = d, o.push(d), s.add(d.group)
                }
                e.__viewId = d.__id = t, d.__alive = !0, d.__model = e, d.group.__ecComponentInfo = {
                    mainType: e.mainType,
                    index: e.componentIndex
                }, a || n.prepareView(d, e, i, l)
            }

            for (a ? i.eachComponent(function (e, t) {
                "series" !== e && u(t)
            }) : i.eachSeries(u), d = 0; d < o.length;) {
                var c = o[d];
                c.__alive ? d++ : (a || c.renderTask.dispose(), s.remove(c.group), c.dispose(i, l), o.splice(d, 1), delete r[c.__id], c.__id = c.group.__ecComponentInfo = null)
            }
        }

        function Kh(e) {
            e.clearColorPalette(), e.eachSeries(function (e) {
                e.clearColorPalette()
            })
        }

        function Vh(e, t, i, n) {
            !function (e, t, i, n, a) {
                kh(e._componentsViews, function (e) {
                    var a = e.__model;
                    e.render(a, t, i, n), zh(a, e)
                })
            }(e, t, i, n), kh(e._chartsViews, function (e) {
                e.__alive = !1
            }), Wh(e, t, 0, n), kh(e._chartsViews, function (e) {
                e.__alive || e.remove(t, i)
            })
        }

        function Wh(e, t, i, n, o) {
            var r, s = e._scheduler;
            t.eachSeries(function (t) {
                var i = e._chartsMap[t.__viewId];
                i.__alive = !0;
                var a = i.renderTask;
                s.updatePayload(a, n), o && o.get(t.uid) && a.dirty(), r |= a.perform(s.getPerformArgs(a)), i.group.silent = !!t.get("silent"), zh(t, i), function (e, t) {
                    var i = e.get("blendMode") || null;
                    t.group.traverse(function (e) {
                        e.isGroup || e.style.blend !== i && e.setStyle("blend", i), e.eachPendingDisplayable && e.eachPendingDisplayable(function (e) {
                            e.setStyle("blend", i)
                        })
                    })
                }(t, i)
            }), s.unfinished |= r, function (e, t) {
                var i = e._zr.storage, n = 0;
                i.traverse(function (e) {
                    n++
                }), n > t.get("hoverLayerThreshold") && !a.node && t.eachSeries(function (t) {
                    if (!t.preventUsingHoverLayer) {
                        var i = e._chartsMap[t.__viewId];
                        i.__alive && i.group.traverse(function (e) {
                            e.useHoverLayer = !0
                        })
                    }
                })
            }(e, t), Ac(e._zr.dom, t)
        }

        function Gh(e, t) {
            kh(Jh, function (i) {
                i(e, t)
            })
        }

        xh.resize = function (e) {
            if (!this._disposed) {
                this._zr.resize(e);
                var t = this._model;
                if (this._loadingFX && this._loadingFX.resize(), t) {
                    var i = t.resetOption("media"), n = e && e.silent;
                    this[Ih] = !0, i && Oh(this), Ph.update.call(this), this[Ih] = !1, Rh.call(this, n), Bh.call(this, n)
                }
            }
        }, xh.showLoading = function (e, t) {
            if (!this._disposed && (wh(e) && (t = e, e = ""), e = e || "default", this.hideLoading(), ef[e])) {
                var i = ef[e](this._api, t), n = this._zr;
                this._loadingFX = i, n.add(i)
            }
        }, xh.hideLoading = function () {
            this._disposed || (this._loadingFX && this._zr.remove(this._loadingFX), this._loadingFX = null)
        }, xh.makeActionFromEvent = function (e) {
            var t = k({}, e);
            return t.type = $h[e.type], t
        }, xh.dispatchAction = function (e, t) {
            this._disposed || (wh(t) || (t = {silent: !!t}), Xh[e.type] && this._model && (this[Ih] ? this._pendingActions.push(e) : (Lh.call(this, e, t.silent), t.flush ? this._zr.flush(!0) : !1 !== t.flush && a.browser.weChat && this._throttledZrFlush(), Rh.call(this, t.silent), Bh.call(this, t.silent))))
        }, xh.appendData = function (e) {
            if (!this._disposed) {
                var t = e.seriesIndex;
                this.getModel().getSeriesByIndex(t).appendData(e), this._scheduler.unfinished = !0
            }
        }, xh.on = Dh("on", !1), xh.off = Dh("off", !1), xh.one = Dh("one", !1);
        var Hh = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];

        function zh(e, t) {
            var i = e.get("z"), n = e.get("zlevel");
            t.group.traverse(function (e) {
                "group" !== e.type && (null != i && (e.z = i), null != n && (e.zlevel = n))
            })
        }

        function jh() {
            this.eventInfo
        }

        xh._initEvents = function () {
            kh(Hh, function (e) {
                function t(t) {
                    var i, n = this.getModel(), a = t.target;
                    if ("globalout" === e) i = {}; else if (a && null != a.dataIndex) {
                        var o = a.dataModel || n.getSeriesByIndex(a.seriesIndex);
                        i = o && o.getDataParams(a.dataIndex, a.dataType, a) || {}
                    } else a && a.eventData && (i = k({}, a.eventData));
                    if (i) {
                        var r = i.componentType, s = i.componentIndex;
                        "markLine" !== r && "markPoint" !== r && "markArea" !== r || (r = "series", s = i.seriesIndex);
                        var l = r && null != s && n.getComponent(r, s),
                            d = l && this["series" === l.mainType ? "_chartsMap" : "_componentsMap"][l.__viewId];
                        i.event = t, i.type = e, this._ecEventProcessor.eventInfo = {
                            targetEl: a,
                            packedEvent: i,
                            model: l,
                            view: d
                        }, this.trigger(e, i)
                    }
                }

                t.zrEventfulCallAtLast = !0, this._zr.on(e, t, this)
            }, this), kh($h, function (e, t) {
                this._messageCenter.on(t, function (e) {
                    this.trigger(t, e)
                }, this)
            }, this)
        }, xh.isDisposed = function () {
            return this._disposed
        }, xh.clear = function () {
            this._disposed || this.setOption({series: []}, !0)
        }, xh.dispose = function () {
            if (!this._disposed) {
                this._disposed = !0, za(this.getDom(), rf, "");
                var e = this._api, t = this._model;
                kh(this._componentsViews, function (i) {
                    i.dispose(t, e)
                }), kh(this._chartsViews, function (i) {
                    i.dispose(t, e)
                }), this._zr.dispose(), delete tf[this.id]
            }
        }, b(Nh, Ne), jh.prototype = {
            constructor: jh, normalizeQuery: function (e) {
                var t = {}, i = {}, n = {};
                if (L(e)) {
                    var a = Ch(e);
                    t.mainType = a.main || null, t.subType = a.sub || null
                } else {
                    var o = ["Index", "Name", "Id"], r = {name: 1, dataIndex: 1, dataType: 1};
                    D(e, function (e, a) {
                        for (var s = !1, l = 0; l < o.length; l++) {
                            var d = o[l], u = a.lastIndexOf(d);
                            if (0 < u && u === a.length - d.length) {
                                var c = a.slice(0, u);
                                "data" !== c && (t.mainType = c, t[d.toLowerCase()] = e, s = !0)
                            }
                        }
                        r.hasOwnProperty(a) && (i[a] = e, s = !0), s || (n[a] = e)
                    })
                }
                return {cptQuery: t, dataQuery: i, otherQuery: n}
            }, filter: function (e, t, i) {
                var n = this.eventInfo;
                if (!n) return !0;
                var a = n.targetEl, o = n.packedEvent, r = n.model, s = n.view;
                if (!r || !s) return !0;
                var l = t.cptQuery, d = t.dataQuery;
                return u(l, r, "mainType") && u(l, r, "subType") && u(l, r, "index", "componentIndex") && u(l, r, "name") && u(l, r, "id") && u(d, o, "name") && u(d, o, "dataIndex") && u(d, o, "dataType") && (!s.filterForExposedEvent || s.filterForExposedEvent(e, t.otherQuery, a, o));

                function u(e, t, i, n) {
                    return null == e[i] || t[n || i] === e[i]
                }
            }, afterTrigger: function () {
                this.eventInfo = null
            }
        };
        var Xh = {}, $h = {}, Yh = [], qh = [], Jh = [], Zh = [], Qh = {}, ef = {}, tf = {}, nf = {}, af = new Date - 0,
            of = new Date - 0, rf = "_echarts_instance_";

        function sf(e) {
            nf[e] = !1
        }

        var lf = sf;

        function df(e) {
            return tf[function (e, t) {
                return e.getAttribute ? e.getAttribute(t) : e[t]
            }(e, rf)]
        }

        function uf(e, t) {
            Qh[e] = t
        }

        function cf(e) {
            qh.push(e)
        }

        function hf(e, t) {
            mf(Yh, e, t, 1e3)
        }

        function ff(e, t, i) {
            "function" == typeof t && (i = t, t = "");
            var n = wh(e) ? e.type : [e, e = {event: t}][0];
            e.event = (e.event || n).toLowerCase(), t = e.event, yh(_h.test(n) && _h.test(t)), Xh[n] || (Xh[n] = {
                action: i,
                actionInfo: e
            }), $h[t] = n
        }

        function gf(e, t) {
            iu.register(e, t)
        }

        function pf(e, t) {
            mf(Zh, e, t, 1e3, "layout")
        }

        function vf(e, t) {
            mf(Zh, e, t, 3e3, "visual")
        }

        function mf(e, t, i, n, a) {
            (Th(t) || wh(t)) && (i = t, t = n);
            var o = xc.wrapStageHandler(i, a);
            return o.__prio = t, o.__raw = i, e.push(o), o
        }

        function yf(e, t) {
            ef[e] = t
        }

        function kf(e) {
            return bd.extend(e)
        }

        function Tf(e) {
            return lc.extend(e)
        }

        function wf(e) {
            return ec.extend(e)
        }

        function Cf(e) {
            return fc.extend(e)
        }

        function Sf(e) {
            return e
        }

        function If(e, t, i, n, a) {
            this._old = e, this._new = t, this._oldKeyGetter = i || Sf, this._newKeyGetter = n || Sf, this.context = a
        }

        function bf(e, t, i, n, a) {
            for (var o = 0; o < e.length; o++) {
                var r = "_ec_" + a[n](e[o], o), s = t[r];
                null == s ? (i.push(r), t[r] = o) : (s.length || (t[r] = s = [s]), s.push(o))
            }
        }

        vf(2e3, _c), cf(Su), hf(900, function (e) {
            var t = Q();
            e.eachSeries(function (e) {
                var i = e.get("stack");
                if (i) {
                    var n = t.get(i) || t.set(i, []), a = e.getData(), o = {
                        stackResultDimension: a.getCalculationInfo("stackResultDimension"),
                        stackedOverDimension: a.getCalculationInfo("stackedOverDimension"),
                        stackedDimension: a.getCalculationInfo("stackedDimension"),
                        stackedByDimension: a.getCalculationInfo("stackedByDimension"),
                        isStackedByIndex: a.getCalculationInfo("isStackedByIndex"),
                        data: a,
                        seriesModel: e
                    };
                    if (!o.stackedDimension || !o.isStackedByIndex && !o.stackedByDimension) return;
                    n.length && a.setCalculationInfo("stackedOnSeries", n[n.length - 1].seriesModel), n.push(o)
                }
            }), t.each(Iu)
        }), yf("default", function (e, t) {
            T(t = t || {}, {
                text: "loading",
                textColor: "#000",
                fontSize: "12px",
                maskColor: "rgba(255, 255, 255, 0.8)",
                showSpinner: !0,
                color: "#c23531",
                spinnerRadius: 10,
                lineWidth: 5,
                zlevel: 0
            });
            var i = new Ai, n = new es({style: {fill: t.maskColor}, zlevel: t.zlevel, z: 1e4});
            i.add(n);
            var a = t.fontSize + " sans-serif", o = new es({
                style: {
                    fill: "none",
                    text: t.text,
                    font: a,
                    textPosition: "right",
                    textDistance: 10,
                    textFill: t.textColor
                }, zlevel: t.zlevel, z: 10001
            });
            if (i.add(o), t.showSpinner) {
                var r = new ss({
                    shape: {startAngle: -Nc / 2, endAngle: -Nc / 2 + .1, r: t.spinnerRadius},
                    style: {stroke: t.color, lineCap: "round", lineWidth: t.lineWidth},
                    zlevel: t.zlevel,
                    z: 10001
                });
                r.animateShape(!0).when(1e3, {endAngle: 3 * Nc / 2}).start("circularInOut"), r.animateShape(!0).when(1e3, {startAngle: 3 * Nc / 2}).delay(300).start("circularInOut"), i.add(r)
            }
            return i.resize = function () {
                var i = un(t.text, a), s = t.showSpinner ? t.spinnerRadius : 0,
                    l = (e.getWidth() - 2 * s - (t.showSpinner && i ? 10 : 0) - i) / 2 - (t.showSpinner ? 0 : i / 2),
                    d = e.getHeight() / 2;
                t.showSpinner && r.setShape({cx: l, cy: d}), o.setShape({
                    x: l - s,
                    y: d - s,
                    width: 2 * s,
                    height: 2 * s
                }), n.setShape({x: 0, y: 0, width: e.getWidth(), height: e.getHeight()})
            }, i.resize(), i
        }), ff({type: "highlight", event: "highlight", update: "highlight"}, te), ff({
            type: "downplay",
            event: "downplay",
            update: "downplay"
        }, te), uf("light", qc), uf("dark", Qc), If.prototype = {
            constructor: If, add: function (e) {
                return this._add = e, this
            }, update: function (e) {
                return this._update = e, this
            }, remove: function (e) {
                return this._remove = e, this
            }, execute: function () {
                var e = this._old, t = this._new, i = {}, n = [], a = [];
                for (bf(e, {}, n, "_oldKeyGetter", this), bf(t, i, a, "_newKeyGetter", this), o = 0; o < e.length; o++) null != (s = i[r = n[o]]) ? ((d = s.length) ? (1 === d && (i[r] = null), s = s.shift()) : i[r] = null, this._update && this._update(s, o)) : this._remove && this._remove(o);
                for (var o = 0; o < a.length; o++) {
                    var r = a[o];
                    if (i.hasOwnProperty(r)) {
                        var s;
                        if (null == (s = i[r])) continue;
                        if (s.length) for (var l = 0, d = s.length; l < d; l++) this._add && this._add(s[l]); else this._add && this._add(s)
                    }
                }
            }
        };
        var _f = Q(["tooltip", "label", "itemName", "itemId", "seriesName"]);

        function Df(e, t) {
            return e.hasOwnProperty(t) || (e[t] = []), e[t]
        }

        function Af(e) {
            return "category" === e ? "ordinal" : "time" === e ? "time" : "float"
        }

        function Nf(e) {
            null != e && k(this, e), this.otherDims = {}
        }

        var xf = R, Ef = "undefined", Pf = {
                float: typeof Float64Array == Ef ? Array : Float64Array,
                int: typeof Int32Array == Ef ? Array : Int32Array,
                ordinal: Array,
                number: Array,
                time: Array
            }, Of = typeof Uint32Array == Ef ? Array : Uint32Array, Mf = typeof Int32Array == Ef ? Array : Int32Array,
            Ff = typeof Uint16Array == Ef ? Array : Uint16Array;

        function Lf(e) {
            return 65535 < e._rawCount ? Of : Ff
        }

        var Rf = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_rawData", "_chunkSize", "_chunkCount", "_dimValueGetter", "_count", "_rawCount", "_nameDimIdx", "_idDimIdx"],
            Bf = ["_extent", "_approximateExtent", "_rawExtent"];

        function Uf(e, t) {
            D(Rf.concat(t.__wrappedMethods || []), function (i) {
                t.hasOwnProperty(i) && (e[i] = t[i])
            }), e.__wrappedMethods = t.__wrappedMethods, D(Bf, function (i) {
                e[i] = v(t[i])
            }), e._calculationInfo = k(t._calculationInfo)
        }

        var Kf = function (e, t) {
            e = e || ["x", "y"];
            for (var i = {}, n = [], a = {}, o = 0; o < e.length; o++) {
                var r = e[o];
                L(r) ? r = new Nf({name: r}) : r instanceof Nf || (r = new Nf(r));
                var s = r.name;
                r.type = r.type || "float", r.coordDim || (r.coordDim = s, r.coordDimIndex = 0), r.otherDims = r.otherDims || {}, n.push(s), (i[s] = r).index = o, r.createInvertedIndices && (a[s] = [])
            }
            this.dimensions = n, this._dimensionInfos = i, this.hostModel = t, this.dataType, this._indices = null, this._count = 0, this._rawCount = 0, this._storage = {}, this._nameList = [], this._idList = [], this._optionModels = [], this._visual = {}, this._layout = {}, this._itemVisuals = [], this.hasItemVisual = {}, this._itemLayouts = [], this._graphicEls = [], this._chunkSize = 1e5, this._chunkCount = 0, this._rawData, this._rawExtent = {}, this._extent = {}, this._approximateExtent = {}, this._dimensionsSummary = function (e) {
                var t = {}, i = t.encode = {}, n = Q(), a = [], o = [],
                    r = t.userOutput = {dimensionNames: e.dimensions.slice(), encode: {}};
                D(e.dimensions, function (t) {
                    var s = e.getDimensionInfo(t), l = s.coordDim;
                    if (l) {
                        var d = s.coordDimIndex;
                        Df(i, l)[d] = t, s.isExtraCoord || (n.set(l, 1), function (e) {
                            return !("ordinal" === e || "time" === e)
                        }(s.type) && (a[0] = t), Df(r.encode, l)[d] = s.index), s.defaultTooltip && o.push(t)
                    }
                    _f.each(function (e, t) {
                        var n = Df(i, t), a = s.otherDims[t];
                        null != a && !1 !== a && (n[a] = s.name)
                    })
                });
                var s = [], l = {};
                n.each(function (e, t) {
                    var n = i[t];
                    l[t] = n[0], s = s.concat(n)
                }), t.dataDimsOnCoord = s, t.encodeFirstDimNotExtra = l;
                var d = i.label;
                d && d.length && (a = d.slice());
                var u = i.tooltip;
                return u && u.length ? o = u.slice() : o.length || (o = a.slice()), i.defaultedLabel = a, i.defaultedTooltip = o, t
            }(this), this._invertedIndicesMap = a, this._calculationInfo = {}, this.userOutput = this._dimensionsSummary.userOutput
        }, Vf = Kf.prototype;

        function Wf(e, t, i, n, a) {
            var o = Pf[t.type], r = n - 1, s = t.name, l = e[s][r];
            if (l && l.length < i) {
                for (var d = new o(Math.min(a - r * i, i)), u = 0; u < l.length; u++) d[u] = l[u];
                e[s][r] = d
            }
            for (var c = n * i; c < a; c += i) e[s].push(new o(Math.min(a - c, i)))
        }

        function Gf(e) {
            var t = e._invertedIndicesMap;
            D(t, function (i, n) {
                var a = e._dimensionInfos[n].ordinalMeta;
                if (a) {
                    i = t[n] = new Mf(a.categories.length);
                    for (var o = 0; o < i.length; o++) i[o] = -1;
                    for (o = 0; o < e._count; o++) i[e.get(n, o)] = o
                }
            })
        }

        function Hf(e, t, i) {
            var n;
            if (null != t) {
                var a = e._chunkSize, o = Math.floor(i / a), r = i % a, s = e.dimensions[t], l = e._storage[s][o];
                if (l) {
                    n = l[r];
                    var d = e._dimensionInfos[s].ordinalMeta;
                    d && d.categories.length && (n = d.categories[n])
                }
            }
            return n
        }

        function zf(e) {
            return e
        }

        function jf(e) {
            return e < this._count && 0 <= e ? this._indices[e] : -1
        }

        function Xf(e, t) {
            var i = e._idList[t];
            return null == i && (i = Hf(e, e._idDimIdx, t)), null == i && (i = "e\0\0" + t), i
        }

        function $f(e) {
            return M(e) || (e = [e]), e
        }

        function Yf(e, t) {
            var i = e.dimensions, n = new Kf(A(i, e.getDimensionInfo, e), e.hostModel);
            Uf(n, e);
            for (var a = n._storage = {}, o = e._storage, r = 0; r < i.length; r++) {
                var s = i[r];
                o[s] && (0 <= S(t, s) ? (a[s] = qf(o[s]), n._rawExtent[s] = [1 / 0, -1 / 0], n._extent[s] = null) : a[s] = o[s])
            }
            return n
        }

        function qf(e) {
            for (var t, i, n = new Array(e.length), a = 0; a < e.length; a++) n[a] = (t = e[a], i = void 0, (i = t.constructor) === Array ? t.slice() : new i(t));
            return n
        }

        function Jf(e) {
            e.seriesIndex = this.seriesIndex, e.dataIndex = this.dataIndex, e.dataType = this.dataType
        }

        function Zf(e, t, i) {
            Ud.isInstance(t) || (t = Ud.seriesDataToSource(t)), i = i || {}, e = (e || []).slice();
            for (var n = (i.dimsDef || []).slice(), a = Q(), o = Q(), r = [], s = function (e, t, i, n) {
                var a = Math.max(e.dimensionsDetectCount || 1, t.length, i.length, n || 0);
                return D(t, function (e) {
                    var t = e.dimsDef;
                    t && (a = Math.max(a, t.length))
                }), a
            }(t, e, n, i.dimCount), l = 0; l < s; l++) {
                var d = n[l] = k({}, R(n[l]) ? n[l] : {name: n[l]}), u = d.name, c = r[l] = new Nf;
                null != u && null == a.get(u) && (c.name = c.displayName = u, a.set(u, l)), null != d.type && (c.type = d.type), null != d.displayName && (c.displayName = d.displayName)
            }
            var h = i.encodeDef;
            !h && i.encodeDefaulter && (h = i.encodeDefaulter(t, s)), (h = Q(h)).each(function (e, t) {
                if (1 === (e = Pa(e).slice()).length && !L(e[0]) && e[0] < 0) h.set(t, !1); else {
                    var i = h.set(t, []);
                    D(e, function (e, n) {
                        L(e) && (e = a.get(e)), null != e && e < s && (i[n] = e, g(r[e], t, n))
                    })
                }
            });
            var f = 0;

            function g(e, t, i) {
                null != _f.get(t) ? e.otherDims[t] = i : (e.coordDim = t, e.coordDimIndex = i, o.set(t, !0))
            }

            D(e, function (e, t) {
                var i, n, a;
                if (L(e)) i = e, e = {}; else {
                    i = e.name;
                    var o = e.ordinalMeta;
                    e.ordinalMeta = null, (e = v(e)).ordinalMeta = o, n = e.dimsDef, a = e.otherDims, e.name = e.coordDim = e.coordDimIndex = e.dimsDef = e.otherDims = null
                }
                if (!1 !== (s = h.get(i))) {
                    var s;
                    if (!(s = Pa(s)).length) for (var l = 0; l < (n && n.length || 1); l++) {
                        for (; f < r.length && null != r[f].coordDim;) f++;
                        f < r.length && s.push(f++)
                    }
                    D(s, function (t, o) {
                        var s = r[t];
                        if (g(T(s, e), i, o), null == s.name && n) {
                            var l = n[o];
                            R(l) || (l = {name: l}), s.name = s.displayName = l.name, s.defaultTooltip = l.defaultTooltip
                        }
                        a && T(s.otherDims, a)
                    })
                }
            });
            var p = i.generateCoord, m = i.generateCoordCount, y = null != m;
            m = p ? m || 1 : 0;
            for (var w, C, S = p || "value", I = 0; I < s; I++) null == (c = r[I] = r[I] || new Nf).coordDim && (c.coordDim = Qf(S, o, y), c.coordDimIndex = 0, (!p || m <= 0) && (c.isExtraCoord = !0), m--), null == c.name && (c.name = Qf(c.coordDim, a)), null == c.type && (w = t, C = I, c.name, $d(w.data, w.sourceFormat, w.seriesLayoutBy, w.dimensionsDefine, w.startIndex, C) === Kd.Must || c.isExtraCoord && (null != c.otherDims.itemName || null != c.otherDims.seriesName)) && (c.type = "ordinal");
            return r
        }

        function Qf(e, t, i) {
            if (i || null != t.get(e)) {
                for (var n = 0; null != t.get(e + n);) n++;
                e += n
            }
            return t.set(e, !0), e
        }

        Vf.type = "list", Vf.hasItemOption = !0, Vf.getDimension = function (e) {
            return "number" != typeof e && (isNaN(e) || this._dimensionInfos.hasOwnProperty(e)) || (e = this.dimensions[e]), e
        }, Vf.getDimensionInfo = function (e) {
            return this._dimensionInfos[this.getDimension(e)]
        }, Vf.getDimensionsOnCoord = function () {
            return this._dimensionsSummary.dataDimsOnCoord.slice()
        }, Vf.mapDimension = function (e, t) {
            var i = this._dimensionsSummary;
            if (null == t) return i.encodeFirstDimNotExtra[e];
            var n = i.encode[e];
            return !0 === t ? (n || []).slice() : n && n[t]
        }, Vf.initData = function (e, t, i) {
            (Ud.isInstance(e) || _(e)) && (e = new bu(e, this.dimensions.length)), this._rawData = e, this._storage = {}, this._indices = null, this._nameList = t || [], this._idList = [], this._nameRepeatCount = {}, i || (this.hasItemOption = !1), this.defaultDimValueGetter = Ou[this._rawData.getSource().sourceFormat], this._dimValueGetter = i = i || this.defaultDimValueGetter, this._dimValueGetterArrayRows = Ou.arrayRows, this._rawExtent = {}, this._initDataFromProvider(0, e.count()), e.pure && (this.hasItemOption = !1)
        }, Vf.getProvider = function () {
            return this._rawData
        }, Vf.appendData = function (e) {
            var t = this._rawData, i = this.count();
            t.appendData(e);
            var n = t.count();
            t.persistent || (n += i), this._initDataFromProvider(i, n)
        }, Vf.appendValues = function (e, t) {
            for (var i = this._chunkSize, n = this._storage, a = this.dimensions, o = a.length, r = this._rawExtent, s = this.count(), l = s + Math.max(e.length, t ? t.length : 0), d = this._chunkCount, u = 0; u < o; u++) r[m = a[u]] || (r[m] = [1 / 0, -1 / 0]), n[m] || (n[m] = []), Wf(n, this._dimensionInfos[m], i, d, l), this._chunkCount = n[m].length;
            for (var c = new Array(o), h = s; h < l; h++) {
                for (var f = h - s, g = Math.floor(h / i), p = h % i, v = 0; v < o; v++) {
                    var m = a[v], y = this._dimValueGetterArrayRows(e[f] || c, m, f, v);
                    n[m][g][p] = y;
                    var k = r[m];
                    y < k[0] && (k[0] = y), y > k[1] && (k[1] = y)
                }
                t && (this._nameList[h] = t[f])
            }
            this._rawCount = this._count = l, this._extent = {}, Gf(this)
        }, Vf._initDataFromProvider = function (e, t) {
            if (!(t <= e)) {
                for (var i, n = this._chunkSize, a = this._rawData, o = this._storage, r = this.dimensions, s = r.length, l = this._dimensionInfos, d = this._nameList, u = this._idList, c = this._rawExtent, h = this._nameRepeatCount = {}, f = this._chunkCount, g = 0; g < s; g++) {
                    c[w = r[g]] || (c[w] = [1 / 0, -1 / 0]);
                    var p = l[w];
                    0 === p.otherDims.itemName && (i = this._nameDimIdx = g), 0 === p.otherDims.itemId && (this._idDimIdx = g), o[w] || (o[w] = []), Wf(o, p, n, f, t), this._chunkCount = o[w].length
                }
                for (var v = new Array(s), m = e; m < t; m++) {
                    v = a.getItem(m, v);
                    for (var y = Math.floor(m / n), k = m % n, T = 0; T < s; T++) {
                        var w, C = o[w = r[T]][y], S = this._dimValueGetter(v, w, m, T);
                        C[k] = S;
                        var I = c[w];
                        S < I[0] && (I[0] = S), S > I[1] && (I[1] = S)
                    }
                    if (!a.pure) {
                        var b = d[m];
                        if (v && null == b) if (null != v.name) d[m] = b = v.name; else if (null != i) {
                            var _ = r[i], D = o[_][y];
                            if (D) {
                                b = D[k];
                                var A = l[_].ordinalMeta;
                                A && A.categories.length && (b = A.categories[b])
                            }
                        }
                        var N = null == v ? null : v.id;
                        null == N && null != b && (h[b] = h[b] || 0, 0 < h[N = b] && (N += "__ec__" + h[b]), h[b]++), null != N && (u[m] = N)
                    }
                }
                !a.persistent && a.clean && a.clean(), this._rawCount = this._count = t, this._extent = {}, Gf(this)
            }
        }, Vf.count = function () {
            return this._count
        }, Vf.getIndices = function () {
            var e = this._indices;
            if (e) {
                var t = e.constructor, i = this._count;
                if (t === Array) {
                    a = new t(i);
                    for (var n = 0; n < i; n++) a[n] = e[n]
                } else a = new t(e.buffer, 0, i)
            } else {
                var a = new (t = Lf(this))(this.count());
                for (n = 0; n < a.length; n++) a[n] = n
            }
            return a
        }, Vf.get = function (e, t) {
            if (!(0 <= t && t < this._count)) return NaN;
            var i = this._storage;
            if (!i[e]) return NaN;
            t = this.getRawIndex(t);
            var n = Math.floor(t / this._chunkSize), a = t % this._chunkSize;
            return i[e][n][a]
        }, Vf.getByRawIndex = function (e, t) {
            if (!(0 <= t && t < this._rawCount)) return NaN;
            var i = this._storage[e];
            if (!i) return NaN;
            var n = Math.floor(t / this._chunkSize), a = t % this._chunkSize;
            return i[n][a]
        }, Vf._getFast = function (e, t) {
            var i = Math.floor(t / this._chunkSize), n = t % this._chunkSize;
            return this._storage[e][i][n]
        }, Vf.getValues = function (e, t) {
            var i = [];
            M(e) || (t = e, e = this.dimensions);
            for (var n = 0, a = e.length; n < a; n++) i.push(this.get(e[n], t));
            return i
        }, Vf.hasValue = function (e) {
            for (var t = this._dimensionsSummary.dataDimsOnCoord, i = 0, n = t.length; i < n; i++) if (isNaN(this.get(t[i], e))) return !1;
            return !0
        }, Vf.getDataExtent = function (e) {
            e = this.getDimension(e);
            var t = this._storage[e], i = [1 / 0, -1 / 0];
            if (!t) return i;
            var n, a = this.count();
            if (!this._indices) return this._rawExtent[e].slice();
            if (n = this._extent[e]) return n.slice();
            for (var o = (n = i)[0], r = n[1], s = 0; s < a; s++) {
                var l = this._getFast(e, this.getRawIndex(s));
                l < o && (o = l), r < l && (r = l)
            }
            return n = [o, r], this._extent[e] = n
        }, Vf.getApproximateExtent = function (e) {
            return e = this.getDimension(e), this._approximateExtent[e] || this.getDataExtent(e)
        }, Vf.setApproximateExtent = function (e, t) {
            t = this.getDimension(t), this._approximateExtent[t] = e.slice()
        }, Vf.getCalculationInfo = function (e) {
            return this._calculationInfo[e]
        }, Vf.setCalculationInfo = function (e, t) {
            xf(e) ? k(this._calculationInfo, e) : this._calculationInfo[e] = t
        }, Vf.getSum = function (e) {
            var t = 0;
            if (this._storage[e]) for (var i = 0, n = this.count(); i < n; i++) {
                var a = this.get(e, i);
                isNaN(a) || (t += a)
            }
            return t
        }, Vf.getMedian = function (e) {
            var t = [];
            this.each(e, function (e, i) {
                isNaN(e) || t.push(e)
            });
            var i = [].concat(t).sort(function (e, t) {
                return e - t
            }), n = this.count();
            return 0 === n ? 0 : n % 2 == 1 ? i[(n - 1) / 2] : (i[n / 2] + i[n / 2 - 1]) / 2
        }, Vf.rawIndexOf = function (e, t) {
            var i = (e && this._invertedIndicesMap[e])[t];
            return null == i || isNaN(i) ? -1 : i
        }, Vf.indexOfName = function (e) {
            for (var t = 0, i = this.count(); t < i; t++) if (this.getName(t) === e) return t;
            return -1
        }, Vf.indexOfRawIndex = function (e) {
            if (e >= this._rawCount || e < 0) return -1;
            if (!this._indices) return e;
            var t = this._indices, i = t[e];
            if (null != i && i < this._count && i === e) return e;
            for (var n = 0, a = this._count - 1; n <= a;) {
                var o = (n + a) / 2 | 0;
                if (t[o] < e) n = 1 + o; else {
                    if (!(t[o] > e)) return o;
                    a = o - 1
                }
            }
            return -1
        }, Vf.indicesOfNearest = function (e, t, i) {
            var n = [];
            if (!this._storage[e]) return n;
            null == i && (i = 1 / 0);
            for (var a = 1 / 0, o = -1, r = 0, s = 0, l = this.count(); s < l; s++) {
                var d = t - this.get(e, s), u = Math.abs(d);
                u <= i && ((u < a || u === a && 0 <= d && o < 0) && (a = u, o = d, r = 0), d === o && (n[r++] = s))
            }
            return n.length = r, n
        }, Vf.getRawIndex = zf, Vf.getRawDataItem = function (e) {
            if (this._rawData.persistent) return this._rawData.getItem(this.getRawIndex(e));
            for (var t = [], i = 0; i < this.dimensions.length; i++) {
                var n = this.dimensions[i];
                t.push(this.get(n, e))
            }
            return t
        }, Vf.getName = function (e) {
            var t = this.getRawIndex(e);
            return this._nameList[t] || Hf(this, this._nameDimIdx, t) || ""
        }, Vf.getId = function (e) {
            return Xf(this, this.getRawIndex(e))
        }, Vf.each = function (e, t, i, n) {
            if (this._count) {
                "function" == typeof e && (n = i, i = t, t = e, e = []), i = i || n || this;
                for (var a = (e = A($f(e), this.getDimension, this)).length, o = 0; o < this.count(); o++) switch (a) {
                    case 0:
                        t.call(i, o);
                        break;
                    case 1:
                        t.call(i, this.get(e[0], o), o);
                        break;
                    case 2:
                        t.call(i, this.get(e[0], o), this.get(e[1], o), o);
                        break;
                    default:
                        for (var r = 0, s = []; r < a; r++) s[r] = this.get(e[r], o);
                        s[r] = o, t.apply(i, s)
                }
            }
        }, Vf.filterSelf = function (e, t, i, n) {
            if (this._count) {
                "function" == typeof e && (n = i, i = t, t = e, e = []), i = i || n || this, e = A($f(e), this.getDimension, this);
                for (var a = this.count(), o = new (Lf(this))(a), r = [], s = e.length, l = 0, d = e[0], u = 0; u < a; u++) {
                    var c, h = this.getRawIndex(u);
                    if (0 === s) c = t.call(i, u); else if (1 === s) {
                        var f = this._getFast(d, h);
                        c = t.call(i, f, u)
                    } else {
                        for (var g = 0; g < s; g++) r[g] = this._getFast(d, h);
                        r[g] = u, c = t.apply(i, r)
                    }
                    c && (o[l++] = h)
                }
                return l < a && (this._indices = o), this._count = l, this._extent = {}, this.getRawIndex = this._indices ? jf : zf, this
            }
        }, Vf.selectRange = function (e) {
            if (this._count) {
                var t = [];
                for (var i in e) e.hasOwnProperty(i) && t.push(i);
                var n = t.length;
                if (n) {
                    var a = this.count(), o = new (Lf(this))(a), r = 0, s = t[0], l = e[s][0], d = e[s][1], u = !1;
                    if (!this._indices) {
                        var c = 0;
                        if (1 === n) {
                            for (var h = this._storage[t[0]], f = 0; f < this._chunkCount; f++) for (var g = h[f], p = Math.min(this._count - f * this._chunkSize, this._chunkSize), v = 0; v < p; v++) (l <= (w = g[v]) && w <= d || isNaN(w)) && (o[r++] = c), c++;
                            u = !0
                        } else if (2 === n) {
                            h = this._storage[s];
                            var m = this._storage[t[1]], y = e[t[1]][0], k = e[t[1]][1];
                            for (f = 0; f < this._chunkCount; f++) {
                                g = h[f];
                                var T = m[f];
                                for (p = Math.min(this._count - f * this._chunkSize, this._chunkSize), v = 0; v < p; v++) {
                                    var w = g[v], C = T[v];
                                    (l <= w && w <= d || isNaN(w)) && (y <= C && C <= k || isNaN(C)) && (o[r++] = c), c++
                                }
                            }
                            u = !0
                        }
                    }
                    if (!u) if (1 === n) for (v = 0; v < a; v++) {
                        var S = this.getRawIndex(v);
                        (l <= (w = this._getFast(s, S)) && w <= d || isNaN(w)) && (o[r++] = S)
                    } else for (v = 0; v < a; v++) {
                        var I = !0;
                        for (S = this.getRawIndex(v), f = 0; f < n; f++) {
                            var b = t[f];
                            ((w = this._getFast(i, S)) < e[b][0] || w > e[b][1]) && (I = !1)
                        }
                        I && (o[r++] = this.getRawIndex(v))
                    }
                    return r < a && (this._indices = o), this._count = r, this._extent = {}, this.getRawIndex = this._indices ? jf : zf, this
                }
            }
        }, Vf.mapArray = function (e, t, i, n) {
            "function" == typeof e && (n = i, i = t, t = e, e = []), i = i || n || this;
            var a = [];
            return this.each(e, function () {
                a.push(t && t.apply(this, arguments))
            }, i), a
        }, Vf.map = function (e, t, i, n) {
            i = i || n || this;
            var a = Yf(this, e = A($f(e), this.getDimension, this));
            a._indices = this._indices, a.getRawIndex = a._indices ? jf : zf;
            for (var o = a._storage, r = [], s = this._chunkSize, l = e.length, d = this.count(), u = [], c = a._rawExtent, h = 0; h < d; h++) {
                for (var f = 0; f < l; f++) u[f] = this.get(e[f], h);
                u[l] = h;
                var g = t && t.apply(i, u);
                if (null != g) {
                    "object" != typeof g && (r[0] = g, g = r);
                    for (var p = this.getRawIndex(h), v = Math.floor(p / s), m = p % s, y = 0; y < g.length; y++) {
                        var k = e[y], T = g[y], w = c[k], C = o[k];
                        C && (C[v][m] = T), T < w[0] && (w[0] = T), T > w[1] && (w[1] = T)
                    }
                }
            }
            return a
        }, Vf.downSample = function (e, t, i, n) {
            for (var a = Yf(this, [e]), o = a._storage, r = [], s = Math.floor(1 / t), l = o[e], d = this.count(), u = this._chunkSize, c = a._rawExtent[e], h = new (Lf(this))(d), f = 0, g = 0; g < d; g += s) {
                d - g < s && (s = d - g, r.length = s);
                for (var p = 0; p < s; p++) {
                    var v = this.getRawIndex(g + p), m = Math.floor(v / u), y = v % u;
                    r[p] = l[m][y]
                }
                var k = i(r), T = this.getRawIndex(Math.min(g + n(r, k) || 0, d - 1)), w = T % u;
                (l[Math.floor(T / u)][w] = k) < c[0] && (c[0] = k), k > c[1] && (c[1] = k), h[f++] = T
            }
            return a._count = f, a._indices = h, a.getRawIndex = jf, a
        }, Vf.getItemModel = function (e) {
            var t = this.hostModel;
            return new Sl(this.getRawDataItem(e), t, t && t.ecModel)
        }, Vf.diff = function (e) {
            var t = this;
            return new If(e ? e.getIndices() : [], this.getIndices(), function (t) {
                return Xf(e, t)
            }, function (e) {
                return Xf(t, e)
            })
        }, Vf.getVisual = function (e) {
            var t = this._visual;
            return t && t[e]
        }, Vf.setVisual = function (e, t) {
            if (xf(e)) for (var i in e) e.hasOwnProperty(i) && this.setVisual(i, e[i]); else this._visual = this._visual || {}, this._visual[e] = t
        }, Vf.setLayout = function (e, t) {
            if (xf(e)) for (var i in e) e.hasOwnProperty(i) && this.setLayout(i, e[i]); else this._layout[e] = t
        }, Vf.getLayout = function (e) {
            return this._layout[e]
        }, Vf.getItemLayout = function (e) {
            return this._itemLayouts[e]
        }, Vf.setItemLayout = function (e, t, i) {
            this._itemLayouts[e] = i ? k(this._itemLayouts[e] || {}, t) : t
        }, Vf.clearItemLayouts = function () {
            this._itemLayouts.length = 0
        }, Vf.getItemVisual = function (e, t, i) {
            var n = this._itemVisuals[e], a = n && n[t];
            return null != a || i ? a : this.getVisual(t)
        }, Vf.setItemVisual = function (e, t, i) {
            var n = this._itemVisuals[e] || {}, a = this.hasItemVisual;
            if (this._itemVisuals[e] = n, xf(t)) for (var o in t) t.hasOwnProperty(o) && (n[o] = t[o], a[o] = !0); else n[t] = i, a[t] = !0
        }, Vf.clearAllVisual = function () {
            this._visual = {}, this._itemVisuals = [], this.hasItemVisual = {}
        }, Vf.setItemGraphicEl = function (e, t) {
            var i = this.hostModel;
            t && (t.dataIndex = e, t.dataType = this.dataType, t.seriesIndex = i && i.seriesIndex, "group" === t.type && t.traverse(Jf, t)), this._graphicEls[e] = t
        }, Vf.getItemGraphicEl = function (e) {
            return this._graphicEls[e]
        }, Vf.eachItemGraphicEl = function (e, t) {
            D(this._graphicEls, function (i, n) {
                i && e && e.call(t, i, n)
            })
        }, Vf.cloneShallow = function (e) {
            if (!e) {
                var t = A(this.dimensions, this.getDimensionInfo, this);
                e = new Kf(t, this.hostModel)
            }
            if (e._storage = this._storage, Uf(e, this), this._indices) {
                var i = this._indices.constructor;
                e._indices = new i(this._indices)
            } else e._indices = null;
            return e.getRawIndex = e._indices ? jf : zf, e
        }, Vf.wrapMethod = function (e, t) {
            var i = this[e];
            "function" == typeof i && (this.__wrappedMethods = this.__wrappedMethods || [], this.__wrappedMethods.push(e), this[e] = function () {
                var e = i.apply(this, arguments);
                return t.apply(this, [e].concat(z(arguments)))
            })
        }, Vf.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "map"], Vf.CHANGABLE_METHODS = ["filterSelf", "selectRange"];
        var eg = function (e, t) {
            return Zf((t = t || {}).coordDimensions || [], e, {
                dimsDef: t.dimensionsDefine || e.dimensionsDefine,
                encodeDef: t.encodeDefine || e.encodeDefine,
                dimCount: t.dimensionsCount,
                encodeDefaulter: t.encodeDefaulter,
                generateCoord: t.generateCoord,
                generateCoordCount: t.generateCoordCount
            })
        }, tg = {
            cartesian2d: function (e, t, i, n) {
                var a = e.getReferringComponents("xAxis")[0], o = e.getReferringComponents("yAxis")[0];
                t.coordSysDims = ["x", "y"], i.set("x", a), i.set("y", o), ig(a) && (n.set("x", a), t.firstCategoryDimIndex = 0), ig(o) && (n.set("y", o), t.firstCategoryDimIndex, t.firstCategoryDimIndex = 1)
            }, singleAxis: function (e, t, i, n) {
                var a = e.getReferringComponents("singleAxis")[0];
                t.coordSysDims = ["single"], i.set("single", a), ig(a) && (n.set("single", a), t.firstCategoryDimIndex = 0)
            }, polar: function (e, t, i, n) {
                var a = e.getReferringComponents("polar")[0], o = a.findAxisModel("radiusAxis"),
                    r = a.findAxisModel("angleAxis");
                t.coordSysDims = ["radius", "angle"], i.set("radius", o), i.set("angle", r), ig(o) && (n.set("radius", o), t.firstCategoryDimIndex = 0), ig(r) && (n.set("angle", r), null == t.firstCategoryDimIndex && (t.firstCategoryDimIndex = 1))
            }, geo: function (e, t, i, n) {
                t.coordSysDims = ["lng", "lat"]
            }, parallel: function (e, t, i, n) {
                var a = e.ecModel, o = a.getComponent("parallel", e.get("parallelIndex")),
                    r = t.coordSysDims = o.dimensions.slice();
                D(o.parallelAxisIndex, function (e, o) {
                    var s = a.getComponent("parallelAxis", e), l = r[o];
                    i.set(l, s), ig(s) && null == t.firstCategoryDimIndex && (n.set(l, s), t.firstCategoryDimIndex = o)
                })
            }
        };

        function ig(e) {
            return "category" === e.get("type")
        }

        function ng(e, t, i) {
            var n, a, o, r, s = (i = i || {}).byIndex, l = i.stackedCoordDimension, d = !(!e || !e.get("stack"));
            if (D(t, function (e, i) {
                L(e) && (t[i] = e = {name: e}), d && !e.isExtraCoord && (s || n || !e.ordinalMeta || (n = e), a || "ordinal" === e.type || "time" === e.type || l && l !== e.coordDim || (a = e))
            }), !a || s || n || (s = !0), a) {
                o = "__\0ecstackresult", r = "__\0ecstackedover", n && (n.createInvertedIndices = !0);
                var u = a.coordDim, c = a.type, h = 0;
                D(t, function (e) {
                    e.coordDim === u && h++
                }), t.push({
                    name: o,
                    coordDim: u,
                    coordDimIndex: h,
                    type: c,
                    isExtraCoord: !0,
                    isCalculationCoord: !0
                }), h++, t.push({
                    name: r,
                    coordDim: r,
                    coordDimIndex: h,
                    type: c,
                    isExtraCoord: !0,
                    isCalculationCoord: !0
                })
            }
            return {
                stackedDimension: a && a.name,
                stackedByDimension: n && n.name,
                isStackedByIndex: s,
                stackedOverDimension: r,
                stackResultDimension: o
            }
        }

        function ag(e, t) {
            return !!t && t === e.getCalculationInfo("stackedDimension")
        }

        function og(e, t) {
            return ag(e, t) ? e.getCalculationInfo("stackResultDimension") : t
        }

        function rg(e, t, i) {
            i = i || {}, Ud.isInstance(e) || (e = Ud.seriesDataToSource(e));
            var n, a = t.get("coordinateSystem"), o = iu.get(a), r = function (e) {
                var t = e.get("coordinateSystem"), i = new function (e) {
                    this.coordSysName = e, this.coordSysDims = [], this.axisMap = Q(), this.categoryAxisMap = Q(), this.firstCategoryDimIndex = null
                }(t), n = tg[t];
                if (n) return n(e, i, i.axisMap, i.categoryAxisMap), i
            }(t);
            r && (n = A(r.coordSysDims, function (e) {
                var t = {name: e}, i = r.axisMap.get(e);
                if (i) {
                    var n = i.get("type");
                    t.type = Af(n)
                }
                return t
            })), n = n || o && (o.getDimensionsInfo ? o.getDimensionsInfo() : o.dimensions.slice()) || ["x", "y"];
            var s, l, d = eg(e, {
                coordDimensions: n,
                generateCoord: i.generateCoord,
                encodeDefaulter: i.useEncodeDefaulter ? O(zd, n, t) : null
            });
            r && D(d, function (e, t) {
                var i = e.coordDim, n = r.categoryAxisMap.get(i);
                n && (null == s && (s = t), e.ordinalMeta = n.getOrdinalMeta()), null != e.otherDims.itemName && (l = !0)
            }), l || null == s || (d[s].otherDims.itemName = 0);
            var u = ng(t, d), c = new Kf(d, t);
            c.setCalculationInfo(u);
            var h = null != s && function (e) {
                if (e.sourceFormat === Ed) {
                    var t = function (e) {
                        for (var t = 0; t < e.length && null == e[t];) t++;
                        return e[t]
                    }(e.data || []);
                    return null != t && !M(Fa(t))
                }
            }(e) ? function (e, t, i, n) {
                return n === s ? i : this.defaultDimValueGetter(e, t, i, n)
            } : null;
            return c.hasItemOption = !1, c.initData(e, null, h), c
        }

        function sg(e) {
            this._setting = e || {}, this._extent = [1 / 0, -1 / 0], this._interval = 0, this.init && this.init.apply(this, arguments)
        }

        function lg(e) {
            this.categories = e.categories || [], this._needCollect = e.needCollect, this._deduplication = e.deduplication, this._map
        }

        sg.prototype.parse = function (e) {
            return e
        }, sg.prototype.getSetting = function (e) {
            return this._setting[e]
        }, sg.prototype.contain = function (e) {
            var t = this._extent;
            return e >= t[0] && e <= t[1]
        }, sg.prototype.normalize = function (e) {
            var t = this._extent;
            return t[1] === t[0] ? .5 : (e - t[0]) / (t[1] - t[0])
        }, sg.prototype.scale = function (e) {
            var t = this._extent;
            return e * (t[1] - t[0]) + t[0]
        }, sg.prototype.unionExtent = function (e) {
            var t = this._extent;
            e[0] < t[0] && (t[0] = e[0]), e[1] > t[1] && (t[1] = e[1])
        }, sg.prototype.unionExtentFromData = function (e, t) {
            this.unionExtent(e.getApproximateExtent(t))
        }, sg.prototype.getExtent = function () {
            return this._extent.slice()
        }, sg.prototype.setExtent = function (e, t) {
            var i = this._extent;
            isNaN(e) || (i[0] = e), isNaN(t) || (i[1] = t)
        }, sg.prototype.isBlank = function () {
            return this._isBlank
        }, sg.prototype.setBlank = function (e) {
            this._isBlank = e
        }, sg.prototype.getLabel = null, Ja(sg), io(sg, {registerWhenExtend: !0}), lg.createByAxisModel = function (e) {
            var t = e.option, i = t.data, n = i && A(i, cg);
            return new lg({categories: n, needCollect: !n, deduplication: !1 !== t.dedplication})
        };
        var dg = lg.prototype;

        function ug(e) {
            return e._map || (e._map = Q(e.categories))
        }

        function cg(e) {
            return R(e) && null != e.value ? e.value : e + ""
        }

        dg.getOrdinal = function (e) {
            return ug(this).get(e)
        }, dg.parseAndCollect = function (e) {
            var t, i = this._needCollect;
            if ("string" != typeof e && !i) return e;
            if (i && !this._deduplication) return t = this.categories.length, this.categories[t] = e, t;
            var n = ug(this);
            return null == (t = n.get(e)) && (i ? (t = this.categories.length, this.categories[t] = e, n.set(e, t)) : t = NaN), t
        };
        var hg = sg.prototype, fg = sg.extend({
            type: "ordinal", init: function (e, t) {
                e && !M(e) || (e = new lg({categories: e})), this._ordinalMeta = e, this._extent = t || [0, e.categories.length - 1]
            }, parse: function (e) {
                return "string" == typeof e ? this._ordinalMeta.getOrdinal(e) : Math.round(e)
            }, contain: function (e) {
                return e = this.parse(e), hg.contain.call(this, e) && null != this._ordinalMeta.categories[e]
            }, normalize: function (e) {
                return hg.normalize.call(this, this.parse(e))
            }, scale: function (e) {
                return Math.round(hg.scale.call(this, e))
            }, getTicks: function () {
                for (var e = [], t = this._extent, i = t[0]; i <= t[1];) e.push(i), i++;
                return e
            }, getLabel: function (e) {
                if (!this.isBlank()) return this._ordinalMeta.categories[e]
            }, count: function () {
                return this._extent[1] - this._extent[0] + 1
            }, unionExtentFromData: function (e, t) {
                this.unionExtent(e.getApproximateExtent(t))
            }, getOrdinalMeta: function () {
                return this._ordinalMeta
            }, niceTicks: te, niceExtent: te
        });
        fg.create = function () {
            return new fg
        };
        var gg = El;

        function pg(e) {
            return Ml(e) + 2
        }

        function vg(e, t, i) {
            e[t] = Math.max(Math.min(e[t], i[1]), i[0])
        }

        function mg(e, t) {
            isFinite(e[0]) || (e[0] = t[0]), isFinite(e[1]) || (e[1] = t[1]), vg(e, 0, t), vg(e, 1, t), e[0] > e[1] && (e[0] = e[1])
        }

        var yg = El, kg = sg.extend({
            type: "interval", _interval: 0, _intervalPrecision: 2, setExtent: function (e, t) {
                var i = this._extent;
                isNaN(e) || (i[0] = parseFloat(e)), isNaN(t) || (i[1] = parseFloat(t))
            }, unionExtent: function (e) {
                var t = this._extent;
                e[0] < t[0] && (t[0] = e[0]), e[1] > t[1] && (t[1] = e[1]), kg.prototype.setExtent.call(this, t[0], t[1])
            }, getInterval: function () {
                return this._interval
            }, setInterval: function (e) {
                this._interval = e, this._niceExtent = this._extent.slice(), this._intervalPrecision = pg(e)
            }, getTicks: function (e) {
                var t = this._interval, i = this._extent, n = this._niceExtent, a = this._intervalPrecision, o = [];
                if (!t) return o;
                i[0] < n[0] && (e ? o.push(yg(n[0] - t, a)) : o.push(i[0]));
                for (var r = n[0]; r <= n[1] && (o.push(r), (r = yg(r + t, a)) !== o[o.length - 1]);) if (1e4 < o.length) return [];
                var s = o.length ? o[o.length - 1] : n[1];
                return i[1] > s && (e ? o.push(yg(s + t, a)) : o.push(i[1])), o
            }, getMinorTicks: function (e) {
                for (var t = this.getTicks(!0), i = [], n = this.getExtent(), a = 1; a < t.length; a++) {
                    for (var o = t[a], r = t[a - 1], s = 0, l = [], d = (o - r) / e; s < e - 1;) {
                        var u = El(r + (s + 1) * d);
                        u > n[0] && u < n[1] && l.push(u), s++
                    }
                    i.push(l)
                }
                return i
            }, getLabel: function (e, t) {
                if (null == e) return "";
                var i = t && t.precision;
                return null == i ? i = Ml(e) || 0 : "auto" === i && (i = this._intervalPrecision), $l(e = yg(e, i, !0))
            }, niceTicks: function (e, t, i) {
                e = e || 5;
                var n = this._extent, a = n[1] - n[0];
                if (isFinite(a)) {
                    a < 0 && (a = -a, n.reverse());
                    var o = function (e, t, i, n) {
                        var a = {}, o = e[1] - e[0], r = a.interval = Hl(o / t, !0);
                        null != i && r < i && (r = a.interval = i), null != n && n < r && (r = a.interval = n);
                        var s = a.intervalPrecision = pg(r);
                        return mg(a.niceTickExtent = [gg(Math.ceil(e[0] / r) * r, s), gg(Math.floor(e[1] / r) * r, s)], e), a
                    }(n, e, t, i);
                    this._intervalPrecision = o.intervalPrecision, this._interval = o.interval, this._niceExtent = o.niceTickExtent
                }
            }, niceExtent: function (e) {
                var t = this._extent;
                if (t[0] === t[1]) if (0 !== t[0]) {
                    var i = t[0];
                    e.fixMax || (t[1] += i / 2), t[0] -= i / 2
                } else t[1] = 1;
                var n = t[1] - t[0];
                isFinite(n) || (t[0] = 0, t[1] = 1), this.niceTicks(e.splitNumber, e.minInterval, e.maxInterval);
                var a = this._interval;
                e.fixMin || (t[0] = yg(Math.floor(t[0] / a) * a)), e.fixMax || (t[1] = yg(Math.ceil(t[1] / a) * a))
            }
        });
        kg.create = function () {
            return new kg
        };
        var Tg = "__ec_stack_", wg = "undefined" != typeof Float32Array ? Float32Array : Array;

        function Cg(e) {
            return e.get("stack") || Tg + e.seriesIndex
        }

        function Sg(e) {
            return e.dim + e.index
        }

        function Ig(e, t) {
            var i = [];
            return t.eachSeriesByType(e, function (e) {
                xg(e) && !Eg(e) && i.push(e)
            }), i
        }

        function bg(e) {
            var t = function (e) {
                var t = {};
                D(e, function (e) {
                    var i = e.coordinateSystem.getBaseAxis();
                    if ("time" === i.type || "value" === i.type) for (var n = e.getData(), a = i.dim + "_" + i.index, o = n.mapDimension(i.dim), r = 0, s = n.count(); r < s; ++r) {
                        var l = n.get(o, r);
                        t[a] ? t[a].push(l) : t[a] = [l]
                    }
                });
                var i = [];
                for (var n in t) if (t.hasOwnProperty(n)) {
                    var a = t[n];
                    if (a) {
                        a.sort(function (e, t) {
                            return e - t
                        });
                        for (var o = null, r = 1; r < a.length; ++r) {
                            var s = a[r] - a[r - 1];
                            0 < s && (o = null === o ? s : Math.min(o, s))
                        }
                        i[n] = o
                    }
                }
                return i
            }(e), i = [];
            return D(e, function (e) {
                var n, a = e.coordinateSystem.getBaseAxis(), o = a.getExtent();
                if ("category" === a.type) n = a.getBandWidth(); else if ("value" === a.type || "time" === a.type) {
                    var r = a.dim + "_" + a.index, s = t[r], l = Math.abs(o[1] - o[0]), d = a.scale.getExtent(),
                        u = Math.abs(d[1] - d[0]);
                    n = s ? l / u * s : l
                } else {
                    var c = e.getData();
                    n = Math.abs(o[1] - o[0]) / c.count()
                }
                var h = xl(e.get("barWidth"), n), f = xl(e.get("barMaxWidth"), n), g = xl(e.get("barMinWidth") || 1, n),
                    p = e.get("barGap"), v = e.get("barCategoryGap");
                i.push({
                    bandWidth: n,
                    barWidth: h,
                    barMaxWidth: f,
                    barMinWidth: g,
                    barGap: p,
                    barCategoryGap: v,
                    axisKey: Sg(a),
                    stackId: Cg(e)
                })
            }), _g(i)
        }

        function _g(e) {
            var t = {};
            D(e, function (e, i) {
                var n = e.axisKey, a = e.bandWidth, o = t[n] || {
                    bandWidth: a,
                    remainedWidth: a,
                    autoWidthCount: 0,
                    categoryGap: "20%",
                    gap: "30%",
                    stacks: {}
                }, r = o.stacks;
                t[n] = o;
                var s = e.stackId;
                r[s] || o.autoWidthCount++, r[s] = r[s] || {width: 0, maxWidth: 0};
                var l = e.barWidth;
                l && !r[s].width && (r[s].width = l, l = Math.min(o.remainedWidth, l), o.remainedWidth -= l);
                var d = e.barMaxWidth;
                d && (r[s].maxWidth = d);
                var u = e.barMinWidth;
                u && (r[s].minWidth = u);
                var c = e.barGap;
                null != c && (o.gap = c);
                var h = e.barCategoryGap;
                null != h && (o.categoryGap = h)
            });
            var i = {};
            return D(t, function (e, t) {
                i[t] = {};
                var n = e.stacks, a = e.bandWidth, o = xl(e.categoryGap, a), r = xl(e.gap, 1), s = e.remainedWidth,
                    l = e.autoWidthCount, d = (s - o) / (l + (l - 1) * r);
                d = Math.max(d, 0), D(n, function (e) {
                    var t = e.maxWidth, i = e.minWidth;
                    if (e.width) n = e.width, t && (n = Math.min(n, t)), i && (n = Math.max(n, i)), e.width = n, s -= n + r * n, l--; else {
                        var n = d;
                        t && t < n && (n = Math.min(t, s)), i && n < i && (n = i), n !== d && (e.width = n, s -= n + r * n, l--)
                    }
                }), d = (s - o) / (l + (l - 1) * r), d = Math.max(d, 0);
                var u, c = 0;
                D(n, function (e, t) {
                    e.width || (e.width = d), c += (u = e).width * (1 + r)
                }), u && (c -= u.width * r);
                var h = -c / 2;
                D(n, function (e, n) {
                    i[t][n] = i[t][n] || {bandWidth: a, offset: h, width: e.width}, h += e.width * (1 + r)
                })
            }), i
        }

        function Dg(e, t, i) {
            if (e && t) {
                var n = e[Sg(t)];
                return null != n && null != i && (n = n[Cg(i)]), n
            }
        }

        function Ag(e, t) {
            var i = Ig(e, t), n = bg(i), a = {};
            D(i, function (e) {
                var t = e.getData(), i = e.coordinateSystem, o = i.getBaseAxis(), r = Cg(e), s = n[Sg(o)][r],
                    l = s.offset, d = s.width, u = i.getOtherAxis(o), c = e.get("barMinHeight") || 0;
                a[r] = a[r] || [], t.setLayout({bandWidth: s.bandWidth, offset: l, size: d});
                for (var h = t.mapDimension(u.dim), f = t.mapDimension(o.dim), g = ag(t, h), p = u.isHorizontal(), v = Pg(0, u), m = 0, y = t.count(); m < y; m++) {
                    var k, T, w, C, S, I = t.get(h, m), b = t.get(f, m), _ = 0 <= I ? "p" : "n", D = v;
                    g && (a[r][b] || (a[r][b] = {
                        p: v,
                        n: v
                    }), D = a[r][b][_]), p ? (k = D, T = (S = i.dataToPoint([I, b]))[1] + l, w = S[0] - v, C = d, Math.abs(w) < c && (w = (w < 0 ? -1 : 1) * c), isNaN(w) || g && (a[r][b][_] += w)) : (k = (S = i.dataToPoint([b, I]))[0] + l, T = D, w = d, C = S[1] - v, Math.abs(C) < c && (C = (C <= 0 ? -1 : 1) * c), isNaN(C) || g && (a[r][b][_] += C)), t.setItemLayout(m, {
                        x: k,
                        y: T,
                        width: w,
                        height: C
                    })
                }
            }, this)
        }

        var Ng = {
            seriesType: "bar", plan: uc(), reset: function (e) {
                if (xg(e) && Eg(e)) {
                    var t = e.getData(), i = e.coordinateSystem, n = i.grid.getRect(), a = i.getBaseAxis(),
                        o = i.getOtherAxis(a), r = t.mapDimension(o.dim), s = t.mapDimension(a.dim),
                        l = o.isHorizontal(), d = l ? 0 : 1, u = Dg(bg([e]), a, e).width;
                    return .5 < u || (u = .5), {
                        progress: function (e, t) {
                            for (var a, c = e.count, h = new wg(2 * c), f = new wg(2 * c), g = new wg(c), p = [], v = [], m = 0, y = 0; null != (a = e.next());) v[d] = t.get(r, a), v[1 - d] = t.get(s, a), p = i.dataToPoint(v, null, p), f[m] = l ? n.x + n.width : p[0], h[m++] = p[0], f[m] = l ? p[1] : n.y + n.height, h[m++] = p[1], g[y++] = a;
                            t.setLayout({
                                largePoints: h,
                                largeDataIndices: g,
                                largeBackgroundPoints: f,
                                barWidth: u,
                                valueAxisStart: Pg(0, o),
                                backgroundStart: l ? n.x : n.y,
                                valueAxisHorizontal: l
                            })
                        }
                    }
                }
            }
        };

        function xg(e) {
            return e.coordinateSystem && "cartesian2d" === e.coordinateSystem.type
        }

        function Eg(e) {
            return e.pipelineContext && e.pipelineContext.large
        }

        function Pg(e, t) {
            return t.toGlobalCoord(t.dataToCoord("log" === t.type ? 1 : 0))
        }

        var Og = kg.prototype, Mg = Math.ceil, Fg = Math.floor, Lg = 864e5, Rg = kg.extend({
            type: "time", getLabel: function (e) {
                var t = this._stepLvl, i = new Date(e);
                return rd(t[0], i, this.getSetting("useUTC"))
            }, niceExtent: function (e) {
                var t = this._extent;
                if (t[0] === t[1] && (t[0] -= Lg, t[1] += Lg), t[1] === -1 / 0 && t[0] === 1 / 0) {
                    var i = new Date;
                    t[1] = +new Date(i.getFullYear(), i.getMonth(), i.getDate()), t[0] = t[1] - Lg
                }
                this.niceTicks(e.splitNumber, e.minInterval, e.maxInterval);
                var n = this._interval;
                e.fixMin || (t[0] = El(Fg(t[0] / n) * n)), e.fixMax || (t[1] = El(Mg(t[1] / n) * n))
            }, niceTicks: function (e, t, i) {
                e = e || 10;
                var n = this._extent, a = n[1] - n[0], o = a / e;
                null != t && o < t && (o = t), null != i && i < o && (o = i);
                var r = Bg.length, s = function (e, t, i, n) {
                    for (; i < n;) {
                        var a = i + n >>> 1;
                        e[a][1] < t ? i = 1 + a : n = a
                    }
                    return i
                }(Bg, o, 0, r), l = Bg[Math.min(s, r - 1)], d = l[1];
                "year" === l[0] && (d *= Hl(a / d / e, !0));
                var u = this.getSetting("useUTC") ? 0 : 60 * new Date(+n[0] || +n[1]).getTimezoneOffset() * 1e3,
                    c = [Math.round(Mg((n[0] - u) / d) * d + u), Math.round(Fg((n[1] - u) / d) * d + u)];
                mg(c, n), this._stepLvl = l, this._interval = d, this._niceExtent = c
            }, parse: function (e) {
                return +Vl(e)
            }
        });
        D(["contain", "normalize"], function (e) {
            Rg.prototype[e] = function (t) {
                return Og[e].call(this, this.parse(t))
            }
        });
        var Bg = [["hh:mm:ss", 1e3], ["hh:mm:ss", 5e3], ["hh:mm:ss", 1e4], ["hh:mm:ss", 15e3], ["hh:mm:ss", 3e4], ["hh:mm\nMM-dd", 6e4], ["hh:mm\nMM-dd", 3e5], ["hh:mm\nMM-dd", 6e5], ["hh:mm\nMM-dd", 9e5], ["hh:mm\nMM-dd", 18e5], ["hh:mm\nMM-dd", 36e5], ["hh:mm\nMM-dd", 72e5], ["hh:mm\nMM-dd", 216e5], ["hh:mm\nMM-dd", 432e5], ["MM-dd\nyyyy", Lg], ["MM-dd\nyyyy", 2 * Lg], ["MM-dd\nyyyy", 3 * Lg], ["MM-dd\nyyyy", 4 * Lg], ["MM-dd\nyyyy", 5 * Lg], ["MM-dd\nyyyy", 6 * Lg], ["week", 7 * Lg], ["MM-dd\nyyyy", 864e6], ["week", 14 * Lg], ["week", 21 * Lg], ["month", 31 * Lg], ["week", 42 * Lg], ["month", 62 * Lg], ["week", 70 * Lg], ["quarter", 95 * Lg], ["month", 31 * Lg * 4], ["month", 13392e6], ["half-year", 16416e6], ["month", 31 * Lg * 8], ["month", 26784e6], ["year", 380 * Lg]];
        Rg.create = function (e) {
            return new Rg({useUTC: e.ecModel.get("useUTC")})
        };
        var Ug = sg.prototype, Kg = kg.prototype, Vg = Ml, Wg = El, Gg = Math.floor, Hg = Math.ceil, zg = Math.pow,
            jg = Math.log, Xg = sg.extend({
                type: "log", base: 10, $constructor: function () {
                    sg.apply(this, arguments), this._originalScale = new kg
                }, getTicks: function (e) {
                    var t = this._originalScale, i = this._extent, n = t.getExtent();
                    return A(Kg.getTicks.call(this, e), function (e) {
                        var a = El(zg(this.base, e));
                        return a = e === i[0] && t.__fixMin ? $g(a, n[0]) : a, a = e === i[1] && t.__fixMax ? $g(a, n[1]) : a
                    }, this)
                }, getMinorTicks: Kg.getMinorTicks, getLabel: Kg.getLabel, scale: function (e) {
                    return e = Ug.scale.call(this, e), zg(this.base, e)
                }, setExtent: function (e, t) {
                    var i = this.base;
                    e = jg(e) / jg(i), t = jg(t) / jg(i), Kg.setExtent.call(this, e, t)
                }, getExtent: function () {
                    var e = this.base, t = Ug.getExtent.call(this);
                    t[0] = zg(e, t[0]), t[1] = zg(e, t[1]);
                    var i = this._originalScale, n = i.getExtent();
                    return i.__fixMin && (t[0] = $g(t[0], n[0])), i.__fixMax && (t[1] = $g(t[1], n[1])), t
                }, unionExtent: function (e) {
                    this._originalScale.unionExtent(e);
                    var t = this.base;
                    e[0] = jg(e[0]) / jg(t), e[1] = jg(e[1]) / jg(t), Ug.unionExtent.call(this, e)
                }, unionExtentFromData: function (e, t) {
                    this.unionExtent(e.getApproximateExtent(t))
                }, niceTicks: function (e) {
                    e = e || 10;
                    var t = this._extent, i = t[1] - t[0];
                    if (!(i == 1 / 0 || i <= 0)) {
                        var n = Wl(i);
                        for (e / i * n <= .5 && (n *= 10); !isNaN(n) && Math.abs(n) < 1 && 0 < Math.abs(n);) n *= 10;
                        var a = [El(Hg(t[0] / n) * n), El(Gg(t[1] / n) * n)];
                        this._interval = n, this._niceExtent = a
                    }
                }, niceExtent: function (e) {
                    Kg.niceExtent.call(this, e);
                    var t = this._originalScale;
                    t.__fixMin = e.fixMin, t.__fixMax = e.fixMax
                }
            });

        function $g(e, t) {
            return Wg(e, Vg(t))
        }

        function Yg(e, t) {
            var i, n, a, o = e.type, r = t.getMin(), s = t.getMax(), l = e.getExtent();
            "ordinal" === o ? i = t.getCategories().length : (M(n = t.get("boundaryGap")) || (n = [n || 0, n || 0]), "boolean" == typeof n[0] && (n = [0, 0]), n[0] = xl(n[0], 1), n[1] = xl(n[1], 1), a = l[1] - l[0] || Math.abs(l[0])), "dataMin" === r ? r = l[0] : "function" == typeof r && (r = r({
                min: l[0],
                max: l[1]
            })), "dataMax" === s ? s = l[1] : "function" == typeof s && (s = s({min: l[0], max: l[1]}));
            var d = null != r, u = null != s;
            null == r && (r = "ordinal" === o ? i ? 0 : NaN : l[0] - n[0] * a), null == s && (s = "ordinal" === o ? i ? i - 1 : NaN : l[1] + n[1] * a), null != r && isFinite(r) || (r = NaN), null != s && isFinite(s) || (s = NaN), e.setBlank(V(r) || V(s) || "ordinal" === o && !e.getOrdinalMeta().categories.length), t.getNeedCrossZero() && (0 < r && 0 < s && !d && (r = 0), r < 0 && s < 0 && !u && (s = 0));
            var c = t.ecModel;
            if (c && "time" === o) {
                var h, f = Ig("bar", c);
                if (D(f, function (e) {
                    h |= e.getBaseAxis() === t.axis
                }), h) {
                    var g = bg(f), p = function (e, t, i, n) {
                        var a = i.axis.getExtent(), o = a[1] - a[0], r = Dg(n, i.axis);
                        if (void 0 === r) return {min: e, max: t};
                        var s = 1 / 0;
                        D(r, function (e) {
                            s = Math.min(e.offset, s)
                        });
                        var l = -1 / 0;
                        D(r, function (e) {
                            l = Math.max(e.offset + e.width, l)
                        }), s = Math.abs(s), l = Math.abs(l);
                        var d = s + l, u = t - e, c = u / (1 - (s + l) / o) - u;
                        return {min: e -= s / d * c, max: t += l / d * c}
                    }(r, s, t, g);
                    r = p.min, s = p.max
                }
            }
            return {extent: [r, s], fixMin: d, fixMax: u}
        }

        function qg(e, t) {
            var i = Yg(e, t), n = i.extent, a = t.get("splitNumber");
            "log" === e.type && (e.base = t.get("logBase"));
            var o = e.type;
            e.setExtent(n[0], n[1]), e.niceExtent({
                splitNumber: a,
                fixMin: i.fixMin,
                fixMax: i.fixMax,
                minInterval: "interval" === o || "time" === o ? t.get("minInterval") : null,
                maxInterval: "interval" === o || "time" === o ? t.get("maxInterval") : null
            });
            var r = t.get("interval");
            null != r && e.setInterval && e.setInterval(r)
        }

        function Jg(e, t) {
            if (t = t || e.get("type")) switch (t) {
                case"category":
                    return new fg(e.getOrdinalMeta ? e.getOrdinalMeta() : e.getCategories(), [1 / 0, -1 / 0]);
                case"value":
                    return new kg;
                default:
                    return (sg.getClass(t) || kg).create(e)
            }
        }

        function Zg(e) {
            var t, i = e.getLabelModel().get("formatter"), n = "category" === e.type ? e.scale.getExtent()[0] : null;
            return "string" == typeof i ? (t = i, i = function (i) {
                return i = e.scale.getLabel(i), t.replace("{value}", null != i ? i : "")
            }) : "function" == typeof i ? function (t, a) {
                return null != n && (a = t - n), i(Qg(e, t), a)
            } : function (t) {
                return e.scale.getLabel(t)
            }
        }

        function Qg(e, t) {
            return "category" === e.type ? e.scale.getLabel(t) : t
        }

        function ep(e) {
            var t = e.get("interval");
            return null == t ? "auto" : t
        }

        function tp(e) {
            return "category" === e.type && 0 === ep(e.getLabelModel())
        }

        D(["contain", "normalize"], function (e) {
            Xg.prototype[e] = function (t) {
                return t = jg(t) / jg(this.base), Ug[e].call(this, t)
            }
        }), Xg.create = function () {
            return new Xg
        };
        var ip = {
            getMin: function (e) {
                var t = this.option, i = e || null == t.rangeStart ? t.min : t.rangeStart;
                return this.axis && null != i && "dataMin" !== i && "function" != typeof i && !V(i) && (i = this.axis.scale.parse(i)), i
            }, getMax: function (e) {
                var t = this.option, i = e || null == t.rangeEnd ? t.max : t.rangeEnd;
                return this.axis && null != i && "dataMax" !== i && "function" != typeof i && !V(i) && (i = this.axis.scale.parse(i)), i
            }, getNeedCrossZero: function () {
                var e = this.option;
                return null == e.rangeStart && null == e.rangeEnd && !e.scale
            }, getCoordSysModel: te, setRange: function (e, t) {
                this.option.rangeStart = e, this.option.rangeEnd = t
            }, resetRange: function () {
                this.option.rangeStart = this.option.rangeEnd = null
            }
        }, np = Ss({
            type: "triangle", shape: {cx: 0, cy: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = t.width / 2, o = t.height / 2;
                e.moveTo(i, n - o), e.lineTo(i + a, n + o), e.lineTo(i - a, n + o), e.closePath()
            }
        }), ap = Ss({
            type: "diamond", shape: {cx: 0, cy: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = t.width / 2, o = t.height / 2;
                e.moveTo(i, n - o), e.lineTo(i + a, n), e.lineTo(i, n + o), e.lineTo(i - a, n), e.closePath()
            }
        }), op = Ss({
            type: "pin", shape: {x: 0, y: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.x, n = t.y, a = t.width / 5 * 3, o = Math.max(a, t.height), r = a / 2, s = r * r / (o - r),
                    l = n - o + r + s, d = Math.asin(s / r), u = Math.cos(d) * r, c = Math.sin(d), h = Math.cos(d),
                    f = .6 * r, g = .7 * r;
                e.moveTo(i - u, l + s), e.arc(i, l, r, Math.PI - d, 2 * Math.PI + d), e.bezierCurveTo(i + u - c * f, l + s + h * f, i, n - g, i, n), e.bezierCurveTo(i, n - g, i - u + c * f, l + s + h * f, i - u, l + s), e.closePath()
            }
        }), rp = Ss({
            type: "arrow", shape: {x: 0, y: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.height, n = t.width, a = t.x, o = t.y, r = n / 3 * 2;
                e.moveTo(a, o), e.lineTo(a + r, o + i), e.lineTo(a, o + i / 4 * 3), e.lineTo(a - r, o + i), e.lineTo(a, o), e.closePath()
            }
        }), sp = {
            line: function (e, t, i, n, a) {
                a.x1 = e, a.y1 = t + n / 2, a.x2 = e + i, a.y2 = t + n / 2
            }, rect: function (e, t, i, n, a) {
                a.x = e, a.y = t, a.width = i, a.height = n
            }, roundRect: function (e, t, i, n, a) {
                a.x = e, a.y = t, a.width = i, a.height = n, a.r = Math.min(i, n) / 4
            }, square: function (e, t, i, n, a) {
                var o = Math.min(i, n);
                a.x = e, a.y = t, a.width = o, a.height = o
            }, circle: function (e, t, i, n, a) {
                a.cx = e + i / 2, a.cy = t + n / 2, a.r = Math.min(i, n) / 2
            }, diamond: function (e, t, i, n, a) {
                a.cx = e + i / 2, a.cy = t + n / 2, a.width = i, a.height = n
            }, pin: function (e, t, i, n, a) {
                a.x = e + i / 2, a.y = t + n / 2, a.width = i, a.height = n
            }, arrow: function (e, t, i, n, a) {
                a.x = e + i / 2, a.y = t + n / 2, a.width = i, a.height = n
            }, triangle: function (e, t, i, n, a) {
                a.cx = e + i / 2, a.cy = t + n / 2, a.width = i, a.height = n
            }
        }, lp = {};
        D({
            line: is,
            rect: es,
            roundRect: es,
            square: es,
            circle: Vr,
            diamond: ap,
            pin: op,
            arrow: rp,
            triangle: np
        }, function (e, t) {
            lp[t] = new e
        });
        var dp = Ss({
            type: "symbol",
            shape: {symbolType: "", x: 0, y: 0, width: 0, height: 0},
            calculateTextPosition: function (e, t, i) {
                var n = gn(e, t, i), a = this.shape;
                return a && "pin" === a.symbolType && "inside" === t.textPosition && (n.y = i.y + .4 * i.height), n
            },
            buildPath: function (e, t, i) {
                var n = t.symbolType;
                if ("none" !== n) {
                    var a = lp[n];
                    a = a || lp[n = "rect"], sp[n](t.x, t.y, t.width, t.height, a.shape), a.buildPath(e, a.shape, i)
                }
            }
        });

        function up(e, t) {
            if ("image" !== this.type) {
                var i = this.style, n = this.shape;
                n && "line" === n.symbolType ? i.stroke = e : this.__isEmptyBrush ? (i.stroke = e, i.fill = t || "#fff") : (i.fill && (i.fill = e), i.stroke && (i.stroke = e)), this.dirty(!1)
            }
        }

        function cp(e, t, i, n, a, o, r) {
            var s, l = 0 === e.indexOf("empty");
            return l && (e = e.substr(5, 1).toLowerCase() + e.substr(6)), (s = 0 === e.indexOf("image://") ? Ds(e.slice(8), new Di(t, i, n, a), r ? "center" : "cover") : 0 === e.indexOf("path://") ? _s(e.slice(7), {}, new Di(t, i, n, a), r ? "center" : "cover") : new dp({
                shape: {
                    symbolType: e,
                    x: t,
                    y: i,
                    width: n,
                    height: a
                }
            })).__isEmptyBrush = l, s.setColor = up, s.setColor(o), s
        }

        var hp = {isDimensionStacked: ag, enableDataStack: ng, getStackedDimension: og},
            fp = (Object.freeze || Object)({
                createList: function (e) {
                    return rg(e.getSource(), e)
                }, getLayoutRect: vd, dataStack: hp, createScale: function (e, t) {
                    var i = t;
                    Sl.isInstance(t) || b(i = new Sl(t), ip);
                    var n = Jg(i);
                    return n.setExtent(e[0], e[1]), qg(n, i), n
                }, mixinAxisModelCommonMethods: function (e) {
                    b(e, ip)
                }, completeDimensions: Zf, createDimensions: eg, createSymbol: cp
            }), gp = 1e-8;

        function pp(e, t) {
            return Math.abs(e - t) < gp
        }

        function vp(e, t, i) {
            var n = 0, a = e[0];
            if (!a) return !1;
            for (var o = 1; o < e.length; o++) {
                var r = e[o];
                n += lr(a[0], a[1], r[0], r[1], t, i), a = r
            }
            var s = e[0];
            return pp(a[0], s[0]) && pp(a[1], s[1]) || (n += lr(a[0], a[1], s[0], s[1], t, i)), 0 !== n
        }

        function mp(e, t, i) {
            if (this.name = e, this.geometries = t, i) i = [i[0], i[1]]; else {
                var n = this.getBoundingRect();
                i = [n.x + n.width / 2, n.y + n.height / 2]
            }
            this.center = i
        }

        function yp(e, t, i) {
            for (var n = [], a = t[0], o = t[1], r = 0; r < e.length; r += 2) {
                var s = e.charCodeAt(r) - 64, l = e.charCodeAt(r + 1) - 64;
                s = s >> 1 ^ -(1 & s), l = l >> 1 ^ -(1 & l), a = s += a, o = l += o, n.push([s / i, l / i])
            }
            return n
        }

        function kp(e, t) {
            return function (e) {
                if (e.UTF8Encoding) {
                    var t = e.UTF8Scale;
                    null == t && (t = 1024);
                    for (var i = e.features, n = 0; n < i.length; n++) for (var a = i[n].geometry, o = a.coordinates, r = a.encodeOffsets, s = 0; s < o.length; s++) {
                        var l = o[s];
                        if ("Polygon" === a.type) o[s] = yp(l, r[s], t); else if ("MultiPolygon" === a.type) for (var d = 0; d < l.length; d++) {
                            var u = l[d];
                            l[d] = yp(u, r[s][d], t)
                        }
                    }
                    e.UTF8Encoding = !1
                }
            }(e), A(x(e.features, function (e) {
                return e.geometry && e.properties && 0 < e.geometry.coordinates.length
            }), function (e) {
                var i = e.properties, n = e.geometry, a = n.coordinates, o = [];
                "Polygon" === n.type && o.push({
                    type: "polygon",
                    exterior: a[0],
                    interiors: a.slice(1)
                }), "MultiPolygon" === n.type && D(a, function (e) {
                    e[0] && o.push({type: "polygon", exterior: e[0], interiors: e.slice(1)})
                });
                var r = new mp(i[t || "name"], o, i.cp);
                return r.properties = i, r
            })
        }

        mp.prototype = {
            constructor: mp, properties: null, getBoundingRect: function () {
                var e = this._rect;
                if (e) return e;
                for (var t = Number.MAX_VALUE, i = [t, t], n = [-t, -t], a = [], o = [], r = this.geometries, s = 0; s < r.length; s++) "polygon" === r[s].type && (Lo(r[s].exterior, a, o), Se(i, i, a), Ie(n, n, o));
                return 0 === s && (i[0] = i[1] = n[0] = n[1] = 0), this._rect = new Di(i[0], i[1], n[0] - i[0], n[1] - i[1])
            }, contain: function (e) {
                var t = this.getBoundingRect(), i = this.geometries;
                if (!t.contain(e[0], e[1])) return !1;
                e:for (var n = 0, a = i.length; n < a; n++) if ("polygon" === i[n].type) {
                    var o = i[n].exterior, r = i[n].interiors;
                    if (vp(o, e[0], e[1])) {
                        for (var s = 0; s < (r ? r.length : 0); s++) if (vp(r[s])) continue e;
                        return !0
                    }
                }
                return !1
            }, transformTo: function (e, t, i, n) {
                var a = this.getBoundingRect(), o = a.width / a.height;
                i ? n = n || i / o : i = o * n;
                for (var r = new Di(e, t, i, n), s = a.calculateTransform(r), l = this.geometries, d = 0; d < l.length; d++) if ("polygon" === l[d].type) {
                    for (var u = l[d].exterior, c = l[d].interiors, h = 0; h < u.length; h++) Ce(u[h], u[h], s);
                    for (var f = 0; f < (c ? c.length : 0); f++) for (h = 0; h < c[f].length; h++) Ce(c[f][h], c[f][h], s)
                }
                (a = this._rect).copy(r), this.center = [a.x + a.width / 2, a.y + a.height / 2]
            }, cloneShallow: function (e) {
                null == e && (e = this.name);
                var t = new mp(e, this.geometries, this.center);
                return t._rect = this._rect, t.transformTo = null, t
            }
        };
        var Tp = Va();

        function wp(e, t) {
            var i, n = Cp(e, "labels"), a = ep(t), o = Sp(n, a);
            return o || Ip(n, a, {
                labels: F(a) ? _p(e, a) : bp(e, i = "auto" === a ? function (e) {
                    var t = Tp(e).autoInterval;
                    return null != t ? t : Tp(e).autoInterval = e.calculateCategoryInterval()
                }(e) : a), labelCategoryInterval: i
            })
        }

        function Cp(e, t) {
            return Tp(e)[t] || (Tp(e)[t] = [])
        }

        function Sp(e, t) {
            for (var i = 0; i < e.length; i++) if (e[i].key === t) return e[i].value
        }

        function Ip(e, t, i) {
            return e.push({key: t, value: i}), i
        }

        function bp(e, t, i) {
            var n = Zg(e), a = e.scale, o = a.getExtent(), r = e.getLabelModel(), s = [], l = Math.max((t || 0) + 1, 1),
                d = o[0], u = a.count();
            0 !== d && 1 < l && 2 < u / l && (d = Math.round(Math.ceil(d / l) * l));
            var c = tp(e), h = r.get("showMinLabel") || c, f = r.get("showMaxLabel") || c;
            h && d !== o[0] && p(o[0]);
            for (var g = d; g <= o[1]; g += l) p(g);

            function p(e) {
                s.push(i ? e : {formattedLabel: n(e), rawLabel: a.getLabel(e), tickValue: e})
            }

            return f && g - l !== o[1] && p(o[1]), s
        }

        function _p(e, t, i) {
            var n = e.scale, a = Zg(e), o = [];
            return D(n.getTicks(), function (e) {
                var r = n.getLabel(e);
                t(e, r) && o.push(i ? e : {formattedLabel: a(e), rawLabel: r, tickValue: e})
            }), o
        }

        var Dp = [0, 1], Ap = function (e, t, i) {
            this.dim = e, this.scale = t, this._extent = i || [0, 0], this.inverse = !1, this.onBand = !1
        };

        function Np(e, t) {
            var i = (e[1] - e[0]) / t / 2;
            e[0] += i, e[1] -= i
        }

        Ap.prototype = {
            constructor: Ap, contain: function (e) {
                var t = this._extent, i = Math.min(t[0], t[1]), n = Math.max(t[0], t[1]);
                return i <= e && e <= n
            }, containData: function (e) {
                return this.scale.contain(e)
            }, getExtent: function () {
                return this._extent.slice()
            }, getPixelPrecision: function (e) {
                return Fl(e || this.scale.getExtent(), this._extent)
            }, setExtent: function (e, t) {
                var i = this._extent;
                i[0] = e, i[1] = t
            }, dataToCoord: function (e, t) {
                var i = this._extent, n = this.scale;
                return e = n.normalize(e), this.onBand && "ordinal" === n.type && Np(i = i.slice(), n.count()), Nl(e, Dp, i, t)
            }, coordToData: function (e, t) {
                var i = this._extent, n = this.scale;
                this.onBand && "ordinal" === n.type && Np(i = i.slice(), n.count());
                var a = Nl(e, i, Dp, t);
                return this.scale.scale(a)
            }, pointToData: function (e, t) {
            }, getTicksCoords: function (e) {
                var t = (e = e || {}).tickModel || this.getTickModel(), i = A(function (e, t) {
                    return "category" === e.type ? function (e, t) {
                        var i, n, a = Cp(e, "ticks"), o = ep(t), r = Sp(a, o);
                        if (r) return r;
                        if (t.get("show") && !e.scale.isBlank() || (i = []), F(o)) i = _p(e, o, !0); else if ("auto" === o) {
                            var s = wp(e, e.getLabelModel());
                            n = s.labelCategoryInterval, i = A(s.labels, function (e) {
                                return e.tickValue
                            })
                        } else i = bp(e, n = o, !0);
                        return Ip(a, o, {ticks: i, tickCategoryInterval: n})
                    }(e, t) : {ticks: e.scale.getTicks()}
                }(this, t).ticks, function (e) {
                    return {coord: this.dataToCoord(e), tickValue: e}
                }, this);
                return function (e, t, i, n) {
                    var a = t.length;
                    if (e.onBand && !i && a) {
                        var o, r, s = e.getExtent();
                        if (1 === a) t[0].coord = s[0], o = t[1] = {coord: s[0]}; else {
                            var l = t[a - 1].tickValue - t[0].tickValue, d = (t[a - 1].coord - t[0].coord) / l;
                            D(t, function (e) {
                                e.coord -= d / 2
                            });
                            var u = e.scale.getExtent();
                            r = 1 + u[1] - t[a - 1].tickValue, o = {coord: t[a - 1].coord + d * r}, t.push(o)
                        }
                        var c = s[0] > s[1];
                        h(t[0].coord, s[0]) && (n ? t[0].coord = s[0] : t.shift()), n && h(s[0], t[0].coord) && t.unshift({coord: s[0]}), h(s[1], o.coord) && (n ? o.coord = s[1] : t.pop()), n && h(o.coord, s[1]) && t.push({coord: s[1]})
                    }

                    function h(e, t) {
                        return e = El(e), t = El(t), c ? t < e : e < t
                    }
                }(this, i, t.get("alignWithLabel"), e.clamp), i
            }, getMinorTicksCoords: function () {
                if ("ordinal" === this.scale.type) return [];
                var e = this.model.getModel("minorTick").get("splitNumber");
                return 0 < e && e < 100 || (e = 5), A(this.scale.getMinorTicks(e), function (e) {
                    return A(e, function (e) {
                        return {coord: this.dataToCoord(e), tickValue: e}
                    }, this)
                }, this)
            }, getViewLabels: function () {
                return (e = this, "category" === e.type ? function (e) {
                    var t = e.getLabelModel(), i = wp(e, t);
                    return !t.get("show") || e.scale.isBlank() ? {
                        labels: [],
                        labelCategoryInterval: i.labelCategoryInterval
                    } : i
                }(e) : function (e) {
                    var t = e.scale.getTicks(), i = Zg(e);
                    return {
                        labels: A(t, function (t, n) {
                            return {formattedLabel: i(t, n), rawLabel: e.scale.getLabel(t), tickValue: t}
                        })
                    }
                }(e)).labels;
                var e
            }, getLabelModel: function () {
                return this.model.getModel("axisLabel")
            }, getTickModel: function () {
                return this.model.getModel("axisTick")
            }, getBandWidth: function () {
                var e = this._extent, t = this.scale.getExtent(), i = t[1] - t[0] + (this.onBand ? 1 : 0);
                0 === i && (i = 1);
                var n = Math.abs(e[1] - e[0]);
                return Math.abs(n) / i
            }, isHorizontal: null, getRotate: null, calculateCategoryInterval: function () {
                return function (e) {
                    var t = function (e) {
                            var t = e.getLabelModel();
                            return {
                                axisRotate: e.getRotate ? e.getRotate() : e.isHorizontal && !e.isHorizontal() ? 90 : 0,
                                labelRotate: t.get("rotate") || 0,
                                font: t.getFont()
                            }
                        }(e), i = Zg(e), n = (t.axisRotate - t.labelRotate) / 180 * Math.PI, a = e.scale, o = a.getExtent(),
                        r = a.count();
                    if (o[1] - o[0] < 1) return 0;
                    var s = 1;
                    40 < r && (s = Math.max(1, Math.floor(r / 40)));
                    for (var l = o[0], d = e.dataToCoord(l + 1) - e.dataToCoord(l), u = Math.abs(d * Math.cos(n)), c = Math.abs(d * Math.sin(n)), h = 0, f = 0; l <= o[1]; l += s) {
                        var g, p, v = cn(i(l), t.font, "center", "top");
                        g = 1.3 * v.width, p = 1.3 * v.height, h = Math.max(h, g, 7), f = Math.max(f, p, 7)
                    }
                    var m = h / u, y = f / c;
                    isNaN(m) && (m = 1 / 0), isNaN(y) && (y = 1 / 0);
                    var k = Math.max(0, Math.floor(Math.min(m, y))), T = Tp(e.model), w = e.getExtent(),
                        C = T.lastAutoInterval, S = T.lastTickCount;
                    return null != C && null != S && Math.abs(C - k) <= 1 && Math.abs(S - r) <= 1 && k < C && T.axisExtend0 === w[0] && T.axisExtend1 === w[1] ? k = C : (T.lastTickCount = r, T.lastAutoInterval = k, T.axisExtend0 = w[0], T.axisExtend1 = w[1]), k
                }(this)
            }
        };
        var xp = kp, Ep = {};
        D(["map", "each", "filter", "indexOf", "inherits", "reduce", "filter", "bind", "curry", "isArray", "isString", "isObject", "isFunction", "extend", "defaults", "clone", "merge"], function (e) {
            Ep[e] = ie[e]
        });
        var Pp = {};

        function Op(e, t) {
            var i = e.mapDimension("defaultedLabel", !0), n = i.length;
            if (1 === n) return Lu(e, t, i[0]);
            if (n) {
                for (var a = [], o = 0; o < i.length; o++) {
                    var r = Lu(e, t, i[o]);
                    a.push(r)
                }
                return a.join(" ")
            }
        }

        function Mp(e, t, i) {
            Ai.call(this), this.updateData(e, t, i)
        }

        D(["extendShape", "extendPath", "makePath", "makeImage", "mergePath", "resizePath", "createIcon", "setHoverStyle", "setLabelStyle", "setTextStyle", "setText", "getFont", "updateProps", "initProps", "getTransform", "clipPointsByRect", "clipRectByRect", "registerShape", "getShapeClass", "Group", "Image", "Text", "Circle", "Sector", "Ring", "Polygon", "Polyline", "Rect", "Line", "BezierCurve", "Arc", "IncrementalDisplayable", "CompoundPath", "LinearGradient", "RadialGradient", "BoundingRect"], function (e) {
            Pp[e] = vl[e]
        }), ec.extend({
            type: "series.line",
            dependencies: ["grid", "polar"],
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                hoverAnimation: !0,
                clip: !0,
                label: {position: "top"},
                lineStyle: {width: 2, type: "solid"},
                step: !1,
                smooth: !1,
                smoothMonotone: null,
                symbol: "emptyCircle",
                symbolSize: 4,
                symbolRotate: null,
                showSymbol: !0,
                showAllSymbol: "auto",
                connectNulls: !1,
                sampling: "none",
                animationEasing: "linear",
                progressive: 0,
                hoverLayerThreshold: 1 / 0
            }
        });
        var Fp = Mp.prototype, Lp = Mp.getSymbolSize = function (e, t) {
            var i = e.getItemVisual(t, "symbolSize");
            return i instanceof Array ? i.slice() : [+i, +i]
        };

        function Rp(e) {
            return [e[0] / 2, e[1] / 2]
        }

        function Bp(e, t) {
            this.parent.drift(e, t)
        }

        Fp._createSymbol = function (e, t, i, n, a) {
            this.removeAll();
            var o = cp(e, -1, -1, 2, 2, t.getItemVisual(i, "color"), a);
            o.attr({z2: 100, culling: !0, scale: Rp(n)}), o.drift = Bp, this._symbolType = e, this.add(o)
        }, Fp.stopSymbolAnimation = function (e) {
            this.childAt(0).stopAnimation(e)
        }, Fp.getSymbolPath = function () {
            return this.childAt(0)
        }, Fp.getScale = function () {
            return this.childAt(0).scale
        }, Fp.highlight = function () {
            this.childAt(0).trigger("emphasis")
        }, Fp.downplay = function () {
            this.childAt(0).trigger("normal")
        }, Fp.setZ = function (e, t) {
            var i = this.childAt(0);
            i.zlevel = e, i.z = t
        }, Fp.setDraggable = function (e) {
            var t = this.childAt(0);
            t.draggable = e, t.cursor = e ? "move" : t.cursor
        }, Fp.updateData = function (e, t, i) {
            this.silent = !1;
            var n = e.getItemVisual(t, "symbol") || "circle", a = e.hostModel, o = Lp(e, t), r = n !== this._symbolType;
            if (r) {
                var s = e.getItemVisual(t, "symbolKeepAspect");
                this._createSymbol(n, e, t, o, s)
            } else (l = this.childAt(0)).silent = !1, ol(l, {scale: Rp(o)}, a, t);
            if (this._updateCommon(e, t, o, i), r) {
                var l = this.childAt(0), d = i && i.fadeIn, u = {scale: l.scale.slice()};
                d && (u.style = {opacity: l.style.opacity}), l.scale = [0, 0], d && (l.style.opacity = 0), rl(l, u, a, t)
            }
            this._seriesModel = a
        };
        var Up = ["itemStyle"], Kp = ["emphasis", "itemStyle"], Vp = ["label"], Wp = ["emphasis", "label"];

        function Gp(e, t) {
            if (!this.incremental && !this.useHoverLayer) if ("emphasis" === t) {
                var i = this.__symbolOriginalScale, n = i[1] / i[0],
                    a = {scale: [Math.max(1.1 * i[0], i[0] + 3), Math.max(1.1 * i[1], i[1] + 3 * n)]};
                this.animateTo(a, 400, "elasticOut")
            } else "normal" === t && this.animateTo({scale: this.__symbolOriginalScale}, 400, "elasticOut")
        }

        function Hp(e) {
            this.group = new Ai, this._symbolCtor = e || Mp
        }

        Fp._updateCommon = function (e, t, i, n) {
            var a = this.childAt(0), o = e.hostModel, r = e.getItemVisual(t, "color");
            "image" !== a.type ? a.useStyle({strokeNoScale: !0}) : a.setStyle({
                opacity: null,
                shadowBlur: null,
                shadowOffsetX: null,
                shadowOffsetY: null,
                shadowColor: null
            });
            var s = n && n.itemStyle, l = n && n.hoverItemStyle, d = n && n.symbolOffset, u = n && n.labelModel,
                c = n && n.hoverLabelModel, h = n && n.hoverAnimation, f = n && n.cursorStyle;
            if (!n || e.hasItemOption) {
                var g = n && n.itemModel ? n.itemModel : e.getItemModel(t);
                s = g.getModel(Up).getItemStyle(["color"]), l = g.getModel(Kp).getItemStyle(), d = g.getShallow("symbolOffset"), u = g.getModel(Vp), c = g.getModel(Wp), h = g.getShallow("hoverAnimation"), f = g.getShallow("cursor")
            } else l = k({}, l);
            var p = a.style, v = e.getItemVisual(t, "symbolRotate");
            a.attr("rotation", (v || 0) * Math.PI / 180 || 0), d && a.attr("position", [xl(d[0], i[0]), xl(d[1], i[1])]), f && a.attr("cursor", f), a.setColor(r, n && n.symbolInnerColor), a.setStyle(s);
            var m = e.getItemVisual(t, "opacity");
            null != m && (p.opacity = m);
            var y = e.getItemVisual(t, "liftZ"), T = a.__z2Origin;
            null != y ? null == T && (a.__z2Origin = a.z2, a.z2 += y) : null != T && (a.z2 = T, a.__z2Origin = null);
            var w = n && n.useNameLabel;
            Ys(p, l, u, c, {
                labelFetcher: o, labelDataIndex: t, defaultText: function (t, i) {
                    return w ? e.getName(t) : Op(e, t)
                }, isRectText: !0, autoColor: r
            }), a.__symbolOriginalScale = Rp(i), a.hoverStyle = l, a.highDownOnUpdate = h && o.isAnimationEnabled() ? Gp : null, zs(a)
        }, Fp.fadeOut = function (e, t) {
            var i = this.childAt(0);
            this.silent = i.silent = !0, t && t.keepLabel || (i.style.text = null), ol(i, {
                style: {opacity: 0},
                scale: [0, 0]
            }, this._seriesModel, this.dataIndex, e)
        }, I(Mp, Ai);
        var zp = Hp.prototype;

        function jp(e, t, i, n) {
            return t && !isNaN(t[0]) && !isNaN(t[1]) && !(n.isIgnore && n.isIgnore(i)) && !(n.clipShape && !n.clipShape.contain(t[0], t[1])) && "none" !== e.getItemVisual(i, "symbol")
        }

        function Xp(e) {
            return null == e || R(e) || (e = {isIgnore: e}), e || {}
        }

        function $p(e) {
            var t = e.hostModel;
            return {
                itemStyle: t.getModel("itemStyle").getItemStyle(["color"]),
                hoverItemStyle: t.getModel("emphasis.itemStyle").getItemStyle(),
                symbolRotate: t.get("symbolRotate"),
                symbolOffset: t.get("symbolOffset"),
                hoverAnimation: t.get("hoverAnimation"),
                labelModel: t.getModel("label"),
                hoverLabelModel: t.getModel("emphasis.label"),
                cursorStyle: t.get("cursor")
            }
        }

        function Yp(e, t, i) {
            var n, a = e.getBaseAxis(), o = e.getOtherAxis(a), r = function (e, t) {
                    var i = 0, n = e.scale.getExtent();
                    return "start" === t ? i = n[0] : "end" === t ? i = n[1] : 0 < n[0] ? i = n[0] : n[1] < 0 && (i = n[1]), i
                }(o, i), s = a.dim, l = o.dim, d = t.mapDimension(l), u = t.mapDimension(s),
                c = "x" === l || "radius" === l ? 1 : 0, h = A(e.dimensions, function (e) {
                    return t.mapDimension(e)
                }), f = t.getCalculationInfo("stackResultDimension");
            return (n |= ag(t, h[0])) && (h[0] = f), (n |= ag(t, h[1])) && (h[1] = f), {
                dataDimsForPoint: h,
                valueStart: r,
                valueAxisDim: l,
                baseAxisDim: s,
                stacked: !!n,
                valueDim: d,
                baseDim: u,
                baseDataOffset: c,
                stackedOverDimension: t.getCalculationInfo("stackedOverDimension")
            }
        }

        function qp(e, t, i, n) {
            var a = NaN;
            e.stacked && (a = i.get(i.getCalculationInfo("stackedOverDimension"), n)), isNaN(a) && (a = e.valueStart);
            var o = e.baseDataOffset, r = [];
            return r[o] = i.get(e.baseDim, n), r[1 - o] = a, t.dataToPoint(r)
        }

        zp.updateData = function (e, t) {
            t = Xp(t);
            var i = this.group, n = e.hostModel, a = this._data, o = this._symbolCtor, r = $p(e);
            a || i.removeAll(), e.diff(a).add(function (n) {
                var a = e.getItemLayout(n);
                if (jp(e, a, n, t)) {
                    var s = new o(e, n, r);
                    s.attr("position", a), e.setItemGraphicEl(n, s), i.add(s)
                }
            }).update(function (s, l) {
                var d = a.getItemGraphicEl(l), u = e.getItemLayout(s);
                jp(e, u, s, t) ? (d ? (d.updateData(e, s, r), ol(d, {position: u}, n)) : (d = new o(e, s)).attr("position", u), i.add(d), e.setItemGraphicEl(s, d)) : i.remove(d)
            }).remove(function (e) {
                var t = a.getItemGraphicEl(e);
                t && t.fadeOut(function () {
                    i.remove(t)
                })
            }).execute(), this._data = e
        }, zp.isPersistent = function () {
            return !0
        }, zp.updateLayout = function () {
            var e = this._data;
            e && e.eachItemGraphicEl(function (t, i) {
                var n = e.getItemLayout(i);
                t.attr("position", n)
            })
        }, zp.incrementalPrepareUpdate = function (e) {
            this._seriesScope = $p(e), this._data = null, this.group.removeAll()
        }, zp.incrementalUpdate = function (e, t, i) {
            function n(e) {
                e.isGroup || (e.incremental = e.useHoverLayer = !0)
            }

            i = Xp(i);
            for (var a = e.start; a < e.end; a++) {
                var o = t.getItemLayout(a);
                if (jp(t, o, a, i)) {
                    var r = new this._symbolCtor(t, a, this._seriesScope);
                    r.traverse(n), r.attr("position", o), this.group.add(r), t.setItemGraphicEl(a, r)
                }
            }
        }, zp.remove = function (e) {
            var t = this.group, i = this._data;
            i && e ? i.eachItemGraphicEl(function (e) {
                e.fadeOut(function () {
                    t.remove(e)
                })
            }) : t.removeAll()
        };
        var Jp = Se, Zp = Ie, Qp = de, ev = oe, tv = [], iv = [], nv = [];

        function av(e) {
            return isNaN(e[0]) || isNaN(e[1])
        }

        function ov(e, t, i, n, a, o, r, s, l, d) {
            return "none" !== d && d ? function (e, t, i, n, a, o, r, s, l, d, u) {
                for (var c = 0, h = i, f = 0; f < n; f++) {
                    var g = t[h];
                    if (a <= h || h < 0) break;
                    if (av(g)) {
                        if (u) {
                            h += o;
                            continue
                        }
                        break
                    }
                    if (h === i) e[0 < o ? "moveTo" : "lineTo"](g[0], g[1]); else if (0 < l) {
                        var p = t[c], v = "y" === d ? 1 : 0, m = (g[v] - p[v]) * l;
                        ev(iv, p), iv[v] = p[v] + m, ev(nv, g), nv[v] = g[v] - m, e.bezierCurveTo(iv[0], iv[1], nv[0], nv[1], g[0], g[1])
                    } else e.lineTo(g[0], g[1]);
                    c = h, h += o
                }
                return f
            }.apply(this, arguments) : function (e, t, i, n, a, o, r, s, l, d, u) {
                for (var c = 0, h = i, f = 0; f < n; f++) {
                    var g = t[h];
                    if (a <= h || h < 0) break;
                    if (av(g)) {
                        if (u) {
                            h += o;
                            continue
                        }
                        break
                    }
                    if (h === i) e[0 < o ? "moveTo" : "lineTo"](g[0], g[1]), ev(iv, g); else if (0 < l) {
                        var p = h + o, v = t[p];
                        if (u) for (; v && av(t[p]);) v = t[p += o];
                        var m = .5, y = t[c];
                        if (!(v = t[p]) || av(v)) ev(nv, g); else {
                            var k, T;
                            if (av(v) && !u && (v = g), ue(tv, v, y), "x" === d || "y" === d) {
                                var w = "x" === d ? 0 : 1;
                                k = Math.abs(g[w] - y[w]), T = Math.abs(g[w] - v[w])
                            } else k = ye(g, y), T = ye(g, v);
                            Qp(nv, g, tv, -l * (1 - (m = T / (T + k))))
                        }
                        Jp(iv, iv, s), Zp(iv, iv, r), Jp(nv, nv, s), Zp(nv, nv, r), e.bezierCurveTo(iv[0], iv[1], nv[0], nv[1], g[0], g[1]), Qp(iv, g, tv, l * m)
                    } else e.lineTo(g[0], g[1]);
                    c = h, h += o
                }
                return f
            }.apply(this, arguments)
        }

        function rv(e, t) {
            var i = [1 / 0, 1 / 0], n = [-1 / 0, -1 / 0];
            if (t) for (var a = 0; a < e.length; a++) {
                var o = e[a];
                o[0] < i[0] && (i[0] = o[0]), o[1] < i[1] && (i[1] = o[1]), o[0] > n[0] && (n[0] = o[0]), o[1] > n[1] && (n[1] = o[1])
            }
            return {min: t ? i : n, max: t ? n : i}
        }

        var sv = wr.extend({
            type: "ec-polyline",
            shape: {points: [], smooth: 0, smoothConstraint: !0, smoothMonotone: null, connectNulls: !1},
            style: {fill: null, stroke: "#000"},
            brush: Kr(wr.prototype.brush),
            buildPath: function (e, t) {
                var i = t.points, n = 0, a = i.length, o = rv(i, t.smoothConstraint);
                if (t.connectNulls) {
                    for (; 0 < a && av(i[a - 1]); a--) ;
                    for (; n < a && av(i[n]); n++) ;
                }
                for (; n < a;) n += ov(e, i, n, a, a, 1, o.min, o.max, t.smooth, t.smoothMonotone, t.connectNulls) + 1
            }
        }), lv = wr.extend({
            type: "ec-polygon",
            shape: {
                points: [],
                stackedOnPoints: [],
                smooth: 0,
                stackedOnSmooth: 0,
                smoothConstraint: !0,
                smoothMonotone: null,
                connectNulls: !1
            },
            brush: Kr(wr.prototype.brush),
            buildPath: function (e, t) {
                var i = t.points, n = t.stackedOnPoints, a = 0, o = i.length, r = t.smoothMonotone,
                    s = rv(i, t.smoothConstraint), l = rv(n, t.smoothConstraint);
                if (t.connectNulls) {
                    for (; 0 < o && av(i[o - 1]); o--) ;
                    for (; a < o && av(i[a]); a++) ;
                }
                for (; a < o;) {
                    var d = ov(e, i, a, o, o, 1, s.min, s.max, t.smooth, r, t.connectNulls);
                    ov(e, n, a + d - 1, d, o, -1, l.min, l.max, t.stackedOnSmooth, r, t.connectNulls), a += d + 1, e.closePath()
                }
            }
        });

        function dv(e, t, i) {
            var n = e.getArea(), a = e.getBaseAxis().isHorizontal(), o = n.x, r = n.y, s = n.width, l = n.height,
                d = i.get("lineStyle.width") || 2;
            o -= d / 2, r -= d / 2, s += d, l += d, o = Math.floor(o), s = Math.round(s);
            var u = new es({shape: {x: o, y: r, width: s, height: l}});
            return t && (u.shape[a ? "width" : "height"] = 0, rl(u, {shape: {width: s, height: l}}, i)), u
        }

        function uv(e, t, i) {
            var n = e.getArea(), a = new Gr({
                shape: {
                    cx: El(e.cx, 1),
                    cy: El(e.cy, 1),
                    r0: El(n.r0, 1),
                    r: El(n.r, 1),
                    startAngle: n.startAngle,
                    endAngle: n.endAngle,
                    clockwise: n.clockwise
                }
            });
            return t && (a.shape.endAngle = n.startAngle, rl(a, {shape: {endAngle: n.endAngle}}, i)), a
        }

        function cv(e, t, i) {
            return e ? "polar" === e.type ? uv(e, t, i) : "cartesian2d" === e.type ? dv(e, t, i) : null : null
        }

        function hv(e, t) {
            if (e.length === t.length) {
                for (var i = 0; i < e.length; i++) {
                    var n = e[i], a = t[i];
                    if (n[0] !== a[0] || n[1] !== a[1]) return
                }
                return !0
            }
        }

        function fv(e, t) {
            var i = [], n = [], a = [], o = [];
            return Lo(e, i, n), Lo(t, a, o), Math.max(Math.abs(i[0] - a[0]), Math.abs(i[1] - a[1]), Math.abs(n[0] - o[0]), Math.abs(n[1] - o[1]))
        }

        function gv(e) {
            return "number" == typeof e ? e : e ? .5 : 0
        }

        function pv(e, t, i) {
            for (var n = t.getBaseAxis(), a = "x" === n.dim || "radius" === n.dim ? 0 : 1, o = [], r = 0; r < e.length - 1; r++) {
                var s = e[r + 1], l = e[r];
                o.push(l);
                var d = [];
                switch (i) {
                    case"end":
                        d[a] = s[a], d[1 - a] = l[1 - a], o.push(d);
                        break;
                    case"middle":
                        var u = (l[a] + s[a]) / 2, c = [];
                        d[a] = c[a] = u, d[1 - a] = l[1 - a], c[1 - a] = s[1 - a], o.push(d), o.push(c);
                        break;
                    default:
                        d[a] = l[a], d[1 - a] = s[1 - a], o.push(d)
                }
            }
            return e[r] && o.push(e[r]), o
        }

        function vv(e, t, i) {
            if ("cartesian2d" !== e.type) return uv(e, t, i);
            var n = e.getBaseAxis().isHorizontal(), a = dv(e, t, i);
            if (!i.get("clip", !0)) {
                var o = a.shape, r = Math.max(o.width, o.height);
                n ? (o.y -= r, o.height += 2 * r) : (o.x -= r, o.width += 2 * r)
            }
            return a
        }

        function mv(e, t, i) {
            return {
                seriesType: e, performRawSeries: !0, reset: function (e, n, a) {
                    var o = e.getData(), r = e.get("symbol"), s = e.get("symbolSize"), l = e.get("symbolKeepAspect"),
                        d = e.get("symbolRotate"), u = F(r), c = F(s), h = F(d), f = u || c || h, g = !u && r ? r : t,
                        p = c ? null : s;
                    if (o.setVisual({
                        legendSymbol: i || g,
                        symbol: g,
                        symbolSize: p,
                        symbolKeepAspect: l,
                        symbolRotate: d
                    }), !n.isSeriesFiltered(e)) return {
                        dataEach: o.hasItemOption || f ? function (t, i) {
                            if (f) {
                                var n = e.getRawValue(i), a = e.getDataParams(i);
                                u && t.setItemVisual(i, "symbol", r(n, a)), c && t.setItemVisual(i, "symbolSize", s(n, a)), h && t.setItemVisual(i, "symbolRotate", d(n, a))
                            }
                            if (t.hasItemOption) {
                                var o = t.getItemModel(i), l = o.getShallow("symbol", !0),
                                    g = o.getShallow("symbolSize", !0), p = o.getShallow("symbolRotate", !0),
                                    v = o.getShallow("symbolKeepAspect", !0);
                                null != l && t.setItemVisual(i, "symbol", l), null != g && t.setItemVisual(i, "symbolSize", g), null != p && t.setItemVisual(i, "symbolRotate", p), null != v && t.setItemVisual(i, "symbolKeepAspect", v)
                            }
                        } : null
                    }
                }
            }
        }

        function yv(e) {
            return {
                seriesType: e, plan: uc(), reset: function (e) {
                    var t = e.getData(), i = e.coordinateSystem, n = e.pipelineContext.large;
                    if (i) {
                        var a = A(i.dimensions, function (e) {
                            return t.mapDimension(e)
                        }).slice(0, 2), o = a.length, r = t.getCalculationInfo("stackResultDimension");
                        return ag(t, a[0]) && (a[0] = r), ag(t, a[1]) && (a[1] = r), o && {
                            progress: function (e, t) {
                                for (var r = e.end - e.start, s = n && new Float32Array(r * o), l = e.start, d = 0, u = [], c = []; l < e.end; l++) {
                                    var h;
                                    if (1 === o) {
                                        var f = t.get(a[0], l);
                                        h = !isNaN(f) && i.dataToPoint(f, null, c)
                                    } else {
                                        f = u[0] = t.get(a[0], l);
                                        var g = u[1] = t.get(a[1], l);
                                        h = !isNaN(f) && !isNaN(g) && i.dataToPoint(u, null, c)
                                    }
                                    n ? (s[d++] = h ? h[0] : NaN, s[d++] = h ? h[1] : NaN) : t.setItemLayout(l, h && h.slice() || [NaN, NaN])
                                }
                                n && t.setLayout("symbolPoints", s)
                            }
                        }
                    }
                }
            }
        }

        function kv(e, t) {
            return Math.round(e.length / 2)
        }

        fc.extend({
            type: "line", init: function () {
                var e = new Ai, t = new Hp;
                this.group.add(t.group), this._symbolDraw = t, this._lineGroup = e
            }, render: function (e, t, i) {
                var n = e.coordinateSystem, a = this.group, o = e.getData(), r = e.getModel("lineStyle"),
                    s = e.getModel("areaStyle"), l = o.mapArray(o.getItemLayout), d = "polar" === n.type,
                    u = this._coordSys, c = this._symbolDraw, h = this._polyline, f = this._polygon,
                    g = this._lineGroup, p = e.get("animation"), v = !s.isEmpty(), m = s.get("origin"),
                    y = function (e, t, i) {
                        if (!i.valueDim) return [];
                        for (var n = [], a = 0, o = t.count(); a < o; a++) n.push(qp(i, e, t, a));
                        return n
                    }(n, o, Yp(n, o, m)), k = e.get("showSymbol"), w = k && !d && function (e, t, i) {
                        var n = e.get("showAllSymbol"), a = "auto" === n;
                        if (!n || a) {
                            var o = i.getAxesByScale("ordinal")[0];
                            if (o && (!a || !function (e, t) {
                                var i = e.getExtent(), n = Math.abs(i[1] - i[0]) / e.scale.count();
                                isNaN(n) && (n = 0);
                                for (var a = t.count(), o = Math.max(1, Math.round(a / 5)), r = 0; r < a; r += o) if (1.5 * Mp.getSymbolSize(t, r)[e.isHorizontal() ? 1 : 0] > n) return !1;
                                return !0
                            }(o, t))) {
                                var r = t.mapDimension(o.dim), s = {};
                                return D(o.getViewLabels(), function (e) {
                                    s[e.tickValue] = 1
                                }), function (e) {
                                    return !s.hasOwnProperty(t.get(r, e))
                                }
                            }
                        }
                    }(e, o, n), C = this._data;
                C && C.eachItemGraphicEl(function (e, t) {
                    e.__temp && (a.remove(e), C.setItemGraphicEl(t, null))
                }), k || c.remove(), a.add(g);
                var S, I = !d && e.get("step");
                n && n.getArea && e.get("clip", !0) && (null != (S = n.getArea()).width ? (S.x -= .1, S.y -= .1, S.width += .2, S.height += .2) : S.r0 && (S.r0 -= .5, S.r1 += .5)), this._clipShapeForSymbol = S, h && u.type === n.type && I === this._step ? (v && !f ? f = this._newPolygon(l, y, n, p) : f && !v && (g.remove(f), f = this._polygon = null), g.setClipPath(vv(n, !1, e)), k && c.updateData(o, {
                    isIgnore: w,
                    clipShape: S
                }), o.eachItemGraphicEl(function (e) {
                    e.stopAnimation(!0)
                }), hv(this._stackedOnPoints, y) && hv(this._points, l) || (p ? this._updateAnimation(o, y, n, i, I, m) : (I && (l = pv(l, n, I), y = pv(y, n, I)), h.setShape({points: l}), f && f.setShape({
                    points: l,
                    stackedOnPoints: y
                })))) : (k && c.updateData(o, {
                    isIgnore: w,
                    clipShape: S
                }), I && (l = pv(l, n, I), y = pv(y, n, I)), h = this._newPolyline(l, n, p), v && (f = this._newPolygon(l, y, n, p)), g.setClipPath(vv(n, !0, e)));
                var b = function (e, t) {
                    var i = e.getVisual("visualMeta");
                    if (i && i.length && e.count() && "cartesian2d" === t.type) {
                        for (var n, a, o = i.length - 1; 0 <= o; o--) {
                            var r = i[o].dimension, s = e.dimensions[r], l = e.getDimensionInfo(s);
                            if ("x" === (n = l && l.coordDim) || "y" === n) {
                                a = i[o];
                                break
                            }
                        }
                        if (a) {
                            var d = t.getAxis(n), u = A(a.stops, function (e) {
                                return {coord: d.toGlobalCoord(d.dataToCoord(e.value)), color: e.color}
                            }), c = u.length, h = a.outerColors.slice();
                            c && u[0].coord > u[c - 1].coord && (u.reverse(), h.reverse());
                            var f = u[0].coord - 10, g = u[c - 1].coord + 10, p = g - f;
                            if (p < .001) return "transparent";
                            D(u, function (e) {
                                e.offset = (e.coord - f) / p
                            }), u.push({
                                offset: c ? u[c - 1].offset : .5,
                                color: h[1] || "transparent"
                            }), u.unshift({offset: c ? u[0].offset : .5, color: h[0] || "transparent"});
                            var v = new ds(0, 0, 0, 0, u, !0);
                            return v[n] = f, v[n + "2"] = g, v
                        }
                    }
                }(o, n) || o.getVisual("color");
                h.useStyle(T(r.getLineStyle(), {fill: "none", stroke: b, lineJoin: "bevel"}));
                var _ = e.get("smooth");
                if (_ = gv(e.get("smooth")), h.setShape({
                    smooth: _,
                    smoothMonotone: e.get("smoothMonotone"),
                    connectNulls: e.get("connectNulls")
                }), f) {
                    var N = o.getCalculationInfo("stackedOnSeries"), x = 0;
                    f.useStyle(T(s.getAreaStyle(), {
                        fill: b,
                        opacity: .7,
                        lineJoin: "bevel"
                    })), N && (x = gv(N.get("smooth"))), f.setShape({
                        smooth: _,
                        stackedOnSmooth: x,
                        smoothMonotone: e.get("smoothMonotone"),
                        connectNulls: e.get("connectNulls")
                    })
                }
                this._data = o, this._coordSys = n, this._stackedOnPoints = y, this._points = l, this._step = I, this._valueOrigin = m
            }, dispose: function () {
            }, highlight: function (e, t, i, n) {
                var a = e.getData(), o = Ka(a, n);
                if (!(o instanceof Array) && null != o && 0 <= o) {
                    var r = a.getItemGraphicEl(o);
                    if (!r) {
                        var s = a.getItemLayout(o);
                        if (!s) return;
                        if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(s[0], s[1])) return;
                        (r = new Mp(a, o)).position = s, r.setZ(e.get("zlevel"), e.get("z")), r.ignore = isNaN(s[0]) || isNaN(s[1]), r.__temp = !0, a.setItemGraphicEl(o, r), r.stopSymbolAnimation(!0), this.group.add(r)
                    }
                    r.highlight()
                } else fc.prototype.highlight.call(this, e, t, i, n)
            }, downplay: function (e, t, i, n) {
                var a = e.getData(), o = Ka(a, n);
                if (null != o && 0 <= o) {
                    var r = a.getItemGraphicEl(o);
                    r && (r.__temp ? (a.setItemGraphicEl(o, null), this.group.remove(r)) : r.downplay())
                } else fc.prototype.downplay.call(this, e, t, i, n)
            }, _newPolyline: function (e) {
                var t = this._polyline;
                return t && this._lineGroup.remove(t), t = new sv({
                    shape: {points: e},
                    silent: !0,
                    z2: 10
                }), this._lineGroup.add(t), this._polyline = t
            }, _newPolygon: function (e, t) {
                var i = this._polygon;
                return i && this._lineGroup.remove(i), i = new lv({
                    shape: {points: e, stackedOnPoints: t},
                    silent: !0
                }), this._lineGroup.add(i), this._polygon = i
            }, _updateAnimation: function (e, t, i, n, a, o) {
                var r = this._polyline, s = this._polygon, l = e.hostModel, d = function (e, t, i, n, a, o, r, s) {
                        for (var l = function (e, t) {
                            var i = [];
                            return t.diff(e).add(function (e) {
                                i.push({cmd: "+", idx: e})
                            }).update(function (e, t) {
                                i.push({cmd: "=", idx: t, idx1: e})
                            }).remove(function (e) {
                                i.push({cmd: "-", idx: e})
                            }).execute(), i
                        }(e, t), d = [], u = [], c = [], h = [], f = [], g = [], p = [], v = Yp(a, t, r), m = Yp(o, e, s), y = 0; y < l.length; y++) {
                            var k = l[y], T = !0;
                            switch (k.cmd) {
                                case"=":
                                    var w = e.getItemLayout(k.idx), C = t.getItemLayout(k.idx1);
                                    (isNaN(w[0]) || isNaN(w[1])) && (w = C.slice()), d.push(w), u.push(C), c.push(i[k.idx]), h.push(n[k.idx1]), p.push(t.getRawIndex(k.idx1));
                                    break;
                                case"+":
                                    var S = k.idx;
                                    d.push(a.dataToPoint([t.get(v.dataDimsForPoint[0], S), t.get(v.dataDimsForPoint[1], S)])), u.push(t.getItemLayout(S).slice()), c.push(qp(v, a, t, S)), h.push(n[S]), p.push(t.getRawIndex(S));
                                    break;
                                case"-":
                                    S = k.idx;
                                    var I = e.getRawIndex(S);
                                    I !== S ? (d.push(e.getItemLayout(S)), u.push(o.dataToPoint([e.get(m.dataDimsForPoint[0], S), e.get(m.dataDimsForPoint[1], S)])), c.push(i[S]), h.push(qp(m, o, e, S)), p.push(I)) : T = !1
                            }
                            T && (f.push(k), g.push(g.length))
                        }
                        g.sort(function (e, t) {
                            return p[e] - p[t]
                        });
                        var b = [], _ = [], D = [], A = [], N = [];
                        for (y = 0; y < g.length; y++) S = g[y], b[y] = d[S], _[y] = u[S], D[y] = c[S], A[y] = h[S], N[y] = f[S];
                        return {current: b, next: _, stackedOnCurrent: D, stackedOnNext: A, status: N}
                    }(this._data, e, this._stackedOnPoints, t, this._coordSys, i, this._valueOrigin, o), u = d.current,
                    c = d.stackedOnCurrent, h = d.next, f = d.stackedOnNext;
                if (a && (u = pv(d.current, i, a), c = pv(d.stackedOnCurrent, i, a), h = pv(d.next, i, a), f = pv(d.stackedOnNext, i, a)), 3e3 < fv(u, h) || s && 3e3 < fv(c, f)) return r.setShape({points: h}), void (s && s.setShape({
                    points: h,
                    stackedOnPoints: f
                }));
                r.shape.__points = d.current, r.shape.points = u, ol(r, {shape: {points: h}}, l), s && (s.setShape({
                    points: u,
                    stackedOnPoints: c
                }), ol(s, {shape: {points: h, stackedOnPoints: f}}, l));
                for (var g = [], p = d.status, v = 0; v < p.length; v++) if ("=" === p[v].cmd) {
                    var m = e.getItemGraphicEl(p[v].idx1);
                    m && g.push({el: m, ptIdx: v})
                }
                r.animators && r.animators.length && r.animators[0].during(function () {
                    for (var e = 0; e < g.length; e++) g[e].el.attr("position", r.shape.__points[g[e].ptIdx])
                })
            }, remove: function (e) {
                var t = this.group, i = this._data;
                this._lineGroup.removeAll(), this._symbolDraw.remove(!0), i && i.eachItemGraphicEl(function (e, n) {
                    e.__temp && (t.remove(e), i.setItemGraphicEl(n, null))
                }), this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._data = null
            }
        });
        var Tv = {
            average: function (e) {
                for (var t = 0, i = 0, n = 0; n < e.length; n++) isNaN(e[n]) || (t += e[n], i++);
                return 0 === i ? NaN : t / i
            }, sum: function (e) {
                for (var t = 0, i = 0; i < e.length; i++) t += e[i] || 0;
                return t
            }, max: function (e) {
                for (var t = -1 / 0, i = 0; i < e.length; i++) e[i] > t && (t = e[i]);
                return isFinite(t) ? t : NaN
            }, min: function (e) {
                for (var t = 1 / 0, i = 0; i < e.length; i++) e[i] < t && (t = e[i]);
                return isFinite(t) ? t : NaN
            }, nearest: function (e) {
                return e[0]
            }
        };

        function wv(e) {
            return this._axes[e]
        }

        function Cv(e) {
            this._axes = {}, this._dimList = [], this.name = e || ""
        }

        function Sv(e) {
            Cv.call(this, e)
        }

        function Iv(e, t, i, n, a) {
            Ap.call(this, e, t, i), this.type = n || "value", this.position = a || "bottom"
        }

        Cv.prototype = {
            constructor: Cv, type: "cartesian", getAxis: function (e) {
                return this._axes[e]
            }, getAxes: function () {
                return A(this._dimList, wv, this)
            }, getAxesByScale: function (e) {
                return e = e.toLowerCase(), x(this.getAxes(), function (t) {
                    return t.scale.type === e
                })
            }, addAxis: function (e) {
                var t = e.dim;
                this._axes[t] = e, this._dimList.push(t)
            }, dataToCoord: function (e) {
                return this._dataCoordConvert(e, "dataToCoord")
            }, coordToData: function (e) {
                return this._dataCoordConvert(e, "coordToData")
            }, _dataCoordConvert: function (e, t) {
                for (var i = this._dimList, n = e instanceof Array ? [] : {}, a = 0; a < i.length; a++) {
                    var o = i[a], r = this._axes[o];
                    n[o] = r[t](e[o])
                }
                return n
            }
        }, Sv.prototype = {
            constructor: Sv, type: "cartesian2d", dimensions: ["x", "y"], getBaseAxis: function () {
                return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x")
            }, containPoint: function (e) {
                var t = this.getAxis("x"), i = this.getAxis("y");
                return t.contain(t.toLocalCoord(e[0])) && i.contain(i.toLocalCoord(e[1]))
            }, containData: function (e) {
                return this.getAxis("x").containData(e[0]) && this.getAxis("y").containData(e[1])
            }, dataToPoint: function (e, t, i) {
                var n = this.getAxis("x"), a = this.getAxis("y");
                return (i = i || [])[0] = n.toGlobalCoord(n.dataToCoord(e[0])), i[1] = a.toGlobalCoord(a.dataToCoord(e[1])), i
            }, clampData: function (e, t) {
                var i = this.getAxis("x").scale, n = this.getAxis("y").scale, a = i.getExtent(), o = n.getExtent(),
                    r = i.parse(e[0]), s = n.parse(e[1]);
                return (t = t || [])[0] = Math.min(Math.max(Math.min(a[0], a[1]), r), Math.max(a[0], a[1])), t[1] = Math.min(Math.max(Math.min(o[0], o[1]), s), Math.max(o[0], o[1])), t
            }, pointToData: function (e, t) {
                var i = this.getAxis("x"), n = this.getAxis("y");
                return (t = t || [])[0] = i.coordToData(i.toLocalCoord(e[0])), t[1] = n.coordToData(n.toLocalCoord(e[1])), t
            }, getOtherAxis: function (e) {
                return this.getAxis("x" === e.dim ? "y" : "x")
            }, getArea: function () {
                var e = this.getAxis("x").getGlobalExtent(), t = this.getAxis("y").getGlobalExtent(),
                    i = Math.min(e[0], e[1]), n = Math.min(t[0], t[1]);
                return new Di(i, n, Math.max(e[0], e[1]) - i, Math.max(t[0], t[1]) - n)
            }
        }, I(Sv, Cv), Iv.prototype = {
            constructor: Iv,
            index: 0,
            getAxesOnZeroOf: null,
            model: null,
            isHorizontal: function () {
                var e = this.position;
                return "top" === e || "bottom" === e
            },
            getGlobalExtent: function (e) {
                var t = this.getExtent();
                return t[0] = this.toGlobalCoord(t[0]), t[1] = this.toGlobalCoord(t[1]), e && t[0] > t[1] && t.reverse(), t
            },
            getOtherAxis: function () {
                this.grid.getOtherAxis()
            },
            pointToData: function (e, t) {
                return this.coordToData(this.toLocalCoord(e["x" === this.dim ? 0 : 1]), t)
            },
            toLocalCoord: null,
            toGlobalCoord: null
        }, I(Iv, Ap);
        var bv = {
            show: !0,
            zlevel: 0,
            z: 0,
            inverse: !1,
            name: "",
            nameLocation: "end",
            nameRotate: null,
            nameTruncate: {maxWidth: null, ellipsis: "...", placeholder: "."},
            nameTextStyle: {},
            nameGap: 15,
            silent: !1,
            triggerEvent: !1,
            tooltip: {show: !1},
            axisPointer: {},
            axisLine: {
                show: !0,
                onZero: !0,
                onZeroAxisIndex: null,
                lineStyle: {color: "#333", width: 1, type: "solid"},
                symbol: ["none", "none"],
                symbolSize: [10, 15]
            },
            axisTick: {show: !0, inside: !1, length: 5, lineStyle: {width: 1}},
            axisLabel: {
                show: !0,
                inside: !1,
                rotate: 0,
                showMinLabel: null,
                showMaxLabel: null,
                margin: 8,
                fontSize: 12
            },
            splitLine: {show: !0, lineStyle: {color: ["#ccc"], width: 1, type: "solid"}},
            splitArea: {show: !1, areaStyle: {color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]}}
        }, _v = {};

        function Dv(e, t, i, n) {
            D(Av, function (a) {
                t.extend({
                    type: e + "Axis." + a, mergeDefaultAndTheme: function (t, n) {
                        var o = this.layoutMode, r = o ? kd(t) : {};
                        m(t, n.getTheme().get(a + "Axis")), m(t, this.getDefaultOption()), t.type = i(e, t), o && yd(t, r, o)
                    }, optionUpdated: function () {
                        "category" === this.option.type && (this.__ordinalMeta = lg.createByAxisModel(this))
                    }, getCategories: function (e) {
                        var t = this.option;
                        if ("category" === t.type) return e ? t.data : this.__ordinalMeta.categories
                    }, getOrdinalMeta: function () {
                        return this.__ordinalMeta
                    }, defaultOption: y([{}, _v[a + "Axis"], n], !0)
                })
            }), bd.registerSubTypeDefaulter(e + "Axis", O(i, e))
        }

        _v.categoryAxis = m({
            boundaryGap: !0,
            deduplication: null,
            splitLine: {show: !1},
            axisTick: {alignWithLabel: !1, interval: "auto"},
            axisLabel: {interval: "auto"}
        }, bv), _v.valueAxis = m({
            boundaryGap: [0, 0],
            splitNumber: 5,
            minorTick: {show: !1, splitNumber: 5, length: 3, lineStyle: {}},
            minorSplitLine: {show: !1, lineStyle: {color: "#eee", width: 1}}
        }, bv), _v.timeAxis = T({scale: !0, min: "dataMin", max: "dataMax"}, _v.valueAxis), _v.logAxis = T({
            scale: !0,
            logBase: 10
        }, _v.valueAxis);
        var Av = ["value", "category", "time", "log"], Nv = bd.extend({
            type: "cartesian2dAxis", axis: null, init: function () {
                Nv.superApply(this, "init", arguments), this.resetRange()
            }, mergeOption: function () {
                Nv.superApply(this, "mergeOption", arguments), this.resetRange()
            }, restoreData: function () {
                Nv.superApply(this, "restoreData", arguments), this.resetRange()
            }, getCoordSysModel: function () {
                return this.ecModel.queryComponents({
                    mainType: "grid",
                    index: this.option.gridIndex,
                    id: this.option.gridId
                })[0]
            }
        });

        function xv(e, t) {
            return t.type || (t.data ? "category" : "value")
        }

        m(Nv.prototype, ip);
        var Ev = {offset: 0};

        function Pv(e, t) {
            return e.getCoordSysModel() === t
        }

        function Ov(e, t, i) {
            this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this._initCartesian(e, t, i), this.model = e
        }

        Dv("x", Nv, xv, Ev), Dv("y", Nv, xv, Ev), bd.extend({
            type: "grid",
            dependencies: ["xAxis", "yAxis"],
            layoutMode: "box",
            coordinateSystem: null,
            defaultOption: {
                show: !1,
                zlevel: 0,
                z: 0,
                left: "10%",
                top: 60,
                right: "10%",
                bottom: 60,
                containLabel: !1,
                backgroundColor: "rgba(0,0,0,0)",
                borderWidth: 1,
                borderColor: "#ccc"
            }
        });
        var Mv = Ov.prototype;

        function Fv(e, t, i, n) {
            i.getAxesOnZeroOf = function () {
                return a ? [a] : []
            };
            var a, o = e[t], r = i.model, s = r.get("axisLine.onZero"), l = r.get("axisLine.onZeroAxisIndex");
            if (s) {
                if (null != l) Lv(o[l]) && (a = o[l]); else for (var d in o) if (o.hasOwnProperty(d) && Lv(o[d]) && !n[u(o[d])]) {
                    a = o[d];
                    break
                }
                a && (n[u(a)] = !0)
            }

            function u(e) {
                return e.dim + "_" + e.index
            }
        }

        function Lv(e) {
            return e && "category" !== e.type && "time" !== e.type && function (e) {
                var t = e.scale.getExtent(), i = t[0], n = t[1];
                return !(0 < i && 0 < n || i < 0 && n < 0)
            }(e)
        }

        Mv.type = "grid", Mv.axisPointerEnabled = !0, Mv.getRect = function () {
            return this._rect
        }, Mv.update = function (e, t) {
            var i = this._axesMap;
            this._updateScale(e, this.model), D(i.x, function (e) {
                qg(e.scale, e.model)
            }), D(i.y, function (e) {
                qg(e.scale, e.model)
            });
            var n = {};
            D(i.x, function (e) {
                Fv(i, "y", e, n)
            }), D(i.y, function (e) {
                Fv(i, "x", e, n)
            }), this.resize(this.model, t)
        }, Mv.resize = function (e, t, i) {
            var n = vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()});
            this._rect = n;
            var a = this._axesList;

            function o() {
                D(a, function (e) {
                    var t = e.isHorizontal(), i = t ? [0, n.width] : [0, n.height], a = e.inverse ? 1 : 0;
                    e.setExtent(i[a], i[1 - a]), function (e, t) {
                        var i = e.getExtent(), n = i[0] + i[1];
                        e.toGlobalCoord = "x" === e.dim ? function (e) {
                            return e + t
                        } : function (e) {
                            return n - e + t
                        }, e.toLocalCoord = "x" === e.dim ? function (e) {
                            return e - t
                        } : function (e) {
                            return n - e + t
                        }
                    }(e, t ? n.x : n.y)
                })
            }

            o(), !i && e.get("containLabel") && (D(a, function (e) {
                if (!e.model.get("axisLabel.inside")) {
                    var t = function (e) {
                        var t = e.model, i = e.scale;
                        if (t.get("axisLabel.show") && !i.isBlank()) {
                            var n, a, o = "category" === e.type, r = i.getExtent();
                            a = o ? i.count() : (n = i.getTicks()).length;
                            var s, l, d, u, c, h, f, g, p, v = e.getLabelModel(), m = Zg(e), y = 1;
                            40 < a && (y = Math.ceil(a / 40));
                            for (var k = 0; k < a; k += y) {
                                var T = m(n ? n[k] : r[0] + k), w = v.getTextRect(T),
                                    C = (l = w, d = v.get("rotate") || 0, u = d * Math.PI / 180, c = l.plain(), h = c.width, f = c.height, g = h * Math.cos(u) + f * Math.sin(u), p = h * Math.sin(u) + f * Math.cos(u), new Di(c.x, c.y, g, p));
                                s ? s.union(C) : s = C
                            }
                            return s
                        }
                    }(e);
                    if (t) {
                        var i = e.isHorizontal() ? "height" : "width", a = e.model.get("axisLabel.margin");
                        n[i] -= t[i] + a, "top" === e.position ? n.y += t.height + a : "left" === e.position && (n.x += t.width + a)
                    }
                }
            }), o())
        }, Mv.getAxis = function (e, t) {
            var i = this._axesMap[e];
            if (null != i) {
                if (null == t) for (var n in i) if (i.hasOwnProperty(n)) return i[n];
                return i[t]
            }
        }, Mv.getAxes = function () {
            return this._axesList.slice()
        }, Mv.getCartesian = function (e, t) {
            if (null != e && null != t) {
                var i = "x" + e + "y" + t;
                return this._coordsMap[i]
            }
            R(e) && (t = e.yAxisIndex, e = e.xAxisIndex);
            for (var n = 0, a = this._coordsList; n < a.length; n++) if (a[n].getAxis("x").index === e || a[n].getAxis("y").index === t) return a[n]
        }, Mv.getCartesians = function () {
            return this._coordsList.slice()
        }, Mv.convertToPixel = function (e, t, i) {
            var n = this._findConvertTarget(e, t);
            return n.cartesian ? n.cartesian.dataToPoint(i) : n.axis ? n.axis.toGlobalCoord(n.axis.dataToCoord(i)) : null
        }, Mv.convertFromPixel = function (e, t, i) {
            var n = this._findConvertTarget(e, t);
            return n.cartesian ? n.cartesian.pointToData(i) : n.axis ? n.axis.coordToData(n.axis.toLocalCoord(i)) : null
        }, Mv._findConvertTarget = function (e, t) {
            var i, n, a = t.seriesModel, o = t.xAxisModel || a && a.getReferringComponents("xAxis")[0],
                r = t.yAxisModel || a && a.getReferringComponents("yAxis")[0], s = t.gridModel, l = this._coordsList;
            return a ? S(l, i = a.coordinateSystem) < 0 && (i = null) : o && r ? i = this.getCartesian(o.componentIndex, r.componentIndex) : o ? n = this.getAxis("x", o.componentIndex) : r ? n = this.getAxis("y", r.componentIndex) : s && s.coordinateSystem === this && (i = this._coordsList[0]), {
                cartesian: i,
                axis: n
            }
        }, Mv.containPoint = function (e) {
            var t = this._coordsList[0];
            if (t) return t.containPoint(e)
        }, Mv._initCartesian = function (e, t, i) {
            var n = {left: !1, right: !1, top: !1, bottom: !1}, a = {x: {}, y: {}}, o = {x: 0, y: 0};
            if (t.eachComponent("xAxis", r("x"), this), t.eachComponent("yAxis", r("y"), this), !o.x || !o.y) return this._axesMap = {}, void (this._axesList = []);

            function r(t) {
                return function (i, r) {
                    if (Pv(i, e)) {
                        var s = i.get("position");
                        "x" === t ? "top" !== s && "bottom" !== s && (s = n.bottom ? "top" : "bottom") : "left" !== s && "right" !== s && (s = n.left ? "right" : "left"), n[s] = !0;
                        var l = new Iv(t, Jg(i), [0, 0], i.get("type"), s), d = "category" === l.type;
                        l.onBand = d && i.get("boundaryGap"), l.inverse = i.get("inverse"), (i.axis = l).model = i, l.grid = this, l.index = r, this._axesList.push(l), a[t][r] = l, o[t]++
                    }
                }
            }

            D((this._axesMap = a).x, function (t, i) {
                D(a.y, function (n, a) {
                    var o = "x" + i + "y" + a, r = new Sv(o);
                    r.grid = this, r.model = e, this._coordsMap[o] = r, this._coordsList.push(r), r.addAxis(t), r.addAxis(n)
                }, this)
            }, this)
        }, Mv._updateScale = function (e, t) {
            function i(e, t) {
                D(e.mapDimension(t.dim, !0), function (i) {
                    t.scale.unionExtentFromData(e, og(e, i))
                })
            }

            D(this._axesList, function (e) {
                e.scale.setExtent(1 / 0, -1 / 0)
            }), e.eachSeries(function (e) {
                if (Uv(e)) {
                    var n = Bv(e), a = n[0], o = n[1];
                    if (!Pv(a, t) || !Pv(o, t)) return;
                    var r = this.getCartesian(a.componentIndex, o.componentIndex), s = e.getData(), l = r.getAxis("x"),
                        d = r.getAxis("y");
                    "list" === s.type && (i(s, l), i(s, d))
                }
            }, this)
        }, Mv.getTooltipAxes = function (e) {
            var t = [], i = [];
            return D(this.getCartesians(), function (n) {
                var a = null != e && "auto" !== e ? n.getAxis(e) : n.getBaseAxis(), o = n.getOtherAxis(a);
                S(t, a) < 0 && t.push(a), S(i, o) < 0 && i.push(o)
            }), {baseAxes: t, otherAxes: i}
        };
        var Rv = ["xAxis", "yAxis"];

        function Bv(e) {
            return A(Rv, function (t) {
                return e.getReferringComponents(t)[0]
            })
        }

        function Uv(e) {
            return "cartesian2d" === e.get("coordinateSystem")
        }

        function Kv(e, t) {
            this.opt = t, this.axisModel = e, T(t, {
                labelOffset: 0,
                nameDirection: 1,
                tickDirection: 1,
                labelDirection: 1,
                silent: !0
            }), this.group = new Ai;
            var i = new Ai({position: t.position.slice(), rotation: t.rotation});
            i.updateTransform(), this._transform = i.transform, this._dumbGroup = i
        }

        Ov.create = function (e, t) {
            var i = [];
            return e.eachComponent("grid", function (n, a) {
                var o = new Ov(n, e, t);
                o.name = "grid_" + a, o.resize(n, t, !0), n.coordinateSystem = o, i.push(o)
            }), e.eachSeries(function (e) {
                if (Uv(e)) {
                    var t = Bv(e), i = t[0], n = t[1], a = i.getCoordSysModel().coordinateSystem;
                    e.coordinateSystem = a.getCartesian(i.componentIndex, n.componentIndex)
                }
            }), i
        }, Ov.dimensions = Ov.prototype.dimensions = Sv.prototype.dimensions, iu.register("cartesian2d", Ov);
        var Vv = Math.PI;
        Kv.prototype = {
            constructor: Kv, hasBuilder: function (e) {
                return !!Wv[e]
            }, add: function (e) {
                Wv[e].call(this)
            }, getGroup: function () {
                return this.group
            }
        };
        var Wv = {
            axisLine: function () {
                var e = this.opt, t = this.axisModel;
                if (t.get("axisLine.show")) {
                    var i = this.axisModel.axis.getExtent(), n = this._transform, a = [i[0], 0], o = [i[1], 0];
                    n && (Ce(a, a, n), Ce(o, o, n));
                    var r = k({lineCap: "round"}, t.getModel("axisLine.lineStyle").getLineStyle());
                    this.group.add(new is({
                        anid: "line",
                        subPixelOptimize: !0,
                        shape: {x1: a[0], y1: a[1], x2: o[0], y2: o[1]},
                        style: r,
                        strokeContainThreshold: e.strokeContainThreshold || 5,
                        silent: !0,
                        z2: 1
                    }));
                    var s = t.get("axisLine.symbol"), l = t.get("axisLine.symbolSize"),
                        d = t.get("axisLine.symbolOffset") || 0;
                    if ("number" == typeof d && (d = [d, d]), null != s) {
                        "string" == typeof s && (s = [s, s]), "string" != typeof l && "number" != typeof l || (l = [l, l]);
                        var u = l[0], c = l[1];
                        D([{rotate: e.rotation + Math.PI / 2, offset: d[0], r: 0}, {
                            rotate: e.rotation - Math.PI / 2,
                            offset: d[1],
                            r: Math.sqrt((a[0] - o[0]) * (a[0] - o[0]) + (a[1] - o[1]) * (a[1] - o[1]))
                        }], function (t, i) {
                            if ("none" !== s[i] && null != s[i]) {
                                var n = cp(s[i], -u / 2, -c / 2, u, c, r.stroke, !0), o = t.r + t.offset,
                                    l = [a[0] + o * Math.cos(e.rotation), a[1] - o * Math.sin(e.rotation)];
                                n.attr({rotation: t.rotate, position: l, silent: !0, z2: 11}), this.group.add(n)
                            }
                        }, this)
                    }
                }
            }, axisTickLabel: function () {
                var e = this.axisModel, t = this.opt, i = function (e, t, i) {
                    var n = t.axis, a = t.getModel("axisTick");
                    if (a.get("show") && !n.scale.isBlank()) {
                        for (var o = a.getModel("lineStyle"), r = i.tickDirection * a.get("length"), s = Yv(n.getTicksCoords(), e._transform, r, T(o.getLineStyle(), {stroke: t.get("axisLine.lineStyle.color")}), "ticks"), l = 0; l < s.length; l++) e.group.add(s[l]);
                        return s
                    }
                }(this, e, t);
                !function (e, t, i) {
                    if (!tp(e.axis)) {
                        var n = e.get("axisLabel.showMinLabel"), a = e.get("axisLabel.showMaxLabel");
                        i = i || [];
                        var o = (t = t || [])[0], r = t[1], s = t[t.length - 1], l = t[t.length - 2], d = i[0],
                            u = i[1], c = i[i.length - 1], h = i[i.length - 2];
                        !1 === n ? (jv(o), jv(d)) : Xv(o, r) && (n ? (jv(r), jv(u)) : (jv(o), jv(d))), !1 === a ? (jv(s), jv(c)) : Xv(l, s) && (a ? (jv(l), jv(h)) : (jv(s), jv(c)))
                    }
                }(e, function (e, t, i) {
                    var n = t.axis;
                    if (W(i.axisLabelShow, t.get("axisLabel.show")) && !n.scale.isBlank()) {
                        var a = t.getModel("axisLabel"), o = a.get("margin"), r = n.getViewLabels(),
                            s = (W(i.labelRotate, a.get("rotate")) || 0) * Vv / 180,
                            l = Hv(i.rotation, s, i.labelDirection), d = t.getCategories && t.getCategories(!0), u = [],
                            c = zv(t), h = t.get("triggerEvent");
                        return D(r, function (r, s) {
                            var f = r.tickValue, g = r.formattedLabel, p = r.rawLabel, v = a;
                            d && d[f] && d[f].textStyle && (v = new Sl(d[f].textStyle, a, t.ecModel));
                            var m = v.getTextColor() || t.get("axisLine.lineStyle.color"),
                                y = [n.dataToCoord(f), i.labelOffset + i.labelDirection * o],
                                k = new Ur({anid: "label_" + f, position: y, rotation: l.rotation, silent: c, z2: 10});
                            Js(k.style, v, {
                                text: g,
                                textAlign: v.getShallow("align", !0) || l.textAlign,
                                textVerticalAlign: v.getShallow("verticalAlign", !0) || v.getShallow("baseline", !0) || l.textVerticalAlign,
                                textFill: "function" == typeof m ? m("category" === n.type ? p : "value" === n.type ? f + "" : f, s) : m
                            }), h && (k.eventData = Gv(t), k.eventData.targetType = "axisLabel", k.eventData.value = p), e._dumbGroup.add(k), k.updateTransform(), u.push(k), e.group.add(k), k.decomposeTransform()
                        }), u
                    }
                }(this, e, t), i), function (e, t, i) {
                    var n = t.axis, a = t.getModel("minorTick");
                    if (a.get("show") && !n.scale.isBlank()) {
                        var o = n.getMinorTicksCoords();
                        if (o.length) for (var r = a.getModel("lineStyle"), s = i.tickDirection * a.get("length"), l = T(r.getLineStyle(), T(t.getModel("axisTick").getLineStyle(), {stroke: t.get("axisLine.lineStyle.color")})), d = 0; d < o.length; d++) for (var u = Yv(o[d], e._transform, s, l, "minorticks_" + d), c = 0; c < u.length; c++) e.group.add(u[c])
                    }
                }(this, e, t)
            }, axisName: function () {
                var e = this.opt, t = this.axisModel, i = W(e.axisName, t.get("name"));
                if (i) {
                    var n, a, o = t.get("nameLocation"), r = e.nameDirection, s = t.getModel("nameTextStyle"),
                        l = t.get("nameGap") || 0, d = this.axisModel.axis.getExtent(), u = d[0] > d[1] ? -1 : 1,
                        c = ["start" === o ? d[0] - u * l : "end" === o ? d[1] + u * l : (d[0] + d[1]) / 2, $v(o) ? e.labelOffset + r * l : 0],
                        h = t.get("nameRotate");
                    null != h && (h = h * Vv / 180), $v(o) ? n = Hv(e.rotation, null != h ? h : e.rotation, r) : (n = function (e, t, i, n) {
                        var a, o, r = Bl(i - e.rotation), s = n[0] > n[1],
                            l = "start" === t && !s || "start" !== t && s;
                        return a = Ul(r - Vv / 2) ? (o = l ? "bottom" : "top", "center") : Ul(r - 1.5 * Vv) ? (o = l ? "top" : "bottom", "center") : (o = "middle", r < 1.5 * Vv && Vv / 2 < r ? l ? "left" : "right" : l ? "right" : "left"), {
                            rotation: r,
                            textAlign: a,
                            textVerticalAlign: o
                        }
                    }(e, o, h || 0, d), null != (a = e.axisNameAvailableWidth) && (a = Math.abs(a / Math.sin(n.rotation)), isFinite(a) || (a = null)));
                    var f = s.getFont(), g = t.get("nameTruncate", !0) || {}, p = g.ellipsis,
                        v = W(e.nameTruncateMaxWidth, g.maxWidth, a),
                        m = null != p && null != v ? ld(i, v, f, p, {minChar: 2, placeholder: g.placeholder}) : i,
                        y = t.get("tooltip", !0), T = t.mainType, w = {componentType: T, name: i, $vars: ["name"]};
                    w[T + "Index"] = t.componentIndex;
                    var C = new Ur({
                        anid: "name",
                        __fullText: i,
                        __truncatedText: m,
                        position: c,
                        rotation: n.rotation,
                        silent: zv(t),
                        z2: 1,
                        tooltip: y && y.show ? k({
                            content: i, formatter: function () {
                                return i
                            }, formatterParams: w
                        }, y) : null
                    });
                    Js(C.style, s, {
                        text: m,
                        textFont: f,
                        textFill: s.getTextColor() || t.get("axisLine.lineStyle.color"),
                        textAlign: s.get("align") || n.textAlign,
                        textVerticalAlign: s.get("verticalAlign") || n.textVerticalAlign
                    }), t.get("triggerEvent") && (C.eventData = Gv(t), C.eventData.targetType = "axisName", C.eventData.name = i), this._dumbGroup.add(C), C.updateTransform(), this.group.add(C), C.decomposeTransform()
                }
            }
        }, Gv = Kv.makeAxisEventDataBase = function (e) {
            var t = {componentType: e.mainType, componentIndex: e.componentIndex};
            return t[e.mainType + "Index"] = e.componentIndex, t
        }, Hv = Kv.innerTextLayout = function (e, t, i) {
            var n, a = Bl(t - e);
            return {
                rotation: a,
                textAlign: Ul(a) ? (n = 0 < i ? "top" : "bottom", "center") : Ul(a - Vv) ? (n = 0 < i ? "bottom" : "top", "center") : (n = "middle", 0 < a && a < Vv ? 0 < i ? "right" : "left" : 0 < i ? "left" : "right"),
                textVerticalAlign: n
            }
        }, zv = Kv.isLabelSilent = function (e) {
            var t = e.get("tooltip");
            return e.get("silent") || !(e.get("triggerEvent") || t && t.show)
        };

        function jv(e) {
            e && (e.ignore = !0)
        }

        function Xv(e, t) {
            var i = e && e.getBoundingRect().clone(), n = t && t.getBoundingRect().clone();
            if (i && n) {
                var a = rt([]);
                return ut(a, a, -e.rotation), i.applyTransform(lt([], a, e.getLocalTransform())), n.applyTransform(lt([], a, t.getLocalTransform())), i.intersect(n)
            }
        }

        function $v(e) {
            return "middle" === e || "center" === e
        }

        function Yv(e, t, i, n, a) {
            for (var o = [], r = [], s = [], l = 0; l < e.length; l++) {
                var d = e[l].coord;
                r[0] = d, s[r[1] = 0] = d, s[1] = i, t && (Ce(r, r, t), Ce(s, s, t));
                var u = new is({
                    anid: a + "_" + e[l].tickValue,
                    subPixelOptimize: !0,
                    shape: {x1: r[0], y1: r[1], x2: s[0], y2: s[1]},
                    style: n,
                    z2: 2,
                    silent: !0
                });
                o.push(u)
            }
            return o
        }

        var qv = D, Jv = O;

        function Zv(e, t) {
            return "all" === e || M(e) && 0 <= S(e, t) || e === t
        }

        function Qv(e) {
            var t = (e.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
            return t && t.axesInfo[tm(e)]
        }

        function em(e) {
            return !!e.get("handle.show")
        }

        function tm(e) {
            return e.type + "||" + e.id
        }

        var im = Tf({
            type: "axis", _axisPointer: null, axisPointerClass: null, render: function (e, t, i, n) {
                this.axisPointerClass && function (e) {
                    var t = Qv(e);
                    if (t) {
                        var i = t.axisPointerModel, n = t.axis.scale, a = i.option, o = i.get("status"),
                            r = i.get("value");
                        null != r && (r = n.parse(r));
                        var s = em(i);
                        null == o && (a.status = s ? "show" : "hide");
                        var l = n.getExtent().slice();
                        l[0] > l[1] && l.reverse(), (null == r || r > l[1]) && (r = l[1]), r < l[0] && (r = l[0]), a.value = r, s && (a.status = t.axis.scale.isBlank() ? "hide" : "show")
                    }
                }(e), im.superApply(this, "render", arguments), nm(this, e, 0, i, 0, !0)
            }, updateAxisPointer: function (e, t, i, n, a) {
                nm(this, e, 0, i, 0, !1)
            }, remove: function (e, t) {
                var i = this._axisPointer;
                i && i.remove(t), im.superApply(this, "remove", arguments)
            }, dispose: function (e, t) {
                am(this, t), im.superApply(this, "dispose", arguments)
            }
        });

        function nm(e, t, i, n, a, o) {
            var r = im.getAxisPointerClass(e.axisPointerClass);
            if (r) {
                var s = function (e) {
                    var t = Qv(e);
                    return t && t.axisPointerModel
                }(t);
                s ? (e._axisPointer || (e._axisPointer = new r)).render(t, s, n, o) : am(e, n)
            }
        }

        function am(e, t, i) {
            var n = e._axisPointer;
            n && n.dispose(t, i), e._axisPointer = null
        }

        var om = [];

        function rm(e, t, i) {
            i = i || {};
            var n = e.coordinateSystem, a = t.axis, o = {}, r = a.getAxesOnZeroOf()[0], s = a.position,
                l = r ? "onZero" : s, d = a.dim, u = n.getRect(), c = [u.x, u.x + u.width, u.y, u.y + u.height],
                h = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2}, f = t.get("offset") || 0,
                g = "x" === d ? [c[2] - f, c[3] + f] : [c[0] - f, c[1] + f];
            if (r) {
                var p = r.toGlobalCoord(r.dataToCoord(0));
                g[h.onZero] = Math.max(Math.min(p, g[1]), g[0])
            }
            o.position = ["y" === d ? g[h[l]] : c[0], "x" === d ? g[h[l]] : c[3]], o.rotation = Math.PI / 2 * ("x" === d ? 0 : 1), o.labelDirection = o.tickDirection = o.nameDirection = {
                top: -1,
                bottom: 1,
                left: -1,
                right: 1
            }[s], o.labelOffset = r ? g[h[s]] - g[h.onZero] : 0, t.get("axisTick.inside") && (o.tickDirection = -o.tickDirection), W(i.labelInside, t.get("axisLabel.inside")) && (o.labelDirection = -o.labelDirection);
            var v = t.get("axisLabel.rotate");
            return o.labelRotate = "top" === l ? -v : v, o.z2 = 1, o
        }

        function sm(e, t, i, n) {
            var a = i.axis;
            if (!a.scale.isBlank()) {
                var o = i.getModel("splitArea"), r = o.getModel("areaStyle"), s = r.get("color"),
                    l = n.coordinateSystem.getRect(), d = a.getTicksCoords({tickModel: o, clamp: !0});
                if (d.length) {
                    var u = s.length, c = e.__splitAreaColors, h = Q(), f = 0;
                    if (c) for (var g = 0; g < d.length; g++) {
                        var p = c.get(d[g].tickValue);
                        if (null != p) {
                            f = (p + (u - 1) * g) % u;
                            break
                        }
                    }
                    var v = a.toGlobalCoord(d[0].coord), m = r.getAreaStyle();
                    for (s = M(s) ? s : [s], g = 1; g < d.length; g++) {
                        var y, k, w, C, S = a.toGlobalCoord(d[g].coord);
                        v = a.isHorizontal() ? (y = v, k = l.y, w = S - y, C = l.height, y + w) : (y = l.x, k = v, w = l.width, k + (C = S - k));
                        var I = d[g - 1].tickValue;
                        null != I && h.set(I, f), t.add(new es({
                            anid: null != I ? "area_" + I : null,
                            shape: {x: y, y: k, width: w, height: C},
                            style: T({fill: s[f]}, m),
                            silent: !0
                        })), f = (f + 1) % u
                    }
                    e.__splitAreaColors = h
                }
            }
        }

        function lm(e) {
            e.__splitAreaColors = null
        }

        im.registerAxisPointerClass = function (e, t) {
            om[e] = t
        }, im.getAxisPointerClass = function (e) {
            return e && om[e]
        };
        var dm = ["axisLine", "axisTickLabel", "axisName"], um = ["splitArea", "splitLine", "minorSplitLine"],
            cm = im.extend({
                type: "cartesianAxis", axisPointerClass: "CartesianAxisPointer", render: function (e, t, i, n) {
                    this.group.removeAll();
                    var a = this._axisGroup;
                    if (this._axisGroup = new Ai, this.group.add(this._axisGroup), e.get("show")) {
                        var o = e.getCoordSysModel(), r = rm(o, e), s = new Kv(e, r);
                        D(dm, s.add, s), this._axisGroup.add(s.getGroup()), D(um, function (t) {
                            e.get(t + ".show") && this["_" + t](e, o)
                        }, this), ul(a, this._axisGroup, e), cm.superCall(this, "render", e, t, i, n)
                    }
                }, remove: function () {
                    lm(this)
                }, _splitLine: function (e, t) {
                    var i = e.axis;
                    if (!i.scale.isBlank()) {
                        var n = e.getModel("splitLine"), a = n.getModel("lineStyle"), o = a.get("color");
                        o = M(o) ? o : [o];
                        for (var r = t.coordinateSystem.getRect(), s = i.isHorizontal(), l = 0, d = i.getTicksCoords({tickModel: n}), u = [], c = [], h = a.getLineStyle(), f = 0; f < d.length; f++) {
                            var g = i.toGlobalCoord(d[f].coord);
                            s ? (u[0] = g, u[1] = r.y, c[0] = g, c[1] = r.y + r.height) : (u[0] = r.x, u[1] = g, c[0] = r.x + r.width, c[1] = g);
                            var p = l++ % o.length, v = d[f].tickValue;
                            this._axisGroup.add(new is({
                                anid: null != v ? "line_" + d[f].tickValue : null,
                                subPixelOptimize: !0,
                                shape: {x1: u[0], y1: u[1], x2: c[0], y2: c[1]},
                                style: T({stroke: o[p]}, h),
                                silent: !0
                            }))
                        }
                    }
                }, _minorSplitLine: function (e, t) {
                    var i = e.axis, n = e.getModel("minorSplitLine").getModel("lineStyle"),
                        a = t.coordinateSystem.getRect(), o = i.isHorizontal(), r = i.getMinorTicksCoords();
                    if (r.length) for (var s = [], l = [], d = n.getLineStyle(), u = 0; u < r.length; u++) for (var c = 0; c < r[u].length; c++) {
                        var h = i.toGlobalCoord(r[u][c].coord);
                        o ? (s[0] = h, s[1] = a.y, l[0] = h, l[1] = a.y + a.height) : (s[0] = a.x, s[1] = h, l[0] = a.x + a.width, l[1] = h), this._axisGroup.add(new is({
                            anid: "minor_line_" + r[u][c].tickValue,
                            subPixelOptimize: !0,
                            shape: {x1: s[0], y1: s[1], x2: l[0], y2: l[1]},
                            style: d,
                            silent: !0
                        }))
                    }
                }, _splitArea: function (e, t) {
                    sm(this, this._axisGroup, e, t)
                }
            });
        cm.extend({type: "xAxis"}), cm.extend({type: "yAxis"}), Tf({
            type: "grid", render: function (e, t) {
                this.group.removeAll(), e.get("show") && this.group.add(new es({
                    shape: e.coordinateSystem.getRect(),
                    style: T({fill: e.get("backgroundColor")}, e.getItemStyle()),
                    silent: !0,
                    z2: -1
                }))
            }
        }), cf(function (e) {
            e.xAxis && e.yAxis && !e.grid && (e.grid = {})
        }), vf(mv("line", "circle", "line")), pf(yv("line")), hf(Sh.PROCESSOR.STATISTIC, {
            seriesType: "line",
            modifyOutputEnd: !0,
            reset: function (e, t, i) {
                var n = e.getData(), a = e.get("sampling"), o = e.coordinateSystem;
                if ("cartesian2d" === o.type && a) {
                    var r, s = o.getBaseAxis(), l = o.getOtherAxis(s), d = s.getExtent(), u = d[1] - d[0],
                        c = Math.round(n.count() / u);
                    1 < c && ("string" == typeof a ? r = Tv[a] : "function" == typeof a && (r = a), r && e.setData(n.downSample(n.mapDimension(l.dim), 1 / c, r, kv)))
                }
            }
        });
        var hm = ec.extend({
            type: "series.__base_bar__",
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            getMarkerPosition: function (e) {
                var t = this.coordinateSystem;
                if (t) {
                    var i = t.dataToPoint(t.clampData(e)), n = this.getData(), a = n.getLayout("offset"),
                        o = n.getLayout("size");
                    return i[t.getBaseAxis().isHorizontal() ? 0 : 1] += a + o / 2, i
                }
                return [NaN, NaN]
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                barMinHeight: 0,
                barMinAngle: 0,
                large: !1,
                largeThreshold: 400,
                progressive: 3e3,
                progressiveChunkMode: "mod",
                itemStyle: {},
                emphasis: {}
            }
        });

        function fm(e, t, i, n, a, o) {
            Ys(e, t, i.getModel("label"), i.getModel("emphasis.label"), {
                labelFetcher: a,
                labelDataIndex: o,
                defaultText: Op(a.getData(), o),
                isRectText: !0,
                autoColor: n
            }), gm(e), gm(t)
        }

        function gm(e, t) {
            "outside" === e.textPosition && (e.textPosition = t)
        }

        hm.extend({
            type: "series.bar",
            dependencies: ["grid", "polar"],
            brushSelector: "rect",
            getProgressive: function () {
                return !!this.get("large") && this.get("progressive")
            },
            getProgressiveThreshold: function () {
                var e = this.get("progressiveThreshold"), t = this.get("largeThreshold");
                return e < t && (e = t), e
            },
            defaultOption: {
                clip: !0,
                roundCap: !1,
                showBackground: !1,
                backgroundStyle: {
                    color: "rgba(180, 180, 180, 0.2)",
                    borderColor: null,
                    borderWidth: 0,
                    borderType: "solid",
                    borderRadius: 0,
                    shadowBlur: 0,
                    shadowColor: null,
                    shadowOffsetX: 0,
                    shadowOffsetY: 0,
                    opacity: 1
                }
            }
        });
        var pm = no([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["stroke", "barBorderColor"], ["lineWidth", "barBorderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]),
            vm = {
                getBarItemStyle: function (e) {
                    var t = pm(this, e);
                    if (this.getBorderLineDash) {
                        var i = this.getBorderLineDash();
                        i && (t.lineDash = i)
                    }
                    return t
                }
            }, mm = Ss({
                type: "sausage",
                shape: {cx: 0, cy: 0, r0: 0, r: 0, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0},
                buildPath: function (e, t) {
                    var i = t.cx, n = t.cy, a = Math.max(t.r0 || 0, 0), o = Math.max(t.r, 0), r = .5 * (o - a), s = a + r,
                        l = t.startAngle, d = t.endAngle, u = t.clockwise, c = Math.cos(l), h = Math.sin(l),
                        f = Math.cos(d), g = Math.sin(d);
                    (u ? d - l < 2 * Math.PI : l - d < 2 * Math.PI) && (e.moveTo(c * a + i, h * a + n), e.arc(c * s + i, h * s + n, r, -Math.PI + l, l, !u)), e.arc(i, n, o, l, d, !u), e.moveTo(f * o + i, g * o + n), e.arc(f * s + i, g * s + n, r, d - 2 * Math.PI, d - Math.PI, !u), 0 !== a && (e.arc(i, n, a, d, l, u), e.moveTo(c * a + i, g * a + n)), e.closePath()
                }
            }), ym = ["itemStyle", "barBorderWidth"], km = [0, 0];
        k(Sl.prototype, vm), Cf({
            type: "bar", render: function (e, t, i) {
                this._updateDrawMode(e);
                var n = e.get("coordinateSystem");
                return "cartesian2d" !== n && "polar" !== n || (this._isLargeDraw ? this._renderLarge(e, t, i) : this._renderNormal(e, t, i)), this.group
            }, incrementalPrepareRender: function (e, t, i) {
                this._clear(), this._updateDrawMode(e)
            }, incrementalRender: function (e, t, i, n) {
                this._incrementalRenderLarge(e, t)
            }, _updateDrawMode: function (e) {
                var t = e.pipelineContext.large;
                (null == this._isLargeDraw || t ^ this._isLargeDraw) && (this._isLargeDraw = t, this._clear())
            }, _renderNormal: function (e, t, i) {
                var n, a = this.group, o = e.getData(), r = this._data, s = e.coordinateSystem, l = s.getBaseAxis();
                "cartesian2d" === s.type ? n = l.isHorizontal() : "polar" === s.type && (n = "angle" === l.dim);
                var d = e.isAnimationEnabled() ? e : null, u = e.get("clip", !0), c = function (e, t) {
                    var i = e.getArea && e.getArea();
                    if ("cartesian2d" === e.type) {
                        var n = e.getBaseAxis();
                        if ("category" !== n.type || !n.onBand) {
                            var a = t.getLayout("bandWidth");
                            n.isHorizontal() ? (i.x -= a, i.width += 2 * a) : (i.y -= a, i.height += 2 * a)
                        }
                    }
                    return i
                }(s, o);
                a.removeClipPath();
                var h = e.get("roundCap", !0), f = e.get("showBackground", !0), g = e.getModel("backgroundStyle"),
                    p = g.get("barBorderRadius") || 0, v = [], m = this._backgroundEls || [];
                o.diff(r).add(function (t) {
                    var i = o.getItemModel(t), r = _m[s.type](o, t, i);
                    if (f) {
                        var l = _m[s.type](o, t), m = function (e, t, i) {
                            return new ("polar" === e.type ? Gr : es)({shape: Pm(t, i, e), silent: !0, z2: 0})
                        }(s, n, l);
                        m.useStyle(g.getBarItemStyle()), "cartesian2d" === s.type && m.setShape("r", p), v[t] = m
                    }
                    if (o.hasValue(t)) {
                        if (u && Cm[s.type](c, r)) return void a.remove(y);
                        var y = Sm[s.type](t, r, n, d, !1, h);
                        o.setItemGraphicEl(t, y), a.add(y), Am(y, o, t, i, r, e, n, "polar" === s.type)
                    }
                }).update(function (t, i) {
                    var l = o.getItemModel(t), y = _m[s.type](o, t, l);
                    if (f) {
                        var k = m[i];
                        k.useStyle(g.getBarItemStyle()), "cartesian2d" === s.type && k.setShape("r", p), v[t] = k;
                        var T = _m[s.type](o, t);
                        ol(k, {shape: Pm(n, T, s)}, d, t)
                    }
                    var w = r.getItemGraphicEl(i);
                    if (o.hasValue(t)) {
                        if (u && Cm[s.type](c, y)) return void a.remove(w);
                        w ? ol(w, {shape: y}, d, t) : w = Sm[s.type](t, y, n, d, !0, h), o.setItemGraphicEl(t, w), a.add(w), Am(w, o, t, l, y, e, n, "polar" === s.type)
                    } else a.remove(w)
                }).remove(function (e) {
                    var t = r.getItemGraphicEl(e);
                    "cartesian2d" === s.type ? t && Im(e, d, t) : t && bm(e, d, t)
                }).execute();
                var y = this._backgroundGroup || (this._backgroundGroup = new Ai);
                y.removeAll();
                for (var k = 0; k < v.length; ++k) y.add(v[k]);
                a.add(y), this._backgroundEls = v, this._data = o
            }, _renderLarge: function (e, t, i) {
                this._clear(), xm(e, this.group);
                var n = e.get("clip", !0) ? cv(e.coordinateSystem, !1, e) : null;
                n ? this.group.setClipPath(n) : this.group.removeClipPath()
            }, _incrementalRenderLarge: function (e, t) {
                this._removeBackground(), xm(t, this.group, !0)
            }, dispose: te, remove: function (e) {
                this._clear(e)
            }, _clear: function (e) {
                var t = this.group, i = this._data;
                e && e.get("animation") && i && !this._isLargeDraw ? (this._removeBackground(), this._backgroundEls = [], i.eachItemGraphicEl(function (t) {
                    "sector" === t.type ? bm(t.dataIndex, e, t) : Im(t.dataIndex, e, t)
                })) : t.removeAll(), this._data = null
            }, _removeBackground: function () {
                this.group.remove(this._backgroundGroup), this._backgroundGroup = null
            }
        });
        var Tm = Math.max, wm = Math.min, Cm = {
            cartesian2d: function (e, t) {
                var i = t.width < 0 ? -1 : 1, n = t.height < 0 ? -1 : 1;
                i < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height);
                var a = Tm(t.x, e.x), o = wm(t.x + t.width, e.x + e.width), r = Tm(t.y, e.y),
                    s = wm(t.y + t.height, e.y + e.height);
                t.x = a, t.y = r, t.width = o - a, t.height = s - r;
                var l = t.width < 0 || t.height < 0;
                return i < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height), l
            }, polar: function (e) {
                return !1
            }
        }, Sm = {
            cartesian2d: function (e, t, i, n, a) {
                var o = new es({shape: k({}, t), z2: 1});
                if (o.name = "item", n) {
                    var r = i ? "height" : "width", s = {};
                    o.shape[r] = 0, s[r] = t[r], vl[a ? "updateProps" : "initProps"](o, {shape: s}, n, e)
                }
                return o
            }, polar: function (e, t, i, n, a, o) {
                var r = t.startAngle < t.endAngle, s = new (!i && o ? mm : Gr)({shape: T({clockwise: r}, t), z2: 1});
                if (s.name = "item", n) {
                    var l = i ? "r" : "endAngle", d = {};
                    s.shape[l] = i ? 0 : t.startAngle, d[l] = t[l], vl[a ? "updateProps" : "initProps"](s, {shape: d}, n, e)
                }
                return s
            }
        };

        function Im(e, t, i) {
            i.style.text = null, ol(i, {shape: {width: 0}}, t, e, function () {
                i.parent && i.parent.remove(i)
            })
        }

        function bm(e, t, i) {
            i.style.text = null, ol(i, {shape: {r: i.shape.r0}}, t, e, function () {
                i.parent && i.parent.remove(i)
            })
        }

        var _m = {
            cartesian2d: function (e, t, i) {
                var n = e.getItemLayout(t), a = i ? function (e, t) {
                    var i = e.get(ym) || 0, n = isNaN(t.width) ? Number.MAX_VALUE : Math.abs(t.width),
                        a = isNaN(t.height) ? Number.MAX_VALUE : Math.abs(t.height);
                    return Math.min(i, n, a)
                }(i, n) : 0, o = 0 < n.width ? 1 : -1, r = 0 < n.height ? 1 : -1;
                return {x: n.x + o * a / 2, y: n.y + r * a / 2, width: n.width - o * a, height: n.height - r * a}
            }, polar: function (e, t, i) {
                var n = e.getItemLayout(t);
                return {cx: n.cx, cy: n.cy, r0: n.r0, r: n.r, startAngle: n.startAngle, endAngle: n.endAngle}
            }
        };

        function Dm(e) {
            return null != e.startAngle && null != e.endAngle && e.startAngle === e.endAngle
        }

        function Am(e, t, i, n, a, o, r, s) {
            var l = t.getItemVisual(i, "color"), d = t.getItemVisual(i, "opacity"), u = t.getVisual("borderColor"),
                c = n.getModel("itemStyle"), h = n.getModel("emphasis.itemStyle").getBarItemStyle();
            s || e.setShape("r", c.get("barBorderRadius") || 0), e.useStyle(T({
                stroke: Dm(a) ? "none" : u,
                fill: Dm(a) ? "none" : l,
                opacity: d
            }, c.getBarItemStyle()));
            var f = n.getShallow("cursor");
            f && e.attr("cursor", f), r ? a.height : a.width, s || fm(e.style, h, n, l, o, i), Dm(a) && (h.fill = h.stroke = "none"), zs(e, h)
        }

        var Nm = wr.extend({
            type: "largeBar", shape: {points: []}, buildPath: function (e, t) {
                for (var i = t.points, n = this.__startPoint, a = this.__baseDimIdx, o = 0; o < i.length; o += 2) n[a] = i[o + a], e.moveTo(n[0], n[1]), e.lineTo(i[o], i[o + 1])
            }
        });

        function xm(e, t, i) {
            var n = e.getData(), a = [], o = n.getLayout("valueAxisHorizontal") ? 1 : 0;
            a[1 - o] = n.getLayout("valueAxisStart");
            var r = n.getLayout("largeDataIndices"), s = n.getLayout("barWidth"), l = e.getModel("backgroundStyle");
            if (e.get("showBackground", !0)) {
                var d = n.getLayout("largeBackgroundPoints"), u = [];
                u[1 - o] = n.getLayout("backgroundStart");
                var c = new Nm({
                    shape: {points: d},
                    incremental: !!i,
                    __startPoint: u,
                    __baseDimIdx: o,
                    __largeDataIndices: r,
                    __barWidth: s,
                    silent: !0,
                    z2: 0
                });
                !function (e, t, i) {
                    var n = t.get("borderColor") || t.get("color"), a = t.getItemStyle(["color", "borderColor"]);
                    e.useStyle(a), e.style.fill = null, e.style.stroke = n, e.style.lineWidth = i.getLayout("barWidth")
                }(c, l, n), t.add(c)
            }
            var h = new Nm({
                shape: {points: n.getLayout("largePoints")},
                incremental: !!i,
                __startPoint: a,
                __baseDimIdx: o,
                __largeDataIndices: r,
                __barWidth: s
            });
            t.add(h), function (e, t, i) {
                var n = i.getVisual("borderColor") || i.getVisual("color"),
                    a = t.getModel("itemStyle").getItemStyle(["color", "borderColor"]);
                e.useStyle(a), e.style.fill = null, e.style.stroke = n, e.style.lineWidth = i.getLayout("barWidth")
            }(h, e, n), h.seriesIndex = e.seriesIndex, e.get("silent") || (h.on("mousedown", Em), h.on("mousemove", Em))
        }

        var Em = Sc(function (e) {
            var t = function (e, t, i) {
                var n = e.__baseDimIdx, a = 1 - n, o = e.shape.points, r = e.__largeDataIndices,
                    s = Math.abs(e.__barWidth / 2), l = e.__startPoint[a];
                km[0] = t, km[1] = i;
                for (var d = km[n], u = km[1 - n], c = d - s, h = d + s, f = 0, g = o.length / 2; f < g; f++) {
                    var p = 2 * f, v = o[p + n], m = o[p + a];
                    if (c <= v && v <= h && (l <= m ? l <= u && u <= m : m <= u && u <= l)) return r[f]
                }
                return -1
            }(this, e.offsetX, e.offsetY);
            this.dataIndex = 0 <= t ? t : null
        }, 30, !1);

        function Pm(e, t, i) {
            var n, a = "polar" === i.type;
            return n = a ? i.getArea() : i.grid.getRect(), a ? {
                cx: n.cx,
                cy: n.cy,
                r0: e ? n.r0 : t.r0,
                r: e ? n.r : t.r,
                startAngle: e ? t.startAngle : 0,
                endAngle: e ? t.endAngle : 2 * Math.PI
            } : {x: e ? t.x : n.x, y: e ? n.y : t.y, width: e ? t.width : n.width, height: e ? n.height : t.height}
        }

        function Om(e, t, i) {
            t = M(t) && {coordDimensions: t} || k({}, t);
            var n = e.getSource(), a = eg(n, t), o = new Kf(a, e);
            return o.initData(n, i), o
        }

        pf(Sh.VISUAL.LAYOUT, O(Ag, "bar")), pf(Sh.VISUAL.PROGRESSIVE_LAYOUT, Ng), vf({
            seriesType: "bar",
            reset: function (e) {
                e.getData().setVisual("legendSymbol", "roundRect")
            }
        });
        var Mm = {
            updateSelectedMap: function (e) {
                this._targetList = M(e) ? e.slice() : [], this._selectTargetMap = N(e || [], function (e, t) {
                    return e.set(t.name, t), e
                }, Q())
            }, select: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                "single" === this.get("selectedMode") && this._selectTargetMap.each(function (e) {
                    e.selected = !1
                }), i && (i.selected = !0)
            }, unSelect: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                i && (i.selected = !1)
            }, toggleSelected: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                if (null != i) return this[i.selected ? "unSelect" : "select"](e, t), i.selected
            }, isSelected: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                return i && i.selected
            }
        };

        function Fm(e, t) {
            this.getAllNames = function () {
                var e = t();
                return e.mapArray(e.getName)
            }, this.containName = function (e) {
                return 0 <= t().indexOfName(e)
            }, this.indexOfName = function (t) {
                return e().indexOfName(t)
            }, this.getItemVisual = function (t, i) {
                return e().getItemVisual(t, i)
            }
        }

        var Lm = wf({
            type: "series.pie",
            init: function (e) {
                Lm.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this)), this.updateSelectedMap(this._createSelectableList()), this._defaultLabelLine(e)
            },
            mergeOption: function (e) {
                Lm.superCall(this, "mergeOption", e), this.updateSelectedMap(this._createSelectableList())
            },
            getInitialData: function (e, t) {
                return Om(this, {coordDimensions: ["value"], encodeDefaulter: O(jd, this)})
            },
            _createSelectableList: function () {
                for (var e = this.getRawData(), t = e.mapDimension("value"), i = [], n = 0, a = e.count(); n < a; n++) i.push({
                    name: e.getName(n),
                    value: e.get(t, n),
                    selected: Ru(e, n, "selected")
                });
                return i
            },
            getDataParams: function (e) {
                var t = this.getData(), i = Lm.superCall(this, "getDataParams", e), n = [];
                return t.each(t.mapDimension("value"), function (e) {
                    n.push(e)
                }), i.percent = Ll(n, e, t.hostModel.get("percentPrecision")), i.$vars.push("percent"), i
            },
            _defaultLabelLine: function (e) {
                Oa(e, "labelLine", ["show"]);
                var t = e.labelLine, i = e.emphasis.labelLine;
                t.show = t.show && e.label.show, i.show = i.show && e.emphasis.label.show
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                hoverAnimation: !0,
                center: ["50%", "50%"],
                radius: [0, "75%"],
                clockwise: !0,
                startAngle: 90,
                minAngle: 0,
                minShowLabelAngle: 0,
                selectedOffset: 10,
                hoverOffset: 10,
                avoidLabelOverlap: !0,
                percentPrecision: 2,
                stillShowZeroSum: !0,
                left: 0,
                top: 0,
                right: 0,
                bottom: 0,
                width: null,
                height: null,
                label: {
                    rotate: !1,
                    show: !0,
                    position: "outer",
                    alignTo: "none",
                    margin: "25%",
                    bleedMargin: 10,
                    distanceToLabelLine: 5
                },
                labelLine: {show: !0, length: 15, length2: 15, smooth: !1, lineStyle: {width: 1, type: "solid"}},
                itemStyle: {borderWidth: 1},
                animationType: "expansion",
                animationTypeUpdate: "transition",
                animationEasing: "cubicOut"
            }
        });

        function Rm(e, t, i, n) {
            var a = t.getData(), o = this.dataIndex, r = a.getName(o), s = t.get("selectedOffset");
            n.dispatchAction({type: "pieToggleSelect", from: e, name: r, seriesId: t.id}), a.each(function (e) {
                Bm(a.getItemGraphicEl(e), a.getItemLayout(e), t.isSelected(a.getName(e)), s, i)
            })
        }

        function Bm(e, t, i, n, a) {
            var o = (t.startAngle + t.endAngle) / 2, r = i ? n : 0, s = [Math.cos(o) * r, Math.sin(o) * r];
            a ? e.animate().when(200, {position: s}).start("bounceOut") : e.attr("position", s)
        }

        function Um(e, t) {
            Ai.call(this);
            var i = new Gr({z2: 2}), n = new $r, a = new Ur;
            this.add(i), this.add(n), this.add(a), this.updateData(e, t, !0)
        }

        b(Lm, Mm);
        var Km = Um.prototype;

        function Vm(e, t) {
            D(t, function (t) {
                t.update = "updateView", ff(t, function (i, n) {
                    var a = {};
                    return n.eachComponent({mainType: "series", subType: e, query: i}, function (e) {
                        e[t.method] && e[t.method](i.name, i.dataIndex);
                        var n = e.getData();
                        n.each(function (t) {
                            var i = n.getName(t);
                            a[i] = e.isSelected(i) || !1
                        })
                    }), {name: i.name, selected: a, seriesId: i.seriesId}
                })
            })
        }

        function Wm(e) {
            return {
                getTargetSeries: function (t) {
                    var i = {}, n = Q();
                    return t.eachSeriesByType(e, function (e) {
                        e.__paletteScope = i, n.set(e.uid, e)
                    }), n
                }, reset: function (e, t) {
                    var i = e.getRawData(), n = {}, a = e.getData();
                    a.each(function (e) {
                        var t = a.getRawIndex(e);
                        n[t] = e
                    }), i.each(function (t) {
                        var o, r = n[t], s = null != r && a.getItemVisual(r, "color", !0),
                            l = null != r && a.getItemVisual(r, "borderColor", !0);
                        if (s && l || (o = i.getItemModel(t)), !s) {
                            var d = o.get("itemStyle.color") || e.getColorFromPalette(i.getName(t) || t + "", e.__paletteScope, i.count());
                            null != r && a.setItemVisual(r, "color", d)
                        }
                        if (!l) {
                            var u = o.get("itemStyle.borderColor");
                            null != r && a.setItemVisual(r, "borderColor", u)
                        }
                    })
                }
            }
        }

        Km.updateData = function (e, t, i) {
            var n = this.childAt(0), a = this.childAt(1), o = this.childAt(2), r = e.hostModel, s = e.getItemModel(t),
                l = e.getItemLayout(t), d = k({}, l);
            d.label = null;
            var u = r.getShallow("animationTypeUpdate");
            i ? (n.setShape(d), "scale" === r.getShallow("animationType") ? (n.shape.r = l.r0, rl(n, {shape: {r: l.r}}, r, t)) : (n.shape.endAngle = l.startAngle, ol(n, {shape: {endAngle: l.endAngle}}, r, t))) : "expansion" === u ? n.setShape(d) : ol(n, {shape: d}, r, t);
            var c = e.getItemVisual(t, "color");
            n.useStyle(T({
                lineJoin: "bevel",
                fill: c
            }, s.getModel("itemStyle").getItemStyle())), n.hoverStyle = s.getModel("emphasis.itemStyle").getItemStyle();
            var h = s.getShallow("cursor");
            h && n.attr("cursor", h), Bm(this, e.getItemLayout(t), r.isSelected(e.getName(t)), r.get("selectedOffset"), r.get("animation"));
            var f = !i && "transition" === u;
            this._updateLabel(e, t, f), this.highDownOnUpdate = r.get("silent") ? null : function (e, t) {
                var i = r.isAnimationEnabled() && s.get("hoverAnimation");
                "emphasis" === t ? (a.ignore = a.hoverIgnore, o.ignore = o.hoverIgnore, i && (n.stopAnimation(!0), n.animateTo({shape: {r: l.r + r.get("hoverOffset")}}, 300, "elasticOut"))) : (a.ignore = a.normalIgnore, o.ignore = o.normalIgnore, i && (n.stopAnimation(!0), n.animateTo({shape: {r: l.r}}, 300, "elasticOut")))
            }, zs(this)
        }, Km._updateLabel = function (e, t, i) {
            var n = this.childAt(1), a = this.childAt(2), o = e.hostModel, r = e.getItemModel(t),
                s = e.getItemLayout(t).label, l = e.getItemVisual(t, "color");
            if (!s || isNaN(s.x) || isNaN(s.y)) a.ignore = a.normalIgnore = a.hoverIgnore = n.ignore = n.normalIgnore = n.hoverIgnore = !0; else {
                var d = {points: s.linePoints || [[s.x, s.y], [s.x, s.y], [s.x, s.y]]}, u = {x: s.x, y: s.y};
                i ? (ol(n, {shape: d}, o, t), ol(a, {style: u}, o, t)) : (n.attr({shape: d}), a.attr({style: u})), a.attr({
                    rotation: s.rotation,
                    origin: [s.x, s.y],
                    z2: 10
                });
                var c = r.getModel("label"), h = r.getModel("emphasis.label"), f = r.getModel("labelLine"),
                    g = r.getModel("emphasis.labelLine");
                l = e.getItemVisual(t, "color"), Ys(a.style, a.hoverStyle = {}, c, h, {
                    labelFetcher: e.hostModel,
                    labelDataIndex: t,
                    defaultText: s.text,
                    autoColor: l,
                    useInsideStyle: !!s.inside
                }, {
                    textAlign: s.textAlign,
                    textVerticalAlign: s.verticalAlign,
                    opacity: e.getItemVisual(t, "opacity")
                }), a.ignore = a.normalIgnore = !c.get("show"), a.hoverIgnore = !h.get("show"), n.ignore = n.normalIgnore = !f.get("show"), n.hoverIgnore = !g.get("show"), n.setStyle({
                    stroke: l,
                    opacity: e.getItemVisual(t, "opacity")
                }), n.setStyle(f.getModel("lineStyle").getLineStyle()), n.hoverStyle = g.getModel("lineStyle").getLineStyle();
                var p = f.get("smooth");
                p && !0 === p && (p = .4), n.setShape({smooth: p})
            }
        }, I(Um, Ai), fc.extend({
            type: "pie", init: function () {
                var e = new Ai;
                this._sectorGroup = e
            }, render: function (e, t, i, n) {
                if (!n || n.from !== this.uid) {
                    var a = e.getData(), o = this._data, r = this.group, s = t.get("animation"), l = !o,
                        d = e.get("animationType"), u = e.get("animationTypeUpdate"), c = O(Rm, this.uid, e, s, i),
                        h = e.get("selectedMode");
                    if (a.diff(o).add(function (e) {
                        var t = new Um(a, e);
                        l && "scale" !== d && t.eachChild(function (e) {
                            e.stopAnimation(!0)
                        }), h && t.on("click", c), a.setItemGraphicEl(e, t), r.add(t)
                    }).update(function (e, t) {
                        var i = o.getItemGraphicEl(t);
                        l || "transition" === u || i.eachChild(function (e) {
                            e.stopAnimation(!0)
                        }), i.updateData(a, e), i.off("click"), h && i.on("click", c), r.add(i), a.setItemGraphicEl(e, i)
                    }).remove(function (e) {
                        var t = o.getItemGraphicEl(e);
                        r.remove(t)
                    }).execute(), s && 0 < a.count() && (l ? "scale" !== d : "transition" !== u)) {
                        for (var f = a.getItemLayout(0), g = 1; isNaN(f.startAngle) && g < a.count(); ++g) f = a.getItemLayout(g);
                        var p = Math.max(i.getWidth(), i.getHeight()) / 2, v = P(r.removeClipPath, r);
                        r.setClipPath(this._createClipPath(f.cx, f.cy, p, f.startAngle, f.clockwise, v, e, l))
                    } else r.removeClipPath();
                    this._data = a
                }
            }, dispose: function () {
            }, _createClipPath: function (e, t, i, n, a, o, r, s) {
                var l = new Gr({shape: {cx: e, cy: t, r0: 0, r: i, startAngle: n, endAngle: n, clockwise: a}});
                return (s ? rl : ol)(l, {shape: {endAngle: n + (a ? 1 : -1) * Math.PI * 2}}, r, o), l
            }, containPoint: function (e, t) {
                var i = t.getData().getItemLayout(0);
                if (i) {
                    var n = e[0] - i.cx, a = e[1] - i.cy, o = Math.sqrt(n * n + a * a);
                    return o <= i.r && o >= i.r0
                }
            }
        });
        var Gm = Math.PI / 180;

        function Hm(e, t, i, n, a, o, r, s, l, d) {
            function u(t, i, n) {
                for (var a = t; a < i && !(e[a].y + n > l + r); a++) if (e[a].y += n, t < a && a + 1 < i && e[a + 1].y > e[a].y + e[a].height) return void c(a, n / 2);
                c(i - 1, n / 2)
            }

            function c(t, i) {
                for (var n = t; 0 <= n && !(e[n].y - i < l) && (e[n].y -= i, !(0 < n && e[n].y > e[n - 1].y + e[n - 1].height)); n--) ;
            }

            function h(e, t, i, n, a, o) {
                for (var r = t ? Number.MAX_VALUE : 0, s = 0, l = e.length; s < l; s++) if ("none" === e[s].labelAlignTo) {
                    var d = Math.abs(e[s].y - n), u = e[s].len, c = e[s].len2,
                        h = d < a + u ? Math.sqrt((a + u + c) * (a + u + c) - d * d) : Math.abs(e[s].x - i);
                    t && r <= h && (h = r - 10), !t && h <= r && (h = r + 10), e[s].x = i + h * o, r = h
                }
            }

            e.sort(function (e, t) {
                return e.y - t.y
            });
            for (var f, g = 0, p = e.length, v = [], m = [], y = 0; y < p; y++) {
                if ("outer" === e[y].position && "labelLine" === e[y].labelAlignTo) {
                    var k = e[y].x - d;
                    e[y].linePoints[1][0] += k, e[y].x = d
                }
                (f = e[y].y - g) < 0 && u(y, p, -f), g = e[y].y + e[y].height
            }
            for (r - g < 0 && c(p - 1, g - r), y = 0; y < p; y++) e[y].y >= i ? m.push(e[y]) : v.push(e[y]);
            h(v, !1, t, i, n, a), h(m, !0, t, i, n, a)
        }

        function zm(e) {
            return "center" === e.position
        }

        var jm = 2 * Math.PI, Xm = Math.PI / 180;

        function $m(e) {
            return {
                seriesType: e, reset: function (e, t) {
                    var i = t.findComponents({mainType: "legend"});
                    if (i && i.length) {
                        var n = e.getData();
                        n.filterSelf(function (e) {
                            for (var t = n.getName(e), a = 0; a < i.length; a++) if (!i[a].isSelected(t)) return !1;
                            return !0
                        })
                    }
                }
            }
        }

        Vm("pie", [{type: "pieToggleSelect", event: "pieselectchanged", method: "toggleSelected"}, {
            type: "pieSelect",
            event: "pieselected",
            method: "select"
        }, {
            type: "pieUnSelect",
            event: "pieunselected",
            method: "unSelect"
        }]), vf(Wm("pie")), pf(O(function (e, t, i, n) {
            t.eachSeriesByType(e, function (e) {
                var t = e.getData(), n = t.mapDimension("value"), a = function (e, t) {
                    return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                }(e, i), o = e.get("center"), r = e.get("radius");
                M(r) || (r = [0, r]), M(o) || (o = [o, o]);
                var s = xl(a.width, i.getWidth()), l = xl(a.height, i.getHeight()), d = Math.min(s, l),
                    u = xl(o[0], s) + a.x, c = xl(o[1], l) + a.y, h = xl(r[0], d / 2), f = xl(r[1], d / 2),
                    g = -e.get("startAngle") * Xm, p = e.get("minAngle") * Xm, v = 0;
                t.each(n, function (e) {
                    isNaN(e) || v++
                });
                var m = t.getSum(n), y = Math.PI / (m || v) * 2, k = e.get("clockwise"), T = e.get("roseType"),
                    w = e.get("stillShowZeroSum"), C = t.getDataExtent(n);
                C[0] = 0;
                var S = jm, I = 0, b = g, _ = k ? 1 : -1;
                if (t.each(n, function (e, i) {
                    var n;
                    if (isNaN(e)) t.setItemLayout(i, {
                        angle: NaN,
                        startAngle: NaN,
                        endAngle: NaN,
                        clockwise: k,
                        cx: u,
                        cy: c,
                        r0: h,
                        r: T ? NaN : f,
                        viewRect: a
                    }); else {
                        (n = "area" !== T ? 0 === m && w ? y : e * y : jm / v) < p ? S -= n = p : I += e;
                        var o = b + _ * n;
                        t.setItemLayout(i, {
                            angle: n,
                            startAngle: b,
                            endAngle: o,
                            clockwise: k,
                            cx: u,
                            cy: c,
                            r0: h,
                            r: T ? Nl(e, C, [h, f]) : f,
                            viewRect: a
                        }), b = o
                    }
                }), S < jm && v) if (S <= .001) {
                    var D = jm / v;
                    t.each(n, function (e, i) {
                        if (!isNaN(e)) {
                            var n = t.getItemLayout(i);
                            n.angle = D, n.startAngle = g + _ * i * D, n.endAngle = g + _ * (i + 1) * D
                        }
                    })
                } else y = S / I, b = g, t.each(n, function (e, i) {
                    if (!isNaN(e)) {
                        var n = t.getItemLayout(i), a = n.angle === p ? p : e * y;
                        n.startAngle = b, n.endAngle = b + _ * a, b += _ * a
                    }
                });
                !function (e, t, i, n, a, o) {
                    var r, s, l = e.getData(), d = [], u = !1, c = (e.get("minShowLabelAngle") || 0) * Gm;
                    l.each(function (n) {
                        var o = l.getItemLayout(n), h = l.getItemModel(n), f = h.getModel("label"),
                            g = f.get("position") || h.get("emphasis.label.position"), p = f.get("distanceToLabelLine"),
                            v = f.get("alignTo"), m = xl(f.get("margin"), i), y = f.get("bleedMargin"), k = f.getFont(),
                            T = h.getModel("labelLine"), w = T.get("length");
                        w = xl(w, i);
                        var C = T.get("length2");
                        if (C = xl(C, i), !(o.angle < c)) {
                            var S, I, b, _, D = (o.startAngle + o.endAngle) / 2, A = Math.cos(D), N = Math.sin(D);
                            r = o.cx, s = o.cy;
                            var x, E = e.getFormattedLabel(n, "normal") || l.getName(n), P = cn(E, k, _, "top"),
                                O = "inside" === g || "inner" === g;
                            if ("center" === g) S = o.cx, I = o.cy, _ = "center"; else {
                                var M = (O ? (o.r + o.r0) / 2 * A : o.r * A) + r,
                                    F = (O ? (o.r + o.r0) / 2 * N : o.r * N) + s;
                                if (S = M + 3 * A, I = F + 3 * N, !O) {
                                    var L = M + A * (w + t - o.r), R = F + N * (w + t - o.r),
                                        B = L + (A < 0 ? -1 : 1) * C;
                                    S = "edge" === v ? A < 0 ? a + m : a + i - m : B + (A < 0 ? -p : p), b = [[M, F], [L, R], [B, I = R]]
                                }
                                _ = O ? "center" : "edge" === v ? 0 < A ? "right" : "left" : 0 < A ? "left" : "right"
                            }
                            var U = f.get("rotate");
                            x = "number" == typeof U ? U * (Math.PI / 180) : U ? A < 0 ? -D + Math.PI : -D : 0, u = !!x, o.label = {
                                x: S,
                                y: I,
                                position: g,
                                height: P.height,
                                len: w,
                                len2: C,
                                linePoints: b,
                                textAlign: _,
                                verticalAlign: "middle",
                                rotation: x,
                                inside: O,
                                labelDistance: p,
                                labelAlignTo: v,
                                labelMargin: m,
                                bleedMargin: y,
                                textRect: P,
                                text: E,
                                font: k
                            }, O || d.push(o.label)
                        }
                    }), !u && e.get("avoidLabelOverlap") && function (e, t, i, n, a, o, r, s) {
                        for (var l = [], d = [], u = Number.MAX_VALUE, c = -Number.MAX_VALUE, h = 0; h < e.length; h++) zm(e[h]) || (e[h].x < t ? (u = Math.min(u, e[h].x), l.push(e[h])) : (c = Math.max(c, e[h].x), d.push(e[h])));
                        for (Hm(d, t, i, n, 1, 0, o, 0, s, c), Hm(l, t, i, n, -1, 0, o, 0, s, u), h = 0; h < e.length; h++) {
                            var f = e[h];
                            if (!zm(f)) {
                                var g = f.linePoints;
                                if (g) {
                                    var p, v = "edge" === f.labelAlignTo, m = f.textRect.width;
                                    (p = v ? f.x < t ? g[2][0] - f.labelDistance - r - f.labelMargin : r + a - f.labelMargin - g[2][0] - f.labelDistance : f.x < t ? f.x - r - f.bleedMargin : r + a - f.x - f.bleedMargin) < f.textRect.width && (f.text = pn(f.text, p, f.font), "edge" === f.labelAlignTo && (m = un(f.text, f.font)));
                                    var y = g[1][0] - g[2][0];
                                    v ? f.x < t ? g[2][0] = r + f.labelMargin + m + f.labelDistance : g[2][0] = r + a - f.labelMargin - m - f.labelDistance : (f.x < t ? g[2][0] = f.x + f.labelDistance : g[2][0] = f.x - f.labelDistance, g[1][0] = g[2][0] + y), g[1][1] = g[2][1] = f.y
                                }
                            }
                        }
                    }(d, r, s, t, i, n, a, o)
                }(e, f, a.width, a.height, a.x, a.y)
            })
        }, "pie")), hf($m("pie")), ec.extend({
            type: "series.scatter",
            dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            brushSelector: "point",
            getProgressive: function () {
                var e = this.option.progressive;
                return null == e ? this.option.large ? 5e3 : this.get("progressive") : e
            },
            getProgressiveThreshold: function () {
                var e = this.option.progressiveThreshold;
                return null == e ? this.option.large ? 1e4 : this.get("progressiveThreshold") : e
            },
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                hoverAnimation: !0,
                symbolSize: 10,
                large: !1,
                largeThreshold: 2e3,
                itemStyle: {opacity: .8},
                clip: !0
            }
        });
        var Ym = Ss({
            shape: {points: null}, symbolProxy: null, softClipShape: null, buildPath: function (e, t) {
                var i = t.points, n = t.size, a = this.symbolProxy, o = a.shape;
                if (!((e.getContext ? e.getContext() : e) && n[0] < 4)) for (var r = 0; r < i.length;) {
                    var s = i[r++], l = i[r++];
                    isNaN(s) || isNaN(l) || this.softClipShape && !this.softClipShape.contain(s, l) || (o.x = s - n[0] / 2, o.y = l - n[1] / 2, o.width = n[0], o.height = n[1], a.buildPath(e, o, !0))
                }
            }, afterBrush: function (e) {
                var t = this.shape, i = t.points, n = t.size;
                if (n[0] < 4) {
                    this.setTransform(e);
                    for (var a = 0; a < i.length;) {
                        var o = i[a++], r = i[a++];
                        isNaN(o) || isNaN(r) || this.softClipShape && !this.softClipShape.contain(o, r) || e.fillRect(o - n[0] / 2, r - n[1] / 2, n[0], n[1])
                    }
                    this.restoreTransform(e)
                }
            }, findDataIndex: function (e, t) {
                for (var i = this.shape, n = i.points, a = i.size, o = Math.max(a[0], 4), r = Math.max(a[1], 4), s = n.length / 2 - 1; 0 <= s; s--) {
                    var l = 2 * s, d = n[l] - o / 2, u = n[1 + l] - r / 2;
                    if (d <= e && u <= t && e <= d + o && t <= u + r) return s
                }
                return -1
            }
        });

        function qm() {
            this.group = new Ai
        }

        var Jm = qm.prototype;

        function Zm(e, t, i) {
            Ap.call(this, e, t, i), this.type = "value", this.angle = 0, this.name = "", this.model
        }

        function Qm(e, t, i) {
            this._model = e, this.dimensions = [], this._indicatorAxes = A(e.getIndicatorModels(), function (e, t) {
                var i = "indicator_" + t, n = new Zm(i, "log" === e.get("axisType") ? new Xg : new kg);
                return n.name = e.get("name"), (n.model = e).axis = n, this.dimensions.push(i), n
            }, this), this.resize(e, i), this.cx, this.cy, this.r, this.r0, this.startAngle
        }

        Jm.isPersistent = function () {
            return !this._incremental
        }, Jm.updateData = function (e, t) {
            this.group.removeAll();
            var i = new Ym({rectHover: !0, cursor: "default"});
            i.setShape({points: e.getLayout("symbolPoints")}), this._setCommon(i, e, !1, t), this.group.add(i), this._incremental = null
        }, Jm.updateLayout = function (e) {
            if (!this._incremental) {
                var t = e.getLayout("symbolPoints");
                this.group.eachChild(function (e) {
                    if (null != e.startIndex) {
                        var i = 2 * (e.endIndex - e.startIndex), n = 4 * e.startIndex * 2;
                        t = new Float32Array(t.buffer, n, i)
                    }
                    e.setShape("points", t)
                })
            }
        }, Jm.incrementalPrepareUpdate = function (e) {
            this.group.removeAll(), this._clearIncremental(), 2e6 < e.count() ? (this._incremental || (this._incremental = new cs({silent: !0})), this.group.add(this._incremental)) : this._incremental = null
        }, Jm.incrementalUpdate = function (e, t, i) {
            var n;
            this._incremental ? (n = new Ym, this._incremental.addDisplayable(n, !0)) : ((n = new Ym({
                rectHover: !0,
                cursor: "default",
                startIndex: e.start,
                endIndex: e.end
            })).incremental = !0, this.group.add(n)), n.setShape({points: t.getLayout("symbolPoints")}), this._setCommon(n, t, !!this._incremental, i)
        }, Jm._setCommon = function (e, t, i, n) {
            var a = t.hostModel;
            n = n || {};
            var o = t.getVisual("symbolSize");
            e.setShape("size", o instanceof Array ? o : [o, o]), e.softClipShape = n.clipShape || null, e.symbolProxy = cp(t.getVisual("symbol"), 0, 0, 0, 0), e.setColor = e.symbolProxy.setColor;
            var r = e.shape.size[0] < 4;
            e.useStyle(a.getModel("itemStyle").getItemStyle(r ? ["color", "shadowBlur", "shadowColor"] : ["color"]));
            var s = t.getVisual("color");
            s && e.setColor(s), i || (e.seriesIndex = a.seriesIndex, e.on("mousemove", function (t) {
                e.dataIndex = null;
                var i = e.findDataIndex(t.offsetX, t.offsetY);
                0 <= i && (e.dataIndex = i + (e.startIndex || 0))
            }))
        }, Jm.remove = function () {
            this._clearIncremental(), this._incremental = null, this.group.removeAll()
        }, Jm._clearIncremental = function () {
            var e = this._incremental;
            e && e.clearDisplaybles()
        }, Cf({
            type: "scatter", render: function (e, t, i) {
                var n = e.getData();
                this._updateSymbolDraw(n, e).updateData(n, {clipShape: this._getClipShape(e)}), this._finished = !0
            }, incrementalPrepareRender: function (e, t, i) {
                var n = e.getData();
                this._updateSymbolDraw(n, e).incrementalPrepareUpdate(n), this._finished = !1
            }, incrementalRender: function (e, t, i) {
                this._symbolDraw.incrementalUpdate(e, t.getData(), {clipShape: this._getClipShape(t)}), this._finished = e.end === t.getData().count()
            }, updateTransform: function (e, t, i) {
                var n = e.getData();
                if (this.group.dirty(), !this._finished || 1e4 < n.count() || !this._symbolDraw.isPersistent()) return {update: !0};
                var a = yv().reset(e);
                a.progress && a.progress({start: 0, end: n.count()}, n), this._symbolDraw.updateLayout(n)
            }, _getClipShape: function (e) {
                var t = e.coordinateSystem, i = t && t.getArea && t.getArea();
                return e.get("clip", !0) ? i : null
            }, _updateSymbolDraw: function (e, t) {
                var i = this._symbolDraw, n = t.pipelineContext.large;
                return i && n === this._isLargeDraw || (i && i.remove(), i = this._symbolDraw = n ? new qm : new Hp, this._isLargeDraw = n, this.group.removeAll()), this.group.add(i.group), i
            }, remove: function (e, t) {
                this._symbolDraw && this._symbolDraw.remove(!0), this._symbolDraw = null
            }, dispose: function () {
            }
        }), vf(mv("scatter", "circle")), pf(yv("scatter")), I(Zm, Ap), Qm.prototype.getIndicatorAxes = function () {
            return this._indicatorAxes
        }, Qm.prototype.dataToPoint = function (e, t) {
            var i = this._indicatorAxes[t];
            return this.coordToPoint(i.dataToCoord(e), t)
        }, Qm.prototype.coordToPoint = function (e, t) {
            var i = this._indicatorAxes[t].angle;
            return [this.cx + e * Math.cos(i), this.cy - e * Math.sin(i)]
        }, Qm.prototype.pointToData = function (e) {
            var t = e[0] - this.cx, i = e[1] - this.cy, n = Math.sqrt(t * t + i * i);
            t /= n, i /= n;
            for (var a, o = Math.atan2(-i, t), r = 1 / 0, s = -1, l = 0; l < this._indicatorAxes.length; l++) {
                var d = this._indicatorAxes[l], u = Math.abs(o - d.angle);
                u < r && (a = d, s = l, r = u)
            }
            return [s, +(a && a.coordToData(n))]
        }, Qm.prototype.resize = function (e, t) {
            var i = e.get("center"), n = t.getWidth(), a = t.getHeight(), o = Math.min(n, a) / 2;
            this.cx = xl(i[0], n), this.cy = xl(i[1], a), this.startAngle = e.get("startAngle") * Math.PI / 180;
            var r = e.get("radius");
            "string" != typeof r && "number" != typeof r || (r = [0, r]), this.r0 = xl(r[0], o), this.r = xl(r[1], o), D(this._indicatorAxes, function (e, t) {
                e.setExtent(this.r0, this.r);
                var i = this.startAngle + t * Math.PI * 2 / this._indicatorAxes.length;
                i = Math.atan2(Math.sin(i), Math.cos(i)), e.angle = i
            }, this)
        }, Qm.prototype.update = function (e, t) {
            var i = this._indicatorAxes, n = this._model;
            D(i, function (e) {
                e.scale.setExtent(1 / 0, -1 / 0)
            }), e.eachSeriesByType("radar", function (t, a) {
                if ("radar" === t.get("coordinateSystem") && e.getComponent("radar", t.get("radarIndex")) === n) {
                    var o = t.getData();
                    D(i, function (e) {
                        e.scale.unionExtentFromData(o, o.mapDimension(e.dim))
                    })
                }
            }, this);
            var a = n.get("splitNumber");

            function o(e) {
                var t = Math.pow(10, Math.floor(Math.log(e) / Math.LN10)), i = e / t;
                return 2 === i ? i = 5 : i *= 2, i * t
            }

            D(i, function (e, t) {
                var i = Yg(e.scale, e.model).extent;
                qg(e.scale, e.model);
                var n = e.model, r = e.scale, s = n.getMin(), l = n.getMax(), d = r.getInterval();
                if (null != s && null != l) r.setExtent(+s, +l), r.setInterval((l - s) / a); else if (null != s) for (; c = s + d * a, r.setExtent(+s, c), r.setInterval(d), d = o(d), c < i[1] && isFinite(c) && isFinite(i[1]);) ; else if (null != l) for (; h = l - d * a, r.setExtent(h, +l), r.setInterval(d), d = o(d), h > i[0] && isFinite(h) && isFinite(i[0]);) ; else {
                    var u = r.getTicks().length - 1;
                    a < u && (d = o(d));
                    var c, h = El((c = Math.ceil(i[1] / d) * d) - d * a);
                    r.setExtent(h, c), r.setInterval(d)
                }
            })
        }, Qm.dimensions = [], Qm.create = function (e, t) {
            var i = [];
            return e.eachComponent("radar", function (n) {
                var a = new Qm(n, e, t);
                i.push(a), n.coordinateSystem = a
            }), e.eachSeriesByType("radar", function (e) {
                "radar" === e.get("coordinateSystem") && (e.coordinateSystem = i[e.get("radarIndex") || 0])
            }), i
        }, iu.register("radar", Qm);
        var ey = _v.valueAxis;

        function ty(e, t) {
            return T({show: t}, e)
        }

        kf({
            type: "radar",
            optionUpdated: function () {
                var e = this.get("boundaryGap"), t = this.get("splitNumber"), i = this.get("scale"),
                    n = this.get("axisLine"), a = this.get("axisTick"), o = this.get("axisType"),
                    r = this.get("axisLabel"), s = this.get("name"), l = this.get("name.show"),
                    d = this.get("name.formatter"), u = this.get("nameGap"), c = this.get("triggerEvent"),
                    h = A(this.get("indicator") || [], function (h) {
                        null != h.max && 0 < h.max && !h.min ? h.min = 0 : null != h.min && h.min < 0 && !h.max && (h.max = 0);
                        var f = s;
                        if (null != h.color && (f = T({color: h.color}, s)), h = m(v(h), {
                            boundaryGap: e,
                            splitNumber: t,
                            scale: i,
                            axisLine: n,
                            axisTick: a,
                            axisType: o,
                            axisLabel: r,
                            name: h.text,
                            nameLocation: "end",
                            nameGap: u,
                            nameTextStyle: f,
                            triggerEvent: c
                        }, !1), l || (h.name = ""), "string" == typeof d) {
                            var g = h.name;
                            h.name = d.replace("{value}", null != g ? g : "")
                        } else "function" == typeof d && (h.name = d(h.name, h));
                        var p = k(new Sl(h, null, this.ecModel), ip);
                        return p.mainType = "radar", p.componentIndex = this.componentIndex, p
                    }, this);
                this.getIndicatorModels = function () {
                    return h
                }
            },
            defaultOption: {
                zlevel: 0,
                z: 0,
                center: ["50%", "50%"],
                radius: "75%",
                startAngle: 90,
                name: {show: !0},
                boundaryGap: [0, 0],
                splitNumber: 5,
                nameGap: 15,
                scale: !1,
                shape: "polygon",
                axisLine: m({lineStyle: {color: "#bbb"}}, ey.axisLine),
                axisLabel: ty(ey.axisLabel, !1),
                axisTick: ty(ey.axisTick, !1),
                axisType: "interval",
                splitLine: ty(ey.splitLine, !0),
                splitArea: ty(ey.splitArea, !0),
                indicator: []
            }
        });
        var iy = ["axisLine", "axisTickLabel", "axisName"];
        Tf({
            type: "radar", render: function (e, t, i) {
                this.group.removeAll(), this._buildAxes(e), this._buildSplitLineAndArea(e)
            }, _buildAxes: function (e) {
                var t = e.coordinateSystem;
                D(A(t.getIndicatorAxes(), function (e) {
                    return new Kv(e.model, {
                        position: [t.cx, t.cy],
                        rotation: e.angle,
                        labelDirection: -1,
                        tickDirection: -1,
                        nameDirection: 1
                    })
                }), function (e) {
                    D(iy, e.add, e), this.group.add(e.getGroup())
                }, this)
            }, _buildSplitLineAndArea: function (e) {
                var t = e.coordinateSystem, i = t.getIndicatorAxes();
                if (i.length) {
                    var n = e.get("shape"), a = e.getModel("splitLine"), o = e.getModel("splitArea"),
                        r = a.getModel("lineStyle"), s = o.getModel("areaStyle"), l = a.get("show"), d = o.get("show"),
                        u = r.get("color"), c = s.get("color");
                    u = M(u) ? u : [u], c = M(c) ? c : [c];
                    var h = [], f = [];
                    if ("circle" === n) for (var g = i[0].getTicksCoords(), p = t.cx, v = t.cy, m = 0; m < g.length; m++) l && h[_(h, u, m)].push(new Vr({
                        shape: {
                            cx: p,
                            cy: v,
                            r: g[m].coord
                        }
                    })), d && m < g.length - 1 && f[_(f, c, m)].push(new Hr({
                        shape: {
                            cx: p,
                            cy: v,
                            r0: g[m].coord,
                            r: g[m + 1].coord
                        }
                    })); else {
                        var y, k = A(i, function (e, i) {
                            var n = e.getTicksCoords();
                            return y = null == y ? n.length - 1 : Math.min(n.length - 1, y), A(n, function (e) {
                                return t.coordToPoint(e.coord, i)
                            })
                        }), w = [];
                        for (m = 0; m <= y; m++) {
                            for (var C = [], S = 0; S < i.length; S++) C.push(k[S][m]);
                            C[0] && C.push(C[0].slice()), l && h[_(h, u, m)].push(new $r({shape: {points: C}})), d && w && f[_(f, c, m - 1)].push(new Xr({shape: {points: C.concat(w)}})), w = C.slice().reverse()
                        }
                    }
                    var I = r.getLineStyle(), b = s.getAreaStyle();
                    D(f, function (e, t) {
                        this.group.add(Ns(e, {style: T({stroke: "none", fill: c[t % c.length]}, b), silent: !0}))
                    }, this), D(h, function (e, t) {
                        this.group.add(Ns(e, {style: T({fill: "none", stroke: u[t % u.length]}, I), silent: !0}))
                    }, this)
                }

                function _(e, t, i) {
                    var n = i % t.length;
                    return e[n] = e[n] || [], n
                }
            }
        });
        var ny = ec.extend({
            type: "series.radar",
            dependencies: ["radar"],
            init: function (e) {
                ny.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this))
            },
            getInitialData: function (e, t) {
                return Om(this, {generateCoord: "indicator_", generateCoordCount: 1 / 0})
            },
            formatTooltip: function (e) {
                var t = this.getData(), i = this.coordinateSystem.getIndicatorAxes(), n = this.getData().getName(e);
                return Ql("" === n ? this.name : n) + "<br/>" + A(i, function (i, n) {
                    var a = t.get(t.mapDimension(i.dim), e);
                    return Ql(i.name + " : " + a)
                }).join("<br />")
            },
            getTooltipPosition: function (e) {
                if (null != e) for (var t = this.getData(), i = this.coordinateSystem, n = t.getValues(A(i.dimensions, function (e) {
                    return t.mapDimension(e)
                }), e, !0), a = 0, o = n.length; a < o; a++) if (!isNaN(n[a])) {
                    var r = i.getIndicatorAxes();
                    return i.coordToPoint(r[a].dataToCoord(n[a]), a)
                }
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "radar",
                legendHoverLink: !0,
                radarIndex: 0,
                lineStyle: {width: 2, type: "solid"},
                label: {position: "top"},
                symbol: "emptyCircle",
                symbolSize: 4
            }
        });

        function ay(e) {
            return !isNaN(e[0]) && !isNaN(e[1])
        }

        function oy(e) {
            return [e.cx, e.cy]
        }

        Cf({
            type: "radar", render: function (e, t, i) {
                var n = e.coordinateSystem, a = this.group, o = e.getData(), r = this._data;

                function s(e, t) {
                    var i = e.getItemVisual(t, "symbol") || "circle", n = e.getItemVisual(t, "color");
                    if ("none" !== i) {
                        var a = function (e) {
                            return M(e) || (e = [+e, +e]), e
                        }(e.getItemVisual(t, "symbolSize")), o = cp(i, -1, -1, 2, 2, n);
                        return o.attr({style: {strokeNoScale: !0}, z2: 100, scale: [a[0] / 2, a[1] / 2]}), o
                    }
                }

                function l(t, i, n, a, o, r) {
                    n.removeAll();
                    for (var l = 0; l < i.length - 1; l++) {
                        var d = s(a, o);
                        d && (t[d.__dimIdx = l] ? (d.attr("position", t[l]), vl[r ? "initProps" : "updateProps"](d, {position: i[l]}, e, o)) : d.attr("position", i[l]), n.add(d))
                    }
                }

                function d(e) {
                    return A(e, function (e) {
                        return [n.cx, n.cy]
                    })
                }

                o.diff(r).add(function (t) {
                    var i = o.getItemLayout(t);
                    if (i) {
                        var n = new Xr, a = new $r, r = {shape: {points: i}};
                        n.shape.points = d(i), a.shape.points = d(i), rl(n, r, e, t), rl(a, r, e, t);
                        var s = new Ai, u = new Ai;
                        s.add(a), s.add(n), s.add(u), l(a.shape.points, i, u, o, t, !0), o.setItemGraphicEl(t, s)
                    }
                }).update(function (t, i) {
                    var n = r.getItemGraphicEl(i), a = n.childAt(0), s = n.childAt(1), d = n.childAt(2),
                        u = {shape: {points: o.getItemLayout(t)}};
                    u.shape.points && (l(a.shape.points, u.shape.points, d, o, t, !1), ol(a, u, e), ol(s, u, e), o.setItemGraphicEl(t, n))
                }).remove(function (e) {
                    a.remove(r.getItemGraphicEl(e))
                }).execute(), o.eachItemGraphicEl(function (e, t) {
                    var i = o.getItemModel(t), n = e.childAt(0), r = e.childAt(1), s = e.childAt(2),
                        l = o.getItemVisual(t, "color");
                    a.add(e), n.useStyle(T(i.getModel("lineStyle").getLineStyle(), {
                        fill: "none",
                        stroke: l
                    })), n.hoverStyle = i.getModel("emphasis.lineStyle").getLineStyle();
                    var d = i.getModel("areaStyle"), u = i.getModel("emphasis.areaStyle"),
                        c = d.isEmpty() && d.parentModel.isEmpty(), h = u.isEmpty() && u.parentModel.isEmpty();
                    h = h && c, r.ignore = c, r.useStyle(T(d.getAreaStyle(), {
                        fill: l,
                        opacity: .7
                    })), r.hoverStyle = u.getAreaStyle();
                    var f = i.getModel("itemStyle").getItemStyle(["color"]),
                        g = i.getModel("emphasis.itemStyle").getItemStyle(), p = i.getModel("label"),
                        m = i.getModel("emphasis.label");
                    s.eachChild(function (e) {
                        e.setStyle(f), e.hoverStyle = v(g);
                        var i = o.get(o.dimensions[e.__dimIdx], t);
                        null != i && !isNaN(i) || (i = ""), Ys(e.style, e.hoverStyle, p, m, {
                            labelFetcher: o.hostModel,
                            labelDataIndex: t,
                            labelDimIndex: e.__dimIdx,
                            defaultText: i,
                            autoColor: l,
                            isRectText: !0
                        })
                    }), e.highDownOnUpdate = function (e, t) {
                        r.attr("ignore", "emphasis" === t ? h : c)
                    }, zs(e)
                }), this._data = o
            }, remove: function () {
                this.group.removeAll(), this._data = null
            }, dispose: function () {
            }
        }), vf(Wm("radar")), vf(mv("radar", "circle")), pf(function (e) {
            e.eachSeriesByType("radar", function (e) {
                var t = e.getData(), i = [], n = e.coordinateSystem;
                if (n) {
                    var a = n.getIndicatorAxes();
                    D(a, function (e, o) {
                        t.each(t.mapDimension(a[o].dim), function (e, t) {
                            i[t] = i[t] || [];
                            var a = n.dataToPoint(e, o);
                            i[t][o] = ay(a) ? a : oy(n)
                        })
                    }), t.each(function (e) {
                        var a = E(i[e], function (e) {
                            return ay(e)
                        }) || oy(n);
                        i[e].push(a.slice()), t.setItemLayout(e, i[e])
                    })
                }
            })
        }), hf($m("radar")), cf(function (e) {
            var t = e.polar;
            if (t) {
                M(t) || (t = [t]);
                var i = [];
                D(t, function (t, n) {
                    t.indicator ? (t.type && !t.shape && (t.shape = t.type), e.radar = e.radar || [], M(e.radar) || (e.radar = [e.radar]), e.radar.push(t)) : i.push(t)
                }), e.polar = i
            }
            D(e.series, function (e) {
                e && "radar" === e.type && e.polarIndex && (e.radarIndex = e.polarIndex)
            })
        });
        for (var ry = [126, 25], sy = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, .7], [52, .7], [56, 7.7], [59, .7], [64, .7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]], ly = 0; ly < sy.length; ly++) for (var dy = 0; dy < sy[ly].length; dy++) sy[ly][dy][0] /= 10.5, sy[ly][dy][1] /= -14, sy[ly][dy][0] += ry[0], sy[ly][dy][1] += ry[1];
        var uy = {"南海诸岛": [32, 80], "广东": [0, -10], "香港": [10, 5], "澳门": [-10, 10], "天津": [5, 5]},
            cy = {Russia: [100, 60], "United States": [-99, 38], "United States of America": [-99, 38]}, hy = Va(),
            fy = {
                load: function (e, t, i) {
                    var n = hy(t).parsed;
                    if (n) return n;
                    var a, o = t.specialAreas || {}, r = t.geoJSON;
                    try {
                        a = r ? kp(r, i) : []
                    } catch (t) {
                        throw new Error("Invalid geoJson format\n" + t.message)
                    }
                    return D(a, function (t) {
                        var i = t.name;
                        !function (e, t) {
                            if ("china" === e) {
                                var i = uy[t.name];
                                if (i) {
                                    var n = t.center;
                                    n[0] += i[0] / 10.5, n[1] += -i[1] / 14
                                }
                            }
                        }(e, t), function (e, t) {
                            if ("world" === e) {
                                var i = cy[t.name];
                                if (i) {
                                    var n = t.center;
                                    n[0] = i[0], n[1] = i[1]
                                }
                            }
                        }(e, t);
                        var n = o[i];
                        n && t.transformTo(n.left, n.top, n.width, n.height)
                    }), hy(t).parsed = {
                        regions: a, boundingRect: function (e) {
                            for (var t, i = 0; i < e.length; i++) {
                                var n = e[i].getBoundingRect();
                                (t = t || n.clone()).union(n)
                            }
                            return t
                        }(a)
                    }
                }
            }, gy = Va();

        function py(e, t) {
            var i, n, a = e.svgXML;
            try {
                X(null != (n = (i = a && function (e, t) {
                    return (new nh).parse(e, {ignoreViewBox: !0, ignoreRootClip: !0})
                }(a) || {}).root))
            } catch (e) {
                throw new Error("Invalid svg format\n" + e.message)
            }
            var o = i.width, r = i.height, s = i.viewBoxRect;
            if (t || (t = null == o || null == r ? n.getBoundingRect() : new Di(0, 0, 0, 0), null != o && (t.width = o), null != r && (t.height = r)), s) {
                var l = gh(s, t.width, t.height), d = n;
                (n = new Ai).add(d), d.scale = l.scale, d.position = l.position
            }
            return n.setClipPath(new es({shape: t.plain()})), {root: n, boundingRect: t}
        }

        var vy = {
            geoJSON: fy, svg: {
                load: function (e, t) {
                    var i = gy(t).originRoot;
                    if (i) return {root: i, boundingRect: gy(t).boundingRect};
                    var n = py(t);
                    return gy(t).originRoot = n.root, gy(t).boundingRect = n.boundingRect, n
                }, makeGraphic: function (e, t, i) {
                    var n = gy(t), a = n.rootMap || (n.rootMap = Q()), o = a.get(i);
                    if (o) return o;
                    var r = n.originRoot, s = n.boundingRect;
                    return o = n.originRootHostKey ? py(t, s).root : (n.originRootHostKey = i, r), a.set(i, o)
                }, removeGraphic: function (e, t, i) {
                    var n = gy(t), a = n.rootMap;
                    a && a.removeKey(i), i === n.originRootHostKey && (n.originRootHostKey = null)
                }
            }
        }, my = {
            load: function (e, t, i) {
                var n, a = [], o = Q(), r = Q();
                return D(ky(e), function (s) {
                    var l = vy[s.type].load(e, s, i);
                    D(l.regions, function (e) {
                        var i = e.name;
                        t && t.hasOwnProperty(i) && (e = e.cloneShallow(i = t[i])), a.push(e), o.set(i, e), r.set(i, e.center)
                    });
                    var d = l.boundingRect;
                    d && (n ? n.union(d) : n = d.clone())
                }), {regions: a, regionsMap: o, nameCoordMap: r, boundingRect: n || new Di(0, 0, 0, 0)}
            }, makeGraphic: yy("makeGraphic"), removeGraphic: yy("removeGraphic")
        };

        function yy(e) {
            return function (t, i) {
                var n = ky(t), a = [];
                return D(n, function (n) {
                    var o = vy[n.type][e];
                    o && a.push(o(t, n, i))
                }), a
            }
        }

        function ky(e) {
            return vh.retrieveMap(e) || []
        }

        b(ec.extend({
            type: "series.map",
            dependencies: ["geo"],
            layoutMode: "box",
            needsDrawMap: !1,
            seriesGroup: [],
            getInitialData: function (e) {
                for (var t = Om(this, {
                    coordDimensions: ["value"],
                    encodeDefaulter: O(jd, this)
                }), i = t.mapDimension("value"), n = Q(), a = [], o = [], r = 0, s = t.count(); r < s; r++) {
                    var l = t.getName(r);
                    n.set(l, !0), a.push({name: l, value: t.get(i, r), selected: Ru(t, r, "selected")})
                }
                return D(my.load(this.getMapType(), this.option.nameMap, this.option.nameProperty).regions, function (e) {
                    var t = e.name;
                    n.get(t) || (a.push({name: t}), o.push(t))
                }), this.updateSelectedMap(a), t.appendValues([], o), t
            },
            getHostGeoModel: function () {
                var e = this.option.geoIndex;
                return null != e ? this.dependentModels.geo[e] : null
            },
            getMapType: function () {
                return (this.getHostGeoModel() || this).option.map
            },
            getRawValue: function (e) {
                var t = this.getData();
                return t.get(t.mapDimension("value"), e)
            },
            getRegionModel: function (e) {
                var t = this.getData();
                return t.getItemModel(t.indexOfName(e))
            },
            formatTooltip: function (e) {
                for (var t = this.getData(), i = $l(this.getRawValue(e)), n = t.getName(e), a = this.seriesGroup, o = [], r = 0; r < a.length; r++) {
                    var s = a[r].originalData.indexOfName(n), l = t.mapDimension("value");
                    isNaN(a[r].originalData.get(l, s)) || o.push(Ql(a[r].name))
                }
                return o.join(", ") + "<br />" + Ql(n + " : " + i)
            },
            getTooltipPosition: function (e) {
                if (null != e) {
                    var t = this.getData().getName(e), i = this.coordinateSystem, n = i.getRegion(t);
                    return n && i.dataToPoint(n.center)
                }
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "geo",
                map: "",
                left: "center",
                top: "center",
                aspectScale: .75,
                showLegendSymbol: !0,
                dataRangeHoverLink: !0,
                boundingCoords: null,
                center: null,
                zoom: 1,
                scaleLimit: null,
                label: {show: !1, color: "#000"},
                itemStyle: {borderWidth: .5, borderColor: "#444", areaColor: "#eee"},
                emphasis: {label: {show: !0, color: "rgb(100,0,0)"}, itemStyle: {areaColor: "rgba(255,215,0,0.8)"}},
                nameProperty: "name"
            }
        }), Mm);
        var Ty = "\0_ec_interaction_mutex";

        function wy(e, t) {
            return !!Cy(e)[t]
        }

        function Cy(e) {
            return e[Ty] || (e[Ty] = {})
        }

        function Sy(e) {
            this.pointerChecker, this._zr = e, this._opt = {};
            var t = P, i = t(Iy, this), n = t(by, this), a = t(_y, this), o = t(Dy, this), r = t(Ay, this);
            Ne.call(this), this.setPointerChecker = function (e) {
                this.pointerChecker = e
            }, this.enable = function (t, s) {
                this.disable(), this._opt = T(v(s) || {}, {
                    zoomOnMouseWheel: !0,
                    moveOnMouseMove: !0,
                    moveOnMouseWheel: !1,
                    preventDefaultMouseMove: !0
                }), null == t && (t = !0), !0 !== t && "move" !== t && "pan" !== t || (e.on("mousedown", i), e.on("mousemove", n), e.on("mouseup", a)), !0 !== t && "scale" !== t && "zoom" !== t || (e.on("mousewheel", o), e.on("pinch", r))
            }, this.disable = function () {
                e.off("mousedown", i), e.off("mousemove", n), e.off("mouseup", a), e.off("mousewheel", o), e.off("pinch", r)
            }, this.dispose = this.disable, this.isDragging = function () {
                return this._dragging
            }, this.isPinching = function () {
                return this._pinching
            }
        }

        function Iy(e) {
            if (!(Xe(e) || e.target && e.target.draggable)) {
                var t = e.offsetX, i = e.offsetY;
                this.pointerChecker && this.pointerChecker(e, t, i) && (this._x = t, this._y = i, this._dragging = !0)
            }
        }

        function by(e) {
            if (this._dragging && Ey("moveOnMouseMove", e, this._opt) && "pinch" !== e.gestureEvent && !wy(this._zr, "globalPan")) {
                var t = e.offsetX, i = e.offsetY, n = this._x, a = this._y, o = t - n, r = i - a;
                this._x = t, this._y = i, this._opt.preventDefaultMouseMove && je(e.event), xy(this, "pan", "moveOnMouseMove", e, {
                    dx: o,
                    dy: r,
                    oldX: n,
                    oldY: a,
                    newX: t,
                    newY: i
                })
            }
        }

        function _y(e) {
            Xe(e) || (this._dragging = !1)
        }

        function Dy(e) {
            var t = Ey("zoomOnMouseWheel", e, this._opt), i = Ey("moveOnMouseWheel", e, this._opt), n = e.wheelDelta,
                a = Math.abs(n), o = e.offsetX, r = e.offsetY;
            if (0 !== n && (t || i)) {
                if (t) {
                    var s = 3 < a ? 1.4 : 1 < a ? 1.2 : 1.1;
                    Ny(this, "zoom", "zoomOnMouseWheel", e, {scale: 0 < n ? s : 1 / s, originX: o, originY: r})
                }
                if (i) {
                    var l = Math.abs(n);
                    Ny(this, "scrollMove", "moveOnMouseWheel", e, {
                        scrollDelta: (0 < n ? 1 : -1) * (3 < l ? .4 : 1 < l ? .15 : .05),
                        originX: o,
                        originY: r
                    })
                }
            }
        }

        function Ay(e) {
            wy(this._zr, "globalPan") || Ny(this, "zoom", null, e, {
                scale: 1 < e.pinchScale ? 1.1 : 1 / 1.1,
                originX: e.pinchX,
                originY: e.pinchY
            })
        }

        function Ny(e, t, i, n, a) {
            e.pointerChecker && e.pointerChecker(n, a.originX, a.originY) && (je(n.event), xy(e, t, i, n, a))
        }

        function xy(e, t, i, n, a) {
            a.isAvailableBehavior = P(Ey, null, i, n), e.trigger(t, a)
        }

        function Ey(e, t, i) {
            var n = i[e];
            return !e || n && (!L(n) || t.event[n + "Key"])
        }

        function Py(e, t, i) {
            var n = e.target, a = n.position;
            a[0] += t, a[1] += i, n.dirty()
        }

        function Oy(e, t, i, n) {
            var a = e.target, o = e.zoomLimit, r = a.position, s = a.scale, l = e.zoom = e.zoom || 1;
            if (l *= t, o) {
                var d = o.min || 0, u = o.max || 1 / 0;
                l = Math.max(Math.min(u, l), d)
            }
            var c = l / e.zoom;
            e.zoom = l, r[0] -= (i - r[0]) * (c - 1), r[1] -= (n - r[1]) * (c - 1), s[0] *= c, s[1] *= c, a.dirty()
        }

        ff({type: "takeGlobalCursor", event: "globalCursorTaken", update: "update"}, function () {
        }), b(Sy, Ne);
        var My = {axisPointer: 1, tooltip: 1, brush: 1};

        function Fy(e, t, i) {
            var n = t.getComponentByElement(e.topTarget), a = n && n.coordinateSystem;
            return n && n !== i && !My[n.mainType] && a && a.model !== i
        }

        function Ly(e) {
            var t = e.getItemStyle(), i = e.get("areaColor");
            return null != i && (t.fill = i), t
        }

        function Ry(e, t) {
            t.eachChild(function (t) {
                D(t.__regions, function (i) {
                    t.trigger(e.isSelected(i.name) ? "emphasis" : "normal")
                })
            })
        }

        function By(e, t) {
            var i = new Ai;
            this.uid = Dl("ec_map_draw"), this._controller = new Sy(e.getZr()), this._controllerHost = {target: t ? i : null}, this.group = i, this._updateGroup = t, this._mouseDownFlag, this._mapName, this._initialized, i.add(this._regionsGroup = new Ai), i.add(this._backgroundGroup = new Ai)
        }

        By.prototype = {
            constructor: By, draw: function (e, t, i, n, a) {
                var o = "geo" === e.mainType, r = e.getData && e.getData();
                o && t.eachComponent({mainType: "series", subType: "map"}, function (t) {
                    r || t.getHostGeoModel() !== e || (r = t.getData())
                });
                var s = e.coordinateSystem;
                this._updateBackground(s);
                var l, d = this._regionsGroup, u = this.group, c = s.getTransformInfo(), h = !d.childAt(0) || a;
                if (h) u.transform = c.roamTransform, u.decomposeTransform(), u.dirty(); else {
                    var f = new mt;
                    f.transform = c.roamTransform, f.decomposeTransform();
                    var g = {scale: f.scale, position: f.position};
                    l = f.scale, ol(u, g, e)
                }
                var p = c.rawScale, v = c.rawPosition;
                d.removeAll();
                var m = ["itemStyle"], y = ["emphasis", "itemStyle"], k = ["label"], T = ["emphasis", "label"], w = Q();
                D(s.regions, function (t) {
                    var i = w.get(t.name) || w.set(t.name, new Ai),
                        n = new ls({segmentIgnoreThreshold: 1, shape: {paths: []}});
                    i.add(n);
                    var a, s = (M = e.getRegionModel(t.name) || e).getModel(m), c = M.getModel(y), f = Ly(s), g = Ly(c),
                        C = M.getModel(k), S = M.getModel(T);
                    if (r) {
                        a = r.indexOfName(t.name);
                        var I = r.getItemVisual(a, "color", !0);
                        I && (f.fill = I)
                    }

                    function b(e) {
                        return [e[0] * p[0] + v[0], e[1] * p[1] + v[1]]
                    }

                    D(t.geometries, function (e) {
                        if ("polygon" === e.type) {
                            for (var t = [], i = 0; i < e.exterior.length; ++i) t.push(b(e.exterior[i]));
                            for (n.shape.paths.push(new Xr({
                                segmentIgnoreThreshold: 1,
                                shape: {points: t}
                            })), i = 0; i < (e.interiors ? e.interiors.length : 0); ++i) {
                                for (var a = e.interiors[i], o = (t = [], 0); o < a.length; ++o) t.push(b(a[o]));
                                n.shape.paths.push(new Xr({segmentIgnoreThreshold: 1, shape: {points: t}}))
                            }
                        }
                    }), n.setStyle(f), n.style.strokeNoScale = !0, n.culling = !0;
                    var _ = C.get("show"), A = S.get("show"), N = r && isNaN(r.get(r.mapDimension("value"), a)),
                        x = r && r.getItemLayout(a);
                    if (o || N && (_ || A) || x && x.showLabel) {
                        var E, P = o ? t.name : a;
                        (!r || 0 <= a) && (E = e);
                        var O = new Ur({
                            position: b(t.center.slice()),
                            scale: [1 / u.scale[0], 1 / u.scale[1]],
                            z2: 10,
                            silent: !0
                        });
                        Ys(O.style, O.hoverStyle = {}, C, S, {
                            labelFetcher: E,
                            labelDataIndex: P,
                            defaultText: t.name,
                            useInsideStyle: !1
                        }, {
                            textAlign: "center",
                            textVerticalAlign: "middle"
                        }), h || ol(O, {scale: [1 / l[0], 1 / l[1]]}, e), i.add(O)
                    }
                    if (r) r.setItemGraphicEl(a, i); else {
                        var M = e.getRegionModel(t.name);
                        n.eventData = {
                            componentType: "geo",
                            componentIndex: e.componentIndex,
                            geoIndex: e.componentIndex,
                            name: t.name,
                            region: M && M.option || {}
                        }
                    }
                    (i.__regions || (i.__regions = [])).push(t), i.highDownSilentOnTouch = !!e.get("selectedMode"), zs(i, g), d.add(i)
                }), this._updateController(e, t, i), function (e, t, i, n, a) {
                    i.off("click"), i.off("mousedown"), t.get("selectedMode") && (i.on("mousedown", function () {
                        e._mouseDownFlag = !0
                    }), i.on("click", function (o) {
                        if (e._mouseDownFlag) {
                            e._mouseDownFlag = !1;
                            for (var r = o.target; !r.__regions;) r = r.parent;
                            if (r) {
                                var s = {
                                    type: ("geo" === t.mainType ? "geo" : "map") + "ToggleSelect",
                                    batch: A(r.__regions, function (e) {
                                        return {name: e.name, from: a.uid}
                                    })
                                };
                                s[t.mainType + "Id"] = t.id, n.dispatchAction(s), Ry(t, i)
                            }
                        }
                    }))
                }(this, e, d, i, n), Ry(e, d)
            }, remove: function () {
                this._regionsGroup.removeAll(), this._backgroundGroup.removeAll(), this._controller.dispose(), this._mapName && my.removeGraphic(this._mapName, this.uid), this._mapName = null, this._controllerHost = {}
            }, _updateBackground: function (e) {
                var t = e.map;
                this._mapName !== t && D(my.makeGraphic(t, this.uid), function (e) {
                    this._backgroundGroup.add(e)
                }, this), this._mapName = t
            }, _updateController: function (e, t, i) {
                var n = e.coordinateSystem, a = this._controller, o = this._controllerHost;
                o.zoomLimit = e.get("scaleLimit"), o.zoom = n.getZoom(), a.enable(e.get("roam") || !1);
                var r = e.mainType;

                function s() {
                    var t = {type: "geoRoam", componentType: r};
                    return t[r + "Id"] = e.id, t
                }

                a.off("pan").on("pan", function (e) {
                    this._mouseDownFlag = !1, Py(o, e.dx, e.dy), i.dispatchAction(k(s(), {dx: e.dx, dy: e.dy}))
                }, this), a.off("zoom").on("zoom", function (e) {
                    if (this._mouseDownFlag = !1, Oy(o, e.scale, e.originX, e.originY), i.dispatchAction(k(s(), {
                        zoom: e.scale,
                        originX: e.originX,
                        originY: e.originY
                    })), this._updateGroup) {
                        var t = this.group.scale;
                        this._regionsGroup.traverse(function (e) {
                            "text" === e.type && e.attr("scale", [1 / t[0], 1 / t[1]])
                        })
                    }
                }, this), a.setPointerChecker(function (t, a, o) {
                    return n.getViewRectAfterRoam().contain(a, o) && !Fy(t, i, e)
                })
            }
        };
        var Uy = "__seriesMapHighDown", Ky = "__seriesMapCallKey";

        function Vy(e) {
            var t = this[Uy];
            t && t.recordVersion === this[Ky] && Wy(t, e)
        }

        function Wy(e, t) {
            var i = e.circle, n = e.labelModel, a = e.hoverLabelModel, o = e.emphasisText, r = e.normalText;
            t ? (i.style.extendFrom(Js({}, a, {text: a.get("show") ? o : null}, {
                isRectText: !0,
                useInsideStyle: !1
            }, !0)), i.__mapOriginalZ2 = i.z2, i.z2 += vs) : (Js(i.style, n, {
                text: n.get("show") ? r : null,
                textPosition: n.getShallow("position") || "bottom"
            }, {
                isRectText: !0,
                useInsideStyle: !1
            }), i.dirty(!1), null != i.__mapOriginalZ2 && (i.z2 = i.__mapOriginalZ2, i.__mapOriginalZ2 = null))
        }

        function Gy(e, t, i) {
            var n = e.getZoom(), a = e.getCenter(), o = t.zoom, r = e.dataToPoint(a);
            if (null != t.dx && null != t.dy && (r[0] -= t.dx, r[1] -= t.dy, a = e.pointToData(r), e.setCenter(a)), null != o) {
                if (i) {
                    var s = i.min || 0, l = i.max || 1 / 0;
                    o = Math.max(Math.min(n * o, l), s) / n
                }
                e.scale[0] *= o, e.scale[1] *= o;
                var d = e.position, u = (t.originX - d[0]) * (o - 1), c = (t.originY - d[1]) * (o - 1);
                d[0] -= u, d[1] -= c, e.updateTransform(), a = e.pointToData(r), e.setCenter(a), e.setZoom(o * n)
            }
            return {center: e.getCenter(), zoom: e.getZoom()}
        }

        Cf({
            type: "map", render: function (e, t, i, n) {
                if (!n || "mapToggleSelect" !== n.type || n.from !== this.uid) {
                    var a = this.group;
                    if (a.removeAll(), !e.getHostGeoModel()) {
                        if (n && "geoRoam" === n.type && "series" === n.componentType && n.seriesId === e.id) (o = this._mapDraw) && a.add(o.group); else if (e.needsDrawMap) {
                            var o = this._mapDraw || new By(i, !0);
                            a.add(o.group), o.draw(e, t, i, this, n), this._mapDraw = o
                        } else this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
                        e.get("showLegendSymbol") && t.getComponent("legend") && this._renderSymbols(e, t, i)
                    }
                }
            }, remove: function () {
                this._mapDraw && this._mapDraw.remove(), this._mapDraw = null, this.group.removeAll()
            }, dispose: function () {
                this._mapDraw && this._mapDraw.remove(), this._mapDraw = null
            }, _renderSymbols: function (e, t, i) {
                var n = e.originalData, a = this.group;
                n.each(n.mapDimension("value"), function (t, i) {
                    if (!isNaN(t)) {
                        var o = n.getItemLayout(i);
                        if (o && o.point) {
                            var r = o.point, s = o.offset, l = new Vr({
                                style: {fill: e.getData().getVisual("color")},
                                shape: {cx: r[0] + 9 * s, cy: r[1], r: 3},
                                silent: !0,
                                z2: 8 + (s ? 0 : vs + 1)
                            });
                            if (!s) {
                                var d = e.mainSeries.getData(), u = n.getName(i), c = d.indexOfName(u),
                                    h = n.getItemModel(i), f = h.getModel("label"), g = h.getModel("emphasis.label"),
                                    p = d.getItemGraphicEl(c), v = G(e.getFormattedLabel(c, "normal"), u),
                                    m = G(e.getFormattedLabel(c, "emphasis"), v), y = p[Uy], T = Math.random();
                                if (!y) {
                                    y = p[Uy] = {};
                                    var w = O(Vy, !0), C = O(Vy, !1);
                                    p.on("mouseover", w).on("mouseout", C).on("emphasis", w).on("normal", C)
                                }
                                k(y, {
                                    recordVersion: p[Ky] = T,
                                    circle: l,
                                    labelModel: f,
                                    hoverLabelModel: g,
                                    emphasisText: m,
                                    normalText: v
                                }), Wy(y, !1)
                            }
                            a.add(l)
                        }
                    }
                })
            }
        }), ff({type: "geoRoam", event: "geoRoam", update: "updateTransform"}, function (e, t) {
            var i = e.componentType || "series";
            t.eachComponent({mainType: i, query: e}, function (t) {
                var n = t.coordinateSystem;
                if ("geo" === n.type) {
                    var a = Gy(n, e, t.get("scaleLimit"));
                    t.setCenter && t.setCenter(a.center), t.setZoom && t.setZoom(a.zoom), "series" === i && D(t.seriesGroup, function (e) {
                        e.setCenter(a.center), e.setZoom(a.zoom)
                    })
                }
            })
        });
        var Hy = Ce;

        function zy() {
            mt.call(this)
        }

        function jy(e) {
            this.name = e, this.zoomLimit, mt.call(this), this._roamTransformable = new zy, this._rawTransformable = new zy, this._center, this._zoom
        }

        function Xy(e, t, i, n) {
            var a = i.seriesModel, o = a ? a.coordinateSystem : null;
            return o === this ? o[e](n) : null
        }

        function $y(e, t, i, n) {
            jy.call(this, e), this.map = t;
            var a = my.load(t, i);
            this._nameCoordMap = a.nameCoordMap, this._regionsMap = a.regionsMap, this._invertLongitute = null == n || n, this.regions = a.regions, this._rect = a.boundingRect
        }

        function Yy(e, t, i, n) {
            var a = i.geoModel, o = i.seriesModel,
                r = a ? a.coordinateSystem : o ? o.coordinateSystem || (o.getReferringComponents("geo")[0] || {}).coordinateSystem : null;
            return r === this ? r[e](n) : null
        }

        function qy(e, t) {
            var i = e.get("boundingCoords");
            if (null != i) {
                var n = i[0], a = i[1];
                isNaN(n[0]) || isNaN(n[1]) || isNaN(a[0]) || isNaN(a[1]) || this.setBoundingRect(n[0], n[1], a[0] - n[0], a[1] - n[1])
            }
            var o, r = this.getBoundingRect(), s = e.get("layoutCenter"), l = e.get("layoutSize"), d = t.getWidth(),
                u = t.getHeight(), c = r.width / r.height * this.aspectScale, h = !1;
            if (s && l && (s = [xl(s[0], d), xl(s[1], u)], l = xl(l, Math.min(d, u)), isNaN(s[0]) || isNaN(s[1]) || isNaN(l) || (h = !0)), h) {
                var f = {};
                1 < c ? (f.width = l, f.height = l / c) : (f.height = l, f.width = l * c), f.y = s[1] - f.height / 2, f.x = s[0] - f.width / 2
            } else (o = e.getBoxLayoutParams()).aspect = c, f = vd(o, {width: d, height: u});
            this.setViewRect(f.x, f.y, f.width, f.height), this.setCenter(e.get("center")), this.setZoom(e.get("zoom"))
        }

        function Jy(e, t) {
            D(t.get("geoCoord"), function (t, i) {
                e.addGeoCoord(i, t)
            })
        }

        b(zy, mt), jy.prototype = {
            constructor: jy,
            type: "view",
            dimensions: ["x", "y"],
            setBoundingRect: function (e, t, i, n) {
                return this._rect = new Di(e, t, i, n), this._rect
            },
            getBoundingRect: function () {
                return this._rect
            },
            setViewRect: function (e, t, i, n) {
                this.transformTo(e, t, i, n), this._viewRect = new Di(e, t, i, n)
            },
            transformTo: function (e, t, i, n) {
                var a = this.getBoundingRect(), o = this._rawTransformable;
                o.transform = a.calculateTransform(new Di(e, t, i, n)), o.decomposeTransform(), this._updateTransform()
            },
            setCenter: function (e) {
                e && (this._center = e, this._updateCenterAndZoom())
            },
            setZoom: function (e) {
                e = e || 1;
                var t = this.zoomLimit;
                t && (null != t.max && (e = Math.min(t.max, e)), null != t.min && (e = Math.max(t.min, e))), this._zoom = e, this._updateCenterAndZoom()
            },
            getDefaultCenter: function () {
                var e = this.getBoundingRect();
                return [e.x + e.width / 2, e.y + e.height / 2]
            },
            getCenter: function () {
                return this._center || this.getDefaultCenter()
            },
            getZoom: function () {
                return this._zoom || 1
            },
            getRoamTransform: function () {
                return this._roamTransformable.getLocalTransform()
            },
            _updateCenterAndZoom: function () {
                var e = this._rawTransformable.getLocalTransform(), t = this._roamTransformable,
                    i = this.getDefaultCenter(), n = this.getCenter(), a = this.getZoom();
                n = Ce([], n, e), i = Ce([], i, e), t.origin = n, t.position = [i[0] - n[0], i[1] - n[1]], t.scale = [a, a], this._updateTransform()
            },
            _updateTransform: function () {
                var e = this._roamTransformable, t = this._rawTransformable;
                (t.parent = e).updateTransform(), t.updateTransform(), st(this.transform || (this.transform = []), t.transform || ot()), this._rawTransform = t.getLocalTransform(), this.invTransform = this.invTransform || [], ht(this.invTransform, this.transform), this.decomposeTransform()
            },
            getTransformInfo: function () {
                var e = this._roamTransformable.transform, t = this._rawTransformable;
                return {roamTransform: e ? z(e) : ot(), rawScale: z(t.scale), rawPosition: z(t.position)}
            },
            getViewRect: function () {
                return this._viewRect
            },
            getViewRectAfterRoam: function () {
                var e = this.getBoundingRect().clone();
                return e.applyTransform(this.transform), e
            },
            dataToPoint: function (e, t, i) {
                var n = t ? this._rawTransform : this.transform;
                return i = i || [], n ? Hy(i, e, n) : oe(i, e)
            },
            pointToData: function (e) {
                var t = this.invTransform;
                return t ? Hy([], e, t) : [e[0], e[1]]
            },
            convertToPixel: O(Xy, "dataToPoint"),
            convertFromPixel: O(Xy, "pointToData"),
            containPoint: function (e) {
                return this.getViewRectAfterRoam().contain(e[0], e[1])
            }
        }, b(jy, mt), $y.prototype = {
            constructor: $y,
            type: "geo",
            dimensions: ["lng", "lat"],
            containCoord: function (e) {
                for (var t = this.regions, i = 0; i < t.length; i++) if (t[i].contain(e)) return !0;
                return !1
            },
            transformTo: function (e, t, i, n) {
                var a = this.getBoundingRect(), o = this._invertLongitute;
                a = a.clone(), o && (a.y = -a.y - a.height);
                var r = this._rawTransformable;
                if (r.transform = a.calculateTransform(new Di(e, t, i, n)), r.decomposeTransform(), o) {
                    var s = r.scale;
                    s[1] = -s[1]
                }
                r.updateTransform(), this._updateTransform()
            },
            getRegion: function (e) {
                return this._regionsMap.get(e)
            },
            getRegionByCoord: function (e) {
                for (var t = this.regions, i = 0; i < t.length; i++) if (t[i].contain(e)) return t[i]
            },
            addGeoCoord: function (e, t) {
                this._nameCoordMap.set(e, t)
            },
            getGeoCoord: function (e) {
                return this._nameCoordMap.get(e)
            },
            getBoundingRect: function () {
                return this._rect
            },
            dataToPoint: function (e, t, i) {
                if ("string" == typeof e && (e = this.getGeoCoord(e)), e) return jy.prototype.dataToPoint.call(this, e, t, i)
            },
            convertToPixel: O(Yy, "dataToPoint"),
            convertFromPixel: O(Yy, "pointToData")
        }, b($y, jy);
        var Zy = {
            dimensions: $y.prototype.dimensions, create: function (e, t) {
                var i = [];
                e.eachComponent("geo", function (e, n) {
                    var a = e.get("map"), o = e.get("aspectScale"), r = !0, s = vh.retrieveMap(a);
                    s && s[0] && "svg" === s[0].type ? (null == o && (o = 1), r = !1) : null == o && (o = .75);
                    var l = new $y(a + n, a, e.get("nameMap"), r);
                    l.aspectScale = o, l.zoomLimit = e.get("scaleLimit"), i.push(l), Jy(l, e), (e.coordinateSystem = l).model = e, l.resize = qy, l.resize(e, t)
                }), e.eachSeries(function (e) {
                    if ("geo" === e.get("coordinateSystem")) {
                        var t = e.get("geoIndex") || 0;
                        e.coordinateSystem = i[t]
                    }
                });
                var n = {};
                return e.eachSeriesByType("map", function (e) {
                    if (!e.getHostGeoModel()) {
                        var t = e.getMapType();
                        n[t] = n[t] || [], n[t].push(e)
                    }
                }), D(n, function (e, n) {
                    var a = new $y(n, n, y(A(e, function (e) {
                        return e.get("nameMap")
                    })));
                    a.zoomLimit = W.apply(null, A(e, function (e) {
                        return e.get("scaleLimit")
                    })), i.push(a), a.resize = qy, a.aspectScale = e[0].get("aspectScale"), a.resize(e[0], t), D(e, function (e) {
                        Jy(e.coordinateSystem = a, e)
                    })
                }), i
            }, getFilledRegions: function (e, t, i) {
                for (var n = (e || []).slice(), a = Q(), o = 0; o < n.length; o++) a.set(n[o].name, n[o]);
                return D(my.load(t, i).regions, function (e) {
                    var t = e.name;
                    a.get(t) || n.push({name: t})
                }), n
            }
        };
        gf("geo", Zy), pf(function (e) {
            var t = {};
            e.eachSeriesByType("map", function (i) {
                var n = i.getMapType();
                if (!i.getHostGeoModel() && !t[n]) {
                    var a = {};
                    D(i.seriesGroup, function (t) {
                        var i = t.coordinateSystem, n = t.originalData;
                        t.get("showLegendSymbol") && e.getComponent("legend") && n.each(n.mapDimension("value"), function (e, t) {
                            var o = n.getName(t), r = i.getRegion(o);
                            if (r && !isNaN(e)) {
                                var s = a[o] || 0, l = i.dataToPoint(r.center);
                                a[o] = s + 1, n.setItemLayout(t, {point: l, offset: s})
                            }
                        })
                    });
                    var o = i.getData();
                    o.each(function (e) {
                        var t = o.getName(e), i = o.getItemLayout(e) || {};
                        i.showLabel = !a[t], o.setItemLayout(e, i)
                    }), t[n] = !0
                }
            })
        }), vf(function (e) {
            e.eachSeriesByType("map", function (e) {
                var t = e.get("color"), i = e.getModel("itemStyle"), n = i.get("areaColor"),
                    a = i.get("color") || t[e.seriesIndex % t.length];
                e.getData().setVisual({areaColor: n, color: a})
            })
        }), hf(Sh.PROCESSOR.STATISTIC, function (e) {
            var t = {};
            e.eachSeriesByType("map", function (e) {
                var i = e.getHostGeoModel(), n = i ? "o" + i.id : "i" + e.getMapType();
                (t[n] = t[n] || []).push(e)
            }), D(t, function (e, t) {
                for (var i = function (e, t) {
                    var i = {};
                    return D(e, function (e) {
                        e.each(e.mapDimension("value"), function (t, n) {
                            var a = "ec-" + e.getName(n);
                            i[a] = i[a] || [], isNaN(t) || i[a].push(t)
                        })
                    }), e[0].map(e[0].mapDimension("value"), function (n, a) {
                        for (var o = "ec-" + e[0].getName(a), r = 0, s = 1 / 0, l = -1 / 0, d = i[o].length, u = 0; u < d; u++) s = Math.min(s, i[o][u]), l = Math.max(l, i[o][u]), r += i[o][u];
                        return 0 === d ? NaN : "min" === t ? s : "max" === t ? l : "average" === t ? r / d : r
                    })
                }(A(e, function (e) {
                    return e.getData()
                }), e[0].get("mapValueCalculation")), n = 0; n < e.length; n++) e[n].originalData = e[n].getData();
                for (n = 0; n < e.length; n++) (e[n].seriesGroup = e)[n].needsDrawMap = 0 === n && !e[n].getHostGeoModel(), e[n].setData(i.cloneShallow()), e[n].mainSeries = e[0]
            })
        }), cf(function (e) {
            var t = [];
            D(e.series, function (e) {
                e && "map" === e.type && (t.push(e), e.map = e.map || e.mapType, T(e, e.mapLocation))
            })
        }), Vm("map", [{
            type: "mapToggleSelect",
            event: "mapselectchanged",
            method: "toggleSelected"
        }, {type: "mapSelect", event: "mapselected", method: "select"}, {
            type: "mapUnSelect",
            event: "mapunselected",
            method: "unSelect"
        }]);
        var Qy = D, ek = "\0__link_datas", tk = "\0__link_mainData";

        function ik(e) {
            var t = e.mainData, i = e.datas;
            i || (i = {main: t}, e.datasAttr = {main: "data"}), e.datas = e.mainData = null, sk(t, i, e), Qy(i, function (i) {
                Qy(t.TRANSFERABLE_METHODS, function (t) {
                    i.wrapMethod(t, O(nk, e))
                })
            }), t.wrapMethod("cloneShallow", O(ok, e)), Qy(t.CHANGABLE_METHODS, function (i) {
                t.wrapMethod(i, O(ak, e))
            }), X(i[t.dataType] === t)
        }

        function nk(e, t) {
            if (function (e) {
                return e[tk] === e
            }(this)) {
                var i = k({}, this[ek]);
                sk(i[this.dataType] = t, i, e)
            } else lk(t, this.dataType, this[tk], e);
            return t
        }

        function ak(e, t) {
            return e.struct && e.struct.update(this), t
        }

        function ok(e, t) {
            return Qy(t[ek], function (i, n) {
                i !== t && lk(i.cloneShallow(), n, t, e)
            }), t
        }

        function rk(e) {
            var t = this[tk];
            return null == e || null == t ? t : t[ek][e]
        }

        function sk(e, t, i) {
            e[ek] = {}, Qy(t, function (t, n) {
                lk(t, n, e, i)
            })
        }

        function lk(e, t, i, n) {
            (i[ek][t] = e)[tk] = i, e.dataType = t, n.struct && (e[n.structAttr] = n.struct, n.struct[n.datasAttr[t]] = e), e.getLinkedData = rk
        }

        function dk(e, t) {
            this.name = e || "", this.depth = 0, this.height = 0, this.parentNode = null, this.dataIndex = -1, this.children = [], this.viewChildren = [], this.hostTree = t
        }

        function uk(e, t) {
            this.root, this.data, this._nodes = [], this.hostModel = e, this.levelModels = A(t || [], function (t) {
                return new Sl(t, e, e.ecModel)
            })
        }

        function ck(e, t) {
            var i = e.isExpand ? e.children : [], n = e.parentNode.children,
                a = e.hierNode.i ? n[e.hierNode.i - 1] : null;
            if (i.length) {
                !function (e) {
                    for (var t = e.children, i = t.length, n = 0, a = 0; 0 <= --i;) {
                        var o = t[i];
                        o.hierNode.prelim += n, o.hierNode.modifier += n, a += o.hierNode.change, n += o.hierNode.shift + a
                    }
                }(e);
                var o = (i[0].hierNode.prelim + i[i.length - 1].hierNode.prelim) / 2;
                a ? (e.hierNode.prelim = a.hierNode.prelim + t(e, a), e.hierNode.modifier = e.hierNode.prelim - o) : e.hierNode.prelim = o
            } else a && (e.hierNode.prelim = a.hierNode.prelim + t(e, a));
            e.parentNode.hierNode.defaultAncestor = function (e, t, i, n) {
                if (t) {
                    for (var a = e, o = e, r = o.parentNode.children[0], s = t, l = a.hierNode.modifier, d = o.hierNode.modifier, u = r.hierNode.modifier, c = s.hierNode.modifier; s = pk(s), o = vk(o), s && o;) {
                        a = pk(a), r = vk(r), a.hierNode.ancestor = e;
                        var h = s.hierNode.prelim + c - o.hierNode.prelim - d + n(s, o);
                        0 < h && (mk((g = e, p = i, (f = s).hierNode.ancestor.parentNode === g.parentNode ? f.hierNode.ancestor : p), e, h), d += h, l += h), c += s.hierNode.modifier, d += o.hierNode.modifier, l += a.hierNode.modifier, u += r.hierNode.modifier
                    }
                    s && !pk(a) && (a.hierNode.thread = s, a.hierNode.modifier += c - l), o && !vk(r) && (r.hierNode.thread = o, r.hierNode.modifier += d - u, i = e)
                }
                var f, g, p;
                return i
            }(e, a, e.parentNode.hierNode.defaultAncestor || n[0], t)
        }

        function hk(e) {
            var t = e.hierNode.prelim + e.parentNode.hierNode.modifier;
            e.setLayout({x: t}, !0), e.hierNode.modifier += e.parentNode.hierNode.modifier
        }

        function fk(e) {
            return arguments.length ? e : yk
        }

        function gk(e, t) {
            var i = {};
            return e -= Math.PI / 2, i.x = t * Math.cos(e), i.y = t * Math.sin(e), i
        }

        function pk(e) {
            var t = e.children;
            return t.length && e.isExpand ? t[t.length - 1] : e.hierNode.thread
        }

        function vk(e) {
            var t = e.children;
            return t.length && e.isExpand ? t[0] : e.hierNode.thread
        }

        function mk(e, t, i) {
            var n = i / (t.hierNode.i - e.hierNode.i);
            t.hierNode.change -= n, t.hierNode.shift += i, t.hierNode.modifier += i, t.hierNode.prelim += i, e.hierNode.change += n
        }

        function yk(e, t) {
            return e.parentNode === t.parentNode ? 1 : 2
        }

        dk.prototype = {
            constructor: dk, isRemoved: function () {
                return this.dataIndex < 0
            }, eachNode: function (e, t, i) {
                "function" == typeof e && (i = t, t = e, e = null), L(e = e || {}) && (e = {order: e});
                var n, a = e.order || "preorder", o = this[e.attr || "children"];
                "preorder" === a && (n = t.call(i, this));
                for (var r = 0; !n && r < o.length; r++) o[r].eachNode(e, t, i);
                "postorder" === a && t.call(i, this)
            }, updateDepthAndHeight: function (e) {
                var t = 0;
                this.depth = e;
                for (var i = 0; i < this.children.length; i++) {
                    var n = this.children[i];
                    n.updateDepthAndHeight(e + 1), n.height > t && (t = n.height)
                }
                this.height = t + 1
            }, getNodeById: function (e) {
                if (this.getId() === e) return this;
                for (var t = 0, i = this.children, n = i.length; t < n; t++) {
                    var a = i[t].getNodeById(e);
                    if (a) return a
                }
            }, contains: function (e) {
                if (e === this) return !0;
                for (var t = 0, i = this.children, n = i.length; t < n; t++) {
                    var a = i[t].contains(e);
                    if (a) return a
                }
            }, getAncestors: function (e) {
                for (var t = [], i = e ? this : this.parentNode; i;) t.push(i), i = i.parentNode;
                return t.reverse(), t
            }, getValue: function (e) {
                var t = this.hostTree.data;
                return t.get(t.getDimension(e || "value"), this.dataIndex)
            }, setLayout: function (e, t) {
                0 <= this.dataIndex && this.hostTree.data.setItemLayout(this.dataIndex, e, t)
            }, getLayout: function () {
                return this.hostTree.data.getItemLayout(this.dataIndex)
            }, getModel: function (e) {
                if (!(this.dataIndex < 0)) {
                    var t = this.hostTree.data.getItemModel(this.dataIndex), i = this.getLevelModel();
                    return i ? t.getModel(e, i.getModel(e)) : t.getModel(e)
                }
            }, getLevelModel: function () {
                return (this.hostTree.levelModels || [])[this.depth]
            }, setVisual: function (e, t) {
                0 <= this.dataIndex && this.hostTree.data.setItemVisual(this.dataIndex, e, t)
            }, getVisual: function (e, t) {
                return this.hostTree.data.getItemVisual(this.dataIndex, e, t)
            }, getRawIndex: function () {
                return this.hostTree.data.getRawIndex(this.dataIndex)
            }, getId: function () {
                return this.hostTree.data.getId(this.dataIndex)
            }, isAncestorOf: function (e) {
                for (var t = e.parentNode; t;) {
                    if (t === this) return !0;
                    t = t.parentNode
                }
                return !1
            }, isDescendantOf: function (e) {
                return e !== this && e.isAncestorOf(this)
            }
        }, uk.prototype = {
            constructor: uk, type: "tree", eachNode: function (e, t, i) {
                this.root.eachNode(e, t, i)
            }, getNodeByDataIndex: function (e) {
                var t = this.data.getRawIndex(e);
                return this._nodes[t]
            }, getNodeByName: function (e) {
                return this.root.getNodeByName(e)
            }, update: function () {
                for (var e = this.data, t = this._nodes, i = 0, n = t.length; i < n; i++) t[i].dataIndex = -1;
                for (i = 0, n = e.count(); i < n; i++) t[e.getRawIndex(i)].dataIndex = i
            }, clearLayouts: function () {
                this.data.clearItemLayouts()
            }
        }, uk.createTree = function (e, t, i, n) {
            var a = new uk(t, i && i.levels), o = [], r = 1;
            !function e(t, i) {
                var n = t.value;
                r = Math.max(r, M(n) ? n.length : 1), o.push(t);
                var s = new dk(t.name, a);
                i ? function (e, t) {
                    var i = t.children;
                    e.parentNode !== t && (i.push(e), e.parentNode = t)
                }(s, i) : a.root = s, a._nodes.push(s);
                var l = t.children;
                if (l) for (var d = 0; d < l.length; d++) e(l[d], s)
            }(e), a.root.updateDepthAndHeight(0);
            var s = eg(o, {coordDimensions: ["value"], dimensionsCount: r}), l = new Kf(s, t);
            return l.initData(o), n && n(l), ik({mainData: l, struct: a, structAttr: "tree"}), a.update(), a
        }, ec.extend({
            type: "series.tree",
            layoutInfo: null,
            layoutMode: "box",
            getInitialData: function (e) {
                var t = {name: e.name, children: e.data}, i = new Sl(e.leaves || {}, this, this.ecModel),
                    n = uk.createTree(t, this, {}, function (e) {
                        e.wrapMethod("getItemModel", function (e, t) {
                            var a = n.getNodeByDataIndex(t);
                            return a.children.length && a.isExpand || (e.parentModel = i), e
                        })
                    }), a = 0;
                n.eachNode("preorder", function (e) {
                    e.depth > a && (a = e.depth)
                });
                var o = e.expandAndCollapse && 0 <= e.initialTreeDepth ? e.initialTreeDepth : a;
                return n.root.eachNode("preorder", function (e) {
                    var t = e.hostTree.data.getRawDataItem(e.dataIndex);
                    e.isExpand = t && null != t.collapsed ? !t.collapsed : e.depth <= o
                }), n.data
            },
            getOrient: function () {
                var e = this.get("orient");
                return "horizontal" === e ? e = "LR" : "vertical" === e && (e = "TB"), e
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            },
            formatTooltip: function (e) {
                for (var t = this.getData().tree, i = t.root.children[0], n = t.getNodeByDataIndex(e), a = n.getValue(), o = n.name; n && n !== i;) o = n.parentNode.name + "." + o, n = n.parentNode;
                return Ql(o + (isNaN(a) || null == a ? "" : " : " + a))
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "view",
                left: "12%",
                top: "12%",
                right: "12%",
                bottom: "12%",
                layout: "orthogonal",
                edgeShape: "curve",
                edgeForkPosition: "50%",
                roam: !1,
                nodeScaleRatio: .4,
                center: null,
                zoom: 1,
                orient: "LR",
                symbol: "emptyCircle",
                symbolSize: 7,
                expandAndCollapse: !0,
                initialTreeDepth: 2,
                lineStyle: {color: "#ccc", width: 1.5, curveness: .5},
                itemStyle: {color: "lightsteelblue", borderColor: "#c23531", borderWidth: 1.5},
                label: {show: !0, color: "#555"},
                leaves: {label: {show: !0}},
                animationEasing: "linear",
                animationDuration: 700,
                animationDurationUpdate: 1e3
            }
        });
        var kk = Ss({
            shape: {parentPoint: [], childPoints: [], orient: "", forkPosition: ""},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i = t.childPoints, n = i.length, a = t.parentPoint, o = i[0], r = i[n - 1];
                if (1 === n) return e.moveTo(a[0], a[1]), void e.lineTo(o[0], o[1]);
                var s = t.orient, l = "TB" === s || "BT" === s ? 0 : 1, d = 1 - l, u = xl(t.forkPosition, 1), c = [];
                c[l] = a[l], c[d] = a[d] + (r[d] - a[d]) * u, e.moveTo(a[0], a[1]), e.lineTo(c[0], c[1]), e.moveTo(o[0], o[1]), c[l] = o[l], e.lineTo(c[0], c[1]), c[l] = r[l], e.lineTo(c[0], c[1]), e.lineTo(r[0], r[1]);
                for (var h = 1; h < n - 1; h++) {
                    var f = i[h];
                    e.moveTo(f[0], f[1]), c[l] = f[l], e.lineTo(c[0], c[1])
                }
            }
        });

        function Tk(e, t) {
            var i = e.getItemLayout(t);
            return i && !isNaN(i.x) && !isNaN(i.y) && "none" !== e.getItemVisual(t, "symbol")
        }

        function wk(e, t, i) {
            return i.itemModel = t, i.itemStyle = t.getModel("itemStyle").getItemStyle(), i.hoverItemStyle = t.getModel("emphasis.itemStyle").getItemStyle(), i.lineStyle = t.getModel("lineStyle").getLineStyle(), i.labelModel = t.getModel("label"), i.hoverLabelModel = t.getModel("emphasis.label"), !1 === e.isExpand && 0 !== e.children.length ? i.symbolInnerColor = i.itemStyle.fill : i.symbolInnerColor = "#fff", i
        }

        function Ck(e, t, i, n, a, o) {
            var r = !i, s = e.tree.getNodeByDataIndex(t), l = s.getModel(), d = (o = wk(s, l, o), e.tree.root),
                u = s.parentNode === d ? s : s.parentNode || s, c = e.getItemGraphicEl(u.dataIndex), h = u.getLayout(),
                f = c ? {x: c.position[0], y: c.position[1], rawX: c.__radialOldRawX, rawY: c.__radialOldRawY} : h,
                g = s.getLayout();
            r ? (i = new Mp(e, t, o)).attr("position", [f.x, f.y]) : i.updateData(e, t, o), i.__radialOldRawX = i.__radialRawX, i.__radialOldRawY = i.__radialRawY, i.__radialRawX = g.rawX, i.__radialRawY = g.rawY, n.add(i), e.setItemGraphicEl(t, i), ol(i, {position: [g.x, g.y]}, a);
            var p = i.getSymbolPath();
            if ("radial" === o.layout) {
                var v, m, y = d.children[0], k = y.getLayout(), w = y.children.length;
                if (g.x === k.x && !0 === s.isExpand) {
                    var C = {};
                    C.x = (y.children[0].getLayout().x + y.children[w - 1].getLayout().x) / 2, C.y = (y.children[0].getLayout().y + y.children[w - 1].getLayout().y) / 2, (v = Math.atan2(C.y - k.y, C.x - k.x)) < 0 && (v = 2 * Math.PI + v), (m = C.x < k.x) && (v -= Math.PI)
                } else (v = Math.atan2(g.y - k.y, g.x - k.x)) < 0 && (v = 2 * Math.PI + v), 0 === s.children.length || 0 !== s.children.length && !1 === s.isExpand ? (m = g.x < k.x) && (v -= Math.PI) : (m = g.x > k.x) || (v -= Math.PI);
                var S = m ? "left" : "right", I = o.labelModel.get("rotate"), b = I * (Math.PI / 180);
                p.setStyle({
                    textPosition: o.labelModel.get("position") || S,
                    textRotation: null == I ? -v : b,
                    textOrigin: "center",
                    verticalAlign: "middle"
                })
            }
            !function (e, t, i, n, a, o, r, s, l) {
                var d = l.edgeShape, u = n.__edge;
                if ("curve" === d) t.parentNode && t.parentNode !== i && ol(u = u || (n.__edge = new rs({
                    shape: Ik(l, a, a),
                    style: T({opacity: 0, strokeNoScale: !0}, l.lineStyle)
                })), {
                    shape: Ik(l, o, r),
                    style: {opacity: 1}
                }, e); else if ("polyline" === d && "orthogonal" === l.layout && t !== i && t.children && 0 !== t.children.length && !0 === t.isExpand) {
                    for (var c = t.children, h = [], f = 0; f < c.length; f++) {
                        var g = c[f].getLayout();
                        h.push([g.x, g.y])
                    }
                    ol(u = u || (n.__edge = new kk({
                        shape: {
                            parentPoint: [r.x, r.y],
                            childPoints: [[r.x, r.y]],
                            orient: l.orient,
                            forkPosition: l.edgeForkPosition
                        }, style: T({opacity: 0, strokeNoScale: !0}, l.lineStyle)
                    })), {shape: {parentPoint: [r.x, r.y], childPoints: h}, style: {opacity: 1}}, e)
                }
                s.add(u)
            }(a, s, d, i, f, h, g, n, o)
        }

        function Sk(e, t, i, n, a, o) {
            for (var r, s = e.tree.getNodeByDataIndex(t), l = e.tree.root, d = s.getModel(), u = (o = wk(s, d, o), s.parentNode === l ? s : s.parentNode || s), c = o.edgeShape; null == (r = u.getLayout());) u = u.parentNode === l ? u : u.parentNode || u;
            ol(i, {position: [r.x + 1, r.y + 1]}, a, function () {
                n.remove(i), e.setItemGraphicEl(t, null)
            }), i.fadeOut(null, {keepLabel: !0});
            var h = e.getItemGraphicEl(u.dataIndex).__edge,
                f = i.__edge || (!1 === u.isExpand || 1 === u.children.length ? h : void 0);
            c = o.edgeShape, f && ("curve" === c ? ol(f, {shape: Ik(o, r, r), style: {opacity: 0}}, a, function () {
                n.remove(f)
            }) : "polyline" === c && "orthogonal" === o.layout && ol(f, {
                shape: {
                    parentPoint: [r.x, r.y],
                    childPoints: [[r.x, r.y]]
                }, style: {opacity: 0}
            }, a, function () {
                n.remove(f)
            }))
        }

        function Ik(e, t, i) {
            var n, a, o, r, s, l, d, u, c = e.orient;
            if ("radial" !== e.layout) return s = t.x, d = t.y, l = i.x, u = i.y, "LR" !== c && "RL" !== c || (n = s + (l - s) * e.curvature, a = d, o = l + (s - l) * e.curvature, r = u), "TB" !== c && "BT" !== c || (n = s, a = d + (u - d) * e.curvature, o = l, r = u + (d - u) * e.curvature), {
                x1: s,
                y1: d,
                x2: l,
                y2: u,
                cpx1: n,
                cpy1: a,
                cpx2: o,
                cpy2: r
            };
            s = t.rawX, d = t.rawY, l = i.rawX, u = i.rawY;
            var h = gk(s, d), f = gk(s, d + (u - d) * e.curvature), g = gk(l, u + (d - u) * e.curvature), p = gk(l, u);
            return {x1: h.x, y1: h.y, x2: p.x, y2: p.y, cpx1: f.x, cpy1: f.y, cpx2: g.x, cpy2: g.y}
        }

        function bk(e, t) {
            for (var i, n = [e]; i = n.pop();) if (t(i), i.isExpand) {
                var a = i.children;
                if (a.length) for (var o = a.length - 1; 0 <= o; o--) n.push(a[o])
            }
        }

        function _k(e, t, i) {
            if (e && 0 <= S(t, e.type)) {
                var n = i.getData().tree.root, a = e.targetNode;
                if ("string" == typeof a && (a = n.getNodeById(a)), a && n.contains(a)) return {node: a};
                var o = e.targetNodeId;
                if (null != o && (a = n.getNodeById(o))) return {node: a}
            }
        }

        function Dk(e) {
            for (var t = []; e;) (e = e.parentNode) && t.push(e);
            return t.reverse()
        }

        function Ak(e, t) {
            return 0 <= S(Dk(e), t)
        }

        function Nk(e, t) {
            for (var i = []; e;) {
                var n = e.dataIndex;
                i.push({name: e.name, dataIndex: n, value: t.getRawValue(n)}), e = e.parentNode
            }
            return i.reverse(), i
        }

        Cf({
            type: "tree", init: function (e, t) {
                this._oldTree, this._mainGroup = new Ai, this._controller = new Sy(t.getZr()), this._controllerHost = {target: this.group}, this.group.add(this._mainGroup)
            }, render: function (e, t, i, n) {
                var a = e.getData(), o = e.layoutInfo, r = this._mainGroup, s = e.get("layout");
                "radial" === s ? r.attr("position", [o.x + o.width / 2, o.y + o.height / 2]) : r.attr("position", [o.x, o.y]), this._updateViewCoordSys(e, o, s), this._updateController(e, t, i);
                var l = this._data, d = {
                    expandAndCollapse: e.get("expandAndCollapse"),
                    layout: s,
                    edgeShape: e.get("edgeShape"),
                    edgeForkPosition: e.get("edgeForkPosition"),
                    orient: e.getOrient(),
                    curvature: e.get("lineStyle.curveness"),
                    symbolRotate: e.get("symbolRotate"),
                    symbolOffset: e.get("symbolOffset"),
                    hoverAnimation: e.get("hoverAnimation"),
                    useNameLabel: !0,
                    fadeIn: !0
                };
                a.diff(l).add(function (t) {
                    Tk(a, t) && Ck(a, t, null, r, e, d)
                }).update(function (t, i) {
                    var n = l.getItemGraphicEl(i);
                    Tk(a, t) ? Ck(a, t, n, r, e, d) : n && Sk(l, i, n, r, e, d)
                }).remove(function (t) {
                    var i = l.getItemGraphicEl(t);
                    i && Sk(l, t, i, r, e, d)
                }).execute(), this._nodeScaleRatio = e.get("nodeScaleRatio"), this._updateNodeAndLinkScale(e), !0 === d.expandAndCollapse && a.eachItemGraphicEl(function (t, n) {
                    t.off("click").on("click", function () {
                        i.dispatchAction({type: "treeExpandAndCollapse", seriesId: e.id, dataIndex: n})
                    })
                }), this._data = a
            }, _updateViewCoordSys: function (e) {
                var t = e.getData(), i = [];
                t.each(function (e) {
                    var n = t.getItemLayout(e);
                    !n || isNaN(n.x) || isNaN(n.y) || i.push([+n.x, +n.y])
                });
                var n = [], a = [];
                Lo(i, n, a);
                var o = this._min, r = this._max;
                a[0] - n[0] == 0 && (n[0] = o ? o[0] : n[0] - 1, a[0] = r ? r[0] : a[0] + 1), a[1] - n[1] == 0 && (n[1] = o ? o[1] : n[1] - 1, a[1] = r ? r[1] : a[1] + 1);
                var s = e.coordinateSystem = new jy;
                s.zoomLimit = e.get("scaleLimit"), s.setBoundingRect(n[0], n[1], a[0] - n[0], a[1] - n[1]), s.setCenter(e.get("center")), s.setZoom(e.get("zoom")), this.group.attr({
                    position: s.position,
                    scale: s.scale
                }), this._viewCoordSys = s, this._min = n, this._max = a
            }, _updateController: function (e, t, i) {
                var n = this._controller, a = this._controllerHost, o = this.group;
                n.setPointerChecker(function (t, n, a) {
                    var r = o.getBoundingRect();
                    return r.applyTransform(o.transform), r.contain(n, a) && !Fy(t, i, e)
                }), n.enable(e.get("roam")), a.zoomLimit = e.get("scaleLimit"), a.zoom = e.coordinateSystem.getZoom(), n.off("pan").off("zoom").on("pan", function (t) {
                    Py(a, t.dx, t.dy), i.dispatchAction({seriesId: e.id, type: "treeRoam", dx: t.dx, dy: t.dy})
                }, this).on("zoom", function (t) {
                    Oy(a, t.scale, t.originX, t.originY), i.dispatchAction({
                        seriesId: e.id,
                        type: "treeRoam",
                        zoom: t.scale,
                        originX: t.originX,
                        originY: t.originY
                    }), this._updateNodeAndLinkScale(e)
                }, this)
            }, _updateNodeAndLinkScale: function (e) {
                var t = e.getData(), i = this._getNodeGlobalScale(e), n = [i, i];
                t.eachItemGraphicEl(function (e, t) {
                    e.attr("scale", n)
                })
            }, _getNodeGlobalScale: function (e) {
                var t = e.coordinateSystem;
                if ("view" !== t.type) return 1;
                var i = this._nodeScaleRatio, n = t.scale, a = n && n[0] || 1;
                return ((t.getZoom() - 1) * i + 1) / a
            }, dispose: function () {
                this._controller && this._controller.dispose(), this._controllerHost = {}
            }, remove: function () {
                this._mainGroup.removeAll(), this._data = null
            }
        }), ff({type: "treeExpandAndCollapse", event: "treeExpandAndCollapse", update: "update"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "tree", query: e}, function (t) {
                var i = e.dataIndex, n = t.getData().tree.getNodeByDataIndex(i);
                n.isExpand = !n.isExpand
            })
        }), ff({type: "treeRoam", event: "treeRoam", update: "none"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "tree", query: e}, function (t) {
                var i = Gy(t.coordinateSystem, e);
                t.setCenter && t.setCenter(i.center), t.setZoom && t.setZoom(i.zoom)
            })
        }), vf(mv("tree", "circle")), pf(function (e, t) {
            e.eachSeriesByType("tree", function (e) {
                !function (e, t) {
                    var i = function (e, t) {
                        return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                    }(e, t);
                    e.layoutInfo = i;
                    var n = e.get("layout"), a = 0, o = 0, r = null;
                    r = "radial" === n ? (a = 2 * Math.PI, o = Math.min(i.height, i.width) / 2, fk(function (e, t) {
                        return (e.parentNode === t.parentNode ? 1 : 2) / e.depth
                    })) : (a = i.width, o = i.height, fk());
                    var s = e.getData().tree.root, l = s.children[0];
                    if (l) {
                        !function (e) {
                            e.hierNode = {
                                defaultAncestor: null,
                                ancestor: e,
                                prelim: 0,
                                modifier: 0,
                                change: 0,
                                shift: 0,
                                i: 0,
                                thread: null
                            };
                            for (var t, i, n = [e]; t = n.pop();) if (i = t.children, t.isExpand && i.length) for (var a = i.length - 1; 0 <= a; a--) {
                                var o = i[a];
                                o.hierNode = {
                                    defaultAncestor: null,
                                    ancestor: o,
                                    prelim: 0,
                                    modifier: 0,
                                    change: 0,
                                    shift: 0,
                                    i: a,
                                    thread: null
                                }, n.push(o)
                            }
                        }(s), function (e, t, i) {
                            for (var n, a = [e], o = []; n = a.pop();) if (o.push(n), n.isExpand) {
                                var r = n.children;
                                if (r.length) for (var s = 0; s < r.length; s++) a.push(r[s])
                            }
                            for (; n = o.pop();) t(n, i)
                        }(l, ck, r), s.hierNode.modifier = -l.hierNode.prelim, bk(l, hk);
                        var d = l, u = l, c = l;
                        bk(l, function (e) {
                            var t = e.getLayout().x;
                            t < d.getLayout().x && (d = e), t > u.getLayout().x && (u = e), e.depth > c.depth && (c = e)
                        });
                        var h = d === u ? 1 : r(d, u) / 2, f = h - d.getLayout().x, g = 0, p = 0, v = 0, m = 0;
                        if ("radial" === n) g = a / (u.getLayout().x + h + f), p = o / (c.depth - 1 || 1), bk(l, function (e) {
                            v = (e.getLayout().x + f) * g, m = (e.depth - 1) * p;
                            var t = gk(v, m);
                            e.setLayout({x: t.x, y: t.y, rawX: v, rawY: m}, !0)
                        }); else {
                            var y = e.getOrient();
                            "RL" === y || "LR" === y ? (p = o / (u.getLayout().x + h + f), g = a / (c.depth - 1 || 1), bk(l, function (e) {
                                m = (e.getLayout().x + f) * p, v = "LR" === y ? (e.depth - 1) * g : a - (e.depth - 1) * g, e.setLayout({
                                    x: v,
                                    y: m
                                }, !0)
                            })) : "TB" !== y && "BT" !== y || (g = a / (u.getLayout().x + h + f), p = o / (c.depth - 1 || 1), bk(l, function (e) {
                                v = (e.getLayout().x + f) * g, m = "TB" === y ? (e.depth - 1) * p : o - (e.depth - 1) * p, e.setLayout({
                                    x: v,
                                    y: m
                                }, !0)
                            }))
                        }
                    }
                }(e, t)
            })
        }), ec.extend({
            type: "series.treemap",
            layoutMode: "box",
            dependencies: ["grid", "polar"],
            preventUsingHoverLayer: !0,
            _viewRoot: null,
            defaultOption: {
                progressive: 0,
                left: "center",
                top: "middle",
                right: null,
                bottom: null,
                width: "80%",
                height: "80%",
                sort: !0,
                clipWindow: "origin",
                squareRatio: .5 * (1 + Math.sqrt(5)),
                leafDepth: null,
                drillDownIcon: "▶",
                zoomToNodeRatio: .1024,
                roam: !0,
                nodeClick: "zoomToNode",
                animation: !0,
                animationDurationUpdate: 900,
                animationEasing: "quinticInOut",
                breadcrumb: {
                    show: !0,
                    height: 22,
                    left: "center",
                    top: "bottom",
                    emptyItemWidth: 25,
                    itemStyle: {
                        color: "rgba(0,0,0,0.7)",
                        borderColor: "rgba(255,255,255,0.7)",
                        borderWidth: 1,
                        shadowColor: "rgba(150,150,150,1)",
                        shadowBlur: 3,
                        shadowOffsetX: 0,
                        shadowOffsetY: 0,
                        textStyle: {color: "#fff"}
                    },
                    emphasis: {textStyle: {}}
                },
                label: {show: !0, distance: 0, padding: 5, position: "inside", color: "#fff", ellipsis: !0},
                upperLabel: {
                    show: !1,
                    position: [0, "50%"],
                    height: 20,
                    color: "#fff",
                    ellipsis: !0,
                    verticalAlign: "middle"
                },
                itemStyle: {
                    color: null,
                    colorAlpha: null,
                    colorSaturation: null,
                    borderWidth: 0,
                    gapWidth: 0,
                    borderColor: "#fff",
                    borderColorSaturation: null
                },
                emphasis: {
                    upperLabel: {
                        show: !0,
                        position: [0, "50%"],
                        color: "#fff",
                        ellipsis: !0,
                        verticalAlign: "middle"
                    }
                },
                visualDimension: 0,
                visualMin: null,
                visualMax: null,
                color: [],
                colorAlpha: null,
                colorSaturation: null,
                colorMappingBy: "index",
                visibleMin: 10,
                childrenVisibleMin: null,
                levels: []
            },
            getInitialData: function (e, t) {
                var i = {name: e.name, children: e.data};
                !function e(t) {
                    var i = 0;
                    D(t.children, function (t) {
                        e(t);
                        var n = t.value;
                        M(n) && (n = n[0]), i += n
                    });
                    var n = t.value;
                    M(n) && (n = n[0]), null != n && !isNaN(n) || (n = i), n < 0 && (n = 0), M(t.value) ? t.value[0] = n : t.value = n
                }(i);
                var n = e.levels || [], a = A((n = e.levels = function (e, t) {
                    var i, n = t.get("color");
                    if (n) return D(e = e || [], function (e) {
                        var t = new Sl(e), n = t.get("color");
                        (t.get("itemStyle.color") || n && "none" !== n) && (i = !0)
                    }), i || ((e[0] || (e[0] = {})).color = n.slice()), e
                }(n, t)) || [], function (e) {
                    return new Sl(e, this, t)
                }, this), o = uk.createTree(i, this, null, function (e) {
                    e.wrapMethod("getItemModel", function (e, t) {
                        var i = o.getNodeByDataIndex(t), n = a[i.depth];
                        return n && (e.parentModel = n), e
                    })
                });
                return o.data
            },
            optionUpdated: function () {
                this.resetViewRoot()
            },
            formatTooltip: function (e) {
                var t = this.getData(), i = this.getRawValue(e), n = M(i) ? $l(i[0]) : $l(i);
                return Ql(t.getName(e) + ": " + n)
            },
            getDataParams: function (e) {
                var t = ec.prototype.getDataParams.apply(this, arguments),
                    i = this.getData().tree.getNodeByDataIndex(e);
                return t.treePathInfo = Nk(i, this), t
            },
            setLayoutInfo: function (e) {
                this.layoutInfo = this.layoutInfo || {}, k(this.layoutInfo, e)
            },
            mapIdToIndex: function (e) {
                var t = this._idIndexMap;
                t || (t = this._idIndexMap = Q(), this._idIndexMapCount = 0);
                var i = t.get(e);
                return null == i && t.set(e, i = this._idIndexMapCount++), i
            },
            getViewRoot: function () {
                return this._viewRoot
            },
            resetViewRoot: function (e) {
                e ? this._viewRoot = e : e = this._viewRoot;
                var t = this.getRawData().tree.root;
                e && (e === t || t.contains(e)) || (this._viewRoot = t)
            }
        });
        var xk = 5;

        function Ek(e) {
            this.group = new Ai, e.add(this.group)
        }

        function Pk(e, t, i, n, a, o) {
            var r = [[a ? e : e - xk, t], [e + i, t], [e + i, t + n], [a ? e : e - xk, t + n]];
            return o || r.splice(2, 0, [e + i + xk, t + n / 2]), a || r.push([e, t + n / 2]), r
        }

        function Ok(e) {
            var t = Gk(e);
            return t.stroke = t.fill = t.lineWidth = null, t
        }

        Ek.prototype = {
            constructor: Ek, render: function (e, t, i, n) {
                var a = e.getModel("breadcrumb"), o = this.group;
                if (o.removeAll(), a.get("show") && i) {
                    var r = a.getModel("itemStyle"), s = r.getModel("textStyle"), l = {
                        pos: {
                            left: a.get("left"),
                            right: a.get("right"),
                            top: a.get("top"),
                            bottom: a.get("bottom")
                        },
                        box: {width: t.getWidth(), height: t.getHeight()},
                        emptyItemWidth: a.get("emptyItemWidth"),
                        totalWidth: 0,
                        renderList: []
                    };
                    this._prepare(i, l, s), this._renderContent(e, l, r, s, n), md(o, l.pos, l.box)
                }
            }, _prepare: function (e, t, i) {
                for (var n = e; n; n = n.parentNode) {
                    var a = n.getModel().get("name"), o = i.getTextRect(a),
                        r = Math.max(o.width + 16, t.emptyItemWidth);
                    t.totalWidth += r + 8, t.renderList.push({node: n, text: a, width: r})
                }
            }, _renderContent: function (e, t, i, n, a) {
                for (var o, r, s = 0, l = t.emptyItemWidth, d = e.get("breadcrumb.height"), u = function (e, t, i) {
                    var n = t.width, a = t.height, o = xl(e.x, n), r = xl(e.y, a), s = xl(e.x2, n), l = xl(e.y2, a);
                    return (isNaN(o) || isNaN(parseFloat(e.x))) && (o = 0), (isNaN(s) || isNaN(parseFloat(e.x2))) && (s = n), (isNaN(r) || isNaN(parseFloat(e.y))) && (r = 0), (isNaN(l) || isNaN(parseFloat(e.y2))) && (l = a), i = ql(i || 0), {
                        width: Math.max(s - o - i[1] - i[3], 0),
                        height: Math.max(l - r - i[0] - i[2], 0)
                    }
                }(t.pos, t.box), c = t.totalWidth, h = t.renderList, f = h.length - 1; 0 <= f; f--) {
                    var g = h[f], p = g.node, v = g.width, m = g.text;
                    c > u.width && (c -= v - l, v = l, m = null);
                    var y = new Xr({
                        shape: {points: Pk(s, 0, v, d, f === h.length - 1, 0 === f)},
                        style: T(i.getItemStyle(), {
                            lineJoin: "bevel",
                            text: m,
                            textFill: n.getTextColor(),
                            textFont: n.getFont()
                        }),
                        z: 10,
                        onclick: O(a, p)
                    });
                    this.group.add(y), o = e, r = p, y.eventData = {
                        componentType: "series",
                        componentSubType: "treemap",
                        componentIndex: o.componentIndex,
                        seriesIndex: o.componentIndex,
                        seriesName: o.name,
                        seriesType: "treemap",
                        selfType: "breadcrumb",
                        nodeData: {dataIndex: r && r.dataIndex, name: r && r.name},
                        treePathInfo: r && Nk(r, o)
                    }, s += v + 8
                }
            }, remove: function () {
                this.group.removeAll()
            }
        };
        var Mk = P, Fk = Ai, Lk = es, Rk = D, Bk = ["label"], Uk = ["emphasis", "label"], Kk = ["upperLabel"],
            Vk = ["emphasis", "upperLabel"], Wk = 10,
            Gk = no([["fill", "color"], ["stroke", "strokeColor"], ["lineWidth", "strokeWidth"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]);

        function Hk(e, t, i, n, a, o, r, s, l, d) {
            if (r) {
                var u = r.getLayout(), c = e.getData();
                if (c.setItemGraphicEl(r.dataIndex, null), u && u.isInView) {
                    var h = u.width, f = u.height, g = u.borderWidth, p = u.invisible, m = r.getRawIndex(),
                        y = s && s.getRawIndex(), T = r.viewChildren, w = u.upperHeight, C = T && T.length,
                        S = r.getModel("itemStyle"), I = r.getModel("emphasis.itemStyle"), b = P("nodeGroup", Fk);
                    if (b) {
                        if (l.add(b), b.attr("position", [u.x || 0, u.y || 0]), b.__tmNodeWidth = h, b.__tmNodeHeight = f, u.isAboveViewRoot) return b;
                        var _ = r.getModel(), D = P("background", Lk, d, 1);
                        if (D && function (t, i, n) {
                            if (i.dataIndex = r.dataIndex, i.seriesIndex = e.seriesIndex, i.setShape({
                                x: 0,
                                y: 0,
                                width: h,
                                height: f
                            }), p) N(i); else {
                                i.invisible = !1;
                                var a = r.getVisual("borderColor", !0), o = I.get("borderColor"), s = Ok(S);
                                s.fill = a;
                                var l = Gk(I);
                                if (l.fill = o, n) {
                                    var d = h - 2 * g;
                                    x(s, l, a, d, w, {x: g, y: 0, width: d, height: w})
                                } else s.text = l.text = null;
                                i.setStyle(s), Us(i, l)
                            }
                            t.add(i)
                        }(b, D, C && u.upperLabelHeight), C) Xs(b) && js(b, !1), D && (js(D, !0), c.setItemGraphicEl(r.dataIndex, D)); else {
                            var A = P("content", Lk, d, 2);
                            A && function (t, i) {
                                i.dataIndex = r.dataIndex, i.seriesIndex = e.seriesIndex;
                                var n = Math.max(h - 2 * g, 0), a = Math.max(f - 2 * g, 0);
                                if (i.culling = !0, i.setShape({x: g, y: g, width: n, height: a}), p) N(i); else {
                                    i.invisible = !1;
                                    var o = r.getVisual("color", !0), s = Ok(S);
                                    s.fill = o;
                                    var l = Gk(I);
                                    x(s, l, o, n, a), i.setStyle(s), Us(i, l)
                                }
                                t.add(i)
                            }(b, A), D && Xs(D) && js(D, !1), js(b, !0), c.setItemGraphicEl(r.dataIndex, b)
                        }
                        return b
                    }
                }
            }

            function N(e) {
                e.invisible || o.push(e)
            }

            function x(t, i, n, a, o, s) {
                var l = _.get("name"), d = _.getModel(s ? Kk : Bk), c = _.getModel(s ? Vk : Uk),
                    h = d.getShallow("show");
                Ys(t, i, d, c, {
                    defaultText: h ? l : null,
                    autoColor: n,
                    isRectText: !0,
                    labelFetcher: e,
                    labelDataIndex: r.dataIndex,
                    labelProp: s ? "upperLabel" : "label"
                }), E(t, s, u), E(i, s, u), s && (t.textRect = v(s)), t.truncate = h && d.get("ellipsis") ? {
                    outerWidth: a,
                    outerHeight: o,
                    minChar: 2
                } : null
            }

            function E(t, i, n) {
                var a = t.text;
                if (!i && n.isLeafRoot && null != a) {
                    var o = e.get("drillDownIcon", !0);
                    t.text = o ? o + " " + a : a
                }
            }

            function P(e, o, s, l) {
                var d = null != y && i[e][y], u = a[e];
                return d ? (i[e][y] = null, function (e, t, i) {
                    (e[m] = {}).old = "nodeGroup" === i ? t.position.slice() : k({}, t.shape)
                }(u, d, e)) : p || ((d = new o({
                    z: function (e, t) {
                        var i = e * Wk + t;
                        return (i - 1) / i
                    }(s, l)
                })).__tmDepth = s, function (e, t, i) {
                    var o = e[m] = {}, s = r.parentNode;
                    if (s && (!n || "drillDown" === n.direction)) {
                        var l = 0, d = 0, u = a.background[s.getRawIndex()];
                        !n && u && u.old && (l = u.old.width, d = u.old.height), o.old = "nodeGroup" === i ? [0, d] : {
                            x: l,
                            y: d,
                            width: 0,
                            height: 0
                        }
                    }
                    o.fadein = "nodeGroup" !== i
                }(u, 0, d.__tmStorageName = e)), t[e][m] = d
            }
        }

        Cf({
            type: "treemap", init: function (e, t) {
                this._containerGroup, this._storage = {
                    nodeGroup: [],
                    background: [],
                    content: []
                }, this._oldTree, this._breadcrumb, this._controller, this._state = "ready"
            }, render: function (e, t, i, n) {
                if (!(S(t.findComponents({mainType: "series", subType: "treemap", query: n}), e) < 0)) {
                    this.seriesModel = e, this.api = i, this.ecModel = t;
                    var a = _k(n, ["treemapZoomToNode", "treemapRootToNode"], e), o = n && n.type, r = e.layoutInfo,
                        s = !this._oldTree, l = this._storage, d = "treemapRootToNode" === o && a && l ? {
                            rootNodeGroup: l.nodeGroup[a.node.getRawIndex()],
                            direction: n.direction
                        } : null, u = this._giveContainerGroup(r), c = this._doRender(u, e, d);
                    s || o && "treemapZoomToNode" !== o && "treemapRootToNode" !== o ? c.renderFinally() : this._doAnimation(u, c, e, d), this._resetController(i), this._renderBreadcrumb(e, i, a)
                }
            }, _giveContainerGroup: function (e) {
                var t = this._containerGroup;
                return t || (t = this._containerGroup = new Fk, this._initEvents(t), this.group.add(t)), t.attr("position", [e.x, e.y]), t
            }, _doRender: function (e, t, i) {
                var n = t.getData().tree, a = this._oldTree, o = {nodeGroup: [], background: [], content: []},
                    r = {nodeGroup: [], background: [], content: []}, s = this._storage, l = [],
                    d = O(Hk, t, r, s, i, o, l);
                !function e(t, i, n, a, o) {
                    function r(e) {
                        return e.getId()
                    }

                    function s(r, s) {
                        var l = null != r ? t[r] : null, u = null != s ? i[s] : null, c = d(l, u, n, o);
                        c && e(l && l.viewChildren || [], u && u.viewChildren || [], c, a, o + 1)
                    }

                    a ? Rk(i = t, function (e, t) {
                        e.isRemoved() || s(t, t)
                    }) : new If(i, t, r, r).add(s).update(s).remove(O(s, null)).execute()
                }(n.root ? [n.root] : [], a && a.root ? [a.root] : [], e, n === a || !a, 0);
                var u, c, h = (c = {nodeGroup: [], background: [], content: []}, (u = s) && Rk(u, function (e, t) {
                    var i = c[t];
                    Rk(e, function (e) {
                        e && (i.push(e), e.__tmWillDelete = 1)
                    })
                }), c);
                return this._oldTree = n, this._storage = r, {
                    lastsForAnimation: o,
                    willDeleteEls: h,
                    renderFinally: function () {
                        Rk(h, function (e) {
                            Rk(e, function (e) {
                                e.parent && e.parent.remove(e)
                            })
                        }), Rk(l, function (e) {
                            e.invisible = !0, e.dirty()
                        })
                    }
                }
            }, _doAnimation: function (e, t, i, n) {
                if (i.get("animation")) {
                    var a = i.get("animationDurationUpdate"), o = i.get("animationEasing"), r = function () {
                        var e, t = [], i = {};
                        return {
                            add: function (e, n, a, o, r) {
                                return L(o) && (r = o, o = 0), !i[e.id] && (i[e.id] = 1, t.push({
                                    el: e,
                                    target: n,
                                    time: a,
                                    delay: o,
                                    easing: r
                                }), !0)
                            }, done: function (t) {
                                return e = t, this
                            }, start: function () {
                                for (var n = t.length, a = 0, o = t.length; a < o; a++) {
                                    var r = t[a];
                                    r.el.animateTo(r.target, r.time, r.delay, r.easing, s)
                                }
                                return this;

                                function s() {
                                    --n || (t.length = 0, i = {}, e && e())
                                }
                            }
                        }
                    }();
                    Rk(t.willDeleteEls, function (e, t) {
                        Rk(e, function (e, i) {
                            if (!e.invisible) {
                                var s, l = e.parent;
                                if (n && "drillDown" === n.direction) s = l === n.rootNodeGroup ? {
                                    shape: {
                                        x: 0,
                                        y: 0,
                                        width: l.__tmNodeWidth,
                                        height: l.__tmNodeHeight
                                    }, style: {opacity: 0}
                                } : {style: {opacity: 0}}; else {
                                    var d = 0, u = 0;
                                    l.__tmWillDelete || (d = l.__tmNodeWidth / 2, u = l.__tmNodeHeight / 2), s = "nodeGroup" === t ? {
                                        position: [d, u],
                                        style: {opacity: 0}
                                    } : {shape: {x: d, y: u, width: 0, height: 0}, style: {opacity: 0}}
                                }
                                s && r.add(e, s, a, o)
                            }
                        })
                    }), Rk(this._storage, function (e, i) {
                        Rk(e, function (e, n) {
                            var s = t.lastsForAnimation[i][n], l = {};
                            s && ("nodeGroup" === i ? s.old && (l.position = e.position.slice(), e.attr("position", s.old)) : (s.old && (l.shape = k({}, e.shape), e.setShape(s.old)), s.fadein ? (e.setStyle("opacity", 0), l.style = {opacity: 1}) : 1 !== e.style.opacity && (l.style = {opacity: 1})), r.add(e, l, a, o))
                        })
                    }, this), this._state = "animating", r.done(Mk(function () {
                        this._state = "ready", t.renderFinally()
                    }, this)).start()
                }
            }, _resetController: function (e) {
                var t = this._controller;
                t || ((t = this._controller = new Sy(e.getZr())).enable(this.seriesModel.get("roam")), t.on("pan", Mk(this._onPan, this)), t.on("zoom", Mk(this._onZoom, this)));
                var i = new Di(0, 0, e.getWidth(), e.getHeight());
                t.setPointerChecker(function (e, t, n) {
                    return i.contain(t, n)
                })
            }, _clearController: function () {
                var e = this._controller;
                e && (e.dispose(), e = null)
            }, _onPan: function (e) {
                if ("animating" !== this._state && (3 < Math.abs(e.dx) || 3 < Math.abs(e.dy))) {
                    var t = this.seriesModel.getData().tree.root;
                    if (!t) return;
                    var i = t.getLayout();
                    if (!i) return;
                    this.api.dispatchAction({
                        type: "treemapMove",
                        from: this.uid,
                        seriesId: this.seriesModel.id,
                        rootRect: {x: i.x + e.dx, y: i.y + e.dy, width: i.width, height: i.height}
                    })
                }
            }, _onZoom: function (e) {
                var t = e.originX, i = e.originY;
                if ("animating" !== this._state) {
                    var n = this.seriesModel.getData().tree.root;
                    if (!n) return;
                    var a = n.getLayout();
                    if (!a) return;
                    var o = new Di(a.x, a.y, a.width, a.height), r = this.seriesModel.layoutInfo;
                    t -= r.x, i -= r.y;
                    var s = ot();
                    dt(s, s, [-t, -i]), ct(s, s, [e.scale, e.scale]), dt(s, s, [t, i]), o.applyTransform(s), this.api.dispatchAction({
                        type: "treemapRender",
                        from: this.uid,
                        seriesId: this.seriesModel.id,
                        rootRect: {x: o.x, y: o.y, width: o.width, height: o.height}
                    })
                }
            }, _initEvents: function (e) {
                e.on("click", function (e) {
                    if ("ready" === this._state) {
                        var t = this.seriesModel.get("nodeClick", !0);
                        if (t) {
                            var i = this.findTarget(e.offsetX, e.offsetY);
                            if (i) {
                                var n = i.node;
                                if (n.getLayout().isLeafRoot) this._rootToNode(i); else if ("zoomToNode" === t) this._zoomToNode(i); else if ("link" === t) {
                                    var a = n.hostTree.data.getItemModel(n.dataIndex), o = a.get("link", !0),
                                        r = a.get("target", !0) || "blank";
                                    o && dd(o, r)
                                }
                            }
                        }
                    }
                }, this)
            }, _renderBreadcrumb: function (e, t, i) {
                i = i || (i = null != e.get("leafDepth", !0) ? {node: e.getViewRoot()} : this.findTarget(t.getWidth() / 2, t.getHeight() / 2)) || {node: e.getData().tree.root}, (this._breadcrumb || (this._breadcrumb = new Ek(this.group))).render(e, t, i.node, Mk(function (t) {
                    "animating" !== this._state && (Ak(e.getViewRoot(), t) ? this._rootToNode({node: t}) : this._zoomToNode({node: t}))
                }, this))
            }, remove: function () {
                this._clearController(), this._containerGroup && this._containerGroup.removeAll(), this._storage = {
                    nodeGroup: [],
                    background: [],
                    content: []
                }, this._state = "ready", this._breadcrumb && this._breadcrumb.remove()
            }, dispose: function () {
                this._clearController()
            }, _zoomToNode: function (e) {
                this.api.dispatchAction({
                    type: "treemapZoomToNode",
                    from: this.uid,
                    seriesId: this.seriesModel.id,
                    targetNode: e.node
                })
            }, _rootToNode: function (e) {
                this.api.dispatchAction({
                    type: "treemapRootToNode",
                    from: this.uid,
                    seriesId: this.seriesModel.id,
                    targetNode: e.node
                })
            }, findTarget: function (e, t) {
                var i;
                return this.seriesModel.getViewRoot().eachNode({attr: "viewChildren", order: "preorder"}, function (n) {
                    var a = this._storage.background[n.getRawIndex()];
                    if (a) {
                        var o = a.transformCoordToLocal(e, t), r = a.shape;
                        if (!(r.x <= o[0] && o[0] <= r.x + r.width && r.y <= o[1] && o[1] <= r.y + r.height)) return !1;
                        i = {node: n, offsetX: o[0], offsetY: o[1]}
                    }
                }, this), i
            }
        });
        for (var zk = function () {
        }, jk = ["treemapZoomToNode", "treemapRender", "treemapMove"], Xk = 0; Xk < jk.length; Xk++) ff({
            type: jk[Xk],
            update: "updateView"
        }, zk);
        ff({type: "treemapRootToNode", update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "treemap", query: e}, function (t, i) {
                var n = _k(e, ["treemapZoomToNode", "treemapRootToNode"], t);
                if (n) {
                    var a = t.getViewRoot();
                    a && (e.direction = Ak(a, n.node) ? "rollUp" : "drillDown"), t.resetViewRoot(n.node)
                }
            })
        });
        var $k = D, Yk = R, qk = -1, Jk = function (e) {
            var t = e.mappingMethod, i = e.type, n = this.option = v(e);
            this.type = i, this.mappingMethod = t, this._normalizeData = lT[t];
            var a = Zk[i];
            this.applyVisual = a.applyVisual, this.getColorMapper = a.getColorMapper, this._doMap = a._doMap[t], "piecewise" === t ? (Qk(n), function (e) {
                var t = e.pieceList;
                e.hasSpecialVisual = !1, D(t, function (t, i) {
                    t.originIndex = i, null != t.visual && (e.hasSpecialVisual = !0)
                })
            }(n)) : "category" === t ? n.categories ? function (e) {
                var t = e.categories, i = e.visual, n = e.categoryMap = {};
                if ($k(t, function (e, t) {
                    n[e] = t
                }), !M(i)) {
                    var a = [];
                    R(i) ? $k(i, function (e, t) {
                        var i = n[t];
                        a[null != i ? i : qk] = e
                    }) : a[qk] = i, i = sT(e, a)
                }
                for (var o = t.length - 1; 0 <= o; o--) null == i[o] && (delete n[t[o]], t.pop())
            }(n) : Qk(n, !0) : (X("linear" !== t || n.dataExtent), Qk(n))
        };
        Jk.prototype = {
            constructor: Jk, mapValueToVisual: function (e) {
                var t = this._normalizeData(e);
                return this._doMap(t, e)
            }, getNormalizer: function () {
                return P(this._normalizeData, this)
            }
        };
        var Zk = Jk.visualHandlers = {
            color: {
                applyVisual: iT("color"), getColorMapper: function () {
                    var e = this.option;
                    return P("category" === e.mappingMethod ? function (e, t) {
                        return t || (e = this._normalizeData(e)), nT.call(this, e)
                    } : function (t, i, n) {
                        var a = !!n;
                        return i || (t = this._normalizeData(t)), n = zt(t, e.parsedVisual, n), a ? n : Jt(n, "rgba")
                    }, this)
                }, _doMap: {
                    linear: function (e) {
                        return Jt(zt(e, this.option.parsedVisual), "rgba")
                    }, category: nT, piecewise: function (e, t) {
                        var i = rT.call(this, t);
                        return null == i && (i = Jt(zt(e, this.option.parsedVisual), "rgba")), i
                    }, fixed: aT
                }
            },
            colorHue: eT(function (e, t) {
                return Yt(e, t)
            }),
            colorSaturation: eT(function (e, t) {
                return Yt(e, null, t)
            }),
            colorLightness: eT(function (e, t) {
                return Yt(e, null, null, t)
            }),
            colorAlpha: eT(function (e, t) {
                return qt(e, t)
            }),
            opacity: {applyVisual: iT("opacity"), _doMap: oT([0, 1])},
            liftZ: {applyVisual: iT("liftZ"), _doMap: {linear: aT, category: aT, piecewise: aT, fixed: aT}},
            symbol: {
                applyVisual: function (e, t, i) {
                    var n = this.mapValueToVisual(e);
                    if (L(n)) i("symbol", n); else if (Yk(n)) for (var a in n) n.hasOwnProperty(a) && i(a, n[a])
                }, _doMap: {
                    linear: tT, category: nT, piecewise: function (e, t) {
                        var i = rT.call(this, t);
                        return null == i && (i = tT.call(this, e)), i
                    }, fixed: aT
                }
            },
            symbolSize: {applyVisual: iT("symbolSize"), _doMap: oT([0, 1])}
        };

        function Qk(e, t) {
            var i = e.visual, n = [];
            R(i) ? $k(i, function (e) {
                n.push(e)
            }) : null != i && n.push(i), t || 1 !== n.length || {
                color: 1,
                symbol: 1
            }.hasOwnProperty(e.type) || (n[1] = n[0]), sT(e, n)
        }

        function eT(e) {
            return {
                applyVisual: function (t, i, n) {
                    t = this.mapValueToVisual(t), n("color", e(i("color"), t))
                }, _doMap: oT([0, 1])
            }
        }

        function tT(e) {
            var t = this.option.visual;
            return t[Math.round(Nl(e, [0, 1], [0, t.length - 1], !0))] || {}
        }

        function iT(e) {
            return function (t, i, n) {
                n(e, this.mapValueToVisual(t))
            }
        }

        function nT(e) {
            var t = this.option.visual;
            return t[this.option.loop && e !== qk ? e % t.length : e]
        }

        function aT() {
            return this.option.visual[0]
        }

        function oT(e) {
            return {
                linear: function (t) {
                    return Nl(t, e, this.option.visual, !0)
                }, category: nT, piecewise: function (t, i) {
                    var n = rT.call(this, i);
                    return null == n && (n = Nl(t, e, this.option.visual, !0)), n
                }, fixed: aT
            }
        }

        function rT(e) {
            var t = this.option, i = t.pieceList;
            if (t.hasSpecialVisual) {
                var n = i[Jk.findPieceIndex(e, i)];
                if (n && n.visual) return n.visual[this.type]
            }
        }

        function sT(e, t) {
            return e.visual = t, "color" === e.type && (e.parsedVisual = A(t, function (e) {
                return Vt(e)
            })), t
        }

        var lT = {
            linear: function (e) {
                return Nl(e, this.option.dataExtent, [0, 1], !0)
            }, piecewise: function (e) {
                var t = this.option.pieceList, i = Jk.findPieceIndex(e, t, !0);
                if (null != i) return Nl(i, [0, t.length - 1], [0, 1], !0)
            }, category: function (e) {
                var t = this.option.categories ? this.option.categoryMap[e] : e;
                return null == t ? qk : t
            }, fixed: te
        };

        function dT(e, t, i) {
            return e ? t <= i : t < i
        }

        Jk.listVisualTypes = function () {
            var e = [];
            return D(Zk, function (t, i) {
                e.push(i)
            }), e
        }, Jk.addVisualHandler = function (e, t) {
            Zk[e] = t
        }, Jk.isValidType = function (e) {
            return Zk.hasOwnProperty(e)
        }, Jk.eachVisual = function (e, t, i) {
            R(e) ? D(e, t, i) : t.call(i, e)
        }, Jk.mapVisual = function (e, t, i) {
            var n, a = M(e) ? [] : R(e) ? {} : (n = !0, null);
            return Jk.eachVisual(e, function (e, o) {
                var r = t.call(i, e, o);
                n ? a = r : a[o] = r
            }), a
        }, Jk.retrieveVisuals = function (e) {
            var t, i = {};
            return e && $k(Zk, function (n, a) {
                e.hasOwnProperty(a) && (i[a] = e[a], t = !0)
            }), t ? i : null
        }, Jk.prepareVisualTypes = function (e) {
            if (Yk(e)) {
                var t = [];
                $k(e, function (e, i) {
                    t.push(i)
                }), e = t
            } else {
                if (!M(e)) return [];
                e = e.slice()
            }
            return e.sort(function (e, t) {
                return "color" === t && "color" !== e && 0 === e.indexOf("color") ? 1 : -1
            }), e
        }, Jk.dependsOn = function (e, t) {
            return "color" === t ? !(!e || 0 !== e.indexOf(t)) : e === t
        }, Jk.findPieceIndex = function (e, t, i) {
            for (var n, a = 1 / 0, o = 0, r = t.length; o < r; o++) {
                var s = t[o].value;
                if (null != s) {
                    if (s === e || "string" == typeof s && s === e + "") return o;
                    i && c(s, o)
                }
            }
            for (o = 0, r = t.length; o < r; o++) {
                var l = t[o], d = l.interval, u = l.close;
                if (d) {
                    if (d[0] === -1 / 0) {
                        if (dT(u[1], e, d[1])) return o
                    } else if (d[1] === 1 / 0) {
                        if (dT(u[0], d[0], e)) return o
                    } else if (dT(u[0], d[0], e) && dT(u[1], e, d[1])) return o;
                    i && c(d[0], o), i && c(d[1], o)
                }
            }
            if (i) return e === 1 / 0 ? t.length - 1 : e === -1 / 0 ? 0 : n;

            function c(t, i) {
                var o = Math.abs(t - e);
                o < a && (a = o, n = i)
            }
        };
        var uT = M, cT = "itemStyle", hT = {
            seriesType: "treemap", reset: function (e, t, i, n) {
                var a = e.getData().tree, o = a.root, r = e.getModel(cT);
                o.isRemoved() || function e(t, i, n, a, o, r) {
                    var s = t.getModel(), l = t.getLayout();
                    if (l && !l.invisible && l.isInView) {
                        var d, u, c = t.getModel(cT), h = n[t.depth], f = function (e, t, i, n) {
                            var a = k({}, t);
                            return D(["color", "colorAlpha", "colorSaturation"], function (o) {
                                var r = e.get(o, !0);
                                null == r && i && (r = i[o]), null == r && (r = t[o]), null == r && (r = n.get(o)), null != r && (a[o] = r)
                            }), a
                        }(c, i, h, a), g = c.get("borderColor"), p = c.get("borderColorSaturation");
                        null != p && (d = fT(f), g = null != (u = d) ? Yt(u, null, null, p) : null), t.setVisual("borderColor", g);
                        var v = t.viewChildren;
                        if (v && v.length) {
                            var m = function (e, t, i, n, a, o) {
                                if (o && o.length) {
                                    var r = pT(t, "color") || null != a.color && "none" !== a.color && (pT(t, "colorAlpha") || pT(t, "colorSaturation"));
                                    if (r) {
                                        var s = t.get("visualMin"), l = t.get("visualMax"), d = i.dataExtent.slice();
                                        null != s && s < d[0] && (d[0] = s), null != l && l > d[1] && (d[1] = l);
                                        var u = t.get("colorMappingBy"),
                                            c = {type: r.name, dataExtent: d, visual: r.range};
                                        "color" !== c.type || "index" !== u && "id" !== u ? c.mappingMethod = "linear" : (c.mappingMethod = "category", c.loop = !0);
                                        var h = new Jk(c);
                                        return h.__drColorMappingBy = u, h
                                    }
                                }
                            }(0, s, l, 0, f, v);
                            D(v, function (t, i) {
                                if (t.depth >= o.length || t === o[t.depth]) {
                                    var l = function (e, t, i, n, a, o) {
                                        var r = k({}, t);
                                        if (a) {
                                            var s = a.type, l = "color" === s && a.__drColorMappingBy,
                                                d = "index" === l ? n : "id" === l ? o.mapIdToIndex(i.getId()) : i.getValue(e.get("visualDimension"));
                                            r[s] = a.mapValueToVisual(d)
                                        }
                                        return r
                                    }(s, f, t, i, m, r);
                                    e(t, l, n, a, o, r)
                                }
                            })
                        } else d = fT(f), t.setVisual("color", d)
                    }
                }(o, {}, A(a.levelModels, function (e) {
                    return e ? e.get(cT) : null
                }), r, e.getViewRoot().getAncestors(), e)
            }
        };

        function fT(e) {
            var t = gT(e, "color");
            if (t) {
                var i = gT(e, "colorAlpha"), n = gT(e, "colorSaturation");
                return n && (t = Yt(t, null, null, n)), i && (t = qt(t, i)), t
            }
        }

        function gT(e, t) {
            var i = e[t];
            if (null != i && "none" !== i) return i
        }

        function pT(e, t) {
            var i = e.get(t);
            return uT(i) && i.length ? {name: t, range: i} : null
        }

        var vT = Math.max, mT = Math.min, yT = W, kT = D, TT = ["itemStyle", "borderWidth"],
            wT = ["itemStyle", "gapWidth"], CT = ["upperLabel", "show"], ST = ["upperLabel", "height"], IT = {
                seriesType: "treemap", reset: function (e, t, i, n) {
                    var a = i.getWidth(), o = i.getHeight(), r = e.option,
                        s = vd(e.getBoxLayoutParams(), {width: i.getWidth(), height: i.getHeight()}), l = r.size || [],
                        d = xl(yT(s.width, l[0]), a), u = xl(yT(s.height, l[1]), o), c = n && n.type,
                        h = _k(n, ["treemapZoomToNode", "treemapRootToNode"], e),
                        f = "treemapRender" === c || "treemapMove" === c ? n.rootRect : null, g = e.getViewRoot(),
                        p = Dk(g);
                    if ("treemapMove" !== c) {
                        var v = "treemapZoomToNode" === c ? function (e, t, i, n, a) {
                            var o, r = (t || {}).node, s = [n, a];
                            if (!r || r === i) return s;
                            for (var l = n * a, d = l * e.option.zoomToNodeRatio; o = r.parentNode;) {
                                for (var u = 0, c = o.children, h = 0, f = c.length; h < f; h++) u += c[h].getValue();
                                var g = r.getValue();
                                if (0 === g) return s;
                                d *= u / g;
                                var p = o.getModel(), v = p.get(TT), m = Math.max(v, AT(p));
                                d += 4 * v * v + (3 * v + m) * Math.pow(d, .5), Rl < d && (d = Rl), r = o
                            }
                            d < l && (d = l);
                            var y = Math.pow(d / l, .5);
                            return [n * y, a * y]
                        }(e, h, g, d, u) : f ? [f.width, f.height] : [d, u], m = r.sort;
                        m && "asc" !== m && "desc" !== m && (m = "desc");
                        var y = {squareRatio: r.squareRatio, sort: m, leafDepth: r.leafDepth};
                        g.hostTree.clearLayouts();
                        var T = {x: 0, y: 0, width: v[0], height: v[1], area: v[0] * v[1]};
                        g.setLayout(T), function e(t, i, n, a) {
                            var o, r;
                            if (!t.isRemoved()) {
                                var s = t.getLayout();
                                o = s.width, r = s.height;
                                var l = t.getModel(), d = l.get(TT), u = l.get(wT) / 2, c = AT(l), h = Math.max(d, c),
                                    f = d - u, g = h - u, l = t.getModel();
                                t.setLayout({
                                    borderWidth: d,
                                    upperHeight: h,
                                    upperLabelHeight: c
                                }, !0), o = vT(o - 2 * f, 0), r = vT(r - f - g, 0);
                                var p = o * r, v = bT(t, l, p, i, n, a);
                                if (v.length) {
                                    var m = {x: f, y: g, width: o, height: r}, y = mT(o, r), k = 1 / 0, T = [];
                                    T.area = 0;
                                    for (var w = 0, C = v.length; w < C;) {
                                        var S = v[w];
                                        T.push(S), T.area += S.getLayout().area;
                                        var I = _T(T, y, i.squareRatio);
                                        k = I <= k ? (w++, I) : (T.area -= T.pop().getLayout().area, DT(T, y, m, u, !1), y = mT(m.width, m.height), T.length = T.area = 0, 1 / 0)
                                    }
                                    if (T.length && DT(T, y, m, u, !0), !n) {
                                        var b = l.get("childrenVisibleMin");
                                        null != b && p < b && (n = !0)
                                    }
                                    for (var w = 0, C = v.length; w < C; w++) e(v[w], i, n, a + 1)
                                }
                            }
                        }(g, y, !1, 0), T = g.getLayout(), kT(p, function (e, t) {
                            var i = (p[t + 1] || g).getValue();
                            e.setLayout(k({dataExtent: [i, i], borderWidth: 0, upperHeight: 0}, T))
                        })
                    }
                    var w = e.getData().tree.root;
                    w.setLayout(function (e, t, i) {
                        if (t) return {x: t.x, y: t.y};
                        var n = {x: 0, y: 0};
                        if (!i) return n;
                        var a = i.node, o = a.getLayout();
                        if (!o) return n;
                        for (var r = [o.width / 2, o.height / 2], s = a; s;) {
                            var l = s.getLayout();
                            r[0] += l.x, r[1] += l.y, s = s.parentNode
                        }
                        return {x: e.width / 2 - r[0], y: e.height / 2 - r[1]}
                    }(s, f, h), !0), e.setLayoutInfo(s), function e(t, i, n, a, o) {
                        var r = t.getLayout(), s = n[o], l = s && s === t;
                        if (!(s && !l || o === n.length && t !== a)) {
                            t.setLayout({isInView: !0, invisible: !l && !i.intersect(r), isAboveViewRoot: l}, !0);
                            var d = new Di(i.x - r.x, i.y - r.y, i.width, i.height);
                            kT(t.viewChildren || [], function (t) {
                                e(t, d, n, a, o + 1)
                            })
                        }
                    }(w, new Di(-s.x, -s.y, a, o), p, g, 0)
                }
            };

        function bT(e, t, i, n, a, o) {
            var r = e.children || [], s = n.sort;
            "asc" !== s && "desc" !== s && (s = null);
            var l = null != n.leafDepth && n.leafDepth <= o;
            if (a && !l) return e.viewChildren = [];
            !function (e, t) {
                t && e.sort(function (e, i) {
                    var n = "asc" === t ? e.getValue() - i.getValue() : i.getValue() - e.getValue();
                    return 0 == n ? "asc" === t ? e.dataIndex - i.dataIndex : i.dataIndex - e.dataIndex : n
                })
            }(r = x(r, function (e) {
                return !e.isRemoved()
            }), s);
            var d = function (e, t, i) {
                for (var n = 0, a = 0, o = t.length; a < o; a++) n += t[a].getValue();
                var r = e.get("visualDimension");
                if (t && t.length) if ("value" === r && i) s = [t[t.length - 1].getValue(), t[0].getValue()], "asc" === i && s.reverse(); else {
                    var s = [1 / 0, -1 / 0];
                    kT(t, function (e) {
                        var t = e.getValue(r);
                        t < s[0] && (s[0] = t), t > s[1] && (s[1] = t)
                    })
                } else s = [NaN, NaN];
                return {sum: n, dataExtent: s}
            }(t, r, s);
            if (0 === d.sum) return e.viewChildren = [];
            if (d.sum = function (e, t, i, n, a) {
                if (!n) return i;
                for (var o = e.get("visibleMin"), r = a.length, s = r, l = r - 1; 0 <= l; l--) {
                    var d = a["asc" === n ? r - l - 1 : l].getValue();
                    d / i * t < o && (s = l, i -= d)
                }
                return "asc" === n ? a.splice(0, r - s) : a.splice(s, r - s), i
            }(t, i, d.sum, s, r), 0 === d.sum) return e.viewChildren = [];
            for (var u = 0, c = r.length; u < c; u++) {
                var h = r[u].getValue() / d.sum * i;
                r[u].setLayout({area: h})
            }
            return l && (r.length && e.setLayout({isLeafRoot: !0}, !0), r.length = 0), e.viewChildren = r, e.setLayout({dataExtent: d.dataExtent}, !0), r
        }

        function _T(e, t, i) {
            for (var n, a = 0, o = 1 / 0, r = 0, s = e.length; r < s; r++) (n = e[r].getLayout().area) && (n < o && (o = n), a < n && (a = n));
            var l = e.area * e.area, d = t * t * i;
            return l ? vT(d * a / l, l / (d * o)) : 1 / 0
        }

        function DT(e, t, i, n, a) {
            var o = t === i.width ? 0 : 1, r = 1 - o, s = ["x", "y"], l = ["width", "height"], d = i[s[o]],
                u = t ? e.area / t : 0;
            (a || u > i[l[r]]) && (u = i[l[r]]);
            for (var c = 0, h = e.length; c < h; c++) {
                var f = e[c], g = {}, p = u ? f.getLayout().area / u : 0, v = g[l[r]] = vT(u - 2 * n, 0),
                    m = i[s[o]] + i[l[o]] - d, y = c === h - 1 || m < p ? m : p, k = g[l[o]] = vT(y - 2 * n, 0);
                g[s[r]] = i[s[r]] + mT(n, v / 2), g[s[o]] = d + mT(n, k / 2), d += y, f.setLayout(g, !0)
            }
            i[s[r]] += u, i[l[r]] -= u
        }

        function AT(e) {
            return e.get(CT) ? e.get(ST) : 0
        }

        function NT(e) {
            return "_EC_" + e
        }

        function xT(e) {
            this._directed = e || !1, this.nodes = [], this.edges = [], this._nodesMap = {}, this._edgesMap = {}, this.data, this.edgeData
        }

        vf(hT), pf(IT);
        var ET = xT.prototype;

        function PT(e, t) {
            this.id = null == e ? "" : e, this.inEdges = [], this.outEdges = [], this.edges = [], this.hostGraph, this.dataIndex = null == t ? -1 : t
        }

        function OT(e, t, i) {
            this.node1 = e, this.node2 = t, this.dataIndex = null == i ? -1 : i
        }

        function MT(e, t) {
            return {
                getValue: function (i) {
                    var n = this[e][t];
                    return n.get(n.getDimension(i || "value"), this.dataIndex)
                }, setVisual: function (i, n) {
                    0 <= this.dataIndex && this[e][t].setItemVisual(this.dataIndex, i, n)
                }, getVisual: function (i, n) {
                    return this[e][t].getItemVisual(this.dataIndex, i, n)
                }, setLayout: function (i, n) {
                    0 <= this.dataIndex && this[e][t].setItemLayout(this.dataIndex, i, n)
                }, getLayout: function () {
                    return this[e][t].getItemLayout(this.dataIndex)
                }, getGraphicEl: function () {
                    return this[e][t].getItemGraphicEl(this.dataIndex)
                }, getRawIndex: function () {
                    return this[e][t].getRawIndex(this.dataIndex)
                }
            }
        }

        function FT(e, t, i, n, a) {
            for (var o = new xT(n), r = 0; r < e.length; r++) o.addNode(W(e[r].id, e[r].name, r), r);
            var s = [], l = [], d = 0;
            for (r = 0; r < t.length; r++) {
                var u = t[r], c = u.source, h = u.target;
                o.addEdge(c, h, d) && (l.push(u), s.push(W(u.id, c + " > " + h)), d++)
            }
            var f, g = i.get("coordinateSystem");
            if ("cartesian2d" === g || "polar" === g) f = rg(e, i); else {
                var p = iu.get(g), v = p && "view" !== p.type && p.dimensions || [];
                S(v, "value") < 0 && v.concat(["value"]);
                var m = eg(e, {coordDimensions: v});
                (f = new Kf(m, i)).initData(e)
            }
            var y = new Kf(["value"], i);
            return y.initData(l, s), a && a(f, y), ik({
                mainData: f,
                struct: o,
                structAttr: "graph",
                datas: {node: f, edge: y},
                datasAttr: {node: "data", edge: "edgeData"}
            }), o.update(), o
        }

        ET.type = "graph", ET.isDirected = function () {
            return this._directed
        }, ET.addNode = function (e, t) {
            e = null == e ? "" + t : "" + e;
            var i = this._nodesMap;
            if (!i[NT(e)]) {
                var n = new PT(e, t);
                return (n.hostGraph = this).nodes.push(n), i[NT(e)] = n
            }
        }, ET.getNodeByIndex = function (e) {
            var t = this.data.getRawIndex(e);
            return this.nodes[t]
        }, ET.getNodeById = function (e) {
            return this._nodesMap[NT(e)]
        }, ET.addEdge = function (e, t, i) {
            var n = this._nodesMap, a = this._edgesMap;
            if ("number" == typeof e && (e = this.nodes[e]), "number" == typeof t && (t = this.nodes[t]), PT.isInstance(e) || (e = n[NT(e)]), PT.isInstance(t) || (t = n[NT(t)]), e && t) {
                var o = e.id + "-" + t.id;
                if (!a[o]) {
                    var r = new OT(e, t, i);
                    return (r.hostGraph = this)._directed && (e.outEdges.push(r), t.inEdges.push(r)), e.edges.push(r), e !== t && t.edges.push(r), this.edges.push(r), a[o] = r
                }
            }
        }, ET.getEdgeByIndex = function (e) {
            var t = this.edgeData.getRawIndex(e);
            return this.edges[t]
        }, ET.getEdge = function (e, t) {
            PT.isInstance(e) && (e = e.id), PT.isInstance(t) && (t = t.id);
            var i = this._edgesMap;
            return this._directed ? i[e + "-" + t] : i[e + "-" + t] || i[t + "-" + e]
        }, ET.eachNode = function (e, t) {
            for (var i = this.nodes, n = i.length, a = 0; a < n; a++) 0 <= i[a].dataIndex && e.call(t, i[a], a)
        }, ET.eachEdge = function (e, t) {
            for (var i = this.edges, n = i.length, a = 0; a < n; a++) 0 <= i[a].dataIndex && 0 <= i[a].node1.dataIndex && 0 <= i[a].node2.dataIndex && e.call(t, i[a], a)
        }, ET.breadthFirstTraverse = function (e, t, i, n) {
            if (PT.isInstance(t) || (t = this._nodesMap[NT(t)]), t) {
                for (var a = "out" === i ? "outEdges" : "in" === i ? "inEdges" : "edges", o = 0; o < this.nodes.length; o++) this.nodes[o].__visited = !1;
                if (!e.call(n, t, null)) for (var r = [t]; r.length;) {
                    var s = r.shift(), l = s[a];
                    for (o = 0; o < l.length; o++) {
                        var d = l[o], u = d.node1 === s ? d.node2 : d.node1;
                        if (!u.__visited) {
                            if (e.call(n, u, s)) return;
                            r.push(u), u.__visited = !0
                        }
                    }
                }
            }
        }, ET.update = function () {
            for (var e = this.data, t = this.edgeData, i = this.nodes, n = this.edges, a = 0, o = i.length; a < o; a++) i[a].dataIndex = -1;
            for (a = 0, o = e.count(); a < o; a++) i[e.getRawIndex(a)].dataIndex = a;
            for (t.filterSelf(function (e) {
                var i = n[t.getRawIndex(e)];
                return 0 <= i.node1.dataIndex && 0 <= i.node2.dataIndex
            }), a = 0, o = n.length; a < o; a++) n[a].dataIndex = -1;
            for (a = 0, o = t.count(); a < o; a++) n[t.getRawIndex(a)].dataIndex = a
        }, ET.clone = function () {
            for (var e = new xT(this._directed), t = this.nodes, i = this.edges, n = 0; n < t.length; n++) e.addNode(t[n].id, t[n].dataIndex);
            for (n = 0; n < i.length; n++) {
                var a = i[n];
                e.addEdge(a.node1.id, a.node2.id, a.dataIndex)
            }
            return e
        }, PT.prototype = {
            constructor: PT, degree: function () {
                return this.edges.length
            }, inDegree: function () {
                return this.inEdges.length
            }, outDegree: function () {
                return this.outEdges.length
            }, getModel: function (e) {
                if (!(this.dataIndex < 0)) return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)
            }
        }, OT.prototype.getModel = function (e) {
            if (!(this.dataIndex < 0)) return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)
        }, b(PT, MT("hostGraph", "data")), b(OT, MT("hostGraph", "edgeData")), xT.Node = PT, xT.Edge = OT, Qa(PT), Qa(OT);
        var LT = wf({
            type: "series.graph",
            init: function (e) {
                LT.superApply(this, "init", arguments);
                var t = this;

                function i() {
                    return t._categoriesData
                }

                this.legendVisualProvider = new Fm(i, i), this.fillDataTextStyle(e.edges || e.links), this._updateCategoriesData()
            },
            mergeOption: function (e) {
                LT.superApply(this, "mergeOption", arguments), this.fillDataTextStyle(e.edges || e.links), this._updateCategoriesData()
            },
            mergeDefaultAndTheme: function (e) {
                LT.superApply(this, "mergeDefaultAndTheme", arguments), Oa(e, ["edgeLabel"], ["show"])
            },
            getInitialData: function (e, t) {
                var i = e.edges || e.links || [], n = e.data || e.nodes || [], a = this;
                if (n && i) return FT(n, i, this, !0, function (e, i) {
                    e.wrapMethod("getItemModel", function (e) {
                        var t = a._categoriesModels[e.getShallow("category")];
                        return t && (t.parentModel = e.parentModel, e.parentModel = t), e
                    });
                    var n = a.getModel("edgeLabel"), o = new Sl({label: n.option}, n.parentModel, t),
                        r = a.getModel("emphasis.edgeLabel"),
                        s = new Sl({emphasis: {label: r.option}}, r.parentModel, t);

                    function l(e) {
                        return (e = this.parsePath(e)) && "label" === e[0] ? o : e && "emphasis" === e[0] && "label" === e[1] ? s : this.parentModel
                    }

                    i.wrapMethod("getItemModel", function (e) {
                        return e.customizeGetParent(l), e
                    })
                }).data
            },
            getGraph: function () {
                return this.getData().graph
            },
            getEdgeData: function () {
                return this.getGraph().edgeData
            },
            getCategoriesData: function () {
                return this._categoriesData
            },
            formatTooltip: function (e, t, i) {
                if ("edge" !== i) return LT.superApply(this, "formatTooltip", arguments);
                var n = this.getData(), a = this.getDataParams(e, i), o = n.graph.getEdgeByIndex(e),
                    r = n.getName(o.node1.dataIndex), s = n.getName(o.node2.dataIndex), l = [];
                return null != r && l.push(r), null != s && l.push(s), l = Ql(l.join(" > ")), a.value && (l += " : " + Ql(a.value)), l
            },
            _updateCategoriesData: function () {
                var e = A(this.option.categories || [], function (e) {
                    return null != e.value ? e : k({value: 0}, e)
                }), t = new Kf(["value"], this);
                t.initData(e), this._categoriesData = t, this._categoriesModels = t.mapArray(function (e) {
                    return t.getItemModel(e, !0)
                })
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            },
            isAnimationEnabled: function () {
                return LT.superCall(this, "isAnimationEnabled") && !("force" === this.get("layout") && this.get("force.layoutAnimation"))
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "view",
                legendHoverLink: !0,
                hoverAnimation: !0,
                layout: null,
                focusNodeAdjacency: !1,
                circular: {rotateLabel: !1},
                force: {
                    initLayout: null,
                    repulsion: [0, 50],
                    gravity: .1,
                    friction: .6,
                    edgeLength: 30,
                    layoutAnimation: !0
                },
                left: "center",
                top: "center",
                symbol: "circle",
                symbolSize: 10,
                edgeSymbol: ["none", "none"],
                edgeSymbolSize: 10,
                edgeLabel: {position: "middle", distance: 5},
                draggable: !1,
                roam: !1,
                center: null,
                zoom: 1,
                nodeScaleRatio: .6,
                label: {show: !1, formatter: "{b}"},
                itemStyle: {},
                lineStyle: {color: "#aaa", width: 1, curveness: 0, opacity: .5},
                emphasis: {label: {show: !0}}
            }
        }), RT = is.prototype, BT = rs.prototype;

        function UT(e) {
            return isNaN(+e.cpx1) || isNaN(+e.cpy1)
        }

        var KT = Ss({
            type: "ec-line",
            style: {stroke: "#000", fill: null},
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, percent: 1, cpx1: null, cpy1: null},
            buildPath: function (e, t) {
                this[UT(t) ? "_buildPathLine" : "_buildPathCurve"](e, t)
            },
            _buildPathLine: RT.buildPath,
            _buildPathCurve: BT.buildPath,
            pointAt: function (e) {
                return this[UT(this.shape) ? "_pointAtLine" : "_pointAtCurve"](e)
            },
            _pointAtLine: RT.pointAt,
            _pointAtCurve: BT.pointAt,
            tangentAt: function (e) {
                var t = this.shape, i = UT(t) ? [t.x2 - t.x1, t.y2 - t.y1] : this._tangentAtCurve(e);
                return ve(i, i)
            },
            _tangentAtCurve: BT.tangentAt
        }), VT = ["fromSymbol", "toSymbol"];

        function WT(e) {
            return "_" + e + "Type"
        }

        function GT(e, t, i) {
            var n = t.getItemVisual(i, "color"), a = t.getItemVisual(i, e), o = t.getItemVisual(i, e + "Size");
            if (a && "none" !== a) {
                M(o) || (o = [o, o]);
                var r = cp(a, -o[0] / 2, -o[1] / 2, o[0], o[1], n);
                return r.name = e, r
            }
        }

        function HT(e, t) {
            e.x1 = t[0][0], e.y1 = t[0][1], e.x2 = t[1][0], e.y2 = t[1][1], e.percent = 1;
            var i = t[2];
            i ? (e.cpx1 = i[0], e.cpy1 = i[1]) : (e.cpx1 = NaN, e.cpy1 = NaN)
        }

        function zT(e, t, i) {
            Ai.call(this), this._createLine(e, t, i)
        }

        var jT = zT.prototype;

        function XT(e) {
            this._ctor = e || zT, this.group = new Ai
        }

        jT.beforeUpdate = function () {
            var e = this.childOfName("fromSymbol"), t = this.childOfName("toSymbol"), i = this.childOfName("label");
            if (e || t || !i.ignore) {
                for (var n = 1, a = this.parent; a;) a.scale && (n /= a.scale[0]), a = a.parent;
                var o = this.childOfName("line");
                if (this.__dirty || o.__dirty) {
                    var r = o.shape.percent, s = o.pointAt(0), l = o.pointAt(r), d = ue([], l, s);
                    if (ve(d, d), e) {
                        e.attr("position", s);
                        var u = o.tangentAt(0);
                        e.attr("rotation", Math.PI / 2 - Math.atan2(u[1], u[0])), e.attr("scale", [n * r, n * r])
                    }
                    if (t && (t.attr("position", l), u = o.tangentAt(1), t.attr("rotation", -Math.PI / 2 - Math.atan2(u[1], u[0])), t.attr("scale", [n * r, n * r])), !i.ignore) {
                        var c, h, f, g;
                        i.attr("position", l);
                        var p = i.__labelDistance, v = p[0] * n, m = p[1] * n, y = r / 2,
                            k = [(u = o.tangentAt(y))[1], -u[0]], T = o.pointAt(y);
                        0 < k[1] && (k[0] = -k[0], k[1] = -k[1]);
                        var w, C = u[0] < 0 ? -1 : 1;
                        if ("start" !== i.__position && "end" !== i.__position) {
                            var S = -Math.atan2(u[1], u[0]);
                            l[0] < s[0] && (S = Math.PI + S), i.attr("rotation", S)
                        }
                        switch (i.__position) {
                            case"insideStartTop":
                            case"insideMiddleTop":
                            case"insideEndTop":
                            case"middle":
                                w = -m, f = "bottom";
                                break;
                            case"insideStartBottom":
                            case"insideMiddleBottom":
                            case"insideEndBottom":
                                w = m, f = "top";
                                break;
                            default:
                                w = 0, f = "middle"
                        }
                        switch (i.__position) {
                            case"end":
                                c = [d[0] * v + l[0], d[1] * m + l[1]], h = .8 < d[0] ? "left" : d[0] < -.8 ? "right" : "center", f = .8 < d[1] ? "top" : d[1] < -.8 ? "bottom" : "middle";
                                break;
                            case"start":
                                c = [-d[0] * v + s[0], -d[1] * m + s[1]], h = .8 < d[0] ? "right" : d[0] < -.8 ? "left" : "center", f = .8 < d[1] ? "bottom" : d[1] < -.8 ? "top" : "middle";
                                break;
                            case"insideStartTop":
                            case"insideStart":
                            case"insideStartBottom":
                                c = [v * C + s[0], s[1] + w], h = u[0] < 0 ? "right" : "left", g = [-v * C, -w];
                                break;
                            case"insideMiddleTop":
                            case"insideMiddle":
                            case"insideMiddleBottom":
                            case"middle":
                                c = [T[0], T[1] + w], h = "center", g = [0, -w];
                                break;
                            case"insideEndTop":
                            case"insideEnd":
                            case"insideEndBottom":
                                c = [-v * C + l[0], l[1] + w], h = 0 <= u[0] ? "right" : "left", g = [v * C, -w]
                        }
                        i.attr({
                            style: {textVerticalAlign: i.__verticalAlign || f, textAlign: i.__textAlign || h},
                            position: c,
                            scale: [n, n],
                            origin: g
                        })
                    }
                }
            }
        }, jT._createLine = function (e, t, i) {
            var n = e.hostModel, a = function (e) {
                var t = new KT({name: "line", subPixelOptimize: !0});
                return HT(t.shape, e), t
            }(e.getItemLayout(t));
            a.shape.percent = 0, rl(a, {shape: {percent: 1}}, n, t), this.add(a);
            var o = new Ur({name: "label", lineLabelOriginalOpacity: 1});
            this.add(o), D(VT, function (i) {
                var n = GT(i, e, t);
                this.add(n), this[WT(i)] = e.getItemVisual(t, i)
            }, this), this._updateCommonStl(e, t, i)
        }, jT.updateData = function (e, t, i) {
            var n = e.hostModel, a = this.childOfName("line"), o = e.getItemLayout(t), r = {shape: {}};
            HT(r.shape, o), ol(a, r, n, t), D(VT, function (i) {
                var n = e.getItemVisual(t, i), a = WT(i);
                if (this[a] !== n) {
                    this.remove(this.childOfName(i));
                    var o = GT(i, e, t);
                    this.add(o)
                }
                this[a] = n
            }, this), this._updateCommonStl(e, t, i)
        }, jT._updateCommonStl = function (e, t, i) {
            var n = e.hostModel, a = this.childOfName("line"), o = i && i.lineStyle, r = i && i.hoverLineStyle,
                s = i && i.labelModel, l = i && i.hoverLabelModel;
            if (!i || e.hasItemOption) {
                var d = e.getItemModel(t);
                o = d.getModel("lineStyle").getLineStyle(), r = d.getModel("emphasis.lineStyle").getLineStyle(), s = d.getModel("label"), l = d.getModel("emphasis.label")
            }
            var u = e.getItemVisual(t, "color"), c = H(e.getItemVisual(t, "opacity"), o.opacity, 1);
            a.useStyle(T({
                strokeNoScale: !0,
                fill: "none",
                stroke: u,
                opacity: c
            }, o)), a.hoverStyle = r, D(VT, function (e) {
                var t = this.childOfName(e);
                t && (t.setColor(u), t.setStyle({opacity: c}))
            }, this);
            var h, f, g = s.getShallow("show"), p = l.getShallow("show"), v = this.childOfName("label");
            if ((g || p) && (h = u || "#000", null == (f = n.getFormattedLabel(t, "normal", e.dataType)))) {
                var m = n.getRawValue(t);
                f = null == m ? e.getName(t) : isFinite(m) ? El(m) : m
            }
            var y = g ? f : null, k = p ? G(n.getFormattedLabel(t, "emphasis", e.dataType), f) : null, w = v.style;
            if (null != y || null != k) {
                Js(v.style, s, {text: y}, {autoColor: h}), v.__textAlign = w.textAlign, v.__verticalAlign = w.textVerticalAlign, v.__position = s.get("position") || "middle";
                var C = s.get("distance");
                M(C) || (C = [C, C]), v.__labelDistance = C
            }
            v.hoverStyle = null != k ? {
                text: k,
                textFill: l.getTextColor(!0),
                fontStyle: l.getShallow("fontStyle"),
                fontWeight: l.getShallow("fontWeight"),
                fontSize: l.getShallow("fontSize"),
                fontFamily: l.getShallow("fontFamily")
            } : {text: null}, v.ignore = !g && !p, zs(this)
        }, jT.highlight = function () {
            this.trigger("emphasis")
        }, jT.downplay = function () {
            this.trigger("normal")
        }, jT.updateLayout = function (e, t) {
            this.setLinePoints(e.getItemLayout(t))
        }, jT.setLinePoints = function (e) {
            var t = this.childOfName("line");
            HT(t.shape, e), t.dirty()
        }, I(zT, Ai);
        var $T = XT.prototype;

        function YT(e) {
            var t = e.hostModel;
            return {
                lineStyle: t.getModel("lineStyle").getLineStyle(),
                hoverLineStyle: t.getModel("emphasis.lineStyle").getLineStyle(),
                labelModel: t.getModel("label"),
                hoverLabelModel: t.getModel("emphasis.label")
            }
        }

        function qT(e) {
            return isNaN(e[0]) || isNaN(e[1])
        }

        function JT(e) {
            return !qT(e[0]) && !qT(e[1])
        }

        function ZT(e) {
            var t = e.coordinateSystem;
            if ("view" !== t.type) return 1;
            var i = e.option.nodeScaleRatio, n = t.scale, a = n && n[0] || 1;
            return ((t.getZoom() - 1) * i + 1) / a
        }

        function QT(e) {
            var t = e.getVisual("symbolSize");
            return t instanceof Array && (t = (t[0] + t[1]) / 2), +t
        }

        $T.isPersistent = function () {
            return !0
        }, $T.updateData = function (e) {
            var t = this, i = t.group, n = t._lineData;
            t._lineData = e, n || i.removeAll();
            var a = YT(e);
            e.diff(n).add(function (i) {
                !function (e, t, i, n) {
                    if (JT(t.getItemLayout(i))) {
                        var a = new e._ctor(t, i, n);
                        t.setItemGraphicEl(i, a), e.group.add(a)
                    }
                }(t, e, i, a)
            }).update(function (i, o) {
                !function (e, t, i, n, a, o) {
                    var r = t.getItemGraphicEl(n);
                    if (!JT(i.getItemLayout(a))) return e.group.remove(r);
                    r ? r.updateData(i, a, o) : r = new e._ctor(i, a, o), i.setItemGraphicEl(a, r), e.group.add(r)
                }(t, n, e, o, i, a)
            }).remove(function (e) {
                i.remove(n.getItemGraphicEl(e))
            }).execute()
        }, $T.updateLayout = function () {
            var e = this._lineData;
            e && e.eachItemGraphicEl(function (t, i) {
                t.updateLayout(e, i)
            }, this)
        }, $T.incrementalPrepareUpdate = function (e) {
            this._seriesScope = YT(e), this._lineData = null, this.group.removeAll()
        }, $T.incrementalUpdate = function (e, t) {
            function i(e) {
                e.isGroup || function (e) {
                    return e.animators && 0 < e.animators.length
                }(e) || (e.incremental = e.useHoverLayer = !0)
            }

            for (var n = e.start; n < e.end; n++) if (JT(t.getItemLayout(n))) {
                var a = new this._ctor(t, n, this._seriesScope);
                a.traverse(i), this.group.add(a), t.setItemGraphicEl(n, a)
            }
        }, $T.remove = function () {
            this._clearIncremental(), this._incremental = null, this.group.removeAll()
        }, $T._clearIncremental = function () {
            var e = this._incremental;
            e && e.clearDisplaybles()
        };
        var ew = [], tw = [], iw = [], nw = Io, aw = Te, ow = Math.abs;

        function rw(e, t, i) {
            for (var n, a = e[0], o = e[1], r = e[2], s = 1 / 0, l = i * i, d = .1, u = .1; u <= .9; u += .1) ew[0] = nw(a[0], o[0], r[0], u), ew[1] = nw(a[1], o[1], r[1], u), (f = ow(aw(ew, t) - l)) < s && (s = f, n = u);
            for (var c = 0; c < 32; c++) {
                var h = n + d;
                tw[0] = nw(a[0], o[0], r[0], n), tw[1] = nw(a[1], o[1], r[1], n), iw[0] = nw(a[0], o[0], r[0], h), iw[1] = nw(a[1], o[1], r[1], h);
                var f = aw(tw, t) - l;
                if (ow(f) < .01) break;
                var g = aw(iw, t) - l;
                d /= 2, f < 0 ? 0 <= g ? n += d : n -= d : 0 <= g ? n -= d : n += d
            }
            return n
        }

        function sw(e, t) {
            var i = [], n = Do, a = [[], [], []], o = [[], []], r = [];
            t /= 2, e.eachEdge(function (e, s) {
                var l = e.getLayout(), d = e.getVisual("fromSymbol"), u = e.getVisual("toSymbol");
                l.__original || (l.__original = [re(l[0]), re(l[1])], l[2] && l.__original.push(re(l[2])));
                var c = l.__original;
                if (null != l[2]) {
                    if (oe(a[0], c[0]), oe(a[1], c[2]), oe(a[2], c[1]), d && "none" !== d) {
                        var h = QT(e.node1), f = rw(a, c[0], h * t);
                        n(a[0][0], a[1][0], a[2][0], f, i), a[0][0] = i[3], a[1][0] = i[4], n(a[0][1], a[1][1], a[2][1], f, i), a[0][1] = i[3], a[1][1] = i[4]
                    }
                    u && "none" !== u && (h = QT(e.node2), f = rw(a, c[1], h * t), n(a[0][0], a[1][0], a[2][0], f, i), a[1][0] = i[1], a[2][0] = i[2], n(a[0][1], a[1][1], a[2][1], f, i), a[1][1] = i[1], a[2][1] = i[2]), oe(l[0], a[0]), oe(l[1], a[2]), oe(l[2], a[1])
                } else oe(o[0], c[0]), oe(o[1], c[1]), ue(r, o[1], o[0]), ve(r, r), d && "none" !== d && (h = QT(e.node1), de(o[0], o[0], r, h * t)), u && "none" !== u && (h = QT(e.node2), de(o[1], o[1], r, -h * t)), oe(l[0], o[0]), oe(l[1], o[1])
            })
        }

        var lw = "__focusNodeAdjacency", dw = "__unfocusNodeAdjacency", uw = ["itemStyle", "opacity"],
            cw = ["lineStyle", "opacity"];

        function hw(e, t) {
            var i = e.getVisual("opacity");
            return null != i ? i : e.getModel().get(t)
        }

        function fw(e, t, i) {
            var n = e.getGraphicEl(), a = hw(e, t);
            null != i && (null == a && (a = 1), a *= i), n.downplay && n.downplay(), n.traverse(function (e) {
                if (!e.isGroup) {
                    var t = e.lineLabelOriginalOpacity;
                    null != t && null == i || (t = a), e.setStyle("opacity", t)
                }
            })
        }

        function gw(e, t) {
            var i = hw(e, t), n = e.getGraphicEl();
            n.traverse(function (e) {
                e.isGroup || e.setStyle("opacity", i)
            }), n.highlight && n.highlight()
        }

        function pw(e) {
            return e instanceof Array || (e = [e, e]), e
        }

        function vw(e) {
            var t = e.coordinateSystem;
            if (!t || "view" === t.type) {
                var i = e.getGraph();
                i.eachNode(function (e) {
                    var t = e.getModel();
                    e.setLayout([+t.get("x"), +t.get("y")])
                }), mw(i)
            }
        }

        function mw(e) {
            e.eachEdge(function (e) {
                var t = e.getModel().get("lineStyle.curveness") || 0, i = re(e.node1.getLayout()),
                    n = re(e.node2.getLayout()), a = [i, n];
                +t && a.push([(i[0] + n[0]) / 2 - (i[1] - n[1]) * t, (i[1] + n[1]) / 2 - (n[0] - i[0]) * t]), e.setLayout(a)
            })
        }

        Cf({
            type: "graph", init: function (e, t) {
                var i = new Hp, n = new XT, a = this.group;
                this._controller = new Sy(t.getZr()), this._controllerHost = {target: a}, a.add(i.group), a.add(n.group), this._symbolDraw = i, this._lineDraw = n, this._firstRender = !0
            }, render: function (e, t, i) {
                var n = this, a = e.coordinateSystem;
                this._model = e;
                var o = this._symbolDraw, r = this._lineDraw, s = this.group;
                if ("view" === a.type) {
                    var l = {position: a.position, scale: a.scale};
                    this._firstRender ? s.attr(l) : ol(s, l, e)
                }
                sw(e.getGraph(), ZT(e));
                var d = e.getData();
                o.updateData(d);
                var u = e.getEdgeData();
                r.updateData(u), this._updateNodeAndLinkScale(), this._updateController(e, t, i), clearTimeout(this._layoutTimeout);
                var c = e.forceLayout, h = e.get("force.layoutAnimation");
                c && this._startForceLayoutIteration(c, h), d.eachItemGraphicEl(function (t, a) {
                    var o = d.getItemModel(a);
                    t.off("drag").off("dragend");
                    var r = o.get("draggable");
                    r && t.on("drag", function () {
                        c && (c.warmUp(), this._layouting || this._startForceLayoutIteration(c, h), c.setFixed(a), d.setItemLayout(a, t.position))
                    }, this).on("dragend", function () {
                        c && c.setUnfixed(a)
                    }, this), t.setDraggable(r && c), t[lw] && t.off("mouseover", t[lw]), t[dw] && t.off("mouseout", t[dw]), o.get("focusNodeAdjacency") && (t.on("mouseover", t[lw] = function () {
                        n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            dataIndex: t.dataIndex
                        })
                    }), t.on("mouseout", t[dw] = function () {
                        n._dispatchUnfocus(i)
                    }))
                }, this), d.graph.eachEdge(function (t) {
                    var a = t.getGraphicEl();
                    a[lw] && a.off("mouseover", a[lw]), a[dw] && a.off("mouseout", a[dw]), t.getModel().get("focusNodeAdjacency") && (a.on("mouseover", a[lw] = function () {
                        n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            edgeDataIndex: t.dataIndex
                        })
                    }), a.on("mouseout", a[dw] = function () {
                        n._dispatchUnfocus(i)
                    }))
                });
                var f = "circular" === e.get("layout") && e.get("circular.rotateLabel"), g = d.getLayout("cx"),
                    p = d.getLayout("cy");
                d.eachItemGraphicEl(function (e, t) {
                    var i = d.getItemModel(t).get("label.rotate") || 0, n = e.getSymbolPath();
                    if (f) {
                        var a = d.getItemLayout(t), o = Math.atan2(a[1] - p, a[0] - g);
                        o < 0 && (o = 2 * Math.PI + o);
                        var r = a[0] < g;
                        r && (o -= Math.PI);
                        var s = r ? "left" : "right";
                        qs(n, {textRotation: -o, textPosition: s, textOrigin: "center"}, {textPosition: s})
                    } else qs(n, {textRotation: i *= Math.PI / 180})
                }), this._firstRender = !1
            }, dispose: function () {
                this._controller && this._controller.dispose(), this._controllerHost = {}, this._clearTimer()
            }, _dispatchUnfocus: function (e, t) {
                var i = this;
                this._clearTimer(), this._unfocusDelayTimer = setTimeout(function () {
                    i._unfocusDelayTimer = null, e.dispatchAction({type: "unfocusNodeAdjacency", seriesId: i._model.id})
                }, 500)
            }, _clearTimer: function () {
                this._unfocusDelayTimer && (clearTimeout(this._unfocusDelayTimer), this._unfocusDelayTimer = null)
            }, focusNodeAdjacency: function (e, t, i, n) {
                var a = e.getData().graph, o = n.dataIndex, r = n.edgeDataIndex, s = a.getNodeByIndex(o),
                    l = a.getEdgeByIndex(r);
                (s || l) && (a.eachNode(function (e) {
                    fw(e, uw, .1)
                }), a.eachEdge(function (e) {
                    fw(e, cw, .1)
                }), s && (gw(s, uw), D(s.edges, function (e) {
                    e.dataIndex < 0 || (gw(e, cw), gw(e.node1, uw), gw(e.node2, uw))
                })), l && (gw(l, cw), gw(l.node1, uw), gw(l.node2, uw)))
            }, unfocusNodeAdjacency: function (e, t, i, n) {
                var a = e.getData().graph;
                a.eachNode(function (e) {
                    fw(e, uw)
                }), a.eachEdge(function (e) {
                    fw(e, cw)
                })
            }, _startForceLayoutIteration: function (e, t) {
                var i = this;
                !function n() {
                    e.step(function (e) {
                        i.updateLayout(i._model), (i._layouting = !e) && (t ? i._layoutTimeout = setTimeout(n, 16) : n())
                    })
                }()
            }, _updateController: function (e, t, i) {
                var n = this._controller, a = this._controllerHost, o = this.group;
                n.setPointerChecker(function (t, n, a) {
                    var r = o.getBoundingRect();
                    return r.applyTransform(o.transform), r.contain(n, a) && !Fy(t, i, e)
                }), "view" === e.coordinateSystem.type ? (n.enable(e.get("roam")), a.zoomLimit = e.get("scaleLimit"), a.zoom = e.coordinateSystem.getZoom(), n.off("pan").off("zoom").on("pan", function (t) {
                    Py(a, t.dx, t.dy), i.dispatchAction({seriesId: e.id, type: "graphRoam", dx: t.dx, dy: t.dy})
                }).on("zoom", function (t) {
                    Oy(a, t.scale, t.originX, t.originY), i.dispatchAction({
                        seriesId: e.id,
                        type: "graphRoam",
                        zoom: t.scale,
                        originX: t.originX,
                        originY: t.originY
                    }), this._updateNodeAndLinkScale(), sw(e.getGraph(), ZT(e)), this._lineDraw.updateLayout()
                }, this)) : n.disable()
            }, _updateNodeAndLinkScale: function () {
                var e = this._model, t = e.getData(), i = ZT(e), n = [i, i];
                t.eachItemGraphicEl(function (e, t) {
                    e.attr("scale", n)
                })
            }, updateLayout: function (e) {
                sw(e.getGraph(), ZT(e)), this._symbolDraw.updateLayout(), this._lineDraw.updateLayout()
            }, remove: function (e, t) {
                this._symbolDraw && this._symbolDraw.remove(), this._lineDraw && this._lineDraw.remove()
            }
        }), ff({
            type: "focusNodeAdjacency",
            event: "focusNodeAdjacency",
            update: "series:focusNodeAdjacency"
        }, function () {
        }), ff({
            type: "unfocusNodeAdjacency",
            event: "unfocusNodeAdjacency",
            update: "series:unfocusNodeAdjacency"
        }, function () {
        }), ff({type: "graphRoam", event: "graphRoam", update: "none"}, function (e, t) {
            t.eachComponent({mainType: "series", query: e}, function (t) {
                var i = Gy(t.coordinateSystem, e);
                t.setCenter && t.setCenter(i.center), t.setZoom && t.setZoom(i.zoom)
            })
        });
        var yw = Math.PI, kw = [];

        function Tw(e, t) {
            var i = e.coordinateSystem;
            if (!i || "view" === i.type) {
                var n = i.getBoundingRect(), a = e.getData(), o = a.graph, r = n.width / 2 + n.x,
                    s = n.height / 2 + n.y, l = Math.min(n.width, n.height) / 2, d = a.count();
                a.setLayout({cx: r, cy: s}), d && (ww[t](e, i, o, a, l, r, s, d), o.eachEdge(function (e) {
                    var t, i = e.getModel().get("lineStyle.curveness") || 0, n = re(e.node1.getLayout()),
                        a = re(e.node2.getLayout()), o = (n[0] + a[0]) / 2, l = (n[1] + a[1]) / 2;
                    +i && (t = [r * (i *= 3) + o * (1 - i), s * i + l * (1 - i)]), e.setLayout([n, a, t])
                }))
            }
        }

        var ww = {
            value: function (e, t, i, n, a, o, r, s) {
                var l = 0, d = n.getSum("value"), u = 2 * Math.PI / (d || s);
                i.eachNode(function (e) {
                    var t = e.getValue("value"), i = u * (d ? t : 1) / 2;
                    l += i, e.setLayout([a * Math.cos(l) + o, a * Math.sin(l) + r]), l += i
                })
            }, symbolSize: function (e, t, i, n, a, o, r, s) {
                var l = 0;
                kw.length = s;
                var d = ZT(e);
                i.eachNode(function (e) {
                    var t = QT(e);
                    isNaN(t) && (t = 2), t < 0 && (t = 0), t *= d;
                    var i = Math.asin(t / 2 / a);
                    isNaN(i) && (i = yw / 2), kw[e.dataIndex] = i, l += 2 * i
                });
                var u = (2 * yw - l) / s / 2, c = 0;
                i.eachNode(function (e) {
                    var t = u + kw[e.dataIndex];
                    c += t, e.setLayout([a * Math.cos(c) + o, a * Math.sin(c) + r]), c += t
                })
            }
        }, Cw = de;
        hf(function (e) {
            var t = e.findComponents({mainType: "legend"});
            t && t.length && e.eachSeriesByType("graph", function (e) {
                var i = e.getCategoriesData(), n = e.getGraph().data, a = i.mapArray(i.getName);
                n.filterSelf(function (e) {
                    var i = n.getItemModel(e).getShallow("category");
                    if (null != i) {
                        "number" == typeof i && (i = a[i]);
                        for (var o = 0; o < t.length; o++) if (!t[o].isSelected(i)) return !1
                    }
                    return !0
                })
            }, this)
        }), vf(mv("graph", "circle", null)), vf(function (e) {
            var t = {};
            e.eachSeriesByType("graph", function (e) {
                var i = e.getCategoriesData(), n = e.getData(), a = {};
                i.each(function (n) {
                    var o = i.getName(n);
                    a["ec-" + o] = n;
                    var r = i.getItemModel(n), s = r.get("itemStyle.color") || e.getColorFromPalette(o, t);
                    i.setItemVisual(n, "color", s);
                    for (var l = ["opacity", "symbol", "symbolSize", "symbolKeepAspect"], d = 0; d < l.length; d++) {
                        var u = r.getShallow(l[d], !0);
                        null != u && i.setItemVisual(n, l[d], u)
                    }
                }), i.count() && n.each(function (e) {
                    var t = n.getItemModel(e).getShallow("category");
                    if (null != t) {
                        "string" == typeof t && (t = a["ec-" + t]);
                        for (var o = ["color", "opacity", "symbol", "symbolSize", "symbolKeepAspect"], r = 0; r < o.length; r++) null == n.getItemVisual(e, o[r], !0) && n.setItemVisual(e, o[r], i.getItemVisual(t, o[r]))
                    }
                })
            })
        }), vf(function (e) {
            e.eachSeriesByType("graph", function (e) {
                var t = e.getGraph(), i = e.getEdgeData(), n = pw(e.get("edgeSymbol")), a = pw(e.get("edgeSymbolSize")),
                    o = "lineStyle.color".split("."), r = "lineStyle.opacity".split(".");
                i.setVisual("fromSymbol", n && n[0]), i.setVisual("toSymbol", n && n[1]), i.setVisual("fromSymbolSize", a && a[0]), i.setVisual("toSymbolSize", a && a[1]), i.setVisual("color", e.get(o)), i.setVisual("opacity", e.get(r)), i.each(function (e) {
                    var n = i.getItemModel(e), a = t.getEdgeByIndex(e), s = pw(n.getShallow("symbol", !0)),
                        l = pw(n.getShallow("symbolSize", !0)), d = n.get(o), u = n.get(r);
                    switch (d) {
                        case"source":
                            d = a.node1.getVisual("color");
                            break;
                        case"target":
                            d = a.node2.getVisual("color")
                    }
                    s[0] && a.setVisual("fromSymbol", s[0]), s[1] && a.setVisual("toSymbol", s[1]), l[0] && a.setVisual("fromSymbolSize", l[0]), l[1] && a.setVisual("toSymbolSize", l[1]), a.setVisual("color", d), a.setVisual("opacity", u)
                })
            })
        }), pf(function (e, t) {
            e.eachSeriesByType("graph", function (e) {
                var t = e.get("layout"), i = e.coordinateSystem;
                if (i && "view" !== i.type) {
                    var n = e.getData(), a = [];
                    D(i.dimensions, function (e) {
                        a = a.concat(n.mapDimension(e, !0))
                    });
                    for (var o = 0; o < n.count(); o++) {
                        for (var r = [], s = !1, l = 0; l < a.length; l++) {
                            var d = n.get(a[l], o);
                            isNaN(d) || (s = !0), r.push(d)
                        }
                        s ? n.setItemLayout(o, i.dataToPoint(r)) : n.setItemLayout(o, [NaN, NaN])
                    }
                    mw(n.graph)
                } else t && "none" !== t || vw(e)
            })
        }), pf(Sh.VISUAL.POST_CHART_LAYOUT, function (e) {
            e.eachSeriesByType("graph", function (e) {
                "circular" === e.get("layout") && Tw(e, "symbolSize")
            })
        }), pf(function (e) {
            e.eachSeriesByType("graph", function (e) {
                if (!(c = e.coordinateSystem) || "view" === c.type) if ("force" === e.get("layout")) {
                    var t = e.preservedPoints || {}, i = e.getGraph(), n = i.data, a = i.edgeData,
                        o = e.getModel("force"), r = o.get("initLayout");
                    e.preservedPoints ? n.each(function (e) {
                        var i = n.getId(e);
                        n.setItemLayout(e, t[i] || [NaN, NaN])
                    }) : r && "none" !== r ? "circular" === r && Tw(e, "value") : vw(e);
                    var s = n.getDataExtent("value"), l = a.getDataExtent("value"), d = o.get("repulsion"),
                        u = o.get("edgeLength");
                    M(d) || (d = [d, d]), M(u) || (u = [u, u]), u = [u[1], u[0]];
                    var c, h = n.mapArray("value", function (e, t) {
                        var i = n.getItemLayout(t), a = Nl(e, s, d);
                        return isNaN(a) && (a = (d[0] + d[1]) / 2), {
                            w: a,
                            rep: a,
                            fixed: n.getItemModel(t).get("fixed"),
                            p: !i || isNaN(i[0]) || isNaN(i[1]) ? null : i
                        }
                    }), f = a.mapArray("value", function (e, t) {
                        var n = i.getEdgeByIndex(t), a = Nl(e, l, u);
                        isNaN(a) && (a = (u[0] + u[1]) / 2);
                        var o = n.getModel();
                        return {
                            n1: h[n.node1.dataIndex],
                            n2: h[n.node2.dataIndex],
                            d: a,
                            curveness: o.get("lineStyle.curveness") || 0,
                            ignoreForceLayout: o.get("ignoreForceLayout")
                        }
                    }), g = (c = e.coordinateSystem).getBoundingRect(), p = function (e, t, i) {
                        for (var n = i.rect, a = n.width, o = n.height, r = [n.x + a / 2, n.y + o / 2], s = null == i.gravity ? .1 : i.gravity, l = 0; l < e.length; l++) {
                            var d = e[l];
                            d.p || (d.p = ae(a * (Math.random() - .5) + r[0], o * (Math.random() - .5) + r[1])), d.pp = re(d.p), d.edges = null
                        }
                        var u = null == i.friction ? .6 : i.friction, c = u;
                        return {
                            warmUp: function () {
                                c = .8 * u
                            }, setFixed: function (t) {
                                e[t].fixed = !0
                            }, setUnfixed: function (t) {
                                e[t].fixed = !1
                            }, step: function (i) {
                                for (var n = [], a = e.length, o = 0; o < t.length; o++) {
                                    var l = t[o];
                                    if (!l.ignoreForceLayout) {
                                        var d = l.n1;
                                        ue(n, (g = l.n2).p, d.p);
                                        var u = ce(n) - l.d, h = g.w / (d.w + g.w);
                                        isNaN(h) && (h = 0), ve(n, n), d.fixed || Cw(d.p, d.p, n, h * u * c), g.fixed || Cw(g.p, g.p, n, -(1 - h) * u * c)
                                    }
                                }
                                for (o = 0; o < a; o++) (m = e[o]).fixed || (ue(n, r, m.p), Cw(m.p, m.p, n, s * c));
                                for (o = 0; o < a; o++) {
                                    d = e[o];
                                    for (var f = o + 1; f < a; f++) {
                                        var g;
                                        ue(n, (g = e[f]).p, d.p), 0 === (u = ce(n)) && (se(n, Math.random() - .5, Math.random() - .5), u = 1);
                                        var p = (d.rep + g.rep) / u / u;
                                        d.fixed || Cw(d.pp, d.pp, n, p), g.fixed || Cw(g.pp, g.pp, n, -p)
                                    }
                                }
                                var v = [];
                                for (o = 0; o < a; o++) {
                                    var m;
                                    (m = e[o]).fixed || (ue(v, m.p, m.pp), Cw(m.p, m.p, v, c), oe(m.pp, m.p))
                                }
                                c *= .992, i && i(e, t, c < .01)
                            }
                        }
                    }(h, f, {rect: g, gravity: o.get("gravity"), friction: o.get("friction")}), v = p.step;
                    p.step = function (e) {
                        for (var a = 0, o = h.length; a < o; a++) h[a].fixed && oe(h[a].p, i.getNodeByIndex(a).getLayout());
                        v(function (a, o, r) {
                            for (var s = 0, l = a.length; s < l; s++) a[s].fixed || i.getNodeByIndex(s).setLayout(a[s].p), t[n.getId(s)] = a[s].p;
                            for (s = 0, l = o.length; s < l; s++) {
                                var d = o[s], u = i.getEdgeByIndex(s), c = d.n1.p, h = d.n2.p, f = u.getLayout();
                                (f = f ? f.slice() : [])[0] = f[0] || [], f[1] = f[1] || [], oe(f[0], c), oe(f[1], h), +d.curveness && (f[2] = [(c[0] + h[0]) / 2 - (c[1] - h[1]) * d.curveness, (c[1] + h[1]) / 2 - (h[0] - c[0]) * d.curveness]), u.setLayout(f)
                            }
                            e && e(r)
                        })
                    }, e.forceLayout = p, e.preservedPoints = t, p.step()
                } else e.forceLayout = null
            })
        }), gf("graphView", {
            create: function (e, t) {
                var i = [];
                return e.eachSeriesByType("graph", function (e) {
                    var n = e.get("coordinateSystem");
                    if (!n || "view" === n) {
                        var a = e.getData(), o = [], r = [];
                        Lo(a.mapArray(function (e) {
                            var t = a.getItemModel(e);
                            return [+t.get("x"), +t.get("y")]
                        }), o, r), r[0] - o[0] == 0 && (r[0] += 1, o[0] -= 1), r[1] - o[1] == 0 && (r[1] += 1, o[1] -= 1);
                        var s = (r[0] - o[0]) / (r[1] - o[1]), l = function (e, t, i) {
                            var n = e.getBoxLayoutParams();
                            return n.aspect = i, vd(n, {width: t.getWidth(), height: t.getHeight()})
                        }(e, t, s);
                        isNaN(s) && (o = [l.x, l.y], r = [l.x + l.width, l.y + l.height]);
                        var d = r[0] - o[0], u = r[1] - o[1], c = l.width, h = l.height,
                            f = e.coordinateSystem = new jy;
                        f.zoomLimit = e.get("scaleLimit"), f.setBoundingRect(o[0], o[1], d, u), f.setViewRect(l.x, l.y, c, h), f.setCenter(e.get("center")), f.setZoom(e.get("zoom")), i.push(f)
                    }
                }), i
            }
        }), ec.extend({
            type: "series.gauge",
            getInitialData: function (e, t) {
                return Om(this, ["value"])
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                center: ["50%", "50%"],
                legendHoverLink: !0,
                radius: "75%",
                startAngle: 225,
                endAngle: -45,
                clockwise: !0,
                min: 0,
                max: 100,
                splitNumber: 10,
                axisLine: {show: !0, lineStyle: {color: [[.2, "#91c7ae"], [.8, "#63869e"], [1, "#c23531"]], width: 30}},
                splitLine: {show: !0, length: 30, lineStyle: {color: "#eee", width: 2, type: "solid"}},
                axisTick: {show: !0, splitNumber: 5, length: 8, lineStyle: {color: "#eee", width: 1, type: "solid"}},
                axisLabel: {show: !0, distance: 5, color: "auto"},
                pointer: {show: !0, length: "80%", width: 8},
                itemStyle: {color: "auto"},
                title: {show: !0, offsetCenter: [0, "-40%"], color: "#333", fontSize: 15},
                detail: {
                    show: !0,
                    backgroundColor: "rgba(0,0,0,0)",
                    borderWidth: 0,
                    borderColor: "#ccc",
                    width: 100,
                    height: null,
                    padding: [5, 10],
                    offsetCenter: [0, "40%"],
                    color: "auto",
                    fontSize: 30
                }
            }
        });
        var Sw = wr.extend({
            type: "echartsGaugePointer",
            shape: {angle: 0, width: 10, r: 10, x: 0, y: 0},
            buildPath: function (e, t) {
                var i = Math.cos, n = Math.sin, a = t.r, o = t.width, r = t.angle,
                    s = t.x - i(r) * o * (a / 3 <= o ? 1 : 2), l = t.y - n(r) * o * (a / 3 <= o ? 1 : 2);
                r = t.angle - Math.PI / 2, e.moveTo(s, l), e.lineTo(t.x + i(r) * o, t.y + n(r) * o), e.lineTo(t.x + i(t.angle) * a, t.y + n(t.angle) * a), e.lineTo(t.x - i(r) * o, t.y - n(r) * o), e.lineTo(s, l)
            }
        });

        function Iw(e, t) {
            return t && ("string" == typeof t ? e = t.replace("{value}", null != e ? e : "") : "function" == typeof t && (e = t(e))), e
        }

        var bw = 2 * Math.PI, _w = (fc.extend({
            type: "gauge", render: function (e, t, i) {
                this.group.removeAll();
                var n = e.get("axisLine.lineStyle.color"), a = function (e, t) {
                    var i = e.get("center"), n = t.getWidth(), a = t.getHeight(), o = Math.min(n, a);
                    return {cx: xl(i[0], t.getWidth()), cy: xl(i[1], t.getHeight()), r: xl(e.get("radius"), o / 2)}
                }(e, i);
                this._renderMain(e, t, i, n, a)
            }, dispose: function () {
            }, _renderMain: function (e, t, i, n, a) {
                for (var o = this.group, r = e.getModel("axisLine"), s = r.getModel("lineStyle"), l = e.get("clockwise"), d = -e.get("startAngle") / 180 * Math.PI, u = ((p = -e.get("endAngle") / 180 * Math.PI) - d) % bw, c = d, h = s.get("width"), f = r.get("show"), g = 0; f && g < n.length; g++) {
                    var p, v = Math.min(Math.max(n[g][0], 0), 1), m = new Gr({
                        shape: {
                            startAngle: c,
                            endAngle: p = d + u * v,
                            cx: a.cx,
                            cy: a.cy,
                            clockwise: l,
                            r0: a.r - h,
                            r: a.r
                        }, silent: !0
                    });
                    m.setStyle({fill: n[g][1]}), m.setStyle(s.getLineStyle(["color", "borderWidth", "borderColor"])), o.add(m), c = p
                }

                function y(e) {
                    if (e <= 0) return n[0][1];
                    for (var t = 0; t < n.length; t++) if (n[t][0] >= e && (0 === t ? 0 : n[t - 1][0]) < e) return n[t][1];
                    return n[t - 1][1]
                }

                if (!l) {
                    var k = d;
                    d = p, p = k
                }
                this._renderTicks(e, t, i, y, a, d, p, l), this._renderPointer(e, t, i, y, a, d, p, l), this._renderTitle(e, t, i, y, a), this._renderDetail(e, t, i, y, a)
            }, _renderTicks: function (e, t, i, n, a, o, r, s) {
                for (var l = this.group, d = a.cx, u = a.cy, c = a.r, h = +e.get("min"), f = +e.get("max"), g = e.getModel("splitLine"), p = e.getModel("axisTick"), v = e.getModel("axisLabel"), m = e.get("splitNumber"), y = p.get("splitNumber"), k = xl(g.get("length"), c), T = xl(p.get("length"), c), w = o, C = (r - o) / m, S = C / y, I = g.getModel("lineStyle").getLineStyle(), b = p.getModel("lineStyle").getLineStyle(), _ = 0; _ <= m; _++) {
                    var D = Math.cos(w), A = Math.sin(w);
                    if (g.get("show")) {
                        var N = new is({
                            shape: {x1: D * c + d, y1: A * c + u, x2: D * (c - k) + d, y2: A * (c - k) + u},
                            style: I,
                            silent: !0
                        });
                        "auto" === I.stroke && N.setStyle({stroke: n(_ / m)}), l.add(N)
                    }
                    if (v.get("show")) {
                        var x = Iw(El(_ / m * (f - h) + h), v.get("formatter")), E = v.get("distance"), P = n(_ / m);
                        l.add(new Ur({
                            style: Js({}, v, {
                                text: x,
                                x: D * (c - k - E) + d,
                                y: A * (c - k - E) + u,
                                textVerticalAlign: A < -.4 ? "top" : .4 < A ? "bottom" : "middle",
                                textAlign: D < -.4 ? "left" : .4 < D ? "right" : "center"
                            }, {autoColor: P}), silent: !0
                        }))
                    }
                    if (p.get("show") && _ !== m) {
                        for (var O = 0; O <= y; O++) {
                            D = Math.cos(w), A = Math.sin(w);
                            var M = new is({
                                shape: {
                                    x1: D * c + d,
                                    y1: A * c + u,
                                    x2: D * (c - T) + d,
                                    y2: A * (c - T) + u
                                }, silent: !0, style: b
                            });
                            "auto" === b.stroke && M.setStyle({stroke: n((_ + O / y) / m)}), l.add(M), w += S
                        }
                        w -= S
                    } else w += C
                }
            }, _renderPointer: function (e, t, i, n, a, o, r, s) {
                var l = this.group, d = this._data;
                if (e.get("pointer.show")) {
                    var u = [+e.get("min"), +e.get("max")], c = [o, r], h = e.getData(), f = h.mapDimension("value");
                    h.diff(d).add(function (t) {
                        var i = new Sw({shape: {angle: o}});
                        rl(i, {shape: {angle: Nl(h.get(f, t), u, c, !0)}}, e), l.add(i), h.setItemGraphicEl(t, i)
                    }).update(function (t, i) {
                        var n = d.getItemGraphicEl(i);
                        ol(n, {shape: {angle: Nl(h.get(f, t), u, c, !0)}}, e), l.add(n), h.setItemGraphicEl(t, n)
                    }).remove(function (e) {
                        var t = d.getItemGraphicEl(e);
                        l.remove(t)
                    }).execute(), h.eachItemGraphicEl(function (e, t) {
                        var i = h.getItemModel(t), o = i.getModel("pointer");
                        e.setShape({
                            x: a.cx,
                            y: a.cy,
                            width: xl(o.get("width"), a.r),
                            r: xl(o.get("length"), a.r)
                        }), e.useStyle(i.getModel("itemStyle").getItemStyle()), "auto" === e.style.fill && e.setStyle("fill", n(Nl(h.get(f, t), u, [0, 1], !0))), zs(e, i.getModel("emphasis.itemStyle").getItemStyle())
                    }), this._data = h
                } else d && d.eachItemGraphicEl(function (e) {
                    l.remove(e)
                })
            }, _renderTitle: function (e, t, i, n, a) {
                var o = e.getData(), r = o.mapDimension("value"), s = e.getModel("title");
                if (s.get("show")) {
                    var l = s.get("offsetCenter"), d = a.cx + xl(l[0], a.r), u = a.cy + xl(l[1], a.r),
                        c = +e.get("min"), h = +e.get("max"), f = n(Nl(e.getData().get(r, 0), [c, h], [0, 1], !0));
                    this.group.add(new Ur({
                        silent: !0,
                        style: Js({}, s, {
                            x: d,
                            y: u,
                            text: o.getName(0),
                            textAlign: "center",
                            textVerticalAlign: "middle"
                        }, {autoColor: f, forceRich: !0})
                    }))
                }
            }, _renderDetail: function (e, t, i, n, a) {
                var o = e.getModel("detail"), r = +e.get("min"), s = +e.get("max");
                if (o.get("show")) {
                    var l = o.get("offsetCenter"), d = a.cx + xl(l[0], a.r), u = a.cy + xl(l[1], a.r),
                        c = xl(o.get("width"), a.r), h = xl(o.get("height"), a.r), f = e.getData(),
                        g = f.get(f.mapDimension("value"), 0), p = n(Nl(g, [r, s], [0, 1], !0));
                    this.group.add(new Ur({
                        silent: !0,
                        style: Js({}, o, {
                            x: d,
                            y: u,
                            text: Iw(g, o.get("formatter")),
                            textWidth: isNaN(c) ? null : c,
                            textHeight: isNaN(h) ? null : h,
                            textAlign: "center",
                            textVerticalAlign: "middle"
                        }, {autoColor: p, forceRich: !0})
                    }))
                }
            }
        }), wf({
            type: "series.funnel",
            init: function (e) {
                _w.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this)), this._defaultLabelLine(e)
            },
            getInitialData: function (e, t) {
                return Om(this, {coordDimensions: ["value"], encodeDefaulter: O(jd, this)})
            },
            _defaultLabelLine: function (e) {
                Oa(e, "labelLine", ["show"]);
                var t = e.labelLine, i = e.emphasis.labelLine;
                t.show = t.show && e.label.show, i.show = i.show && e.emphasis.label.show
            },
            getDataParams: function (e) {
                var t = this.getData(), i = _w.superCall(this, "getDataParams", e), n = t.mapDimension("value"),
                    a = t.getSum(n);
                return i.percent = a ? +(t.get(n, e) / a * 100).toFixed(2) : 0, i.$vars.push("percent"), i
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                left: 80,
                top: 60,
                right: 80,
                bottom: 60,
                minSize: "0%",
                maxSize: "100%",
                sort: "descending",
                gap: 0,
                funnelAlign: "center",
                label: {show: !0, position: "outer"},
                labelLine: {show: !0, length: 20, lineStyle: {width: 1, type: "solid"}},
                itemStyle: {borderColor: "#fff", borderWidth: 1},
                emphasis: {label: {show: !0}}
            }
        }));

        function Dw(e, t) {
            Ai.call(this);
            var i = new Xr, n = new $r, a = new Ur;
            this.add(i), this.add(n), this.add(a), this.highDownOnUpdate = function (e, t) {
                "emphasis" === t ? (n.ignore = n.hoverIgnore, a.ignore = a.hoverIgnore) : (n.ignore = n.normalIgnore, a.ignore = a.normalIgnore)
            }, this.updateData(e, t, !0)
        }

        var Aw = Dw.prototype, Nw = ["itemStyle", "opacity"];

        function xw(e, t, i, n, a) {
            Ap.call(this, e, t, i), this.type = n || "value", this.axisIndex = a
        }

        function Ew(e, t, i, n, a, o) {
            e = e || 0;
            var r = i[1] - i[0];
            if (null != a && (a = Ow(a, [0, r])), null != o && (o = Math.max(o, null != a ? a : 0)), "all" === n) {
                var s = Math.abs(t[1] - t[0]);
                a = o = Ow(s = Ow(s, [0, r]), [a, o]), n = 0
            }
            t[0] = Ow(t[0], i), t[1] = Ow(t[1], i);
            var l = Pw(t, n);
            t[n] += e;
            var d = a || 0, u = i.slice();
            l.sign < 0 ? u[0] += d : u[1] -= d, t[n] = Ow(t[n], u);
            var c = Pw(t, n);
            return null != a && (c.sign !== l.sign || c.span < a) && (t[1 - n] = t[n] + l.sign * a), c = Pw(t, n), null != o && c.span > o && (t[1 - n] = t[n] + c.sign * o), t
        }

        function Pw(e, t) {
            var i = e[t] - e[1 - t];
            return {span: Math.abs(i), sign: 0 < i ? -1 : i < 0 ? 1 : t ? -1 : 1}
        }

        function Ow(e, t) {
            return Math.min(null != t[1] ? t[1] : 1 / 0, Math.max(null != t[0] ? t[0] : -1 / 0, e))
        }

        Aw.updateData = function (e, t, i) {
            var n = this.childAt(0), a = e.hostModel, o = e.getItemModel(t), r = e.getItemLayout(t),
                s = e.getItemModel(t).get(Nw);
            s = null == s ? 1 : s, n.useStyle({}), i ? (n.setShape({points: r.points}), n.setStyle({opacity: 0}), rl(n, {style: {opacity: s}}, a, t)) : ol(n, {
                style: {opacity: s},
                shape: {points: r.points}
            }, a, t);
            var l = o.getModel("itemStyle"), d = e.getItemVisual(t, "color");
            n.setStyle(T({
                lineJoin: "round",
                fill: d
            }, l.getItemStyle(["opacity"]))), n.hoverStyle = l.getModel("emphasis").getItemStyle(), this._updateLabel(e, t), zs(this)
        }, Aw._updateLabel = function (e, t) {
            var i = this.childAt(1), n = this.childAt(2), a = e.hostModel, o = e.getItemModel(t),
                r = e.getItemLayout(t).label, s = e.getItemVisual(t, "color");
            ol(i, {shape: {points: r.linePoints || r.linePoints}}, a, t), ol(n, {
                style: {
                    x: r.x,
                    y: r.y
                }
            }, a, t), n.attr({rotation: r.rotation, origin: [r.x, r.y], z2: 10});
            var l = o.getModel("label"), d = o.getModel("emphasis.label"), u = o.getModel("labelLine"),
                c = o.getModel("emphasis.labelLine");
            s = e.getItemVisual(t, "color"), Ys(n.style, n.hoverStyle = {}, l, d, {
                labelFetcher: e.hostModel,
                labelDataIndex: t,
                defaultText: e.getName(t),
                autoColor: s,
                useInsideStyle: !!r.inside
            }, {
                textAlign: r.textAlign,
                textVerticalAlign: r.verticalAlign
            }), n.ignore = n.normalIgnore = !l.get("show"), n.hoverIgnore = !d.get("show"), i.ignore = i.normalIgnore = !u.get("show"), i.hoverIgnore = !c.get("show"), i.setStyle({stroke: s}), i.setStyle(u.getModel("lineStyle").getLineStyle()), i.hoverStyle = c.getModel("lineStyle").getLineStyle()
        }, I(Dw, Ai), fc.extend({
            type: "funnel", render: function (e, t, i) {
                var n = e.getData(), a = this._data, o = this.group;
                n.diff(a).add(function (e) {
                    var t = new Dw(n, e);
                    n.setItemGraphicEl(e, t), o.add(t)
                }).update(function (e, t) {
                    var i = a.getItemGraphicEl(t);
                    i.updateData(n, e), o.add(i), n.setItemGraphicEl(e, i)
                }).remove(function (e) {
                    var t = a.getItemGraphicEl(e);
                    o.remove(t)
                }).execute(), this._data = n
            }, remove: function () {
                this.group.removeAll(), this._data = null
            }, dispose: function () {
            }
        }), vf(Wm("funnel")), pf(function (e, t, i) {
            e.eachSeriesByType("funnel", function (e) {
                var i = e.getData(), n = i.mapDimension("value"), a = e.get("sort"), o = function (e, t) {
                        return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                    }(e, t), r = function (e, t) {
                        for (var i = e.mapDimension("value"), n = e.mapArray(i, function (e) {
                            return e
                        }), a = [], o = "ascending" === t, r = 0, s = e.count(); r < s; r++) a[r] = r;
                        return "function" == typeof t ? a.sort(t) : "none" !== t && a.sort(function (e, t) {
                            return o ? n[e] - n[t] : n[t] - n[e]
                        }), a
                    }(i, a), s = [xl(e.get("minSize"), o.width), xl(e.get("maxSize"), o.width)], l = i.getDataExtent(n),
                    d = e.get("min"), u = e.get("max");

                function c(e, t) {
                    var a, r = Nl(i.get(n, e) || 0, [d, u], s, !0);
                    switch (h) {
                        case"left":
                            a = o.x;
                            break;
                        case"center":
                            a = o.x + (o.width - r) / 2;
                            break;
                        case"right":
                            a = o.x + o.width - r
                    }
                    return [[a, t], [a + r, t]]
                }

                null == d && (d = Math.min(l[0], 0)), null == u && (u = l[1]);
                var h = e.get("funnelAlign"), f = e.get("gap"), g = (o.height - f * (i.count() - 1)) / i.count(),
                    p = o.y;
                "ascending" === a && (g = -g, f = -f, p += o.height, r = r.reverse());
                for (var v = 0; v < r.length; v++) {
                    var m = r[v], y = r[v + 1], k = i.getItemModel(m).get("itemStyle.height");
                    null == k ? k = g : (k = xl(k, o.height), "ascending" === a && (k = -k));
                    var T = c(m, p), w = c(y, p + k);
                    p += k + f, i.setItemLayout(m, {points: T.concat(w.slice().reverse())})
                }
                !function (e) {
                    e.each(function (t) {
                        var i, n, a, o, r = e.getItemModel(t), s = r.getModel("label").get("position"),
                            l = r.getModel("labelLine"), d = e.getItemLayout(t), u = d.points,
                            c = "inner" === s || "inside" === s || "center" === s || "insideLeft" === s || "insideRight" === s;
                        if (c) i = "insideLeft" === s ? (n = (u[0][0] + u[3][0]) / 2 + 5, a = (u[0][1] + u[3][1]) / 2, "left") : "insideRight" === s ? (n = (u[1][0] + u[2][0]) / 2 - 5, a = (u[1][1] + u[2][1]) / 2, "right") : (n = (u[0][0] + u[1][0] + u[2][0] + u[3][0]) / 4, a = (u[0][1] + u[1][1] + u[2][1] + u[3][1]) / 4, "center"), o = [[n, a], [n, a]]; else {
                            var h, f, g, p = l.get("length");
                            i = "left" === s ? (h = (u[3][0] + u[0][0]) / 2, f = (u[3][1] + u[0][1]) / 2, n = (g = h - p) - 5, "right") : "right" === s ? (h = (u[1][0] + u[2][0]) / 2, f = (u[1][1] + u[2][1]) / 2, n = (g = h + p) + 5, "left") : "rightTop" === s ? (h = u[1][0], f = u[1][1], n = (g = h + p) + 5, "top") : "rightBottom" === s ? (h = u[2][0], f = u[2][1], n = (g = h + p) + 5, "bottom") : "leftTop" === s ? (h = u[0][0], f = u[1][1], n = (g = h - p) - 5, "right") : "leftBottom" === s ? (h = u[3][0], f = u[2][1], n = (g = h - p) - 5, "right") : (h = (u[1][0] + u[2][0]) / 2, f = (u[1][1] + u[2][1]) / 2, n = (g = h + p) + 5, "left"), o = [[h, f], [g, f]], a = f
                        }
                        d.label = {linePoints: o, x: n, y: a, verticalAlign: "middle", textAlign: i, inside: c}
                    })
                }(i)
            })
        }), hf($m("funnel")), xw.prototype = {
            constructor: xw, model: null, isHorizontal: function () {
                return "horizontal" !== this.coordinateSystem.getModel().get("layout")
            }
        }, I(xw, Ap);
        var Mw = D, Fw = Math.min, Lw = Math.max, Rw = Math.floor, Bw = Math.ceil, Uw = El, Kw = Math.PI;

        function Vw(e, t, i) {
            this._axesMap = Q(), this._axesLayout = {}, this.dimensions = e.dimensions, this._rect, this._model = e, this._init(e, t, i)
        }

        function Ww(e, t) {
            return Fw(Lw(e, t[0]), t[1])
        }

        Vw.prototype = {
            type: "parallel", constructor: Vw, _init: function (e, t, i) {
                var n = e.dimensions, a = e.parallelAxisIndex;
                Mw(n, function (e, i) {
                    var n = a[i], o = t.getComponent("parallelAxis", n),
                        r = this._axesMap.set(e, new xw(e, Jg(o), [0, 0], o.get("type"), n)), s = "category" === r.type;
                    r.onBand = s && o.get("boundaryGap"), r.inverse = o.get("inverse"), (o.axis = r).model = o, r.coordinateSystem = o.coordinateSystem = this
                }, this)
            }, update: function (e, t) {
                this._updateAxesFromSeries(this._model, e)
            }, containPoint: function (e) {
                var t = this._makeLayoutInfo(), i = t.axisBase, n = t.layoutBase, a = t.pixelDimIndex, o = e[1 - a],
                    r = e[a];
                return i <= o && o <= i + t.axisLength && n <= r && r <= n + t.layoutLength
            }, getModel: function () {
                return this._model
            }, _updateAxesFromSeries: function (e, t) {
                t.eachSeries(function (i) {
                    if (e.contains(i, t)) {
                        var n = i.getData();
                        Mw(this.dimensions, function (e) {
                            var t = this._axesMap.get(e);
                            t.scale.unionExtentFromData(n, n.mapDimension(e)), qg(t.scale, t.model)
                        }, this)
                    }
                }, this)
            }, resize: function (e, t) {
                this._rect = vd(e.getBoxLayoutParams(), {
                    width: t.getWidth(),
                    height: t.getHeight()
                }), this._layoutAxes()
            }, getRect: function () {
                return this._rect
            }, _makeLayoutInfo: function () {
                var e, t = this._model, i = this._rect, n = ["x", "y"], a = ["width", "height"], o = t.get("layout"),
                    r = "horizontal" === o ? 0 : 1, s = i[a[r]], l = [0, s], d = this.dimensions.length,
                    u = Ww(t.get("axisExpandWidth"), l), c = Ww(t.get("axisExpandCount") || 0, [0, d]),
                    h = t.get("axisExpandable") && 3 < d && c < d && 1 < c && 0 < u && 0 < s,
                    f = t.get("axisExpandWindow");
                f ? (e = Ww(f[1] - f[0], l), f[1] = f[0] + e) : (e = Ww(u * (c - 1), l), (f = [u * (t.get("axisExpandCenter") || Rw(d / 2)) - e / 2])[1] = f[0] + e);
                var g = (s - e) / (d - c);
                g < 3 && (g = 0);
                var p = [Rw(Uw(f[0] / u, 1)) + 1, Bw(Uw(f[1] / u, 1)) - 1], v = g / u * f[0];
                return {
                    layout: o,
                    pixelDimIndex: r,
                    layoutBase: i[n[r]],
                    layoutLength: s,
                    axisBase: i[n[1 - r]],
                    axisLength: i[a[1 - r]],
                    axisExpandable: h,
                    axisExpandWidth: u,
                    axisCollapseWidth: g,
                    axisExpandWindow: f,
                    axisCount: d,
                    winInnerIndices: p,
                    axisExpandWindow0Pos: v
                }
            }, _layoutAxes: function () {
                var e = this._rect, t = this._axesMap, i = this.dimensions, n = this._makeLayoutInfo(), a = n.layout;
                t.each(function (e) {
                    var t = [0, n.axisLength], i = e.inverse ? 1 : 0;
                    e.setExtent(t[i], t[1 - i])
                }), Mw(i, function (t, i) {
                    var o = (n.axisExpandable ? function (e, t) {
                            var i, n, a = t.layoutLength, o = t.axisExpandWidth, r = t.axisCount, s = t.axisCollapseWidth,
                                l = t.winInnerIndices, d = s, u = !1;
                            return e < l[0] ? (i = e * s, n = s) : e <= l[1] ? (i = t.axisExpandWindow0Pos + e * o - t.axisExpandWindow[0], d = o, u = !0) : (i = a - (r - 1 - e) * s, n = s), {
                                position: i,
                                axisNameAvailableWidth: d,
                                axisLabelShow: u,
                                nameTruncateMaxWidth: n
                            }
                        } : function (e, t) {
                            var i = t.layoutLength / (t.axisCount - 1);
                            return {position: i * e, axisNameAvailableWidth: i, axisLabelShow: !0}
                        })(i, n), r = {horizontal: {x: o.position, y: n.axisLength}, vertical: {x: 0, y: o.position}},
                        s = {horizontal: Kw / 2, vertical: 0}, l = [r[a].x + e.x, r[a].y + e.y], d = s[a], u = ot();
                    ut(u, u, d), dt(u, u, l), this._axesLayout[t] = {
                        position: l,
                        rotation: d,
                        transform: u,
                        axisNameAvailableWidth: o.axisNameAvailableWidth,
                        axisLabelShow: o.axisLabelShow,
                        nameTruncateMaxWidth: o.nameTruncateMaxWidth,
                        tickDirection: 1,
                        labelDirection: 1
                    }
                }, this)
            }, getAxis: function (e) {
                return this._axesMap.get(e)
            }, dataToPoint: function (e, t) {
                return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e), t)
            }, eachActiveState: function (e, t, i, n) {
                null == i && (i = 0), null == n && (n = e.count());
                var a = this._axesMap, o = this.dimensions, r = [], s = [];
                D(o, function (t) {
                    r.push(e.mapDimension(t)), s.push(a.get(t).model)
                });
                for (var l = this.hasAxisBrushed(), d = i; d < n; d++) {
                    var u;
                    if (l) {
                        u = "active";
                        for (var c = e.getValues(r, d), h = 0, f = o.length; h < f; h++) if ("inactive" === s[h].getActiveState(c[h])) {
                            u = "inactive";
                            break
                        }
                    } else u = "normal";
                    t(u, d)
                }
            }, hasAxisBrushed: function () {
                for (var e = this.dimensions, t = this._axesMap, i = !1, n = 0, a = e.length; n < a; n++) "normal" !== t.get(e[n]).model.getActiveState() && (i = !0);
                return i
            }, axisCoordToPoint: function (e, t) {
                return ll([e, 0], this._axesLayout[t].transform)
            }, getAxisLayout: function (e) {
                return v(this._axesLayout[e])
            }, getSlidedAxisExpandWindow: function (e) {
                var t = this._makeLayoutInfo(), i = t.pixelDimIndex, n = t.axisExpandWindow.slice(), a = n[1] - n[0],
                    o = [0, t.axisExpandWidth * (t.axisCount - 1)];
                if (!this.containPoint(e)) return {behavior: "none", axisExpandWindow: n};
                var r, s = e[i] - t.layoutBase - t.axisExpandWindow0Pos, l = "slide", d = t.axisCollapseWidth,
                    u = this._model.get("axisExpandSlideTriggerArea"), c = null != u[0];
                return d ? (c && d && s < a * u[0] ? (l = "jump", r = s - a * u[2]) : c && d && s > a * (1 - u[0]) ? (l = "jump", r = s - a * (1 - u[2])) : 0 <= (r = s - a * u[1]) && (r = s - a * (1 - u[1])) <= 0 && (r = 0), (r *= t.axisExpandWidth / d) ? Ew(r, n, o, "all") : l = "none") : (a = n[1] - n[0], (n = [Lw(0, o[1] * s / a - a / 2)])[1] = Fw(o[1], n[0] + a), n[0] = n[1] - a), {
                    axisExpandWindow: n,
                    behavior: l
                }
            }
        }, iu.register("parallel", {
            create: function (e, t) {
                var i = [];
                return e.eachComponent("parallel", function (n, a) {
                    var o = new Vw(n, e, t);
                    o.name = "parallel_" + a, o.resize(n, t), (n.coordinateSystem = o).model = n, i.push(o)
                }), e.eachSeries(function (t) {
                    if ("parallel" === t.get("coordinateSystem")) {
                        var i = e.queryComponents({
                            mainType: "parallel",
                            index: t.get("parallelIndex"),
                            id: t.get("parallelId")
                        })[0];
                        t.coordinateSystem = i.coordinateSystem
                    }
                }), i
            }
        });
        var Gw = bd.extend({
            type: "baseParallelAxis", axis: null, activeIntervals: [], getAreaSelectStyle: function () {
                return no([["fill", "color"], ["lineWidth", "borderWidth"], ["stroke", "borderColor"], ["width", "width"], ["opacity", "opacity"]])(this.getModel("areaSelectStyle"))
            }, setActiveIntervals: function (e) {
                var t = this.activeIntervals = v(e);
                if (t) for (var i = t.length - 1; 0 <= i; i--) Pl(t[i])
            }, getActiveState: function (e) {
                var t = this.activeIntervals;
                if (!t.length) return "normal";
                if (null == e || isNaN(e)) return "inactive";
                if (1 === t.length) {
                    var i = t[0];
                    if (i[0] <= e && e <= i[1]) return "active"
                } else for (var n = 0, a = t.length; n < a; n++) if (t[n][0] <= e && e <= t[n][1]) return "active";
                return "inactive"
            }
        });
        m(Gw.prototype, ip), Dv("parallel", Gw, function (e, t) {
            return t.type || (t.data ? "category" : "value")
        }, {
            type: "value",
            dim: null,
            areaSelectStyle: {
                width: 20,
                borderWidth: 1,
                borderColor: "rgba(160,197,232)",
                color: "rgba(160,197,232)",
                opacity: .3
            },
            realtime: !0,
            z: 10
        }), bd.extend({
            type: "parallel",
            dependencies: ["parallelAxis"],
            coordinateSystem: null,
            dimensions: null,
            parallelAxisIndex: null,
            layoutMode: "box",
            defaultOption: {
                zlevel: 0,
                z: 0,
                left: 80,
                top: 60,
                right: 80,
                bottom: 60,
                layout: "horizontal",
                axisExpandable: !1,
                axisExpandCenter: null,
                axisExpandCount: 0,
                axisExpandWidth: 50,
                axisExpandRate: 17,
                axisExpandDebounce: 50,
                axisExpandSlideTriggerArea: [-.15, .05, .4],
                axisExpandTriggerOn: "click",
                parallelAxisDefault: null
            },
            init: function () {
                bd.prototype.init.apply(this, arguments), this.mergeOption({})
            },
            mergeOption: function (e) {
                var t = this.option;
                e && m(t, e, !0), this._initDimensions()
            },
            contains: function (e, t) {
                var i = e.get("parallelIndex");
                return null != i && t.getComponent("parallel", i) === this
            },
            setAxisExpand: function (e) {
                D(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function (t) {
                    e.hasOwnProperty(t) && (this.option[t] = e[t])
                }, this)
            },
            _initDimensions: function () {
                var e = this.dimensions = [], t = this.parallelAxisIndex = [];
                D(x(this.dependentModels.parallelAxis, function (e) {
                    return (e.get("parallelIndex") || 0) === this.componentIndex
                }, this), function (i) {
                    e.push("dim" + i.get("dim")), t.push(i.componentIndex)
                })
            }
        }), ff({type: "axisAreaSelect", event: "axisAreaSelected"}, function (e, t) {
            t.eachComponent({mainType: "parallelAxis", query: e}, function (t) {
                t.axis.model.setActiveIntervals(e.intervals)
            })
        }), ff("parallelAxisExpand", function (e, t) {
            t.eachComponent({mainType: "parallel", query: e}, function (t) {
                t.setAxisExpand(e)
            })
        });
        var Hw = O, zw = D, jw = A, Xw = Math.min, $w = Math.max, Yw = Math.pow, qw = 1e4, Jw = 6, Zw = 6,
            Qw = "globalPan", eC = {w: [0, 0], e: [0, 1], n: [1, 0], s: [1, 1]},
            tC = {w: "ew", e: "ew", n: "ns", s: "ns", ne: "nesw", sw: "nesw", nw: "nwse", se: "nwse"}, iC = {
                brushStyle: {lineWidth: 2, stroke: "rgba(0,0,0,0.3)", fill: "rgba(0,0,0,0.1)"},
                transformable: !0,
                brushMode: "single",
                removeOnClick: !1
            }, nC = 0;

        function aC(e) {
            Ne.call(this), this._zr = e, this.group = new Ai, this._brushType, this._brushOption, this._panels, this._track = [], this._dragging, this._covers = [], this._creatingCover, this._creatingPanel, this._enableGlobalPan, this._uid = "brushController_" + nC++, this._handlers = {}, zw(xC, function (e, t) {
                this._handlers[t] = P(e, this)
            }, this)
        }

        function oC(e, t) {
            var i = PC[t.brushType].createCover(e, t);
            return i.__brushOption = t, lC(i, t), e.group.add(i), i
        }

        function rC(e, t) {
            var i = uC(t);
            return i.endCreating && (i.endCreating(e, t), lC(t, t.__brushOption)), t
        }

        function sC(e, t) {
            var i = t.__brushOption;
            uC(t).updateCoverShape(e, t, i.range, i)
        }

        function lC(e, t) {
            var i = t.z;
            null == i && (i = qw), e.traverse(function (e) {
                e.z = i, e.z2 = i
            })
        }

        function dC(e, t) {
            uC(t).updateCommon(e, t), sC(e, t)
        }

        function uC(e) {
            return PC[e.__brushOption.brushType]
        }

        function cC(e, t, i) {
            var n, a = e._panels;
            if (!a) return !0;
            var o = e._transform;
            return zw(a, function (e) {
                e.isTargetByCursor(t, i, o) && (n = e)
            }), n
        }

        function hC(e, t) {
            var i = e._panels;
            if (!i) return !0;
            var n = t.__brushOption.panelId;
            return null == n || i[n]
        }

        function fC(e) {
            var t = e._covers, i = t.length;
            return zw(t, function (t) {
                e.group.remove(t)
            }, e), t.length = 0, !!i
        }

        function gC(e, t) {
            var i = jw(e._covers, function (e) {
                var t = e.__brushOption, i = v(t.range);
                return {brushType: t.brushType, panelId: t.panelId, range: i}
            });
            e.trigger("brush", i, {isEnd: !!t.isEnd, removeOnClick: !!t.removeOnClick})
        }

        function pC(e) {
            var t = e.length - 1;
            return t < 0 && (t = 0), [e[0], e[t]]
        }

        function vC(e, t, i, n) {
            var a = new Ai;
            return a.add(new es({
                name: "main",
                style: TC(i),
                silent: !0,
                draggable: !0,
                cursor: "move",
                drift: Hw(e, t, a, "nswe"),
                ondragend: Hw(gC, t, {isEnd: !0})
            })), zw(n, function (i) {
                a.add(new es({
                    name: i,
                    style: {opacity: 0},
                    draggable: !0,
                    silent: !0,
                    invisible: !0,
                    drift: Hw(e, t, a, i),
                    ondragend: Hw(gC, t, {isEnd: !0})
                }))
            }), a
        }

        function mC(e, t, i, n) {
            var a = n.brushStyle.lineWidth || 0, o = $w(a, Zw), r = i[0][0], s = i[1][0], l = r - a / 2, d = s - a / 2,
                u = i[0][1], c = i[1][1], h = u - o + a / 2, f = c - o + a / 2, g = u - r, p = c - s, v = g + a,
                m = p + a;
            kC(e, t, "main", r, s, g, p), n.transformable && (kC(e, t, "w", l, d, o, m), kC(e, t, "e", h, d, o, m), kC(e, t, "n", l, d, v, o), kC(e, t, "s", l, f, v, o), kC(e, t, "nw", l, d, o, o), kC(e, t, "ne", h, d, o, o), kC(e, t, "sw", l, f, o, o), kC(e, t, "se", h, f, o, o))
        }

        function yC(e, t) {
            var i = t.__brushOption, n = i.transformable, a = t.childAt(0);
            a.useStyle(TC(i)), a.attr({
                silent: !n,
                cursor: n ? "move" : "default"
            }), zw(["w", "e", "n", "s", "se", "sw", "ne", "nw"], function (i) {
                var a = t.childOfName(i), o = function e(t, i) {
                    if (1 < i.length) {
                        i = i.split("");
                        var n = [e(t, i[0]), e(t, i[1])];
                        return "e" !== n[0] && "w" !== n[0] || n.reverse(), n.join("")
                    }
                    var n = dl({w: "left", e: "right", n: "top", s: "bottom"}[i], sl(t.group));
                    return {left: "w", right: "e", top: "n", bottom: "s"}[n]
                }(e, i);
                a && a.attr({silent: !n, invisible: !n, cursor: n ? tC[o] + "-resize" : null})
            })
        }

        function kC(e, t, i, n, a, o, r) {
            var s = t.childOfName(i);
            s && s.setShape(function (e) {
                var t = Xw(e[0][0], e[1][0]), i = Xw(e[0][1], e[1][1]), n = $w(e[0][0], e[1][0]),
                    a = $w(e[0][1], e[1][1]);
                return {x: t, y: i, width: n - t, height: a - i}
            }(bC(e, t, [[n, a], [n + o, a + r]])))
        }

        function TC(e) {
            return T({strokeNoScale: !0}, e.brushStyle)
        }

        function wC(e, t, i, n) {
            var a = [Xw(e, i), Xw(t, n)], o = [$w(e, i), $w(t, n)];
            return [[a[0], o[0]], [a[1], o[1]]]
        }

        function CC(e, t, i, n, a, o, r, s) {
            var l = n.__brushOption, d = e(l.range), u = IC(i, o, r);
            zw(a.split(""), function (e) {
                var t = eC[e];
                d[t[0]][t[1]] += u[t[0]]
            }), l.range = t(wC(d[0][0], d[1][0], d[0][1], d[1][1])), dC(i, n), gC(i, {isEnd: !1})
        }

        function SC(e, t, i, n, a) {
            var o = t.__brushOption.range, r = IC(e, i, n);
            zw(o, function (e) {
                e[0] += r[0], e[1] += r[1]
            }), dC(e, t), gC(e, {isEnd: !1})
        }

        function IC(e, t, i) {
            var n = e.group, a = n.transformCoordToLocal(t, i), o = n.transformCoordToLocal(0, 0);
            return [a[0] - o[0], a[1] - o[1]]
        }

        function bC(e, t, i) {
            var n = hC(e, t);
            return n && !0 !== n ? n.clipPath(i, e._transform) : v(i)
        }

        function _C(e) {
            var t = e.event;
            t.preventDefault && t.preventDefault()
        }

        function DC(e, t, i) {
            return e.childOfName("main").contain(t, i)
        }

        function AC(e, t, i, n) {
            var a, o = e._creatingCover, r = e._creatingPanel, s = e._brushOption;
            if (e._track.push(i.slice()), function (e) {
                var t = e._track;
                if (!t.length) return !1;
                var i = t[t.length - 1], n = t[0], a = i[0] - n[0], o = i[1] - n[1], r = Yw(a * a + o * o, .5);
                return Jw < r
            }(e) || o) {
                if (r && !o) {
                    "single" === s.brushMode && fC(e);
                    var l = v(s);
                    l.brushType = NC(l.brushType, r), l.panelId = !0 === r ? null : r.panelId, o = e._creatingCover = oC(e, l), e._covers.push(o)
                }
                if (o) {
                    var d = PC[NC(e._brushType, r)];
                    o.__brushOption.range = d.getCreatingRange(bC(e, o, e._track)), n && (rC(e, o), d.updateCommon(e, o)), sC(e, o), a = {isEnd: n}
                }
            } else n && "single" === s.brushMode && s.removeOnClick && cC(e, t, i) && fC(e) && (a = {
                isEnd: n,
                removeOnClick: !0
            });
            return a
        }

        function NC(e, t) {
            return "auto" === e ? t.defaultBrushType : e
        }

        aC.prototype = {
            constructor: aC, enableBrush: function (e) {
                return this._brushType && function (e) {
                    var t = e._zr;
                    (function (e, t, i) {
                        var n = Cy(e);
                        n[t] === i && (n[t] = null)
                    })(t, Qw, e._uid), function (e, t) {
                        zw(t, function (t, i) {
                            e.off(i, t)
                        })
                    }(t, e._handlers), e._brushType = e._brushOption = null
                }(this), e.brushType && function (e, t) {
                    var i = e._zr;
                    e._enableGlobalPan || function (e, t, i) {
                        Cy(e).globalPan = i
                    }(i, 0, e._uid), function (e, t) {
                        zw(t, function (t, i) {
                            e.on(i, t)
                        })
                    }(i, e._handlers), e._brushType = t.brushType, e._brushOption = m(v(iC), t, !0)
                }(this, e), this
            }, setPanels: function (e) {
                if (e && e.length) {
                    var t = this._panels = {};
                    D(e, function (e) {
                        t[e.panelId] = v(e)
                    })
                } else this._panels = null;
                return this
            }, mount: function (e) {
                e = e || {}, this._enableGlobalPan = e.enableGlobalPan;
                var t = this.group;
                return this._zr.add(t), t.attr({
                    position: e.position || [0, 0],
                    rotation: e.rotation || 0,
                    scale: e.scale || [1, 1]
                }), this._transform = t.getLocalTransform(), this
            }, eachCover: function (e, t) {
                zw(this._covers, e, t)
            }, updateCovers: function (e) {
                e = A(e, function (e) {
                    return m(v(iC), e, !0)
                });
                var t = "\0-brush-index-", i = this._covers, n = this._covers = [], a = this, o = this._creatingCover;
                return new If(i, e, function (e, t) {
                    return r(e.__brushOption, t)
                }, r).add(s).update(s).remove(function (e) {
                    i[e] !== o && a.group.remove(i[e])
                }).execute(), this;

                function r(e, i) {
                    return (null != e.id ? e.id : t + i) + "-" + e.brushType
                }

                function s(t, r) {
                    var s = e[t];
                    if (null != r && i[r] === o) n[t] = i[r]; else {
                        var l = n[t] = null != r ? (i[r].__brushOption = s, i[r]) : rC(a, oC(a, s));
                        dC(a, l)
                    }
                }
            }, unmount: function () {
                return this.enableBrush(!1), fC(this), this._zr.remove(this.group), this
            }, dispose: function () {
                this.unmount(), this.off()
            }
        }, b(aC, Ne);
        var xC = {
            mousedown: function (e) {
                if (this._dragging) EC(this, e); else if (!e.target || !e.target.draggable) {
                    _C(e);
                    var t = this.group.transformCoordToLocal(e.offsetX, e.offsetY);
                    this._creatingCover = null, (this._creatingPanel = cC(this, e, t)) && (this._dragging = !0, this._track = [t.slice()])
                }
            }, mousemove: function (e) {
                var t = e.offsetX, i = e.offsetY, n = this.group.transformCoordToLocal(t, i);
                if (function (e, t, i) {
                    if (e._brushType && !function (e, t, i) {
                        var n = e._zr;
                        return t < 0 || t > n.getWidth() || i > n.getHeight()
                    }(e, t)) {
                        var n = e._zr, a = e._covers, o = cC(e, t, i);
                        if (!e._dragging) for (var r = 0; r < a.length; r++) {
                            var s = a[r].__brushOption;
                            if (o && (!0 === o || s.panelId === o.panelId) && PC[s.brushType].contain(a[r], i[0], i[1])) return
                        }
                        o && n.setCursorStyle("crosshair")
                    }
                }(this, e, n), this._dragging) {
                    _C(e);
                    var a = AC(this, e, n, !1);
                    a && gC(this, a)
                }
            }, mouseup: function (e) {
                EC(this, e)
            }
        };

        function EC(e, t) {
            if (e._dragging) {
                _C(t);
                var i = t.offsetX, n = t.offsetY, a = e.group.transformCoordToLocal(i, n), o = AC(e, t, a, !0);
                e._dragging = !1, e._track = [], e._creatingCover = null, o && gC(e, o)
            }
        }

        var PC = {
            lineX: OC(0), lineY: OC(1), rect: {
                createCover: function (e, t) {
                    return vC(Hw(CC, function (e) {
                        return e
                    }, function (e) {
                        return e
                    }), e, t, ["w", "e", "n", "s", "se", "sw", "ne", "nw"])
                }, getCreatingRange: function (e) {
                    var t = pC(e);
                    return wC(t[1][0], t[1][1], t[0][0], t[0][1])
                }, updateCoverShape: function (e, t, i, n) {
                    mC(e, t, i, n)
                }, updateCommon: yC, contain: DC
            }, polygon: {
                createCover: function (e, t) {
                    var i = new Ai;
                    return i.add(new $r({name: "main", style: TC(t), silent: !0})), i
                }, getCreatingRange: function (e) {
                    return e
                }, endCreating: function (e, t) {
                    t.remove(t.childAt(0)), t.add(new Xr({
                        name: "main",
                        draggable: !0,
                        drift: Hw(SC, e, t),
                        ondragend: Hw(gC, e, {isEnd: !0})
                    }))
                }, updateCoverShape: function (e, t, i, n) {
                    t.childAt(0).setShape({points: bC(e, t, i)})
                }, updateCommon: yC, contain: DC
            }
        };

        function OC(e) {
            return {
                createCover: function (t, i) {
                    return vC(Hw(CC, function (t) {
                        var i = [t, [0, 100]];
                        return e && i.reverse(), i
                    }, function (t) {
                        return t[e]
                    }), t, i, [["w", "e"], ["n", "s"]][e])
                }, getCreatingRange: function (t) {
                    var i = pC(t);
                    return [Xw(i[0][e], i[1][e]), $w(i[0][e], i[1][e])]
                }, updateCoverShape: function (t, i, n, a) {
                    var o, r = hC(t, i);
                    if (!0 !== r && r.getLinearBrushOtherExtent) o = r.getLinearBrushOtherExtent(e, t._transform); else {
                        var s = t._zr;
                        o = [0, [s.getWidth(), s.getHeight()][1 - e]]
                    }
                    var l = [n, o];
                    e && l.reverse(), mC(t, i, l, a)
                }, updateCommon: yC, contain: DC
            }
        }

        function MC(e) {
            return e = RC(e), function (t, i) {
                return cl(t, e)
            }
        }

        function FC(e, t) {
            return e = RC(e), function (i) {
                var n = null != t ? t : i, a = n ? e.width : e.height, o = n ? e.x : e.y;
                return [o, o + (a || 0)]
            }
        }

        function LC(e, t, i) {
            return e = RC(e), function (n, a, o) {
                return e.contain(a[0], a[1]) && !Fy(n, t, i)
            }
        }

        function RC(e) {
            return Di.create(e)
        }

        var BC = ["axisLine", "axisTickLabel", "axisName"], UC = Tf({
            type: "parallelAxis", init: function (e, t) {
                UC.superApply(this, "init", arguments), (this._brushController = new aC(t.getZr())).on("brush", P(this._onBrush, this))
            }, render: function (e, t, i, n) {
                if (!function (e, t, i) {
                    return i && "axisAreaSelect" === i.type && t.findComponents({
                        mainType: "parallelAxis",
                        query: i
                    })[0] === e
                }(e, t, n)) {
                    this.axisModel = e, this.api = i, this.group.removeAll();
                    var a = this._axisGroup;
                    if (this._axisGroup = new Ai, this.group.add(this._axisGroup), e.get("show")) {
                        var o = function (e, t) {
                                return t.getComponent("parallel", e.get("parallelIndex"))
                            }(e, t), r = o.coordinateSystem, s = e.getAreaSelectStyle(), l = s.width, d = e.axis.dim,
                            u = k({strokeContainThreshold: l}, r.getAxisLayout(d)), c = new Kv(e, u);
                        D(BC, c.add, c), this._axisGroup.add(c.getGroup()), this._refreshBrushController(u, s, e, o, l, i);
                        var h = n && !1 === n.animation ? null : e;
                        ul(a, this._axisGroup, h)
                    }
                }
            }, _refreshBrushController: function (e, t, i, n, a, o) {
                var r = i.axis.getExtent(), s = r[1] - r[0], l = Math.min(30, .1 * Math.abs(s)),
                    d = Di.create({x: r[0], y: -a / 2, width: s, height: a});
                d.x -= l, d.width += 2 * l, this._brushController.mount({
                    enableGlobalPan: !0,
                    rotation: e.rotation,
                    position: e.position
                }).setPanels([{
                    panelId: "pl",
                    clipPath: MC(d),
                    isTargetByCursor: LC(d, o, n),
                    getLinearBrushOtherExtent: FC(d, 0)
                }]).enableBrush({brushType: "lineX", brushStyle: t, removeOnClick: !0}).updateCovers(function (e) {
                    var t = e.axis;
                    return A(e.activeIntervals, function (e) {
                        return {
                            brushType: "lineX",
                            panelId: "pl",
                            range: [t.dataToCoord(e[0], !0), t.dataToCoord(e[1], !0)]
                        }
                    })
                }(i))
            }, _onBrush: function (e, t) {
                var i = this.axisModel, n = i.axis, a = A(e, function (e) {
                    return [n.coordToData(e.range[0], !0), n.coordToData(e.range[1], !0)]
                });
                !i.option.realtime !== t.isEnd && !t.removeOnClick || this.api.dispatchAction({
                    type: "axisAreaSelect",
                    parallelAxisId: i.id,
                    intervals: a
                })
            }, dispose: function () {
                this._brushController.dispose()
            }
        });
        Tf({
            type: "parallel", render: function (e, t, i) {
                this._model = e, this._api = i, this._handlers || (this._handlers = {}, D(KC, function (e, t) {
                    i.getZr().on(t, this._handlers[t] = P(e, this))
                }, this)), Ic(this, "_throttledDispatchExpand", e.get("axisExpandRate"), "fixRate")
            }, dispose: function (e, t) {
                D(this._handlers, function (e, i) {
                    t.getZr().off(i, e)
                }), this._handlers = null
            }, _throttledDispatchExpand: function (e) {
                this._dispatchExpand(e)
            }, _dispatchExpand: function (e) {
                e && this._api.dispatchAction(k({type: "parallelAxisExpand"}, e))
            }
        });
        var KC = {
            mousedown: function (e) {
                VC(this, "click") && (this._mouseDownPoint = [e.offsetX, e.offsetY])
            }, mouseup: function (e) {
                var t = this._mouseDownPoint;
                if (VC(this, "click") && t) {
                    var i = [e.offsetX, e.offsetY];
                    if (5 < Math.pow(t[0] - i[0], 2) + Math.pow(t[1] - i[1], 2)) return;
                    var n = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);
                    "none" !== n.behavior && this._dispatchExpand({axisExpandWindow: n.axisExpandWindow})
                }
                this._mouseDownPoint = null
            }, mousemove: function (e) {
                if (!this._mouseDownPoint && VC(this, "mousemove")) {
                    var t = this._model, i = t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]),
                        n = i.behavior;
                    "jump" === n && this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")), this._throttledDispatchExpand("none" === n ? null : {
                        axisExpandWindow: i.axisExpandWindow,
                        animation: "jump" === n && null
                    })
                }
            }
        };

        function VC(e, t) {
            var i = e._model;
            return i.get("axisExpandable") && i.get("axisExpandTriggerOn") === t
        }

        function WC(e, t, i, n) {
            for (var a, o = [], r = 0; r < i.length; r++) {
                var s = i[r], l = e.get(e.mapDimension(s), t);
                a = l, ("category" === n.getAxis(s).type ? null == a : null == a || isNaN(a)) || o.push(n.dataToPoint(l, s))
            }
            return o
        }

        function GC(e, t, i, n, a) {
            var o = WC(e, i, n, a), r = new $r({shape: {points: o}, silent: !0, z2: 10});
            return t.add(r), e.setItemGraphicEl(i, r), r
        }

        function HC(e) {
            var t = e.get("smooth", !0);
            return !0 === t && (t = .3), {lineStyle: e.getModel("lineStyle").getLineStyle(), smooth: null != t ? t : .3}
        }

        function zC(e, t, i, n) {
            var a = n.lineStyle;
            t.hasItemOption && (a = t.getItemModel(i).getModel("lineStyle").getLineStyle()), e.useStyle(a);
            var o = e.style;
            o.fill = null, o.stroke = t.getItemVisual(i, "color"), o.opacity = t.getItemVisual(i, "opacity"), n.smooth && (e.shape.smooth = n.smooth)
        }

        cf(function (e) {
            var t;
            !function (e) {
                if (!e.parallel) {
                    var t = !1;
                    D(e.series, function (e) {
                        e && "parallel" === e.type && (t = !0)
                    }), t && (e.parallel = [{}])
                }
            }(e), D(Pa((t = e).parallelAxis), function (e) {
                if (R(e)) {
                    var i = e.parallelIndex || 0, n = Pa(t.parallel)[i];
                    n && n.parallelAxisDefault && m(e, n.parallelAxisDefault, !1)
                }
            })
        }), ec.extend({
            type: "series.parallel",
            dependencies: ["parallel"],
            visualColorAccessPath: "lineStyle.color",
            getInitialData: function (e, t) {
                var i = this.getSource();
                return function (e, t) {
                    if (!e.encodeDefine) {
                        var i = t.ecModel.getComponent("parallel", t.get("parallelIndex"));
                        if (i) {
                            var n = e.encodeDefine = Q();
                            D(i.dimensions, function (e) {
                                var t = function (e) {
                                    return +e.replace("dim", "")
                                }(e);
                                n.set(e, t)
                            })
                        }
                    }
                }(i, this), rg(i, this)
            },
            getRawIndicesByActiveState: function (e) {
                var t = this.coordinateSystem, i = this.getData(), n = [];
                return t.eachActiveState(i, function (t, a) {
                    e === t && n.push(i.getRawIndex(a))
                }), n
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "parallel",
                parallelIndex: 0,
                label: {show: !1},
                inactiveOpacity: .05,
                activeOpacity: 1,
                lineStyle: {width: 1, opacity: .45, type: "solid"},
                emphasis: {label: {show: !1}},
                progressive: 500,
                smooth: !1,
                animationEasing: "linear"
            }
        }), fc.extend({
            type: "parallel", init: function () {
                this._dataGroup = new Ai, this.group.add(this._dataGroup), this._data, this._initialized
            }, render: function (e, t, i, n) {
                var a = this._dataGroup, o = e.getData(), r = this._data, s = e.coordinateSystem, l = s.dimensions,
                    d = HC(e);
                if (o.diff(r).add(function (e) {
                    zC(GC(o, a, e, l, s), o, e, d)
                }).update(function (t, i) {
                    var a = r.getItemGraphicEl(i), u = WC(o, t, l, s);
                    o.setItemGraphicEl(t, a);
                    var c = n && !1 === n.animation ? null : e;
                    ol(a, {shape: {points: u}}, c, t), zC(a, o, t, d)
                }).remove(function (e) {
                    var t = r.getItemGraphicEl(e);
                    a.remove(t)
                }).execute(), !this._initialized) {
                    this._initialized = !0;
                    var u = function (e, t, i) {
                        var n = e.model, a = e.getRect(),
                            o = new es({shape: {x: a.x, y: a.y, width: a.width, height: a.height}}),
                            r = "horizontal" === n.get("layout") ? "width" : "height";
                        return o.setShape(r, 0), rl(o, {shape: {width: a.width, height: a.height}}, t, i), o
                    }(s, e, function () {
                        setTimeout(function () {
                            a.removeClipPath()
                        })
                    });
                    a.setClipPath(u)
                }
                this._data = o
            }, incrementalPrepareRender: function (e, t, i) {
                this._initialized = !0, this._data = null, this._dataGroup.removeAll()
            }, incrementalRender: function (e, t, i) {
                for (var n = t.getData(), a = t.coordinateSystem, o = a.dimensions, r = HC(t), s = e.start; s < e.end; s++) {
                    var l = GC(n, this._dataGroup, s, o, a);
                    l.incremental = !0, zC(l, n, s, r)
                }
            }, dispose: function () {
            }, remove: function () {
                this._dataGroup && this._dataGroup.removeAll(), this._data = null
            }
        });
        var jC = ["lineStyle", "normal", "opacity"];
        vf({
            seriesType: "parallel", reset: function (e, t, i) {
                var n = e.getModel("itemStyle"), a = e.getModel("lineStyle"), o = t.get("color"),
                    r = a.get("color") || n.get("color") || o[e.seriesIndex % o.length], s = e.get("inactiveOpacity"),
                    l = e.get("activeOpacity"), d = e.getModel("lineStyle").getLineStyle(), u = e.coordinateSystem,
                    c = e.getData(), h = {normal: d.opacity, active: l, inactive: s};
                return c.setVisual("color", r), {
                    progress: function (e, t) {
                        u.eachActiveState(t, function (e, i) {
                            var n = h[e];
                            if ("normal" === e && t.hasItemOption) {
                                var a = t.getItemModel(i).get(jC, !0);
                                null != a && (n = a)
                            }
                            t.setItemVisual(i, "opacity", n)
                        }, e.start, e.end)
                    }
                }
            }
        });
        var XC = ec.extend({
                type: "series.sankey",
                layoutInfo: null,
                levelModels: null,
                getInitialData: function (e, t) {
                    for (var i = e.edges || e.links, n = e.data || e.nodes, a = e.levels, o = this.levelModels = {}, r = 0; r < a.length; r++) null != a[r].depth && 0 <= a[r].depth && (o[a[r].depth] = new Sl(a[r], this, t));
                    if (n && i) return FT(n, i, this, !0, function (e, t) {
                        e.wrapMethod("getItemModel", function (e, t) {
                            return e.customizeGetParent(function (e) {
                                var i = this.parentModel, n = i.getData().getItemLayout(t).depth;
                                return i.levelModels[n] || this.parentModel
                            }), e
                        }), t.wrapMethod("getItemModel", function (e, t) {
                            return e.customizeGetParent(function (e) {
                                var i = this.parentModel, n = i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;
                                return i.levelModels[n] || this.parentModel
                            }), e
                        })
                    }).data
                },
                setNodePosition: function (e, t) {
                    var i = this.option.data[e];
                    i.localX = t[0], i.localY = t[1]
                },
                getGraph: function () {
                    return this.getData().graph
                },
                getEdgeData: function () {
                    return this.getGraph().edgeData
                },
                formatTooltip: function (e, t, i) {
                    if ("edge" === i) {
                        var n = this.getDataParams(e, i), a = n.data, o = a.source + " -- " + a.target;
                        return n.value && (o += " : " + n.value), Ql(o)
                    }
                    if ("node" !== i) return XC.superCall(this, "formatTooltip", e, t);
                    var r = this.getGraph().getNodeByIndex(e).getLayout().value, s = this.getDataParams(e, i).data.name;
                    return r && (o = s + " : " + r), Ql(o)
                },
                optionUpdated: function () {
                    var e = this.option;
                    !0 === e.focusNodeAdjacency && (e.focusNodeAdjacency = "allEdges")
                },
                getDataParams: function (e, t) {
                    var i = XC.superCall(this, "getDataParams", e, t);
                    if (null == i.value && "node" === t) {
                        var n = this.getGraph().getNodeByIndex(e).getLayout().value;
                        i.value = n
                    }
                    return i
                },
                defaultOption: {
                    zlevel: 0,
                    z: 2,
                    coordinateSystem: "view",
                    layout: null,
                    left: "5%",
                    top: "5%",
                    right: "20%",
                    bottom: "5%",
                    orient: "horizontal",
                    nodeWidth: 20,
                    nodeGap: 8,
                    draggable: !0,
                    focusNodeAdjacency: !1,
                    layoutIterations: 32,
                    label: {show: !0, position: "right", color: "#000", fontSize: 12},
                    levels: [],
                    nodeAlign: "justify",
                    itemStyle: {borderWidth: 1, borderColor: "#333"},
                    lineStyle: {color: "#314656", opacity: .2, curveness: .5},
                    emphasis: {label: {show: !0}, lineStyle: {opacity: .5}},
                    animationEasing: "linear",
                    animationDuration: 1e3
                }
            }), $C = ["itemStyle", "opacity"], YC = ["emphasis", "itemStyle", "opacity"], qC = ["lineStyle", "opacity"],
            JC = ["emphasis", "lineStyle", "opacity"];

        function ZC(e, t) {
            return e.getVisual("opacity") || e.getModel().get(t)
        }

        function QC(e, t, i) {
            var n = e.getGraphicEl(), a = ZC(e, t);
            null != i && (null == a && (a = 1), a *= i), n.downplay && n.downplay(), n.traverse(function (e) {
                "group" !== e.type && e.setStyle("opacity", a)
            })
        }

        function eS(e, t) {
            var i = ZC(e, t), n = e.getGraphicEl();
            n.traverse(function (e) {
                "group" !== e.type && e.setStyle("opacity", i)
            }), n.highlight && n.highlight()
        }

        var tS = Ss({
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, cpx1: 0, cpy1: 0, cpx2: 0, cpy2: 0, extent: 0, orient: ""},
            buildPath: function (e, t) {
                var i = t.extent;
                e.moveTo(t.x1, t.y1), e.bezierCurveTo(t.cpx1, t.cpy1, t.cpx2, t.cpy2, t.x2, t.y2), "vertical" === t.orient ? (e.lineTo(t.x2 + i, t.y2), e.bezierCurveTo(t.cpx2 + i, t.cpy2, t.cpx1 + i, t.cpy1, t.x1 + i, t.y1)) : (e.lineTo(t.x2, t.y2 + i), e.bezierCurveTo(t.cpx2, t.cpy2 + i, t.cpx1, t.cpy1 + i, t.x1, t.y1 + i)), e.closePath()
            },
            highlight: function () {
                this.trigger("emphasis")
            },
            downplay: function () {
                this.trigger("normal")
            }
        });

        function iS(e) {
            var t = e.hostGraph.data.getRawDataItem(e.dataIndex);
            return null != t.depth && 0 <= t.depth
        }

        function nS(e, t, i, n, a) {
            var o = "vertical" === a ? "x" : "y";
            D(e, function (e) {
                var r, s, l;
                e.sort(function (e, t) {
                    return e.getLayout()[o] - t.getLayout()[o]
                });
                for (var d = 0, u = e.length, c = "vertical" === a ? "dx" : "dy", h = 0; h < u; h++) 0 < (l = d - (s = e[h]).getLayout()[o]) && (r = s.getLayout()[o] + l, "vertical" === a ? s.setLayout({x: r}, !0) : s.setLayout({y: r}, !0)), d = s.getLayout()[o] + s.getLayout()[c] + t;
                if (0 < (l = d - t - ("vertical" === a ? n : i))) for (r = s.getLayout()[o] - l, "vertical" === a ? s.setLayout({x: r}, !0) : s.setLayout({y: r}, !0), d = r, h = u - 2; 0 <= h; --h) 0 < (l = (s = e[h]).getLayout()[o] + s.getLayout()[c] + t - d) && (r = s.getLayout()[o] - l, "vertical" === a ? s.setLayout({x: r}, !0) : s.setLayout({y: r}, !0)), d = s.getLayout()[o]
            })
        }

        function aS(e, t, i) {
            D(e.slice().reverse(), function (e) {
                D(e, function (e) {
                    if (e.outEdges.length) {
                        var n = cS(e.outEdges, oS, i) / cS(e.outEdges, uS, i);
                        if (isNaN(n)) {
                            var a = e.outEdges.length;
                            n = a ? cS(e.outEdges, rS, i) / a : 0
                        }
                        if ("vertical" === i) {
                            var o = e.getLayout().x + (n - dS(e, i)) * t;
                            e.setLayout({x: o}, !0)
                        } else {
                            var r = e.getLayout().y + (n - dS(e, i)) * t;
                            e.setLayout({y: r}, !0)
                        }
                    }
                })
            })
        }

        function oS(e, t) {
            return dS(e.node2, t) * e.getValue()
        }

        function rS(e, t) {
            return dS(e.node2, t)
        }

        function sS(e, t) {
            return dS(e.node1, t) * e.getValue()
        }

        function lS(e, t) {
            return dS(e.node1, t)
        }

        function dS(e, t) {
            return "vertical" === t ? e.getLayout().x + e.getLayout().dx / 2 : e.getLayout().y + e.getLayout().dy / 2
        }

        function uS(e) {
            return e.getValue()
        }

        function cS(e, t, i) {
            for (var n = 0, a = e.length, o = -1; ++o < a;) {
                var r = +t.call(e, e[o], i);
                isNaN(r) || (n += r)
            }
            return n
        }

        function hS(e, t, i) {
            D(e, function (e) {
                D(e, function (e) {
                    if (e.inEdges.length) {
                        var n = cS(e.inEdges, sS, i) / cS(e.inEdges, uS, i);
                        if (isNaN(n)) {
                            var a = e.inEdges.length;
                            n = a ? cS(e.inEdges, lS, i) / a : 0
                        }
                        if ("vertical" === i) {
                            var o = e.getLayout().x + (n - dS(e, i)) * t;
                            e.setLayout({x: o}, !0)
                        } else {
                            var r = e.getLayout().y + (n - dS(e, i)) * t;
                            e.setLayout({y: r}, !0)
                        }
                    }
                })
            })
        }

        Cf({
            type: "sankey", _model: null, _focusAdjacencyDisabled: !1, render: function (e, t, i) {
                var n = this, a = e.getGraph(), o = this.group, r = e.layoutInfo, s = r.width, l = r.height,
                    d = e.getData(), u = e.getData("edge"), c = e.get("orient");
                this._model = e, o.removeAll(), o.attr("position", [r.x, r.y]), a.eachEdge(function (t) {
                    var i = new tS;
                    i.dataIndex = t.dataIndex, i.seriesIndex = e.seriesIndex, i.dataType = "edge";
                    var n, a, r, d, h, f, g, p, v = t.getModel("lineStyle"), m = v.get("curveness"),
                        y = t.node1.getLayout(), k = t.node1.getModel(), T = k.get("localX"), w = k.get("localY"),
                        C = t.node2.getLayout(), S = t.node2.getModel(), I = S.get("localX"), b = S.get("localY"),
                        _ = t.getLayout();
                    switch (i.shape.extent = Math.max(1, _.dy), p = "vertical" === (i.shape.orient = c) ? (n = (null != T ? T * s : y.x) + _.sy, a = (null != w ? w * l : y.y) + y.dy, r = (null != I ? I * s : C.x) + _.ty, h = n, f = a * (1 - m) + (d = null != b ? b * l : C.y) * m, g = r, a * m + d * (1 - m)) : (n = (null != T ? T * s : y.x) + y.dx, a = (null != w ? w * l : y.y) + _.sy, h = n * (1 - m) + (r = null != I ? I * s : C.x) * m, f = a, g = n * m + r * (1 - m), d = (null != b ? b * l : C.y) + _.ty), i.setShape({
                        x1: n,
                        y1: a,
                        x2: r,
                        y2: d,
                        cpx1: h,
                        cpy1: f,
                        cpx2: g,
                        cpy2: p
                    }), i.setStyle(v.getItemStyle()), i.style.fill) {
                        case"source":
                            i.style.fill = t.node1.getVisual("color");
                            break;
                        case"target":
                            i.style.fill = t.node2.getVisual("color")
                    }
                    zs(i, t.getModel("emphasis.lineStyle").getItemStyle()), o.add(i), u.setItemGraphicEl(t.dataIndex, i)
                }), a.eachNode(function (t) {
                    var i = t.getLayout(), n = t.getModel(), a = n.get("localX"), r = n.get("localY"),
                        u = n.getModel("label"), c = n.getModel("emphasis.label"), h = new es({
                            shape: {
                                x: null != a ? a * s : i.x,
                                y: null != r ? r * l : i.y,
                                width: i.dx,
                                height: i.dy
                            }, style: n.getModel("itemStyle").getItemStyle()
                        }), f = t.getModel("emphasis.itemStyle").getItemStyle();
                    Ys(h.style, f, u, c, {
                        labelFetcher: e,
                        labelDataIndex: t.dataIndex,
                        defaultText: t.id,
                        isRectText: !0
                    }), h.setStyle("fill", t.getVisual("color")), zs(h, f), o.add(h), d.setItemGraphicEl(t.dataIndex, h), h.dataType = "node"
                }), d.eachItemGraphicEl(function (t, a) {
                    var o = d.getItemModel(a);
                    o.get("draggable") && (t.drift = function (t, o) {
                        n._focusAdjacencyDisabled = !0, this.shape.x += t, this.shape.y += o, this.dirty(), i.dispatchAction({
                            type: "dragNode",
                            seriesId: e.id,
                            dataIndex: d.getRawIndex(a),
                            localX: this.shape.x / s,
                            localY: this.shape.y / l
                        })
                    }, t.ondragend = function () {
                        n._focusAdjacencyDisabled = !1
                    }, t.draggable = !0, t.cursor = "move"), t.highlight = function () {
                        this.trigger("emphasis")
                    }, t.downplay = function () {
                        this.trigger("normal")
                    }, t.focusNodeAdjHandler && t.off("mouseover", t.focusNodeAdjHandler), t.unfocusNodeAdjHandler && t.off("mouseout", t.unfocusNodeAdjHandler), o.get("focusNodeAdjacency") && (t.on("mouseover", t.focusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || (n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            dataIndex: t.dataIndex
                        }))
                    }), t.on("mouseout", t.unfocusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || n._dispatchUnfocus(i)
                    }))
                }), u.eachItemGraphicEl(function (t, a) {
                    var o = u.getItemModel(a);
                    t.focusNodeAdjHandler && t.off("mouseover", t.focusNodeAdjHandler), t.unfocusNodeAdjHandler && t.off("mouseout", t.unfocusNodeAdjHandler), o.get("focusNodeAdjacency") && (t.on("mouseover", t.focusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || (n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            edgeDataIndex: t.dataIndex
                        }))
                    }), t.on("mouseout", t.unfocusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || n._dispatchUnfocus(i)
                    }))
                }), !this._data && e.get("animation") && o.setClipPath(function (e, t, i) {
                    var n = new es({shape: {x: e.x - 10, y: e.y - 10, width: 0, height: e.height + 20}});
                    return rl(n, {shape: {width: e.width + 20}}, t, function () {
                        o.removeClipPath()
                    }), n
                }(o.getBoundingRect(), e)), this._data = e.getData()
            }, dispose: function () {
                this._clearTimer()
            }, _dispatchUnfocus: function (e) {
                var t = this;
                this._clearTimer(), this._unfocusDelayTimer = setTimeout(function () {
                    t._unfocusDelayTimer = null, e.dispatchAction({type: "unfocusNodeAdjacency", seriesId: t._model.id})
                }, 500)
            }, _clearTimer: function () {
                this._unfocusDelayTimer && (clearTimeout(this._unfocusDelayTimer), this._unfocusDelayTimer = null)
            }, focusNodeAdjacency: function (e, t, i, n) {
                var a = e.getData(), o = a.graph, r = n.dataIndex, s = a.getItemModel(r), l = n.edgeDataIndex;
                if (null != r || null != l) {
                    var d = o.getNodeByIndex(r), u = o.getEdgeByIndex(l);
                    if (o.eachNode(function (e) {
                        QC(e, $C, .1)
                    }), o.eachEdge(function (e) {
                        QC(e, qC, .1)
                    }), d) {
                        eS(d, YC);
                        var c = s.get("focusNodeAdjacency");
                        "outEdges" === c ? D(d.outEdges, function (e) {
                            e.dataIndex < 0 || (eS(e, JC), eS(e.node2, YC))
                        }) : "inEdges" === c ? D(d.inEdges, function (e) {
                            e.dataIndex < 0 || (eS(e, JC), eS(e.node1, YC))
                        }) : "allEdges" === c && D(d.edges, function (e) {
                            e.dataIndex < 0 || (eS(e, JC), e.node1 !== d && eS(e.node1, YC), e.node2 !== d && eS(e.node2, YC))
                        })
                    }
                    u && (eS(u, JC), eS(u.node1, YC), eS(u.node2, YC))
                }
            }, unfocusNodeAdjacency: function (e, t, i, n) {
                var a = e.getGraph();
                a.eachNode(function (e) {
                    QC(e, $C)
                }), a.eachEdge(function (e) {
                    QC(e, qC)
                })
            }
        }), ff({type: "dragNode", event: "dragnode", update: "update"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sankey", query: e}, function (t) {
                t.setNodePosition(e.dataIndex, [e.localX, e.localY])
            })
        }), pf(function (e, t, i) {
            e.eachSeriesByType("sankey", function (e) {
                var i = e.get("nodeWidth"), n = e.get("nodeGap"), a = function (e, t) {
                    return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                }(e, t), o = (e.layoutInfo = a).width, r = a.height, s = e.getGraph(), l = s.nodes, d = s.edges;
                !function (e) {
                    D(e, function (e) {
                        var t = cS(e.outEdges, uS), i = cS(e.inEdges, uS), n = e.getValue() || 0, a = Math.max(t, i, n);
                        e.setLayout({value: a}, !0)
                    })
                }(l), function (e, t, i, n, a, o, r, s, l) {
                    (function (e, t, i, n, a, o, r) {
                        for (var s = [], l = [], d = [], u = [], c = 0, h = 0; h < t.length; h++) s[h] = 1;
                        for (h = 0; h < e.length; h++) l[h] = e[h].inEdges.length, 0 === l[h] && d.push(e[h]);
                        for (var f = -1; d.length;) {
                            for (var g = 0; g < d.length; g++) {
                                var p = d[g], v = p.hostGraph.data.getRawDataItem(p.dataIndex),
                                    m = null != v.depth && 0 <= v.depth;
                                m && v.depth > f && (f = v.depth), p.setLayout({depth: m ? v.depth : c}, !0), "vertical" === o ? p.setLayout({dy: i}, !0) : p.setLayout({dx: i}, !0);
                                for (var y = 0; y < p.outEdges.length; y++) {
                                    var k = p.outEdges[y], T = t.indexOf(k);
                                    s[T] = 0;
                                    var w = k.node2, C = e.indexOf(w);
                                    0 == --l[C] && u.indexOf(w) < 0 && u.push(w)
                                }
                            }
                            ++c, d = u, u = []
                        }
                        for (h = 0; h < s.length; h++) if (1 === s[h]) throw new Error("Sankey is a DAG, the original data has cycle!");
                        var S = c - 1 < f ? f : c - 1;
                        r && "left" !== r && function (e, t, i, n) {
                            if ("right" === t) {
                                for (var a = [], o = e, r = 0; o.length;) {
                                    for (var s = 0; s < o.length; s++) {
                                        var l = o[s];
                                        l.setLayout({skNodeHeight: r}, !0);
                                        for (var d = 0; d < l.inEdges.length; d++) {
                                            var u = l.inEdges[d];
                                            a.indexOf(u.node1) < 0 && a.push(u.node1)
                                        }
                                    }
                                    o = a, a = [], ++r
                                }
                                D(e, function (e) {
                                    iS(e) || e.setLayout({depth: Math.max(0, n - e.getLayout().skNodeHeight)}, !0)
                                })
                            } else "justify" === t && function (e, t) {
                                D(e, function (e) {
                                    iS(e) || e.outEdges.length || e.setLayout({depth: t}, !0)
                                })
                            }(e, n)
                        }(e, r, 0, S), function (e, t, i) {
                            D(e, function (e) {
                                var n = e.getLayout().depth * t;
                                "vertical" === i ? e.setLayout({y: n}, !0) : e.setLayout({x: n}, !0)
                            })
                        }(e, "vertical" === o ? (a - i) / S : (n - i) / S, o)
                    })(e, t, i, a, o, s, l), function (e, t, i, n, a, o, r) {
                        var s = function (e, t) {
                            var i = [], n = "x", a = Xa(e, function (e) {
                                return e.getLayout()[n]
                            });
                            return a.keys.sort(function (e, t) {
                                return e - t
                            }), D(a.keys, function (e) {
                                i.push(a.buckets.get(e))
                            }), i
                        }(e);
                        (function (e, t, i, n, a, o) {
                            var r = 1 / 0;
                            D(e, function (e) {
                                var t = e.length, s = 0;
                                D(e, function (e) {
                                    s += e.getLayout().value
                                });
                                var l = "vertical" === o ? (n - (t - 1) * a) / s : (i - (t - 1) * a) / s;
                                l < r && (r = l)
                            }), D(e, function (e) {
                                D(e, function (e, t) {
                                    var i = e.getLayout().value * r;
                                    "vertical" === o ? (e.setLayout({x: t}, !0), e.setLayout({dx: i}, !0)) : (e.setLayout({y: t}, !0), e.setLayout({dy: i}, !0))
                                })
                            }), D(t, function (e) {
                                var t = +e.getValue() * r;
                                e.setLayout({dy: t}, !0)
                            })
                        })(s, t, i, n, a, r), nS(s, a, i, n, r);
                        for (var l = 1; 0 < o; o--) aS(s, l *= .99, r), nS(s, a, i, n, r), hS(s, l, r), nS(s, a, i, n, r)
                    }(e, t, o, a, n, r, s), function (e, t) {
                        var i = "y";
                        D(e, function (e) {
                            e.outEdges.sort(function (e, t) {
                                return e.node2.getLayout()[i] - t.node2.getLayout()[i]
                            }), e.inEdges.sort(function (e, t) {
                                return e.node1.getLayout()[i] - t.node1.getLayout()[i]
                            })
                        }), D(e, function (e) {
                            var t = 0, i = 0;
                            D(e.outEdges, function (e) {
                                e.setLayout({sy: t}, !0), t += e.getLayout().dy
                            }), D(e.inEdges, function (e) {
                                e.setLayout({ty: i}, !0), i += e.getLayout().dy
                            })
                        })
                    }(e)
                }(l, d, i, n, o, r, 0 !== x(l, function (e) {
                    return 0 === e.getLayout().value
                }).length ? 0 : e.get("layoutIterations"), e.get("orient"), e.get("nodeAlign"))
            })
        }), vf(function (e, t) {
            e.eachSeriesByType("sankey", function (e) {
                var t = e.getGraph().nodes;
                if (t.length) {
                    var i = 1 / 0, n = -1 / 0;
                    D(t, function (e) {
                        var t = e.getLayout().value;
                        t < i && (i = t), n < t && (n = t)
                    }), D(t, function (t) {
                        var a = new Jk({
                            type: "color",
                            mappingMethod: "linear",
                            dataExtent: [i, n],
                            visual: e.get("color")
                        }).mapValueToVisual(t.getLayout().value), o = t.getModel().get("itemStyle.color");
                        null != o ? t.setVisual("color", o) : t.setVisual("color", a)
                    })
                }
            })
        });
        var fS = {
            _baseAxisDim: null, getInitialData: function (e, t) {
                var i, n, a = t.getComponent("xAxis", this.get("xAxisIndex")),
                    o = t.getComponent("yAxis", this.get("yAxisIndex")), r = a.get("type"), s = o.get("type");
                "category" === r ? (e.layout = "horizontal", i = a.getOrdinalMeta(), n = !0) : "category" === s ? (e.layout = "vertical", i = o.getOrdinalMeta(), n = !0) : e.layout = e.layout || "horizontal";
                var l = ["x", "y"], d = "horizontal" === e.layout ? 0 : 1, u = this._baseAxisDim = l[d], c = l[1 - d],
                    h = [a, o], f = h[d].get("type"), g = h[1 - d].get("type"), p = e.data;
                if (p && n) {
                    var v = [];
                    D(p, function (e, t) {
                        var i;
                        e.value && M(e.value) ? (i = e.value.slice(), e.value.unshift(t)) : M(e) ? (i = e.slice(), e.unshift(t)) : i = e, v.push(i)
                    }), e.data = v
                }
                var m = this.defaultValueDimensions, y = [{
                    name: u,
                    type: Af(f),
                    ordinalMeta: i,
                    otherDims: {tooltip: !1, itemName: 0},
                    dimsDef: ["base"]
                }, {name: c, type: Af(g), dimsDef: m.slice()}];
                return Om(this, {coordDimensions: y, dimensionsCount: m.length + 1, encodeDefaulter: O(zd, y, this)})
            }, getBaseAxis: function () {
                var e = this._baseAxisDim;
                return this.ecModel.getComponent(e + "Axis", this.get(e + "AxisIndex")).axis
            }
        };
        b(ec.extend({
            type: "series.boxplot",
            dependencies: ["xAxis", "yAxis", "grid"],
            defaultValueDimensions: [{name: "min", defaultTooltip: !0}, {
                name: "Q1",
                defaultTooltip: !0
            }, {name: "median", defaultTooltip: !0}, {name: "Q3", defaultTooltip: !0}, {
                name: "max",
                defaultTooltip: !0
            }],
            dimensions: null,
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                hoverAnimation: !0,
                layout: null,
                boxWidth: [7, 50],
                itemStyle: {color: "#fff", borderWidth: 1},
                emphasis: {
                    itemStyle: {
                        borderWidth: 2,
                        shadowBlur: 5,
                        shadowOffsetX: 2,
                        shadowOffsetY: 2,
                        shadowColor: "rgba(0,0,0,0.4)"
                    }
                },
                animationEasing: "elasticOut",
                animationDuration: 800
            }
        }), fS, !0);
        var gS = ["itemStyle"], pS = ["emphasis", "itemStyle"], vS = (fc.extend({
            type: "boxplot", render: function (e, t, i) {
                var n = e.getData(), a = this.group, o = this._data;
                this._data || a.removeAll();
                var r = "horizontal" === e.get("layout") ? 1 : 0;
                n.diff(o).add(function (e) {
                    if (n.hasValue(e)) {
                        var t = mS(n.getItemLayout(e), n, e, r, !0);
                        n.setItemGraphicEl(e, t), a.add(t)
                    }
                }).update(function (e, t) {
                    var i = o.getItemGraphicEl(t);
                    if (n.hasValue(e)) {
                        var s = n.getItemLayout(e);
                        i ? yS(s, i, n, e) : i = mS(s, n, e, r), a.add(i), n.setItemGraphicEl(e, i)
                    } else a.remove(i)
                }).remove(function (e) {
                    var t = o.getItemGraphicEl(e);
                    t && a.remove(t)
                }).execute(), this._data = n
            }, remove: function (e) {
                var t = this.group, i = this._data;
                this._data = null, i && i.eachItemGraphicEl(function (e) {
                    e && t.remove(e)
                })
            }, dispose: te
        }), wr.extend({
            type: "boxplotBoxPath", shape: {}, buildPath: function (e, t) {
                var i = t.points, n = 0;
                for (e.moveTo(i[n][0], i[n][1]), n++; n < 4; n++) e.lineTo(i[n][0], i[n][1]);
                for (e.closePath(); n < i.length; n++) e.moveTo(i[n][0], i[n][1]), n++, e.lineTo(i[n][0], i[n][1])
            }
        }));

        function mS(e, t, i, n, a) {
            var o = e.ends, r = new vS({
                shape: {
                    points: a ? function (e, t, i) {
                        return A(e, function (e) {
                            return (e = e.slice())[t] = i.initBaseline, e
                        })
                    }(o, n, e) : o
                }
            });
            return yS(e, r, t, i, a), r
        }

        function yS(e, t, i, n, a) {
            var o = i.hostModel;
            (0, vl[a ? "initProps" : "updateProps"])(t, {shape: {points: e.ends}}, o, n);
            var r = i.getItemModel(n), s = r.getModel(gS), l = i.getItemVisual(n, "color"),
                d = s.getItemStyle(["borderColor"]);
            d.stroke = l, d.strokeNoScale = !0, t.useStyle(d), t.z2 = 100, zs(t, r.getModel(pS).getItemStyle())
        }

        var kS = ["itemStyle", "borderColor"], TS = D;
        vf(function (e, t) {
            var i = e.get("color");
            e.eachRawSeriesByType("boxplot", function (t) {
                var n = i[t.seriesIndex % i.length], a = t.getData();
                a.setVisual({
                    legendSymbol: "roundRect",
                    color: t.get(kS) || n
                }), e.isSeriesFiltered(t) || a.each(function (e) {
                    var t = a.getItemModel(e);
                    a.setItemVisual(e, {color: t.get(kS, !0)})
                })
            })
        }), pf(function (e) {
            var t = function (e) {
                var t = [], i = [];
                return e.eachSeriesByType("boxplot", function (e) {
                    var n = e.getBaseAxis(), a = S(i, n);
                    a < 0 && (a = i.length, i[a] = n, t[a] = {axis: n, seriesModels: []}), t[a].seriesModels.push(e)
                }), t
            }(e);
            TS(t, function (e) {
                var t = e.seriesModels;
                t.length && (function (e) {
                    var t, i, n = e.axis, a = e.seriesModels, o = a.length, r = e.boxWidthList = [],
                        s = e.boxOffsetList = [], l = [];
                    if ("category" === n.type) i = n.getBandWidth(); else {
                        var d = 0;
                        TS(a, function (e) {
                            d = Math.max(d, e.getData().count())
                        }), t = n.getExtent(), Math.abs(t[1] - t[0])
                    }
                    TS(a, function (e) {
                        var t = e.get("boxWidth");
                        M(t) || (t = [t, t]), l.push([xl(t[0], i) || 0, xl(t[1], i) || 0])
                    });
                    var u = .8 * i - 2, c = u / o * .3, h = (u - c * (o - 1)) / o, f = h / 2 - u / 2;
                    TS(a, function (e, t) {
                        s.push(f), f += c + h, r.push(Math.min(Math.max(h, l[t][0]), l[t][1]))
                    })
                }(e), TS(t, function (t, i) {
                    !function (e, t, i) {
                        var n = e.coordinateSystem, a = e.getData(), o = i / 2,
                            r = "horizontal" === e.get("layout") ? 0 : 1, s = 1 - r, l = ["x", "y"],
                            d = a.mapDimension(l[r]), u = a.mapDimension(l[s], !0);
                        if (!(null == d || u.length < 5)) for (var c = 0; c < a.count(); c++) {
                            var h = a.get(d, c), f = k(h, u[2], c), g = k(h, u[0], c), p = k(h, u[1], c),
                                v = k(h, u[3], c), m = k(h, u[4], c), y = [];
                            T(y, p, 0), T(y, v, 1), y.push(g, p, m, v), w(y, g), w(y, m), w(y, f), a.setItemLayout(c, {
                                initBaseline: f[s],
                                ends: y
                            })
                        }

                        function k(e, i, o) {
                            var l, d = a.get(i, o), u = [];
                            return u[r] = e, u[s] = d, isNaN(e) || isNaN(d) ? l = [NaN, NaN] : (l = n.dataToPoint(u))[r] += t, l
                        }

                        function T(e, t, i) {
                            var n = t.slice(), a = t.slice();
                            n[r] += o, a[r] -= o, i ? e.push(n, a) : e.push(a, n)
                        }

                        function w(e, t) {
                            var i = t.slice(), n = t.slice();
                            i[r] -= o, n[r] += o, e.push(i, n)
                        }
                    }(t, e.boxOffsetList[i], e.boxWidthList[i])
                }))
            })
        }), b(ec.extend({
            type: "series.candlestick",
            dependencies: ["xAxis", "yAxis", "grid"],
            defaultValueDimensions: [{name: "open", defaultTooltip: !0}, {
                name: "close",
                defaultTooltip: !0
            }, {name: "lowest", defaultTooltip: !0}, {name: "highest", defaultTooltip: !0}],
            dimensions: null,
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                hoverAnimation: !0,
                layout: null,
                clip: !0,
                itemStyle: {
                    color: "#c23531",
                    color0: "#314656",
                    borderWidth: 1,
                    borderColor: "#c23531",
                    borderColor0: "#314656"
                },
                emphasis: {itemStyle: {borderWidth: 2}},
                barMaxWidth: null,
                barMinWidth: null,
                barWidth: null,
                large: !0,
                largeThreshold: 600,
                progressive: 3e3,
                progressiveThreshold: 1e4,
                progressiveChunkMode: "mod",
                animationUpdate: !1,
                animationEasing: "linear",
                animationDuration: 300
            },
            getShadowDim: function () {
                return "open"
            },
            brushSelector: function (e, t, i) {
                var n = t.getItemLayout(e);
                return n && i.rect(n.brushRect)
            }
        }), fS, !0);
        var wS = ["itemStyle"], CS = ["emphasis", "itemStyle"], SS = ["color", "color0", "borderColor", "borderColor0"],
            IS = (fc.extend({
                type: "candlestick", render: function (e, t, i) {
                    this.group.removeClipPath(), this._updateDrawMode(e), this._isLargeDraw ? this._renderLarge(e) : this._renderNormal(e)
                }, incrementalPrepareRender: function (e, t, i) {
                    this._clear(), this._updateDrawMode(e)
                }, incrementalRender: function (e, t, i, n) {
                    this._isLargeDraw ? this._incrementalRenderLarge(e, t) : this._incrementalRenderNormal(e, t)
                }, _updateDrawMode: function (e) {
                    var t = e.pipelineContext.large;
                    (null == this._isLargeDraw || t ^ this._isLargeDraw) && (this._isLargeDraw = t, this._clear())
                }, _renderNormal: function (e) {
                    var t = e.getData(), i = this._data, n = this.group, a = t.getLayout("isSimpleBox"),
                        o = e.get("clip", !0), r = e.coordinateSystem, s = r.getArea && r.getArea();
                    this._data || n.removeAll(), t.diff(i).add(function (i) {
                        if (t.hasValue(i)) {
                            var r, l = t.getItemLayout(i);
                            if (o && _S(s, l)) return;
                            rl(r = bS(l, 0, !0), {shape: {points: l.ends}}, e, i), DS(r, t, i, a), n.add(r), t.setItemGraphicEl(i, r)
                        }
                    }).update(function (r, l) {
                        var d = i.getItemGraphicEl(l);
                        if (t.hasValue(r)) {
                            var u = t.getItemLayout(r);
                            o && _S(s, u) ? n.remove(d) : (d ? ol(d, {shape: {points: u.ends}}, e, r) : d = bS(u), DS(d, t, r, a), n.add(d), t.setItemGraphicEl(r, d))
                        } else n.remove(d)
                    }).remove(function (e) {
                        var t = i.getItemGraphicEl(e);
                        t && n.remove(t)
                    }).execute(), this._data = t
                }, _renderLarge: function (e) {
                    this._clear(), NS(e, this.group);
                    var t = e.get("clip", !0) ? cv(e.coordinateSystem, !1, e) : null;
                    t ? this.group.setClipPath(t) : this.group.removeClipPath()
                }, _incrementalRenderNormal: function (e, t) {
                    for (var i, n = t.getData(), a = n.getLayout("isSimpleBox"); null != (i = e.next());) {
                        var o;
                        DS(o = bS(n.getItemLayout(i)), n, i, a), o.incremental = !0, this.group.add(o)
                    }
                }, _incrementalRenderLarge: function (e, t) {
                    NS(t, this.group, !0)
                }, remove: function (e) {
                    this._clear()
                }, _clear: function () {
                    this.group.removeAll(), this._data = null
                }, dispose: te
            }), wr.extend({
                type: "normalCandlestickBox", shape: {}, buildPath: function (e, t) {
                    var i = t.points;
                    this.__simpleBox ? (e.moveTo(i[4][0], i[4][1]), e.lineTo(i[6][0], i[6][1])) : (e.moveTo(i[0][0], i[0][1]), e.lineTo(i[1][0], i[1][1]), e.lineTo(i[2][0], i[2][1]), e.lineTo(i[3][0], i[3][1]), e.closePath(), e.moveTo(i[4][0], i[4][1]), e.lineTo(i[5][0], i[5][1]), e.moveTo(i[6][0], i[6][1]), e.lineTo(i[7][0], i[7][1]))
                }
            }));

        function bS(e, t, i) {
            var n = e.ends;
            return new IS({
                shape: {
                    points: i ? function (e, t) {
                        return A(e, function (e) {
                            return (e = e.slice())[1] = t.initBaseline, e
                        })
                    }(n, e) : n
                }, z2: 100
            })
        }

        function _S(e, t) {
            for (var i = !0, n = 0; n < t.ends.length; n++) if (e.contain(t.ends[n][0], t.ends[n][1])) {
                i = !1;
                break
            }
            return i
        }

        function DS(e, t, i, n) {
            var a = t.getItemModel(i), o = a.getModel(wS), r = t.getItemVisual(i, "color"),
                s = t.getItemVisual(i, "borderColor") || r, l = o.getItemStyle(SS);
            e.useStyle(l), e.style.strokeNoScale = !0, e.style.fill = r, e.style.stroke = s, e.__simpleBox = n, zs(e, a.getModel(CS).getItemStyle())
        }

        var AS = wr.extend({
            type: "largeCandlestickBox", shape: {}, buildPath: function (e, t) {
                for (var i = t.points, n = 0; n < i.length;) if (this.__sign === i[n++]) {
                    var a = i[n++];
                    e.moveTo(a, i[n++]), e.lineTo(a, i[n++])
                } else n += 3
            }
        });

        function NS(e, t, i) {
            var n = e.getData(), a = n.getLayout("largePoints"), o = new AS({shape: {points: a}, __sign: 1});
            t.add(o);
            var r = new AS({shape: {points: a}, __sign: -1});
            t.add(r), xS(1, o, e, n), xS(-1, r, e, n), i && (o.incremental = !0, r.incremental = !0)
        }

        function xS(e, t, i, n) {
            var a = 0 < e ? "P" : "N", o = n.getVisual("borderColor" + a) || n.getVisual("color" + a),
                r = i.getModel(wS).getItemStyle(SS);
            t.useStyle(r), t.style.fill = null, t.style.stroke = o
        }

        var ES = ["itemStyle", "borderColor"], PS = ["itemStyle", "borderColor0"], OS = ["itemStyle", "color"],
            MS = ["itemStyle", "color0"], FS = {
                seriesType: "candlestick", plan: uc(), performRawSeries: !0, reset: function (e, t) {
                    if (e.getData().setVisual({
                        legendSymbol: "roundRect",
                        colorP: i(1, e),
                        colorN: i(-1, e),
                        borderColorP: n(1, e),
                        borderColorN: n(-1, e)
                    }), !t.isSeriesFiltered(e)) return !e.pipelineContext.large && {
                        progress: function (e, t) {
                            for (var a; null != (a = e.next());) {
                                var o = t.getItemModel(a), r = t.getItemLayout(a).sign;
                                t.setItemVisual(a, {color: i(r, o), borderColor: n(r, o)})
                            }
                        }
                    };

                    function i(e, t) {
                        return t.get(0 < e ? OS : MS)
                    }

                    function n(e, t) {
                        return t.get(0 < e ? ES : PS)
                    }
                }
            }, LS = "undefined" != typeof Float32Array ? Float32Array : Array, RS = {
                seriesType: "candlestick", plan: uc(), reset: function (e) {
                    var t = e.coordinateSystem, i = e.getData(), n = function (e, t) {
                            var i, n = e.getBaseAxis(),
                                a = "category" === n.type ? n.getBandWidth() : (i = n.getExtent(), Math.abs(i[1] - i[0]) / t.count()),
                                o = xl(G(e.get("barMaxWidth"), a), a), r = xl(G(e.get("barMinWidth"), 1), a),
                                s = e.get("barWidth");
                            return null != s ? xl(s, a) : Math.max(Math.min(a / 2, o), r)
                        }(e, i), a = ["x", "y"], o = i.mapDimension(a[0]), r = i.mapDimension(a[1], !0), s = r[0], l = r[1],
                        d = r[2], u = r[3];
                    if (i.setLayout({candleWidth: n, isSimpleBox: n <= 1.3}), !(null == o || r.length < 4)) return {
                        progress: e.pipelineContext.large ? function (e, i) {
                            for (var n, a, r = new LS(4 * e.count), c = 0, h = [], f = []; null != (a = e.next());) {
                                var g = i.get(o, a), p = i.get(s, a), v = i.get(l, a), m = i.get(d, a), y = i.get(u, a);
                                isNaN(g) || isNaN(m) || isNaN(y) ? (r[c++] = NaN, c += 3) : (r[c++] = BS(i, a, p, v, l), h[0] = g, h[1] = m, n = t.dataToPoint(h, null, f), r[c++] = n ? n[0] : NaN, r[c++] = n ? n[1] : NaN, h[1] = y, n = t.dataToPoint(h, null, f), r[c++] = n ? n[1] : NaN)
                            }
                            i.setLayout("largePoints", r)
                        } : function (e, i) {
                            for (var a; null != (a = e.next());) {
                                var r = i.get(o, a), c = i.get(s, a), h = i.get(l, a), f = i.get(d, a), g = i.get(u, a),
                                    p = Math.min(c, h), v = Math.max(c, h), m = C(p, r), y = C(v, r), k = C(f, r),
                                    T = C(g, r), w = [];
                                S(w, y, 0), S(w, m, 1), w.push(b(T), b(y), b(k), b(m)), i.setItemLayout(a, {
                                    sign: BS(i, a, c, h, l),
                                    initBaseline: h < c ? y[1] : m[1],
                                    ends: w,
                                    brushRect: I(f, g, r)
                                })
                            }

                            function C(e, i) {
                                var n = [];
                                return n[0] = i, n[1] = e, isNaN(i) || isNaN(e) ? [NaN, NaN] : t.dataToPoint(n)
                            }

                            function S(e, t, i) {
                                var a = t.slice(), o = t.slice();
                                a[0] = Es(a[0] + n / 2, 1, !1), o[0] = Es(o[0] - n / 2, 1, !0), i ? e.push(a, o) : e.push(o, a)
                            }

                            function I(e, t, i) {
                                var a = C(e, i), o = C(t, i);
                                return a[0] -= n / 2, o[0] -= n / 2, {x: a[0], y: a[1], width: n, height: o[1] - a[1]}
                            }

                            function b(e) {
                                return e[0] = Es(e[0], 1), e
                            }
                        }
                    }
                }
            };

        function BS(e, t, i, n, a) {
            return n < i ? -1 : i < n ? 1 : 0 < t ? e.get(a, t - 1) <= n ? 1 : -1 : 1
        }

        function US(e, t) {
            var i = t.rippleEffectColor || t.color;
            e.eachChild(function (e) {
                e.attr({
                    z: t.z,
                    zlevel: t.zlevel,
                    style: {stroke: "stroke" === t.brushType ? i : null, fill: "fill" === t.brushType ? i : null}
                })
            })
        }

        function KS(e, t) {
            Ai.call(this);
            var i = new Mp(e, t), n = new Ai;
            this.add(i), this.add(n), n.beforeUpdate = function () {
                this.attr(i.getScale())
            }, this.updateData(e, t)
        }

        cf(function (e) {
            e && M(e.series) && D(e.series, function (e) {
                R(e) && "k" === e.type && (e.type = "candlestick")
            })
        }), vf(FS), pf(RS), ec.extend({
            type: "series.effectScatter",
            dependencies: ["grid", "polar"],
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            brushSelector: "point",
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                effectType: "ripple",
                progressive: 0,
                showEffectOn: "render",
                rippleEffect: {period: 4, scale: 2.5, brushType: "fill"},
                symbolSize: 10
            }
        });
        var VS = KS.prototype;
        VS.stopEffectAnimation = function () {
            this.childAt(1).removeAll()
        }, VS.startEffectAnimation = function (e) {
            for (var t = e.symbolType, i = e.color, n = this.childAt(1), a = 0; a < 3; a++) {
                var o = cp(t, -1, -1, 2, 2, i);
                o.attr({style: {strokeNoScale: !0}, z2: 99, silent: !0, scale: [.5, .5]});
                var r = -a / 3 * e.period + e.effectOffset;
                o.animate("", !0).when(e.period, {scale: [e.rippleScale / 2, e.rippleScale / 2]}).delay(r).start(), o.animateStyle(!0).when(e.period, {opacity: 0}).delay(r).start(), n.add(o)
            }
            US(n, e)
        }, VS.updateEffectAnimation = function (e) {
            for (var t = this._effectCfg, i = this.childAt(1), n = ["symbolType", "period", "rippleScale"], a = 0; a < n.length; a++) {
                var o = n[a];
                if (t[o] !== e[o]) return this.stopEffectAnimation(), void this.startEffectAnimation(e)
            }
            US(i, e)
        }, VS.highlight = function () {
            this.trigger("emphasis")
        }, VS.downplay = function () {
            this.trigger("normal")
        }, VS.updateData = function (e, t) {
            var i = e.hostModel;
            this.childAt(0).updateData(e, t);
            var n = this.childAt(1), a = e.getItemModel(t), o = e.getItemVisual(t, "symbol"), r = function (e) {
                return M(e) || (e = [+e, +e]), e
            }(e.getItemVisual(t, "symbolSize")), s = e.getItemVisual(t, "color");
            n.attr("scale", r), n.traverse(function (e) {
                e.attr({fill: s})
            });
            var l = a.getShallow("symbolOffset");
            if (l) {
                var d = n.position;
                d[0] = xl(l[0], r[0]), d[1] = xl(l[1], r[1])
            }
            var u = e.getItemVisual(t, "symbolRotate");
            n.rotation = (u || 0) * Math.PI / 180 || 0;
            var c = {};
            if (c.showEffectOn = i.get("showEffectOn"), c.rippleScale = a.get("rippleEffect.scale"), c.brushType = a.get("rippleEffect.brushType"), c.period = 1e3 * a.get("rippleEffect.period"), c.effectOffset = t / e.count(), c.z = a.getShallow("z") || 0, c.zlevel = a.getShallow("zlevel") || 0, c.symbolType = o, c.color = s, c.rippleEffectColor = a.get("rippleEffect.color"), this.off("mouseover").off("mouseout").off("emphasis").off("normal"), "render" === c.showEffectOn) this._effectCfg ? this.updateEffectAnimation(c) : this.startEffectAnimation(c), this._effectCfg = c; else {
                this._effectCfg = null, this.stopEffectAnimation();
                var h = this.childAt(0), f = function () {
                    h.highlight(), "render" !== c.showEffectOn && this.startEffectAnimation(c)
                }, g = function () {
                    h.downplay(), "render" !== c.showEffectOn && this.stopEffectAnimation()
                };
                this.on("mouseover", f, this).on("mouseout", g, this).on("emphasis", f, this).on("normal", g, this)
            }
            this._effectCfg = c
        }, VS.fadeOut = function (e) {
            this.off("mouseover").off("mouseout").off("emphasis").off("normal"), e && e()
        }, I(KS, Ai), Cf({
            type: "effectScatter", init: function () {
                this._symbolDraw = new Hp(KS)
            }, render: function (e, t, i) {
                var n = e.getData(), a = this._symbolDraw;
                a.updateData(n), this.group.add(a.group)
            }, updateTransform: function (e, t, i) {
                var n = e.getData();
                this.group.dirty();
                var a = yv().reset(e);
                a.progress && a.progress({start: 0, end: n.count()}, n), this._symbolDraw.updateLayout(n)
            }, _updateGroupTransform: function (e) {
                var t = e.coordinateSystem;
                t && t.getRoamTransform && (this.group.transform = ft(t.getRoamTransform()), this.group.decomposeTransform())
            }, remove: function (e, t) {
                this._symbolDraw && this._symbolDraw.remove(t)
            }, dispose: function () {
            }
        }), vf(mv("effectScatter", "circle")), pf(yv("effectScatter"));
        var WS = "undefined" == typeof Uint32Array ? Array : Uint32Array,
            GS = "undefined" == typeof Float64Array ? Array : Float64Array;

        function HS(e) {
            var t = e.data;
            t && t[0] && t[0][0] && t[0][0].coord && (e.data = A(t, function (e) {
                var t = {coords: [e[0].coord, e[1].coord]};
                return e[0].name && (t.fromName = e[0].name), e[1].name && (t.toName = e[1].name), y([t, e[0], e[1]])
            }))
        }

        var zS = ec.extend({
            type: "series.lines",
            dependencies: ["grid", "polar"],
            visualColorAccessPath: "lineStyle.color",
            init: function (e) {
                e.data = e.data || [], HS(e);
                var t = this._processFlatCoordsArray(e.data);
                this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset, t.flatCoords && (e.data = new Float32Array(t.count)), zS.superApply(this, "init", arguments)
            },
            mergeOption: function (e) {
                if (e.data = e.data || [], HS(e), e.data) {
                    var t = this._processFlatCoordsArray(e.data);
                    this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset, t.flatCoords && (e.data = new Float32Array(t.count))
                }
                zS.superApply(this, "mergeOption", arguments)
            },
            appendData: function (e) {
                var t = this._processFlatCoordsArray(e.data);
                t.flatCoords && (this._flatCoords ? (this._flatCoords = ee(this._flatCoords, t.flatCoords), this._flatCoordsOffset = ee(this._flatCoordsOffset, t.flatCoordsOffset)) : (this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset), e.data = new Float32Array(t.count)), this.getRawData().appendData(e.data)
            },
            _getCoordsFromItemModel: function (e) {
                var t = this.getData().getItemModel(e);
                return t.option instanceof Array ? t.option : t.getShallow("coords")
            },
            getLineCoordsCount: function (e) {
                return this._flatCoordsOffset ? this._flatCoordsOffset[2 * e + 1] : this._getCoordsFromItemModel(e).length
            },
            getLineCoords: function (e, t) {
                if (this._flatCoordsOffset) {
                    for (var i = this._flatCoordsOffset[2 * e], n = this._flatCoordsOffset[2 * e + 1], a = 0; a < n; a++) t[a] = t[a] || [], t[a][0] = this._flatCoords[i + 2 * a], t[a][1] = this._flatCoords[i + 2 * a + 1];
                    return n
                }
                var o = this._getCoordsFromItemModel(e);
                for (a = 0; a < o.length; a++) t[a] = t[a] || [], t[a][0] = o[a][0], t[a][1] = o[a][1];
                return o.length
            },
            _processFlatCoordsArray: function (e) {
                var t = 0;
                if (this._flatCoords && (t = this._flatCoords.length), "number" != typeof e[0]) return {
                    flatCoordsOffset: null,
                    flatCoords: null,
                    count: e.length
                };
                for (var i = e.length, n = new WS(i), a = new GS(i), o = 0, r = 0, s = 0, l = 0; l < i;) {
                    s++;
                    var d = e[l++];
                    n[r++] = o + t, n[r++] = d;
                    for (var u = 0; u < d; u++) {
                        var c = e[l++], h = e[l++];
                        a[o++] = c, a[o++] = h
                    }
                }
                return {flatCoordsOffset: new Uint32Array(n.buffer, 0, r), flatCoords: a, count: s}
            },
            getInitialData: function (e, t) {
                var i = new Kf(["value"], this);
                return i.hasItemOption = !1, i.initData(e.data, [], function (e, t, n, a) {
                    if (e instanceof Array) return NaN;
                    i.hasItemOption = !0;
                    var o = e.value;
                    return null != o ? o instanceof Array ? o[a] : o : void 0
                }), i
            },
            formatTooltip: function (e) {
                var t = this.getData().getItemModel(e), i = t.get("name");
                if (i) return i;
                var n = t.get("fromName"), a = t.get("toName"), o = [];
                return null != n && o.push(n), null != a && o.push(a), Ql(o.join(" > "))
            },
            preventIncremental: function () {
                return !!this.get("effect.show")
            },
            getProgressive: function () {
                var e = this.option.progressive;
                return null == e ? this.option.large ? 1e4 : this.get("progressive") : e
            },
            getProgressiveThreshold: function () {
                var e = this.option.progressiveThreshold;
                return null == e ? this.option.large ? 2e4 : this.get("progressiveThreshold") : e
            },
            defaultOption: {
                coordinateSystem: "geo",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                hoverAnimation: !0,
                xAxisIndex: 0,
                yAxisIndex: 0,
                symbol: ["none", "none"],
                symbolSize: [10, 10],
                geoIndex: 0,
                effect: {
                    show: !1,
                    period: 4,
                    constantSpeed: 0,
                    symbol: "circle",
                    symbolSize: 3,
                    loop: !0,
                    trailLength: .2
                },
                large: !1,
                largeThreshold: 2e3,
                polyline: !1,
                clip: !0,
                label: {show: !1, position: "end"},
                lineStyle: {opacity: .5}
            }
        });

        function jS(e, t, i) {
            Ai.call(this), this.add(this.createLine(e, t, i)), this._updateEffectSymbol(e, t)
        }

        var XS = jS.prototype;

        function $S(e, t, i) {
            Ai.call(this), this._createPolyline(e, t, i)
        }

        XS.createLine = function (e, t, i) {
            return new zT(e, t, i)
        }, XS._updateEffectSymbol = function (e, t) {
            var i = e.getItemModel(t).getModel("effect"), n = i.get("symbolSize"), a = i.get("symbol");
            M(n) || (n = [n, n]);
            var o = i.get("color") || e.getItemVisual(t, "color"), r = this.childAt(1);
            this._symbolType !== a && (this.remove(r), (r = cp(a, -.5, -.5, 1, 1, o)).z2 = 100, r.culling = !0, this.add(r)), r && (r.setStyle("shadowColor", o), r.setStyle(i.getItemStyle(["color"])), r.attr("scale", n), r.setColor(o), r.attr("scale", n), this._symbolType = a, this._symbolScale = n, this._updateEffectAnimation(e, i, t))
        }, XS._updateEffectAnimation = function (e, t, i) {
            var n = this.childAt(1);
            if (n) {
                var a = this, o = e.getItemLayout(i), r = 1e3 * t.get("period"), s = t.get("loop"),
                    l = t.get("constantSpeed"), d = W(t.get("delay"), function (t) {
                        return t / e.count() * r / 3
                    }), u = "function" == typeof d;
                if (n.ignore = !0, this.updateAnimationPoints(n, o), 0 < l && (r = this.getLineLength(n) / l * 1e3), r !== this._period || s !== this._loop) {
                    n.stopAnimation();
                    var c = d;
                    u && (c = d(i)), 0 < n.__t && (c = -r * n.__t), n.__t = 0;
                    var h = n.animate("", s).when(r, {__t: 1}).delay(c).during(function () {
                        a.updateSymbolPosition(n)
                    });
                    s || h.done(function () {
                        a.remove(n)
                    }), h.start()
                }
                this._period = r, this._loop = s
            }
        }, XS.getLineLength = function (e) {
            return ye(e.__p1, e.__cp1) + ye(e.__cp1, e.__p2)
        }, XS.updateAnimationPoints = function (e, t) {
            e.__p1 = t[0], e.__p2 = t[1], e.__cp1 = t[2] || [(t[0][0] + t[1][0]) / 2, (t[0][1] + t[1][1]) / 2]
        }, XS.updateData = function (e, t, i) {
            this.childAt(0).updateData(e, t, i), this._updateEffectSymbol(e, t)
        }, XS.updateSymbolPosition = function (e) {
            var t = e.__p1, i = e.__p2, n = e.__cp1, a = e.__t, o = e.position, r = [o[0], o[1]], s = Io, l = bo;
            o[0] = s(t[0], n[0], i[0], a), o[1] = s(t[1], n[1], i[1], a);
            var d = l(t[0], n[0], i[0], a), u = l(t[1], n[1], i[1], a);
            if (e.rotation = -Math.atan2(u, d) - Math.PI / 2, "line" === this._symbolType || "rect" === this._symbolType || "roundRect" === this._symbolType) if (void 0 !== e.__lastT && e.__lastT < e.__t) {
                var c = 1.05 * ye(r, o);
                e.attr("scale", [e.scale[0], c]), 1 === a && (o[0] = r[0] + (o[0] - r[0]) / 2, o[1] = r[1] + (o[1] - r[1]) / 2)
            } else 1 === e.__lastT ? (c = 2 * ye(t, o), e.attr("scale", [e.scale[0], c])) : e.attr("scale", this._symbolScale);
            e.__lastT = e.__t, e.ignore = !1
        }, XS.updateLayout = function (e, t) {
            this.childAt(0).updateLayout(e, t);
            var i = e.getItemModel(t).getModel("effect");
            this._updateEffectAnimation(e, i, t)
        }, I(jS, Ai);
        var YS = $S.prototype;

        function qS(e, t, i) {
            jS.call(this, e, t, i), this._lastFrame = 0, this._lastFramePercent = 0
        }

        YS._createPolyline = function (e, t, i) {
            var n = e.getItemLayout(t), a = new $r({shape: {points: n}});
            this.add(a), this._updateCommonStl(e, t, i)
        }, YS.updateData = function (e, t, i) {
            var n = e.hostModel;
            ol(this.childAt(0), {shape: {points: e.getItemLayout(t)}}, n, t), this._updateCommonStl(e, t, i)
        }, YS._updateCommonStl = function (e, t, i) {
            var n = this.childAt(0), a = e.getItemModel(t), o = e.getItemVisual(t, "color"), r = i && i.lineStyle,
                s = i && i.hoverLineStyle;
            i && !e.hasItemOption || (r = a.getModel("lineStyle").getLineStyle(), s = a.getModel("emphasis.lineStyle").getLineStyle()), n.useStyle(T({
                strokeNoScale: !0,
                fill: "none",
                stroke: o
            }, r)), n.hoverStyle = s, zs(this)
        }, YS.updateLayout = function (e, t) {
            this.childAt(0).setShape("points", e.getItemLayout(t))
        }, I($S, Ai);
        var JS = qS.prototype;
        JS.createLine = function (e, t, i) {
            return new $S(e, t, i)
        }, JS.updateAnimationPoints = function (e, t) {
            this._points = t;
            for (var i = [0], n = 0, a = 1; a < t.length; a++) {
                var o = t[a - 1], r = t[a];
                n += ye(o, r), i.push(n)
            }
            if (0 !== n) {
                for (a = 0; a < i.length; a++) i[a] /= n;
                this._offsets = i, this._length = n
            }
        }, JS.getLineLength = function (e) {
            return this._length
        }, JS.updateSymbolPosition = function (e) {
            var t = e.__t, i = this._points, n = this._offsets, a = i.length;
            if (n) {
                var o = this._lastFrame;
                if (t < this._lastFramePercent) {
                    for (r = Math.min(o + 1, a - 1); 0 <= r && !(n[r] <= t); r--) ;
                    r = Math.min(r, a - 2)
                } else {
                    for (var r = o; r < a && !(n[r] > t); r++) ;
                    r = Math.min(r - 1, a - 2)
                }
                we(e.position, i[r], i[r + 1], (t - n[r]) / (n[r + 1] - n[r]));
                var s = i[r + 1][0] - i[r][0], l = i[r + 1][1] - i[r][1];
                e.rotation = -Math.atan2(l, s) - Math.PI / 2, this._lastFrame = r, this._lastFramePercent = t, e.ignore = !1
            }
        }, I(qS, jS);
        var ZS = Ss({
            shape: {polyline: !1, curveness: 0, segs: []}, buildPath: function (e, t) {
                var i = t.segs, n = t.curveness;
                if (t.polyline) for (var a = 0; a < i.length;) {
                    var o = i[a++];
                    if (0 < o) {
                        e.moveTo(i[a++], i[a++]);
                        for (var r = 1; r < o; r++) e.lineTo(i[a++], i[a++])
                    }
                } else for (a = 0; a < i.length;) {
                    var s = i[a++], l = i[a++], d = i[a++], u = i[a++];
                    if (e.moveTo(s, l), 0 < n) {
                        var c = (s + d) / 2 - (l - u) * n, h = (l + u) / 2 - (d - s) * n;
                        e.quadraticCurveTo(c, h, d, u)
                    } else e.lineTo(d, u)
                }
            }, findDataIndex: function (e, t) {
                var i = this.shape, n = i.segs, a = i.curveness;
                if (i.polyline) for (var o = 0, r = 0; r < n.length;) {
                    var s = n[r++];
                    if (0 < s) for (var l = n[r++], d = n[r++], u = 1; u < s; u++) if (tr(l, d, c = n[r++], h = n[r++])) return o;
                    o++
                } else for (o = 0, r = 0; r < n.length;) {
                    l = n[r++], d = n[r++];
                    var c = n[r++], h = n[r++];
                    if (0 < a) {
                        if (nr(l, d, (l + c) / 2 - (d - h) * a, (d + h) / 2 - (c - l) * a, c, h)) return o
                    } else if (tr(l, d, c, h)) return o;
                    o++
                }
                return -1
            }
        });

        function QS() {
            this.group = new Ai
        }

        var eI = QS.prototype;
        eI.isPersistent = function () {
            return !this._incremental
        }, eI.updateData = function (e) {
            this.group.removeAll();
            var t = new ZS({rectHover: !0, cursor: "default"});
            t.setShape({segs: e.getLayout("linesPoints")}), this._setCommon(t, e), this.group.add(t), this._incremental = null
        }, eI.incrementalPrepareUpdate = function (e) {
            this.group.removeAll(), this._clearIncremental(), 5e5 < e.count() ? (this._incremental || (this._incremental = new cs({silent: !0})), this.group.add(this._incremental)) : this._incremental = null
        }, eI.incrementalUpdate = function (e, t) {
            var i = new ZS;
            i.setShape({segs: t.getLayout("linesPoints")}), this._setCommon(i, t, !!this._incremental), this._incremental ? this._incremental.addDisplayable(i, !0) : (i.rectHover = !0, i.cursor = "default", i.__startIndex = e.start, this.group.add(i))
        }, eI.remove = function () {
            this._clearIncremental(), this._incremental = null, this.group.removeAll()
        }, eI._setCommon = function (e, t, i) {
            var n = t.hostModel;
            e.setShape({
                polyline: n.get("polyline"),
                curveness: n.get("lineStyle.curveness")
            }), e.useStyle(n.getModel("lineStyle").getLineStyle()), e.style.strokeNoScale = !0;
            var a = t.getVisual("color");
            a && e.setStyle("stroke", a), e.setStyle("fill"), i || (e.seriesIndex = n.seriesIndex, e.on("mousemove", function (t) {
                e.dataIndex = null;
                var i = e.findDataIndex(t.offsetX, t.offsetY);
                0 < i && (e.dataIndex = i + e.__startIndex)
            }))
        }, eI._clearIncremental = function () {
            var e = this._incremental;
            e && e.clearDisplaybles()
        };
        var tI = {
            seriesType: "lines", plan: uc(), reset: function (e) {
                var t = e.coordinateSystem, i = e.get("polyline"), n = e.pipelineContext.large;
                return {
                    progress: function (a, o) {
                        var r = [];
                        if (n) {
                            var s, l = a.end - a.start;
                            if (i) {
                                for (var d = 0, u = a.start; u < a.end; u++) d += e.getLineCoordsCount(u);
                                s = new Float32Array(l + 2 * d)
                            } else s = new Float32Array(4 * l);
                            var c = 0, h = [];
                            for (u = a.start; u < a.end; u++) {
                                var f = e.getLineCoords(u, r);
                                i && (s[c++] = f);
                                for (var g = 0; g < f; g++) h = t.dataToPoint(r[g], !1, h), s[c++] = h[0], s[c++] = h[1]
                            }
                            o.setLayout("linesPoints", s)
                        } else for (u = a.start; u < a.end; u++) {
                            var p = o.getItemModel(u), v = (f = e.getLineCoords(u, r), []);
                            if (i) for (var m = 0; m < f; m++) v.push(t.dataToPoint(r[m])); else {
                                v[0] = t.dataToPoint(r[0]), v[1] = t.dataToPoint(r[1]);
                                var y = p.get("lineStyle.curveness");
                                +y && (v[2] = [(v[0][0] + v[1][0]) / 2 - (v[0][1] - v[1][1]) * y, (v[0][1] + v[1][1]) / 2 - (v[1][0] - v[0][0]) * y])
                            }
                            o.setItemLayout(u, v)
                        }
                    }
                }
            }
        };

        function iI(e) {
            return e instanceof Array || (e = [e, e]), e
        }

        Cf({
            type: "lines", init: function () {
            }, render: function (e, t, i) {
                var n = e.getData(), a = this._updateLineDraw(n, e), o = e.get("zlevel"),
                    r = e.get("effect.trailLength"), s = i.getZr(), l = "svg" === s.painter.getType();
                l || s.painter.getLayer(o).clear(!0), null == this._lastZlevel || l || s.configLayer(this._lastZlevel, {motionBlur: !1}), this._showEffect(e) && r && (l || s.configLayer(o, {
                    motionBlur: !0,
                    lastFrameAlpha: Math.max(Math.min(r / 10 + .9, 1), 0)
                })), a.updateData(n);
                var d = e.get("clip", !0) && cv(e.coordinateSystem, !1, e);
                d ? this.group.setClipPath(d) : this.group.removeClipPath(), this._lastZlevel = o, this._finished = !0
            }, incrementalPrepareRender: function (e, t, i) {
                var n = e.getData();
                this._updateLineDraw(n, e).incrementalPrepareUpdate(n), this._clearLayer(i), this._finished = !1
            }, incrementalRender: function (e, t, i) {
                this._lineDraw.incrementalUpdate(e, t.getData()), this._finished = e.end === t.getData().count()
            }, updateTransform: function (e, t, i) {
                var n = e.getData(), a = e.pipelineContext;
                if (!this._finished || a.large || a.progressiveRender) return {update: !0};
                var o = tI.reset(e);
                o.progress && o.progress({
                    start: 0,
                    end: n.count()
                }, n), this._lineDraw.updateLayout(), this._clearLayer(i)
            }, _updateLineDraw: function (e, t) {
                var i = this._lineDraw, n = this._showEffect(t), a = !!t.get("polyline"), o = t.pipelineContext.large;
                return i && n === this._hasEffet && a === this._isPolyline && o === this._isLargeDraw || (i && i.remove(), i = this._lineDraw = o ? new QS : new XT(a ? n ? qS : $S : n ? jS : zT), this._hasEffet = n, this._isPolyline = a, this._isLargeDraw = o, this.group.removeAll()), this.group.add(i.group), i
            }, _showEffect: function (e) {
                return !!e.get("effect.show")
            }, _clearLayer: function (e) {
                var t = e.getZr();
                "svg" === t.painter.getType() || null == this._lastZlevel || t.painter.getLayer(this._lastZlevel).clear(!0)
            }, remove: function (e, t) {
                this._lineDraw && this._lineDraw.remove(), this._lineDraw = null, this._clearLayer(t)
            }, dispose: function () {
            }
        });
        var nI = "lineStyle.opacity".split("."), aI = {
            seriesType: "lines", reset: function (e, t, i) {
                var n = iI(e.get("symbol")), a = iI(e.get("symbolSize")), o = e.getData();
                return o.setVisual("fromSymbol", n && n[0]), o.setVisual("toSymbol", n && n[1]), o.setVisual("fromSymbolSize", a && a[0]), o.setVisual("toSymbolSize", a && a[1]), o.setVisual("opacity", e.get(nI)), {
                    dataEach: o.hasItemOption ? function (e, t) {
                        var i = e.getItemModel(t), n = iI(i.getShallow("symbol", !0)),
                            a = iI(i.getShallow("symbolSize", !0)), o = i.get(nI);
                        n[0] && e.setItemVisual(t, "fromSymbol", n[0]), n[1] && e.setItemVisual(t, "toSymbol", n[1]), a[0] && e.setItemVisual(t, "fromSymbolSize", a[0]), a[1] && e.setItemVisual(t, "toSymbolSize", a[1]), e.setItemVisual(t, "opacity", o)
                    } : null
                }
            }
        };

        function oI() {
            var e = w();
            this.canvas = e, this.blurSize = 30, this.pointSize = 20, this.maxOpacity = 1, this.minOpacity = 0, this._gradientPixels = {}
        }

        pf(tI), vf(aI), ec.extend({
            type: "series.heatmap",
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {generateCoord: "value"})
            },
            preventIncremental: function () {
                var e = iu.get(this.get("coordinateSystem"));
                if (e && e.dimensions) return "lng" === e.dimensions[0] && "lat" === e.dimensions[1]
            },
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                geoIndex: 0,
                blurSize: 30,
                pointSize: 20,
                maxOpacity: 1,
                minOpacity: 0
            }
        }), oI.prototype = {
            update: function (e, t, i, n, a, o) {
                var r = this._getBrush(), s = this._getGradient(e, a, "inRange"),
                    l = this._getGradient(e, a, "outOfRange"), d = this.pointSize + this.blurSize, u = this.canvas,
                    c = u.getContext("2d"), h = e.length;
                u.width = t, u.height = i;
                for (var f = 0; f < h; ++f) {
                    var g = e[f], p = g[0], v = g[1], m = n(g[2]);
                    c.globalAlpha = m, c.drawImage(r, p - d, v - d)
                }
                if (!u.width || !u.height) return u;
                for (var y = c.getImageData(0, 0, u.width, u.height), k = y.data, T = 0, w = k.length, C = this.minOpacity, S = this.maxOpacity - C; T < w;) {
                    m = k[T + 3] / 256;
                    var I = 4 * Math.floor(255 * m);
                    if (0 < m) {
                        var b = o(m) ? s : l;
                        0 < m && (m = m * S + C), k[T++] = b[I], k[T++] = b[1 + I], k[T++] = b[2 + I], k[T++] = b[3 + I] * m * 256
                    } else T += 4
                }
                return c.putImageData(y, 0, 0), u
            }, _getBrush: function () {
                var e = this._brushCanvas || (this._brushCanvas = w()), t = this.pointSize + this.blurSize, i = 2 * t;
                e.width = i, e.height = i;
                var n = e.getContext("2d");
                return n.clearRect(0, 0, i, i), n.shadowOffsetX = i, n.shadowBlur = this.blurSize, n.shadowColor = "#000", n.beginPath(), n.arc(-t, t, this.pointSize, 0, 2 * Math.PI, !0), n.closePath(), n.fill(), e
            }, _getGradient: function (e, t, i) {
                for (var n = this._gradientPixels, a = n[i] || (n[i] = new Uint8ClampedArray(1024)), o = [0, 0, 0, 0], r = 0, s = 0; s < 256; s++) t[i](s / 255, !0, o), a[r++] = o[0], a[r++] = o[1], a[r++] = o[2], a[r++] = o[3];
                return a
            }
        }, Cf({
            type: "heatmap", render: function (e, t, i) {
                var n;
                t.eachComponent("visualMap", function (t) {
                    t.eachTargetSeries(function (i) {
                        i === e && (n = t)
                    })
                }), this.group.removeAll(), this._incrementalDisplayable = null;
                var a = e.coordinateSystem;
                "cartesian2d" === a.type || "calendar" === a.type ? this._renderOnCartesianAndCalendar(e, i, 0, e.getData().count()) : function (e) {
                    var t = e.dimensions;
                    return "lng" === t[0] && "lat" === t[1]
                }(a) && this._renderOnGeo(a, e, n, i)
            }, incrementalPrepareRender: function (e, t, i) {
                this.group.removeAll()
            }, incrementalRender: function (e, t, i, n) {
                t.coordinateSystem && this._renderOnCartesianAndCalendar(t, n, e.start, e.end, !0)
            }, _renderOnCartesianAndCalendar: function (e, t, i, n, a) {
                var o, r, s = e.coordinateSystem;
                if ("cartesian2d" === s.type) {
                    var l = s.getAxis("x"), d = s.getAxis("y");
                    o = l.getBandWidth(), r = d.getBandWidth()
                }
                for (var u = this.group, c = e.getData(), h = "emphasis.itemStyle", f = "emphasis.label", g = e.getModel("itemStyle").getItemStyle(["color"]), p = e.getModel(h).getItemStyle(), v = e.getModel("label"), m = e.getModel(f), y = s.type, T = "cartesian2d" === y ? [c.mapDimension("x"), c.mapDimension("y"), c.mapDimension("value")] : [c.mapDimension("time"), c.mapDimension("value")], w = i; w < n; w++) {
                    var C;
                    if ("cartesian2d" === y) {
                        if (isNaN(c.get(T[2], w))) continue;
                        var S = s.dataToPoint([c.get(T[0], w), c.get(T[1], w)]);
                        C = new es({
                            shape: {
                                x: Math.floor(Math.round(S[0]) - o / 2),
                                y: Math.floor(Math.round(S[1]) - r / 2),
                                width: Math.ceil(o),
                                height: Math.ceil(r)
                            }, style: {fill: c.getItemVisual(w, "color"), opacity: c.getItemVisual(w, "opacity")}
                        })
                    } else {
                        if (isNaN(c.get(T[1], w))) continue;
                        C = new es({
                            z2: 1,
                            shape: s.dataToRect([c.get(T[0], w)]).contentShape,
                            style: {fill: c.getItemVisual(w, "color"), opacity: c.getItemVisual(w, "opacity")}
                        })
                    }
                    var I = c.getItemModel(w);
                    c.hasItemOption && (g = I.getModel("itemStyle").getItemStyle(["color"]), p = I.getModel(h).getItemStyle(), v = I.getModel("label"), m = I.getModel(f));
                    var b = e.getRawValue(w), _ = "-";
                    b && null != b[2] && (_ = b[2]), Ys(g, p, v, m, {
                        labelFetcher: e,
                        labelDataIndex: w,
                        defaultText: _,
                        isRectText: !0
                    }), C.setStyle(g), zs(C, c.hasItemOption ? p : k({}, p)), (C.incremental = a) && (C.useHoverLayer = !0), u.add(C), c.setItemGraphicEl(w, C)
                }
            }, _renderOnGeo: function (e, t, i, n) {
                var a = i.targetVisuals.inRange, o = i.targetVisuals.outOfRange, r = t.getData(),
                    s = this._hmLayer || this._hmLayer || new oI;
                s.blurSize = t.get("blurSize"), s.pointSize = t.get("pointSize"), s.minOpacity = t.get("minOpacity"), s.maxOpacity = t.get("maxOpacity");
                var l = e.getViewRect().clone(), d = e.getRoamTransform();
                l.applyTransform(d);
                var u = Math.max(l.x, 0), c = Math.max(l.y, 0), h = Math.min(l.width + l.x, n.getWidth()),
                    f = Math.min(l.height + l.y, n.getHeight()), g = h - u, p = f - c,
                    v = [r.mapDimension("lng"), r.mapDimension("lat"), r.mapDimension("value")],
                    m = r.mapArray(v, function (t, i, n) {
                        var a = e.dataToPoint([t, i]);
                        return a[0] -= u, a[1] -= c, a.push(n), a
                    }), y = i.getExtent(), k = "visualMap.continuous" === i.type ? function (e, t) {
                        var i = e[1] - e[0];
                        return t = [(t[0] - e[0]) / i, (t[1] - e[0]) / i], function (e) {
                            return e >= t[0] && e <= t[1]
                        }
                    }(y, i.option.range) : function (e, t, i) {
                        var n = e[1] - e[0], a = (t = A(t, function (t) {
                            return {interval: [(t.interval[0] - e[0]) / n, (t.interval[1] - e[0]) / n]}
                        })).length, o = 0;
                        return function (e) {
                            for (var n = o; n < a; n++) if ((r = t[n].interval)[0] <= e && e <= r[1]) {
                                o = n;
                                break
                            }
                            if (n === a) for (n = o - 1; 0 <= n; n--) {
                                var r;
                                if ((r = t[n].interval)[0] <= e && e <= r[1]) {
                                    o = n;
                                    break
                                }
                            }
                            return 0 <= n && n < a && i[n]
                        }
                    }(y, i.getPieceList(), i.option.selected);
                s.update(m, g, p, a.color.getNormalizer(), {
                    inRange: a.color.getColorMapper(),
                    outOfRange: o.color.getColorMapper()
                }, k);
                var T = new Yn({style: {width: g, height: p, x: u, y: c, image: s.canvas}, silent: !0});
                this.group.add(T)
            }, dispose: function () {
            }
        });
        var rI = hm.extend({
            type: "series.pictorialBar",
            dependencies: ["grid"],
            defaultOption: {
                symbol: "circle",
                symbolSize: null,
                symbolRotate: null,
                symbolPosition: null,
                symbolOffset: null,
                symbolMargin: null,
                symbolRepeat: !1,
                symbolRepeatDirection: "end",
                symbolClip: !1,
                symbolBoundingData: null,
                symbolPatternSize: 400,
                barGap: "-100%",
                progressive: 0,
                hoverAnimation: !1
            },
            getInitialData: function (e) {
                return e.stack = null, rI.superApply(this, "getInitialData", arguments)
            }
        }), sI = ["itemStyle", "borderWidth"], lI = [{xy: "x", wh: "width", index: 0, posDesc: ["left", "right"]}, {
            xy: "y",
            wh: "height",
            index: 1,
            posDesc: ["top", "bottom"]
        }], dI = new Vr;

        function uI(e, t, i, n) {
            var a = e.getItemLayout(t), o = i.get("symbolRepeat"), r = i.get("symbolClip"),
                s = i.get("symbolPosition") || "start", l = (i.get("symbolRotate") || 0) * Math.PI / 180 || 0,
                d = i.get("symbolPatternSize") || 2, u = i.isAnimationEnabled(), c = {
                    dataIndex: t,
                    layout: a,
                    itemModel: i,
                    symbolType: e.getItemVisual(t, "symbol") || "circle",
                    color: e.getItemVisual(t, "color"),
                    symbolClip: r,
                    symbolRepeat: o,
                    symbolRepeatDirection: i.get("symbolRepeatDirection"),
                    symbolPatternSize: d,
                    rotation: l,
                    animationModel: u ? i : null,
                    hoverAnimation: u && i.get("hoverAnimation"),
                    z2: i.getShallow("z", !0) || 0
                };
            !function (e, t, i, n, a) {
                var o, r = n.valueDim, s = e.get("symbolBoundingData"),
                    l = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), d = l.toGlobalCoord(l.dataToCoord(0)),
                    u = 1 - +(i[r.wh] <= 0);
                if (M(s)) {
                    var c = [cI(l, s[0]) - d, cI(l, s[1]) - d];
                    c[1] < c[0] && c.reverse(), o = c[u]
                } else o = null != s ? cI(l, s) - d : t ? n.coordSysExtent[r.index][u] - d : i[r.wh];
                a.boundingLength = o, t && (a.repeatCutLength = i[r.wh]), a.pxSign = 0 < o ? 1 : o < 0 ? -1 : 0
            }(i, o, a, n, c), function (e, t, i, n, a, o, r, s, l, d) {
                var u = l.valueDim, c = l.categoryDim, h = Math.abs(i[c.wh]), f = e.getItemVisual(t, "symbolSize");
                (f = M(f) ? f.slice() : (null == f && (f = "100%"), [f, f]))[c.index] = xl(f[c.index], h), f[u.index] = xl(f[u.index], n ? h : Math.abs(o)), d.symbolSize = f, (d.symbolScale = [f[0] / s, f[1] / s])[u.index] *= (l.isHorizontal ? -1 : 1) * r
            }(e, t, a, o, 0, c.boundingLength, c.pxSign, d, n, c), function (e, t, i, n, a) {
                var o = e.get(sI) || 0;
                o && (dI.attr({
                    scale: t.slice(),
                    rotation: i
                }), dI.updateTransform(), o /= dI.getLineScale(), o *= t[n.valueDim.index]), a.valueLineWidth = o
            }(i, c.symbolScale, l, n, c);
            var h = c.symbolSize, f = i.get("symbolOffset");
            return M(f) && (f = [xl(f[0], h[0]), xl(f[1], h[1])]), function (e, t, i, n, a, o, r, s, l, d, u, c) {
                var h = u.categoryDim, f = u.valueDim, g = c.pxSign, p = Math.max(t[f.index] + s, 0), v = p;
                if (n) {
                    var m = Math.abs(l), y = W(e.get("symbolMargin"), "15%") + "", T = !1;
                    y.lastIndexOf("!") === y.length - 1 && (T = !0, y = y.slice(0, y.length - 1)), y = xl(y, t[f.index]);
                    var w = Math.max(p + 2 * y, 0), C = T ? 0 : 2 * y, S = jl(n), I = S ? n : DI((m + C) / w);
                    w = p + 2 * (y = (m - I * p) / 2 / (T ? I : I - 1)), C = T ? 0 : 2 * y, S || "fixed" === n || (I = d ? DI((Math.abs(d) + C) / w) : 0), v = I * w - C, c.repeatTimes = I, c.symbolMargin = y
                }
                var b = g * (v / 2), _ = c.pathPosition = [];
                _[h.index] = i[h.wh] / 2, _[f.index] = "start" === r ? b : "end" === r ? l - b : l / 2, o && (_[0] += o[0], _[1] += o[1]);
                var D = c.bundlePosition = [];
                D[h.index] = i[h.xy], D[f.index] = i[f.xy];
                var A = c.barRectShape = k({}, i);
                A[f.wh] = g * Math.max(Math.abs(i[f.wh]), Math.abs(_[f.index] + b)), A[h.wh] = i[h.wh];
                var N = c.clipShape = {};
                N[h.xy] = -i[h.xy], N[h.wh] = u.ecSize[h.wh], N[f.xy] = 0, N[f.wh] = i[f.wh]
            }(i, h, a, o, 0, f, s, c.valueLineWidth, c.boundingLength, c.repeatCutLength, n, c), c
        }

        function cI(e, t) {
            return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))
        }

        function hI(e) {
            var t = e.symbolPatternSize, i = cp(e.symbolType, -t / 2, -t / 2, t, t, e.color);
            return i.attr({culling: !0}), "image" !== i.type && i.setStyle({strokeNoScale: !0}), i
        }

        function fI(e, t, i, n) {
            var a = e.__pictorialBundle, o = i.symbolSize, r = i.valueLineWidth, s = i.pathPosition, l = t.valueDim,
                d = i.repeatTimes || 0, u = 0, c = o[t.valueDim.index] + r + 2 * i.symbolMargin;
            for (II(e, function (e) {
                e.__pictorialAnimationIndex = u, e.__pictorialRepeatTimes = d, u < d ? bI(e, null, g(u), i, n) : bI(e, null, {scale: [0, 0]}, i, n, function () {
                    a.remove(e)
                }), TI(e, i), u++
            }); u < d; u++) {
                var h = hI(i);
                h.__pictorialAnimationIndex = u, h.__pictorialRepeatTimes = d, a.add(h);
                var f = g(u);
                bI(h, {position: f.position, scale: [0, 0]}, {
                    scale: f.scale,
                    rotation: f.rotation
                }, i, n), h.on("mouseover", p).on("mouseout", v), TI(h, i)
            }

            function g(e) {
                var t = s.slice(), n = i.pxSign, a = e;
                return ("start" === i.symbolRepeatDirection ? 0 < n : n < 0) && (a = d - 1 - e), t[l.index] = c * (a - d / 2 + .5) + s[l.index], {
                    position: t,
                    scale: i.symbolScale.slice(),
                    rotation: i.rotation
                }
            }

            function p() {
                II(e, function (e) {
                    e.trigger("emphasis")
                })
            }

            function v() {
                II(e, function (e) {
                    e.trigger("normal")
                })
            }
        }

        function gI(e, t, i, n) {
            var a = e.__pictorialBundle, o = e.__pictorialMainPath;
            o ? bI(o, null, {
                position: i.pathPosition.slice(),
                scale: i.symbolScale.slice(),
                rotation: i.rotation
            }, i, n) : (o = e.__pictorialMainPath = hI(i), a.add(o), bI(o, {
                position: i.pathPosition.slice(),
                scale: [0, 0],
                rotation: i.rotation
            }, {scale: i.symbolScale.slice()}, i, n), o.on("mouseover", function () {
                this.trigger("emphasis")
            }).on("mouseout", function () {
                this.trigger("normal")
            })), TI(o, i)
        }

        function pI(e, t, i) {
            var n = k({}, t.barRectShape), a = e.__pictorialBarRect;
            a ? bI(a, null, {shape: n}, t, i) : (a = e.__pictorialBarRect = new es({
                z2: 2,
                shape: n,
                silent: !0,
                style: {stroke: "transparent", fill: "transparent", lineWidth: 0}
            }), e.add(a))
        }

        function vI(e, t, i, n) {
            if (i.symbolClip) {
                var a = e.__pictorialClipPath, o = k({}, i.clipShape), r = t.valueDim, s = i.animationModel,
                    l = i.dataIndex;
                if (a) ol(a, {shape: o}, s, l); else {
                    o[r.wh] = 0, a = new es({shape: o}), e.__pictorialBundle.setClipPath(a), e.__pictorialClipPath = a;
                    var d = {};
                    d[r.wh] = i.clipShape[r.wh], vl[n ? "updateProps" : "initProps"](a, {shape: d}, s, l)
                }
            }
        }

        function mI(e, t) {
            var i = e.getItemModel(t);
            return i.getAnimationDelayParams = yI, i.isAnimationEnabled = kI, i
        }

        function yI(e) {
            return {index: e.__pictorialAnimationIndex, count: e.__pictorialRepeatTimes}
        }

        function kI() {
            return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation")
        }

        function TI(e, t) {
            e.off("emphasis").off("normal");
            var i = t.symbolScale.slice();
            t.hoverAnimation && e.on("emphasis", function () {
                this.animateTo({scale: [1.1 * i[0], 1.1 * i[1]]}, 400, "elasticOut")
            }).on("normal", function () {
                this.animateTo({scale: i.slice()}, 400, "elasticOut")
            })
        }

        function wI(e, t, i, n) {
            var a = new Ai, o = new Ai;
            return a.add(o), (a.__pictorialBundle = o).attr("position", i.bundlePosition.slice()), i.symbolRepeat ? fI(a, t, i) : gI(a, 0, i), pI(a, i, n), vI(a, t, i, n), a.__pictorialShapeStr = SI(e, i), a.__pictorialSymbolMeta = i, a
        }

        function CI(e, t, i, n) {
            var a = n.__pictorialBarRect;
            a && (a.style.text = null);
            var o = [];
            II(n, function (e) {
                o.push(e)
            }), n.__pictorialMainPath && o.push(n.__pictorialMainPath), n.__pictorialClipPath && (i = null), D(o, function (e) {
                ol(e, {scale: [0, 0]}, i, t, function () {
                    n.parent && n.parent.remove(n)
                })
            }), e.setItemGraphicEl(t, null)
        }

        function SI(e, t) {
            return [e.getItemVisual(t.dataIndex, "symbol") || "none", !!t.symbolRepeat, !!t.symbolClip].join(":")
        }

        function II(e, t, i) {
            D(e.__pictorialBundle.children(), function (n) {
                n !== e.__pictorialBarRect && t.call(i, n)
            })
        }

        function bI(e, t, i, n, a, o) {
            t && e.attr(t), n.symbolClip && !a ? i && e.attr(i) : i && vl[a ? "updateProps" : "initProps"](e, i, n.animationModel, n.dataIndex, o)
        }

        function _I(e, t, i) {
            var n = i.color, a = i.dataIndex, o = i.itemModel, r = o.getModel("itemStyle").getItemStyle(["color"]),
                s = o.getModel("emphasis.itemStyle").getItemStyle(), l = o.getShallow("cursor");
            II(e, function (e) {
                e.setColor(n), e.setStyle(T({
                    fill: n,
                    opacity: i.opacity
                }, r)), zs(e, s), l && (e.cursor = l), e.z2 = i.z2
            });
            var d = {}, u = (t.valueDim.posDesc[+(0 < i.boundingLength)], e.__pictorialBarRect);
            fm(u.style, d, o, n, t.seriesModel, a), zs(u, d)
        }

        function DI(e) {
            var t = Math.round(e);
            return Math.abs(e - t) < 1e-4 ? t : Math.ceil(e)
        }

        function AI(e, t, i, n, a) {
            Ap.call(this, e, t, i), this.type = n || "value", this.position = a || "bottom", this.orient = null
        }

        function NI(e, t, i) {
            this.dimension = "single", this.dimensions = ["single"], this._axis = null, this._rect, this._init(e, t, i), this.model = e
        }

        function xI(e, t) {
            t = t || {};
            var i = e.coordinateSystem, n = e.axis, a = {}, o = n.position, r = n.orient, s = i.getRect(),
                l = [s.x, s.x + s.width, s.y, s.y + s.height],
                d = {horizontal: {top: l[2], bottom: l[3]}, vertical: {left: l[0], right: l[1]}};
            a.position = ["vertical" === r ? d.vertical[o] : l[0], "horizontal" === r ? d.horizontal[o] : l[3]], a.rotation = Math.PI / 2 * {
                horizontal: 0,
                vertical: 1
            }[r], a.labelDirection = a.tickDirection = a.nameDirection = {
                top: -1,
                bottom: 1,
                right: 1,
                left: -1
            }[o], e.get("axisTick.inside") && (a.tickDirection = -a.tickDirection), W(t.labelInside, e.get("axisLabel.inside")) && (a.labelDirection = -a.labelDirection);
            var u = t.rotate;
            return null == u && (u = e.get("axisLabel.rotate")), a.labelRotation = "top" === o ? -u : u, a.z2 = 1, a
        }

        Cf({
            type: "pictorialBar", render: function (e, t, i) {
                var n = this.group, a = e.getData(), o = this._data, r = e.coordinateSystem,
                    s = !!r.getBaseAxis().isHorizontal(), l = r.grid.getRect(), d = {
                        ecSize: {width: i.getWidth(), height: i.getHeight()},
                        seriesModel: e,
                        coordSys: r,
                        coordSysExtent: [[l.x, l.x + l.width], [l.y, l.y + l.height]],
                        isHorizontal: s,
                        valueDim: lI[+s],
                        categoryDim: lI[1 - s]
                    };
                return a.diff(o).add(function (e) {
                    if (a.hasValue(e)) {
                        var t = mI(a, e), i = uI(a, e, t, d), o = wI(a, d, i);
                        a.setItemGraphicEl(e, o), n.add(o), _I(o, d, i)
                    }
                }).update(function (e, t) {
                    var i = o.getItemGraphicEl(t);
                    if (a.hasValue(e)) {
                        var r = mI(a, e), s = uI(a, e, r, d), l = SI(a, s);
                        i && l !== i.__pictorialShapeStr && (n.remove(i), a.setItemGraphicEl(e, null), i = null), i ? function (e, t, i) {
                            var n = i.animationModel, a = i.dataIndex;
                            ol(e.__pictorialBundle, {position: i.bundlePosition.slice()}, n, a), i.symbolRepeat ? fI(e, t, i, !0) : gI(e, 0, i, !0), pI(e, i, !0), vI(e, t, i, !0)
                        }(i, d, s) : i = wI(a, d, s, !0), a.setItemGraphicEl(e, i), i.__pictorialSymbolMeta = s, n.add(i), _I(i, d, s)
                    } else n.remove(i)
                }).remove(function (e) {
                    var t = o.getItemGraphicEl(e);
                    t && CI(o, e, t.__pictorialSymbolMeta.animationModel, t)
                }).execute(), this._data = a, this.group
            }, dispose: te, remove: function (e, t) {
                var i = this.group, n = this._data;
                e.get("animation") ? n && n.eachItemGraphicEl(function (t) {
                    CI(n, t.dataIndex, e, t)
                }) : i.removeAll()
            }
        }), pf(O(Ag, "pictorialBar")), vf(mv("pictorialBar", "roundRect")), AI.prototype = {
            constructor: AI,
            model: null,
            isHorizontal: function () {
                var e = this.position;
                return "top" === e || "bottom" === e
            },
            pointToData: function (e, t) {
                return this.coordinateSystem.pointToData(e, t)[0]
            },
            toGlobalCoord: null,
            toLocalCoord: null
        }, I(AI, Ap), iu.register("single", {
            create: function (e, t) {
                var i = [];
                return e.eachComponent("singleAxis", function (n, a) {
                    var o = new NI(n, e, t);
                    o.name = "single_" + a, o.resize(n, t), n.coordinateSystem = o, i.push(o)
                }), e.eachSeries(function (t) {
                    if ("singleAxis" === t.get("coordinateSystem")) {
                        var i = e.queryComponents({
                            mainType: "singleAxis",
                            index: t.get("singleAxisIndex"),
                            id: t.get("singleAxisId")
                        })[0];
                        t.coordinateSystem = i && i.coordinateSystem
                    }
                }), i
            }, dimensions: (NI.prototype = {
                type: "singleAxis", axisPointerEnabled: !0, constructor: NI, _init: function (e, t, i) {
                    var n = this.dimension, a = new AI(n, Jg(e), [0, 0], e.get("type"), e.get("position")),
                        o = "category" === a.type;
                    a.onBand = o && e.get("boundaryGap"), a.inverse = e.get("inverse"), a.orient = e.get("orient"), (e.axis = a).model = e, (a.coordinateSystem = this)._axis = a
                }, update: function (e, t) {
                    e.eachSeries(function (e) {
                        if (e.coordinateSystem === this) {
                            var t = e.getData();
                            D(t.mapDimension(this.dimension, !0), function (e) {
                                this._axis.scale.unionExtentFromData(t, e)
                            }, this), qg(this._axis.scale, this._axis.model)
                        }
                    }, this)
                }, resize: function (e, t) {
                    this._rect = vd({
                        left: e.get("left"),
                        top: e.get("top"),
                        right: e.get("right"),
                        bottom: e.get("bottom"),
                        width: e.get("width"),
                        height: e.get("height")
                    }, {width: t.getWidth(), height: t.getHeight()}), this._adjustAxis()
                }, getRect: function () {
                    return this._rect
                }, _adjustAxis: function () {
                    var e = this._rect, t = this._axis, i = t.isHorizontal(), n = i ? [0, e.width] : [0, e.height],
                        a = t.reverse ? 1 : 0;
                    t.setExtent(n[a], n[1 - a]), this._updateAxisTransform(t, i ? e.x : e.y)
                }, _updateAxisTransform: function (e, t) {
                    var i = e.getExtent(), n = i[0] + i[1], a = e.isHorizontal();
                    e.toGlobalCoord = a ? function (e) {
                        return e + t
                    } : function (e) {
                        return n - e + t
                    }, e.toLocalCoord = a ? function (e) {
                        return e - t
                    } : function (e) {
                        return n - e + t
                    }
                }, getAxis: function () {
                    return this._axis
                }, getBaseAxis: function () {
                    return this._axis
                }, getAxes: function () {
                    return [this._axis]
                }, getTooltipAxes: function () {
                    return {baseAxes: [this.getAxis()]}
                }, containPoint: function (e) {
                    var t = this.getRect(), i = this.getAxis();
                    return "horizontal" === i.orient ? i.contain(i.toLocalCoord(e[0])) && e[1] >= t.y && e[1] <= t.y + t.height : i.contain(i.toLocalCoord(e[1])) && e[0] >= t.y && e[0] <= t.y + t.height
                }, pointToData: function (e) {
                    var t = this.getAxis();
                    return [t.coordToData(t.toLocalCoord(e["horizontal" === t.orient ? 0 : 1]))]
                }, dataToPoint: function (e) {
                    var t = this.getAxis(), i = this.getRect(), n = [], a = "horizontal" === t.orient ? 0 : 1;
                    return e instanceof Array && (e = e[0]), n[a] = t.toGlobalCoord(t.dataToCoord(+e)), n[1 - a] = 0 == a ? i.y + i.height / 2 : i.x + i.width / 2, n
                }
            }).dimensions
        });
        var EI = ["axisLine", "axisTickLabel", "axisName"], PI = ["splitArea", "splitLine"], OI = im.extend({
            type: "singleAxis", axisPointerClass: "SingleAxisPointer", render: function (e, t, i, n) {
                var a = this.group;
                a.removeAll();
                var o = this._axisGroup;
                this._axisGroup = new Ai;
                var r = xI(e), s = new Kv(e, r);
                D(EI, s.add, s), a.add(this._axisGroup), a.add(s.getGroup()), D(PI, function (t) {
                    e.get(t + ".show") && this["_" + t](e)
                }, this), ul(o, this._axisGroup, e), OI.superCall(this, "render", e, t, i, n)
            }, remove: function () {
                lm(this)
            }, _splitLine: function (e) {
                var t = e.axis;
                if (!t.scale.isBlank()) {
                    var i = e.getModel("splitLine"), n = i.getModel("lineStyle"), a = n.get("width"),
                        o = n.get("color");
                    o = o instanceof Array ? o : [o];
                    for (var r = e.coordinateSystem.getRect(), s = t.isHorizontal(), l = [], d = 0, u = t.getTicksCoords({tickModel: i}), c = [], h = [], f = 0; f < u.length; ++f) {
                        var g = t.toGlobalCoord(u[f].coord);
                        s ? (c[0] = g, c[1] = r.y, h[0] = g, h[1] = r.y + r.height) : (c[0] = r.x, c[1] = g, h[0] = r.x + r.width, h[1] = g);
                        var p = d++ % o.length;
                        l[p] = l[p] || [], l[p].push(new is({
                            subPixelOptimize: !0,
                            shape: {x1: c[0], y1: c[1], x2: h[0], y2: h[1]},
                            style: {lineWidth: a},
                            silent: !0
                        }))
                    }
                    for (f = 0; f < l.length; ++f) this.group.add(Ns(l[f], {
                        style: {
                            stroke: o[f % o.length],
                            lineDash: n.getLineDash(a),
                            lineWidth: a
                        }, silent: !0
                    }))
                }
            }, _splitArea: function (e) {
                sm(this, this._axisGroup, e, e)
            }
        }), MI = bd.extend({
            type: "singleAxis",
            layoutMode: "box",
            axis: null,
            coordinateSystem: null,
            getCoordSysModel: function () {
                return this
            }
        });

        function FI(e, t) {
            var i, n = [], a = e.seriesIndex;
            if (null == a || !(i = t.getSeriesByIndex(a))) return {point: []};
            var o = i.getData(), r = Ka(o, e);
            if (null == r || r < 0 || M(r)) return {point: []};
            var s = o.getItemGraphicEl(r), l = i.coordinateSystem;
            if (i.getTooltipPosition) n = i.getTooltipPosition(r) || []; else if (l && l.dataToPoint) n = l.dataToPoint(o.getValues(A(l.dimensions, function (e) {
                return o.mapDimension(e)
            }), r, !0)) || []; else if (s) {
                var d = s.getBoundingRect().clone();
                d.applyTransform(s.transform), n = [d.x + d.width / 2, d.y + d.height / 2]
            }
            return {point: n, el: s}
        }

        m(MI.prototype, ip), Dv("single", MI, function (e, t) {
            return t.type || (t.data ? "category" : "value")
        }, {
            left: "5%",
            top: "5%",
            right: "5%",
            bottom: "5%",
            type: "value",
            position: "bottom",
            orient: "horizontal",
            axisLine: {show: !0, lineStyle: {width: 1, type: "solid"}},
            tooltip: {show: !0},
            axisTick: {show: !0, length: 6, lineStyle: {width: 1}},
            axisLabel: {show: !0, interval: "auto"},
            splitLine: {show: !0, lineStyle: {type: "dashed", opacity: .2}}
        });
        var LI = D, RI = O, BI = Va();

        function UI(e, t, i, n, a) {
            var o = e.axis;
            if (!o.scale.isBlank() && o.containData(t)) if (e.involveSeries) {
                var r = function (e, t) {
                    var i = t.axis, n = i.dim, a = e, o = [], r = Number.MAX_VALUE, s = -1;
                    return LI(t.seriesModels, function (t, l) {
                        var d, u, c = t.getData().mapDimension(n, !0);
                        if (t.getAxisTooltipData) {
                            var h = t.getAxisTooltipData(c, e, i);
                            u = h.dataIndices, d = h.nestestValue
                        } else {
                            if (!(u = t.getData().indicesOfNearest(c[0], e, "category" === i.type ? .5 : null)).length) return;
                            d = t.getData().get(c[0], u[0])
                        }
                        if (null != d && isFinite(d)) {
                            var f = e - d, g = Math.abs(f);
                            g <= r && ((g < r || 0 <= f && s < 0) && (r = g, s = f, a = d, o.length = 0), LI(u, function (e) {
                                o.push({
                                    seriesIndex: t.seriesIndex,
                                    dataIndexInside: e,
                                    dataIndex: t.getData().getRawIndex(e)
                                })
                            }))
                        }
                    }), {payloadBatch: o, snapToValue: a}
                }(t, e), s = r.payloadBatch, l = r.snapToValue;
                s[0] && null == a.seriesIndex && k(a, s[0]), !n && e.snap && o.containData(l) && null != l && (t = l), i.showPointer(e, t, s, a), i.showTooltip(e, r, l)
            } else i.showPointer(e, t)
        }

        function KI(e, t, i, n) {
            e[t.key] = {value: i, payloadBatch: n}
        }

        function VI(e, t, i, n) {
            var a = i.payloadBatch, o = t.axis, r = o.model, s = t.axisPointerModel;
            if (t.triggerTooltip && a.length) {
                var l = t.coordSys.model, d = tm(l), u = e.map[d];
                u || (u = e.map[d] = {
                    coordSysId: l.id,
                    coordSysIndex: l.componentIndex,
                    coordSysType: l.type,
                    coordSysMainType: l.mainType,
                    dataByAxis: []
                }, e.list.push(u)), u.dataByAxis.push({
                    axisDim: o.dim,
                    axisIndex: r.componentIndex,
                    axisType: r.type,
                    axisId: r.id,
                    value: n,
                    valueLabelOpt: {precision: s.get("label.precision"), formatter: s.get("label.formatter")},
                    seriesDataIndices: a.slice()
                })
            }
        }

        function WI(e) {
            var t = e.axis.model, i = {}, n = i.axisDim = e.axis.dim;
            return i.axisIndex = i[n + "AxisIndex"] = t.componentIndex, i.axisName = i[n + "AxisName"] = t.name, i.axisId = i[n + "AxisId"] = t.id, i
        }

        function GI(e) {
            return !e || null == e[0] || isNaN(e[0]) || null == e[1] || isNaN(e[1])
        }

        kf({
            type: "axisPointer",
            coordSysAxesInfo: null,
            defaultOption: {
                show: "auto",
                triggerOn: null,
                zlevel: 0,
                z: 50,
                type: "line",
                snap: !1,
                triggerTooltip: !0,
                value: null,
                status: null,
                link: [],
                animation: null,
                animationDurationUpdate: 200,
                lineStyle: {color: "#aaa", width: 1, type: "solid"},
                shadowStyle: {color: "rgba(150,150,150,0.3)"},
                label: {
                    show: !0,
                    formatter: null,
                    precision: "auto",
                    margin: 3,
                    color: "#fff",
                    padding: [5, 7, 5, 7],
                    backgroundColor: "auto",
                    borderColor: null,
                    borderWidth: 0,
                    shadowBlur: 3,
                    shadowColor: "#aaa"
                },
                handle: {
                    show: !1,
                    icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
                    size: 45,
                    margin: 50,
                    color: "#333",
                    shadowBlur: 3,
                    shadowColor: "#aaa",
                    shadowOffsetX: 0,
                    shadowOffsetY: 2,
                    throttle: 40
                }
            }
        });
        var HI = Va(), zI = D;

        function jI(e, t, i) {
            if (!a.node) {
                var n = t.getZr();
                HI(n).records || (HI(n).records = {}), function (e, t) {
                    function i(i, n) {
                        e.on(i, function (i) {
                            var a = function (e) {
                                var t = {showTip: [], hideTip: []}, i = function (n) {
                                    var a = t[n.type];
                                    a ? a.push(n) : (n.dispatchAction = i, e.dispatchAction(n))
                                };
                                return {dispatchAction: i, pendings: t}
                            }(t);
                            zI(HI(e).records, function (e) {
                                e && n(e, i, a.dispatchAction)
                            }), function (e, t) {
                                var i, n = e.showTip.length, a = e.hideTip.length;
                                n ? i = e.showTip[n - 1] : a && (i = e.hideTip[a - 1]), i && (i.dispatchAction = null, t.dispatchAction(i))
                            }(a.pendings, t)
                        })
                    }

                    HI(e).initialized || (HI(e).initialized = !0, i("click", O($I, "click")), i("mousemove", O($I, "mousemove")), i("globalout", XI))
                }(n, t), (HI(n).records[e] || (HI(n).records[e] = {})).handler = i
            }
        }

        function XI(e, t, i) {
            e.handler("leave", null, i)
        }

        function $I(e, t, i, n) {
            t.handler(e, i, n)
        }

        function YI(e, t) {
            if (!a.node) {
                var i = t.getZr();
                (HI(i).records || {})[e] && (HI(i).records[e] = null)
            }
        }

        var qI = Tf({
            type: "axisPointer", render: function (e, t, i) {
                var n = t.getComponent("tooltip"),
                    a = e.get("triggerOn") || n && n.get("triggerOn") || "mousemove|click";
                jI("axisPointer", i, function (e, t, i) {
                    "none" !== a && ("leave" === e || 0 <= a.indexOf(e)) && i({
                        type: "updateAxisPointer",
                        currTrigger: e,
                        x: t && t.offsetX,
                        y: t && t.offsetY
                    })
                })
            }, remove: function (e, t) {
                YI(t.getZr(), "axisPointer"), qI.superApply(this._model, "remove", arguments)
            }, dispose: function (e, t) {
                YI("axisPointer", t), qI.superApply(this._model, "dispose", arguments)
            }
        }), JI = Va(), ZI = v, QI = P;

        function eb() {
        }

        function tb(e, t, i, n) {
            !function e(t, i) {
                if (R(t) && R(i)) {
                    var n = !0;
                    return D(i, function (i, a) {
                        n = n && e(t[a], i)
                    }), !!n
                }
                return t === i
            }(JI(i).lastProp, n) && (JI(i).lastProp = n, t ? ol(i, n, e) : (i.stopAnimation(), i.attr(n)))
        }

        function ib(e, t) {
            e[t.get("label.show") ? "show" : "hide"]()
        }

        function nb(e) {
            return {position: e.position.slice(), rotation: e.rotation || 0}
        }

        function ab(e, t, i) {
            var n = t.get("z"), a = t.get("zlevel");
            e && e.traverse(function (e) {
                "group" !== e.type && (null != n && (e.z = n), null != a && (e.zlevel = a), e.silent = i)
            })
        }

        function ob(e) {
            var t, i = e.get("type"), n = e.getModel(i + "Style");
            return "line" === i ? (t = n.getLineStyle()).fill = null : "shadow" === i && ((t = n.getAreaStyle()).stroke = null), t
        }

        function rb(e, t, i, n, a) {
            var o = sb(i.get("value"), t.axis, t.ecModel, i.get("seriesDataIndices"), {
                    precision: i.get("label.precision"),
                    formatter: i.get("label.formatter")
                }), r = i.getModel("label"), s = ql(r.get("padding") || 0), l = r.getFont(), d = cn(o, l), u = a.position,
                c = d.width + s[1] + s[3], h = d.height + s[0] + s[2], f = a.align;
            "right" === f && (u[0] -= c), "center" === f && (u[0] -= c / 2);
            var g = a.verticalAlign;
            "bottom" === g && (u[1] -= h), "middle" === g && (u[1] -= h / 2), function (e, t, i, n) {
                var a = n.getWidth(), o = n.getHeight();
                e[0] = Math.min(e[0] + t, a) - t, e[1] = Math.min(e[1] + i, o) - i, e[0] = Math.max(e[0], 0), e[1] = Math.max(e[1], 0)
            }(u, c, h, n);
            var p = r.get("backgroundColor");
            p && "auto" !== p || (p = t.get("axisLine.lineStyle.color")), e.label = {
                shape: {
                    x: 0,
                    y: 0,
                    width: c,
                    height: h,
                    r: r.get("borderRadius")
                },
                position: u.slice(),
                style: {
                    text: o,
                    textFont: l,
                    textFill: r.getTextColor(),
                    textPosition: "inside",
                    textPadding: s,
                    fill: p,
                    stroke: r.get("borderColor") || "transparent",
                    lineWidth: r.get("borderWidth") || 0,
                    shadowBlur: r.get("shadowBlur"),
                    shadowColor: r.get("shadowColor"),
                    shadowOffsetX: r.get("shadowOffsetX"),
                    shadowOffsetY: r.get("shadowOffsetY")
                },
                z2: 10
            }
        }

        function sb(e, t, i, n, a) {
            e = t.scale.parse(e);
            var o = t.scale.getLabel(e, {precision: a.precision}), r = a.formatter;
            if (r) {
                var s = {value: Qg(t, e), axisDimension: t.dim, axisIndex: t.index, seriesData: []};
                D(n, function (e) {
                    var t = i.getSeriesByIndex(e.seriesIndex), n = e.dataIndexInside, a = t && t.getDataParams(n);
                    a && s.seriesData.push(a)
                }), L(r) ? o = r.replace("{value}", o) : F(r) && (o = r(s))
            }
            return o
        }

        function lb(e, t, i) {
            var n = ot();
            return ut(n, n, i.rotation), dt(n, n, i.position), ll([e.dataToCoord(t), (i.labelOffset || 0) + (i.labelDirection || 1) * (i.labelMargin || 0)], n)
        }

        function db(e, t, i, n, a, o) {
            var r = Kv.innerTextLayout(i.rotation, 0, i.labelDirection);
            i.labelMargin = a.get("label.margin"), rb(t, n, a, o, {
                position: lb(n.axis, e, i),
                align: r.textAlign,
                verticalAlign: r.textVerticalAlign
            })
        }

        function ub(e, t, i) {
            return {x1: e[i = i || 0], y1: e[1 - i], x2: t[i], y2: t[1 - i]}
        }

        function cb(e, t, i) {
            return {x: e[i = i || 0], y: e[1 - i], width: t[i], height: t[1 - i]}
        }

        function hb(e, t, i, n, a, o) {
            return {cx: e, cy: t, r0: i, r: n, startAngle: a, endAngle: o, clockwise: !0}
        }

        Ja((eb.prototype = {
            _group: null,
            _lastGraphicKey: null,
            _handle: null,
            _dragging: !1,
            _lastValue: null,
            _lastStatus: null,
            _payloadInfo: null,
            animationThreshold: 15,
            render: function (e, t, i, n) {
                var a = t.get("value"), o = t.get("status");
                if (this._axisModel = e, this._axisPointerModel = t, this._api = i, n || this._lastValue !== a || this._lastStatus !== o) {
                    this._lastValue = a, this._lastStatus = o;
                    var r = this._group, s = this._handle;
                    if (!o || "hide" === o) return r && r.hide(), void (s && s.hide());
                    r && r.show(), s && s.show();
                    var l = {};
                    this.makeElOption(l, a, e, t, i);
                    var d = l.graphicKey;
                    d !== this._lastGraphicKey && this.clear(i), this._lastGraphicKey = d;
                    var u = this._moveAnimation = this.determineAnimation(e, t);
                    if (r) {
                        var c = O(tb, t, u);
                        this.updatePointerEl(r, l, c, t), this.updateLabelEl(r, l, c, t)
                    } else r = this._group = new Ai, this.createPointerEl(r, l, e, t), this.createLabelEl(r, l, e, t), i.getZr().add(r);
                    ab(r, t, !0), this._renderHandle(a)
                }
            },
            remove: function (e) {
                this.clear(e)
            },
            dispose: function (e) {
                this.clear(e)
            },
            determineAnimation: function (e, t) {
                var i = t.get("animation"), n = e.axis, a = "category" === n.type, o = t.get("snap");
                if (!o && !a) return !1;
                if ("auto" !== i && null != i) return !0 === i;
                var r = this.animationThreshold;
                if (a && n.getBandWidth() > r) return !0;
                if (o) {
                    var s = Qv(e).seriesDataCount, l = n.getExtent();
                    return Math.abs(l[0] - l[1]) / s > r
                }
                return !1
            },
            makeElOption: function (e, t, i, n, a) {
            },
            createPointerEl: function (e, t, i, n) {
                var a = t.pointer;
                if (a) {
                    var o = JI(e).pointerEl = new vl[a.type](ZI(t.pointer));
                    e.add(o)
                }
            },
            createLabelEl: function (e, t, i, n) {
                if (t.label) {
                    var a = JI(e).labelEl = new es(ZI(t.label));
                    e.add(a), ib(a, n)
                }
            },
            updatePointerEl: function (e, t, i) {
                var n = JI(e).pointerEl;
                n && t.pointer && (n.setStyle(t.pointer.style), i(n, {shape: t.pointer.shape}))
            },
            updateLabelEl: function (e, t, i, n) {
                var a = JI(e).labelEl;
                a && (a.setStyle(t.label.style), i(a, {shape: t.label.shape, position: t.label.position}), ib(a, n))
            },
            _renderHandle: function (e) {
                if (!this._dragging && this.updateHandleTransform) {
                    var t, i = this._axisPointerModel, n = this._api.getZr(), a = this._handle,
                        o = i.getModel("handle"), r = i.get("status");
                    if (!o.get("show") || !r || "hide" === r) return a && n.remove(a), void (this._handle = null);
                    this._handle || (t = !0, a = this._handle = hl(o.get("icon"), {
                        cursor: "move",
                        draggable: !0,
                        onmousemove: function (e) {
                            je(e.event)
                        },
                        onmousedown: QI(this._onHandleDragMove, this, 0, 0),
                        drift: QI(this._onHandleDragMove, this),
                        ondragend: QI(this._onHandleDragEnd, this)
                    }), n.add(a)), ab(a, i, !1), a.setStyle(o.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
                    var s = o.get("size");
                    M(s) || (s = [s, s]), a.attr("scale", [s[0] / 2, s[1] / 2]), Ic(this, "_doDispatchAxisPointer", o.get("throttle") || 0, "fixRate"), this._moveHandleToValue(e, t)
                }
            },
            _moveHandleToValue: function (e, t) {
                tb(this._axisPointerModel, !t && this._moveAnimation, this._handle, nb(this.getHandleTransform(e, this._axisModel, this._axisPointerModel)))
            },
            _onHandleDragMove: function (e, t) {
                var i = this._handle;
                if (i) {
                    this._dragging = !0;
                    var n = this.updateHandleTransform(nb(i), [e, t], this._axisModel, this._axisPointerModel);
                    this._payloadInfo = n, i.stopAnimation(), i.attr(nb(n)), JI(i).lastProp = null, this._doDispatchAxisPointer()
                }
            },
            _doDispatchAxisPointer: function () {
                if (this._handle) {
                    var e = this._payloadInfo, t = this._axisModel;
                    this._api.dispatchAction({
                        type: "updateAxisPointer",
                        x: e.cursorPoint[0],
                        y: e.cursorPoint[1],
                        tooltipOption: e.tooltipOption,
                        axesInfo: [{axisDim: t.axis.dim, axisIndex: t.componentIndex}]
                    })
                }
            },
            _onHandleDragEnd: function (e) {
                if (this._dragging = !1, this._handle) {
                    var t = this._axisPointerModel.get("value");
                    this._moveHandleToValue(t), this._api.dispatchAction({type: "hideTip"})
                }
            },
            getHandleTransform: null,
            updateHandleTransform: null,
            clear: function (e) {
                this._lastValue = null, this._lastStatus = null;
                var t = e.getZr(), i = this._group, n = this._handle;
                t && i && (this._lastGraphicKey = null, i && t.remove(i), n && t.remove(n), this._group = null, this._handle = null, this._payloadInfo = null)
            },
            doClear: function () {
            },
            buildLabel: function (e, t, i) {
                return {x: e[i = i || 0], y: e[1 - i], width: t[i], height: t[1 - i]}
            }
        }).constructor = eb);
        var fb = eb.extend({
            makeElOption: function (e, t, i, n, a) {
                var o = i.axis, r = o.grid, s = n.get("type"), l = gb(r, o).getOtherAxis(o).getGlobalExtent(),
                    d = o.toGlobalCoord(o.dataToCoord(t, !0));
                if (s && "none" !== s) {
                    var u = ob(n), c = pb[s](o, d, l);
                    c.style = u, e.graphicKey = c.type, e.pointer = c
                }
                db(t, e, rm(r.model, i), i, n, a)
            }, getHandleTransform: function (e, t, i) {
                var n = rm(t.axis.grid.model, t, {labelInside: !1});
                return n.labelMargin = i.get("handle.margin"), {
                    position: lb(t.axis, e, n),
                    rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
                }
            }, updateHandleTransform: function (e, t, i, n) {
                var a = i.axis, o = a.grid, r = a.getGlobalExtent(!0), s = gb(o, a).getOtherAxis(a).getGlobalExtent(),
                    l = "x" === a.dim ? 0 : 1, d = e.position;
                d[l] += t[l], d[l] = Math.min(r[1], d[l]), d[l] = Math.max(r[0], d[l]);
                var u = (s[1] + s[0]) / 2, c = [u, u];
                return c[l] = d[l], {
                    position: d,
                    rotation: e.rotation,
                    cursorPoint: c,
                    tooltipOption: [{verticalAlign: "middle"}, {align: "center"}][l]
                }
            }
        });

        function gb(e, t) {
            var i = {};
            return i[t.dim + "AxisIndex"] = t.index, e.getCartesian(i)
        }

        var pb = {
            line: function (e, t, i) {
                return {type: "Line", subPixelOptimize: !0, shape: ub([t, i[0]], [t, i[1]], vb(e))}
            }, shadow: function (e, t, i) {
                var n = Math.max(1, e.getBandWidth()), a = i[1] - i[0];
                return {type: "Rect", shape: cb([t - n / 2, i[0]], [n, a], vb(e))}
            }
        };

        function vb(e) {
            return "x" === e.dim ? 0 : 1
        }

        im.registerAxisPointerClass("CartesianAxisPointer", fb), cf(function (e) {
            if (e) {
                e.axisPointer && 0 !== e.axisPointer.length || (e.axisPointer = {});
                var t = e.axisPointer.link;
                t && !M(t) && (e.axisPointer.link = [t])
            }
        }), hf(Sh.PROCESSOR.STATISTIC, function (e, t) {
            e.getComponent("axisPointer").coordSysAxesInfo = function (e, t) {
                var i = {axesInfo: {}, seriesInvolved: !1, coordSysAxesInfo: {}, coordSysMap: {}};
                return function (e, t, i) {
                    var n = t.getComponent("tooltip"), a = t.getComponent("axisPointer"), o = a.get("link", !0) || [],
                        r = [];
                    qv(i.getCoordinateSystems(), function (i) {
                        if (i.axisPointerEnabled) {
                            var s = tm(i.model), l = e.coordSysAxesInfo[s] = {},
                                d = (e.coordSysMap[s] = i).model.getModel("tooltip", n);
                            if (qv(i.getAxes(), Jv(f, !1, null)), i.getTooltipAxes && n && d.get("show")) {
                                var u = "axis" === d.get("trigger"), c = "cross" === d.get("axisPointer.type"),
                                    h = i.getTooltipAxes(d.get("axisPointer.axis"));
                                (u || c) && qv(h.baseAxes, Jv(f, !c || "cross", u)), c && qv(h.otherAxes, Jv(f, "cross", !1))
                            }
                        }

                        function f(n, s, u) {
                            var c = u.model.getModel("axisPointer", a), h = c.get("show");
                            if (h && ("auto" !== h || n || em(c))) {
                                null == s && (s = c.get("triggerTooltip"));
                                var f = (c = n ? function (e, t, i, n, a, o) {
                                        var r = t.getModel("axisPointer"), s = {};
                                        qv(["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], function (e) {
                                            s[e] = v(r.get(e))
                                        }), s.snap = "category" !== e.type && !!o, "cross" === r.get("type") && (s.type = "line");
                                        var l = s.label || (s.label = {});
                                        if (null == l.show && (l.show = !1), "cross" === a) {
                                            var d = r.get("label.show");
                                            if (l.show = null == d || d, !o) {
                                                var u = s.lineStyle = r.get("crossStyle");
                                                u && T(l, u.textStyle)
                                            }
                                        }
                                        return e.model.getModel("axisPointer", new Sl(s, i, n))
                                    }(u, d, a, t, n, s) : c).get("snap"), g = tm(u.model),
                                    p = s || f || "category" === u.type, m = e.axesInfo[g] = {
                                        key: g,
                                        axis: u,
                                        coordSys: i,
                                        axisPointerModel: c,
                                        triggerTooltip: s,
                                        involveSeries: p,
                                        snap: f,
                                        useHandle: em(c),
                                        seriesModels: []
                                    };
                                l[g] = m, e.seriesInvolved |= p;
                                var y = function (e, t) {
                                    for (var i = t.model, n = t.dim, a = 0; a < e.length; a++) {
                                        var o = e[a] || {};
                                        if (Zv(o[n + "AxisId"], i.id) || Zv(o[n + "AxisIndex"], i.componentIndex) || Zv(o[n + "AxisName"], i.name)) return a
                                    }
                                }(o, u);
                                if (null != y) {
                                    var k = r[y] || (r[y] = {axesInfo: {}});
                                    k.axesInfo[g] = m, k.mapper = o[y].mapper, m.linkGroup = k
                                }
                            }
                        }
                    })
                }(i, e, t), i.seriesInvolved && function (e, t) {
                    t.eachSeries(function (t) {
                        var i = t.coordinateSystem, n = t.get("tooltip.trigger", !0), a = t.get("tooltip.show", !0);
                        i && "none" !== n && !1 !== n && "item" !== n && !1 !== a && !1 !== t.get("axisPointer.show", !0) && qv(e.coordSysAxesInfo[tm(i.model)], function (e) {
                            var n = e.axis;
                            i.getAxis(n.dim) === n && (e.seriesModels.push(t), null == e.seriesDataCount && (e.seriesDataCount = 0), e.seriesDataCount += t.getData().count())
                        })
                    }, this)
                }(i, e), i
            }(e, t)
        }), ff({
            type: "updateAxisPointer",
            event: "updateAxisPointer",
            update: ":updateAxisPointer"
        }, function (e, t, i) {
            var n = e.currTrigger, a = [e.x, e.y], o = e, r = e.dispatchAction || P(i.dispatchAction, i),
                s = t.getComponent("axisPointer").coordSysAxesInfo;
            if (s) {
                GI(a) && (a = FI({seriesIndex: o.seriesIndex, dataIndex: o.dataIndex}, t).point);
                var l = GI(a), d = o.axesInfo, u = s.axesInfo, c = "leave" === n || GI(a), h = {}, f = {},
                    g = {list: [], map: {}}, p = {showPointer: RI(KI, f), showTooltip: RI(VI, g)};
                LI(s.coordSysMap, function (e, t) {
                    var i = l || e.containPoint(a);
                    LI(s.coordSysAxesInfo[t], function (e, t) {
                        var n = e.axis, o = function (e, t) {
                            for (var i = 0; i < (e || []).length; i++) {
                                var n = e[i];
                                if (t.axis.dim === n.axisDim && t.axis.model.componentIndex === n.axisIndex) return n
                            }
                        }(d, e);
                        if (!c && i && (!d || o)) {
                            var r = o && o.value;
                            null != r || l || (r = n.pointToData(a)), null != r && UI(e, r, p, !1, h)
                        }
                    })
                });
                var v = {};
                return LI(u, function (e, t) {
                    var i = e.linkGroup;
                    i && !f[t] && LI(i.axesInfo, function (t, n) {
                        var a = f[n];
                        if (t !== e && a) {
                            var o = a.value;
                            i.mapper && (o = e.axis.scale.parse(i.mapper(o, WI(t), WI(e)))), v[e.key] = o
                        }
                    })
                }), LI(v, function (e, t) {
                    UI(u[t], e, p, !0, h)
                }), function (e, t, i) {
                    var n = i.axesInfo = [];
                    LI(t, function (t, i) {
                        var a = t.axisPointerModel.option, o = e[i];
                        o ? (t.useHandle || (a.status = "show"), a.value = o.value, a.seriesDataIndices = (o.payloadBatch || []).slice()) : t.useHandle || (a.status = "hide"), "show" === a.status && n.push({
                            axisDim: t.axis.dim,
                            axisIndex: t.axis.model.componentIndex,
                            value: a.value
                        })
                    })
                }(f, u, h), function (e, t, i, n) {
                    if (GI(t) || !e.list.length) return n({type: "hideTip"});
                    var a = ((e.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
                    n({
                        type: "showTip",
                        escapeConnect: !0,
                        x: t[0],
                        y: t[1],
                        tooltipOption: i.tooltipOption,
                        position: i.position,
                        dataIndexInside: a.dataIndexInside,
                        dataIndex: a.dataIndex,
                        seriesIndex: a.seriesIndex,
                        dataByCoordSys: e.list
                    })
                }(g, a, e, r), function (e, t, i) {
                    var n = i.getZr(), a = "axisPointerLastHighlights", o = BI(n)[a] || {}, r = BI(n)[a] = {};
                    LI(e, function (e, t) {
                        var i = e.axisPointerModel.option;
                        "show" === i.status && LI(i.seriesDataIndices, function (e) {
                            var t = e.seriesIndex + " | " + e.dataIndex;
                            r[t] = e
                        })
                    });
                    var s = [], l = [];
                    D(o, function (e, t) {
                        r[t] || l.push(e)
                    }), D(r, function (e, t) {
                        o[t] || s.push(e)
                    }), l.length && i.dispatchAction({
                        type: "downplay",
                        escapeConnect: !0,
                        batch: l
                    }), s.length && i.dispatchAction({type: "highlight", escapeConnect: !0, batch: s})
                }(u, 0, i), h
            }
        });
        var mb = ["x", "y"], yb = ["width", "height"], kb = eb.extend({
            makeElOption: function (e, t, i, n, a) {
                var o = i.axis, r = o.coordinateSystem, s = Cb(r, 1 - wb(o)), l = r.dataToPoint(t)[0],
                    d = n.get("type");
                if (d && "none" !== d) {
                    var u = ob(n), c = Tb[d](o, l, s);
                    c.style = u, e.graphicKey = c.type, e.pointer = c
                }
                db(t, e, xI(i), i, n, a)
            }, getHandleTransform: function (e, t, i) {
                var n = xI(t, {labelInside: !1});
                return n.labelMargin = i.get("handle.margin"), {
                    position: lb(t.axis, e, n),
                    rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
                }
            }, updateHandleTransform: function (e, t, i, n) {
                var a = i.axis, o = a.coordinateSystem, r = wb(a), s = Cb(o, r), l = e.position;
                l[r] += t[r], l[r] = Math.min(s[1], l[r]), l[r] = Math.max(s[0], l[r]);
                var d = Cb(o, 1 - r), u = (d[1] + d[0]) / 2, c = [u, u];
                return c[r] = l[r], {
                    position: l,
                    rotation: e.rotation,
                    cursorPoint: c,
                    tooltipOption: {verticalAlign: "middle"}
                }
            }
        }), Tb = {
            line: function (e, t, i) {
                return {type: "Line", subPixelOptimize: !0, shape: ub([t, i[0]], [t, i[1]], wb(e))}
            }, shadow: function (e, t, i) {
                var n = e.getBandWidth(), a = i[1] - i[0];
                return {type: "Rect", shape: cb([t - n / 2, i[0]], [n, a], wb(e))}
            }
        };

        function wb(e) {
            return e.isHorizontal() ? 0 : 1
        }

        function Cb(e, t) {
            var i = e.getRect();
            return [i[mb[t]], i[mb[t]] + i[yb[t]]]
        }

        im.registerAxisPointerClass("SingleAxisPointer", kb), Tf({type: "single"});
        var Sb = ec.extend({
            type: "series.themeRiver",
            dependencies: ["singleAxis"],
            nameMap: null,
            init: function (e) {
                Sb.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this))
            },
            fixData: function (e) {
                var t = e.length, i = Xa(e, function (e) {
                    return e[2]
                }), n = [];
                i.buckets.each(function (e, t) {
                    n.push({name: t, dataList: e})
                });
                for (var a = n.length, o = -1, r = -1, s = 0; s < a; ++s) {
                    var l = n[s].dataList.length;
                    o < l && (o = l, r = s)
                }
                for (var d = 0; d < a; ++d) if (d !== r) for (var u = n[d].name, c = 0; c < o; ++c) {
                    for (var h = n[r].dataList[c][0], f = n[d].dataList.length, g = -1, p = 0; p < f; ++p) if (n[d].dataList[p][0] === h) {
                        g = p;
                        break
                    }
                    -1 === g && (e[t] = [], e[t][0] = h, e[t][1] = 0, e[t][2] = u, t++)
                }
                return e
            },
            getInitialData: function (e, t) {
                for (var i = t.queryComponents({
                    mainType: "singleAxis",
                    index: this.get("singleAxisIndex"),
                    id: this.get("singleAxisId")
                })[0].get("type"), n = x(e.data, function (e) {
                    return void 0 !== e[2]
                }), a = this.fixData(n || []), o = [], r = this.nameMap = Q(), s = 0, l = 0; l < a.length; ++l) o.push(a[l][2]), r.get(a[l][2]) || (r.set(a[l][2], s), s++);
                var d = eg(a, {
                    coordDimensions: ["single"],
                    dimensionsDefine: [{name: "time", type: Af(i)}, {name: "value", type: "float"}, {
                        name: "name",
                        type: "ordinal"
                    }],
                    encodeDefine: {single: 0, value: 1, itemName: 2}
                }), u = new Kf(d, this);
                return u.initData(a), u
            },
            getLayerSeries: function () {
                for (var e = this.getData(), t = e.count(), i = [], n = 0; n < t; ++n) i[n] = n;
                var a = e.mapDimension("single"), o = Xa(i, function (t) {
                    return e.get("name", t)
                }), r = [];
                return o.buckets.each(function (t, i) {
                    t.sort(function (t, i) {
                        return e.get(a, t) - e.get(a, i)
                    }), r.push({name: i, indices: t})
                }), r
            },
            getAxisTooltipData: function (e, t, i) {
                M(e) || (e = e ? [e] : []);
                for (var n, a = this.getData(), o = this.getLayerSeries(), r = [], s = o.length, l = 0; l < s; ++l) {
                    for (var d = Number.MAX_VALUE, u = -1, c = o[l].indices.length, h = 0; h < c; ++h) {
                        var f = a.get(e[0], o[l].indices[h]), g = Math.abs(f - t);
                        g <= d && (n = f, d = g, u = o[l].indices[h])
                    }
                    r.push(u)
                }
                return {dataIndices: r, nestestValue: n}
            },
            formatTooltip: function (e) {
                var t = this.getData(), i = t.getName(e), n = t.get(t.mapDimension("value"), e);
                return !isNaN(n) && null != n || (n = "-"), Ql(i + " : " + n)
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "singleAxis",
                boundaryGap: ["10%", "10%"],
                singleAxisIndex: 0,
                animationEasing: "linear",
                label: {margin: 4, show: !0, position: "left", color: "#000", fontSize: 11},
                emphasis: {label: {show: !0}}
            }
        });

        function Ib(e, t, i) {
            if (e.count()) for (var n, a = t.coordinateSystem, o = t.getLayerSeries(), r = e.mapDimension("single"), s = e.mapDimension("value"), l = A(o, function (t) {
                return A(t.indices, function (t) {
                    var i = a.dataToPoint(e.get(r, t));
                    return i[1] = e.get(s, t), i
                })
            }), d = function (e) {
                for (var t = e.length, i = e[0].length, n = [], a = [], o = 0, r = {}, s = 0; s < i; ++s) {
                    for (var l = 0, d = 0; l < t; ++l) d += e[l][s][1];
                    o < d && (o = d), n.push(d)
                }
                for (var u = 0; u < i; ++u) a[u] = (o - n[u]) / 2;
                for (var c = o = 0; c < i; ++c) {
                    var h = n[c] + a[c];
                    o < h && (o = h)
                }
                return r.y0 = a, r.max = o, r
            }(l), u = d.y0, c = i / d.max, h = o.length, f = o[0].indices.length, g = 0; g < f; ++g) {
                n = u[g] * c, e.setItemLayout(o[0].indices[g], {
                    layerIndex: 0,
                    x: l[0][g][0],
                    y0: n,
                    y: l[0][g][1] * c
                });
                for (var p = 1; p < h; ++p) n += l[p - 1][g][1] * c, e.setItemLayout(o[p].indices[g], {
                    layerIndex: p,
                    x: l[p][g][0],
                    y0: n,
                    y: l[p][g][1] * c
                })
            }
        }

        Cf({
            type: "themeRiver", init: function () {
                this._layers = []
            }, render: function (e, t, i) {
                var n = e.getData(), a = this.group, o = e.getLayerSeries(), r = n.getLayout("layoutInfo"), s = r.rect,
                    l = r.boundaryGap;

                function d(e) {
                    return e.name
                }

                a.attr("position", [0, s.y + l[0]]);
                var u = new If(this._layersSeries || [], o, d, d), c = {};

                function h(t, i, r) {
                    var s = this._layers;
                    if ("remove" !== t) {
                        for (var l, d, u, h = [], f = [], g = o[i].indices, p = 0; p < g.length; p++) {
                            var v = n.getItemLayout(g[p]), m = v.x, y = v.y0, T = v.y;
                            h.push([m, y]), f.push([m, y + T]), l = n.getItemVisual(g[p], "color")
                        }
                        var w = n.getItemLayout(g[0]), C = n.getItemModel(g[p - 1]), S = C.getModel("label"),
                            I = S.get("margin");
                        if ("add" === t) {
                            var b = c[i] = new Ai;
                            d = new lv({
                                shape: {
                                    points: h,
                                    stackedOnPoints: f,
                                    smooth: .4,
                                    stackedOnSmooth: .4,
                                    smoothConstraint: !1
                                }, z2: 0
                            }), u = new Ur({
                                style: {
                                    x: w.x - I,
                                    y: w.y0 + w.y / 2
                                }
                            }), b.add(d), b.add(u), a.add(b), d.setClipPath(function (e, t, i) {
                                var n = new es({shape: {x: e.x - 10, y: e.y - 10, width: 0, height: e.height + 20}});
                                return rl(n, {shape: {width: e.width + 20, height: e.height + 20}}, t, function () {
                                    d.removeClipPath()
                                }), n
                            }(d.getBoundingRect(), e))
                        } else b = s[r], d = b.childAt(0), u = b.childAt(1), a.add(b), c[i] = b, ol(d, {
                            shape: {
                                points: h,
                                stackedOnPoints: f
                            }
                        }, e), ol(u, {style: {x: w.x - I, y: w.y0 + w.y / 2}}, e);
                        var _ = C.getModel("emphasis.itemStyle"), D = C.getModel("itemStyle");
                        Js(u.style, S, {
                            text: S.get("show") ? e.getFormattedLabel(g[p - 1], "normal") || n.getName(g[p - 1]) : null,
                            textVerticalAlign: "middle"
                        }), d.setStyle(k({fill: l}, D.getItemStyle(["color"]))), zs(d, _.getItemStyle())
                    } else a.remove(s[i])
                }

                u.add(P(h, this, "add")).update(P(h, this, "update")).remove(P(h, this, "remove")).execute(), this._layersSeries = o, this._layers = c
            }, dispose: function () {
            }
        }), pf(function (e, t) {
            e.eachSeriesByType("themeRiver", function (e) {
                var t = e.getData(), i = e.coordinateSystem, n = {}, a = i.getRect();
                n.rect = a;
                var o = e.get("boundaryGap"), r = i.getAxis();
                n.boundaryGap = o, "horizontal" === r.orient ? (o[0] = xl(o[0], a.height), o[1] = xl(o[1], a.height), Ib(t, e, a.height - o[0] - o[1])) : (o[0] = xl(o[0], a.width), o[1] = xl(o[1], a.width), Ib(t, e, a.width - o[0] - o[1])), t.setLayout("layoutInfo", n)
            })
        }), vf(function (e) {
            e.eachSeriesByType("themeRiver", function (e) {
                var t = e.getData(), i = e.getRawData(), n = e.get("color"), a = Q();
                t.each(function (e) {
                    a.set(t.getRawIndex(e), e)
                }), i.each(function (o) {
                    var r = i.getName(o), s = n[(e.nameMap.get(r) - 1) % n.length];
                    i.setItemVisual(o, "color", s);
                    var l = a.get(o);
                    null != l && t.setItemVisual(l, "color", s)
                })
            })
        }), hf($m("themeRiver")), ec.extend({
            type: "series.sunburst",
            _viewRoot: null,
            getInitialData: function (e, t) {
                var i = {name: e.name, children: e.data};
                !function e(t) {
                    var i = 0;
                    D(t.children, function (t) {
                        e(t);
                        var n = t.value;
                        M(n) && (n = n[0]), i += n
                    });
                    var n = t.value;
                    M(n) && (n = n[0]), null != n && !isNaN(n) || (n = i), n < 0 && (n = 0), M(t.value) ? t.value[0] = n : t.value = n
                }(i);
                var n = e.levels || [], a = {};
                return a.levels = n, uk.createTree(i, this, a).data
            },
            optionUpdated: function () {
                this.resetViewRoot()
            },
            getDataParams: function (e) {
                var t = ec.prototype.getDataParams.apply(this, arguments),
                    i = this.getData().tree.getNodeByDataIndex(e);
                return t.treePathInfo = Nk(i, this), t
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                center: ["50%", "50%"],
                radius: [0, "75%"],
                clockwise: !0,
                startAngle: 90,
                minAngle: 0,
                percentPrecision: 2,
                stillShowZeroSum: !0,
                highlightPolicy: "descendant",
                nodeClick: "rootToNode",
                renderLabelForZeroData: !1,
                label: {
                    rotate: "radial",
                    show: !0,
                    opacity: 1,
                    align: "center",
                    position: "inside",
                    distance: 5,
                    silent: !0
                },
                itemStyle: {
                    borderWidth: 1,
                    borderColor: "white",
                    borderType: "solid",
                    shadowBlur: 0,
                    shadowColor: "rgba(0, 0, 0, 0.2)",
                    shadowOffsetX: 0,
                    shadowOffsetY: 0,
                    opacity: 1
                },
                highlight: {itemStyle: {opacity: 1}},
                downplay: {itemStyle: {opacity: .5}, label: {opacity: .6}},
                animationType: "expansion",
                animationDuration: 1e3,
                animationDurationUpdate: 500,
                animationEasing: "cubicOut",
                data: [],
                levels: [],
                sort: "desc"
            },
            getViewRoot: function () {
                return this._viewRoot
            },
            resetViewRoot: function (e) {
                e ? this._viewRoot = e : e = this._viewRoot;
                var t = this.getRawData().tree.root;
                e && (e === t || t.contains(e)) || (this._viewRoot = t)
            }
        });
        var bb = 2, _b = 4;

        function Db(e, t, i) {
            Ai.call(this);
            var n = new Gr({z2: bb});
            n.seriesIndex = t.seriesIndex;
            var a = new Ur({z2: _b, silent: e.getModel("label").get("silent")});

            function o() {
                a.ignore = a.hoverIgnore
            }

            function r() {
                a.ignore = a.normalIgnore
            }

            this.add(n), this.add(a), this.updateData(!0, e, "normal", t, i), this.on("emphasis", o).on("normal", r).on("mouseover", o).on("mouseout", r)
        }

        var Ab = Db.prototype;
        Ab.updateData = function (e, t, i, n, a) {
            (this.node = t).piece = this, n = n || this._seriesModel, a = a || this._ecModel;
            var o = this.childAt(0);
            o.dataIndex = t.dataIndex;
            var r = t.getModel(), s = t.getLayout(), l = k({}, s);
            l.label = null;
            var d = function (e, t, i) {
                var n = e.getVisual("color"), a = e.getVisual("visualMeta");
                a && 0 !== a.length || (n = null);
                var o = e.getModel("itemStyle").get("color");
                if (o) return o;
                if (n) return n;
                if (0 === e.depth) return i.option.color[0];
                var r = i.option.color.length;
                return o = i.option.color[function (e) {
                    for (var t = e; 1 < t.depth;) t = t.parentNode;
                    return S(e.getAncestors()[0].children, t)
                }(e) % r]
            }(t, 0, a);
            !function (e, t, i) {
                t.getData().setItemVisual(e.dataIndex, "color", i)
            }(t, n, d);
            var u, c = r.getModel("itemStyle").getItemStyle();
            u = T({
                lineJoin: "bevel",
                fill: (u = "normal" === i ? c : m(r.getModel(i + ".itemStyle").getItemStyle(), c)).fill || d
            }, u), e ? (o.setShape(l), o.shape.r = s.r0, ol(o, {shape: {r: s.r}}, n, t.dataIndex), o.useStyle(u)) : "object" == typeof u.fill && u.fill.type || "object" == typeof o.style.fill && o.style.fill.type ? (ol(o, {shape: l}, n), o.useStyle(u)) : ol(o, {
                shape: l,
                style: u
            }, n), this._updateLabel(n, d, i);
            var h = r.getShallow("cursor");
            if (h && o.attr("cursor", h), e) {
                var f = n.getShallow("highlightPolicy");
                this._initEvents(o, t, n, f)
            }
            this._seriesModel = n || this._seriesModel, this._ecModel = a || this._ecModel, zs(this)
        }, Ab.onEmphasis = function (e) {
            var t = this;
            this.node.hostTree.root.eachNode(function (i) {
                i.piece && (t.node === i ? i.piece.updateData(!1, i, "emphasis") : function (e, t, i) {
                    return "none" !== i && ("self" === i ? e === t : "ancestor" === i ? e === t || e.isAncestorOf(t) : e === t || e.isDescendantOf(t))
                }(i, t.node, e) ? i.piece.childAt(0).trigger("highlight") : "none" !== e && i.piece.childAt(0).trigger("downplay"))
            })
        }, Ab.onNormal = function () {
            this.node.hostTree.root.eachNode(function (e) {
                e.piece && e.piece.updateData(!1, e, "normal")
            })
        }, Ab.onHighlight = function () {
            this.updateData(!1, this.node, "highlight")
        }, Ab.onDownplay = function () {
            this.updateData(!1, this.node, "downplay")
        }, Ab._updateLabel = function (e, t, i) {
            var n = this.node.getModel(), a = n.getModel("label"),
                o = "normal" === i || "emphasis" === i ? a : n.getModel(i + ".label"), r = n.getModel("emphasis.label"),
                s = W(e.getFormattedLabel(this.node.dataIndex, i, null, null, "label"), this.node.name);
            !1 === S("show") && (s = "");
            var l = this.node.getLayout(), d = o.get("minAngle");
            null == d && (d = a.get("minAngle")), d = d / 180 * Math.PI;
            var u = l.endAngle - l.startAngle;
            null != d && Math.abs(u) < d && (s = "");
            var c = this.childAt(1);
            Ys(c.style, c.hoverStyle || {}, a, r, {
                defaultText: o.getShallow("show") ? s : null,
                autoColor: t,
                useInsideStyle: !0
            });
            var h, f = (l.startAngle + l.endAngle) / 2, g = Math.cos(f), p = Math.sin(f), v = S("position"),
                m = S("distance") || 0, y = S("align");
            "outside" === v ? (h = l.r + m, y = f > Math.PI / 2 ? "right" : "left") : y && "center" !== y ? "left" === y ? (h = l.r0 + m, f > Math.PI / 2 && (y = "right")) : "right" === y && (h = l.r - m, f > Math.PI / 2 && (y = "left")) : (h = (l.r + l.r0) / 2, y = "center"), c.attr("style", {
                text: s,
                textAlign: y,
                textVerticalAlign: S("verticalAlign") || "middle",
                opacity: S("opacity")
            });
            var k = h * g + l.cx, T = h * p + l.cy;
            c.attr("position", [k, T]);
            var w = S("rotate"), C = 0;

            function S(e) {
                var t = o.get(e);
                return null == t ? a.get(e) : t
            }

            "radial" === w ? (C = -f) < -Math.PI / 2 && (C += Math.PI) : "tangential" === w ? (C = Math.PI / 2 - f) > Math.PI / 2 ? C -= Math.PI : C < -Math.PI / 2 && (C += Math.PI) : "number" == typeof w && (C = w * Math.PI / 180), c.attr("rotation", C)
        }, Ab._initEvents = function (e, t, i, n) {
            function a() {
                r.onEmphasis(n)
            }

            function o() {
                r.onNormal()
            }

            e.off("mouseover").off("mouseout").off("emphasis").off("normal");
            var r = this;
            i.isAnimationEnabled() && e.on("mouseover", a).on("mouseout", o).on("emphasis", a).on("normal", o).on("downplay", function () {
                r.onDownplay()
            }).on("highlight", function () {
                r.onHighlight()
            })
        }, I(Db, Ai), fc.extend({
            type: "sunburst", init: function () {
            }, render: function (e, t, i, n) {
                var a = this;
                this.seriesModel = e, this.api = i, this.ecModel = t;
                var o = e.getData(), r = o.tree.root, s = e.getViewRoot(), l = this.group,
                    d = e.get("renderLabelForZeroData"), u = [];
                s.eachNode(function (e) {
                    u.push(e)
                });
                var c = this._oldChildren || [];
                if (function (i, n) {
                    function a(e) {
                        return e.getId()
                    }

                    function s(a, s) {
                        !function (i, n) {
                            if (d || !i || i.getValue() || (i = null), i !== r && n !== r) if (n && n.piece) i ? (n.piece.updateData(!1, i, "normal", e, t), o.setItemGraphicEl(i.dataIndex, n.piece)) : function (e) {
                                e && e.piece && (l.remove(e.piece), e.piece = null)
                            }(n); else if (i) {
                                var a = new Db(i, e, t);
                                l.add(a), o.setItemGraphicEl(i.dataIndex, a)
                            }
                        }(null == a ? null : i[a], null == s ? null : n[s])
                    }

                    0 === i.length && 0 === n.length || new If(n, i, a, a).add(s).update(s).remove(O(s, null)).execute()
                }(u, c), function (i, n) {
                    if (0 < n.depth) {
                        a.virtualPiece ? a.virtualPiece.updateData(!1, i, "normal", e, t) : (a.virtualPiece = new Db(i, e, t), l.add(a.virtualPiece)), n.piece._onclickEvent && n.piece.off("click", n.piece._onclickEvent);
                        var o = function (e) {
                            a._rootToNode(n.parentNode)
                        };
                        n.piece._onclickEvent = o, a.virtualPiece.on("click", o)
                    } else a.virtualPiece && (l.remove(a.virtualPiece), a.virtualPiece = null)
                }(r, s), n && n.highlight && n.highlight.piece) {
                    var h = e.getShallow("highlightPolicy");
                    n.highlight.piece.onEmphasis(h)
                } else if (n && n.unhighlight) {
                    var f = this.virtualPiece;
                    !f && r.children.length && (f = r.children[0].piece), f && f.onNormal()
                }
                this._initEvents(), this._oldChildren = u
            }, dispose: function () {
            }, _initEvents: function () {
                function e(e) {
                    var i = !1;
                    t.seriesModel.getViewRoot().eachNode(function (n) {
                        if (!i && n.piece && n.piece.childAt(0) === e.target) {
                            var a = n.getModel().get("nodeClick");
                            if ("rootToNode" === a) t._rootToNode(n); else if ("link" === a) {
                                var o = n.getModel(), r = o.get("link");
                                r && dd(r, o.get("target", !0) || "_blank")
                            }
                            i = !0
                        }
                    })
                }

                var t = this;
                this.group._onclickEvent && this.group.off("click", this.group._onclickEvent), this.group.on("click", e), this.group._onclickEvent = e
            }, _rootToNode: function (e) {
                e !== this.seriesModel.getViewRoot() && this.api.dispatchAction({
                    type: "sunburstRootToNode",
                    from: this.uid,
                    seriesId: this.seriesModel.id,
                    targetNode: e
                })
            }, containPoint: function (e, t) {
                var i = t.getData().getItemLayout(0);
                if (i) {
                    var n = e[0] - i.cx, a = e[1] - i.cy, o = Math.sqrt(n * n + a * a);
                    return o <= i.r && o >= i.r0
                }
            }
        });
        var Nb = "sunburstRootToNode";
        ff({type: Nb, update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sunburst", query: e}, function (t, i) {
                var n = _k(e, [Nb], t);
                if (n) {
                    var a = t.getViewRoot();
                    a && (e.direction = Ak(a, n.node) ? "rollUp" : "drillDown"), t.resetViewRoot(n.node)
                }
            })
        });
        var xb = "sunburstHighlight";
        ff({type: xb, update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sunburst", query: e}, function (t, i) {
                var n = _k(e, [xb], t);
                n && (e.highlight = n.node)
            })
        }), ff({type: "sunburstUnhighlight", update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sunburst", query: e}, function (t, i) {
                e.unhighlight = !0
            })
        });
        var Eb = Math.PI / 180;

        function Pb(e, t) {
            return t = t || [0, 0], A(["x", "y"], function (i, n) {
                var a = this.getAxis(i), o = t[n], r = e[n] / 2;
                return "category" === a.type ? a.getBandWidth() : Math.abs(a.dataToCoord(o - r) - a.dataToCoord(o + r))
            }, this)
        }

        function Ob(e, t) {
            return t = t || [0, 0], A([0, 1], function (i) {
                var n = t[i], a = e[i] / 2, o = [], r = [];
                return o[i] = n - a, r[i] = n + a, o[1 - i] = r[1 - i] = t[1 - i], Math.abs(this.dataToPoint(o)[i] - this.dataToPoint(r)[i])
            }, this)
        }

        function Mb(e, t) {
            var i = this.getAxis(), n = t instanceof Array ? t[0] : t, a = (e instanceof Array ? e[0] : e) / 2;
            return "category" === i.type ? i.getBandWidth() : Math.abs(i.dataToCoord(n - a) - i.dataToCoord(n + a))
        }

        function Fb(e, t) {
            return A(["Radius", "Angle"], function (i, n) {
                var a = this["get" + i + "Axis"](), o = t[n], r = e[n] / 2, s = "dataTo" + i,
                    l = "category" === a.type ? a.getBandWidth() : Math.abs(a[s](o - r) - a[s](o + r));
                return "Angle" === i && (l = l * Math.PI / 180), l
            }, this)
        }

        vf(O(Wm, "sunburst")), pf(O(function (e, t, i, n) {
            t.eachSeriesByType(e, function (e) {
                var t = e.get("center"), n = e.get("radius");
                M(n) || (n = [0, n]), M(t) || (t = [t, t]);
                var a = i.getWidth(), o = i.getHeight(), r = Math.min(a, o), s = xl(t[0], a), l = xl(t[1], o),
                    d = xl(n[0], r / 2), u = xl(n[1], r / 2), c = -e.get("startAngle") * Eb, h = e.get("minAngle") * Eb,
                    f = e.getData().tree.root, g = e.getViewRoot(), p = g.depth, v = e.get("sort");
                null != v && function e(t, i) {
                    var n = t.children || [];
                    t.children = function (e, t) {
                        if ("function" == typeof t) return e.sort(t);
                        var i = "asc" === t;
                        return e.sort(function (e, t) {
                            var n = (e.getValue() - t.getValue()) * (i ? 1 : -1);
                            return 0 == n ? (e.dataIndex - t.dataIndex) * (i ? -1 : 1) : n
                        })
                    }(n, i), n.length && D(t.children, function (t) {
                        e(t, i)
                    })
                }(g, v);
                var m = 0;
                D(g.children, function (e) {
                    isNaN(e.getValue()) || m++
                });
                var y = g.getValue(), k = Math.PI / (y || m) * 2, T = 0 < g.depth, w = g.height - (T ? -1 : 1),
                    C = (u - d) / (w || 1), S = e.get("clockwise"), I = e.get("stillShowZeroSum"), b = S ? 1 : -1,
                    _ = function (e, t) {
                        if (e) {
                            var i = t;
                            if (e !== f) {
                                var n = e.getValue(), a = 0 === y && I ? k : n * k;
                                a < h && (a = h), i = t + b * a;
                                var o = e.depth - p - (T ? -1 : 1), u = d + C * o, c = d + C * (1 + o),
                                    g = e.getModel();
                                null != g.get("r0") && (u = xl(g.get("r0"), r / 2)), null != g.get("r") && (c = xl(g.get("r"), r / 2)), e.setLayout({
                                    angle: a,
                                    startAngle: t,
                                    endAngle: i,
                                    clockwise: S,
                                    cx: s,
                                    cy: l,
                                    r0: u,
                                    r: c
                                })
                            }
                            if (e.children && e.children.length) {
                                var v = 0;
                                D(e.children, function (e) {
                                    v += _(e, t + v)
                                })
                            }
                            return i - t
                        }
                    };
                if (T) {
                    var A = d, N = d + C, x = 2 * Math.PI;
                    f.setLayout({angle: x, startAngle: c, endAngle: c + x, clockwise: S, cx: s, cy: l, r0: A, r: N})
                }
                _(g, c)
            })
        }, "sunburst")), hf(O($m, "sunburst"));
        var Lb = ms, Rb = ["itemStyle"], Bb = ["emphasis", "itemStyle"], Ub = ["label"], Kb = ["emphasis", "label"],
            Vb = "e\0\0", Wb = {
                cartesian2d: function (e) {
                    var t = e.grid.getRect();
                    return {
                        coordSys: {type: "cartesian2d", x: t.x, y: t.y, width: t.width, height: t.height},
                        api: {
                            coord: function (t) {
                                return e.dataToPoint(t)
                            }, size: P(Pb, e)
                        }
                    }
                }, geo: function (e) {
                    var t = e.getBoundingRect();
                    return {
                        coordSys: {type: "geo", x: t.x, y: t.y, width: t.width, height: t.height, zoom: e.getZoom()},
                        api: {
                            coord: function (t) {
                                return e.dataToPoint(t)
                            }, size: P(Ob, e)
                        }
                    }
                }, singleAxis: function (e) {
                    var t = e.getRect();
                    return {
                        coordSys: {type: "singleAxis", x: t.x, y: t.y, width: t.width, height: t.height},
                        api: {
                            coord: function (t) {
                                return e.dataToPoint(t)
                            }, size: P(Mb, e)
                        }
                    }
                }, polar: function (e) {
                    var t = e.getRadiusAxis(), i = e.getAngleAxis(), n = t.getExtent();
                    return n[0] > n[1] && n.reverse(), {
                        coordSys: {type: "polar", cx: e.cx, cy: e.cy, r: n[1], r0: n[0]},
                        api: {
                            coord: P(function (n) {
                                var a = t.dataToRadius(n[0]), o = i.dataToAngle(n[1]), r = e.coordToPoint([a, o]);
                                return r.push(a, o * Math.PI / 180), r
                            }), size: P(Fb, e)
                        }
                    }
                }, calendar: function (e) {
                    var t = e.getRect(), i = e.getRangeInfo();
                    return {
                        coordSys: {
                            type: "calendar",
                            x: t.x,
                            y: t.y,
                            width: t.width,
                            height: t.height,
                            cellWidth: e.getCellWidth(),
                            cellHeight: e.getCellHeight(),
                            rangeInfo: {start: i.start, end: i.end, weeks: i.weeks, dayCount: i.allDay}
                        }, api: {
                            coord: function (t, i) {
                                return e.dataToPoint(t, i)
                            }
                        }
                    }
                }
            };

        function Gb(e, t, i, n, a) {
            null == i[e] || a || (t[e] = i[e], i[e] = n[e])
        }

        function Hb(e, t, i, n) {
            var a = e.get("renderItem"), o = e.coordinateSystem, r = {};
            o && (r = o.prepareCustoms ? o.prepareCustoms() : Wb[o.type](o));
            var s, l, d, u, c, h = T({
                getWidth: n.getWidth,
                getHeight: n.getHeight,
                getZr: n.getZr,
                getDevicePixelRatio: n.getDevicePixelRatio,
                value: function (e, i) {
                    return null == i && (i = s), t.get(t.getDimension(e || 0), i)
                },
                style: function (i, n) {
                    null == n && (n = s), p(n);
                    var a = l.getModel(Rb).getItemStyle();
                    null != c && (a.fill = c);
                    var o = t.getItemVisual(n, "opacity");
                    null != o && (a.opacity = o);
                    var r = i ? Yb(i, d) : d;
                    return Js(a, r, null, {
                        autoColor: c,
                        isRectText: !0
                    }), a.text = r.getShallow("show") ? G(e.getFormattedLabel(n, "normal"), Op(t, n)) : null, i && qb(a, i), a
                },
                styleEmphasis: function (i, n) {
                    null == n && (n = s), p(n);
                    var a = l.getModel(Bb).getItemStyle(), o = i ? Yb(i, u) : u;
                    return Js(a, o, null, {isRectText: !0}, !0), a.text = o.getShallow("show") ? H(e.getFormattedLabel(n, "emphasis"), e.getFormattedLabel(n, "normal"), Op(t, n)) : null, i && qb(a, i), a
                },
                visual: function (e, i) {
                    return null == i && (i = s), t.getItemVisual(i, e)
                },
                barLayout: function (e) {
                    if (o.getBaseAxis) return function (e) {
                        var t = [], i = e.axis;
                        if ("category" === i.type) {
                            for (var n = i.getBandWidth(), a = 0; a < e.count; a++) t.push(T({
                                bandWidth: n,
                                axisKey: "axis0",
                                stackId: Tg + a
                            }, e));
                            var o = _g(t), r = [];
                            for (a = 0; a < e.count; a++) {
                                var s = o.axis0[Tg + a];
                                s.offsetCenter = s.offset + s.width / 2, r.push(s)
                            }
                            return r
                        }
                    }(T({axis: o.getBaseAxis()}, e))
                },
                currentSeriesIndices: function () {
                    return i.getCurrentSeriesIndices()
                },
                font: function (e) {
                    return nl(e, i)
                }
            }, r.api || {}), f = {
                context: {},
                seriesId: e.id,
                seriesName: e.name,
                seriesIndex: e.seriesIndex,
                coordSys: r.coordSys,
                dataInsideLength: t.count(),
                encode: function (e) {
                    var t = {};
                    return D(e.dimensions, function (i, n) {
                        var a = e.getDimensionInfo(i);
                        if (!a.isExtraCoord) {
                            var o = a.coordDim;
                            (t[o] = t[o] || [])[a.coordDimIndex] = n
                        }
                    }), t
                }(e.getData())
            }, g = !0;
            return function (e, i) {
                return s = e, g = !0, a && a(T({
                    dataIndexInside: e,
                    dataIndex: t.getRawIndex(e),
                    actionType: i ? i.type : null
                }, f), h)
            };

            function p(e) {
                null == e && (e = s), g && (l = t.getItemModel(e), d = l.getModel(Ub), u = l.getModel(Kb), c = t.getItemVisual(e, "color"), g = !1)
            }
        }

        function zb(e, t, i, n, a, o) {
            return (e = jb(e, t, i, n, a, o, !0)) && o.setItemGraphicEl(t, e), e
        }

        function jb(e, t, i, n, a, o, r) {
            var s = !i, l = (i = i || {}).type, d = i.shape, u = i.style;
            if (e && (s || null != l && l !== e.__customGraphicType || "path" === l && function (e) {
                return e && (e.hasOwnProperty("pathData") || e.hasOwnProperty("d"))
            }(d) && Zb(d) !== e.__customPathData || "image" === l && Qb(u, "image") && u.image !== e.__customImagePath || "text" === l && Qb(d, "text") && u.text !== e.__customText) && (a.remove(e), e = null), !s) {
                var c = !e;
                return function (e, t, i, n, a, o, r) {
                    var s = {}, l = i.style || {};
                    if (i.shape && (s.shape = v(i.shape)), i.position && (s.position = i.position.slice()), i.scale && (s.scale = i.scale.slice()), i.origin && (s.origin = i.origin.slice()), i.rotation && (s.rotation = i.rotation), "image" === e.type && i.style) {
                        var d = s.style = {};
                        D(["x", "y", "width", "height"], function (t) {
                            Gb(t, d, l, e.style, o)
                        })
                    }
                    if ("text" === e.type && i.style && (d = s.style = {}, D(["x", "y"], function (t) {
                        Gb(t, d, l, e.style, o)
                    }), !l.hasOwnProperty("textFill") && l.fill && (l.textFill = l.fill), !l.hasOwnProperty("textStroke") && l.stroke && (l.textStroke = l.stroke)), "group" !== e.type && (e.useStyle(l), o)) {
                        e.style.opacity = 0;
                        var u = l.opacity;
                        null == u && (u = 1), rl(e, {style: {opacity: u}}, n, t)
                    }
                    o ? e.attr(s) : ol(e, s, n, t), i.hasOwnProperty("z2") && e.attr("z2", i.z2 || 0), i.hasOwnProperty("silent") && e.attr("silent", i.silent), i.hasOwnProperty("invisible") && e.attr("invisible", i.invisible), i.hasOwnProperty("ignore") && e.attr("ignore", i.ignore), i.hasOwnProperty("info") && e.attr("info", i.info);
                    var c = i.styleEmphasis;
                    Us(e, c), r && js(e, !1 !== c)
                }(e = e || function (e) {
                    var t, i = e.type;
                    if ("path" === i) {
                        var n = e.shape, a = null != n.width && null != n.height ? {
                            x: n.x || 0,
                            y: n.y || 0,
                            width: n.width,
                            height: n.height
                        } : null, o = Zb(n);
                        (t = _s(o, null, a, n.layout || "center")).__customPathData = o
                    } else if ("image" === i) (t = new Yn({})).__customImagePath = e.style.image; else if ("text" === i) (t = new Ur({})).__customText = e.style.text; else if ("group" === i) t = new Ai; else {
                        if ("compoundPath" === i) throw new Error('"compoundPath" is not supported yet.');
                        t = new (bs(i))
                    }
                    return t.__customGraphicType = i, t.name = e.name, t
                }(i), t, i, n, 0, c, r), "group" === l && function (e, t, i, n, a) {
                    var o = i.children, r = o ? o.length : 0, s = i.$mergeChildren,
                        l = "byName" === s || i.diffChildrenByName, d = !1 === s;
                    if (r || l || d) {
                        if (l) return function (e) {
                            new If(e.oldChildren, e.newChildren, Xb, Xb, e).add($b).update($b).remove(Jb).execute()
                        }({
                            oldChildren: e.children() || [],
                            newChildren: o || [],
                            dataIndex: t,
                            animatableModel: n,
                            group: e,
                            data: a
                        });
                        d && e.removeAll();
                        for (var u = 0; u < r; u++) o[u] && jb(e.childAt(u), t, o[u], n, e, a)
                    }
                }(e, t, i, n, o), a.add(e), e
            }
        }

        function Xb(e, t) {
            var i = e && e.name;
            return null != i ? i : Vb + t
        }

        function $b(e, t) {
            var i = this.context, n = null != e ? i.newChildren[e] : null;
            jb(null != t ? i.oldChildren[t] : null, i.dataIndex, n, i.animatableModel, i.group, i.data)
        }

        function Yb(e, t) {
            var i = new Sl({}, t);
            return D(Lb, function (t, n) {
                e.hasOwnProperty(t) && (i.option[n] = e[t])
            }), i
        }

        function qb(e, t) {
            for (var i in t) !t.hasOwnProperty(i) && Lb.hasOwnProperty(i) || (e[i] = t[i])
        }

        function Jb(e) {
            var t = this.context, i = t.oldChildren[e];
            i && t.group.remove(i)
        }

        function Zb(e) {
            return e && (e.pathData || e.d)
        }

        function Qb(e, t) {
            return e && e.hasOwnProperty(t)
        }

        function e_(e) {
            return e.get("stack") || "__ec_stack_" + e.seriesIndex
        }

        function t_(e, t) {
            return t.dim + e.model.componentIndex
        }

        function i_(e, t) {
            Ap.call(this, "radius", e, t), this.type = "category"
        }

        ec.extend({
            type: "series.custom",
            dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                useTransform: !0,
                clip: !1
            },
            getInitialData: function (e, t) {
                return rg(this.getSource(), this)
            },
            getDataParams: function (e, t, i) {
                var n = ec.prototype.getDataParams.apply(this, arguments);
                return i && (n.info = i.info), n
            }
        }), fc.extend({
            type: "custom", _data: null, render: function (e, t, i, n) {
                var a = this._data, o = e.getData(), r = this.group, s = Hb(e, o, t, i);
                o.diff(a).add(function (t) {
                    zb(null, t, s(t, n), e, r, o)
                }).update(function (t, i) {
                    zb(a.getItemGraphicEl(i), t, s(t, n), e, r, o)
                }).remove(function (e) {
                    var t = a.getItemGraphicEl(e);
                    t && r.remove(t)
                }).execute();
                var l = e.get("clip", !0) ? cv(e.coordinateSystem, !1, e) : null;
                l ? r.setClipPath(l) : r.removeClipPath(), this._data = o
            }, incrementalPrepareRender: function (e, t, i) {
                this.group.removeAll(), this._data = null
            }, incrementalRender: function (e, t, i, n, a) {
                var o = t.getData(), r = Hb(t, o, i, n);

                function s(e) {
                    e.isGroup || (e.incremental = !0, e.useHoverLayer = !0)
                }

                for (var l = e.start; l < e.end; l++) zb(null, l, r(l, a), t, this.group, o).traverse(s)
            }, dispose: te, filterForExposedEvent: function (e, t, i, n) {
                var a = t.element;
                if (null == a || i.name === a) return !0;
                for (; (i = i.parent) && i !== this.group;) if (i.name === a) return !0;
                return !1
            }
        }), i_.prototype = {
            constructor: i_, pointToData: function (e, t) {
                return this.polar.pointToData(e, t)["radius" === this.dim ? 0 : 1]
            }, dataToRadius: Ap.prototype.dataToCoord, radiusToData: Ap.prototype.coordToData
        }, I(i_, Ap);
        var n_ = Va();

        function a_(e, t) {
            t = t || [0, 360], Ap.call(this, "angle", e, t), this.type = "category"
        }

        function o_(e) {
            this.name = e || "", this.cx = 0, this.cy = 0, this._radiusAxis = new i_, this._angleAxis = new a_, this._radiusAxis.polar = this._angleAxis.polar = this
        }

        a_.prototype = {
            constructor: a_,
            pointToData: function (e, t) {
                return this.polar.pointToData(e, t)["radius" === this.dim ? 0 : 1]
            },
            dataToAngle: Ap.prototype.dataToCoord,
            angleToData: Ap.prototype.coordToData,
            calculateCategoryInterval: function () {
                var e = this.getLabelModel(), t = this.scale, i = t.getExtent(), n = t.count();
                if (i[1] - i[0] < 1) return 0;
                var a = i[0], o = this.dataToCoord(a + 1) - this.dataToCoord(a), r = Math.abs(o),
                    s = cn(a, e.getFont(), "center", "top"), l = Math.max(s.height, 7) / r;
                isNaN(l) && (l = 1 / 0);
                var d = Math.max(0, Math.floor(l)), u = n_(this.model), c = u.lastAutoInterval, h = u.lastTickCount;
                return null != c && null != h && Math.abs(c - d) <= 1 && Math.abs(h - n) <= 1 && d < c ? d = c : (u.lastTickCount = n, u.lastAutoInterval = d), d
            }
        }, I(a_, Ap), o_.prototype = {
            type: "polar",
            axisPointerEnabled: !0,
            constructor: o_,
            dimensions: ["radius", "angle"],
            model: null,
            containPoint: function (e) {
                var t = this.pointToCoord(e);
                return this._radiusAxis.contain(t[0]) && this._angleAxis.contain(t[1])
            },
            containData: function (e) {
                return this._radiusAxis.containData(e[0]) && this._angleAxis.containData(e[1])
            },
            getAxis: function (e) {
                return this["_" + e + "Axis"]
            },
            getAxes: function () {
                return [this._radiusAxis, this._angleAxis]
            },
            getAxesByScale: function (e) {
                var t = [], i = this._angleAxis, n = this._radiusAxis;
                return i.scale.type === e && t.push(i), n.scale.type === e && t.push(n), t
            },
            getAngleAxis: function () {
                return this._angleAxis
            },
            getRadiusAxis: function () {
                return this._radiusAxis
            },
            getOtherAxis: function (e) {
                var t = this._angleAxis;
                return e === t ? this._radiusAxis : t
            },
            getBaseAxis: function () {
                return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis()
            },
            getTooltipAxes: function (e) {
                var t = null != e && "auto" !== e ? this.getAxis(e) : this.getBaseAxis();
                return {baseAxes: [t], otherAxes: [this.getOtherAxis(t)]}
            },
            dataToPoint: function (e, t) {
                return this.coordToPoint([this._radiusAxis.dataToRadius(e[0], t), this._angleAxis.dataToAngle(e[1], t)])
            },
            pointToData: function (e, t) {
                var i = this.pointToCoord(e);
                return [this._radiusAxis.radiusToData(i[0], t), this._angleAxis.angleToData(i[1], t)]
            },
            pointToCoord: function (e) {
                var t = e[0] - this.cx, i = e[1] - this.cy, n = this.getAngleAxis(), a = n.getExtent(),
                    o = Math.min(a[0], a[1]), r = Math.max(a[0], a[1]);
                n.inverse ? o = r - 360 : r = o + 360;
                var s = Math.sqrt(t * t + i * i);
                t /= s, i /= s;
                for (var l = Math.atan2(-i, t) / Math.PI * 180, d = l < o ? 1 : -1; l < o || r < l;) l += 360 * d;
                return [s, l]
            },
            coordToPoint: function (e) {
                var t = e[0], i = e[1] / 180 * Math.PI;
                return [Math.cos(i) * t + this.cx, -Math.sin(i) * t + this.cy]
            },
            getArea: function () {
                var e = this.getAngleAxis(), t = this.getRadiusAxis().getExtent().slice();
                t[0] > t[1] && t.reverse();
                var i = e.getExtent(), n = Math.PI / 180;
                return {
                    cx: this.cx,
                    cy: this.cy,
                    r0: t[0],
                    r: t[1],
                    startAngle: -i[0] * n,
                    endAngle: -i[1] * n,
                    clockwise: e.inverse,
                    contain: function (e, t) {
                        var i = e - this.cx, n = t - this.cy, a = i * i + n * n, o = this.r, r = this.r0;
                        return a <= o * o && r * r <= a
                    }
                }
            }
        };
        var r_ = bd.extend({
            type: "polarAxis", axis: null, getCoordSysModel: function () {
                return this.ecModel.queryComponents({
                    mainType: "polar",
                    index: this.option.polarIndex,
                    id: this.option.polarId
                })[0]
            }
        });

        function s_(e, t) {
            return t.type || (t.data ? "category" : "value")
        }

        function l_(e, t) {
            var i = this, n = i.getAngleAxis(), a = i.getRadiusAxis();
            if (n.scale.setExtent(1 / 0, -1 / 0), a.scale.setExtent(1 / 0, -1 / 0), e.eachSeries(function (e) {
                if (e.coordinateSystem === i) {
                    var t = e.getData();
                    D(t.mapDimension("radius", !0), function (e) {
                        a.scale.unionExtentFromData(t, og(t, e))
                    }), D(t.mapDimension("angle", !0), function (e) {
                        n.scale.unionExtentFromData(t, og(t, e))
                    })
                }
            }), qg(n.scale, n.model), qg(a.scale, a.model), "category" === n.type && !n.onBand) {
                var o = n.getExtent(), r = 360 / n.scale.count();
                n.inverse ? o[1] += r : o[1] -= r, n.setExtent(o[0], o[1])
            }
        }

        function d_(e, t) {
            if (e.type = t.get("type"), e.scale = Jg(t), e.onBand = t.get("boundaryGap") && "category" === e.type, e.inverse = t.get("inverse"), "angleAxis" === t.mainType) {
                e.inverse ^= t.get("clockwise");
                var i = t.get("startAngle");
                e.setExtent(i, i + (e.inverse ? -360 : 360))
            }
            (t.axis = e).model = t
        }

        m(r_.prototype, ip), Dv("angle", r_, s_, {
            startAngle: 90,
            clockwise: !0,
            splitNumber: 12,
            axisLabel: {rotate: !1}
        }), Dv("radius", r_, s_, {splitNumber: 5}), kf({
            type: "polar",
            dependencies: ["polarAxis", "angleAxis"],
            coordinateSystem: null,
            findAxisModel: function (e) {
                var t;
                return this.ecModel.eachComponent(e, function (e) {
                    e.getCoordSysModel() === this && (t = e)
                }, this), t
            },
            defaultOption: {zlevel: 0, z: 0, center: ["50%", "50%"], radius: "80%"}
        }), iu.register("polar", {
            dimensions: o_.prototype.dimensions, create: function (e, t) {
                var i = [];
                return e.eachComponent("polar", function (e, n) {
                    var a = new o_(n);
                    a.update = l_;
                    var o = a.getRadiusAxis(), r = a.getAngleAxis(), s = e.findAxisModel("radiusAxis"),
                        l = e.findAxisModel("angleAxis");
                    d_(o, s), d_(r, l), function (e, t, i) {
                        var n = t.get("center"), a = i.getWidth(), o = i.getHeight();
                        e.cx = xl(n[0], a), e.cy = xl(n[1], o);
                        var r = e.getRadiusAxis(), s = Math.min(a, o) / 2, l = t.get("radius");
                        null == l ? l = [0, "100%"] : M(l) || (l = [0, l]), l = [xl(l[0], s), xl(l[1], s)], r.inverse ? r.setExtent(l[1], l[0]) : r.setExtent(l[0], l[1])
                    }(a, e, t), i.push(a), (e.coordinateSystem = a).model = e
                }), e.eachSeries(function (t) {
                    if ("polar" === t.get("coordinateSystem")) {
                        var i = e.queryComponents({
                            mainType: "polar",
                            index: t.get("polarIndex"),
                            id: t.get("polarId")
                        })[0];
                        t.coordinateSystem = i.coordinateSystem
                    }
                }), i
            }
        });
        var u_ = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];

        function c_(e, t, i) {
            t[1] > t[0] && (t = t.slice().reverse());
            var n = e.coordToPoint([t[0], i]), a = e.coordToPoint([t[1], i]);
            return {x1: n[0], y1: n[1], x2: a[0], y2: a[1]}
        }

        function h_(e) {
            return e.getRadiusAxis().inverse ? 0 : 1
        }

        function f_(e) {
            var t = e[0], i = e[e.length - 1];
            t && i && Math.abs(Math.abs(t.coord - i.coord) - 360) < 1e-4 && e.pop()
        }

        im.extend({
            type: "angleAxis", axisPointerClass: "PolarAxisPointer", render: function (e, t) {
                if (this.group.removeAll(), e.get("show")) {
                    var i = e.axis, n = i.polar, a = n.getRadiusAxis().getExtent(), o = i.getTicksCoords(),
                        r = i.getMinorTicksCoords(), s = A(i.getViewLabels(), function (e) {
                            return (e = v(e)).coord = i.dataToCoord(e.tickValue), e
                        });
                    f_(s), f_(o), D(u_, function (t) {
                        !e.get(t + ".show") || i.scale.isBlank() && "axisLine" !== t || this["_" + t](e, n, o, r, a, s)
                    }, this)
                }
            }, _axisLine: function (e, t, i, n, a) {
                var o, r = e.getModel("axisLine.lineStyle"), s = h_(t), l = s ? 0 : 1;
                (o = 0 === a[l] ? new Vr({
                    shape: {cx: t.cx, cy: t.cy, r: a[s]},
                    style: r.getLineStyle(),
                    z2: 1,
                    silent: !0
                }) : new Hr({
                    shape: {cx: t.cx, cy: t.cy, r: a[s], r0: a[l]},
                    style: r.getLineStyle(),
                    z2: 1,
                    silent: !0
                })).style.fill = null, this.group.add(o)
            }, _axisTick: function (e, t, i, n, a) {
                var o = e.getModel("axisTick"), r = (o.get("inside") ? -1 : 1) * o.get("length"), s = a[h_(t)],
                    l = A(i, function (e) {
                        return new is({shape: c_(t, [s, s + r], e.coord)})
                    });
                this.group.add(Ns(l, {style: T(o.getModel("lineStyle").getLineStyle(), {stroke: e.get("axisLine.lineStyle.color")})}))
            }, _minorTick: function (e, t, i, n, a) {
                if (n.length) {
                    for (var o = e.getModel("axisTick"), r = e.getModel("minorTick"), s = (o.get("inside") ? -1 : 1) * r.get("length"), l = a[h_(t)], d = [], u = 0; u < n.length; u++) for (var c = 0; c < n[u].length; c++) d.push(new is({shape: c_(t, [l, l + s], n[u][c].coord)}));
                    this.group.add(Ns(d, {style: T(r.getModel("lineStyle").getLineStyle(), T(o.getLineStyle(), {stroke: e.get("axisLine.lineStyle.color")}))}))
                }
            }, _axisLabel: function (e, t, i, n, a, o) {
                var r = e.getCategories(!0), s = e.getModel("axisLabel"), l = s.get("margin"),
                    d = e.get("triggerEvent");
                D(o, function (i, n) {
                    var o = s, u = i.tickValue, c = a[h_(t)], h = t.coordToPoint([c + l, i.coord]), f = t.cx, g = t.cy,
                        p = Math.abs(h[0] - f) / c < .3 ? "center" : h[0] > f ? "left" : "right",
                        v = Math.abs(h[1] - g) / c < .3 ? "middle" : h[1] > g ? "top" : "bottom";
                    r && r[u] && r[u].textStyle && (o = new Sl(r[u].textStyle, s, s.ecModel));
                    var m = new Ur({silent: Kv.isLabelSilent(e)});
                    this.group.add(m), Js(m.style, o, {
                        x: h[0],
                        y: h[1],
                        textFill: o.getTextColor() || e.get("axisLine.lineStyle.color"),
                        text: i.formattedLabel,
                        textAlign: p,
                        textVerticalAlign: v
                    }), d && (m.eventData = Kv.makeAxisEventDataBase(e), m.eventData.targetType = "axisLabel", m.eventData.value = i.rawLabel)
                }, this)
            }, _splitLine: function (e, t, i, n, a) {
                var o = e.getModel("splitLine").getModel("lineStyle"), r = o.get("color"), s = 0;
                r = r instanceof Array ? r : [r];
                for (var l = [], d = 0; d < i.length; d++) {
                    var u = s++ % r.length;
                    l[u] = l[u] || [], l[u].push(new is({shape: c_(t, a, i[d].coord)}))
                }
                for (d = 0; d < l.length; d++) this.group.add(Ns(l[d], {
                    style: T({stroke: r[d % r.length]}, o.getLineStyle()),
                    silent: !0,
                    z: e.get("z")
                }))
            }, _minorSplitLine: function (e, t, i, n, a) {
                if (n.length) {
                    for (var o = e.getModel("minorSplitLine").getModel("lineStyle"), r = [], s = 0; s < n.length; s++) for (var l = 0; l < n[s].length; l++) r.push(new is({shape: c_(t, a, n[s][l].coord)}));
                    this.group.add(Ns(r, {style: o.getLineStyle(), silent: !0, z: e.get("z")}))
                }
            }, _splitArea: function (e, t, i, n, a) {
                if (i.length) {
                    var o = e.getModel("splitArea").getModel("areaStyle"), r = o.get("color"), s = 0;
                    r = r instanceof Array ? r : [r];
                    for (var l = [], d = Math.PI / 180, u = -i[0].coord * d, c = Math.min(a[0], a[1]), h = Math.max(a[0], a[1]), f = e.get("clockwise"), g = 1; g < i.length; g++) {
                        var p = s++ % r.length;
                        l[p] = l[p] || [], l[p].push(new Gr({
                            shape: {
                                cx: t.cx,
                                cy: t.cy,
                                r0: c,
                                r: h,
                                startAngle: u,
                                endAngle: -i[g].coord * d,
                                clockwise: f
                            }, silent: !0
                        })), u = -i[g].coord * d
                    }
                    for (g = 0; g < l.length; g++) this.group.add(Ns(l[g], {
                        style: T({fill: r[g % r.length]}, o.getAreaStyle()),
                        silent: !0
                    }))
                }
            }
        });
        var g_ = ["axisLine", "axisTickLabel", "axisName"], p_ = ["splitLine", "splitArea", "minorSplitLine"];
        im.extend({
            type: "radiusAxis", axisPointerClass: "PolarAxisPointer", render: function (e, t) {
                if (this.group.removeAll(), e.get("show")) {
                    var i = e.axis, n = i.polar, a = n.getAngleAxis(), o = i.getTicksCoords(),
                        r = i.getMinorTicksCoords(), s = a.getExtent()[0], l = i.getExtent(), d = function (e, t, i) {
                            return {
                                position: [e.cx, e.cy],
                                rotation: i / 180 * Math.PI,
                                labelDirection: -1,
                                tickDirection: -1,
                                nameDirection: 1,
                                labelRotate: t.getModel("axisLabel").get("rotate"),
                                z2: 1
                            }
                        }(n, e, s), u = new Kv(e, d);
                    D(g_, u.add, u), this.group.add(u.getGroup()), D(p_, function (t) {
                        e.get(t + ".show") && !i.scale.isBlank() && this["_" + t](e, n, s, l, o, r)
                    }, this)
                }
            }, _splitLine: function (e, t, i, n, a) {
                var o = e.getModel("splitLine").getModel("lineStyle"), r = o.get("color"), s = 0;
                r = r instanceof Array ? r : [r];
                for (var l = [], d = 0; d < a.length; d++) {
                    var u = s++ % r.length;
                    l[u] = l[u] || [], l[u].push(new Vr({shape: {cx: t.cx, cy: t.cy, r: a[d].coord}}))
                }
                for (d = 0; d < l.length; d++) this.group.add(Ns(l[d], {
                    style: T({
                        stroke: r[d % r.length],
                        fill: null
                    }, o.getLineStyle()), silent: !0
                }))
            }, _minorSplitLine: function (e, t, i, n, a, o) {
                if (o.length) {
                    for (var r = e.getModel("minorSplitLine").getModel("lineStyle"), s = [], l = 0; l < o.length; l++) for (var d = 0; d < o[l].length; d++) s.push(new Vr({
                        shape: {
                            cx: t.cx,
                            cy: t.cy,
                            r: o[l][d].coord
                        }
                    }));
                    this.group.add(Ns(s, {style: T({fill: null}, r.getLineStyle()), silent: !0}))
                }
            }, _splitArea: function (e, t, i, n, a) {
                if (a.length) {
                    var o = e.getModel("splitArea").getModel("areaStyle"), r = o.get("color"), s = 0;
                    r = r instanceof Array ? r : [r];
                    for (var l = [], d = a[0].coord, u = 1; u < a.length; u++) {
                        var c = s++ % r.length;
                        l[c] = l[c] || [], l[c].push(new Gr({
                            shape: {
                                cx: t.cx,
                                cy: t.cy,
                                r0: d,
                                r: a[u].coord,
                                startAngle: 0,
                                endAngle: 2 * Math.PI
                            }, silent: !0
                        })), d = a[u].coord
                    }
                    for (u = 0; u < l.length; u++) this.group.add(Ns(l[u], {
                        style: T({fill: r[u % r.length]}, o.getAreaStyle()),
                        silent: !0
                    }))
                }
            }
        });
        var v_ = eb.extend({
            makeElOption: function (e, t, i, n, a) {
                var o = i.axis;
                "angle" === o.dim && (this.animationThreshold = Math.PI / 18);
                var r, s = o.polar, l = s.getOtherAxis(o).getExtent();
                r = o["dataTo" + sd(o.dim)](t);
                var d = n.get("type");
                if (d && "none" !== d) {
                    var u = ob(n), c = m_[d](o, s, r, l, u);
                    c.style = u, e.graphicKey = c.type, e.pointer = c
                }
                var h = n.get("label.margin");
                rb(e, i, n, a, function (e, t, i, n, a) {
                    var o = t.axis, r = o.dataToCoord(e), s = n.getAngleAxis().getExtent()[0];
                    s = s / 180 * Math.PI;
                    var l, d, u, c = n.getRadiusAxis().getExtent();
                    if ("radius" === o.dim) {
                        var h = ot();
                        ut(h, h, s), dt(h, h, [n.cx, n.cy]), l = ll([r, -a], h);
                        var f = t.getModel("axisLabel").get("rotate") || 0,
                            g = Kv.innerTextLayout(s, f * Math.PI / 180, -1);
                        d = g.textAlign, u = g.textVerticalAlign
                    } else {
                        var p = c[1];
                        l = n.coordToPoint([p + a, r]);
                        var v = n.cx, m = n.cy;
                        d = Math.abs(l[0] - v) / p < .3 ? "center" : l[0] > v ? "left" : "right", u = Math.abs(l[1] - m) / p < .3 ? "middle" : l[1] > m ? "top" : "bottom"
                    }
                    return {position: l, align: d, verticalAlign: u}
                }(t, i, 0, s, h))
            }
        }), m_ = {
            line: function (e, t, i, n, a) {
                return "angle" === e.dim ? {
                    type: "Line",
                    shape: ub(t.coordToPoint([n[0], i]), t.coordToPoint([n[1], i]))
                } : {type: "Circle", shape: {cx: t.cx, cy: t.cy, r: i}}
            }, shadow: function (e, t, i, n, a) {
                var o = Math.max(1, e.getBandWidth()), r = Math.PI / 180;
                return "angle" === e.dim ? {
                    type: "Sector",
                    shape: hb(t.cx, t.cy, n[0], n[1], (-i - o / 2) * r, (o / 2 - i) * r)
                } : {type: "Sector", shape: hb(t.cx, t.cy, i - o / 2, i + o / 2, 0, 2 * Math.PI)}
            }
        };

        function y_(e, t) {
            t.update = "updateView", ff(t, function (t, i) {
                var n = {};
                return i.eachComponent({mainType: "geo", query: t}, function (i) {
                    i[e](t.name), D(i.coordinateSystem.regions, function (e) {
                        n[e.name] = i.isSelected(e.name) || !1
                    })
                }), {selected: n, name: t.name}
            })
        }

        function k_(e, t, i) {
            this._model = e
        }

        function T_(e, t, i, n) {
            var a = i.calendarModel, o = i.seriesModel, r = a ? a.coordinateSystem : o ? o.coordinateSystem : null;
            return r === this ? r[e](n) : null
        }

        im.registerAxisPointerClass("PolarAxisPointer", v_), pf(O(function (e, t, i) {
            var n = {}, a = function (e) {
                var t = {};
                D(e, function (e, i) {
                    var n = e.getData(), a = e.coordinateSystem, o = a.getBaseAxis(), r = t_(a, o), s = o.getExtent(),
                        l = "category" === o.type ? o.getBandWidth() : Math.abs(s[1] - s[0]) / n.count(), d = t[r] || {
                            bandWidth: l,
                            remainedWidth: l,
                            autoWidthCount: 0,
                            categoryGap: "20%",
                            gap: "30%",
                            stacks: {}
                        }, u = d.stacks;
                    t[r] = d;
                    var c = e_(e);
                    u[c] || d.autoWidthCount++, u[c] = u[c] || {width: 0, maxWidth: 0};
                    var h = xl(e.get("barWidth"), l), f = xl(e.get("barMaxWidth"), l), g = e.get("barGap"),
                        p = e.get("barCategoryGap");
                    h && !u[c].width && (h = Math.min(d.remainedWidth, h), u[c].width = h, d.remainedWidth -= h), f && (u[c].maxWidth = f), null != g && (d.gap = g), null != p && (d.categoryGap = p)
                });
                var i = {};
                return D(t, function (e, t) {
                    i[t] = {};
                    var n = e.stacks, a = e.bandWidth, o = xl(e.categoryGap, a), r = xl(e.gap, 1), s = e.remainedWidth,
                        l = e.autoWidthCount, d = (s - o) / (l + (l - 1) * r);
                    d = Math.max(d, 0), D(n, function (e, t) {
                        var i = e.maxWidth;
                        i && i < d && (i = Math.min(i, s), e.width && (i = Math.min(i, e.width)), s -= i, e.width = i, l--)
                    }), d = (s - o) / (l + (l - 1) * r), d = Math.max(d, 0);
                    var u, c = 0;
                    D(n, function (e, t) {
                        e.width || (e.width = d), c += (u = e).width * (1 + r)
                    }), u && (c -= u.width * r);
                    var h = -c / 2;
                    D(n, function (e, n) {
                        i[t][n] = i[t][n] || {offset: h, width: e.width}, h += e.width * (1 + r)
                    })
                }), i
            }(x(t.getSeriesByType(e), function (e) {
                return !t.isSeriesFiltered(e) && e.coordinateSystem && "polar" === e.coordinateSystem.type
            }));
            t.eachSeriesByType(e, function (e) {
                if ("polar" === e.coordinateSystem.type) {
                    var t = e.getData(), i = e.coordinateSystem, o = i.getBaseAxis(), r = t_(i, o), s = e_(e),
                        l = a[r][s], d = l.offset, u = l.width, c = i.getOtherAxis(o), h = e.coordinateSystem.cx,
                        f = e.coordinateSystem.cy, g = e.get("barMinHeight") || 0, p = e.get("barMinAngle") || 0;
                    n[s] = n[s] || [];
                    for (var v = t.mapDimension(c.dim), m = t.mapDimension(o.dim), y = ag(t, v), k = "radius" !== o.dim || !e.get("roundCap", !0), T = c.getExtent()[0], w = 0, C = t.count(); w < C; w++) {
                        var S, I, b, _, D = t.get(v, w), A = t.get(m, w), N = 0 <= D ? "p" : "n", x = T;
                        if (y && (n[s][A] || (n[s][A] = {p: T, n: T}), x = n[s][A][N]), "radius" === c.dim) {
                            var E = c.dataToRadius(D) - T, P = o.dataToAngle(A);
                            Math.abs(E) < g && (E = (E < 0 ? -1 : 1) * g), I = (S = x) + E, _ = (b = P - d) - u, y && (n[s][A][N] = I)
                        } else {
                            var O = c.dataToAngle(D, k) - T, M = o.dataToRadius(A);
                            Math.abs(O) < p && (O = (O < 0 ? -1 : 1) * p), I = (S = M + d) + u, _ = (b = x) + O, y && (n[s][A][N] = _)
                        }
                        t.setItemLayout(w, {
                            cx: h,
                            cy: f,
                            r0: S,
                            r: I,
                            startAngle: -b * Math.PI / 180,
                            endAngle: -_ * Math.PI / 180
                        })
                    }
                }
            }, this)
        }, "bar")), Tf({type: "polar"}), b(bd.extend({
            type: "geo",
            coordinateSystem: null,
            layoutMode: "box",
            init: function (e) {
                bd.prototype.init.apply(this, arguments), Oa(e, "label", ["show"])
            },
            optionUpdated: function () {
                var e = this.option, t = this;
                e.regions = Zy.getFilledRegions(e.regions, e.map, e.nameMap), this._optionModelMap = N(e.regions || [], function (e, i) {
                    return i.name && e.set(i.name, new Sl(i, t)), e
                }, Q()), this.updateSelectedMap(e.regions)
            },
            defaultOption: {
                zlevel: 0,
                z: 0,
                show: !0,
                left: "center",
                top: "center",
                aspectScale: null,
                silent: !1,
                map: "",
                boundingCoords: null,
                center: null,
                zoom: 1,
                scaleLimit: null,
                label: {show: !1, color: "#000"},
                itemStyle: {borderWidth: .5, borderColor: "#444", color: "#eee"},
                emphasis: {label: {show: !0, color: "rgb(100,0,0)"}, itemStyle: {color: "rgba(255,215,0,0.8)"}},
                regions: []
            },
            getRegionModel: function (e) {
                return this._optionModelMap.get(e) || new Sl(null, this, this.ecModel)
            },
            getFormattedLabel: function (e, t) {
                var i = this.getRegionModel(e).get("label" + ("normal" === t ? "." : t + ".") + "formatter"),
                    n = {name: e};
                return "function" == typeof i ? (n.status = t, i(n)) : "string" == typeof i ? i.replace("{a}", null != e ? e : "") : void 0
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            }
        }), Mm), Tf({
            type: "geo", init: function (e, t) {
                var i = new By(t, !0);
                this._mapDraw = i, this.group.add(i.group)
            }, render: function (e, t, i, n) {
                if (!n || "geoToggleSelect" !== n.type || n.from !== this.uid) {
                    var a = this._mapDraw;
                    e.get("show") ? a.draw(e, t, i, this, n) : this._mapDraw.group.removeAll(), this.group.silent = e.get("silent")
                }
            }, dispose: function () {
                this._mapDraw && this._mapDraw.remove()
            }
        }), y_("toggleSelected", {type: "geoToggleSelect", event: "geoselectchanged"}), y_("select", {
            type: "geoSelect",
            event: "geoselected"
        }), y_("unSelect", {type: "geoUnSelect", event: "geounselected"}), k_.prototype = {
            constructor: k_,
            type: "calendar",
            dimensions: ["time", "value"],
            getDimensionsInfo: function () {
                return [{name: "time", type: "time"}, "value"]
            },
            getRangeInfo: function () {
                return this._rangeInfo
            },
            getModel: function () {
                return this._model
            },
            getRect: function () {
                return this._rect
            },
            getCellWidth: function () {
                return this._sw
            },
            getCellHeight: function () {
                return this._sh
            },
            getOrient: function () {
                return this._orient
            },
            getFirstDayOfWeek: function () {
                return this._firstDayOfWeek
            },
            getDateInfo: function (e) {
                var t = (e = Vl(e)).getFullYear(), i = e.getMonth() + 1;
                i = i < 10 ? "0" + i : i;
                var n = e.getDate();
                n = n < 10 ? "0" + n : n;
                var a = e.getDay();
                return {
                    y: t,
                    m: i,
                    d: n,
                    day: a = Math.abs((a + 7 - this.getFirstDayOfWeek()) % 7),
                    time: e.getTime(),
                    formatedDate: t + "-" + i + "-" + n,
                    date: e
                }
            },
            getNextNDay: function (e, t) {
                return 0 === (t = t || 0) || (e = new Date(this.getDateInfo(e).time)).setDate(e.getDate() + t), this.getDateInfo(e)
            },
            update: function (e, t) {
                this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay"), this._orient = this._model.get("orient"), this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0, this._rangeInfo = this._getRangeInfo(this._initRangeOption());
                var i = this._rangeInfo.weeks || 1, n = ["width", "height"], a = this._model.get("cellSize").slice(),
                    o = this._model.getBoxLayoutParams(), r = "horizontal" === this._orient ? [i, 7] : [7, i];
                D([0, 1], function (e) {
                    d(a, e) && (o[n[e]] = a[e] * r[e])
                });
                var s = {width: t.getWidth(), height: t.getHeight()}, l = this._rect = vd(o, s);

                function d(e, t) {
                    return null != e[t] && "auto" !== e[t]
                }

                D([0, 1], function (e) {
                    d(a, e) || (a[e] = l[n[e]] / r[e])
                }), this._sw = a[0], this._sh = a[1]
            },
            dataToPoint: function (e, t) {
                M(e) && (e = e[0]), null == t && (t = !0);
                var i = this.getDateInfo(e), n = this._rangeInfo, a = i.formatedDate;
                if (t && !(i.time >= n.start.time && i.time < n.end.time + 864e5)) return [NaN, NaN];
                var o = i.day, r = this._getRangeInfo([n.start.time, a]).nthWeek;
                return "vertical" === this._orient ? [this._rect.x + o * this._sw + this._sw / 2, this._rect.y + r * this._sh + this._sh / 2] : [this._rect.x + r * this._sw + this._sw / 2, this._rect.y + o * this._sh + this._sh / 2]
            },
            pointToData: function (e) {
                var t = this.pointToDate(e);
                return t && t.time
            },
            dataToRect: function (e, t) {
                var i = this.dataToPoint(e, t);
                return {
                    contentShape: {
                        x: i[0] - (this._sw - this._lineWidth) / 2,
                        y: i[1] - (this._sh - this._lineWidth) / 2,
                        width: this._sw - this._lineWidth,
                        height: this._sh - this._lineWidth
                    },
                    center: i,
                    tl: [i[0] - this._sw / 2, i[1] - this._sh / 2],
                    tr: [i[0] + this._sw / 2, i[1] - this._sh / 2],
                    br: [i[0] + this._sw / 2, i[1] + this._sh / 2],
                    bl: [i[0] - this._sw / 2, i[1] + this._sh / 2]
                }
            },
            pointToDate: function (e) {
                var t = Math.floor((e[0] - this._rect.x) / this._sw) + 1,
                    i = Math.floor((e[1] - this._rect.y) / this._sh) + 1, n = this._rangeInfo.range;
                return "vertical" === this._orient ? this._getDateByWeeksAndDay(i, t - 1, n) : this._getDateByWeeksAndDay(t, i - 1, n)
            },
            convertToPixel: O(T_, "dataToPoint"),
            convertFromPixel: O(T_, "pointToData"),
            _initRangeOption: function () {
                var e = this._model.get("range"), t = e;
                if (M(t) && 1 === t.length && (t = t[0]), /^\d{4}$/.test(t) && (e = [t + "-01-01", t + "-12-31"]), /^\d{4}[\/|-]\d{1,2}$/.test(t)) {
                    var i = this.getDateInfo(t), n = i.date;
                    n.setMonth(n.getMonth() + 1);
                    var a = this.getNextNDay(n, -1);
                    e = [i.formatedDate, a.formatedDate]
                }
                /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(t) && (e = [t, t]);
                var o = this._getRangeInfo(e);
                return o.start.time > o.end.time && e.reverse(), e
            },
            _getRangeInfo: function (e) {
                var t;
                (e = [this.getDateInfo(e[0]), this.getDateInfo(e[1])])[0].time > e[1].time && (t = !0, e.reverse());
                var i = Math.floor(e[1].time / 864e5) - Math.floor(e[0].time / 864e5) + 1, n = new Date(e[0].time),
                    a = n.getDate(), o = e[1].date.getDate();
                n.setDate(a + i - 1);
                var r = n.getDate();
                if (r !== o) for (var s = 0 < n.getTime() - e[1].time ? 1 : -1; (r = n.getDate()) !== o && 0 < (n.getTime() - e[1].time) * s;) i -= s, n.setDate(r - s);
                var l = Math.floor((i + e[0].day + 6) / 7), d = t ? 1 - l : l - 1;
                return t && e.reverse(), {
                    range: [e[0].formatedDate, e[1].formatedDate],
                    start: e[0],
                    end: e[1],
                    allDay: i,
                    weeks: l,
                    nthWeek: d,
                    fweek: e[0].day,
                    lweek: e[1].day
                }
            },
            _getDateByWeeksAndDay: function (e, t, i) {
                var n = this._getRangeInfo(i);
                if (e > n.weeks || 0 === e && t < n.fweek || e === n.weeks && t > n.lweek) return !1;
                var a = 7 * (e - 1) - n.fweek + t, o = new Date(n.start.time);
                return o.setDate(n.start.d + a), this.getDateInfo(o)
            }
        }, k_.dimensions = k_.prototype.dimensions, k_.getDimensionsInfo = k_.prototype.getDimensionsInfo, k_.create = function (e, t) {
            var i = [];
            return e.eachComponent("calendar", function (n) {
                var a = new k_(n, e, t);
                i.push(a), n.coordinateSystem = a
            }), e.eachSeries(function (e) {
                "calendar" === e.get("coordinateSystem") && (e.coordinateSystem = i[e.get("calendarIndex") || 0])
            }), i
        }, iu.register("calendar", k_);
        var w_ = bd.extend({
            type: "calendar",
            coordinateSystem: null,
            defaultOption: {
                zlevel: 0,
                z: 2,
                left: 80,
                top: 60,
                cellSize: 20,
                orient: "horizontal",
                splitLine: {show: !0, lineStyle: {color: "#000", width: 1, type: "solid"}},
                itemStyle: {color: "#fff", borderWidth: 1, borderColor: "#ccc"},
                dayLabel: {show: !0, firstDay: 0, position: "start", margin: "50%", nameMap: "en", color: "#000"},
                monthLabel: {
                    show: !0,
                    position: "start",
                    margin: 5,
                    align: "center",
                    nameMap: "en",
                    formatter: null,
                    color: "#000"
                },
                yearLabel: {
                    show: !0,
                    position: null,
                    margin: 30,
                    formatter: null,
                    color: "#ccc",
                    fontFamily: "sans-serif",
                    fontWeight: "bolder",
                    fontSize: 20
                }
            },
            init: function (e, t, i, n) {
                var a = kd(e);
                w_.superApply(this, "init", arguments), C_(e, a)
            },
            mergeOption: function (e, t) {
                w_.superApply(this, "mergeOption", arguments), C_(this.option, e)
            }
        });

        function C_(e, t) {
            var i = e.cellSize;
            M(i) ? 1 === i.length && (i[1] = i[0]) : i = e.cellSize = [i, i];
            var n = A([0, 1], function (e) {
                return function (e, t) {
                    return null != e[fd[t][0]] || null != e[fd[t][1]] && null != e[fd[t][2]]
                }(t, e) && (i[e] = "auto"), null != i[e] && "auto" !== i[e]
            });
            yd(e, t, {type: "box", ignoreSize: n})
        }

        var S_ = {
            EN: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            CN: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
        }, I_ = {EN: ["S", "M", "T", "W", "T", "F", "S"], CN: ["日", "一", "二", "三", "四", "五", "六"]};
        Tf({
            type: "calendar",
            _tlpoints: null,
            _blpoints: null,
            _firstDayOfMonth: null,
            _firstDayPoints: null,
            render: function (e, t, i) {
                var n = this.group;
                n.removeAll();
                var a = e.coordinateSystem, o = a.getRangeInfo(), r = a.getOrient();
                this._renderDayRect(e, o, n), this._renderLines(e, o, r, n), this._renderYearText(e, o, r, n), this._renderMonthText(e, r, n), this._renderWeekText(e, o, r, n)
            },
            _renderDayRect: function (e, t, i) {
                for (var n = e.coordinateSystem, a = e.getModel("itemStyle").getItemStyle(), o = n.getCellWidth(), r = n.getCellHeight(), s = t.start.time; s <= t.end.time; s = n.getNextNDay(s, 1).time) {
                    var l = n.dataToRect([s], !1).tl,
                        d = new es({shape: {x: l[0], y: l[1], width: o, height: r}, cursor: "default", style: a});
                    i.add(d)
                }
            },
            _renderLines: function (e, t, i, n) {
                var a = this, o = e.coordinateSystem, r = e.getModel("splitLine.lineStyle").getLineStyle(),
                    s = e.get("splitLine.show"), l = r.lineWidth;
                this._tlpoints = [], this._blpoints = [], this._firstDayOfMonth = [], this._firstDayPoints = [];
                for (var d = t.start, u = 0; d.time <= t.end.time; u++) {
                    h(d.formatedDate), 0 === u && (d = o.getDateInfo(t.start.y + "-" + t.start.m));
                    var c = d.date;
                    c.setMonth(c.getMonth() + 1), d = o.getDateInfo(c)
                }

                function h(t) {
                    a._firstDayOfMonth.push(o.getDateInfo(t)), a._firstDayPoints.push(o.dataToRect([t], !1).tl);
                    var l = a._getLinePointsOfOneWeek(e, t, i);
                    a._tlpoints.push(l[0]), a._blpoints.push(l[l.length - 1]), s && a._drawSplitline(l, r, n)
                }

                h(o.getNextNDay(t.end.time, 1).formatedDate), s && this._drawSplitline(a._getEdgesPoints(a._tlpoints, l, i), r, n), s && this._drawSplitline(a._getEdgesPoints(a._blpoints, l, i), r, n)
            },
            _getEdgesPoints: function (e, t, i) {
                var n = [e[0].slice(), e[e.length - 1].slice()], a = "horizontal" === i ? 0 : 1;
                return n[0][a] = n[0][a] - t / 2, n[1][a] = n[1][a] + t / 2, n
            },
            _drawSplitline: function (e, t, i) {
                var n = new $r({z2: 20, shape: {points: e}, style: t});
                i.add(n)
            },
            _getLinePointsOfOneWeek: function (e, t, i) {
                var n = e.coordinateSystem;
                t = n.getDateInfo(t);
                for (var a = [], o = 0; o < 7; o++) {
                    var r = n.getNextNDay(t.time, o), s = n.dataToRect([r.time], !1);
                    a[2 * r.day] = s.tl, a[2 * r.day + 1] = s["horizontal" === i ? "bl" : "tr"]
                }
                return a
            },
            _formatterLabel: function (e, t) {
                return "string" == typeof e && e ? nd(e, t) : "function" == typeof e ? e(t) : t.nameMap
            },
            _yearTextPositionControl: function (e, t, i, n, a) {
                t = t.slice();
                var o = ["center", "bottom"];
                "bottom" === n ? (t[1] += a, o = ["center", "top"]) : "left" === n ? t[0] -= a : "right" === n ? (t[0] += a, o = ["center", "top"]) : t[1] -= a;
                var r = 0;
                return "left" !== n && "right" !== n || (r = Math.PI / 2), {
                    rotation: r,
                    position: t,
                    style: {textAlign: o[0], textVerticalAlign: o[1]}
                }
            },
            _renderYearText: function (e, t, i, n) {
                var a = e.getModel("yearLabel");
                if (a.get("show")) {
                    var o = a.get("margin"), r = a.get("position");
                    r = r || ("horizontal" !== i ? "top" : "left");
                    var s = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]], l = (s[0][0] + s[1][0]) / 2,
                        d = (s[0][1] + s[1][1]) / 2, u = "horizontal" === i ? 0 : 1,
                        c = {top: [l, s[u][1]], bottom: [l, s[1 - u][1]], left: [s[1 - u][0], d], right: [s[u][0], d]},
                        h = t.start.y;
                    +t.end.y > +t.start.y && (h = h + "-" + t.end.y);
                    var f = a.get("formatter"), g = {start: t.start.y, end: t.end.y, nameMap: h},
                        p = this._formatterLabel(f, g), v = new Ur({z2: 30});
                    Js(v.style, a, {text: p}), v.attr(this._yearTextPositionControl(v, c[r], i, r, o)), n.add(v)
                }
            },
            _monthTextPositionControl: function (e, t, i, n, a) {
                var o = "left", r = "top", s = e[0], l = e[1];
                return "horizontal" === i ? (l += a, t && (o = "center"), "start" === n && (r = "bottom")) : (s += a, t && (r = "middle"), "start" === n && (o = "right")), {
                    x: s,
                    y: l,
                    textAlign: o,
                    textVerticalAlign: r
                }
            },
            _renderMonthText: function (e, t, i) {
                var n = e.getModel("monthLabel");
                if (n.get("show")) {
                    var a = n.get("nameMap"), o = n.get("margin"), r = n.get("position"), s = n.get("align"),
                        l = [this._tlpoints, this._blpoints];
                    L(a) && (a = S_[a.toUpperCase()] || []);
                    var d = "start" === r ? 0 : 1, u = "horizontal" === t ? 0 : 1;
                    o = "start" === r ? -o : o;
                    for (var c = "center" === s, h = 0; h < l[d].length - 1; h++) {
                        var f = l[d][h].slice(), g = this._firstDayOfMonth[h];
                        if (c) {
                            var p = this._firstDayPoints[h];
                            f[u] = (p[u] + l[0][h + 1][u]) / 2
                        }
                        var v = n.get("formatter"), m = a[+g.m - 1],
                            y = {yyyy: g.y, yy: (g.y + "").slice(2), MM: g.m, M: +g.m, nameMap: m},
                            T = this._formatterLabel(v, y), w = new Ur({z2: 30});
                        k(Js(w.style, n, {text: T}), this._monthTextPositionControl(f, c, t, r, o)), i.add(w)
                    }
                }
            },
            _weekTextPositionControl: function (e, t, i, n, a) {
                var o = "center", r = "middle", s = e[0], l = e[1], d = "start" === i;
                return "horizontal" === t ? (s = s + n + (d ? 1 : -1) * a[0] / 2, o = d ? "right" : "left") : (l = l + n + (d ? 1 : -1) * a[1] / 2, r = d ? "bottom" : "top"), {
                    x: s,
                    y: l,
                    textAlign: o,
                    textVerticalAlign: r
                }
            },
            _renderWeekText: function (e, t, i, n) {
                var a = e.getModel("dayLabel");
                if (a.get("show")) {
                    var o = e.coordinateSystem, r = a.get("position"), s = a.get("nameMap"), l = a.get("margin"),
                        d = o.getFirstDayOfWeek();
                    L(s) && (s = I_[s.toUpperCase()] || []);
                    var u = o.getNextNDay(t.end.time, 7 - t.lweek).time, c = [o.getCellWidth(), o.getCellHeight()];
                    l = xl(l, c["horizontal" === i ? 0 : 1]), "start" === r && (u = o.getNextNDay(t.start.time, -(7 + t.fweek)).time, l = -l);
                    for (var h = 0; h < 7; h++) {
                        var f, g = o.getNextNDay(u, h), p = o.dataToRect([g.time], !1).center;
                        f = Math.abs((h + d) % 7);
                        var v = new Ur({z2: 30});
                        k(Js(v.style, a, {text: s[f]}), this._weekTextPositionControl(p, i, r, l, c)), n.add(v)
                    }
                }
            }
        });
        var b_ = {path: null, compoundPath: null, group: Ai, image: Yn, text: Ur};
        cf(function (e) {
            var t = e.graphic;
            M(t) ? t[0] && t[0].elements ? e.graphic = [e.graphic[0]] : e.graphic = [{elements: t}] : t && !t.elements && (e.graphic = [{elements: [t]}])
        });
        var __ = kf({
            type: "graphic",
            defaultOption: {elements: [], parentId: null},
            _elOptionsToUpdate: null,
            mergeOption: function (e) {
                var t = this.option.elements;
                this.option.elements = null, __.superApply(this, "mergeOption", arguments), this.option.elements = t
            },
            optionUpdated: function (e, t) {
                var i = this.option, n = (t ? i : e).elements, a = i.elements = t ? [] : i.elements, o = [];
                this._flatten(n, o);
                var r = La(a, o);
                Ra(r);
                var s = this._elOptionsToUpdate = [];
                D(r, function (e, t) {
                    var i = e.option;
                    i && (s.push(i), function (e, t) {
                        var i = e.exist;
                        if (t.id = e.keyInfo.id, !t.type && i && (t.type = i.type), null == t.parentId) {
                            var n = t.parentOption;
                            n ? t.parentId = n.id : i && (t.parentId = i.parentId)
                        }
                        t.parentOption = null
                    }(e, i), function (e, t, i) {
                        var n = k({}, i), a = e[t], o = i.$action || "merge";
                        "merge" === o ? a ? (m(a, n, !0), yd(a, n, {ignoreSize: !0}), Td(i, a)) : e[t] = n : "replace" === o ? e[t] = n : "remove" === o && a && (e[t] = null)
                    }(a, t, i), function (e, t) {
                        e && (e.hv = t.hv = [N_(t, ["left", "right"]), N_(t, ["top", "bottom"])], "group" === e.type && (null == e.width && (e.width = t.width = 0), null == e.height && (e.height = t.height = 0)))
                    }(a[t], i))
                }, this);
                for (var l = a.length - 1; 0 <= l; l--) null == a[l] ? a.splice(l, 1) : delete a[l].$action
            },
            _flatten: function (e, t, i) {
                D(e, function (e) {
                    if (e) {
                        i && (e.parentOption = i), t.push(e);
                        var n = e.children;
                        "group" === e.type && n && this._flatten(n, t, e), delete e.children
                    }
                }, this)
            },
            useElOptionsToUpdate: function () {
                var e = this._elOptionsToUpdate;
                return this._elOptionsToUpdate = null, e
            }
        });

        function D_(e, t, i, n) {
            var a = i.type, o = new (b_.hasOwnProperty(a) ? b_[a] : bs(a))(i);
            t.add(o), n.set(e, o), o.__ecGraphicId = e
        }

        function A_(e, t) {
            var i = e && e.parent;
            i && ("group" === e.type && e.traverse(function (e) {
                A_(e, t)
            }), t.removeKey(e.__ecGraphicId), i.remove(e))
        }

        function N_(e, t) {
            var i;
            return D(t, function (t) {
                null != e[t] && "auto" !== e[t] && (i = !0)
            }), i
        }

        Tf({
            type: "graphic", init: function (e, t) {
                this._elMap = Q(), this._lastGraphicModel
            }, render: function (e, t, i) {
                e !== this._lastGraphicModel && this._clear(), this._lastGraphicModel = e, this._updateElements(e), this._relocate(e, i)
            }, _updateElements: function (e) {
                var t = e.useElOptionsToUpdate();
                if (t) {
                    var i = this._elMap, n = this.group;
                    D(t, function (t) {
                        var a = t.$action, o = t.id, r = i.get(o), s = t.parentId, l = null != s ? i.get(s) : n,
                            d = t.style;
                        "text" === t.type && d && (t.hv && t.hv[1] && (d.textVerticalAlign = d.textBaseline = null), !d.hasOwnProperty("textFill") && d.fill && (d.textFill = d.fill), !d.hasOwnProperty("textStroke") && d.stroke && (d.textStroke = d.stroke));
                        var u = function (e) {
                            return e = k({}, e), D(["id", "parentId", "$action", "hv", "bounding"].concat(hd), function (t) {
                                delete e[t]
                            }), e
                        }(t);
                        a && "merge" !== a ? "replace" === a ? (A_(r, i), D_(o, l, u, i)) : "remove" === a && A_(r, i) : r ? r.attr(u) : D_(o, l, u, i);
                        var c = i.get(o);
                        c && (c.__ecGraphicWidthOption = t.width, c.__ecGraphicHeightOption = t.height, function (e, t) {
                            var i = e.eventData;
                            e.silent || e.ignore || i || (i = e.eventData = {
                                componentType: "graphic",
                                componentIndex: t.componentIndex,
                                name: e.name
                            }), i && (i.info = e.info)
                        }(c, e))
                    })
                }
            }, _relocate: function (e, t) {
                for (var i = e.option.elements, n = this.group, a = this._elMap, o = t.getWidth(), r = t.getHeight(), s = 0; s < i.length; s++) {
                    var l = i[s];
                    if ((u = a.get(l.id)) && u.isGroup) {
                        var d = (c = u.parent) === n;
                        u.__ecGraphicWidth = xl(u.__ecGraphicWidthOption, d ? o : c.__ecGraphicWidth) || 0, u.__ecGraphicHeight = xl(u.__ecGraphicHeightOption, d ? r : c.__ecGraphicHeight) || 0
                    }
                }
                for (s = i.length - 1; 0 <= s; s--) {
                    var u, c;
                    l = i[s], (u = a.get(l.id)) && md(u, l, (c = u.parent) === n ? {
                        width: o,
                        height: r
                    } : {width: c.__ecGraphicWidth, height: c.__ecGraphicHeight}, null, {
                        hv: l.hv,
                        boundingMode: l.bounding
                    })
                }
            }, _clear: function () {
                var e = this._elMap;
                e.each(function (t) {
                    A_(t, e)
                }), this._elMap = Q()
            }, dispose: function () {
                this._clear()
            }
        });
        var x_ = {};

        function E_(e, t) {
            x_[e] = t
        }

        function P_(e) {
            return x_[e]
        }

        var O_ = kf({
            type: "toolbox",
            layoutMode: {type: "box", ignoreSize: !0},
            optionUpdated: function () {
                O_.superApply(this, "optionUpdated", arguments), D(this.option.feature, function (e, t) {
                    var i = P_(t);
                    i && m(e, i.defaultOption)
                })
            },
            defaultOption: {
                show: !0,
                z: 6,
                zlevel: 0,
                orient: "horizontal",
                left: "right",
                top: "top",
                backgroundColor: "transparent",
                borderColor: "#ccc",
                borderRadius: 0,
                borderWidth: 0,
                padding: 5,
                itemSize: 15,
                itemGap: 8,
                showTitle: !0,
                iconStyle: {borderColor: "#666", color: "none"},
                emphasis: {iconStyle: {borderColor: "#3E98C5"}},
                tooltip: {show: !1}
            }
        });

        function M_(e, t) {
            var i = ql(t.get("padding")), n = t.getItemStyle(["color", "opacity"]);
            return n.fill = t.get("backgroundColor"), e = new es({
                shape: {
                    x: e.x - i[3],
                    y: e.y - i[0],
                    width: e.width + i[1] + i[3],
                    height: e.height + i[0] + i[2],
                    r: t.get("borderRadius")
                }, style: n, silent: !0, z2: -1
            })
        }

        Tf({
            type: "toolbox", render: function (e, t, i, n) {
                var a = this.group;
                if (a.removeAll(), e.get("show")) {
                    var o = +e.get("itemSize"), r = e.get("feature") || {}, s = this._features || (this._features = {}),
                        l = [];
                    D(r, function (e, t) {
                        l.push(t)
                    }), new If(this._featureNames || [], l).add(d).update(d).remove(O(d, null)).execute(), this._featureNames = l, function (e, t, i) {
                        var n = t.getBoxLayoutParams(), a = t.get("padding"),
                            o = {width: i.getWidth(), height: i.getHeight()}, r = vd(n, o, a);
                        pd(t.get("orient"), e, t.get("itemGap"), r.width, r.height), md(e, n, o, a)
                    }(a, e, i), a.add(M_(a.getBoundingRect(), e)), a.eachChild(function (e) {
                        var t = e.__title, n = e.hoverStyle;
                        if (n && t) {
                            var r = cn(t, Sn(n)), s = e.position[0] + a.position[0], l = !1;
                            e.position[1] + a.position[1] + o + r.height > i.getHeight() && (n.textPosition = "top", l = !0);
                            var d = l ? -5 - r.height : o + 8;
                            s + r.width / 2 > i.getWidth() ? (n.textPosition = ["100%", d], n.textAlign = "right") : s - r.width / 2 < 0 && (n.textPosition = [0, d], n.textAlign = "left")
                        }
                    })
                }

                function d(d, u) {
                    var c, h = l[d], f = l[u], g = r[h], p = new Sl(g, e, e.ecModel);
                    if (n && null != n.newTitle && n.featureName === h && (g.title = n.newTitle), h && !f) {
                        if (function (e) {
                            return 0 === e.indexOf("my")
                        }(h)) c = {model: p, onclick: p.option.onclick, featureName: h}; else {
                            var v = P_(h);
                            if (!v) return;
                            c = new v(p, t, i)
                        }
                        s[h] = c
                    } else {
                        if (!(c = s[f])) return;
                        c.model = p, c.ecModel = t, c.api = i
                    }
                    h || !f ? p.get("show") && !c.unusable ? (function (n, r, s) {
                        var l = n.getModel("iconStyle"), d = n.getModel("emphasis.iconStyle"),
                            u = r.getIcons ? r.getIcons() : n.get("icon"), c = n.get("title") || {};
                        if ("string" == typeof u) {
                            var h = u, f = c;
                            c = {}, (u = {})[s] = h, c[s] = f
                        }
                        var g = n.iconPaths = {};
                        D(u, function (s, u) {
                            var h = hl(s, {}, {x: -o / 2, y: -o / 2, width: o, height: o});
                            h.setStyle(l.getItemStyle()), h.hoverStyle = d.getItemStyle(), h.setStyle({
                                text: c[u],
                                textAlign: d.get("textAlign"),
                                textBorderRadius: d.get("textBorderRadius"),
                                textPadding: d.get("textPadding"),
                                textFill: null
                            });
                            var f = e.getModel("tooltip");
                            f && f.get("show") && h.attr("tooltip", k({
                                content: c[u],
                                formatter: f.get("formatter", !0) || function () {
                                    return c[u]
                                },
                                formatterParams: {
                                    componentType: "toolbox",
                                    name: u,
                                    title: c[u],
                                    $vars: ["name", "title"]
                                },
                                position: f.get("position", !0) || "bottom"
                            }, f.option)), zs(h), e.get("showTitle") && (h.__title = c[u], h.on("mouseover", function () {
                                var t = d.getItemStyle(),
                                    i = "vertical" === e.get("orient") ? null == e.get("right") ? "right" : "left" : null == e.get("bottom") ? "bottom" : "top";
                                h.setStyle({
                                    textFill: d.get("textFill") || t.fill || t.stroke || "#000",
                                    textBackgroundColor: d.get("textBackgroundColor"),
                                    textPosition: d.get("textPosition") || i
                                })
                            }).on("mouseout", function () {
                                h.setStyle({textFill: null, textBackgroundColor: null})
                            })), h.trigger(n.get("iconStatus." + u) || "normal"), a.add(h), h.on("click", P(r.onclick, r, t, i, u)), g[u] = h
                        })
                    }(p, c, h), p.setIconStatus = function (e, t) {
                        var i = this.option, n = this.iconPaths;
                        i.iconStatus = i.iconStatus || {}, i.iconStatus[e] = t, n[e] && n[e].trigger(t)
                    }, c.render && c.render(p, t, i, n)) : c.remove && c.remove(t, i) : c.dispose && c.dispose(t, i)
                }
            }, updateView: function (e, t, i, n) {
                D(this._features, function (e) {
                    e.updateView && e.updateView(e.model, t, i, n)
                })
            }, remove: function (e, t) {
                D(this._features, function (i) {
                    i.remove && i.remove(e, t)
                }), this.group.removeAll()
            }, dispose: function (e, t) {
                D(this._features, function (i) {
                    i.dispose && i.dispose(e, t)
                })
            }
        });
        var F_ = Dc.toolbox.saveAsImage;

        function L_(e) {
            this.model = e
        }

        L_.defaultOption = {
            show: !0,
            icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
            title: F_.title,
            type: "png",
            connectedBackgroundColor: "#fff",
            name: "",
            excludeComponents: ["toolbox"],
            pixelRatio: 1,
            lang: F_.lang.slice()
        }, L_.prototype.unusable = !a.canvasSupported, L_.prototype.onclick = function (e, t) {
            var i = this.model, n = i.get("name") || e.get("title.0.text") || "echarts",
                o = "svg" === t.getZr().painter.getType() ? "svg" : i.get("type", !0) || "png",
                r = t.getConnectedDataURL({
                    type: o,
                    backgroundColor: i.get("backgroundColor", !0) || e.get("backgroundColor") || "#fff",
                    connectedBackgroundColor: i.get("connectedBackgroundColor"),
                    excludeComponents: i.get("excludeComponents"),
                    pixelRatio: i.get("pixelRatio")
                });
            if ("function" != typeof MouseEvent || a.browser.ie || a.browser.edge) if (window.navigator.msSaveOrOpenBlob) {
                for (var s = atob(r.split(",")[1]), l = s.length, d = new Uint8Array(l); l--;) d[l] = s.charCodeAt(l);
                var u = new Blob([d]);
                window.navigator.msSaveOrOpenBlob(u, n + "." + o)
            } else {
                var c = i.get("lang"),
                    h = '<body style="margin:0;"><img src="' + r + '" style="max-width:100%;" title="' + (c && c[0] || "") + '" /></body>';
                window.open().document.write(h)
            } else {
                var f = document.createElement("a");
                f.download = n + "." + o, f.target = "_blank", f.href = r;
                var g = new MouseEvent("click", {view: window, bubbles: !0, cancelable: !1});
                f.dispatchEvent(g)
            }
        }, E_("saveAsImage", L_);
        var R_ = Dc.toolbox.magicType, B_ = "__ec_magicType_stack__";

        function U_(e) {
            this.model = e
        }

        U_.defaultOption = {
            show: !0,
            type: [],
            icon: {
                line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
                bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
                stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"
            },
            title: v(R_.title),
            option: {},
            seriesIndex: {}
        };
        var K_ = U_.prototype;
        K_.getIcons = function () {
            var e = this.model, t = e.get("icon"), i = {};
            return D(e.get("type"), function (e) {
                t[e] && (i[e] = t[e])
            }), i
        };
        var V_ = {
            line: function (e, t, i, n) {
                if ("bar" === e) return m({
                    id: t,
                    type: "line",
                    data: i.get("data"),
                    stack: i.get("stack"),
                    markPoint: i.get("markPoint"),
                    markLine: i.get("markLine")
                }, n.get("option.line") || {}, !0)
            }, bar: function (e, t, i, n) {
                if ("line" === e) return m({
                    id: t,
                    type: "bar",
                    data: i.get("data"),
                    stack: i.get("stack"),
                    markPoint: i.get("markPoint"),
                    markLine: i.get("markLine")
                }, n.get("option.bar") || {}, !0)
            }, stack: function (e, t, i, n) {
                var a = i.get("stack") === B_;
                if ("line" === e || "bar" === e) return n.setIconStatus("stack", a ? "normal" : "emphasis"), m({
                    id: t,
                    stack: a ? "" : B_
                }, n.get("option.stack") || {}, !0)
            }
        }, W_ = [["line", "bar"], ["stack"]];
        K_.onclick = function (e, t, i) {
            var n = this.model, a = n.get("seriesIndex." + i);
            if (V_[i]) {
                var o, r = {series: []};
                D(W_, function (e) {
                    0 <= S(e, i) && D(e, function (e) {
                        n.setIconStatus(e, "normal")
                    })
                }), n.setIconStatus(i, "emphasis"), e.eachComponent({
                    mainType: "series",
                    query: null == a ? null : {seriesIndex: a}
                }, function (t) {
                    var a = t.subType, o = t.id, s = V_[i](a, o, t, n);
                    s && (T(s, t.option), r.series.push(s));
                    var l = t.coordinateSystem;
                    if (l && "cartesian2d" === l.type && ("line" === i || "bar" === i)) {
                        var d = l.getAxesByScale("ordinal")[0];
                        if (d) {
                            var u = d.dim + "Axis", c = e.queryComponents({
                                mainType: u,
                                index: t.get(name + "Index"),
                                id: t.get(name + "Id")
                            })[0].componentIndex;
                            r[u] = r[u] || [];
                            for (var h = 0; h <= c; h++) r[u][c] = r[u][c] || {};
                            r[u][c].boundaryGap = "bar" === i
                        }
                    }
                }), "stack" === i && (o = r.series && r.series[0] && r.series[0].stack === B_ ? m({stack: R_.title.tiled}, R_.title) : v(R_.title)), t.dispatchAction({
                    type: "changeMagicType",
                    currentType: i,
                    newOption: r,
                    newTitle: o,
                    featureName: "magicType"
                })
            }
        }, ff({type: "changeMagicType", event: "magicTypeChanged", update: "prepareAndUpdate"}, function (e, t) {
            t.mergeOption(e.newOption)
        }), E_("magicType", U_);
        var G_ = Dc.toolbox.dataView, H_ = new Array(60).join("-"), z_ = "\t";

        function j_(e) {
            return e.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
        }

        var X_ = new RegExp("[" + z_ + "]+", "g");

        function $_(e) {
            this._dom = null, this.model = e
        }

        $_.defaultOption = {
            show: !0,
            readOnly: !1,
            optionToContent: null,
            contentToOption: null,
            icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
            title: v(G_.title),
            lang: v(G_.lang),
            backgroundColor: "#fff",
            textColor: "#000",
            textareaColor: "#fff",
            textareaBorderColor: "#333",
            buttonColor: "#c23531",
            buttonTextColor: "#fff"
        }, $_.prototype.onclick = function (e, t) {
            var i = t.getDom(), n = this.model;
            this._dom && i.removeChild(this._dom);
            var a = document.createElement("div");
            a.style.cssText = "position:absolute;left:5px;top:5px;bottom:5px;right:5px;", a.style.backgroundColor = n.get("backgroundColor") || "#fff";
            var o = document.createElement("h4"), r = n.get("lang") || [];
            o.innerHTML = r[0] || n.get("title"), o.style.cssText = "margin: 10px 20px;", o.style.color = n.get("textColor");
            var s = document.createElement("div"), l = document.createElement("textarea");
            s.style.cssText = "display:block;width:100%;overflow:auto;";
            var d = n.get("optionToContent"), u = n.get("contentToOption"), c = function (e) {
                var t = function (e) {
                    var t = {}, i = [], n = [];
                    return e.eachRawSeries(function (e) {
                        var a = e.coordinateSystem;
                        if (!a || "cartesian2d" !== a.type && "polar" !== a.type) i.push(e); else {
                            var o = a.getBaseAxis();
                            if ("category" === o.type) {
                                var r = o.dim + "_" + o.index;
                                t[r] || (t[r] = {
                                    categoryAxis: o,
                                    valueAxis: a.getOtherAxis(o),
                                    series: []
                                }, n.push({axisDim: o.dim, axisIndex: o.index})), t[r].series.push(e)
                            } else i.push(e)
                        }
                    }), {seriesGroupByCategoryAxis: t, other: i, meta: n}
                }(e);
                return {
                    value: x([function (e) {
                        var t = [];
                        return D(e, function (e, i) {
                            var n = e.categoryAxis, a = e.valueAxis.dim, o = [" "].concat(A(e.series, function (e) {
                                return e.name
                            })), r = [n.model.getCategories()];
                            D(e.series, function (e) {
                                r.push(e.getRawData().mapArray(a, function (e) {
                                    return e
                                }))
                            });
                            for (var s = [o.join(z_)], l = 0; l < r[0].length; l++) {
                                for (var d = [], u = 0; u < r.length; u++) d.push(r[u][l]);
                                s.push(d.join(z_))
                            }
                            t.push(s.join("\n"))
                        }), t.join("\n\n" + H_ + "\n\n")
                    }(t.seriesGroupByCategoryAxis), function (e) {
                        return A(e, function (e) {
                            var t = e.getRawData(), i = [e.name], n = [];
                            return t.each(t.dimensions, function () {
                                for (var e = arguments.length, a = arguments[e - 1], o = t.getName(a), r = 0; r < e - 1; r++) n[r] = arguments[r];
                                i.push((o ? o + z_ : "") + n.join(z_))
                            }), i.join("\n")
                        }).join("\n\n" + H_ + "\n\n")
                    }(t.other)], function (e) {
                        return e.replace(/[\n\t\s]/g, "")
                    }).join("\n\n" + H_ + "\n\n"), meta: t.meta
                }
            }(e);
            if ("function" == typeof d) {
                var h = d(t.getOption());
                "string" == typeof h ? s.innerHTML = h : K(h) && s.appendChild(h)
            } else s.appendChild(l), l.readOnly = n.get("readOnly"), l.style.cssText = "width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;", l.style.color = n.get("textColor"), l.style.borderColor = n.get("textareaBorderColor"), l.style.backgroundColor = n.get("textareaColor"), l.value = c.value;
            var f = c.meta, g = document.createElement("div");
            g.style.cssText = "position:absolute;bottom:0;left:0;right:0;";
            var p = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",
                v = document.createElement("div"), m = document.createElement("div");
            p += ";background-color:" + n.get("buttonColor"), p += ";color:" + n.get("buttonTextColor");
            var y = this;

            function k() {
                i.removeChild(a), y._dom = null
            }

            ze(v, "click", k), ze(m, "click", function () {
                var e;
                try {
                    e = "function" == typeof u ? u(s, t.getOption()) : function (e, t) {
                        var i = {series: []};
                        return D(e.split(new RegExp("\n*" + H_ + "\n*", "g")), function (e, n) {
                            if (function (e) {
                                if (0 <= e.slice(0, e.indexOf("\n")).indexOf(z_)) return !0
                            }(e)) {
                                var a = function (e) {
                                    for (var t = e.split(/\n+/g), i = [], n = A(j_(t.shift()).split(X_), function (e) {
                                        return {name: e, data: []}
                                    }), a = 0; a < t.length; a++) {
                                        var o = j_(t[a]).split(X_);
                                        i.push(o.shift());
                                        for (var r = 0; r < o.length; r++) n[r] && (n[r].data[a] = o[r])
                                    }
                                    return {series: n, categories: i}
                                }(e), o = t[n], r = o.axisDim + "Axis";
                                o && (i[r] = i[r] || [], i[r][o.axisIndex] = {data: a.categories}, i.series = i.series.concat(a.series))
                            } else a = function (e) {
                                for (var t = e.split(/\n+/g), i = j_(t.shift()), n = [], a = 0; a < t.length; a++) {
                                    var o, r = j_(t[a]).split(X_), s = "", l = !1;
                                    o = isNaN(r[0]) ? (l = !0, s = r[0], r = r.slice(1), n[a] = {
                                        name: s,
                                        value: []
                                    }, n[a].value) : n[a] = [];
                                    for (var d = 0; d < r.length; d++) o.push(+r[d]);
                                    1 === o.length && (l ? n[a].value = o[0] : n[a] = o[0])
                                }
                                return {name: i, data: n}
                            }(e), i.series.push(a)
                        }), i
                    }(l.value, f)
                } catch (e) {
                    throw k(), new Error("Data view format error " + e)
                }
                e && t.dispatchAction({type: "changeDataView", newOption: e}), k()
            }), v.innerHTML = r[1], m.innerHTML = r[2], m.style.cssText = p, v.style.cssText = p, n.get("readOnly") || g.appendChild(m), g.appendChild(v), a.appendChild(o), a.appendChild(s), a.appendChild(g), s.style.height = i.clientHeight - 80 + "px", i.appendChild(a), this._dom = a
        }, $_.prototype.remove = function (e, t) {
            this._dom && t.getDom().removeChild(this._dom)
        }, $_.prototype.dispose = function (e, t) {
            this.remove(e, t)
        }, E_("dataView", $_), ff({
            type: "changeDataView",
            event: "dataViewChanged",
            update: "prepareAndUpdate"
        }, function (e, t) {
            var i = [];
            D(e.newOption.series, function (e) {
                var n = t.getSeriesByName(e.name)[0];
                if (n) {
                    var a = n.get("data");
                    i.push({
                        name: e.name, data: function (e, t) {
                            return A(e, function (e, i) {
                                var n = t && t[i];
                                return R(n) && !M(n) ? (R(e) && !M(e) && (e = e.value), T({value: e}, n)) : e
                            })
                        }(e.data, a)
                    })
                } else i.push(k({type: "scatter"}, e))
            }), t.mergeOption(T({series: i}, e.newOption))
        });
        var Y_ = D, q_ = S, J_ = O, Z_ = ["dataToPoint", "pointToData"],
            Q_ = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"];

        function eD(e, t, i) {
            var n = this._targetInfoList = [], a = {}, o = nD(t, e);
            Y_(aD, function (e, t) {
                i && i.include && !(0 <= q_(i.include, t)) || e(o, n, a)
            })
        }

        var tD = eD.prototype;

        function iD(e) {
            return e[0] > e[1] && e.reverse(), e
        }

        function nD(e, t) {
            return Ga(e, t, {includeMainTypes: Q_})
        }

        tD.setOutputRanges = function (e, t) {
            this.matchOutputRanges(e, t, function (e, t, i) {
                if ((e.coordRanges || (e.coordRanges = [])).push(t), !e.coordRange) {
                    e.coordRange = t;
                    var n = sD[e.brushType](0, i, t);
                    e.__rangeOffset = {offset: dD[e.brushType](n.values, e.range, [1, 1]), xyMinMax: n.xyMinMax}
                }
            })
        }, tD.matchOutputRanges = function (e, t, i) {
            Y_(e, function (e) {
                var n = this.findTargetInfo(e, t);
                n && !0 !== n && D(n.coordSyses, function (n) {
                    var a = sD[e.brushType](1, n, e.range);
                    i(e, a.values, n, t)
                })
            }, this)
        }, tD.setInputRanges = function (e, t) {
            Y_(e, function (e) {
                var i = this.findTargetInfo(e, t);
                if (e.range = e.range || [], i && !0 !== i) {
                    e.panelId = i.panelId;
                    var n = sD[e.brushType](0, i.coordSys, e.coordRange), a = e.__rangeOffset;
                    e.range = a ? dD[e.brushType](n.values, a.offset, function (e, t) {
                        var i = cD(e), n = cD(t), a = [i[0] / n[0], i[1] / n[1]];
                        return isNaN(a[0]) && (a[0] = 1), isNaN(a[1]) && (a[1] = 1), a
                    }(n.xyMinMax, a.xyMinMax)) : n.values
                }
            }, this)
        }, tD.makePanelOpts = function (e, t) {
            return A(this._targetInfoList, function (i) {
                var n = i.getPanelRect();
                return {
                    panelId: i.panelId,
                    defaultBrushType: t && t(i),
                    clipPath: MC(n),
                    isTargetByCursor: LC(n, e, i.coordSysModel),
                    getLinearBrushOtherExtent: FC(n)
                }
            })
        }, tD.controlSeries = function (e, t, i) {
            var n = this.findTargetInfo(e, i);
            return !0 === n || n && 0 <= q_(n.coordSyses, t.coordinateSystem)
        }, tD.findTargetInfo = function (e, t) {
            for (var i = this._targetInfoList, n = nD(t, e), a = 0; a < i.length; a++) {
                var o = i[a], r = e.panelId;
                if (r) {
                    if (o.panelId === r) return o
                } else for (a = 0; a < oD.length; a++) if (oD[a](n, o)) return o
            }
            return !0
        };
        var aD = {
            grid: function (e, t) {
                var i = e.xAxisModels, n = e.yAxisModels, a = e.gridModels, o = Q(), r = {}, s = {};
                (i || n || a) && (Y_(i, function (e) {
                    var t = e.axis.grid.model;
                    o.set(t.id, t), r[t.id] = !0
                }), Y_(n, function (e) {
                    var t = e.axis.grid.model;
                    o.set(t.id, t), s[t.id] = !0
                }), Y_(a, function (e) {
                    o.set(e.id, e), r[e.id] = !0, s[e.id] = !0
                }), o.each(function (e) {
                    var a = e.coordinateSystem, o = [];
                    Y_(a.getCartesians(), function (e, t) {
                        (0 <= q_(i, e.getAxis("x").model) || 0 <= q_(n, e.getAxis("y").model)) && o.push(e)
                    }), t.push({
                        panelId: "grid--" + e.id,
                        gridModel: e,
                        coordSysModel: e,
                        coordSys: o[0],
                        coordSyses: o,
                        getPanelRect: rD.grid,
                        xAxisDeclared: r[e.id],
                        yAxisDeclared: s[e.id]
                    })
                }))
            }, geo: function (e, t) {
                Y_(e.geoModels, function (e) {
                    var i = e.coordinateSystem;
                    t.push({
                        panelId: "geo--" + e.id,
                        geoModel: e,
                        coordSysModel: e,
                        coordSys: i,
                        coordSyses: [i],
                        getPanelRect: rD.geo
                    })
                })
            }
        }, oD = [function (e, t) {
            var i = e.xAxisModel, n = e.yAxisModel, a = e.gridModel;
            return !a && i && (a = i.axis.grid.model), !a && n && (a = n.axis.grid.model), a && a === t.gridModel
        }, function (e, t) {
            var i = e.geoModel;
            return i && i === t.geoModel
        }], rD = {
            grid: function () {
                return this.coordSys.grid.getRect().clone()
            }, geo: function () {
                var e = this.coordSys, t = e.getBoundingRect().clone();
                return t.applyTransform(sl(e)), t
            }
        }, sD = {
            lineX: J_(lD, 0), lineY: J_(lD, 1), rect: function (e, t, i) {
                var n = t[Z_[e]]([i[0][0], i[1][0]]), a = t[Z_[e]]([i[0][1], i[1][1]]),
                    o = [iD([n[0], a[0]]), iD([n[1], a[1]])];
                return {values: o, xyMinMax: o}
            }, polygon: function (e, t, i) {
                var n = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
                return {
                    values: A(i, function (i) {
                        var a = t[Z_[e]](i);
                        return n[0][0] = Math.min(n[0][0], a[0]), n[1][0] = Math.min(n[1][0], a[1]), n[0][1] = Math.max(n[0][1], a[0]), n[1][1] = Math.max(n[1][1], a[1]), a
                    }), xyMinMax: n
                }
            }
        };

        function lD(e, t, i, n) {
            var a = i.getAxis(["x", "y"][e]), o = iD(A([0, 1], function (e) {
                return t ? a.coordToData(a.toLocalCoord(n[e])) : a.toGlobalCoord(a.dataToCoord(n[e]))
            })), r = [];
            return r[e] = o, r[1 - e] = [NaN, NaN], {values: o, xyMinMax: r}
        }

        var dD = {
            lineX: J_(uD, 0), lineY: J_(uD, 1), rect: function (e, t, i) {
                return [[e[0][0] - i[0] * t[0][0], e[0][1] - i[0] * t[0][1]], [e[1][0] - i[1] * t[1][0], e[1][1] - i[1] * t[1][1]]]
            }, polygon: function (e, t, i) {
                return A(e, function (e, n) {
                    return [e[0] - i[0] * t[n][0], e[1] - i[1] * t[n][1]]
                })
            }
        };

        function uD(e, t, i, n) {
            return [t[0] - n[e] * i[0], t[1] - n[e] * i[1]]
        }

        function cD(e) {
            return e ? [e[0][1] - e[0][0], e[1][1] - e[1][0]] : [NaN, NaN]
        }

        var hD = D, fD = "\0_ec_hist_store";

        function gD(e) {
            var t = e[fD];
            return t = t || (e[fD] = [{}])
        }

        bd.registerSubTypeDefaulter("dataZoom", function () {
            return "slider"
        });
        var pD, vD, mD, yD, kD = ["cartesian2d", "polar", "singleAxis"],
            TD = (vD = ["axisIndex", "axis", "index", "id"], mD = A(pD = (pD = ["x", "y", "z", "radius", "angle", "single"]).slice(), sd), yD = A(vD = (vD || []).slice(), sd), function (e, t) {
                D(pD, function (i, n) {
                    for (var a = {name: i, capital: mD[n]}, o = 0; o < vD.length; o++) a[vD[o]] = i + yD[o];
                    e.call(t, a)
                })
            });

        function wD(e, t, i, n) {
            this._dimName = e, this._axisIndex = t, this._valueWindow, this._percentWindow, this._dataExtent, this._minMaxSpan, this.ecModel = n, this._dataZoomModel = i
        }

        var CD = D, SD = Pl;

        function ID(e, t) {
            var i = e.getAxisModel(), n = e._percentWindow, a = e._valueWindow;
            if (n) {
                var o = Fl(a, [0, 500]);
                o = Math.min(o, 20);
                var r = t || 0 === n[0] && 100 === n[1];
                i.setRange(r ? null : +a[0].toFixed(o), r ? null : +a[1].toFixed(o))
            }
        }

        wD.prototype = {
            constructor: wD, hostedBy: function (e) {
                return this._dataZoomModel === e
            }, getDataValueWindow: function () {
                return this._valueWindow.slice()
            }, getDataPercentWindow: function () {
                return this._percentWindow.slice()
            }, getTargetSeriesModels: function () {
                var e = [], t = this.ecModel;
                return t.eachSeries(function (i) {
                    if (function (e) {
                        return 0 <= S(kD, e)
                    }(i.get("coordinateSystem"))) {
                        var n = this._dimName, a = t.queryComponents({
                            mainType: n + "Axis",
                            index: i.get(n + "AxisIndex"),
                            id: i.get(n + "AxisId")
                        })[0];
                        this._axisIndex === (a && a.componentIndex) && e.push(i)
                    }
                }, this), e
            }, getAxisModel: function () {
                return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex)
            }, getOtherAxisModel: function () {
                var e, t, i, n = this._dimName, a = this.ecModel, o = this.getAxisModel();
                return e = "x" === n || "y" === n ? (t = "gridIndex", "x" === n ? "y" : "x") : (t = "polarIndex", "angle" === n ? "radius" : "angle"), a.eachComponent(e + "Axis", function (e) {
                    (e.get(t) || 0) === (o.get(t) || 0) && (i = e)
                }), i
            }, getMinMaxSpan: function () {
                return v(this._minMaxSpan)
            }, calculateDataWindow: function (e) {
                var t, i = this._dataExtent, n = this.getAxisModel().axis.scale,
                    a = this._dataZoomModel.getRangePropMode(), o = [0, 100], r = [], s = [];
                CD(["start", "end"], function (l, d) {
                    var u = e[l], c = e[l + "Value"];
                    "percent" === a[d] ? (null == u && (u = o[d]), c = n.parse(Nl(u, o, i))) : (t = !0, u = Nl(c = null == c ? i[d] : n.parse(c), i, o)), s[d] = c, r[d] = u
                }), SD(s), SD(r);
                var l = this._minMaxSpan;

                function d(e, t, i, a, o) {
                    var r = o ? "Span" : "ValueSpan";
                    Ew(0, e, i, "all", l["min" + r], l["max" + r]);
                    for (var s = 0; s < 2; s++) t[s] = Nl(e[s], i, a, !0), o && (t[s] = n.parse(t[s]))
                }

                return t ? d(s, r, i, o, !1) : d(r, s, o, i, !0), {valueWindow: s, percentWindow: r}
            }, reset: function (e) {
                if (e === this._dataZoomModel) {
                    var t = this.getTargetSeriesModels();
                    this._dataExtent = function (e, t, i) {
                        var n = [1 / 0, -1 / 0];
                        return CD(i, function (e) {
                            var i = e.getData();
                            i && CD(i.mapDimension(t, !0), function (e) {
                                var t = i.getApproximateExtent(e);
                                t[0] < n[0] && (n[0] = t[0]), t[1] > n[1] && (n[1] = t[1])
                            })
                        }), n[1] < n[0] && (n = [NaN, NaN]), function (e, t) {
                            var i = e.getAxisModel(), n = i.getMin(!0), a = "category" === i.get("type"),
                                o = a && i.getCategories().length;
                            null != n && "dataMin" !== n && "function" != typeof n ? t[0] = n : a && (t[0] = 0 < o ? 0 : NaN);
                            var r = i.getMax(!0);
                            null != r && "dataMax" !== r && "function" != typeof r ? t[1] = r : a && (t[1] = 0 < o ? o - 1 : NaN), i.get("scale", !0) || (0 < t[0] && (t[0] = 0), t[1] < 0 && (t[1] = 0))
                        }(e, n), n
                    }(this, this._dimName, t), a = (n = this)._minMaxSpan = {}, o = n._dataZoomModel, r = n._dataExtent, CD(["min", "max"], function (e) {
                        var t = o.get(e + "Span"), i = o.get(e + "ValueSpan");
                        null != i && (i = n.getAxisModel().axis.scale.parse(i)), null != i ? t = Nl(r[0] + i, r, [0, 100], !0) : null != t && (i = Nl(t, [0, 100], r, !0) - r[0]), a[e + "Span"] = t, a[e + "ValueSpan"] = i
                    });
                    var i = this.calculateDataWindow(e.settledOption);
                    this._valueWindow = i.valueWindow, this._percentWindow = i.percentWindow, ID(this)
                }
                var n, a, o, r
            }, restore: function (e) {
                e === this._dataZoomModel && (this._valueWindow = this._percentWindow = null, ID(this, !0))
            }, filterData: function (e, t) {
                if (e === this._dataZoomModel) {
                    var i = this._dimName, n = this.getTargetSeriesModels(), a = e.get("filterMode"),
                        o = this._valueWindow;
                    "none" !== a && CD(n, function (e) {
                        var t = e.getData(), n = t.mapDimension(i, !0);
                        n.length && ("weakFilter" === a ? t.filterSelf(function (e) {
                            for (var i, a, r, s = 0; s < n.length; s++) {
                                var l = t.get(n[s], e), d = !isNaN(l), u = l < o[0], c = l > o[1];
                                if (d && !u && !c) return !0;
                                d && (r = !0), u && (i = !0), c && (a = !0)
                            }
                            return r && i && a
                        }) : CD(n, function (i) {
                            if ("empty" === a) e.setData(t = t.map(i, function (e) {
                                return function (e) {
                                    return e >= o[0] && e <= o[1]
                                }(e) ? e : NaN
                            })); else {
                                var n = {};
                                n[i] = o, t.selectRange(n)
                            }
                        }), CD(n, function (e) {
                            t.setApproximateExtent(o, e)
                        }))
                    })
                }
            }
        };
        var bD = D, _D = TD, DD = kf({
            type: "dataZoom",
            dependencies: ["xAxis", "yAxis", "zAxis", "radiusAxis", "angleAxis", "singleAxis", "series"],
            defaultOption: {
                zlevel: 0,
                z: 4,
                orient: null,
                xAxisIndex: null,
                yAxisIndex: null,
                filterMode: "filter",
                throttle: null,
                start: 0,
                end: 100,
                startValue: null,
                endValue: null,
                minSpan: null,
                maxSpan: null,
                minValueSpan: null,
                maxValueSpan: null,
                rangeMode: null
            },
            init: function (e, t, i) {
                this._dataIntervalByAxis = {}, this._dataInfo = {}, this._axisProxies = {}, this.textStyleModel, this._autoThrottle = !0, this._rangePropMode = ["percent", "percent"];
                var n = AD(e);
                this.settledOption = n, this.mergeDefaultAndTheme(e, i), this.doInit(n)
            },
            mergeOption: function (e) {
                var t = AD(e);
                m(this.option, e, !0), m(this.settledOption, t, !0), this.doInit(t)
            },
            doInit: function (e) {
                var t = this.option;
                a.canvasSupported || (t.realtime = !1), this._setDefaultThrottle(e), ND(this, e);
                var i = this.settledOption;
                bD([["start", "startValue"], ["end", "endValue"]], function (e, n) {
                    "value" === this._rangePropMode[n] && (t[e[0]] = i[e[0]] = null)
                }, this), this.textStyleModel = this.getModel("textStyle"), this._resetTarget(), this._giveAxisProxies()
            },
            _giveAxisProxies: function () {
                var e = this._axisProxies;
                this.eachTargetAxis(function (t, i, n, a) {
                    var o = this.dependentModels[t.axis][i],
                        r = o.__dzAxisProxy || (o.__dzAxisProxy = new wD(t.name, i, this, a));
                    e[t.name + "_" + i] = r
                }, this)
            },
            _resetTarget: function () {
                var e = this.option, t = this._judgeAutoMode();
                _D(function (t) {
                    var i = t.axisIndex;
                    e[i] = Pa(e[i])
                }, this), "axisIndex" === t ? this._autoSetAxisIndex() : "orient" === t && this._autoSetOrient()
            },
            _judgeAutoMode: function () {
                var e = this.option, t = !1;
                _D(function (i) {
                    null != e[i.axisIndex] && (t = !0)
                }, this);
                var i = e.orient;
                return null == i && t ? "orient" : t ? void 0 : (null == i && (e.orient = "horizontal"), "axisIndex")
            },
            _autoSetAxisIndex: function () {
                var e = !0, t = this.get("orient", !0), i = this.option, n = this.dependentModels;
                if (e) {
                    var a = "vertical" === t ? "y" : "x";
                    n[a + "Axis"].length ? (i[a + "AxisIndex"] = [0], e = !1) : bD(n.singleAxis, function (n) {
                        e && n.get("orient", !0) === t && (i.singleAxisIndex = [n.componentIndex], e = !1)
                    })
                }
                e && _D(function (t) {
                    if (e) {
                        var n = [], a = this.dependentModels[t.axis];
                        if (a.length && !n.length) for (var o = 0, r = a.length; o < r; o++) "category" === a[o].get("type") && n.push(o);
                        (i[t.axisIndex] = n).length && (e = !1)
                    }
                }, this), e && this.ecModel.eachSeries(function (e) {
                    this._isSeriesHasAllAxesTypeOf(e, "value") && _D(function (t) {
                        var n = i[t.axisIndex], a = e.get(t.axisIndex), o = e.get(t.axisId);
                        S(n, a = e.ecModel.queryComponents({
                            mainType: t.axis,
                            index: a,
                            id: o
                        })[0].componentIndex) < 0 && n.push(a)
                    })
                }, this)
            },
            _autoSetOrient: function () {
                var e;
                this.eachTargetAxis(function (t) {
                    e = e || t.name
                }, this), this.option.orient = "y" === e ? "vertical" : "horizontal"
            },
            _isSeriesHasAllAxesTypeOf: function (e, t) {
                var i = !0;
                return _D(function (n) {
                    var a = e.get(n.axisIndex), o = this.dependentModels[n.axis][a];
                    o && o.get("type") === t || (i = !1)
                }, this), i
            },
            _setDefaultThrottle: function (e) {
                if (e.hasOwnProperty("throttle") && (this._autoThrottle = !1), this._autoThrottle) {
                    var t = this.ecModel.option;
                    this.option.throttle = t.animation && 0 < t.animationDurationUpdate ? 100 : 20
                }
            },
            getFirstTargetAxisModel: function () {
                var e;
                return _D(function (t) {
                    if (null == e) {
                        var i = this.get(t.axisIndex);
                        i.length && (e = this.dependentModels[t.axis][i[0]])
                    }
                }, this), e
            },
            eachTargetAxis: function (e, t) {
                var i = this.ecModel;
                _D(function (n) {
                    bD(this.get(n.axisIndex), function (a) {
                        e.call(t, n, a, this, i)
                    }, this)
                }, this)
            },
            getAxisProxy: function (e, t) {
                return this._axisProxies[e + "_" + t]
            },
            getAxisModel: function (e, t) {
                var i = this.getAxisProxy(e, t);
                return i && i.getAxisModel()
            },
            setRawRange: function (e) {
                var t = this.option, i = this.settledOption;
                bD([["start", "startValue"], ["end", "endValue"]], function (n) {
                    null == e[n[0]] && null == e[n[1]] || (t[n[0]] = i[n[0]] = e[n[0]], t[n[1]] = i[n[1]] = e[n[1]])
                }, this), ND(this, e)
            },
            setCalculatedRange: function (e) {
                var t = this.option;
                bD(["start", "startValue", "end", "endValue"], function (i) {
                    t[i] = e[i]
                })
            },
            getPercentRange: function () {
                var e = this.findRepresentativeAxisProxy();
                if (e) return e.getDataPercentWindow()
            },
            getValueRange: function (e, t) {
                if (null != e || null != t) return this.getAxisProxy(e, t).getDataValueWindow();
                var i = this.findRepresentativeAxisProxy();
                return i ? i.getDataValueWindow() : void 0
            },
            findRepresentativeAxisProxy: function (e) {
                if (e) return e.__dzAxisProxy;
                var t = this._axisProxies;
                for (var i in t) if (t.hasOwnProperty(i) && t[i].hostedBy(this)) return t[i];
                for (var i in t) if (t.hasOwnProperty(i) && !t[i].hostedBy(this)) return t[i]
            },
            getRangePropMode: function () {
                return this._rangePropMode.slice()
            }
        });

        function AD(e) {
            var t = {};
            return bD(["start", "end", "startValue", "endValue", "throttle"], function (i) {
                e.hasOwnProperty(i) && (t[i] = e[i])
            }), t
        }

        function ND(e, t) {
            var i = e._rangePropMode, n = e.get("rangeMode");
            bD([["start", "startValue"], ["end", "endValue"]], function (e, a) {
                var o = null != t[e[0]], r = null != t[e[1]];
                o && !r ? i[a] = "percent" : !o && r ? i[a] = "value" : n ? i[a] = n[a] : o && (i[a] = "percent")
            })
        }

        var xD = lc.extend({
            type: "dataZoom", render: function (e, t, i, n) {
                this.dataZoomModel = e, this.ecModel = t, this.api = i
            }, getTargetCoordInfo: function () {
                var e = this.dataZoomModel, t = this.ecModel, i = {};
                return e.eachTargetAxis(function (e, n) {
                    var a = t.getComponent(e.axis, n);
                    if (a) {
                        var o = a.getCoordSysModel();
                        o && function (e, t, i, n) {
                            for (var a, o = 0; o < i.length; o++) if (i[o].model === e) {
                                a = i[o];
                                break
                            }
                            a || i.push(a = {model: e, axisModels: [], coordIndex: n}), a.axisModels.push(t)
                        }(o, a, i[o.mainType] || (i[o.mainType] = []), o.componentIndex)
                    }
                }, this), i
            }
        });
        DD.extend({type: "dataZoom.select"}), xD.extend({type: "dataZoom.select"}), hf({
            getTargetSeries: function (e) {
                var t = Q();
                return e.eachComponent("dataZoom", function (e) {
                    e.eachTargetAxis(function (e, i, n) {
                        D(n.getAxisProxy(e.name, i).getTargetSeriesModels(), function (e) {
                            t.set(e.uid, e)
                        })
                    })
                }), t
            }, modifyOutputEnd: !0, overallReset: function (e, t) {
                e.eachComponent("dataZoom", function (e) {
                    e.eachTargetAxis(function (e, i, n) {
                        n.getAxisProxy(e.name, i).reset(n, t)
                    }), e.eachTargetAxis(function (e, i, n) {
                        n.getAxisProxy(e.name, i).filterData(n, t)
                    })
                }), e.eachComponent("dataZoom", function (e) {
                    var t = e.findRepresentativeAxisProxy(), i = t.getDataPercentWindow(), n = t.getDataValueWindow();
                    e.setCalculatedRange({start: i[0], end: i[1], startValue: n[0], endValue: n[1]})
                })
            }
        }), ff("dataZoom", function (e, t) {
            var i = function (e, t, i) {
                return function (a) {
                    var o, r = {nodes: [], records: {}};
                    if (t(function (e) {
                        r.records[e.name] = {}
                    }), !a) return r;
                    for (n(a, r); o = !1, e(s), o;) ;

                    function s(e) {
                        !function (e, t) {
                            return 0 <= S(t.nodes, e)
                        }(e, r) && function (e, n) {
                            var a = !1;
                            return t(function (t) {
                                D(i(e, t) || [], function (e) {
                                    n.records[t.name][e] && (a = !0)
                                })
                            }), a
                        }(e, r) && (n(e, r), o = !0)
                    }

                    return r
                };

                function n(e, n) {
                    n.nodes.push(e), t(function (t) {
                        D(i(e, t) || [], function (e) {
                            n.records[t.name][e] = !0
                        })
                    })
                }
            }(P(t.eachComponent, t, "dataZoom"), TD, function (e, t) {
                return e.get(t.axisIndex)
            }), n = [];
            t.eachComponent({mainType: "dataZoom", query: e}, function (e, t) {
                n.push.apply(n, i(e).nodes)
            }), D(n, function (t, i) {
                t.setRawRange({start: e.start, end: e.end, startValue: e.startValue, endValue: e.endValue})
            })
        });
        var ED = Dc.toolbox.dataZoom, PD = D;

        function OD(e, t, i) {
            (this._brushController = new aC(i.getZr())).on("brush", P(this._onBrush, this)).mount(), this._isZoomActive
        }

        OD.defaultOption = {
            show: !0,
            filterMode: "filter",
            icon: {
                zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
                back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
            },
            title: v(ED.title)
        };
        var MD = OD.prototype;
        MD.render = function (e, t, i, n) {
            this.model = e, this.ecModel = t, this.api = i, function (e, t, i, n, a) {
                var o = i._isZoomActive;
                n && "takeGlobalCursor" === n.type && (o = "dataZoomSelect" === n.key && n.dataZoomSelectActive), i._isZoomActive = o, e.setIconStatus("zoom", o ? "emphasis" : "normal");
                var r = new eD(LD(e.option), t, {include: ["grid"]});
                i._brushController.setPanels(r.makePanelOpts(a, function (e) {
                    return e.xAxisDeclared && !e.yAxisDeclared ? "lineX" : !e.xAxisDeclared && e.yAxisDeclared ? "lineY" : "rect"
                })).enableBrush(!!o && {brushType: "auto", brushStyle: {lineWidth: 0, fill: "rgba(0,0,0,0.2)"}})
            }(e, t, this, n, i), function (e, t) {
                e.setIconStatus("back", 1 < function (e) {
                    return gD(e).length
                }(t) ? "emphasis" : "normal")
            }(e, t)
        }, MD.onclick = function (e, t, i) {
            FD[i].call(this)
        }, MD.remove = function (e, t) {
            this._brushController.unmount()
        }, MD.dispose = function (e, t) {
            this._brushController.dispose()
        };
        var FD = {
            zoom: function () {
                var e = !this._isZoomActive;
                this.api.dispatchAction({type: "takeGlobalCursor", key: "dataZoomSelect", dataZoomSelectActive: e})
            }, back: function () {
                this._dispatchZoomAction(function (e) {
                    var t = gD(e), i = t[t.length - 1];
                    1 < t.length && t.pop();
                    var n = {};
                    return hD(i, function (e, i) {
                        for (var a = t.length - 1; 0 <= a; a--) if (e = t[a][i]) {
                            n[i] = e;
                            break
                        }
                    }), n
                }(this.ecModel))
            }
        };

        function LD(e) {
            var t = {};
            return D(["xAxisIndex", "yAxisIndex"], function (i) {
                t[i] = e[i], null == t[i] && (t[i] = "all"), !1 !== t[i] && "none" !== t[i] || (t[i] = [])
            }), t
        }

        MD._onBrush = function (e, t) {
            if (t.isEnd && e.length) {
                var i = {}, n = this.ecModel;
                this._brushController.updateCovers([]), new eD(LD(this.model.option), n, {include: ["grid"]}).matchOutputRanges(e, n, function (e, t, i) {
                    if ("cartesian2d" === i.type) {
                        var n = e.brushType;
                        "rect" === n ? (a("x", i, t[0]), a("y", i, t[1])) : a({lineX: "x", lineY: "y"}[n], i, t)
                    }
                }), function (e, t) {
                    var i = gD(e);
                    hD(t, function (t, n) {
                        for (var a = i.length - 1; 0 <= a && !i[a][n]; a--) ;
                        if (a < 0) {
                            var o = e.queryComponents({mainType: "dataZoom", subType: "select", id: n})[0];
                            if (o) {
                                var r = o.getPercentRange();
                                i[0][n] = {dataZoomId: n, start: r[0], end: r[1]}
                            }
                        }
                    }), i.push(t)
                }(n, i), this._dispatchZoomAction(i)
            }

            function a(e, t, a) {
                var o = t.getAxis(e), r = o.model, s = function (e, t, i) {
                    var n;
                    return i.eachComponent({mainType: "dataZoom", subType: "select"}, function (i) {
                        i.getAxisModel(e, t.componentIndex) && (n = i)
                    }), n
                }(e, r, n), l = s.findRepresentativeAxisProxy(r).getMinMaxSpan();
                null == l.minValueSpan && null == l.maxValueSpan || (a = Ew(0, a.slice(), o.scale.getExtent(), 0, l.minValueSpan, l.maxValueSpan)), s && (i[s.id] = {
                    dataZoomId: s.id,
                    startValue: a[0],
                    endValue: a[1]
                })
            }
        }, MD._dispatchZoomAction = function (e) {
            var t = [];
            PD(e, function (e, i) {
                t.push(v(e))
            }), t.length && this.api.dispatchAction({type: "dataZoom", from: this.uid, batch: t})
        }, E_("dataZoom", OD), cf(function (e) {
            if (e) {
                var t = e.dataZoom || (e.dataZoom = []);
                M(t) || (e.dataZoom = t = [t]);
                var i = e.toolbox;
                if (i && (M(i) && (i = i[0]), i && i.feature)) {
                    var n = i.feature.dataZoom;
                    a("xAxis", n), a("yAxis", n)
                }
            }

            function a(i, n) {
                if (n) {
                    var a = i + "Index", o = n[a];
                    null == o || "all" === o || M(o) || (o = !1 === o || "none" === o ? [] : [o]), M(r = e[i]) || (r = r ? [r] : []), PD(r, function (e, r) {
                        if (null == o || "all" === o || -1 !== S(o, r)) {
                            var s = {
                                type: "select",
                                $fromToolbox: !0,
                                filterMode: n.filterMode || "filter",
                                id: "\0_ec_\0toolbox-dataZoom_" + i + r
                            };
                            s[a] = r, t.push(s)
                        }
                    })
                }
                var r
            }
        });
        var RD = Dc.toolbox.restore;

        function BD(e) {
            this.model = e
        }

        BD.defaultOption = {
            show: !0,
            icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
            title: RD.title
        }, BD.prototype.onclick = function (e, t, i) {
            !function (e) {
                e[fD] = null
            }(e), t.dispatchAction({type: "restore", from: this.uid})
        }, E_("restore", BD), ff({type: "restore", event: "restore", update: "prepareAndUpdate"}, function (e, t) {
            t.resetOption("recreate")
        }), kf({
            type: "tooltip",
            dependencies: ["axisPointer"],
            defaultOption: {
                zlevel: 0,
                z: 60,
                show: !0,
                showContent: !0,
                trigger: "item",
                triggerOn: "mousemove|click",
                alwaysShowContent: !1,
                displayMode: "single",
                renderMode: "auto",
                confine: !1,
                showDelay: 0,
                hideDelay: 100,
                transitionDuration: .4,
                enterable: !1,
                backgroundColor: "rgba(50,50,50,0.7)",
                borderColor: "#333",
                borderRadius: 4,
                borderWidth: 0,
                padding: 5,
                extraCssText: "",
                axisPointer: {
                    type: "line",
                    axis: "auto",
                    animation: "auto",
                    animationDurationUpdate: 200,
                    animationEasingUpdate: "exponentialOut",
                    crossStyle: {color: "#999", width: 1, type: "dashed", textStyle: {}}
                },
                textStyle: {color: "#fff", fontSize: 14}
            }
        });
        var UD = D, KD = Yl, VD = ["", "-webkit-", "-moz-", "-o-"];

        function WD(e, t, i, n, a) {
            var o = t && t.painter;
            if (i) {
                var r = o && o.getViewportRoot();
                r && function (e, t, i, n, a) {
                    Le(Fe, t, n, a, !0) && Le(e, i, Fe[0], Fe[1])
                }(e, r, document.body, n, a)
            } else {
                e[0] = n, e[1] = a;
                var s = o && o.getViewportRootOffset();
                s && (e[0] += s.offsetLeft, e[1] += s.offsetTop)
            }
        }

        function GD(e, t, i) {
            if (a.wxa) return null;
            var n = document.createElement("div");
            n.domBelongToZr = !0, this.el = n;
            var o = this._zr = t.getZr(), r = this._appendToBody = i && i.appendToBody;
            this._styleCoord = [0, 0], WD(this._styleCoord, o, r, t.getWidth() / 2, t.getHeight() / 2), r ? document.body.appendChild(n) : e.appendChild(n), this._container = e, this._show = !1, this._hideTimeout;
            var s = this;
            n.onmouseenter = function () {
                s._enterable && (clearTimeout(s._hideTimeout), s._show = !0), s._inContent = !0
            }, n.onmousemove = function (e) {
                if (e = e || window.event, !s._enterable) {
                    var t = o.handler;
                    He(o.painter.getViewportRoot(), e, !0), t.dispatch("mousemove", e)
                }
            }, n.onmouseleave = function () {
                s._enterable && s._show && s.hideLater(s._hideDelay), s._inContent = !1
            }
        }

        function HD(e) {
            this._zr = e.getZr(), this._show = !1, this._hideTimeout
        }

        GD.prototype = {
            constructor: GD, _enterable: !0, update: function () {
                var e = this._container, t = e.currentStyle || document.defaultView.getComputedStyle(e), i = e.style;
                "absolute" !== i.position && "absolute" !== t.position && (i.position = "relative")
            }, show: function (e) {
                clearTimeout(this._hideTimeout);
                var t = this.el, i = this._styleCoord;
                t.style.cssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + function (e) {
                    var t = [], i = e.get("transitionDuration"), n = e.get("backgroundColor"),
                        o = e.getModel("textStyle"), r = e.get("padding");
                    return i && t.push(function (e) {
                        var t = "cubic-bezier(0.23, 1, 0.32, 1)", i = "left " + e + "s " + t + ",top " + e + "s " + t;
                        return A(VD, function (e) {
                            return e + "transition:" + i
                        }).join(";")
                    }(i)), n && (a.canvasSupported ? t.push("background-Color:" + n) : (t.push("background-Color:#" + Ht(n)), t.push("filter:alpha(opacity=70)"))), UD(["width", "color", "radius"], function (i) {
                        var n = "border-" + i, a = KD(n), o = e.get(a);
                        null != o && t.push(n + ":" + o + ("color" === i ? "" : "px"))
                    }), t.push(function (e) {
                        var t = [], i = e.get("fontSize"), n = e.getTextColor();
                        return n && t.push("color:" + n), t.push("font:" + e.getFont()), i && t.push("line-height:" + Math.round(3 * i / 2) + "px"), UD(["decoration", "align"], function (i) {
                            var n = e.get(i);
                            n && t.push("text-" + i + ":" + n)
                        }), t.join(";")
                    }(o)), null != r && t.push("padding:" + ql(r).join("px ") + "px"), t.join(";") + ";"
                }(e) + ";left:" + i[0] + "px;top:" + i[1] + "px;" + (e.get("extraCssText") || ""), t.style.display = t.innerHTML ? "block" : "none", t.style.pointerEvents = this._enterable ? "auto" : "none", this._show = !0
            }, setContent: function (e) {
                this.el.innerHTML = null == e ? "" : e
            }, setEnterable: function (e) {
                this._enterable = e
            }, getSize: function () {
                var e = this.el;
                return [e.clientWidth, e.clientHeight]
            }, moveTo: function (e, t) {
                var i = this._styleCoord;
                WD(i, this._zr, this._appendToBody, e, t);
                var n = this.el.style;
                n.left = i[0] + "px", n.top = i[1] + "px"
            }, hide: function () {
                this.el.style.display = "none", this._show = !1
            }, hideLater: function (e) {
                !this._show || this._inContent && this._enterable || (e ? (this._hideDelay = e, this._show = !1, this._hideTimeout = setTimeout(P(this.hide, this), e)) : this.hide())
            }, isShow: function () {
                return this._show
            }, dispose: function () {
                this.el.parentNode.removeChild(this.el)
            }, getOuterSize: function () {
                var e = this.el.clientWidth, t = this.el.clientHeight;
                if (document.defaultView && document.defaultView.getComputedStyle) {
                    var i = document.defaultView.getComputedStyle(this.el);
                    i && (e += parseInt(i.borderLeftWidth, 10) + parseInt(i.borderRightWidth, 10), t += parseInt(i.borderTopWidth, 10) + parseInt(i.borderBottomWidth, 10))
                }
                return {width: e, height: t}
            }
        }, HD.prototype = {
            constructor: HD, _enterable: !0, update: function () {
            }, show: function (e) {
                this._hideTimeout && clearTimeout(this._hideTimeout), this.el.attr("show", !0), this._show = !0
            }, setContent: function (e, t, i) {
                this.el && this._zr.remove(this.el);
                for (var n = {}, a = e, o = "{marker", r = a.indexOf(o); 0 <= r;) {
                    var s = a.indexOf("|}"), l = a.substr(r + o.length, s - r - o.length);
                    -1 < l.indexOf("sub") ? n["marker" + l] = {
                        textWidth: 4,
                        textHeight: 4,
                        textBorderRadius: 2,
                        textBackgroundColor: t[l],
                        textOffset: [3, 0]
                    } : n["marker" + l] = {
                        textWidth: 10,
                        textHeight: 10,
                        textBorderRadius: 5,
                        textBackgroundColor: t[l]
                    }, r = (a = a.substr(s + 1)).indexOf("{marker")
                }
                this.el = new Ur({
                    style: {
                        rich: n,
                        text: e,
                        textLineHeight: 20,
                        textBackgroundColor: i.get("backgroundColor"),
                        textBorderRadius: i.get("borderRadius"),
                        textFill: i.get("textStyle.color"),
                        textPadding: i.get("padding")
                    }, z: i.get("z")
                }), this._zr.add(this.el);
                var d = this;
                this.el.on("mouseover", function () {
                    d._enterable && (clearTimeout(d._hideTimeout), d._show = !0), d._inContent = !0
                }), this.el.on("mouseout", function () {
                    d._enterable && d._show && d.hideLater(d._hideDelay), d._inContent = !1
                })
            }, setEnterable: function (e) {
                this._enterable = e
            }, getSize: function () {
                var e = this.el.getBoundingRect();
                return [e.width, e.height]
            }, moveTo: function (e, t) {
                this.el && this.el.attr("position", [e, t])
            }, hide: function () {
                this.el && this.el.hide(), this._show = !1
            }, hideLater: function (e) {
                !this._show || this._inContent && this._enterable || (e ? (this._hideDelay = e, this._show = !1, this._hideTimeout = setTimeout(P(this.hide, this), e)) : this.hide())
            }, isShow: function () {
                return this._show
            }, getOuterSize: function () {
                var e = this.getSize();
                return {width: e[0], height: e[1]}
            }
        };
        var zD = P, jD = D, XD = xl, $D = new es({shape: {x: -1, y: -1, width: 2, height: 2}});

        function YD(e) {
            for (var t = e.pop(); e.length;) {
                var i = e.pop();
                i && (Sl.isInstance(i) && (i = i.get("tooltip", !0)), "string" == typeof i && (i = {formatter: i}), t = new Sl(i, t, t.ecModel))
            }
            return t
        }

        function qD(e, t) {
            return e.dispatchAction || P(t.dispatchAction, t)
        }

        function JD(e) {
            return "center" === e || "middle" === e
        }

        Tf({
            type: "tooltip", init: function (e, t) {
                if (!a.node) {
                    var i, n = e.getComponent("tooltip"), o = n.get("renderMode");
                    this._renderMode = ja(o), "html" === this._renderMode ? (i = new GD(t.getDom(), t, {appendToBody: n.get("appendToBody", !0)}), this._newLine = "<br/>") : (i = new HD(t), this._newLine = "\n"), this._tooltipContent = i
                }
            }, render: function (e, t, i) {
                if (!a.node) {
                    this.group.removeAll(), this._tooltipModel = e, this._ecModel = t, this._api = i, this._lastDataByCoordSys = null, this._alwaysShowContent = e.get("alwaysShowContent");
                    var n = this._tooltipContent;
                    n.update(), n.setEnterable(e.get("enterable")), this._initGlobalListener(), this._keepShow()
                }
            }, _initGlobalListener: function () {
                var e = this._tooltipModel.get("triggerOn");
                jI("itemTooltip", this._api, zD(function (t, i, n) {
                    "none" !== e && (0 <= e.indexOf(t) ? this._tryShow(i, n) : "leave" === t && this._hide(n))
                }, this))
            }, _keepShow: function () {
                var e = this._tooltipModel, t = this._ecModel, i = this._api;
                if (null != this._lastX && null != this._lastY && "none" !== e.get("triggerOn")) {
                    var n = this;
                    clearTimeout(this._refreshUpdateTimeout), this._refreshUpdateTimeout = setTimeout(function () {
                        i.isDisposed() || n.manuallyShowTip(e, t, i, {x: n._lastX, y: n._lastY})
                    })
                }
            }, manuallyShowTip: function (e, t, i, n) {
                if (n.from !== this.uid && !a.node) {
                    var o = qD(n, i);
                    this._ticket = "";
                    var r = n.dataByCoordSys;
                    if (n.tooltip && null != n.x && null != n.y) {
                        var s = $D;
                        s.position = [n.x, n.y], s.update(), s.tooltip = n.tooltip, this._tryShow({
                            offsetX: n.x,
                            offsetY: n.y,
                            target: s
                        }, o)
                    } else if (r) this._tryShow({
                        offsetX: n.x,
                        offsetY: n.y,
                        position: n.position,
                        dataByCoordSys: n.dataByCoordSys,
                        tooltipOption: n.tooltipOption
                    }, o); else if (null != n.seriesIndex) {
                        if (this._manuallyAxisShowTip(e, t, i, n)) return;
                        var l = FI(n, t), d = l.point[0], u = l.point[1];
                        null != d && null != u && this._tryShow({
                            offsetX: d,
                            offsetY: u,
                            position: n.position,
                            target: l.el
                        }, o)
                    } else null != n.x && null != n.y && (i.dispatchAction({
                        type: "updateAxisPointer",
                        x: n.x,
                        y: n.y
                    }), this._tryShow({
                        offsetX: n.x,
                        offsetY: n.y,
                        position: n.position,
                        target: i.getZr().findHover(n.x, n.y).target
                    }, o))
                }
            }, manuallyHideTip: function (e, t, i, n) {
                var a = this._tooltipContent;
                !this._alwaysShowContent && this._tooltipModel && a.hideLater(this._tooltipModel.get("hideDelay")), this._lastX = this._lastY = null, n.from !== this.uid && this._hide(qD(n, i))
            }, _manuallyAxisShowTip: function (e, t, i, n) {
                var a = n.seriesIndex, o = n.dataIndex, r = t.getComponent("axisPointer").coordSysAxesInfo;
                if (null != a && null != o && null != r) {
                    var s = t.getSeriesByIndex(a);
                    if (s && "axis" === (e = YD([s.getData().getItemModel(o), s, (s.coordinateSystem || {}).model, e])).get("trigger")) return i.dispatchAction({
                        type: "updateAxisPointer",
                        seriesIndex: a,
                        dataIndex: o,
                        position: n.position
                    }), !0
                }
            }, _tryShow: function (e, t) {
                var i = e.target;
                if (this._tooltipModel) {
                    this._lastX = e.offsetX, this._lastY = e.offsetY;
                    var n = e.dataByCoordSys;
                    n && n.length ? this._showAxisTooltip(n, e) : i && null != i.dataIndex ? (this._lastDataByCoordSys = null, this._showSeriesItemTooltip(e, i, t)) : i && i.tooltip ? (this._lastDataByCoordSys = null, this._showComponentItemTooltip(e, i, t)) : (this._lastDataByCoordSys = null, this._hide(t))
                }
            }, _showOrMove: function (e, t) {
                var i = e.get("showDelay");
                t = P(t, this), clearTimeout(this._showTimout), 0 < i ? this._showTimout = setTimeout(t, i) : t()
            }, _showAxisTooltip: function (e, t) {
                var i = this._ecModel, n = this._tooltipModel, a = [t.offsetX, t.offsetY], o = [], r = [],
                    s = YD([t.tooltipOption, n]), l = this._renderMode, d = this._newLine, u = {};
                jD(e, function (e) {
                    jD(e.dataByAxis, function (e) {
                        var t = i.getComponent(e.axisDim + "Axis", e.axisIndex), n = e.value, a = [];
                        if (t && null != n) {
                            var s = sb(n, t.axis, i, e.seriesDataIndices, e.valueLabelOpt);
                            D(e.seriesDataIndices, function (o) {
                                var d = i.getSeriesByIndex(o.seriesIndex), c = o.dataIndexInside,
                                    h = d && d.getDataParams(c);
                                if (h.axisDim = e.axisDim, h.axisIndex = e.axisIndex, h.axisType = e.axisType, h.axisId = e.axisId, h.axisValue = Qg(t.axis, n), h.axisValueLabel = s, h) {
                                    r.push(h);
                                    var f, g = d.formatTooltip(c, !0, null, l);
                                    if (R(g)) {
                                        f = g.html;
                                        var p = g.markers;
                                        m(u, p)
                                    } else f = g;
                                    a.push(f)
                                }
                            });
                            var c = s;
                            "html" !== l ? o.push(a.join(d)) : o.push((c ? Ql(c) + d : "") + a.join(d))
                        }
                    })
                }, this), o.reverse(), o = o.join(this._newLine + this._newLine);
                var c = t.position;
                this._showOrMove(s, function () {
                    this._updateContentNotChangedOnAxis(e) ? this._updatePosition(s, c, a[0], a[1], this._tooltipContent, r) : this._showTooltipContent(s, o, r, Math.random(), a[0], a[1], c, void 0, u)
                })
            }, _showSeriesItemTooltip: function (e, t, i) {
                var n = this._ecModel, a = t.seriesIndex, o = n.getSeriesByIndex(a), r = t.dataModel || o,
                    s = t.dataIndex, l = t.dataType, d = r.getData(l),
                    u = YD([d.getItemModel(s), r, o && (o.coordinateSystem || {}).model, this._tooltipModel]),
                    c = u.get("trigger");
                if (null == c || "item" === c) {
                    var h, f, g = r.getDataParams(s, l), p = r.formatTooltip(s, !1, l, this._renderMode);
                    f = R(p) ? (h = p.html, p.markers) : (h = p, null);
                    var v = "item_" + r.name + "_" + s;
                    this._showOrMove(u, function () {
                        this._showTooltipContent(u, h, g, v, e.offsetX, e.offsetY, e.position, e.target, f)
                    }), i({
                        type: "showTip",
                        dataIndexInside: s,
                        dataIndex: d.getRawIndex(s),
                        seriesIndex: a,
                        from: this.uid
                    })
                }
            }, _showComponentItemTooltip: function (e, t, i) {
                var n = t.tooltip;
                "string" == typeof n && (n = {content: n, formatter: n});
                var a = new Sl(n, this._tooltipModel, this._ecModel), o = a.get("content"), r = Math.random();
                this._showOrMove(a, function () {
                    this._showTooltipContent(a, o, a.get("formatterParams") || {}, r, e.offsetX, e.offsetY, e.position, t)
                }), i({type: "showTip", from: this.uid})
            }, _showTooltipContent: function (e, t, i, n, a, o, r, s, l) {
                if (this._ticket = "", e.get("showContent") && e.get("show")) {
                    var d = this._tooltipContent, u = e.get("formatter");
                    r = r || e.get("position");
                    var c = t;
                    if (u && "string" == typeof u) c = id(u, i, !0); else if ("function" == typeof u) {
                        var h = zD(function (t, n) {
                            t === this._ticket && (d.setContent(n, l, e), this._updatePosition(e, r, a, o, d, i, s))
                        }, this);
                        this._ticket = n, c = u(i, n, h)
                    }
                    d.setContent(c, l, e), d.show(e), this._updatePosition(e, r, a, o, d, i, s)
                }
            }, _updatePosition: function (e, t, i, n, a, o, r) {
                var s = this._api.getWidth(), l = this._api.getHeight();
                t = t || e.get("position");
                var d = a.getSize(), u = e.get("align"), c = e.get("verticalAlign"),
                    h = r && r.getBoundingRect().clone();
                if (r && h.applyTransform(r.transform), "function" == typeof t && (t = t([i, n], o, a.el, h, {
                    viewSize: [s, l],
                    contentSize: d.slice()
                })), M(t)) i = XD(t[0], s), n = XD(t[1], l); else if (R(t)) {
                    t.width = d[0], t.height = d[1];
                    var f = vd(t, {width: s, height: l});
                    i = f.x, n = f.y, c = u = null
                } else if ("string" == typeof t && r) i = (g = function (e, t, i) {
                    var n = i[0], a = i[1], o = 0, r = 0, s = t.width, l = t.height;
                    switch (e) {
                        case"inside":
                            o = t.x + s / 2 - n / 2, r = t.y + l / 2 - a / 2;
                            break;
                        case"top":
                            o = t.x + s / 2 - n / 2, r = t.y - a - 5;
                            break;
                        case"bottom":
                            o = t.x + s / 2 - n / 2, r = t.y + l + 5;
                            break;
                        case"left":
                            o = t.x - n - 5, r = t.y + l / 2 - a / 2;
                            break;
                        case"right":
                            o = t.x + s + 5, r = t.y + l / 2 - a / 2
                    }
                    return [o, r]
                }(t, h, d))[0], n = g[1]; else {
                    var g;
                    i = (g = function (e, t, i, n, a, o, r) {
                        var s = i.getOuterSize(), l = s.width, d = s.height;
                        return null != o && (n < e + l + o ? e -= l + o : e += o), null != r && (a < t + d + r ? t -= d + r : t += r), [e, t]
                    }(i, n, a, s, l, u ? null : 20, c ? null : 20))[0], n = g[1]
                }
                u && (i -= JD(u) ? d[0] / 2 : "right" === u ? d[0] : 0), c && (n -= JD(c) ? d[1] / 2 : "bottom" === c ? d[1] : 0), e.get("confine") && (i = (g = function (e, t, i, n, a) {
                    var o = i.getOuterSize(), r = o.width, s = o.height;
                    return e = Math.min(e + r, n) - r, t = Math.min(t + s, a) - s, e = Math.max(e, 0), t = Math.max(t, 0), [e, t]
                }(i, n, a, s, l))[0], n = g[1]), a.moveTo(i, n)
            }, _updateContentNotChangedOnAxis: function (e) {
                var t = this._lastDataByCoordSys, i = !!t && t.length === e.length;
                return i && jD(t, function (t, n) {
                    var a = t.dataByAxis || {}, o = (e[n] || {}).dataByAxis || [];
                    (i &= a.length === o.length) && jD(a, function (e, t) {
                        var n = o[t] || {}, a = e.seriesDataIndices || [], r = n.seriesDataIndices || [];
                        (i &= e.value === n.value && e.axisType === n.axisType && e.axisId === n.axisId && a.length === r.length) && jD(a, function (e, t) {
                            var n = r[t];
                            i &= e.seriesIndex === n.seriesIndex && e.dataIndex === n.dataIndex
                        })
                    })
                }), this._lastDataByCoordSys = e, !!i
            }, _hide: function (e) {
                this._lastDataByCoordSys = null, e({type: "hideTip", from: this.uid})
            }, dispose: function (e, t) {
                a.node || (this._tooltipContent.dispose(), YI("itemTooltip", t))
            }
        }), ff({type: "showTip", event: "showTip", update: "tooltip:manuallyShowTip"}, function () {
        }), ff({type: "hideTip", event: "hideTip", update: "tooltip:manuallyHideTip"}, function () {
        });
        var ZD = ["rect", "polygon", "keep", "clear"], QD = D;

        function eA(e) {
            if (e) for (var t in e) if (e.hasOwnProperty(t)) return !0
        }

        function tA(e, t, i) {
            var n = {};
            return QD(t, function (t) {
                var a = n[t] = function () {
                    function e() {
                    }

                    return e.prototype.__hidden = e.prototype, new e
                }();
                QD(e[t], function (e, n) {
                    if (Jk.isValidType(n)) {
                        var o = {type: n, visual: e};
                        i && i(o, t), a[n] = new Jk(o), "opacity" === n && ((o = v(o)).type = "colorAlpha", a.__hidden.__alphaForOpacity = new Jk(o))
                    }
                })
            }), n
        }

        function iA(e, t, i) {
            var n;
            D(i, function (e) {
                t.hasOwnProperty(e) && eA(t[e]) && (n = !0)
            }), n && D(i, function (i) {
                t.hasOwnProperty(i) && eA(t[i]) ? e[i] = v(t[i]) : delete e[i]
            })
        }

        var nA = {
            lineX: aA(0), lineY: aA(1), rect: {
                point: function (e, t, i) {
                    return e && i.boundingRect.contain(e[0], e[1])
                }, rect: function (e, t, i) {
                    return e && i.boundingRect.intersect(e)
                }
            }, polygon: {
                point: function (e, t, i) {
                    return e && i.boundingRect.contain(e[0], e[1]) && vp(i.range, e[0], e[1])
                }, rect: function (e, t, i) {
                    var n = i.range;
                    if (!e || n.length <= 1) return !1;
                    var a = e.x, o = e.y, r = e.width, s = e.height, l = n[0];
                    return !!(vp(n, a, o) || vp(n, a + r, o) || vp(n, a, o + s) || vp(n, a + r, o + s) || Di.create(e).contain(l[0], l[1]) || fl(a, o, a + r, o, n) || fl(a, o, a, o + s, n) || fl(a + r, o, a + r, o + s, n) || fl(a, o + s, a + r, o + s, n)) || void 0
                }
            }
        };

        function aA(e) {
            var t = ["x", "y"], i = ["width", "height"];
            return {
                point: function (t, i, n) {
                    if (t) {
                        var a = n.range;
                        return oA(t[e], a)
                    }
                }, rect: function (n, a, o) {
                    if (n) {
                        var r = o.range, s = [n[t[e]], n[t[e]] + n[i[e]]];
                        return s[1] < s[0] && s.reverse(), oA(s[0], r) || oA(s[1], r) || oA(r[0], s) || oA(r[1], s)
                    }
                }
            }
        }

        function oA(e, t) {
            return t[0] <= e && e <= t[1]
        }

        var rA = ["inBrush", "outOfBrush"], sA = "__ecBrushSelect", lA = "__ecInBrushSelectEvent", dA = Sh.VISUAL.BRUSH;

        function uA(e) {
            e.eachComponent({mainType: "brush"}, function (t) {
                (t.brushTargetManager = new eD(t.option, e)).setInputRanges(t.areas, e)
            })
        }

        function cA(e, t) {
            if (!e.isDisposed()) {
                var i = e.getZr();
                i[lA] = !0, e.dispatchAction({type: "brushSelect", batch: t}), i[lA] = !1
            }
        }

        function hA(e, t, i, n) {
            for (var a = 0, o = t.length; a < o; a++) {
                var r = t[a];
                if (e[r.brushType](n, i, r.selectors, r)) return !0
            }
        }

        function fA(e) {
            var t = e.brushSelector;
            if (L(t)) {
                var i = [];
                return D(nA, function (e, n) {
                    i[n] = function (i, n, a, o) {
                        var r = n.getItemLayout(i);
                        return e[t](r, a, o)
                    }
                }), i
            }
            if (F(t)) {
                var n = {};
                return D(nA, function (e, i) {
                    n[i] = t
                }), n
            }
            return t
        }

        pf(dA, function (e, t, i) {
            e.eachComponent({mainType: "brush"}, function (e) {
                i && "takeGlobalCursor" === i.type && e.setBrushOption("brush" === i.key ? i.brushOption : {brushType: !1})
            }), uA(e)
        }), vf(dA, function (e, t, i) {
            var n, a, o = [];
            e.eachComponent({mainType: "brush"}, function (t, i) {
                var r = {brushId: t.id, brushIndex: i, brushName: t.name, areas: v(t.areas), selected: []};
                o.push(r);
                var s = t.option, l = s.brushLink, d = [], u = [], c = [], h = 0;
                i || (n = s.throttleType, a = s.throttleDelay);
                var f = A(t.areas, function (e) {
                    return t = T({boundingRect: gA[e.brushType](e)}, e), i = t.selectors = {}, D(nA[t.brushType], function (e, n) {
                        i[n] = function (n) {
                            return e(n, i, t)
                        }
                    }), t;
                    var t, i
                }), g = tA(t.option, rA, function (e) {
                    e.mappingMethod = "fixed"
                });

                function p(e) {
                    return "all" === l || d[e]
                }

                function m(e) {
                    return !!e.length
                }

                M(l) && D(l, function (e) {
                    d[e] = 1
                }), e.eachSeries(function (i, n) {
                    var a = c[n] = [];
                    "parallel" === i.subType ? function (e, t) {
                        var i = e.coordinateSystem;
                        h |= i.hasAxisBrushed(), p(t) && i.eachActiveState(e.getData(), function (e, t) {
                            "active" === e && (u[t] = 1)
                        })
                    }(i, n) : function (i, n, a) {
                        var o = fA(i);
                        if (o && !function (e, t) {
                            var i = e.option.seriesIndex;
                            return null != i && "all" !== i && (M(i) ? S(i, t) < 0 : t !== i)
                        }(t, n) && (D(f, function (n) {
                            o[n.brushType] && t.brushTargetManager.controlSeries(n, i, e) && a.push(n), h |= m(a)
                        }), p(n) && m(a))) {
                            var r = i.getData();
                            r.each(function (e) {
                                hA(o, a, r, e) && (u[e] = 1)
                            })
                        }
                    }(i, n, a)
                }), e.eachSeries(function (e, t) {
                    var i = {seriesId: e.id, seriesIndex: t, seriesName: e.name, dataIndex: []};
                    r.selected.push(i);
                    var n = fA(e), a = c[t], o = e.getData(), s = p(t) ? function (e) {
                        return u[e] ? (i.dataIndex.push(o.getRawIndex(e)), "inBrush") : "outOfBrush"
                    } : function (e) {
                        return hA(n, a, o, e) ? (i.dataIndex.push(o.getRawIndex(e)), "inBrush") : "outOfBrush"
                    };
                    (p(t) ? h : m(a)) && function (e, t, i, n, a, o) {
                        var r, s = {};

                        function l(e) {
                            return i.getItemVisual(r, e)
                        }

                        function d(e, t) {
                            i.setItemVisual(r, e, t)
                        }

                        function u(e, u) {
                            r = null == o ? e : u;
                            var c = i.getRawDataItem(r);
                            if (!c || !1 !== c.visualMap) for (var h = n.call(a, e), f = t[h], g = s[h], p = 0, v = g.length; p < v; p++) {
                                var m = g[p];
                                f[m] && f[m].applyVisual(e, l, d)
                            }
                        }

                        D(e, function (e) {
                            var i = Jk.prepareVisualTypes(t[e]);
                            s[e] = i
                        }), null == o ? i.each(u) : i.each([o], u)
                    }(rA, g, o, s)
                })
            }), function (e, t, i, n, a) {
                if (a) {
                    var o = e.getZr();
                    o[lA] || (o[sA] || (o[sA] = cA), Ic(o, sA, i, t)(e, n))
                }
            }(t, n, a, o, i)
        });
        var gA = {
            lineX: te, lineY: te, rect: function (e) {
                return pA(e.range)
            }, polygon: function (e) {
                for (var t, i = e.range, n = 0, a = i.length; n < a; n++) {
                    t = t || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
                    var o = i[n];
                    o[0] < t[0][0] && (t[0][0] = o[0]), o[0] > t[0][1] && (t[0][1] = o[0]), o[1] < t[1][0] && (t[1][0] = o[1]), o[1] > t[1][1] && (t[1][1] = o[1])
                }
                return t && pA(t)
            }
        };

        function pA(e) {
            return new Di(e[0][0], e[1][0], e[0][1] - e[0][0], e[1][1] - e[1][0])
        }

        var vA = ["#ddd"];

        function mA(e, t) {
            return m({
                brushType: e.brushType,
                brushMode: e.brushMode,
                transformable: e.transformable,
                brushStyle: new Sl(e.brushStyle).getItemStyle(),
                removeOnClick: e.removeOnClick,
                z: e.z
            }, t, !0)
        }

        function yA(e, t, i, n) {
            n && n.$from === e.id || this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())
        }

        kf({
            type: "brush",
            dependencies: ["geo", "grid", "xAxis", "yAxis", "parallel", "series"],
            defaultOption: {
                toolbox: null,
                brushLink: null,
                seriesIndex: "all",
                geoIndex: null,
                xAxisIndex: null,
                yAxisIndex: null,
                brushType: "rect",
                brushMode: "single",
                transformable: !0,
                brushStyle: {borderWidth: 1, color: "rgba(120,140,180,0.3)", borderColor: "rgba(120,140,180,0.8)"},
                throttleType: "fixRate",
                throttleDelay: 0,
                removeOnClick: !0,
                z: 1e4
            },
            areas: [],
            brushType: null,
            brushOption: {},
            coordInfoList: [],
            optionUpdated: function (e, t) {
                var i = this.option;
                t || iA(i, e, ["inBrush", "outOfBrush"]);
                var n = i.inBrush = i.inBrush || {};
                i.outOfBrush = i.outOfBrush || {color: vA}, n.hasOwnProperty("liftZ") || (n.liftZ = 5)
            },
            setAreas: function (e) {
                e && (this.areas = A(e, function (e) {
                    return mA(this.option, e)
                }, this))
            },
            setBrushOption: function (e) {
                this.brushOption = mA(this.option, e), this.brushType = this.brushOption.brushType
            }
        }), Tf({
            type: "brush", init: function (e, t) {
                this.ecModel = e, this.api = t, this.model, (this._brushController = new aC(t.getZr())).on("brush", P(this._onBrush, this)).mount()
            }, render: function (e) {
                return this.model = e, yA.apply(this, arguments)
            }, updateTransform: function (e, t) {
                return uA(t), yA.apply(this, arguments)
            }, updateView: yA, dispose: function () {
                this._brushController.dispose()
            }, _onBrush: function (e, t) {
                var i = this.model.id;
                this.model.brushTargetManager.setOutputRanges(e, this.ecModel), t.isEnd && !t.removeOnClick || this.api.dispatchAction({
                    type: "brush",
                    brushId: i,
                    areas: v(e),
                    $from: i
                }), t.isEnd && this.api.dispatchAction({type: "brushEnd", brushId: i, areas: v(e), $from: i})
            }
        }), ff({type: "brush", event: "brush"}, function (e, t) {
            t.eachComponent({mainType: "brush", query: e}, function (t) {
                t.setAreas(e.areas)
            })
        }), ff({type: "brushSelect", event: "brushSelected", update: "none"}, function () {
        }), ff({type: "brushEnd", event: "brushEnd", update: "none"}, function () {
        });
        var kA = Dc.toolbox.brush;

        function TA(e, t, i) {
            this.model = e, this.ecModel = t, this.api = i, this._brushType, this._brushMode
        }

        TA.defaultOption = {
            show: !0, type: ["rect", "polygon", "lineX", "lineY", "keep", "clear"], icon: {
                rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
                polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
                lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
                lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
                keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
                clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
            }, title: v(kA.title)
        };
        var wA = TA.prototype;

        function CA(e) {
            var t = e.itemStyle || (e.itemStyle = {}), i = t.emphasis || (t.emphasis = {}),
                n = e.label || e.label || {}, a = n.normal || (n.normal = {}), o = {normal: 1, emphasis: 1};
            D(n, function (e, t) {
                o[t] || SA(a, t) || (a[t] = e)
            }), i.label && !SA(n, "emphasis") && (n.emphasis = i.label, delete i.label)
        }

        function SA(e, t) {
            return e.hasOwnProperty(t)
        }

        wA.render = wA.updateView = function (e, t, i) {
            var n, a, o;
            t.eachComponent({mainType: "brush"}, function (e) {
                n = e.brushType, a = e.brushOption.brushMode || "single", o |= e.areas.length
            }), this._brushType = n, this._brushMode = a, D(e.get("type", !0), function (t) {
                e.setIconStatus(t, ("keep" === t ? "multiple" === a : "clear" === t ? o : t === n) ? "emphasis" : "normal")
            })
        }, wA.getIcons = function () {
            var e = this.model, t = e.get("icon", !0), i = {};
            return D(e.get("type", !0), function (e) {
                t[e] && (i[e] = t[e])
            }), i
        }, wA.onclick = function (e, t, i) {
            var n = this._brushType, a = this._brushMode;
            "clear" === i ? (t.dispatchAction({type: "axisAreaSelect", intervals: []}), t.dispatchAction({
                type: "brush",
                command: "clear",
                areas: []
            })) : t.dispatchAction({
                type: "takeGlobalCursor",
                key: "brush",
                brushOption: {
                    brushType: "keep" === i ? n : n !== i && i,
                    brushMode: "keep" === i ? "multiple" === a ? "single" : "multiple" : a
                }
            })
        }, E_("brush", TA), cf(function (e, t) {
            var i = e && e.brush;
            if (M(i) || (i = i ? [i] : []), i.length) {
                var n = [];
                D(i, function (e) {
                    var t = e.hasOwnProperty("toolbox") ? e.toolbox : [];
                    t instanceof Array && (n = n.concat(t))
                });
                var a = e && e.toolbox;
                M(a) && (a = a[0]), a || (a = {feature: {}}, e.toolbox = [a]);
                var o = a.feature || (a.feature = {}), r = o.brush || (o.brush = {}), s = r.type || (r.type = []);
                s.push.apply(s, n), function (e) {
                    var t = {};
                    D(e, function (e) {
                        t[e] = 1
                    }), e.length = 0, D(t, function (t, i) {
                        e.push(i)
                    })
                }(s), t && !s.length && s.push.apply(s, ZD)
            }
        }), kf({
            type: "title",
            layoutMode: {type: "box", ignoreSize: !0},
            defaultOption: {
                zlevel: 0,
                z: 6,
                show: !0,
                text: "",
                target: "blank",
                subtext: "",
                subtarget: "blank",
                left: 0,
                top: 0,
                backgroundColor: "rgba(0,0,0,0)",
                borderColor: "#ccc",
                borderWidth: 0,
                padding: 5,
                itemGap: 10,
                textStyle: {fontSize: 18, fontWeight: "bolder", color: "#333"},
                subtextStyle: {color: "#aaa"}
            }
        }), Tf({
            type: "title", render: function (e, t, i) {
                if (this.group.removeAll(), e.get("show")) {
                    var n = this.group, a = e.getModel("textStyle"), o = e.getModel("subtextStyle"),
                        r = e.get("textAlign"), s = G(e.get("textBaseline"), e.get("textVerticalAlign")), l = new Ur({
                            style: Js({}, a, {
                                text: e.get("text"),
                                textFill: a.getTextColor()
                            }, {disableBox: !0}), z2: 10
                        }), d = l.getBoundingRect(), u = e.get("subtext"), c = new Ur({
                            style: Js({}, o, {
                                text: u,
                                textFill: o.getTextColor(),
                                y: d.height + e.get("itemGap"),
                                textVerticalAlign: "top"
                            }, {disableBox: !0}), z2: 10
                        }), h = e.get("link"), f = e.get("sublink"), g = e.get("triggerEvent", !0);
                    l.silent = !h && !g, c.silent = !f && !g, h && l.on("click", function () {
                        dd(h, "_" + e.get("target"))
                    }), f && c.on("click", function () {
                        dd(h, "_" + e.get("subtarget"))
                    }), l.eventData = c.eventData = g ? {
                        componentType: "title",
                        componentIndex: e.componentIndex
                    } : null, n.add(l), u && n.add(c);
                    var p = n.getBoundingRect(), v = e.getBoxLayoutParams();
                    v.width = p.width, v.height = p.height;
                    var m = vd(v, {width: i.getWidth(), height: i.getHeight()}, e.get("padding"));
                    r || ("middle" === (r = e.get("left") || e.get("right")) && (r = "center"), "right" === r ? m.x += m.width : "center" === r && (m.x += m.width / 2)), s || ("center" === (s = e.get("top") || e.get("bottom")) && (s = "middle"), "bottom" === s ? m.y += m.height : "middle" === s && (m.y += m.height / 2), s = s || "top"), n.attr("position", [m.x, m.y]);
                    var y = {textAlign: r, textVerticalAlign: s};
                    l.setStyle(y), c.setStyle(y), p = n.getBoundingRect();
                    var k = m.margin, T = e.getItemStyle(["color", "opacity"]);
                    T.fill = e.get("backgroundColor");
                    var w = new es({
                        shape: {
                            x: p.x - k[3],
                            y: p.y - k[0],
                            width: p.width + k[1] + k[3],
                            height: p.height + k[0] + k[2],
                            r: e.get("borderRadius")
                        }, style: T, subPixelOptimize: !0, silent: !0
                    });
                    n.add(w)
                }
            }
        }), bd.registerSubTypeDefaulter("timeline", function () {
            return "slider"
        }), ff({type: "timelineChange", event: "timelineChanged", update: "prepareAndUpdate"}, function (e, t) {
            var i = t.getComponent("timeline");
            return i && null != e.currentIndex && (i.setCurrentIndex(e.currentIndex), !i.get("loop", !0) && i.isIndexMax() && i.setPlayState(!1)), t.resetOption("timeline"), T({currentIndex: i.option.currentIndex}, e)
        }), ff({type: "timelinePlayChange", event: "timelinePlayChanged", update: "update"}, function (e, t) {
            var i = t.getComponent("timeline");
            i && null != e.playState && i.setPlayState(e.playState)
        });
        var IA = bd.extend({
            type: "timeline",
            layoutMode: "box",
            defaultOption: {
                zlevel: 0,
                z: 4,
                show: !0,
                axisType: "time",
                realtime: !0,
                left: "20%",
                top: null,
                right: "20%",
                bottom: 0,
                width: null,
                height: 40,
                padding: 5,
                controlPosition: "left",
                autoPlay: !1,
                rewind: !1,
                loop: !0,
                playInterval: 2e3,
                currentIndex: 0,
                itemStyle: {},
                label: {color: "#000"},
                data: []
            },
            init: function (e, t, i) {
                this._data, this._names, this.mergeDefaultAndTheme(e, i), this._initData()
            },
            mergeOption: function (e) {
                IA.superApply(this, "mergeOption", arguments), this._initData()
            },
            setCurrentIndex: function (e) {
                null == e && (e = this.option.currentIndex);
                var t = this._data.count();
                this.option.loop ? e = (e % t + t) % t : (t <= e && (e = t - 1), e < 0 && (e = 0)), this.option.currentIndex = e
            },
            getCurrentIndex: function () {
                return this.option.currentIndex
            },
            isIndexMax: function () {
                return this.getCurrentIndex() >= this._data.count() - 1
            },
            setPlayState: function (e) {
                this.option.autoPlay = !!e
            },
            getPlayState: function () {
                return !!this.option.autoPlay
            },
            _initData: function () {
                var e = this.option, t = e.data || [], i = e.axisType, n = this._names = [];
                if ("category" === i) {
                    var a = [];
                    D(t, function (e, t) {
                        var i, o = Fa(e);
                        R(e) ? (i = v(e)).value = t : i = t, a.push(i), L(o) || null != o && !isNaN(o) || (o = ""), n.push(o + "")
                    }), t = a
                }
                var o = {category: "ordinal", time: "time"}[i] || "number";
                (this._data = new Kf([{name: "value", type: o}], this)).initData(t, n)
            },
            getData: function () {
                return this._data
            },
            getCategories: function () {
                if ("category" === this.get("axisType")) return this._names.slice()
            }
        });

        function bA(e, t, i, n) {
            Ap.call(this, e, t, i), this.type = n || "value", this.model = null
        }

        b(IA.extend({
            type: "timeline.slider", defaultOption: {
                backgroundColor: "rgba(0,0,0,0)",
                borderColor: "#ccc",
                borderWidth: 0,
                orient: "horizontal",
                inverse: !1,
                tooltip: {trigger: "item"},
                symbol: "emptyCircle",
                symbolSize: 10,
                lineStyle: {show: !0, width: 2, color: "#304654"},
                label: {position: "auto", show: !0, interval: "auto", rotate: 0, color: "#304654"},
                itemStyle: {color: "#304654", borderWidth: 1},
                checkpointStyle: {
                    symbol: "circle",
                    symbolSize: 13,
                    color: "#c23531",
                    borderWidth: 5,
                    borderColor: "rgba(194,53,49, 0.5)",
                    animation: !0,
                    animationDuration: 300,
                    animationEasing: "quinticInOut"
                },
                controlStyle: {
                    show: !0,
                    showPlayBtn: !0,
                    showPrevBtn: !0,
                    showNextBtn: !0,
                    itemSize: 22,
                    itemGap: 12,
                    position: "left",
                    playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
                    stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
                    nextIcon: "path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",
                    prevIcon: "path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",
                    color: "#304654",
                    borderColor: "#304654",
                    borderWidth: 1
                },
                emphasis: {
                    label: {show: !0, color: "#c23531"},
                    itemStyle: {color: "#c23531"},
                    controlStyle: {color: "#c23531", borderColor: "#c23531", borderWidth: 2}
                },
                data: []
            }
        }), Uu);
        var _A = lc.extend({type: "timeline"});
        bA.prototype = {
            constructor: bA, getLabelModel: function () {
                return this.model.getModel("label")
            }, isHorizontal: function () {
                return "horizontal" === this.model.get("orient")
            }
        }, I(bA, Ap);
        var DA = P, AA = D, NA = Math.PI;

        function xA(e, t, i, n, a, o) {
            var r = t.get("color");
            a ? (a.setColor(r), i.add(a), o && o.onUpdate(a)) : ((a = cp(e.get("symbol"), -1, -1, 2, 2, r)).setStyle("strokeNoScale", !0), i.add(a), o && o.onCreate(a));
            var s = t.getItemStyle(["color", "symbol", "symbolSize"]);
            a.setStyle(s), n = m({rectHover: !0, z2: 100}, n, !0);
            var l = e.get("symbolSize");
            (l = l instanceof Array ? l.slice() : [+l, +l])[0] /= 2, l[1] /= 2, n.scale = l;
            var d = e.get("symbolOffset");
            if (d) {
                var u = n.position = n.position || [0, 0];
                u[0] += xl(d[0], l[0]), u[1] += xl(d[1], l[1])
            }
            var c = e.get("symbolRotate");
            return n.rotation = (c || 0) * Math.PI / 180 || 0, a.attr(n), a.updateTransform(), a
        }

        function EA(e, t, i, n, a) {
            if (!e.dragging) {
                var o = n.getModel("checkpointStyle"), r = i.dataToCoord(n.getData().get(["value"], t));
                a || !o.get("animation", !0) ? e.attr({position: [r, 0]}) : (e.stopAnimation(!0), e.animateTo({position: [r, 0]}, o.get("animationDuration", !0), o.get("animationEasing", !0)))
            }
        }

        _A.extend({
            type: "timeline.slider", init: function (e, t) {
                this.api = t, this._axis, this._viewRect, this._timer, this._currentPointer, this._mainGroup, this._labelGroup
            }, render: function (e, t, i, n) {
                if (this.model = e, this.api = i, this.ecModel = t, this.group.removeAll(), e.get("show", !0)) {
                    var a = this._layout(e, i), o = this._createGroup("mainGroup"), r = this._createGroup("labelGroup"),
                        s = this._axis = this._createAxis(a, e);
                    e.formatTooltip = function (e) {
                        return Ql(s.scale.getLabel(e))
                    }, AA(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function (t) {
                        this["_render" + t](a, o, s, e)
                    }, this), this._renderAxisLabel(a, r, s, e), this._position(a, e)
                }
                this._doPlayStop()
            }, remove: function () {
                this._clearTimer(), this.group.removeAll()
            }, dispose: function () {
                this._clearTimer()
            }, _layout: function (e, t) {
                var i = e.get("label.position"), n = e.get("orient"), a = function (e, t) {
                    return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()}, e.get("padding"))
                }(e, t);
                null == i || "auto" === i ? i = "horizontal" === n ? a.y + a.height / 2 < t.getHeight() / 2 ? "-" : "+" : a.x + a.width / 2 < t.getWidth() / 2 ? "+" : "-" : isNaN(i) && (i = {
                    horizontal: {
                        top: "-",
                        bottom: "+"
                    }, vertical: {left: "-", right: "+"}
                }[n][i]);
                var o, r, s, l, d = {horizontal: "center", vertical: 0 <= i || "+" === i ? "left" : "right"},
                    u = {horizontal: 0 <= i || "+" === i ? "top" : "bottom", vertical: "middle"},
                    c = {horizontal: 0, vertical: NA / 2}, h = "vertical" === n ? a.height : a.width,
                    f = e.getModel("controlStyle"), g = f.get("show", !0), p = g ? f.get("itemSize") : 0,
                    v = g ? f.get("itemGap") : 0, m = p + v, y = e.get("label.rotate") || 0;
                y = y * NA / 180;
                var k = f.get("position", !0), T = g && f.get("showPlayBtn", !0), w = g && f.get("showPrevBtn", !0),
                    C = g && f.get("showNextBtn", !0), S = 0, I = h;
                return "left" === k || "bottom" === k ? (T && (o = [0, 0], S += m), w && (r = [S, 0], S += m)) : (T && (o = [I - p, 0], I -= m), w && (r = [0, 0], S += m)), C && (s = [I - p, 0], I -= m), l = [S, I], e.get("inverse") && l.reverse(), {
                    viewRect: a,
                    mainLength: h,
                    orient: n,
                    rotation: c[n],
                    labelRotation: y,
                    labelPosOpt: i,
                    labelAlign: e.get("label.align") || d[n],
                    labelBaseline: e.get("label.verticalAlign") || e.get("label.baseline") || u[n],
                    playPosition: o,
                    prevBtnPosition: r,
                    nextBtnPosition: s,
                    axisExtent: l,
                    controlSize: p,
                    controlGap: v
                }
            }, _position: function (e, t) {
                var i = this._mainGroup, n = this._labelGroup, a = e.viewRect;
                if ("vertical" === e.orient) {
                    var o = ot(), r = a.x, s = a.y + a.height;
                    dt(o, o, [-r, -s]), ut(o, o, -NA / 2), dt(o, o, [r, s]), (a = a.clone()).applyTransform(o)
                }
                var l = v(a), d = v(i.getBoundingRect()), u = v(n.getBoundingRect()), c = i.position, h = n.position;
                h[0] = c[0] = l[0][0];
                var f, g = e.labelPosOpt;

                function p(e) {
                    var t = e.position;
                    e.origin = [l[0][0] - t[0], l[1][0] - t[1]]
                }

                function v(e) {
                    return [[e.x, e.x + e.width], [e.y, e.y + e.height]]
                }

                function m(e, t, i, n, a) {
                    e[n] += i[n][a] - t[n][a]
                }

                isNaN(g) ? (m(c, d, l, 1, f = "+" === g ? 0 : 1), m(h, u, l, 1, 1 - f)) : (m(c, d, l, 1, f = 0 <= g ? 0 : 1), h[1] = c[1] + g), i.attr("position", c), n.attr("position", h), i.rotation = n.rotation = e.rotation, p(i), p(n)
            }, _createAxis: function (e, t) {
                var i = t.getData(), n = t.get("axisType"), a = Jg(t, n);
                a.getTicks = function () {
                    return i.mapArray(["value"], function (e) {
                        return e
                    })
                };
                var o = i.getDataExtent("value");
                a.setExtent(o[0], o[1]), a.niceTicks();
                var r = new bA("value", a, e.axisExtent, n);
                return r.model = t, r
            }, _createGroup: function (e) {
                var t = this["_" + e] = new Ai;
                return this.group.add(t), t
            }, _renderAxisLine: function (e, t, i, n) {
                var a = i.getExtent();
                n.get("lineStyle.show") && t.add(new is({
                    shape: {x1: a[0], y1: 0, x2: a[1], y2: 0},
                    style: k({lineCap: "round"}, n.getModel("lineStyle").getLineStyle()),
                    silent: !0,
                    z2: 1
                }))
            }, _renderAxisTick: function (e, t, i, n) {
                var a = n.getData(), o = i.scale.getTicks();
                AA(o, function (e) {
                    var o = i.dataToCoord(e), r = a.getItemModel(e), s = r.getModel("itemStyle"),
                        l = r.getModel("emphasis.itemStyle"),
                        d = {position: [o, 0], onclick: DA(this._changeTimeline, this, e)}, u = xA(r, s, t, d);
                    zs(u, l.getItemStyle()), r.get("tooltip") ? (u.dataIndex = e, u.dataModel = n) : u.dataIndex = u.dataModel = null
                }, this)
            }, _renderAxisLabel: function (e, t, i, n) {
                if (i.getLabelModel().get("show")) {
                    var a = n.getData(), o = i.getViewLabels();
                    AA(o, function (n) {
                        var o = n.tickValue, r = a.getItemModel(o), s = r.getModel("label"),
                            l = r.getModel("emphasis.label"), d = i.dataToCoord(n.tickValue), u = new Ur({
                                position: [d, 0],
                                rotation: e.labelRotation - e.rotation,
                                onclick: DA(this._changeTimeline, this, o),
                                silent: !1
                            });
                        Js(u.style, s, {
                            text: n.formattedLabel,
                            textAlign: e.labelAlign,
                            textVerticalAlign: e.labelBaseline
                        }), t.add(u), zs(u, Js({}, l))
                    }, this)
                }
            }, _renderControl: function (e, t, i, n) {
                var a = e.controlSize, o = e.rotation, r = n.getModel("controlStyle").getItemStyle(),
                    s = n.getModel("emphasis.controlStyle").getItemStyle(), l = [0, -a / 2, a, a], d = n.getPlayState(),
                    u = n.get("inverse", !0);

                function c(e, i, d, u) {
                    if (e) {
                        var c = function (e, t, i, n) {
                            return _s(e.get(t).replace(/^path:\/\//, ""), v(n || {}), new Di(i[0], i[1], i[2], i[3]), "center")
                        }(n, i, l, {
                            position: e,
                            origin: [a / 2, 0],
                            rotation: u ? -o : 0,
                            rectHover: !0,
                            style: r,
                            onclick: d
                        });
                        t.add(c), zs(c, s)
                    }
                }

                c(e.nextBtnPosition, "controlStyle.nextIcon", DA(this._changeTimeline, this, u ? "-" : "+")), c(e.prevBtnPosition, "controlStyle.prevIcon", DA(this._changeTimeline, this, u ? "+" : "-")), c(e.playPosition, "controlStyle." + (d ? "stopIcon" : "playIcon"), DA(this._handlePlayClick, this, !d), !0)
            }, _renderCurrentPointer: function (e, t, i, n) {
                var a = n.getData(), o = n.getCurrentIndex(), r = a.getItemModel(o).getModel("checkpointStyle"),
                    s = this, l = {
                        onCreate: function (e) {
                            e.draggable = !0, e.drift = DA(s._handlePointerDrag, s), e.ondragend = DA(s._handlePointerDragend, s), EA(e, o, i, n, !0)
                        }, onUpdate: function (e) {
                            EA(e, o, i, n)
                        }
                    };
                this._currentPointer = xA(r, r, this._mainGroup, {}, this._currentPointer, l)
            }, _handlePlayClick: function (e) {
                this._clearTimer(), this.api.dispatchAction({type: "timelinePlayChange", playState: e, from: this.uid})
            }, _handlePointerDrag: function (e, t, i) {
                this._clearTimer(), this._pointerChangeTimeline([i.offsetX, i.offsetY])
            }, _handlePointerDragend: function (e) {
                this._pointerChangeTimeline([e.offsetX, e.offsetY], !0)
            }, _pointerChangeTimeline: function (e, t) {
                var i = this._toAxisCoord(e)[0], n = Pl(this._axis.getExtent().slice());
                i > n[1] && (i = n[1]), i < n[0] && (i = n[0]), this._currentPointer.position[0] = i, this._currentPointer.dirty();
                var a = this._findNearestTick(i), o = this.model;
                (t || a !== o.getCurrentIndex() && o.get("realtime")) && this._changeTimeline(a)
            }, _doPlayStop: function () {
                this._clearTimer(), this.model.getPlayState() && (this._timer = setTimeout(DA(function () {
                    var e = this.model;
                    this._changeTimeline(e.getCurrentIndex() + (e.get("rewind", !0) ? -1 : 1))
                }, this), this.model.get("playInterval")))
            }, _toAxisCoord: function (e) {
                return ll(e, this._mainGroup.getLocalTransform(), !0)
            }, _findNearestTick: function (e) {
                var t, i = this.model.getData(), n = 1 / 0, a = this._axis;
                return i.each(["value"], function (i, o) {
                    var r = a.dataToCoord(i), s = Math.abs(r - e);
                    s < n && (n = s, t = o)
                }), t
            }, _clearTimer: function () {
                this._timer && (clearTimeout(this._timer), this._timer = null)
            }, _changeTimeline: function (e) {
                var t = this.model.getCurrentIndex();
                "+" === e ? e = t + 1 : "-" === e && (e = t - 1), this.api.dispatchAction({
                    type: "timelineChange",
                    currentIndex: e,
                    from: this.uid
                })
            }
        }), cf(function (e) {
            var t = e && e.timeline;
            M(t) || (t = t ? [t] : []), D(t, function (e) {
                e && function (e) {
                    var t = e.type, i = {number: "value", time: "time"};
                    if (i[t] && (e.axisType = i[t], delete e.type), CA(e), SA(e, "controlPosition")) {
                        var n = e.controlStyle || (e.controlStyle = {});
                        SA(n, "position") || (n.position = e.controlPosition), "none" !== n.position || SA(n, "show") || (n.show = !1, delete n.position), delete e.controlPosition
                    }
                    D(e.data || [], function (e) {
                        R(e) && !M(e) && (!SA(e, "value") && SA(e, "name") && (e.value = e.name), CA(e))
                    })
                }(e)
            })
        });
        var PA = $l, OA = Ql;

        function MA(e) {
            Oa(e, "label", ["show"])
        }

        var FA = kf({
            type: "marker", dependencies: ["series", "grid", "polar", "geo"], init: function (e, t, i) {
                this.mergeDefaultAndTheme(e, i), this._mergeOption(e, i, !1, !0)
            }, isAnimationEnabled: function () {
                if (a.node) return !1;
                var e = this.__hostSeries;
                return this.getShallow("animation") && e && e.isAnimationEnabled()
            }, mergeOption: function (e, t) {
                this._mergeOption(e, t, !1, !1)
            }, _mergeOption: function (e, t, i, n) {
                var a = this.constructor, o = this.mainType + "Model";
                i || t.eachSeries(function (e) {
                    var i = e.get(this.mainType, !0), r = e[o];
                    i && i.data ? (r ? r._mergeOption(i, t, !0) : (n && MA(i), D(i.data, function (e) {
                        e instanceof Array ? (MA(e[0]), MA(e[1])) : MA(e)
                    }), k(r = new a(i, this, t), {
                        mainType: this.mainType,
                        seriesIndex: e.seriesIndex,
                        name: e.name,
                        createdBySelf: !0
                    }), r.__hostSeries = e), e[o] = r) : e[o] = null
                }, this)
            }, formatTooltip: function (e) {
                var t = this.getData(), i = this.getRawValue(e), n = M(i) ? A(i, PA).join(", ") : PA(i),
                    a = t.getName(e), o = OA(this.name);
                return null == i && !a || (o += "<br />"), a && (o += OA(a), null != i && (o += " : ")), null != i && (o += OA(n)), o
            }, getData: function () {
                return this._data
            }, setData: function (e) {
                this._data = e
            }
        });
        b(FA, Uu), FA.extend({
            type: "markPoint",
            defaultOption: {
                zlevel: 0,
                z: 5,
                symbol: "pin",
                symbolSize: 50,
                tooltip: {trigger: "item"},
                label: {show: !0, position: "inside"},
                itemStyle: {borderWidth: 2},
                emphasis: {label: {show: !0}}
            }
        });
        var LA = S;

        function RA(e, t, i, n, a, o) {
            var r = [], s = ag(t, n) ? t.getCalculationInfo("stackResultDimension") : n, l = HA(t, s, e),
                d = t.indicesOfNearest(s, l)[0];
            r[a] = t.get(i, d), r[o] = t.get(s, d);
            var u = t.get(n, d), c = Ol(t.get(n, d));
            return 0 <= (c = Math.min(c, 20)) && (r[o] = +r[o].toFixed(c)), [r, u]
        }

        var BA = O, UA = {min: BA(RA, "min"), max: BA(RA, "max"), average: BA(RA, "average")};

        function KA(e, t) {
            var i = e.getData(), n = e.coordinateSystem;
            if (t && !function (e) {
                return !isNaN(parseFloat(e.x)) && !isNaN(parseFloat(e.y))
            }(t) && !M(t.coord) && n) {
                var a = n.dimensions, o = VA(t, i, n, e);
                if ((t = v(t)).type && UA[t.type] && o.baseAxis && o.valueAxis) {
                    var r = LA(a, o.baseAxis.dim), s = LA(a, o.valueAxis.dim),
                        l = UA[t.type](i, o.baseDataDim, o.valueDataDim, r, s);
                    t.coord = l[0], t.value = l[1]
                } else {
                    for (var d = [null != t.xAxis ? t.xAxis : t.radiusAxis, null != t.yAxis ? t.yAxis : t.angleAxis], u = 0; u < 2; u++) UA[d[u]] && (d[u] = HA(i, i.mapDimension(a[u]), d[u]));
                    t.coord = d
                }
            }
            return t
        }

        function VA(e, t, i, n) {
            var a = {};
            return null != e.valueIndex || null != e.valueDim ? (a.valueDataDim = null != e.valueIndex ? t.getDimension(e.valueIndex) : e.valueDim, a.valueAxis = i.getAxis(function (e, t) {
                var i = e.getData(), n = i.dimensions;
                t = i.getDimension(t);
                for (var a = 0; a < n.length; a++) {
                    var o = i.getDimensionInfo(n[a]);
                    if (o.name === t) return o.coordDim
                }
            }(n, a.valueDataDim)), a.baseAxis = i.getOtherAxis(a.valueAxis), a.baseDataDim = t.mapDimension(a.baseAxis.dim)) : (a.baseAxis = n.getBaseAxis(), a.valueAxis = i.getOtherAxis(a.baseAxis), a.baseDataDim = t.mapDimension(a.baseAxis.dim), a.valueDataDim = t.mapDimension(a.valueAxis.dim)), a
        }

        function WA(e, t) {
            return !(e && e.containData && t.coord && !function (e) {
                return !(isNaN(parseFloat(e.x)) && isNaN(parseFloat(e.y)))
            }(t)) || e.containData(t.coord)
        }

        function GA(e, t, i, n) {
            return n < 2 ? e.coord && e.coord[n] : e.value
        }

        function HA(e, t, i) {
            if ("average" !== i) return "median" === i ? e.getMedian(t) : e.getDataExtent(t, !0)["max" === i ? 1 : 0];
            var n = 0, a = 0;
            return e.each(t, function (e, t) {
                isNaN(e) || (n += e, a++)
            }), n / a
        }

        var zA = Tf({
            type: "marker", init: function () {
                this.markerGroupMap = Q()
            }, render: function (e, t, i) {
                var n = this.markerGroupMap;
                n.each(function (e) {
                    e.__keep = !1
                });
                var a = this.type + "Model";
                t.eachSeries(function (e) {
                    var n = e[a];
                    n && this.renderSeries(e, n, t, i)
                }, this), n.each(function (e) {
                    e.__keep || this.group.remove(e.group)
                }, this)
            }, renderSeries: function () {
            }
        });

        function jA(e, t, i) {
            var n = t.coordinateSystem;
            e.each(function (a) {
                var o, r = e.getItemModel(a), s = xl(r.get("x"), i.getWidth()), l = xl(r.get("y"), i.getHeight());
                if (isNaN(s) || isNaN(l)) {
                    if (t.getMarkerPosition) o = t.getMarkerPosition(e.getValues(e.dimensions, a)); else if (n) {
                        var d = e.get(n.dimensions[0], a), u = e.get(n.dimensions[1], a);
                        o = n.dataToPoint([d, u])
                    }
                } else o = [s, l];
                isNaN(s) || (o[0] = s), isNaN(l) || (o[1] = l), e.setItemLayout(a, o)
            })
        }

        function XA(e, t, i, n) {
            var a = e.getData(), o = n.type;
            if (!M(n) && ("min" === o || "max" === o || "average" === o || "median" === o || null != n.xAxis || null != n.yAxis)) {
                var r, s;
                if (null != n.yAxis || null != n.xAxis) r = t.getAxis(null != n.yAxis ? "y" : "x"), s = W(n.yAxis, n.xAxis); else {
                    var l = VA(n, a, t, e);
                    r = l.valueAxis, s = HA(a, og(a, l.valueDataDim), o)
                }
                var d = "x" === r.dim ? 0 : 1, u = 1 - d, c = v(n), h = {};
                c.type = null, c.coord = [], h.coord = [], c.coord[u] = -1 / 0, h.coord[u] = 1 / 0;
                var f = i.get("precision");
                0 <= f && "number" == typeof s && (s = +s.toFixed(Math.min(f, 20))), c.coord[d] = h.coord[d] = s, n = [c, h, {
                    type: o,
                    valueIndex: n.valueIndex,
                    value: s
                }]
            }
            return (n = [KA(e, n[0]), KA(e, n[1]), k({}, n[2])])[2].type = n[2].type || "", m(n[2], n[0]), m(n[2], n[1]), n
        }

        function $A(e) {
            return !isNaN(e) && !isFinite(e)
        }

        function YA(e, t, i, n) {
            var a = 1 - e, o = n.dimensions[e];
            return $A(t[a]) && $A(i[a]) && t[e] === i[e] && n.getAxis(o).containData(t[e])
        }

        function qA(e, t) {
            if ("cartesian2d" === e.type) {
                var i = t[0].coord, n = t[1].coord;
                if (i && n && (YA(1, i, n, e) || YA(0, i, n, e))) return !0
            }
            return WA(e, t[0]) && WA(e, t[1])
        }

        function JA(e, t, i, n, a) {
            var o, r = n.coordinateSystem, s = e.getItemModel(t), l = xl(s.get("x"), a.getWidth()),
                d = xl(s.get("y"), a.getHeight());
            if (isNaN(l) || isNaN(d)) {
                if (n.getMarkerPosition) o = n.getMarkerPosition(e.getValues(e.dimensions, t)); else {
                    var u = r.dimensions, c = e.get(u[0], t), h = e.get(u[1], t);
                    o = r.dataToPoint([c, h])
                }
                if ("cartesian2d" === r.type) {
                    var f = r.getAxis("x"), g = r.getAxis("y");
                    u = r.dimensions, $A(e.get(u[0], t)) ? o[0] = f.toGlobalCoord(f.getExtent()[i ? 0 : 1]) : $A(e.get(u[1], t)) && (o[1] = g.toGlobalCoord(g.getExtent()[i ? 0 : 1]))
                }
                isNaN(l) || (o[0] = l), isNaN(d) || (o[1] = d)
            } else o = [l, d];
            e.setItemLayout(t, o)
        }

        function ZA(e, t, i, n) {
            var a = KA(e, n[0]), o = KA(e, n[1]), r = W, s = a.coord, l = o.coord;
            s[0] = r(s[0], -1 / 0), s[1] = r(s[1], -1 / 0), l[0] = r(l[0], 1 / 0), l[1] = r(l[1], 1 / 0);
            var d = y([{}, a, o]);
            return d.coord = [a.coord, o.coord], d.x0 = a.x, d.y0 = a.y, d.x1 = o.x, d.y1 = o.y, d
        }

        function QA(e) {
            return !isNaN(e) && !isFinite(e)
        }

        function eN(e, t, i) {
            var n = 1 - e;
            return QA(t[n]) && QA(i[n])
        }

        function tN(e, t) {
            var i = t.coord[0], n = t.coord[1];
            return !("cartesian2d" !== e.type || !i || !n || !eN(1, i, n) && !eN(0, i, n)) || WA(e, {
                coord: i,
                x: t.x0,
                y: t.y0
            }) || WA(e, {coord: n, x: t.x1, y: t.y1})
        }

        function iN(e, t, i, n, a) {
            var o, r = n.coordinateSystem, s = e.getItemModel(t), l = xl(s.get(i[0]), a.getWidth()),
                d = xl(s.get(i[1]), a.getHeight());
            if (isNaN(l) || isNaN(d)) {
                if (n.getMarkerPosition) o = n.getMarkerPosition(e.getValues(i, t)); else {
                    var u = [f = e.get(i[0], t), g = e.get(i[1], t)];
                    r.clampData && r.clampData(u, u), o = r.dataToPoint(u, !0)
                }
                if ("cartesian2d" === r.type) {
                    var c = r.getAxis("x"), h = r.getAxis("y"), f = e.get(i[0], t), g = e.get(i[1], t);
                    QA(f) ? o[0] = c.toGlobalCoord(c.getExtent()["x0" === i[0] ? 0 : 1]) : QA(g) && (o[1] = h.toGlobalCoord(h.getExtent()["y0" === i[1] ? 0 : 1]))
                }
                isNaN(l) || (o[0] = l), isNaN(d) || (o[1] = d)
            } else o = [l, d];
            return o
        }

        zA.extend({
            type: "markPoint", updateTransform: function (e, t, i) {
                t.eachSeries(function (e) {
                    var t = e.markPointModel;
                    t && (jA(t.getData(), e, i), this.markerGroupMap.get(e.id).updateLayout(t))
                }, this)
            }, renderSeries: function (e, t, i, n) {
                var a = e.coordinateSystem, o = e.id, r = e.getData(), s = this.markerGroupMap,
                    l = s.get(o) || s.set(o, new Hp), d = function (e, t, i) {
                        var n;
                        n = e ? A(e && e.dimensions, function (e) {
                            return T({name: e}, t.getData().getDimensionInfo(t.getData().mapDimension(e)) || {})
                        }) : [{name: "value", type: "float"}];
                        var a = new Kf(n, i), o = A(i.get("data"), O(KA, t));
                        return e && (o = x(o, O(WA, e))), a.initData(o, null, e ? GA : function (e) {
                            return e.value
                        }), a
                    }(a, e, t);
                t.setData(d), jA(t.getData(), e, n), d.each(function (e) {
                    var i = d.getItemModel(e), n = i.getShallow("symbol"), a = i.getShallow("symbolSize"), o = F(n),
                        s = F(a);
                    if (o || s) {
                        var l = t.getRawValue(e), u = t.getDataParams(e);
                        o && (n = n(l, u)), s && (a = a(l, u))
                    }
                    d.setItemVisual(e, {
                        symbol: n,
                        symbolSize: a,
                        color: i.get("itemStyle.color") || r.getVisual("color")
                    })
                }), l.updateData(d), this.group.add(l.group), d.eachItemGraphicEl(function (e) {
                    e.traverse(function (e) {
                        e.dataModel = t
                    })
                }), l.__keep = !0, l.group.silent = t.get("silent") || e.get("silent")
            }
        }), cf(function (e) {
            e.markPoint = e.markPoint || {}
        }), FA.extend({
            type: "markLine",
            defaultOption: {
                zlevel: 0,
                z: 5,
                symbol: ["circle", "arrow"],
                symbolSize: [8, 16],
                precision: 2,
                tooltip: {trigger: "item"},
                label: {show: !0, position: "end", distance: 5},
                lineStyle: {type: "dashed"},
                emphasis: {label: {show: !0}, lineStyle: {width: 3}},
                animationEasing: "linear"
            }
        }), zA.extend({
            type: "markLine", updateTransform: function (e, t, i) {
                t.eachSeries(function (e) {
                    var t = e.markLineModel;
                    if (t) {
                        var n = t.getData(), a = t.__from, o = t.__to;
                        a.each(function (t) {
                            JA(a, t, !0, e, i), JA(o, t, !1, e, i)
                        }), n.each(function (e) {
                            n.setItemLayout(e, [a.getItemLayout(e), o.getItemLayout(e)])
                        }), this.markerGroupMap.get(e.id).updateLayout()
                    }
                }, this)
            }, renderSeries: function (e, t, i, n) {
                var a = e.coordinateSystem, o = e.id, r = e.getData(), s = this.markerGroupMap,
                    l = s.get(o) || s.set(o, new XT);
                this.group.add(l.group);
                var d = function (e, t, i) {
                    var n;
                    n = e ? A(e && e.dimensions, function (e) {
                        return T({name: e}, t.getData().getDimensionInfo(t.getData().mapDimension(e)) || {})
                    }) : [{name: "value", type: "float"}];
                    var a = new Kf(n, i), o = new Kf(n, i), r = new Kf([], i), s = A(i.get("data"), O(XA, t, e, i));
                    e && (s = x(s, O(qA, e)));
                    var l = e ? GA : function (e) {
                        return e.value
                    };
                    return a.initData(A(s, function (e) {
                        return e[0]
                    }), null, l), o.initData(A(s, function (e) {
                        return e[1]
                    }), null, l), r.initData(A(s, function (e) {
                        return e[2]
                    })), r.hasItemOption = !0, {from: a, to: o, line: r}
                }(a, e, t), u = d.from, c = d.to, h = d.line;
                t.__from = u, t.__to = c, t.setData(h);
                var f = t.get("symbol"), g = t.get("symbolSize");

                function p(t, i, a) {
                    var o = t.getItemModel(i);
                    JA(t, i, a, e, n), t.setItemVisual(i, {
                        symbolSize: o.get("symbolSize") || g[a ? 0 : 1],
                        symbol: o.get("symbol", !0) || f[a ? 0 : 1],
                        color: o.get("itemStyle.color") || r.getVisual("color")
                    })
                }

                M(f) || (f = [f, f]), "number" == typeof g && (g = [g, g]), d.from.each(function (e) {
                    p(u, e, !0), p(c, e, !1)
                }), h.each(function (e) {
                    var t = h.getItemModel(e).get("lineStyle.color");
                    h.setItemVisual(e, {color: t || u.getItemVisual(e, "color")}), h.setItemLayout(e, [u.getItemLayout(e), c.getItemLayout(e)]), h.setItemVisual(e, {
                        fromSymbolSize: u.getItemVisual(e, "symbolSize"),
                        fromSymbol: u.getItemVisual(e, "symbol"),
                        toSymbolSize: c.getItemVisual(e, "symbolSize"),
                        toSymbol: c.getItemVisual(e, "symbol")
                    })
                }), l.updateData(h), d.line.eachItemGraphicEl(function (e, i) {
                    e.traverse(function (e) {
                        e.dataModel = t
                    })
                }), l.__keep = !0, l.group.silent = t.get("silent") || e.get("silent")
            }
        }), cf(function (e) {
            e.markLine = e.markLine || {}
        }), FA.extend({
            type: "markArea",
            defaultOption: {
                zlevel: 0,
                z: 1,
                tooltip: {trigger: "item"},
                animation: !1,
                label: {show: !0, position: "top"},
                itemStyle: {borderWidth: 0},
                emphasis: {label: {show: !0, position: "top"}}
            }
        });
        var nN = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
        zA.extend({
            type: "markArea", updateTransform: function (e, t, i) {
                t.eachSeries(function (e) {
                    var t = e.markAreaModel;
                    if (t) {
                        var n = t.getData();
                        n.each(function (t) {
                            var a = A(nN, function (a) {
                                return iN(n, t, a, e, i)
                            });
                            n.setItemLayout(t, a), n.getItemGraphicEl(t).setShape("points", a)
                        })
                    }
                }, this)
            }, renderSeries: function (e, t, i, n) {
                var a = e.coordinateSystem, o = e.id, r = e.getData(), s = this.markerGroupMap,
                    l = s.get(o) || s.set(o, {group: new Ai});
                this.group.add(l.group), l.__keep = !0;
                var d = function (e, t, i) {
                    var n, a;
                    a = e ? (n = A(e && e.dimensions, function (e) {
                        var i = t.getData();
                        return T({name: e}, i.getDimensionInfo(i.mapDimension(e)) || {})
                    }), new Kf(A(["x0", "y0", "x1", "y1"], function (e, t) {
                        return {name: e, type: n[t % 2].type}
                    }), i)) : new Kf(n = [{name: "value", type: "float"}], i);
                    var o = A(i.get("data"), O(ZA, t, e, i));
                    e && (o = x(o, O(tN, e)));
                    var r = e ? function (e, t, i, n) {
                        return e.coord[Math.floor(n / 2)][n % 2]
                    } : function (e) {
                        return e.value
                    };
                    return a.initData(o, null, r), a.hasItemOption = !0, a
                }(a, e, t);
                t.setData(d), d.each(function (t) {
                    d.setItemLayout(t, A(nN, function (i) {
                        return iN(d, t, i, e, n)
                    })), d.setItemVisual(t, {color: r.getVisual("color")})
                }), d.diff(l.__data).add(function (e) {
                    var t = new Xr({shape: {points: d.getItemLayout(e)}});
                    d.setItemGraphicEl(e, t), l.group.add(t)
                }).update(function (e, i) {
                    var n = l.__data.getItemGraphicEl(i);
                    ol(n, {shape: {points: d.getItemLayout(e)}}, t, e), l.group.add(n), d.setItemGraphicEl(e, n)
                }).remove(function (e) {
                    var t = l.__data.getItemGraphicEl(e);
                    l.group.remove(t)
                }).execute(), d.eachItemGraphicEl(function (e, i) {
                    var n = d.getItemModel(i), a = n.getModel("label"), o = n.getModel("emphasis.label"),
                        r = d.getItemVisual(i, "color");
                    e.useStyle(T(n.getModel("itemStyle").getItemStyle(), {
                        fill: qt(r, .4),
                        stroke: r
                    })), e.hoverStyle = n.getModel("emphasis.itemStyle").getItemStyle(), Ys(e.style, e.hoverStyle, a, o, {
                        labelFetcher: t,
                        labelDataIndex: i,
                        defaultText: d.getName(i) || "",
                        isRectText: !0,
                        autoColor: r
                    }), zs(e, {}), e.dataModel = t
                }), l.__data = d, l.group.silent = t.get("silent") || e.get("silent")
            }
        }), cf(function (e) {
            e.markArea = e.markArea || {}
        });
        var aN = Dc.legend.selector,
            oN = {all: {type: "all", title: v(aN.all)}, inverse: {type: "inverse", title: v(aN.inverse)}}, rN = kf({
                type: "legend.plain",
                dependencies: ["series"],
                layoutMode: {type: "box", ignoreSize: !0},
                init: function (e, t, i) {
                    this.mergeDefaultAndTheme(e, i), e.selected = e.selected || {}, this._updateSelector(e)
                },
                mergeOption: function (e) {
                    rN.superCall(this, "mergeOption", e), this._updateSelector(e)
                },
                _updateSelector: function (e) {
                    var t = e.selector;
                    !0 === t && (t = e.selector = ["all", "inverse"]), M(t) && D(t, function (e, i) {
                        L(e) && (e = {type: e}), t[i] = m(e, oN[e.type])
                    })
                },
                optionUpdated: function () {
                    this._updateData(this.ecModel);
                    var e = this._data;
                    if (e[0] && "single" === this.get("selectedMode")) {
                        for (var t = !1, i = 0; i < e.length; i++) {
                            var n = e[i].get("name");
                            if (this.isSelected(n)) {
                                this.select(n), t = !0;
                                break
                            }
                        }
                        t || this.select(e[0].get("name"))
                    }
                },
                _updateData: function (e) {
                    var t = [], i = [];
                    e.eachRawSeries(function (n) {
                        var a, o = n.name;
                        if (i.push(o), n.legendVisualProvider) {
                            var r = n.legendVisualProvider.getAllNames();
                            e.isSeriesFiltered(n) || (i = i.concat(r)), r.length ? t = t.concat(r) : a = !0
                        } else a = !0;
                        a && Ba(n) && t.push(n.name)
                    }), this._availableNames = i;
                    var n = A(this.get("data") || t, function (e) {
                        return "string" != typeof e && "number" != typeof e || (e = {name: e}), new Sl(e, this, this.ecModel)
                    }, this);
                    this._data = n
                },
                getData: function () {
                    return this._data
                },
                select: function (e) {
                    var t = this.option.selected;
                    "single" === this.get("selectedMode") && D(this._data, function (e) {
                        t[e.get("name")] = !1
                    }), t[e] = !0
                },
                unSelect: function (e) {
                    "single" !== this.get("selectedMode") && (this.option.selected[e] = !1)
                },
                toggleSelected: function (e) {
                    var t = this.option.selected;
                    t.hasOwnProperty(e) || (t[e] = !0), this[t[e] ? "unSelect" : "select"](e)
                },
                allSelect: function () {
                    var e = this._data, t = this.option.selected;
                    D(e, function (e) {
                        t[e.get("name", !0)] = !0
                    })
                },
                inverseSelect: function () {
                    var e = this._data, t = this.option.selected;
                    D(e, function (e) {
                        var i = e.get("name", !0);
                        t.hasOwnProperty(i) || (t[i] = !0), t[i] = !t[i]
                    })
                },
                isSelected: function (e) {
                    var t = this.option.selected;
                    return !(t.hasOwnProperty(e) && !t[e]) && 0 <= S(this._availableNames, e)
                },
                getOrient: function () {
                    return "vertical" === this.get("orient") ? {index: 1, name: "vertical"} : {index: 0, name: "horizontal"}
                },
                defaultOption: {
                    zlevel: 0,
                    z: 4,
                    show: !0,
                    orient: "horizontal",
                    left: "center",
                    top: 0,
                    align: "auto",
                    backgroundColor: "rgba(0,0,0,0)",
                    borderColor: "#ccc",
                    borderRadius: 0,
                    borderWidth: 0,
                    padding: 5,
                    itemGap: 10,
                    itemWidth: 25,
                    itemHeight: 14,
                    inactiveColor: "#ccc",
                    inactiveBorderColor: "#ccc",
                    itemStyle: {borderWidth: 0},
                    textStyle: {color: "#333"},
                    selectedMode: !0,
                    selector: !1,
                    selectorLabel: {
                        show: !0,
                        borderRadius: 10,
                        padding: [3, 5, 3, 5],
                        fontSize: 12,
                        fontFamily: " sans-serif",
                        color: "#666",
                        borderWidth: 1,
                        borderColor: "#666"
                    },
                    emphasis: {selectorLabel: {show: !0, color: "#eee", backgroundColor: "#666"}},
                    selectorPosition: "auto",
                    selectorItemGap: 7,
                    selectorButtonGap: 10,
                    tooltip: {show: !1}
                }
            });

        function sN(e, t, i) {
            var n, a = {}, o = "toggleSelected" === e;
            return i.eachComponent("legend", function (i) {
                o && null != n ? i[n ? "select" : "unSelect"](t.name) : "allSelect" === e || "inverseSelect" === e ? i[e]() : (i[e](t.name), n = i.isSelected(t.name)), D(i.getData(), function (e) {
                    var t = e.get("name");
                    if ("\n" !== t && "" !== t) {
                        var n = i.isSelected(t);
                        a.hasOwnProperty(t) ? a[t] = a[t] && n : a[t] = n
                    }
                })
            }), "allSelect" === e || "inverseSelect" === e ? {selected: a} : {name: t.name, selected: a}
        }

        ff("legendToggleSelect", "legendselectchanged", O(sN, "toggleSelected")), ff("legendAllSelect", "legendselectall", O(sN, "allSelect")), ff("legendInverseSelect", "legendinverseselect", O(sN, "inverseSelect")), ff("legendSelect", "legendselected", O(sN, "select")), ff("legendUnSelect", "legendunselected", O(sN, "unSelect"));
        var lN = O, dN = D, uN = Ai, cN = Tf({
            type: "legend.plain", newlineDisabled: !1, init: function () {
                this.group.add(this._contentGroup = new uN), this._backgroundEl, this.group.add(this._selectorGroup = new uN), this._isFirstRender = !0
            }, getContentGroup: function () {
                return this._contentGroup
            }, getSelectorGroup: function () {
                return this._selectorGroup
            }, render: function (e, t, i) {
                var n = this._isFirstRender;
                if (this._isFirstRender = !1, this.resetInner(), e.get("show", !0)) {
                    var a = e.get("align"), o = e.get("orient");
                    a && "auto" !== a || (a = "right" === e.get("left") && "vertical" === o ? "right" : "left");
                    var r = e.get("selector", !0), s = e.get("selectorPosition", !0);
                    !r || s && "auto" !== s || (s = "horizontal" === o ? "end" : "start"), this.renderInner(a, e, t, i, r, o, s);
                    var l = e.getBoxLayoutParams(), d = {width: i.getWidth(), height: i.getHeight()},
                        u = e.get("padding"), c = vd(l, d, u), h = this.layoutInner(e, a, c, n, r, s),
                        f = vd(T({width: h.width, height: h.height}, l), d, u);
                    this.group.attr("position", [f.x - h.x, f.y - h.y]), this.group.add(this._backgroundEl = M_(h, e))
                }
            }, resetInner: function () {
                this.getContentGroup().removeAll(), this._backgroundEl && this.group.remove(this._backgroundEl), this.getSelectorGroup().removeAll()
            }, renderInner: function (e, t, i, n, a, o, r) {
                var s = this.getContentGroup(), l = Q(), d = t.get("selectedMode"), u = [];
                i.eachRawSeries(function (e) {
                    e.get("legendHoverLink") || u.push(e.id)
                }), dN(t.getData(), function (a, o) {
                    var r = a.get("name");
                    if (this.newlineDisabled || "" !== r && "\n" !== r) {
                        var c = i.getSeriesByName(r)[0];
                        if (!l.get(r)) if (c) {
                            var h = c.getData(), f = h.getVisual("color"), g = h.getVisual("borderColor");
                            "function" == typeof f && (f = f(c.getDataParams(0))), "function" == typeof g && (g = g(c.getDataParams(0)));
                            var p = h.getVisual("legendSymbol") || "roundRect", v = h.getVisual("symbol");
                            this._createItem(r, o, a, t, p, v, e, f, g, d).on("click", lN(fN, r, null, n, u)).on("mouseover", lN(gN, c.name, null, n, u)).on("mouseout", lN(pN, c.name, null, n, u)), l.set(r, !0)
                        } else i.eachRawSeries(function (i) {
                            if (!l.get(r) && i.legendVisualProvider) {
                                var s = i.legendVisualProvider;
                                if (!s.containName(r)) return;
                                var c = s.indexOfName(r), h = s.getItemVisual(c, "color"),
                                    f = s.getItemVisual(c, "borderColor");
                                this._createItem(r, o, a, t, "roundRect", null, e, h, f, d).on("click", lN(fN, null, r, n, u)).on("mouseover", lN(gN, null, r, n, u)).on("mouseout", lN(pN, null, r, n, u)), l.set(r, !0)
                            }
                        }, this)
                    } else s.add(new uN({newline: !0}))
                }, this), a && this._createSelector(a, t, n, o, r)
            }, _createSelector: function (e, t, i, n, a) {
                var o = this.getSelectorGroup();
                dN(e, function (e) {
                    !function (e) {
                        var n = e.type, a = new Ur({
                            style: {x: 0, y: 0, align: "center", verticalAlign: "middle"},
                            onclick: function () {
                                i.dispatchAction({type: "all" === n ? "legendAllSelect" : "legendInverseSelect"})
                            }
                        });
                        o.add(a);
                        var r = t.getModel("selectorLabel"), s = t.getModel("emphasis.selectorLabel");
                        Ys(a.style, a.hoverStyle = {}, r, s, {defaultText: e.title, isRectText: !1}), zs(a)
                    }(e)
                })
            }, _createItem: function (e, t, i, n, a, o, r, s, l, d) {
                var u = n.get("itemWidth"), c = n.get("itemHeight"), h = n.get("inactiveColor"),
                    f = n.get("inactiveBorderColor"), g = n.get("symbolKeepAspect"), p = n.getModel("itemStyle"),
                    v = n.isSelected(e), m = new uN, y = i.getModel("textStyle"), T = i.get("icon"),
                    w = i.getModel("tooltip"), C = w.parentModel,
                    S = cp(a = T || a, 0, 0, u, c, v ? s : h, null == g || g);
                if (m.add(hN(S, a, p, l, f, v)), !T && o && (o !== a || "none" === o)) {
                    var I = .8 * c;
                    "none" === o && (o = "circle");
                    var b = cp(o, (u - I) / 2, (c - I) / 2, I, I, v ? s : h, null == g || g);
                    m.add(hN(b, o, p, l, f, v))
                }
                var _ = "left" === r ? u + 5 : -5, D = r, A = n.get("formatter"), N = e;
                "string" == typeof A && A ? N = A.replace("{name}", null != e ? e : "") : "function" == typeof A && (N = A(e)), m.add(new Ur({
                    style: Js({}, y, {
                        text: N,
                        x: _,
                        y: c / 2,
                        textFill: v ? y.getTextColor() : h,
                        textAlign: D,
                        textVerticalAlign: "middle"
                    })
                }));
                var x = new es({
                    shape: m.getBoundingRect(),
                    invisible: !0,
                    tooltip: w.get("show") ? k({
                        content: e,
                        formatter: C.get("formatter", !0) || function () {
                            return e
                        },
                        formatterParams: {
                            componentType: "legend",
                            legendIndex: n.componentIndex,
                            name: e,
                            $vars: ["name"]
                        }
                    }, w.option) : null
                });
                return m.add(x), m.eachChild(function (e) {
                    e.silent = !0
                }), x.silent = !d, this.getContentGroup().add(m), zs(m), m.__legendDataIndex = t, m
            }, layoutInner: function (e, t, i, n, a, o) {
                var r = this.getContentGroup(), s = this.getSelectorGroup();
                pd(e.get("orient"), r, e.get("itemGap"), i.width, i.height);
                var l = r.getBoundingRect(), d = [-l.x, -l.y];
                if (a) {
                    pd("horizontal", s, e.get("selectorItemGap", !0));
                    var u = s.getBoundingRect(), c = [-u.x, -u.y], h = e.get("selectorButtonGap", !0),
                        f = e.getOrient().index, g = 0 === f ? "width" : "height", p = 0 === f ? "height" : "width",
                        v = 0 === f ? "y" : "x";
                    "end" === o ? c[f] += l[g] + h : d[f] += u[g] + h, c[1 - f] += l[p] / 2 - u[p] / 2, s.attr("position", c), r.attr("position", d);
                    var m = {x: 0, y: 0};
                    return m[g] = l[g] + h + u[g], m[p] = Math.max(l[p], u[p]), m[v] = Math.min(0, u[v] + c[1 - f]), m
                }
                return r.attr("position", d), this.group.getBoundingRect()
            }, remove: function () {
                this.getContentGroup().removeAll(), this._isFirstRender = !0
            }
        });

        function hN(e, t, i, n, a, o) {
            var r;
            return "line" !== t && t.indexOf("empty") < 0 ? (r = i.getItemStyle(), e.style.stroke = n, o || (r.stroke = a)) : r = i.getItemStyle(["borderWidth", "borderColor"]), e.setStyle(r)
        }

        function fN(e, t, i, n) {
            pN(e, t, i, n), i.dispatchAction({type: "legendToggleSelect", name: null != e ? e : t}), gN(e, t, i, n)
        }

        function gN(e, t, i, n) {
            var a = i.getZr().storage.getDisplayList()[0];
            a && a.useHoverLayer || i.dispatchAction({type: "highlight", seriesName: e, name: t, excludeSeriesId: n})
        }

        function pN(e, t, i, n) {
            var a = i.getZr().storage.getDisplayList()[0];
            a && a.useHoverLayer || i.dispatchAction({type: "downplay", seriesName: e, name: t, excludeSeriesId: n})
        }

        hf(Sh.PROCESSOR.SERIES_FILTER, function (e) {
            var t = e.findComponents({mainType: "legend"});
            t && t.length && e.filterSeries(function (e) {
                for (var i = 0; i < t.length; i++) if (!t[i].isSelected(e.name)) return !1;
                return !0
            })
        }), bd.registerSubTypeDefaulter("legend", function () {
            return "plain"
        });
        var vN = rN.extend({
            type: "legend.scroll",
            setScrollDataIndex: function (e) {
                this.option.scrollDataIndex = e
            },
            defaultOption: {
                scrollDataIndex: 0,
                pageButtonItemGap: 5,
                pageButtonGap: null,
                pageButtonPosition: "end",
                pageFormatter: "{current}/{total}",
                pageIcons: {
                    horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
                    vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
                },
                pageIconColor: "#2f4554",
                pageIconInactiveColor: "#aaa",
                pageIconSize: 15,
                pageTextStyle: {color: "#333"},
                animationDurationUpdate: 800
            },
            init: function (e, t, i, n) {
                var a = kd(e);
                vN.superCall(this, "init", e, t, i, n), mN(this, e, a)
            },
            mergeOption: function (e, t) {
                vN.superCall(this, "mergeOption", e, t), mN(this, this.option, e)
            }
        });

        function mN(e, t, i) {
            var n = [1, 1];
            n[e.getOrient().index] = 0, yd(t, i, {type: "box", ignoreSize: n})
        }

        var yN = Ai, kN = ["width", "height"], TN = ["x", "y"], wN = cN.extend({
            type: "legend.scroll", newlineDisabled: !0, init: function () {
                wN.superCall(this, "init"), this._currentIndex = 0, this.group.add(this._containerGroup = new yN), this._containerGroup.add(this.getContentGroup()), this.group.add(this._controllerGroup = new yN), this._showController
            }, resetInner: function () {
                wN.superCall(this, "resetInner"), this._controllerGroup.removeAll(), this._containerGroup.removeClipPath(), this._containerGroup.__rectSize = null
            }, renderInner: function (e, t, i, n, a, o, r) {
                var s = this;
                wN.superCall(this, "renderInner", e, t, i, n, a, o, r);
                var l = this._controllerGroup, d = t.get("pageIconSize", !0);
                M(d) || (d = [d, d]), c("pagePrev", 0);
                var u = t.getModel("pageTextStyle");

                function c(e, i) {
                    var a = e + "DataIndex",
                        o = hl(t.get("pageIcons", !0)[t.getOrient().name][i], {onclick: P(s._pageGo, s, a, t, n)}, {
                            x: -d[0] / 2,
                            y: -d[1] / 2,
                            width: d[0],
                            height: d[1]
                        });
                    o.name = e, l.add(o)
                }

                l.add(new Ur({
                    name: "pageText",
                    style: {
                        textFill: u.getTextColor(),
                        font: u.getFont(),
                        textVerticalAlign: "middle",
                        textAlign: "center"
                    },
                    silent: !0
                })), c("pageNext", 1)
            }, layoutInner: function (e, t, i, n, a, o) {
                var r = this.getSelectorGroup(), s = e.getOrient().index, l = kN[s], d = TN[s], u = kN[1 - s],
                    c = TN[1 - s];
                a && pd("horizontal", r, e.get("selectorItemGap", !0));
                var h = e.get("selectorButtonGap", !0), f = r.getBoundingRect(), g = [-f.x, -f.y], p = v(i);
                a && (p[l] = i[l] - f[l] - h);
                var m = this._layoutContentAndController(e, n, p, s, l, u, c);
                if (a) {
                    if ("end" === o) g[s] += m[l] + h; else {
                        var y = f[l] + h;
                        g[s] -= y, m[d] -= y
                    }
                    m[l] += f[l] + h, g[1 - s] += m[c] + m[u] / 2 - f[u] / 2, m[u] = Math.max(m[u], f[u]), m[c] = Math.min(m[c], f[c] + g[1 - s]), r.attr("position", g)
                }
                return m
            }, _layoutContentAndController: function (e, t, i, n, a, o, r) {
                var s = this.getContentGroup(), l = this._containerGroup, d = this._controllerGroup;
                pd(e.get("orient"), s, e.get("itemGap"), n ? i.width : null, n ? null : i.height), pd("horizontal", d, e.get("pageButtonItemGap", !0));
                var u = s.getBoundingRect(), c = d.getBoundingRect(), h = this._showController = u[a] > i[a],
                    f = [-u.x, -u.y];
                t || (f[n] = s.position[n]);
                var g = [0, 0], p = [-c.x, -c.y], v = G(e.get("pageButtonGap", !0), e.get("itemGap", !0));
                h && ("end" === e.get("pageButtonPosition", !0) ? p[n] += i[a] - c[a] : g[n] += c[a] + v), p[1 - n] += u[o] / 2 - c[o] / 2, s.attr("position", f), l.attr("position", g), d.attr("position", p);
                var m = {x: 0, y: 0};
                if (m[a] = h ? i[a] : u[a], m[o] = Math.max(u[o], c[o]), m[r] = Math.min(0, c[r] + p[1 - n]), l.__rectSize = i[a], h) {
                    var y = {x: 0, y: 0};
                    y[a] = Math.max(i[a] - c[a] - v, 0), y[o] = m[o], l.setClipPath(new es({shape: y})), l.__rectSize = y[a]
                } else d.eachChild(function (e) {
                    e.attr({invisible: !0, silent: !0})
                });
                var k = this._getPageInfo(e);
                return null != k.pageIndex && ol(s, {position: k.contentPosition}, h && e), this._updatePageInfoView(e, k), m
            }, _pageGo: function (e, t, i) {
                var n = this._getPageInfo(t)[e];
                null != n && i.dispatchAction({type: "legendScroll", scrollDataIndex: n, legendId: t.id})
            }, _updatePageInfoView: function (e, t) {
                var i = this._controllerGroup;
                D(["pagePrev", "pageNext"], function (n) {
                    var a = null != t[n + "DataIndex"], o = i.childOfName(n);
                    o && (o.setStyle("fill", a ? e.get("pageIconColor", !0) : e.get("pageIconInactiveColor", !0)), o.cursor = a ? "pointer" : "default")
                });
                var n = i.childOfName("pageText"), a = e.get("pageFormatter"), o = t.pageIndex,
                    r = null != o ? o + 1 : 0, s = t.pageCount;
                n && a && n.setStyle("text", L(a) ? a.replace("{current}", r).replace("{total}", s) : a({
                    current: r,
                    total: s
                }))
            }, _getPageInfo: function (e) {
                var t = e.get("scrollDataIndex", !0), i = this.getContentGroup(), n = this._containerGroup.__rectSize,
                    a = e.getOrient().index, o = kN[a], r = TN[a], s = this._findTargetItemIndex(t), l = i.children(),
                    d = l[s], u = l.length, c = u ? 1 : 0, h = {
                        contentPosition: i.position.slice(),
                        pageCount: c,
                        pageIndex: c - 1,
                        pagePrevDataIndex: null,
                        pageNextDataIndex: null
                    };
                if (!d) return h;
                var f = y(d);
                h.contentPosition[a] = -f.s;
                for (var g = s + 1, p = f, v = f, m = null; g <= u; ++g) (!(m = y(l[g])) && v.e > p.s + n || m && !k(m, p.s)) && (p = v.i > p.i ? v : m) && (null == h.pageNextDataIndex && (h.pageNextDataIndex = p.i), ++h.pageCount), v = m;
                for (g = s - 1, p = f, v = f, m = null; -1 <= g; --g) (m = y(l[g])) && k(v, m.s) || !(p.i < v.i) || (v = p, null == h.pagePrevDataIndex && (h.pagePrevDataIndex = p.i), ++h.pageCount, ++h.pageIndex), p = m;
                return h;

                function y(e) {
                    if (e) {
                        var t = e.getBoundingRect(), i = t[r] + e.position[a];
                        return {s: i, e: i + t[o], i: e.__legendDataIndex}
                    }
                }

                function k(e, t) {
                    return e.e >= t && e.s <= t + n
                }
            }, _findTargetItemIndex: function (e) {
                return this._showController ? (this.getContentGroup().eachChild(function (n, a) {
                    var o = n.__legendDataIndex;
                    null == i && null != o && (i = a), o === e && (t = a)
                }), null != t ? t : i) : 0;
                var t, i
            }
        });
        ff("legendScroll", "legendscroll", function (e, t) {
            var i = e.scrollDataIndex;
            null != i && t.eachComponent({mainType: "legend", subType: "scroll", query: e}, function (e) {
                e.setScrollDataIndex(i)
            })
        }), DD.extend({
            type: "dataZoom.slider",
            layoutMode: "box",
            defaultOption: {
                show: !0,
                right: "ph",
                top: "ph",
                width: "ph",
                height: "ph",
                left: null,
                bottom: null,
                backgroundColor: "rgba(47,69,84,0)",
                dataBackground: {
                    lineStyle: {color: "#2f4554", width: .5, opacity: .3},
                    areaStyle: {color: "rgba(47,69,84,0.3)", opacity: .3}
                },
                borderColor: "#ddd",
                fillerColor: "rgba(167,183,204,0.4)",
                handleIcon: "M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",
                handleSize: "100%",
                handleStyle: {color: "#a7b7cc"},
                labelPrecision: null,
                labelFormatter: null,
                showDetail: !0,
                showDataShadow: "auto",
                realtime: !0,
                zoomLock: !1,
                textStyle: {color: "#333"}
            }
        });
        var CN = es, SN = Nl, IN = Pl, bN = P, _N = D, DN = "horizontal", AN = "vertical",
            NN = ["line", "bar", "candlestick", "scatter"], xN = xD.extend({
                type: "dataZoom.slider", init: function (e, t) {
                    this._displayables = {}, this._orient, this._range, this._handleEnds, this._size, this._handleWidth, this._handleHeight, this._location, this._dragging, this._dataShadowInfo, this.api = t
                }, render: function (e, t, i, n) {
                    xN.superApply(this, "render", arguments), Ic(this, "_dispatchZoomAction", this.dataZoomModel.get("throttle"), "fixRate"), this._orient = e.get("orient"), !1 !== this.dataZoomModel.get("show") ? (n && "dataZoom" === n.type && n.from === this.uid || this._buildView(), this._updateView()) : this.group.removeAll()
                }, remove: function () {
                    xN.superApply(this, "remove", arguments), bc(this, "_dispatchZoomAction")
                }, dispose: function () {
                    xN.superApply(this, "dispose", arguments), bc(this, "_dispatchZoomAction")
                }, _buildView: function () {
                    var e = this.group;
                    e.removeAll(), this._resetLocation(), this._resetInterval();
                    var t = this._displayables.barGroup = new Ai;
                    this._renderBackground(), this._renderHandle(), this._renderDataShadow(), e.add(t), this._positionGroup()
                }, _resetLocation: function () {
                    var e = this.dataZoomModel, t = this.api, i = this._findCoordRect(),
                        n = {width: t.getWidth(), height: t.getHeight()}, a = this._orient === DN ? {
                            right: n.width - i.x - i.width,
                            top: n.height - 30 - 7,
                            width: i.width,
                            height: 30
                        } : {right: 7, top: i.y, width: 30, height: i.height}, o = kd(e.option);
                    D(["right", "top", "width", "height"], function (e) {
                        "ph" === o[e] && (o[e] = a[e])
                    });
                    var r = vd(o, n, e.padding);
                    this._location = {
                        x: r.x,
                        y: r.y
                    }, this._size = [r.width, r.height], this._orient === AN && this._size.reverse()
                }, _positionGroup: function () {
                    var e = this.group, t = this._location, i = this._orient,
                        n = this.dataZoomModel.getFirstTargetAxisModel(), a = n && n.get("inverse"),
                        o = this._displayables.barGroup, r = (this._dataShadowInfo || {}).otherAxisInverse;
                    o.attr(i !== DN || a ? i === DN && a ? {scale: r ? [-1, 1] : [-1, -1]} : i !== AN || a ? {
                        scale: r ? [-1, -1] : [-1, 1],
                        rotation: Math.PI / 2
                    } : {scale: r ? [1, -1] : [1, 1], rotation: Math.PI / 2} : {scale: r ? [1, 1] : [1, -1]});
                    var s = e.getBoundingRect([o]);
                    e.attr("position", [t.x - s.x, t.y - s.y])
                }, _getViewExtent: function () {
                    return [0, this._size[0]]
                }, _renderBackground: function () {
                    var e = this.dataZoomModel, t = this._size, i = this._displayables.barGroup;
                    i.add(new CN({
                        silent: !0,
                        shape: {x: 0, y: 0, width: t[0], height: t[1]},
                        style: {fill: e.get("backgroundColor")},
                        z2: -40
                    })), i.add(new CN({
                        shape: {x: 0, y: 0, width: t[0], height: t[1]},
                        style: {fill: "transparent"},
                        z2: 0,
                        onclick: P(this._onClickPanelClick, this)
                    }))
                }, _renderDataShadow: function () {
                    var e = this._dataShadowInfo = this._prepareDataShadowInfo();
                    if (e) {
                        var t = this._size, i = e.series, n = i.getRawData(),
                            a = i.getShadowDim ? i.getShadowDim() : e.otherDim;
                        if (null != a) {
                            var o = n.getDataExtent(a), r = .3 * (o[1] - o[0]);
                            o = [o[0] - r, o[1] + r];
                            var s, l = [0, t[1]], d = [0, t[0]], u = [[t[0], 0], [0, 0]], c = [],
                                h = d[1] / (n.count() - 1), f = 0, g = Math.round(n.count() / t[0]);
                            n.each([a], function (e, t) {
                                if (0 < g && t % g) f += h; else {
                                    var i = null == e || isNaN(e) || "" === e, n = i ? 0 : SN(e, o, l, !0);
                                    i && !s && t ? (u.push([u[u.length - 1][0], 0]), c.push([c[c.length - 1][0], 0])) : !i && s && (u.push([f, 0]), c.push([f, 0])), u.push([f, n]), c.push([f, n]), f += h, s = i
                                }
                            });
                            var p = this.dataZoomModel;
                            this._displayables.barGroup.add(new Xr({
                                shape: {points: u},
                                style: T({fill: p.get("dataBackgroundColor")}, p.getModel("dataBackground.areaStyle").getAreaStyle()),
                                silent: !0,
                                z2: -20
                            })), this._displayables.barGroup.add(new $r({
                                shape: {points: c},
                                style: p.getModel("dataBackground.lineStyle").getLineStyle(),
                                silent: !0,
                                z2: -19
                            }))
                        }
                    }
                }, _prepareDataShadowInfo: function () {
                    var e = this.dataZoomModel, t = e.get("showDataShadow");
                    if (!1 !== t) {
                        var i, n = this.ecModel;
                        return e.eachTargetAxis(function (a, o) {
                            D(e.getAxisProxy(a.name, o).getTargetSeriesModels(), function (e) {
                                if (!(i || !0 !== t && S(NN, e.get("type")) < 0)) {
                                    var r, s = n.getComponent(a.axis, o).axis, l = function (e) {
                                        return {x: "y", y: "x", radius: "angle", angle: "radius"}[e]
                                    }(a.name), d = e.coordinateSystem;
                                    null != l && d.getOtherAxis && (r = d.getOtherAxis(s).inverse), l = e.getData().mapDimension(l), i = {
                                        thisAxis: s,
                                        series: e,
                                        thisDim: a.name,
                                        otherDim: l,
                                        otherAxisInverse: r
                                    }
                                }
                            }, this)
                        }, this), i
                    }
                }, _renderHandle: function () {
                    var e = this._displayables, t = e.handles = [], i = e.handleLabels = [],
                        n = this._displayables.barGroup, a = this._size, o = this.dataZoomModel;
                    n.add(e.filler = new CN({
                        draggable: !0,
                        cursor: EN(this._orient),
                        drift: bN(this._onDragMove, this, "all"),
                        ondragstart: bN(this._showDataInfo, this, !0),
                        ondragend: bN(this._onDragEnd, this),
                        onmouseover: bN(this._showDataInfo, this, !0),
                        onmouseout: bN(this._showDataInfo, this, !1),
                        style: {fill: o.get("fillerColor"), textPosition: "inside"}
                    })), n.add(new CN({
                        silent: !0,
                        subPixelOptimize: !0,
                        shape: {x: 0, y: 0, width: a[0], height: a[1]},
                        style: {
                            stroke: o.get("dataBackgroundColor") || o.get("borderColor"),
                            lineWidth: 1,
                            fill: "rgba(0,0,0,0)"
                        }
                    })), _N([0, 1], function (e) {
                        var a = hl(o.get("handleIcon"), {
                            cursor: EN(this._orient),
                            draggable: !0,
                            drift: bN(this._onDragMove, this, e),
                            ondragend: bN(this._onDragEnd, this),
                            onmouseover: bN(this._showDataInfo, this, !0),
                            onmouseout: bN(this._showDataInfo, this, !1)
                        }, {x: -1, y: 0, width: 2, height: 2}), r = a.getBoundingRect();
                        this._handleHeight = xl(o.get("handleSize"), this._size[1]), this._handleWidth = r.width / r.height * this._handleHeight, a.setStyle(o.getModel("handleStyle").getItemStyle());
                        var s = o.get("handleColor");
                        null != s && (a.style.fill = s), n.add(t[e] = a);
                        var l = o.textStyleModel;
                        this.group.add(i[e] = new Ur({
                            silent: !0,
                            invisible: !0,
                            style: {
                                x: 0,
                                y: 0,
                                text: "",
                                textVerticalAlign: "middle",
                                textAlign: "center",
                                textFill: l.getTextColor(),
                                textFont: l.getFont()
                            },
                            z2: 10
                        }))
                    }, this)
                }, _resetInterval: function () {
                    var e = this._range = this.dataZoomModel.getPercentRange(), t = this._getViewExtent();
                    this._handleEnds = [SN(e[0], [0, 100], t, !0), SN(e[1], [0, 100], t, !0)]
                }, _updateInterval: function (e, t) {
                    var i = this.dataZoomModel, n = this._handleEnds, a = this._getViewExtent(),
                        o = i.findRepresentativeAxisProxy().getMinMaxSpan(), r = [0, 100];
                    Ew(t, n, a, i.get("zoomLock") ? "all" : e, null != o.minSpan ? SN(o.minSpan, r, a, !0) : null, null != o.maxSpan ? SN(o.maxSpan, r, a, !0) : null);
                    var s = this._range, l = this._range = IN([SN(n[0], a, r, !0), SN(n[1], a, r, !0)]);
                    return !s || s[0] !== l[0] || s[1] !== l[1]
                }, _updateView: function (e) {
                    var t = this._displayables, i = this._handleEnds, n = IN(i.slice()), a = this._size;
                    _N([0, 1], function (e) {
                        var n = t.handles[e], o = this._handleHeight;
                        n.attr({scale: [o / 2, o / 2], position: [i[e], a[1] / 2 - o / 2]})
                    }, this), t.filler.setShape({x: n[0], y: 0, width: n[1] - n[0], height: a[1]}), this._updateDataInfo(e)
                }, _updateDataInfo: function (e) {
                    var t = this.dataZoomModel, i = this._displayables, n = i.handleLabels, a = this._orient, o = ["", ""];
                    if (t.get("showDetail")) {
                        var r = t.findRepresentativeAxisProxy();
                        if (r) {
                            var s = r.getAxisModel().axis, l = this._range, d = e ? r.calculateDataWindow({
                                start: l[0],
                                end: l[1]
                            }).valueWindow : r.getDataValueWindow();
                            o = [this._formatLabel(d[0], s), this._formatLabel(d[1], s)]
                        }
                    }
                    var u = IN(this._handleEnds.slice());

                    function c(e) {
                        var t = sl(i.handles[e].parent, this.group), r = dl(0 === e ? "right" : "left", t),
                            s = this._handleWidth / 2 + 5, l = ll([u[e] + (0 === e ? -s : s), this._size[1] / 2], t);
                        n[e].setStyle({
                            x: l[0],
                            y: l[1],
                            textVerticalAlign: a === DN ? "middle" : r,
                            textAlign: a === DN ? r : "center",
                            text: o[e]
                        })
                    }

                    c.call(this, 0), c.call(this, 1)
                }, _formatLabel: function (e, t) {
                    var i = this.dataZoomModel, n = i.get("labelFormatter"), a = i.get("labelPrecision");
                    null != a && "auto" !== a || (a = t.getPixelPrecision());
                    var o = null == e || isNaN(e) ? "" : "category" === t.type || "time" === t.type ? t.scale.getLabel(Math.round(e)) : e.toFixed(Math.min(a, 20));
                    return F(n) ? n(e, o) : L(n) ? n.replace("{value}", o) : o
                }, _showDataInfo: function (e) {
                    e = this._dragging || e;
                    var t = this._displayables.handleLabels;
                    t[0].attr("invisible", !e), t[1].attr("invisible", !e)
                }, _onDragMove: function (e, t, i, n) {
                    this._dragging = !0, je(n.event);
                    var a = ll([t, i], this._displayables.barGroup.getLocalTransform(), !0),
                        o = this._updateInterval(e, a[0]), r = this.dataZoomModel.get("realtime");
                    this._updateView(!r), o && r && this._dispatchZoomAction()
                }, _onDragEnd: function () {
                    this._dragging = !1, this._showDataInfo(!1), this.dataZoomModel.get("realtime") || this._dispatchZoomAction()
                }, _onClickPanelClick: function (e) {
                    var t = this._size, i = this._displayables.barGroup.transformCoordToLocal(e.offsetX, e.offsetY);
                    if (!(i[0] < 0 || i[0] > t[0] || i[1] < 0 || i[1] > t[1])) {
                        var n = this._handleEnds, a = (n[0] + n[1]) / 2, o = this._updateInterval("all", i[0] - a);
                        this._updateView(), o && this._dispatchZoomAction()
                    }
                }, _dispatchZoomAction: function () {
                    var e = this._range;
                    this.api.dispatchAction({
                        type: "dataZoom",
                        from: this.uid,
                        dataZoomId: this.dataZoomModel.id,
                        start: e[0],
                        end: e[1]
                    })
                }, _findCoordRect: function () {
                    var e;
                    if (_N(this.getTargetCoordInfo(), function (t) {
                        if (!e && t.length) {
                            var i = t[0].model.coordinateSystem;
                            e = i.getRect && i.getRect()
                        }
                    }), !e) {
                        var t = this.api.getWidth(), i = this.api.getHeight();
                        e = {x: .2 * t, y: .2 * i, width: .6 * t, height: .6 * i}
                    }
                    return e
                }
            });

        function EN(e) {
            return "vertical" === e ? "ns-resize" : "ew-resize"
        }

        DD.extend({
            type: "dataZoom.inside",
            defaultOption: {
                disabled: !1,
                zoomLock: !1,
                zoomOnMouseWheel: !0,
                moveOnMouseMove: !0,
                moveOnMouseWheel: !1,
                preventDefaultMouseMove: !0
            }
        });
        var PN = "\0_ec_dataZoom_roams";

        function ON(e) {
            return e.type + "\0_" + e.id
        }

        function MN(e) {
            var t = e.getZr();
            return t[PN] || (t[PN] = {})
        }

        function FN(e) {
            D(e, function (t, i) {
                t.count || (t.controller.dispose(), delete e[i])
            })
        }

        function LN(e, t) {
            e.dispatchAction({type: "dataZoom", batch: t})
        }

        var RN = P, BN = xD.extend({
            type: "dataZoom.inside", init: function (e, t) {
                this._range
            }, render: function (e, t, i, n) {
                BN.superApply(this, "render", arguments), this._range = e.getPercentRange(), D(this.getTargetCoordInfo(), function (t, n) {
                    var a = A(t, function (e) {
                        return ON(e.model)
                    });
                    D(t, function (t) {
                        var o = t.model, r = {};
                        D(["pan", "zoom", "scrollMove"], function (e) {
                            r[e] = RN(UN[e], this, t, n)
                        }, this), function (e, t) {
                            var i = MN(e), n = t.dataZoomId, a = t.coordId;
                            D(i, function (e, i) {
                                var o = e.dataZoomInfos;
                                o[n] && S(t.allCoordIds, a) < 0 && (delete o[n], e.count--)
                            }), FN(i);
                            var o = i[a];
                            o || ((o = i[a] = {coordId: a, dataZoomInfos: {}, count: 0}).controller = function (e, t) {
                                var i = new Sy(e.getZr());
                                return D(["pan", "zoom", "scrollMove"], function (e) {
                                    i.on(e, function (i) {
                                        var n = [];
                                        D(t.dataZoomInfos, function (a) {
                                            if (i.isAvailableBehavior(a.dataZoomModel.option)) {
                                                var o = (a.getRange || {})[e], r = o && o(t.controller, i);
                                                !a.dataZoomModel.get("disabled", !0) && r && n.push({
                                                    dataZoomId: a.dataZoomId,
                                                    start: r[0],
                                                    end: r[1]
                                                })
                                            }
                                        }), n.length && t.dispatchAction(n)
                                    })
                                }), i
                            }(e, o), o.dispatchAction = O(LN, e)), o.dataZoomInfos[n] || o.count++, o.dataZoomInfos[n] = t;
                            var r = function (e) {
                                var t, i = {type_true: 2, type_move: 1, type_false: 0, type_undefined: -1}, n = !0;
                                return D(e, function (e) {
                                    var a = e.dataZoomModel,
                                        o = !a.get("disabled", !0) && (!a.get("zoomLock", !0) || "move");
                                    i["type_" + t] < i["type_" + o] && (t = o), n &= a.get("preventDefaultMouseMove", !0)
                                }), {
                                    controlType: t,
                                    opt: {
                                        zoomOnMouseWheel: !0,
                                        moveOnMouseMove: !0,
                                        moveOnMouseWheel: !0,
                                        preventDefaultMouseMove: !!n
                                    }
                                }
                            }(o.dataZoomInfos);
                            o.controller.enable(r.controlType, r.opt), o.controller.setPointerChecker(t.containsPoint), Ic(o, "dispatchAction", t.dataZoomModel.get("throttle", !0), "fixRate")
                        }(i, {
                            coordId: ON(o), allCoordIds: a, containsPoint: function (e, t, i) {
                                return o.coordinateSystem.containPoint([t, i])
                            }, dataZoomId: e.id, dataZoomModel: e, getRange: r
                        })
                    }, this)
                }, this)
            }, dispose: function () {
                var e, t, i;
                e = this.api, t = this.dataZoomModel.id, D(i = MN(e), function (e) {
                    e.controller.dispose();
                    var i = e.dataZoomInfos;
                    i[t] && (delete i[t], e.count--)
                }), FN(i), BN.superApply(this, "dispose", arguments), this._range = null
            }
        }), UN = {
            zoom: function (e, t, i, n) {
                var a = this._range, o = a.slice(), r = e.axisModels[0];
                if (r) {
                    var s = WN[t](null, [n.originX, n.originY], r, i, e),
                        l = (0 < s.signal ? s.pixelStart + s.pixelLength - s.pixel : s.pixel - s.pixelStart) / s.pixelLength * (o[1] - o[0]) + o[0],
                        d = Math.max(1 / n.scale, 0);
                    o[0] = (o[0] - l) * d + l, o[1] = (o[1] - l) * d + l;
                    var u = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
                    return Ew(0, o, [0, 100], 0, u.minSpan, u.maxSpan), this._range = o, a[0] !== o[0] || a[1] !== o[1] ? o : void 0
                }
            }, pan: KN(function (e, t, i, n, a, o) {
                var r = WN[n]([o.oldX, o.oldY], [o.newX, o.newY], t, a, i);
                return r.signal * (e[1] - e[0]) * r.pixel / r.pixelLength
            }), scrollMove: KN(function (e, t, i, n, a, o) {
                return WN[n]([0, 0], [o.scrollDelta, o.scrollDelta], t, a, i).signal * (e[1] - e[0]) * o.scrollDelta
            })
        };

        function KN(e) {
            return function (t, i, n, a) {
                var o = this._range, r = o.slice(), s = t.axisModels[0];
                if (s) {
                    var l = e(r, s, t, i, n, a);
                    return Ew(l, r, [0, 100], "all"), this._range = r, o[0] !== r[0] || o[1] !== r[1] ? r : void 0
                }
            }
        }

        function VN(e) {
            var t = e && e.visualMap;
            M(t) || (t = t ? [t] : []), GN(t, function (e) {
                if (e) {
                    HN(e, "splitList") && !HN(e, "pieces") && (e.pieces = e.splitList, delete e.splitList);
                    var t = e.pieces;
                    t && M(t) && GN(t, function (e) {
                        R(e) && (HN(e, "start") && !HN(e, "min") && (e.min = e.start), HN(e, "end") && !HN(e, "max") && (e.max = e.end))
                    })
                }
            })
        }

        var WN = {
            grid: function (e, t, i, n, a) {
                var o = i.axis, r = {}, s = a.model.coordinateSystem.getRect();
                return e = e || [0, 0], "x" === o.dim ? (r.pixel = t[0] - e[0], r.pixelLength = s.width, r.pixelStart = s.x, r.signal = o.inverse ? 1 : -1) : (r.pixel = t[1] - e[1], r.pixelLength = s.height, r.pixelStart = s.y, r.signal = o.inverse ? -1 : 1), r
            }, polar: function (e, t, i, n, a) {
                var o = i.axis, r = {}, s = a.model.coordinateSystem, l = s.getRadiusAxis().getExtent(),
                    d = s.getAngleAxis().getExtent();
                return e = e ? s.pointToCoord(e) : [0, 0], t = s.pointToCoord(t), "radiusAxis" === i.mainType ? (r.pixel = t[0] - e[0], r.pixelLength = l[1] - l[0], r.pixelStart = l[0], r.signal = o.inverse ? 1 : -1) : (r.pixel = t[1] - e[1], r.pixelLength = d[1] - d[0], r.pixelStart = d[0], r.signal = o.inverse ? -1 : 1), r
            }, singleAxis: function (e, t, i, n, a) {
                var o = i.axis, r = a.model.coordinateSystem.getRect(), s = {};
                return e = e || [0, 0], "horizontal" === o.orient ? (s.pixel = t[0] - e[0], s.pixelLength = r.width, s.pixelStart = r.x, s.signal = o.inverse ? 1 : -1) : (s.pixel = t[1] - e[1], s.pixelLength = r.height, s.pixelStart = r.y, s.signal = o.inverse ? -1 : 1), s
            }
        }, GN = D;

        function HN(e, t) {
            return e && e.hasOwnProperty && e.hasOwnProperty(t)
        }

        bd.registerSubTypeDefaulter("visualMap", function (e) {
            return e.categories || (e.pieces ? 0 < e.pieces.length : 0 < e.splitNumber) && !e.calculable ? "piecewise" : "continuous"
        });
        var zN = Sh.VISUAL.COMPONENT;

        function jN(e, t, i, n) {
            for (var a = t.targetVisuals[n], o = Jk.prepareVisualTypes(a), r = {color: e.getData().getVisual("color")}, s = 0, l = o.length; s < l; s++) {
                var d = o[s], u = a["opacity" === d ? "__alphaForOpacity" : d];
                u && u.applyVisual(i, c, h)
            }
            return r.color;

            function c(e) {
                return r[e]
            }

            function h(e, t) {
                r[e] = t
            }
        }

        vf(zN, {
            createOnAllSeries: !0, reset: function (e, t) {
                var i = [];
                return t.eachComponent("visualMap", function (t) {
                    var n = e.pipelineContext;
                    !t.isTargetSeries(e) || n && n.large || i.push(function (e, t, i, n) {
                        var a = {};
                        return D(e, function (e) {
                            var i = Jk.prepareVisualTypes(t[e]);
                            a[e] = i
                        }), {
                            progress: function (e, o) {
                                function r(e) {
                                    return o.getItemVisual(l, e)
                                }

                                function s(e, t) {
                                    o.setItemVisual(l, e, t)
                                }

                                var l;
                                for (null != n && (n = o.getDimension(n)); null != (l = e.next());) {
                                    var d = o.getRawDataItem(l);
                                    if (!d || !1 !== d.visualMap) for (var u = null != n ? o.get(n, l, !0) : l, c = i(u), h = t[c], f = a[c], g = 0, p = f.length; g < p; g++) {
                                        var v = f[g];
                                        h[v] && h[v].applyVisual(u, r, s)
                                    }
                                }
                            }
                        }
                    }(t.stateList, t.targetVisuals, P(t.getValueState, t), t.getDataDimension(e.getData())))
                }), i
            }
        }), vf(zN, {
            createOnAllSeries: !0, reset: function (e, t) {
                var i = e.getData(), n = [];
                t.eachComponent("visualMap", function (t) {
                    if (t.isTargetSeries(e)) {
                        var a = t.getVisualMeta(P(jN, null, e, t)) || {stops: [], outerColors: []},
                            o = t.getDataDimension(i), r = i.getDimensionInfo(o);
                        null != r && (a.dimension = r.index, n.push(a))
                    }
                }), e.getData().setVisual("visualMeta", n)
            }
        });
        var XN = function (e, t, i) {
            var n = v(($N[e] || {})[t]);
            return i && M(n) ? n[n.length - 1] : n
        }, $N = {
            color: {active: ["#006edd", "#e0ffff"], inactive: ["rgba(0,0,0,0)"]},
            colorHue: {active: [0, 360], inactive: [0, 0]},
            colorSaturation: {active: [.3, 1], inactive: [0, 0]},
            colorLightness: {active: [.9, .5], inactive: [0, 0]},
            colorAlpha: {active: [.3, 1], inactive: [0, 0]},
            opacity: {active: [.3, 1], inactive: [0, 0]},
            symbol: {active: ["circle", "roundRect", "diamond"], inactive: ["none"]},
            symbolSize: {active: [10, 50], inactive: [0, 0]}
        }, YN = Jk.mapVisual, qN = Jk.eachVisual, JN = M, ZN = D, QN = Pl, ex = Nl, tx = kf({
            type: "visualMap",
            dependencies: ["series"],
            stateList: ["inRange", "outOfRange"],
            replacableOptionKeys: ["inRange", "outOfRange", "target", "controller", "color"],
            dataBound: [-1 / 0, 1 / 0],
            layoutMode: {type: "box", ignoreSize: !0},
            defaultOption: {
                show: !0,
                zlevel: 0,
                z: 4,
                seriesIndex: "all",
                min: 0,
                max: 200,
                dimension: null,
                inRange: null,
                outOfRange: null,
                left: 0,
                right: null,
                top: null,
                bottom: 0,
                itemWidth: null,
                itemHeight: null,
                inverse: !1,
                orient: "vertical",
                backgroundColor: "rgba(0,0,0,0)",
                borderColor: "#ccc",
                contentColor: "#5793f3",
                inactiveColor: "#aaa",
                borderWidth: 0,
                padding: 5,
                textGap: 10,
                precision: 0,
                color: null,
                formatter: null,
                text: null,
                textStyle: {color: "#333"}
            },
            init: function (e, t, i) {
                this._dataExtent, this.targetVisuals = {}, this.controllerVisuals = {}, this.textStyleModel, this.itemSize, this.mergeDefaultAndTheme(e, i)
            },
            optionUpdated: function (e, t) {
                var i = this.option;
                a.canvasSupported || (i.realtime = !1), t || iA(i, e, this.replacableOptionKeys), this.textStyleModel = this.getModel("textStyle"), this.resetItemSize(), this.completeVisualOption()
            },
            resetVisual: function (e) {
                var t = this.stateList;
                e = P(e, this), this.controllerVisuals = tA(this.option.controller, t, e), this.targetVisuals = tA(this.option.target, t, e)
            },
            getTargetSeriesIndices: function () {
                var e = this.option.seriesIndex, t = [];
                return null == e || "all" === e ? this.ecModel.eachSeries(function (e, i) {
                    t.push(i)
                }) : t = Pa(e), t
            },
            eachTargetSeries: function (e, t) {
                D(this.getTargetSeriesIndices(), function (i) {
                    e.call(t, this.ecModel.getSeriesByIndex(i))
                }, this)
            },
            isTargetSeries: function (e) {
                var t = !1;
                return this.eachTargetSeries(function (i) {
                    i === e && (t = !0)
                }), t
            },
            formatValueText: function (e, t, i) {
                var n, a, o = this.option, r = o.precision, s = this.dataBound, l = o.formatter;
                return i = i || ["<", ">"], M(e) && (e = e.slice(), n = !0), a = t ? e : n ? [d(e[0]), d(e[1])] : d(e), L(l) ? l.replace("{value}", n ? a[0] : a).replace("{value2}", n ? a[1] : a) : F(l) ? n ? l(e[0], e[1]) : l(e) : n ? e[0] === s[0] ? i[0] + " " + a[1] : e[1] === s[1] ? i[1] + " " + a[0] : a[0] + " - " + a[1] : a;

                function d(e) {
                    return e === s[0] ? "min" : e === s[1] ? "max" : (+e).toFixed(Math.min(r, 20))
                }
            },
            resetExtent: function () {
                var e = this.option, t = QN([e.min, e.max]);
                this._dataExtent = t
            },
            getDataDimension: function (e) {
                var t = this.option.dimension, i = e.dimensions;
                if (null != t || i.length) {
                    if (null != t) return e.getDimension(t);
                    for (var n = e.dimensions, a = n.length - 1; 0 <= a; a--) {
                        var o = n[a];
                        if (!e.getDimensionInfo(o).isCalculationCoord) return o
                    }
                }
            },
            getExtent: function () {
                return this._dataExtent.slice()
            },
            completeVisualOption: function () {
                var e = this.ecModel, t = this.option, i = {inRange: t.inRange, outOfRange: t.outOfRange},
                    n = t.target || (t.target = {}), a = t.controller || (t.controller = {});
                m(n, i), m(a, i);
                var o = this.isCategory();

                function r(i) {
                    JN(t.color) && !i.inRange && (i.inRange = {color: t.color.slice().reverse()}), i.inRange = i.inRange || {color: e.get("gradientColor")}, ZN(this.stateList, function (e) {
                        var t = i[e];
                        if (L(t)) {
                            var n = XN(t, "active", o);
                            n ? (i[e] = {}, i[e][t] = n) : delete i[e]
                        }
                    }, this)
                }

                r.call(this, n), r.call(this, a), function (e, t, i) {
                    var n = e[t], a = e[i];
                    n && !a && (a = e[i] = {}, ZN(n, function (e, t) {
                        if (Jk.isValidType(t)) {
                            var i = XN(t, "inactive", o);
                            null != i && (a[t] = i, "color" !== t || a.hasOwnProperty("opacity") || a.hasOwnProperty("colorAlpha") || (a.opacity = [0, 0]))
                        }
                    }))
                }.call(this, n, "inRange", "outOfRange"), function (e) {
                    var t = (e.inRange || {}).symbol || (e.outOfRange || {}).symbol,
                        i = (e.inRange || {}).symbolSize || (e.outOfRange || {}).symbolSize,
                        n = this.get("inactiveColor");
                    ZN(this.stateList, function (a) {
                        var r = this.itemSize, s = e[a];
                        null == (s = s || (e[a] = {color: o ? n : [n]})).symbol && (s.symbol = t && v(t) || (o ? "roundRect" : ["roundRect"])), null == s.symbolSize && (s.symbolSize = i && v(i) || (o ? r[0] : [r[0], r[0]])), s.symbol = YN(s.symbol, function (e) {
                            return "none" === e || "square" === e ? "roundRect" : e
                        });
                        var l = s.symbolSize;
                        if (null != l) {
                            var d = -1 / 0;
                            qN(l, function (e) {
                                d < e && (d = e)
                            }), s.symbolSize = YN(l, function (e) {
                                return ex(e, [0, d], [0, r[0]], !0)
                            })
                        }
                    }, this)
                }.call(this, a)
            },
            resetItemSize: function () {
                this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))]
            },
            isCategory: function () {
                return !!this.option.categories
            },
            setSelected: te,
            getValueState: te,
            getVisualMeta: te
        }), ix = [20, 140], nx = tx.extend({
            type: "visualMap.continuous",
            defaultOption: {
                align: "auto",
                calculable: !1,
                range: null,
                realtime: !0,
                itemHeight: null,
                itemWidth: null,
                hoverLink: !0,
                hoverLinkDataSize: null,
                hoverLinkOnHandle: null
            },
            optionUpdated: function (e, t) {
                nx.superApply(this, "optionUpdated", arguments), this.resetExtent(), this.resetVisual(function (e) {
                    e.mappingMethod = "linear", e.dataExtent = this.getExtent()
                }), this._resetRange()
            },
            resetItemSize: function () {
                nx.superApply(this, "resetItemSize", arguments);
                var e = this.itemSize;
                "horizontal" === this._orient && e.reverse(), null != e[0] && !isNaN(e[0]) || (e[0] = ix[0]), null != e[1] && !isNaN(e[1]) || (e[1] = ix[1])
            },
            _resetRange: function () {
                var e = this.getExtent(), t = this.option.range;
                !t || t.auto ? (e.auto = 1, this.option.range = e) : M(t) && (t[0] > t[1] && t.reverse(), t[0] = Math.max(t[0], e[0]), t[1] = Math.min(t[1], e[1]))
            },
            completeVisualOption: function () {
                tx.prototype.completeVisualOption.apply(this, arguments), D(this.stateList, function (e) {
                    var t = this.option.controller[e].symbolSize;
                    t && t[0] !== t[1] && (t[0] = 0)
                }, this)
            },
            setSelected: function (e) {
                this.option.range = e.slice(), this._resetRange()
            },
            getSelected: function () {
                var e = this.getExtent(), t = Pl((this.get("range") || []).slice());
                return t[0] > e[1] && (t[0] = e[1]), t[1] > e[1] && (t[1] = e[1]), t[0] < e[0] && (t[0] = e[0]), t[1] < e[0] && (t[1] = e[0]), t
            },
            getValueState: function (e) {
                var t = this.option.range, i = this.getExtent();
                return (t[0] <= i[0] || t[0] <= e) && (t[1] >= i[1] || e <= t[1]) ? "inRange" : "outOfRange"
            },
            findTargetDataIndices: function (e) {
                var t = [];
                return this.eachTargetSeries(function (i) {
                    var n = [], a = i.getData();
                    a.each(this.getDataDimension(a), function (t, i) {
                        e[0] <= t && t <= e[1] && n.push(i)
                    }, this), t.push({seriesId: i.id, dataIndex: n})
                }, this), t
            },
            getVisualMeta: function (e) {
                var t = ax(0, 0, this.getExtent()), i = ax(0, 0, this.option.range.slice()), n = [];

                function a(t, i) {
                    n.push({value: t, color: e(t, i)})
                }

                for (var o = 0, r = 0, s = i.length, l = t.length; r < l && (!i.length || t[r] <= i[0]); r++) t[r] < i[o] && a(t[r], "outOfRange");
                for (var d = 1; o < s; o++, d = 0) d && n.length && a(i[o], "outOfRange"), a(i[o], "inRange");
                for (d = 1; r < l; r++) (!i.length || i[i.length - 1] < t[r]) && (d && (n.length && a(n[n.length - 1].value, "outOfRange"), d = 0), a(t[r], "outOfRange"));
                var u = n.length;
                return {stops: n, outerColors: [u ? n[0].color : "transparent", u ? n[u - 1].color : "transparent"]}
            }
        });

        function ax(e, t, i) {
            if (i[0] === i[1]) return i.slice();
            for (var n = (i[1] - i[0]) / 200, a = i[0], o = [], r = 0; r <= 200 && a < i[1]; r++) o.push(a), a += n;
            return o.push(i[1]), o
        }

        var ox = Tf({
            type: "visualMap", autoPositionValues: {left: 1, right: 1, top: 1, bottom: 1}, init: function (e, t) {
                this.ecModel = e, this.api = t, this.visualMapModel
            }, render: function (e, t, i, n) {
                !1 !== (this.visualMapModel = e).get("show") ? this.doRender.apply(this, arguments) : this.group.removeAll()
            }, renderBackground: function (e) {
                var t = this.visualMapModel, i = ql(t.get("padding") || 0), n = e.getBoundingRect();
                e.add(new es({
                    z2: -1,
                    silent: !0,
                    shape: {x: n.x - i[3], y: n.y - i[0], width: n.width + i[3] + i[1], height: n.height + i[0] + i[2]},
                    style: {
                        fill: t.get("backgroundColor"),
                        stroke: t.get("borderColor"),
                        lineWidth: t.get("borderWidth")
                    }
                }))
            }, getControllerVisual: function (e, t, i) {
                var n = (i = i || {}).forceState, a = this.visualMapModel, o = {};
                if ("symbol" === t && (o.symbol = a.get("itemSymbol")), "color" === t) {
                    var r = a.get("contentColor");
                    o.color = r
                }

                function s(e) {
                    return o[e]
                }

                function l(e, t) {
                    o[e] = t
                }

                var d = a.controllerVisuals[n || a.getValueState(e)];
                return D(Jk.prepareVisualTypes(d), function (n) {
                    var a = d[n];
                    i.convertOpacityToAlpha && "opacity" === n && (n = "colorAlpha", a = d.__alphaForOpacity), Jk.dependsOn(n, t) && a && a.applyVisual(e, s, l)
                }), o[t]
            }, positionGroup: function (e) {
                var t = this.visualMapModel, i = this.api;
                md(e, t.getBoxLayoutParams(), {width: i.getWidth(), height: i.getHeight()})
            }, doRender: te
        });

        function rx(e, t, i) {
            var n = e.option, a = n.align;
            if (null != a && "auto" !== a) return a;
            for (var o = {
                width: t.getWidth(),
                height: t.getHeight()
            }, r = "horizontal" === n.orient ? 1 : 0, s = [["left", "right", "width"], ["top", "bottom", "height"]], l = s[r], d = [0, null, 10], u = {}, c = 0; c < 3; c++) u[s[1 - r][c]] = d[c], u[l[c]] = 2 === c ? i[0] : n[l[c]];
            var h = [["x", "width", 3], ["y", "height", 0]][r], f = vd(u, o, n.padding);
            return l[(f.margin[h[2]] || 0) + f[h[0]] + .5 * f[h[1]] < .5 * o[h[1]] ? 0 : 1]
        }

        function sx(e, t) {
            return D(e || [], function (e) {
                null != e.dataIndex && (e.dataIndexInside = e.dataIndex, e.dataIndex = null), e.highlightKey = "visualMap" + (t ? t.componentIndex : "")
            }), e
        }

        var lx = Nl, dx = D, ux = Math.min, cx = Math.max, hx = ox.extend({
            type: "visualMap.continuous", init: function () {
                hx.superApply(this, "init", arguments), this._shapes = {}, this._dataInterval = [], this._handleEnds = [], this._orient, this._useHandle, this._hoverLinkDataIndices = [], this._dragging, this._hovering
            }, doRender: function (e, t, i, n) {
                n && "selectDataRange" === n.type && n.from === this.uid || this._buildView()
            }, _buildView: function () {
                this.group.removeAll();
                var e = this.visualMapModel, t = this.group;
                this._orient = e.get("orient"), this._useHandle = e.get("calculable"), this._resetInterval(), this._renderBar(t);
                var i = e.get("text");
                this._renderEndsText(t, i, 0), this._renderEndsText(t, i, 1), this._updateView(!0), this.renderBackground(t), this._updateView(), this._enableHoverLinkToSeries(), this._enableHoverLinkFromSeries(), this.positionGroup(t)
            }, _renderEndsText: function (e, t, i) {
                if (t) {
                    var n = t[1 - i];
                    n = null != n ? n + "" : "";
                    var a = this.visualMapModel, o = a.get("textGap"), r = a.itemSize, s = this._shapes.barGroup,
                        l = this._applyTransform([r[0] / 2, 0 === i ? -o : r[1] + o], s),
                        d = this._applyTransform(0 === i ? "bottom" : "top", s), u = this._orient,
                        c = this.visualMapModel.textStyleModel;
                    this.group.add(new Ur({
                        style: {
                            x: l[0],
                            y: l[1],
                            textVerticalAlign: "horizontal" === u ? "middle" : d,
                            textAlign: "horizontal" === u ? d : "center",
                            text: n,
                            textFont: c.getFont(),
                            textFill: c.getTextColor()
                        }
                    }))
                }
            }, _renderBar: function (e) {
                var t = this.visualMapModel, i = this._shapes, n = t.itemSize, a = this._orient, o = this._useHandle,
                    r = rx(t, this.api, n), s = i.barGroup = this._createBarGroup(r);
                s.add(i.outOfRange = fx()), s.add(i.inRange = fx(null, o ? px(this._orient) : null, P(this._dragHandle, this, "all", !1), P(this._dragHandle, this, "all", !0)));
                var l = t.textStyleModel.getTextRect("国"), d = cx(l.width, l.height);
                o && (i.handleThumbs = [], i.handleLabels = [], i.handleLabelPoints = [], this._createHandle(s, 0, n, d, a, r), this._createHandle(s, 1, n, d, a, r)), this._createIndicator(s, n, d, a), e.add(s)
            }, _createHandle: function (e, t, i, n, a) {
                var o = P(this._dragHandle, this, t, !1), r = P(this._dragHandle, this, t, !0), s = fx(function (e, t) {
                    return 0 === e ? [[0, 0], [t, 0], [t, -t]] : [[0, 0], [t, 0], [t, t]]
                }(t, n), px(this._orient), o, r);
                s.position[0] = i[0], e.add(s);
                var l = this.visualMapModel.textStyleModel, d = new Ur({
                    draggable: !0,
                    drift: o,
                    onmousemove: function (e) {
                        je(e.event)
                    },
                    ondragend: r,
                    style: {x: 0, y: 0, text: "", textFont: l.getFont(), textFill: l.getTextColor()}
                });
                this.group.add(d);
                var u = ["horizontal" === a ? n / 2 : 1.5 * n, "horizontal" === a ? 0 === t ? -1.5 * n : 1.5 * n : 0 === t ? -n / 2 : n / 2],
                    c = this._shapes;
                c.handleThumbs[t] = s, c.handleLabelPoints[t] = u, c.handleLabels[t] = d
            }, _createIndicator: function (e, t, i, n) {
                var a = fx([[0, 0]], "move");
                a.position[0] = t[0], a.attr({invisible: !0, silent: !0}), e.add(a);
                var o = this.visualMapModel.textStyleModel, r = new Ur({
                    silent: !0,
                    invisible: !0,
                    style: {x: 0, y: 0, text: "", textFont: o.getFont(), textFill: o.getTextColor()}
                });
                this.group.add(r);
                var s = ["horizontal" === n ? i / 2 : 9, 0], l = this._shapes;
                l.indicator = a, l.indicatorLabel = r, l.indicatorLabelPoint = s
            }, _dragHandle: function (e, t, i, n) {
                if (this._useHandle) {
                    if (this._dragging = !t, !t) {
                        var a = this._applyTransform([i, n], this._shapes.barGroup, !0);
                        this._updateInterval(e, a[1]), this._updateView()
                    }
                    t === !this.visualMapModel.get("realtime") && this.api.dispatchAction({
                        type: "selectDataRange",
                        from: this.uid,
                        visualMapId: this.visualMapModel.id,
                        selected: this._dataInterval.slice()
                    }), t ? this._hovering || this._clearHoverLinkToSeries() : gx(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[e], !1)
                }
            }, _resetInterval: function () {
                var e = this.visualMapModel, t = this._dataInterval = e.getSelected(), i = e.getExtent(),
                    n = [0, e.itemSize[1]];
                this._handleEnds = [lx(t[0], i, n, !0), lx(t[1], i, n, !0)]
            }, _updateInterval: function (e, t) {
                t = t || 0;
                var i = this.visualMapModel, n = this._handleEnds, a = [0, i.itemSize[1]];
                Ew(t, n, a, e, 0);
                var o = i.getExtent();
                this._dataInterval = [lx(n[0], a, o, !0), lx(n[1], a, o, !0)]
            }, _updateView: function (e) {
                var t = this.visualMapModel, i = t.getExtent(), n = this._shapes, a = [0, t.itemSize[1]],
                    o = e ? a : this._handleEnds, r = this._createBarVisual(this._dataInterval, i, o, "inRange"),
                    s = this._createBarVisual(i, i, a, "outOfRange");
                n.inRange.setStyle({
                    fill: r.barColor,
                    opacity: r.opacity
                }).setShape("points", r.barPoints), n.outOfRange.setStyle({
                    fill: s.barColor,
                    opacity: s.opacity
                }).setShape("points", s.barPoints), this._updateHandle(o, r)
            }, _createBarVisual: function (e, t, i, n) {
                var a = {forceState: n, convertOpacityToAlpha: !0}, o = this._makeColorGradient(e, a),
                    r = [this.getControllerVisual(e[0], "symbolSize", a), this.getControllerVisual(e[1], "symbolSize", a)],
                    s = this._createBarPoints(i, r);
                return {
                    barColor: new ds(0, 0, 0, 1, o),
                    barPoints: s,
                    handlesColor: [o[0].color, o[o.length - 1].color]
                }
            }, _makeColorGradient: function (e, t) {
                var i = [], n = (e[1] - e[0]) / 100;
                i.push({color: this.getControllerVisual(e[0], "color", t), offset: 0});
                for (var a = 1; a < 100; a++) {
                    var o = e[0] + n * a;
                    if (o > e[1]) break;
                    i.push({color: this.getControllerVisual(o, "color", t), offset: a / 100})
                }
                return i.push({color: this.getControllerVisual(e[1], "color", t), offset: 1}), i
            }, _createBarPoints: function (e, t) {
                var i = this.visualMapModel.itemSize;
                return [[i[0] - t[0], e[0]], [i[0], e[0]], [i[0], e[1]], [i[0] - t[1], e[1]]]
            }, _createBarGroup: function (e) {
                var t = this._orient, i = this.visualMapModel.get("inverse");
                return new Ai("horizontal" !== t || i ? "horizontal" === t && i ? {
                    scale: "bottom" === e ? [-1, 1] : [1, 1],
                    rotation: -Math.PI / 2
                } : "vertical" !== t || i ? {scale: "left" === e ? [1, 1] : [-1, 1]} : {scale: "left" === e ? [1, -1] : [-1, -1]} : {
                    scale: "bottom" === e ? [1, 1] : [-1, 1],
                    rotation: Math.PI / 2
                })
            }, _updateHandle: function (e, t) {
                if (this._useHandle) {
                    var i = this._shapes, n = this.visualMapModel, a = i.handleThumbs, o = i.handleLabels;
                    dx([0, 1], function (r) {
                        var s = a[r];
                        s.setStyle("fill", t.handlesColor[r]), s.position[1] = e[r];
                        var l = ll(i.handleLabelPoints[r], sl(s, this.group));
                        o[r].setStyle({
                            x: l[0],
                            y: l[1],
                            text: n.formatValueText(this._dataInterval[r]),
                            textVerticalAlign: "middle",
                            textAlign: this._applyTransform("horizontal" === this._orient ? 0 === r ? "bottom" : "top" : "left", i.barGroup)
                        })
                    }, this)
                }
            }, _showIndicator: function (e, t, i, n) {
                var a = this.visualMapModel, o = a.getExtent(), r = a.itemSize, s = [0, r[1]], l = lx(e, o, s, !0),
                    d = this._shapes, u = d.indicator;
                if (u) {
                    u.position[1] = l, u.attr("invisible", !1), u.setShape("points", function (e, t, i, n) {
                        return e ? [[0, -ux(t, cx(i, 0))], [6, 0], [0, ux(t, cx(n - i, 0))]] : [[0, 0], [5, -5], [5, 5]]
                    }(!!i, n, l, r[1]));
                    var c = this.getControllerVisual(e, "color", {convertOpacityToAlpha: !0});
                    u.setStyle("fill", c);
                    var h = ll(d.indicatorLabelPoint, sl(u, this.group)), f = d.indicatorLabel;
                    f.attr("invisible", !1);
                    var g = this._applyTransform("left", d.barGroup), p = this._orient;
                    f.setStyle({
                        text: (i || "") + a.formatValueText(t),
                        textVerticalAlign: "horizontal" === p ? g : "middle",
                        textAlign: "horizontal" === p ? "center" : g,
                        x: h[0],
                        y: h[1]
                    })
                }
            }, _enableHoverLinkToSeries: function () {
                var e = this;
                this._shapes.barGroup.on("mousemove", function (t) {
                    if (e._hovering = !0, !e._dragging) {
                        var i = e.visualMapModel.itemSize,
                            n = e._applyTransform([t.offsetX, t.offsetY], e._shapes.barGroup, !0, !0);
                        n[1] = ux(cx(0, n[1]), i[1]), e._doHoverLinkToSeries(n[1], 0 <= n[0] && n[0] <= i[0])
                    }
                }).on("mouseout", function () {
                    e._hovering = !1, e._dragging || e._clearHoverLinkToSeries()
                })
            }, _enableHoverLinkFromSeries: function () {
                var e = this.api.getZr();
                this.visualMapModel.option.hoverLink ? (e.on("mouseover", this._hoverLinkFromSeriesMouseOver, this), e.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries()
            }, _doHoverLinkToSeries: function (e, t) {
                var i = this.visualMapModel, n = i.itemSize;
                if (i.option.hoverLink) {
                    var a = [0, n[1]], o = i.getExtent();
                    e = ux(cx(a[0], e), a[1]);
                    var r = function (e, t, i) {
                        var n = 6, a = e.get("hoverLinkDataSize");
                        return a && (n = lx(a, t, i, !0) / 2), n
                    }(i, o, a), s = [e - r, e + r], l = lx(e, a, o, !0), d = [lx(s[0], a, o, !0), lx(s[1], a, o, !0)];
                    s[0] < a[0] && (d[0] = -1 / 0), a[1] < s[1] && (d[1] = 1 / 0), t && (d[0] === -1 / 0 ? this._showIndicator(l, d[1], "< ", r) : d[1] === 1 / 0 ? this._showIndicator(l, d[0], "> ", r) : this._showIndicator(l, l, "≈ ", r));
                    this._hoverLinkDataIndices;
                    var u = [];
                    (t || gx(i)) && (u = this._hoverLinkDataIndices = i.findTargetDataIndices(d));
                    var c = function (e, t) {
                        var i = {}, n = {};
                        return a([], i), a(t || [], n, i), [o(i), o(n)];

                        function a(e, t, i) {
                            for (var n = 0, a = e.length; n < a; n++) for (var o = e[n].seriesId, r = Pa(e[n].dataIndex), s = i && i[o], l = 0, d = r.length; l < d; l++) {
                                var u = r[l];
                                s && s[u] ? s[u] = null : (t[o] || (t[o] = {}))[u] = 1
                            }
                        }

                        function o(e, t) {
                            var i = [];
                            for (var n in e) if (e.hasOwnProperty(n) && null != e[n]) if (t) i.push(+n); else {
                                var a = o(e[n], !0);
                                a.length && i.push({seriesId: n, dataIndex: a})
                            }
                            return i
                        }
                    }(0, u);
                    this._dispatchHighDown("downplay", sx(c[0], i)), this._dispatchHighDown("highlight", sx(c[1], i))
                }
            }, _hoverLinkFromSeriesMouseOver: function (e) {
                var t = e.target, i = this.visualMapModel;
                if (t && null != t.dataIndex) {
                    var n = this.ecModel.getSeriesByIndex(t.seriesIndex);
                    if (i.isTargetSeries(n)) {
                        var a = n.getData(t.dataType), o = a.get(i.getDataDimension(a), t.dataIndex, !0);
                        isNaN(o) || this._showIndicator(o, o)
                    }
                }
            }, _hideIndicator: function () {
                var e = this._shapes;
                e.indicator && e.indicator.attr("invisible", !0), e.indicatorLabel && e.indicatorLabel.attr("invisible", !0)
            }, _clearHoverLinkToSeries: function () {
                this._hideIndicator();
                var e = this._hoverLinkDataIndices;
                this._dispatchHighDown("downplay", sx(e, this.visualMapModel)), e.length = 0
            }, _clearHoverLinkFromSeries: function () {
                this._hideIndicator();
                var e = this.api.getZr();
                e.off("mouseover", this._hoverLinkFromSeriesMouseOver), e.off("mouseout", this._hideIndicator)
            }, _applyTransform: function (e, t, i, n) {
                var a = sl(t, n ? null : this.group);
                return vl[M(e) ? "applyTransform" : "transformDirection"](e, a, i)
            }, _dispatchHighDown: function (e, t) {
                t && t.length && this.api.dispatchAction({type: e, batch: t})
            }, dispose: function () {
                this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries()
            }, remove: function () {
                this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries()
            }
        });

        function fx(e, t, i, n) {
            return new Xr({
                shape: {points: e}, draggable: !!i, cursor: t, drift: i, onmousemove: function (e) {
                    je(e.event)
                }, ondragend: n
            })
        }

        function gx(e) {
            var t = e.get("hoverLinkOnHandle");
            return !!(null == t ? e.get("realtime") : t)
        }

        function px(e) {
            return "vertical" === e ? "ns-resize" : "ew-resize"
        }

        ff({type: "selectDataRange", event: "dataRangeSelected", update: "update"}, function (e, t) {
            t.eachComponent({mainType: "visualMap", query: e}, function (t) {
                t.setSelected(e.selected)
            })
        }), cf(VN);
        var vx = tx.extend({
            type: "visualMap.piecewise",
            defaultOption: {
                selected: null,
                minOpen: !1,
                maxOpen: !1,
                align: "auto",
                itemWidth: 20,
                itemHeight: 14,
                itemSymbol: "roundRect",
                pieceList: null,
                categories: null,
                splitNumber: 5,
                selectedMode: "multiple",
                itemGap: 10,
                hoverLink: !0,
                showLabel: null
            },
            optionUpdated: function (e, t) {
                vx.superApply(this, "optionUpdated", arguments), this._pieceList = [], this.resetExtent();
                var i = this._mode = this._determineMode();
                mx[this._mode].call(this), this._resetSelected(e, t);
                var n = this.option.categories;
                this.resetVisual(function (e, t) {
                    "categories" === i ? (e.mappingMethod = "category", e.categories = v(n)) : (e.dataExtent = this.getExtent(), e.mappingMethod = "piecewise", e.pieceList = A(this._pieceList, function (e) {
                        return e = v(e), "inRange" !== t && (e.visual = null), e
                    }))
                })
            },
            completeVisualOption: function () {
                var e = this.option, t = {}, i = Jk.listVisualTypes(), n = this.isCategory();

                function a(e, t, i) {
                    return e && e[t] && (R(e[t]) ? e[t].hasOwnProperty(i) : e[t] === i)
                }

                D(e.pieces, function (e) {
                    D(i, function (i) {
                        e.hasOwnProperty(i) && (t[i] = 1)
                    })
                }), D(t, function (t, i) {
                    var o = 0;
                    D(this.stateList, function (t) {
                        o |= a(e, t, i) || a(e.target, t, i)
                    }, this), o || D(this.stateList, function (t) {
                        (e[t] || (e[t] = {}))[i] = XN(i, "inRange" === t ? "active" : "inactive", n)
                    })
                }, this), tx.prototype.completeVisualOption.apply(this, arguments)
            },
            _resetSelected: function (e, t) {
                var i = this.option, n = this._pieceList, a = (t ? i : e).selected || {};
                if (i.selected = a, D(n, function (e, t) {
                    var i = this.getSelectedMapKey(e);
                    a.hasOwnProperty(i) || (a[i] = !0)
                }, this), "single" === i.selectedMode) {
                    var o = !1;
                    D(n, function (e, t) {
                        var i = this.getSelectedMapKey(e);
                        a[i] && (o ? a[i] = !1 : o = !0)
                    }, this)
                }
            },
            getSelectedMapKey: function (e) {
                return "categories" === this._mode ? e.value + "" : e.index + ""
            },
            getPieceList: function () {
                return this._pieceList
            },
            _determineMode: function () {
                var e = this.option;
                return e.pieces && 0 < e.pieces.length ? "pieces" : this.option.categories ? "categories" : "splitNumber"
            },
            setSelected: function (e) {
                this.option.selected = v(e)
            },
            getValueState: function (e) {
                var t = Jk.findPieceIndex(e, this._pieceList);
                return null != t && this.option.selected[this.getSelectedMapKey(this._pieceList[t])] ? "inRange" : "outOfRange"
            },
            findTargetDataIndices: function (e) {
                var t = [];
                return this.eachTargetSeries(function (i) {
                    var n = [], a = i.getData();
                    a.each(this.getDataDimension(a), function (t, i) {
                        Jk.findPieceIndex(t, this._pieceList) === e && n.push(i)
                    }, this), t.push({seriesId: i.id, dataIndex: n})
                }, this), t
            },
            getRepresentValue: function (e) {
                var t;
                if (this.isCategory()) t = e.value; else if (null != e.value) t = e.value; else {
                    var i = e.interval || [];
                    t = i[0] === -1 / 0 && i[1] === 1 / 0 ? 0 : (i[0] + i[1]) / 2
                }
                return t
            },
            getVisualMeta: function (e) {
                if (!this.isCategory()) {
                    var t = [], i = [], n = this, a = this._pieceList.slice();
                    if (a.length) {
                        var o = a[0].interval[0];
                        o !== -1 / 0 && a.unshift({interval: [-1 / 0, o]}), (o = a[a.length - 1].interval[1]) !== 1 / 0 && a.push({interval: [o, 1 / 0]})
                    } else a.push({interval: [-1 / 0, 1 / 0]});
                    var r = -1 / 0;
                    return D(a, function (e) {
                        var t = e.interval;
                        t && (t[0] > r && s([r, t[0]], "outOfRange"), s(t.slice()), r = t[1])
                    }, this), {stops: t, outerColors: i}
                }

                function s(a, o) {
                    var r = n.getRepresentValue({interval: a});
                    o = o || n.getValueState(r);
                    var s = e(r, o);
                    a[0] === -1 / 0 ? i[0] = s : a[1] === 1 / 0 ? i[1] = s : t.push({
                        value: a[0],
                        color: s
                    }, {value: a[1], color: s})
                }
            }
        }), mx = {
            splitNumber: function () {
                var e = this.option, t = this._pieceList, i = Math.min(e.precision, 20), n = this.getExtent(),
                    a = e.splitNumber;
                a = Math.max(parseInt(a, 10), 1), e.splitNumber = a;
                for (var o = (n[1] - n[0]) / a; +o.toFixed(i) !== o && i < 5;) i++;
                e.precision = i, o = +o.toFixed(i), e.minOpen && t.push({interval: [-1 / 0, n[0]], close: [0, 0]});
                for (var r = 0, s = n[0]; r < a; s += o, r++) {
                    var l = r === a - 1 ? n[1] : s + o;
                    t.push({interval: [s, l], close: [1, 1]})
                }
                e.maxOpen && t.push({interval: [n[1], 1 / 0], close: [0, 0]}), zl(t), D(t, function (e, t) {
                    e.index = t, e.text = this.formatValueText(e.interval)
                }, this)
            }, categories: function () {
                var e = this.option;
                D(e.categories, function (e) {
                    this._pieceList.push({text: this.formatValueText(e, !0), value: e})
                }, this), yx(e, this._pieceList)
            }, pieces: function () {
                var e = this.option, t = this._pieceList;
                D(e.pieces, function (e, i) {
                    R(e) || (e = {value: e});
                    var n = {text: "", index: i};
                    if (null != e.label && (n.text = e.label), e.hasOwnProperty("value")) {
                        var a = n.value = e.value;
                        n.interval = [a, a], n.close = [1, 1]
                    } else {
                        for (var o = n.interval = [], r = n.close = [0, 0], s = [1, 0, 1], l = [-1 / 0, 1 / 0], d = [], u = 0; u < 2; u++) {
                            for (var c = [["gte", "gt", "min"], ["lte", "lt", "max"]][u], h = 0; h < 3 && null == o[u]; h++) o[u] = e[c[h]], r[u] = s[h], d[u] = 2 === h;
                            null == o[u] && (o[u] = l[u])
                        }
                        d[0] && o[1] === 1 / 0 && (r[0] = 0), d[1] && o[0] === -1 / 0 && (r[1] = 0), o[0] === o[1] && r[0] && r[1] && (n.value = o[0])
                    }
                    n.visual = Jk.retrieveVisuals(e), t.push(n)
                }, this), yx(e, t), zl(t), D(t, function (e) {
                    var t = e.close, i = [["<", "≤"][t[1]], [">", "≥"][t[0]]];
                    e.text = e.text || this.formatValueText(null != e.value ? e.value : e.interval, !1, i)
                }, this)
            }
        };

        function yx(e, t) {
            var i = e.inverse;
            ("vertical" === e.orient ? !i : i) && t.reverse()
        }

        ox.extend({
            type: "visualMap.piecewise", doRender: function () {
                var e = this.group;
                e.removeAll();
                var t = this.visualMapModel, i = t.get("textGap"), n = t.textStyleModel, a = n.getFont(),
                    o = n.getTextColor(), r = this._getItemAlign(), s = t.itemSize, l = this._getViewData(),
                    d = l.endsText, u = W(t.get("showLabel", !0), !d);
                d && this._renderEndsText(e, d[0], s, u, r), D(l.viewPieceList, function (n) {
                    var l = n.piece, d = new Ai;
                    d.onclick = P(this._onItemClick, this, l), this._enableHoverLink(d, n.indexInModelPieceList);
                    var c = t.getRepresentValue(l);
                    if (this._createItemSymbol(d, c, [0, 0, s[0], s[1]]), u) {
                        var h = this.visualMapModel.getValueState(c);
                        d.add(new Ur({
                            style: {
                                x: "right" === r ? -i : s[0] + i,
                                y: s[1] / 2,
                                text: l.text,
                                textVerticalAlign: "middle",
                                textAlign: r,
                                textFont: a,
                                textFill: o,
                                opacity: "outOfRange" === h ? .5 : 1
                            }
                        }))
                    }
                    e.add(d)
                }, this), d && this._renderEndsText(e, d[1], s, u, r), pd(t.get("orient"), e, t.get("itemGap")), this.renderBackground(e), this.positionGroup(e)
            }, _enableHoverLink: function (e, t) {
                function i(e) {
                    var i = this.visualMapModel;
                    i.option.hoverLink && this.api.dispatchAction({type: e, batch: sx(i.findTargetDataIndices(t), i)})
                }

                e.on("mouseover", P(i, this, "highlight")).on("mouseout", P(i, this, "downplay"))
            }, _getItemAlign: function () {
                var e = this.visualMapModel, t = e.option;
                if ("vertical" === t.orient) return rx(e, this.api, e.itemSize);
                var i = t.align;
                return i && "auto" !== i || (i = "left"), i
            }, _renderEndsText: function (e, t, i, n, a) {
                if (t) {
                    var o = new Ai, r = this.visualMapModel.textStyleModel;
                    o.add(new Ur({
                        style: {
                            x: n ? "right" === a ? i[0] : 0 : i[0] / 2,
                            y: i[1] / 2,
                            textVerticalAlign: "middle",
                            textAlign: n ? a : "center",
                            text: t,
                            textFont: r.getFont(),
                            textFill: r.getTextColor()
                        }
                    })), e.add(o)
                }
            }, _getViewData: function () {
                var e = this.visualMapModel, t = A(e.getPieceList(), function (e, t) {
                    return {piece: e, indexInModelPieceList: t}
                }), i = e.get("text"), n = e.get("orient"), a = e.get("inverse");
                return ("horizontal" === n ? a : !a) ? t.reverse() : i = i && i.slice().reverse(), {
                    viewPieceList: t,
                    endsText: i
                }
            }, _createItemSymbol: function (e, t, i) {
                e.add(cp(this.getControllerVisual(t, "symbol"), i[0], i[1], i[2], i[3], this.getControllerVisual(t, "color")))
            }, _onItemClick: function (e) {
                var t = this.visualMapModel, i = t.option, n = v(i.selected), a = t.getSelectedMapKey(e);
                "single" === i.selectedMode ? (n[a] = !0, D(n, function (e, t) {
                    n[t] = t === a
                })) : n[a] = !n[a], this.api.dispatchAction({
                    type: "selectDataRange",
                    from: this.uid,
                    visualMapId: this.visualMapModel.id,
                    selected: n
                })
            }
        }), cf(VN);
        var kx, Tx = "urn:schemas-microsoft-com:vml", Cx = "undefined" == typeof window ? null : window, Sx = !1,
            Ix = Cx && Cx.document;

        function bx(e) {
            return kx(e)
        }

        if (Ix && !a.canvasSupported) try {
            Ix.namespaces.zrvml || Ix.namespaces.add("zrvml", Tx), kx = function (e) {
                return Ix.createElement("<zrvml:" + e + ' class="zrvml">')
            }
        } catch (e) {
            kx = function (e) {
                return Ix.createElement("<" + e + ' xmlns="' + Tx + '" class="zrvml">')
            }
        }
        var _x, Dx = er.CMD, Ax = Math.round, Nx = Math.sqrt, xx = Math.abs, Ex = Math.cos, Px = Math.sin,
            Ox = Math.max;
        if (!a.canvasSupported) {
            var Mx = ",", Fx = "progid:DXImageTransform.Microsoft", Lx = 21600, Rx = Lx / 2, Bx = function (e) {
                e.style.cssText = "position:absolute;left:0;top:0;width:1px;height:1px;", e.coordsize = Lx + "," + Lx, e.coordorigin = "0,0"
            }, Ux = function (e, t, i) {
                return "rgb(" + [e, t, i].join(",") + ")"
            }, Kx = function (e, t) {
                t && e && t.parentNode !== e && e.appendChild(t)
            }, Vx = function (e, t) {
                t && e && t.parentNode === e && e.removeChild(t)
            }, Wx = function (e, t, i) {
                return 1e5 * (parseFloat(e) || 0) + 1e3 * (parseFloat(t) || 0) + i
            }, Gx = Gn, Hx = function (e, t, i) {
                var n = Vt(t);
                i = +i, isNaN(i) && (i = 1), n && (e.color = Ux(n[0], n[1], n[2]), e.opacity = i * n[3])
            }, zx = function (e, t, i, n) {
                var a = "fill" === t, o = e.getElementsByTagName(t)[0];
                null != i[t] && "none" !== i[t] && (a || !a && i.lineWidth) ? (e[a ? "filled" : "stroked"] = "true", i[t] instanceof os && Vx(e, o), o = o || bx(t), a ? function (e, t, i) {
                    var n, a, o = t.fill;
                    if (null != o) if (o instanceof os) {
                        var r, s = 0, l = [0, 0], d = 0, u = 1, c = i.getBoundingRect(), h = c.width, f = c.height;
                        if ("linear" === o.type) {
                            r = "gradient";
                            var g = i.transform, p = [o.x * h, o.y * f], v = [o.x2 * h, o.y2 * f];
                            g && (Ce(p, p, g), Ce(v, v, g));
                            var m = v[0] - p[0], y = v[1] - p[1];
                            (s = 180 * Math.atan2(m, y) / Math.PI) < 0 && (s += 360), s < 1e-6 && (s = 0)
                        } else {
                            r = "gradientradial", p = [o.x * h, o.y * f], g = i.transform;
                            var k = i.scale, T = h, w = f;
                            l = [(p[0] - c.x) / T, (p[1] - c.y) / w], g && Ce(p, p, g), T /= k[0] * Lx, w /= k[1] * Lx;
                            var C = Ox(T, w);
                            d = 0 / C, u = 2 * o.r / C - d
                        }
                        var S = o.colorStops.slice();
                        S.sort(function (e, t) {
                            return e.offset - t.offset
                        });
                        for (var I = S.length, b = [], _ = [], D = 0; D < I; D++) {
                            var A = S[D], N = (n = A.color, a = Vt(n), [Ux(a[0], a[1], a[2]), a[3]]);
                            _.push(A.offset * u + d + " " + N[0]), 0 !== D && D !== I - 1 || b.push(N)
                        }
                        if (2 <= I) {
                            var x = b[0][0], E = b[1][0], P = b[0][1] * t.opacity, O = b[1][1] * t.opacity;
                            e.type = r, e.method = "none", e.focus = "100%", e.angle = s, e.color = x, e.color2 = E, e.colors = _.join(","), e.opacity = O, e.opacity2 = P
                        }
                        "radial" === r && (e.focusposition = l.join(","))
                    } else Hx(e, o, t.opacity)
                }(o, i, n) : function (e, t) {
                    t.lineDash && (e.dashstyle = t.lineDash.join(" ")), null == t.stroke || t.stroke instanceof os || Hx(e, t.stroke, t.opacity)
                }(o, i), Kx(e, o)) : (e[a ? "filled" : "stroked"] = "false", Vx(e, o))
            }, jx = [[], [], []];
            wr.prototype.brushVML = function (e) {
                var t = this.style, i = this._vmlEl;
                i || (i = bx("shape"), Bx(i), this._vmlEl = i), zx(i, "fill", t, this), zx(i, "stroke", t, this);
                var n = this.transform, a = null != n, o = i.getElementsByTagName("stroke")[0];
                if (o) {
                    var r = t.lineWidth;
                    if (a && !t.strokeNoScale) {
                        var s = n[0] * n[3] - n[1] * n[2];
                        r *= Nx(xx(s))
                    }
                    o.weight = r + "px"
                }
                var l = this.path || (this.path = new er);
                this.__dirtyPath && (l.beginPath(), l.subPixelOptimize = !1, this.buildPath(l, this.shape), l.toStatic(), this.__dirtyPath = !1), i.path = function (e, t) {
                    var i, n, a, o, r, s, l = Dx.M, d = Dx.C, u = Dx.L, c = Dx.A, h = Dx.Q, f = [], g = e.data,
                        p = e.len();
                    for (o = 0; o < p;) {
                        switch (n = "", i = 0, a = g[o++]) {
                            case l:
                                n = " m ", i = 1, r = g[o++], s = g[o++], jx[0][0] = r, jx[0][1] = s;
                                break;
                            case u:
                                n = " l ", i = 1, r = g[o++], s = g[o++], jx[0][0] = r, jx[0][1] = s;
                                break;
                            case h:
                            case d:
                                n = " c ", i = 3;
                                var v, m, y = g[o++], k = g[o++], T = g[o++], w = g[o++];
                                a === h ? (T = ((v = T) + 2 * y) / 3, w = ((m = w) + 2 * k) / 3, y = (r + 2 * y) / 3, k = (s + 2 * k) / 3) : (v = g[o++], m = g[o++]), jx[0][0] = y, jx[0][1] = k, jx[1][0] = T, jx[1][1] = w, r = jx[2][0] = v, s = jx[2][1] = m;
                                break;
                            case c:
                                var C = 0, S = 0, I = 1, b = 1, _ = 0;
                                t && (C = t[4], S = t[5], I = Nx(t[0] * t[0] + t[1] * t[1]), b = Nx(t[2] * t[2] + t[3] * t[3]), _ = Math.atan2(-t[1] / b, t[0] / I));
                                var D = g[o++], A = g[o++], N = g[o++], x = g[o++], E = g[o++] + _, P = g[o++] + E + _;
                                o++;
                                var O = g[o++], M = D + Ex(E) * N, F = A + Px(E) * x,
                                    L = (y = D + Ex(P) * N, k = A + Px(P) * x, O ? " wa " : " at ");
                                Math.abs(M - y) < 1e-4 && (.01 < Math.abs(P - E) ? O && (M += .0125) : Math.abs(F - A) < 1e-4 ? O && M < D || !O && D < M ? k -= .0125 : k += .0125 : O && F < A || !O && A < F ? y += .0125 : y -= .0125), f.push(L, Ax(((D - N) * I + C) * Lx - Rx), Mx, Ax(((A - x) * b + S) * Lx - Rx), Mx, Ax(((D + N) * I + C) * Lx - Rx), Mx, Ax(((A + x) * b + S) * Lx - Rx), Mx, Ax((M * I + C) * Lx - Rx), Mx, Ax((F * b + S) * Lx - Rx), Mx, Ax((y * I + C) * Lx - Rx), Mx, Ax((k * b + S) * Lx - Rx)), r = y, s = k;
                                break;
                            case Dx.R:
                                var R = jx[0], B = jx[1];
                                R[0] = g[o++], R[1] = g[o++], B[0] = R[0] + g[o++], B[1] = R[1] + g[o++], t && (Ce(R, R, t), Ce(B, B, t)), R[0] = Ax(R[0] * Lx - Rx), B[0] = Ax(B[0] * Lx - Rx), R[1] = Ax(R[1] * Lx - Rx), B[1] = Ax(B[1] * Lx - Rx), f.push(" m ", R[0], Mx, R[1], " l ", B[0], Mx, R[1], " l ", B[0], Mx, B[1], " l ", R[0], Mx, B[1]);
                                break;
                            case Dx.Z:
                                f.push(" x ")
                        }
                        if (0 < i) {
                            f.push(n);
                            for (var U = 0; U < i; U++) {
                                var K = jx[U];
                                t && Ce(K, K, t), f.push(Ax(K[0] * Lx - Rx), Mx, Ax(K[1] * Lx - Rx), U < i - 1 ? Mx : "")
                            }
                        }
                    }
                    return f.join("")
                }(l, this.transform), i.style.zIndex = Wx(this.zlevel, this.z, this.z2), Kx(e, i), null != t.text ? this.drawRectText(e, this.getBoundingRect()) : this.removeRectText(e)
            }, wr.prototype.onRemove = function (e) {
                Vx(e, this._vmlEl), this.removeRectText(e)
            }, wr.prototype.onAdd = function (e) {
                Kx(e, this._vmlEl), this.appendRectText(e)
            }, Yn.prototype.brushVML = function (e) {
                var t, i, n = this.style, a = n.image;
                if (function (e) {
                    return "object" == typeof e && e.tagName && "IMG" === e.tagName.toUpperCase()
                }(a)) {
                    var o = a.src;
                    if (o === this._imageSrc) t = this._imageWidth, i = this._imageHeight; else {
                        var r = a.runtimeStyle, s = r.width, l = r.height;
                        r.width = "auto", r.height = "auto", t = a.width, i = a.height, r.width = s, r.height = l, this._imageSrc = o, this._imageWidth = t, this._imageHeight = i
                    }
                    a = o
                } else a === this._imageSrc && (t = this._imageWidth, i = this._imageHeight);
                if (a) {
                    var d = n.x || 0, u = n.y || 0, c = n.width, h = n.height, f = n.sWidth, g = n.sHeight,
                        p = n.sx || 0, v = n.sy || 0, m = f && g, y = this._vmlEl;
                    y || (y = Ix.createElement("div"), Bx(y), this._vmlEl = y);
                    var k, T = y.style, w = !1, C = 1, S = 1;
                    if (this.transform && (k = this.transform, C = Nx(k[0] * k[0] + k[1] * k[1]), S = Nx(k[2] * k[2] + k[3] * k[3]), w = k[1] || k[2]), w) {
                        var I = [d, u], b = [d + c, u], _ = [d, u + h], D = [d + c, u + h];
                        Ce(I, I, k), Ce(b, b, k), Ce(_, _, k), Ce(D, D, k);
                        var A = Ox(I[0], b[0], _[0], D[0]), N = Ox(I[1], b[1], _[1], D[1]), x = [];
                        x.push("M11=", k[0] / C, Mx, "M12=", k[2] / S, Mx, "M21=", k[1] / C, Mx, "M22=", k[3] / S, Mx, "Dx=", Ax(d * C + k[4]), Mx, "Dy=", Ax(u * S + k[5])), T.padding = "0 " + Ax(A) + "px " + Ax(N) + "px 0", T.filter = Fx + ".Matrix(" + x.join("") + ", SizingMethod=clip)"
                    } else k && (d = d * C + k[4], u = u * S + k[5]), T.filter = "", T.left = Ax(d) + "px", T.top = Ax(u) + "px";
                    var E = this._imageEl, P = this._cropEl;
                    E || (E = Ix.createElement("div"), this._imageEl = E);
                    var O = E.style;
                    if (m) {
                        if (t && i) O.width = Ax(C * t * c / f) + "px", O.height = Ax(S * i * h / g) + "px"; else {
                            var M = new Image, F = this;
                            M.onload = function () {
                                M.onload = null, t = M.width, i = M.height, O.width = Ax(C * t * c / f) + "px", O.height = Ax(S * i * h / g) + "px", F._imageWidth = t, F._imageHeight = i, F._imageSrc = a
                            }, M.src = a
                        }
                        P || ((P = Ix.createElement("div")).style.overflow = "hidden", this._cropEl = P);
                        var L = P.style;
                        L.width = Ax((c + p * c / f) * C), L.height = Ax((h + v * h / g) * S), L.filter = Fx + ".Matrix(Dx=" + -p * c / f * C + ",Dy=" + -v * h / g * S + ")", P.parentNode || y.appendChild(P), E.parentNode !== P && P.appendChild(E)
                    } else O.width = Ax(C * c) + "px", O.height = Ax(S * h) + "px", y.appendChild(E), P && P.parentNode && (y.removeChild(P), this._cropEl = null);
                    var R = "", B = n.opacity;
                    B < 1 && (R += ".Alpha(opacity=" + Ax(100 * B) + ") "), R += Fx + ".AlphaImageLoader(src=" + a + ", SizingMethod=scale)", O.filter = R, y.style.zIndex = Wx(this.zlevel, this.z, this.z2), Kx(e, y), null != n.text && this.drawRectText(e, this.getBoundingRect())
                }
            }, Yn.prototype.onRemove = function (e) {
                Vx(e, this._vmlEl), this._vmlEl = null, this._cropEl = null, this._imageEl = null, this.removeRectText(e)
            }, Yn.prototype.onAdd = function (e) {
                Kx(e, this._vmlEl), this.appendRectText(e)
            };
            var Xx, $x = "normal", Yx = {}, qx = 0, Jx = document.createElement("div");
            _x = function (e, t) {
                var i = Ix;
                Xx || ((Xx = i.createElement("div")).style.cssText = "position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;", Ix.body.appendChild(Xx));
                try {
                    Xx.style.font = t
                } catch (e) {
                }
                return Xx.innerHTML = "", Xx.appendChild(i.createTextNode(e)), {width: Xx.offsetWidth}
            }, dn.measureText = _x;
            for (var Zx = new Di, Qx = function (e, t, i, n) {
                var a = this.style;
                this.__dirty && En(a);
                var o = a.text;
                if (null != o && (o += ""), o) {
                    if (a.rich) {
                        var r = wn(o, a);
                        o = [];
                        for (var s = 0; s < r.lines.length; s++) {
                            for (var l = r.lines[s].tokens, d = [], u = 0; u < l.length; u++) d.push(l[u].text);
                            o.push(d.join(""))
                        }
                        o = o.join("\n")
                    }
                    var c, h, f = a.textAlign, g = a.textVerticalAlign, p = function (e) {
                        var t = Yx[e];
                        if (!t) {
                            100 < qx && (qx = 0, Yx = {});
                            var i, n = Jx.style;
                            try {
                                n.font = e, i = n.fontFamily.split(",")[0]
                            } catch (e) {
                            }
                            t = {
                                style: n.fontStyle || $x,
                                variant: n.fontVariant || $x,
                                weight: n.fontWeight || $x,
                                size: 0 | parseFloat(n.fontSize || 12),
                                family: i || "Microsoft YaHei"
                            }, Yx[e] = t, qx++
                        }
                        return t
                    }(a.font), v = p.style + " " + p.variant + " " + p.weight + " " + p.size + 'px "' + p.family + '"';
                    i = i || cn(o, v, f, g, a.textPadding, a.textLineHeight);
                    var m = this.transform;
                    if (m && !n && (Zx.copy(t), Zx.applyTransform(m), t = Zx), n) c = t.x, h = t.y; else {
                        var y = a.textPosition;
                        if (y instanceof Array) c = t.x + Gx(y[0], t.width), h = t.y + Gx(y[1], t.height), f = f || "left"; else {
                            var k = this.calculateTextPosition ? this.calculateTextPosition({}, a, t) : gn({}, a, t);
                            c = k.x, h = k.y, f = f || k.textAlign, g = g || k.textVerticalAlign
                        }
                    }
                    c = hn(c, i.width, f), h = fn(h, i.height, g), h += i.height / 2;
                    var T, w, C, S = bx, I = this._textVmlEl;
                    I ? w = (T = (C = I.firstChild).nextSibling).nextSibling : (I = S("line"), T = S("path"), w = S("textpath"), C = S("skew"), w.style["v-text-align"] = "left", Bx(I), T.textpathok = !0, w.on = !0, I.from = "0 0", I.to = "1000 0.05", Kx(I, C), Kx(I, T), Kx(I, w), this._textVmlEl = I);
                    var b = [c, h], _ = I.style;
                    m && n ? (Ce(b, b, m), C.on = !0, C.matrix = m[0].toFixed(3) + Mx + m[2].toFixed(3) + Mx + m[1].toFixed(3) + Mx + m[3].toFixed(3) + ",0,0", C.offset = (Ax(b[0]) || 0) + "," + (Ax(b[1]) || 0), C.origin = "0 0", _.left = "0px", _.top = "0px") : (C.on = !1, _.left = Ax(c) + "px", _.top = Ax(h) + "px"), w.string = function (e) {
                        return String(e).replace(/&/g, "&amp;").replace(/"/g, "&quot;")
                    }(o);
                    try {
                        w.style.font = v
                    } catch (e) {
                    }
                    zx(I, "fill", {fill: a.textFill, opacity: a.opacity}, this), zx(I, "stroke", {
                        stroke: a.textStroke,
                        opacity: a.opacity,
                        lineDash: a.lineDash || null
                    }, this), I.style.zIndex = Wx(this.zlevel, this.z, this.z2), Kx(e, I)
                }
            }, eE = function (e) {
                Vx(e, this._textVmlEl), this._textVmlEl = null
            }, tE = function (e) {
                Kx(e, this._textVmlEl)
            }, iE = [jn, $n, Yn, wr, Ur], nE = 0; nE < iE.length; nE++) {
                var aE = iE[nE].prototype;
                aE.drawRectText = Qx, aE.removeRectText = eE, aE.appendRectText = tE
            }
            Ur.prototype.brushVML = function (e) {
                var t = this.style;
                null != t.text ? this.drawRectText(e, {
                    x: t.x || 0,
                    y: t.y || 0,
                    width: 0,
                    height: 0
                }, this.getBoundingRect(), !0) : this.removeRectText(e)
            }, Ur.prototype.onRemove = function (e) {
                this.removeRectText(e)
            }, Ur.prototype.onAdd = function (e) {
                this.appendRectText(e)
            }
        }

        function oE(e) {
            return parseInt(e, 10)
        }

        function rE(e, t) {
            !function () {
                if (!Sx && Ix) {
                    Sx = !0;
                    var e = Ix.styleSheets;
                    e.length < 31 ? Ix.createStyleSheet().addRule(".zrvml", "behavior:url(#default#VML)") : e[0].addRule(".zrvml", "behavior:url(#default#VML)")
                }
            }(), this.root = e, this.storage = t;
            var i = document.createElement("div"), n = document.createElement("div");
            i.style.cssText = "display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;", n.style.cssText = "position:absolute;left:0;top:0;", e.appendChild(i), this._vmlRoot = n, this._vmlViewport = i, this.resize();
            var a = t.delFromStorage, o = t.addToStorage;
            t.delFromStorage = function (e) {
                a.call(t, e), e && e.onRemove && e.onRemove(n)
            }, t.addToStorage = function (e) {
                e.onAdd && e.onAdd(n), o.call(t, e)
            }, this._firstPaint = !0
        }

        function sE(e) {
            return document.createElementNS("http://www.w3.org/2000/svg", e)
        }

        rE.prototype = {
            constructor: rE, getType: function () {
                return "vml"
            }, getViewportRoot: function () {
                return this._vmlViewport
            }, getViewportRootOffset: function () {
                var e = this.getViewportRoot();
                if (e) return {offsetLeft: e.offsetLeft || 0, offsetTop: e.offsetTop || 0}
            }, refresh: function () {
                var e = this.storage.getDisplayList(!0, !0);
                this._paintList(e)
            }, _paintList: function (e) {
                for (var t = this._vmlRoot, i = 0; i < e.length; i++) {
                    var n = e[i];
                    n.invisible || n.ignore ? (n.__alreadyNotVisible || n.onRemove(t), n.__alreadyNotVisible = !0) : (n.__alreadyNotVisible && n.onAdd(t), n.__alreadyNotVisible = !1, n.__dirty && (n.beforeBrush && n.beforeBrush(), (n.brushVML || n.brush).call(n, t), n.afterBrush && n.afterBrush())), n.__dirty = !1
                }
                this._firstPaint && (this._vmlViewport.appendChild(t), this._firstPaint = !1)
            }, resize: function (e, t) {
                if (e = null == e ? this._getWidth() : e, t = null == t ? this._getHeight() : t, this._width !== e || this._height !== t) {
                    this._width = e, this._height = t;
                    var i = this._vmlViewport.style;
                    i.width = e + "px", i.height = t + "px"
                }
            }, dispose: function () {
                this.root.innerHTML = "", this._vmlRoot = this._vmlViewport = this.storage = null
            }, getWidth: function () {
                return this._width
            }, getHeight: function () {
                return this._height
            }, clear: function () {
                this._vmlViewport && this.root.removeChild(this._vmlViewport)
            }, _getWidth: function () {
                var e = this.root, t = e.currentStyle;
                return (e.clientWidth || oE(t.width)) - oE(t.paddingLeft) - oE(t.paddingRight) | 0
            }, _getHeight: function () {
                var e = this.root, t = e.currentStyle;
                return (e.clientHeight || oE(t.height)) - oE(t.paddingTop) - oE(t.paddingBottom) | 0
            }
        }, D(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "toDataURL", "pathToImage"], function (e) {
            rE.prototype[e] = function (e) {
                return function () {
                    vi('In IE8.0 VML mode painter not support method "' + e + '"')
                }
            }(e)
        }), ba("vml", rE);
        var lE = er.CMD, dE = Array.prototype.join, uE = "none", cE = Math.round, hE = Math.sin, fE = Math.cos,
            gE = Math.PI, pE = 2 * Math.PI, vE = 180 / gE, mE = 1e-4;

        function yE(e) {
            return cE(1e4 * e) / 1e4
        }

        function kE(e) {
            return e < mE && -mE < e
        }

        function TE(e, t) {
            t && wE(e, "transform", "matrix(" + dE.call(t, ",") + ")")
        }

        function wE(e, t, i) {
            i && ("linear" === i.type || "radial" === i.type) || e.setAttribute(t, i)
        }

        function CE(e, t, i, n) {
            if (function (e, t) {
                var i = t ? e.textFill : e.fill;
                return null != i && i !== uE
            }(t, i)) {
                var a = i ? t.textFill : t.fill;
                wE(e, "fill", a = "transparent" === a ? uE : a), wE(e, "fill-opacity", null != t.fillOpacity ? t.fillOpacity * t.opacity : t.opacity)
            } else wE(e, "fill", uE);
            if (function (e, t) {
                var i = t ? e.textStroke : e.stroke;
                return null != i && i !== uE
            }(t, i)) {
                var o = i ? t.textStroke : t.stroke;
                wE(e, "stroke", o = "transparent" === o ? uE : o), wE(e, "stroke-width", (i ? t.textStrokeWidth : t.lineWidth) / (!i && t.strokeNoScale ? n.getLineScale() : 1)), wE(e, "paint-order", i ? "stroke" : "fill"), wE(e, "stroke-opacity", null != t.strokeOpacity ? t.strokeOpacity : t.opacity), t.lineDash ? (wE(e, "stroke-dasharray", t.lineDash.join(",")), wE(e, "stroke-dashoffset", cE(t.lineDashOffset || 0))) : wE(e, "stroke-dasharray", ""), t.lineCap && wE(e, "stroke-linecap", t.lineCap), t.lineJoin && wE(e, "stroke-linejoin", t.lineJoin), t.miterLimit && wE(e, "stroke-miterlimit", t.miterLimit)
            } else wE(e, "stroke", uE)
        }

        var SE = {
                brush: function (e) {
                    var t = e.style, i = e.__svgEl;
                    i || (i = sE("path"), e.__svgEl = i), e.path || e.createPathProxy();
                    var n = e.path;
                    if (e.__dirtyPath) {
                        n.beginPath(), n.subPixelOptimize = !1, e.buildPath(n, e.shape), e.__dirtyPath = !1;
                        var a = function (e) {
                            for (var t = [], i = e.data, n = e.len(), a = 0; a < n;) {
                                var o = "", r = 0;
                                switch (i[a++]) {
                                    case lE.M:
                                        o = "M", r = 2;
                                        break;
                                    case lE.L:
                                        o = "L", r = 2;
                                        break;
                                    case lE.Q:
                                        o = "Q", r = 4;
                                        break;
                                    case lE.C:
                                        o = "C", r = 6;
                                        break;
                                    case lE.A:
                                        var s = i[a++], l = i[a++], d = i[a++], u = i[a++], c = i[a++], h = i[a++],
                                            f = i[a++], g = i[a++], p = Math.abs(h),
                                            v = kE(p - pE) || (g ? pE <= h : pE <= -h), m = 0 < h ? h % pE : h % pE + pE,
                                            y = !1;
                                        y = !!v || !kE(p) && gE <= m == !!g;
                                        var k = yE(s + d * fE(c)), T = yE(l + u * hE(c));
                                        v && (h = g ? pE - 1e-4 : 1e-4 - pE, y = !0, 9 === a && t.push("M", k, T));
                                        var w = yE(s + d * fE(c + h)), C = yE(l + u * hE(c + h));
                                        t.push("A", yE(d), yE(u), cE(f * vE), +y, +g, w, C);
                                        break;
                                    case lE.Z:
                                        o = "Z";
                                        break;
                                    case lE.R:
                                        w = yE(i[a++]), C = yE(i[a++]);
                                        var S = yE(i[a++]), I = yE(i[a++]);
                                        t.push("M", w, C, "L", w + S, C, "L", w + S, C + I, "L", w, C + I, "L", w, C)
                                }
                                o && t.push(o);
                                for (var b = 0; b < r; b++) t.push(yE(i[a++]))
                            }
                            return t.join(" ")
                        }(n);
                        a.indexOf("NaN") < 0 && wE(i, "d", a)
                    }
                    CE(i, t, !1, e), TE(i, e.transform), null != t.text ? xE(e, e.getBoundingRect()) : PE(e)
                }
            }, IE = {
                brush: function (e) {
                    var t = e.style, i = t.image;
                    if (i instanceof HTMLImageElement && (i = i.src), i) {
                        var n = t.x || 0, a = t.y || 0, o = t.width, r = t.height, s = e.__svgEl;
                        s || (s = sE("image"), e.__svgEl = s), i !== e.__imageSrc && (function (e, t, i) {
                            e.setAttributeNS("http://www.w3.org/1999/xlink", "href", i)
                        }(s, 0, i), e.__imageSrc = i), wE(s, "width", o), wE(s, "height", r), wE(s, "x", n), wE(s, "y", a), TE(s, e.transform), null != t.text ? xE(e, e.getBoundingRect()) : PE(e)
                    }
                }
            }, bE = {}, _E = new Di, DE = {}, AE = [],
            NE = {left: "start", right: "end", center: "middle", middle: "middle"}, xE = function (e, t) {
                var i = e.style, n = e.transform, a = e instanceof Ur || i.transformText;
                e.__dirty && En(i);
                var o = i.text;
                if (null != o && (o += ""), zn(o, i)) {
                    null == o && (o = ""), !a && n && (_E.copy(t), _E.applyTransform(n), t = _E);
                    var r = e.__textSvgEl;
                    r || (r = sE("text"), e.__textSvgEl = r);
                    var s = r.style, l = i.font || ln, d = r.__computedFont;
                    l !== r.__styleFont && (s.font = r.__styleFont = l, d = r.__computedFont = s.font);
                    var u = i.textPadding, c = i.textLineHeight, h = e.__textCotentBlock;
                    h && !e.__dirtyText || (h = e.__textCotentBlock = Tn(o, d, u, c, i.truncate));
                    var f = h.outerHeight, g = h.lineHeight;
                    Un(DE, e, i, t);
                    var p = DE.baseX, v = DE.baseY, m = DE.textAlign || "left", y = DE.textVerticalAlign;
                    !function (e, t, i, n, a, o, r) {
                        rt(AE), t && i && st(AE, i);
                        var s = n.textRotation;
                        if (a && s) {
                            var l = n.textOrigin;
                            "center" === l ? (o = a.width / 2 + a.x, r = a.height / 2 + a.y) : l && (o = l[0] + a.x, r = l[1] + a.y), AE[4] -= o, AE[5] -= r, ut(AE, AE, s), AE[4] += o, AE[5] += r
                        }
                        TE(e, AE)
                    }(r, a, n, i, t, p, v);
                    var k = p, T = fn(v, f, y);
                    u && (k = function (e, t, i) {
                        return "right" === t ? e - i[1] : "center" === t ? e + i[3] / 2 - i[1] / 2 : e + i[3]
                    }(p, m, u), T += u[0]), T += g / 2, CE(r, i, !0, e);
                    var w = h.canCacheByTextString, C = e.__tspanList || (e.__tspanList = []), S = C.length;
                    if (w && e.__canCacheByTextString && e.__text === o) {
                        if (e.__dirtyText && S) for (var I = 0; I < S; ++I) EE(C[I], m, k, T + I * g)
                    } else {
                        e.__text = o, e.__canCacheByTextString = w;
                        var b = h.lines, _ = b.length;
                        for (I = 0; I < _; I++) {
                            var D = C[I], A = b[I];
                            D ? D.__zrText !== A && (D.innerHTML = "", D.appendChild(document.createTextNode(A))) : (D = C[I] = sE("tspan"), r.appendChild(D), D.appendChild(document.createTextNode(A))), EE(D, m, k, T + I * g)
                        }
                        if (_ < S) {
                            for (; I < S; I++) r.removeChild(C[I]);
                            C.length = _
                        }
                    }
                }
            };

        function EE(e, t, i, n) {
            wE(e, "dominant-baseline", "middle"), wE(e, "text-anchor", NE[t]), wE(e, "x", i), wE(e, "y", n)
        }

        function PE(e) {
            e && e.__textSvgEl && (e.__textSvgEl.parentNode && e.__textSvgEl.parentNode.removeChild(e.__textSvgEl), e.__textSvgEl = null, e.__tspanList = [], e.__text = null)
        }

        function OE() {
        }

        function ME(e, t) {
            for (var i = 0, n = t.length, a = 0, o = 0; i < n; i++) {
                var r = t[i];
                if (r.removed) {
                    for (s = [], l = o; l < o + r.count; l++) s.push(l);
                    r.indices = s, o += r.count
                } else {
                    for (var s = [], l = a; l < a + r.count; l++) s.push(l);
                    r.indices = s, a += r.count, r.added || (o += r.count)
                }
            }
            return t
        }

        bE.drawRectText = xE, bE.brush = function (e) {
            null != e.style.text ? xE(e, !1) : PE(e)
        }, OE.prototype = {
            diff: function (e, t, i) {
                i = i || function (e, t) {
                    return e === t
                }, this.equals = i;
                var n = this;
                e = e.slice();
                var a = (t = t.slice()).length, o = e.length, r = 1, s = a + o, l = [{newPos: -1, components: []}],
                    d = this.extractCommon(l[0], t, e, 0);
                if (l[0].newPos + 1 >= a && o <= d + 1) {
                    for (var u = [], c = 0; c < t.length; c++) u.push(c);
                    return [{indices: u, count: t.length}]
                }

                function h() {
                    for (var i = -1 * r; i <= r; i += 2) {
                        var s, d = l[i - 1], u = l[i + 1], c = (u ? u.newPos : 0) - i;
                        d && (l[i - 1] = void 0);
                        var h = d && d.newPos + 1 < a, f = u && 0 <= c && c < o;
                        if (h || f) {
                            if (!h || f && d.newPos < u.newPos ? (s = {
                                newPos: (g = u).newPos,
                                components: g.components.slice(0)
                            }, n.pushComponent(s.components, void 0, !0)) : ((s = d).newPos++, n.pushComponent(s.components, !0, void 0)), c = n.extractCommon(s, t, e, i), s.newPos + 1 >= a && o <= c + 1) return ME(0, s.components);
                            l[i] = s
                        } else l[i] = void 0
                    }
                    var g;
                    r++
                }

                for (; r <= s;) {
                    var f = h();
                    if (f) return f
                }
            }, pushComponent: function (e, t, i) {
                var n = e[e.length - 1];
                n && n.added === t && n.removed === i ? e[e.length - 1] = {
                    count: n.count + 1,
                    added: t,
                    removed: i
                } : e.push({count: 1, added: t, removed: i})
            }, extractCommon: function (e, t, i, n) {
                for (var a = t.length, o = i.length, r = e.newPos, s = r - n, l = 0; r + 1 < a && s + 1 < o && this.equals(t[r + 1], i[s + 1]);) r++, s++, l++;
                return l && e.components.push({count: l}), e.newPos = r, s
            }, tokenize: function (e) {
                return e.slice()
            }, join: function (e) {
                return e.slice()
            }
        };
        var FE = new OE;

        function LE(e, t, i, n, a) {
            this._zrId = e, this._svgRoot = t, this._tagNames = "string" == typeof i ? [i] : i, this._markLabel = n, this._domName = a || "_dom", this.nextId = 0
        }

        function RE(e, t) {
            LE.call(this, e, t, ["linearGradient", "radialGradient"], "__gradient_in_use__")
        }

        function BE(e, t) {
            LE.call(this, e, t, "clipPath", "__clippath_in_use__")
        }

        function UE(e, t) {
            LE.call(this, e, t, ["filter"], "__filter_in_use__", "_shadowDom")
        }

        function KE(e) {
            return e && (e.shadowBlur || e.shadowOffsetX || e.shadowOffsetY || e.textShadowBlur || e.textShadowOffsetX || e.textShadowOffsetY)
        }

        function VE(e) {
            return parseInt(e, 10)
        }

        function WE(e, t) {
            return t && e && t.parentNode !== e
        }

        function GE(e, t, i) {
            if (WE(e, t) && i) {
                var n = i.nextSibling;
                n ? e.insertBefore(t, n) : e.appendChild(t)
            }
        }

        function HE(e, t) {
            if (WE(e, t)) {
                var i = e.firstChild;
                i ? e.insertBefore(t, i) : e.appendChild(t)
            }
        }

        function zE(e, t) {
            t && e && t.parentNode === e && e.removeChild(t)
        }

        function jE(e) {
            return e.__textSvgEl
        }

        function XE(e) {
            return e.__svgEl
        }

        function $E(e, t, i, n) {
            this.root = e, this.storage = t, this._opts = i = k({}, i || {});
            var a = sE("svg");
            a.setAttribute("xmlns", "http://www.w3.org/2000/svg"), a.setAttribute("version", "1.1"), a.setAttribute("baseProfile", "full"), a.style.cssText = "user-select:none;position:absolute;left:0;top:0;";
            var o = sE("g");
            a.appendChild(o);
            var r = sE("g");
            a.appendChild(r), this.gradientManager = new RE(n, r), this.clipPathManager = new BE(n, r), this.shadowManager = new UE(n, r);
            var s = document.createElement("div");
            s.style.cssText = "overflow:hidden;position:relative", this._svgDom = a, this._svgRoot = r, this._backgroundRoot = o, this._viewport = s, e.appendChild(s), s.appendChild(a), this.resize(i.width, i.height), this._visibleList = []
        }

        LE.prototype.createElement = sE, LE.prototype.getDefs = function (e) {
            var t = this._svgRoot, i = this._svgRoot.getElementsByTagName("defs");
            return 0 === i.length ? e ? ((i = t.insertBefore(this.createElement("defs"), t.firstChild)).contains || (i.contains = function (e) {
                var t = i.children;
                if (!t) return !1;
                for (var n = t.length - 1; 0 <= n; --n) if (t[n] === e) return !0;
                return !1
            }), i) : null : i[0]
        }, LE.prototype.update = function (e, t) {
            if (e) {
                var i = this.getDefs(!1);
                if (e[this._domName] && i.contains(e[this._domName])) "function" == typeof t && t(e); else {
                    var n = this.add(e);
                    n && (e[this._domName] = n)
                }
            }
        }, LE.prototype.addDom = function (e) {
            this.getDefs(!0).appendChild(e)
        }, LE.prototype.removeDom = function (e) {
            var t = this.getDefs(!1);
            t && e[this._domName] && (t.removeChild(e[this._domName]), e[this._domName] = null)
        }, LE.prototype.getDoms = function () {
            var e = this.getDefs(!1);
            if (!e) return [];
            var t = [];
            return D(this._tagNames, function (i) {
                var n = e.getElementsByTagName(i);
                t = t.concat([].slice.call(n))
            }), t
        }, LE.prototype.markAllUnused = function () {
            var e = this.getDoms(), t = this;
            D(e, function (e) {
                e[t._markLabel] = "0"
            })
        }, LE.prototype.markUsed = function (e) {
            e && (e[this._markLabel] = "1")
        }, LE.prototype.removeUnused = function () {
            var e = this.getDefs(!1);
            if (e) {
                var t = this.getDoms(), i = this;
                D(t, function (t) {
                    "1" !== t[i._markLabel] && e.removeChild(t)
                })
            }
        }, LE.prototype.getSvgProxy = function (e) {
            return e instanceof wr ? SE : e instanceof Yn ? IE : e instanceof Ur ? bE : SE
        }, LE.prototype.getTextSvgElement = function (e) {
            return e.__textSvgEl
        }, LE.prototype.getSvgElement = function (e) {
            return e.__svgEl
        }, I(RE, LE), RE.prototype.addWithoutUpdate = function (e, t) {
            if (t && t.style) {
                var i = this;
                D(["fill", "stroke"], function (n) {
                    if (t.style[n] && ("linear" === t.style[n].type || "radial" === t.style[n].type)) {
                        var a, o = t.style[n], r = i.getDefs(!0);
                        o._dom ? (a = o._dom, r.contains(o._dom) || i.addDom(a)) : a = i.add(o), i.markUsed(t);
                        var s = a.getAttribute("id");
                        e.setAttribute(n, "url(#" + s + ")")
                    }
                })
            }
        }, RE.prototype.add = function (e) {
            var t;
            if ("linear" === e.type) t = this.createElement("linearGradient"); else {
                if ("radial" !== e.type) return vi("Illegal gradient type."), null;
                t = this.createElement("radialGradient")
            }
            return e.id = e.id || this.nextId++, t.setAttribute("id", "zr" + this._zrId + "-gradient-" + e.id), this.updateDom(e, t), this.addDom(t), t
        }, RE.prototype.update = function (e) {
            var t = this;
            LE.prototype.update.call(this, e, function () {
                var i = e.type, n = e._dom.tagName;
                "linear" === i && "linearGradient" === n || "radial" === i && "radialGradient" === n ? t.updateDom(e, e._dom) : (t.removeDom(e), t.add(e))
            })
        }, RE.prototype.updateDom = function (e, t) {
            if ("linear" === e.type) t.setAttribute("x1", e.x), t.setAttribute("y1", e.y), t.setAttribute("x2", e.x2), t.setAttribute("y2", e.y2); else {
                if ("radial" !== e.type) return void vi("Illegal gradient type.");
                t.setAttribute("cx", e.x), t.setAttribute("cy", e.y), t.setAttribute("r", e.r)
            }
            e.global ? t.setAttribute("gradientUnits", "userSpaceOnUse") : t.setAttribute("gradientUnits", "objectBoundingBox"), t.innerHTML = "";
            for (var i = e.colorStops, n = 0, a = i.length; n < a; ++n) {
                var o = this.createElement("stop");
                o.setAttribute("offset", 100 * i[n].offset + "%");
                var r = i[n].color;
                if (r.indexOf(!1)) {
                    var s = Vt(r)[3], l = Ht(r);
                    o.setAttribute("stop-color", "#" + l), o.setAttribute("stop-opacity", s)
                } else o.setAttribute("stop-color", i[n].color);
                t.appendChild(o)
            }
            e._dom = t
        }, RE.prototype.markUsed = function (e) {
            if (e.style) {
                var t = e.style.fill;
                t && t._dom && LE.prototype.markUsed.call(this, t._dom), (t = e.style.stroke) && t._dom && LE.prototype.markUsed.call(this, t._dom)
            }
        }, I(BE, LE), BE.prototype.update = function (e) {
            var t = this.getSvgElement(e);
            t && this.updateDom(t, e.__clipPaths, !1);
            var i = this.getTextSvgElement(e);
            i && this.updateDom(i, e.__clipPaths, !0), this.markUsed(e)
        }, BE.prototype.updateDom = function (e, t, i) {
            if (t && 0 < t.length) {
                var n, a, o = this.getDefs(!0), r = t[0], s = i ? "_textDom" : "_dom";
                r[s] ? (a = r[s].getAttribute("id"), n = r[s], o.contains(n) || o.appendChild(n)) : (a = "zr" + this._zrId + "-clip-" + this.nextId, ++this.nextId, (n = this.createElement("clipPath")).setAttribute("id", a), o.appendChild(n), r[s] = n);
                var l = this.getSvgProxy(r);
                if (r.transform && r.parent.invTransform && !i) {
                    var d = Array.prototype.slice.call(r.transform);
                    lt(r.transform, r.parent.invTransform, r.transform), l.brush(r), r.transform = d
                } else l.brush(r);
                var u = this.getSvgElement(r);
                n.innerHTML = "", n.appendChild(u.cloneNode()), e.setAttribute("clip-path", "url(#" + a + ")"), 1 < t.length && this.updateDom(n, t.slice(1), i)
            } else e && e.setAttribute("clip-path", "none")
        }, BE.prototype.markUsed = function (e) {
            var t = this;
            e.__clipPaths && D(e.__clipPaths, function (e) {
                e._dom && LE.prototype.markUsed.call(t, e._dom), e._textDom && LE.prototype.markUsed.call(t, e._textDom)
            })
        }, I(UE, LE), UE.prototype.addWithoutUpdate = function (e, t) {
            if (t && KE(t.style)) {
                var i;
                t._shadowDom ? (i = t._shadowDom, this.getDefs(!0).contains(t._shadowDom) || this.addDom(i)) : i = this.add(t), this.markUsed(t);
                var n = i.getAttribute("id");
                e.style.filter = "url(#" + n + ")"
            }
        }, UE.prototype.add = function (e) {
            var t = this.createElement("filter");
            return e._shadowDomId = e._shadowDomId || this.nextId++, t.setAttribute("id", "zr" + this._zrId + "-shadow-" + e._shadowDomId), this.updateDom(e, t), this.addDom(t), t
        }, UE.prototype.update = function (e, t) {
            if (KE(t.style)) {
                var i = this;
                LE.prototype.update.call(this, t, function () {
                    i.updateDom(t, t._shadowDom)
                })
            } else this.remove(e, t)
        }, UE.prototype.remove = function (e, t) {
            null != t._shadowDomId && (this.removeDom(e), e.style.filter = "")
        }, UE.prototype.updateDom = function (e, t) {
            var i = t.getElementsByTagName("feDropShadow");
            i = 0 === i.length ? this.createElement("feDropShadow") : i[0];
            var n, a, o, r, s = e.style, l = e.scale && e.scale[0] || 1, d = e.scale && e.scale[1] || 1;
            if (s.shadowBlur || s.shadowOffsetX || s.shadowOffsetY) n = s.shadowOffsetX || 0, a = s.shadowOffsetY || 0, o = s.shadowBlur, r = s.shadowColor; else {
                if (!s.textShadowBlur) return void this.removeDom(t, s);
                n = s.textShadowOffsetX || 0, a = s.textShadowOffsetY || 0, o = s.textShadowBlur, r = s.textShadowColor
            }
            i.setAttribute("dx", n / l), i.setAttribute("dy", a / d), i.setAttribute("flood-color", r);
            var u = o / 2 / l + " " + o / 2 / d;
            i.setAttribute("stdDeviation", u), t.setAttribute("x", "-100%"), t.setAttribute("y", "-100%"), t.setAttribute("width", Math.ceil(o / 2 * 200) + "%"), t.setAttribute("height", Math.ceil(o / 2 * 200) + "%"), t.appendChild(i), e._shadowDom = t
        }, UE.prototype.markUsed = function (e) {
            e._shadowDom && LE.prototype.markUsed.call(this, e._shadowDom)
        }, $E.prototype = {
            constructor: $E, getType: function () {
                return "svg"
            }, getViewportRoot: function () {
                return this._viewport
            }, getSvgDom: function () {
                return this._svgDom
            }, getSvgRoot: function () {
                return this._svgRoot
            }, getViewportRootOffset: function () {
                var e = this.getViewportRoot();
                if (e) return {offsetLeft: e.offsetLeft || 0, offsetTop: e.offsetTop || 0}
            }, refresh: function () {
                var e = this.storage.getDisplayList(!0);
                this._paintList(e)
            }, setBackgroundColor: function (e) {
                this._backgroundRoot && this._backgroundNode && this._backgroundRoot.removeChild(this._backgroundNode);
                var t = sE("rect");
                t.setAttribute("width", this.getWidth()), t.setAttribute("height", this.getHeight()), t.setAttribute("x", 0), t.setAttribute("y", 0), t.setAttribute("id", 0), t.style.fill = e, this._backgroundRoot.appendChild(t), this._backgroundNode = t
            }, _paintList: function (e) {
                this.gradientManager.markAllUnused(), this.clipPathManager.markAllUnused(), this.shadowManager.markAllUnused();
                var t, i, n = this._svgRoot, a = this._visibleList, o = e.length, r = [];
                for (t = 0; t < o; t++) {
                    var s = e[t], l = (i = s) instanceof wr ? SE : i instanceof Yn ? IE : i instanceof Ur ? bE : SE,
                        d = XE(s) || jE(s);
                    s.invisible || (s.__dirty && (l && l.brush(s), this.clipPathManager.update(s), s.style && (this.gradientManager.update(s.style.fill), this.gradientManager.update(s.style.stroke), this.shadowManager.update(d, s)), s.__dirty = !1), r.push(s))
                }
                var u, c = function (e, t, i) {
                    return FE.diff(e, t, void 0)
                }(a, r);
                for (t = 0; t < c.length; t++) if ((g = c[t]).removed) for (var h = 0; h < g.count; h++) {
                    d = XE(s = a[g.indices[h]]);
                    var f = jE(s);
                    zE(n, d), zE(n, f)
                }
                for (t = 0; t < c.length; t++) {
                    var g;
                    if ((g = c[t]).added) for (h = 0; h < g.count; h++) d = XE(s = r[g.indices[h]]), f = jE(s), u ? GE(n, d, u) : HE(n, d), d ? GE(n, f, d) : u ? GE(n, f, u) : HE(n, f), GE(n, f, d), u = f || d || u, this.gradientManager.addWithoutUpdate(d || f, s), this.shadowManager.addWithoutUpdate(d || f, s), this.clipPathManager.markUsed(s); else if (!g.removed) for (h = 0; h < g.count; h++) d = XE(s = r[g.indices[h]]), f = jE(s), d = XE(s), f = jE(s), this.gradientManager.markUsed(s), this.gradientManager.addWithoutUpdate(d || f, s), this.shadowManager.markUsed(s), this.shadowManager.addWithoutUpdate(d || f, s), this.clipPathManager.markUsed(s), f && GE(n, f, d), u = d || f || u
                }
                this.gradientManager.removeUnused(), this.clipPathManager.removeUnused(), this.shadowManager.removeUnused(), this._visibleList = r
            }, _getDefs: function (e) {
                var t, i = this._svgDom;
                return 0 !== (t = i.getElementsByTagName("defs")).length ? t[0] : e ? ((t = i.insertBefore(sE("defs"), i.firstChild)).contains || (t.contains = function (e) {
                    var i = t.children;
                    if (!i) return !1;
                    for (var n = i.length - 1; 0 <= n; --n) if (i[n] === e) return !0;
                    return !1
                }), t) : null
            }, resize: function (e, t) {
                var i = this._viewport;
                i.style.display = "none";
                var n = this._opts;
                if (null != e && (n.width = e), null != t && (n.height = t), e = this._getSize(0), t = this._getSize(1), i.style.display = "", this._width !== e || this._height !== t) {
                    this._width = e, this._height = t;
                    var a = i.style;
                    a.width = e + "px", a.height = t + "px";
                    var o = this._svgDom;
                    o.setAttribute("width", e), o.setAttribute("height", t)
                }
                this._backgroundNode && (this._backgroundNode.setAttribute("width", e), this._backgroundNode.setAttribute("height", t))
            }, getWidth: function () {
                return this._width
            }, getHeight: function () {
                return this._height
            }, _getSize: function (e) {
                var t = this._opts, i = ["width", "height"][e], n = ["clientWidth", "clientHeight"][e],
                    a = ["paddingLeft", "paddingTop"][e], o = ["paddingRight", "paddingBottom"][e];
                if (null != t[i] && "auto" !== t[i]) return parseFloat(t[i]);
                var r = this.root, s = document.defaultView.getComputedStyle(r);
                return (r[n] || VE(s[i]) || VE(r.style[i])) - (VE(s[a]) || 0) - (VE(s[o]) || 0) | 0
            }, dispose: function () {
                this.root.innerHTML = "", this._svgRoot = this._backgroundRoot = this._svgDom = this._backgroundNode = this._viewport = this.storage = null
            }, clear: function () {
                this._viewport && this.root.removeChild(this._viewport)
            }, toDataURL: function () {
                return this.refresh(), "data:image/svg+xml;charset=UTF-8," + encodeURIComponent(this._svgDom.outerHTML.replace(/></g, ">\n\r<"))
            }
        }, D(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "pathToImage"], function (e) {
            $E.prototype[e] = function (e) {
                return function () {
                    vi('In SVG mode painter not support method "' + e + '"')
                }
            }(e)
        }), ba("svg", $E), e.version = "4.8.0", e.dependencies = {zrender: "4.3.1"}, e.PRIORITY = Sh, e.init = function (e, t, i) {
            var n = df(e);
            if (n) return n;
            var a = new Nh(e, t, i);
            return a.id = "ec_" + af++, tf[a.id] = a, za(e, rf, a.id), function (e) {
                var t = "__connectUpdateStatus";

                function i(e, i) {
                    for (var n = 0; n < e.length; n++) e[n][t] = i
                }

                kh($h, function (n, a) {
                    e._messageCenter.on(a, function (n) {
                        if (nf[e.group] && 0 !== e[t]) {
                            if (n && n.escapeConnect) return;
                            var a = e.makeActionFromEvent(n), o = [];
                            kh(tf, function (t) {
                                t !== e && t.group === e.group && o.push(t)
                            }), i(o, 0), kh(o, function (e) {
                                1 !== e[t] && e.dispatchAction(a)
                            }), i(o, 2)
                        }
                    })
                })
            }(a), a
        }, e.connect = function (e) {
            if (M(e)) {
                var t = e;
                e = null, kh(t, function (t) {
                    null != t.group && (e = t.group)
                }), e = e || "g_" + of++, kh(t, function (t) {
                    t.group = e
                })
            }
            return nf[e] = !0, e
        }, e.disConnect = sf, e.disconnect = lf, e.dispose = function (e) {
            "string" == typeof e ? e = tf[e] : e instanceof Nh || (e = df(e)), e instanceof Nh && !e.isDisposed() && e.dispose()
        }, e.getInstanceByDom = df, e.getInstanceById = function (e) {
            return tf[e]
        }, e.registerTheme = uf, e.registerPreprocessor = cf, e.registerProcessor = hf, e.registerPostUpdate = function (e) {
            Jh.push(e)
        }, e.registerAction = ff, e.registerCoordinateSystem = gf, e.getCoordinateSystemDimensions = function (e) {
            var t = iu.get(e);
            if (t) return t.getDimensionsInfo ? t.getDimensionsInfo() : t.dimensions.slice()
        }, e.registerLayout = pf, e.registerVisual = vf, e.registerLoading = yf, e.extendComponentModel = kf, e.extendComponentView = Tf, e.extendSeriesModel = wf, e.extendChartView = Cf, e.setCanvasCreator = function (e) {
            p("createCanvas", e)
        }, e.registerMap = function (e, t, i) {
            vh.registerMap(e, t, i)
        }, e.getMap = function (e) {
            var t = vh.retrieveMap(e);
            return t && t[0] && {geoJson: t[0].geoJSON, specialAreas: t[0].specialAreas}
        }, e.dataTool = {}, e.zrender = Da, e.number = Xl, e.format = ud, e.throttle = Sc, e.helper = fp, e.matrix = gt, e.vector = be, e.color = Zt, e.parseGeoJSON = kp, e.parseGeoJson = xp, e.util = Ep, e.graphic = Pp, e.List = Kf, e.Model = Sl, e.Axis = Ap, e.env = a
    }(t)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(246);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\task-chart-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(426), a = i(248);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(759);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "68373646", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\TaskChart.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    t.BSpline = class {
        constructor({points: e = [], degree: t = 4, tessellation: i = 10}) {
            e.length >= 2 ? this.points = [this.getExtendPoint(e[0], e[1]), ...e, this.getExtendPoint(e[e.length - 1], e[e.length - 2])] : this.points = e, this.degree = t, this.tessellation = i, this.curvePoints = [], this.knotVector = [], this.uniformRender()
        }

        getExtendPoint(e, t) {
            return {x: t.x - 2 * (t.x - e.x), y: t.y - 2 * (t.y - e.y)}
        }

        uniformRender() {
            if (this.createKnots(), this.points.length < 2) return;
            let e = 1 / this.tessellation;
            for (let t = this.knotVector[this.degree]; t < this.knotVector[this.knotVector.length - this.degree - 1]; t += e) {
                let e = this.deBoor(t);
                this.curvePoints.push(e)
            }
            let t = this.deBoor(this.knotVector[this.knotVector.length - this.degree - 1]);
            this.curvePoints.push(t)
        }

        createKnots() {
            if (this.knotVector = [], this.points.length >= 2) {
                let e = this.degree + this.points.length + 1, t = 1 / (e - 1);
                for (let i = 0; i < e; i++) this.knotVector.push(i * t)
            }
        }

        deBoor(e) {
            let t = 0, i = 0;
            for (let n = 0; n < this.points.length; n++) {
                let a = this.basisFunction(n, this.degree, e);
                a > 0 && (t += this.points[n].x * a, i += this.points[n].y * a)
            }
            return [t, i]
        }

        basisFunction(e, t, i) {
            if (0 === t) return this.knotVector[e] <= i && i < this.knotVector[e + 1] ? 1 : 0;
            let n = (i - this.knotVector[e]) / (this.knotVector[e + t] - this.knotVector[e]),
                a = (this.knotVector[e + t + 1] - i) / (this.knotVector[e + t + 1] - this.knotVector[e + 1]);
            return n * this.basisFunction(e, t - 1, i) + a * this.basisFunction(e + 1, t - 1, i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(914);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(408), a = i(250);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\XlHeader.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(409), a = i(252);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\XlDetail.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(410), a = i(254);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(763);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "93d3b760", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\FileList.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(916);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(411), a = i(256);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\multi-chosen-tasks.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(424), a = i(258);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\multi-chosen-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(412), a = i(260);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(767);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "3b3b3296", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\Recommend.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(918);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(920);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(262);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(392), a = i(264);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(268);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\downloading-item-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(427), a = i(270);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\downloading-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(479), o = i(774), r = i(0), s = i(43), l = i(62), d = r.default.getLogger("Thunder.QueryTaskInfo");
    const u = new class extends a.HttpSession {
        constructor() {
            super(), this.lastActiveTaskId = -1, this.curBatchQueryId = void 0, this.timerId = null
        }

        queryP2spTaskInfo(e) {
            return n(this, void 0, void 0, function* () {
                return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), 0 === e.indexOf("ed2k://") && -1 === e.indexOf("|") && (e = e.replace(/%7C/g, "|")), new Promise(t => {
                    this.queryResInfo("url", e).then(e => {
                        let i = {result: 0, gcid: "", fileSize: 0, errCode: 0};
                        e && 200 === e.status && null !== e.data && null !== e.data.result && "ok" === e.data.result && "" !== e.data.gcid ? (i.result = e.data.code, i.fileSize = e.data.file_size, i.gcid = e.data.gcid, t(i)) : t(null)
                    }).catch(() => {
                        t(null)
                    })
                })
            })
        }

        asyncBatchQueryP2spTaskInfoByUrl(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if (!e || 0 === e.length) return 0;
                void 0 === this.curBatchQueryId ? this.curBatchQueryId = 1 : this.curBatchQueryId += 1;
                let n = 0;
                for (; n < e.length; ++n) {
                    let i = yield this.queryP2spTaskInfo(e[n]);
                    i && t(e[n], i, n), yield this.delay(200)
                }
                return n >= e.length && i && "function" == typeof i && i(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 i = null;
                    200 === e.statusCode && e.body && e.body.length > 12 && (i = o.QueryTaskInfoPackageNS.praseEd2kTaskInfoBuffer(e.body)), d.information("postRequestEd2kTaskInfoByEd2kLink", i), t(i)
                }, e => {
                    d.warning("postRequestEd2kTaskInfoByEd2kLink", e), t(null)
                })
            })
        }

        delay(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    setTimeout(t, e)
                })
            })
        }

        queryResInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                return l.fetchPCRes({url: "/xlppc.resinfo.api/v1/queryresinfo", data: {type: e, res: t}}, "prod")
            })
        }
    };
    !function (e) {
        e.postRequestEd2kTaskInfoByEd2kLink = function (e) {
            return n(this, void 0, void 0, function* () {
                return u.postRequestEd2kTaskInfoByEd2kLink(e)
            })
        }, e.asyncBatchQueryP2spTaskInfoByUrl = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                return u.asyncBatchQueryP2spTaskInfoByUrl(e, t, i)
            })
        }, e.queryResInfo = function (e, t) {
            return n(this, void 0, void 0, function* () {
                return u.queryResInfo(e, t)
            })
        }
    }(t.QueryTaskInfoHelperNS || (t.QueryTaskInfoHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(7), o = i(775), r = i(776), s = i(0).default.getLogger("Thunder.QueryTaskInfoPackage"),
        l = a.default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = 0;

        function i() {
            let e = 0, t = n.join(__rootDir, "../../Thunder.exe"), i = l.getFileVersion(t).split(".");
            if (i && 4 === i.length) {
                e = 26 * Number(i[0]).valueOf() + 18 * Number(i[1]).valueOf() + Number(i[3]).valueOf()
            }
            return e
        }

        function a() {
            return l.getPeerID()
        }

        e.createQueryP2spTaskInfoBuffer = function (e) {
            let n = 0, l = Buffer.alloc(10240);
            return s.information("createQueryP2spTaskInfoBuffer protocolVersion", 61, n), n = l.writeUInt32LE(61, n), s.information("createQueryP2spTaskInfoBuffer sequence", t, n), n = l.writeUInt32LE(++t, n), s.information("createQueryP2spTaskInfoBuffer command length", "0", n), n = l.writeUInt32LE(0, n), s.information("createQueryP2spTaskInfoBuffer thunder ver", i(), n), n = l.writeUInt32LE(i(), n), s.information("createQueryP2spTaskInfoBuffer compress flag", "0", n), n = l.writeUInt16LE(0, n), s.information("createQueryP2spTaskInfoBuffer reserved", "0", n), n = r.BufferUtilitiesNS.writeString(l, "", n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer command", "2021", n), n = l.writeUInt16LE(2021, n), s.information("createQueryP2spTaskInfoBuffer by what", "2", n), n = l.writeUInt8(2, n), s.information("createQueryP2spTaskInfoBuffer body length", "0", n), n = l.writeUInt32LE(0, n), s.information("createQueryP2spTaskInfoBuffer url", e, n), n = r.BufferUtilitiesNS.writeString(l, e, n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", "origin url", n), n = r.BufferUtilitiesNS.writeString(l, "", n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", "refurl", n), n = r.BufferUtilitiesNS.writeString(l, "", n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", a(), n), n = r.BufferUtilitiesNS.writeString(l, a(), n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer", "ip", n), n = l.writeInt32LE(0, n), n = l.writeInt32LE(0, n), n = l.writeInt32LE(-1, n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", "length", n), l = l.slice(0, n), 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 i = 0, n = e.readUInt32LE(i);
                s.information("protocolVersion:", n), i += 4;
                let a = e.readUInt32LE(i);
                s.information("sequence:", a), i += 4;
                let l = e.readUInt32LE(i);
                s.information("commandLegth:", l), i += 4;
                let d = e.readUInt32LE(i);
                s.information("thunderVersion:", d), i += 4;
                let u = e.readUInt16LE(i);
                s.information("compressFlag:", u), i += 2, i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0];
                let c = e.readUInt16LE(i);
                if (s.information("commandType:", c), i += 2, t.result = e.readUInt8(i), i += 1, 1 === t.result) {
                    i = r.BufferUtilitiesNS.readString(e, i, "hex")[0];
                    let n = r.BufferUtilitiesNS.readUInt64LE(e, i);
                    i = n[0], t.fileSize = n[1];
                    let a = r.BufferUtilitiesNS.readString(e, i, "hex");
                    i = a[0], t.gcid = a[1].toUpperCase(), s.information("gcid", a[1])
                } else t.errCode = e.readUInt32LE(i);
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.warning("decryptHttpBuffer", e)
            }
            return t
        }, e.createQueryEd2kTaskInfoBuffer = function (e) {
            let n = 0, d = Buffer.alloc(4096);
            s.information("createQueryEd2kTaskInfoBuffer protocolVersion", 60, n), n = d.writeUInt32LE(60, n), s.information("createQueryEd2kTaskInfoBuffer sequence", t, n), n = d.writeUInt32LE(++t, n), s.information("createQueryEd2kTaskInfoBuffer command length", "0", n), n = d.writeUInt32LE(0, n), s.information("createQueryEd2kTaskInfoBuffer thunder ver", i(), n), n = d.writeUInt32LE(i(), n), s.information("createQueryEd2kTaskInfoBuffer compress flag", "0", n), n = d.writeUInt16LE(0, n), s.information("createQueryEd2kTaskInfoBuffer reserved", "0", n), n = r.BufferUtilitiesNS.writeString(d, "", n, "utf-8"), s.information("createQueryEd2kTaskInfoBuffer command", "5001", n), n = d.writeUInt16LE(5001, n), s.information("createQueryEd2kTaskInfoBuffer", a(), n), n = r.BufferUtilitiesNS.writeString(d, a(), n, "utf-8");
            let u = l.parseEd2kUrl(e), c = u.fileHash;
            n = d.writeInt32LE(c.length / 2, n);
            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), n = d.writeUInt8(h << 4 | f, n);
            return n = r.BufferUtilitiesNS.writeUInt64LE(d, u.fileSize, n), n = d.writeInt32LE(0, n), n = r.BufferUtilitiesNS.writeString(d, "", n, "utf-8"), n = d.writeInt32LE(0, n), n = r.BufferUtilitiesNS.writeString(d, e, n, "utf-8"), d = d.slice(0, n), s.information("createQueryEd2kTaskInfoBuffer before encrypt", d, n), d = o.ShubCryptoNS.encryptHttpBuffer(d)
        }, e.praseEd2kTaskInfoBuffer = function (e) {
            let t = {result: 0, hasRecord: 0, gcid: ""};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e), s.information("praseEd2kTaskInfoBuffer buffer", e);
                let i = 0, n = e.readUInt32LE(i);
                s.information("protocolVersion:", n), i += 4;
                let a = e.readUInt32LE(i);
                s.information("sequence:", a), i += 4;
                let l = e.readUInt32LE(i);
                s.information("commandLegth:", l), i += 4;
                let d = e.readUInt32LE(i);
                s.information("thunderVersion:", d), i += 4;
                let u = e.readUInt16LE(i);
                s.information("compressFlag:", u), i += 2, i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0];
                let c = e.readUInt16LE(i);
                if (s.information("commandType:", c), i += 2, t.result = e.readUInt8(i), i += 1, 1 === t.result && (t.hasRecord = e.readInt32LE(i), i += 4, 1 === t.hasRecord)) {
                    i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0], i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0], i = r.BufferUtilitiesNS.readString(e, i, "hex")[0];
                    let n = r.BufferUtilitiesNS.readString(e, i, "hex");
                    i = n[0], t.gcid = n[1].toUpperCase()
                }
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.warning("decryptHttpBuffer", e)
            }
            return s.information("praseEd2kTaskInfoBuffer response", t), t
        }
    }(t.QueryTaskInfoPackageNS || (t.QueryTaskInfoPackageNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(116), a = i(74), o = i(73), r = i(35), s = i(0).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 = n.Buffer.alloc(20);
                e.copy(t, 0, 0, 20);
                let i = n.Buffer.alloc(e.length - 20);
                e.copy(i, 0, 20);
                let o = a.deflateSync(i);
                e = n.Buffer.concat([t, o])
            }
            let i = n.Buffer.alloc(8);
            e.copy(i, 0, 0, 7), i = t(i);
            let o = n.Buffer.alloc(12);
            e.copy(o, 0, 0, 11);
            let s = n.Buffer.alloc(e.length - 12);
            e.copy(s, 0, 12), s = r.ToolsUtilitiesAWNS.encryptBuffer(s, i);
            let l = n.Buffer.concat([o, s]);
            return l.writeUInt32LE(s.length, 8), l
        }, e.decryptHttpBuffer = function (e) {
            let i = null;
            try {
                let o = n.Buffer.alloc(8);
                e.copy(o, 0, 0, 7), o = t(o);
                let l = n.Buffer.alloc(12);
                e.copy(l, 0, 0, 11);
                let d = n.Buffer.alloc(e.length - 12);
                if (e.copy(d, 0, 12), d = r.ToolsUtilitiesAWNS.decryptBuffer(d, o), 0 !== (i = n.Buffer.concat([l, d])).readUInt16LE(16)) {
                    let e = n.Buffer.alloc(20);
                    i.copy(e, 0, 0, 20);
                    let t = n.Buffer.alloc(i.length - 20);
                    i.copy(t, 0, 20);
                    let o = a.inflateSync(t);
                    i = n.Buffer.concat([e, o])
                }
            } catch (e) {
                s.warning("decryptHttpBuffer", e)
            }
            return i
        }
    }(t.ShubCryptoNS || (t.ShubCryptoNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(7).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.writeUInt64LE = function (e, t, i) {
            const n = ~~(t / 4294967295), a = t % 4294967295 - n;
            return i = e.writeUInt32LE(a, i), i = e.writeUInt32LE(n, i)
        }, e.writeString = function (e, t, i, n) {
            let o = null;
            if ("gbk" === n) {
                let e = 936, i = a.utf8StringEncodeToBinary(t, e);
                o = Buffer.from(i, "binary")
            } else o = Buffer.from(t, n);
            return (i = e.writeUInt32LE(o.byteLength, i)) + o.copy(e, i, 0)
        }, e.readUInt64LE = function (e, t) {
            let i = e.readUInt32LE(t);
            t += 4;
            let n = e.readUInt32LE(t);
            return [t += 4, n * Math.pow(2, 32) + i]
        }, e.readString = function (e, t, i) {
            let n = e.readUInt32LE(t);
            t += 4;
            let o = void 0;
            if ("gbk" === i) {
                let i = 936, r = e.toString("binary", t, t + n);
                o = a.utf8StringDecodeFromBinary(r, i)
            } else o = e.toString(i, t, t + n);
            return [t += n, o]
        }
    }(t.BufferUtilitiesNS || (t.BufferUtilitiesNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(430), a = i(272);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\item-vip-expand\\item-vip-speed-plugin.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(274);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\completed-item-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(428), a = i(276);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\completed-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(278);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\recycle-item-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(429), a = i(280);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\recycle-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(922);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(383), a = i(282);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list-skeleton.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(284);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\private-space-open-page-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(393), a = i(286);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\private-space-open-page.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(288);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-search-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(394), a = i(290);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list-search.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(292);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\setting-center-view\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(378), a = i(294);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(802);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\setting-center-view\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(384), a = i(296);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(801);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "69ad46c4", null);
    s.options.__file = "src\\common\\generator-view\\generator-view.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(395), a = i(298);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkbox.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(924);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(416), a = i(312);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(417), a = i(314);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.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, i) {
    "use strict";
    i.r(t);
    var n = i(401), a = i(318);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-radio.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(418), a = i(320);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-container.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(402), a = i(322);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkinput.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(403), a = i(324);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkselect.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(404), a = i(326);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-textarea.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(405), a = i(328);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.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, i) {
    "use strict";
    var n = i(926);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(928);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(930);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(932);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(939);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(941);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(950);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(953);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(956);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(958);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(960);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(963);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(968);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(970);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(972);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(975);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(977);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(979);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(981);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(983);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(986);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(988);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(992);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(997);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1e3);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1002);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1004);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1006);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1010);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1012);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1014);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1016);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1018);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(1020);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(6), r = i(5), s = i(84);
    !function (e) {
        function t(e, t) {
            return n(this, void 0, void 0, function* () {
                if (null !== e) {
                    let i = e.webContents;
                    (yield i.isDevToolsOpened()) ? yield i.closeDevTools() : yield i.openDevTools(t)
                }
            })
        }

        e.openDevTool = t, e.enableDevTools = function (e) {
            return n(this, void 0, void 0, function* () {
                window.addEventListener("keyup", i => n(this, void 0, void 0, function* () {
                    if ("F12" === i.key && i.ctrlKey) s.DevEnvHelperNS.isLogEnable() && (yield t(yield a.asyncRemoteCall.getCurrentWindow(), e)); else if (("t" === i.key || "T" === i.key) && i.altKey && s.DevEnvHelperNS.isLogEnable()) {
                        let e = document.getElementById("DevProcessPid");
                        if (e) document.body.removeChild(e); else {
                            (e = document.createElement("p")).id = "DevProcessPid", e.style.position = "absolute", e.style.left = "0px", e.style.top = "0px", e.style.width = "100%", e.style.zIndex = "10000", e.style.color = "rgb(255,0,0)", document.body.appendChild(e);
                            let t = "process.pid:" + process.pid;
                            t += "\r\nlocation.href:" + location.href, t += "\r\nprocess.argv:" + process.argv, e.innerText = t
                        }
                    }
                }), !0)
            })
        }, e.enableDragOpenFile = function (e) {
            void 0 === e && (e = !1), document.addEventListener("dragover", e => (e.preventDefault(), e.stopPropagation(), !1), !0), document.addEventListener("drop", e => n(this, void 0, void 0, function* () {
                e.preventDefault(), e.stopPropagation();
                let t = e.dataTransfer, i = t.files, n = t.items;
                if (void 0 !== n && null !== n && n.length > 0) for (let e = 0; e < n.length; e++) {
                    let t = n[e];
                    "string" === t.kind && "text/uri-list" === t.type ? t.getAsString(e => {
                        r.client.callServerFunction("DropOpenUrl", e).catch()
                    }) : t.kind
                }
                if (void 0 !== i && null !== i && i.length > 0) for (let e = 0; e < i.length; e++) {
                    let t = i[e].path;
                    void 0 !== t && null !== t && "" !== t && (yield o.FileSystemAWNS.existsAW(t)) && r.client.callServerFunction("DropOpenFile", t).catch()
                }
                return !1
            }), !0)
        }
    }(t.ThunderToolsNS || (t.ThunderToolsNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(11), r = i(5), s = i(46), l = i(13), d = i(0), u = i(7), c = i(43), h = i(3), f = i(9),
        g = i(37), p = i(34), v = i(75), m = i(77), y = i(76), k = i(460),
        T = u.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    class w {
        static getInstance() {
            return null === w.instance && (w.instance = new w), w.instance
        }
    }

    w.instance = null, function (e) {
        const t = ["http://", "https://", "ftp://"], i = "thunder://", u = "ed2k://", C = "magnet:?",
            S = [i, "thunders://", u, C];
        let I = !1;
        const b = d.default.getLogger("ClipBoardNS");

        function _(e) {
            let i = !1;
            if (e) for (let n = 0; n < t.length; ++n) {
                let a = t[n];
                if (0 === e.indexOf(a)) {
                    i = !0;
                    break
                }
            }
            return i
        }

        function D(e) {
            let t = !1;
            if (e) for (let i = 0; i < S.length; ++i) {
                let n = S[i];
                if (0 === e.indexOf(n)) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function A(e) {
            let t = !1;
            return e && (t = 0 === e.indexOf(u)), t
        }

        function N(e) {
            let t = !1;
            return e && (t = 0 === e.indexOf(C)), t
        }

        function x(e, t) {
            let i = !1;
            do {
                if (!e) break;
                if (!t) break;
                if (t.endsWith(";") || (t = `${t};`), t.indexOf(`${e};`) > -1) {
                    i = !0;
                    break
                }
            } while (0);
            return i
        }

        function E(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                let i = "thunderx://";
                if (void 0 === (e = e.trim()) || null === e || "" === e) break;
                0 === e.indexOf(i, 0) && (t = !0)
            } while (0);
            return t
        }

        function P(e) {
            let t = "", i = (e = e.trim()).substring("thunderx://".length), n = i.lastIndexOf("}");
            return n > 0 && (t = i.substring(0, n + 1)), t
        }

        function O(e) {
            let t = e, i = e.substr(C.length).split("&");
            for (let n = 0; n < i.length; ++n) {
                let a = i[n].indexOf("=");
                if (a < 0) continue;
                let o = i[n].substr(0, a);
                if ("xt" === o || 0 === o.indexOf("xt.")) {
                    const o = "urn:btih:";
                    if (i[n].substr(a + 1, o.length) !== o) break;
                    let r = i[n].substr(a + o.length + 1);
                    if (r.length <= 32) break;
                    let s = /[0-9,A-Z,a-z]{40}/;
                    if (s.test(r)) {
                        r.length > 40 && "&" !== r[40] && (b.information("reg test 40"), r = r.substr(0, 40), (a = e.indexOf(r)) >= 0 && (t = e.substr(0, a + r.length))), b.information("urlOut", t, e);
                        break
                    }
                    if ((s = /[0-9,A-Z,a-z]{32}/).test(r)) {
                        "&" !== r[32] && (b.information("reg test 32"), r = r.substr(0, 32), (a = e.indexOf(r)) >= 0 && (t = e.substr(0, a + r.length))), b.information("urlOut", t, e);
                        break
                    }
                }
            }
            return t
        }

        function M(e) {
            let t = e;
            if (e) {
                let n = /[^A-Za-z0-9=\/\+]/g;
                n.lastIndex = i.length, n.exec(e) && (t = e.substr(0, n.lastIndex - 1), b.information("urlOut", t, e))
            }
            return t
        }

        function F(e) {
            let t = e;
            if (e) {
                let i = /\|\//g;
                i.lastIndex = u.length, i.exec(e) && (t = e.substr(0, i.lastIndex), b.information("urlOut", t, e))
            }
            return t
        }

        function L(e, t, i) {
            let n = !0, a = t[0];
            return i - a.length >= 3 && 0 === a.indexOf("http") && "&tr=" === e.substr(i - a.length - "&tr=".length, "&tr=".length) && (n = !1), n
        }

        function R(e) {
            let t = [];
            if (e) {
                let i = function (e) {
                    let t = [], i = /(https?|ftp|thunder|ed2k|magnet):/g, n = i.exec(e), a = -1;
                    for (; n;) {
                        if (L(e, n, i.lastIndex)) {
                            let o = a, r = n[0];
                            a = i.lastIndex - r.length, o >= 0 && t.push(e.substr(o, a - o))
                        }
                        (n = i.exec(e)) || t.push(e.substr(a))
                    }
                    return t
                }(e);
                if (b.information("splitTextByProtocal", i), 1 === i.length) {
                    let e = i[0];
                    if (N(e)) e = O(e); else if (c.Common.isThunderPrivateUrl(e)) e = M(e); else if (A(e)) e = F(e); else {
                        let t = e.trim().match(/([\S]+)/);
                        t && t[0] && (e = t[0])
                    }
                    t.push(e)
                } else i.forEach(e => {
                    N(e = function (e) {
                        let t = e;
                        if (e) {
                            let i = /[ ,\r,\n]/g;
                            i.exec(e) && (t = e.substr(0, i.lastIndex - 1), b.information("urlOut", t, e))
                        }
                        return t
                    }(e = e.trim())) ? e = O(e) : c.Common.isThunderPrivateUrl(e) ? e = M(e) : A(e) ? e = F(e) : _(e) && (e = function (e) {
                        let t = e;
                        if (e) {
                            let i = y.BHOConfigNS.getValue("Monitor", "ExtendNames", y.BHOConfigNS.getDefaultExtendNames()).split(";");
                            i.sort((e, t) => t.length - e.length), b.information("extendNamesArr", i);
                            let n = -1;
                            for (let t = 0; t < i.length; ++t) {
                                if (i[t].length <= 0) continue;
                                let a = e.lastIndexOf(i[t]);
                                b.information("index", a, "endIndex", n, "ext", i[t]), a >= 0 && a >= n && (n = a + i[t].length)
                            }
                            n >= 0 && (t = e.substr(0, n), b.information("urlOut", t, e))
                        }
                        return t
                    }(e)), b.information("validUrl", e), t.push(e)
                })
            }
            return t
        }

        function B(e, t) {
            let i = e.join(" ");
            for (let e = 0; e < t.length; e++) {
                let n = t[e];
                if (0 === n.indexOf("https://pan.xunlei.com/s/")) {
                    if (l.ThunderUtil.getQueryString(n, "pass_code")) {
                        b.information("auto share completely url", n), r.client.callServerFunction("BringMainWndToTop").catch(), r.client.callServerFunction("OpenNewTab", n).catch();
                        break
                    }
                    let a = i.indexOf(n) + n.length, o = i.substring(a);
                    if (e !== t.length - 1) {
                        let n = t[e + 1], r = i.indexOf(n, a);
                        -1 !== r && (o = i.substring(a, r))
                    }
                    let s = /提取码.*?([a-zA-Z0-9]+)/.exec(o);
                    if (s || (s = /.*?([a-zA-Z0-9]+)/.exec(o)), b.information("auto share", s), s && s[1] && 4 === s[1].length) {
                        let e = s[1];
                        b.information("auto share", n, e), n = l.ThunderUtil.setQueryString(n, {pass_code: e}), b.information("auto share open url", n), r.client.callServerFunction("BringMainWndToTop").catch(), r.client.callServerFunction("OpenNewTab", n).catch();
                        break
                    }
                }
            }
        }

        function U(e, t) {
            return n(this, void 0, void 0, function* () {
                if (I) {
                    if (I = !1, !(yield(yield o.asyncRemoteCall.getCurrentWindow()).isVisible())) return
                }
                let i = [], n = f.ConfigNS.getValue("Monitor", "MonitorClipBoard", !0);
                do {
                    if (!n) {
                        b.information("notwatch");
                        break
                    }
                    let o = t.join("");
                    b.information("textList", t), m.URLHelperNS.isBirdKey(o) && (b.information("isbirdkey"), v.openBirdKeyDecodeDialog(o, {from: "clipboard"}));
                    let r = m.URLHelperNS.isYunFetchBackTask(o);
                    if (b.information("clipBoardText", o, "regExp", r), b.information("isYunFetchBackTask regExp", r), r && r.length > 0) {
                        let e = r[1], t = new Buffer(e, "base64").toString("utf8");
                        yield k.ThunderUnionYunFetchBackNS.createTaskFromJsonString(decodeURIComponent(t));
                        break
                    }
                    if (b.information("attachClipBoardCallback type:", e, t), null !== t && void 0 !== t && t.length > 0) {
                        let e = t.join("");
                        if (E(e)) {
                            let t = P(e);
                            g.ThunderNewTask.createThunderxTask(t).catch();
                            break
                        }
                    }
                    let l = y.BHOConfigNS.getValue("Monitor", "ExtendNames", y.BHOConfigNS.getDefaultExtendNames()),
                        d = y.BHOConfigNS.getValue("Monitor", "WatchTraditionLink", 1),
                        u = y.BHOConfigNS.getValue("Monitor", "ConfigWatch_Bt", 1),
                        f = y.BHOConfigNS.getValue("EMuleGenericSettings", "EMuleWatchLink", 1),
                        T = y.BHOConfigNS.getValue("MagnetGenericSettings", "MagnetWatchLink", 1), w = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = R(i);
                        for (let e of n) w[e] = !0
                    }
                    let C = Object.keys(w);
                    if (!C || 0 === C.length) break;
                    B(t, C);
                    for (let e = 0; e < C.length; e++) {
                        let t = C[e];
                        if (!t) continue;
                        let n = t;
                        if (c.Common.isThunderPrivateUrl(t) && (t = c.Common.parseThunderPrivateUrl(t)), !_(t) && !D(t)) {
                            b.information("isVaildUrl && isVaildUrl url:", t);
                            continue
                        }
                        let o = p.ThunderHelper.getTaskTypeFromUrl(t);
                        if (o === h.DownloadKernel.TaskType.P2sp) {
                            if (0 === d && 0 === u) {
                                b.information("taskType: P2sp, watchTraditionLink === 0 && watchBtLink === 0");
                                continue
                            }
                            let e = s.parse(t);
                            if (null === e) continue;
                            let o = a.extname(e.pathname);
                            if (o && (o = o.toLowerCase()), 0 !== d && x(o, l)) b.information("valid watchTraditionLink"); else {
                                if (0 === u || ".torrent" !== o) {
                                    b.information("invalid ext:", o);
                                    continue
                                }
                                b.information("valid watchBtLink")
                            }
                            -1 !== n.indexOf("(*)") || i.includes(n, 0) || i.push(n)
                        } else if (o === h.DownloadKernel.TaskType.Emule) {
                            if (0 === f) {
                                b.information("taskType: Emule, watchBtLink === 0");
                                continue
                            }
                            -1 !== n.indexOf("(*)") || i.includes(n, 0) || i.push(n)
                        } else if (o === h.DownloadKernel.TaskType.Magnet || o === h.DownloadKernel.TaskType.Bt) {
                            if (0 === T) {
                                b.information("taskType: Magnet, watchMagnetLink === 0");
                                continue
                            }
                            g.ThunderNewTask.createBtTaskWindow({url: n, type: "url"}, {source: "clipboard"})
                        }
                    }
                } while (0);
                i.length > 0 && g.ThunderNewTask.createPreNewTaskWindow(i, "clipboard")
            })
        }

        e.init = function (e) {
            I = e, T.initClipBoard(), setTimeout(() => {
                T.attachClipBoard(U)
            }, 1e3)
        }, e.getOperInfoInstance = function () {
            return w.getInstance()
        }
    }(t.ClipBoardNS || (t.ClipBoardNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(18), r = i(11), s = i(2), l = i(6), d = i(13), u = i(7), c = i(14), h = i(9),
        f = a.default.getLogger("MainRendererHelper"), g = u.default(s.join(__rootDir, "../bin/ThunderHelper.node"));
    const p = new class {
        constructor() {
            this.mainWndDataIniPath = s.resolve(__profilesDir, "mainWndData.ini"), this.preBossKeyName = "", this.defaultMainWndWidth = 1060, this.defaultMainWndHeight = 680
        }

        saveMainWndData() {
            return n(this, void 0, void 0, function* () {
                let e = yield r.asyncRemoteCall.getCurrentWindow(), t = yield e.getSize(), i = "normal";
                (yield e.isMaximized()) && (i = "max");
                let n = this.defaultMainWndWidth, a = this.defaultMainWndHeight;
                t && (n = t[0], a = t[1]), g.writeINI(this.mainWndDataIniPath, "MainBody", "ExitState", i), g.writeINI(this.mainWndDataIniPath, "MainBody", "MainWndLastWidth", n.toString()), g.writeINI(this.mainWndDataIniPath, "MainBody", "MainWndLastHeight", a.toString()), f.information("saveMainWndData:", this.mainWndDataIniPath, n, a, i)
            })
        }

        initMainRendererHelper() {
            h.ConfigNS.attachListener(c.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onRegisterBossKey(), this.onInitDefaultPath().catch()
            })
        }

        onInitDefaultPath() {
            return n(this, void 0, void 0, function* () {
                let e = h.ConfigNS.getValue("TaskDefaultSettings", "InitPath", "");
                if ("" === e) {
                    let t = d.ThunderUtil.getMaxFreeDriver();
                    null !== t && "" !== t && (e = t + ":\\迅雷下载")
                }
                "" !== e && h.ConfigNS.setValue("TaskDefaultSettings", "InitPath", e);
                let t = h.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                "" !== t && (yield l.FileSystemAWNS.mkdirsAW(t)) || "" !== e && (yield l.FileSystemAWNS.mkdirsAW(e), h.ConfigNS.setValue("TaskDefaultSettings", "DefaultPath", e))
            })
        }

        onRegisterBossKey() {
            h.ConfigNS.setValue("BossKey", "BossKeyState", !1), this.registerBossKey().catch(), h.ConfigNS.attachListener(c.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                "BossKey" === e && this.registerBossKey().catch()
            })
        }

        registerBossKey() {
            return n(this, void 0, void 0, function* () {
                let e = yield r.asyncRemoteCall.getGlobalShortcut();
                if ("" !== this.preBossKeyName && (yield e.unregister(this.preBossKeyName)), h.ConfigNS.getValue("BossKey", "BossKeySwitch", !1)) {
                    let t = h.ConfigNS.getValue("BossKey", "BossKeyName", "Alt+D");
                    null !== t && void 0 !== t && "" !== t && (e.register(t, () => {
                        o.ipcRenderer.send("closeMainWindow", "BossKey")
                    }), this.preBossKeyName = t)
                }
            })
        }
    };
    t.default = p
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = i(7), s = i(17), l = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        d = a.default.getLogger("BindConfigNS");
    let u = o.resolve(__profilesDir, "BindingConfig.ini");
    !function (e) {
        e.init = function () {
            s.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => n(this, void 0, void 0, function* () {
                d.information("BindConfigNS init userId:", e), l.writeINI(u, "UserInfo", "UserId", e)
            }))
        }
    }(t.BindConfigNS || (t.BindConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(9), r = i(11), s = i(14);
    let l = void 0;

    function d() {
        return n(this, void 0, void 0, function* () {
            let e = void 0;
            if ("browser" === process.type) e = process.argv; else if ("renderer" === process.type) {
                e = (yield r.asyncRemoteCall.getProcess()).argv
            }
            return e
        })
    }

    function u() {
        return n(this, void 0, void 0, function* () {
            return new Promise(e => {
                o.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    let t = o.ConfigNS.getValue("PerformanceTest", "memoryWarning", 500);
                    e(t)
                })
            })
        })
    }

    function c() {
        return n(this, void 0, void 0, function* () {
            do {
                let e = (new Date).getHours();
                if (e < 10 && e > 20) break;
                const t = i(18).dialog;
                let n = "browser" === process.type ? t : yield r.asyncRemoteCall.getDialog();
                if (!n) break;
                let a = {
                    type: "info",
                    title: "内存预警",
                    message: `memory warning in ${process.type} ${process.pid} process`,
                    detail: `进程id ${process.pid}`,
                    buttons: ["close"]
                };
                yield n.showMessageBox(a)
            } while (0)
        })
    }

    t.memoryWarningSupport = function () {
        return n(this, void 0, void 0, function* () {
            do {
                let e = yield d();
                if (!e || 0 === e.length) break;
                if (!e.includes("--autotest:startup")) break;
                let t = yield u();
                if (void 0 !== l) break;
                l = setInterval(() => {
                    let e = process.memoryUsage(), i = e && e.heapUsed;
                    i && i >= 1024 * t * 1024 && (process.takeHeapSnapshot(a.join(__rootDir, `..\\..\\A-Heap-${(new Date).getTime()}.heapsnapshot`)), clearInterval(l), l = null, c().catch())
                }, 1e4)
            } while (0)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(36), o = i(4), r = i(16), s = i(25), l = i(483), d = i(841), u = i(364);
    !function (e) {
        e.adNaviteFunction = new class {
            constructor() {
                this.isRegister = !1
            }

            registerFunction() {
                this.isRegister || (this.isRegister = !0, this.registerNativeFunction(), this.registerServerFunction())
            }

            registerNativeFunction() {
                let e = [{functionName: "SetSceneStatus", nativeFunc: this.setSceneStatus}, {
                    functionName: "ShowAdTips",
                    nativeFunc: this.showTips
                }];
                a.NativeCallNS.registerNativeFunction(e)
            }

            registerServerFunction() {
                let e = {SetSceneStatus: this.ipcSetSceneStatus, ShowAdTips: this.ipcShowTips};
                r.server.registerFunctions(e)
            }

            setSceneStatus(e, t, i, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1];
                    l.adPlatform.setSceneStatus(a, r, n[2]), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            ipcSetSceneStatus(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0] || !i[1]) break;
                    l.adPlatform.setSceneStatus(i[0], i[1], i[2])
                } while (0)
            }

            showTips(e, t, i, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1];
                    d.adTipsManager.showFunctionalTips(r, a), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            ipcShowTips(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0] || !i[1]) break;
                    let t = i[0], n = i[1];
                    d.adTipsManager.showFunctionalTips(n, t)
                } while (0)
            }
        }, e.init = function () {
            e.adNaviteFunction.registerFunction(), setTimeout(() => n(this, void 0, void 0, function* () {
                const {AdPlatformManagerNS: e} = yield Promise.resolve().then(() => i(80));
                e.getInstance().init().catch(), l.adPlatform.initAw().catch()
            }), 5e3);
            let t = 60;
            process.env.DEBUG_AD_TEST && (t = 5), setTimeout(() => {
                u.adLeftBottomHelper.fetchOrderAw().catch()
            }, 1e3 * t);
            let a = 120;
            process.env.DEBUG_JS_TIP && (a = 5), setTimeout(() => {
                d.adTipsManager.initAw().catch()
            }, 1e3 * a)
        }
    }(t.AdManageNS || (t.AdManageNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(153), o = i(842), r = i(843), s = i(33), l = i(11), d = i(844);
    t.adTipsManager = new class {
        constructor() {
            this.marketTips = new o.AdMarketTips, this.functionalTips = new r.AdFunctionalTips, this.webPageTips = new d.AdWebPageTips
        }

        initAw() {
            return n(this, void 0, void 0, function* () {
                (yield l.asyncRemoteCall.getIpcMain()).on(s.ThunderChannelList.channelMRAdTipsClick, (e, t, i) => n(this, void 0, void 0, function* () {
                    i && i.orderType && (i.orderType === a.OrderType.Market ? yield this.marketTips.onClickAw(t, i) : i.orderType === a.OrderType.Functional && (yield this.functionalTips.onClickAw(t, i)))
                })), yield this.webPageTips.initAw(), setTimeout(() => n(this, void 0, void 0, function* () {
                    yield this.marketTips.initAw()
                }), 15e3), setTimeout(() => n(this, void 0, void 0, function* () {
                    yield this.functionalTips.initAw()
                }), 3e4)
            })
        }

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

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(68), o = i(9), r = i(79), s = i(153), l = i(17), d = i(5), u = i(0);
    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 = u.default.getLogger("AdMarketTips")
        }

        initAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                return l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(this, void 0, void 0, function* () {
                    yield this.updateUserInfoAw()
                })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => n(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 n(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 i = e => super[e];
            return n(this, void 0, void 0, function* () {
                try {
                    switch (yield i("handleEventAW").call(this, e, t), e) {
                        case"ad_load":
                            let n = yield this.downloadResourcesAW();
                            this.logger.information("downloadResourcesAW result", n), n && (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 n(this, void 0, void 0, function* () {
                try {
                    let e = yield d.client.callServerFunction("GetUserInfo", 2);
                    if (e) {
                        let t = JSON.parse(e).isVip;
                        this.isVip = t > 0, this.isVip && this.clearAllTips()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        getShownOrderIdAw() {
            return n(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(), i = "";
            e === t ? "" !== (i = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === i.slice(i.length - 1) && (i = i.slice(0, i.length - 1)) : o.ConfigNS.setValue("AdMarketTips", "TheDate", t), i = "" !== i ? `${i},${this.curShowOrder.orderId}` : `${this.curShowOrder.orderId}`, o.ConfigNS.setValue("AdMarketTips", "shownOrders", i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(68), r = i(35), s = i(6), l = i(79), d = i(153), u = i(60), c = i(0);
    t.AdFunctionalTips = class extends d.AdTips {
        constructor() {
            super(), this.readyScenesMap = new Map, this.orderType = d.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 i = this.readyScenesMap.get(t);
                if (!i) {
                    this.logger.information("showTip:sceneName 有问题");
                    break
                }
                this.curSelectScene = i, super.showTip(e)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                let t = e("fetchOrdersAw").call(this);
                return this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const i = e => super[e];
            return n(this, void 0, void 0, function* () {
                switch (yield i("handleEventAW").call(this, e, t), e) {
                    case"ad_load":
                        let n = yield this.downloadResourcesAW();
                        this.logger.information("downloadResourcesAW result", n), n && (yield this.downloadScenes(), yield this.loadAllScenes())
                }
            })
        }

        downloadScenes() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (null === this.curSelectOrder || void 0 === this.curSelectOrder) break;
                    const {UnzipUtilitiesAWNS: e} = yield Promise.resolve().then(() => i(139));
                    let t = this.curSelectOrder.scenes;
                    if (!(t.length <= 0)) for (let i = 0; i < t.length; ++i) {
                        let n = t[i], o = n.url, l = n.md5, d = `${n.name}.zip`, c = a.join(this.adDataScenesDir, d);
                        this.logger.information("downloadScenes:", o, c);
                        let h = yield u.AxiosNS.downloadFileAW(o, c);
                        if (this.logger.information("下载场景包：result = ", h, ";fileName = ", d), h) {
                            if (!1 === (h = yield r.ToolsUtilitiesAWNS.matchFileMd5(c, l))) {
                                this.logger.information("校验MD5值没通过，故删除该文件", l), yield s.FileSystemAWNS.unlinkAW(c);
                                continue
                            }
                            h = yield e.uncompressZipFile(`${this.adDataScenesDir}/`, c), this.logger.information("解压场景包：result = ", h, ";fileName = ", d), yield s.FileSystemAWNS.unlinkAW(c)
                        }
                    }
                } while (0)
            })
        }

        loadAllScenes() {
            return n(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 i = e[t], n = i.name, r = this.readyScenesMap.get(n);
                        if (null === r || void 0 === r) {
                            this.readyScenesMap.set(n, i);
                            let e = a.join(this.adDataScenesDir, n);
                            yield o.AdHelperNS.loadScene(e)
                        }
                    }
                } while (0)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(68), o = i(9), r = i(79), s = i(153), l = i(17), d = i(5), u = i(13), c = i(107), h = i(146), f = i(0),
        g = i(11);
    t.AdWebPageTips = class extends s.AdTips {
        constructor() {
            super(), this.isVip = !1, this.lastShowTime = 0, this.orderType = s.OrderType.WebPage, this.tipsPriority = r.MsgQueueNS.MsgPriority.AdvertisementMarket, this.positionId = 1352, this.logger = f.default.getLogger("AdWebPageTips")
        }

        initAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                return l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(this, void 0, void 0, function* () {
                    yield this.updateUserInfoAw()
                })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => n(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
                }
                this.logger.information("showTip");
                let t = e[0].materialId;
                super.showTip(t)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return n(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
            })
        }

        createTip(e) {
            let t = !0, i = u.ThunderUtil.deepCopy(e);
            h.NotificationHelper.notify({
                title: i.title || "迅雷TIPS",
                type: c.Notification.TipsType.AdvertisementWebPageTips,
                width: i.width || 316,
                height: i.height ? i.height + 30 : 296,
                duration: i.timeout ? 1e3 * i.timeout : 6e3,
                noDelay: !0,
                name: this.tipsName,
                priority: this.tipsPriority,
                url: i.targetUrl,
                data: {exData: i}
            }, (e, ...o) => n(this, void 0, void 0, function* () {
                if ("webpage_loading" === e) this.curShowOrder = this.curSelectOrder, this.curShowScene = this.curSelectScene, this.curShowMaterialId = i.materialId; else if ("webpage_load_failed" === e) this.handleEventAW("ad_noshow", "loaderror").catch(); else if ("webpage_loaded" === e) this.handleEventAW("ad_show").catch(); else if ("click" === e) {
                    t = !1, this.handleEventAW("ad_click", "img").catch();
                    let [e] = o;
                    a.AdHelperNS.execute(i.openType, e), 1 === i.openType && (yield g.asyncRemoteCall.getCurrentWindow()).show()
                } else "click_close" === e ? (t = !1, this.handleEventAW("ad_closed", "btnClose").catch()) : "closed" === e && t && this.handleEventAW("ad_closed", "auto").catch()
            }))
        }

        parseOrders(e) {
            let t = [];
            if (this.orderType !== s.OrderType.WebPage) throw this.logger.warning("parseOrders only for orders width type [WebPage]"), new Error("parseOrders only for orders width type [WebPage]");
            for (let i = 0; i < e.length; ++i) {
                let n = {}, a = e[i];
                n.orderId = a.orderId, this.logger.information("parseOrders: orderId = ", a.orderId);
                let o = a.materials;
                if (!o || o.length <= 0) this.logger.warning("parseOrders: has no materials"); else {
                    n.materials = [];
                    for (let e of o) {
                        let t = {};
                        if (t.materialId = e.material_id, t.openType = e.open_type, t.targetUrl = e.open_url, t.style = e.type, this.orderType === s.OrderType.WebPage) {
                            let i = {
                                10101: {key: "title", type: "string"},
                                10901: {key: "width", type: "number"},
                                10902: {key: "height", type: "number"},
                                10906: {key: "timeout", type: "number"},
                                10910: {key: "targetUrl", type: "string"}
                            };
                            e.data.map(e => {
                                let n = i[e.asset];
                                n && ("number" === n.type ? t[n.key] = parseInt(e.value, 10) : t[n.key] = String(e.value))
                            })
                        }
                        t.targetUrl ? n.materials.push(t) : this.logger.warning("parseOrder: targetUrl missing")
                    }
                    t.push(n)
                }
            }
            return this.logger.information("parseOrder done. orders = ", t), t
        }

        handleEventAW(e, t) {
            const i = e => super[e];
            return n(this, void 0, void 0, function* () {
                try {
                    switch (yield i("handleEventAW").call(this, e, t), e) {
                        case"ad_load":
                            let n = yield this.downloadResourcesAW();
                            this.logger.information("downloadResourcesAW result", n), n && (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 n(this, void 0, void 0, function* () {
                try {
                    let e = yield d.client.callServerFunction("GetUserInfo", 2);
                    if (e) {
                        let t = JSON.parse(e).isVip;
                        this.isVip = t > 0, this.isVip && this.clearAllTips()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        getShownOrderIdAw() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                return yield a.AdHelperNS.onConfigInitAw(), o.ConfigNS.getValue("AdWebPageTips", "TheDate", "") === a.AdHelperNS.getCurDate() && "" !== (e = o.ConfigNS.getValue("AdWebPageTips", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        saveShownOrders() {
            let e = o.ConfigNS.getValue("AdWebPageTips", "TheDate", ""), t = a.AdHelperNS.getCurDate(), i = "";
            e === t ? "" !== (i = o.ConfigNS.getValue("AdWebPageTips", "shownOrders", "")) && "," === i.slice(i.length - 1) && (i = i.slice(0, i.length - 1)) : o.ConfigNS.setValue("AdWebPageTips", "TheDate", t), i = "" !== i ? `${i},${this.curShowOrder.orderId}` : `${this.curShowOrder.orderId}`, o.ConfigNS.setValue("AdWebPageTips", "shownOrders", i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(36), r = i(4), s = i(25), l = i(464), d = i(27), u = i(17),
        c = a.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}];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            attachCallbackEvent(e, t, i, n) {
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = n[0], o = n[1];
                u.NativeCallModule.nativeCall.AttachNativeEvent(a, (...e) => {
                    d.NativeCallHostModule.nativeCallHost.fireNativeEvent(o, ...e)
                }), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            }

            createTipsWnd(e, t, i, n) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i) || r.isNullOrUndefined(n)) break;
                    if (r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], d = "", u = null, c = null;
                    r.isNullOrUndefined(n[2]) || (u = n[2]), r.isNullOrUndefined(n[3]) || (c = n[3]), r.isNullOrUndefined(n[4]) || (d = n[4]), l.TipsHelperNS.tipsUIHelper.createTipsWnd(a, o, u, c, d).catch(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isTipsWndShow(e, t, i) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) break;
                    let n = l.TipsHelperNS.tipsUIHelper.isTipsWndShow();
                    e.callNativeFunctionCallback(t, i, n)
                } while (0)
            }

            isMainWndShow(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) break;
                        let n = yield l.TipsHelperNS.tipsUIHelper.isMainWndShow();
                        e.callNativeFunctionCallback(t, i, n)
                    } while (0)
                })
            }

            closeTipsWnd(e, t, i) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) break;
                    l.TipsHelperNS.tipsUIHelper.closeTipsWnd(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showOrHideTipsWnd(e, t, i, n) {
                c.information("showOrHideTipsWnd", e, t, i);
                let a = !1, o = null, d = null, u = null, h = null;
                r.isNullOrUndefined(n[0]) || (a = n[0]), r.isNullOrUndefined(n[1]) || (o = n[1]), r.isNullOrUndefined(n[2]) || (d = n[2]), r.isNullOrUndefined(n[3]) || (u = n[3]), r.isNullOrUndefined(n[4]) || (h = n[4]), l.TipsHelperNS.tipsUIHelper.showOrHideTipsWnd(a, o, d, u, h), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.TipsNaviteFunctionNS || (t.TipsNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(36), o = i(25), r = i(27), s = i(13), l = i(146),
        d = n.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.NativeCallNS.registerNativeFunction(e)
                }
            }

            showNotification(e, t, i, n) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    if (s.ThunderUtil.isUndef(n) || s.ThunderUtil.isUndef(n[0])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(n[0]);
                        if (d.information("showNotification", "options", a), !a) break;
                        let u = n[1], c = null;
                        d.information("notificationCallBackId", u), s.ThunderUtil.isDef(u) && (c = ((...e) => {
                            r.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, u, ...e)
                        })), l.NotificationHelper.notify(a, c)
                    } catch (n) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NotificationNaviteFunctionNS || (t.NotificationNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(17), r = i(145), s = i(0), l = i(13), d = i(6), u = i(358), c = i(469), h = i(848),
        f = i(357), g = i(11), p = s.default.getLogger("MainRenderer"), {isDef: v, isUndef: m} = l.ThunderUtil, y = !1;
    let k = !1, T = !1, w = "", C = `${__profilesDir}/user-skin-info.json`, S = !1, I = null;

    function b(e) {
        let t = !1;
        do {
            let i;
            try {
                i = JSON.parse(localStorage.getItem("coolShakes"))
            } catch (e) {
                p.warning(e);
                break
            }
            let n = null;
            if (n = (i || []).find(t => t.id === e.skinID), m(n)) break;
            if (n.is_svip || n.is_vip) {
                t = n.is_svip ? T : k;
                break
            }
            t = !0;
            break
        } while (0);
        return t
    }

    function _(e, t = !1, i = !1) {
        return n(this, void 0, void 0, function* () {
            if (y) {
                if (t || function (e) {
                    let t, i, n = !0;
                    do {
                        if (e.type !== r.SkinHelperNS.SkinType.Wallpaper) break;
                        try {
                            t = JSON.parse(localStorage.getItem("wallpapers"))
                        } catch (e) {
                            p.warning(e);
                            break
                        }
                        if (i = (t || []).find(t => t.id === e.skinID), v(i) && i.is_vip) {
                            n = k;
                            break
                        }
                        try {
                            t = JSON.parse(localStorage.getItem("coolWallpapers"))
                        } catch (e) {
                            p.warning(e);
                            break
                        }
                        if (i = (t || []).find(t => t.id === e.skinID), m(i)) break;
                        if (i.is_svip || i.is_vip) {
                            n = i.is_svip ? T : k;
                            break
                        }
                    } while (0);
                    return n
                }(e)) {
                    if (e.type !== r.SkinHelperNS.SkinType.Default && e.type !== r.SkinHelperNS.SkinType.Color && e.type !== r.SkinHelperNS.SkinType.Wallpaper || (yield h.default.enableSuperCoolWallpaper(!1)), 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 || e.type === r.SkinHelperNS.SkinType.Cool) {
                        let {
                            colors: {
                                colorGradientBackground: t,
                                colorGradientForeground: i,
                                colorPrimaryControl1: n,
                                colorPrimaryControl2: a,
                                colorPrimaryControl3: o,
                                colorPrimaryControl4: s,
                                colorSearch: d,
                                colorPrimaryText: u,
                                colorPrimary: c,
                                colorPrimaryGradient: f,
                                colorSecondary: g,
                                colorAccordion: p
                            }, opacity: v, opacityDesc: m, image: y
                        } = e;
                        if (document.body.classList.add("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                            "--background-main": "",
                            "--color-primary-theme": `${c}`,
                            "--color-primary-control-1": `${n}`,
                            "--color-primary-control-2": `${a}`,
                            "--color-primary-control-3": `${o}`,
                            "--color-primary-control-4": `${s}`,
                            "--color-primary-gradient-1": `${f[0]}`,
                            "--color-primary-gradient-2": `${f[1]}`,
                            "--color-primary-text": `${u}`,
                            "--color-search": `${d}`,
                            "--color-secondary": `${g}`,
                            "--color-gradient-background-1": `${t[0]}`,
                            "--color-gradient-background-2": `${t[1]}`,
                            "--color-gradient-foreground-1": `${i[0]}`,
                            "--color-gradient-foreground-2": `${i[1]}`,
                            "--color-accordion-1": `${p[0]}`,
                            "--color-accordion-2": `${p[1]}`,
                            "--default-opacity-1": m ? `${v + .1}` : `${v - .1}`,
                            "--default-opacity-2": m ? `${v - .1}` : `${v + .1}`
                        }), e.type === r.SkinHelperNS.SkinType.Wallpaper || e.type === r.SkinHelperNS.SkinType.Cool) {
                            let t = new Image;
                            t.addEventListener("load", () => {
                                l.ThunderUtil.setCSSProperties(document.body, {"--background-main": `url("${y}")`}), e.type === r.SkinHelperNS.SkinType.Cool && h.default.enableSuperCoolWallpaper(!0).catch()
                            }), t.src = y
                        }
                    }
                } else try {
                    yield a.client.callServerFunction("SetSkinInfo", r.SkinHelperNS.defaultSkinInfo)
                } catch (e) {
                    p.warning(e)
                }
                i || (yield N(w))
            }
        })
    }

    function D() {
        return n(this, void 0, void 0, function* () {
            {
                let e = yield f.default.getShakeInfo(w);
                e ? b(e) && (yield h.default.enableSuperCoolShake(!0, e)) : yield h.default.enableSuperCoolShake(!1)
            }
        })
    }

    function A(e) {
        return n(this, void 0, void 0, function* () {
            if (m(e) || e) {
                let e = yield a.client.callServerFunction("GetUserInfo", 2), t = null;
                if (e) {
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        p.warning(e)
                    }
                    if (t) {
                        k = "1" === t.isVip;
                        let e = Number(t.vasType).valueOf();
                        T = k && 5 === e
                    }
                }
            } else k = !1, T = !1;
            try {
                yield f.default.setSkinInfo(f.default.getFeaturedSkinInfo())
            } catch (e) {
                p.warning(e)
            }
        })
    }

    function N(e) {
        return n(this, void 0, void 0, function* () {
            try {
                let t = {}, i = yield a.client.callServerFunction("GetSkinInfo"),
                    n = yield c.SpringFestivalSkinNS.canShowSkin();
                if (i.is_spring_festival && n && (i = I), m(i)) return;
                let o = "{}";
                if (I = i, "" !== e) {
                    (yield d.FileSystemAWNS.existsAW(C)) && (o = (yield d.FileSystemAWNS.readFileAW(C)).toString() || "{}", t = JSON.parse(o)), (t = JSON.parse(o))[e] = i, delete t[e].colors, yield d.FileSystemAWNS.writeFileAW(C, JSON.stringify(t))
                }
            } catch (e) {
                p.warning(e)
            }
        })
    }

    a.client.attachServerEvent("OnChangeSkin", (e, ...t) => {
        _(t[0], t[1], t[2]).catch()
    }), a.client.attachServerEvent("OnChangeShake", (e, ...t) => {
        (function (e, t = !1) {
            return n(this, void 0, void 0, function* () {
                if (v(e)) {
                    if (t || b(e)) {
                        let t = void 0;
                        yield h.default.enableSuperCoolShake(!0, e, t)
                    }
                } else yield h.default.enableSuperCoolShake(!1);
                t || (yield f.default.handleShakeSave(w, e))
            })
        })(t[0], t[1]).catch()
    }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => n(this, void 0, void 0, function* () {
        do {
            try {
                yield A(!0), w = e, D().catch();
                let t = (yield d.FileSystemAWNS.readFileAW(C)).toString(), i = JSON.parse(t)[e],
                    n = yield a.client.callServerFunction("GetSkinInfo");
                I = i;
                let o = JSON.parse(localStorage.getItem("wallpapers"));
                null === o && (o = ((yield u.default.getWallpapers()) || []).sort((e, t) => e.manual_order - t.manual_order) || []);
                let r = o.find(e => e.id === i.skinID), s = o.find(e => e.id === n.skinID);
                if (!r) {
                    o = null;
                    try {
                        o = JSON.parse(localStorage.getItem("coolWallpapers"))
                    } catch (e) {
                    }
                    null === o && (o = ((yield u.default.getCoolWallpapers()) || []).sort((e, t) => e.manual_order - t.manual_order) || []), r = o.find(e => e.id === i.skinID)
                }
                if (S && (S = !1, !s || s && !s.is_vip || s && s.is_vip && k)) return void (yield N(e));
                if ("" !== t && (!r || k && r.is_vip || !r.is_vip)) {
                    if (yield c.SpringFestivalSkinNS.canShowSkin()) break;
                    yield a.client.callServerFunction("SetSkinInfo", i)
                }
            } catch (e) {
                p.warning(e)
            }
        } while (0)
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => n(this, void 0, void 0, function* () {
        try {
            w = "", yield A(!1)
        } catch (e) {
            p.warning(e)
        }
        yield h.default.enableSuperCoolShake(!1)
    })), function () {
        return n(this, void 0, void 0, function* () {
            (yield g.asyncRemoteCall.getIpcMain()).on("update-skin-reserved", (e, t) => {
                S = t
            })
        })
    }().catch()
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(11), o = i(6), r = i(0), s = i(13), l = r.default.getLogger("SuperCoolSkinHelper"), d = 680, u = .88,
        c = {width: 4096, height: 2160};
    t.default = new class {
        constructor() {
            this.injected = !1, this.moveAttachFunc = void 0, this.shakeAttachFunc = void 0, this.currentShakeInfo = void 0, this.preShakeTime = void 0, this.shakeStartTime = void 0, this.delayShakeTimerId = void 0, this.movements = []
        }

        enableSuperCoolWallpaper(e) {
            return n(this, void 0, void 0, function* () {
                let t = yield a.asyncRemoteCall.getCurrentWindow();
                if (e) {
                    if (!this.moveAttachFunc) {
                        this.onMainWindowMove(), this.moveAttachFunc = this.onMainWindowMove.bind(this), t.on("move", this.moveAttachFunc);
                        let e = yield(yield a.asyncRemoteCall.getScreen()).getPrimaryDisplay(), i = e.size.width,
                            n = e.size.height, o = c.width / i, r = c.height / n;
                        o <= r ? n = c.height / o : i = c.width / r;
                        let l = document.querySelector(".xlx-media");
                        s.ThunderUtil.setCSSProperties(l, {
                            "background-size": `${i}px ${n}px`,
                            "background-repeat": "repeat"
                        })
                    }
                } else if (this.moveAttachFunc) {
                    t.removeListener("move", this.moveAttachFunc), this.moveAttachFunc = void 0;
                    let e = document.querySelector(".xlx-media");
                    s.ThunderUtil.setCSSProperties(e, {
                        "background-position": "center top",
                        "background-size": "cover",
                        "background-repeat": "no-repeat"
                    })
                }
            })
        }

        doMove() {
            let e = void 0, t = void 0;
            e = `${0 - window.screenLeft}px`, t = `${0 - window.screenTop}px`;
            let i = document.querySelector(".xlx-media");
            s.ThunderUtil.setCSSProperties(i, {"background-position": `${e} ${t}`})
        }

        onMainWindowMove() {
            let e = void 0;
            e = setTimeout(() => {
                void 0 !== e && (clearTimeout(e), e = void 0), this.doMove()
            }, 15)
        }

        enableSuperCoolShake(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = yield a.asyncRemoteCall.getCurrentWindow();
                e ? (this.injectJs(i), this.currentShakeInfo && this.currentShakeInfo.image !== t.image && window.stopCoolSkinShake && window.stopCoolSkinShake(), this.currentShakeInfo = t, l.information("update current shakeinfo", this.currentShakeInfo), this.shakeAttachFunc || (this.shakeAttachFunc = this.onMainWindowShake.bind(this), n.on("move", this.shakeAttachFunc))) : (this.currentShakeInfo = void 0, window.stopCoolSkinShake && window.stopCoolSkinShake(), this.shakeAttachFunc && (n.removeListener("move", this.shakeAttachFunc), this.shakeAttachFunc = void 0))
            })
        }

        previewShake(e) {
            return n(this, void 0, void 0, function* () {
                window.startCoolSkinShake && (yield o.FileSystemAWNS.existsAW(e)) && window.startCoolSkinShake({
                    image: e,
                    count: 30
                })
            })
        }

        injectJs(e) {
            do {
                if (this.injected) {
                    e && e();
                    break
                }
                this.injected = !0;
                let t = document.createElement("script");
                t.setAttribute("type", "text/javascript"), t.src = `file:///${__rootDir}/out/shake-skin.js`, t.onload = function () {
                    this.parentNode.removeChild(this), e && e()
                }, document.body.appendChild(t)
            } while (0)
        }

        doShake() {
            if (void 0 !== this.delayShakeTimerId && (clearTimeout(this.delayShakeTimerId), this.delayShakeTimerId = void 0), this.preShakeTime = void 0, this.shakeStartTime = void 0, this.movements = null, this.movements = [], window.startCoolSkinShake && this.currentShakeInfo) {
                let e = this.currentShakeInfo.count || 30, t = this.currentShakeInfo.rotate || 0, i = 10, n = 4;
                this.currentShakeInfo.time && this.currentShakeInfo.time.length >= 2 && (this.currentShakeInfo.time[0] && (i = isNaN(Number(this.currentShakeInfo.time[0])) ? 10 : Number(this.currentShakeInfo.time[1]) || 1), i = this.currentShakeInfo.time[0] || 10, void 0 !== this.currentShakeInfo.time[1] && null !== this.currentShakeInfo.time[1] && (n = isNaN(Number(this.currentShakeInfo.time[1])) ? 4 : Number(this.currentShakeInfo.time[1]))), window.startCoolSkinShake({
                    image: this.currentShakeInfo.image,
                    count: e,
                    rotate: t,
                    durationMax: i,
                    durationMin: n
                })
            }
        }

        continueDelayShake() {
            void 0 !== this.delayShakeTimerId && (clearTimeout(this.delayShakeTimerId), this.delayShakeTimerId = void 0, this.delayShakeTimerId = setTimeout(() => {
                this.doShake()
            }, 100))
        }

        getDistance(e, t) {
            return Math.sqrt(e * e + t * t)
        }

        getAverageSpeed() {
            let e = 0;
            do {
                if (!this.movements || this.movements.length < 2) break;
                let t = 0;
                for (let e = 0; e < this.movements.length - 1; e++) {
                    let i = this.movements[e], n = this.movements[e + 1];
                    n.tick - i.tick > 0 && (t += this.getDistance(n.x - i.x, n.y - i.y))
                }
                let i = this.movements[this.movements.length - 1].tick - this.movements[0].tick;
                e = t / i, l.information(`shake get distance ${t}, duration ${i}, speed: ${e}`)
            } while (0);
            return e
        }

        onPosChange() {
            do {
                if (!this.shakeStartTime) break;
                let e = (new Date).getTime();
                this.movements.push({tick: e, x: window.screenLeft, y: window.screenTop})
            } while (0)
        }

        onMainWindowShake() {
            this.onPosChange();
            do {
                this.continueDelayShake();
                let e = (new Date).getTime();
                if (this.preShakeTime && e - this.preShakeTime >= 100) {
                    l.information("shake 不连续的拖动，判断中断", e - this.preShakeTime), this.preShakeTime = void 0, this.shakeStartTime = void 0, this.movements = null, this.movements = [];
                    break
                }
                void 0 === this.preShakeTime && (this.shakeStartTime = e), this.preShakeTime = e, this.shakeStartTime && e - this.shakeStartTime >= d && (l.information(`shake 连续晃动超过${d}秒`), this.getAverageSpeed() > u && void 0 === this.delayShakeTimerId && (this.delayShakeTimerId = setTimeout(() => {
                    this.doShake()
                }, 100)))
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(17), r = i(0), s = i(13), l = i(6), d = i(471), u = i(359),
        c = r.default.getLogger("Thunder.speedcurve-skin.init-skin"), {isDef: h, isUndef: f} = s.ThunderUtil;
    let g = !1, p = !1, v = "", m = `${d.SpeedCurveSkinHelperNS.cacheDir}/user-skin-info.json`;

    function y(e) {
        let t = !0;
        return e.type === d.SpeedCurveSkinHelperNS.SkinType.SuperVip ? t = p : e.type === d.SpeedCurveSkinHelperNS.SkinType.Vip && (t = g), t
    }

    function k(e) {
        return h(e.type) && e.type >= d.SpeedCurveSkinHelperNS.SkinType.Vip
    }

    function T(e, t = !1, i = !1) {
        return n(this, void 0, void 0, function* () {
            if (i || y(e)) ; else try {
                yield a.client.callServerFunction("SetSpeedCurveSkinInfo", d.SpeedCurveSkinHelperNS.defaultSkinInfo)
            } catch (e) {
                c.warning(e)
            }
            i && !t || (yield C(v))
        })
    }

    function w(e) {
        return n(this, void 0, void 0, function* () {
            if (f(e) || e) try {
                let e = JSON.parse(yield a.client.callServerFunction("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 T(yield a.client.callServerFunction("GetSpeedCurveSkinInfo"))
            } catch (e) {
                c.warning(e)
            }
        })
    }

    function C(e) {
        return n(this, void 0, void 0, function* () {
            try {
                let t = {}, i = yield a.client.callServerFunction("GetSpeedCurveSkinInfo"), n = "{}";
                if ("" !== e) {
                    (yield l.FileSystemAWNS.existsAW(m)) && (n = (yield l.FileSystemAWNS.readFileAW(m)).toString() || "{}"), (t = JSON.parse(n))[e] = {
                        id: i.id,
                        type: i.type
                    }, yield l.FileSystemAWNS.writeFileAW(m, JSON.stringify(t))
                }
            } catch (e) {
                c.warning(e)
            }
        })
    }

    a.client.attachServerEvent("OnChangeSpeedCurveSkin", (e, ...t) => n(this, void 0, void 0, function* () {
        yield T(t[0], t[1], t[2])
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => n(this, void 0, void 0, function* () {
        try {
            yield w(!0), v = e;
            let t = (yield l.FileSystemAWNS.readFileAW(m)).toString(), i = JSON.parse(t)[e],
                n = yield a.client.callServerFunction("GetSpeedCurveSkinInfo"),
                o = JSON.parse(localStorage.getItem("speedcurveSkins"));
            if (null === o && (o = (yield u.default.getSkins()) || []), (n = o.find(e => e.id === n.id)) && k(n) && y(n)) return void (yield C(e));
            if (!i) return;
            if (i = o.find(e => e.id === i.id)) {
                let e = k(i);
                (e && y(i) || !e) && (yield a.client.callServerFunction("SetSpeedCurveSkinInfo", i))
            }
        } catch (e) {
            c.warning(e)
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => n(this, void 0, void 0, function* () {
        try {
            v = "", yield w(!1)
        } catch (e) {
            c.warning(e)
        }
    }))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(17), r = i(0), s = i(13), l = i(6), d = i(473),
        u = r.default.getLogger("Thunder.suspension-skin.init-skin"), {isDef: c, isUndef: h} = s.ThunderUtil;
    let f = !1, g = "", p = `${d.SuspensionSkinHelperNS.cacheDir}/user-skin-info.json`;

    function v(e) {
        let t = !0;
        return e.type === d.SuspensionSkinHelperNS.SkinType.Vip && (t = f), t
    }

    function m(e) {
        return c(e.type) && e.type >= d.SuspensionSkinHelperNS.SkinType.Vip
    }

    function y(e) {
        return n(this, void 0, void 0, function* () {
            u.information("updateUserSkin", e), g = e, yield function (e) {
                return n(this, void 0, void 0, function* () {
                    if (h(e) || e) try {
                        let e = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                        c(e) && (f = "1" === e.isVip)
                    } catch (e) {
                        u.warning(e)
                    } else f = !1
                })
            }(e && "" !== e);
            let t = void 0;
            try {
                t = (yield l.FileSystemAWNS.readFileAW(p)).toString()
            } catch (e) {
                u.warning(e)
            }
            let i = null;
            if (t) try {
                let n = JSON.parse(t);
                n && (i = n[e])
            } catch (e) {
                u.warning(e)
            }
            let o = yield a.client.callServerFunction("GetSuspensionSkinInfo");
            if (o && m(o) && v(o)) return void (yield k(e));
            i || (i = f ? d.SuspensionSkinHelperNS.vipSkinInfo : d.SuspensionSkinHelperNS.defaultSkinInfo), u.information("skinInfo", i);
            let r = m(i);
            (r && v(i) || !r) && (yield a.client.callServerFunction("SetSuspensionSkinInfo", i))
        })
    }

    function k(e) {
        return n(this, void 0, void 0, function* () {
            u.information("userId", e, "isVip", f);
            try {
                if (f) {
                    let t = {}, i = yield a.client.callServerFunction("GetSuspensionSkinInfo"), n = "{}";
                    if ("" !== e) {
                        let a = yield l.FileSystemAWNS.existsAW(p);
                        u.information("isHaveSkinFile", a), a && (n = (yield l.FileSystemAWNS.readFileAW(p)).toString() || "{}"), (t = JSON.parse(n))[e] = {
                            id: i.id,
                            type: i.type
                        }, u.information("handleSkinSave", e, i), yield l.FileSystemAWNS.writeFileAW(p, JSON.stringify(t))
                    }
                }
            } catch (e) {
                u.warning(e)
            }
        })
    }

    a.client.attachServerEvent("OnChangeSuspensionSkin", (e, ...t) => {
        (function (e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                if (u.information("changeSkin", "isPreview", t, "temp", i), i || v(e)) ; else try {
                    yield a.client.callServerFunction("SetSuspensionSkinInfo", d.SuspensionSkinHelperNS.defaultSkinInfo), u.information("set defaultSkinInfo")
                } catch (e) {
                    u.warning(e)
                }
                i && !t || (yield k(g))
            })
        })(t[0], t[1], t[2]).catch()
    }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => n(this, void 0, void 0, function* () {
        yield y(e)
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => n(this, void 0, void 0, function* () {
        if ("vipinfo" === e) {
            u.information("data", t);
            try {
                let e = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                if (u.information("userInfo", e), c(e) && "1" === e.isVip) {
                    let e = yield a.client.callServerFunction("GetUserID");
                    f = !0, g = e, yield a.client.callServerFunction("SetSuspensionSkinInfo", d.SuspensionSkinHelperNS.vipSkinInfo)
                }
            } catch (e) {
                u.warning(e)
            }
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => n(this, void 0, void 0, function* () {
        try {
            yield y("")
        } catch (e) {
            u.warning(e)
        }
    }))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(341), o = i(25), r = i(23), s = i(4), l = i(17), d = i(10), u = i(2), c = i(7), h = i(9), f = i(11),
        g = i(35), p = i(27), v = i(136), m = i(0).default.getLogger("EmbeddedNativeFunction"),
        y = c.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: "FireLoginEvent",
                nativeFunc: this.fireLoginEvent
            }, {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: "GetConfigValue",
                nativeFunc: this.getConfigValue
            }, {functionName: "SetConfigValue", nativeFunc: this.setConfigValue}, {
                functionName: "GetDeviceID",
                nativeFunc: this.getDeviceID
            }, {functionName: "BringMainWndToTop", nativeFunc: this.bringMainWndToTop}, {
                functionName: "ShowWebWnd",
                nativeFunc: this.showWebWnd
            }, {functionName: "SaveLoginData", nativeFunc: this.saveLoginData}];
            a.BrowserCtrl.registerDefaultNativeFunction(e)
        }

        saveLoginData(e, t, i, n) {
            do {
                if (m.information("saveLoginData", e, t, i), s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || s.isNullOrUndefined(n[1]) || s.isNullOrUndefined(n[2])) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], l = n[1], d = n[2];
                r.LoginHelperNS.loginSDKHelper.saveData(a, l, d).then(n => {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                }).catch(() => {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.CallFailed)
                })
            } while (0)
        }

        getUserID(e, t, i, n) {
            r.LoginHelperNS.loginHelper.getUserInfo("userid", function (n) {
                null !== n && void 0 !== n && "" !== n || (n = "0"), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        getSessionID(e, t, i, n) {
            r.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (n) {
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        loadLoginData(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let n = null;
                do {
                    if (s.isNullOrUndefined(a) || s.isNullOrUndefined(a[0]) || s.isNullOrUndefined(a[1])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let l = a[0], d = a[1];
                    n = "memory" === l && "initconfig" === d ? yield r.LoginHelperNS.loginSDKHelper.getInitData() : r.LoginHelperNS.loginSDKHelper.loadData(l, d), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                } while (0)
            })
        }

        fireLoginEvent(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(a) || !Array.isArray(a)) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if ("string" != typeof a[0]) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let n = a[0], l = a[1], d = yield r.LoginHelperNS.loginSDKHelper.fireEvent(n, l);
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, JSON.stringify(d))
                } while (0)
            })
        }

        getUserInfo(e, t, i, n) {
            (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
            let a = 0;
            if (s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0])) a = 0; else {
                let e = n[0];
                a = null === e || void 0 === e || "" === e ? 0 : Number(e)
            }
            r.LoginHelperNS.loginHelper.getUserInfoEx(a, function (n) {
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        isLogined(e, t, i, n) {
            (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError), r.LoginHelperNS.loginHelper.isLogined(function (n) {
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        openNewTab(e, t, i, n) {
            do {
                if (s.isNullOrUndefined(n)) break;
                if (s.isNullOrUndefined(n[0])) break;
                let a = n[0], r = n[1];
                l.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", a, r), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
            } while (0)
        }

        trackEvent(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) break;
                    if (!a || !a[0]) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let n = a[0], r = void 0 === a[1] ? "" : a[1], l = void 0 === a[2] ? "" : a[2],
                        u = void 0 === a[3] ? 0 : a[3], c = void 0 === a[4] ? 0 : a[4], h = void 0 === a[5] ? 0 : a[5],
                        f = void 0 === a[6] ? 0 : a[6], g = void 0 === a[7] ? "" : a[7], p = void 0 === a[8] ? 0 : a[8],
                        v = yield d.XLStatNS.asyncTrackEvent(n, r, l, u, c, h, f, g, p);
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, v)
                } while (0)
            })
        }

        getThunderVersion(e, t, i, n) {
            let a = u.join(__rootDir, "../../Thunder.exe"), r = y.getFileVersion(a);
            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, r)
        }

        showLoginDlg(e, t, i, n) {
            let a = "other", l = !0;
            s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || (a = n[0]), s.isNullOrUndefined(n) || s.isNullOrUndefined(n[1]) || (l = n[1]), r.LoginHelperNS.loginHelper.showLoginDlg(a, l), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
        }

        getPeerID(e, t, i, n) {
            let a = y.getPeerID();
            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, a)
        }

        getConfigValue(e, t, i, n) {
            do {
                if (!e || s.isNullOrUndefined(t) || !i) break;
                if (!n || !n[0] || !n[1]) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], r = n[1], l = n[2], d = h.ConfigNS.getValue(a, r, l);
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, d)
            } while (0)
        }

        setConfigValue(e, t, i, n) {
            do {
                if (!e || s.isNullOrUndefined(t) || !i) break;
                if (!n || !n[0] || !n[1]) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], r = n[1], l = n[2];
                h.ConfigNS.setValue(a, r, l), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
            } while (0)
        }

        getDeviceID(e, t, i, n) {
            let a = y.getPeerID();
            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, a)
        }

        bringMainWndToTop(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) break;
                    let n = !1, a = yield f.asyncRemoteCall.getCurrentWindow();
                    a && (yield a.show(), yield g.ToolsUtilitiesAWNS.setForegroundWindow(y, a), n = !0), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                } while (0)
            })
        }

        showWebWnd(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) break;
                    if (s.isNullOrUndefined(a) || s.isNullOrUndefined(a[0])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let r = a[0];
                    if (a.splice(0, 1), null !== a[10] && void 0 !== a[10]) {
                        let e = a[10];
                        a[10] = (() => n(this, void 0, void 0, function* () {
                            return new Promise(i => {
                                p.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e, (e, t) => {
                                    m.information(e, t), i(t)
                                })
                            })
                        }))
                    }
                    if (null !== a[11] && void 0 !== a[11]) {
                        let e = a[11];
                        a[11] = (() => n(this, void 0, void 0, function* () {
                            p.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                        }))
                    }
                    yield v.EmbeddedBrowserManagerNs.showWebWnd(r, ...a), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                } while (0)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(11), r = i(7).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = null;

        function i() {
            r.asyncFindProcess("xlbrowsershell.exe", function (e) {
                let t = a.join(__rootDir, "../../").toLocaleLowerCase();
                e.forEach(e => {
                    let i = e.path;
                    i && -1 !== i.toLocaleLowerCase().indexOf(t) && r.emptyWorkingSet(e.id)
                })
            }), r.asyncFindProcess("Thunder.exe", function (e) {
                let t = a.join(__rootDir, "../../").toLocaleLowerCase();
                e.forEach(e => {
                    let i = e.path;
                    i && -1 !== i.toLocaleLowerCase().indexOf(t) && r.emptyWorkingSet(e.id)
                })
            }), t && clearInterval(t), t = setInterval(() => {
                i()
            }, 6e4)
        }

        function s() {
            t && (clearInterval(t), t = null)
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = yield o.asyncRemoteCall.getCurrentWindow();
                e.on("hide", i), e.on("minimize", i), e.on("restore", s), e.on("show", s)
            })
        }, e.emptyBrowserWorkingSet = function () {
            r.asyncFindProcess("xlbrowsershell.exe", function (e) {
                let t = a.join(__rootDir, "../../").toLocaleLowerCase();
                e.forEach(e => {
                    let i = e.path;
                    i && -1 !== i.toLocaleLowerCase().indexOf(t) && r.emptyWorkingSet(e.id)
                })
            })
        }
    }(t.EmptyWorkingSetNS || (t.EmptyWorkingSetNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(10), o = i(0), r = i(7), s = o.default.getLogger("360"),
        l = r.default(n.join(__rootDir, "../bin/ThunderHelper.node")), d = "360HealthElf.exe",
        u = "360DesktopLite64.exe";
    var c, h;
    !function (e) {
        e[e.GWL_EXSTYLE = -20] = "GWL_EXSTYLE"
    }(c || (c = {})), function (e) {
        e[e.WS_EX_TOPMOST = 8] = "WS_EX_TOPMOST"
    }(h || (h = {}));
    let f = 5e3, g = void 0, p = void 0, v = !1, m = !1;

    function y() {
        do {
            if (v) break;
            v = !0, a.XLStatNS.trackEvent("core_event", "360healthelf_run")
        } while (0)
    }

    function k() {
        do {
            if (m) break;
            m = !0, a.XLStatNS.trackEvent("core_event", "360desktoplite_run")
        } while (0)
    }

    function T() {
        do {
            let e = l.getCursorPos(), t = l.getWndHandleFromPoint(e.x, e.y);
            if (!t) break;
            if (!l.isFullScreen(t)) break;
            if (!(l.getWindowLong(t, c.GWL_EXSTYLE) & h.WS_EX_TOPMOST)) {
                s.information("WS_EX_TOPMOST", !1);
                break
            }
            s.information("WS_EX_TOPMOST", !0);
            let i = l.getWindowThreadProcessId(t);
            if (!i) break;
            let n = l.getProcessImageName(i);
            s.information("getProcessImageName", n);
            let o = n.toLowerCase() === d.toLowerCase(), r = n.toLowerCase() === u.toLowerCase();
            (o || r) && (g && (clearInterval(g), g = void 0), a.XLStatNS.trackEvent("core_event", "fullscreen_top_popup"))
        } while (0)
    }

    t.fullScreenCheckBegin = function () {
        do {
            if (p) break;
            p = setTimeout(() => {
                clearTimeout(p), p = void 0, l.asyncFindProcess(d, function (e) {
                    let t = e && e.length > 0;
                    s.information("check process", d, t, e), t && y()
                }), l.asyncFindProcess(u, function (e) {
                    let t = e && e.length > 0;
                    s.information("check process", u, t, e), t && k()
                }), g = setInterval(() => {
                    T()
                }, f)
            }, 1e4)
        } while (0)
    }, t.fullScreenCheckEnd = function () {
        return new Promise(e => {
            g && (clearInterval(g), g = void 0), p && (clearTimeout(p), p = void 0), e(!0)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(855), o = i(2), r = i(7), s = i(16), l = i(24), d = i(9), u = i(66), c = i(10),
        h = r.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = -1;

        function i(e, i, ...n) {
            return t
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let i = o.join(__rootDir, "../../Thunder.exe"), n = {
                        appKey: "eGx4X2Rvd25sb2FkX2RpYWdub3NpcwBSAAE=",
                        appName: "xlx_download_diagnosis",
                        appVer: h.getFileVersion(i),
                        peerId: h.getPeerID(),
                        installChannel: h.getInstallChannel(),
                        configFile: o.join(i, "../detect_stat.xml"),
                        storageFile: o.join(i, "../detect_stat.dat"),
                        useServerXml: 0
                    };
                    if ((t = yield c.XLStatNS.initParam(n)) < 0) break;
                    e = !0
                } while (0);
                let r = {GetDetectStatCookie: i};
                return s.server.registerFunctions(r), setTimeout(() => n(this, void 0, void 0, function* () {
                    if (yield l.default.isInitedAw(), l.default.getConfigInfo("downloadDetectTools", "autoDetect")) {
                        let e = new Date, t = u.TimeHelperNS.formatDate(e, "yyyy-MM-dd");
                        t !== d.ConfigNS.getValue("downloadDetectTools", "autoDetectDate", "") && (d.ConfigNS.setValue("downloadDetectTools", "autoDetectDate", t), a.DownloadDetectToolsNS.start("auto"))
                    }
                }), 3e4), e
            })
        }, e.uninit = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (t < 0) break;
                    yield c.XLStatNS.asyncUninit(t), e = !0
                } while (0);
                return e
            })
        }
    }(t.DownloadDetectHelperNS || (t.DownloadDetectHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(7), s = i(93), l = i(856), d = i(857), u = i(4).promisify, c = i(42), h = i(5),
        f = i(10), g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        p = o.default.getLogger("download-detect-tools");
    !function (e) {
        let t, o, r, v, m, y;
        !function (e) {
            e[e.AF_INET = 2] = "AF_INET", e[e.AF_INET6 = 23] = "AF_INET6"
        }(t = e.AfType || (e.AfType = {})), function (e) {
            e[e.IF_TYPE_SOFTWARE_LOOPBACK = 24] = "IF_TYPE_SOFTWARE_LOOPBACK"
        }(o = e.IfType || (e.IfType = {})), function (e) {
            e[e.IfOperStatusUp = 1] = "IfOperStatusUp", e[e.IfOperStatusDown = 2] = "IfOperStatusDown", e[e.IfOperStatusTesting = 3] = "IfOperStatusTesting", e[e.IfOperStatusUnknown = 4] = "IfOperStatusUnknown", e[e.IfOperStatusDormant = 5] = "IfOperStatusDormant", e[e.IfOperStatusNotPresent = 6] = "IfOperStatusNotPresent", e[e.IfOperStatusLowerLayerDown = 7] = "IfOperStatusLowerLayerDown"
        }(r = e.IfOperStatus || (e.IfOperStatus = {})), function (e) {
            e[e.None = 0] = "None", e[e.Started = 1] = "Started", e[e.Success = 2] = "Success", e[e.Failed = 3] = "Failed"
        }(v = e.DetectState || (e.DetectState = {})), function (e) {
            e[e.IndexServer = 0] = "IndexServer", e[e.BTIndexServer = 1] = "BTIndexServer", e[e.EMuleIndexServer = 2] = "EMuleIndexServer", e[e.MirrorSource = 3] = "MirrorSource", e[e.TorrentServer = 4] = "TorrentServer", e[e.P2PServer = 5] = "P2PServer", e[e.PingServer = 6] = "PingServer", e[e.NATServer = 7] = "NATServer", e[e.AccountLogin = 8] = "AccountLogin", e[e.VipDownload = 9] = "VipDownload", e[e.UPNPState = 10] = "UPNPState", e[e.DHTState = 11] = "DHTState", e[e.IPv6Support = 12] = "IPv6Support"
        }(m = e.DetectItemType || (e.DetectItemType = {})), function (e) {
            e.Start = "Start", e.StartItem = "StartItem", e.StatusChange = "StatusChange", e.FinishItem = "FinishItem", e.Finish = "Finish"
        }(y = e.DetectEvent || (e.DetectEvent = {}));
        const k = new class extends c.default {
            constructor() {
                super(), this.detectingItems = null, this.localIPInfo = null, this.currentDetectingIndex = void 0, this.adapterInfos = null, this.statCookie = -1, this.detectingItems = [{
                    type: m.IndexServer,
                    name: "普通任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载“HTTP、FTP”协议的下载链接时，需要查询下载链接对应的文件信息。\n          如果此项失败，您将无法加速下载“HTTP、FTP”协议的下载链接。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectIndexServer.bind(this)
                }, {
                    type: m.BTIndexServer,
                    name: "BT任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载BT任务时，需要查询BT任务对应的文件信息。\n          如果此项失败，您将无法加速下载BT任务。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectBTIndexServer.bind(this)
                }, {
                    type: m.TorrentServer,
                    name: "磁力任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载磁力链接时，需要查询磁力链接对应的BT种子信息。\n          如果此项失败，您将无法下载磁力链接。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectTorrentServer.bind(this)
                }, {
                    type: m.EMuleIndexServer,
                    name: "eMule任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载“ed2k”协议的下载链接时，需要查询下载链接对应的文件信息。\n          如果此项失败，您将无法加速下载eMule任务。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectEMuleIndexServer.bind(this)
                }, {
                    type: m.MirrorSource,
                    name: "主机镜像资源服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务查询主机镜像资源。\n          如果此项失败，您下载任意任务时，都无法获得主机镜像资源加速。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectMirrorSource.bind(this)
                }, {
                    type: m.P2PServer,
                    name: "节点镜像资源服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务查询节点镜像资源。\n          如果此项失败，您下载任意任务时，都无法获得节点镜像资源加速。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectP2PServer.bind(this)
                }, {
                    type: m.PingServer,
                    name: "连通检测服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务检测各个镜像资源的连通性，从而提升镜像资源连通率，理论上可以更快获得加速效果。\n          如果此项失败，您下载任意任务时，下载加速效果提升较为缓慢。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectPingServer.bind(this)
                }, {
                    type: m.NATServer,
                    name: "网络感知服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务感知您与节点镜像资源之间的网络连接结构，从而提升节点镜像资源连通率，理论上可以获得更快的下载速度。\n          如果此项失败，您下载任意任务时，下载加速效果较差。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectNATServer.bind(this)
                }, {
                    type: m.AccountLogin,
                    name: "帐号登录服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷登录帐号时，需要通过该服务获取您的帐号信息。\n          如果此项失败，您将无法登录迅雷帐号。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectAccountLogin.bind(this)
                }, {
                    type: m.VipDownload,
                    name: "会员加速服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷会员加速下载任意任务时，需要通过该服务查询会员加速资源，从而获得会员加速效果。\n          如果此项失败，您下载任意任务时，都无法获得会员加速效果。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectVipDownload.bind(this)
                }, {
                    type: m.UPNPState,
                    name: "UPnP状态",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "迅雷能够利用路由器的UPnP功能进行端口映射，从而提升镜像资源的连通率，理论上可以获得更快的下载速度。\n          如果您没有使用路由器，这项失败可以忽略。\n          如果您使用路由器，并且此项失败，请您登录路由器的管理页面，开启“UPnP”功能。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectUPNPState.bind(this)
                }, {
                    type: m.DHTState,
                    name: "DHT状态",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载BT任务时，需要通过DHT网络获取更多镜像资源，理论上可以获得更快的下载速度。\n          如果此项失败，您下载BT任务时，下载加速效果可能略受影响。\n          但是如果“BT任务信息、节点镜像资源服务”正常，则该失败可以忽略。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectDHTState.bind(this)
                }, {
                    type: m.IPv6Support,
                    name: "IPv6支持",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "迅雷现已支持IPv6互联网协议，通过该协议迅雷可以更快速可靠的连接镜像资源，从而提升镜像资源连通率，理论上可以获得更快的下载速度。\n          如果此项失败，可能是由于您的路由器或网络运营商暂未支持IPv6互联网协议，不过该项失败并不会影响您的正常下载。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectIPv6Support.bind(this)
                }]
            }

            dnsLookupAW(e) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    const i = u(l.lookup);
                    try {
                        t = yield i(e, 4)
                    } catch (t) {
                        p.warning("dnsLookup IPv4 failed! hostName", e, "e", t)
                    }
                    return t
                })
            }

            tcpConnectAW(e, t, i = 4) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(a => n(this, void 0, void 0, function* () {
                        let n = new s.Socket;
                        try {
                            n.on("connect", () => {
                                a(!0), n.end()
                            }), n.on("error", i => {
                                p.warning("tcpConnectAW error! host", e, "port", t, i), a(!1), n.end()
                            }), n.on("timeout", () => {
                                p.warning("tcpConnectAW timeout! host", e, "port", t), a(!1), n.end()
                            }), n.connect({port: t, host: e, family: i})
                        } catch (i) {
                            p.warning("tcpConnect failed! host", e, "port", t, i), a(!1)
                        }
                    }))
                })
            }

            detectTcpConnect(e, t, i = 80) {
                return n(this, void 0, void 0, function* () {
                    let n = !1;
                    do {
                        this.setDetectDesc((-1 !== e.name.indexOf("服务") ? "开始连接" : "开始查询") + e.name);
                        let a = yield this.dnsLookupAW(t);
                        if (!a) {
                            this.setDetectDesc("域名解析失败", "域名解析失败");
                            break
                        }
                        this.setDetectDesc("域名解析成功");
                        let o = (new Date).getTime();
                        if (yield this.tcpConnectAW(a.address, i)) {
                            let t = (new Date).getTime() - o;
                            this.setDetectDesc(e.name + (-1 !== e.name.indexOf("服务") ? "连接" : "查询") + "成功（耗时：" + t + "毫秒）"), n = !0
                        } else this.setDetectDesc(e.name + (-1 !== e.name.indexOf("服务") ? "连接" : "查询") + "失败", "tcp连接失败（" + a.address + ":" + i + "）")
                    } while (0);
                    return n
                })
            }

            setDetectDesc(e, t) {
                if (void 0 !== this.currentDetectingIndex) {
                    let i = this.detectingItems[this.currentDetectingIndex];
                    i.detectDesc = e, i.statResult = t, this.fireEvent(y.StatusChange, i, e)
                }
            }

            detectIndexServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5idx.v6.shub.sandai.net")
                })
            }

            detectBTIndexServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5btmain.v6.shub.sandai.net")
                })
            }

            detectEMuleIndexServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5emu.v6.shub.sandai.net")
                })
            }

            detectTorrentServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "pool.v6.bt.n0808.com")
                })
            }

            detectP2PServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5pr.sandai.net")
                })
            }

            detectPingServer(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = "hub5u.sandai.net";
                    this.setDetectDesc("开始连接" + e.name);
                    let n = (new Date).getTime(), a = yield d.promise.probe(i);
                    if (a && a.alive) {
                        let i = (new Date).getTime() - n;
                        this.setDetectDesc(e.name + "连接成功（耗时：" + i + "毫秒）"), t = !0
                    } else p.information("ping failed! host:", i, ", result:", a), this.setDetectDesc(e.name + "连接失败", "ping失败（" + i + "）");
                    return t
                })
            }

            detectDCDNServer(e) {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        this.setDetectDesc("开始连接会员加速服务");
                        let t = yield this.dnsLookupAW("dcdnhub.xfs.xcloud.sandai.net");
                        if (!t) {
                            this.setDetectDesc("域名解析失败", "dcdnhub.xfs.xcloud.sandai.net域名解析失败");
                            break
                        }
                        this.setDetectDesc("域名解析成功");
                        let i = (new Date).getTime();
                        if (yield this.tcpConnectAW(t.address, 80)) {
                            let t = (new Date).getTime() - i;
                            this.setDetectDesc("会员加速服务连接成功（耗时：" + t + "毫秒）"), e = !0
                        } else this.setDetectDesc("会员加速服务连接失败", "tcp连接失败（" + t.address + ":80）")
                    } while (0);
                    return e
                })
            }

            detectVipAuthServer(e) {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        this.setDetectDesc("开始连接会员加速验证服务");
                        let t = yield this.dnsLookupAW("ali.pc-x.speed.auth.vip.xunlei.com");
                        if (!t) {
                            this.setDetectDesc("域名解析失败", "ali.pc-x.speed.auth.vip.xunlei.com域名解析失败");
                            break
                        }
                        this.setDetectDesc("域名解析成功");
                        let i = (new Date).getTime();
                        if (yield this.tcpConnectAW(t.address, 80)) {
                            let t = (new Date).getTime() - i;
                            this.setDetectDesc("会员加速验证服务连接成功（耗时：" + t + "毫秒）"), e = !0
                        } else this.setDetectDesc("会员加速验证服务连接失败", "tcp连接失败（" + t.address + ":80）")
                    } while (0);
                    return e
                })
            }

            detectMirrorSource(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5sr.v6.shub.sandai.net")
                })
            }

            detectNATServer(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        let i = !1;
                        {
                            const t = ["hub5pn.sandai.net", "g1.hub5pn.sandai.net", "g2.hub5pn.sandai.net", "g3.hub5pn.sandai.net"];
                            let n = "";
                            for (let a = 0; a < t.length; ++a) {
                                let o = t[a];
                                this.setDetectDesc("开始连接" + e.name + "【" + (a + 1) + "】");
                                let r = (new Date).getTime(), s = yield d.promise.probe(o);
                                if (s && s.alive) {
                                    let t = (new Date).getTime() - r;
                                    this.setDetectDesc(e.name + "连接成功（耗时：" + t + "毫秒）"), i = !0;
                                    break
                                }
                                p.warning("detectNATServer ping failed! host:", o, ", result", s), n.length > 0 && (n += ","), n += "ping失败（" + o + "）", this.setDetectDesc(e.name + "连接失败", n)
                            }
                        }
                        t(i)
                    }))
                })
            }

            detectAccountLogin(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        this.setDetectDesc("开始帐号登录服务");
                        let n = (new Date).getTime();
                        const a = yield i(20);
                        a.defaults.adapter = i(21);
                        let o = e.statResult || "";
                        try {
                            let e = yield a.request({
                                method: "options",
                                url: "https://xluser-ssl.xunlei.com/xluser.core.login",
                                params: {}
                            });
                            if (204 === e.status) {
                                let e = (new Date).getTime() - n;
                                this.setDetectDesc("连接帐号登录服务成功（耗时：" + e + "毫秒）"), t(!0)
                            } else o.length > 0 && (o += ","), o += "options请求失败（" + e.status + "）", this.setDetectDesc("连接帐号登录服务失败（" + e.status + "）", o), t(!1)
                        } catch (e) {
                            p.information("detectAccountLogin exception! e", e), o.length > 0 && (o += ","), o += "options请求失败，" + (e || ""), this.setDetectDesc("连接帐号登录服务失败", o), t(!1)
                        }
                    }))
                })
            }

            detectVipDownload(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        let i = !1;
                        do {
                            if (!(yield this.detectVipAuthServer(e))) break;
                            if (!(yield this.detectDCDNServer(e))) break;
                            i = !0
                        } while (0);
                        t(i)
                    }))
                })
            }

            detectUPNPState(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => n(this, void 0, void 0, function* () {
                        this.setDetectDesc("开始检测UPnP状态");
                        let t = yield h.client.callServerFunction("QueryGlobalInfo"), i = t && t.isUPnPReady > 0;
                        this.setDetectDesc("UPnP状态" + (i ? "可用" : "不可用")), e(i)
                    }))
                })
            }

            detectDHTState(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => n(this, void 0, void 0, function* () {
                        this.setDetectDesc("开始检测DHT状态");
                        let t = yield h.client.callServerFunction("QueryGlobalInfo"), i = t && t.dhtNodeCount > 0;
                        this.setDetectDesc("DHT状态" + (i ? "可用" : "不可用")), e(i)
                    }))
                })
            }

            detectIPv6Support(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        this.setDetectDesc("开始检测IPv6支持"), g.getNetAdapterInfo(i => n(this, void 0, void 0, function* () {
                            p.information("adapterInfos", i), this.adapterInfos = i;
                            let n = !1;
                            for (let e = 0; e < i.length; ++e) {
                                let a = i[e];
                                if (a.type !== o.IF_TYPE_SOFTWARE_LOOPBACK && a.operStatus === r.IfOperStatusUp) {
                                    for (let e = 0; e < a.ipAddresses.length; ++e) if (a.ipAddresses[e].family === t.AF_INET6) {
                                        n = !0;
                                        break
                                    }
                                    if (n) break
                                }
                            }
                            if (n) {
                                let e = null;
                                const t = u(l.lookup);
                                let i = "hub5idx.v6.shub.sandai.net";
                                try {
                                    e = yield t(i, 6)
                                } catch (e) {
                                    p.warning("dnsLookup IPv6 failed! hostName", i, "e", e)
                                }
                                n = !!e && (yield this.tcpConnectAW(e.address, 80, 6))
                            }
                            this.setDetectDesc(n ? "机器和网络环境已支持IPv6" : "机器或网络环境不支持IPv6"), e(n)
                        }))
                    })
                })
            }

            sendFinishStat(e, t) {
                return n(this, void 0, void 0, function* () {
                    let n = "result=" + encodeURIComponent(e);
                    n += ",wrong_cnt=" + t, n += ",ip=" + (this.localIPInfo && this.localIPInfo.localIP ? this.localIPInfo.localIP : ""), n += ",windows_version=" + (yield Promise.resolve().then(() => i(59))).release();
                    let o = a.join(__rootDir, "../bin/SDK/DownloadSDK.dll");
                    n += ",download_engine_version=" + g.getFileVersion(o), n += ",dns=" + this.getDNSList().join("|"), f.XLStatNS.trackEvent("xlx_download_diagnosis", "download_diagnosis_result", "", 0, 0, 0, 0, n, this.statCookie)
                })
            }

            getLocalIPInfoAW() {
                return n(this, void 0, void 0, function* () {
                    if (this.localIPInfo) return this.localIPInfo;
                    const e = yield i(20);
                    e.defaults.adapter = i(21);
                    try {
                        let t = yield e.request({
                            method: "post",
                            url: "https://tool.lu/ip/ajax.html",
                            params: {},
                            headers: {}
                        });
                        200 === t.status && t.data && t.data.text && (this.localIPInfo = {
                            teleCommunications: t.data.text.ip2region_location,
                            localIP: t.data.text.ip
                        })
                    } catch (e) {
                        p.warning("request https://tool.lu/ip/ajax.html failed! e", e)
                    }
                    return this.localIPInfo
                })
            }

            start(e) {
                return n(this, void 0, void 0, function* () {
                    let t = "", i = 0;
                    this.statCookie = yield h.client.callServerFunction("GetDetectStatCookie"), h.client.broadcastEvent("DownloadDetectStart", e), this.fireEvent(y.Start);
                    let n = v.Success;
                    for (let e = 0; e < this.detectingItems.length; ++e) {
                        let a = this.detectingItems[e];
                        this.currentDetectingIndex = e, a.state = v.Started, this.fireEvent(y.StartItem, a, e), (yield a.detect(a)) ? a.state = v.Success : (a.state = v.Failed, n = v.Failed, t += a.name + "," + (a.statResult || "") + "|", i++), this.fireEvent(y.FinishItem, a, e, a.state)
                    }
                    yield this.getLocalIPInfoAW(), this.fireEvent(y.Finish, n), this.sendFinishStat(t, i).catch()
                })
            }

            getAllDectectItems() {
                return this.detectingItems
            }

            getDNSList() {
                let e = [];
                if (this.adapterInfos) {
                    let t = {};
                    for (let e = 0; e < this.adapterInfos.length; ++e) {
                        let i = this.adapterInfos[e];
                        i.type !== o.IF_TYPE_SOFTWARE_LOOPBACK && i.operStatus === r.IfOperStatusUp && i.dnsAddresses.forEach(e => {
                            t[e] = !0
                        })
                    }
                    e = Object.keys(t)
                }
                return e
            }

            restart(e) {
                return n(this, void 0, void 0, function* () {
                    for (let e = 0; e < this.detectingItems.length; ++e) {
                        let t = this.detectingItems[e];
                        t.state = v.None, t.detectDesc = "正在扫描…"
                    }
                    return this.currentDetectingIndex = 0, this.start(e)
                })
            }
        };
        e.getLocalIPInfo = function () {
            return n(this, void 0, void 0, function* () {
                return k.getLocalIPInfoAW()
            })
        }, e.start = function (e) {
            k.start(e).catch()
        }, e.restart = function (e) {
            k.restart(e).catch()
        }, e.getAllDectectItems = function () {
            return k.getAllDectectItems()
        }, e.getDNSList = function () {
            return k.getDNSList()
        }, e.attachListener = function (e, t) {
            k.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            k.detachListener(e, t)
        }
    }(t.DownloadDetectToolsNS || (t.DownloadDetectToolsNS = {}))
}, function (e, t) {
    e.exports = require("dns")
}, function (e, t, i) {
    var n = {};
    n.sys = i(858), n.promise = i(506), e.exports = n
}, function (e, t, i) {
    "use strict";
    var n = i(506);
    t.probe = function (e, t, i) {
        var a = i || {};
        return n.probe(e, a).then(function (e) {
            t(e.alive, null)
        }).catch(function (e) {
            t(null, e)
        }).done()
    }
}, function (e, t, i) {
    /*!
 *
 * Copyright 2009-2017 Kris Kowal under the terms of the MIT
 * license found at https://github.com/kriskowal/q/blob/v1/LICENSE
 *
 * With parts by Tyler Close
 * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
 * at http://www.opensource.org/licenses/mit-license.html
 * Forked at ref_send.js version: 2009-05-11
 *
 * With parts by Mark Miller
 * Copyright (C) 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
    !function (t) {
        "use strict";
        "function" == typeof bootstrap ? bootstrap("promise", t) : e.exports = t()
    }(function () {
        "use strict";
        var e = !1;
        try {
            throw new Error
        } catch (t) {
            e = !!t.stack
        }
        var t, i = w(), n = function () {
        }, a = function () {
            var e = {task: void 0, next: null}, t = e, i = !1, n = void 0, o = !1, r = [];

            function s() {
                for (var t, n; e.next;) t = (e = e.next).task, e.task = void 0, (n = e.domain) && (e.domain = void 0, n.enter()), l(t, n);
                for (; r.length;) l(t = r.pop());
                i = !1
            }

            function l(e, t) {
                try {
                    e()
                } catch (e) {
                    if (o) throw t && t.exit(), setTimeout(s, 0), t && t.enter(), e;
                    setTimeout(function () {
                        throw e
                    }, 0)
                }
                t && t.exit()
            }

            if (a = function (e) {
                t = t.next = {task: e, domain: o && process.domain, next: null}, i || (i = !0, n())
            }, "object" == typeof process && "[object process]" === process.toString() && process.nextTick) o = !0, n = function () {
                process.nextTick(s)
            }; else if ("function" == typeof setImmediate) n = "undefined" != typeof window ? setImmediate.bind(window, s) : function () {
                setImmediate(s)
            }; else if ("undefined" != typeof MessageChannel) {
                var d = new MessageChannel;
                d.port1.onmessage = function () {
                    n = u, d.port1.onmessage = s, s()
                };
                var u = function () {
                    d.port2.postMessage(0)
                };
                n = function () {
                    setTimeout(s, 0), u()
                }
            } else n = function () {
                setTimeout(s, 0)
            };
            return a.runAfter = function (e) {
                r.push(e), i || (i = !0, n())
            }, a
        }(), o = Function.call;

        function r(e) {
            return function () {
                return o.apply(e, arguments)
            }
        }

        var s, l = r(Array.prototype.slice), d = r(Array.prototype.reduce || function (e, t) {
            var i = 0, n = this.length;
            if (1 === arguments.length) for (; ;) {
                if (i in this) {
                    t = this[i++];
                    break
                }
                if (++i >= n) throw new TypeError
            }
            for (; i < n; i++) i in this && (t = e(t, this[i], i));
            return t
        }), u = r(Array.prototype.indexOf || function (e) {
            for (var t = 0; t < this.length; t++) if (this[t] === e) return t;
            return -1
        }), c = r(Array.prototype.map || function (e, t) {
            var i = this, n = [];
            return d(i, function (a, o, r) {
                n.push(e.call(t, o, r, i))
            }, void 0), n
        }), h = Object.create || function (e) {
            function t() {
            }

            return t.prototype = e, new t
        }, f = Object.defineProperty || function (e, t, i) {
            return e[t] = i.value, e
        }, g = r(Object.prototype.hasOwnProperty), p = Object.keys || function (e) {
            var t = [];
            for (var i in e) g(e, i) && t.push(i);
            return t
        }, v = r(Object.prototype.toString);
        s = "undefined" != typeof ReturnValue ? ReturnValue : function (e) {
            this.value = e
        };
        var m = "From previous event:";

        function y(t, i) {
            if (e && i.stack && "object" == typeof t && null !== t && t.stack) {
                for (var n = [], a = i; a; a = a.source) a.stack && (!t.__minimumStackCounter__ || t.__minimumStackCounter__ > a.stackCounter) && (f(t, "__minimumStackCounter__", {
                    value: a.stackCounter,
                    configurable: !0
                }), n.unshift(a.stack));
                n.unshift(t.stack);
                var o = function (e) {
                    for (var t = e.split("\n"), i = [], n = 0; n < t.length; ++n) {
                        var a = t[n];
                        !T(a) && (-1 === (o = a).indexOf("(module.js:") && -1 === o.indexOf("(node.js:")) && a && i.push(a)
                    }
                    var o;
                    return i.join("\n")
                }(n.join("\n" + m + "\n"));
                f(t, "stack", {value: o, configurable: !0})
            }
        }

        function k(e) {
            var t = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);
            if (t) return [t[1], Number(t[2])];
            var i = /at ([^ ]+):(\d+):(?:\d+)$/.exec(e);
            if (i) return [i[1], Number(i[2])];
            var n = /.*@(.+):(\d+)$/.exec(e);
            return n ? [n[1], Number(n[2])] : void 0
        }

        function T(e) {
            var n = k(e);
            if (!n) return !1;
            var a = n[0], o = n[1];
            return a === t && o >= i && o <= X
        }

        function w() {
            if (e) try {
                throw new Error
            } catch (e) {
                var i = e.stack.split("\n"), n = k(i[0].indexOf("@") > 0 ? i[1] : i[2]);
                if (!n) return;
                return t = n[0], n[1]
            }
        }

        function C(e) {
            return e instanceof D ? e : E(e) ? (t = e, i = I(), C.nextTick(function () {
                try {
                    t.then(i.resolve, i.reject, i.notify)
                } catch (e) {
                    i.reject(e)
                }
            }), i.promise) : V(e);
            var t, i
        }

        C.resolve = C, C.nextTick = a, C.longStackSupport = !1;
        var S = 1;

        function I() {
            var t, i = [], n = [], a = h(I.prototype), o = h(D.prototype);
            if (o.promiseDispatch = function (e, a, o) {
                var r = l(arguments);
                i ? (i.push(r), "when" === a && o[1] && n.push(o[1])) : C.nextTick(function () {
                    t.promiseDispatch.apply(t, r)
                })
            }, o.valueOf = function () {
                if (i) return o;
                var e = N(t);
                return x(e) && (t = e), e
            }, o.inspect = function () {
                return t ? t.inspect() : {state: "pending"}
            }, C.longStackSupport && e) try {
                throw new Error
            } catch (e) {
                o.stack = e.stack.substring(e.stack.indexOf("\n") + 1), o.stackCounter = S++
            }

            function r(a) {
                t = a, C.longStackSupport && e && (o.source = a), d(i, function (e, t) {
                    C.nextTick(function () {
                        a.promiseDispatch.apply(a, t)
                    })
                }, void 0), i = void 0, n = void 0
            }

            return a.promise = o, a.resolve = function (e) {
                t || r(C(e))
            }, a.fulfill = function (e) {
                t || r(V(e))
            }, a.reject = function (e) {
                t || r(K(e))
            }, a.notify = function (e) {
                t || d(n, function (t, i) {
                    C.nextTick(function () {
                        i(e)
                    })
                }, void 0)
            }, a
        }

        function b(e) {
            if ("function" != typeof e) throw new TypeError("resolver must be a function.");
            var t = I();
            try {
                e(t.resolve, t.reject, t.notify)
            } catch (e) {
                t.reject(e)
            }
            return t.promise
        }

        function _(e) {
            return b(function (t, i) {
                for (var n = 0, a = e.length; n < a; n++) C(e[n]).then(t, i)
            })
        }

        function D(e, t, i) {
            void 0 === t && (t = function (e) {
                return K(new Error("Promise does not support operation: " + e))
            }), void 0 === i && (i = function () {
                return {state: "unknown"}
            });
            var n = h(D.prototype);
            if (n.promiseDispatch = function (i, a, o) {
                var r;
                try {
                    r = e[a] ? e[a].apply(n, o) : t.call(n, a, o)
                } catch (e) {
                    r = K(e)
                }
                i && i(r)
            }, n.inspect = i, i) {
                var a = i();
                "rejected" === a.state && (n.exception = a.reason), n.valueOf = function () {
                    var e = i();
                    return "pending" === e.state || "rejected" === e.state ? n : e.value
                }
            }
            return n
        }

        function A(e, t, i, n) {
            return C(e).then(t, i, n)
        }

        function N(e) {
            if (x(e)) {
                var t = e.inspect();
                if ("fulfilled" === t.state) return t.value
            }
            return e
        }

        function x(e) {
            return e instanceof D
        }

        function E(e) {
            return (t = e) === Object(t) && "function" == typeof e.then;
            var t
        }

        "object" == typeof process && process && process.env && process.env.Q_DEBUG && (C.longStackSupport = !0), C.defer = I, I.prototype.makeNodeResolver = function () {
            var e = this;
            return function (t, i) {
                t ? e.reject(t) : arguments.length > 2 ? e.resolve(l(arguments, 1)) : e.resolve(i)
            }
        }, C.Promise = b, C.promise = b, b.race = _, b.all = H, b.reject = K, b.resolve = C, C.passByCopy = function (e) {
            return e
        }, D.prototype.passByCopy = function () {
            return this
        }, C.join = function (e, t) {
            return C(e).join(t)
        }, D.prototype.join = function (e) {
            return C([this, e]).spread(function (e, t) {
                if (e === t) return e;
                throw new Error("Q can't join: not the same: " + e + " " + t)
            })
        }, C.race = _, D.prototype.race = function () {
            return this.then(C.race)
        }, C.makePromise = D, D.prototype.toString = function () {
            return "[object Promise]"
        }, D.prototype.then = function (e, t, i) {
            var n = this, a = I(), o = !1;
            return C.nextTick(function () {
                n.promiseDispatch(function (t) {
                    o || (o = !0, a.resolve(function (t) {
                        try {
                            return "function" == typeof e ? e(t) : t
                        } catch (e) {
                            return K(e)
                        }
                    }(t)))
                }, "when", [function (e) {
                    o || (o = !0, a.resolve(function (e) {
                        if ("function" == typeof t) {
                            y(e, n);
                            try {
                                return t(e)
                            } catch (e) {
                                return K(e)
                            }
                        }
                        return K(e)
                    }(e)))
                }])
            }), n.promiseDispatch(void 0, "when", [void 0, function (e) {
                var t, n = !1;
                try {
                    t = function (e) {
                        return "function" == typeof i ? i(e) : e
                    }(e)
                } catch (e) {
                    if (n = !0, !C.onerror) throw e;
                    C.onerror(e)
                }
                n || a.notify(t)
            }]), a.promise
        }, C.tap = function (e, t) {
            return C(e).tap(t)
        }, D.prototype.tap = function (e) {
            return e = C(e), this.then(function (t) {
                return e.fcall(t).thenResolve(t)
            })
        }, C.when = A, D.prototype.thenResolve = function (e) {
            return this.then(function () {
                return e
            })
        }, C.thenResolve = function (e, t) {
            return C(e).thenResolve(t)
        }, D.prototype.thenReject = function (e) {
            return this.then(function () {
                throw e
            })
        }, C.thenReject = function (e, t) {
            return C(e).thenReject(t)
        }, C.nearer = N, C.isPromise = x, C.isPromiseAlike = E, C.isPending = function (e) {
            return x(e) && "pending" === e.inspect().state
        }, D.prototype.isPending = function () {
            return "pending" === this.inspect().state
        }, C.isFulfilled = function (e) {
            return !x(e) || "fulfilled" === e.inspect().state
        }, D.prototype.isFulfilled = function () {
            return "fulfilled" === this.inspect().state
        }, C.isRejected = function (e) {
            return x(e) && "rejected" === e.inspect().state
        }, D.prototype.isRejected = function () {
            return "rejected" === this.inspect().state
        };
        var P, O, M, F = [], L = [], R = [], B = !0;

        function U() {
            F.length = 0, L.length = 0, B || (B = !0)
        }

        function K(e) {
            var t = D({
                when: function (t) {
                    return t && function (e) {
                        if (B) {
                            var t = u(L, e);
                            -1 !== t && ("object" == typeof process && "function" == typeof process.emit && C.nextTick.runAfter(function () {
                                var i = u(R, e);
                                -1 !== i && (process.emit("rejectionHandled", F[t], e), R.splice(i, 1))
                            }), L.splice(t, 1), F.splice(t, 1))
                        }
                    }(this), t ? t(e) : this
                }
            }, function () {
                return this
            }, function () {
                return {state: "rejected", reason: e}
            });
            return function (e, t) {
                B && ("object" == typeof process && "function" == typeof process.emit && C.nextTick.runAfter(function () {
                    -1 !== u(L, e) && (process.emit("unhandledRejection", t, e), R.push(e))
                }), L.push(e), t && void 0 !== t.stack ? F.push(t.stack) : F.push("(no stack) " + t))
            }(t, e), t
        }

        function V(e) {
            return D({
                when: function () {
                    return e
                }, get: function (t) {
                    return e[t]
                }, set: function (t, i) {
                    e[t] = i
                }, delete: function (t) {
                    delete e[t]
                }, post: function (t, i) {
                    return null === t || void 0 === t ? e.apply(void 0, i) : e[t].apply(e, i)
                }, apply: function (t, i) {
                    return e.apply(t, i)
                }, keys: function () {
                    return p(e)
                }
            }, void 0, function () {
                return {state: "fulfilled", value: e}
            })
        }

        function W(e, t, i) {
            return C(e).spread(t, i)
        }

        function G(e, t, i) {
            return C(e).dispatch(t, i)
        }

        function H(e) {
            return A(e, function (e) {
                var t = 0, i = I();
                return d(e, function (n, a, o) {
                    var r;
                    x(a) && "fulfilled" === (r = a.inspect()).state ? e[o] = r.value : (++t, A(a, function (n) {
                        e[o] = n, 0 == --t && i.resolve(e)
                    }, i.reject, function (e) {
                        i.notify({index: o, value: e})
                    }))
                }, void 0), 0 === t && i.resolve(e), i.promise
            })
        }

        function z(e) {
            if (0 === e.length) return C.resolve();
            var t = C.defer(), i = 0;
            return d(e, function (n, a, o) {
                var r = e[o];
                i++, A(r, function (e) {
                    t.resolve(e)
                }, function (e) {
                    if (0 == --i) {
                        var n = e || new Error("" + e);
                        n.message = "Q can't get fulfillment value from any promise, all promises were rejected. Last error message: " + n.message, t.reject(n)
                    }
                }, function (e) {
                    t.notify({index: o, value: e})
                })
            }, void 0), t.promise
        }

        function j(e) {
            return A(e, function (e) {
                return e = c(e, C), A(H(c(e, function (e) {
                    return A(e, n, n)
                })), function () {
                    return e
                })
            })
        }

        C.resetUnhandledRejections = U, C.getUnhandledReasons = function () {
            return F.slice()
        }, C.stopUnhandledRejectionTracking = function () {
            U(), B = !1
        }, U(), C.reject = K, C.fulfill = V, C.master = function (e) {
            return D({
                isDef: function () {
                }
            }, function (t, i) {
                return G(e, t, i)
            }, function () {
                return C(e).inspect()
            })
        }, C.spread = W, D.prototype.spread = function (e, t) {
            return this.all().then(function (t) {
                return e.apply(void 0, t)
            }, t)
        }, C.async = function (e) {
            return function () {
                function t(e, t) {
                    var o;
                    if ("undefined" == typeof StopIteration) {
                        try {
                            o = i[e](t)
                        } catch (e) {
                            return K(e)
                        }
                        return o.done ? C(o.value) : A(o.value, n, a)
                    }
                    try {
                        o = i[e](t)
                    } catch (e) {
                        return function (e) {
                            return "[object StopIteration]" === v(e) || e instanceof s
                        }(e) ? C(e.value) : K(e)
                    }
                    return A(o, n, a)
                }

                var i = e.apply(this, arguments), n = t.bind(t, "next"), a = t.bind(t, "throw");
                return n()
            }
        }, C.spawn = function (e) {
            C.done(C.async(e)())
        }, C.return = function (e) {
            throw new s(e)
        }, C.promised = function (e) {
            return function () {
                return W([this, H(arguments)], function (t, i) {
                    return e.apply(t, i)
                })
            }
        }, C.dispatch = G, D.prototype.dispatch = function (e, t) {
            var i = this, n = I();
            return C.nextTick(function () {
                i.promiseDispatch(n.resolve, e, t)
            }), n.promise
        }, C.get = function (e, t) {
            return C(e).dispatch("get", [t])
        }, D.prototype.get = function (e) {
            return this.dispatch("get", [e])
        }, C.set = function (e, t, i) {
            return C(e).dispatch("set", [t, i])
        }, D.prototype.set = function (e, t) {
            return this.dispatch("set", [e, t])
        }, C.del = C.delete = function (e, t) {
            return C(e).dispatch("delete", [t])
        }, D.prototype.del = D.prototype.delete = function (e) {
            return this.dispatch("delete", [e])
        }, C.mapply = C.post = function (e, t, i) {
            return C(e).dispatch("post", [t, i])
        }, D.prototype.mapply = D.prototype.post = function (e, t) {
            return this.dispatch("post", [e, t])
        }, C.send = C.mcall = C.invoke = function (e, t) {
            return C(e).dispatch("post", [t, l(arguments, 2)])
        }, D.prototype.send = D.prototype.mcall = D.prototype.invoke = function (e) {
            return this.dispatch("post", [e, l(arguments, 1)])
        }, C.fapply = function (e, t) {
            return C(e).dispatch("apply", [void 0, t])
        }, D.prototype.fapply = function (e) {
            return this.dispatch("apply", [void 0, e])
        }, C.try = C.fcall = function (e) {
            return C(e).dispatch("apply", [void 0, l(arguments, 1)])
        }, D.prototype.fcall = function () {
            return this.dispatch("apply", [void 0, l(arguments)])
        }, C.fbind = function (e) {
            var t = C(e), i = l(arguments, 1);
            return function () {
                return t.dispatch("apply", [this, i.concat(l(arguments))])
            }
        }, D.prototype.fbind = function () {
            var e = this, t = l(arguments);
            return function () {
                return e.dispatch("apply", [this, t.concat(l(arguments))])
            }
        }, C.keys = function (e) {
            return C(e).dispatch("keys", [])
        }, D.prototype.keys = function () {
            return this.dispatch("keys", [])
        }, C.all = H, D.prototype.all = function () {
            return H(this)
        }, C.any = z, D.prototype.any = function () {
            return z(this)
        }, C.allResolved = (P = j, O = "allResolved", M = "allSettled", function () {
            return "undefined" != typeof console && "function" == typeof console.warn && console.warn(O + " is deprecated, use " + M + " instead.", new Error("").stack), P.apply(P, arguments)
        }), D.prototype.allResolved = function () {
            return j(this)
        }, C.allSettled = function (e) {
            return C(e).allSettled()
        }, D.prototype.allSettled = function () {
            return this.then(function (e) {
                return H(c(e, function (e) {
                    function t() {
                        return e.inspect()
                    }

                    return (e = C(e)).then(t, t)
                }))
            })
        }, C.fail = C.catch = function (e, t) {
            return C(e).then(void 0, t)
        }, D.prototype.fail = D.prototype.catch = function (e) {
            return this.then(void 0, e)
        }, C.progress = function (e, t) {
            return C(e).then(void 0, void 0, t)
        }, D.prototype.progress = function (e) {
            return this.then(void 0, void 0, e)
        }, C.fin = C.finally = function (e, t) {
            return C(e).finally(t)
        }, D.prototype.fin = D.prototype.finally = function (e) {
            if (!e || "function" != typeof e.apply) throw new Error("Q can't apply finally callback");
            return e = C(e), this.then(function (t) {
                return e.fcall().then(function () {
                    return t
                })
            }, function (t) {
                return e.fcall().then(function () {
                    throw t
                })
            })
        }, C.done = function (e, t, i, n) {
            return C(e).done(t, i, n)
        }, D.prototype.done = function (e, t, i) {
            var n = function (e) {
                C.nextTick(function () {
                    if (y(e, a), !C.onerror) throw e;
                    C.onerror(e)
                })
            }, a = e || t || i ? this.then(e, t, i) : this;
            "object" == typeof process && process && process.domain && (n = process.domain.bind(n)), a.then(void 0, n)
        }, C.timeout = function (e, t, i) {
            return C(e).timeout(t, i)
        }, D.prototype.timeout = function (e, t) {
            var i = I(), n = setTimeout(function () {
                t && "string" != typeof t || ((t = new Error(t || "Timed out after " + e + " ms")).code = "ETIMEDOUT"), i.reject(t)
            }, e);
            return this.then(function (e) {
                clearTimeout(n), i.resolve(e)
            }, function (e) {
                clearTimeout(n), i.reject(e)
            }, i.notify), i.promise
        }, C.delay = function (e, t) {
            return void 0 === t && (t = e, e = void 0), C(e).delay(t)
        }, D.prototype.delay = function (e) {
            return this.then(function (t) {
                var i = I();
                return setTimeout(function () {
                    i.resolve(t)
                }, e), i.promise
            })
        }, C.nfapply = function (e, t) {
            return C(e).nfapply(t)
        }, D.prototype.nfapply = function (e) {
            var t = I(), i = l(e);
            return i.push(t.makeNodeResolver()), this.fapply(i).fail(t.reject), t.promise
        }, C.nfcall = function (e) {
            var t = l(arguments, 1);
            return C(e).nfapply(t)
        }, D.prototype.nfcall = function () {
            var e = l(arguments), t = I();
            return e.push(t.makeNodeResolver()), this.fapply(e).fail(t.reject), t.promise
        }, C.nfbind = C.denodeify = function (e) {
            if (void 0 === e) throw new Error("Q can't wrap an undefined function");
            var t = l(arguments, 1);
            return function () {
                var i = t.concat(l(arguments)), n = I();
                return i.push(n.makeNodeResolver()), C(e).fapply(i).fail(n.reject), n.promise
            }
        }, D.prototype.nfbind = D.prototype.denodeify = function () {
            var e = l(arguments);
            return e.unshift(this), C.denodeify.apply(void 0, e)
        }, C.nbind = function (e, t) {
            var i = l(arguments, 2);
            return function () {
                var n = i.concat(l(arguments)), a = I();
                return n.push(a.makeNodeResolver()), C(function () {
                    return e.apply(t, arguments)
                }).fapply(n).fail(a.reject), a.promise
            }
        }, D.prototype.nbind = function () {
            var e = l(arguments, 0);
            return e.unshift(this), C.nbind.apply(void 0, e)
        }, C.nmapply = C.npost = function (e, t, i) {
            return C(e).npost(t, i)
        }, D.prototype.nmapply = D.prototype.npost = function (e, t) {
            var i = l(t || []), n = I();
            return i.push(n.makeNodeResolver()), this.dispatch("post", [e, i]).fail(n.reject), n.promise
        }, C.nsend = C.nmcall = C.ninvoke = function (e, t) {
            var i = l(arguments, 2), n = I();
            return i.push(n.makeNodeResolver()), C(e).dispatch("post", [t, i]).fail(n.reject), n.promise
        }, D.prototype.nsend = D.prototype.nmcall = D.prototype.ninvoke = function (e) {
            var t = l(arguments, 1), i = I();
            return t.push(i.makeNodeResolver()), this.dispatch("post", [e, t]).fail(i.reject), i.promise
        }, C.nodeify = function (e, t) {
            return C(e).nodeify(t)
        }, D.prototype.nodeify = function (e) {
            if (!e) return this;
            this.then(function (t) {
                C.nextTick(function () {
                    e(null, t)
                })
            }, function (t) {
                C.nextTick(function () {
                    e(t)
                })
            })
        }, C.noConflict = function () {
            throw new Error("Q.noConflict only works when Q is used as a global")
        };
        var X = w();
        return C
    })
}, 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, i) {
    "use strict";
    var n = i(4), a = {}, o = {numeric: !0, timeout: 2, min_reply: 1, extra: []};
    a.getResult = function (e, t) {
        var i = t || {}, a = [];
        return ["numeric", "timeout", "min_reply", "extra"].forEach(function (e) {
            "boolean" != typeof i[e] && (i[e] = i[e] || o[e])
        }), i.numeric && a.push("-n"), i.timeout && (a = a.concat(["-w", n.format("%d", i.timeout)])), i.min_reply && (a = a.concat(["-c", n.format("%d", i.min_reply)])), i.extra && (a = a.concat(i.extra)), a.push(e), a
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = {}, o = {numeric: !0, timeout: 2, min_reply: 1, extra: []};
    a.getResult = function (e, t) {
        var i = t || {}, a = [];
        return ["numeric", "timeout", "min_reply", "extra"].forEach(function (e) {
            "boolean" != typeof i[e] && (i[e] = i[e] || o[e])
        }), i.numeric && a.push("-n"), i.timeout && (a = a.concat(["-t", n.format("%d", i.timeout)])), i.min_reply && (a = a.concat(["-c", n.format("%d", i.min_reply)])), i.extra && (a = a.concat(i.extra)), a.push(e), a
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = {}, o = {numeric: !0, timeout: 5, min_reply: 1, extra: []};
    a.getResult = function (e, t) {
        var i = t || {}, a = [];
        return ["numeric", "timeout", "min_reply", "extra"].forEach(function (e) {
            "boolean" != typeof i[e] && (i[e] = i[e] || o[e])
        }), i.numeric || a.push("-a"), i.timeout && (a = a.concat(["-w", n.format("%d", 1e3 * i.timeout)])), i.min_reply && (a = a.concat(["-n", n.format("%d", i.min_reply)])), i.extra && (a = a.concat(i.extra)), a.push(e), a
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(507), o = i(865), r = i(508), s = i(866);

    function l() {
    }

    l.createParser = function (e) {
        if (!a.isPlatformSupport(e)) throw new Error(n.format("Platform |%s| is not support", e));
        var t = null;
        return a.isWindow(e) ? t = new o : a.isMacOS(e) ? t = new r : a.isLinux(e) && (t = new s), t
    }, e.exports = l
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(112), o = i(366);

    function r() {
        o.call(this), this._ipv4Regex = /^([0-9]{1,3}\.){3}[0-9]{1,3}$/
    }

    n.inherits(r, o), r.prototype._processHeader = function (e) {
        var t = e.split(" ");
        this._response.host = t[1], this._ipv4Regex.test(this._response.host) ? this._response.numeric_host = t[1] : this._response.numeric_host = t[2].slice(1, -1), this._changeState(this.STATES.BODY)
    }, r.prototype._processBody = function (e) {
        var t = e.split(" "), i = a.filter(t, function (e) {
            return e.indexOf("=") >= 0 || e.indexOf("<") >= 0
        });
        if (i.length >= 3) {
            var n = a.find(i, function (e) {
                return e.indexOf("ms") >= 0
            }), o = /([0-9\.]+)/.exec(n);
            this._times.push(parseFloat(o[1], 10))
        }
        ":" === e.slice(-1) && this._changeState(this.STATES.FOOTER)
    }, r.prototype._processFooter = function (e) {
        if (e.indexOf("ms") >= 0) {
            var t = /([0-9\.]+)/g, i = t.exec(e), n = t.exec(e), o = t.exec(e);
            a.all([i, n, o]) && (this._response.min = parseFloat(i[1], 10), this._response.max = parseFloat(n[1], 10), this._response.avg = parseFloat(o[1], 10), this._changeState(this.STATES.END))
        }
    }, e.exports = r
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(366), o = i(508);

    function r() {
        a.call(this)
    }

    n.inherits(r, a), r.prototype._processHeader = function (e) {
        var t = e.split(" ");
        this._response.host = t[1], this._response.numeric_host = t[2].slice(1, -1), this._changeState(this.STATES.BODY)
    }, r.prototype._processBody = function (e) {
        o.prototype._processBody.call(this, e)
    }, r.prototype._processFooter = function (e) {
        o.prototype._processFooter.call(this, e)
    }, e.exports = r
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i, n, a, o;
        !function (e) {
            e.Unkown = "XgtType.Unkown", e.Try = "XgtType.Try", e.Ad = "XgtType.Ad", e.Baotuan = "XgtType.Baotuan", e.PlayGame = "XgtType.PlayGame", e.PackageTry = "XgtType.PackageTry"
        }(t = e.XgtType || (e.XgtType = {})), function (e) {
            e[e.Before_All = 0] = "Before_All", e[e.Before_Novice = 1] = "Before_Novice", e[e.Before_Join = 2] = "Before_Join", e[e.Before_CutLine = 3] = "Before_CutLine", e[e.Doing_CutLineOut = 4] = "Doing_CutLineOut", e[e.Doing_Succeed = 5] = "Doing_Succeed", e[e.Doing_SucceedCutLineOut = 6] = "Doing_SucceedCutLineOut", e[e.Doing_SucceedOpenAuto = 7] = "Doing_SucceedOpenAuto", e[e.Doing_KickOut = 8] = "Doing_KickOut"
        }(i = e.BaotuanXgt || (e.BaotuanXgt = {})), function (e) {
            e[e.NoVip = -1] = "NoVip", e[e.Vip = 0] = "Vip", e[e.Try = 1] = "Try", e[e.Ad = 2] = "Ad"
        }(n = e.VipTaskType || (e.VipTaskType = {})), function (e) {
            e[e.PlatinumVip = 0] = "PlatinumVip", e[e.SuperVip = 1] = "SuperVip", e[e.MixVip = 2] = "MixVip"
        }(a = 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"
        }(o = e.VipTaskStatus || (e.VipTaskStatus = {}))
    }(t.VipDownloadDefineNS || (t.VipDownloadDefineNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(11), r = i(341), s = i(18), l = i(17), d = i(5), u = i(33), c = i(455), h = i(0), f = i(56),
        g = i(25), p = i(7), v = h.default.getLogger("Thunder.embedded-browser:individuation-browser"),
        m = p.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    class y {
        constructor() {
            this.browserCtr = null, this.wnd = null, this.state = void 0, this.curShowCmd = "show", this.browserEventHandler = null, this.attachListener().catch()
        }

        setBrowserEventHandler(e) {
            this.browserEventHandler = e
        }

        closeWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && this.wnd.close()
            })
        }

        showBrowser(e, t, i, a, o, r, l, d, c) {
            return n(this, void 0, void 0, function* () {
                v.information("showBrowser");
                do {
                    if (!this.browserCtr) {
                        if (!(yield this.createBrowser(e, t, i, a, o, r, l, d, c))) break
                    }
                    if ("loaded" === this.state) {
                        let e = this.browserCtr.getBrowser().getWindowHandle();
                        m.showWindow(e, f.CmdShow.SW_SHOW)
                    } else "error" === this.state && s.ipcRenderer.send(u.ThunderChannelList.channelMRIndividuationBrowserMsg, "OnLoadError")
                } while (0)
            })
        }

        hideBrowser() {
            if (v.information("hideBrowser"), this.browserCtr) {
                let e = this.browserCtr.getBrowser().getWindowHandle();
                m.showWindow(e, f.CmdShow.SW_HIDE)
            }
        }

        destroyBrowser() {
            v.information("destroyBrowser"), this.browserCtr && this.browserCtr.destroyBrowser(!1), this.browserCtr = null, this.state = void 0
        }

        isWindow() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                return this.wnd && !(yield this.wnd.isDestroyed()) && (e = !0), e
            })
        }

        createBrowser(e, t, i, a, s, l, d, u, h) {
            return n(this, void 0, void 0, function* () {
                let n = !1, g = c.CommonFunctionNs.getBrowserWindowRect(e, a, s, l, d, u, h);
                v.information("createBrowser", "hwnd", e, "url", i, "rect", g);
                let p = yield(yield o.asyncRemoteCall.getBrowserWindow()).fromId(t), y = !0;
                return p && (y = yield p.isDestroyed()), y || (this.setWnd(p), this.browserCtr = new r.BrowserCtrl, this.browserCtr.createChromiumBrowser(e, i, !1, g, this.getDefaultEvents()).catch(), this.registerNativeFunctions(this.getNativeFunctionMap()), m.setWindowLong(e, f.SetWindowType.GWL_STYLE, f.WindowStyle.WS_CLIPCHILDREN), n = !0), n
            })
        }

        refresh() {
            v.information("refresh"), this.browserCtr && (this.state = void 0, this.browserCtr.refresh(!0))
        }

        resize(e, t, i, n, a, o) {
            v.information("resize"), this.browserCtr && this.browserCtr.getBrowser() && c.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), e, t, i, n, a, o, "show" === this.curShowCmd ? f.Uflag.SWP_SHOWWINDOW : f.Uflag.SWP_HIDEWINDOW)
        }

        setWnd(e) {
            this.wnd = e, this.wnd.once("close", () => {
                v.information("parentWindow close"), this.destroyBrowser(), this.wnd = null
            })
        }

        closeDialog(e, t, i, n) {
            this.closeWnd().catch(), e.callNativeFunctionCallback(t, i, g.NativeFunctionErrorCode.Success)
        }

        onLoadError(e, t, i, a, o, r) {
            return n(this, void 0, void 0, function* () {
                if (v.information("OnLoadError isMainFrame, errorCode, url: ", t, a, i), (yield this.isWindow()) && t) if (-3 === a) {
                    this.state = "loaded";
                    let t = e.target.getWindowHandle();
                    m.showWindow(t, "show" === this.curShowCmd ? f.CmdShow.SW_SHOW : f.CmdShow.SW_HIDE)
                } else this.state = "error", s.ipcRenderer.send(u.ThunderChannelList.channelMRIndividuationBrowserMsg, "OnLoadError");
                this.browserEventHandler && t && this.browserEventHandler("OnLoadError", t, i, a, o, r)
            })
        }

        onLoadEnd(e, t, i, a, o) {
            return n(this, void 0, void 0, function* () {
                v.information("OnLoadEnd isMainFrame", t, i);
                do {
                    if ("error" === this.state) break;
                    if ((yield this.isWindow()) && t) {
                        this.state = "loaded";
                        let t = e.target.getWindowHandle();
                        m.showWindow(t, "show" === this.curShowCmd ? f.CmdShow.SW_SHOW : f.CmdShow.SW_HIDE)
                    }
                    this.browserEventHandler && t && this.browserEventHandler("OnLoadEnd", t, i, a, o)
                } while (0)
            })
        }

        onBeforeNavigate(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                if (v.information("OnBeforeNavigate isMainframe", t, i), (yield this.isWindow()) && t) {
                    let t = e.target.getWindowHandle();
                    m.showWindow(t, f.CmdShow.SW_HIDE)
                }
                this.browserEventHandler && this.browserEventHandler("OnBeforeNavigate", t, i, a)
            })
        }

        onNewBrowserPopup(e, t, i, n, a, o) {
            v.information("onNewBrowserPopup url", i);
            let r = !1;
            this.browserEventHandler && (r = this.browserEventHandler("OnNewBrowserPopup", i)), r || d.client.callServerFunction("openNewTab", i).catch()
        }

        getDefaultEvents() {
            return [{eventName: "before-nav", listener: this.onBeforeNavigate.bind(this)}, {
                eventName: "load-error",
                listener: this.onLoadError.bind(this)
            }, {eventName: "load-end", listener: this.onLoadEnd.bind(this)}, {
                eventName: "new-browser-popup",
                listener: this.onNewBrowserPopup.bind(this)
            }]
        }

        getNativeFunctionMap() {
            return [{functionName: "CloseDialog", nativeFunc: this.closeDialog.bind(this)}]
        }

        attachListener() {
            return n(this, void 0, void 0, function* () {
                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)
                }), (yield o.asyncRemoteCall.getIpcMain()).on(u.ThunderChannelList.channelRMIndividuationBrowserMsg, (e, t, ...i) => {
                    if (v.information(".ipcMain.on:", u.ThunderChannelList.channelRMIndividuationBrowserMsg, t), "show" === t) {
                        this.curShowCmd = "show";
                        let e = i[0], t = i[1], n = i[2], a = i[3], o = i[4], r = i[5], s = i[6], l = i[7], d = i[8];
                        this.showBrowser(e, t, n, a, o, r, s, l, d).catch()
                    } else if ("hide" === t) this.curShowCmd = "hide", this.hideBrowser(); else if ("refresh" === t) this.refresh(); else if ("resize" === t || "move" === t) {
                        let e = i[0], t = i[1], n = i[2], a = i[3], o = i[4], r = i[5];
                        this.resize(e, t, n, a, o, r)
                    }
                })
            })
        }

        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)
        }
    }

    t.IndividuationBrowser = y, t.default = new y
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(0), o = i(3), r = i(15), s = i(7).default(n.join(__rootDir, "../bin/ThunderHelper.node")),
        l = a.default.getLogger("Thunder.TaskP2spAutoRename"), d = r.DownloadKernelEventManager.getEventManager();
    !function (e) {
        let t = void 0, i = void 0;

        function a(e, t) {
            do {
                if (!e) break;
                if (e.getType() !== o.DownloadKernel.TaskType.P2sp) break;
                if (0 == (t & (o.DownloadKernel.TaskDetailChangedFlags.OriginName | o.DownloadKernel.TaskDetailChangedFlags.HTTPContentType))) break;
                let i = "";
                0 != (t & o.DownloadKernel.TaskDetailChangedFlags.HTTPContentType) && (i = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.HTTPContentType), l.information("httpContentType:", i));
                let a = "", r = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskName), d = !1;
                if (1 !== e.getExtraObject().getNameFixed()) {
                    if (0 != (t & o.DownloadKernel.TaskDetailChangedFlags.OriginName)) {
                        let t = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.OriginName);
                        l.information("originName:", t), t && "" !== t && (a = t, n.extname(a) || (d = !0))
                    }
                } else if (l.information("p2spTask name fixed!", e.getId()), i && "" !== i) {
                    let e = n.extname(r);
                    (!e || "" === e || e.length > 5) && (a = r, d = !0)
                }
                if (d && i && "" !== i && "" !== a) {
                    let e = n.parse(a).name;
                    if (e && "" !== e) {
                        let t = "HKEY_CLASSES_ROOT", n = "MIME\\Database\\Content Type\\" + i, o = "Extension",
                            r = s.readRegString(t, n, o);
                        r && "" !== r && (a = e + r)
                    }
                }
                "" !== a && a !== r && (l.information("task rename:", a, ", old name:", r), e.reName(a).catch())
            } while (0)
        }

        function r(e, t) {
            e.forEach(e => {
                a(e, t)
            })
        }

        e.init = function () {
            do {
                if (void 0 !== t && void 0 !== i) break;
                t = d.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === o.DownloadKernel.TaskEventType.DetailChanged && r(e[1], e[2])
                }), i = d.attachTaskEvent(o.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    e && e[0] === o.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged && e[1].forEach((e, t) => {
                        e.forEach(e => {
                            a(e, e.getDetailChangedFlags())
                        })
                    })
                })
            } while (0)
        }, e.uninit = function () {
            do {
                if (void 0 !== t && void 0 !== i) break;
                d.detachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, t), t = void 0, d.detachTaskEvent(o.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, i), i = void 0
            } while (0)
        }
    }(t.TaskP2spAutoRenameNS || (t.TaskP2spAutoRenameNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(4), o = i(16), r = i(362), s = n.default.getLogger("ScheduleTaskPluginFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetDownloadCompleteTaskType: this.getDownloadCompleteTaskType,
                        SetDownloadCompleteTaskType: this.setDownloadCompleteTaskType,
                        CancelDownloadCompleteTask: this.cancelDownloadCompleteTask
                    };
                    o.server.registerFunctions(e)
                }
            }

            getDownloadCompleteTaskType(e, t, ...i) {
                let n = r.ScheduleCompleteTaskType.UnKnown;
                do {
                    if (!e) break;
                    n = r.ScheduleTaskNS.getDownloadCompleteTaskType()
                } while (0);
                return n
            }

            setDownloadCompleteTaskType(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (!i || !a.isNumber(i[0])) break;
                    s.information("setDownloadCompleteTaskType:", i[0]), r.ScheduleTaskNS.setDownloadCompleteTaskType(i[0]), n = !0
                } while (0);
                return n
            }

            cancelDownloadCompleteTask(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    s.information("cancelDownloadCompleteTask"), r.ScheduleTaskNS.cancelDownloadCompleteTask(), n = !0
                } while (0);
                return n
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ScheduleTaskPluginFunctionNS || (t.ScheduleTaskPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

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

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

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(16), r = i(0), s = i(12), l = i(3), d = i(56), u = i(5), c = i(55), h = i(6), f = i(13),
        g = i(9), p = i(24), v = i(32), m = i(15), y = i(37), k = i(872), T = i(30),
        w = m.DownloadKernelEventManager.getEventManager(), C = s.DownloadKernelTaskManager.getTaskManager(),
        S = r.default.getLogger("ThunderMain-client-process");
    t.clientProduct = new class {
        constructor() {
            this.panRationInfo = {
                fileId: "",
                infos: []
            }, this.onOpenSuccCookie = 0, this.taskStateChangeCookid = 0, this.isRegister = !1, this.playingId = "", this.playSoure = d.XmpPlaySoure.PLAY_UNKNOWN, this.panTasks = new Map, this.selectTaskId = "", this.selectTab = ""
        }

        init() {
            return n(this, void 0, void 0, function* () {
                this.isRegister || (this.isRegister = !0, o.server.registerFunctions({
                    GetRationInfos: this.getRationInfos.bind(this),
                    YunPlay: this.yunPlay.bind(this),
                    SelectTaskChange: this.selectTaskChange.bind(this),
                    SetPlayingTaskId: this.setPlayingTaskId.bind(this),
                    UpdatePanEmbedRect: this.updatePanEmbedRect.bind(this),
                    UpdateDownloadEmbedRect: this.updateDownloadEmbedRect.bind(this),
                    SetXmpCurrentMode: this.setXmpCurrentMode.bind(this),
                    ClosePlay: this.closePlay.bind(this),
                    ThunderResize: this.thunderResize.bind(this),
                    SetSelectPanFileId: this.setSelectPanFileId.bind(this),
                    BackUpEmbedAndSelectPlayingTask: this.backUpEmbedAndSelectPlayingTask.bind(this),
                    GetPlayingTaskId: this.getPlayingTaskId.bind(this),
                    GetPlayingSoure: this.getPlayingSoure.bind(this),
                    CreateYunPlayTask: this.createYunPlayTask.bind(this),
                    GetThunderSelectTaskId: this.getThunderSelectTaskId.bind(this),
                    GetThunderSelectTab: this.getThunderSelectTab.bind(this),
                    SetShowStateByScroll: this.setShowStateByScroll.bind(this),
                    SetTaskVideoByteRatio: this.setTaskVideoByteRatio.bind(this)
                }), u.client.attachServerEvent("OnCurNavChange", (e, t, i) => n(this, void 0, void 0, function* () {
                    S.information("cqm OnCurNavChange currentPanel", t), yield this.callXmpMainRenderer("SetSelectPanel", t)
                })), u.client.attachServerEvent("OnLogout", () => n(this, void 0, void 0, function* () {
                    yield this.callXmpMainRenderer("OnUserLogout")
                })), u.client.attachServerEvent("OnSelectTabChange", (e, t, i) => n(this, void 0, void 0, function* () {
                    this.selectTab = t, yield this.callXmpMainRenderer("SetSelectTab", t)
                })), u.client.attachServerEvent("OnXmpClose", e => n(this, void 0, void 0, function* () {
                    this.playSoure = d.XmpPlaySoure.PLAY_UNKNOWN, this.playingId = ""
                })), u.client.attachServerEvent("OnStop", (e, t, i, a, o) => n(this, void 0, void 0, function* () {
                    if (this.panTasks && o) {
                        let e = this.panTasks.get(o);
                        S.information("value", e, "panFileId", "panTasks", this.panTasks), C.stopTask(e, l.DownloadKernel.TaskStopReason.Unknown), this.panTasks.delete(o)
                    }
                })))
            })
        }

        yunPlay(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let e = {ret: !1, errcode: 0};
                do {
                    if (!i || !i.playUrl || !i.fileName) break;
                    let t = "";
                    if (S.information("yunPlay xmpInfo.medias", i.medias), i.taskUrl = i.taskUrl ? i.taskUrl : "", i.cid = i.cid ? i.cid : "", i.gcid = i.gcid ? i.gcid : "", i.taskId = i.taskId ? i.taskId : -1, i.fileSize = i.fileSize ? i.fileSize : 0, i.fileDir = i.fileDir ? i.fileDir : "", i.fileIndex = i.fileIndex ? i.fileIndex : 0, i.dlnaPlay = void 0 !== i.dlnaPlay && i.dlnaPlay, i.playPosPercent = i.playPosPercent ? i.playPosPercent : 0, i.startPos = i.startPos ? i.startPos : 0, i.taskType = i.taskType ? i.taskType : 0, i.fromweb = void 0 === i.fromweb || i.fromweb, i.openFrom = i.openFrom ? i.openFrom : "xunlei11", i.panFileId = i.panFileId ? i.panFileId : null, i.isEmbed = void 0 === i.isEmbed || i.isEmbed, i.playSoure = d.XmpPlaySoure.PLAY_BY_PAN, i.medias && i.medias.length > 0) {
                        let e = [];
                        for (let n of i.medias) {
                            let a = {};
                            a.ratioId = n.media_id, a.rationName = n.media_name, a.iconLink = n.icon_link, a.isOrigin = n.is_origin, a.isDefault = n.is_default, a.isVisible = n.is_visible, a.priority = n.priority, a.name = n.resolution_name, a.need_more_quota = n.need_more_quota, a.redirect_link = n.redirect_link, n.link && (a.url = n.link.url, a.expire = n.link.expire, a.token = n.link.token), n.is_default && (i.playUrl = n.link.url, t = n.link.token), e.push(a)
                        }
                        this.panRationInfo.fileId = i.panFileId, this.panRationInfo.infos = e
                    }
                    e = yield v.TaskOperatorNs.playVideoByXmp(i), u.client.detachServerEvent("OnOpenSucceededCreateTask", this.onOpenSuccCookie), this.onOpenSuccCookie = u.client.attachServerEvent("OnOpenSucceededCreateTask", (e, a, o, r) => n(this, void 0, void 0, function* () {
                        i.panFileId && o === i.panFileId && (yield this.createTask(i.playUrl, i.fileName, i.panFileId, t, r), u.client.detachServerEvent("OnOpenSucceededCreateTask", this.onOpenSuccCookie), this.onOpenSuccCookie = 0)
                    }))
                } while (0);
                return e
            })
        }

        createTask(e, t, i, r, s) {
            return n(this, void 0, void 0, function* () {
                let s = p.default.getConfigInfo("xmpDoubleUrl", "close");
                if (S.information("createTask close", s), s) return S.information("xmpDoubleUrl close"), !1;
                this.taskStateChangeCookid && (w.detachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, this.taskStateChangeCookid), this.taskStateChangeCookid = 0);
                let d = yield f.ThunderUtil.getThunderTempPath(!0), u = "",
                    c = g.ConfigNS.getValue("ThunderPanPlugin", "useDefault", !1);
                if (S.information("userDefault", c), c) u = g.ConfigNS.getValue("ThunderPanPlugin", "defaultDownloadPath", "C:\\迅雷下载"); else {
                    let e = g.ConfigNS.getValue("ThunderPanPlugin", "downloadPaths", []);
                    e && e.length > 0 && (u = e[0])
                }
                let v = "";
                v = u && "" !== u ? a.join(u, "云盘缓存") : a.join(d, "云盘取回", "云盘缓存"), (yield h.FileSystemAWNS.existsAW(v)) || (yield h.FileSystemAWNS.mkdirAW(v)), S.information("dirPath", v);
                let m = {taskBaseInfo: {taskName: t, savePath: v, productInfo: "", origin: ""}, isBackground: !0},
                    y = {url: e, nameFixed: 1};
                m.p2spTaskInfo = y;
                let T = C.findTask(e);
                yield C.deleteTask(T, !0);
                let I = yield C.createTask(l.DownloadKernel.TaskType.P2sp, m);
                if (!I) return !1;
                if (T = I.getId(), S.information("createTask taskId", T), r) I.enableDcdnWithVipCert(r); else {
                    let e = yield o.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetFiles", [i]);
                    if (e && e[0] && e[0].files && e[0].files[0] && e[0].files[0].links && e[0].files[0].links && e[0].files[0].links["application/octet-stream"]) {
                        let t = e[0].files[0].links["application/octet-stream"].token;
                        I.enableDcdnWithVipCert(t)
                    }
                }
                S.information("token", r);
                let b = !1;
                I.setDownloadStrategy(l.DownloadKernel.XLDownloadStrategy.XL_TASKDOWNLOAD_STRATEGY_ONLINEPLAYING), b = yield C.startTask(T), this.setPanTask(i, T);
                let _ = "";
                return this.taskStateChangeCookid = w.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (e[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                        let t = e[1];
                        if (!t || t.length < 1) break;
                        for (let e = 0; e < t.length; ++e) if (t[e].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId) === T && t[e].getTaskStatus() === l.DownloadKernel.TaskStatus.Started) {
                            w.detachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, this.taskStateChangeCookid), this.taskStateChangeCookid = 0, _ = yield I.getPlayUrl(-1), yield this.callXmpMainRenderer("XmpPlayerSetConfig", k.APlayerConfigId.CONFIGID_NETWORK__STUFFURL, _), yield this.callXmpMainRenderer("XmpPlayerRecordStat", "setYunDownloadId", T), S.information("OnSetAplayerConfig taskId", T, "ret", b, "playUrl", _);
                            break
                        }
                    } while (0)
                })), b
            })
        }

        selectTaskChange(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                this.selectTaskId = i, yield this.callXmpMainRenderer("SetSelectTaskId", i, a)
            })
        }

        setPlayingTaskId(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                S.information("setPlayingTaskId", i, a), this.playingId = i, this.playSoure = a, a === d.XmpPlaySoure.PLAY_BY_DOWNLOAD ? yield this.callXmpMainRenderer("SetPlayingTaskId", i, a) : yield this.callXmpMainRenderer("SetPlayingPanFileId", i, a)
            })
        }

        updateDownloadEmbedRect(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.callXmpMainRenderer("UpdateDownloadEmbedRect", i), yield this.callXmpMainProcess("UpdateDownloadEmbedRect", i)
            })
        }

        updatePanEmbedRect(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.callXmpMainRenderer("UpdatePanEmbedRect", i), yield this.callXmpMainProcess("UpdatePanEmbedRect", i)
            })
        }

        setXmpCurrentMode(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.callXmpMainRenderer("SetXmpCurrentMode", i)
            })
        }

        closePlay(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.callXmpMainRenderer("XmpPlayerClose", i)
            })
        }

        callXmpMainProcess(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = yield u.client.callRemoteClientFunction(c.mainProcessContext, e, ...t).catch();
                return i && i.length > 0 ? i[0] : {}
            })
        }

        callXmpMainRenderer(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = yield u.client.callRemoteClientFunction(c.mainRendererContext, e, ...t).catch();
                return i && i.length > 0 ? i[0] : {}
            })
        }

        quitDeletePanTmpXmpDownloadFile() {
            return n(this, void 0, void 0, function* () {
                for (let e of this.panTasks.values()) yield C.deleteTask(e, !0);
                return !0
            })
        }

        thunderResize(e, t) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(c.mainProcessContext, "ThunderResize")
            })
        }

        setSelectPanFileId(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                this.selectTaskId = i, yield this.callXmpMainRenderer("SetSelectPanFileId", i, a)
            })
        }

        setPanTask(e, t) {
            this.panTasks.set(e, t)
        }

        backUpEmbedAndSelectPlayingTask(e, t, i, a, r) {
            return n(this, void 0, void 0, function* () {
                r === d.XmpPlaySoure.PLAY_BY_PAN ? o.server.callClientFunctionByName("ThunderPanPluginWebview", "ShowFileDetail", {
                    fileId: a,
                    redirect: !0
                }).catch() : yield y.ThunderNewTask.selectTask(Number(i))
            })
        }

        getPlayingTaskId(e, t, ...i) {
            return this.playingId
        }

        getPlayingSoure(e, t, ...i) {
            return this.playSoure
        }

        createYunPlayTask(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                let e = i[0], t = i[1], n = i[2], a = i[3], o = i[4], r = i[5];
                if (o) {
                    let t = C.findTask(e);
                    S.information("createYunPlayTask deleteTask taskId", t, "preUrl", o), yield C.deleteTask(t, !0)
                }
                yield this.createTask(e, t, n, a, r)
            })
        }

        getRationInfos(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                return i && i[0] === this.panRationInfo.fileId ? this.panRationInfo.infos : []
            })
        }

        getThunderSelectTaskId(e, t, ...i) {
            return this.selectTaskId
        }

        getThunderSelectTab(e, t, ...i) {
            return this.selectTab
        }

        setShowStateByScroll(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.callXmpMainRenderer("SetCanShowStateByScroll", i)
            })
        }

        setTaskVideoByteRatio(e, t, i, a, o, r) {
            return n(this, void 0, void 0, function* () {
                i || (i = this.panTasks.get(r));
                let e = C.getTaskFromTaskId(i);
                if (!e) return;
                let t = e.getVirtualTaskId();
                a = a || -1, S.information("taskId", i, "bytesPerSecond", o, "virtualTaskId", t), T.ThunderKernel.updateTaskVideoByteRatio(t, -1, o)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.CONFIGID_APLAYERINFO = 1] = "CONFIGID_APLAYERINFO", e[e.CONFIGID_CODECSPATH = 2] = "CONFIGID_CODECSPATH", e[e.CONFIGID_CODECSDISABLELIST = 3] = "CONFIGID_CODECSDISABLELIST", e[e.CONFIGID_CURRENTURL = 4] = "CONFIGID_CURRENTURL", e[e.CONFIGID_FILESIZE = 5] = "CONFIGID_FILESIZE", e[e.CONFIGID_PLAYMODE = 6] = "CONFIGID_PLAYMODE", e[e.CONFIGID_PLAYRESULT = 7] = "CONFIGID_PLAYRESULT", e[e.CONFIGID_AUTOPLAY = 8] = "CONFIGID_AUTOPLAY", e[e.CONFIGID_USEOPENCHAIN = 9] = "CONFIGID_USEOPENCHAIN", e[e.CONFIGID_SOUNDDEVICELIST = 10] = "CONFIGID_SOUNDDEVICELIST", e[e.CONFIGID_SOUNDDEVICECURRENT = 11] = "CONFIGID_SOUNDDEVICECURRENT", e[e.CONFIGID_SOUNDSILENT = 12] = "CONFIGID_SOUNDSILENT", e[e.CONFIGID_SOUNDBALANCE = 13] = "CONFIGID_SOUNDBALANCE", e[e.CONFIGID_DISABLEVIDEO = 14] = "CONFIGID_DISABLEVIDEO", e[e.CONFIGID_DISABLEAUDIO = 15] = "CONFIGID_DISABLEAUDIO", e[e.CONFIGID_ENABLEVSFILTER = 16] = "CONFIGID_ENABLEVSFILTER", e[e.CONFIGID_ENABLEAUDIOSWITCHER = 17] = "CONFIGID_ENABLEAUDIOSWITCHER", e[e.CONFIGID_DOWNLOADCODECSYNC = 18] = "CONFIGID_DOWNLOADCODECSYNC", e[e.CONFIGID_DOWNLOADCODECCOMPLETED = 19] = "CONFIGID_DOWNLOADCODECCOMPLETED", e[e.CONFIGID_WINDOWHANDLE = 20] = "CONFIGID_WINDOWHANDLE", e[e.CONFIGID_WINDOWMOVED = 21] = "CONFIGID_WINDOWMOVED", e[e.CONFIGID_SETTINGEXPLAIN = 22] = "CONFIGID_SETTINGEXPLAIN", e[e.CONFIGID_SETTINGVALUES = 23] = "CONFIGID_SETTINGVALUES", e[e.CONFIGID_LOADPLUGIN = 24] = "CONFIGID_LOADPLUGIN", e[e.CONFIGID_FREEPLUGIN = 25] = "CONFIGID_FREEPLUGIN", e[e.CONFIGID_FLASHINTERACTION = 26] = "CONFIGID_FLASHINTERACTION", e[e.CONFIGID_INTELMEDIASDKDECODER = 27] = "CONFIGID_INTELMEDIASDKDECODER", e[e.CONFIGID_INTELMEDIASDKENCODER = 28] = "CONFIGID_INTELMEDIASDKENCODER", e[e.CONFIGID_READSIZE = 29] = "CONFIGID_READSIZE", e[e.CONFIGID_READOFFSET = 30] = "CONFIGID_READOFFSET", e[e.CONFIGID_READPOSITION = 31] = "CONFIGID_READPOSITION", e[e.CONFIGID_WRITEOFFSET = 32] = "CONFIGID_WRITEOFFSET", e[e.CONFIGID_ALLOWLOG = 33] = "CONFIGID_ALLOWLOG", e[e.CONFIGID_MEDIAINFO = 34] = "CONFIGID_MEDIAINFO", e[e.CONFIGID_PLUGINSTDCALL = 35] = "CONFIGID_PLUGINSTDCALL", e[e.CONFIGID_LOGOSETTINGS = 36] = "CONFIGID_LOGOSETTINGS", e[e.CONFIGID_LOGOFILE = 37] = "CONFIGID_LOGOFILE", e[e.CONFIGID_CUSTOMCURSOR = 38] = "CONFIGID_CUSTOMCURSOR", e[e.CONFIGID_APLAYERDNN = 43] = "CONFIGID_APLAYERDNN", e[e.CONFIGID_AUTOPLAY_AFTERBUFFER = 48] = "CONFIGID_AUTOPLAY_AFTERBUFFER", e[e.CONFIGID_TIMEISFRAME = 101] = "CONFIGID_TIMEISFRAME", e[e.CONFIGID_STARTPOSITION = 102] = "CONFIGID_STARTPOSITION", e[e.CONFIGID_STOPPOSITION = 103] = "CONFIGID_STOPPOSITION", e[e.CONFIGID_PLAYSPEED = 104] = "CONFIGID_PLAYSPEED", e[e.CONFIGID_KEYFRAMESEEK = 105] = "CONFIGID_KEYFRAMESEEK", e[e.CONFIGID_KEYFRAMECOUNT = 106] = "CONFIGID_KEYFRAMECOUNT", e[e.CONFIGID_KEYFRAMELIST = 107] = "CONFIGID_KEYFRAMELIST", e[e.CONFIGID_KEYFRAMECURRENT = 108] = "CONFIGID_KEYFRAMECURRENT", e[e.CONFIGID_CANFRAMESTEPFORWARDONE = 109] = "CONFIGID_CANFRAMESTEPFORWARDONE", e[e.CONFIGID_CANFRAMESTEPFORWARDMULTI = 110] = "CONFIGID_CANFRAMESTEPFORWARDMULTI", e[e.CONFIGID_CANFRAMESTEPBACKWORDKONE = 111] = "CONFIGID_CANFRAMESTEPBACKWORDKONE", e[e.CONFIGID_CANFRAMESTEPBACKWORDMULTI = 112] = "CONFIGID_CANFRAMESTEPBACKWORDMULTI", e[e.CONFIGID_FRAMESTEP = 113] = "CONFIGID_FRAMESTEP", e[e.CONFIGID_ISFRAMESTEPPING = 114] = "CONFIGID_ISFRAMESTEPPING", e[e.CONFIGID_READINDEXWHENOPEN = 115] = "CONFIGID_READINDEXWHENOPEN", e[e.CONFIGID_TIMEPOSITIONLIST = 116] = "CONFIGID_TIMEPOSITIONLIST", e[e.CONFIGID_FRAMEINTERVAL = 117] = "CONFIGID_FRAMEINTERVAL", e[e.CONFIGID_FRAMESDRAWN = 118] = "CONFIGID_FRAMESDRAWN", e[e.CONFIGID_LOOPPLAY = 119] = "CONFIGID_LOOPPLAY", e[e.CONFIGID_NOCLOSEWHENCOMPLETE = 120] = "CONFIGID_NOCLOSEWHENCOMPLETE", e[e.CONFIGID_MOUSEFRAMESEEK = 122] = "CONFIGID_MOUSEFRAMESEEK", e[e.CONFIGID_RENDERMODECONFIG = 201] = "CONFIGID_RENDERMODECONFIG", e[e.CONFIGID_RENDERMODECURRENT = 202] = "CONFIGID_RENDERMODECURRENT", e[e.CONFIGID_ASPECTRATIONATIVE = 203] = "CONFIGID_ASPECTRATIONATIVE", e[e.CONFIGID_ASPECTRATIOCUSTOM = 204] = "CONFIGID_ASPECTRATIOCUSTOM", e[e.CONFIGID_VIDEOSOURCEPOSITION = 205] = "CONFIGID_VIDEOSOURCEPOSITION", e[e.CONFIGID_VIDEOTARGETPOSITION = 206] = "CONFIGID_VIDEOTARGETPOSITION", e[e.CONFIGID_CLIPBLACKBANDENABLE = 207] = "CONFIGID_CLIPBLACKBANDENABLE", e[e.CONFIGID_CLIPBLACKBANDSTILL = 208] = "CONFIGID_CLIPBLACKBANDSTILL", e[e.CONFIGID_SPEEDUPENABLE = 209] = "CONFIGID_SPEEDUPENABLE", e[e.CONFIGID_SPEEDUPCUDAFIRST = 210] = "CONFIGID_SPEEDUPCUDAFIRST", e[e.CONFIGID_SPEEDUPSTATUS = 211] = "CONFIGID_SPEEDUPSTATUS", e[e.CONFIGID_SPEEDUPQUERY = 212] = "CONFIGID_SPEEDUPQUERY", e[e.CONFIGID_VIDEOADJUSTUSABLE = 213] = "CONFIGID_VIDEOADJUSTUSABLE", e[e.CONFIGID_BRIGHTNESS = 214] = "CONFIGID_BRIGHTNESS", e[e.CONFIGID_CONTRAST = 215] = "CONFIGID_CONTRAST", e[e.CONFIGID_SATURATION = 216] = "CONFIGID_SATURATION", e[e.CONFIGID_HUE = 217] = "CONFIGID_HUE", e[e.CONFIGID_COREAVCOUTPUTLEVEL = 218] = "CONFIGID_COREAVCOUTPUTLEVEL", e[e.CONFIGID_UNUSED = 219] = "CONFIGID_UNUSED", e[e.CONFIGID_VIDEOCODEC = 220] = "CONFIGID_VIDEOCODEC", e[e.CONFIGID_VIDEOOUTPUTFORMAT = 221] = "CONFIGID_VIDEOOUTPUTFORMAT", e[e.CONFIGID_CURRENTBLACKBANDINFO = 222] = "CONFIGID_CURRENTBLACKBANDINFO", e[e.CONFIGID_IMAGEPROCESSUSABLE = 301] = "CONFIGID_IMAGEPROCESSUSABLE", e[e.CONFIGID_IMAGEFLIPH = 302] = "CONFIGID_IMAGEFLIPH", e[e.CONFIGID_IMAGEFLIPV = 303] = "CONFIGID_IMAGEFLIPV", e[e.CONFIGID_IMAGEROTATE = 304] = "CONFIGID_IMAGEROTATE", e[e.CONFIGID_IMAGENORMALIZEENABLE = 305] = "CONFIGID_IMAGENORMALIZEENABLE", e[e.CONFIGID_IMAGENORMALIZECOMPARE = 306] = "CONFIGID_IMAGENORMALIZECOMPARE", e[e.CONFIGID_IMAGESHARPEN = 307] = "CONFIGID_IMAGESHARPEN", e[e.CONFIGID_IMAGECOLOR3DENABLE = 308] = "CONFIGID_IMAGECOLOR3DENABLE", e[e.CONFIGID_IMAGECOLOR3DOKAY = 309] = "CONFIGID_IMAGECOLOR3DOKAY", e[e.CONFIGID_IMAGECOLOR3DSHOW = 310] = "CONFIGID_IMAGECOLOR3DSHOW", e[e.CONFIGID_IMAGECOLOR3DMODE = 311] = "CONFIGID_IMAGECOLOR3DMODE", e[e.CONFIGID_IMAGECOLOR3DCOLOR = 312] = "CONFIGID_IMAGECOLOR3DCOLOR", e[e.CONFIGID_IMAGEUSEOPENCL = 313] = "CONFIGID_IMAGEUSEOPENCL", e[e.CONFIGID_IMAGEUSEAVX2 = 314] = "CONFIGID_IMAGEUSEAVX2", e[e.CONFIGID_IMAGEUSESSE2 = 315] = "CONFIGID_IMAGEUSESSE2", e[e.CONFIGID_AUIDOPROCESSUSABLE = 401] = "CONFIGID_AUIDOPROCESSUSABLE", e[e.CONFIGID_AUDIOTRACKLIST = 402] = "CONFIGID_AUDIOTRACKLIST", e[e.CONFIGID_AUDIOTRACKCURRENT = 403] = "CONFIGID_AUDIOTRACKCURRENT",e[e.CONFIGID_AUDIOCHANNEL = 404] = "CONFIGID_AUDIOCHANNEL",e[e.CONFIGID_AUDIOTIMESHIFT = 405] = "CONFIGID_AUDIOTIMESHIFT",e[e.CONFIGID_AUDIONORMALIZE = 406] = "CONFIGID_AUDIONORMALIZE",e[e.CONFIGID_AUDIOVSSENABLE = 407] = "CONFIGID_AUDIOVSSENABLE",e[e.CONFIGID_AUDIOVSSDEEP = 408] = "CONFIGID_AUDIOVSSDEEP",e[e.CONFIGID_AUDIOLOADTRACK = 409] = "CONFIGID_AUDIOLOADTRACK",e[e.CONFIGID_AUDIOCODEC = 410] = "CONFIGID_AUDIOCODEC",e[e.CONFIGID_AUDIOINPUTCHANNELS = 411] = "CONFIGID_AUDIOINPUTCHANNELS",e[e.CONFIGID_AUDIOINPUTSAMPLERATE = 412] = "CONFIGID_AUDIOINPUTSAMPLERATE",e[e.CONFIGID_AUDIOINPUTSAMPLEBIT = 413] = "CONFIGID_AUDIOINPUTSAMPLEBIT",e[e.CONFIGID_AUDIOOUTPUTFORMAT = 414] = "CONFIGID_AUDIOOUTPUTFORMAT",e[e.CONFIGID_AUDIOOUTPUTCHANNELS = 415] = "CONFIGID_AUDIOOUTPUTCHANNELS",e[e.CONFIGID_AUDIOOUTPUTSAMPLERATE = 416] = "CONFIGID_AUDIOOUTPUTSAMPLERATE",e[e.CONFIGID_AUDIOOUTPUTSAMPLEBIT = 417] = "CONFIGID_AUDIOOUTPUTSAMPLEBIT",e[e.CONFIGID_SUBTITLEUSABLE = 501] = "CONFIGID_SUBTITLEUSABLE",e[e.CONFIGID_SUBTITLEEXTNAMELIST = 502] = "CONFIGID_SUBTITLEEXTNAMELIST",e[e.CONFIGID_SUBTITLEFILENAME = 503] = "CONFIGID_SUBTITLEFILENAME",e[e.CONFIGID_SUBTITLESHOW = 504] = "CONFIGID_SUBTITLESHOW",e[e.CONFIGID_SUBTITLELANGUAGELIST = 505] = "CONFIGID_SUBTITLELANGUAGELIST",e[e.CONFIGID_SUBTITLELANGUAGECURRENT = 506] = "CONFIGID_SUBTITLELANGUAGECURRENT",e[e.CONFIGID_SUBTITLEPLACEMENT = 507] = "CONFIGID_SUBTITLEPLACEMENT",e[e.CONFIGID_SUBTITLEFONT = 508] = "CONFIGID_SUBTITLEFONT",e[e.CONFIGID_SUBTITLETIMING = 509] = "CONFIGID_SUBTITLETIMING",e[e.CONFIGID_SUBTITLE3D = 510] = "CONFIGID_SUBTITLE3D",e[e.CONFIGID_SUBTITLECONTENT = 511] = "CONFIGID_SUBTITLECONTENT",e[e.CONFIGID_PICTUREUSABLE = 601] = "CONFIGID_PICTUREUSABLE",e[e.CONFIGID_PICTUREENABLE = 602] = "CONFIGID_PICTUREENABLE",e[e.CONFIGID_PICTUREBOUND = 603] = "CONFIGID_PICTUREBOUND",e[e.CONFIGID_PICTUREWIDTH = 604] = "CONFIGID_PICTUREWIDTH",e[e.CONFIGID_PICTUREHEIGHT = 605] = "CONFIGID_PICTUREHEIGHT",e[e.CONFIGID_PICTURELEFT = 606] = "CONFIGID_PICTURELEFT",e[e.CONFIGID_PICTURETOP = 607] = "CONFIGID_PICTURETOP",e[e.CONFIGID_PICTUREALPHA = 608] = "CONFIGID_PICTUREALPHA",e[e.CONFIGID_PICTURECOLORKEY = 609] = "CONFIGID_PICTURECOLORKEY",e[e.CONFIGID_PICTUREHITTEST = 610] = "CONFIGID_PICTUREHITTEST",e[e.CONFIGID_PICTUREHITALPHA = 611] = "CONFIGID_PICTUREHITALPHA",e[e.CONFIGID_PICTURETEXT = 612] = "CONFIGID_PICTURETEXT",e[e.CONFIGID_PICTUREFONT = 613] = "CONFIGID_PICTUREFONT",e[e.CONFIGID_PICTURERGBABUFFER = 614] = "CONFIGID_PICTURERGBABUFFER",e[e.CONFIGID_PICTUREBMPHANDLE = 615] = "CONFIGID_PICTUREBMPHANDLE",e[e.CONFIGID_PICTUREBMPFILENAME = 616] = "CONFIGID_PICTUREBMPFILENAME",e[e.CONFIGID_PICTUREPNGFILENAME = 617] = "CONFIGID_PICTUREPNGFILENAME",e[e.CONFIGID_PICTURESWFFILENAME = 618] = "CONFIGID_PICTURESWFFILENAME",e[e.CONFIGID_PICTURESWFSIZE = 619] = "CONFIGID_PICTURESWFSIZE",e[e.CONFIGID_PICTURESWFCONTROL = 620] = "CONFIGID_PICTURESWFCONTROL",e[e.CONFIGID_PICTUREEVRCPLINEAR = 621] = "CONFIGID_PICTUREEVRCPLINEAR",e[e.CONFIGID_PICTUREATTACHTOVR = 622] = "CONFIGID_PICTUREATTACHTOVR",e[e.CONFIGID_SNAPSHOTUSABLE = 701] = "CONFIGID_SNAPSHOTUSABLE",e[e.CONFIGID_SNAPSHOTIMAGE = 702] = "CONFIGID_SNAPSHOTIMAGE",e[e.CONFIGID_SNAPSHOTWIDTH = 703] = "CONFIGID_SNAPSHOTWIDTH",e[e.CONFIGID_SNAPSHOTHEIGHT = 704] = "CONFIGID_SNAPSHOTHEIGHT",e[e.CONFIGID_SNAPSHOTSOURCEPOSITION = 705] = "CONFIGID_SNAPSHOTSOURCEPOSITION",e[e.CONFIGID_SNAPSHOTKEEPASPECTRATIO = 706] = "CONFIGID_SNAPSHOTKEEPASPECTRATIO",e[e.CONFIGID_SNAPSHOTFORMAT = 707] = "CONFIGID_SNAPSHOTFORMAT",e[e.CONFIGID_SNAPSHOTJPEGQUALITY = 708] = "CONFIGID_SNAPSHOTJPEGQUALITY",e[e.CONFIGID_SNAPSHOTGIFPARAM = 709] = "CONFIGID_SNAPSHOTGIFPARAM",e[e.CONFIGID_SNAPSHOTABORT = 710] = "CONFIGID_SNAPSHOTABORT",e[e.CONFIGID_SNAPSHOTGIFWORKING = 711] = "CONFIGID_SNAPSHOTGIFWORKING",e[e.CONFIGID_SNAPSHOTGIFPROGRESS = 712] = "CONFIGID_SNAPSHOTGIFPROGRESS",e[e.CONFIGID_SNAPSHOTSUBTITLE = 713] = "CONFIGID_SNAPSHOTSUBTITLE",e[e.CONFIGID_CUTUSABLE = 801] = "CONFIGID_CUTUSABLE",e[e.CONFIGID_CUTFORMATLIST = 802] = "CONFIGID_CUTFORMATLIST",e[e.CONFIGID_CUTFORMATCURRENT = 803] = "CONFIGID_CUTFORMATCURRENT",e[e.CONFIGID_CUTFILENAME = 804] = "CONFIGID_CUTFILENAME",e[e.CONFIGID_TRANSCODEVIDEOWIDTH = 901] = "CONFIGID_TRANSCODEVIDEOWIDTH",e[e.CONFIGID_TRANSCODEVIDEOHEIGHT = 902] = "CONFIGID_TRANSCODEVIDEOHEIGHT",e[e.CONFIGID_TRANSCODEKEEPASPECTRATIO = 903] = "CONFIGID_TRANSCODEKEEPASPECTRATIO",e[e.CONFIGID_TRANSCODEROUNDSIZE = 904] = "CONFIGID_TRANSCODEROUNDSIZE",e[e.CONFIGID_TRANSCODEAUDIOTRACK = 905] = "CONFIGID_TRANSCODEAUDIOTRACK",e[e.CONFIGID_TRANSCODESUBTLTELANGUAGE = 906] = "CONFIGID_TRANSCODESUBTLTELANGUAGE",e[e.CONFIGID_TRANSCODECROPBORDER = 907] = "CONFIGID_TRANSCODECROPBORDER",e[e.CONFIGID_TRANSCODEVSFILTER = 908] = "CONFIGID_TRANSCODEVSFILTER",e[e.CONFIGID_NETWORK_BUFFERENTER = 1001] = "CONFIGID_NETWORK_BUFFERENTER",e[e.CONFIGID_NETWORK_BUFFERLEAVE = 1002] = "CONFIGID_NETWORK_BUFFERLEAVE",e[e.CONFIGID_NETWORK_NOBUFFERDRY = 1003] = "CONFIGID_NETWORK_NOBUFFERDRY",e[e.CONFIGID_NETWORK_SEEKBUFFERTIMEOUT = 1004] = "CONFIGID_NETWORK_SEEKBUFFERTIMEOUT",e[e.CONFIGID_NETWORK__ISSEEKBUFFER = 1012] = "CONFIGID_NETWORK__ISSEEKBUFFER",e[e.CONFIGID_NETWORK__FASTSEEK = 1013] = "CONFIGID_NETWORK__FASTSEEK",e[e.CONFIGID_NETWORK__STUFFURL = 1014] = "CONFIGID_NETWORK__STUFFURL",e[e.CONFIGID_HTTPENABLEVOD = 1101] = "CONFIGID_HTTPENABLEVOD",e[e.CONFIGID_HTTPFAILEDRECONNECTCOUNT = 1102] = "CONFIGID_HTTPFAILEDRECONNECTCOUNT",e[e.CONFIGID_HTTPFAILEDRECONNECTINTERVAL = 1103] = "CONFIGID_HTTPFAILEDRECONNECTINTERVAL",e[e.CONFIGID_HTTPLIVE = 1104] = "CONFIGID_HTTPLIVE",e[e.CONFIGID_HTTPCOOKIE = 1105] = "CONFIGID_HTTPCOOKIE",e[e.CONFIGID_HTTPREFERER = 1106] = "CONFIGID_HTTPREFERER",e[e.CONFIGID_HTTPCUSTOMHEADERS = 1107] = "CONFIGID_HTTPCUSTOMHEADERS",e[e.CONFIGID_HTTPUSERAGENT = 1108] = "CONFIGID_HTTPUSERAGENT",e[e.CONFIGID_MULTISOURCEUSABLE = 1201] = "CONFIGID_MULTISOURCEUSABLE",e[e.CONFIGID_MULTISOURCECHANGE = 1202] = "CONFIGID_MULTISOURCECHANGE",e[e.CONFIGID_MULTISOURCESEEK = 1203] = "CONFIGID_MULTISOURCESEEK",e[e.CONFIGID_MULTISOURCECURRENT = 1204] = "CONFIGID_MULTISOURCECURRENT",e[e.CONFIGID_LYRICUSABLE = 1301] = "CONFIGID_LYRICUSABLE",e[e.CONFIGID_LYRICSHOW = 1302] = "CONFIGID_LYRICSHOW",e[e.CONFIGID_LYRICUPDATETIME = 1303] = "CONFIGID_LYRICUPDATETIME",e[e.CONFIGID_LYRICFORMAT = 1304] = "CONFIGID_LYRICFORMAT",e[e.CONFIGID_LYRICFILE = 1305] = "CONFIGID_LYRICFILE",e[e.CONFIGID_LYRICCONTENT = 1306] = "CONFIGID_LYRICCONTENT",e[e.CONFIGID_LYRICBACKCOLOR = 1307] = "CONFIGID_LYRICBACKCOLOR",e[e.CONFIGID_LYRICPICTUREFILENAME = 1308] = "CONFIGID_LYRICPICTUREFILENAME",e[e.CONFIGID_LYRICPICTUREHANDLE = 1309] = "CONFIGID_LYRICPICTUREHANDLE",e[e.CONFIGID_LYRICPICTUREMODE = 1310] = "CONFIGID_LYRICPICTUREMODE",e[e.CONFIGID_LYRICFONT = 1311] = "CONFIGID_LYRICFONT",e[e.CONFIGID_LYRICFONTNORMALCOLOR = 1312] = "CONFIGID_LYRICFONTNORMALCOLOR",e[e.CONFIGID_LYRICFONTHIGHLIGHTCOLOR = 1313] = "CONFIGID_LYRICFONTHIGHLIGHTCOLOR",e[e.CONFIGID_LYRICFRAMEENABLE = 1314] = "CONFIGID_LYRICFRAMEENABLE",e[e.CONFIGID_LYRICFRAMECOLOR = 1315] = "CONFIGID_LYRICFRAMECOLOR",e[e.CONFIGID_LYRICSMOOTHMULITPLE = 1316] = "CONFIGID_LYRICSMOOTHMULITPLE",e[e.CONFIGID_LYRICSMOOTHONLYLYRIC = 1317] = "CONFIGID_LYRICSMOOTHONLYLYRIC",e[e.CONFIGID_LYRICALPHA = 1318] = "CONFIGID_LYRICALPHA",e[e.CONFIGID_LYRICANIMATION = 1319] = "CONFIGID_LYRICANIMATION",e[e.CONFIGID_LYRICTIMEOFFSET = 1320] = "CONFIGID_LYRICTIMEOFFSET",e[e.CONFIGID_LYRICDRAGENABLE = 1321] = "CONFIGID_LYRICDRAGENABLE",e[e.CONFIGID_LYRICDRAGLINECOLOR = 1322] = "CONFIGID_LYRICDRAGLINECOLOR",e[e.CONFIGID_LYRICDRAGTEXTCOLOR = 1323] = "CONFIGID_LYRICDRAGTEXTCOLOR",e[e.CONFIGID_LYRICDRAGTEXTLEFT = 1324] = "CONFIGID_LYRICDRAGTEXTLEFT",e[e.CONFIGID_LYRICDRAGTEXTRIGHTFRONT = 1325] = "CONFIGID_LYRICDRAGTEXTRIGHTFRONT",e[e.CONFIGID_LYRICDRAGTEXTRIGHTBACK = 1326] = "CONFIGID_LYRICDRAGTEXTRIGHTBACK",e[e.CONFIGID_LYRICDRAGTEXTRIGHTDIV = 1327] = "CONFIGID_LYRICDRAGTEXTRIGHTDIV",e[e.CONFIGID_LYRICALIGN = 1328] = "CONFIGID_LYRICALIGN",e[e.CONFIGID_DVDCHAPTERS = 1401] = "CONFIGID_DVDCHAPTERS",e[e.CONFIGID_DVDANGLECOUNT = 1402] = "CONFIGID_DVDANGLECOUNT",e[e.CONFIGID_DVDAUDIOS = 1403] = "CONFIGID_DVDAUDIOS",e[e.CONFIGID_DVDSUBPICTURES = 1404] = "CONFIGID_DVDSUBPICTURES",e[e.CONFIGID_DVDCURRENTCHAPTER = 1405] = "CONFIGID_DVDCURRENTCHAPTER",e[e.CONFIGID_DVDCURRENTANGLE = 1406] = "CONFIGID_DVDCURRENTANGLE",e[e.CONFIGID_DVDCURRENTAUDIO = 1407] = "CONFIGID_DVDCURRENTAUDIO",e[e.CONFIGID_DVDCURRENTSUBPICTURE = 1408] = "CONFIGID_DVDCURRENTSUBPICTURE",e[e.CONFIGID_DVDPARENTALLEVEL = 1409] = "CONFIGID_DVDPARENTALLEVEL",e[e.CONFIGID_DVDSHOWMENU = 1410] = "CONFIGID_DVDSHOWMENU",e[e.CONFIGID_DVDPRESSBUTTON = 1411] = "CONFIGID_DVDPRESSBUTTON",e[e.CONFIGID_DVDSKIPCHAPTER = 1412] = "CONFIGID_DVDSKIPCHAPTER",e[e.CONFIGID_DVDPLAYFORWARD = 1413] = "CONFIGID_DVDPLAYFORWARD",e[e.CONFIGID_DVDPLAYBACKWARD = 1414] = "CONFIGID_DVDPLAYBACKWARD",e[e.CONFIGID_DVDNEEDINTERACTION = 1415] = "CONFIGID_DVDNEEDINTERACTION",e[e.CONFIGID_AC3DTSUSABLE = 1501] = "CONFIGID_AC3DTSUSABLE",e[e.CONFIGID_AC3DTSOUTPUTMODE = 1502] = "CONFIGID_AC3DTSOUTPUTMODE",e[e.CONFIGID_AC3DTSVOICEVOLUME = 1503] = "CONFIGID_AC3DTSVOICEVOLUME",e[e.CONFIGID_SVCCURRENTLEVEL = 1601] = "CONFIGID_SVCCURRENTLEVEL",e[e.CONFIGID_SVCSTATISTICINTERVAL = 1602] = "CONFIGID_SVCSTATISTICINTERVAL",e[e.CONFIGID_SVCLEVELMIN = 1603] = "CONFIGID_SVCLEVELMIN",e[e.CONFIGID_SVCLEVELMAX = 1604] = "CONFIGID_SVCLEVELMAX",e[e.CONFIGID_SVCDOWNLOADSPEED = 1605] = "CONFIGID_SVCDOWNLOADSPEED",e[e.CONFIGID_SVCCONNECTTIMEOUT = 1606] = "CONFIGID_SVCCONNECTTIMEOUT",e[e.CONFIGID_DETECTSUBTITLEUSABLE = 1701] = "CONFIGID_DETECTSUBTITLEUSABLE",e[e.CONFIGID_DETECTSUBTITLEENABLE = 1702] = "CONFIGID_DETECTSUBTITLEENABLE",e[e.CONFIGID_DETECTSUBTITLEAREA = 1703] = "CONFIGID_DETECTSUBTITLEAREA",e[e.CONFIGID_DETECTSUBTITLESHOW = 1704] = "CONFIGID_DETECTSUBTITLESHOW",e[e.CONFIGID_DLNAENABLE = 1801] = "CONFIGID_DLNAENABLE",e[e.CONFIGID_DLNADEVICELIST = 1802] = "CONFIGID_DLNADEVICELIST",e[e.CONFIGID_DLNACURRENTDEVICE = 1803] = "CONFIGID_DLNACURRENTDEVICE",e[e.CONFIGID_DLNASEARCHDEVICE = 1804] = "CONFIGID_DLNASEARCHDEVICE",e[e.CONFIGID_VIDEO3DUSABLE = 1901] = "CONFIGID_VIDEO3DUSABLE",e[e.CONFIGID_VIDEO3DSHOW = 1902] = "CONFIGID_VIDEO3DSHOW",e[e.CONFIGID_VIDEO3DOBJECTLIST = 1903] = "CONFIGID_VIDEO3DOBJECTLIST",e[e.CONFIGID_VIDEO3DCURRENTOBJECT = 1904] = "CONFIGID_VIDEO3DCURRENTOBJECT",e[e.CONFIGID_VIDEO3DOBJECTINFO = 1905] = "CONFIGID_VIDEO3DOBJECTINFO",e[e.CONFIGID_VIDEO3DADDOBJECT = 1906] = "CONFIGID_VIDEO3DADDOBJECT",e[e.CONFIGID_VIDEO3DDELETEOBJECT = 1907] = "CONFIGID_VIDEO3DDELETEOBJECT",e[e.CONFIGID_VIDEO3DPOINTCOUNT = 1908] = "CONFIGID_VIDEO3DPOINTCOUNT",e[e.CONFIGID_VIDEO3DCURRENTPOINT = 1909] = "CONFIGID_VIDEO3DCURRENTPOINT",e[e.CONFIGID_VIDEO3DPOINTINFO = 1910] = "CONFIGID_VIDEO3DPOINTINFO",e[e.CONFIGID_VIDEO3DADDPOINT = 1911] = "CONFIGID_VIDEO3DADDPOINT",e[e.CONFIGID_VIDEO3DDELETEPOINT = 1912] = "CONFIGID_VIDEO3DDELETEPOINT",e[e.CONFIGID_VIDEO3DFRAMECOUNT = 1913] = "CONFIGID_VIDEO3DFRAMECOUNT",e[e.CONFIGID_VIDEO3DFRAMEINFO = 1914] = "CONFIGID_VIDEO3DFRAMEINFO",e[e.CONFIGID_VIDEO3DADDFRAME = 1915] = "CONFIGID_VIDEO3DADDFRAME",e[e.CONFIGID_VIDEO3DDELETEFRAME = 1916] = "CONFIGID_VIDEO3DDELETEFRAME",e[e.CONFIGID_VIDEO3DCLEARFRAMES = 1917] = "CONFIGID_VIDEO3DCLEARFRAMES",e[e.CONFIGID_VIDEO3DCOPYFRAME = 1918] = "CONFIGID_VIDEO3DCOPYFRAME",e[e.CONFIGID_VIDEO3DSAMEFRAMES = 1919] = "CONFIGID_VIDEO3DSAMEFRAMES",e[e.CONFIGID_VIDEO3DLINEARFRAMES = 1920] = "CONFIGID_VIDEO3DLINEARFRAMES",e[e.CONFIGID_VIDEO3DEDITMODE = 1921] = "CONFIGID_VIDEO3DEDITMODE",e[e.CONFIGID_VIDEO3DSELECTTOOL = 1922] = "CONFIGID_VIDEO3DSELECTTOOL",e[e.CONFIGID_VIDEO3DMAGICADMIT = 1923] = "CONFIGID_VIDEO3DMAGICADMIT",e[e.CONFIGID_VIDEO3DLOADFROMFILE = 1924] = "CONFIGID_VIDEO3DLOADFROMFILE",e[e.CONFIGID_VIDEO3DSAVETOFILE = 1925] = "CONFIGID_VIDEO3DSAVETOFILE",e[e.CONFIGID_WIDIENABLE = 2001] = "CONFIGID_WIDIENABLE",e[e.CONFIGID_WIDIADAPTERLIST = 2002] = "CONFIGID_WIDIADAPTERLIST",e[e.CONFIGID_WIDICONNECT = 2003] = "CONFIGID_WIDICONNECT",e[e.CONFIGID_WIDIDISCONNECT = 2004] = "CONFIGID_WIDIDISCONNECT",e[e.CONFIGID_WIDISETMODE = 2005] = "CONFIGID_WIDISETMODE",e[e.CONFIGID_WIDISEARCHDEVICE = 2006] = "CONFIGID_WIDISEARCHDEVICE",e[e.CONFIGID_SUBTITLE2USABLE = 2101] = "CONFIGID_SUBTITLE2USABLE",e[e.CONFIGID_SUBTITLE2EXTNAMELIST = 2102] = "CONFIGID_SUBTITLE2EXTNAMELIST",e[e.CONFIGID_SUBTITLE2FILENAME = 2103] = "CONFIGID_SUBTITLE2FILENAME",e[e.CONFIGID_SUBTITLE2SHOW = 2104] = "CONFIGID_SUBTITLE2SHOW",e[e.CONFIGID_SUBTITLE2LANGUAGELIST = 2105] = "CONFIGID_SUBTITLE2LANGUAGELIST",e[e.CONFIGID_SUBTITLE2LANGUAGECURRENT = 2106] = "CONFIGID_SUBTITLE2LANGUAGECURRENT",e[e.CONFIGID_SUBTITLE2PLACEMENT = 2107] = "CONFIGID_SUBTITLE2PLACEMENT",e[e.CONFIGID_SUBTITLE2FONT = 2108] = "CONFIGID_SUBTITLE2FONT",e[e.CONFIGID_SUBTITLE2TIMING = 2109] = "CONFIGID_SUBTITLE2TIMING",e[e.CONFIGID_SUBTITLE23D = 2110] = "CONFIGID_SUBTITLE23D",e[e.CONFIGID_SUBTITLE2CONTENT = 2111] = "CONFIGID_SUBTITLE2CONTENT",e[e.CONFIGID_CACHEFILENAME = 2201] = "CONFIGID_CACHEFILENAME",e[e.CONFIGID_CACHECLEAR = 2202] = "CONFIGID_CACHECLEAR",e[e.CONFIGID_CACHEDOWNLOADLIST = 2203] = "CONFIGID_CACHEDOWNLOADLIST",e[e.CONFIGID_CACHECOMPLETED = 2204] = "CONFIGID_CACHECOMPLETED",e[e.CONFIGID_CACHECONVERT = 2205] = "CONFIGID_CACHECONVERT",e[e.CONFIGID_CACHEIGNORECOMPAREURL = 2206] = "CONFIGID_CACHEIGNORECOMPAREURL",e[e.CONFIGID_CACHEGREED = 2207] = "CONFIGID_CACHEGREED",e[e.CONFIGID_SPRITEUSABLE = 2301] = "CONFIGID_SPRITEUSABLE",e[e.CONFIGID_SPRITELIST = 2302] = "CONFIGID_SPRITELIST",e[e.CONFIGID_SPRITEADD = 2303] = "CONFIGID_SPRITEADD",e[e.CONFIGID_SPRITEDELETE = 2304] = "CONFIGID_SPRITEDELETE",e[e.CONFIGID_SPRITECURRENT = 2305] = "CONFIGID_SPRITECURRENT",e[e.CONFIGID_SPRITEBOUND = 2306] = "CONFIGID_SPRITEBOUND",e[e.CONFIGID_SPRITEPOSITION = 2307] = "CONFIGID_SPRITEPOSITION",e[e.CONFIGID_SPRITEMOVETO = 2308] = "CONFIGID_SPRITEMOVETO",e[e.CONFIGID_SPRITESELECTVIDEO = 2309] = "CONFIGID_SPRITESELECTVIDEO",e[e.CONFIGID_SPRITESELECTRECT = 2310] = "CONFIGID_SPRITESELECTRECT",e[e.CONFIGID_SPRITESHOWSELECT = 2311] = "CONFIGID_SPRITESHOWSELECT",e[e.CONFIGID_SPRITEATTACHVIDEO = 2312] = "CONFIGID_SPRITEATTACHVIDEO",e[e.CONFIGID_SPRITEATTACHTOVR = 2313] = "CONFIGID_SPRITEATTACHTOVR",e[e.CONFIGID_VRENABLE = 2401] = "CONFIGID_VRENABLE",e[e.CONFIGID_VRMODE = 2402] = "CONFIGID_VRMODE",e[e.CONFIGID_VRPOSITION = 2403] = "CONFIGID_VRPOSITION",e[e.CONFIGID_VRDEVICE = 2404] = "CONFIGID_VRDEVICE",e[e.CONFIGID_VRDELAY = 2405] = "CONFIGID_VRDELAY",e[e.CONFIGID_VRCIRCULARPARAMETER = 2406] = "CONFIGID_VRCIRCULARPARAMETER",e[e.CONFIGID_VRMONITORPARAMETER = 2407] = "CONFIGID_VRMONITORPARAMETER",e[e.CONFIGID_VRFILLBAND = 2408] = "CONFIGID_VRFILLBAND",e[e.CONFIGID_VRFOCUSPOSITION = 2409] = "CONFIGID_VRFOCUSPOSITION",e[e.CONFIGID_VRQUALITY = 2410] = "CONFIGID_VRQUALITY",e[e.CONFIGID_DNNVSRMODEL = 2802] = "CONFIGID_DNNVSRMODEL",e[e.CONFIGID_DNNENABLEVSR = 2803] = "CONFIGID_DNNENABLEVSR",e[e.CONFIGID_DNNIMAGESR = 2804] = "CONFIGID_DNNIMAGESR"
    }(t.APlayerConfigId || (t.APlayerConfigId = {})), function (e) {
        e[e.EVENTCODE_BASE = 1e4] = "EVENTCODE_BASE", e[e.EVENTCODE_MULTISOURCE = 10001] = "EVENTCODE_MULTISOURCE", e[e.EVENTCODE_DVD = 10002] = "EVENTCODE_DVD", e[e.EVENTCODE_STEPCOMPLETED = 10003] = "EVENTCODE_STEPCOMPLETED", e[e.EVENTCODE_DLNA = 10004] = "EVENTCODE_DLNA", e[e.EVENTCODE_GIFCOMPLETED = 10005] = "EVENTCODE_GIFCOMPLETED", e[e.EVENTCODE_WIDI = 10006] = "EVENTCODE_WIDI", e[e.EVENTCODE_VIDEO3D = 10007] = "EVENTCODE_VIDEO3D", e[e.EVENTCODE_SPRITE = 10008] = "EVENTCODE_SPRITE", e[e.EVENTCODE_PLAYLIST = 10009] = "EVENTCODE_PLAYLIST", e[e.EVENTCODE_PLAYCOMPLETE = 10010] = "EVENTCODE_PLAYCOMPLETE", e[e.EVENTCODE_DNNIMAGESR = 10013] = "EVENTCODE_DNNIMAGESR"
    }(t.APlayerEventCode || (t.APlayerEventCode = {}))
}, 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) {
}, , , , , , , , , 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) {
}]);
/*! Thunder 11 BY LUOCHENZHIMU */
/*! Last updated on 2020/12/27 */
/*! https://www.luochenzhimu.com */