diff --git a/ui/ariang/index.html b/ui/ariang/index.html index e623451..e79739c 100644 --- a/ui/ariang/index.html +++ b/ui/ariang/index.html @@ -12,4 +12,4 @@ - -->
\ No newline at end of file + -->
\ No newline at end of file diff --git a/ui/ariang/js/aria-ng-860b712940.min.js b/ui/ariang/js/aria-ng-3aaabaa96c.min.js similarity index 99% rename from ui/ariang/js/aria-ng-860b712940.min.js rename to ui/ariang/js/aria-ng-3aaabaa96c.min.js index ef1a419..0e22f6f 100644 --- a/ui/ariang/js/aria-ng-860b712940.min.js +++ b/ui/ariang/js/aria-ng-3aaabaa96c.min.js @@ -2,4 +2,4 @@ * AriaNg * https://github.com/mayswind/AriaNg */ -!function(){"use strict";var e,t,a;if(e=navigator.appName,t=navigator.appVersion.split(";"),a=t&&t.length>1?t[1].replace(/[ ]/g,""):"","Microsoft Internet Explorer"===e&&("MSIE6.0"===a||"MSIE7.0"===a||"MSIE8.0"===a||"MSIE9.0"===a)){var n=document.createElement("div");n.className="alert alert-danger",n.innerHTML="Sorry, AriaNg cannot support this browser, please upgrade your browser!",document.getElementById("content-wrapper").appendChild(n)}document.addEventListener("contextmenu",(function(e){const t=e.target.tagName;"TEXTAREA"!==t&&"INPUT"!==t&&e.preventDefault()}))}(),function(){"use strict";var e=function(){var e=$(window).height(),t=$(".main-header").outerHeight()+$(".main-footer").outerHeight();$(".content-body").css("height",e-t)};$(window,".wrapper").resize((function(){e()})),e()}(),function(){"use strict";angular.module("ariaNg",["ngRoute","ngSanitize","ngTouch","ngMessages","ngCookies","ngAnimate","pascalprecht.translate","angularMoment","ngWebSocket","utf8-base64","LocalStorageModule","ui-notification","angularBittorrentPeerid","cgBusy","angularPromiseButtons","angular-clipboard","inputDropdown",angularDragula(angular)])}(),function(){"use strict";angular.module("ariaNg").config(["$routeProvider",function(e){var t="/"+JSON.parse(localStorage["AriaNg.Options"]||'{"defaultTaskPage":"all"}').defaultTaskPage||"all";e.when("/all",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/downloading",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/waiting",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/stopped",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/new",{templateUrl:"views/new.html",controller:"NewTaskController"}).when("/new/:url",{template:"",controller:"CommandController"}).when("/task/detail/:gid",{templateUrl:"views/task-detail.html",controller:"TaskDetailController",reloadOnSearch:!1}).when("/settings/ariang",{templateUrl:"views/settings-ariang.html",controller:"AriaNgSettingsController",reloadOnSearch:!1}).when("/settings/ariang/:extendType",{templateUrl:"views/settings-ariang.html",controller:"AriaNgSettingsController"}).when("/settings/aria2/basic",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/http-ftp-sftp",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/http",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/ftp-sftp",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/bt",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/metalink",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/rpc",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/advanced",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/rpc/set",{template:"",controller:"CommandController"}).when("/settings/rpc/set/:protocol/:host/:port/:interface/:secret?",{template:"",controller:"CommandController"}).when("/debug",{templateUrl:"views/debug.html",controller:"AriaNgDebugController"}).when("/status",{templateUrl:"views/status.html",controller:"Aria2StatusController"}).when("/recommend",{templateUrl:"views/recommend.html"}).otherwise({redirectTo:t})}])}(),function(){"use strict";angular.module("ariaNg").run(["$window","$rootScope","$location","$document","$timeout","ariaNgCommonService","ariaNgKeyboardService","ariaNgNotificationService","ariaNgLogService","ariaNgSettingService","aria2TaskService","aria2SettingService","aria2AllOptions",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var f=!1,g=function(e,t){return e===t||0===t.indexOf(e)&&0===t.substring(e.length).indexOf("/")},m=function(){t.currentTheme="light",angular.element("body").removeClass("theme-dark")},h=function(){t.currentTheme="dark",angular.element("body").addClass("theme-dark")},v=function(){if(c.isBrowserSupportDarkMode()){var t=e.matchMedia("(prefers-color-scheme: dark)");l.info("[root.setThemeBySystemSettings] system uses "+(t.matches?"dark":"light")+" theme"),t.matches?h():m()}else m()},b=function(){angular.element('[data-widget="pushmenu"]').PushMenu("collapse")},k=function(e){if(!e||parseInt(e).toString()!=e)return e;for(var t=["","k","m","g"],a=0,n=0;n=0)},t.isTaskRetryable=function(e){return e&&"error"===e.status&&e.errorDescription&&!e.bittorrent},t.keydownActions={find:function(e){return e.preventDefault&&e.preventDefault(),t.searchContext.setSearchBoxFocused(),!1}},t.swipeActions={leftSwipe:function(){c.getSwipeGesture()&&(angular.element("body").hasClass("sidebar-collapse")?(!this.extendLeftSwipe||angular.isFunction(this.extendLeftSwipe)&&!this.extendLeftSwipe())&&b():b())},rightSwipe:function(){c.getSwipeGesture()&&(!this.extendRightSwipe||angular.isFunction(this.extendRightSwipe)&&!this.extendRightSwipe())&&angular.element('[data-widget="pushmenu"]').PushMenu("expand")}},t.refreshPage=function(){e.location.reload()},t.setAutoRefreshAfterPageLoad=function(){f=!0},t.setTheme=function(e){"system"===e?v():"dark"===e?h():m()},e.addEventListener("keydown",(function(e){if(c.getKeyboardShortcuts()){var a=angular.element('input[type="text"],textarea').is(":focus");if(o.isCtrlAPressed(e)&&!a){if(angular.isFunction(t.keydownActions.selectAll))return t.keydownActions.selectAll(e)}else if(o.isCtrlFPressed(e)){if(angular.isFunction(t.keydownActions.find))return t.keydownActions.find(e)}else if(o.isDeletePressed(e)&&!a&&angular.isFunction(t.keydownActions.delete))return t.keydownActions.delete(e)}}),!0),c.onFirstAccess((function(){r.notifyInPage("","Tap to configure and get started with AriaNg.",{delay:!1,onClose:function(){a.path("/settings/ariang")}})})),d.onFirstSuccess((function(e){r.notifyInPage("","is connected",{type:"success",contentPrefix:e.rpcName+" "})})),d.onConnectionSuccess((function(){i((function(){"Connected"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Connected"),t.taskContext.isRpcOptionsSet||(!function(){const e=c.getRpcOptions(),a=c.getCurrentRpcDisplayName();u.getGlobalOption((function(n){if(n.success)try{let i=n.data;for(const t of Object.keys(e)){let n=e[t]||"",s=i[t]||"";if("Bytes"===p[t].suffix&&(s=k(s)),s.toLowerCase()!==n.toLowerCase()){u.setGlobalOptions(e,(function(){r.notifyInPage("","settings have taken effect",{type:"success",contentPrefix:a+" "})}));break}}t.enhanced="true"===i["enable-extension"]}catch(e){l.warn("[root.initAria2Options] ",e)}}))}(),t.taskContext.isRpcOptionsSet=!0)}))})),d.onConnectionFailed((function(){i((function(){"Disconnected"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Disconnected"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onConnectionReconnecting((function(){i((function(){"Reconnecting"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Reconnecting"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onConnectionWaitingToReconnect((function(){i((function(){"Waiting to reconnect"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Waiting to reconnect"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onTaskCompleted((function(e){r.notifyTaskComplete(e.task)})),d.onBtTaskCompleted((function(e){r.notifyBtTaskComplete(e.task)})),d.onTaskErrorOccur((function(e){r.notifyTaskError(e.task)})),t.$on("$locationChangeStart",(function(e){t.skipLocationChange?t.skipLocationChange=!1:(s.closeAllDialogs(),t.loadPromise=null,delete t.keydownActions.selectAll,delete t.keydownActions.delete,delete t.swipeActions.extendLeftSwipe,delete t.swipeActions.extendRightSwipe,angular.isArray(t.taskContext.list)&&t.taskContext.list.length>0&&(t.taskContext.list.length=0),angular.isObject(t.taskContext.selected)&&(t.taskContext.selected={}),t.taskContext.enableSelectAll=!1)})),t.$on("$routeChangeStart",(function(e,t,i){!function(e){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element("ul.nav-sidebar a").each((function(t,a){var n=angular.element(a).attr("href").substring(2);g(n,e)&&angular.element(a).addClass("active")})),angular.element("ul.nav-treeview a").each((function(t,a){var n=angular.element(a).attr("href").substring(2);g(n,e)&&angular.element(a).parentsUntil(".nav-sidebar > .nav-treeview").prev("a").addClass("active").parent().addClass("menu-open")}))}(a.path()),n.unbind("keypress")})),c.isBrowserSupportDarkMode())&&e.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(function(e){l.info("[root] system switches to "+(e.matches?"dark":"light")+" theme"),"system"===c.getTheme()&&(e.matches?h():m())}));t.$on("$locationChangeSuccess",(function(a,n,i){f&&e.location.reload(),i.includes("settings/aria2")&&n.includes("settings/aria2")||(t.searchContext.text=""),t.searchContext.enabledInPage=!1})),"system"===c.getTheme()?v():"dark"===c.getTheme()?h():m(),function(){var e=c.getBrowserFeatures();if(e.localStorage||l.warn("[root.initCheck] LocalStorage is not supported!"),e.cookies||l.warn("[root.initCheck] Cookies is not supported!"),!c.isBrowserSupportStorage())throw angular.element("body").prepend('
'),angular.element(".main-sidebar").addClass("blur"),angular.element(".navbar").addClass("blur"),angular.element(".content-body").addClass("blur"),r.notifyInPage("","You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.",{type:"error",delay:!1}),new Error("You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.")}(),angular.element("section.sidebar > ul > li[data-href-match] > a").on("click",(function(){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element(this).addClass("active")})),angular.element("section.sidebar > ul > li > ul.nav-treeview > li[data-href-match] > a").on("click",(function(){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element(this).addClass("active").parent().parent().siblings("a").addClass("active")}))}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgConstants",{title:"AriaNg",appPrefix:"AriaNg",optionStorageKey:"Options",browserNotificationHistoryStorageKey:"Notifications",languageStorageKeyPrefix:"Language",settingHistoryKeyPrefix:"History",languagePath:"langs",languageFileExtension:".txt",defaultLanguage:"en",defaultHost:"localhost",defaultSecureProtocol:"https",defaultPathSeparator:"/",httpRequestTimeout:2e4,globalStatStorageCapacity:120,taskStatStorageCapacity:300,lazySaveTimeout:500,errorTooltipDelay:500,notificationInPageTimeout:2e3,historyMaxStoreCount:10,cachedDebugLogsLimit:100}).constant("ariaNgDefaultOptions",{language:"en",theme:"light",title:"${downspeed}, ${upspeed} - ${title}",titleRefreshInterval:5e3,browserNotification:!1,browserNotificationSound:!0,browserNotificationFrequency:"unlimited",rpcAlias:"",rpcHost:"",rpcPort:"6800",rpcInterface:"jsonrpc",protocol:"http",httpMethod:"POST",rpcRequestHeaders:"",rpcOptions:{},secret:"",extendRpcServers:[],webSocketReconnectInterval:5e3,globalStatRefreshInterval:1e3,downloadTaskRefreshInterval:1e3,keyboardShortcuts:!0,swipeGesture:!0,dragAndDropTasks:!0,rpcListDisplayOrder:"recentlyUsed",afterCreatingNewTask:"task-list",removeOldTaskAfterRetrying:!1,confirmTaskRemoval:!0,includePrefixWhenCopyingFromTaskDetails:!0,showPiecesInfoInTaskDetailPage:"le10240",afterRetryingTask:"task-list-default",pauseAfterRetry:!1,taskListIndependentDisplayOrder:!0,displayOrder:"default:asc",downloadingTaskListPageDisplayOrder:"default:asc",waitingTaskListPageDisplayOrder:"default:asc",stoppedTaskListPageDisplayOrder:"default:asc",fileListDisplayOrder:"default:asc",peerListDisplayOrder:"default:asc",defaultTaskPage:"all",recCount:0,compactMode:!1}).constant("aria2eConstants",{recommendOrigin:"https://rec.aria2e.com",recManifestUrl:"https://rec.aria2e.com/manifest.json"})}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgBuildConfiguration",{buildVersion:"v1.3.8e",buildCommit:"de68e78"})}(),function(){"use strict";angular.module("ariaNg").config(["$qProvider","$translateProvider","localStorageServiceProvider","NotificationProvider","ariaNgConstants","ariaNgLanguages",function(e,t,a,n,i,s){e.errorOnUnhandledRejections(!1),a.setPrefix(i.appPrefix).setStorageType("localStorage").setStorageCookie(365,"/");var o=[],r={};for(var l in s)if(s.hasOwnProperty(l)){var c=s[l].aliases;if(o.push(l),angular.isArray(c)&&!(c.length<1))for(var d=0;d= 2, of course). If SIZE is 15M, since 2*15M > 20MiB, aria2 does not split file and download it using 1 source. You can append K or M (1K = 1024, 1M = 1024K). Possible Values: 1M-1024M.","netrc-path.name":".netrc Path","netrc-path.description":"","no-netrc.name":"Disable netrc","no-netrc.description":"","no-proxy.name":"No Proxy List","no-proxy.description":"Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.","out.name":"File Name","out.description":"The file name of the downloaded file. It is always relative to the directory given in --dir option. When the --force-sequential option is used, this option is ignored.","proxy-method.name":"Proxy Method","proxy-method.description":"Set the method to use in proxy request. METHOD is either GET or TUNNEL. HTTPS downloads always use TUNNEL regardless of this option.","remote-time.name":"Remote File Timestamp","remote-time.description":"Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file.","reuse-uri.name":"Reuse Uri","reuse-uri.description":"Reuse already used URIs if no unused URIs are left.","retry-wait.name":"Retry Wait","retry-wait.description":"Set the seconds to wait between retries. When SEC > 0, aria2 will retry downloads when the HTTP server returns a 503 response.","server-stat-of.name":"Server Stat Output","server-stat-of.description":"Specify the file name to which performance profile of the servers is saved. You can load saved data using --server-stat-if option.","server-stat-timeout.name":"Server Stat Timeout","server-stat-timeout.description":"Specifies timeout in seconds to invalidate performance profile of the servers since the last contact to them.","split.name":"Split Count","split.description":"Download a file using N connections. If more than N URIs are given, first N URIs are used and remaining URIs are used for backup. If less than N URIs are given, those URIs are used more than once so that N connections total are made simultaneously. The number of connections to the same host is restricted by the --max-connection-per-server option.","stream-piece-selector.name":"Piece Selection Algorithm","stream-piece-selector.description":"Specify piece selection algorithm used in HTTP/FTP download. Piece means fixed length segment which is downloaded in parallel in segmented download. If default is given, aria2 selects piece so that it reduces the number of establishing connection. This is reasonable default behavior because establishing connection is an expensive operation. If inorder is given, aria2 selects piece which has minimum index. Index=0 means first of the file. This will be useful to view movie while downloading it. --enable-http-pipelining option may be useful to reduce re-connection overhead. Please note that aria2 honors --min-split-size option, so it will be necessary to specify a reasonable value to --min-split-size option. If random is given, aria2 selects piece randomly. Like inorder, --min-split-size option is honored. If geom is given, at the beginning aria2 selects piece which has minimum index like inorder, but it exponentially increasingly keeps space from previously selected piece. This will reduce the number of establishing connection and at the same time it will download the beginning part of the file first. This will be useful to view movie while downloading it.","timeout.name":"Timeout","timeout.description":"","uri-selector.name":"URI Selection Algorithm","uri-selector.description":"Specify URI selection algorithm. The possible values are inorder, feedback and adaptive. If inorder is given, URI is tried in the order appeared in the URI list. If feedback is given, aria2 uses download speed observed in the previous downloads and choose fastest server in the URI list. This also effectively skips dead mirrors. The observed download speed is a part of performance profile of servers mentioned in --server-stat-of and --server-stat-if If adaptive is given, selects one of the best mirrors for the first and reserved connections. For supplementary ones, it returns mirrors which has not been tested yet, and if each of them has already been tested, returns mirrors which has to be tested again. Otherwise, it doesn't select anymore mirrors. Like feedback, it uses a performance profile of servers.","check-certificate.name":"Check Certificate","check-certificate.description":"","http-accept-gzip.name":"Accept GZip","http-accept-gzip.description":"Send Accept: deflate, gzip request header and inflate response if remote server responds with Content-Encoding: gzip or Content-Encoding: deflate.","http-auth-challenge.name":"Auth Challenge","http-auth-challenge.description":"Send HTTP authorization header only when it is requested by the server. If false is set, then authorization header is always sent to the server. There is an exception: if user name and password are embedded in URI, authorization header is always sent to the server regardless of this option.","http-no-cache.name":"No Cache","http-no-cache.description":"Send Cache-Control: no-cache and Pragma: no-cache header to avoid cached content. If false is given, these headers are not sent and you can add Cache-Control header with a directive you like using --header option.","http-user.name":"HTTP Default User Name","http-user.description":"","http-passwd.name":"HTTP Default Password","http-passwd.description":"","http-proxy.name":"HTTP Proxy Server","http-proxy.description":"","http-proxy-user.name":"HTTP Proxy User Name","http-proxy-user.description":"","http-proxy-passwd.name":"HTTP Proxy Password","http-proxy-passwd.description":"","https-proxy.name":"HTTPS Proxy Server","https-proxy.description":"","https-proxy-user.name":"HTTPS Proxy User Name","https-proxy-user.description":"","https-proxy-passwd.name":"HTTPS Proxy Password","https-proxy-passwd.description":"","referer.name":"Referer","referer.description":"Set an http referrer (Referer). This affects all http/https downloads. If * is given, the download URI is also used as the referrer. This may be useful when used together with the --parameterized-uri option.","enable-http-keep-alive.name":"Enable Persistent Connection","enable-http-keep-alive.description":"Enable HTTP/1.1 persistent connection.","enable-http-pipelining.name":"Enable HTTP Pipelining","enable-http-pipelining.description":"Enable HTTP/1.1 pipelining.","header.name":"Custom Header","header.description":'Append HEADER to HTTP request header. Put one item per line, each item containing "header name: header value".',"save-cookies.name":"Cookies Path","save-cookies.description":"Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape format. If FILE already exists, it is overwritten. Session Cookies are also saved and their expiry values are treated as 0.","use-head.name":"Use HEAD Method","use-head.description":"Use HEAD method for the first request to the HTTP server.","user-agent.name":"Custom User Agent","user-agent.description":"","ftp-user.name":"FTP Default User Name","ftp-user.description":"","ftp-passwd.name":"FTP Default Password","ftp-passwd.description":"If user name is embedded but password is missing in URI, aria2 tries to resolve password using .netrc. If password is found in .netrc, then use it as password. If not, use the password specified in this option.","ftp-pasv.name":"Passive Mode","ftp-pasv.description":"Use the passive mode in FTP. If false is given, the active mode will be used. This option is ignored for SFTP transfer.","ftp-proxy.name":"FTP Proxy Server","ftp-proxy.description":"","ftp-proxy-user.name":"FTP Proxy User Name","ftp-proxy-user.description":"","ftp-proxy-passwd.name":"FTP Proxy Password","ftp-proxy-passwd.description":"","ftp-type.name":"Transfer Type","ftp-type.description":"","ftp-reuse-connection.name":"Reuse Connection","ftp-reuse-connection.description":"","ssh-host-key-md.name":"SSH Public Key Checksum","ssh-host-key-md.description":"Set checksum for SSH host public key. The option value format is TYPE=DIGEST. TYPE is hash type. The supported hash type is sha-1 or md5. DIGEST is hex digest. For example: sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3. This option can be used to validate server's public key when SFTP is used. If this option is not set, which is default, no validation takes place.","bt-detach-seed-only.name":"Detach Seed Only","bt-detach-seed-only.description":"Exclude seed only downloads when counting concurrent active downloads (See -j option). This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode, then it is excluded from active download count (thus it becomes 2), and the next download waiting in queue gets started. But be aware that seeding item is still recognized as active download in RPC method.","bt-enable-hook-after-hash-check.name":"Enable Hook After Hash Check","bt-enable-hook-after-hash-check.description":"Allow hook command invocation after hash check (see -V option) in BitTorrent download. By default, when hash check succeeds, the command given by --on-bt-download-complete is executed. To disable this action, give false to this option.","bt-enable-lpd.name":"Enable Local Peer Discovery (LPD)","bt-enable-lpd.description":"Enable Local Peer Discovery. If a private flag is set in a torrent, aria2 doesn't use this feature for that download even if true is given.","bt-exclude-tracker.name":"BitTorrent Exclude Trackers","bt-exclude-tracker.description":"Comma separated list of BitTorrent tracker's announce URI to remove. You can use special value * which matches all URIs, thus removes all announce URIs. When specifying * in shell command-line, don't forget to escape or quote it.","bt-external-ip.name":"External IP","bt-external-ip.description":"Specify the external IP address to use in BitTorrent download and DHT. It may be sent to BitTorrent tracker. For DHT, this option should be set to report that local node is downloading a particular torrent. This is critical to use DHT in a private network. Although this function is named external, it can accept any kind of IP addresses.","bt-force-encryption.name":"Force Encryption","bt-force-encryption.description":"Requires BitTorrent message payload encryption with arc4. This is a shorthand of --bt-require-crypto --bt-min-crypto-level=arc4. This option does not change the option value of those options. If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload.","bt-hash-check-seed.name":"Hash Check Before Seeding","bt-hash-check-seed.description":"If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. If you want to check file and download it only when it is damaged or incomplete, set this option to false. This option has effect only on BitTorrent download.","bt-load-saved-metadata.name":"Load Saved Metadata File","bt-load-saved-metadata.description":"Before getting torrent metadata from DHT when downloading with magnet link, first try to read file saved by --bt-save-metadata option. If it is successful, then skip downloading metadata from DHT.","bt-max-open-files.name":"Max Open Files","bt-max-open-files.description":"Specify maximum number of files to open in multi-file BitTorrent/Metalink download globally.","bt-max-peers.name":"Max Peers","bt-max-peers.description":"Specify the maximum number of peers per torrent. 0 means unlimited.","bt-metadata-only.name":"Download Metadata Only","bt-metadata-only.description":"Download meta data only. The file(s) described in meta data will not be downloaded. This option has effect only when BitTorrent Magnet URI is used.","bt-min-crypto-level.name":"Min Crypto Level","bt-min-crypto-level.description":"Set minimum level of encryption method. If several encryption methods are provided by a peer, aria2 chooses the lowest one which satisfies the given level.","bt-prioritize-piece.name":"Prioritize Piece","bt-prioritize-piece.description":"Try to download first and last pieces of each file first. This is useful for previewing files. The argument can contain 2 keywords: head and tail. To include both keywords, they must be separated by comma. These keywords can take one parameter, SIZE. For example, if head=SIZE is specified, pieces in the range of first SIZE bytes of each file get higher priority. tail=SIZE means the range of last SIZE bytes of each file. SIZE can include K or M (1K = 1024, 1M = 1024K).","bt-remove-unselected-file.name":"Remove Unselected File","bt-remove-unselected-file.description":"Removes the unselected files when download is completed in BitTorrent. To select files, use --select-file option. If it is not used, all files are assumed to be selected. Please use this option with care because it will actually remove files from your disk.","bt-require-crypto.name":"Require Crypto","bt-require-crypto.description":"If true is given, aria2 doesn't accept and establish connection with legacy BitTorrent handshake(\\19BitTorrent protocol). Thus aria2 always uses Obfuscation handshake.","bt-request-peer-speed-limit.name":"Preferred Download Speed","bt-request-peer-speed-limit.description":"If the whole download speed of every torrent is lower than SPEED, aria2 temporarily increases the number of peers to try for more download speed. Configuring this option with your preferred download speed can increase your download speed in some cases. You can append K or M (1K = 1024, 1M = 1024K).","bt-save-metadata.name":"Save Metadata","bt-save-metadata.description":'Save meta data as ".torrent" file. This option has effect only when BitTorrent Magnet URI is used. The file name is hex encoded info hash with suffix ".torrent". The directory to be saved is the same directory where download file is saved. If the same file already exists, meta data is not saved.',"bt-seed-unverified.name":"Not Verify Downloaded Fileds","bt-seed-unverified.description":"Seed previously downloaded files without verifying piece hashes.","bt-stop-timeout.name":"Stop Timeout","bt-stop-timeout.description":"Stop BitTorrent download if download speed is 0 in consecutive SEC seconds. If 0 is given, this feature is disabled.","bt-tracker.name":"BitTorrent Trackers","bt-tracker.description":"Comma separated list of additional BitTorrent tracker's announce URI. These URIs are not affected by --bt-exclude-tracker option because they are added after URIs in --bt-exclude-tracker option are removed.","bt-tracker-connect-timeout.name":"BitTorrent Tracker Connect Timeout","bt-tracker-connect-timeout.description":"Set the connect timeout in seconds to establish connection to tracker. After the connection is established, this option makes no effect and --bt-tracker-timeout option is used instead.","bt-tracker-interval.name":"BitTorrent Tracker Connect Interval","bt-tracker-interval.description":"Set the interval in seconds between tracker requests. This completely overrides interval value and aria2 just uses this value and ignores the min interval and interval value in the response of tracker. If 0 is set, aria2 determines interval based on the response of tracker and the download progress.","bt-tracker-timeout.name":"BitTorrent Tracker Timeout","bt-tracker-timeout.description":"","dht-file-path.name":"DHT (IPv4) File","dht-file-path.description":"Change the IPv4 DHT routing table file to PATH.","dht-file-path6.name":"DHT (IPv6) File","dht-file-path6.description":"Change the IPv6 DHT routing table file to PATH.","dht-listen-port.name":"DHT Listen Port","dht-listen-port.description":'Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. Multiple ports can be specified by using "," for example: 6881,6885. You can also use - to specify a range: 6881-6999. , and - can be used together.',"dht-message-timeout.name":"DHT Message Timeout","dht-message-timeout.description":"","enable-dht.name":"Enable DHT (IPv4)","enable-dht.description":"Enable IPv4 DHT functionality. It also enables UDP tracker support. If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given.","enable-dht6.name":"Enable DHT (IPv6)","enable-dht6.description":"Enable IPv6 DHT functionality. If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. Use --dht-listen-port option to specify port number to listen on.","enable-peer-exchange.name":"Enable Peer Exchange","enable-peer-exchange.description":"Enable Peer Exchange extension. If a private flag is set in a torrent, this feature is disabled for that download even if true is given.","follow-torrent.name":"Follow Torrent","follow-torrent.description":"If true or mem is specified, when a file whose suffix is .torrent or content type is application/x-bittorrent is downloaded, aria2 parses it as a torrent file and downloads files mentioned in it. If mem is specified, a torrent file is not written to the disk, but is just kept in memory. If false is specified, the .torrent file is downloaded to the disk, but is not parsed as a torrent and its contents are not downloaded.","listen-port.name":"Listen Port","listen-port.description":'Set TCP port number for BitTorrent downloads. Multiple ports can be specified by using "," for example: 6881,6885. You can also use - to specify a range: 6881-6999. , and - can be used together: 6881-6889,6999.',"enable-pmap.name":"Enable UPnP Port Mapping","enable-pmap.description":"Enables UPnP automatic port mapping for BT and DHT protocols, and automatically sets the external IP address (bt-external-ip) to improve BT connectivity and node discovery. (The LAN gateway needs to enable UPnP function)","max-overall-upload-limit.name":"Global Max Upload Limit","max-overall-upload-limit.description":"Set max overall upload speed in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","max-upload-limit.name":"Max Upload Limit","max-upload-limit.description":"Set max upload speed per each torrent in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","peer-id-prefix.name":"Peer ID Prefix","peer-id-prefix.description":"Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length. If more than 20 bytes are specified, only first 20 bytes are used. If less than 20 bytes are specified, random byte data are added to make its length 20 bytes.","peer-agent.name":"Peer Agent","peer-agent.description":"Specify the string used during the bitorrent extended handshake for the peer’s client version.","seed-ratio.name":"Min Share Ratio","seed-ratio.description":"Specify share ratio. Seed completed torrents until share ratio reaches RATIO. You are strongly encouraged to specify equals or more than 1.0 here. Specify 0.0 if you intend to do seeding regardless of share ratio. If --seed-time option is specified along with this option, seeding ends when at least one of the conditions is satisfied.","seed-time.name":"Min Seed Time","seed-time.description":"Specify seeding time in (fractional) minutes. Specifying --seed-time=0 disables seeding after download completed.","follow-metalink.name":"Follow Metalink","follow-metalink.description":"If true or mem is specified, when a file whose suffix is .meta4 or .metalink or content type of application/metalink4+xml or application/metalink+xml is downloaded, aria2 parses it as a metalink file and downloads files mentioned in it. If mem is specified, a metalink file is not written to the disk, but is just kept in memory. If false is specified, the .metalink file is downloaded to the disk, but is not parsed as a metalink file and its contents are not downloaded.","metalink-base-uri.name":"Base URI","metalink-base-uri.description":"Specify base URI to resolve relative URI in metalink:url and metalink:metaurl element in a metalink file stored in local disk. If URI points to a directory, URI must end with /.","metalink-language.name":"Language","metalink-language.description":"","metalink-location.name":"Preferred Server Location","metalink-location.description":"The location of the preferred server. A comma-delimited list of locations is acceptable, for example, jp,us.","metalink-os.name":"Operation System","metalink-os.description":"The operating system of the file to download.","metalink-version.name":"Version","metalink-version.description":"The version of the file to download.","metalink-preferred-protocol.name":"Preferred Protocol","metalink-preferred-protocol.description":"Specify preferred protocol. The possible values are http, https, ftp and none. Specify none to disable this feature.","metalink-enable-unique-protocol.name":"Enable Unique Protocol","metalink-enable-unique-protocol.description":"If true is given and several protocols are available for a mirror in a metalink file, aria2 uses one of them. Use --metalink-preferred-protocol option to specify the preference of protocol.","enable-rpc.name":"Enable JSON-RPC/XML-RPC Server","enable-rpc.description":"","pause-metadata.name":"Pause After Metadata Downloaded","pause-metadata.description":"Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.","rpc-allow-origin-all.name":"Allow All Origin Request","rpc-allow-origin-all.description":"Add Access-Control-Allow-Origin header field with value * to the RPC response.","rpc-listen-all.name":"Listen on All Network Interfaces","rpc-listen-all.description":"Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.","rpc-listen-port.name":"Listen Port","rpc-listen-port.description":"","rpc-max-request-size.name":"Max Request Size","rpc-max-request-size.description":"Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.","rpc-save-upload-metadata.name":"Save Upload Metadata","rpc-save-upload-metadata.description":"Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is '.torrent'. For metalink, it is '.meta4'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.","rpc-secure.name":"Enable SSL/TLS","rpc-secure.description":"RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.","allow-overwrite.name":"Allow Overwrite","allow-overwrite.description":"Restart download from scratch if the corresponding control file doesn't exist. See also --auto-file-renaming option.","allow-piece-length-change.name":"Allow Piece Length Change","allow-piece-length-change.description":"If false is given, aria2 aborts download when a piece length is different from one in a control file. If true is given, you can proceed but some download progress will be lost.","always-resume.name":"Always Resume Download","always-resume.description":"Always resume download. If true is given, aria2 always tries to resume download and if resume is not possible, aborts download. If false is given, when all given URIs do not support resume or aria2 encounters N URIs which does not support resume (N is the value specified using --max-resume-failure-tries option), aria2 downloads file from scratch. See --max-resume-failure-tries option.","async-dns.name":"Asynchronous DNS","async-dns.description":"","auto-file-renaming.name":"Auto File Renaming","auto-file-renaming.description":"Rename file name if the same file already exists. This option works only in HTTP(S)/FTP download. The new file name has a dot and a number(1..9999) appended after the name, but before the file extension, if any.","auto-save-interval.name":"Auto Save Interval","auto-save-interval.description":"Save a control file(*.aria2) every SEC seconds. If 0 is given, a control file is not saved during download. aria2 saves a control file when it stops regardless of the value. The possible values are between 0 to 600.","conditional-get.name":"Conditional Download","conditional-get.description":"Download file only when the local file is older than remote file. This function only works with HTTP(S) downloads only. It does not work if file size is specified in Metalink. It also ignores Content-Disposition header. If a control file exists, this option will be ignored. This function uses If-Modified-Since header to get only newer file conditionally. When getting modification time of local file, it uses user supplied file name (see --out option) or file name part in URI if --out is not specified. To overwrite existing file, --allow-overwrite is required.","conf-path.name":"Configuration File","conf-path.description":"","console-log-level.name":"Console Log Level","console-log-level.description":"","content-disposition-default-utf8.name":"Use UTF-8 to Handle Content-Disposition","content-disposition-default-utf8.description":"Handle quoted string in Content-Disposition header as UTF-8 instead of ISO-8859-1, for example, the filename parameter, but not the extended version filename.","daemon.name":"Enable Daemon","daemon.description":"","deferred-input.name":"Deferred Load","deferred-input.description":"If true is given, aria2 does not read all URIs and options from file specified by --input-file option at startup, but it reads one by one when it needs later. This may reduce memory usage if input file contains a lot of URIs to download. If false is given, aria2 reads all URIs and options at startup. --deferred-input option will be disabled when --save-session is used together.","disable-ipv6.name":"Disable IPv6","disable-ipv6.description":"","disk-cache.name":"Disk Cache","disk-cache.description":"Enable disk cache. If SIZE is 0, the disk cache is disabled. This feature caches the downloaded data in memory, which grows to at most SIZE bytes. The cache storage is created for aria2 instance and shared by all downloads. The one advantage of the disk cache is reduce the disk I/O because the data are written in larger unit and it is reordered by the offset of the file. If hash checking is involved and the data are cached in memory, we don't need to read them from the disk. SIZE can include K or M (1K = 1024, 1M = 1024K).","download-result.name":"Download Result","download-result.description":"This option changes the way Download Results is formatted. If OPT is default, print GID, status, average download speed and path/URI. If multiple files are involved, path/URI of first requested file is printed and remaining ones are omitted. If OPT is full, print GID, status, average download speed, percentage of progress and path/URI. The percentage of progress and path/URI are printed for each requested file in each row. If OPT is hide, Download Results is hidden.","dscp.name":"DSCP","dscp.description":"Set DSCP value in outgoing IP packets of BitTorrent traffic for QoS. This parameter sets only DSCP bits in TOS field of IP packets, not the whole field. If you take values from /usr/include/netinet/ip.h divide them by 4 (otherwise values would be incorrect, e.g. your CS1 class would turn into CS4). If you take commonly used values from RFC, network vendors' documentation, Wikipedia or any other source, use them as they are.","rlimit-nofile.name":"Soft Limit of Open File Descriptors","rlimit-nofile.description":"Set the soft limit of open file descriptors. This open will only have effect when: a. The system supports it (posix). b. The limit does not exceed the hard limit. c. The specified limit is larger than the current soft limit. This is equivalent to setting nofile via ulimit, except that it will never decrease the limit. This option is only available on systems supporting the rlimit API.","enable-color.name":"Enable Color in Terminal","enable-color.description":"","enable-mmap.name":"Enable MMap","enable-mmap.description":"Map files into memory. This option may not work if the file space is not pre-allocated. See --file-allocation.","event-poll.name":"Event Polling Method","event-poll.description":"Specify the method for polling events. The possible values are epoll, kqueue, port, poll and select. For each epoll, kqueue, port and poll, it is available if system supports it. epoll is available on recent Linux. kqueue is available on various *BSD systems including Mac OS X. port is available on Open Solaris. The default value may vary depending on the system you use.","file-allocation.name":"File Allocation Method","file-allocation.description":"Specify file allocation method. none doesn't pre-allocate file space. prealloc pre-allocates file space before download begins. This may take some time depending on the size of the file. If you are using newer file systems such as ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), falloc is your best choice. It allocates large(few GiB) files almost instantly. Don't use falloc with legacy file systems such as ext3 and FAT32 because it takes almost same time as prealloc and it blocks aria2 entirely until allocation finishes. falloc may not be available if your system doesn't have posix_fallocate(3) function. trunc uses ftruncate(2) system call or platform-specific counterpart to truncate a file to a specified length. In multi file torrent downloads, the files adjacent forward to the specified files are also allocated if they share the same piece.","force-save.name":"Force Save","force-save.description":"Save download with --save-session option even if the download is completed or removed. This option also saves control file in that situations. This may be useful to save BitTorrent seeding which is recognized as completed state.","save-not-found.name":"Save Not Found File","save-not-found.description":"Save download with --save-session option even if the file was not found on the server. This option also saves control file in that situations.","hash-check-only.name":"Hash Check Only","hash-check-only.description":"If true is given, after hash check using --check-integrity option, abort download whether or not download is complete.","human-readable.name":"Console Human Readable Output","human-readable.description":"Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi) in the console readout.","keep-unfinished-download-result.name":"Keep Unfinished Download Result","keep-unfinished-download-result.description":"Keep unfinished download results even if doing so exceeds --max-download-result. This is useful if all unfinished downloads must be saved in session file (see --save-session option). Please keep in mind that there is no upper bound to the number of unfinished download result to keep. If that is undesirable, turn this option off.","max-download-result.name":"Max Download Result","max-download-result.description":"Set maximum number of download result kept in memory. The download results are completed/error/removed downloads. The download results are stored in FIFO queue and it can store at most NUM download results. When queue is full and new download result is created, oldest download result is removed from the front of the queue and new one is pushed to the back. Setting big number in this option may result high memory consumption after thousands of downloads. Specifying 0 means no download result is kept. Note that unfinished downloads are kept in memory regardless of this option value. See --keep-unfinished-download-result option.","max-mmap-limit.name":"Max MMap Limit","max-mmap-limit.description":"Set the maximum file size to enable mmap (see --enable-mmap option). The file size is determined by the sum of all files contained in one download. For example, if a download contains 5 files, then file size is the total size of those files. If file size is strictly greater than the size specified in this option, mmap will be disabled.","max-resume-failure-tries.name":"Max Resume Failure Try Times","max-resume-failure-tries.description":"When used with --always-resume=false, aria2 downloads file from scratch when aria2 detects N number of URIs that does not support resume. If N is 0, aria2 downloads file from scratch when all given URIs do not support resume. See --always-resume option.","min-tls-version.name":"Min TLS Version","min-tls-version.description":"Specify minimum SSL/TLS version to enable.","log-level.name":"Log Level","log-level.description":"","optimize-concurrent-downloads.name":"Optimize Concurrent Downloads","optimize-concurrent-downloads.description":"Optimizes the number of concurrent downloads according to the bandwidth available. aria2 uses the download speed observed in the previous downloads to adapt the number of downloads launched in parallel according to the rule N = A + B Log10(speed in Mbps). The coefficients A and B can be customized in the option arguments with A and B separated by a colon. The default values (A=5, B=25) lead to using typically 5 parallel downloads on 1Mbps networks and above 50 on 100Mbps networks. The number of parallel downloads remains constrained under the maximum defined by the --max-concurrent-downloads parameter.","piece-length.name":"Piece Length","piece-length.description":"Set a piece length for HTTP/FTP downloads. This is the boundary when aria2 splits a file. All splits occur at multiple of this length. This option will be ignored in BitTorrent downloads. It will be also ignored if Metalink file contains piece hashes.","show-console-readout.name":"Show Console Output","show-console-readout.description":"","summary-interval.name":"Download Summary Output Interval","summary-interval.description":"Set interval in seconds to output download progress summary. Setting 0 suppresses the output.","max-overall-download-limit.name":"Global Max Download Limit","max-overall-download-limit.description":"Set max overall download speed in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","max-download-limit.name":"Max Download Limit","max-download-limit.description":"Set max download speed per each download in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","no-conf.name":"Disable Configuration File","no-conf.description":"","no-file-allocation-limit.name":"No File Allocation Limit","no-file-allocation-limit.description":"No file allocation is made for files whose size is smaller than SIZE. You can append K or M (1K = 1024, 1M = 1024K).","parameterized-uri.name":"Enable Parameterized URI","parameterized-uri.description":"Enable parameterized URI support. You can specify set of parts: http://{sv1,sv2,sv3}/foo.iso. Also you can specify numeric sequences with step counter: http://host/image[000-100:2].img. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, -Z option is required.","quiet.name":"Disable Console Output","quiet.description":"","realtime-chunk-checksum.name":"Realtime Data Chunk Validation","realtime-chunk-checksum.description":"Validate chunk of data by calculating checksum while downloading a file if chunk checksums are provided.","remove-control-file.name":"Remove Control File","remove-control-file.description":"Remove control file before download. Using with --allow-overwrite=true, download always starts from scratch. This will be useful for users behind proxy server which disables resume.","save-session.name":"Session Save File","save-session.description":"Save error/unfinished downloads to FILE on exit. You can pass this output file to aria2c with --input-file option on restart. If you like the output to be gzipped append a .gz extension to the file name. Please note that downloads added by aria2.addTorrent() and aria2.addMetalink() RPC method and whose meta data could not be saved as a file are not saved. Downloads removed using aria2.remove() and aria2.forceRemove() will not be saved.","save-session-interval.name":"Save Session Interval","save-session-interval.description":"Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits.","socket-recv-buffer-size.name":"Socket Receive Buffer Size","socket-recv-buffer-size.description":"Set the maximum socket receive buffer in bytes. Specifing 0 will disable this option. This value will be set to socket file descriptor using SO_RCVBUF socket option with setsockopt() call.","stop.name":"Auto Shutdown Time","stop.description":"Stop application after SEC seconds has passed. If 0 is given, this feature is disabled.","truncate-console-readout.name":"Truncate Console Output","truncate-console-readout.description":"Truncate console readout to fit in a single line."}})}])}(),function(){"use strict";angular.module("ariaNg").constant("aria2AllOptions",{gid:{type:"string",readonly:!0,required:!0},dir:{type:"string",required:!0,lazySaveTimeout:1500,showHistory:!0},log:{type:"string",lazySaveTimeout:2e3,required:!0},"max-concurrent-downloads":{type:"integer",defaultValue:"5",required:!0,min:1},"check-integrity":{type:"boolean",defaultValue:"false",required:!0},continue:{type:"boolean",required:!0},"all-proxy":{type:"string",lazySaveTimeout:1e3,showHistory:!0},"all-proxy-user":{type:"string"},"all-proxy-passwd":{type:"string"},checksum:{type:"string",required:!0,pattern:"^(md5|sha-(1|224|256|384|512))=[a-zA-Z0-9]+$"},"connect-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"dry-run":{type:"boolean",defaultValue:"false",required:!0},"lowest-speed-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-connection-per-server":{type:"integer",defaultValue:"1",required:!0,min:1},"max-file-not-found":{type:"integer",defaultValue:"0",required:!0,min:0},"max-tries":{type:"integer",defaultValue:"5",required:!0,min:0},"min-split-size":{type:"string",suffix:"Bytes",defaultValue:"20M",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"netrc-path":{type:"string",readonly:!0,defaultValue:"$(HOME)/.netrc"},"no-netrc":{type:"boolean",required:!0},"no-proxy":{type:"text",separator:",",showCount:!0},out:{type:"string"},"proxy-method":{type:"option",options:["get","tunnel"],defaultValue:"get",required:!0},"remote-time":{type:"boolean",defaultValue:"false",required:!0},"reuse-uri":{type:"boolean",defaultValue:"true",required:!0},"retry-wait":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0,max:600},"server-stat-of":{type:"string"},"server-stat-timeout":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"86400"},split:{type:"integer",defaultValue:"5",required:!0,min:1},"stream-piece-selector":{type:"option",options:["default","inorder","random","geom"],defaultValue:"default",required:!0},timeout:{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"uri-selector":{type:"option",options:["inorder","feedback","adaptive"],defaultValue:"feedback",required:!0},"check-certificate":{type:"boolean",readonly:!0,defaultValue:"true"},"http-accept-gzip":{type:"boolean",defaultValue:"false",required:!0},"http-auth-challenge":{type:"boolean",defaultValue:"false",required:!0},"http-no-cache":{type:"boolean",defaultValue:"false",required:!0},"http-user":{type:"string"},"http-passwd":{type:"string"},"http-proxy":{type:"string"},"http-proxy-user":{type:"string"},"http-proxy-passwd":{type:"string"},"https-proxy":{type:"string"},"https-proxy-user":{type:"string"},"https-proxy-passwd":{type:"string"},referer:{type:"string"},"enable-http-keep-alive":{type:"boolean",defaultValue:"true",required:!0},"enable-http-pipelining":{type:"boolean",defaultValue:"false",required:!0},header:{type:"text",separator:"\n",overrideMode:"append",submitFormat:"array",showCount:!0,trimCount:!0},"save-cookies":{type:"string"},"use-head":{type:"boolean",defaultValue:"false",required:!0},"user-agent":{type:"string",defaultValue:"aria2/$VERSION"},"ftp-user":{type:"string",defaultValue:"anonymous"},"ftp-passwd":{type:"string",defaultValue:"ARIA2USER@"},"ftp-pasv":{type:"boolean",defaultValue:"true",required:!0},"ftp-proxy":{type:"string"},"ftp-proxy-user":{type:"string"},"ftp-proxy-passwd":{type:"string"},"ftp-type":{type:"option",options:["binary","ascii"],defaultValue:"binary",required:!0},"ftp-reuse-connection":{type:"boolean",defaultValue:"true",required:!0},"ssh-host-key-md":{type:"string"},"show-files":{type:"boolean",readonly:!0},"bt-detach-seed-only":{type:"boolean",readonly:!0,defaultValue:"false"},"bt-enable-hook-after-hash-check":{since:"1.19.3",type:"boolean",defaultValue:"true",required:!0},"bt-enable-lpd":{type:"boolean",defaultValue:"false",required:!0},"bt-exclude-tracker":{type:"text",separator:",",showCount:!0},"bt-external-ip":{type:"string"},"bt-force-encryption":{type:"boolean",defaultValue:"false",required:!0},"bt-hash-check-seed":{type:"boolean",defaultValue:"true",required:!0},"bt-load-saved-metadata":{since:"1.33.0",type:"boolean",defaultValue:"false",required:!0},"bt-max-open-files":{type:"integer",defaultValue:"100",required:!0,min:1},"bt-max-peers":{type:"integer",defaultValue:"55",required:!0,min:0},"bt-metadata-only":{type:"boolean",defaultValue:"false",required:!0},"bt-min-crypto-level":{type:"option",options:["plain","arc4"],defaultValue:"plain",required:!0},"bt-prioritize-piece":{type:"string"},"bt-remove-unselected-file":{type:"boolean",defaultValue:"false",required:!0},"bt-require-crypto":{type:"boolean",defaultValue:"false",required:!0},"bt-request-peer-speed-limit":{type:"string",suffix:"Bytes",defaultValue:"50K",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"bt-save-metadata":{type:"boolean",defaultValue:"false",required:!0},"bt-seed-unverified":{type:"boolean",defaultValue:"false",required:!0},"bt-stop-timeout":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0},"bt-tracker":{type:"text",separator:",",showCount:!0},"bt-tracker-connect-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"bt-tracker-interval":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0},"bt-tracker-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"dht-file-path":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/dht.dat"},"dht-file-path6":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/dht6.dat"},"dht-listen-port":{type:"string",readonly:!0,defaultValue:"6881-6999"},"dht-message-timeout":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"10"},"enable-dht":{type:"boolean",readonly:!0,defaultValue:"true"},"enable-dht6":{type:"boolean",readonly:!0},"enable-peer-exchange":{type:"boolean",defaultValue:"true",required:!0},"follow-torrent":{type:"option",options:["true","false","mem"],defaultValue:"true",required:!0},"listen-port":{type:"integer",readonly:!0,defaultValue:"6881-6999"},"enable-pmap":{since:"enhanced",type:"boolean",defaultValue:"false",required:!0},"max-overall-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"peer-id-prefix":{type:"string",readonly:!0,defaultValue:"A2-$MAJOR-$MINOR-$PATCH-"},"peer-agent":{since:"1.33.0",type:"string",defaultValue:"aria2/$MAJOR.$MINOR.$PATCH",readonly:!0},"seed-ratio":{type:"float",defaultValue:"1.0",required:!0,min:0},"seed-time":{type:"float",suffix:"Minutes",required:!0,min:0},"follow-metalink":{type:"option",options:["true","false","mem"],defaultValue:"true",required:!0},"metalink-base-uri":{type:"string"},"metalink-language":{type:"string"},"metalink-location":{type:"string"},"metalink-os":{type:"string"},"metalink-version":{type:"string"},"metalink-preferred-protocol":{type:"option",options:["http","https","ftp","none"],defaultValue:"none",required:!0},"metalink-enable-unique-protocol":{type:"boolean",defaultValue:"true",required:!0},"enable-rpc":{type:"boolean",readonly:!0,defaultValue:"false"},"pause-metadata":{type:"boolean",defaultValue:"false",required:!0},"rpc-allow-origin-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-port":{type:"integer",readonly:!0,defaultValue:"6800"},"rpc-max-request-size":{type:"string",suffix:"Bytes",readonly:!0,defaultValue:"2M"},"rpc-save-upload-metadata":{type:"boolean",defaultValue:"true",required:!0},"rpc-secure":{type:"boolean",readonly:!0},"allow-overwrite":{type:"boolean",defaultValue:"false",required:!0},"allow-piece-length-change":{type:"boolean",defaultValue:"false",required:!0},"always-resume":{type:"boolean",defaultValue:"true",required:!0},"async-dns":{type:"boolean",defaultValue:"true",required:!0},"auto-file-renaming":{type:"boolean",defaultValue:"true",required:!0},"auto-save-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"60"},"conditional-get":{type:"boolean",defaultValue:"false",required:!0},"conf-path":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/aria2.conf"},"console-log-level":{type:"option",options:["debug","info","notice","warn","error"],readonly:!0,defaultValue:"notice"},"content-disposition-default-utf8":{since:"1.31.0",type:"boolean",defaultValue:"false"},daemon:{type:"boolean",readonly:!0,defaultValue:"false"},"deferred-input":{type:"boolean",readonly:!0,defaultValue:"false"},"disable-ipv6":{type:"boolean",readonly:!0,defaultValue:"false"},"disk-cache":{type:"string",suffix:"Bytes",readonly:!0,defaultValue:"16M"},"download-result":{type:"option",options:["default","full","hide"],defaultValue:"default",required:!0},dscp:{type:"string",readonly:!0},"rlimit-nofile":{type:"string",readonly:!0},"enable-color":{type:"boolean",readonly:!0,defaultValue:"true"},"enable-mmap":{type:"boolean",defaultValue:"false",required:!0},"event-poll":{type:"option",options:["epoll","kqueue","port","poll","select"],readonly:!0},"file-allocation":{type:"option",options:["none","prealloc","trunc","falloc"],defaultValue:"prealloc",required:!0},"force-save":{type:"boolean",defaultValue:"false",required:!0},"save-not-found":{since:"1.27.0",type:"boolean",defaultValue:"true",required:!0},"hash-check-only":{type:"boolean",defaultValue:"false",required:!0},"human-readable":{type:"boolean",readonly:!0,defaultValue:"true"},"keep-unfinished-download-result":{type:"boolean",defaultValue:"true",required:!0},"max-download-result":{type:"integer",defaultValue:"1000",required:!0,min:0},"max-mmap-limit":{since:"1.20.0",type:"string",suffix:"Bytes",defaultValue:"9223372036854775807",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-resume-failure-tries":{type:"integer",defaultValue:"0",required:!0,min:0},"min-tls-version":{type:"option",options:["SSLv3","TLSv1","TLSv1.1","TLSv1.2"],readonly:!0,defaultValue:"TLSv1"},"log-level":{type:"option",options:["debug","info","notice","warn","error"],defaultValue:"debug",required:!0},"optimize-concurrent-downloads":{since:"1.22.0",type:"string",defaultValue:"false"},"piece-length":{type:"string",suffix:"Bytes",defaultValue:"1M",required:!0,pattern:"^(0|[1-9]\\d*(M|m)?)$"},"show-console-readout":{type:"boolean",readonly:!0,defaultValue:"true"},"summary-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"60"},"max-overall-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"no-conf":{type:"boolean",readonly:!0},"no-file-allocation-limit":{type:"string",suffix:"Bytes",defaultValue:"5M",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"parameterized-uri":{type:"boolean",defaultValue:"false",required:!0},quiet:{type:"boolean",readonly:!0,defaultValue:"false"},"realtime-chunk-checksum":{type:"boolean",defaultValue:"true",required:!0},"remove-control-file":{type:"boolean",required:!0},"save-session":{type:"string"},"save-session-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"0"},"socket-recv-buffer-size":{since:"1.19.3",type:"string",suffix:"Bytes",readonly:!0,defaultValue:"0"},stop:{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"0"},"truncate-console-readout":{type:"boolean",readonly:!0,defaultValue:"true"}}).constant("aria2GlobalAvailableOptions",{basicOptions:["dir","log","max-concurrent-downloads","check-integrity","continue"],httpFtpSFtpOptions:["all-proxy","all-proxy-user","all-proxy-passwd","connect-timeout","dry-run","lowest-speed-limit","max-connection-per-server","max-file-not-found","max-tries","min-split-size","netrc-path","no-netrc","no-proxy","proxy-method","remote-time","reuse-uri","retry-wait","server-stat-of","server-stat-timeout","split","stream-piece-selector","timeout","uri-selector"],httpOptions:["check-certificate","http-accept-gzip","http-auth-challenge","http-no-cache","http-user","http-passwd","http-proxy","http-proxy-user","http-proxy-passwd","https-proxy","https-proxy-user","https-proxy-passwd","referer","enable-http-keep-alive","enable-http-pipelining","header","save-cookies","use-head","user-agent"],ftpSFtpOptions:["ftp-user","ftp-passwd","ftp-pasv","ftp-proxy","ftp-proxy-user","ftp-proxy-passwd","ftp-type","ftp-reuse-connection","ssh-host-key-md"],btOptions:["bt-detach-seed-only","bt-enable-hook-after-hash-check","bt-enable-lpd","bt-exclude-tracker","bt-external-ip","bt-force-encryption","bt-hash-check-seed","bt-load-saved-metadata","bt-max-open-files","bt-max-peers","bt-metadata-only","bt-min-crypto-level","bt-prioritize-piece","bt-remove-unselected-file","bt-require-crypto","bt-request-peer-speed-limit","bt-save-metadata","bt-seed-unverified","bt-stop-timeout","bt-tracker","bt-tracker-connect-timeout","bt-tracker-interval","bt-tracker-timeout","dht-file-path","dht-file-path6","dht-listen-port","dht-message-timeout","enable-dht","enable-dht6","enable-peer-exchange","follow-torrent","listen-port","enable-pmap","max-overall-upload-limit","max-upload-limit","peer-id-prefix","peer-agent","seed-ratio","seed-time"],metalinkOptions:["follow-metalink","metalink-base-uri","metalink-language","metalink-location","metalink-os","metalink-version","metalink-preferred-protocol","metalink-enable-unique-protocol"],rpcOptions:["enable-rpc","pause-metadata","rpc-allow-origin-all","rpc-listen-all","rpc-listen-port","rpc-max-request-size","rpc-save-upload-metadata","rpc-secure"],advancedOptions:["allow-overwrite","allow-piece-length-change","always-resume","async-dns","auto-file-renaming","auto-save-interval","conditional-get","conf-path","console-log-level","content-disposition-default-utf8","daemon","deferred-input","disable-ipv6","disk-cache","download-result","dscp","rlimit-nofile","enable-color","enable-mmap","event-poll","file-allocation","force-save","save-not-found","hash-check-only","human-readable","keep-unfinished-download-result","max-download-result","max-mmap-limit","max-resume-failure-tries","min-tls-version","log-level","optimize-concurrent-downloads","piece-length","show-console-readout","summary-interval","max-overall-download-limit","max-download-limit","no-conf","no-file-allocation-limit","parameterized-uri","quiet","realtime-chunk-checksum","remove-control-file","save-session","save-session-interval","socket-recv-buffer-size","stop","truncate-console-readout"]}).constant("aria2QuickSettingsAvailableOptions",{globalSpeedLimitOptions:["max-overall-download-limit","max-overall-upload-limit"]}).constant("aria2TaskAvailableOptions",{taskOptions:[{key:"dir",category:"global",canUpdate:"new",showHistory:!0},{key:"out",category:"http",canUpdate:"new"},{key:"allow-overwrite",category:"global",canShow:"new"},{key:"max-download-limit",category:"global"},{key:"max-upload-limit",category:"bittorrent"},{key:"split",category:"http",canUpdate:"new|waiting|paused"},{key:"min-split-size",category:"http",canUpdate:"new|waiting|paused"},{key:"max-connection-per-server",category:"http",canUpdate:"new|waiting|paused"},{key:"lowest-speed-limit",category:"http",canUpdate:"new|waiting|paused"},{key:"stream-piece-selector",category:"http",canUpdate:"new|waiting|paused"},{key:"http-user",category:"http",canUpdate:"new|waiting|paused"},{key:"http-passwd",category:"http",canUpdate:"new|waiting|paused"},{key:"all-proxy",category:"http",canUpdate:"new|waiting|paused",showHistory:!0},{key:"all-proxy-user",category:"http",canUpdate:"new|waiting|paused",showHistory:!0},{key:"all-proxy-passwd",category:"http",canUpdate:"new|waiting|paused"},{key:"checksum",category:"http"},{key:"referer",category:"http",canUpdate:"new"},{key:"header",category:"http",canUpdate:"new"},{key:"bt-max-peers",category:"bittorrent"},{key:"bt-request-peer-speed-limit",category:"bittorrent"},{key:"bt-remove-unselected-file",category:"bittorrent"},{key:"bt-stop-timeout",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"bt-tracker",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"bt-exclude-tracker",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"seed-ratio",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"seed-time",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"conditional-get",category:"global",canShow:"new"},{key:"check-integrity",category:"global"},{key:"file-allocation",category:"global",canShow:"new"},{key:"parameterized-uri",category:"global",canShow:"new"},{key:"force-save",category:"global"}]})}(),function(){"use strict";angular.module("ariaNg").constant("aria2Errors",{1:{descriptionKey:"error.unknown"},2:{descriptionKey:"error.operation.timeout"},3:{descriptionKey:"error.resource.notfound"},4:{descriptionKey:"error.resource.notfound.max-file-not-found"},5:{descriptionKey:"error.download.aborted.lowest-speed-limit"},6:{descriptionKey:"error.network.problem"},8:{descriptionKey:"error.resume.notsupported"},9:{descriptionKey:"error.space.notenough"},10:{descriptionKey:"error.piece.length.different"},11:{descriptionKey:"error.download.sametime"},12:{descriptionKey:"error.download.torrent.sametime"},13:{descriptionKey:"error.file.exists"},14:{descriptionKey:"error.file.rename.failed"},15:{descriptionKey:"error.file.open.failed"},16:{descriptionKey:"error.file.create.failed"},17:{descriptionKey:"error.io.error"},18:{descriptionKey:"error.directory.create.failed"},19:{descriptionKey:"error.name.resolution.failed"},20:{descriptionKey:"error.metalink.file.parse.failed"},21:{descriptionKey:"error.ftp.command.failed"},22:{descriptionKey:"error.http.response.header.bad"},23:{descriptionKey:"error.redirects.toomany"},24:{descriptionKey:"error.http.authorization.failed"},25:{descriptionKey:"error.bencoded.file.parse.failed"},26:{descriptionKey:"error.torrent.file.corrupted"},27:{descriptionKey:"error.magnet.uri.bad"},28:{descriptionKey:"error.option.bad"},29:{descriptionKey:"error.server.overload"},30:{descriptionKey:"error.rpc.request.parse.failed"},32:{descriptionKey:"error.checksum.failed"}})}(),function(){"use strict";angular.module("ariaNg").constant("aria2RpcConstants",{rpcServiceVersion:"2.0",rpcServiceName:"aria2",rpcSystemServiceName:"system",rpcTokenPrefix:"token:"}).constant("aria2RpcErrors",{Unauthorized:{message:"Unauthorized",tipTextKey:"rpc.error.unauthorized"}})}(),function(){"use strict";angular.module("ariaNg").controller("CommandController",["$rootScope","$window","$location","$routeParams","ariaNgDefaultOptions","ariaNgCommonService","ariaNgLogService","ariaNgSettingService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c){var d=a.path();(function(n,d){return 0===n.indexOf("/new")?function(t,n){try{t=s.base64UrlDecode(t)}catch(e){return s.showError("URL is not base64 encoded!"),!1}var i={},r=!1;if(n){for(var d in n)n.hasOwnProperty(d)&&c.isOptionKeyValid(d)&&(i[d]=n[d]);"true"===n.pause&&(r=!0)}return e.loadPromise=l.newUriTask({urls:[t],options:i},r,(function(e){if(!e.success)return!1;r?a.path("/waiting"):a.path("/downloading")})),o.info("[CommandController] new download: "+t),!0}(d.url,d):0===n.indexOf("/settings/rpc/set")?function(e,n,l,c,d){if(l=l||i.rpcPort,c=c||i.rpcInterface,d=d||i.secret,o.info("[CommandController] set rpc: "+e+"://"+n+":"+l+"/"+c+", secret: "+d),!e||"http"!==e&&"https"!==e&&"ws"!==e&&"wss"!==e)return s.showError("Protocol is invalid!"),!1;if(!n)return s.showError("RPC host cannot be empty!"),!1;if(d)try{d=s.base64UrlDecode(d)}catch(e){return s.showError("RPC secret is not base64 encoded!"),!1}var u={rpcAlias:"",rpcHost:n,rpcPort:l,rpcInterface:c,protocol:e,httpMethod:i.httpMethod,rpcRequestHeaders:"",secret:d};return r.isRpcSettingEqualsDefault(u)?a.path("/downloading"):(r.setDefaultRpcSetting(u,{keepCurrent:!1,forceSet:!0}),a.path("/downloading"),t.location.reload()),!0}(d.protocol,d.host,d.port,d.interface,d.secret):(s.showError("Parameter is invalid!"),!1)})(d,angular.extend({},n,a.search()))||a.path("/downloading")}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgDebugController",["$rootScope","$scope","$location","$interval","$timeout","$filter","ariaNgConstants","ariaNgCommonService","ariaNgLocalizationService","ariaNgLogService","ariaNgKeyboardService","ariaNgSettingService","aria2RpcService",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var f=[{name:"logs",show:!0},{name:"rpc",show:!0}],g=null,m=function(){for(var e=[],t=0;t=0)},t.setLogLevelFilter=function(e){t.context.logLevelFilter=e},t.isSetLogLevelFilter=function(e){return t.context.logLevelFilter===e},t.getLogLevelFilter=function(){return t.context.logLevelFilter},t.setAutoRefreshInterval=function(e){t.context.logAutoRefreshInterval=e,g&&n.cancel(g),e>0&&(t.reloadLogs(),g=n((function(){t.reloadLogs()}),t.context.logAutoRefreshInterval))},t.reloadLogs=function(){t.context.logs=c.getDebugLogs().slice()},t.clearDebugLogs=function(){r.confirm("Confirm Clear","Are you sure you want to clear debug logs?","warning",(function(){c.clearDebugLogs(),t.reloadLogs()}),!1)},t.showLogDetail=function(e){t.context.currentLog=e,angular.element("#log-detail-modal").modal()},$("#log-detail-modal").on("hide.bs.modal",(function(e){t.context.currentLog=null})),t.executeAria2Method=function(){if(!t.context.rpcRequestMethod||t.context.rpcRequestMethod.indexOf(".")<0)r.showError("RPC method is illegal!");else{var e=t.context.rpcRequestMethod.split(".");if(2===e.length){var a=e[1];if(angular.isFunction(p[a])){var n={silent:!1,callback:function(e){t.context.rpcResponse=e?s("json")(e.data):s("json")(e)}},i={};try{i=angular.fromJson(t.context.rpcRequestParameters)}catch(e){return c.error("[AriaNgDebugController.executeAria2Method] failed to parse request parameters: "+t.context.rpcRequestParameters,e),void r.showError("RPC request parameters are invalid!")}for(var o in i)i.hasOwnProperty(o)&&"silent"!==o&&"callback"!==o&&(n[o]=i[o]);return p[a](n)}r.showError("AriaNg does not support this RPC method!")}else r.showError("RPC method is illegal!")}},t.requestParametersTextboxKeyDown=function(e){if(u.getKeyboardShortcuts())return d.isCtrlEnterPressed(e)&&t.executeMethodForm.$valid?(e.preventDefault&&e.preventDefault(),t.executeAria2Method(),!1):void 0},t.$on("$destroy",(function(){g&&n.cancel(g)})),e.swipeActions.extendLeftSwipe=function(){var e=m(),a=e.indexOf(t.context.currentTab);return a0&&(t.changeTab(e[a-1]),!0)},e.loadPromise=i((function(){u.isEnableDebugMode()?t.setAutoRefreshInterval(t.context.logAutoRefreshInterval):r.showError("Access Denied!",(function(){u.isEnableDebugMode()||a.path("/settings/ariang")}))}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("MainController",["$rootScope","$scope","$route","$window","$location","$document","$interval","clipboard","aria2RpcErrors","ariaNgCommonService","ariaNgVersionService","ariaNgNotificationService","ariaNgSettingService","ariaNgMonitorService","ariaNgTitleService","aria2TaskService","aria2SettingService","ariaNgKeyboardService","aria2eRecService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f,g,m,h,v,b){var k=null,y=null;e.defaultTaskPage=p.getDefaultTaskPage();var w="/"+e.defaultTaskPage,S=function(){var e=i.path().substring(1);return"all"===e||"downloading"===e||"waiting"===e||"stopped"===e?e:""},x=function(){var e=g.getFinalTitleByGlobalStat({globalStat:t.globalStat,currentRpcProfile:C()});s[0].title=e},T=function(e,a){return h.getGlobalStat((function(e){if(e.success||e.data.message!==l.Unauthorized.message){if(e.success){let a=e.data;t.globalStat=a,t.globalStat.numTotal=Number(a.numActive)+Number(a.numWaiting)+Number(a.numStopped),f.recordGlobalStat(e.data)}a&&a(e)}else o.cancel(y)}),e)},C=function(){if(!t.rpcSettings||t.rpcSettings.length<1)return null;for(var e=0;e0,data:f.getGlobalStatsData()},t.enableDebugMode=function(){return p.isEnableDebugMode()},t.quickSettingContext=null,t.rpcSettings=p.getAllRpcSettings(),t.currentRpcProfile=C(),t.currentRpcAlias=p.getCurrentRpcDisplayName(),t.isCurrentRpcUseWebSocket=p.isCurrentRpcUseWebSocket(),t.isTaskSelected=function(){return e.taskContext.getSelectedTaskIds().length>0},t.isSelectedTasksAllHaveUrl=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a1&&c.showError("Failed to change some tasks state."),!e.hasSuccess)return;let s=t.globalStat;T(!0,(function(o){let r=t.globalStat;e.hasError||"start"!==n||("/waiting"===i.path()&&o.success&&r.numActive>s.numActive?i.path("/downloading"):a.reload())})),e.hasError||"pause"!==n||("/downloading"===i.path()?i.path("/waiting"):a.reload())}),r.length>1))},t.retryTask=function(t){c.confirm("Confirm Retry","Are you sure you want to retry the selected task? AriaNg will create same task after clicking OK.","info",(function(){e.loadPromise=m.retryTask(t.gid,(function(e){if(e.success){T(!0);var t=p.getAfterRetryingTask();e.success&&e.data&&("task-list-default"===t?i.path()!==w?i.path(w):a.reload():"task-list-downloading"===t?"/downloading"!==i.path()?i.path("/downloading"):a.reload():"task-detail"===t?i.path("/task/detail/"+e.data):a.reload())}else c.showError("Failed to retry this task.")}),!1)}))},t.hasPausedTask=function(){return e.taskContext.hasPausedTask()},t.hasRetryableTask=function(){return e.taskContext.hasRetryableTask()},t.hasCompletedTask=function(){return e.taskContext.hasCompletedTask()},t.isSelectedTaskRetryable=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a1&&c.showError("Failed to remove some task(s)."),e.hasSuccess&&(T(!0),e.hasError||("/downloading"==i.path()?i.path("/stopped"):i.path().startsWith("/task/detail")?i.path(w):a.reload()))}),n.length>1,!!t)};const o=v.isShiftKeyPressed(t);if(p.getConfirmTaskRemoval()||o){let t=null;e.enhanced&&(t={input:"checkbox",inputValue:o,inputPlaceholder:"Remove downloaded file(s) simultaneously"}),c.confirm("Confirm Remove","Are you sure you want to remove the selected task?","warning",s,!1,t)}else s()},t.clearStoppedTasks=function(){c.confirm("Confirm Clear","Are you sure you want to clear stopped tasks?","warning",(function(){e.loadPromise=m.clearStoppedTasks((function(e){e.success&&(T(!0),"/stopped"!==i.path()?i.path(w):a.reload())}))}))},t.isAllTasksSelected=function(){return e.taskContext.isAllSelected()},t.selectAllTasks=function(){e.taskContext.selectAll()},t.selectAllPausedTasks=function(){e.taskContext.selectAllPaused()},t.selectAllFailedTasks=function(){e.taskContext.selectAllFailed()},t.selectAllCompletedTasks=function(){e.taskContext.selectAllCompleted()},t.copySelectedTasksDownloadLink=function(){for(var t=e.taskContext.getSelectedTasks(),a="",n=0;n0&&(a+="\n"),a+=t[n].singleUrl;a.length>0&&r.copyText(a)},t.copySelectedTasksMagnetLink=function(){for(var t=e.taskContext.getSelectedTasks(),a="",n=0;n0&&(a+="\n"),a+="magnet:?xt=urn:btih:"+t[n].infoHash;a.length>0&&r.copyText(a)},t.changeDisplayOrder=function(e,t){var a=S(),n=c.parseOrderType(p.getDisplayOrder(a)),i=c.parseOrderType(e);t&&i.type===n.type&&(i.reverse=!n.reverse),p.setDisplayOrder(i.getValue(),a)},t.isSetDisplayOrder=function(e){var t=S(),a=c.parseOrderType(p.getDisplayOrder(t)),n=c.parseOrderType(e);return a.equals(n)},t.showQuickSettingDialog=function(e,a){t.quickSettingContext={type:e,title:a}},t.switchRpcSetting=function(t){t.isDefault||(p.setDefaultRpcSetting(t),0===i.path().indexOf("/task/detail/")||0===i.path().indexOf("/settings/aria2/")?(e.setAutoRefreshAfterPageLoad(),i.path(w)):n.location.reload())},t.getOpenHandlerUrl=function(e,a){if(!t.currentRpcProfile||!t.currentRpcProfile.openHandlerUrl)return"";let n=t.currentRpcProfile.openHandlerUrl;if("string"!=typeof e||"string"!=typeof n)return"";let i="";const s=n.match(/\${relativepath:(\d+)}/);if(s){const t=parseInt(s[1]);i=t?c.getRelativeDir(e,t):""}return n.replace("${taskdir}",e).replace(/\${relativepath:(\d+)}/,i).replace("${taskname}",a)},p.getTitleRefreshInterval()>0&&(k=o((function(){x()}),p.getTitleRefreshInterval())),p.getGlobalStatRefreshInterval()>0&&(y=o((function(){T(!0)}),p.getGlobalStatRefreshInterval())),b.getRecManifestPromise().then((function(t){if(t){try{var a=n.navigator.language,s=p.getRecCount(),o=t.contents[0].regions||[],r=t.total>s,l=o.includes("all")||o.includes(a);e.hasNewRec=r&&l,e.recTotal=t.total}catch(t){e.hasNewRec=!1,e.recTotal=s}0===i.path().indexOf("/recommend")&&p.setRecCount(e.recTotal)}else e.hasNewRec=!1})).catch((function(t){e.hasNewRec=!1,e.recTotal=p.getRecCount()})),t.updateRecCount=function(){p.setRecCount(e.recCount),e.hasNewRec=!1},t.compactMode=p.getCompactMode(),t.$watch("compactMode",(function(e,t){p.setCompactMode(e)})),t.$on("$destroy",(function(){k&&o.cancel(k),y&&o.cancel(y)})),T(!0,(function(){x()}))}])}(),function(){"use strict";angular.module("ariaNg").controller("NewTaskController",["$rootScope","$scope","$location","$q","$timeout","ariaNgCommonService","ariaNgLogService","ariaNgKeyboardService","ariaNgFileService","ariaNgFileTypes","ariaNgSettingService","aria2TaskService","aria2SettingService","ariaNgNotificationService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f){var g,m=[{name:"links",show:!0},{name:"options",show:!0}],h=a.search(),v=function(){for(var e=[],t=0;t{e.isDir||t.pendingTasks.push(e)}))}};t.context={currentTab:"links",taskType:"urls",urls:"",uploadFiles:[],showUrlFilter:!1,lastChecked:-1,collapsedDirs:[],torrentTask:{},availableOptions:(g=p.getNewTaskOptionKeys(),p.getSpecifiedOptions(g,{disableRequired:!0})),globalOptions:null,options:{},optionFilter:{global:!0,http:!1,bittorrent:!1},exportCommandApiOptions:null,hasDownloadsPermission:s.hasDownloadsPermission()};const S=angular.copy(t.context);if(t.resetContext=function(){t.context=angular.copy(S),t.pendingTasks=[]},t.changeTab=function(e){"options"===e&&t.loadDefaultOption(),t.context.currentTab=e},e.swipeActions.extendLeftSwipe=function(){var e=v(),a=e.indexOf(t.context.currentTab);return a0&&(t.changeTab(e[a-1]),!0)},t.loadDefaultOption=function(){t.context.globalOptions||(e.loadPromise=p.getGlobalOption((function(e){e.success&&(t.context.globalOptions=e.data)})))},h.url){try{t.context.urls=decodeURI(s.base64UrlDecode(h.url))}catch(e){o.error("[NewTaskController] base64 decode error, url="+h.url,e)}t.context.urls?.startsWith("http")&&(t.context.optionFilter.http=!0,t.context.urls.includes("\n")||i((function(){"Connected"==e.taskContext.rpcStatus&&t.changeTab("options")}),1440,!1)),h.referer&&(t.context.options.referer=h.referer),h.header&&(t.context.options.header=h.header),h.filename&&(t.context.options.out=decodeURIComponent(h.filename)),h.dir&&(t.context.options.dir=decodeURIComponent(h.dir))}t.openTorrent=function(){l.openFileContent({scope:t,fileFilter:".torrent",fileType:"binary"},(function(e){t.context.uploadFiles.push(e),t.context.taskType="torrent",w(e.base64Content)}),(function(e){s.showError(e)}),angular.element("#file-holder"))},t.openMetalink=function(){l.openFileContent({scope:t,fileFilter:".meta4,.metalink",fileType:"binary"},(function(e){t.context.uploadFiles.push(e),t.context.taskType="metalink",t.changeTab("options")}),(function(e){s.showError(e)}),angular.element("#file-holder"))},t.dragEnterHandler=function(e,t){e.preventDefault(),t.focus(),t.addClass("has-warning");let a=e.originalEvent.dataTransfer.items;(a.length>1||"file"!=a[0].kind)&&t.removeClass("has-warning").addClass("has-error")},t.dragLeaveHandler=function(e,t){e.preventDefault(),t.blur(),t.removeClass("has-warning has-error")},t.dropHandler=function(e,a){e.preventDefault(),a.removeClass("has-warning has-error");const n=e.originalEvent.dataTransfer.files,o=e.originalEvent.dataTransfer.items;for(const e of o)"string"==e.kind&&"text/uri-list"==e.type&&(t.context.urls&&!t.context.urls.endsWith("\n")?t.context.urls+="\n":angular.isUndefined(t.context.urls)&&(t.context.urls=""),e.getAsString((function(e){t.$apply((function(){t.context.urls+=e+"\n"}))})));for(const e of n){if(t.context.taskType&&"urls"!==t.context.taskType){if(!e.name.toLowerCase().endsWith(t.context.taskType))continue}else if(e.name.toLowerCase().endsWith(".torrent"))t.context.taskType="torrent";else{if(!e.name.toLowerCase().endsWith(".meta4")&&!e.name.toLowerCase().endsWith(".metalink"))continue;t.context.taskType="metalink"}const a={fileName:e.name},n=new FileReader;n.onload=function(){a.base64Content=n.result.replace(/.*?base64,/,""),t.context.uploadFiles.push(a),"torrent"===t.context.taskType?(t.context.optionFilter.bittorrent=!0,i((function(){w(a.base64Content)}))):t.changeTab("options")},n.onerror=function(){s.showError("Failed to load file!")},n.readAsDataURL(e)}},t.isNewTaskValid=function(){return t.context.uploadFiles.length?"torrent"!==t.context.taskType||t.isAnyFileSelected():t.newTaskForm.$valid},t.startDownload=function(i,s){var o=function(e){if(e.hasSuccess||e.success){var t=null;e.results&&e.results.length>0?t=e.results[0]:e&&(t=e),"task-detail"===d.getAfterCreatingNewTask()&&t&&t.data?a.path("/task/detail/"+t.data):"all"===d.getDefaultTaskPage()?a.path("/all"):i?a.path("/waiting"):a.path("/downloading")}};"urls"===t.context.taskType?t.context.hasDownloadsPermission&&"Connected"!==e.taskContext.rpcStatus?(f.notifyInPage("","Aria2 is disconnected, All tasks will be downloaded via Browser. Invalid URL will be ignored.",{type:"info",delay:6e3}),e.loadPromise=t.invokeBrowserDownload(s)):e.loadPromise=y(i,o):"torrent"===t.context.taskType?e.loadPromise=function(e,a){var i=[],s=angular.copy(t.context.options);b(s);for(const n of t.context.uploadFiles){x(),t.context.torrentTask.selectedFileIndex&&(s["select-file"]=t.context.torrentTask.selectedFileIndex);var o={content:n.base64Content,options:s};i.push(u.newTorrentTask(o,e,a))}return n.all(i)}(i,o):"metalink"===t.context.taskType&&(e.loadPromise=function(e,a){var i=[],s=angular.copy(t.context.options);b(s);for(const n of t.context.uploadFiles){var o={content:n.base64Content,options:s};i.push(u.newMetalinkTask(o,e,a))}return n.all(i)}(i,o))},t.invokeBrowserDownload=function(e){let n=function(){"all"===d.getDefaultTaskPage()?a.path("/all"):a.path("/downloading")};if(t.context.hasDownloadsPermission){let a=s.parseUrlsFromOriginInput(t.context.urls,"^(https?|ftp)://.+$");if(a.length>1)s.confirm("Download via Browser","Confirm to download multiple URLs from Browser simultaneously?","warning",(function(){let e={url:t.context.urls};chrome.runtime.sendMessage({type:"DOWNLOAD_VIA_BROWSER",data:e}).then(n)}),!1,null,(function(){e&&e.preventDefault()}));else if(1===a.length){let e={url:t.context.urls,filename:t.context.options.out};return chrome.runtime.sendMessage({type:"DOWNLOAD_VIA_BROWSER",data:e}).then(n)}}e&&e.preventDefault()},t.showExportCommandAPIModal=function(){t.context.exportCommandApiOptions={type:"new-task",data:k()}},t.setOption=function(e,a,n){""===a&&p.isOptionKeyRequired(e)?delete t.context.options[e]:t.context.options[e]=a,n.setReady()},t.urlTextboxKeyDown=function(e){if(d.getKeyboardShortcuts())return r.isCtrlEnterPressed(e)&&t.newTaskForm.$valid?(e.preventDefault&&e.preventDefault(),t.startDownload(),!1):void 0},t.getValidUrlsCount=function(){let e=0;if(t.context.showUrlFilter)for(const a of t.pendingTasks)t.filterTask(a)&&a.selected&&e++;else{var a=s.parseUrlsFromOriginInput(t.context.urls);e=a?a.length:0}return e},t.showUrlFilter=function(){t.context.showUrlFilter?(t.cancelUrlFilter(),e.searchContext.enabledInPage=!1):((!t.pendingTasks||"urls"===t.context.taskType&&t.newTaskForm.urls.$dirty)&&(t.pendingTasks=k()),e.searchContext.enabledInPage=!0,t.context.showUrlFilter=!0)},t.cancelUrlFilter=function(){t.context.showUrlFilter&&(t.context.showUrlFilter=!1,e.searchContext.enabledInPage=!1)},t.isAnyFileSelected=function(){if(!t.pendingTasks||!t.pendingTasks.length)return!1;for(var e=0;e=0&&(i.push(r),l.selected||(o=!1))}}for(r=0;r0&&"."===i.charAt(0)&&(i=i.substring(1)),g={extension:i,classified:!1,selected:!1,selectedCount:0,unSelectedCount:0},a[n]=g}o.selected?(g.selected=!0,g.selectedCount++):g.unSelectedCount++}var o={};for(var r in c)if(c.hasOwnProperty(r)){for(var l=c[r].name,d=c[r].extensions,u=[],p=0;p0&&(o[r]={name:l,extensions:u})}var f=[];for(var n in a){var g;if(a.hasOwnProperty(n))(g=a[n]).classified||f.push(g)}f.length>0&&(o.other={name:"Other",extensions:f}),t.context.fileExtensions=o,angular.element("#custom-choose-file-modal").modal()}},t.setSelectedExtension=function(e,a){if(t.pendingTasks&&t.pendingTasks.length){var n=t.pendingTasks;for(const o of n){var i="";"urls"===t.context.taskType?i=s.getFileExtensionFromUrl(o.urls[0]):"torrent"===t.context.taskType&&(i=s.getFileExtension(o.path)),i&&(i=i.toLowerCase()),i==="."+e&&(o.selected=a)}}},t.onTaskClick=function(e,a){let n=t.context.lastChecked,i=t.pendingTasks;if(e<0||!Array.isArray(i)||i.length<1)return;let s=i[e].selected=!i[e].selected;if(a.shiftKey&&-1!==n){let t=n=0)},e.keydownActions.selectAll=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.selectFiles("auto")})),!1},$("#custom-choose-file-modal").on("hide.bs.modal",(function(e){t.context.fileExtensions=null}));var x=function(){if(!t.context.torrentTask||!t.context.torrentTask.files)return;let e=[];for(const a of t.context.torrentTask.files)a&&a.selected&&!a.isDir&&e.push(a.index);e.length&&(t.context.torrentTask.selectedFileIndex=e.join(","))},T=function(e){if(e){var t=0,a=0;if(e.files&&e.files.length)for(var n=0;n0&&t===e.subDirs.length+e.files.length,e.partialSelected=t>0&&t0}},C=function(){if(t.context.torrentTask&&t.context.torrentTask.multiDir)for(var e=0;e0)for(var i=0;i0&&(d.processDownloadTasks(e.taskContext.list),!a)){var o=!1;for(i=0;i0}else t.data.message===r.Unauthorized.message&&s.cancel(f)}),t)};t.getOrderType=function(){return c.getDisplayOrder(p)},t.openDownloadFolder=function(e,i){if(e.stopPropagation(),0!==e.button||!i.files||i.files.length<1)return;let s="aria2://browse/path="+(i.files.length>1?i.dir+i.taskName:i.files[0].path);t.currentRpcProfile&&t.currentRpcProfile.openHandlerUrl&&(s=t.getOpenHandlerUrl(i.dir,i.taskName)),a.location.href=s,setTimeout((()=>{v||l.confirm("Install Aria2 Manager","Aria2 Manager is not installed, go to Alex Recommends channel for more information?","info",(function(){n.path("recommend").search("path","/posts/3").hash("usage")}))}),1200)},t.onTaskClick=function(t,a,n){if(t<0||!Array.isArray(n)||n.length<1)return;let i=n[t].gid,s=c.getKeyboardShortcuts(),o=a.originalEvent?.sourceCapabilities?.firesTouchEvents||!1;if(2==a.button&&e.taskContext.selected[i])return;if(!(o||0==a.button&&(!s&&!u.isModifierKeyPressed(a)||s&&u.isModifierKeyPressed(a)||a.shiftKey)))for(const t in e.taskContext.selected)t!==i&&(e.taskContext.selected[t]=!1);let r=e.taskContext.selected[i]=!e.taskContext.selected[i];if(a.shiftKey&&0==a.button&&-1!==h){let a=h0&&(f=s((function(){b(!0)}),c.getDownloadTaskRefreshInterval())),o.options(t,"task-list",{revertOnSpill:!0,moves:function(){return t.isSupportDragTask()}}),t.$on("task-list.drop-model",(function(e,t,a){var n=angular.element(t),i=n.attr("data-gid"),s=n.index();g=!0,d.changeTaskPosition(i,s,(function(){g=!1}),!0)})),angular.element(a).on("blur",(function(){v=!0})),t.$on("$destroy",(function(){g=!0,f&&s.cancel(f)})),e.keydownActions.selectAll=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.selectAllTasks()})),!1},e.keydownActions.delete=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.removeTasks(e)})),!1},e.loadPromise=b(!1),t.isWindows="Windows"==navigator?.userAgentData?.platform||"Win32"==navigator?.platform,t.isRpcLocalhost=c.isCurrentRpcLocalhost(),t.location=p}])}(),function(){"use strict";angular.module("ariaNg").controller("TaskDetailController",["$rootScope","$scope","$routeParams","$location","$interval","clipboard","aria2RpcErrors","ariaNgFileTypes","ariaNgCommonService","ariaNgSettingService","ariaNgMonitorService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var f=[{name:"overview",show:!0},{name:"pieces",show:!0},{name:"filelist",show:!0},{name:"btpeers",show:!0}],g=null,m=!1,h=null,v=!0,b=!1,k=function(){for(var e=[],t=0;t0&&t===e.subDirs.length+e.files.length,e.partialSelected=t>0&&t0}},R=function(){if(t.task&&t.task.multiDir)for(var e=0;e0,showPiecesInfo:"never"!==c.getShowPiecesInfoInTaskDetailPage(),showChooseFilesToolbar:!1,fileExtensions:[],collapsedDirs:{},btPeers:[],healthPercent:0,collapseTrackers:!0,statusData:d.getEmptyStatsData(a.gid),availableOptions:[],options:[]},t.changeTab=function(a){"settings"===a&&t.loadTaskOption(t.task),t.context.currentTab=a,e.skipLocationChange=!0,n.search("tab",a).replace()},e.swipeActions.extendLeftSwipe=function(){var e=k(),a=e.indexOf(t.context.currentTab);return a0&&(t.changeTab(e[a-1]),!0)},t.changeFileListDisplayOrder=function(e,a){if(!t.task||!t.task.multiDir){var n=l.parseOrderType(c.getFileListDisplayOrder()),i=l.parseOrderType(e);a&&i.type===n.type&&(i.reverse=!n.reverse),c.setFileListDisplayOrder(i.getValue())}},t.isSetFileListDisplayOrder=function(e){var t=l.parseOrderType(c.getFileListDisplayOrder()),a=l.parseOrderType(e);return t.equals(a)},t.getFileListOrderType=function(){return t.task&&t.task.multiDir?null:c.getFileListDisplayOrder()},t.showChooseFilesToolbar=function(){t.context.showChooseFilesToolbar?t.cancelChooseFiles():(m=!0,t.context.showChooseFilesToolbar=!0)},t.isAnyFileSelected=function(){if(!t.task||!t.task.files)return!1;for(var e=0;e=0&&(i.push(o),d.selected||(s=!1))}}for(o=0;o0&&"."===s.charAt(0)&&(s=s.substring(1)),m={extension:s,classified:!1,selected:!1,selectedCount:0,unSelectedCount:0},a[g]=m}i.selected?(m.selected=!0,m.selectedCount++):m.unSelectedCount++}}var o={};for(var c in r)if(r.hasOwnProperty(c)){var d=r[c].name,u=r[c].extensions,p=[];for(n=0;n0&&(o[c]={name:d,extensions:p})}var f=[];for(var g in a){var m;if(a.hasOwnProperty(g))(m=a[g]).classified||f.push(m)}f.length>0&&(o.other={name:"Other",extensions:f}),t.context.fileExtensions=o,angular.element("#custom-choose-file-modal").modal()}},t.setSelectedExtension=function(e,a){if(t.task&&t.task.files){for(var n=t.task.files,i=0;i span").text().trim(),t="";if(h.find(".setting-value > span").each((function(e,a){e>0&&(t+="\n"),t+=angular.element(a).text().trim()})),c.getIncludePrefixWhenCopyingFromTaskDetails()){var a=e+": "+t;s.copyText(a)}else s.copyText(t)}},b="settings"===t.context.currentTab&&!t.context.options.length,c.getDownloadTaskRefreshInterval()>0&&(g=i((function(){!t.task||"complete"!==t.task.status&&"error"!==t.task.status&&"removed"!==t.task.status?T(!0):i.cancel(g)}),c.getDownloadTaskRefreshInterval())),t.$on("$destroy",(function(){g&&i.cancel(g)})),t.onOverviewMouseDown=function(){angular.element('#overview-items .row[contextmenu-bind!="true"]').contextmenu({target:"#task-overview-contextmenu",before:function(e,t){h=t}}).attr("contextmenu-bind","true")},angular.element("#task-overview-contextmenu").on("hide.bs.context",(function(){h=null})),e.loadPromise=T(!1),t.isWindows="Windows"==navigator?.userAgentData?.platform||"Win32"==navigator?.platform,t.isRpcLocalhost=c.isCurrentRpcLocalhost(),t.backHome=function(){window.history.length>1?window.history.back():n.path("")}}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgSettingsController",["$rootScope","$scope","$routeParams","$location","$window","$interval","$timeout","$filter","clipboard","ariaNgLanguages","ariaNgCommonService","ariaNgVersionService","ariaNgKeyboardService","ariaNgNotificationService","ariaNgLocalizationService","ariaNgLogService","ariaNgFileService","ariaNgSettingService","ariaNgMonitorService","ariaNgTitleService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f,g,m,h,v,b,k,y){var w=a.extendType,S=null,x=function(){return k.getFinalTitleByGlobalStat({globalStat:b.getCurrentGlobalStat(),currentRpcProfile:T()})},T=function(){if(!t.context||!t.context.rpcSettings||t.context.rpcSettings.length<1)return null;for(var e=0;e0?(t.changeRpcTab(e-1),!0):0===e&&(t.changeGlobalTab(),!0)},t.isSupportNotification=function(){return f.isSupportBrowserNotification()&&v.isCurrentRpcUseWebSocket(t.context.settings.protocol)},t.setLanguage=function(e){v.setLanguage(e)&&g.applyLanguage(e),t.updateTitlePreview()},t.setTheme=function(t){v.setTheme(t),e.setTheme(t)},t.setDebugMode=function(e){v.setDebugMode(e)},t.setTitle=function(e){v.setTitle(e)},t.setEnableBrowserNotification=function(e){v.setBrowserNotification(e),e&&!f.hasBrowserPermission()&&f.requestBrowserPermission((function(e){e.granted||(t.context.settings.browserNotification=!1,d.showError("You have disabled notification in your browser. You should change your browser's settings before you enable this function."))}))},t.setBrowserNotificationSound=function(e){v.setBrowserNotificationSound(e)},t.setBrowserNotificationFrequency=function(e){v.setBrowserNotificationFrequency(e)},t.setWebSocketReconnectInterval=function(e){C(),v.setWebSocketReconnectInterval(e)},t.setTitleRefreshInterval=function(e){C(),v.setTitleRefreshInterval(e)},t.setGlobalStatRefreshInterval=function(e){C(),v.setGlobalStatRefreshInterval(e)},t.setDownloadTaskRefreshInterval=function(e){C(),v.setDownloadTaskRefreshInterval(e)},t.setRPCListDisplayOrder=function(e){C(),v.setRPCListDisplayOrder(e)},t.setDefaultTaskPage=function(t){e.defaultTaskPage=t,v.setDefaultTaskPage(t)},t.setTaskListIndependentDisplayOrder=function(e){v.setTaskListIndependentDisplayOrder(e)},t.setKeyboardShortcuts=function(e){v.setKeyboardShortcuts(e)},t.setSwipeGesture=function(e){v.setSwipeGesture(e)},t.setDragAndDropTasks=function(e){v.setDragAndDropTasks(e)},t.setAfterCreatingNewTask=function(e){v.setAfterCreatingNewTask(e)},t.setRemoveOldTaskAfterRetrying=function(e){v.setRemoveOldTaskAfterRetrying(e)},t.setPauseAfterRetry=function(e){v.setPauseAfterRetry(e)},t.setConfirmTaskRemoval=function(e){v.setConfirmTaskRemoval(e)},t.setIncludePrefixWhenCopyingFromTaskDetails=function(e){v.setIncludePrefixWhenCopyingFromTaskDetails(e)},t.setShowPiecesInfoInTaskDetailPage=function(e){v.setShowPiecesInfoInTaskDetailPage(e)},t.setAfterRetryingTask=function(e){v.setAfterRetryingTask(e)},t.showImportSettingsModal=function(){t.context.importSettings=null,angular.element("#import-settings-modal").modal()},$("#import-settings-modal").on("hide.bs.modal",(function(e){t.context.importSettings=null})),t.openAriaNgConfigFile=function(){h.openFileContent({scope:t,fileFilter:".json",fileType:"text"},(function(e){t.context.importSettings=e.content}),(function(e){d.showError(e)}),angular.element("#import-file-holder"))},t.importSettings=function(e){var t=null;try{t=JSON.parse(e)}catch(e){return m.error("[AriaNgSettingsController.importSettings] parse settings json error",e),void d.showError("Invalid settings data format!")}if(!angular.isObject(t)||angular.isArray(t))return m.error("[AriaNgSettingsController.importSettings] settings json is not object"),void d.showError("Invalid settings data format!");t&&d.confirm("Confirm Import","Are you sure you want to import all settings?","warning",(function(){v.importAllOptions(t),i.location.reload()}))},t.showExportSettingsModal=function(){t.context.exportSettings=r("json")(v.exportAllOptions()),t.context.exportSettingsCopied=!1,angular.element("#export-settings-modal").modal()},$("#export-settings-modal").on("hide.bs.modal",(function(e){t.context.exportSettings=null,t.context.exportSettingsCopied=!1})),t.copyExportSettings=function(){l.copyText(t.context.exportSettings,{container:angular.element("#export-settings-modal")[0]}),t.context.exportSettingsCopied=!0},t.addNewRpcSetting=function(){C();var e=v.addNewRpcSetting();t.context.rpcSettings.push(e),t.changeRpcTab(t.context.rpcSettings.length-1)},t.updateRpcSetting=function(e,t){C(),"protocol"!==t||e[t]||(e[t]="http"),v.updateRpcSetting(e,t)},t.removeRpcSetting=function(e){var a=e.rpcAlias?e.rpcAlias:e.rpcHost+":"+e.rpcPort;d.confirm("Confirm Remove",'Are you sure you want to remove rpc setting "{rpcName}"?',"warning",(function(){C();var a=t.getCurrentRpcTabIndex(),n=t.context.rpcSettings.indexOf(e);v.removeRpcSetting(e),t.context.rpcSettings.splice(n,1),a>=t.context.rpcSettings.length?t.changeRpcTab(t.context.rpcSettings.length-1):a<=0||a<=n||t.changeRpcTab(a-1)}),!1,{textParams:{rpcName:a}})},t.showExportCommandAPIModal=function(e){t.context.exportCommandApiOptions={type:"setting",data:e}},t.setDefaultRpcSetting=function(e){e.isDefault||(v.setDefaultRpcSetting(e),i.location.reload())},t.resetSettings=function(){d.confirm("Confirm Reset","Are you sure you want to reset all settings?","warning",(function(){v.resetSettings(),i.location.reload()}))},t.clearHistory=function(){d.confirm("Confirm Clear","Are you sure you want to clear all settings history?","warning",(function(){y.clearSettingsHistorys(),i.location.reload()}))},t.resetAria2Settings=function(){d.confirm("Confirm Reset","Reset the current Aria2 settings (Will take effect after Aria2 restarts)?","warning",(function(){const e=v.getRpcOptions(),t=y.getDefaultOptions(Object.keys(e));y.setGlobalOptions(t,(function(){const e=v.getCurrentRpcDisplayName();f.notifyInPage("","settings are reset",{type:"success",contentPrefix:e+" "})})),v.resetRpcOptions()}))},e.loadPromise=o((function(){angular.element('[data-toggle="popover"]').popover()}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2SettingsController",["$rootScope","$scope","$location","ariaNgConstants","ariaNgCommonService","aria2SettingService","ariaNgSettingService","ariaNgLocalizationService",function(e,t,a,n,i,s,o,r){var l=a.path().substring(a.path().lastIndexOf("/")+1);t.context={availableOptions:function(e){var t=s.getAvailableGlobalOptionsKeys(e);if(t)return s.getSpecifiedOptions(t);i.showError("Type is illegal!")}(l),globalOptions:[]},t.setGlobalOption=function(e,t,a){return s.setGlobalOption(e,t,(function(n){n.success&&"OK"===n.data?(a.setSuccess(),o.setRpcOption(e,t)):a.setFailed(n.data.message)}),!0)},e.searchContext.enabledInPage=!0,t.filterOption=function(t){if(!(t&&angular.isObject(t)&&angular.isString(t.key)&&angular.isString(t.nameKey)))return!1;if(!e.searchContext||!e.searchContext.text)return!0;let a=!1;const n=e.searchContext.text.toLowerCase();return a|=t.key.toLowerCase().includes(n),a|=r.getLocalizedText(t.nameKey).includes(n),a},e.loadPromise=s.getGlobalOption((function(e){e.success&&(t.context.globalOptions=e.data)}))}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2StatusController",["$rootScope","$scope","$timeout","ariaNgCommonService","ariaNgSettingService","aria2SettingService",function(e,t,a,n,i,s){t.context={host:i.getCurrentRpcUrl(),serverStatus:null,isSupportReconnect:s.canReconnect()},t.reconnect=function(){!t.context.isSupportReconnect||"Disconnected"!==e.taskContext.rpcStatus&&"Waiting to reconnect"!==e.taskContext.rpcStatus||s.reconnect()},t.saveSession=function(){return s.saveSession((function(e){e.success&&"OK"===e.data&&n.showOperationSucceeded("Session has been saved successfully.")}))},t.shutdown=function(){n.confirm("Confirm Shutdown","Are you sure you want to shutdown aria2?","warning",(function(e){e&&e.success&&"OK"===e.data&&n.showOperationSucceeded("Aria2 has been shutdown successfully.")}),!0,null,null,(function(e){s.shutdown((function(t){e(t)}))}))},e.$watch("taskContext.rpcStatus",(function(e){"Connected"===e?(s.getAria2Status((function(e){e.success&&(t.context.serverStatus=e.data)})),s.getSessionInfo((function(e){e.success&&(t.context.sessionInfo=e.data)}))):(t.context.serverStatus=null,t.context.sessionInfo=null)})),e.loadPromise=a((function(){}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("RecommendController",["$rootScope","$scope","$location","$sce","aria2eConstants","ariaNgSettingService",function(e,t,a,n,i,s){let o=a.search().path||"",r=a.hash()?"#"+a.hash():"",l=s.getLanguage()||"en";l="zh_Hans"==l?"":"zh_Hant"==l?"/zh-tw":"/en",t.recommendUrl=n.trustAsResourceUrl(i.recommendOrigin+l+o+r);var c=s.getRecCount();e.recTotal>c&&s.setRecCount(e.recTotal),e.hasNewRec=!1}])}(),function(){"use strict";angular.module("ariaNg").directive("ngAutoFocus",["$timeout",function(e){return{restrict:"A",link:function(t,a){e((function(){a[0].focus()}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngPieceBar",["aria2TaskService",function(e){return{restrict:"E",template:'',replace:!0,scope:{bitField:"=",pieceCount:"=",color:"@"},link:function(t,a){var n=function(){var n=a[0],i=e.getCombinedPieces(t.bitField,t.pieceCount),s=n.getContext("2d");s.fillStyle=t.color||"#000",s.clearRect(0,0,n.width,n.height);for(var o=0,r=n.width,l=n.height,c=0;c',replace:!0,scope:{bitField:"=",pieceCount:"="},link:function(t,a){var n=[],i=[],s=function(){i=e.getPieceStatus(t.bitField,t.pieceCount),n.length=0,a.empty();for(var s=Math.max(1,i.length),o=0;o');n.push(r),a.append(r)}};t.$watch("bitField",(function(){!function(){var a=e.getPieceStatus(t.bitField,t.pieceCount);if(i&&a&&i.length===a.length&&a.length===n.length){for(var o=0;o",scope:{options:"=ngData",theme:"=ngTheme"},link:function(a,n,i){angular.extend({},i);var s=n.find("div"),o=n.parent().height(),r=parseInt(i.height)||o||200;s.css("height",r+"px");var l=echarts.init(s[0],t.get(a.theme)),c=function(){l.resize(),a.$apply()};angular.element(e).on("resize",c),a.$watch("options",(function(e){e&&function(e){l.setOption(e)}(e)}),!0),a.$on("$destroy",(function(){l&&!l.isDisposed()&&l.dispose(),angular.element(e).off("resize",c)}))}}}]).directive("ngPopChart",["$window","chartTheme",function(e,t){return{restrict:"A",scope:{options:"=ngData",theme:"=ngTheme"},link:function(e,a,n){var i={ngPopoverClass:"",ngContainer:"body",ngTrigger:"click",ngPlacement:"top"};angular.extend(i,n);var s=null,o='
';a.popover({container:i.ngContainer,content:'
'+o+"
",html:!0,placement:i.ngPlacement,template:'',trigger:i.ngTrigger}).on("shown.bs.popover",(function(){var a=angular.element(".chart-pop"),i=a.parent().height();a.empty();var o=parseInt(n.height)||i||200;a.css("height",o+"px"),s=echarts.init(a[0],t.get(e.theme))})).on("hide.bs.popover",(function(){s&&!s.isDisposed()&&s.dispose()})).on("hidden.bs.popover",(function(){angular.element(".chart-pop").empty().append(o)}));e.$watch("options",(function(e){e&&function(e){s&&!s.isDisposed()&&s.setOption(e)}(e)}),!0)}}}]).factory("chartTheme",["chartDefaultTheme","chartDarkTheme",function(e,t){var a={defaultTheme:e,darkTheme:t};return{get:function(e){return"default"!==e&&a[e+"Theme"]?angular.extend({},a.defaultTheme,a[e+"Theme"]):a.defaultTheme}}}]).factory("chartDefaultTheme",(function(){return{color:["#74a329","#3a89e9"],legend:{top:"bottom"},toolbox:{show:!1},tooltip:{show:!0,trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",axisPointer:{type:"line",lineStyle:{color:"#233333",type:"dashed",width:1},crossStyle:{color:"#008acd",width:1},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},grid:{x:40,y:20,x2:30,y2:50},categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#f3f3f3"}}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#f3f3f3"}},splitArea:{show:!1}},line:{itemStyle:{normal:{lineStyle:{width:2,type:"solid"}}},smooth:!0,symbolSize:6},textStyle:{fontFamily:"Hiragino Sans GB, Microsoft YaHei, STHeiti, Helvetica Neue, Helvetica, Arial, sans-serif"},animationDuration:500}})).factory("chartDarkTheme",(function(){return{tooltip:{show:!0,trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",axisPointer:{type:"line",lineStyle:{color:"#ddd",type:"dashed",width:1},crossStyle:{color:"#ddd",width:1},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#333"}}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,textStyle:{color:"#eee"}},splitLine:{lineStyle:{color:"#333"}},splitArea:{show:!1}}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngDragenter",(function(){return{restrict:"A",link:function(e,t,a){t.on("dragenter",(function(n){e.$eval(a.ngDragenter,{$event:n,element:t})}))}}})),angular.module("ariaNg").directive("ngDragover",(function(){return{restrict:"A",link:function(e,t,a){t.on("dragover",(function(n){e.$eval(a.ngDragover,{$event:n,element:t})}))}}})),angular.module("ariaNg").directive("ngDragleave",(function(){return{restrict:"A",link:function(e,t,a){t.on("dragleave",(function(n){e.$eval(a.ngDragleave,{$event:n,element:t})}))}}})),angular.module("ariaNg").directive("ngDrop",(function(){return{restrict:"A",link:function(e,t,a){t.on("drop",(function(n){e.$eval(a.ngDrop,{$event:n,element:t})}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngExportCommandApiDialog",["clipboard","ariaNgCommonService",function(e,t){return{restrict:"E",templateUrl:"views/export-command-api-dialog.html",replace:!0,scope:{options:"="},link:function(a,n,i){a.context={trueFalseOptions:[{name:"Enabled",value:!0},{name:"Disabled",value:!1}],baseUrl:t.getFullPageUrl(),commandAPIUrl:null,pauseOnAdded:!0,isCopied:!1};var s=function(){var e=a.context.baseUrl;return e.indexOf("#")>=0&&(e=e.substring(0,e.indexOf("#"))),e},o=function(e){var n=s()+"#!/new/task?url="+t.base64UrlEncode(e.urls[0]);if(a.context.pauseOnAdded&&(n+="&pause=true"),e.options)for(var i in e.options)e.options.hasOwnProperty(i)&&(n+="&"+i+"="+e.options[i]);return n};a.generateCommandAPIUrl=function(){var e,n;a.options&&("new-task"===a.options.type?a.context.commandAPIUrl=function(e){for(var t="",a=0;a0&&(t+="\n"),t+=o(e[a]);return t}(a.options.data):"setting"===a.options.type&&(a.context.commandAPIUrl=(e=a.options.data,n=s()+"#!/settings/rpc/set?protocol="+e.protocol+"&host="+e.rpcHost+"&port="+e.rpcPort+"&interface="+e.rpcInterface,e.secret&&(n+="&secret="+t.base64UrlEncode(e.secret)),n)),a.context.isCopied=!1)},a.copyCommandAPI=function(){e.copyText(a.context.commandAPIUrl,{container:angular.element(n)[0]}),a.context.isCopied=!0},angular.element(n).on("hidden.bs.modal",(function(){a.$apply((function(){a.options=null,a.context.commandAPIUrl=null,a.context.isCopied=!1}))})),a.$watch("options",(function(e){e&&(a.generateCommandAPIUrl(),a.context.isCopied=!1,angular.element(n).modal("show"))}),!0)}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngIndeterminate",(function(){return{restrict:"A",scope:{indeterminate:"=ngIndeterminate"},link:function(e,t){e.$watch("indeterminate",(function(){t[0].indeterminate="true"===e.indeterminate||!0===e.indeterminate}))}}}))}(),angular.module("inputDropdown",[]).directive("inputDropdown",[function(){return{restrict:"E",require:"?ngModel",scope:{defaultDropdownItems:"=",selectedItem:"=",allowCustomInput:"=",inputRequired:"=",disabled:"=",inputName:"@",inputClassName:"@",inputPlaceholder:"@",onlyShowNonEmptyDropdown:"@",filterListMethod:"&",valueChangedMethod:"&",itemSelectedMethod:"&",removeItemMethod:"&"},template:'
  • {{item.readableName}}{{item}}
',controller:["$scope",function(e){this.getSelectedItem=function(){return e.selectedItem},this.isRequired=function(){return e.inputRequired},this.customInputAllowed=function(){return e.allowCustomInput},this.getInput=function(){return e.inputValue}}],link:function(e,t,a,n){var i=!1,s=t.find("input").isolateScope();e.activeItemIndex=0,e.inputValue="",e.dropdownVisible=!1,e.dropdownItems=e.defaultDropdownItems||[],n&&e.$watch((function(){return n.$viewValue}),(function(t){e.inputValue=t})),e.$watch("dropdownItems",(function(t,a){angular.equals(t,a)||(e.allowCustomInput?e.setInputActive():e.setActive(0))})),e.$watch("selectedItem",(function(t,a){s.updateInputValidity(),angular.equals(t,a)||t&&(e.inputValue="string"==typeof t?t:t.readableName)})),e.setInputActive=function(){e.setActive(-1)},e.setActive=function(t){e.activeItemIndex=t},e.inputChange=function(){if(e.selectedItem=null,o(),u(e.inputValue,"input"),e.inputValue){if(e.allowCustomInput&&s.updateInputValidity(),e.filterListMethod){var t=e.filterListMethod({userInput:e.inputValue});t&&t.then((function(t){e.dropdownItems=t}))}}else e.dropdownItems=e.defaultDropdownItems||[]},e.inputFocus=function(){e.allowCustomInput?e.setInputActive():e.setActive(0),o()},e.inputBlur=function(e){i?i=!1:r()},e.dropdownPressed=function(){i=!0},e.selectItem=function(t){e.selectedItem=t,r(),u(t,"select"),e.itemSelectedMethod&&e.itemSelectedMethod({item:t})},e.removeItem=function(t,a){if(e.removeItemMethod&&e.dropdownItems.length>0){let n=e.dropdownItems.indexOf(a);e.dropdownItems.splice(n,1),e.removeItemMethod({$event:t,item:a})}};var o=function(){(!e.onlyShowNonEmptyDropdown||e.dropdownItems&&e.dropdownItems.length)&&(e.dropdownVisible=!0)},r=function(){e.dropdownVisible=!1},l=function(){var t=e.activeItemIndex-1;t>=0?e.setActive(t):e.allowCustomInput&&e.setInputActive()},c=function(){var t=e.activeItemIndex+1;t=0&&e.activeItemIndex0&&-1!==e.activeItemIndex&&(t.preventDefault(),e.$apply(d));break;case 9:e.dropdownVisible&&e.dropdownItems&&e.dropdownItems.length>0&&-1!==e.activeItemIndex&&e.$apply(d)}}))}}}]),angular.module("inputDropdown").directive("inputDropdownValidator",(function(){return{require:["^inputDropdown","ngModel"],restrict:"A",scope:{},link:function(e,t,a,n){var i=n[0],s=n[1];e.updateInputValidity=function(){var e=i.getSelectedItem(),t=!1;i.isRequired()?(i.customInputAllowed()&&i.getInput()||e)&&(t=!0):t=!0,s.$setValidity("itemSelectedValid",t)}}}})),function(){"use strict";angular.module("ariaNg").directive("ngPlaceholder",(function(){return{restrict:"A",scope:{placeholder:"=ngPlaceholder"},link:function(e,t){e.$watch("placeholder",(function(){t[0].placeholder=e.placeholder}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngSetting",["$timeout","$q","ariaNgConstants","ariaNgLocalizationService","ariaNgKeyboardService","aria2SettingService",function(e,t,a,n,i,s){return{restrict:"E",templateUrl:"views/setting.html",require:"?ngModel",replace:!0,scope:{option:"=",ngModel:"=",enhanced:"<",defaultValue:"=?",fixedValue:"=?",onChangeValue:"&"},link:function(o,r,l,c){var d=null,u={showPlaceholderCount:!1,deleteKeyAlwaysChangeValue:!1,lazySaveTimeout:o.option.lazySaveTimeout||a.lazySaveTimeout,errorTooltipPlacement:"top",errorTooltipDelay:a.errorTooltipDelay};angular.extend(u,l);var p,f=function(){o.option&&o.option.showHistory&&(o.history=s.getSettingHistory(o.option.key))},g=function(){angular.element(r).tooltip("dispose")},m=function(t,a,i){t&&e((function(){var e=o.optionStatus.getValue();"failed"!==e&&"error"!==e||angular.element(r).tooltip({animation:!1,title:n.getLocalizedText(t,i),trigger:"focus",placement:u.errorTooltipPlacement,container:r,template:''}).tooltip("show")}),u.errorTooltipDelay)},h=function(e,t,a){if(!e||!t||!angular.isString(e))return 0;var n=e.split(t),i=n.length;if(a)for(var s=0;so.option.max)return void o.optionStatus.setError("Input number is above max value!",{value:o.option.max})}if(""===t||!angular.isDefined(o.option.pattern)||new RegExp(o.option.pattern).test(t)){var i={key:o.option.key,value:t,optionStatus:o.optionStatus},s=function(){o.optionStatus.setSaving(),o.onChangeValue(i)};o.onChangeValue&&(a?(o.optionStatus.setPending(),d=e((function(){s()}),u.lazySaveTimeout)):s())}else o.optionStatus.setError("Input value is invalid!")}else o.optionStatus.setError("Input number is invalid!");else o.optionStatus.setError("Input number is invalid!")},o.inputKeyUp=function(e,t){if((!0===u.deleteKeyAlwaysChangeValue||"true"===u.deleteKeyAlwaysChangeValue)&&(i.isBackspacePressed(e)||i.isDeletePressed(e))){if(o.optionValue&&""!==o.optionValue)return;o.changeValue("",t)}},o.filterHistory=function(e){var a=[];if(o.history&&e)for(var n=0;n0;i.$setValidity("invalidUrls",s)}}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngBlobDownload",["ariaNgFileService",function(e){return{restrict:"A",scope:{ngBlobDownload:"=ngBlobDownload",ngFileName:"@",ngContentType:"@"},link:function(t,a){t.$watch("ngBlobDownload",(function(n){n&&e.saveFileContent(n,a,{fileName:t.ngFileName,contentType:t.ngContentType})}))}}}])}(),function(){"use strict";angular.module("ariaNg").filter("dateDuration",["moment",function(e){return function(t,a,n){var i=e.duration(t,a);return e.utc(i.asMilliseconds()).format(n)}}])}(),function(){"use strict";angular.module("ariaNg").filter("fileOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a)||!n)return a;var i=t.parseOrderType(n);return null===i?a:"index"===i.type?e("orderBy")(a,["index"],i.reverse):"name"===i.type?e("orderBy")(a,["fileName"],i.reverse):"size"===i.type?e("orderBy")(a,["length"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"selected"===i.type?e("orderBy")(a,["selected"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("logOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a)||!n)return a;var i=t.parseOrderType(n);return null===i?a:"time"===i.type?e("orderBy")(a,["time"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("longDate",["ariaNgCommonService","ariaNgLocalizationService",function(e,t){return function(a){var n=t.getLongDateFormat();return e.formatDateTime(a,n)}}])}(),function(){"use strict";angular.module("ariaNg").filter("peerOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a))return a;var i=t.parseOrderType(n);return null===i?a:"address"===i.type?e("orderBy")(a,["ip","port"],i.reverse):"client"===i.type?e("orderBy")(a,["client.name","client.version"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"dspeed"===i.type?e("orderBy")(a,["downloadSpeed"],i.reverse):"uspeed"===i.type?e("orderBy")(a,["uploadSpeed"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("percent",["$filter",function(e){return function(t,a){var n=Math.pow(10,a),i=parseInt(t*n)/n;return e("number")(i,a)}}])}(),function(){"use strict";angular.module("ariaNg").filter("reverse",(function(){return function(e){return e?e.slice().reverse():e}}))}(),function(){"use strict";angular.module("ariaNg").filter("taskOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a))return a;var i=t.parseOrderType(n);return null===i?a:"name"===i.type?e("orderBy")(a,["taskName"],i.reverse):"size"===i.type?e("orderBy")(a,["totalLength"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"remain"===i.type?e("orderBy")(a,["idle","remainTime","remainLength"],i.reverse):"dspeed"===i.type?e("orderBy")(a,["downloadSpeed"],i.reverse):"uspeed"===i.type?e("orderBy")(a,["uploadSpeed"],i.reverse):"default"===i.type?e("orderBy")(a,["groupIndex"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("taskStatus",(function(){return function(e,t){return e?"active"===e.status?e.verifyIntegrityPending?"Pending Verification":e.verifiedLength?e.verifiedPercent?"format.task.verifying-percent":"Verifying":!0===e.seeder||"true"===e.seeder?"Seeding":"Downloading":t||"waiting"!==e.status?t||"paused"!==e.status?t||"complete"!==e.status?t||"error"!==e.status?t||"removed"!==e.status?"":"Removed":e.errorCode?"format.task.error-occurred":"Error Occurred":"Completed":"Paused":"Waiting":""}}))}(),function(){"use strict";angular.module("ariaNg").filter("groupTask",(function(){return function(e){if(!angular.isArray(e))return e;let t=-1;for(const a in e){switch(e[a].status){case"active":t=1;break;case"waiting":t=2;break;case"paused":t=3;break;case"error":t=4;break;case"complete":t=5;break;case"removed":t=6;break;default:t=10}e[a].groupIndex=t}return e}}))}(),function(){"use strict";angular.module("ariaNg").filter("timeDisplayName",["ariaNgCommonService","ariaNgLocalizationService",function(e,t){return function(a,n){if(!a)return t.getLocalizedText(n);var i=e.getTimeOption(a);return t.getLocalizedText(i.name,{value:i.value})}}])}(),function(){"use strict";angular.module("ariaNg").filter("readableVolume",["$filter",function(e){var t=["B","KB","MB","GB"];return function(a,n){var i=t[0],s=2,o=!1;angular.isNumber(n)?s=n:"auto"===n&&(o=!0),a||(a=0),angular.isNumber(a)||(a=parseInt(a));for(var r=1;r=1024;r++)a/=1024,i=t[r];return o&&(s=function(e){return e<1?2:e<10?1:0}(a)),(a=e("number")(a,s))+" "+i}}])}(),function(){"use strict";angular.module("ariaNg").factory("SweetAlert",(function(){return{swal:function(e,t){Swal.fire(e).then((e=>t(e)))},close:function(){Swal.close()}}}))}(),function(){"use strict";angular.module("ariaNg").provider("ariaNgAssetsCacheService",[function(){var e={},t="languages.";this.getLanguageAsset=function(a){return function(t){for(var a=t.split("."),n=e,i=0;i0&&"\\"!==e.charAt(t-1)&&"="===e.charAt(t))return{key:e.substring(0,t).replace("\\=","="),value:e.substring(t+1,e.length).replace("\\=","=")};return{value:e}},c=function(e,t){var a=e;if(!t)return a;if("["===t[0]&&"]"===t[t.length-1]&&(t=t.substring(1,t.length-1)),"global"===t)return a;for(var n=t.split("."),i=0;ie.toString(16).padStart(2,"0"))).join(""),length:s-t+o}}};return{getFullPageUrl:function(){return e.location.protocol+"//"+e.location.host+e.location.pathname+(e.location.search?e.location.search:"")},base64Encode:function(e){return n.encode(e)},base64Decode:function(e){return n.decode(e)},base64UrlEncode:function(e){return n.urlencode(e)},base64UrlDecode:function(e){return n.urldecode(e)},generateUniqueId:function(){var e=o.appPrefix+"_"+Math.round((new Date).getTime()/1e3)+"_"+Math.random();return this.base64Encode(e)},showDialog:function(e,t,n,i,o){o||(o={}),e&&(e=r.getLocalizedText(e)),t&&(t=r.getLocalizedText(t,o.textParams)),o.confirmButtonText=r.getLocalizedText("OK"),function(e,t,n,i,o){a((function(){s.swal({title:e,text:t,icon:n,reverseButtons:!0,inputAutoFocus:!1,confirmButtonText:o&&o.confirmButtonText||null},(function(){i&&i()}))}),100)}(e,t,n,i,o)},showInfo:function(e,t,a,n){this.showDialog(e,t,"info",a,n)},showError:function(e,t,a){this.showDialog("Error",e,"error",t,a)},showOperationSucceeded:function(e,t){this.showDialog("Operation Succeeded",e,"success",t)},confirm:function(e,t,a,n,i,o,l,c){o||(o={}),e&&(e=r.getLocalizedText(e)),t&&(t=r.getLocalizedText(t,o.textParams)),o.inputPlaceholder&&(o.inputPlaceholder=r.getLocalizedText(o.inputPlaceholder)),o.confirmButtonText=r.getLocalizedText("OK"),o.cancelButtonText=r.getLocalizedText("Cancel"),function(e,t,a,n,i,o,r,l){var c={title:e,text:t,icon:a,showCancelButton:!0,reverseButtons:!0,showLoaderOnConfirm:!!i,preConfirm:l?function(){return new Promise(l)}:null,inputAutoFocus:!1,input:o&&o.input||null,inputValue:o&&o.inputValue||null,inputPlaceholder:o&&o.inputPlaceholder||null,confirmButtonText:o&&o.confirmButtonText||null,cancelButtonText:o&&o.cancelButtonText||null};"warning"===a&&(c.confirmButtonColor="#F39C12"),s.swal(c,(function(e){e.isConfirmed?n&&n(e.value):r&&r(e.value)}))}(e,t,a,n,i,o,l,c)},closeAllDialogs:function(){s.close()},getFileExtension:function(e){return!e||e.lastIndexOf(".")<0?e:e.substring(e.lastIndexOf("."))},getFileExtensionFromUrl:function(e){let t=".";try{let a=new URL(e).pathname.split("/").pop();t+=a.includes(".")?a.split(".").pop():""}catch(e){t="."}return t},parseUrlsFromOriginInput:function(e,t){if(!e)return[];for(var a=e.split("\n"),n=[],i=0;i2?a.slice(-t-1,-1).join("/")+"/":""},parseTorrentInfo:function(e){return c(new Uint8Array(e))},base64ToArrayBuffer:function(e){return function(e){if(!angular.isString(e))return null;const t=e.split(",")[1]||e,a=atob(t),n=a.length,i=new ArrayBuffer(n),s=new Uint8Array(i);for(let e=0;e10&&e.splice(0,e.length-10),i.set(a.browserNotificationHistoryStorageKey,e)}},p=function(t,s){e.Notification&&c(d())&&(function(){if(!r.getBrowserNotificationFrequency()||"unlimited"===r.getBrowserNotificationFrequency())return!1;var e=i.get(a.browserNotificationHistoryStorageKey)||[];if(!angular.isArray(e))return!1;if(e.length<1)return!1;var t=null,s=!1;if("high"===r.getBrowserNotificationFrequency()){if(e.length<10)return!1;t=e[e.length-10].time,s=n.isUnixTimeAfter(t,"-1","minute")}else"middle"===r.getBrowserNotificationFrequency()?(t=e[e.length-1].time,s=n.isUnixTimeAfter(t,"-1","minute")):"low"===r.getBrowserNotificationFrequency()&&(t=e[e.length-1].time,s=n.isUnixTimeAfter(t,"-5","minute"));return s&&o.debug("[ariaNgNotificationService.isReachBrowserNotificationFrequencyLimit] reach frequency limit"+(t?", the oldest time is "+t:"")),s}()||(chrome?.runtime?.id?(s={type:"basic",iconUrl:"tileicon.png",title:t,silent:s.silent??!1,message:s.body},u(),chrome.notifications.create(s)):(s=angular.extend({icon:"tileicon.png"},s),u(),new e.Notification(t,s))))};return{isSupportBrowserNotification:function(){return l},hasBrowserPermission:function(){return!!l&&c(d())},requestBrowserPermission:function(t){l&&function(t){e.Notification&&e.Notification.requestPermission((function(e){t&&t({granted:c(e),permission:e})}))}((function(e){e.granted||r.setBrowserNotification(!1),t&&t(e)}))},notifyViaBrowser:function(e,t,a){return a||(a={}),e&&(e=s.getLocalizedText(e,a.titleParams)),t&&(t=s.getLocalizedText(t,a.contentParams)),function(e,t,a){a||(a={}),a.body=t,r.getBrowserNotificationSound()||(a.silent=!0),l&&r.getBrowserNotification()&&p(e,a)}(e,t,a)},notifyTaskComplete:function(e){this.notifyViaBrowser("Download Completed",e&&e.taskName?e.taskName:"")},notifyBtTaskComplete:function(e){this.notifyViaBrowser("BT Download Completed",e&&e.taskName?e.taskName:"")},notifyTaskError:function(e){this.notifyViaBrowser("Download Error",e&&e.taskName?e.taskName:"")},notifyInPage:function(e,a,n){return n||(n={}),e&&(e=s.getLocalizedText(e,n.titleParams)),a&&(a=s.getLocalizedText(a,n.contentParams),n.contentPrefix&&(a=n.contentPrefix+a)),function(e,a,n){return n||(n={}),a?(n.title=e,n.message=a):n.message=e,n.type&&t[n.type]||(n.type="primary"),n.positionY||(n.positionY="top"),t[n.type](n)}(e,a,n)},clearNotificationInPage:function(){t.clearAll()}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLocalizationService",["$translate","amMoment",function(e,t){return{applyLanguage:function(a){return e.use(a),t.changeLocale(a),!0},getLocalizedText:function(t,a){return e.instant(t,a)},getLongDateFormat:function(){return this.getLocalizedText("format.longdate")}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLogService",["$log","ariaNgConstants",function(e,t){var a={DEBUG:1,INFO:2,WARN:3,ERROR:4},n=0,i=!1,s=[],o=function(e,a,o){i&&(s.length>=t.cachedDebugLogsLimit&&s.shift(),s.push(function(e,t,a){return{id:++n,time:new Date,level:t,content:e,attachment:a}}(e,a,o)))};return{setEnableDebugLog:function(e){i=e},compareLogLevel:function(e,t){var n=a[e],i=a[t];return n||(n=0),i||(i=0),n>i?1:n=0&&n.push(a[i]);return n}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgFileService",["$window",function(e){var t=!!e.FileReader,a=!!e.Blob;return{isSupportFileReader:function(){return t},isSupportBlob:function(){return a},openFileContent:function(e,a,n,i){t?(e=angular.extend({scope:null,fileFilter:null,fileType:"binary",successCallback:a,errorCallback:n},e),i&&i.change||(i=angular.element('')),i.data("options",e),e.fileFilter&&i.attr("accept",e.fileFilter),i.val(""),"true"!==i.attr("data-ariang-file-initialized")&&i.change((function(){if(this.files&&!(this.files.length<1)){var e=i.data("options"),t=function(e){var t=[];if(!e||e.length<1)return t.push(/.+$/),t;for(var a=e.split(","),n=0;n')),t.attr("href",s),n.fileName&&t.attr("download",n.fileName),n.autoTrigger&&t.trigger("click"),n.autoRevoke&&URL.revokeObjectURL(s)}}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgSettingService",["$window","$location","$filter","ariaNgConstants","ariaNgDefaultOptions","ariaNgLanguages","ariaNgCommonService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r,l){var c={localStorage:l.isLocalStorageSupported(),cookies:l.isCookiesSupported()},d=c.localStorage||c.cookies,u=!!e.matchMedia&&e.matchMedia("(prefers-color-scheme: dark)")&&"not all"!==e.matchMedia("(prefers-color-scheme: dark)").media&&angular.isFunction(e.matchMedia("(prefers-color-scheme: dark)").addEventListener),p=[],f=!1,g={debugMode:!1},m=function(e){for(var t in s)if(s.hasOwnProperty(t)){if(t.toLowerCase()===e.toLowerCase())return t;var a=s[t].aliases;if(angular.isArray(a)&&!(a.length<1))for(var n=0;n1){var a,n=t.split("-");if(t=n[0]+"-"+n[1],!s[t])(a=m(t))&&(t=a)}return s[t]?(r.info('[ariaNgSettingService] use browser language "'+t+'" as current language'),t):(r.info('[ariaNgSettingService] browser language "'+t+'" not support, use default language'),i.language)},v=function(e){return l.set(n.optionStorageKey,e)},b=function(){var e,t=l.get(n.optionStorageKey);if(t&&!s[t.language]&&(t.language=(e=t.language,m(e)||h())),!t){if((t=angular.extend({},i)).language=h(),t.rpcHost||w(t),angular.isArray(t.extendRpcServers))for(var a=0;a"+n.getLocalizedText("No Data")+"";var i=a.getLongTimeFromUnixTime(t[0].name),s=e("readableVolume")(t[0].value)+"/s";return'
'+i+'
'+(e("readableVolume")(t[1].value)+"/s")+'
'+s+"
"}},xAxis:{data:[],type:"category",boundaryGap:!1,axisLabel:{show:!1}},yAxis:{type:"value",axisLabel:{formatter:function(t){return e("readableVolume")(t,"auto")}}},series:[{type:"line",areaStyle:{normal:{opacity:.1}},smooth:!0,symbolSize:6,showAllSymbol:!1,data:[]},{type:"line",areaStyle:{normal:{opacity:.1}},smooth:!0,symbolSize:6,showAllSymbol:!1,data:[]}]},o=i.xAxis.data,l=i.series[0].data,c=i.series[1].data,d=0;d=r(e)&&(n.shift(),i.shift(),o.shift()),n.push(t.time),i.push(t.uploadSpeed),o.push(t.downloadSpeed)}(e,t)},getStatsData:function(e){return c(e)||l(e),function(e){return s[e]}(e)},getEmptyStatsData:function(e){return c(e)&&function(e){delete s[e]}(e),this.getStatsData(e)},recordGlobalStat:function(e){this.recordStat(o,e),i=e},getGlobalStatsData:function(){return this.getStatsData(o)},getCurrentGlobalStat:function(){return i}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgTitleService",["$filter","ariaNgConstants","ariaNgLocalizationService","ariaNgSettingService",function(e,t,a,n){var i=function(e){if(!e)return{};for(var t=e.substring(2,e.length-1).split(":"),a={oldValue:e},n=1;n0)for(var r=0;r0&&(n+="&"),(angular.isObject(s)||angular.isArray(s))&&(s=angular.toJson(s),s=a.base64Encode(s),s=encodeURIComponent(s)),n+=i+"="+s)}return n.length<1?e:(n=e.indexOf("?")<0?"?"+n:"&"+n,e+n)}(l.url,n.requestBody)),r)for(var c=r.split("\n"),d=0;d0?e.params[0]:null)}}(t))}else e.request&&function(e){var t=angular.fromJson(e);if(t){var a=t.id;if(a){var n=c[a];if(n){var i=n.context;n.deferred.reject({success:!1,context:i}),i.errorCallback&&(s.debug("[aria2WebSocketRpcService.processRequestFailed] "+(i&&i.requestBody&&i.requestBody.method?i.requestBody.method+" ":"")+"request failed"),i.errorCallback(i.id,{message:"Cannot connect to aria2!"})),delete c[a]}}}}(e.request)})),r.onOpen((function(t){s.debug("[aria2WebSocketRpcService.onOpen] websocket is opened",t),e&&e.connectionSuccessCallback&&e.connectionSuccessCallback({rpcUrl:o})})),r.onClose((function(t){for(var a in s.warn("[aria2WebSocketRpcService.onClose] websocket is closed",t),c)if(c.hasOwnProperty(a)){var n=c[a];n?(n.deferred.reject({success:!1,context:n.context}),s.debug("[aria2WebSocketRpcService.socketClient.onClose] reject old request",n.context),n.context.errorCallback(n.context.id,{message:"Cannot connect to aria2!"}),delete c[a]):delete c[a]}var r=i.getWebSocketReconnectInterval()>0;r&&f(e),r&&e&&e.connectionWaitingToReconnectCallback?e.connectionWaitingToReconnectCallback({rpcUrl:o}):e&&e.connectionFailedCallback&&e.connectionFailedCallback({rpcUrl:o})}))}catch(e){return{success:!1,error:"Cannot initialize WebSocket!",exception:e}}return{success:!0,instance:r}},p=function(e){e&&r&&(e.connectionReconnectingCallback&&e.connectionReconnectingCallback({rpcUrl:o}),r.reconnect())},f=function(e){l?s.warn("[aria2WebSocketRpcService.planToReconnect] another reconnection is pending"):(l=a((function(){return null==r?(s.warn("[aria2WebSocketRpcService.planToReconnect] websocket is null"),void(l=null)):0===r.readyState||1===r.readyState?(s.warn("[aria2WebSocketRpcService.planToReconnect] websocket current state is already "+r.readyState),void(l=null)):(p(e),void(l=null))}),i.getWebSocketReconnectInterval()),s.debug("[aria2WebSocketRpcService.planToReconnect] next reconnection is pending in "+i.getWebSocketReconnectInterval()+"ms"))};return{request:function(t){if(t){var a=u({connectionSuccessCallback:t.connectionSuccessCallback,connectionFailedCallback:t.connectionFailedCallback,connectionReconnectingCallback:t.connectionReconnectingCallback,connectionWaitingToReconnectCallback:t.connectionWaitingToReconnectCallback}),n=t.uniqueId,i=angular.toJson(t.requestBody);s.debug("[aria2WebSocketRpcService.request] "+(t&&t.requestBody&&t.requestBody.method?t.requestBody.method+" ":"")+"request start",t);var o=e.defer();return a.instance?(c[n]={context:t,deferred:o},a.instance.send(i)):(o.reject({success:!1,context:t}),s.debug("[aria2WebSocketRpcService.request] client error",a),t.errorCallback(t.id,{message:a.error})),o.promise}},reconnect:function(e){p(e)},on:function(e,t){var a=d[e];angular.isArray(a)||(a=d[e]=[]),a.push(t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2RpcService",["$location","$q","aria2RpcConstants","aria2RpcErrors","aria2AllOptions","ariaNgCommonService","ariaNgLogService","ariaNgSettingService","ariaNgNotificationService","aria2HttpRpcService","aria2WebSocketRpcService",function(e,t,a,n,i,s,o,r,l,c,d){var u=r.isCurrentRpcUseWebSocket()?d:c,p=!1,f=r.getCurrentRpcSecret(),g=[],m=[],h=[],v=[],b=[],k=[],y=[],w=[],S=[],x=[],T=[],C=[],P=[],D=function(e){return 0===e.indexOf(a.rpcSystemServiceName+".")},R=function(e){return a.rpcServiceName+"."+e},A=function(e,t){if(t)return e;var n=s.generateUniqueId(),i={uniqueId:n,requestBody:{jsonrpc:a.rpcServiceVersion,method:e.methodName,id:n,params:e.params},connectionSuccessCallback:e.connectionSuccessCallback,connectionFailedCallback:e.connectionFailedCallback,connectionReconnectingCallback:e.connectionReconnectingCallback,connectionWaitingToReconnectCallback:e.connectionWaitingToReconnectCallback,successCallback:e.successCallback,errorCallback:e.errorCallback};return u.request(i)},I=function(e,t){var a=function(e){return R(e)}(e);u.on(a,(function(e){if(angular.isArray(t)&&!(t.length<1))for(var a=0;a1){var l=arguments[1];o.successCallback=function(e,t){if(l.callback&&l.callback({id:e,success:!0,data:t,context:l}),O(m),!p){p=!0;var a={rpcName:r.getCurrentRpcDisplayName()};O(g,a)}},o.errorCallback=function(t,a){var i=!1,s=e.path();l.silent||s!==n||(i=L(a)),l.callback&&l.callback({id:t,success:!1,data:a,errorProcessed:i,context:l}),O(h)}}if(arguments.length>2)for(var c=2;c0&&(o.params=s),o},U=function(e,t){var a=angular.copy(e);for(var n in a)a.hasOwnProperty(n)&&M(a,n)&&(a[n]=q(a[n],i[n]));return t&&t.pauseOnAdded&&(a.pause="true"),a},M=function(e,t){return!(!e[t]||!angular.isString(e[t]))&&!(!i[t]||"array"!==i[t].submitFormat)},q=function(e,t){for(var a=e.split(t.separator),n=[],i=0;i0&&(t=e.uris[0].uri,a=!0);var n=t.lastIndexOf("/");if(n<0&&(n=t.lastIndexOf("\\")),n<=0||n===t.length)return t;var i=t.substring(n+1),s=i.indexOf("?"),o=i;if(s>0&&(o=i.substring(0,s)),a)try{o=decodeURI(o)}catch(e){r.warn("[aria2TaskService.getFileName] failed to url decode file name, original file name: "+o,e)}return o},d=function(e,t){var n=e.dir,i=t.path;n&&(n=n.replace(/\\/g,a.defaultPathSeparator)),i&&(i=i.replace(/\\/g,a.defaultPathSeparator));var s=function(){i.length>1&&i.charAt(0)===a.defaultPathSeparator&&(i=i.substr(1))};if(n&&0===i.indexOf(n)&&(i=i.substr(n.length)),s(),e.bittorrent&&"multi"===e.bittorrent.mode&&e.bittorrent.info&&e.bittorrent.info.name){var o=e.bittorrent.info.name;0===i.indexOf(o)&&(i=i.substr(o.length))}return s(),t.fileName&&i.lastIndexOf(t.fileName)+t.fileName.length===i.length&&(i=i.substr(0,i.length-t.fileName.length)),i.length>1&&i.charAt(i.length-1)===a.defaultPathSeparator&&(i=i.substr(0,i.length-1)),i},u=function(e,t,n){var i=n[e];if(i)return i;var s=null,o=e;if(e.length){var r="",l=e.lastIndexOf(a.defaultPathSeparator);l>0&&(r=e.substring(0,l),o=e.substring(l+1)),s=u(r,t,n)}return i={isDir:!0,nodePath:e,nodeName:o,relativePath:s&&s.nodePath||"",level:s&&s.level+1||0,length:0,selected:!0,partialSelected:!1,files:[],subDirs:[]},t.push(i),n[e]=i,s&&s.subDirs.push(i),i},p=function(e,t,a){if(e&&t&&a){var n=e.relativePath||"",i=u(n,t,a);return i.files.push(e),i}},f=function(e,t,a){if(e){var n=0,i=0,s=0;if(e.subDirs&&e.subDirs.length)for(var o=0;o0&&i===e.subDirs.length+e.files.length,e.partialSelected=i>0&&i0}},g=function(e,t){for(var a=[],n=0;n=t)return a}return a},m=function(e,t){if(!e)return r.warn("[aria2TaskService.processDownloadTask] task is null"),e;t=t&&e.bittorrent&&"multi"===e.bittorrent.mode;var a,i,l=g(e.bitfield,e.numPieces);if(e.totalLength=parseInt(e.totalLength),e.completedLength=parseInt(e.completedLength),e.completePercent=e.totalLength>0?e.completedLength/e.totalLength*100:0,e.remainLength=e.totalLength-e.completedLength,e.remainPercent=100-e.completePercent,e.uploadLength=e.uploadLength?parseInt(e.uploadLength):0,e.shareRatio=e.completedLength>0?e.uploadLength/e.completedLength:0,e.uploadSpeed=parseInt(e.uploadSpeed),e.downloadSpeed=parseInt(e.downloadSpeed),e.numPieces=parseInt(e.numPieces),e.completedPieces=s.countArray(l,!0),e.pieceLength=parseInt(e.pieceLength),e.idle=0===e.downloadSpeed,e.remainTime=(a=e.remainLength,0===(i=e.downloadSpeed)?0:a/i),e.seeder=!0===e.seeder||"true"===e.seeder,e.verifiedLength&&e.files){let t=0;e.files.forEach((e=>{t+=e.length})),e.verifiedPercent=t>0?parseInt(e.verifiedLength/t*100):void 0}else e.verifiedPercent=void 0;e.dir=s.formatFilePath(e.dir);var u=function(e){var t="",a=!0;return e.bittorrent&&e.bittorrent.info&&(t=e.bittorrent.info.name),e.bittorrent&&e.files.length>0&&e.files[0].path.includes("[METADATA]")&&(e.files[0].path=e.dir+e.files[0].path.replace("[METADATA]","")+".torrent"),!t&&e.files&&e.files.length>0&&(t=c(e.files[0])),t||(t=o.getLocalizedText("Unknown"),a=!1),{name:t,success:a}}(e);if(e.taskName=u.name,e.hasTaskName=u.success,e.errorDescription=function(e){return e.errorCode&&n[e.errorCode]&&n[e.errorCode].descriptionKey?n[e.errorCode].hide?"":n[e.errorCode].descriptionKey:""}(e),e.files){for(var m=0,h=[],v={},b=0;b0?k.completedLength/k.length*100:0,t){k.relativePath=d(e,k);var y=p(k,h,v);k.level=y.level+1}m+=k.selected?1:0}if(t&&h.length>1){var w=[];f(v[""],v,w),e.files=w,e.multiDir=!0}e.selectedFileCount=m}if(e.files&&1===e.files.length&&e.files[0].uris&&e.files[0].uris[0]){var S=!0,x=e.files[0].uris[0].uri;for(b=0;b0&&(i+=","),i+=t[s];return this.setTaskOption(e,"select-file",i,a,n)},getBtTaskPeers:function(e,t,a,n){return i.getPeers({gid:e.gid,silent:!!a,callback:function(a){t?(a.success&&h(a.data,e,n),t(a)):r.warn("[aria2TaskService.getBtTaskPeers] callback is null")}})},getTaskStatusAndBtPeers:function(e,t,a,n,s,o){var l=[i.tellStatus({gid:e},!0)];return n&&l.push(i.getPeers({gid:e},!0)),i.multicall({methods:l,silent:!!a,callback:function(e){t?(e.task={},e.success&&e.data.length>0&&(e.task=e.data[0][0],m(e.task,o)),e.success&&e.task.bittorrent&&e.data.length>1&&(e.peers=e.data[1][0],h(e.peers,e.task,s)),t(e)):r.warn("[aria2TaskService.getTaskStatusAndBtPeers] callback is null")}})},newUriTask:function(e,t,a,n){return i.addUri({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newUriTasks:function(e,t,a,n){return i.addUriMulti({tasks:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newTorrentTask:function(e,t,a,n){return i.addTorrent({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newMetalinkTask:function(e,t,a,n){return i.addMetalink({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},startTasks:function(e,t,a){return i.unpauseMulti({gids:e,silent:!!a,callback:t})},pauseTasks:function(e,t,a){return i.forcePauseMulti({gids:e,silent:!!a,callback:t})},retryTask:function(t,a,n){var s=e.defer(),o=[i.tellStatus({gid:t},!0),i.getOption({gid:t},!0)],c=null,d=null;return i.multicall({methods:o,silent:!!n,callback:function(e){if(!a)return void r.warn("[aria2TaskService.retryTask] callback is null");if(!e.success)return r.warn("[aria2TaskService.retryTask] response is not success",e),s.reject(e),void a(e);if(e.data.length>0&&(c=e.data[0][0]),e.data.length>1&&(d=e.data[1][0]),!c||!d||!c.files||1!==c.files.length||c.bittorrent)return c||r.warn("[aria2TaskService.retryTask] task is null"),d||r.warn("[aria2TaskService.retryTask] options is null"),c.files||r.warn("[aria2TaskService.retryTask] task file is null"),1!==c.files.length&&r.warn("[aria2TaskService.retryTask] task file length is not equal 1"),c.bittorrent&&r.warn("[aria2TaskService.retryTask] task is bittorrent"),s.reject(t),void a({success:!1});for(var o=c.files[0],u=[],p=0;p0&&u.push(i.forceRemoveMulti({gids:r,removeFile:o,silent:!!n,callback:function(e){s.pushArrayTo(g,e.results),p=p||e.hasSuccess,f=f||e.hasError}})),l.length>0&&u.push(i.removeDownloadResultMulti({gids:l,removeFile:o,silent:!!n,callback:function(e){s.pushArrayTo(g,e.results),p=p||e.hasSuccess,f=f||e.hasError}})),e.all(u).then((function(){a&&a({hasSuccess:!!p,hasError:!!f,remainsStoppedTask:!!c,results:g})}))},changeTaskPosition:function(e,t,a,n){return i.changePosition({gid:e,pos:t,how:"POS_SET",silent:!!n,callback:a})},clearStoppedTasks:function(e,t){return i.purgeDownloadResult({silent:!!t,callback:e})},onConnectionSuccess:function(e){e?i.onConnectionSuccess({callback:e}):r.warn("[aria2TaskService.onConnectionSuccess] callback is null")},onConnectionFailed:function(e){e?i.onConnectionFailed({callback:e}):r.warn("[aria2TaskService.onConnectionFailed] callback is null")},onConnectionReconnecting:function(e){e?i.onConnectionReconnecting({callback:e}):r.warn("[aria2TaskService.onConnectionReconnecting] callback is null")},onConnectionWaitingToReconnect:function(e){e?i.onConnectionWaitingToReconnect({callback:e}):r.warn("[aria2TaskService.onConnectionWaitingToReconnect] callback is null")},onFirstSuccess:function(e){e?i.onFirstSuccess({callback:e}):r.warn("[aria2TaskService.onFirstSuccess] callback is null")},onOperationSuccess:function(e){e?i.onOperationSuccess({callback:e}):r.warn("[aria2TaskService.onOperationSuccess] callback is null")},onOperationError:function(e){e?i.onOperationError({callback:e}):r.warn("[aria2TaskService.onOperationError] callback is null")},onTaskCompleted:function(e){e?i.onDownloadComplete({callback:v(this.getTaskStatus,e,"completed")}):r.warn("[aria2TaskService.onTaskCompleted] callback is null")},onBtTaskCompleted:function(e){e?i.onBtDownloadComplete({callback:v(this.getTaskStatus,e,"btcompleted")}):r.warn("[aria2TaskService.onBtTaskCompleted] callback is null")},onTaskErrorOccur:function(e){e?i.onDownloadError({callback:v(this.getTaskStatus,e,"error")}):r.warn("[aria2TaskService.onTaskErrorOccur] callback is null")},processDownloadTasks:function(e,t){if(angular.isArray(e))for(var a=0;a0&&n[n.length-1].isCompleted===s?n[n.length-1].count++:n.push({isCompleted:s,count:1})}return n}(e,t)},estimateHealthPercentFromPeers:function(e,t){if(!e||e.numPieces<1||t.length<1)return r.warn("[aria2TaskService.estimateHealthPercentFromPeers] tasks is null or numPieces < 1 or peers < 1",e),e.completePercent;for(var a=[],n=0,i=e.completePercent,s=0;sn?(n=c,i=o.completePercent):c===n&&o.completePercent>i&&(i=o.completePercent)}var p=0;if(a.length>0)for(;;){var f=!0;for(s=0;s0?(p++,a[s]--):f=!1;if(!f)break}if(p<=n)return i;var m=p/e.numPieces*100;return m<=i?i:m}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2SettingService",["ariaNgConstants","aria2AllOptions","aria2GlobalAvailableOptions","aria2QuickSettingsAvailableOptions","aria2TaskAvailableOptions","aria2RpcService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r){var l=function(t){return e.settingHistoryKeyPrefix+"."+t};return{isOptionKeyValid:function(e){return!!t[e]},isOptionKeyRequired:function(e){var a=t[e];return a&&a.required},getAvailableGlobalOptionsKeys:function(e){return"basic"===e?a.basicOptions:"http-ftp-sftp"===e?a.httpFtpSFtpOptions:"http"===e?a.httpOptions:"ftp-sftp"===e?a.ftpSFtpOptions:"bt"===e?a.btOptions:"metalink"===e?a.metalinkOptions:"rpc"===e?a.rpcOptions:"advanced"===e&&a.advancedOptions},getAria2QuickSettingsAvailableOptions:function(e){return"globalSpeedLimit"===e&&n.globalSpeedLimitOptions},getAvailableTaskOptionKeys:function(e,t){for(var a=i.taskOptions,n=[],s=0;s-1&&(n.splice(i,1),r.set(a,n)),n},clearSettingsHistorys:function(){for(var t=r.keys(e.settingHistoryKeyPrefix+"."),a=0;a{let n=e.recManifestUrl;fetch(n).then((e=>{t(e.json())})).catch((e=>{a(e)}))}))}}}])}(),angular.module("ariaNg").run(["$templateCache",function(e){e.put("views/debug.html",'
'),e.put("views/export-command-api-dialog.html",''),e.put("views/list.html",'
'),e.put("views/new.html",'
'),e.put("views/notification-reloadable.html",''),e.put("views/recommend.html",''),e.put("views/setting-dialog.html",'\x3c!-- /.modal --\x3e'),e.put("views/setting.html",'
 
'),e.put("views/settings-aria2.html",'
'),e.put("views/settings-ariang.html",'
'),e.put("views/status.html",'
Aria2 RPC Address
Aria2 Status
Session ID
-
Aria2 Version
- Enhanced Edition
Enabled Features
-
Operations
'),e.put("views/task-detail.html",'
\x3c!-- /.nav-tabs-custom --\x3e
')}]); \ No newline at end of file +!function(){"use strict";var e,t,a;if(e=navigator.appName,t=navigator.appVersion.split(";"),a=t&&t.length>1?t[1].replace(/[ ]/g,""):"","Microsoft Internet Explorer"===e&&("MSIE6.0"===a||"MSIE7.0"===a||"MSIE8.0"===a||"MSIE9.0"===a)){var n=document.createElement("div");n.className="alert alert-danger",n.innerHTML="Sorry, AriaNg cannot support this browser, please upgrade your browser!",document.getElementById("content-wrapper").appendChild(n)}document.addEventListener("contextmenu",(function(e){const t=e.target.tagName;"TEXTAREA"!==t&&"INPUT"!==t&&e.preventDefault()}))}(),function(){"use strict";var e=function(){var e=$(window).height(),t=$(".main-header").outerHeight()+$(".main-footer").outerHeight();$(".content-body").css("height",e-t)};$(window,".wrapper").resize((function(){e()})),e()}(),function(){"use strict";angular.module("ariaNg",["ngRoute","ngSanitize","ngTouch","ngMessages","ngCookies","ngAnimate","pascalprecht.translate","angularMoment","ngWebSocket","utf8-base64","LocalStorageModule","ui-notification","angularBittorrentPeerid","cgBusy","angularPromiseButtons","angular-clipboard","inputDropdown",angularDragula(angular)])}(),function(){"use strict";angular.module("ariaNg").config(["$routeProvider",function(e){var t="/"+JSON.parse(localStorage["AriaNg.Options"]||'{"defaultTaskPage":"all"}').defaultTaskPage||"all";e.when("/all",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/downloading",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/waiting",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/stopped",{templateUrl:"views/list.html",controller:"DownloadListController"}).when("/new",{templateUrl:"views/new.html",controller:"NewTaskController"}).when("/new/:url",{template:"",controller:"CommandController"}).when("/task/detail/:gid",{templateUrl:"views/task-detail.html",controller:"TaskDetailController",reloadOnSearch:!1}).when("/settings/ariang",{templateUrl:"views/settings-ariang.html",controller:"AriaNgSettingsController",reloadOnSearch:!1}).when("/settings/ariang/:extendType",{templateUrl:"views/settings-ariang.html",controller:"AriaNgSettingsController"}).when("/settings/aria2/basic",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/http-ftp-sftp",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/http",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/ftp-sftp",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/bt",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/metalink",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/rpc",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/aria2/advanced",{templateUrl:"views/settings-aria2.html",controller:"Aria2SettingsController"}).when("/settings/rpc/set",{template:"",controller:"CommandController"}).when("/settings/rpc/set/:protocol/:host/:port/:interface/:secret?",{template:"",controller:"CommandController"}).when("/debug",{templateUrl:"views/debug.html",controller:"AriaNgDebugController"}).when("/status",{templateUrl:"views/status.html",controller:"Aria2StatusController"}).when("/recommend",{templateUrl:"views/recommend.html"}).otherwise({redirectTo:t})}])}(),function(){"use strict";angular.module("ariaNg").run(["$window","$rootScope","$location","$document","$timeout","ariaNgCommonService","ariaNgKeyboardService","ariaNgNotificationService","ariaNgLogService","ariaNgSettingService","aria2TaskService","aria2SettingService","aria2AllOptions",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var f=!1,g=function(e,t){return e===t||0===t.indexOf(e)&&0===t.substring(e.length).indexOf("/")},m=function(){t.currentTheme="light",angular.element("body").removeClass("theme-dark")},h=function(){t.currentTheme="dark",angular.element("body").addClass("theme-dark")},v=function(){if(c.isBrowserSupportDarkMode()){var t=e.matchMedia("(prefers-color-scheme: dark)");l.info("[root.setThemeBySystemSettings] system uses "+(t.matches?"dark":"light")+" theme"),t.matches?h():m()}else m()},b=function(){angular.element('[data-widget="pushmenu"]').PushMenu("collapse")},k=function(e){if(!e||parseInt(e).toString()!=e)return e;for(var t=["","k","m","g"],a=0,n=0;n=0)},t.isTaskRetryable=function(e){return e&&"error"===e.status&&e.errorDescription&&!e.bittorrent},t.keydownActions={find:function(e){return e.preventDefault&&e.preventDefault(),t.searchContext.setSearchBoxFocused(),!1}},t.swipeActions={leftSwipe:function(){c.getSwipeGesture()&&(angular.element("body").hasClass("sidebar-collapse")?(!this.extendLeftSwipe||angular.isFunction(this.extendLeftSwipe)&&!this.extendLeftSwipe())&&b():b())},rightSwipe:function(){c.getSwipeGesture()&&(!this.extendRightSwipe||angular.isFunction(this.extendRightSwipe)&&!this.extendRightSwipe())&&angular.element('[data-widget="pushmenu"]').PushMenu("expand")}},t.refreshPage=function(){e.location.reload()},t.setAutoRefreshAfterPageLoad=function(){f=!0},t.setTheme=function(e){"system"===e?v():"dark"===e?h():m()},e.addEventListener("keydown",(function(e){if(c.getKeyboardShortcuts()){var a=angular.element('input[type="text"],textarea').is(":focus");if(o.isCtrlAPressed(e)&&!a){if(angular.isFunction(t.keydownActions.selectAll))return t.keydownActions.selectAll(e)}else if(o.isCtrlFPressed(e)){if(angular.isFunction(t.keydownActions.find))return t.keydownActions.find(e)}else if(o.isDeletePressed(e)&&!a&&angular.isFunction(t.keydownActions.delete))return t.keydownActions.delete(e)}}),!0),c.onFirstAccess((function(){r.notifyInPage("","Tap to configure and get started with AriaNg.",{delay:!1,onClose:function(){a.path("/settings/ariang")}})})),d.onFirstSuccess((function(e){r.notifyInPage("","is connected",{type:"success",contentPrefix:e.rpcName+" "})})),d.onConnectionSuccess((function(){i((function(){"Connected"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Connected"),t.taskContext.isRpcOptionsSet||(!function(){const e=c.getRpcOptions(),a=c.getCurrentRpcDisplayName();u.getGlobalOption((function(n){if(n.success)try{let i=n.data;for(const t of Object.keys(e)){let n=e[t]||"",s=i[t]||"";if("Bytes"===p[t].suffix&&(s=k(s)),s.toLowerCase()!==n.toLowerCase()){u.setGlobalOptions(e,(function(){r.notifyInPage("","settings have taken effect",{type:"success",contentPrefix:a+" "})}));break}}t.enhanced="true"===i["enable-extension"]}catch(e){l.warn("[root.initAria2Options] ",e)}}))}(),t.taskContext.isRpcOptionsSet=!0)}))})),d.onConnectionFailed((function(){i((function(){"Disconnected"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Disconnected"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onConnectionReconnecting((function(){i((function(){"Reconnecting"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Reconnecting"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onConnectionWaitingToReconnect((function(){i((function(){"Waiting to reconnect"!==t.taskContext.rpcStatus&&(t.taskContext.rpcStatus="Waiting to reconnect"),t.taskContext.isRpcOptionsSet&&(t.taskContext.isRpcOptionsSet=!1)}))})),d.onTaskCompleted((function(e){r.notifyTaskComplete(e.task)})),d.onBtTaskCompleted((function(e){r.notifyBtTaskComplete(e.task)})),d.onTaskErrorOccur((function(e){r.notifyTaskError(e.task)})),t.$on("$locationChangeStart",(function(e){t.skipLocationChange?t.skipLocationChange=!1:(s.closeAllDialogs(),t.loadPromise=null,delete t.keydownActions.selectAll,delete t.keydownActions.delete,delete t.swipeActions.extendLeftSwipe,delete t.swipeActions.extendRightSwipe,angular.isArray(t.taskContext.list)&&t.taskContext.list.length>0&&(t.taskContext.list.length=0),angular.isObject(t.taskContext.selected)&&(t.taskContext.selected={}),t.taskContext.enableSelectAll=!1)})),t.$on("$routeChangeStart",(function(e,t,i){!function(e){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element("ul.nav-sidebar a").each((function(t,a){var n=angular.element(a).attr("href").substring(2);g(n,e)&&angular.element(a).addClass("active")})),angular.element("ul.nav-treeview a").each((function(t,a){var n=angular.element(a).attr("href").substring(2);g(n,e)&&angular.element(a).parentsUntil(".nav-sidebar > .nav-treeview").prev("a").addClass("active").parent().addClass("menu-open")}))}(a.path()),n.unbind("keypress")})),c.isBrowserSupportDarkMode())&&e.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(function(e){l.info("[root] system switches to "+(e.matches?"dark":"light")+" theme"),"system"===c.getTheme()&&(e.matches?h():m())}));t.$on("$locationChangeSuccess",(function(a,n,i){f&&e.location.reload(),i.includes("settings/aria2")&&n.includes("settings/aria2")||(t.searchContext.text=""),t.searchContext.enabledInPage=!1})),"system"===c.getTheme()?v():"dark"===c.getTheme()?h():m(),function(){var e=c.getBrowserFeatures();if(e.localStorage||l.warn("[root.initCheck] LocalStorage is not supported!"),e.cookies||l.warn("[root.initCheck] Cookies is not supported!"),!c.isBrowserSupportStorage())throw angular.element("body").prepend('
'),angular.element(".main-sidebar").addClass("blur"),angular.element(".navbar").addClass("blur"),angular.element(".content-body").addClass("blur"),r.notifyInPage("","You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.",{type:"error",delay:!1}),new Error("You cannot use AriaNg because this browser does not meet the minimum requirements for data storage.")}(),angular.element("section.sidebar > ul > li[data-href-match] > a").on("click",(function(){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element(this).addClass("active")})),angular.element("section.sidebar > ul > li > ul.nav-treeview > li[data-href-match] > a").on("click",(function(){angular.element("section.sidebar > ul li a").removeClass("active"),angular.element(this).addClass("active").parent().parent().siblings("a").addClass("active")}))}])}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgConstants",{title:"AriaNg",appPrefix:"AriaNg",optionStorageKey:"Options",browserNotificationHistoryStorageKey:"Notifications",languageStorageKeyPrefix:"Language",settingHistoryKeyPrefix:"History",languagePath:"langs",languageFileExtension:".txt",defaultLanguage:"en",defaultHost:"localhost",defaultSecureProtocol:"https",defaultPathSeparator:"/",httpRequestTimeout:2e4,globalStatStorageCapacity:120,taskStatStorageCapacity:300,lazySaveTimeout:500,errorTooltipDelay:500,notificationInPageTimeout:2e3,historyMaxStoreCount:10,cachedDebugLogsLimit:100}).constant("ariaNgDefaultOptions",{language:"en",theme:"light",title:"${downspeed}, ${upspeed} - ${title}",titleRefreshInterval:5e3,browserNotification:!1,browserNotificationSound:!0,browserNotificationFrequency:"unlimited",rpcAlias:"",rpcHost:"",rpcPort:"6800",rpcInterface:"jsonrpc",protocol:"http",httpMethod:"POST",rpcRequestHeaders:"",rpcOptions:{},secret:"",extendRpcServers:[],webSocketReconnectInterval:5e3,globalStatRefreshInterval:1e3,downloadTaskRefreshInterval:1e3,keyboardShortcuts:!0,swipeGesture:!0,dragAndDropTasks:!0,rpcListDisplayOrder:"recentlyUsed",afterCreatingNewTask:"task-list",removeOldTaskAfterRetrying:!1,confirmTaskRemoval:!0,includePrefixWhenCopyingFromTaskDetails:!0,showPiecesInfoInTaskDetailPage:"le10240",afterRetryingTask:"task-list-default",pauseAfterRetry:!1,taskListIndependentDisplayOrder:!0,displayOrder:"default:asc",downloadingTaskListPageDisplayOrder:"default:asc",waitingTaskListPageDisplayOrder:"default:asc",stoppedTaskListPageDisplayOrder:"default:asc",fileListDisplayOrder:"default:asc",peerListDisplayOrder:"default:asc",defaultTaskPage:"all",recCount:0,compactMode:!1}).constant("aria2eConstants",{recommendOrigin:"https://rec.aria2e.com",recManifestUrl:"https://rec.aria2e.com/manifest.json"})}(),function(){"use strict";angular.module("ariaNg").constant("ariaNgBuildConfiguration",{buildVersion:"v1.3.8e",buildCommit:"861dedb"})}(),function(){"use strict";angular.module("ariaNg").config(["$qProvider","$translateProvider","localStorageServiceProvider","NotificationProvider","ariaNgConstants","ariaNgLanguages",function(e,t,a,n,i,s){e.errorOnUnhandledRejections(!1),a.setPrefix(i.appPrefix).setStorageType("localStorage").setStorageCookie(365,"/");var o=[],r={};for(var l in s)if(s.hasOwnProperty(l)){var c=s[l].aliases;if(o.push(l),angular.isArray(c)&&!(c.length<1))for(var d=0;d= 2, of course). If SIZE is 15M, since 2*15M > 20MiB, aria2 does not split file and download it using 1 source. You can append K or M (1K = 1024, 1M = 1024K). Possible Values: 1M-1024M.","netrc-path.name":".netrc Path","netrc-path.description":"","no-netrc.name":"Disable netrc","no-netrc.description":"","no-proxy.name":"No Proxy List","no-proxy.description":"Specify a comma separated list of host names, domains and network addresses with or without a subnet mask where no proxy should be used.","out.name":"File Name","out.description":"The file name of the downloaded file. It is always relative to the directory given in --dir option. When the --force-sequential option is used, this option is ignored.","proxy-method.name":"Proxy Method","proxy-method.description":"Set the method to use in proxy request. METHOD is either GET or TUNNEL. HTTPS downloads always use TUNNEL regardless of this option.","remote-time.name":"Remote File Timestamp","remote-time.description":"Retrieve timestamp of the remote file from the remote HTTP/FTP server and if it is available, apply it to the local file.","reuse-uri.name":"Reuse Uri","reuse-uri.description":"Reuse already used URIs if no unused URIs are left.","retry-wait.name":"Retry Wait","retry-wait.description":"Set the seconds to wait between retries. When SEC > 0, aria2 will retry downloads when the HTTP server returns a 503 response.","server-stat-of.name":"Server Stat Output","server-stat-of.description":"Specify the file name to which performance profile of the servers is saved. You can load saved data using --server-stat-if option.","server-stat-timeout.name":"Server Stat Timeout","server-stat-timeout.description":"Specifies timeout in seconds to invalidate performance profile of the servers since the last contact to them.","split.name":"Split Count","split.description":"Download a file using N connections. If more than N URIs are given, first N URIs are used and remaining URIs are used for backup. If less than N URIs are given, those URIs are used more than once so that N connections total are made simultaneously. The number of connections to the same host is restricted by the --max-connection-per-server option.","stream-piece-selector.name":"Piece Selection Algorithm","stream-piece-selector.description":"Specify piece selection algorithm used in HTTP/FTP download. Piece means fixed length segment which is downloaded in parallel in segmented download. If default is given, aria2 selects piece so that it reduces the number of establishing connection. This is reasonable default behavior because establishing connection is an expensive operation. If inorder is given, aria2 selects piece which has minimum index. Index=0 means first of the file. This will be useful to view movie while downloading it. --enable-http-pipelining option may be useful to reduce re-connection overhead. Please note that aria2 honors --min-split-size option, so it will be necessary to specify a reasonable value to --min-split-size option. If random is given, aria2 selects piece randomly. Like inorder, --min-split-size option is honored. If geom is given, at the beginning aria2 selects piece which has minimum index like inorder, but it exponentially increasingly keeps space from previously selected piece. This will reduce the number of establishing connection and at the same time it will download the beginning part of the file first. This will be useful to view movie while downloading it.","timeout.name":"Timeout","timeout.description":"","uri-selector.name":"URI Selection Algorithm","uri-selector.description":"Specify URI selection algorithm. The possible values are inorder, feedback and adaptive. If inorder is given, URI is tried in the order appeared in the URI list. If feedback is given, aria2 uses download speed observed in the previous downloads and choose fastest server in the URI list. This also effectively skips dead mirrors. The observed download speed is a part of performance profile of servers mentioned in --server-stat-of and --server-stat-if If adaptive is given, selects one of the best mirrors for the first and reserved connections. For supplementary ones, it returns mirrors which has not been tested yet, and if each of them has already been tested, returns mirrors which has to be tested again. Otherwise, it doesn't select anymore mirrors. Like feedback, it uses a performance profile of servers.","check-certificate.name":"Check Certificate","check-certificate.description":"","http-accept-gzip.name":"Accept GZip","http-accept-gzip.description":"Send Accept: deflate, gzip request header and inflate response if remote server responds with Content-Encoding: gzip or Content-Encoding: deflate.","http-auth-challenge.name":"Auth Challenge","http-auth-challenge.description":"Send HTTP authorization header only when it is requested by the server. If false is set, then authorization header is always sent to the server. There is an exception: if user name and password are embedded in URI, authorization header is always sent to the server regardless of this option.","http-no-cache.name":"No Cache","http-no-cache.description":"Send Cache-Control: no-cache and Pragma: no-cache header to avoid cached content. If false is given, these headers are not sent and you can add Cache-Control header with a directive you like using --header option.","http-user.name":"HTTP Default User Name","http-user.description":"","http-passwd.name":"HTTP Default Password","http-passwd.description":"","http-proxy.name":"HTTP Proxy Server","http-proxy.description":"","http-proxy-user.name":"HTTP Proxy User Name","http-proxy-user.description":"","http-proxy-passwd.name":"HTTP Proxy Password","http-proxy-passwd.description":"","https-proxy.name":"HTTPS Proxy Server","https-proxy.description":"","https-proxy-user.name":"HTTPS Proxy User Name","https-proxy-user.description":"","https-proxy-passwd.name":"HTTPS Proxy Password","https-proxy-passwd.description":"","referer.name":"Referer","referer.description":"Set an http referrer (Referer). This affects all http/https downloads. If * is given, the download URI is also used as the referrer. This may be useful when used together with the --parameterized-uri option.","enable-http-keep-alive.name":"Enable Persistent Connection","enable-http-keep-alive.description":"Enable HTTP/1.1 persistent connection.","enable-http-pipelining.name":"Enable HTTP Pipelining","enable-http-pipelining.description":"Enable HTTP/1.1 pipelining.","header.name":"Custom Header","header.description":'Append HEADER to HTTP request header. Put one item per line, each item containing "header name: header value".',"save-cookies.name":"Cookies Path","save-cookies.description":"Save Cookies to FILE in Mozilla/Firefox(1.x/2.x)/ Netscape format. If FILE already exists, it is overwritten. Session Cookies are also saved and their expiry values are treated as 0.","use-head.name":"Use HEAD Method","use-head.description":"Use HEAD method for the first request to the HTTP server.","user-agent.name":"Custom User Agent","user-agent.description":"","ftp-user.name":"FTP Default User Name","ftp-user.description":"","ftp-passwd.name":"FTP Default Password","ftp-passwd.description":"If user name is embedded but password is missing in URI, aria2 tries to resolve password using .netrc. If password is found in .netrc, then use it as password. If not, use the password specified in this option.","ftp-pasv.name":"Passive Mode","ftp-pasv.description":"Use the passive mode in FTP. If false is given, the active mode will be used. This option is ignored for SFTP transfer.","ftp-proxy.name":"FTP Proxy Server","ftp-proxy.description":"","ftp-proxy-user.name":"FTP Proxy User Name","ftp-proxy-user.description":"","ftp-proxy-passwd.name":"FTP Proxy Password","ftp-proxy-passwd.description":"","ftp-type.name":"Transfer Type","ftp-type.description":"","ftp-reuse-connection.name":"Reuse Connection","ftp-reuse-connection.description":"","ssh-host-key-md.name":"SSH Public Key Checksum","ssh-host-key-md.description":"Set checksum for SSH host public key. The option value format is TYPE=DIGEST. TYPE is hash type. The supported hash type is sha-1 or md5. DIGEST is hex digest. For example: sha-1=b030503d4de4539dc7885e6f0f5e256704edf4c3. This option can be used to validate server's public key when SFTP is used. If this option is not set, which is default, no validation takes place.","bt-detach-seed-only.name":"Detach Seed Only","bt-detach-seed-only.description":"Exclude seed only downloads when counting concurrent active downloads (See -j option). This means that if -j3 is given and this option is turned on and 3 downloads are active and one of those enters seed mode, then it is excluded from active download count (thus it becomes 2), and the next download waiting in queue gets started. But be aware that seeding item is still recognized as active download in RPC method.","bt-enable-hook-after-hash-check.name":"Enable Hook After Hash Check","bt-enable-hook-after-hash-check.description":"Allow hook command invocation after hash check (see -V option) in BitTorrent download. By default, when hash check succeeds, the command given by --on-bt-download-complete is executed. To disable this action, give false to this option.","bt-enable-lpd.name":"Enable Local Peer Discovery (LPD)","bt-enable-lpd.description":"Enable Local Peer Discovery. If a private flag is set in a torrent, aria2 doesn't use this feature for that download even if true is given.","bt-exclude-tracker.name":"BitTorrent Exclude Trackers","bt-exclude-tracker.description":"Comma separated list of BitTorrent tracker's announce URI to remove. You can use special value * which matches all URIs, thus removes all announce URIs. When specifying * in shell command-line, don't forget to escape or quote it.","bt-external-ip.name":"External IP","bt-external-ip.description":"Specify the external IP address to use in BitTorrent download and DHT. It may be sent to BitTorrent tracker. For DHT, this option should be set to report that local node is downloading a particular torrent. This is critical to use DHT in a private network. Although this function is named external, it can accept any kind of IP addresses.","bt-force-encryption.name":"Force Encryption","bt-force-encryption.description":"Requires BitTorrent message payload encryption with arc4. This is a shorthand of --bt-require-crypto --bt-min-crypto-level=arc4. This option does not change the option value of those options. If true is given, deny legacy BitTorrent handshake and only use Obfuscation handshake and always encrypt message payload.","bt-hash-check-seed.name":"Hash Check Before Seeding","bt-hash-check-seed.description":"If true is given, after hash check using --check-integrity option and file is complete, continue to seed file. If you want to check file and download it only when it is damaged or incomplete, set this option to false. This option has effect only on BitTorrent download.","bt-load-saved-metadata.name":"Load Saved Metadata File","bt-load-saved-metadata.description":"Before getting torrent metadata from DHT when downloading with magnet link, first try to read file saved by --bt-save-metadata option. If it is successful, then skip downloading metadata from DHT.","bt-max-open-files.name":"Max Open Files","bt-max-open-files.description":"Specify maximum number of files to open in multi-file BitTorrent/Metalink download globally.","bt-max-peers.name":"Max Peers","bt-max-peers.description":"Specify the maximum number of peers per torrent. 0 means unlimited.","bt-metadata-only.name":"Download Metadata Only","bt-metadata-only.description":"Download meta data only. The file(s) described in meta data will not be downloaded. This option has effect only when BitTorrent Magnet URI is used.","bt-min-crypto-level.name":"Min Crypto Level","bt-min-crypto-level.description":"Set minimum level of encryption method. If several encryption methods are provided by a peer, aria2 chooses the lowest one which satisfies the given level.","bt-prioritize-piece.name":"Prioritize Piece","bt-prioritize-piece.description":"Try to download first and last pieces of each file first. This is useful for previewing files. The argument can contain 2 keywords: head and tail. To include both keywords, they must be separated by comma. These keywords can take one parameter, SIZE. For example, if head=SIZE is specified, pieces in the range of first SIZE bytes of each file get higher priority. tail=SIZE means the range of last SIZE bytes of each file. SIZE can include K or M (1K = 1024, 1M = 1024K).","bt-remove-unselected-file.name":"Remove Unselected File","bt-remove-unselected-file.description":"Removes the unselected files when download is completed in BitTorrent. To select files, use --select-file option. If it is not used, all files are assumed to be selected. Please use this option with care because it will actually remove files from your disk.","bt-require-crypto.name":"Require Crypto","bt-require-crypto.description":"If true is given, aria2 doesn't accept and establish connection with legacy BitTorrent handshake(\\19BitTorrent protocol). Thus aria2 always uses Obfuscation handshake.","bt-request-peer-speed-limit.name":"Preferred Download Speed","bt-request-peer-speed-limit.description":"If the whole download speed of every torrent is lower than SPEED, aria2 temporarily increases the number of peers to try for more download speed. Configuring this option with your preferred download speed can increase your download speed in some cases. You can append K or M (1K = 1024, 1M = 1024K).","bt-save-metadata.name":"Save Metadata","bt-save-metadata.description":'Save meta data as ".torrent" file. This option has effect only when BitTorrent Magnet URI is used. The file name is hex encoded info hash with suffix ".torrent". The directory to be saved is the same directory where download file is saved. If the same file already exists, meta data is not saved.',"bt-seed-unverified.name":"Not Verify Downloaded Fileds","bt-seed-unverified.description":"Seed previously downloaded files without verifying piece hashes.","bt-stop-timeout.name":"Stop Timeout","bt-stop-timeout.description":"Stop BitTorrent download if download speed is 0 in consecutive SEC seconds. If 0 is given, this feature is disabled.","bt-tracker.name":"BitTorrent Trackers","bt-tracker.description":"Comma separated list of additional BitTorrent tracker's announce URI. These URIs are not affected by --bt-exclude-tracker option because they are added after URIs in --bt-exclude-tracker option are removed.","bt-tracker-connect-timeout.name":"BitTorrent Tracker Connect Timeout","bt-tracker-connect-timeout.description":"Set the connect timeout in seconds to establish connection to tracker. After the connection is established, this option makes no effect and --bt-tracker-timeout option is used instead.","bt-tracker-interval.name":"BitTorrent Tracker Connect Interval","bt-tracker-interval.description":"Set the interval in seconds between tracker requests. This completely overrides interval value and aria2 just uses this value and ignores the min interval and interval value in the response of tracker. If 0 is set, aria2 determines interval based on the response of tracker and the download progress.","bt-tracker-timeout.name":"BitTorrent Tracker Timeout","bt-tracker-timeout.description":"","dht-file-path.name":"DHT (IPv4) File","dht-file-path.description":"Change the IPv4 DHT routing table file to PATH.","dht-file-path6.name":"DHT (IPv6) File","dht-file-path6.description":"Change the IPv6 DHT routing table file to PATH.","dht-listen-port.name":"DHT Listen Port","dht-listen-port.description":'Set UDP listening port used by DHT(IPv4, IPv6) and UDP tracker. Multiple ports can be specified by using "," for example: 6881,6885. You can also use - to specify a range: 6881-6999. , and - can be used together.',"dht-message-timeout.name":"DHT Message Timeout","dht-message-timeout.description":"","enable-dht.name":"Enable DHT (IPv4)","enable-dht.description":"Enable IPv4 DHT functionality. It also enables UDP tracker support. If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given.","enable-dht6.name":"Enable DHT (IPv6)","enable-dht6.description":"Enable IPv6 DHT functionality. If a private flag is set in a torrent, aria2 doesn't use DHT for that download even if true is given. Use --dht-listen-port option to specify port number to listen on.","enable-peer-exchange.name":"Enable Peer Exchange","enable-peer-exchange.description":"Enable Peer Exchange extension. If a private flag is set in a torrent, this feature is disabled for that download even if true is given.","follow-torrent.name":"Follow Torrent","follow-torrent.description":"If true or mem is specified, when a file whose suffix is .torrent or content type is application/x-bittorrent is downloaded, aria2 parses it as a torrent file and downloads files mentioned in it. If mem is specified, a torrent file is not written to the disk, but is just kept in memory. If false is specified, the .torrent file is downloaded to the disk, but is not parsed as a torrent and its contents are not downloaded.","listen-port.name":"Listen Port","listen-port.description":'Set TCP port number for BitTorrent downloads. Multiple ports can be specified by using "," for example: 6881,6885. You can also use - to specify a range: 6881-6999. , and - can be used together: 6881-6889,6999.',"enable-pmap.name":"Enable UPnP Port Mapping","enable-pmap.description":"Enables UPnP automatic port mapping for BT and DHT protocols, and automatically sets the external IP address (bt-external-ip) to improve BT connectivity and node discovery. (The LAN gateway needs to enable UPnP function)","max-overall-upload-limit.name":"Global Max Upload Limit","max-overall-upload-limit.description":"Set max overall upload speed in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","max-upload-limit.name":"Max Upload Limit","max-upload-limit.description":"Set max upload speed per each torrent in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","peer-id-prefix.name":"Peer ID Prefix","peer-id-prefix.description":"Specify the prefix of peer ID. The peer ID in BitTorrent is 20 byte length. If more than 20 bytes are specified, only first 20 bytes are used. If less than 20 bytes are specified, random byte data are added to make its length 20 bytes.","peer-agent.name":"Peer Agent","peer-agent.description":"Specify the string used during the bitorrent extended handshake for the peer’s client version.","seed-ratio.name":"Min Share Ratio","seed-ratio.description":"Specify share ratio. Seed completed torrents until share ratio reaches RATIO. You are strongly encouraged to specify equals or more than 1.0 here. Specify 0.0 if you intend to do seeding regardless of share ratio. If --seed-time option is specified along with this option, seeding ends when at least one of the conditions is satisfied.","seed-time.name":"Min Seed Time","seed-time.description":"Specify seeding time in (fractional) minutes. Specifying --seed-time=0 disables seeding after download completed.","follow-metalink.name":"Follow Metalink","follow-metalink.description":"If true or mem is specified, when a file whose suffix is .meta4 or .metalink or content type of application/metalink4+xml or application/metalink+xml is downloaded, aria2 parses it as a metalink file and downloads files mentioned in it. If mem is specified, a metalink file is not written to the disk, but is just kept in memory. If false is specified, the .metalink file is downloaded to the disk, but is not parsed as a metalink file and its contents are not downloaded.","metalink-base-uri.name":"Base URI","metalink-base-uri.description":"Specify base URI to resolve relative URI in metalink:url and metalink:metaurl element in a metalink file stored in local disk. If URI points to a directory, URI must end with /.","metalink-language.name":"Language","metalink-language.description":"","metalink-location.name":"Preferred Server Location","metalink-location.description":"The location of the preferred server. A comma-delimited list of locations is acceptable, for example, jp,us.","metalink-os.name":"Operation System","metalink-os.description":"The operating system of the file to download.","metalink-version.name":"Version","metalink-version.description":"The version of the file to download.","metalink-preferred-protocol.name":"Preferred Protocol","metalink-preferred-protocol.description":"Specify preferred protocol. The possible values are http, https, ftp and none. Specify none to disable this feature.","metalink-enable-unique-protocol.name":"Enable Unique Protocol","metalink-enable-unique-protocol.description":"If true is given and several protocols are available for a mirror in a metalink file, aria2 uses one of them. Use --metalink-preferred-protocol option to specify the preference of protocol.","enable-rpc.name":"Enable JSON-RPC/XML-RPC Server","enable-rpc.description":"","pause-metadata.name":"Pause After Metadata Downloaded","pause-metadata.description":"Pause downloads created as a result of metadata download. There are 3 types of metadata downloads in aria2: (1) downloading .torrent file. (2) downloading torrent metadata using magnet link. (3) downloading metalink file. These metadata downloads will generate downloads using their metadata. This option pauses these subsequent downloads. This option is effective only when --enable-rpc=true is given.","rpc-allow-origin-all.name":"Allow All Origin Request","rpc-allow-origin-all.description":"Add Access-Control-Allow-Origin header field with value * to the RPC response.","rpc-listen-all.name":"Listen on All Network Interfaces","rpc-listen-all.description":"Listen incoming JSON-RPC/XML-RPC requests on all network interfaces. If false is given, listen only on local loopback interface.","rpc-listen-port.name":"Listen Port","rpc-listen-port.description":"","rpc-max-request-size.name":"Max Request Size","rpc-max-request-size.description":"Set max size of JSON-RPC/XML-RPC request. If aria2 detects the request is more than SIZE bytes, it drops connection.","rpc-save-upload-metadata.name":"Save Upload Metadata","rpc-save-upload-metadata.description":"Save the uploaded torrent or metalink meta data in the directory specified by --dir option. The file name consists of SHA-1 hash hex string of meta data plus extension. For torrent, the extension is '.torrent'. For metalink, it is '.meta4'. If false is given to this option, the downloads added by aria2.addTorrent() or aria2.addMetalink() will not be saved by --save-session option.","rpc-secure.name":"Enable SSL/TLS","rpc-secure.description":"RPC transport will be encrypted by SSL/TLS. The RPC clients must use https scheme to access the server. For WebSocket client, use wss scheme. Use --rpc-certificate and --rpc-private-key options to specify the server certificate and private key.","allow-overwrite.name":"Allow Overwrite","allow-overwrite.description":"Restart download from scratch if the corresponding control file doesn't exist. See also --auto-file-renaming option.","allow-piece-length-change.name":"Allow Piece Length Change","allow-piece-length-change.description":"If false is given, aria2 aborts download when a piece length is different from one in a control file. If true is given, you can proceed but some download progress will be lost.","always-resume.name":"Always Resume Download","always-resume.description":"Always resume download. If true is given, aria2 always tries to resume download and if resume is not possible, aborts download. If false is given, when all given URIs do not support resume or aria2 encounters N URIs which does not support resume (N is the value specified using --max-resume-failure-tries option), aria2 downloads file from scratch. See --max-resume-failure-tries option.","async-dns.name":"Asynchronous DNS","async-dns.description":"","auto-file-renaming.name":"Auto File Renaming","auto-file-renaming.description":"Rename file name if the same file already exists. This option works only in HTTP(S)/FTP download. The new file name has a dot and a number(1..9999) appended after the name, but before the file extension, if any.","auto-save-interval.name":"Auto Save Interval","auto-save-interval.description":"Save a control file(*.aria2) every SEC seconds. If 0 is given, a control file is not saved during download. aria2 saves a control file when it stops regardless of the value. The possible values are between 0 to 600.","conditional-get.name":"Conditional Download","conditional-get.description":"Download file only when the local file is older than remote file. This function only works with HTTP(S) downloads only. It does not work if file size is specified in Metalink. It also ignores Content-Disposition header. If a control file exists, this option will be ignored. This function uses If-Modified-Since header to get only newer file conditionally. When getting modification time of local file, it uses user supplied file name (see --out option) or file name part in URI if --out is not specified. To overwrite existing file, --allow-overwrite is required.","conf-path.name":"Configuration File","conf-path.description":"","console-log-level.name":"Console Log Level","console-log-level.description":"","content-disposition-default-utf8.name":"Use UTF-8 to Handle Content-Disposition","content-disposition-default-utf8.description":"Handle quoted string in Content-Disposition header as UTF-8 instead of ISO-8859-1, for example, the filename parameter, but not the extended version filename.","daemon.name":"Enable Daemon","daemon.description":"","deferred-input.name":"Deferred Load","deferred-input.description":"If true is given, aria2 does not read all URIs and options from file specified by --input-file option at startup, but it reads one by one when it needs later. This may reduce memory usage if input file contains a lot of URIs to download. If false is given, aria2 reads all URIs and options at startup. --deferred-input option will be disabled when --save-session is used together.","disable-ipv6.name":"Disable IPv6","disable-ipv6.description":"","disk-cache.name":"Disk Cache","disk-cache.description":"Enable disk cache. If SIZE is 0, the disk cache is disabled. This feature caches the downloaded data in memory, which grows to at most SIZE bytes. The cache storage is created for aria2 instance and shared by all downloads. The one advantage of the disk cache is reduce the disk I/O because the data are written in larger unit and it is reordered by the offset of the file. If hash checking is involved and the data are cached in memory, we don't need to read them from the disk. SIZE can include K or M (1K = 1024, 1M = 1024K).","download-result.name":"Download Result","download-result.description":"This option changes the way Download Results is formatted. If OPT is default, print GID, status, average download speed and path/URI. If multiple files are involved, path/URI of first requested file is printed and remaining ones are omitted. If OPT is full, print GID, status, average download speed, percentage of progress and path/URI. The percentage of progress and path/URI are printed for each requested file in each row. If OPT is hide, Download Results is hidden.","dscp.name":"DSCP","dscp.description":"Set DSCP value in outgoing IP packets of BitTorrent traffic for QoS. This parameter sets only DSCP bits in TOS field of IP packets, not the whole field. If you take values from /usr/include/netinet/ip.h divide them by 4 (otherwise values would be incorrect, e.g. your CS1 class would turn into CS4). If you take commonly used values from RFC, network vendors' documentation, Wikipedia or any other source, use them as they are.","rlimit-nofile.name":"Soft Limit of Open File Descriptors","rlimit-nofile.description":"Set the soft limit of open file descriptors. This open will only have effect when: a. The system supports it (posix). b. The limit does not exceed the hard limit. c. The specified limit is larger than the current soft limit. This is equivalent to setting nofile via ulimit, except that it will never decrease the limit. This option is only available on systems supporting the rlimit API.","enable-color.name":"Enable Color in Terminal","enable-color.description":"","enable-mmap.name":"Enable MMap","enable-mmap.description":"Map files into memory. This option may not work if the file space is not pre-allocated. See --file-allocation.","event-poll.name":"Event Polling Method","event-poll.description":"Specify the method for polling events. The possible values are epoll, kqueue, port, poll and select. For each epoll, kqueue, port and poll, it is available if system supports it. epoll is available on recent Linux. kqueue is available on various *BSD systems including Mac OS X. port is available on Open Solaris. The default value may vary depending on the system you use.","file-allocation.name":"File Allocation Method","file-allocation.description":"Specify file allocation method. none doesn't pre-allocate file space. prealloc pre-allocates file space before download begins. This may take some time depending on the size of the file. If you are using newer file systems such as ext4 (with extents support), btrfs, xfs or NTFS(MinGW build only), falloc is your best choice. It allocates large(few GiB) files almost instantly. Don't use falloc with legacy file systems such as ext3 and FAT32 because it takes almost same time as prealloc and it blocks aria2 entirely until allocation finishes. falloc may not be available if your system doesn't have posix_fallocate(3) function. trunc uses ftruncate(2) system call or platform-specific counterpart to truncate a file to a specified length. In multi file torrent downloads, the files adjacent forward to the specified files are also allocated if they share the same piece.","force-save.name":"Force Save","force-save.description":"Save download with --save-session option even if the download is completed or removed. This option also saves control file in that situations. This may be useful to save BitTorrent seeding which is recognized as completed state.","save-not-found.name":"Save Not Found File","save-not-found.description":"Save download with --save-session option even if the file was not found on the server. This option also saves control file in that situations.","hash-check-only.name":"Hash Check Only","hash-check-only.description":"If true is given, after hash check using --check-integrity option, abort download whether or not download is complete.","human-readable.name":"Console Human Readable Output","human-readable.description":"Print sizes and speed in human readable format (e.g., 1.2Ki, 3.4Mi) in the console readout.","keep-unfinished-download-result.name":"Keep Unfinished Download Result","keep-unfinished-download-result.description":"Keep unfinished download results even if doing so exceeds --max-download-result. This is useful if all unfinished downloads must be saved in session file (see --save-session option). Please keep in mind that there is no upper bound to the number of unfinished download result to keep. If that is undesirable, turn this option off.","max-download-result.name":"Max Download Result","max-download-result.description":"Set maximum number of download result kept in memory. The download results are completed/error/removed downloads. The download results are stored in FIFO queue and it can store at most NUM download results. When queue is full and new download result is created, oldest download result is removed from the front of the queue and new one is pushed to the back. Setting big number in this option may result high memory consumption after thousands of downloads. Specifying 0 means no download result is kept. Note that unfinished downloads are kept in memory regardless of this option value. See --keep-unfinished-download-result option.","max-mmap-limit.name":"Max MMap Limit","max-mmap-limit.description":"Set the maximum file size to enable mmap (see --enable-mmap option). The file size is determined by the sum of all files contained in one download. For example, if a download contains 5 files, then file size is the total size of those files. If file size is strictly greater than the size specified in this option, mmap will be disabled.","max-resume-failure-tries.name":"Max Resume Failure Try Times","max-resume-failure-tries.description":"When used with --always-resume=false, aria2 downloads file from scratch when aria2 detects N number of URIs that does not support resume. If N is 0, aria2 downloads file from scratch when all given URIs do not support resume. See --always-resume option.","min-tls-version.name":"Min TLS Version","min-tls-version.description":"Specify minimum SSL/TLS version to enable.","log-level.name":"Log Level","log-level.description":"","optimize-concurrent-downloads.name":"Optimize Concurrent Downloads","optimize-concurrent-downloads.description":"Optimizes the number of concurrent downloads according to the bandwidth available. aria2 uses the download speed observed in the previous downloads to adapt the number of downloads launched in parallel according to the rule N = A + B Log10(speed in Mbps). The coefficients A and B can be customized in the option arguments with A and B separated by a colon. The default values (A=5, B=25) lead to using typically 5 parallel downloads on 1Mbps networks and above 50 on 100Mbps networks. The number of parallel downloads remains constrained under the maximum defined by the --max-concurrent-downloads parameter.","piece-length.name":"Piece Length","piece-length.description":"Set a piece length for HTTP/FTP downloads. This is the boundary when aria2 splits a file. All splits occur at multiple of this length. This option will be ignored in BitTorrent downloads. It will be also ignored if Metalink file contains piece hashes.","show-console-readout.name":"Show Console Output","show-console-readout.description":"","summary-interval.name":"Download Summary Output Interval","summary-interval.description":"Set interval in seconds to output download progress summary. Setting 0 suppresses the output.","max-overall-download-limit.name":"Global Max Download Limit","max-overall-download-limit.description":"Set max overall download speed in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","max-download-limit.name":"Max Download Limit","max-download-limit.description":"Set max download speed per each download in bytes/sec. 0 means unrestricted. You can append K or M (1K = 1024, 1M = 1024K).","no-conf.name":"Disable Configuration File","no-conf.description":"","no-file-allocation-limit.name":"No File Allocation Limit","no-file-allocation-limit.description":"No file allocation is made for files whose size is smaller than SIZE. You can append K or M (1K = 1024, 1M = 1024K).","parameterized-uri.name":"Enable Parameterized URI","parameterized-uri.description":"Enable parameterized URI support. You can specify set of parts: http://{sv1,sv2,sv3}/foo.iso. Also you can specify numeric sequences with step counter: http://host/image[000-100:2].img. A step counter can be omitted. If all URIs do not point to the same file, such as the second example above, -Z option is required.","quiet.name":"Disable Console Output","quiet.description":"","realtime-chunk-checksum.name":"Realtime Data Chunk Validation","realtime-chunk-checksum.description":"Validate chunk of data by calculating checksum while downloading a file if chunk checksums are provided.","remove-control-file.name":"Remove Control File","remove-control-file.description":"Remove control file before download. Using with --allow-overwrite=true, download always starts from scratch. This will be useful for users behind proxy server which disables resume.","save-session.name":"Session Save File","save-session.description":"Save error/unfinished downloads to FILE on exit. You can pass this output file to aria2c with --input-file option on restart. If you like the output to be gzipped append a .gz extension to the file name. Please note that downloads added by aria2.addTorrent() and aria2.addMetalink() RPC method and whose meta data could not be saved as a file are not saved. Downloads removed using aria2.remove() and aria2.forceRemove() will not be saved.","save-session-interval.name":"Save Session Interval","save-session-interval.description":"Save error/unfinished downloads to a file specified by --save-session option every SEC seconds. If 0 is given, file will be saved only when aria2 exits.","socket-recv-buffer-size.name":"Socket Receive Buffer Size","socket-recv-buffer-size.description":"Set the maximum socket receive buffer in bytes. Specifing 0 will disable this option. This value will be set to socket file descriptor using SO_RCVBUF socket option with setsockopt() call.","stop.name":"Auto Shutdown Time","stop.description":"Stop application after SEC seconds has passed. If 0 is given, this feature is disabled.","truncate-console-readout.name":"Truncate Console Output","truncate-console-readout.description":"Truncate console readout to fit in a single line."}})}])}(),function(){"use strict";angular.module("ariaNg").constant("aria2AllOptions",{gid:{type:"string",readonly:!0,required:!0},dir:{type:"string",required:!0,lazySaveTimeout:1500,showHistory:!0},log:{type:"string",lazySaveTimeout:2e3,required:!0},"max-concurrent-downloads":{type:"integer",defaultValue:"5",required:!0,min:1},"check-integrity":{type:"boolean",defaultValue:"false",required:!0},continue:{type:"boolean",required:!0},"all-proxy":{type:"string",lazySaveTimeout:1e3,showHistory:!0},"all-proxy-user":{type:"string"},"all-proxy-passwd":{type:"string"},checksum:{type:"string",required:!0,pattern:"^(md5|sha-(1|224|256|384|512))=[a-zA-Z0-9]+$"},"connect-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"dry-run":{type:"boolean",defaultValue:"false",required:!0},"lowest-speed-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-connection-per-server":{type:"integer",defaultValue:"1",required:!0,min:1},"max-file-not-found":{type:"integer",defaultValue:"0",required:!0,min:0},"max-tries":{type:"integer",defaultValue:"5",required:!0,min:0},"min-split-size":{type:"string",suffix:"Bytes",defaultValue:"20M",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"netrc-path":{type:"string",readonly:!0,defaultValue:"$(HOME)/.netrc"},"no-netrc":{type:"boolean",required:!0},"no-proxy":{type:"text",separator:",",showCount:!0},out:{type:"string"},"proxy-method":{type:"option",options:["get","tunnel"],defaultValue:"get",required:!0},"remote-time":{type:"boolean",defaultValue:"false",required:!0},"reuse-uri":{type:"boolean",defaultValue:"true",required:!0},"retry-wait":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0,max:600},"server-stat-of":{type:"string"},"server-stat-timeout":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"86400"},split:{type:"integer",defaultValue:"5",required:!0,min:1},"stream-piece-selector":{type:"option",options:["default","inorder","random","geom"],defaultValue:"default",required:!0},timeout:{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"uri-selector":{type:"option",options:["inorder","feedback","adaptive"],defaultValue:"feedback",required:!0},"check-certificate":{type:"boolean",readonly:!0,defaultValue:"true"},"http-accept-gzip":{type:"boolean",defaultValue:"false",required:!0},"http-auth-challenge":{type:"boolean",defaultValue:"false",required:!0},"http-no-cache":{type:"boolean",defaultValue:"false",required:!0},"http-user":{type:"string"},"http-passwd":{type:"string"},"http-proxy":{type:"string"},"http-proxy-user":{type:"string"},"http-proxy-passwd":{type:"string"},"https-proxy":{type:"string"},"https-proxy-user":{type:"string"},"https-proxy-passwd":{type:"string"},referer:{type:"string"},"enable-http-keep-alive":{type:"boolean",defaultValue:"true",required:!0},"enable-http-pipelining":{type:"boolean",defaultValue:"false",required:!0},header:{type:"text",separator:"\n",overrideMode:"append",submitFormat:"array",showCount:!0,trimCount:!0},"save-cookies":{type:"string"},"use-head":{type:"boolean",defaultValue:"false",required:!0},"user-agent":{type:"string",defaultValue:"aria2/$VERSION"},"ftp-user":{type:"string",defaultValue:"anonymous"},"ftp-passwd":{type:"string",defaultValue:"ARIA2USER@"},"ftp-pasv":{type:"boolean",defaultValue:"true",required:!0},"ftp-proxy":{type:"string"},"ftp-proxy-user":{type:"string"},"ftp-proxy-passwd":{type:"string"},"ftp-type":{type:"option",options:["binary","ascii"],defaultValue:"binary",required:!0},"ftp-reuse-connection":{type:"boolean",defaultValue:"true",required:!0},"ssh-host-key-md":{type:"string"},"show-files":{type:"boolean",readonly:!0},"bt-detach-seed-only":{type:"boolean",readonly:!0,defaultValue:"false"},"bt-enable-hook-after-hash-check":{since:"1.19.3",type:"boolean",defaultValue:"true",required:!0},"bt-enable-lpd":{type:"boolean",defaultValue:"false",required:!0},"bt-exclude-tracker":{type:"text",separator:",",showCount:!0},"bt-external-ip":{type:"string"},"bt-force-encryption":{type:"boolean",defaultValue:"false",required:!0},"bt-hash-check-seed":{type:"boolean",defaultValue:"true",required:!0},"bt-load-saved-metadata":{since:"1.33.0",type:"boolean",defaultValue:"false",required:!0},"bt-max-open-files":{type:"integer",defaultValue:"100",required:!0,min:1},"bt-max-peers":{type:"integer",defaultValue:"55",required:!0,min:0},"bt-metadata-only":{type:"boolean",defaultValue:"false",required:!0},"bt-min-crypto-level":{type:"option",options:["plain","arc4"],defaultValue:"plain",required:!0},"bt-prioritize-piece":{type:"string"},"bt-remove-unselected-file":{type:"boolean",defaultValue:"false",required:!0},"bt-require-crypto":{type:"boolean",defaultValue:"false",required:!0},"bt-request-peer-speed-limit":{type:"string",suffix:"Bytes",defaultValue:"50K",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"bt-save-metadata":{type:"boolean",defaultValue:"false",required:!0},"bt-seed-unverified":{type:"boolean",defaultValue:"false",required:!0},"bt-stop-timeout":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0},"bt-tracker":{type:"text",separator:",",showCount:!0},"bt-tracker-connect-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"bt-tracker-interval":{type:"integer",suffix:"Seconds",defaultValue:"0",required:!0,min:0},"bt-tracker-timeout":{type:"integer",suffix:"Seconds",defaultValue:"60",required:!0,min:1,max:600},"dht-file-path":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/dht.dat"},"dht-file-path6":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/dht6.dat"},"dht-listen-port":{type:"string",readonly:!0,defaultValue:"6881-6999"},"dht-message-timeout":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"10"},"enable-dht":{type:"boolean",readonly:!0,defaultValue:"true"},"enable-dht6":{type:"boolean",readonly:!0},"enable-peer-exchange":{type:"boolean",defaultValue:"true",required:!0},"follow-torrent":{type:"option",options:["true","false","mem"],defaultValue:"true",required:!0},"listen-port":{type:"integer",readonly:!0,defaultValue:"6881-6999"},"enable-pmap":{since:"enhanced",type:"boolean",defaultValue:"false",required:!0},"max-overall-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-upload-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"peer-id-prefix":{type:"string",readonly:!0,defaultValue:"A2-$MAJOR-$MINOR-$PATCH-"},"peer-agent":{since:"1.33.0",type:"string",defaultValue:"aria2/$MAJOR.$MINOR.$PATCH",readonly:!0},"seed-ratio":{type:"float",defaultValue:"1.0",required:!0,min:0},"seed-time":{type:"float",suffix:"Minutes",required:!0,min:0},"follow-metalink":{type:"option",options:["true","false","mem"],defaultValue:"true",required:!0},"metalink-base-uri":{type:"string"},"metalink-language":{type:"string"},"metalink-location":{type:"string"},"metalink-os":{type:"string"},"metalink-version":{type:"string"},"metalink-preferred-protocol":{type:"option",options:["http","https","ftp","none"],defaultValue:"none",required:!0},"metalink-enable-unique-protocol":{type:"boolean",defaultValue:"true",required:!0},"enable-rpc":{type:"boolean",readonly:!0,defaultValue:"false"},"pause-metadata":{type:"boolean",defaultValue:"false",required:!0},"rpc-allow-origin-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-all":{type:"boolean",readonly:!0,defaultValue:"false"},"rpc-listen-port":{type:"integer",readonly:!0,defaultValue:"6800"},"rpc-max-request-size":{type:"string",suffix:"Bytes",readonly:!0,defaultValue:"2M"},"rpc-save-upload-metadata":{type:"boolean",defaultValue:"true",required:!0},"rpc-secure":{type:"boolean",readonly:!0},"allow-overwrite":{type:"boolean",defaultValue:"false",required:!0},"allow-piece-length-change":{type:"boolean",defaultValue:"false",required:!0},"always-resume":{type:"boolean",defaultValue:"true",required:!0},"async-dns":{type:"boolean",defaultValue:"true",required:!0},"auto-file-renaming":{type:"boolean",defaultValue:"true",required:!0},"auto-save-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"60"},"conditional-get":{type:"boolean",defaultValue:"false",required:!0},"conf-path":{type:"string",readonly:!0,defaultValue:"$HOME/.aria2/aria2.conf"},"console-log-level":{type:"option",options:["debug","info","notice","warn","error"],readonly:!0,defaultValue:"notice"},"content-disposition-default-utf8":{since:"1.31.0",type:"boolean",defaultValue:"false"},daemon:{type:"boolean",readonly:!0,defaultValue:"false"},"deferred-input":{type:"boolean",readonly:!0,defaultValue:"false"},"disable-ipv6":{type:"boolean",readonly:!0,defaultValue:"false"},"disk-cache":{type:"string",suffix:"Bytes",readonly:!0,defaultValue:"16M"},"download-result":{type:"option",options:["default","full","hide"],defaultValue:"default",required:!0},dscp:{type:"string",readonly:!0},"rlimit-nofile":{type:"string",readonly:!0},"enable-color":{type:"boolean",readonly:!0,defaultValue:"true"},"enable-mmap":{type:"boolean",defaultValue:"false",required:!0},"event-poll":{type:"option",options:["epoll","kqueue","port","poll","select"],readonly:!0},"file-allocation":{type:"option",options:["none","prealloc","trunc","falloc"],defaultValue:"prealloc",required:!0},"force-save":{type:"boolean",defaultValue:"false",required:!0},"save-not-found":{since:"1.27.0",type:"boolean",defaultValue:"true",required:!0},"hash-check-only":{type:"boolean",defaultValue:"false",required:!0},"human-readable":{type:"boolean",readonly:!0,defaultValue:"true"},"keep-unfinished-download-result":{type:"boolean",defaultValue:"true",required:!0},"max-download-result":{type:"integer",defaultValue:"1000",required:!0,min:0},"max-mmap-limit":{since:"1.20.0",type:"string",suffix:"Bytes",defaultValue:"9223372036854775807",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-resume-failure-tries":{type:"integer",defaultValue:"0",required:!0,min:0},"min-tls-version":{type:"option",options:["SSLv3","TLSv1","TLSv1.1","TLSv1.2"],readonly:!0,defaultValue:"TLSv1"},"log-level":{type:"option",options:["debug","info","notice","warn","error"],defaultValue:"debug",required:!0},"optimize-concurrent-downloads":{since:"1.22.0",type:"string",defaultValue:"false"},"piece-length":{type:"string",suffix:"Bytes",defaultValue:"1M",required:!0,pattern:"^(0|[1-9]\\d*(M|m)?)$"},"show-console-readout":{type:"boolean",readonly:!0,defaultValue:"true"},"summary-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"60"},"max-overall-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"max-download-limit":{type:"string",suffix:"Bytes",defaultValue:"0",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"no-conf":{type:"boolean",readonly:!0},"no-file-allocation-limit":{type:"string",suffix:"Bytes",defaultValue:"5M",required:!0,pattern:"^(0|[1-9]\\d*(K|k|M|m)?)$"},"parameterized-uri":{type:"boolean",defaultValue:"false",required:!0},quiet:{type:"boolean",readonly:!0,defaultValue:"false"},"realtime-chunk-checksum":{type:"boolean",defaultValue:"true",required:!0},"remove-control-file":{type:"boolean",required:!0},"save-session":{type:"string"},"save-session-interval":{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"0"},"socket-recv-buffer-size":{since:"1.19.3",type:"string",suffix:"Bytes",readonly:!0,defaultValue:"0"},stop:{type:"integer",suffix:"Seconds",readonly:!0,defaultValue:"0"},"truncate-console-readout":{type:"boolean",readonly:!0,defaultValue:"true"}}).constant("aria2GlobalAvailableOptions",{basicOptions:["dir","log","max-concurrent-downloads","check-integrity","continue"],httpFtpSFtpOptions:["all-proxy","all-proxy-user","all-proxy-passwd","connect-timeout","dry-run","lowest-speed-limit","max-connection-per-server","max-file-not-found","max-tries","min-split-size","netrc-path","no-netrc","no-proxy","proxy-method","remote-time","reuse-uri","retry-wait","server-stat-of","server-stat-timeout","split","stream-piece-selector","timeout","uri-selector"],httpOptions:["check-certificate","http-accept-gzip","http-auth-challenge","http-no-cache","http-user","http-passwd","http-proxy","http-proxy-user","http-proxy-passwd","https-proxy","https-proxy-user","https-proxy-passwd","referer","enable-http-keep-alive","enable-http-pipelining","header","save-cookies","use-head","user-agent"],ftpSFtpOptions:["ftp-user","ftp-passwd","ftp-pasv","ftp-proxy","ftp-proxy-user","ftp-proxy-passwd","ftp-type","ftp-reuse-connection","ssh-host-key-md"],btOptions:["bt-detach-seed-only","bt-enable-hook-after-hash-check","bt-enable-lpd","bt-exclude-tracker","bt-external-ip","bt-force-encryption","bt-hash-check-seed","bt-load-saved-metadata","bt-max-open-files","bt-max-peers","bt-metadata-only","bt-min-crypto-level","bt-prioritize-piece","bt-remove-unselected-file","bt-require-crypto","bt-request-peer-speed-limit","bt-save-metadata","bt-seed-unverified","bt-stop-timeout","bt-tracker","bt-tracker-connect-timeout","bt-tracker-interval","bt-tracker-timeout","dht-file-path","dht-file-path6","dht-listen-port","dht-message-timeout","enable-dht","enable-dht6","enable-peer-exchange","follow-torrent","listen-port","enable-pmap","max-overall-upload-limit","max-upload-limit","peer-id-prefix","peer-agent","seed-ratio","seed-time"],metalinkOptions:["follow-metalink","metalink-base-uri","metalink-language","metalink-location","metalink-os","metalink-version","metalink-preferred-protocol","metalink-enable-unique-protocol"],rpcOptions:["enable-rpc","pause-metadata","rpc-allow-origin-all","rpc-listen-all","rpc-listen-port","rpc-max-request-size","rpc-save-upload-metadata","rpc-secure"],advancedOptions:["allow-overwrite","allow-piece-length-change","always-resume","async-dns","auto-file-renaming","auto-save-interval","conditional-get","conf-path","console-log-level","content-disposition-default-utf8","daemon","deferred-input","disable-ipv6","disk-cache","download-result","dscp","rlimit-nofile","enable-color","enable-mmap","event-poll","file-allocation","force-save","save-not-found","hash-check-only","human-readable","keep-unfinished-download-result","max-download-result","max-mmap-limit","max-resume-failure-tries","min-tls-version","log-level","optimize-concurrent-downloads","piece-length","show-console-readout","summary-interval","max-overall-download-limit","max-download-limit","no-conf","no-file-allocation-limit","parameterized-uri","quiet","realtime-chunk-checksum","remove-control-file","save-session","save-session-interval","socket-recv-buffer-size","stop","truncate-console-readout"]}).constant("aria2QuickSettingsAvailableOptions",{globalSpeedLimitOptions:["max-overall-download-limit","max-overall-upload-limit"]}).constant("aria2TaskAvailableOptions",{taskOptions:[{key:"dir",category:"global",canUpdate:"new",showHistory:!0},{key:"out",category:"http",canUpdate:"new"},{key:"allow-overwrite",category:"global",canShow:"new"},{key:"max-download-limit",category:"global"},{key:"max-upload-limit",category:"bittorrent"},{key:"split",category:"http",canUpdate:"new|waiting|paused"},{key:"min-split-size",category:"http",canUpdate:"new|waiting|paused"},{key:"max-connection-per-server",category:"http",canUpdate:"new|waiting|paused"},{key:"lowest-speed-limit",category:"http",canUpdate:"new|waiting|paused"},{key:"stream-piece-selector",category:"http",canUpdate:"new|waiting|paused"},{key:"http-user",category:"http",canUpdate:"new|waiting|paused"},{key:"http-passwd",category:"http",canUpdate:"new|waiting|paused"},{key:"all-proxy",category:"http",canUpdate:"new|waiting|paused",showHistory:!0},{key:"all-proxy-user",category:"http",canUpdate:"new|waiting|paused",showHistory:!0},{key:"all-proxy-passwd",category:"http",canUpdate:"new|waiting|paused"},{key:"checksum",category:"http"},{key:"referer",category:"http",canUpdate:"new"},{key:"header",category:"http",canUpdate:"new"},{key:"bt-max-peers",category:"bittorrent"},{key:"bt-request-peer-speed-limit",category:"bittorrent"},{key:"bt-remove-unselected-file",category:"bittorrent"},{key:"bt-stop-timeout",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"bt-tracker",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"bt-exclude-tracker",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"seed-ratio",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"seed-time",category:"bittorrent",canUpdate:"new|waiting|paused"},{key:"conditional-get",category:"global",canShow:"new"},{key:"check-integrity",category:"global"},{key:"file-allocation",category:"global",canShow:"new"},{key:"parameterized-uri",category:"global",canShow:"new"},{key:"force-save",category:"global"}]})}(),function(){"use strict";angular.module("ariaNg").constant("aria2Errors",{1:{descriptionKey:"error.unknown"},2:{descriptionKey:"error.operation.timeout"},3:{descriptionKey:"error.resource.notfound"},4:{descriptionKey:"error.resource.notfound.max-file-not-found"},5:{descriptionKey:"error.download.aborted.lowest-speed-limit"},6:{descriptionKey:"error.network.problem"},8:{descriptionKey:"error.resume.notsupported"},9:{descriptionKey:"error.space.notenough"},10:{descriptionKey:"error.piece.length.different"},11:{descriptionKey:"error.download.sametime"},12:{descriptionKey:"error.download.torrent.sametime"},13:{descriptionKey:"error.file.exists"},14:{descriptionKey:"error.file.rename.failed"},15:{descriptionKey:"error.file.open.failed"},16:{descriptionKey:"error.file.create.failed"},17:{descriptionKey:"error.io.error"},18:{descriptionKey:"error.directory.create.failed"},19:{descriptionKey:"error.name.resolution.failed"},20:{descriptionKey:"error.metalink.file.parse.failed"},21:{descriptionKey:"error.ftp.command.failed"},22:{descriptionKey:"error.http.response.header.bad"},23:{descriptionKey:"error.redirects.toomany"},24:{descriptionKey:"error.http.authorization.failed"},25:{descriptionKey:"error.bencoded.file.parse.failed"},26:{descriptionKey:"error.torrent.file.corrupted"},27:{descriptionKey:"error.magnet.uri.bad"},28:{descriptionKey:"error.option.bad"},29:{descriptionKey:"error.server.overload"},30:{descriptionKey:"error.rpc.request.parse.failed"},32:{descriptionKey:"error.checksum.failed"}})}(),function(){"use strict";angular.module("ariaNg").constant("aria2RpcConstants",{rpcServiceVersion:"2.0",rpcServiceName:"aria2",rpcSystemServiceName:"system",rpcTokenPrefix:"token:"}).constant("aria2RpcErrors",{Unauthorized:{message:"Unauthorized",tipTextKey:"rpc.error.unauthorized"}})}(),function(){"use strict";angular.module("ariaNg").controller("CommandController",["$rootScope","$window","$location","$routeParams","ariaNgDefaultOptions","ariaNgCommonService","ariaNgLogService","ariaNgSettingService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c){var d=a.path();(function(n,d){return 0===n.indexOf("/new")?function(t,n){try{t=s.base64UrlDecode(t)}catch(e){return s.showError("URL is not base64 encoded!"),!1}var i={},r=!1;if(n){for(var d in n)n.hasOwnProperty(d)&&c.isOptionKeyValid(d)&&(i[d]=n[d]);"true"===n.pause&&(r=!0)}return e.loadPromise=l.newUriTask({urls:[t],options:i},r,(function(e){if(!e.success)return!1;r?a.path("/waiting"):a.path("/downloading")})),o.info("[CommandController] new download: "+t),!0}(d.url,d):0===n.indexOf("/settings/rpc/set")?function(e,n,l,c,d){if(l=l||i.rpcPort,c=c||i.rpcInterface,d=d||i.secret,o.info("[CommandController] set rpc: "+e+"://"+n+":"+l+"/"+c+", secret: "+d),!e||"http"!==e&&"https"!==e&&"ws"!==e&&"wss"!==e)return s.showError("Protocol is invalid!"),!1;if(!n)return s.showError("RPC host cannot be empty!"),!1;if(d)try{d=s.base64UrlDecode(d)}catch(e){return s.showError("RPC secret is not base64 encoded!"),!1}var u={rpcAlias:"",rpcHost:n,rpcPort:l,rpcInterface:c,protocol:e,httpMethod:i.httpMethod,rpcRequestHeaders:"",secret:d};return r.isRpcSettingEqualsDefault(u)?a.path("/downloading"):(r.setDefaultRpcSetting(u,{keepCurrent:!1,forceSet:!0}),a.path("/downloading"),t.location.reload()),!0}(d.protocol,d.host,d.port,d.interface,d.secret):(s.showError("Parameter is invalid!"),!1)})(d,angular.extend({},n,a.search()))||a.path("/downloading")}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgDebugController",["$rootScope","$scope","$location","$interval","$timeout","$filter","ariaNgConstants","ariaNgCommonService","ariaNgLocalizationService","ariaNgLogService","ariaNgKeyboardService","ariaNgSettingService","aria2RpcService",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var f=[{name:"logs",show:!0},{name:"rpc",show:!0}],g=null,m=function(){for(var e=[],t=0;t=0)},t.setLogLevelFilter=function(e){t.context.logLevelFilter=e},t.isSetLogLevelFilter=function(e){return t.context.logLevelFilter===e},t.getLogLevelFilter=function(){return t.context.logLevelFilter},t.setAutoRefreshInterval=function(e){t.context.logAutoRefreshInterval=e,g&&n.cancel(g),e>0&&(t.reloadLogs(),g=n((function(){t.reloadLogs()}),t.context.logAutoRefreshInterval))},t.reloadLogs=function(){t.context.logs=c.getDebugLogs().slice()},t.clearDebugLogs=function(){r.confirm("Confirm Clear","Are you sure you want to clear debug logs?","warning",(function(){c.clearDebugLogs(),t.reloadLogs()}),!1)},t.showLogDetail=function(e){t.context.currentLog=e,angular.element("#log-detail-modal").modal()},$("#log-detail-modal").on("hide.bs.modal",(function(e){t.context.currentLog=null})),t.executeAria2Method=function(){if(!t.context.rpcRequestMethod||t.context.rpcRequestMethod.indexOf(".")<0)r.showError("RPC method is illegal!");else{var e=t.context.rpcRequestMethod.split(".");if(2===e.length){var a=e[1];if(angular.isFunction(p[a])){var n={silent:!1,callback:function(e){t.context.rpcResponse=e?s("json")(e.data):s("json")(e)}},i={};try{i=angular.fromJson(t.context.rpcRequestParameters)}catch(e){return c.error("[AriaNgDebugController.executeAria2Method] failed to parse request parameters: "+t.context.rpcRequestParameters,e),void r.showError("RPC request parameters are invalid!")}for(var o in i)i.hasOwnProperty(o)&&"silent"!==o&&"callback"!==o&&(n[o]=i[o]);return p[a](n)}r.showError("AriaNg does not support this RPC method!")}else r.showError("RPC method is illegal!")}},t.requestParametersTextboxKeyDown=function(e){if(u.getKeyboardShortcuts())return d.isCtrlEnterPressed(e)&&t.executeMethodForm.$valid?(e.preventDefault&&e.preventDefault(),t.executeAria2Method(),!1):void 0},t.$on("$destroy",(function(){g&&n.cancel(g)})),e.swipeActions.extendLeftSwipe=function(){var e=m(),a=e.indexOf(t.context.currentTab);return a0&&(t.changeTab(e[a-1]),!0)},e.loadPromise=i((function(){u.isEnableDebugMode()?t.setAutoRefreshInterval(t.context.logAutoRefreshInterval):r.showError("Access Denied!",(function(){u.isEnableDebugMode()||a.path("/settings/ariang")}))}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("MainController",["$rootScope","$scope","$route","$window","$location","$document","$interval","clipboard","aria2RpcErrors","ariaNgCommonService","ariaNgVersionService","ariaNgNotificationService","ariaNgSettingService","ariaNgMonitorService","ariaNgTitleService","aria2TaskService","aria2SettingService","ariaNgKeyboardService","aria2eRecService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f,g,m,h,v,b){var k=null,y=null;e.defaultTaskPage=p.getDefaultTaskPage();var w="/"+e.defaultTaskPage,S=function(){var e=i.path().substring(1);return"all"===e||"downloading"===e||"waiting"===e||"stopped"===e?e:""},x=function(){var e=g.getFinalTitleByGlobalStat({globalStat:t.globalStat,currentRpcProfile:C()});s[0].title=e},T=function(e,a){return h.getGlobalStat((function(e){if(e.success||e.data.message!==l.Unauthorized.message){if(e.success){let a=e.data;t.globalStat=a,t.globalStat.numTotal=Number(a.numActive)+Number(a.numWaiting)+Number(a.numStopped),f.recordGlobalStat(e.data)}a&&a(e)}else o.cancel(y)}),e)},C=function(){if(!t.rpcSettings||t.rpcSettings.length<1)return null;for(var e=0;e0,data:f.getGlobalStatsData()},t.enableDebugMode=function(){return p.isEnableDebugMode()},t.quickSettingContext=null,t.rpcSettings=p.getAllRpcSettings(),t.currentRpcProfile=C(),t.currentRpcAlias=p.getCurrentRpcDisplayName(),t.isCurrentRpcUseWebSocket=p.isCurrentRpcUseWebSocket(),t.isTaskSelected=function(){return e.taskContext.getSelectedTaskIds().length>0},t.isSelectedTasksAllHaveUrl=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a1&&c.showError("Failed to change some tasks state."),!e.hasSuccess)return;let s=t.globalStat;T(!0,(function(o){let r=t.globalStat;e.hasError||"start"!==n||("/waiting"===i.path()&&o.success&&r.numActive>s.numActive?i.path("/downloading"):a.reload())})),e.hasError||"pause"!==n||("/downloading"===i.path()?i.path("/waiting"):a.reload())}),r.length>1))},t.retryTask=function(t){c.confirm("Confirm Retry","Are you sure you want to retry the selected task? AriaNg will create same task after clicking OK.","info",(function(){e.loadPromise=m.retryTask(t.gid,(function(e){if(e.success){T(!0);var t=p.getAfterRetryingTask();e.success&&e.data&&("task-list-default"===t?i.path()!==w?i.path(w):a.reload():"task-list-downloading"===t?"/downloading"!==i.path()?i.path("/downloading"):a.reload():"task-detail"===t?i.path("/task/detail/"+e.data):a.reload())}else c.showError("Failed to retry this task.")}),!1)}))},t.hasPausedTask=function(){return e.taskContext.hasPausedTask()},t.hasRetryableTask=function(){return e.taskContext.hasRetryableTask()},t.hasCompletedTask=function(){return e.taskContext.hasCompletedTask()},t.isSelectedTaskRetryable=function(){var t=e.taskContext.getSelectedTasks();if(t.length<1)return!1;for(var a=0;a1&&c.showError("Failed to remove some task(s)."),e.hasSuccess&&(T(!0),e.hasError||("/downloading"==i.path()?i.path("/stopped"):i.path().startsWith("/task/detail")?i.path(w):a.reload()))}),n.length>1,!!t)};const o=v.isShiftKeyPressed(t);if(p.getConfirmTaskRemoval()||o){let t=null;e.enhanced&&(t={input:"checkbox",inputValue:o,inputPlaceholder:"Remove downloaded file(s) simultaneously"}),c.confirm("Confirm Remove","Are you sure you want to remove the selected task?","warning",s,!1,t)}else s()},t.clearStoppedTasks=function(){c.confirm("Confirm Clear","Are you sure you want to clear stopped tasks?","warning",(function(){e.loadPromise=m.clearStoppedTasks((function(e){e.success&&(T(!0),"/stopped"!==i.path()?i.path(w):a.reload())}))}))},t.isAllTasksSelected=function(){return e.taskContext.isAllSelected()},t.selectAllTasks=function(){e.taskContext.selectAll()},t.selectAllPausedTasks=function(){e.taskContext.selectAllPaused()},t.selectAllFailedTasks=function(){e.taskContext.selectAllFailed()},t.selectAllCompletedTasks=function(){e.taskContext.selectAllCompleted()},t.copySelectedTasksDownloadLink=function(){for(var t=e.taskContext.getSelectedTasks(),a="",n=0;n0&&(a+="\n"),a+=t[n].singleUrl;a.length>0&&r.copyText(a)},t.copySelectedTasksMagnetLink=function(){for(var t=e.taskContext.getSelectedTasks(),a="",n=0;n0&&(a+="\n"),a+="magnet:?xt=urn:btih:"+t[n].infoHash;a.length>0&&r.copyText(a)},t.changeDisplayOrder=function(e,t){var a=S(),n=c.parseOrderType(p.getDisplayOrder(a)),i=c.parseOrderType(e);t&&i.type===n.type&&(i.reverse=!n.reverse),p.setDisplayOrder(i.getValue(),a)},t.isSetDisplayOrder=function(e){var t=S(),a=c.parseOrderType(p.getDisplayOrder(t)),n=c.parseOrderType(e);return a.equals(n)},t.showQuickSettingDialog=function(e,a){t.quickSettingContext={type:e,title:a}},t.switchRpcSetting=function(t){t.isDefault||(p.setDefaultRpcSetting(t),0===i.path().indexOf("/task/detail/")||0===i.path().indexOf("/settings/aria2/")?(e.setAutoRefreshAfterPageLoad(),i.path(w)):n.location.reload())},t.getOpenHandlerUrl=function(e,a){if(!t.currentRpcProfile||!t.currentRpcProfile.openHandlerUrl)return"";let n=t.currentRpcProfile.openHandlerUrl;if("string"!=typeof e||"string"!=typeof n)return"";let i="";const s=n.match(/\${relativepath:(\d+)}/);if(s){const t=parseInt(s[1]);i=t?c.getRelativeDir(e,t):""}return n.replace("${taskdir}",e).replace(/\${relativepath:(\d+)}/,i).replace("${taskname}",a)},p.getTitleRefreshInterval()>0&&(k=o((function(){x()}),p.getTitleRefreshInterval())),p.getGlobalStatRefreshInterval()>0&&(y=o((function(){T(!0)}),p.getGlobalStatRefreshInterval())),b.getRecManifestPromise().then((function(t){if(t){try{var a=n.navigator.language,s=p.getRecCount(),o=t.contents[0].regions||[],r=t.total>s,l=o.includes("all")||o.includes(a);e.hasNewRec=r&&l,e.recTotal=t.total}catch(t){e.hasNewRec=!1,e.recTotal=s}0===i.path().indexOf("/recommend")&&p.setRecCount(e.recTotal)}else e.hasNewRec=!1})).catch((function(t){e.hasNewRec=!1,e.recTotal=p.getRecCount()})),t.updateRecCount=function(){p.setRecCount(e.recCount),e.hasNewRec=!1},t.compactMode=p.getCompactMode(),t.$watch("compactMode",(function(e,t){p.setCompactMode(e)})),t.$on("$destroy",(function(){k&&o.cancel(k),y&&o.cancel(y)})),T(!0,(function(){x()}))}])}(),function(){"use strict";angular.module("ariaNg").controller("NewTaskController",["$rootScope","$scope","$location","$q","$timeout","ariaNgCommonService","ariaNgLogService","ariaNgKeyboardService","ariaNgFileService","ariaNgFileTypes","ariaNgSettingService","aria2TaskService","aria2SettingService","ariaNgNotificationService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f){var g,m=[{name:"links",show:!0},{name:"options",show:!0}],h=a.search(),v=function(){for(var e=[],t=0;t{e.isDir||t.pendingTasks.push(e)}))}};t.context={currentTab:"links",taskType:"urls",urls:"",uploadFiles:[],showUrlFilter:!1,lastChecked:-1,collapsedDirs:[],torrentTask:{},availableOptions:(g=p.getNewTaskOptionKeys(),p.getSpecifiedOptions(g,{disableRequired:!0})),globalOptions:null,options:{},optionFilter:{global:!0,http:!1,bittorrent:!1},exportCommandApiOptions:null,hasDownloadsPermission:s.hasDownloadsPermission()};const S=angular.copy(t.context);if(t.resetContext=function(){t.context=angular.copy(S),t.pendingTasks=[]},t.changeTab=function(e){"options"===e&&t.loadDefaultOption(),t.context.currentTab=e},e.swipeActions.extendLeftSwipe=function(){var e=v(),a=e.indexOf(t.context.currentTab);return a0&&(t.changeTab(e[a-1]),!0)},t.loadDefaultOption=function(){t.context.globalOptions||(e.loadPromise=p.getGlobalOption((function(e){e.success&&(t.context.globalOptions=e.data)})))},h.url){try{t.context.urls=decodeURI(s.base64UrlDecode(h.url))}catch(e){o.error("[NewTaskController] base64 decode error, url="+h.url,e)}t.context.urls?.startsWith("http")&&(t.context.optionFilter.http=!0,t.context.urls.includes("\n")||i((function(){"Connected"==e.taskContext.rpcStatus&&t.changeTab("options")}),1440,!1)),h.referer&&(t.context.options.referer=h.referer),h.header&&(t.context.options.header=h.header),h.filename&&(t.context.options.out=decodeURIComponent(h.filename)),h.dir&&(t.context.options.dir=decodeURIComponent(h.dir))}t.openTorrent=function(){l.openFileContent({scope:t,fileFilter:".torrent",fileType:"binary"},(function(e){t.context.uploadFiles.push(e),t.context.taskType="torrent",w(e.base64Content)}),(function(e){s.showError(e)}),angular.element("#file-holder"))},t.openMetalink=function(){l.openFileContent({scope:t,fileFilter:".meta4,.metalink",fileType:"binary"},(function(e){t.context.uploadFiles.push(e),t.context.taskType="metalink",t.changeTab("options")}),(function(e){s.showError(e)}),angular.element("#file-holder"))},t.dragEnterHandler=function(e,t){e.preventDefault(),t.focus(),t.addClass("has-warning");let a=e.originalEvent.dataTransfer.items;(a.length>1||"file"!=a[0].kind)&&t.removeClass("has-warning").addClass("has-error")},t.dragLeaveHandler=function(e,t){e.preventDefault(),t.blur(),t.removeClass("has-warning has-error")},t.dropHandler=function(e,a){e.preventDefault(),a.removeClass("has-warning has-error");const n=e.originalEvent.dataTransfer.files,o=e.originalEvent.dataTransfer.items;for(const e of o)"string"==e.kind&&"text/uri-list"==e.type&&(t.context.urls&&!t.context.urls.endsWith("\n")?t.context.urls+="\n":angular.isUndefined(t.context.urls)&&(t.context.urls=""),e.getAsString((function(e){t.$apply((function(){t.context.urls+=e+"\n"}))})));for(const e of n){if(t.context.taskType&&"urls"!==t.context.taskType){if(!e.name.toLowerCase().endsWith(t.context.taskType))continue}else if(e.name.toLowerCase().endsWith(".torrent"))t.context.taskType="torrent";else{if(!e.name.toLowerCase().endsWith(".meta4")&&!e.name.toLowerCase().endsWith(".metalink"))continue;t.context.taskType="metalink"}const a={fileName:e.name},n=new FileReader;n.onload=function(){a.base64Content=n.result.replace(/.*?base64,/,""),t.context.uploadFiles.push(a),"torrent"===t.context.taskType?(t.context.optionFilter.bittorrent=!0,i((function(){w(a.base64Content)}))):t.changeTab("options")},n.onerror=function(){s.showError("Failed to load file!")},n.readAsDataURL(e)}},t.isNewTaskValid=function(){return t.context.uploadFiles.length?"torrent"!==t.context.taskType||t.isAnyFileSelected():t.newTaskForm.$valid},t.startDownload=function(i,s){var o=function(e){if(e.hasSuccess||e.success){var t=null;e.results&&e.results.length>0?t=e.results[0]:e&&(t=e),"task-detail"===d.getAfterCreatingNewTask()&&t&&t.data?a.path("/task/detail/"+t.data):"all"===d.getDefaultTaskPage()?a.path("/all"):i?a.path("/waiting"):a.path("/downloading")}};"urls"===t.context.taskType?t.context.hasDownloadsPermission&&"Connected"!==e.taskContext.rpcStatus?(f.notifyInPage("","Aria2 is disconnected, All tasks will be downloaded via Browser. Invalid URL will be ignored.",{type:"info",delay:6e3}),e.loadPromise=t.invokeBrowserDownload(s)):e.loadPromise=y(i,o):"torrent"===t.context.taskType?e.loadPromise=function(e,a){var i=[],s=angular.copy(t.context.options);b(s);for(const n of t.context.uploadFiles){x(),t.context.torrentTask.selectedFileIndex&&(s["select-file"]=t.context.torrentTask.selectedFileIndex);var o={content:n.base64Content,options:s};i.push(u.newTorrentTask(o,e,a))}return n.all(i)}(i,o):"metalink"===t.context.taskType&&(e.loadPromise=function(e,a){var i=[],s=angular.copy(t.context.options);b(s);for(const n of t.context.uploadFiles){var o={content:n.base64Content,options:s};i.push(u.newMetalinkTask(o,e,a))}return n.all(i)}(i,o))},t.invokeBrowserDownload=function(e){let n=function(){"all"===d.getDefaultTaskPage()?a.path("/all"):a.path("/downloading")};if(t.context.hasDownloadsPermission){let a=s.parseUrlsFromOriginInput(t.context.urls,"^(https?|ftp)://.+$");if(a.length>1)s.confirm("Download via Browser","Confirm to download multiple URLs from Browser simultaneously?","warning",(function(){let e={url:t.context.urls};chrome.runtime.sendMessage({type:"DOWNLOAD_VIA_BROWSER",data:e}).then(n)}),!1,null,(function(){e&&e.preventDefault()}));else if(1===a.length){let e={url:t.context.urls,filename:t.context.options.out};return chrome.runtime.sendMessage({type:"DOWNLOAD_VIA_BROWSER",data:e}).then(n)}}e&&e.preventDefault()},t.showExportCommandAPIModal=function(){t.context.exportCommandApiOptions={type:"new-task",data:k()}},t.setOption=function(e,a,n){""===a&&p.isOptionKeyRequired(e)?delete t.context.options[e]:t.context.options[e]=a,n.setReady()},t.urlTextboxKeyDown=function(e){if(d.getKeyboardShortcuts())return r.isCtrlEnterPressed(e)&&t.newTaskForm.$valid?(e.preventDefault&&e.preventDefault(),t.startDownload(),!1):void 0},t.getValidUrlsCount=function(){let e=0;if(t.context.showUrlFilter)for(const a of t.pendingTasks)t.filterTask(a)&&a.selected&&e++;else{var a=s.parseUrlsFromOriginInput(t.context.urls);e=a?a.length:0}return e},t.showUrlFilter=function(){t.context.showUrlFilter?(t.cancelUrlFilter(),e.searchContext.enabledInPage=!1):((!t.pendingTasks||"urls"===t.context.taskType&&t.newTaskForm.urls.$dirty)&&(t.pendingTasks=k()),e.searchContext.enabledInPage=!0,t.context.showUrlFilter=!0)},t.cancelUrlFilter=function(){t.context.showUrlFilter&&(t.context.showUrlFilter=!1,e.searchContext.enabledInPage=!1)},t.isAnyFileSelected=function(){if(!t.pendingTasks||!t.pendingTasks.length)return!1;for(var e=0;e=0&&(i.push(r),l.selected||(o=!1))}}for(r=0;r0&&"."===i.charAt(0)&&(i=i.substring(1)),g={extension:i,classified:!1,selected:!1,selectedCount:0,unSelectedCount:0},a[n]=g}o.selected?(g.selected=!0,g.selectedCount++):g.unSelectedCount++}var o={};for(var r in c)if(c.hasOwnProperty(r)){for(var l=c[r].name,d=c[r].extensions,u=[],p=0;p0&&(o[r]={name:l,extensions:u})}var f=[];for(var n in a){var g;if(a.hasOwnProperty(n))(g=a[n]).classified||f.push(g)}f.length>0&&(o.other={name:"Other",extensions:f}),t.context.fileExtensions=o,angular.element("#custom-choose-file-modal").modal()}},t.setSelectedExtension=function(e,a){if(t.pendingTasks&&t.pendingTasks.length){var n=t.pendingTasks;for(const o of n){var i="";"urls"===t.context.taskType?i=s.getFileExtensionFromUrl(o.urls[0]):"torrent"===t.context.taskType&&(i=s.getFileExtension(o.path)),i&&(i=i.toLowerCase()),i==="."+e&&(o.selected=a)}}},t.onTaskClick=function(e,a){let n=t.context.lastChecked,i=t.pendingTasks;if(e<0||!Array.isArray(i)||i.length<1)return;let s=i[e].selected=!i[e].selected;if(a.shiftKey&&-1!==n){let t=n=0)},e.keydownActions.selectAll=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.selectFiles("auto")})),!1},$("#custom-choose-file-modal").on("hide.bs.modal",(function(e){t.context.fileExtensions=null}));var x=function(){if(!t.context.torrentTask||!t.context.torrentTask.files)return;let e=[];for(const a of t.context.torrentTask.files)a&&a.selected&&!a.isDir&&e.push(a.index);e.length&&(t.context.torrentTask.selectedFileIndex=e.join(","))},T=function(e){if(e){var t=0,a=0;if(e.files&&e.files.length)for(var n=0;n0&&t===e.subDirs.length+e.files.length,e.partialSelected=t>0&&t0}},C=function(){if(t.context.torrentTask&&t.context.torrentTask.multiDir)for(var e=0;e0)for(var i=0;i0&&(d.processDownloadTasks(e.taskContext.list),!a)){var o=!1;for(i=0;i0}else t.data.message===r.Unauthorized.message&&s.cancel(f)}),t)};t.getOrderType=function(){return c.getDisplayOrder(p)},t.openDownloadFolder=function(e,i){if(e.stopPropagation(),0!==e.button||!i.files||i.files.length<1)return;let s="aria2://browse/path="+(i.files.length>1?i.dir+i.taskName:i.files[0].path);t.currentRpcProfile&&t.currentRpcProfile.openHandlerUrl&&(s=t.getOpenHandlerUrl(i.dir,i.taskName)),a.location.href=s,setTimeout((()=>{v||l.confirm("Install Aria2 Manager","Aria2 Manager is not installed, go to Alex Recommends channel for more information?","info",(function(){n.path("recommend").search("path","/posts/3").hash("usage")}))}),1200)},t.onTaskClick=function(t,a,n){if(t<0||!Array.isArray(n)||n.length<1)return;let i=n[t].gid,s=c.getKeyboardShortcuts(),o=a.originalEvent?.sourceCapabilities?.firesTouchEvents||!1;if(2==a.button&&e.taskContext.selected[i])return;if(!(o||0==a.button&&(!s&&!u.isModifierKeyPressed(a)||s&&u.isModifierKeyPressed(a)||a.shiftKey)))for(const t in e.taskContext.selected)t!==i&&(e.taskContext.selected[t]=!1);let r=e.taskContext.selected[i]=!e.taskContext.selected[i];if(a.shiftKey&&0==a.button&&-1!==h){let a=h0&&(f=s((function(){b(!0)}),c.getDownloadTaskRefreshInterval())),o.options(t,"task-list",{revertOnSpill:!0,moves:function(){return t.isSupportDragTask()}}),t.$on("task-list.drop-model",(function(e,t,a){var n=angular.element(t),i=n.attr("data-gid"),s=n.index();g=!0,d.changeTaskPosition(i,s,(function(){g=!1}),!0)})),angular.element(a).on("blur",(function(){v=!0})),t.$on("$destroy",(function(){g=!0,f&&s.cancel(f)})),e.keydownActions.selectAll=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.selectAllTasks()})),!1},e.keydownActions.delete=function(e){return e.preventDefault&&e.preventDefault(),t.$apply((function(){t.removeTasks(e)})),!1},e.loadPromise=b(!1),t.isWindows="Windows"==navigator?.userAgentData?.platform||"Win32"==navigator?.platform,t.isRpcLocalhost=c.isCurrentRpcLocalhost(),t.location=p}])}(),function(){"use strict";angular.module("ariaNg").controller("TaskDetailController",["$rootScope","$scope","$routeParams","$location","$interval","clipboard","aria2RpcErrors","ariaNgFileTypes","ariaNgCommonService","ariaNgSettingService","ariaNgMonitorService","aria2TaskService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u,p){var f=[{name:"overview",show:!0},{name:"pieces",show:!0},{name:"filelist",show:!0},{name:"btpeers",show:!0}],g=null,m=!1,h=null,v=!0,b=!1,k=function(){for(var e=[],t=0;t0&&t===e.subDirs.length+e.files.length,e.partialSelected=t>0&&t0}},R=function(){if(t.task&&t.task.multiDir)for(var e=0;e0,showPiecesInfo:"never"!==c.getShowPiecesInfoInTaskDetailPage(),showChooseFilesToolbar:!1,fileExtensions:[],collapsedDirs:{},btPeers:[],healthPercent:0,collapseTrackers:!0,statusData:d.getEmptyStatsData(a.gid),availableOptions:[],options:[]},t.changeTab=function(a){"settings"===a&&t.loadTaskOption(t.task),t.context.currentTab=a,e.skipLocationChange=!0,n.search("tab",a).replace()},e.swipeActions.extendLeftSwipe=function(){var e=k(),a=e.indexOf(t.context.currentTab);return a0&&(t.changeTab(e[a-1]),!0)},t.changeFileListDisplayOrder=function(e,a){if(!t.task||!t.task.multiDir){var n=l.parseOrderType(c.getFileListDisplayOrder()),i=l.parseOrderType(e);a&&i.type===n.type&&(i.reverse=!n.reverse),c.setFileListDisplayOrder(i.getValue())}},t.isSetFileListDisplayOrder=function(e){var t=l.parseOrderType(c.getFileListDisplayOrder()),a=l.parseOrderType(e);return t.equals(a)},t.getFileListOrderType=function(){return t.task&&t.task.multiDir?null:c.getFileListDisplayOrder()},t.showChooseFilesToolbar=function(){t.context.showChooseFilesToolbar?t.cancelChooseFiles():(m=!0,t.context.showChooseFilesToolbar=!0)},t.isAnyFileSelected=function(){if(!t.task||!t.task.files)return!1;for(var e=0;e=0&&(i.push(o),d.selected||(s=!1))}}for(o=0;o0&&"."===s.charAt(0)&&(s=s.substring(1)),m={extension:s,classified:!1,selected:!1,selectedCount:0,unSelectedCount:0},a[g]=m}i.selected?(m.selected=!0,m.selectedCount++):m.unSelectedCount++}}var o={};for(var c in r)if(r.hasOwnProperty(c)){var d=r[c].name,u=r[c].extensions,p=[];for(n=0;n0&&(o[c]={name:d,extensions:p})}var f=[];for(var g in a){var m;if(a.hasOwnProperty(g))(m=a[g]).classified||f.push(m)}f.length>0&&(o.other={name:"Other",extensions:f}),t.context.fileExtensions=o,angular.element("#custom-choose-file-modal").modal()}},t.setSelectedExtension=function(e,a){if(t.task&&t.task.files){for(var n=t.task.files,i=0;i span").text().trim(),t="";if(h.find(".setting-value > span").each((function(e,a){e>0&&(t+="\n"),t+=angular.element(a).text().trim()})),c.getIncludePrefixWhenCopyingFromTaskDetails()){var a=e+": "+t;s.copyText(a)}else s.copyText(t)}},b="settings"===t.context.currentTab&&!t.context.options.length,c.getDownloadTaskRefreshInterval()>0&&(g=i((function(){!t.task||"complete"!==t.task.status&&"error"!==t.task.status&&"removed"!==t.task.status?T(!0):i.cancel(g)}),c.getDownloadTaskRefreshInterval())),t.$on("$destroy",(function(){g&&i.cancel(g)})),t.onOverviewMouseDown=function(){angular.element('#overview-items .row[contextmenu-bind!="true"]').contextmenu({target:"#task-overview-contextmenu",before:function(e,t){h=t}}).attr("contextmenu-bind","true")},angular.element("#task-overview-contextmenu").on("hide.bs.context",(function(){h=null})),e.loadPromise=T(!1),t.isWindows="Windows"==navigator?.userAgentData?.platform||"Win32"==navigator?.platform,t.isRpcLocalhost=c.isCurrentRpcLocalhost(),t.backHome=function(){window.history.length>1?window.history.back():n.path("")}}])}(),function(){"use strict";angular.module("ariaNg").controller("AriaNgSettingsController",["$rootScope","$scope","$routeParams","$location","$window","$interval","$timeout","$filter","clipboard","ariaNgLanguages","ariaNgCommonService","ariaNgVersionService","ariaNgKeyboardService","ariaNgNotificationService","ariaNgLocalizationService","ariaNgLogService","ariaNgFileService","ariaNgSettingService","ariaNgMonitorService","ariaNgTitleService","aria2SettingService",function(e,t,a,n,i,s,o,r,l,c,d,u,p,f,g,m,h,v,b,k,y){var w=a.extendType,S=null,x=function(){return k.getFinalTitleByGlobalStat({globalStat:b.getCurrentGlobalStat(),currentRpcProfile:T()})},T=function(){if(!t.context||!t.context.rpcSettings||t.context.rpcSettings.length<1)return null;for(var e=0;e0?(t.changeRpcTab(e-1),!0):0===e&&(t.changeGlobalTab(),!0)},t.isSupportNotification=function(){return f.isSupportBrowserNotification()&&v.isCurrentRpcUseWebSocket(t.context.settings.protocol)},t.setLanguage=function(e){v.setLanguage(e)&&g.applyLanguage(e),t.updateTitlePreview()},t.setTheme=function(t){v.setTheme(t),e.setTheme(t)},t.setDebugMode=function(e){v.setDebugMode(e)},t.setTitle=function(e){v.setTitle(e)},t.setEnableBrowserNotification=function(e){v.setBrowserNotification(e),e&&!f.hasBrowserPermission()&&f.requestBrowserPermission((function(e){e.granted||(t.context.settings.browserNotification=!1,d.showError("You have disabled notification in your browser. You should change your browser's settings before you enable this function."))}))},t.setBrowserNotificationSound=function(e){v.setBrowserNotificationSound(e)},t.setBrowserNotificationFrequency=function(e){v.setBrowserNotificationFrequency(e)},t.setWebSocketReconnectInterval=function(e){C(),v.setWebSocketReconnectInterval(e)},t.setTitleRefreshInterval=function(e){C(),v.setTitleRefreshInterval(e)},t.setGlobalStatRefreshInterval=function(e){C(),v.setGlobalStatRefreshInterval(e)},t.setDownloadTaskRefreshInterval=function(e){C(),v.setDownloadTaskRefreshInterval(e)},t.setRPCListDisplayOrder=function(e){C(),v.setRPCListDisplayOrder(e)},t.setDefaultTaskPage=function(t){e.defaultTaskPage=t,v.setDefaultTaskPage(t)},t.setTaskListIndependentDisplayOrder=function(e){v.setTaskListIndependentDisplayOrder(e)},t.setKeyboardShortcuts=function(e){v.setKeyboardShortcuts(e)},t.setSwipeGesture=function(e){v.setSwipeGesture(e)},t.setDragAndDropTasks=function(e){v.setDragAndDropTasks(e)},t.setAfterCreatingNewTask=function(e){v.setAfterCreatingNewTask(e)},t.setRemoveOldTaskAfterRetrying=function(e){v.setRemoveOldTaskAfterRetrying(e)},t.setPauseAfterRetry=function(e){v.setPauseAfterRetry(e)},t.setConfirmTaskRemoval=function(e){v.setConfirmTaskRemoval(e)},t.setIncludePrefixWhenCopyingFromTaskDetails=function(e){v.setIncludePrefixWhenCopyingFromTaskDetails(e)},t.setShowPiecesInfoInTaskDetailPage=function(e){v.setShowPiecesInfoInTaskDetailPage(e)},t.setAfterRetryingTask=function(e){v.setAfterRetryingTask(e)},t.showImportSettingsModal=function(){t.context.importSettings=null,angular.element("#import-settings-modal").modal()},$("#import-settings-modal").on("hide.bs.modal",(function(e){t.context.importSettings=null})),t.openAriaNgConfigFile=function(){h.openFileContent({scope:t,fileFilter:".json",fileType:"text"},(function(e){t.context.importSettings=e.content}),(function(e){d.showError(e)}),angular.element("#import-file-holder"))},t.importSettings=function(e){var t=null;try{t=JSON.parse(e)}catch(e){return m.error("[AriaNgSettingsController.importSettings] parse settings json error",e),void d.showError("Invalid settings data format!")}if(!angular.isObject(t)||angular.isArray(t))return m.error("[AriaNgSettingsController.importSettings] settings json is not object"),void d.showError("Invalid settings data format!");t&&d.confirm("Confirm Import","Are you sure you want to import all settings?","warning",(function(){v.importAllOptions(t),i.location.reload()}))},t.showExportSettingsModal=function(){t.context.exportSettings=r("json")(v.exportAllOptions()),t.context.exportSettingsCopied=!1,angular.element("#export-settings-modal").modal()},$("#export-settings-modal").on("hide.bs.modal",(function(e){t.context.exportSettings=null,t.context.exportSettingsCopied=!1})),t.copyExportSettings=function(){l.copyText(t.context.exportSettings,{container:angular.element("#export-settings-modal")[0]}),t.context.exportSettingsCopied=!0},t.addNewRpcSetting=function(){C();var e=v.addNewRpcSetting();t.context.rpcSettings.push(e),t.changeRpcTab(t.context.rpcSettings.length-1)},t.updateRpcSetting=function(e,t){C(),"protocol"!==t||e[t]||(e[t]="http"),v.updateRpcSetting(e,t)},t.removeRpcSetting=function(e){var a=e.rpcAlias?e.rpcAlias:e.rpcHost+":"+e.rpcPort;d.confirm("Confirm Remove",'Are you sure you want to remove rpc setting "{rpcName}"?',"warning",(function(){C();var a=t.getCurrentRpcTabIndex(),n=t.context.rpcSettings.indexOf(e);v.removeRpcSetting(e),t.context.rpcSettings.splice(n,1),a>=t.context.rpcSettings.length?t.changeRpcTab(t.context.rpcSettings.length-1):a<=0||a<=n||t.changeRpcTab(a-1)}),!1,{textParams:{rpcName:a}})},t.showExportCommandAPIModal=function(e){t.context.exportCommandApiOptions={type:"setting",data:e}},t.setDefaultRpcSetting=function(e){e.isDefault||(v.setDefaultRpcSetting(e),i.location.reload())},t.resetSettings=function(){d.confirm("Confirm Reset","Are you sure you want to reset all settings?","warning",(function(){v.resetSettings(),i.location.reload()}))},t.clearHistory=function(){d.confirm("Confirm Clear","Are you sure you want to clear all settings history?","warning",(function(){y.clearSettingsHistorys(),i.location.reload()}))},t.resetAria2Settings=function(){d.confirm("Confirm Reset","Reset the current Aria2 settings (Will take effect after Aria2 restarts)?","warning",(function(){const e=v.getRpcOptions(),t=y.getDefaultOptions(Object.keys(e));y.setGlobalOptions(t,(function(){const e=v.getCurrentRpcDisplayName();f.notifyInPage("","settings are reset",{type:"success",contentPrefix:e+" "})})),v.resetRpcOptions()}))},e.loadPromise=o((function(){angular.element('[data-toggle="popover"]').popover()}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2SettingsController",["$rootScope","$scope","$location","ariaNgConstants","ariaNgCommonService","aria2SettingService","ariaNgSettingService","ariaNgLocalizationService",function(e,t,a,n,i,s,o,r){var l=a.path().substring(a.path().lastIndexOf("/")+1);t.context={availableOptions:function(e){var t=s.getAvailableGlobalOptionsKeys(e);if(t)return s.getSpecifiedOptions(t);i.showError("Type is illegal!")}(l),globalOptions:[]},t.setGlobalOption=function(e,t,a){return s.setGlobalOption(e,t,(function(n){n.success&&"OK"===n.data?(a.setSuccess(),o.setRpcOption(e,t)):a.setFailed(n.data.message)}),!0)},e.searchContext.enabledInPage=!0,t.filterOption=function(t){if(!(t&&angular.isObject(t)&&angular.isString(t.key)&&angular.isString(t.nameKey)))return!1;if(!e.searchContext||!e.searchContext.text)return!0;let a=!1;const n=e.searchContext.text.toLowerCase();return a|=t.key.toLowerCase().includes(n),a|=r.getLocalizedText(t.nameKey).includes(n),a},e.loadPromise=s.getGlobalOption((function(e){e.success&&(t.context.globalOptions=e.data)}))}])}(),function(){"use strict";angular.module("ariaNg").controller("Aria2StatusController",["$rootScope","$scope","$timeout","ariaNgCommonService","ariaNgSettingService","aria2SettingService",function(e,t,a,n,i,s){t.context={host:i.getCurrentRpcUrl(),serverStatus:null,isSupportReconnect:s.canReconnect()},t.reconnect=function(){!t.context.isSupportReconnect||"Disconnected"!==e.taskContext.rpcStatus&&"Waiting to reconnect"!==e.taskContext.rpcStatus||s.reconnect()},t.saveSession=function(){return s.saveSession((function(e){e.success&&"OK"===e.data&&n.showOperationSucceeded("Session has been saved successfully.")}))},t.shutdown=function(){n.confirm("Confirm Shutdown","Are you sure you want to shutdown aria2?","warning",(function(e){e&&e.success&&"OK"===e.data&&n.showOperationSucceeded("Aria2 has been shutdown successfully.")}),!0,null,null,(function(e){s.shutdown((function(t){e(t)}))}))},e.$watch("taskContext.rpcStatus",(function(e){"Connected"===e?(s.getAria2Status((function(e){e.success&&(t.context.serverStatus=e.data)})),s.getSessionInfo((function(e){e.success&&(t.context.sessionInfo=e.data)}))):(t.context.serverStatus=null,t.context.sessionInfo=null)})),e.loadPromise=a((function(){}),100)}])}(),function(){"use strict";angular.module("ariaNg").controller("RecommendController",["$rootScope","$scope","$location","$sce","aria2eConstants","ariaNgSettingService",function(e,t,a,n,i,s){let o=a.search().path||"",r=a.hash()?"#"+a.hash():"",l=s.getLanguage()||"en";l="zh_Hans"==l?"":"zh_Hant"==l?"/zh-tw":"/en",t.recommendUrl=n.trustAsResourceUrl(i.recommendOrigin+l+o+r);var c=s.getRecCount();e.recTotal>c&&s.setRecCount(e.recTotal),e.hasNewRec=!1}])}(),function(){"use strict";angular.module("ariaNg").directive("ngAutoFocus",["$timeout",function(e){return{restrict:"A",link:function(t,a){e((function(){a[0].focus()}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngPieceBar",["aria2TaskService",function(e){return{restrict:"E",template:'',replace:!0,scope:{bitField:"=",pieceCount:"=",color:"@"},link:function(t,a){var n=function(){var n=a[0],i=e.getCombinedPieces(t.bitField,t.pieceCount),s=n.getContext("2d");s.fillStyle=t.color||"#000",s.clearRect(0,0,n.width,n.height);for(var o=0,r=n.width,l=n.height,c=0;c',replace:!0,scope:{bitField:"=",pieceCount:"="},link:function(t,a){var n=[],i=[],s=function(){i=e.getPieceStatus(t.bitField,t.pieceCount),n.length=0,a.empty();for(var s=Math.max(1,i.length),o=0;o');n.push(r),a.append(r)}};t.$watch("bitField",(function(){!function(){var a=e.getPieceStatus(t.bitField,t.pieceCount);if(i&&a&&i.length===a.length&&a.length===n.length){for(var o=0;o",scope:{options:"=ngData",theme:"=ngTheme"},link:function(a,n,i){angular.extend({},i);var s=n.find("div"),o=n.parent().height(),r=parseInt(i.height)||o||200;s.css("height",r+"px");var l=echarts.init(s[0],t.get(a.theme)),c=function(){l.resize(),a.$apply()};angular.element(e).on("resize",c),a.$watch("options",(function(e){e&&function(e){l.setOption(e)}(e)}),!0),a.$on("$destroy",(function(){l&&!l.isDisposed()&&l.dispose(),angular.element(e).off("resize",c)}))}}}]).directive("ngPopChart",["$window","chartTheme",function(e,t){return{restrict:"A",scope:{options:"=ngData",theme:"=ngTheme"},link:function(e,a,n){var i={ngPopoverClass:"",ngContainer:"body",ngTrigger:"click",ngPlacement:"top"};angular.extend(i,n);var s=null,o='
';a.popover({container:i.ngContainer,content:'
'+o+"
",html:!0,placement:i.ngPlacement,template:'',trigger:i.ngTrigger}).on("shown.bs.popover",(function(){var a=angular.element(".chart-pop"),i=a.parent().height();a.empty();var o=parseInt(n.height)||i||200;a.css("height",o+"px"),s=echarts.init(a[0],t.get(e.theme))})).on("hide.bs.popover",(function(){s&&!s.isDisposed()&&s.dispose()})).on("hidden.bs.popover",(function(){angular.element(".chart-pop").empty().append(o)}));e.$watch("options",(function(e){e&&function(e){s&&!s.isDisposed()&&s.setOption(e)}(e)}),!0)}}}]).factory("chartTheme",["chartDefaultTheme","chartDarkTheme",function(e,t){var a={defaultTheme:e,darkTheme:t};return{get:function(e){return"default"!==e&&a[e+"Theme"]?angular.extend({},a.defaultTheme,a[e+"Theme"]):a.defaultTheme}}}]).factory("chartDefaultTheme",(function(){return{color:["#74a329","#3a89e9"],legend:{top:"bottom"},toolbox:{show:!1},tooltip:{show:!0,trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",axisPointer:{type:"line",lineStyle:{color:"#233333",type:"dashed",width:1},crossStyle:{color:"#008acd",width:1},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},grid:{x:40,y:20,x2:30,y2:50},categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#f3f3f3"}}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#f3f3f3"}},splitArea:{show:!1}},line:{itemStyle:{normal:{lineStyle:{width:2,type:"solid"}}},smooth:!0,symbolSize:6},textStyle:{fontFamily:"Hiragino Sans GB, Microsoft YaHei, STHeiti, Helvetica Neue, Helvetica, Arial, sans-serif"},animationDuration:500}})).factory("chartDarkTheme",(function(){return{tooltip:{show:!0,trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.7)",axisPointer:{type:"line",lineStyle:{color:"#ddd",type:"dashed",width:1},crossStyle:{color:"#ddd",width:1},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},categoryAxis:{axisLine:{show:!1},axisTick:{show:!1},splitLine:{lineStyle:{color:"#333"}}},valueAxis:{axisLine:{show:!1},axisTick:{show:!1},axisLabel:{show:!0,textStyle:{color:"#eee"}},splitLine:{lineStyle:{color:"#333"}},splitArea:{show:!1}}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngDragenter",(function(){return{restrict:"A",link:function(e,t,a){t.on("dragenter",(function(n){e.$eval(a.ngDragenter,{$event:n,element:t})}))}}})),angular.module("ariaNg").directive("ngDragover",(function(){return{restrict:"A",link:function(e,t,a){t.on("dragover",(function(n){e.$eval(a.ngDragover,{$event:n,element:t})}))}}})),angular.module("ariaNg").directive("ngDragleave",(function(){return{restrict:"A",link:function(e,t,a){t.on("dragleave",(function(n){e.$eval(a.ngDragleave,{$event:n,element:t})}))}}})),angular.module("ariaNg").directive("ngDrop",(function(){return{restrict:"A",link:function(e,t,a){t.on("drop",(function(n){e.$eval(a.ngDrop,{$event:n,element:t})}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngExportCommandApiDialog",["clipboard","ariaNgCommonService",function(e,t){return{restrict:"E",templateUrl:"views/export-command-api-dialog.html",replace:!0,scope:{options:"="},link:function(a,n,i){a.context={trueFalseOptions:[{name:"Enabled",value:!0},{name:"Disabled",value:!1}],baseUrl:t.getFullPageUrl(),commandAPIUrl:null,pauseOnAdded:!0,isCopied:!1};var s=function(){var e=a.context.baseUrl;return e.indexOf("#")>=0&&(e=e.substring(0,e.indexOf("#"))),e},o=function(e){var n=s()+"#!/new/task?url="+t.base64UrlEncode(e.urls[0]);if(a.context.pauseOnAdded&&(n+="&pause=true"),e.options)for(var i in e.options)e.options.hasOwnProperty(i)&&(n+="&"+i+"="+e.options[i]);return n};a.generateCommandAPIUrl=function(){var e,n;a.options&&("new-task"===a.options.type?a.context.commandAPIUrl=function(e){for(var t="",a=0;a0&&(t+="\n"),t+=o(e[a]);return t}(a.options.data):"setting"===a.options.type&&(a.context.commandAPIUrl=(e=a.options.data,n=s()+"#!/settings/rpc/set?protocol="+e.protocol+"&host="+e.rpcHost+"&port="+e.rpcPort+"&interface="+e.rpcInterface,e.secret&&(n+="&secret="+t.base64UrlEncode(e.secret)),n)),a.context.isCopied=!1)},a.copyCommandAPI=function(){e.copyText(a.context.commandAPIUrl,{container:angular.element(n)[0]}),a.context.isCopied=!0},angular.element(n).on("hidden.bs.modal",(function(){a.$apply((function(){a.options=null,a.context.commandAPIUrl=null,a.context.isCopied=!1}))})),a.$watch("options",(function(e){e&&(a.generateCommandAPIUrl(),a.context.isCopied=!1,angular.element(n).modal("show"))}),!0)}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngIndeterminate",(function(){return{restrict:"A",scope:{indeterminate:"=ngIndeterminate"},link:function(e,t){e.$watch("indeterminate",(function(){t[0].indeterminate="true"===e.indeterminate||!0===e.indeterminate}))}}}))}(),angular.module("inputDropdown",[]).directive("inputDropdown",[function(){return{restrict:"E",require:"?ngModel",scope:{defaultDropdownItems:"=",selectedItem:"=",allowCustomInput:"=",inputRequired:"=",disabled:"=",inputName:"@",inputClassName:"@",inputPlaceholder:"@",onlyShowNonEmptyDropdown:"@",filterListMethod:"&",valueChangedMethod:"&",itemSelectedMethod:"&",removeItemMethod:"&"},template:'
  • {{item.readableName}}{{item}}
',controller:["$scope",function(e){this.getSelectedItem=function(){return e.selectedItem},this.isRequired=function(){return e.inputRequired},this.customInputAllowed=function(){return e.allowCustomInput},this.getInput=function(){return e.inputValue}}],link:function(e,t,a,n){var i=!1,s=t.find("input").isolateScope();e.activeItemIndex=0,e.inputValue="",e.dropdownVisible=!1,e.dropdownItems=e.defaultDropdownItems||[],n&&e.$watch((function(){return n.$viewValue}),(function(t){e.inputValue=t})),e.$watch("dropdownItems",(function(t,a){angular.equals(t,a)||(e.allowCustomInput?e.setInputActive():e.setActive(0))})),e.$watch("selectedItem",(function(t,a){s.updateInputValidity(),angular.equals(t,a)||t&&(e.inputValue="string"==typeof t?t:t.readableName)})),e.setInputActive=function(){e.setActive(-1)},e.setActive=function(t){e.activeItemIndex=t},e.inputChange=function(){if(e.selectedItem=null,o(),u(e.inputValue,"input"),e.inputValue){if(e.allowCustomInput&&s.updateInputValidity(),e.filterListMethod){var t=e.filterListMethod({userInput:e.inputValue});t&&t.then((function(t){e.dropdownItems=t}))}}else e.dropdownItems=e.defaultDropdownItems||[]},e.inputFocus=function(){e.allowCustomInput?e.setInputActive():e.setActive(0),o()},e.inputBlur=function(e){i?i=!1:r()},e.dropdownPressed=function(){i=!0},e.selectItem=function(t){e.selectedItem=t,r(),u(t,"select"),e.itemSelectedMethod&&e.itemSelectedMethod({item:t})},e.removeItem=function(t,a){if(e.removeItemMethod&&e.dropdownItems.length>0){let n=e.dropdownItems.indexOf(a);e.dropdownItems.splice(n,1),e.removeItemMethod({$event:t,item:a})}};var o=function(){(!e.onlyShowNonEmptyDropdown||e.dropdownItems&&e.dropdownItems.length)&&(e.dropdownVisible=!0)},r=function(){e.dropdownVisible=!1},l=function(){var t=e.activeItemIndex-1;t>=0?e.setActive(t):e.allowCustomInput&&e.setInputActive()},c=function(){var t=e.activeItemIndex+1;t=0&&e.activeItemIndex0&&-1!==e.activeItemIndex&&(t.preventDefault(),e.$apply(d));break;case 9:e.dropdownVisible&&e.dropdownItems&&e.dropdownItems.length>0&&-1!==e.activeItemIndex&&e.$apply(d)}}))}}}]),angular.module("inputDropdown").directive("inputDropdownValidator",(function(){return{require:["^inputDropdown","ngModel"],restrict:"A",scope:{},link:function(e,t,a,n){var i=n[0],s=n[1];e.updateInputValidity=function(){var e=i.getSelectedItem(),t=!1;i.isRequired()?(i.customInputAllowed()&&i.getInput()||e)&&(t=!0):t=!0,s.$setValidity("itemSelectedValid",t)}}}})),function(){"use strict";angular.module("ariaNg").directive("ngPlaceholder",(function(){return{restrict:"A",scope:{placeholder:"=ngPlaceholder"},link:function(e,t){e.$watch("placeholder",(function(){t[0].placeholder=e.placeholder}))}}}))}(),function(){"use strict";angular.module("ariaNg").directive("ngSetting",["$timeout","$q","ariaNgConstants","ariaNgLocalizationService","ariaNgKeyboardService","aria2SettingService",function(e,t,a,n,i,s){return{restrict:"E",templateUrl:"views/setting.html",require:"?ngModel",replace:!0,scope:{option:"=",ngModel:"=",enhanced:"<",defaultValue:"=?",fixedValue:"=?",onChangeValue:"&"},link:function(o,r,l,c){var d=null,u={showPlaceholderCount:!1,deleteKeyAlwaysChangeValue:!1,lazySaveTimeout:o.option.lazySaveTimeout||a.lazySaveTimeout,errorTooltipPlacement:"top",errorTooltipDelay:a.errorTooltipDelay};angular.extend(u,l);var p,f=function(){o.option&&o.option.showHistory&&(o.history=s.getSettingHistory(o.option.key))},g=function(){angular.element(r).tooltip("dispose")},m=function(t,a,i){t&&e((function(){var e=o.optionStatus.getValue();"failed"!==e&&"error"!==e||angular.element(r).tooltip({animation:!1,title:n.getLocalizedText(t,i),trigger:"focus",placement:u.errorTooltipPlacement,container:r,template:''}).tooltip("show")}),u.errorTooltipDelay)},h=function(e,t,a){if(!e||!t||!angular.isString(e))return 0;var n=e.split(t),i=n.length;if(a)for(var s=0;so.option.max)return void o.optionStatus.setError("Input number is above max value!",{value:o.option.max})}if(""===t||!angular.isDefined(o.option.pattern)||new RegExp(o.option.pattern).test(t)){var i={key:o.option.key,value:t,optionStatus:o.optionStatus},s=function(){o.optionStatus.setSaving(),o.onChangeValue(i)};o.onChangeValue&&(a?(o.optionStatus.setPending(),d=e((function(){s()}),u.lazySaveTimeout)):s())}else o.optionStatus.setError("Input value is invalid!")}else o.optionStatus.setError("Input number is invalid!");else o.optionStatus.setError("Input number is invalid!")},o.inputKeyUp=function(e,t){if((!0===u.deleteKeyAlwaysChangeValue||"true"===u.deleteKeyAlwaysChangeValue)&&(i.isBackspacePressed(e)||i.isDeletePressed(e))){if(o.optionValue&&""!==o.optionValue)return;o.changeValue("",t)}},o.filterHistory=function(e){var a=[];if(o.history&&e)for(var n=0;n0;i.$setValidity("invalidUrls",s)}}))}}}])}(),function(){"use strict";angular.module("ariaNg").directive("ngBlobDownload",["ariaNgFileService",function(e){return{restrict:"A",scope:{ngBlobDownload:"=ngBlobDownload",ngFileName:"@",ngContentType:"@"},link:function(t,a){t.$watch("ngBlobDownload",(function(n){n&&e.saveFileContent(n,a,{fileName:t.ngFileName,contentType:t.ngContentType})}))}}}])}(),function(){"use strict";angular.module("ariaNg").filter("dateDuration",["moment",function(e){return function(t,a,n){var i=e.duration(t,a);return e.utc(i.asMilliseconds()).format(n)}}])}(),function(){"use strict";angular.module("ariaNg").filter("fileOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a)||!n)return a;var i=t.parseOrderType(n);return null===i?a:"index"===i.type?e("orderBy")(a,["index"],i.reverse):"name"===i.type?e("orderBy")(a,["fileName"],i.reverse):"size"===i.type?e("orderBy")(a,["length"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"selected"===i.type?e("orderBy")(a,["selected"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("logOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a)||!n)return a;var i=t.parseOrderType(n);return null===i?a:"time"===i.type?e("orderBy")(a,["time"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("longDate",["ariaNgCommonService","ariaNgLocalizationService",function(e,t){return function(a){var n=t.getLongDateFormat();return e.formatDateTime(a,n)}}])}(),function(){"use strict";angular.module("ariaNg").filter("peerOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a))return a;var i=t.parseOrderType(n);return null===i?a:"address"===i.type?e("orderBy")(a,["ip","port"],i.reverse):"client"===i.type?e("orderBy")(a,["client.name","client.version"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"dspeed"===i.type?e("orderBy")(a,["downloadSpeed"],i.reverse):"uspeed"===i.type?e("orderBy")(a,["uploadSpeed"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("percent",["$filter",function(e){return function(t,a){var n=Math.pow(10,a),i=parseInt(t*n)/n;return e("number")(i,a)}}])}(),function(){"use strict";angular.module("ariaNg").filter("reverse",(function(){return function(e){return e?e.slice().reverse():e}}))}(),function(){"use strict";angular.module("ariaNg").filter("taskOrderBy",["$filter","ariaNgCommonService",function(e,t){return function(a,n){if(!angular.isArray(a))return a;var i=t.parseOrderType(n);return null===i?a:"name"===i.type?e("orderBy")(a,["taskName"],i.reverse):"size"===i.type?e("orderBy")(a,["totalLength"],i.reverse):"percent"===i.type?e("orderBy")(a,["completePercent"],i.reverse):"remain"===i.type?e("orderBy")(a,["idle","remainTime","remainLength"],i.reverse):"dspeed"===i.type?e("orderBy")(a,["downloadSpeed"],i.reverse):"uspeed"===i.type?e("orderBy")(a,["uploadSpeed"],i.reverse):"default"===i.type?e("orderBy")(a,["groupIndex"],i.reverse):a}}])}(),function(){"use strict";angular.module("ariaNg").filter("taskStatus",(function(){return function(e,t){return e?"active"===e.status?e.verifyIntegrityPending?"Pending Verification":e.verifiedLength?e.verifiedPercent?"format.task.verifying-percent":"Verifying":!0===e.seeder||"true"===e.seeder?"Seeding":"Downloading":t||"waiting"!==e.status?t||"paused"!==e.status?t||"complete"!==e.status?t||"error"!==e.status?t||"removed"!==e.status?"":"Removed":e.errorCode?"format.task.error-occurred":"Error Occurred":"Completed":"Paused":"Waiting":""}}))}(),function(){"use strict";angular.module("ariaNg").filter("groupTask",(function(){return function(e){if(!angular.isArray(e))return e;let t=-1;for(const a in e){switch(e[a].status){case"active":t=1;break;case"waiting":t=2;break;case"paused":t=3;break;case"error":t=4;break;case"complete":t=5;break;case"removed":t=6;break;default:t=10}e[a].groupIndex=t}return e}}))}(),function(){"use strict";angular.module("ariaNg").filter("timeDisplayName",["ariaNgCommonService","ariaNgLocalizationService",function(e,t){return function(a,n){if(!a)return t.getLocalizedText(n);var i=e.getTimeOption(a);return t.getLocalizedText(i.name,{value:i.value})}}])}(),function(){"use strict";angular.module("ariaNg").filter("readableVolume",["$filter",function(e){var t=["B","KB","MB","GB"];return function(a,n){var i=t[0],s=2,o=!1;angular.isNumber(n)?s=n:"auto"===n&&(o=!0),a||(a=0),angular.isNumber(a)||(a=parseInt(a));for(var r=1;r=1024;r++)a/=1024,i=t[r];return o&&(s=function(e){return e<1?2:e<10?1:0}(a)),(a=e("number")(a,s))+" "+i}}])}(),function(){"use strict";angular.module("ariaNg").factory("SweetAlert",(function(){return{swal:function(e,t){Swal.fire(e).then((e=>t(e)))},close:function(){Swal.close()}}}))}(),function(){"use strict";angular.module("ariaNg").provider("ariaNgAssetsCacheService",[function(){var e={},t="languages.";this.getLanguageAsset=function(a){return function(t){for(var a=t.split("."),n=e,i=0;i0&&"\\"!==e.charAt(t-1)&&"="===e.charAt(t))return{key:e.substring(0,t).replace("\\=","="),value:e.substring(t+1,e.length).replace("\\=","=")};return{value:e}},c=function(e,t){var a=e;if(!t)return a;if("["===t[0]&&"]"===t[t.length-1]&&(t=t.substring(1,t.length-1)),"global"===t)return a;for(var n=t.split("."),i=0;ie.toString(16).padStart(2,"0"))).join(""),length:s-t+o}}};return{getFullPageUrl:function(){return e.location.protocol+"//"+e.location.host+e.location.pathname+(e.location.search?e.location.search:"")},base64Encode:function(e){return n.encode(e)},base64Decode:function(e){return n.decode(e)},base64UrlEncode:function(e){return n.urlencode(e)},base64UrlDecode:function(e){return n.urldecode(e)},generateUniqueId:function(){var e=o.appPrefix+"_"+Math.round((new Date).getTime()/1e3)+"_"+Math.random();return this.base64Encode(e)},showDialog:function(e,t,n,i,o){o||(o={}),e&&(e=r.getLocalizedText(e)),t&&(t=r.getLocalizedText(t,o.textParams)),o.confirmButtonText=r.getLocalizedText("OK"),function(e,t,n,i,o){a((function(){s.swal({title:e,text:t,icon:n,reverseButtons:!0,inputAutoFocus:!1,confirmButtonText:o&&o.confirmButtonText||null},(function(){i&&i()}))}),100)}(e,t,n,i,o)},showInfo:function(e,t,a,n){this.showDialog(e,t,"info",a,n)},showError:function(e,t,a){this.showDialog("Error",e,"error",t,a)},showOperationSucceeded:function(e,t){this.showDialog("Operation Succeeded",e,"success",t)},confirm:function(e,t,a,n,i,o,l,c){o||(o={}),e&&(e=r.getLocalizedText(e)),t&&(t=r.getLocalizedText(t,o.textParams)),o.inputPlaceholder&&(o.inputPlaceholder=r.getLocalizedText(o.inputPlaceholder)),o.confirmButtonText=r.getLocalizedText("OK"),o.cancelButtonText=r.getLocalizedText("Cancel"),function(e,t,a,n,i,o,r,l){var c={title:e,text:t,icon:a,showCancelButton:!0,reverseButtons:!0,showLoaderOnConfirm:!!i,preConfirm:l?function(){return new Promise(l)}:null,inputAutoFocus:!1,input:o&&o.input||null,inputValue:o&&o.inputValue||null,inputPlaceholder:o&&o.inputPlaceholder||null,confirmButtonText:o&&o.confirmButtonText||null,cancelButtonText:o&&o.cancelButtonText||null};"warning"===a&&(c.confirmButtonColor="#F39C12"),s.swal(c,(function(e){e.isConfirmed?n&&n(e.value):r&&r(e.value)}))}(e,t,a,n,i,o,l,c)},closeAllDialogs:function(){s.close()},getFileExtension:function(e){return!e||e.lastIndexOf(".")<0?e:e.substring(e.lastIndexOf("."))},getFileExtensionFromUrl:function(e){let t=".";try{let a=new URL(e).pathname.split("/").pop();t+=a.includes(".")?a.split(".").pop():""}catch(e){t="."}return t},parseUrlsFromOriginInput:function(e,t){if(!e)return[];for(var a=e.split("\n"),n=[],i=0;i2?a.slice(-t-1,-1).join("/")+"/":""},parseTorrentInfo:function(e){return c(new Uint8Array(e))},base64ToArrayBuffer:function(e){return function(e){if(!angular.isString(e))return null;const t=e.split(",")[1]||e,a=atob(t),n=a.length,i=new ArrayBuffer(n),s=new Uint8Array(i);for(let e=0;e10&&e.splice(0,e.length-10),i.set(a.browserNotificationHistoryStorageKey,e)}},p=function(t,s){e.Notification&&c(d())&&(function(){if(!r.getBrowserNotificationFrequency()||"unlimited"===r.getBrowserNotificationFrequency())return!1;var e=i.get(a.browserNotificationHistoryStorageKey)||[];if(!angular.isArray(e))return!1;if(e.length<1)return!1;var t=null,s=!1;if("high"===r.getBrowserNotificationFrequency()){if(e.length<10)return!1;t=e[e.length-10].time,s=n.isUnixTimeAfter(t,"-1","minute")}else"middle"===r.getBrowserNotificationFrequency()?(t=e[e.length-1].time,s=n.isUnixTimeAfter(t,"-1","minute")):"low"===r.getBrowserNotificationFrequency()&&(t=e[e.length-1].time,s=n.isUnixTimeAfter(t,"-5","minute"));return s&&o.debug("[ariaNgNotificationService.isReachBrowserNotificationFrequencyLimit] reach frequency limit"+(t?", the oldest time is "+t:"")),s}()||(chrome?.runtime?.id?(s={type:"basic",iconUrl:"tileicon.png",title:t,silent:s.silent??!1,message:s.body},u(),chrome.notifications.create(s)):(s=angular.extend({icon:"tileicon.png"},s),u(),new e.Notification(t,s))))};return{isSupportBrowserNotification:function(){return l},hasBrowserPermission:function(){return!!l&&c(d())},requestBrowserPermission:function(t){l&&function(t){e.Notification&&e.Notification.requestPermission((function(e){t&&t({granted:c(e),permission:e})}))}((function(e){e.granted||r.setBrowserNotification(!1),t&&t(e)}))},notifyViaBrowser:function(e,t,a){return a||(a={}),e&&(e=s.getLocalizedText(e,a.titleParams)),t&&(t=s.getLocalizedText(t,a.contentParams)),function(e,t,a){a||(a={}),a.body=t,r.getBrowserNotificationSound()||(a.silent=!0),l&&r.getBrowserNotification()&&p(e,a)}(e,t,a)},notifyTaskComplete:function(e){this.notifyViaBrowser("Download Completed",e&&e.taskName?e.taskName:"")},notifyBtTaskComplete:function(e){this.notifyViaBrowser("BT Download Completed",e&&e.taskName?e.taskName:"")},notifyTaskError:function(e){this.notifyViaBrowser("Download Error",e&&e.taskName?e.taskName:"")},notifyInPage:function(e,a,n){return n||(n={}),e&&(e=s.getLocalizedText(e,n.titleParams)),a&&(a=s.getLocalizedText(a,n.contentParams),n.contentPrefix&&(a=n.contentPrefix+a)),function(e,a,n){return n||(n={}),a?(n.title=e,n.message=a):n.message=e,n.type&&t[n.type]||(n.type="primary"),n.positionY||(n.positionY="top"),t[n.type](n)}(e,a,n)},clearNotificationInPage:function(){t.clearAll()}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLocalizationService",["$translate","amMoment",function(e,t){return{applyLanguage:function(a){return e.use(a),t.changeLocale(a),!0},getLocalizedText:function(t,a){return e.instant(t,a)},getLongDateFormat:function(){return this.getLocalizedText("format.longdate")}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgLogService",["$log","ariaNgConstants",function(e,t){var a={DEBUG:1,INFO:2,WARN:3,ERROR:4},n=0,i=!1,s=[],o=function(e,a,o){i&&(s.length>=t.cachedDebugLogsLimit&&s.shift(),s.push(function(e,t,a){return{id:++n,time:new Date,level:t,content:e,attachment:a}}(e,a,o)))};return{setEnableDebugLog:function(e){i=e},compareLogLevel:function(e,t){var n=a[e],i=a[t];return n||(n=0),i||(i=0),n>i?1:n=0&&n.push(a[i]);return n}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgFileService",["$window",function(e){var t=!!e.FileReader,a=!!e.Blob;return{isSupportFileReader:function(){return t},isSupportBlob:function(){return a},openFileContent:function(e,a,n,i){t?(e=angular.extend({scope:null,fileFilter:null,fileType:"binary",successCallback:a,errorCallback:n},e),i&&i.change||(i=angular.element('')),i.data("options",e),e.fileFilter&&i.attr("accept",e.fileFilter),i.val(""),"true"!==i.attr("data-ariang-file-initialized")&&i.change((function(){if(this.files&&!(this.files.length<1)){var e=i.data("options"),t=function(e){var t=[];if(!e||e.length<1)return t.push(/.+$/),t;for(var a=e.split(","),n=0;n')),t.attr("href",s),n.fileName&&t.attr("download",n.fileName),n.autoTrigger&&t.trigger("click"),n.autoRevoke&&URL.revokeObjectURL(s)}}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgSettingService",["$window","$location","$filter","ariaNgConstants","ariaNgDefaultOptions","ariaNgLanguages","ariaNgCommonService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r,l){var c={localStorage:l.isLocalStorageSupported(),cookies:l.isCookiesSupported()},d=c.localStorage||c.cookies,u=!!e.matchMedia&&e.matchMedia("(prefers-color-scheme: dark)")&&"not all"!==e.matchMedia("(prefers-color-scheme: dark)").media&&angular.isFunction(e.matchMedia("(prefers-color-scheme: dark)").addEventListener),p=[],f=!1,g={debugMode:!1},m=function(e){for(var t in s)if(s.hasOwnProperty(t)){if(t.toLowerCase()===e.toLowerCase())return t;var a=s[t].aliases;if(angular.isArray(a)&&!(a.length<1))for(var n=0;n1){var a,n=t.split("-");if(t=n[0]+"-"+n[1],!s[t])(a=m(t))&&(t=a)}return s[t]?(r.info('[ariaNgSettingService] use browser language "'+t+'" as current language'),t):(r.info('[ariaNgSettingService] browser language "'+t+'" not support, use default language'),i.language)},v=function(e){return l.set(n.optionStorageKey,e)},b=function(){var e,t=l.get(n.optionStorageKey);if(t&&!s[t.language]&&(t.language=(e=t.language,m(e)||h())),!t){if((t=angular.extend({},i)).language=h(),t.rpcHost||w(t),angular.isArray(t.extendRpcServers))for(var a=0;a"+n.getLocalizedText("No Data")+"";var i=a.getLongTimeFromUnixTime(t[0].name),s=e("readableVolume")(t[0].value)+"/s";return'
'+i+'
'+(e("readableVolume")(t[1].value)+"/s")+'
'+s+"
"}},xAxis:{data:[],type:"category",boundaryGap:!1,axisLabel:{show:!1}},yAxis:{type:"value",axisLabel:{formatter:function(t){return e("readableVolume")(t,"auto")}}},series:[{type:"line",areaStyle:{normal:{opacity:.1}},smooth:!0,symbolSize:6,showAllSymbol:!1,data:[]},{type:"line",areaStyle:{normal:{opacity:.1}},smooth:!0,symbolSize:6,showAllSymbol:!1,data:[]}]},o=i.xAxis.data,l=i.series[0].data,c=i.series[1].data,d=0;d=r(e)&&(n.shift(),i.shift(),o.shift()),n.push(t.time),i.push(t.uploadSpeed),o.push(t.downloadSpeed)}(e,t)},getStatsData:function(e){return c(e)||l(e),function(e){return s[e]}(e)},getEmptyStatsData:function(e){return c(e)&&function(e){delete s[e]}(e),this.getStatsData(e)},recordGlobalStat:function(e){this.recordStat(o,e),i=e},getGlobalStatsData:function(){return this.getStatsData(o)},getCurrentGlobalStat:function(){return i}}}])}(),function(){"use strict";angular.module("ariaNg").factory("ariaNgTitleService",["$filter","ariaNgConstants","ariaNgLocalizationService","ariaNgSettingService",function(e,t,a,n){var i=function(e){if(!e)return{};for(var t=e.substring(2,e.length-1).split(":"),a={oldValue:e},n=1;n0)for(var r=0;r0&&(n+="&"),(angular.isObject(s)||angular.isArray(s))&&(s=angular.toJson(s),s=a.base64Encode(s),s=encodeURIComponent(s)),n+=i+"="+s)}return n.length<1?e:(n=e.indexOf("?")<0?"?"+n:"&"+n,e+n)}(l.url,n.requestBody)),r)for(var c=r.split("\n"),d=0;d0?e.params[0]:null)}}(t))}else e.request&&function(e){var t=angular.fromJson(e);if(t){var a=t.id;if(a){var n=c[a];if(n){var i=n.context;n.deferred.reject({success:!1,context:i}),i.errorCallback&&(s.debug("[aria2WebSocketRpcService.processRequestFailed] "+(i&&i.requestBody&&i.requestBody.method?i.requestBody.method+" ":"")+"request failed"),i.errorCallback(i.id,{message:"Cannot connect to aria2!"})),delete c[a]}}}}(e.request)})),r.onOpen((function(t){s.debug("[aria2WebSocketRpcService.onOpen] websocket is opened",t),e&&e.connectionSuccessCallback&&e.connectionSuccessCallback({rpcUrl:o})})),r.onClose((function(t){for(var a in s.warn("[aria2WebSocketRpcService.onClose] websocket is closed",t),c)if(c.hasOwnProperty(a)){var n=c[a];n?(n.deferred.reject({success:!1,context:n.context}),s.debug("[aria2WebSocketRpcService.socketClient.onClose] reject old request",n.context),n.context.errorCallback(n.context.id,{message:"Cannot connect to aria2!"}),delete c[a]):delete c[a]}var r=i.getWebSocketReconnectInterval()>0;r&&f(e),r&&e&&e.connectionWaitingToReconnectCallback?e.connectionWaitingToReconnectCallback({rpcUrl:o}):e&&e.connectionFailedCallback&&e.connectionFailedCallback({rpcUrl:o})}))}catch(e){return{success:!1,error:"Cannot initialize WebSocket!",exception:e}}return{success:!0,instance:r}},p=function(e){e&&r&&(e.connectionReconnectingCallback&&e.connectionReconnectingCallback({rpcUrl:o}),r.reconnect())},f=function(e){l?s.warn("[aria2WebSocketRpcService.planToReconnect] another reconnection is pending"):(l=a((function(){return null==r?(s.warn("[aria2WebSocketRpcService.planToReconnect] websocket is null"),void(l=null)):0===r.readyState||1===r.readyState?(s.warn("[aria2WebSocketRpcService.planToReconnect] websocket current state is already "+r.readyState),void(l=null)):(p(e),void(l=null))}),i.getWebSocketReconnectInterval()),s.debug("[aria2WebSocketRpcService.planToReconnect] next reconnection is pending in "+i.getWebSocketReconnectInterval()+"ms"))};return{request:function(t){if(t){var a=u({connectionSuccessCallback:t.connectionSuccessCallback,connectionFailedCallback:t.connectionFailedCallback,connectionReconnectingCallback:t.connectionReconnectingCallback,connectionWaitingToReconnectCallback:t.connectionWaitingToReconnectCallback}),n=t.uniqueId,i=angular.toJson(t.requestBody);s.debug("[aria2WebSocketRpcService.request] "+(t&&t.requestBody&&t.requestBody.method?t.requestBody.method+" ":"")+"request start",t);var o=e.defer();return a.instance?(c[n]={context:t,deferred:o},a.instance.send(i)):(o.reject({success:!1,context:t}),s.debug("[aria2WebSocketRpcService.request] client error",a),t.errorCallback(t.id,{message:a.error})),o.promise}},reconnect:function(e){p(e)},on:function(e,t){var a=d[e];angular.isArray(a)||(a=d[e]=[]),a.push(t)}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2RpcService",["$location","$q","aria2RpcConstants","aria2RpcErrors","aria2AllOptions","ariaNgCommonService","ariaNgLogService","ariaNgSettingService","ariaNgNotificationService","aria2HttpRpcService","aria2WebSocketRpcService",function(e,t,a,n,i,s,o,r,l,c,d){var u=r.isCurrentRpcUseWebSocket()?d:c,p=!1,f=r.getCurrentRpcSecret(),g=[],m=[],h=[],v=[],b=[],k=[],y=[],w=[],S=[],x=[],T=[],C=[],P=[],D=function(e){return 0===e.indexOf(a.rpcSystemServiceName+".")},R=function(e){return a.rpcServiceName+"."+e},A=function(e,t){if(t)return e;var n=s.generateUniqueId(),i={uniqueId:n,requestBody:{jsonrpc:a.rpcServiceVersion,method:e.methodName,id:n,params:e.params},connectionSuccessCallback:e.connectionSuccessCallback,connectionFailedCallback:e.connectionFailedCallback,connectionReconnectingCallback:e.connectionReconnectingCallback,connectionWaitingToReconnectCallback:e.connectionWaitingToReconnectCallback,successCallback:e.successCallback,errorCallback:e.errorCallback};return u.request(i)},I=function(e,t){var a=function(e){return R(e)}(e);u.on(a,(function(e){if(angular.isArray(t)&&!(t.length<1))for(var a=0;a1){var l=arguments[1];o.successCallback=function(e,t){if(l.callback&&l.callback({id:e,success:!0,data:t,context:l}),O(m),!p){p=!0;var a={rpcName:r.getCurrentRpcDisplayName()};O(g,a)}},o.errorCallback=function(t,a){var i=!1,s=e.path();l.silent||s!==n||(i=L(a)),l.callback&&l.callback({id:t,success:!1,data:a,errorProcessed:i,context:l}),O(h)}}if(arguments.length>2)for(var c=2;c0&&(o.params=s),o},U=function(e,t){var a=angular.copy(e);for(var n in a)a.hasOwnProperty(n)&&M(a,n)&&(a[n]=q(a[n],i[n]));return t&&t.pauseOnAdded&&(a.pause="true"),a},M=function(e,t){return!(!e[t]||!angular.isString(e[t]))&&!(!i[t]||"array"!==i[t].submitFormat)},q=function(e,t){for(var a=e.split(t.separator),n=[],i=0;i0&&(t=e.uris[0].uri,a=!0);var n=t.lastIndexOf("/");if(n<0&&(n=t.lastIndexOf("\\")),n<=0||n===t.length)return t;var i=t.substring(n+1),s=i.indexOf("?"),o=i;if(s>0&&(o=i.substring(0,s)),a)try{o=decodeURI(o)}catch(e){r.warn("[aria2TaskService.getFileName] failed to url decode file name, original file name: "+o,e)}return o},d=function(e,t){var n=e.dir,i=t.path;n&&(n=n.replace(/\\/g,a.defaultPathSeparator)),i&&(i=i.replace(/\\/g,a.defaultPathSeparator));var s=function(){i.length>1&&i.charAt(0)===a.defaultPathSeparator&&(i=i.substr(1))};if(n&&0===i.indexOf(n)&&(i=i.substr(n.length)),s(),e.bittorrent&&"multi"===e.bittorrent.mode&&e.bittorrent.info&&e.bittorrent.info.name){var o=e.bittorrent.info.name;0===i.indexOf(o)&&(i=i.substr(o.length))}return s(),t.fileName&&i.lastIndexOf(t.fileName)+t.fileName.length===i.length&&(i=i.substr(0,i.length-t.fileName.length)),i.length>1&&i.charAt(i.length-1)===a.defaultPathSeparator&&(i=i.substr(0,i.length-1)),i},u=function(e,t,n){var i=n[e];if(i)return i;var s=null,o=e;if(e.length){var r="",l=e.lastIndexOf(a.defaultPathSeparator);l>0&&(r=e.substring(0,l),o=e.substring(l+1)),s=u(r,t,n)}return i={isDir:!0,nodePath:e,nodeName:o,relativePath:s&&s.nodePath||"",level:s&&s.level+1||0,length:0,selected:!0,partialSelected:!1,files:[],subDirs:[]},t.push(i),n[e]=i,s&&s.subDirs.push(i),i},p=function(e,t,a){if(e&&t&&a){var n=e.relativePath||"",i=u(n,t,a);return i.files.push(e),i}},f=function(e,t,a){if(e){var n=0,i=0,s=0;if(e.subDirs&&e.subDirs.length)for(var o=0;o0&&i===e.subDirs.length+e.files.length,e.partialSelected=i>0&&i0}},g=function(e,t){for(var a=[],n=0;n=t)return a}return a},m=function(e,t){if(!e)return r.warn("[aria2TaskService.processDownloadTask] task is null"),e;t=t&&e.bittorrent&&"multi"===e.bittorrent.mode;var a,i,l=g(e.bitfield,e.numPieces);if(e.totalLength=parseInt(e.totalLength),e.completedLength=parseInt(e.completedLength),e.completePercent=e.totalLength>0?e.completedLength/e.totalLength*100:0,e.remainLength=e.totalLength-e.completedLength,e.remainPercent=100-e.completePercent,e.uploadLength=e.uploadLength?parseInt(e.uploadLength):0,e.shareRatio=e.completedLength>0?e.uploadLength/e.completedLength:0,e.uploadSpeed=parseInt(e.uploadSpeed),e.downloadSpeed=parseInt(e.downloadSpeed),e.numPieces=parseInt(e.numPieces),e.completedPieces=s.countArray(l,!0),e.pieceLength=parseInt(e.pieceLength),e.idle=0===e.downloadSpeed,e.remainTime=(a=e.remainLength,0===(i=e.downloadSpeed)?0:a/i),e.seeder=!0===e.seeder||"true"===e.seeder,e.verifiedLength&&e.files){let t=0;e.files.forEach((e=>{t+=e.length})),e.verifiedPercent=t>0?parseInt(e.verifiedLength/t*100):void 0}else e.verifiedPercent=void 0;e.dir=s.formatFilePath(e.dir);var u=function(e){var t="",a=!0;return e.bittorrent&&e.bittorrent.info&&(t=e.bittorrent.info.name),e.bittorrent&&e.files.length>0&&e.files[0].path.includes("[METADATA]")&&(e.files[0].path=e.dir+e.files[0].path.replace("[METADATA]","")+".torrent"),!t&&e.files&&e.files.length>0&&(t=c(e.files[0])),t||(t=o.getLocalizedText("Unknown"),a=!1),{name:t,success:a}}(e);if(e.taskName=u.name,e.hasTaskName=u.success,e.errorDescription=function(e){return e.errorCode&&n[e.errorCode]&&n[e.errorCode].descriptionKey?n[e.errorCode].hide?"":n[e.errorCode].descriptionKey:""}(e),e.files){for(var m=0,h=[],v={},b=0;b0?k.completedLength/k.length*100:0,t){k.relativePath=d(e,k);var y=p(k,h,v);k.level=y.level+1}m+=k.selected?1:0}if(t&&h.length>1){var w=[];f(v[""],v,w),e.files=w,e.multiDir=!0}e.selectedFileCount=m}if(e.files&&1===e.files.length&&e.files[0].uris&&e.files[0].uris[0]){var S=!0,x=e.files[0].uris[0].uri;for(b=0;b0&&(i+=","),i+=t[s];return this.setTaskOption(e,"select-file",i,a,n)},getBtTaskPeers:function(e,t,a,n){return i.getPeers({gid:e.gid,silent:!!a,callback:function(a){t?(a.success&&h(a.data,e,n),t(a)):r.warn("[aria2TaskService.getBtTaskPeers] callback is null")}})},getTaskStatusAndBtPeers:function(e,t,a,n,s,o){var l=[i.tellStatus({gid:e},!0)];return n&&l.push(i.getPeers({gid:e},!0)),i.multicall({methods:l,silent:!!a,callback:function(e){t?(e.task={},e.success&&e.data.length>0&&(e.task=e.data[0][0],m(e.task,o)),e.success&&e.task.bittorrent&&e.data.length>1&&(e.peers=e.data[1][0],h(e.peers,e.task,s)),t(e)):r.warn("[aria2TaskService.getTaskStatusAndBtPeers] callback is null")}})},newUriTask:function(e,t,a,n){return i.addUri({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newUriTasks:function(e,t,a,n){return i.addUriMulti({tasks:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newTorrentTask:function(e,t,a,n){return i.addTorrent({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},newMetalinkTask:function(e,t,a,n){return i.addMetalink({task:e,pauseOnAdded:!!t,silent:!!n,callback:a})},startTasks:function(e,t,a){return i.unpauseMulti({gids:e,silent:!!a,callback:t})},pauseTasks:function(e,t,a){return i.forcePauseMulti({gids:e,silent:!!a,callback:t})},retryTask:function(t,a,n){var s=e.defer(),o=[i.tellStatus({gid:t},!0),i.getOption({gid:t},!0)],c=null,d=null;return i.multicall({methods:o,silent:!!n,callback:function(e){if(!a)return void r.warn("[aria2TaskService.retryTask] callback is null");if(!e.success)return r.warn("[aria2TaskService.retryTask] response is not success",e),s.reject(e),void a(e);if(e.data.length>0&&(c=e.data[0][0]),e.data.length>1&&(d=e.data[1][0]),!c||!d||!c.files||1!==c.files.length||c.bittorrent)return c||r.warn("[aria2TaskService.retryTask] task is null"),d||r.warn("[aria2TaskService.retryTask] options is null"),c.files||r.warn("[aria2TaskService.retryTask] task file is null"),1!==c.files.length&&r.warn("[aria2TaskService.retryTask] task file length is not equal 1"),c.bittorrent&&r.warn("[aria2TaskService.retryTask] task is bittorrent"),s.reject(t),void a({success:!1});for(var o=c.files[0],u=[],p=0;p0&&u.push(i.forceRemoveMulti({gids:r,removeFile:o,silent:!!n,callback:function(e){s.pushArrayTo(g,e.results),p=p||e.hasSuccess,f=f||e.hasError}})),l.length>0&&u.push(i.removeDownloadResultMulti({gids:l,removeFile:o,silent:!!n,callback:function(e){s.pushArrayTo(g,e.results),p=p||e.hasSuccess,f=f||e.hasError}})),e.all(u).then((function(){a&&a({hasSuccess:!!p,hasError:!!f,remainsStoppedTask:!!c,results:g})}))},changeTaskPosition:function(e,t,a,n){return i.changePosition({gid:e,pos:t,how:"POS_SET",silent:!!n,callback:a})},clearStoppedTasks:function(e,t){return i.purgeDownloadResult({silent:!!t,callback:e})},onConnectionSuccess:function(e){e?i.onConnectionSuccess({callback:e}):r.warn("[aria2TaskService.onConnectionSuccess] callback is null")},onConnectionFailed:function(e){e?i.onConnectionFailed({callback:e}):r.warn("[aria2TaskService.onConnectionFailed] callback is null")},onConnectionReconnecting:function(e){e?i.onConnectionReconnecting({callback:e}):r.warn("[aria2TaskService.onConnectionReconnecting] callback is null")},onConnectionWaitingToReconnect:function(e){e?i.onConnectionWaitingToReconnect({callback:e}):r.warn("[aria2TaskService.onConnectionWaitingToReconnect] callback is null")},onFirstSuccess:function(e){e?i.onFirstSuccess({callback:e}):r.warn("[aria2TaskService.onFirstSuccess] callback is null")},onOperationSuccess:function(e){e?i.onOperationSuccess({callback:e}):r.warn("[aria2TaskService.onOperationSuccess] callback is null")},onOperationError:function(e){e?i.onOperationError({callback:e}):r.warn("[aria2TaskService.onOperationError] callback is null")},onTaskCompleted:function(e){e?i.onDownloadComplete({callback:v(this.getTaskStatus,e,"completed")}):r.warn("[aria2TaskService.onTaskCompleted] callback is null")},onBtTaskCompleted:function(e){e?i.onBtDownloadComplete({callback:v(this.getTaskStatus,e,"btcompleted")}):r.warn("[aria2TaskService.onBtTaskCompleted] callback is null")},onTaskErrorOccur:function(e){e?i.onDownloadError({callback:v(this.getTaskStatus,e,"error")}):r.warn("[aria2TaskService.onTaskErrorOccur] callback is null")},processDownloadTasks:function(e,t){if(angular.isArray(e))for(var a=0;a0&&n[n.length-1].isCompleted===s?n[n.length-1].count++:n.push({isCompleted:s,count:1})}return n}(e,t)},estimateHealthPercentFromPeers:function(e,t){if(!e||e.numPieces<1||t.length<1)return r.warn("[aria2TaskService.estimateHealthPercentFromPeers] tasks is null or numPieces < 1 or peers < 1",e),e.completePercent;for(var a=[],n=0,i=e.completePercent,s=0;sn?(n=c,i=o.completePercent):c===n&&o.completePercent>i&&(i=o.completePercent)}var p=0;if(a.length>0)for(;;){var f=!0;for(s=0;s0?(p++,a[s]--):f=!1;if(!f)break}if(p<=n)return i;var m=p/e.numPieces*100;return m<=i?i:m}}}])}(),function(){"use strict";angular.module("ariaNg").factory("aria2SettingService",["ariaNgConstants","aria2AllOptions","aria2GlobalAvailableOptions","aria2QuickSettingsAvailableOptions","aria2TaskAvailableOptions","aria2RpcService","ariaNgLogService","ariaNgStorageService",function(e,t,a,n,i,s,o,r){var l=function(t){return e.settingHistoryKeyPrefix+"."+t};return{isOptionKeyValid:function(e){return!!t[e]},isOptionKeyRequired:function(e){var a=t[e];return a&&a.required},getAvailableGlobalOptionsKeys:function(e){return"basic"===e?a.basicOptions:"http-ftp-sftp"===e?a.httpFtpSFtpOptions:"http"===e?a.httpOptions:"ftp-sftp"===e?a.ftpSFtpOptions:"bt"===e?a.btOptions:"metalink"===e?a.metalinkOptions:"rpc"===e?a.rpcOptions:"advanced"===e&&a.advancedOptions},getAria2QuickSettingsAvailableOptions:function(e){return"globalSpeedLimit"===e&&n.globalSpeedLimitOptions},getAvailableTaskOptionKeys:function(e,t){for(var a=i.taskOptions,n=[],s=0;s-1&&(n.splice(i,1),r.set(a,n)),n},clearSettingsHistorys:function(){for(var t=r.keys(e.settingHistoryKeyPrefix+"."),a=0;a{let n=e.recManifestUrl;fetch(n).then((e=>{t(e.json())})).catch((e=>{a(e)}))}))}}}])}(),angular.module("ariaNg").run(["$templateCache",function(e){e.put("views/debug.html",'
'),e.put("views/export-command-api-dialog.html",''),e.put("views/list.html",'
'),e.put("views/new.html",'
'),e.put("views/notification-reloadable.html",''),e.put("views/recommend.html",''),e.put("views/setting-dialog.html",'\x3c!-- /.modal --\x3e'),e.put("views/setting.html",'
 
'),e.put("views/settings-aria2.html",'
'),e.put("views/settings-ariang.html",'
'),e.put("views/status.html",'
Aria2 RPC Address
Aria2 Status
Session ID
-
Aria2 Version
- Enhanced Edition
Enabled Features
-
Operations
'),e.put("views/task-detail.html",'
\x3c!-- /.nav-tabs-custom --\x3e
')}]); \ No newline at end of file diff --git a/ui/ariang/js/plugins-2104250bca.min.js b/ui/ariang/js/plugins-bb70e85dac.min.js similarity index 87% rename from ui/ariang/js/plugins-2104250bca.min.js rename to ui/ariang/js/plugins-bb70e85dac.min.js index 4841315..963c5dc 100644 --- a/ui/ariang/js/plugins-2104250bca.min.js +++ b/ui/ariang/js/plugins-bb70e85dac.min.js @@ -1,9 +1,9 @@ /*! * AdminLTE v3.2.0 (https://adminlte.io) - * Copyright 2014-2022 Colorlib + * Copyright 2014-2024 Colorlib * Licensed under MIT (https://github.com/ColorlibHQ/AdminLTE/blob/master/LICENSE) */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).adminlte={},e.jQuery)}(this,(function(e,t){"use strict";var n=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(t),o="CardRefresh",i="lte.cardrefresh",r=n.default.fn[o],a='[data-card-widget="card-refresh"]',s={source:"",sourceSelector:"",params:{},trigger:a,content:".card-body",loadInContent:!0,loadOnInit:!0,loadErrorTemplate:!0,responseType:"",overlayTemplate:'
',errorTemplate:'',onLoadStart:function(){},onLoadDone:function(e){return e},onLoadFail:function(e,t,n){}},l=function(){function e(e,t){if(this._element=e,this._parent=e.parents(".card").first(),this._settings=n.default.extend({},s,t),this._overlay=n.default(this._settings.overlayTemplate),e.hasClass("card")&&(this._parent=e),""===this._settings.source)throw new Error("Source url was not defined. Please specify a url in your CardRefresh source option.")}var t=e.prototype;return t.load=function(){var e=this;this._addOverlay(),this._settings.onLoadStart.call(n.default(this)),n.default.get(this._settings.source,this._settings.params,(function(t){e._settings.loadInContent&&(""!==e._settings.sourceSelector&&(t=n.default(t).find(e._settings.sourceSelector).html()),e._parent.find(e._settings.content).html(t)),e._settings.onLoadDone.call(n.default(e),t),e._removeOverlay()}),""!==this._settings.responseType&&this._settings.responseType).fail((function(t,o,i){if(e._removeOverlay(),e._settings.loadErrorTemplate){var r=n.default(e._settings.errorTemplate).text(i);e._parent.find(e._settings.content).empty().append(r)}e._settings.onLoadFail.call(n.default(e),t,o,i)})),n.default(this._element).trigger(n.default.Event("loaded.lte.cardrefresh"))},t._addOverlay=function(){this._parent.append(this._overlay),n.default(this._element).trigger(n.default.Event("overlay.added.lte.cardrefresh"))},t._removeOverlay=function(){this._parent.find(this._overlay).remove(),n.default(this._element).trigger(n.default.Event("overlay.removed.lte.cardrefresh"))},t._init=function(){var e=this;n.default(this).find(this._settings.trigger).on("click",(function(){e.load()})),this._settings.loadOnInit&&this.load()},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(i),r=n.default.extend({},s,"object"==typeof t?t:n.default(this).data());if(o)if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}else void 0===t&&o._init();else o=new e(n.default(this),r),n.default(this).data(i,o),o._init()}))},e}();n.default(document).on("click",a,(function(e){e&&e.preventDefault(),l._jQueryInterface.call(n.default(this),"load")})),n.default((function(){n.default(a).each((function(){l._jQueryInterface.call(n.default(this))}))})),n.default.fn[o]=l._jQueryInterface,n.default.fn[o].Constructor=l,n.default.fn[o].noConflict=function(){return n.default.fn[o]=r,l._jQueryInterface};var u="CardWidget",c="lte.cardwidget",d=n.default.fn[u],f="collapsed-card",p="collapsing-card",h="expanding-card",g="was-collapsed",m="maximized-card",v='[data-card-widget="remove"]',y='[data-card-widget="collapse"]',b='[data-card-widget="maximize"]',w={animationSpeed:"normal",collapseTrigger:y,removeTrigger:v,maximizeTrigger:b,collapseIcon:"fa-minus",expandIcon:"fa-plus",maximizeIcon:"fa-expand",minimizeIcon:"fa-compress"},C=function(){function e(e,t){this._element=e,this._parent=e.parents(".card").first(),e.hasClass("card")&&(this._parent=e),this._settings=n.default.extend({},w,t)}var t=e.prototype;return t.collapse=function(){var e=this;this._parent.addClass(p).children(".card-body, .card-footer").slideUp(this._settings.animationSpeed,(function(){e._parent.addClass(f).removeClass(p)})),this._parent.find("> .card-header "+this._settings.collapseTrigger+" ."+this._settings.collapseIcon).addClass(this._settings.expandIcon).removeClass(this._settings.collapseIcon),this._element.trigger(n.default.Event("collapsed.lte.cardwidget"),this._parent)},t.expand=function(){var e=this;this._parent.addClass(h).children(".card-body, .card-footer").slideDown(this._settings.animationSpeed,(function(){e._parent.removeClass(f).removeClass(h)})),this._parent.find("> .card-header "+this._settings.collapseTrigger+" ."+this._settings.expandIcon).addClass(this._settings.collapseIcon).removeClass(this._settings.expandIcon),this._element.trigger(n.default.Event("expanded.lte.cardwidget"),this._parent)},t.remove=function(){this._parent.slideUp(),this._element.trigger(n.default.Event("removed.lte.cardwidget"),this._parent)},t.toggle=function(){this._parent.hasClass(f)?this.expand():this.collapse()},t.maximize=function(){this._parent.find(this._settings.maximizeTrigger+" ."+this._settings.maximizeIcon).addClass(this._settings.minimizeIcon).removeClass(this._settings.maximizeIcon),this._parent.css({height:this._parent.height(),width:this._parent.width(),position:"fixed",transition:"all .15s"}).delay(150).queue((function(){var e=n.default(this);e.addClass(m),n.default("html").addClass(m),e.hasClass(f)&&e.addClass(g),e.dequeue()})),this._element.trigger(n.default.Event("maximized.lte.cardwidget"),this._parent)},t.minimize=function(){this._parent.find(this._settings.maximizeTrigger+" ."+this._settings.minimizeIcon).addClass(this._settings.maximizeIcon).removeClass(this._settings.minimizeIcon),this._parent.css("cssText","height: "+this._parent[0].style.height+" !important; width: "+this._parent[0].style.width+" !important; transition: all .15s;").delay(10).queue((function(){var e=n.default(this);e.removeClass(m),n.default("html").removeClass(m),e.css({height:"inherit",width:"inherit"}),e.hasClass(g)&&e.removeClass(g),e.dequeue()})),this._element.trigger(n.default.Event("minimized.lte.cardwidget"),this._parent)},t.toggleMaximize=function(){this._parent.hasClass(m)?this.minimize():this.maximize()},t._init=function(e){var t=this;this._parent=e,n.default(this).find(this._settings.collapseTrigger).click((function(){t.toggle()})),n.default(this).find(this._settings.maximizeTrigger).click((function(){t.toggleMaximize()})),n.default(this).find(this._settings.removeTrigger).click((function(){t.remove()}))},e._jQueryInterface=function(t){var o=n.default(this).data(c),i=n.default.extend({},w,n.default(this).data());o||(o=new e(n.default(this),i),n.default(this).data(c,"string"==typeof t?o:t)),"string"==typeof t&&/collapse|expand|remove|toggle|maximize|minimize|toggleMaximize/.test(t)?o[t]():"object"==typeof t&&o._init(n.default(this))},e}();n.default(document).on("click",y,(function(e){e&&e.preventDefault(),C._jQueryInterface.call(n.default(this),"toggle")})),n.default(document).on("click",v,(function(e){e&&e.preventDefault(),C._jQueryInterface.call(n.default(this),"remove")})),n.default(document).on("click",b,(function(e){e&&e.preventDefault(),C._jQueryInterface.call(n.default(this),"toggleMaximize")})),n.default.fn[u]=C._jQueryInterface,n.default.fn[u].Constructor=C,n.default.fn[u].noConflict=function(){return n.default.fn[u]=d,C._jQueryInterface};var T="ControlSidebar",_="lte.controlsidebar",S=n.default.fn[T],x=".control-sidebar",k=".control-sidebar-content",E='[data-widget="control-sidebar"]',A=".main-header",O=".main-footer",I="control-sidebar-animate",L="control-sidebar-open",$="control-sidebar-slide-open",B="layout-fixed",P={controlsidebarSlide:!0,scrollbarTheme:"os-theme-light",scrollbarAutoHide:"l",target:x,animationSpeed:300},j=function(){function e(e,t){this._element=e,this._config=t}var t=e.prototype;return t.collapse=function(){var e=this,t=n.default("body"),o=n.default("html");this._config.controlsidebarSlide?(o.addClass(I),t.removeClass($).delay(300).queue((function(){n.default(x).hide(),o.removeClass(I),n.default(this).dequeue()}))):t.removeClass(L),n.default(this._element).trigger(n.default.Event("collapsed.lte.controlsidebar")),setTimeout((function(){n.default(e._element).trigger(n.default.Event("collapsed-done.lte.controlsidebar"))}),this._config.animationSpeed)},t.show=function(e){void 0===e&&(e=!1);var t=n.default("body"),o=n.default("html");e&&n.default(x).hide(),this._config.controlsidebarSlide?(o.addClass(I),n.default(this._config.target).show().delay(10).queue((function(){t.addClass($).delay(300).queue((function(){o.removeClass(I),n.default(this).dequeue()})),n.default(this).dequeue()}))):t.addClass(L),this._fixHeight(),this._fixScrollHeight(),n.default(this._element).trigger(n.default.Event("expanded.lte.controlsidebar"))},t.toggle=function(){var e=n.default("body"),t=this._config.target,o=!n.default(t).is(":visible"),i=e.hasClass(L)||e.hasClass($),r=o&&(e.hasClass(L)||e.hasClass($));o||r?this.show(o):i&&this.collapse()},t._init=function(){var e=this,t=n.default("body");t.hasClass(L)||t.hasClass($)?(n.default(x).not(this._config.target).hide(),n.default(this._config.target).css("display","block")):n.default(x).hide(),this._fixHeight(),this._fixScrollHeight(),n.default(window).resize((function(){e._fixHeight(),e._fixScrollHeight()})),n.default(window).scroll((function(){var t=n.default("body");(t.hasClass(L)||t.hasClass($))&&e._fixScrollHeight()}))},t._isNavbarFixed=function(){var e=n.default("body");return e.hasClass("layout-navbar-fixed")||e.hasClass("layout-sm-navbar-fixed")||e.hasClass("layout-md-navbar-fixed")||e.hasClass("layout-lg-navbar-fixed")||e.hasClass("layout-xl-navbar-fixed")},t._isFooterFixed=function(){var e=n.default("body");return e.hasClass("layout-footer-fixed")||e.hasClass("layout-sm-footer-fixed")||e.hasClass("layout-md-footer-fixed")||e.hasClass("layout-lg-footer-fixed")||e.hasClass("layout-xl-footer-fixed")},t._fixScrollHeight=function(){var e=n.default("body"),t=n.default(this._config.target);if(e.hasClass(B)){var o={scroll:n.default(document).height(),window:n.default(window).height(),header:n.default(A).outerHeight(),footer:n.default(O).outerHeight()},i=Math.abs(o.window+n.default(window).scrollTop()-o.scroll),r=n.default(window).scrollTop(),a=this._isNavbarFixed()&&"fixed"===n.default(A).css("position"),s=this._isFooterFixed()&&"fixed"===n.default(O).css("position"),l=n.default(this._config.target+", "+this._config.target+" "+k);if(0===r&&0===i)t.css({bottom:o.footer,top:o.header}),l.css("height",o.window-(o.header+o.footer));else if(i<=o.footer)if(!1===s){var u=o.header-r;t.css("bottom",o.footer-i).css("top",u>=0?u:0),l.css("height",o.window-(o.footer-i))}else t.css("bottom",o.footer);else r<=o.header?!1===a?(t.css("top",o.header-r),l.css("height",o.window-(o.header-r))):t.css("top",o.header):!1===a?(t.css("top",0),l.css("height",o.window)):t.css("top",o.header);s&&a?(l.css("height","100%"),t.css("height","")):(s||a)&&(l.css("height","100%"),l.css("height",""))}},t._fixHeight=function(){var e=n.default("body"),t=n.default(this._config.target+" "+k);if(e.hasClass(B)){var o=n.default(window).height(),i=n.default(A).outerHeight(),r=n.default(O).outerHeight(),a=o-i;this._isFooterFixed()&&"fixed"===n.default(O).css("position")&&(a=o-i-r),t.css("height",a),void 0!==n.default.fn.overlayScrollbars&&t.overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}})}else t.attr("style","")},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(_),i=n.default.extend({},P,"object"==typeof t?t:n.default(this).data());if(o)if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}else void 0===t&&o._init();else o=new e(n.default(this),i),n.default(this).data(_,o),o._init()}))},e}();n.default(document).on("click",E,(function(e){e.preventDefault(),j._jQueryInterface.call(n.default(this),"toggle")})),n.default(document).ready((function(){j._jQueryInterface.call(n.default(E),"_init")})),n.default.fn[T]=j._jQueryInterface,n.default.fn[T].Constructor=j,n.default.fn[T].noConflict=function(){return n.default.fn[T]=S,j._jQueryInterface};var M="DirectChat",D="lte.directchat",N=n.default.fn[M],F=function(){function e(e){this._element=e}return e.prototype.toggle=function(){n.default(this._element).parents(".direct-chat").first().toggleClass("direct-chat-contacts-open"),n.default(this._element).trigger(n.default.Event("toggled.lte.directchat"))},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(D);if(o)if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}else void 0===t&&o._init();else o=new e(n.default(this)),n.default(this).data(D,o)}))},e}();n.default(document).on("click",'[data-widget="chat-pane-toggle"]',(function(e){e&&e.preventDefault(),F._jQueryInterface.call(n.default(this),"toggle")})),n.default.fn[M]=F._jQueryInterface,n.default.fn[M].Constructor=F,n.default.fn[M].noConflict=function(){return n.default.fn[M]=N,F._jQueryInterface};var R="Dropdown",H="lte.dropdown",z=n.default.fn[R],U={},V=function(){function e(e,t){this._config=t,this._element=e}var t=e.prototype;return t.toggleSubmenu=function(){this._element.siblings().show().toggleClass("show"),this._element.next().hasClass("show")||this._element.parents(".dropdown-menu").first().find(".show").removeClass("show").hide(),this._element.parents("li.nav-item.dropdown.show").on("hidden.bs.dropdown",(function(){n.default(".dropdown-submenu .show").removeClass("show").hide()}))},t.fixPosition=function(){var e=n.default(".dropdown-menu.show");if(0!==e.length){e.hasClass("dropdown-menu-right")?e.css({left:"inherit",right:0}):e.css({left:0,right:"inherit"});var t=e.offset(),o=e.width(),i=n.default(window).width()-t.left;t.left<0?e.css({left:"inherit",right:t.left-5}):i'+e+"";n.default(pe).append(unescape(escape(l)));var u='
';if(n.default(me).append(unescape(escape(u))),i)if(this._config.loadingScreen){var c=n.default(ye);c.is(":animated")||c.fadeIn(),n.default(a+" iframe").ready((function(){"number"==typeof r._config.loadingScreen?(r.switchTab("#"+s),setTimeout((function(){c.fadeOut()}),r._config.loadingScreen)):(r.switchTab("#"+s),c.fadeOut())}))}else this.switchTab("#"+s);this.onTabCreated(n.default("#"+s))},t.openTabSidebar=function(e,t){void 0===t&&(t=this._config.autoShowNewTab);var o=n.default(e).clone();void 0===o.attr("href")&&(o=n.default(e).parent("a").clone()),o.find(".right, .search-path").remove();var i=o.find("p").text();""===i&&(i=o.text());var r=o.attr("href");if("#"!==r&&""!==r&&void 0!==r){var a=unescape(r).replace("./","").replace(/["#&'./:=?[\]]/gi,"-").replace(/(--)/gi,""),s="tab-"+a;if(!this._config.allowDuplicates&&n.default("#"+s).length>0)return this.switchTab("#"+s,this._config.allowReload);(!this._config.allowDuplicates&&0===n.default("#"+s).length||this._config.allowDuplicates)&&this.createTab(i,r,a,t)}},t.switchTab=function(e,t){var o=this;void 0===t&&(t=!1);var i=n.default(e),r=i.attr("href");if(n.default(ve).hide(),t){var a=n.default(ye);this._config.loadingScreen?a.show(0,(function(){n.default(r+" iframe").attr("src",n.default(r+" iframe").attr("src")).ready((function(){o._config.loadingScreen&&("number"==typeof o._config.loadingScreen?setTimeout((function(){a.fadeOut()}),o._config.loadingScreen):a.fadeOut())}))})):n.default(r+" iframe").attr("src",n.default(r+" iframe").attr("src"))}n.default(pe+" .active").tab("dispose").removeClass("active"),this._fixHeight(),i.tab("show"),i.parents("li").addClass("active"),this.onTabChanged(i),this._config.autoItemActive&&this._setItemActive(n.default(r+" iframe").attr("src"))},t.removeActiveTab=function(e,t){if("all"==e)n.default(he).remove(),n.default(be).remove(),n.default(ve).show();else if("all-other"==e)n.default(he+":not(.active)").remove(),n.default(be+":not(.active)").remove();else if("only-this"==e){var o=n.default(t),i=o.parent(".nav-item"),r=i.parent(),a=i.index(),s=o.siblings(".nav-link").attr("aria-controls");if(i.remove(),n.default("#"+s).remove(),n.default(me).children().length==n.default(ve+", "+ye).length)n.default(ve).show();else{var l=a-1;this.switchTab(r.children().eq(l).find("a.nav-link"))}}else{var u=n.default(he+".active"),c=u.parent(),d=u.index();if(u.remove(),n.default(be+".active").remove(),n.default(me).children().length==n.default(ve+", "+ye).length)n.default(ve).show();else{var f=d-1;this.switchTab(c.children().eq(f).find("a.nav-link"))}}},t.toggleFullscreen=function(){n.default("body").hasClass(Se)?(n.default(ue+" i").removeClass(this._config.iconMinimize).addClass(this._config.iconMaximize),n.default("body").removeClass(Se),n.default(ve+", "+ye).height("100%"),n.default(ce).height("100%"),n.default(de).height("100%")):(n.default(ue+" i").removeClass(this._config.iconMaximize).addClass(this._config.iconMinimize),n.default("body").addClass(Se)),n.default(window).trigger("resize"),this._fixHeight(!0)},t._init=function(){var e=n.default(me).children().length>2;if(this._setupListeners(),this._fixHeight(!0),e){var t="#tab-"+n.default(""+be).first().attr("id").replace("panel-","");this.switchTab(t,!0)}},t._initFrameElement=function(){if(window.frameElement&&this._config&&this._config.autoIframeMode){var e=n.default("body");e.addClass(_e),this._config.autoDarkMode&&e.addClass("dark-mode")}},t._navScroll=function(e){var t=n.default(pe).scrollLeft();n.default(pe).animate({scrollLeft:t+e},250,"linear")},t._setupListeners=function(){var e=this;n.default(window).on("resize",(function(){setTimeout((function(){e._fixHeight()}),1)})),n.default(ce).hasClass(_e)&&(n.default(document).on("click",we+", .sidebar-search-results .list-group-item",(function(t){t.preventDefault(),e.openTabSidebar(t.target)})),this._config.useNavbarItems&&n.default(document).on("click",Ce+", "+Te,(function(t){t.preventDefault(),e.openTabSidebar(t.target)}))),n.default(document).on("click",ge,(function(t){t.preventDefault(),e.onTabClick(t.target),e.switchTab(t.target)})),n.default(document).on("click",ge,(function(t){t.preventDefault(),e.onTabClick(t.target),e.switchTab(t.target)})),n.default(document).on("click",'[data-widget="iframe-close"]',(function(t){t.preventDefault();var n=t.target;"I"===n.nodeName&&(n=t.target.offsetParent),e.removeActiveTab(n.attributes["data-type"]?n.attributes["data-type"].nodeValue:null,n)})),n.default(document).on("click",ue,(function(t){t.preventDefault(),e.toggleFullscreen()}));var t=!1,o=null;n.default(document).on("mousedown",'[data-widget="iframe-scrollleft"]',(function(n){n.preventDefault(),clearInterval(o);var i=e._config.scrollOffset;e._config.scrollBehaviorSwap||(i=-i),t=!0,e._navScroll(i),o=setInterval((function(){e._navScroll(i)}),250)})),n.default(document).on("mousedown",'[data-widget="iframe-scrollright"]',(function(n){n.preventDefault(),clearInterval(o);var i=e._config.scrollOffset;e._config.scrollBehaviorSwap&&(i=-i),t=!0,e._navScroll(i),o=setInterval((function(){e._navScroll(i)}),250)})),n.default(document).on("mouseup",(function(){t&&(t=!1,clearInterval(o),o=null)}))},t._setItemActive=function(e){n.default(we+", "+Te).removeClass("active"),n.default(Ce).parent().removeClass("active");var t=n.default(Ce+'[href$="'+e+'"]'),o=n.default('.main-header a.dropdown-item[href$="'+e+'"]'),i=n.default(we+'[href$="'+e+'"]');t.each((function(e,t){n.default(t).parent().addClass("active")})),o.each((function(e,t){n.default(t).addClass("active")})),i.each((function(e,t){n.default(t).addClass("active"),n.default(t).parents(".nav-treeview").prevAll(".nav-link").addClass("active")}))},t._fixHeight=function(e){if(void 0===e&&(e=!1),n.default("body").hasClass(Se)){var t=n.default(window).height(),o=n.default(fe).outerHeight();n.default(ve+", "+ye+", "+de).height(t-o),n.default(ce).height(t)}else{var i=parseFloat(n.default(ce).css("height")),r=n.default(fe).outerHeight();1==e?setTimeout((function(){n.default(ve+", "+ye).height(i-r)}),50):n.default(de).height(i-r)}},e._jQueryInterface=function(t,o,i,r,a){if(n.default(le).length>0){var s=n.default(this).data(ae);s||(s=n.default(this).data());var l=n.default.extend({},xe,"object"==typeof t?t:s);localStorage.setItem("AdminLTE:IFrame:Options",JSON.stringify(l));var u=new e(n.default(this),l);window.iFrameInstance=u,n.default(this).data(ae,"object"==typeof t?t:re({link:i,name:o,id:r,reload:a},s)),"string"==typeof t&&/createTab|openTabSidebar|switchTab|removeActiveTab/.test(t)&&u[t](o,i,r,a)}else window.iFrameInstance=new e(n.default(this),JSON.parse(localStorage.getItem("AdminLTE:IFrame:Options")))._initFrameElement()},e}();n.default(window).on("load",(function(){ke._jQueryInterface.call(n.default(le))})),n.default.fn.IFrame=ke._jQueryInterface,n.default.fn.IFrame.Constructor=ke,n.default.fn.IFrame.noConflict=function(){return n.default.fn.IFrame=se,ke._jQueryInterface};var Ee="lte.layout",Ae=n.default.fn.Layout,Oe=".main-header",Ie=".main-sidebar",Le=".main-sidebar .sidebar",$e=".main-footer",Be="sidebar-focused",Pe={scrollbarTheme:"os-theme-light",scrollbarAutoHide:"l",panelAutoHeight:!0,panelAutoHeightMode:"min-height",preloadDuration:200,loginRegisterAutoHeight:!0},je=function(){function e(e,t){this._config=t,this._element=e}var t=e.prototype;return t.fixLayoutHeight=function(e){void 0===e&&(e=null);var t=n.default("body"),o=0;(t.hasClass("control-sidebar-slide-open")||t.hasClass("control-sidebar-open")||"control_sidebar"===e)&&(o=n.default(".control-sidebar-content").outerHeight());var i={window:n.default(window).height(),header:n.default(Oe).length>0?n.default(Oe).outerHeight():0,footer:n.default($e).length>0?n.default($e).outerHeight():0,sidebar:n.default(Le).length>0?n.default(Le).height():0,controlSidebar:o},r=this._max(i),a=this._config.panelAutoHeight;!0===a&&(a=0);var s=n.default(".content-wrapper");!1!==a&&(r===i.controlSidebar?s.css(this._config.panelAutoHeightMode,r+a):r===i.window?s.css(this._config.panelAutoHeightMode,r+a-i.header-i.footer):s.css(this._config.panelAutoHeightMode,r+a-i.header),this._isFooterFixed()&&s.css(this._config.panelAutoHeightMode,parseFloat(s.css(this._config.panelAutoHeightMode))+i.footer)),t.hasClass("layout-fixed")&&(void 0!==n.default.fn.overlayScrollbars?n.default(Le).overlayScrollbars({className:this._config.scrollbarTheme,sizeAutoCapable:!0,scrollbars:{autoHide:this._config.scrollbarAutoHide,clickScrolling:!0}}):n.default(Le).css("overflow-y","auto"))},t.fixLoginRegisterHeight=function(){var e=n.default("body"),t=n.default(".login-box, .register-box");if(e.hasClass("iframe-mode"))e.css("height","100%"),n.default(".wrapper").css("height","100%"),n.default("html").css("height","100%");else if(0===t.length)e.css("height","auto"),n.default("html").css("height","auto");else{var o=t.height();e.css(this._config.panelAutoHeightMode)!==o&&e.css(this._config.panelAutoHeightMode,o)}},t._init=function(){var e=this;this.fixLayoutHeight(),!0===this._config.loginRegisterAutoHeight?this.fixLoginRegisterHeight():this._config.loginRegisterAutoHeight===parseInt(this._config.loginRegisterAutoHeight,10)&&setInterval(this.fixLoginRegisterHeight,this._config.loginRegisterAutoHeight),n.default(Le).on("collapsed.lte.treeview expanded.lte.treeview",(function(){e.fixLayoutHeight()})),n.default(Ie).on("mouseenter mouseleave",(function(){n.default("body").hasClass("sidebar-collapse")&&e.fixLayoutHeight()})),n.default('[data-widget="pushmenu"]').on("collapsed.lte.pushmenu shown.lte.pushmenu",(function(){setTimeout((function(){e.fixLayoutHeight()}),300)})),n.default('[data-widget="control-sidebar"]').on("collapsed.lte.controlsidebar",(function(){e.fixLayoutHeight()})).on("expanded.lte.controlsidebar",(function(){e.fixLayoutHeight("control_sidebar")})),n.default(window).resize((function(){e.fixLayoutHeight()})),setTimeout((function(){n.default("body.hold-transition").removeClass("hold-transition")}),50),setTimeout((function(){var e=n.default(".preloader");e&&(e.css("height",0),setTimeout((function(){e.children().hide()}),200))}),this._config.preloadDuration)},t._max=function(e){var t=0;return Object.keys(e).forEach((function(n){e[n]>t&&(t=e[n])})),t},t._isFooterFixed=function(){return"fixed"===n.default($e).css("position")},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(Ee),i=n.default.extend({},Pe,"object"==typeof t?t:n.default(this).data());if(o)if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}else void 0===t&&o._init();else o=new e(n.default(this),i),n.default(this).data(Ee,o),o._init()}))},e}();n.default(window).on("load",(function(){je._jQueryInterface.call(n.default("body"))})),n.default(Le+" a").on("focusin",(function(){n.default(Ie).addClass(Be)})).on("focusout",(function(){n.default(Ie).removeClass(Be)})),n.default.fn.Layout=je._jQueryInterface,n.default.fn.Layout.Constructor=je,n.default.fn.Layout.noConflict=function(){return n.default.fn.Layout=Ae,je._jQueryInterface};var Me="PushMenu",De="lte.pushmenu",Ne="."+De,Fe=n.default.fn[Me],Re='[data-widget="pushmenu"]',He="body",ze="sidebar-collapse",Ue="sidebar-open",Ve="sidebar-is-opening",qe="sidebar-closed",Qe={autoCollapseSize:992,enableRemember:!1,noTransitionAfterReload:!0,animationSpeed:300},We=function(){function e(e,t){this._element=e,this._options=t,0===n.default("#sidebar-overlay").length&&this._addOverlay(),this._init()}var t=e.prototype;return t.expand=function(){var e=n.default(He);this._options.autoCollapseSize&&n.default(window).width()<=this._options.autoCollapseSize&&e.addClass(Ue),e.addClass(Ve).removeClass("sidebar-collapse sidebar-closed").delay(50).queue((function(){e.removeClass(Ve),n.default(this).dequeue()})),this._options.enableRemember&&localStorage.setItem("remember"+Ne,Ue),n.default(this._element).trigger(n.default.Event("shown.lte.pushmenu"))},t.collapse=function(){var e=this,t=n.default(He);this._options.autoCollapseSize&&n.default(window).width()<=this._options.autoCollapseSize&&t.removeClass(Ue).addClass(qe),t.addClass(ze),this._options.enableRemember&&localStorage.setItem("remember"+Ne,ze),n.default(this._element).trigger(n.default.Event("collapsed.lte.pushmenu")),setTimeout((function(){n.default(e._element).trigger(n.default.Event("collapsed-done.lte.pushmenu"))}),this._options.animationSpeed)},t.toggle=function(){n.default(He).hasClass(ze)?this.expand():this.collapse()},t.autoCollapse=function(e){if(void 0===e&&(e=!1),this._options.autoCollapseSize){var t=n.default(He);n.default(window).width()<=this._options.autoCollapseSize?t.hasClass(Ue)||this.collapse():!0===e&&(t.hasClass(Ue)?t.removeClass(Ue):t.hasClass(qe)&&this.expand())}},t.remember=function(){if(this._options.enableRemember){var e=n.default("body");localStorage.getItem("remember"+Ne)===ze?this._options.noTransitionAfterReload?e.addClass("hold-transition").addClass(ze).delay(50).queue((function(){n.default(this).removeClass("hold-transition"),n.default(this).dequeue()})):e.addClass(ze):this._options.noTransitionAfterReload?e.addClass("hold-transition").removeClass(ze).delay(50).queue((function(){n.default(this).removeClass("hold-transition"),n.default(this).dequeue()})):e.removeClass(ze)}},t._init=function(){var e=this;this.remember(),this.autoCollapse(),n.default(window).resize((function(){e.autoCollapse(!0)}))},t._addOverlay=function(){var e=this,t=n.default("
",{id:"sidebar-overlay"});t.on("click",(function(){e.collapse()})),n.default(".wrapper").append(t)},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(De),i=n.default.extend({},Qe,"object"==typeof t?t:n.default(this).data());if(o)if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}else void 0===t&&o._init();else o=new e(n.default(this),i),n.default(this).data(De,o),o._init()}))},e}();n.default(document).on("click",Re,(function(e){e.preventDefault();var t=e.currentTarget;"pushmenu"!==n.default(t).data("widget")&&(t=n.default(t).closest(Re)),We._jQueryInterface.call(n.default(t),"toggle")})),n.default(window).on("load",(function(){We._jQueryInterface.call(n.default(Re))})),n.default.fn[Me]=We._jQueryInterface,n.default.fn[Me].Constructor=We,n.default.fn[Me].noConflict=function(){return n.default.fn[Me]=Fe,We._jQueryInterface};var Xe="SidebarSearch",Ke="lte.sidebar-search",Ye=n.default.fn[Xe],Ge="sidebar-search-open",Ze="fa-search",Je="fa-times",et='[data-widget="sidebar-search"]',tt=et+" .form-control",nt=et+" .btn",ot=nt+" i",it=".sidebar-search-results",rt=".sidebar-search-results .list-group",at={arrowSign:"->",minLength:3,maxResults:7,highlightName:!0,highlightPath:!1,highlightClass:"text-light",notFoundText:"No element found!"},st=[],lt=function(){function e(e,t){this.element=e,this.options=n.default.extend({},at,t),this.items=[]}var o=e.prototype;return o._init=function(){var e=this;0!==n.default(et).length&&(0===n.default(et).next(it).length&&n.default(et).after(n.default("
",{class:"sidebar-search-results"})),0===n.default(it).children(".list-group").length&&n.default(it).append(n.default("
",{class:"list-group"})),this._addNotFound(),n.default(".main-sidebar .nav-sidebar").children().each((function(t,n){e._parseItem(n)})))},o.search=function(){var e=this,t=n.default(tt).val().toLowerCase();if(t.length .nav-link"),a=n.default(e).clone().find("> .nav-treeview"),s=r.attr("href"),l=r.find("p").children().remove().end().text();if(i.name=this._trimText(l),i.link=s,i.path=t,0===a.length)st.push(i);else{var u=i.path.concat([i.name]);a.children().each((function(e,t){o._parseItem(t,u)}))}}},o._trimText=function(e){return t.trim(e.replace(/(\r\n|\n|\r)/gm," "))},o._renderItem=function(e,t,o){var i=this;if(o=o.join(" "+this.options.arrowSign+" "),e=unescape(e),t=decodeURI(t),this.options.highlightName||this.options.highlightPath){var r=n.default(tt).val().toLowerCase(),a=new RegExp(r,"gi");this.options.highlightName&&(e=e.replace(a,(function(e){return''+e+""}))),this.options.highlightPath&&(o=o.replace(a,(function(e){return''+e+""})))}var s=n.default("",{href:decodeURIComponent(t),class:"list-group-item"}),l=n.default("
",{class:"search-title"}).html(e),u=n.default("
",{class:"search-path"}).html(o);return s.append(l).append(u),s},o._addNotFound=function(){n.default(rt).append(this._renderItem(this.options.notFoundText,"#",[]))},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(Ke),i=n.default.extend({},at,"object"==typeof t?t:n.default(this).data());if(o)if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}else void 0===t&&o._init();else o=new e(n.default(this),i),n.default(this).data(Ke,o),o._init()}))},e}();n.default(document).on("click",nt,(function(e){e.preventDefault(),lt._jQueryInterface.call(n.default(et),"toggle")})),n.default(document).on("keyup",tt,(function(e){return 38==e.keyCode?(e.preventDefault(),void n.default(rt).children().last().focus()):40==e.keyCode?(e.preventDefault(),void n.default(rt).children().first().focus()):void setTimeout((function(){lt._jQueryInterface.call(n.default(et),"search")}),100)})),n.default(document).on("keydown",rt,(function(e){var t=n.default(":focus");38==e.keyCode&&(e.preventDefault(),t.is(":first-child")?t.siblings().last().focus():t.prev().focus()),40==e.keyCode&&(e.preventDefault(),t.is(":last-child")?t.siblings().first().focus():t.next().focus())})),n.default(window).on("load",(function(){lt._jQueryInterface.call(n.default(et),"init")})),n.default.fn[Xe]=lt._jQueryInterface,n.default.fn[Xe].Constructor=lt,n.default.fn[Xe].noConflict=function(){return n.default.fn[Xe]=Ye,lt._jQueryInterface};var ut="NavbarSearch",ct="lte.navbar-search",dt=n.default.fn[ut],ft='[data-widget="navbar-search"]',pt=".form-control",ht="navbar-search-open",gt={resetOnClose:!0,target:".navbar-search-block"},mt=function(){function e(e,t){this._element=e,this._config=t}var t=e.prototype;return t.open=function(){n.default(this._config.target).css("display","flex").hide().fadeIn().addClass(ht),n.default(this._config.target+" "+pt).focus()},t.close=function(){n.default(this._config.target).fadeOut().removeClass(ht),this._config.resetOnClose&&n.default(this._config.target+" "+pt).val("")},t.toggle=function(){n.default(this._config.target).hasClass(ht)?this.close():this.open()},e._jQueryInterface=function(t){return this.each((function(){var o=n.default(this).data(ct),i=n.default.extend({},gt,"object"==typeof t?t:n.default(this).data());if(o){if("string"==typeof t){if(void 0===o[t])throw new TypeError('No method named "'+t+'"');o[t]()}}else o=new e(n.default(this),i),n.default(this).data(ct,o)}))},e}();n.default(document).on("click",ft,(function(e){e.preventDefault();var t=n.default(e.currentTarget);"navbar-search"!==t.data("widget")&&(t=t.closest(ft)),mt._jQueryInterface.call(t,"toggle")})),n.default.fn[ut]=mt._jQueryInterface,n.default.fn[ut].Constructor=mt,n.default.fn[ut].noConflict=function(){return n.default.fn[ut]=dt,mt._jQueryInterface};var vt=n.default.fn.Toasts,yt="topRight",bt="topLeft",wt="bottomRight",Ct="bottomLeft",Tt={position:yt,fixed:!0,autohide:!1,autoremove:!0,delay:1e3,fade:!0,icon:null,image:null,imageAlt:null,imageHeight:"25px",title:null,subtitle:null,close:!0,body:null,class:null},_t=function(){function e(e,t){this._config=t,this._prepareContainer(),n.default("body").trigger(n.default.Event("init.lte.toasts"))}var t=e.prototype;return t.create=function(){var e=n.default('