Sucuri Security – Auditing, Malware Scanner and Security Hardening - Version 1.8.4

Version Description

This version adds support for the latest version of WordPress. Introduces new features and fixes some bugs reported by the WordPress community as well as bugs found by our automated testing system.

=

Download this release

Release Info

Developer yorman
Plugin Icon 128x128 Sucuri Security – Auditing, Malware Scanner and Security Hardening
Version 1.8.4
Comparing to
See all releases

Code changes from version 1.8.3 to 1.8.4

Files changed (191) hide show
  1. .htaccess +0 -8
  2. inc/css/c3.min.css +1 -0
  3. inc/css/flags.min.css +256 -0
  4. inc/css/styles.css +846 -0
  5. inc/css/sucuri-scanner.min.css +0 -1
  6. inc/images/antivirus-logo-x42.png +0 -0
  7. inc/images/checkcross.png +0 -0
  8. inc/images/checkinfo.png +0 -0
  9. inc/images/checkmark.png +0 -0
  10. inc/images/checknotice.png +0 -0
  11. inc/images/checkwarn.png +0 -0
  12. inc/images/cloudproxy-logo-x42.png +0 -0
  13. inc/images/flags.sprite.png +0 -0
  14. inc/images/logo.png +0 -0
  15. inc/images/main-logo.png +0 -0
  16. inc/images/mainlogo.png +0 -0
  17. inc/images/menu-icon.png +0 -0
  18. inc/images/menuicon.png +0 -0
  19. inc/images/pluginlogo.png +0 -0
  20. inc/images/sucuri-website.png +0 -0
  21. inc/js/c3.min.js +6 -5
  22. inc/js/d3.min.js +5 -5
  23. inc/js/scripts.js +109 -0
  24. inc/js/sucuri-scanner.min.js +0 -1
  25. inc/tpl/auditlogs-report.html.tpl +108 -0
  26. inc/tpl/auditlogs.html.tpl +103 -0
  27. inc/tpl/auditlogs.snippet.tpl +31 -0
  28. inc/tpl/base.html.tpl +28 -28
  29. inc/tpl/bsidebar.html.tpl +0 -67
  30. inc/tpl/corefiles-page.html.tpl +0 -39
  31. inc/tpl/corefiles.html.tpl +0 -88
  32. inc/tpl/corefiles.snippet.tpl +0 -14
  33. inc/tpl/dashboard.html.tpl +72 -0
  34. inc/tpl/firewall-auditlogs.html.tpl +56 -50
  35. inc/tpl/firewall-auditlogs.snippet.tpl +2 -2
  36. inc/tpl/firewall-clearcache.html.tpl +48 -48
  37. inc/tpl/firewall-settings.html.tpl +54 -56
  38. inc/tpl/firewall-settings.snippet.tpl +1 -1
  39. inc/tpl/firewall.html.tpl +8 -14
  40. inc/tpl/hardening-panel.html.tpl +0 -35
  41. inc/tpl/hardening-whitelist.html.tpl +0 -96
  42. inc/tpl/hardening.html.tpl +0 -37
  43. inc/tpl/hardening.snippet.tpl +0 -19
  44. inc/tpl/infosys-cronjobs.html.tpl +0 -62
  45. inc/tpl/infosys-errorlogs-flimit.html.tpl +0 -24
  46. inc/tpl/infosys-errorlogs-freader.html.tpl +0 -61
  47. inc/tpl/infosys-errorlogs-status.html.tpl +0 -23
  48. inc/tpl/infosys-errorlogs.html.tpl +0 -8
  49. inc/tpl/infosys-errorlogs.snippet.tpl +0 -8
  50. inc/tpl/infosys-htaccess.html.tpl +0 -41
  51. inc/tpl/infosys-serverinfo.html.tpl +0 -6
  52. inc/tpl/infosys-wpconfig.html.tpl +0 -13
  53. inc/tpl/infosys-wpconfig.snippet.tpl +0 -5
  54. inc/tpl/infosys.html.tpl +0 -42
  55. inc/tpl/integrity-auditlogs.html.tpl +0 -102
  56. inc/tpl/integrity-auditlogs.snippet.tpl +0 -15
  57. inc/tpl/integrity-auditreport.html.tpl +0 -109
  58. inc/tpl/integrity-correct.html.tpl +32 -0
  59. inc/tpl/integrity-diff-utility.html.tpl +50 -0
  60. inc/tpl/integrity-incorrect.html.tpl +90 -0
  61. inc/tpl/integrity-incorrect.snippet.tpl +58 -0
  62. inc/tpl/integrity-modifiedfiles.html.tpl +0 -88
  63. inc/tpl/integrity-modifiedfiles.snippet.tpl +0 -6
  64. inc/tpl/{corefiles-notification.html.tpl → integrity-notification.html.tpl} +3 -3
  65. inc/tpl/integrity-wpoutdate.html.tpl +0 -10
  66. inc/tpl/integrity.html.tpl +37 -5
  67. inc/tpl/lastlogins-admins-lastlogin.snippet.tpl +2 -1
  68. inc/tpl/lastlogins-admins.html.tpl +24 -14
  69. inc/tpl/lastlogins-admins.snippet.tpl +5 -1
  70. inc/tpl/lastlogins-all.html.tpl +40 -38
  71. inc/tpl/lastlogins-all.snippet.tpl +5 -2
  72. inc/tpl/lastlogins-blockedusers.html.tpl +55 -58
  73. inc/tpl/lastlogins-blockedusers.snippet.tpl +7 -3
  74. inc/tpl/lastlogins-failedlogins.html.tpl +58 -81
  75. inc/tpl/lastlogins-failedlogins.snippet.tpl +9 -4
  76. inc/tpl/lastlogins-loggedin.html.tpl +29 -18
  77. inc/tpl/lastlogins-loggedin.snippet.tpl +7 -4
  78. inc/tpl/lastlogins.html.tpl +12 -22
  79. inc/tpl/malwarescan-appdetail.snippet.tpl +0 -5
  80. inc/tpl/malwarescan-outdated.snippet.tpl +0 -8
  81. inc/tpl/malwarescan-recommendation.snippet.tpl +0 -11
  82. inc/tpl/malwarescan-resblacklist.html.tpl +0 -14
  83. inc/tpl/malwarescan-resblacklist.snippet.tpl +0 -12
  84. inc/tpl/malwarescan-resmalware.html.tpl +0 -114
  85. inc/tpl/malwarescan-resmalware.snippet.tpl +0 -25
  86. inc/tpl/malwarescan-results.html.tpl +0 -49
  87. inc/tpl/malwarescan-reswebdetails.html.tpl +0 -45
  88. inc/tpl/malwarescan-resweblinks.html.tpl +0 -10
  89. inc/tpl/malwarescan-sysnotice.snippet.tpl +0 -6
  90. inc/tpl/malwarescan-weblinkitems.snippet.tpl +0 -6
  91. inc/tpl/malwarescan-weblinktitle.snippet.tpl +0 -9
  92. inc/tpl/malwarescan.html.tpl +0 -37
  93. inc/tpl/modalwindow.html.tpl +1 -5
  94. inc/tpl/notification-admin.html.tpl +1 -1
  95. inc/tpl/notification-pretty.html.tpl +28 -30
  96. inc/tpl/notification-resetpwd.html.tpl +0 -11
  97. inc/tpl/notification-simple.html.tpl +5 -9
  98. inc/tpl/posthack-resetpassword.html.tpl +0 -63
  99. inc/tpl/posthack-resetpassword.snippet.tpl +0 -10
  100. inc/tpl/posthack-resetplugins.html.tpl +0 -74
  101. inc/tpl/posthack-resetplugins.snippet.tpl +0 -12
  102. inc/tpl/posthack-updates.html.tpl +0 -46
  103. inc/tpl/posthack-updatesecretkeys.html.tpl +0 -53
  104. inc/tpl/posthack.html.tpl +0 -35
  105. inc/tpl/register-site.html.tpl +51 -0
  106. inc/tpl/settings-alert-subject.snippet.tpl +0 -8
  107. inc/tpl/settings-alert.html.tpl +0 -12
  108. inc/tpl/{settings-alert-bruteforce.html.tpl → settings-alerts-bruteforce.html.tpl} +13 -13
  109. inc/tpl/{settings-alert-events.html.tpl → settings-alerts-events.html.tpl} +9 -9
  110. inc/tpl/{settings-alert-events.snippet.tpl → settings-alerts-events.snippet.tpl} +4 -3
  111. inc/tpl/settings-alerts-ignore-posts.html.tpl +62 -0
  112. inc/tpl/{settings-ignorerules.snippet.tpl → settings-alerts-ignore-posts.snippet.tpl} +8 -6
  113. inc/tpl/{settings-alert-perhour.html.tpl → settings-alerts-perhour.html.tpl} +8 -8
  114. inc/tpl/{settings-alert-recipients.html.tpl → settings-alerts-recipients.html.tpl} +14 -18
  115. inc/tpl/{settings-alert-recipients.snippet.tpl → settings-alerts-recipients.snippet.tpl} +4 -3
  116. inc/tpl/{settings-alert-subject.html.tpl → settings-alerts-subject.html.tpl} +7 -7
  117. inc/tpl/settings-alerts-subject.snippet.tpl +7 -0
  118. inc/tpl/settings-alerts-trustedips.html.tpl +56 -0
  119. inc/tpl/{settings-trustip.snippet.tpl → settings-alerts-trustedips.snippet.tpl} +6 -3
  120. inc/tpl/settings-apirecovery.html.tpl +4 -4
  121. inc/tpl/settings-apiregistered.html.tpl +8 -6
  122. inc/tpl/settings-apiservice-handler.html.tpl +0 -25
  123. inc/tpl/settings-apiservice-protocol.html.tpl +0 -105
  124. inc/tpl/settings-apiservice-protocol.snippet.tpl +0 -8
  125. inc/tpl/settings-apiservice-proxy.html.tpl +10 -9
  126. inc/tpl/settings-apiservice-ssl.html.tpl +0 -38
  127. inc/tpl/settings-apiservice-status.html.tpl +7 -5
  128. inc/tpl/settings-apiservice-timeout.html.tpl +7 -7
  129. inc/tpl/settings-apiservice.html.tpl +0 -14
  130. inc/tpl/settings-corefiles-cache.html.tpl +0 -42
  131. inc/tpl/settings-corefiles-cache.snippet.tpl +0 -6
  132. inc/tpl/settings-corefiles-language.html.tpl +0 -40
  133. inc/tpl/settings-corefiles-status.html.tpl +0 -42
  134. inc/tpl/settings-datastorage-files.snippet.tpl +0 -11
  135. inc/tpl/settings-general-apikey.html.tpl +5 -5
  136. inc/tpl/settings-general-auditlogstats.html.tpl +15 -25
  137. inc/tpl/settings-general-commentmonitor.html.tpl +8 -12
  138. inc/tpl/settings-general-cronjobs.html.tpl +54 -0
  139. inc/tpl/{infosys-cronjobs.snippet.tpl → settings-general-cronjobs.snippet.tpl} +7 -3
  140. inc/tpl/settings-general-datastorage.html.tpl +29 -29
  141. inc/tpl/settings-general-datastorage.snippet.tpl +22 -0
  142. inc/tpl/settings-general-datetime.html.tpl +0 -21
  143. inc/tpl/settings-general-importexport.html.tpl +38 -0
  144. inc/tpl/settings-general-ipdiscoverer.html.tpl +26 -34
  145. inc/tpl/settings-general-pwdcollector.html.tpl +0 -39
  146. inc/tpl/settings-general-resetoptions.html.tpl +9 -20
  147. inc/tpl/settings-general-reverseproxy.html.tpl +11 -13
  148. inc/tpl/{settings-selfhosting-monitor.html.tpl → settings-general-selfhosting.html.tpl} +15 -16
  149. inc/tpl/settings-general-xhrmonitor.html.tpl +0 -45
  150. inc/tpl/settings-general.html.tpl +0 -22
  151. inc/tpl/settings-hardening-options.snippet.tpl +44 -0
  152. inc/tpl/settings-hardening-whitelist-phpfiles.html.tpl +81 -0
  153. inc/tpl/{hardening-whitelist.snippet.tpl → settings-hardening-whitelist-phpfiles.snippet.tpl} +6 -3
  154. inc/tpl/settings-heartbeat.html.tpl +0 -84
  155. inc/tpl/settings-ignorerules.html.tpl +0 -49
  156. inc/tpl/settings-ignorescan-files.html.tpl +0 -20
  157. inc/tpl/settings-ignorescan-folders.html.tpl +0 -59
  158. inc/tpl/settings-ignorescan-status.html.tpl +0 -25
  159. inc/tpl/settings-ignorescan.html.tpl +0 -8
  160. inc/tpl/{posthack-updates-notification.html.tpl → settings-posthack-available-updates-alert.html.tpl} +4 -3
  161. inc/tpl/settings-posthack-available-updates.html.tpl +48 -0
  162. inc/tpl/{posthack-updates.snippet.tpl → settings-posthack-available-updates.snippet.tpl} +5 -1
  163. inc/tpl/settings-posthack-reset-password-alert.html.tpl +6 -0
  164. inc/tpl/settings-posthack-reset-password.html.tpl +80 -0
  165. inc/tpl/settings-posthack-reset-password.snippet.tpl +17 -0
  166. inc/tpl/settings-posthack-reset-plugins.html.tpl +97 -0
  167. inc/tpl/settings-posthack-reset-plugins.snippet.tpl +22 -0
  168. inc/tpl/settings-posthack-security-keys.html.tpl +53 -0
  169. inc/tpl/{posthack-updatesecretkeys.snippet.tpl → settings-posthack-security-keys.snippet.tpl} +4 -2
  170. inc/tpl/settings-scanner-ignore-folders.html.tpl +75 -0
  171. inc/tpl/{settings-ignorescan.snippet.tpl → settings-scanner-ignore-folders.snippet.tpl} +6 -4
  172. inc/tpl/settings-scanner-integrity-cache.html.tpl +51 -0
  173. inc/tpl/settings-scanner-integrity-cache.snippet.tpl +18 -0
  174. inc/tpl/settings-scanner-integrity-diff-utility.html.tpl +34 -0
  175. inc/tpl/settings-scanner-integrity-language.html.tpl +38 -0
  176. inc/tpl/settings-scanner-options.html.tpl +42 -0
  177. inc/tpl/settings-scanner.html.tpl +0 -145
  178. inc/tpl/settings-selfhosting.html.tpl +0 -4
  179. inc/tpl/settings-sitecheck-cache.html.tpl +0 -23
  180. inc/tpl/settings-sitecheck-status.html.tpl +0 -56
  181. inc/tpl/settings-sitecheck-timeout.html.tpl +0 -43
  182. inc/tpl/settings-trustip.html.tpl +0 -58
  183. inc/tpl/settings-webinfo-details.html.tpl +12 -0
  184. inc/tpl/{infosys-serverinfo.snippet.tpl → settings-webinfo-details.snippet.tpl} +2 -1
  185. inc/tpl/settings-webinfo-htaccess.html.tpl +39 -0
  186. inc/tpl/settings-webinfo-wpconfig.html.tpl +19 -0
  187. inc/tpl/settings-webinfo-wpconfig.snippet.tpl +6 -0
  188. inc/tpl/settings.html.tpl +101 -49
  189. inc/tpl/setup-form.html.tpl +0 -70
  190. inc/tpl/setup-notice.html.tpl +0 -20
  191. inc/tpl/sitecheck-blacklist.html.tpl +2 -0
.htaccess DELETED
@@ -1,8 +0,0 @@
1
-
2
- Order Deny,Allow
3
- Deny from all
4
-
5
- <FilesMatch "\.(gif|jpe?g|png|css|js)$">
6
- Order Allow,Deny
7
- Allow from all
8
- </FilesMatch>
 
 
 
 
 
 
 
 
inc/css/c3.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:gray;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-title{font:14px sans-serif}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}
inc/css/flags.min.css ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .sucuriscan-flag {
2
+ background: url("../images/flags.sprite.png") no-repeat;
3
+ height: 11px;
4
+ width: 16px;
5
+ }
6
+ .sucuriscan-flag-ad { background-position: -16px 0; }
7
+ .sucuriscan-flag-ae { background-position: -32px 0; }
8
+ .sucuriscan-flag-af { background-position: -48px 0; }
9
+ .sucuriscan-flag-ag { background-position: -64px 0; }
10
+ .sucuriscan-flag-ai { background-position: -80px 0; }
11
+ .sucuriscan-flag-al { background-position: -96px 0; }
12
+ .sucuriscan-flag-am { background-position: -112px 0; }
13
+ .sucuriscan-flag-an { background-position: -128px 0; }
14
+ .sucuriscan-flag-ao { background-position: -144px 0; }
15
+ .sucuriscan-flag-ar { background-position: -160px 0; }
16
+ .sucuriscan-flag-as { background-position: -176px 0; }
17
+ .sucuriscan-flag-at { background-position: -192px 0; }
18
+ .sucuriscan-flag-au { background-position: -208px 0; }
19
+ .sucuriscan-flag-aw { background-position: -224px 0; }
20
+ .sucuriscan-flag-az { background-position: -240px 0; }
21
+ .sucuriscan-flag-ba { background-position: 0 -11px; }
22
+ .sucuriscan-flag-bb { background-position: -16px -11px; }
23
+ .sucuriscan-flag-bd { background-position: -32px -11px; }
24
+ .sucuriscan-flag-be { background-position: -48px -11px; }
25
+ .sucuriscan-flag-bf { background-position: -64px -11px; }
26
+ .sucuriscan-flag-bg { background-position: -80px -11px; }
27
+ .sucuriscan-flag-bh { background-position: -96px -11px; }
28
+ .sucuriscan-flag-bi { background-position: -112px -11px; }
29
+ .sucuriscan-flag-bj { background-position: -128px -11px; }
30
+ .sucuriscan-flag-bm { background-position: -144px -11px; }
31
+ .sucuriscan-flag-bn { background-position: -160px -11px; }
32
+ .sucuriscan-flag-bo { background-position: -176px -11px; }
33
+ .sucuriscan-flag-br { background-position: -192px -11px; }
34
+ .sucuriscan-flag-bs { background-position: -208px -11px; }
35
+ .sucuriscan-flag-bt { background-position: -224px -11px; }
36
+ .sucuriscan-flag-bv { background-position: -240px -11px; }
37
+ .sucuriscan-flag-bw { background-position: 0 -22px; }
38
+ .sucuriscan-flag-by { background-position: -16px -22px; }
39
+ .sucuriscan-flag-bz { background-position: -32px -22px; }
40
+ .sucuriscan-flag-ca { background-position: -48px -22px; }
41
+ .sucuriscan-flag-cd { background-position: -80px -22px; }
42
+ .sucuriscan-flag-cf { background-position: -96px -22px; }
43
+ .sucuriscan-flag-cg { background-position: -112px -22px; }
44
+ .sucuriscan-flag-ch { background-position: -128px -22px; }
45
+ .sucuriscan-flag-ci { background-position: -144px -22px; }
46
+ .sucuriscan-flag-ck { background-position: -160px -22px; }
47
+ .sucuriscan-flag-cl { background-position: -176px -22px; }
48
+ .sucuriscan-flag-cm { background-position: -192px -22px; }
49
+ .sucuriscan-flag-cn { background-position: -208px -22px; }
50
+ .sucuriscan-flag-co { background-position: -224px -22px; }
51
+ .sucuriscan-flag-cr { background-position: -240px -22px; }
52
+ .sucuriscan-flag-cu { background-position: 0 -33px; }
53
+ .sucuriscan-flag-cv { background-position: -16px -33px; }
54
+ .sucuriscan-flag-cw { background-position: -32px -33px; }
55
+ .sucuriscan-flag-cy { background-position: -48px -33px; }
56
+ .sucuriscan-flag-cz { background-position: -64px -33px; }
57
+ .sucuriscan-flag-de { background-position: -80px -33px; }
58
+ .sucuriscan-flag-dj { background-position: -96px -33px; }
59
+ .sucuriscan-flag-dk { background-position: -112px -33px; }
60
+ .sucuriscan-flag-dm { background-position: -128px -33px; }
61
+ .sucuriscan-flag-do { background-position: -144px -33px; }
62
+ .sucuriscan-flag-dz { background-position: -160px -33px; }
63
+ .sucuriscan-flag-ec { background-position: -176px -33px; }
64
+ .sucuriscan-flag-ee { background-position: -192px -33px; }
65
+ .sucuriscan-flag-eg { background-position: -208px -33px; }
66
+ .sucuriscan-flag-eh { background-position: -224px -33px; }
67
+ .sucuriscan-flag-er { background-position: 0 -44px; }
68
+ .sucuriscan-flag-es { background-position: -16px -44px; }
69
+ .sucuriscan-flag-et { background-position: -32px -44px; }
70
+ .sucuriscan-flag-eu { background-position: -48px -44px; }
71
+ .sucuriscan-flag-fi { background-position: -64px -44px; }
72
+ .sucuriscan-flag-fj { background-position: -80px -44px; }
73
+ .sucuriscan-flag-fk { background-position: -96px -44px; }
74
+ .sucuriscan-flag-fm { background-position: -112px -44px; }
75
+ .sucuriscan-flag-fo { background-position: -128px -44px; }
76
+ .sucuriscan-flag-fr { background-position: -144px -44px; }
77
+ .sucuriscan-flag-ga { background-position: -160px -44px; }
78
+ .sucuriscan-flag-gb { background-position: -176px -44px; }
79
+ .sucuriscan-flag-gd { background-position: -192px -44px; }
80
+ .sucuriscan-flag-ge { background-position: -208px -44px; }
81
+ .sucuriscan-flag-gf { background-position: -224px -44px; }
82
+ .sucuriscan-flag-gg { background-position: -240px -44px; }
83
+ .sucuriscan-flag-gh { background-position: 0 -55px; }
84
+ .sucuriscan-flag-gi { background-position: -16px -55px; }
85
+ .sucuriscan-flag-gl { background-position: -32px -55px; }
86
+ .sucuriscan-flag-gm { background-position: -48px -55px; }
87
+ .sucuriscan-flag-gn { background-position: -64px -55px; }
88
+ .sucuriscan-flag-gp { background-position: -80px -55px; }
89
+ .sucuriscan-flag-gq { background-position: -96px -55px; }
90
+ .sucuriscan-flag-gr { background-position: -112px -55px; }
91
+ .sucuriscan-flag-gs { background-position: -128px -55px; }
92
+ .sucuriscan-flag-gt { background-position: -144px -55px; }
93
+ .sucuriscan-flag-gu { background-position: -160px -55px; }
94
+ .sucuriscan-flag-gw { background-position: -176px -55px; }
95
+ .sucuriscan-flag-gy { background-position: -192px -55px; }
96
+ .sucuriscan-flag-hk { background-position: -208px -55px; }
97
+ .sucuriscan-flag-hm { background-position: -224px -55px; }
98
+ .sucuriscan-flag-hn { background-position: -240px -55px; }
99
+ .sucuriscan-flag-hr { background-position: 0 -66px; }
100
+ .sucuriscan-flag-ht { background-position: -16px -66px; }
101
+ .sucuriscan-flag-hu { background-position: -32px -66px; }
102
+ .sucuriscan-flag-ic { background-position: -48px -66px; }
103
+ .sucuriscan-flag-id { background-position: -64px -66px; }
104
+ .sucuriscan-flag-ie { background-position: -80px -66px; }
105
+ .sucuriscan-flag-il { background-position: -96px -66px; }
106
+ .sucuriscan-flag-im { background-position: -112px -66px; }
107
+ .sucuriscan-flag-in { background-position: -128px -66px; }
108
+ .sucuriscan-flag-io { background-position: -144px -66px; }
109
+ .sucuriscan-flag-iq { background-position: -160px -66px; }
110
+ .sucuriscan-flag-ir { background-position: -176px -66px; }
111
+ .sucuriscan-flag-is { background-position: -192px -66px; }
112
+ .sucuriscan-flag-it { background-position: -208px -66px; }
113
+ .sucuriscan-flag-je { background-position: -224px -66px; }
114
+ .sucuriscan-flag-jm { background-position: -240px -66px; }
115
+ .sucuriscan-flag-jo { background-position: 0 -77px; }
116
+ .sucuriscan-flag-jp { background-position: -16px -77px; }
117
+ .sucuriscan-flag-ke { background-position: -32px -77px; }
118
+ .sucuriscan-flag-kg { background-position: -48px -77px; }
119
+ .sucuriscan-flag-kh { background-position: -64px -77px; }
120
+ .sucuriscan-flag-ki { background-position: -80px -77px; }
121
+ .sucuriscan-flag-km { background-position: -96px -77px; }
122
+ .sucuriscan-flag-kn { background-position: -112px -77px; }
123
+ .sucuriscan-flag-kp { background-position: -128px -77px; }
124
+ .sucuriscan-flag-kr { background-position: -144px -77px; }
125
+ .sucuriscan-flag-kw { background-position: -176px -77px; }
126
+ .sucuriscan-flag-ky { background-position: -192px -77px; }
127
+ .sucuriscan-flag-kz { background-position: -208px -77px; }
128
+ .sucuriscan-flag-la { background-position: -224px -77px; }
129
+ .sucuriscan-flag-lb { background-position: -240px -77px; }
130
+ .sucuriscan-flag-lc { background-position: 0 -88px; }
131
+ .sucuriscan-flag-li { background-position: -16px -88px; }
132
+ .sucuriscan-flag-lk { background-position: -32px -88px; }
133
+ .sucuriscan-flag-lr { background-position: -48px -88px; }
134
+ .sucuriscan-flag-ls { background-position: -64px -88px; }
135
+ .sucuriscan-flag-lt { background-position: -80px -88px; }
136
+ .sucuriscan-flag-lu { background-position: -96px -88px; }
137
+ .sucuriscan-flag-lv { background-position: -112px -88px; }
138
+ .sucuriscan-flag-ly { background-position: -128px -88px; }
139
+ .sucuriscan-flag-ma { background-position: -144px -88px; }
140
+ .sucuriscan-flag-mc { background-position: -160px -88px; }
141
+ .sucuriscan-flag-md { background-position: -176px -88px; }
142
+ .sucuriscan-flag-me { background-position: -192px -88px; }
143
+ .sucuriscan-flag-mg { background-position: -208px -88px; }
144
+ .sucuriscan-flag-mh { background-position: -224px -88px; }
145
+ .sucuriscan-flag-mk { background-position: -240px -88px; }
146
+ .sucuriscan-flag-ml { background-position: 0 -99px; }
147
+ .sucuriscan-flag-mm { background-position: -16px -99px; }
148
+ .sucuriscan-flag-mn { background-position: -32px -99px; }
149
+ .sucuriscan-flag-mo { background-position: -48px -99px; }
150
+ .sucuriscan-flag-mp { background-position: -64px -99px; }
151
+ .sucuriscan-flag-mq { background-position: -80px -99px; }
152
+ .sucuriscan-flag-mr { background-position: -96px -99px; }
153
+ .sucuriscan-flag-ms { background-position: -112px -99px; }
154
+ .sucuriscan-flag-mt { background-position: -128px -99px; }
155
+ .sucuriscan-flag-mu { background-position: -144px -99px; }
156
+ .sucuriscan-flag-mv { background-position: -160px -99px; }
157
+ .sucuriscan-flag-mw { background-position: -176px -99px; }
158
+ .sucuriscan-flag-mx { background-position: -192px -99px; }
159
+ .sucuriscan-flag-my { background-position: -208px -99px; }
160
+ .sucuriscan-flag-mz { background-position: -224px -99px; }
161
+ .sucuriscan-flag-na { background-position: -240px -99px; }
162
+ .sucuriscan-flag-nc { background-position: 0 -110px; }
163
+ .sucuriscan-flag-ne { background-position: -16px -110px; }
164
+ .sucuriscan-flag-nf { background-position: -32px -110px; }
165
+ .sucuriscan-flag-ng { background-position: -48px -110px; }
166
+ .sucuriscan-flag-ni { background-position: -64px -110px; }
167
+ .sucuriscan-flag-nl { background-position: -80px -110px; }
168
+ .sucuriscan-flag-no { background-position: -96px -110px; }
169
+ .sucuriscan-flag-np { background-position: -112px -110px; }
170
+ .sucuriscan-flag-nr { background-position: -128px -110px; }
171
+ .sucuriscan-flag-nu { background-position: -144px -110px; }
172
+ .sucuriscan-flag-nz { background-position: -160px -110px; }
173
+ .sucuriscan-flag-om { background-position: -176px -110px; }
174
+ .sucuriscan-flag-pa { background-position: -192px -110px; }
175
+ .sucuriscan-flag-pe { background-position: -208px -110px; }
176
+ .sucuriscan-flag-pf { background-position: -224px -110px; }
177
+ .sucuriscan-flag-pg { background-position: -240px -110px; }
178
+ .sucuriscan-flag-ph { background-position: 0 -121px; }
179
+ .sucuriscan-flag-pk { background-position: -16px -121px; }
180
+ .sucuriscan-flag-pl { background-position: -32px -121px; }
181
+ .sucuriscan-flag-pm { background-position: -48px -121px; }
182
+ .sucuriscan-flag-pn { background-position: -64px -121px; }
183
+ .sucuriscan-flag-pr { background-position: -80px -121px; }
184
+ .sucuriscan-flag-ps { background-position: -96px -121px; }
185
+ .sucuriscan-flag-pt { background-position: -112px -121px; }
186
+ .sucuriscan-flag-pw { background-position: -128px -121px; }
187
+ .sucuriscan-flag-py { background-position: -144px -121px; }
188
+ .sucuriscan-flag-qa { background-position: -160px -121px; }
189
+ .sucuriscan-flag-re { background-position: -176px -121px; }
190
+ .sucuriscan-flag-ro { background-position: -192px -121px; }
191
+ .sucuriscan-flag-rs { background-position: -208px -121px; }
192
+ .sucuriscan-flag-ru { background-position: -224px -121px; }
193
+ .sucuriscan-flag-rw { background-position: -240px -121px; }
194
+ .sucuriscan-flag-sa { background-position: 0 -132px; }
195
+ .sucuriscan-flag-sb { background-position: -16px -132px; }
196
+ .sucuriscan-flag-sc { background-position: -32px -132px; }
197
+ .sucuriscan-flag-sd { background-position: -64px -132px; }
198
+ .sucuriscan-flag-se { background-position: -80px -132px; }
199
+ .sucuriscan-flag-sg { background-position: -96px -132px; }
200
+ .sucuriscan-flag-sh { background-position: -112px -132px; }
201
+ .sucuriscan-flag-si { background-position: -128px -132px; }
202
+ .sucuriscan-flag-sk { background-position: -144px -132px; }
203
+ .sucuriscan-flag-sl { background-position: -160px -132px; }
204
+ .sucuriscan-flag-sm { background-position: -176px -132px; }
205
+ .sucuriscan-flag-sn { background-position: -192px -132px; }
206
+ .sucuriscan-flag-so { background-position: -208px -132px; }
207
+ .sucuriscan-flag-sr { background-position: -240px -132px; }
208
+ .sucuriscan-flag-ss { background-position: 0 -143px; }
209
+ .sucuriscan-flag-st { background-position: -16px -143px; }
210
+ .sucuriscan-flag-sv { background-position: -32px -143px; }
211
+ .sucuriscan-flag-sx { background-position: -48px -143px; }
212
+ .sucuriscan-flag-sy { background-position: -64px -143px; }
213
+ .sucuriscan-flag-sz { background-position: -80px -143px; }
214
+ .sucuriscan-flag-tc { background-position: -96px -143px; }
215
+ .sucuriscan-flag-td { background-position: -112px -143px; }
216
+ .sucuriscan-flag-tf { background-position: -128px -143px; }
217
+ .sucuriscan-flag-tg { background-position: -144px -143px; }
218
+ .sucuriscan-flag-th { background-position: -160px -143px; }
219
+ .sucuriscan-flag-tj { background-position: -176px -143px; }
220
+ .sucuriscan-flag-tk { background-position: -192px -143px; }
221
+ .sucuriscan-flag-tl { background-position: -208px -143px; }
222
+ .sucuriscan-flag-tm { background-position: -224px -143px; }
223
+ .sucuriscan-flag-tn { background-position: -240px -143px; }
224
+ .sucuriscan-flag-to { background-position: 0 -154px; }
225
+ .sucuriscan-flag-tr { background-position: -16px -154px; }
226
+ .sucuriscan-flag-tt { background-position: -32px -154px; }
227
+ .sucuriscan-flag-tv { background-position: -48px -154px; }
228
+ .sucuriscan-flag-tw { background-position: -64px -154px; }
229
+ .sucuriscan-flag-tz { background-position: -80px -154px; }
230
+ .sucuriscan-flag-ua { background-position: -96px -154px; }
231
+ .sucuriscan-flag-ug { background-position: -112px -154px; }
232
+ .sucuriscan-flag-um { background-position: -128px -154px; }
233
+ .sucuriscan-flag-us { background-position: -144px -154px; }
234
+ .sucuriscan-flag-uy { background-position: -160px -154px; }
235
+ .sucuriscan-flag-uz { background-position: -176px -154px; }
236
+ .sucuriscan-flag-va { background-position: -192px -154px; }
237
+ .sucuriscan-flag-vc { background-position: -208px -154px; }
238
+ .sucuriscan-flag-ve { background-position: -224px -154px; }
239
+ .sucuriscan-flag-vg { background-position: -240px -154px; }
240
+ .sucuriscan-flag-vi { background-position: 0 -165px; }
241
+ .sucuriscan-flag-vn { background-position: -16px -165px; }
242
+ .sucuriscan-flag-vu { background-position: -32px -165px; }
243
+ .sucuriscan-flag-wf { background-position: -64px -165px; }
244
+ .sucuriscan-flag-ws { background-position: -80px -165px; }
245
+ .sucuriscan-flag-ye { background-position: -96px -165px; }
246
+ .sucuriscan-flag-yt { background-position: -112px -165px; }
247
+ .sucuriscan-flag-za { background-position: -128px -165px; }
248
+ .sucuriscan-flag-zm { background-position: -160px -165px; }
249
+ .sucuriscan-flag-zw { background-position: -176px -165px; }
250
+ .sucuriscan-flag-catalonia { background-position: -64px -22px; }
251
+ .sucuriscan-flag-england { background-position: -240px -33px; }
252
+ .sucuriscan-flag-kurdistan { background-position: -160px -77px; }
253
+ .sucuriscan-flag-scotland { background-position: -48px -132px; }
254
+ .sucuriscan-flag-somaliland { background-position: -224px -132px; }
255
+ .sucuriscan-flag-wales { background-position: -48px -165px; }
256
+ .sucuriscan-flag-zanzibar { background-position: -144px -165px; }
inc/css/styles.css ADDED
@@ -0,0 +1,846 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body.toplevel_page_sucuriscan,
2
+ body.sucuri-security_page_sucuriscan_settings,
3
+ body.sucuri-security_page_sucuriscan_firewall,
4
+ body.sucuri-security_page_sucuriscan_hardening {
5
+ background: #f8f8f8;
6
+ }
7
+ .sucuriscan-container {
8
+ margin: 0;
9
+ margin-left: 9px;
10
+ margin-right: 28px;
11
+ margin-top: 10px;
12
+ }
13
+ .sucuriscan-container *,
14
+ .sucuriscan-container::after,
15
+ .sucuriscan-container::before {
16
+ -webkit-box-sizing: border-box;
17
+ -moz-box-sizing: border-box;
18
+ box-sizing: border-box;
19
+ }
20
+ .sucuriscan-clearfix::after,
21
+ .sucuriscan-clearfix::before {
22
+ content: ' ';
23
+ display: table;
24
+ }
25
+ .sucuriscan-clearfix::after {
26
+ clear: both;
27
+ }
28
+ .sucuriscan-pull-left {
29
+ float: left;
30
+ }
31
+ .sucuriscan-pull-right {
32
+ float: right;
33
+ }
34
+ .sucuriscan-hidden {
35
+ display: none !important;
36
+ }
37
+ .sucuriscan-monospace {
38
+ font-family: Menlo, Monaco, monospace, serif;
39
+ }
40
+ .sucuriscan-wraptext {
41
+ word-break: break-all;
42
+ }
43
+ .sucuriscan-container select {
44
+ margin: 0;
45
+ padding: 0;
46
+ height: 30px;
47
+ line-height: normal;
48
+ }
49
+ .sucuriscan-container input[type=text] {
50
+ margin: 0;
51
+ padding: 0 7px;
52
+ line-height: 28px;
53
+ }
54
+ .sucuriscan-container fieldset {
55
+ margin-bottom: 10px;
56
+ }
57
+ .sucuriscan-container fieldset:last-child {
58
+ margin-bottom: 0;
59
+ }
60
+ .sucuriscan-container fieldset label {
61
+ display: inline-block;
62
+ text-transform: uppercase;
63
+ line-height: 30px;
64
+ font-weight: 700;
65
+ }
66
+ .sucuriscan-container fieldset span {
67
+ line-height: 30px;
68
+ display: inline-block;
69
+ }
70
+ .sucuriscan-container fieldset span,
71
+ .sucuriscan-container fieldset label,
72
+ .sucuriscan-container fieldset select,
73
+ .sucuriscan-container fieldset button,
74
+ .sucuriscan-container fieldset input[type=text],
75
+ .sucuriscan-container fieldset input[type=checkbox],
76
+ .wp-core-ui .sucuriscan-container fieldset .button,
77
+ .wp-core-ui .sucuriscan-container fieldset .button-primary,
78
+ .wp-core-ui .sucuriscan-container fieldset .button-secondary {
79
+ margin: 0;
80
+ float: left;
81
+ margin-left: 5px;
82
+ }
83
+ .sucuriscan-container fieldset label {
84
+ margin-left: 0;
85
+ }
86
+ .sucuriscan-container fieldset input[type=checkbox] {
87
+ margin-top: 7px;
88
+ margin-bottom: 7px;
89
+ }
90
+ .sucuriscan-container .sucuriscan-full-textarea {
91
+ width: 100%;
92
+ min-height: 300px;
93
+ background: #efefef;
94
+ word-break: break-all;
95
+ padding: 20px;
96
+ margin: 0;
97
+ }
98
+ .sucuriscan-header {
99
+ margin-top: 4px;
100
+ }
101
+ .sucuriscan-header .sucuriscan-logo {
102
+ display: inline-block;
103
+ height: 33px;
104
+ margin-left: 10px;
105
+ margin-right: 8px;
106
+ text-decoration: none;
107
+ }
108
+ .sucuriscan-header .sucuriscan-subtitle {
109
+ color: #727376;
110
+ font-size: 30px;
111
+ font-weight: 200;
112
+ }
113
+ .sucuriscan-header .sucuriscan-version {
114
+ color: #727376;
115
+ font-size: 11px;
116
+ margin-left: 0;
117
+ }
118
+ .sucuriscan-header .sucuriscan-navbar ul {
119
+ margin: 0;
120
+ padding: 0;
121
+ list-style: none;
122
+ }
123
+ .sucuriscan-header .sucuriscan-navbar li {
124
+ float: left;
125
+ margin-bottom: 0;
126
+ margin-left: 5px;
127
+ }
128
+ .sucuriscan-container .button {
129
+ -moz-box-shadow: none;
130
+ -webkit-box-shadow: none;
131
+ background: none;
132
+ border-color: transparent;
133
+ height: auto;
134
+ line-height: normal;
135
+ border-radius: 40px;
136
+ box-shadow: none;
137
+ text-shadow: none;
138
+ padding: 6px 20px;
139
+ }
140
+ .sucuriscan-container .button-primary {
141
+ background: #559b43;
142
+ border-color: #559b43;
143
+ color: #fff;
144
+ }
145
+ .sucuriscan-container .button-secondary {
146
+ background: transparent;
147
+ border-color: #559b43;
148
+ color: #559b43;
149
+ }
150
+ .wp-core-ui .sucuriscan-container .button-primary:focus,
151
+ .wp-core-ui .sucuriscan-container .button-primary:hover,
152
+ .wp-core-ui .sucuriscan-container .button-primary:active,
153
+ .wp-core-ui .sucuriscan-container .button-primary:visited,
154
+ .wp-core-ui .sucuriscan-container .button-primary:disabled,
155
+ .wp-core-ui .sucuriscan-container .button-primary[disabled] {
156
+ color: #fff;
157
+ background: #4b8a3b;
158
+ border-color: #4b8a3b;
159
+ text-shadow: none !important;
160
+ box-shadow: none !important;
161
+ }
162
+ .wp-core-ui .sucuriscan-container .button-primary:disabled,
163
+ .wp-core-ui .sucuriscan-container .button-primary[disabled] {
164
+ color: #a0a5aa !important;
165
+ border-color: #ddd !important;
166
+ background: #f7f7f7 !important;
167
+ }
168
+ .sucuriscan-container .sucuriscan-register-site-button {
169
+ background: #65666a;
170
+ border-color: #65666a;
171
+ }
172
+ .wp-core-ui .sucuriscan-container .sucuriscan-register-site-button:focus,
173
+ .wp-core-ui .sucuriscan-container .sucuriscan-register-site-button:hover,
174
+ .wp-core-ui .sucuriscan-container .sucuriscan-register-site-button:active {
175
+ background: #5e5f62;
176
+ border-color: #5e5f62;
177
+ }
178
+ .sucuriscan-container .sucuriscan-register-site-modal fieldset label {
179
+ min-width: 160px;
180
+ }
181
+ .sucuriscan-content {
182
+ /* plugin content */
183
+ }
184
+ .sucuriscan-footer {
185
+ color: #555d66;
186
+ font-size: 11px;
187
+ text-align: center;
188
+ margin-top: 30px;
189
+ }
190
+ .sucuriscan-panel {
191
+ background: #fff;
192
+ border-radius: 10px;
193
+ box-shadow: 0 0 8px #dedede;
194
+ border: 1px solid #dedede;
195
+ margin-top: 30px;
196
+ padding: 30px;
197
+ }
198
+ .sucuriscan-panel .sucuriscan-title {
199
+ font-size: 30px;
200
+ font-weight: 800;
201
+ letter-spacing: 0.1px;
202
+ margin: 0;
203
+ margin-bottom: 24px;
204
+ }
205
+ .sucuriscan-panel p {
206
+ margin: 0;
207
+ margin-bottom: 10px;
208
+ }
209
+ .sucuriscan-panel p:last-child {
210
+ margin-bottom: 0;
211
+ }
212
+ .sucuriscan-panel hr {
213
+ margin: 20px 0;
214
+ }
215
+ .sucuriscan-tooltip {
216
+ position: relative;
217
+ }
218
+ .sucuriscan-tooltip-object {
219
+ width: 300px;
220
+ position: absolute;
221
+ background: rgba(0, 0, 0, 0.9);
222
+ line-height: normal;
223
+ border-radius: 3px;
224
+ padding: 20px;
225
+ font-size: 12px;
226
+ color: #fff;
227
+ }
228
+ .sucuriscan-tooltip-object::before {
229
+ left: 50%;
230
+ content: ' ';
231
+ position: absolute;
232
+ border: 10px solid transparent;
233
+ border-top-color: rgba(0, 0, 0, 0.9);
234
+ border-bottom: none;
235
+ margin-left: -10px;
236
+ bottom: -10px;
237
+ }
238
+ .sucuriscan-overlay {
239
+ background: #666;
240
+ background: rgba(0, 0, 0, 0.8);
241
+ bottom: 0;
242
+ left: 0;
243
+ position: fixed;
244
+ right: 0;
245
+ top: 0;
246
+ z-index: 9990;
247
+ }
248
+ .sucuriscan-modal {
249
+ left: 15%;
250
+ position: absolute;
251
+ top: 25px;
252
+ width: 65%;
253
+ z-index: 9990;
254
+ }
255
+ .sucuriscan-modal-outside {
256
+ background: #fff;
257
+ border-top: 10px solid #639940;
258
+ left: 0;
259
+ position: relative;
260
+ }
261
+ .sucuriscan-modal-header,
262
+ .sucuriscan-modal-inside {
263
+ padding: 30px;
264
+ }
265
+ .sucuriscan-modal-header {
266
+ padding-bottom: 0;
267
+ }
268
+ .sucuriscan-modal-inside {
269
+ padding-top: 10px;
270
+ }
271
+ .sucuriscan-modal-inside p {
272
+ margin-top: 0;
273
+ }
274
+ .sucuriscan-modal-header .sucuriscan-modal-title {
275
+ border-bottom: 0;
276
+ font-size: 30px;
277
+ line-height: 44px;
278
+ margin: 0;
279
+ padding: 0;
280
+ font-weight: 800;
281
+ letter-spacing: 0.1px;
282
+ }
283
+ .sucuriscan-modal-header .sucuriscan-modal-close {
284
+ background: #639940;
285
+ border-radius: 50%;
286
+ color: #fff;
287
+ display: inline-block;
288
+ font-size: 16px;
289
+ font-weight: 700;
290
+ line-height: 31px;
291
+ padding: 0 10px;
292
+ position: absolute;
293
+ right: -15px;
294
+ text-decoration: none;
295
+ top: -21px;
296
+ }
297
+ .sucuriscan-tabs {
298
+ margin-top: 30px;
299
+ }
300
+ .sucuriscan-tabs .sucuriscan-tabs-buttons {
301
+ margin: 0;
302
+ padding: 0;
303
+ border-bottom: 1px solid #ccc;
304
+ }
305
+ .sucuriscan-tabs .sucuriscan-tabs-buttons li {
306
+ float: left;
307
+ margin: 0;
308
+ }
309
+ .sucuriscan-tabs .sucuriscan-tabs-buttons li:first-child {
310
+ margin-left: 12px;
311
+ }
312
+ .sucuriscan-tabs .sucuriscan-tabs-buttons li:first-child a {
313
+ border-top-left-radius: 6px;
314
+ }
315
+ .sucuriscan-tabs .sucuriscan-tabs-buttons li:last-child a {
316
+ border-right: 1px solid #ccc;
317
+ border-top-right-radius: 6px;
318
+ }
319
+ .sucuriscan-tabs .sucuriscan-tabs-buttons a {
320
+ background: #f1f1f1;
321
+ border: 1px solid #dfdfdf;
322
+ border-bottom: 0;
323
+ border-right: 0;
324
+ padding: 0 18px;
325
+ line-height: 34px;
326
+ display: inline-block;
327
+ text-decoration: none;
328
+ color: #000;
329
+ }
330
+ .sucuriscan-tabs .sucuriscan-tabs-buttons .sucuriscan-tab-active {
331
+ background: #fff;
332
+ font-weight: 700;
333
+ border-top-left-radius: 6px;
334
+ border-top-right-radius: 6px;
335
+ padding-top: 4px;
336
+ margin-top: -4px;
337
+ }
338
+ .sucuriscan-tabs .sucuriscan-tabs-buttons a:hover {
339
+ background: #fff;
340
+ }
341
+ .sucuriscan-pagination {
342
+ border-radius: 4px;
343
+ display: inline-block;
344
+ margin: 0;
345
+ padding: 0;
346
+ }
347
+ .sucuriscan-pagination > li {
348
+ display: inline;
349
+ }
350
+ .sucuriscan-pagination > li > a,
351
+ .sucuriscan-pagination > li > span {
352
+ background: #fff;
353
+ border: 1px solid #ddd;
354
+ color: #428bca;
355
+ float: left;
356
+ line-height: 1.42857143;
357
+ margin-left: -1px;
358
+ padding: 6px 12px;
359
+ position: relative;
360
+ text-decoration: none;
361
+ }
362
+ .sucuriscan-pagination > li:first-child > a,
363
+ .sucuriscan-pagination > li:first-child > span {
364
+ border-radius: 4px 0 0 4px;
365
+ margin-left: 0;
366
+ }
367
+ .sucuriscan-pagination > li:last-child > a,
368
+ .sucuriscan-pagination > li:last-child > span {
369
+ border-radius: 0 4px 4px 0;
370
+ }
371
+ .sucuriscan-pagination > li > a.sucuriscan-pagination-active,
372
+ .sucuriscan-pagination > li > a:hover {
373
+ background: #0074a2;
374
+ color: #fff;
375
+ }
376
+ .wrap div.sucuriscan-alert {
377
+ margin: 0;
378
+ position: relative;
379
+ }
380
+ .wrap .sucuriscan-alert > .close {
381
+ color: #fff;
382
+ font-size: 18px;
383
+ font-weight: 700;
384
+ position: absolute;
385
+ text-decoration: none;
386
+ right: 20px;
387
+ top: 20px;
388
+ }
389
+ .wrap .sucuriscan-alert.info,
390
+ .wrap .sucuriscan-alert.error,
391
+ .wrap .sucuriscan-alert.success,
392
+ .wrap .sucuriscan-alert.updated,
393
+ .sucuriscan-inline-alert,
394
+ .sucuriscan-inline-alert-info,
395
+ .sucuriscan-inline-alert-error,
396
+ .sucuriscan-inline-alert-success {
397
+ background: #ddd;
398
+ border: 0;
399
+ box-shadow: none;
400
+ color: #fff;
401
+ padding: 0;
402
+ }
403
+ .wrap .sucuriscan-alert.info,
404
+ .sucuriscan-inline-alert-info {
405
+ background: #0684e1;
406
+ }
407
+ .wrap .sucuriscan-alert.error,
408
+ .sucuriscan-inline-alert-error {
409
+ background: #dd3d36;
410
+ }
411
+ .wrap .sucuriscan-alert.success,
412
+ .wrap .sucuriscan-alert.updated,
413
+ .sucuriscan-inline-alert-success {
414
+ background: #00a63f;
415
+ }
416
+ .wrap .sucuriscan-alert.info,
417
+ .wrap .sucuriscan-alert.error,
418
+ .wrap .sucuriscan-alert.success,
419
+ .wrap .sucuriscan-alert.updated,
420
+ .sucuriscan-inline-alert,
421
+ .sucuriscan-inline-alert-info,
422
+ .sucuriscan-inline-alert-error,
423
+ .sucuriscan-inline-alert-success,
424
+ .sucuriscan-inline-alert-updated {
425
+ margin-bottom: 20px;
426
+ }
427
+ .wrap .sucuriscan-alert.info:last-child,
428
+ .wrap .sucuriscan-alert.error:last-child,
429
+ .wrap .sucuriscan-alert.success:last-child,
430
+ .wrap .sucuriscan-alert.updated:last-child,
431
+ .sucuriscan-inline-alert:last-child,
432
+ .sucuriscan-inline-alert-info:last-child,
433
+ .sucuriscan-inline-alert-error:last-child,
434
+ .sucuriscan-inline-alert-success:last-child,
435
+ .sucuriscan-inline-alert-updated:last-child {
436
+ margin-bottom: 0;
437
+ }
438
+ .wrap .sucuriscan-alert.info a,
439
+ .wrap .sucuriscan-alert.error a,
440
+ .wrap .sucuriscan-alert.success a,
441
+ .wrap .sucuriscan-alert.updated a,
442
+ .sucuriscan-inline-alert a,
443
+ .sucuriscan-inline-alert-info a,
444
+ .sucuriscan-inline-alert-error a,
445
+ .sucuriscan-inline-alert-success a,
446
+ .sucuriscan-inline-alert-updated a {
447
+ color: #fff;
448
+ text-decoration: none;
449
+ }
450
+ .wrap .sucuriscan-alert.info p,
451
+ .wrap .sucuriscan-alert.error p,
452
+ .wrap .sucuriscan-alert.success p,
453
+ .wrap .sucuriscan-alert.updated p,
454
+ .sucuriscan-inline-alert p,
455
+ .sucuriscan-inline-alert-info p,
456
+ .sucuriscan-inline-alert-error p,
457
+ .sucuriscan-inline-alert-success p {
458
+ margin: 0;
459
+ color: #fff;
460
+ padding: 20px;
461
+ padding-bottom: 0;
462
+ }
463
+ .wrap .sucuriscan-alert.info p a,
464
+ .wrap .sucuriscan-alert.error p a,
465
+ .wrap .sucuriscan-alert.success p a,
466
+ .wrap .sucuriscan-alert.updated p a,
467
+ .sucuriscan-inline-alert p a,
468
+ .sucuriscan-inline-alert-info p a,
469
+ .sucuriscan-inline-alert-error p a,
470
+ .sucuriscan-inline-alert-success p a {
471
+ text-decoration: underline;
472
+ }
473
+ .wrap .sucuriscan-alert.info p:last-child,
474
+ .wrap .sucuriscan-alert.error p:last-child,
475
+ .wrap .sucuriscan-alert.success p:last-child,
476
+ .wrap .sucuriscan-alert.updated p:last-child,
477
+ .sucuriscan-inline-alert p:last-child,
478
+ .sucuriscan-inline-alert-info p:last-child,
479
+ .sucuriscan-inline-alert-error p:last-child,
480
+ .sucuriscan-inline-alert-success p:last-child {
481
+ padding-bottom: 20px;
482
+ }
483
+ .sucuriscan-hstatus {
484
+ margin: 0;
485
+ padding: 20px;
486
+ position: relative;
487
+ border: 1px solid transparent;
488
+ margin-bottom: 20px;
489
+ }
490
+ .sucuriscan-hstatus:last-child {
491
+ margin-bottom: 0;
492
+ }
493
+ .sucuriscan-hstatus-0 {
494
+ background-color: #f2dede;
495
+ border-color: #ebccd1;
496
+ color: #a94442;
497
+ }
498
+ .sucuriscan-hstatus-0 .button-primary {
499
+ background: #9b2b27;
500
+ border-color: #9b2b27;
501
+ }
502
+ .wp-core-ui .sucuriscan-hstatus-0 .button-primary:focus,
503
+ .wp-core-ui .sucuriscan-hstatus-0 .button-primary:hover,
504
+ .wp-core-ui .sucuriscan-hstatus-0 .button-primary:active,
505
+ .wp-core-ui .sucuriscan-hstatus-0 .button-primary:disabled,
506
+ .wp-core-ui .sucuriscan-hstatus-0 .button-primary[disabled] {
507
+ background: #872522;
508
+ border-color: #872522;
509
+ }
510
+ .sucuriscan-hstatus-1 {
511
+ background-color: #dff0d8;
512
+ border-color: #d6e9c6;
513
+ color: #3c763d;
514
+ }
515
+ .sucuriscan-hstatus-2 {
516
+ background-color: #dee4f2;
517
+ border-color: #ccd0eb;
518
+ color: #4263a9;
519
+ }
520
+ .sucuriscan-hstatus-2 .button-primary {
521
+ background: #44709b;
522
+ border-color: #44709b;
523
+ }
524
+ .wp-core-ui .sucuriscan-hstatus-2 .button-primary:focus,
525
+ .wp-core-ui .sucuriscan-hstatus-2 .button-primary:hover,
526
+ .wp-core-ui .sucuriscan-hstatus-2 .button-primary:active,
527
+ .wp-core-ui .sucuriscan-hstatus-2 .button-primary:disabled,
528
+ .wp-core-ui .sucuriscan-hstatus-2 .button-primary[disabled] {
529
+ background: #3f6890;
530
+ border-color: #3f6890;
531
+ }
532
+ .sucuriscan-hstatus form {
533
+ position: absolute;
534
+ right: 20px;
535
+ top: 14px;
536
+ }
537
+ .sucuriscan-flag-bar {
538
+ fill: #fff !important;
539
+ }
540
+ .sucuriscan-flag-icon-green path,
541
+ .sucuriscan-auditlog-success path,
542
+ .sucuriscan-integrity-added path {
543
+ fill: #00a63f;
544
+ }
545
+ .sucuriscan-flag-icon-red path,
546
+ .sucuriscan-auditlog-error path,
547
+ .sucuriscan-integrity-removed path {
548
+ fill: #f23924;
549
+ }
550
+ .sucuriscan-flag-icon-purple path,
551
+ .sucuriscan-auditlog-debug path,
552
+ .sucuriscan-integrity-modified path {
553
+ fill: #b406dc;
554
+ }
555
+ .sucuriscan-flag-icon-orange path,
556
+ .sucuriscan-auditlog-warning path {
557
+ fill: #f2812e;
558
+ }
559
+ .sucuriscan-flag-icon-blue path,
560
+ .sucuriscan-auditlog-notice path {
561
+ fill: #4664c5;
562
+ }
563
+ .sucuriscan-flag-icon-white path,
564
+ .sucuriscan-auditlog-info path {
565
+ fill: #f3f3f3;
566
+ }
567
+ .sucuriscan-flag-icon-black path,
568
+ .sucuriscan-auditlog-critical path {
569
+ fill: #000;
570
+ }
571
+ .sucuriscan-container .sucuriscan-table {
572
+ margin-bottom: 20px;
573
+ }
574
+ .sucuriscan-container .sucuriscan-table:last-child {
575
+ margin-bottom: 0;
576
+ }
577
+ .sucuriscan-container .sucuriscan-table tbody tr:nth-child(odd) {
578
+ background: #f5f5f5;
579
+ }
580
+ .sucuriscan-dashboard-left {
581
+ width: 68%;
582
+ padding-right: 25px;
583
+ }
584
+ .sucuriscan-dashboard-right {
585
+ width: 32%;
586
+ }
587
+ .sucuriscan-dashboard-left .sucuriscan-tabs {
588
+ margin-top: 0;
589
+ }
590
+ .sucuriscan-dashboard-left .sucuriscan-tabs-containers {
591
+ margin-top: 30px;
592
+ }
593
+ .sucuriscan-integrity .sucuriscan-integrity-left,
594
+ .sucuriscan-integrity .sucuriscan-integrity-right {
595
+ width: 50%;
596
+ }
597
+ .sucuriscan-integrity .sucuriscan-integrity-right {
598
+ padding-left: 110px;
599
+ }
600
+ .sucuriscan-integrity .sucuriscan-subtitle {
601
+ margin: 0;
602
+ border-bottom: 1px solid #ddd;
603
+ font-weight: 800;
604
+ margin-bottom: 12px;
605
+ padding-bottom: 11px;
606
+ }
607
+ .sucuriscan-integrity hr {
608
+ margin: 20px 0;
609
+ }
610
+ .sucuriscan-integrity-correct .sucuriscan-integrity-right {
611
+ background: url('../images/checkmark.png') no-repeat 25px 30px;
612
+ }
613
+ .sucuriscan-integrity-incorrect .sucuriscan-integrity-right {
614
+ background: url('../images/checkcross.png') no-repeat 25px 30px;
615
+ }
616
+ .sucuriscan-integrity-loading .sucuriscan-integrity-missing {
617
+ height: 147px;
618
+ background: #f8f8f8;
619
+ border: 3px dotted #ddd;
620
+ border-radius: 14px;
621
+ }
622
+ .sucuriscan-integrity-correct .sucuriscan-subtitle {
623
+ color: #559b43;
624
+ }
625
+ .sucuriscan-integrity-incorrect .sucuriscan-subtitle {
626
+ color: #f33924;
627
+ }
628
+ .sucuriscan-integrity-incorrect .sucuriscan-table .sucuriscan-tooltip {
629
+ left: 5px;
630
+ position: relative;
631
+ top: 3px;
632
+ }
633
+ .sucuriscan-container .sucuriscan-integrity-diff-utility {
634
+ margin-bottom: 20px;
635
+ }
636
+ .sucuriscan-diff-utility-modal .sucuriscan-modal-inside p {
637
+ margin-bottom: 20px;
638
+ }
639
+ .sucuriscan-container .sucuriscan-diff-content {
640
+ background: #003140;
641
+ font-family: Menlo, Monaco, monospace, serif;
642
+ border: 1px solid #32636c;
643
+ border-radius: 4px;
644
+ font-size: 12px;
645
+ padding: 20px 0;
646
+ margin: 0;
647
+ }
648
+ .sucuriscan-container .sucuriscan-diff-line {
649
+ color: #fff;
650
+ white-space: pre-wrap;
651
+ padding: 0 20px;
652
+ margin: 0;
653
+ }
654
+ .sucuriscan-container .sucuriscan-diff-header {
655
+ color: #999;
656
+ }
657
+ .sucuriscan-container .sucuriscan-diff-minus {
658
+ color: #ff304b;
659
+ }
660
+ .sucuriscan-container .sucuriscan-diff-plus {
661
+ color: #83e600;
662
+ }
663
+ .sucuriscan-sitecheck-details {
664
+ margin-top: 20px;
665
+ margin-bottom: 20px;
666
+ padding-top: 20px;
667
+ padding-bottom: 0;
668
+ position: relative;
669
+ border-top: 1px solid #dedede;
670
+ border-bottom: 1px solid #dedede;
671
+ }
672
+ .sucuriscan-sitecheck-details ul {
673
+ margin: 0;
674
+ }
675
+ .sucuriscan-sitecheck-details li {
676
+ display: inline-block;
677
+ margin-bottom: 20px;
678
+ margin-right: 20px;
679
+ }
680
+ .sucuriscan-sitecheck-details .sucuriscan-details-title {
681
+ display: block;
682
+ font-weight: bold;
683
+ }
684
+ .sucuriscan-sitecheck-details .sucuriscan-details-value {
685
+ display: block;
686
+ overflow: hidden;
687
+ text-overflow: ellipsis;
688
+ white-space: nowrap;
689
+ }
690
+ .sucuriscan-sitecheck-details .sucuriscan-pull-left {
691
+ width: 80%;
692
+ }
693
+ .sucuriscan-sitecheck-details .sucuriscan-pull-right {
694
+ width: 20%;
695
+ }
696
+ .sucuriscan-sitecheck-list ul {
697
+ margin-top: 20px;
698
+ margin-bottom: 0;
699
+ }
700
+ .sucuriscan-sitecheck-list li {
701
+ margin-top: 10px;
702
+ padding-left: 30px;
703
+ margin-bottom: 0;
704
+ }
705
+ .sucuriscan-sitecheck-list a {
706
+ font-size: 14px;
707
+ text-decoration: none;
708
+ }
709
+ .sucuriscan-sitecheck-list-INFO {
710
+ background: url('../images/checkinfo.png') no-repeat;
711
+ }
712
+ .sucuriscan-sitecheck-list-WARN {
713
+ background: url('../images/checkwarn.png') no-repeat;
714
+ }
715
+ .sucuriscan-sitecheck-list-NOTICE {
716
+ background: url('../images/checknotice.png') no-repeat;
717
+ }
718
+ .sucuriscan-sitecheck-list-INFO a,
719
+ .sucuriscan-sitecheck-list-NOTICE a {
720
+ color: #000;
721
+ }
722
+ .sucuriscan-sitecheck-list-WARN a {
723
+ color: #f23924;
724
+ font-weight: bold;
725
+ }
726
+ .sucuriscan-sitecheck-footnote {
727
+ color: #989898;
728
+ padding-top: 20px;
729
+ border-top: 1px solid #ddd;
730
+ margin-top: 20px;
731
+ }
732
+ .sucuriscan-sitecheck-footnote a,
733
+ .sucuriscan-sitecheck-footnote p {
734
+ font-size: 11px;
735
+ margin: 0;
736
+ }
737
+ .sucuriscan-tag-title {
738
+ color: #fff;
739
+ display: table;
740
+ font-size: 17px;
741
+ font-weight: 900;
742
+ margin: 0;
743
+ padding: 8px 14px;
744
+ position: relative;
745
+ border-radius: 4px;
746
+ }
747
+ .sucuriscan-tag-green {
748
+ background-color: #00a63f;
749
+ }
750
+ .sucuriscan-tag-red {
751
+ background-color: #f23924;
752
+ }
753
+ .sucuriscan-tag-blue {
754
+ background-color: #3922f2;
755
+ }
756
+ .sucuriscan-auditlog-response {
757
+ margin-bottom: 30px;
758
+ }
759
+ .sucuriscan-auditlog-date {
760
+ color: #808080;
761
+ padding: 30px 0;
762
+ font-size: 24px;
763
+ font-weight: 200;
764
+ border-bottom: 1px solid #dbdbdb;
765
+ }
766
+ .sucuriscan-auditlog-date:first-child {
767
+ padding-top: 0;
768
+ }
769
+ .sucuriscan-auditlog-entry {
770
+ padding: 10px 0;
771
+ border-bottom: 1px solid #dbdbdb;
772
+ }
773
+ .sucuriscan-auditlog-entry-title,
774
+ .sucuriscan-auditlog-entry-address,
775
+ .sucuriscan-auditlog-entry-extra li {
776
+ overflow: hidden;
777
+ white-space: nowrap;
778
+ text-overflow: ellipsis;
779
+ }
780
+ .sucuriscan-auditlog-entry-time {
781
+ width: 6.5111%;
782
+ color: #808080;
783
+ margin-right: 20px;
784
+ }
785
+ .sucuriscan-auditlog-entry-event {
786
+ width: 3.2811%;
787
+ margin-right: 20px;
788
+ }
789
+ .sucuriscan-auditlog-entry-message {
790
+ width: 64.3111%;
791
+ color: #000;
792
+ }
793
+ .sucuriscan-auditlog-entry-title strong {
794
+ font-size: 14px;
795
+ font-weight: 800;
796
+ }
797
+ .sucuriscan-auditlog-entry-title span {
798
+ font-size: 14px;
799
+ }
800
+ .sucuriscan-auditlog-entry-extra {
801
+ color: #717171;
802
+ font-size: 11px;
803
+ }
804
+ .sucuriscan-auditlog-entry-extra ul {
805
+ margin-top: 5px;
806
+ }
807
+ .sucuriscan-auditlog-entry-extra li {
808
+ margin-bottom: 0;
809
+ }
810
+ .sucuriscan-auditlog-entry-address {
811
+ width: 19.4311%;
812
+ color: #808080;
813
+ text-align: right;
814
+ }
815
+ .sucuriscan-auditlog-table .sucuriscan-pagination-loading {
816
+ line-height: 32px;
817
+ margin-left: 10px;
818
+ }
819
+ .sucuriscan-hardening-option {
820
+ margin-bottom: 0;
821
+ }
822
+ .sucuriscan-hardening-option .button {
823
+ min-width: 150px;
824
+ }
825
+ .sucuriscan-hardening-option > span {
826
+ font-size: 16px;
827
+ }
828
+ .sucuriscan-hardening-option .sucuriscan-hardening-help {
829
+ display: inline-block;
830
+ padding: 8px 0;
831
+ width: 14px;
832
+ }
833
+ .sucuriscan-hardening-option .sucuriscan-hardening-help svg {
834
+ float: left;
835
+ }
836
+ .sucuriscan-accesslog-datetime,
837
+ .sucuriscan-accesslog-signature,
838
+ .sucuriscan-accesslog-request,
839
+ .sucuriscan-accesslog-useragent,
840
+ .sucuriscan-accesslog-target,
841
+ .sucuriscan-accesslog-referer {
842
+ margin-left: 24px;
843
+ }
844
+ .sucuriscan-accesslog-label {
845
+ font-weight: 700;
846
+ }
inc/css/sucuri-scanner.min.css DELETED
@@ -1 +0,0 @@
1
- .sucuriscan-malware-payload,.sucuriscan-request-summary td+td,.sucuriscan-wraptext{word-break:break-all}.sucuriscan-wrap *,.sucuriscan-wrap:after,.sucuriscan-wrap:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sucuriscan-clearfix:after,.sucuriscan-clearfix:before{display:table;content:' '}.sucuriscan-clearfix:after{clear:both}.sucuriscan-hidden{display:none!important}.sucuriscan-opacity{opacity:.6}.sucuriscan-monospace{font-family:Menlo,Monaco,monospace,courier}.sucuriscan-ellipsis{overflow:hidden;display:inline-block;white-space:nowrap;text-overflow:ellipsis}.sucuriscan-pull-left{float:left}.sucuriscan-pull-right{float:right}.sucuriscan-list li{list-style:disc;margin:0 0 5px 15px}.sucuriscan-gradient,.sucuriscan-leftside #poststuff h3,.sucuriscan-leftside .sucuriscan-panelstuff h3,.sucuriscan-maincontent .sucuriscan-table tr>th,.sucuriscan-modal-header{background-color:#f1f1f1;background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec);filter:"progid: DXImageTransform.Microsoft.Gradient(startColorstr=#f9f9f9, endColorstr=#ececec)";-ms-filter:"progid: DXImageTransform.Microsoft.Gradient(startColorstr=#f9f9f9, endColorstr=#ececec)"}.wp-core-ui .button-success,.wp-core-ui .button-success.focus,.wp-core-ui .button-success.hover,.wp-core-ui .button-success:focus,.wp-core-ui .button-success:hover,.wp-core-ui .button.button-success.button-hero{-webkit-box-shadow:0 1px 0 #109900;-moz-box-shadow:0 1px 0 #109900;box-shadow:0 1px 0 #109900}.wp-core-ui .button-success,.wp-core-ui .button-success.focus,.wp-core-ui .button-success.hover,.wp-core-ui .button-success:focus,.wp-core-ui .button-success:hover{background:#8dcd5a;border-color:#48a325;box-shadow:0 1px 0 #109900;text-shadow:0 -1px 1px #109900,1px 0 1px #109900,0 1px 1px #109900,-1px 0 1px #109900}.wp-core-ui .button-success.focus,.wp-core-ui .button-success.hover,.wp-core-ui .button-success:focus,.wp-core-ui .button-success:hover{background:#69be48}.wp-core-ui .button-success.focus,.wp-core-ui .button-success:focus{border-color:#23500e}.wp-core-ui .button-success.active,.wp-core-ui .button-success.active:focus,.wp-core-ui .button-success.active:hover,.wp-core-ui .button-success:active{background:#47a61b;border-color:#358400}.wp-core-ui .button-success-disabled,.wp-core-ui .button-success.disabled,.wp-core-ui .button-success:disabled,.wp-core-ui .button-success[disabled]{color:#b2e794!important;background:#74ba29!important;border-color:#3f7f1b!important}.wp-core-ui .button-danger,.wp-core-ui .button-danger.focus,.wp-core-ui .button-danger.hover,.wp-core-ui .button-danger:focus,.wp-core-ui .button-danger:hover,.wp-core-ui .button.button-danger.button-hero{-webkit-box-shadow:0 1px 0 #99000e;-moz-box-shadow:0 1px 0 #99000e;box-shadow:0 1px 0 #99000e}.wp-core-ui .button-danger,.wp-core-ui .button-danger.focus,.wp-core-ui .button-danger.hover,.wp-core-ui .button-danger:focus,.wp-core-ui .button-danger:hover{background:#cd5050;border-color:#a52121;text-shadow:0 -1px 1px #99000e,1px 0 1px #99000e,0 1px 1px #99000e,-1px 0 1px #99000e}.wp-core-ui .button-danger.focus,.wp-core-ui .button-danger.hover,.wp-core-ui .button-danger:focus,.wp-core-ui .button-danger:hover{background:#be4242}.wp-core-ui .button-danger.focus,.wp-core-ui .button-danger:focus{border-color:#500e0e}.wp-core-ui .button-danger.active,.wp-core-ui .button-danger.active:focus,.wp-core-ui .button-danger.active:hover,.wp-core-ui .button-danger:active{background:#a61b1b;border-color:#840000}.wp-core-ui .button-danger-disabled,.wp-core-ui .button-danger.disabled,.wp-core-ui .button-danger:disabled,.wp-core-ui .button-danger[disabled]{color:#e79494!important;background:#ba2929!important;border-color:#7f1b1b!important}.wp-core-ui .sucuriscan-btnblock{display:block;width:100%;text-align:center}.sucuriscan-overlay{position:fixed;top:0;left:0;bottom:0;right:0;z-index:9990;background:#666;background:rgba(0,0,0,.5)}.sucuriscan-modal{position:absolute;top:25px;left:15%;z-index:9990;width:65%}.sucuriscan-modal-outside{position:relative;left:0;border:1px solid #ddd}.sucuriscan-modal-inside{background:#fff;padding:20px}.sucuriscan-modal-header{padding:0;border-bottom:1px solid #ddd}#poststuff h3.sucuriscan-modal-title,.sucuriscan-leftside #poststuff h3.sucuriscan-modal-title,.sucuriscan-modal-header .sucuriscan-modal-title{margin:0 0 0 10px;padding:0;float:left;line-height:38px;border-bottom:0}.sucuriscan-modal-header .sucuriscan-modal-logo{display:inline-block;float:left;margin-top:8px;margin-left:18px}.sucuriscan-modal-header .sucuriscan-modal-logo img{height:22px}.sucuriscan-modal-close{display:inline-block;position:absolute;top:0;right:0;font-size:16px;font-weight:700;text-decoration:none;line-height:38px;padding:0 15px;border-left:1px solid #ddd}.sucuriscan-modal-inside p:first-child{margin-top:0}.sucuriscan-panelstuff .inside{margin:6px 0 0}.postbox .inside p:last-child,.sucuriscan-modal-inside p:last-child{margin-bottom:0}.sucuriscan-label,.sucuriscan-label-danger,.sucuriscan-label-default,.sucuriscan-label-error,.sucuriscan-label-info,.sucuriscan-label-notice,.sucuriscan-label-primary,.sucuriscan-label-success,.sucuriscan-label-unknown,.sucuriscan-label-warning{display:inline;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;padding:.2em .6em .3em;border-radius:.25em}.sucuriscan-label-default,.sucuriscan-label-unknown{background:#777}.sucuriscan-label-danger,.sucuriscan-label-error{background:#d9534f}.sucuriscan-label-info,.sucuriscan-label-notice{background:#5bc0de}.sucuriscan-label-warning{background:#f0ad4e}.sucuriscan-label-success{background:#5cb85c}.sucuriscan-label-primary{background:#428bca}.sucuriscan-wrap{margin-top:20px}.sucuriscan-wrap .sucuriscan-maincontent{margin:20px 0}.sucuriscan-wrap .sucuriscan-leftside{width:73.5%;float:left}.sucuriscan-wrap .sucuriscan-onecolumn{width:100%}.sucuriscan-wrap .sucuriscan-sidebar{width:25%;float:right}.sucuriscan-wrap #warnings_hook{line-height:normal;padding:0}.sucuriscan-wrap .sucuriscan-navbar{padding-top:20px;padding-left:6px}.sucuriscan-wrap .sucuriscan-navbar .nav-tab{margin-right:0}.sucuriscan-footer,.sucuriscan-header{position:relative;min-width:255px;background:#333;margin:0;padding:10px;border-radius:4px}.sucuriscan-footer .sucuriscan-help{color:#fff;float:right;text-align:right}.sucuriscan-footer .sucuriscan-help p{line-height:38px;margin:0 10px 0 0;padding:0}.sucuriscan-wrap .sucuriscan-footer h2,.sucuriscan-wrap .sucuriscan-header h2,.sucuriscan-wrap .sucuriscan-logo{float:left;margin:0;padding:0}.sucuriscan-wrap .sucuriscan-logo{display:inline-block}.sucuriscan-wrap .sucuriscan-logo img{display:block}.sucuriscan-wrap .sucuriscan-footer h2,.sucuriscan-wrap .sucuriscan-header h2{color:#fff;line-height:38px;margin-left:10px;text-shadow:#000 0 1px 0}.sucuriscan-leftside #poststuff .postbox:last-child,.sucuriscan-leftside .sucuriscan-panelstuff .postbox:last-child{margin-bottom:0}.sucuriscan-leftside #poststuff .postbox h3,.sucuriscan-leftside .sucuriscan-panelstuff .postbox h3{margin:0;padding:10px;border-bottom:1px solid #ddd}.sucuriscan-maincontent abbr{text-decoration:underline;cursor:help}.wrap div.sucuriscan-setup-notice{background:#bbe8f5;margin:0 0 20px;padding:0;border:1px solid #bbb;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.wrap div.sucuriscan-setup-notice .sucuriscan-setup-image,.wrap div.sucuriscan-setup-notice .sucuriscan-setup-image img{border-radius:3px 0 0 3px}.wrap div.sucuriscan-setup-notice .sucuriscan-setup-image{background:#333;margin:-1px 0 -1px -1px;padding:7px 10px;border-right:1px solid transparent}.wrap div.sucuriscan-setup-notice .sucuriscan-setup-form{padding:4px 4px 4px 0}.wrap div.sucuriscan-setup-notice p{font-size:14px;line-height:20px;margin:0 0 0 10px;padding:7px 0}.wrap div.sucuriscan-setup-notice,.wrap div.sucuriscan-setup-notice .sucuriscan-setup-image{border-color:#4393ac}.wp-core-ui .button.sucuriscan-review-hero,.wp-core-ui .sucuriscan-review-hero{height:initial;line-height:36px;float:right;padding:0 20px}.sucuriscan-input-group>label{display:inline-block;border:1px solid #ddd;border-right:0;line-height:26px;float:left;padding:0 10px;background:#eee}.sucuriscan-input-group>input[type=text]{margin:0;padding-bottom:4px}.sucuriscan-input-group>select{vertical-align:initial;margin:0}.sucuriscan-table-setup td{vertical-align:top}.sucuriscan-table-setup .sucuriscan-description{font-size:12px;margin-top:10px}.sucuriscan-dismiss-setup{font-size:10px;line-height:28px}.sucuriscan-maincontent .sucuriscan-table{margin-top:12px}.sucuriscan-maincontent .sucuriscan-table tr>th{border-top:1px solid #e5e5e5;border-bottom:1px solid #e5e5e5}.sucuriscan-maincontent .sucuriscan-table tr:first-child th{border-top:0}.sucuriscan-maincontent .sucuriscan-table td.check-column{padding:8px 10px}.sucuriscan-maincontent .sucuriscan-striped-table tr:nth-child(even){background:#f5f5f5}.sucuriscan-table-double-title tr:first-child th,.sucuriscan-table-quad-title tr:first-child th,.sucuriscan-table-quad-title tr:first-child+tr th,.sucuriscan-table-quad-title tr:first-child+tr+tr th,.sucuriscan-table-triple-title tr:first-child th,.sucuriscan-table-triple-title tr:first-child+tr th{border-bottom:0}.sucuriscan-table-description{border-left-width:1px!important;box-shadow:none}.sucuriscan-table-description .inside{border-bottom:0!important}.widefat td.td-with-button{text-align:right;padding:3px 10px}.widefat td.td-with-button button{min-width:90px}.widefat td.td-with-button select{height:initial;line-height:initial;vertical-align:top;margin:0;padding:2px 0 3px}.widefat th.check-column{line-height:36px;padding:0}.widefat th.check-column input[type=checkbox]{margin:1px 0 0 10px}.sucuriscan-list-as-table{background:#fff;border:1px solid #e5e5e5}.sucuriscan-list-as-table li{line-height:30px;word-break:break-all;margin:0;padding:0 10px}.sucuriscan-list-as-table li:nth-child(odd){background:#f5f5f5}.sucuriscan-list-as-table-scrollable{height:300px;overflow:hidden;overflow-y:scroll}.sucuriscan-maincontent .thead-with-button{padding:5px 5px 5px 10px}.sucuriscan-maincontent .thead-with-button>span{display:inline-block;line-height:28px}.sucuriscan-maincontent .thead-with-button .input-text{line-height:26px}.sucuriscan-maincontent .thead-with-button select{margin:0;padding:0}.sucuriscan-maincontent .thead-topright-action{display:inline-block;float:right}.sucuriscan-ad{color:#fff;padding:20px;margin-bottom:20px}.sucuriscan-ad .sucuriscan-ad-btn,.sucuriscan-ad h3,.sucuriscan-ad h4{font-family:Arial,Helvetica,sans-serif;color:#fff;margin:0}.sucuriscan-ad h3{font-size:18px;font-weight:300}.sucuriscan-ad h4{font-size:22px;font-weight:700;margin-top:10px}.sucuriscan-ad .sucuriscan-ad-btn{display:block;font-size:13px;font-weight:700;text-align:center;text-decoration:none;text-transform:uppercase;margin-top:20px;padding:5px;border-radius:20px}.sucuriscan-ad .sucuriscan-ad-footer{margin-top:20px;margin-bottom:0}.sucuriscan-ad .sucuriscan-ad-footer ul{margin:0}.sucuriscan-ad .sucuriscan-ad-footer li{font-size:12px;color:#fff;list-style:disc;margin:0 0 0 16px}.sucuriscan-ad .sucuriscan-ad-footer li.featured{color:#fde44c}.sucuriscan-scanner-video{width:100%;background:#fff;border:1px solid #ddd}.sucuriscan-sidebar .sucuriscan-supportbtn{width:100%;height:initial;text-align:center;line-height:36px;margin-top:15px;padding:0}.sucuriscan-hide-ads{min-height:initial!important;margin-top:15px}.sucuriscan-hide-ads .button-link{text-decoration:underline}.sucuriscan-hide-ads-instructions{border:1px solid #ddd;background:#fff;margin-top:15px;padding:10px}.sucuriscan-hide-ads .button-link,.sucuriscan-hide-ads-instructions,.sucuriscan-hide-ads-instructions code{font-size:11px}.sucuriscan-hide-ads-instructions code{display:block;margin-top:5px}.sucuriscan-ad-firewall{background:#606e77}.sucuriscan-ad-firewall .sucuriscan-ad-btn{background:#606e77;border:1px solid #fff}.sucuriscan-ad-firewall .sucuriscan-ad-btn:hover{background:#85929b}.sucuriscan-ad-antivirus{background:#04833e;padding-bottom:0}.sucuriscan-ad-antivirus .sucuriscan-ad-website{display:block;text-decoration:none;margin-top:20px}.sucuriscan-ad-antivirus .sucuriscan-ad-website img{display:block;max-width:100%}.sucuriscan-ad-antivirus .sucuriscan-ad-btn{background-color:#e8840a;background-image:-webkit-gradient(linear,left top,left bottom,from(#e8840a),to(#ef7f02));background-image:-webkit-linear-gradient(top,#e8840a,#ef7f02);background-image:-moz-linear-gradient(top,#e8840a,#ef7f02);background-image:-ms-linear-gradient(top,#e8840a,#ef7f02);background-image:-o-linear-gradient(top,#e8840a,#ef7f02);background-image:linear-gradient(top,#e8840a,#ef7f02);filter:"progid: DXImageTransform.Microsoft.Gradient(startColorstr=#e8840a, endColorstr=#ef7f02)";-ms-filter:"progid: DXImageTransform.Microsoft.Gradient(startColorstr=#e8840a, endColorstr=#ef7f02)";box-shadow:inset 0 1px 1px #eaac3a;border:1px solid #d17301}div.sucuriscan-alert{position:relative;margin:0 0 20px}div.sucuriscan-alert>a.close{position:absolute;top:10px;right:10px;font-size:18px;font-weight:700;text-decoration:none}.sucuriscan-inline-alert,.sucuriscan-inline-alert-error,.sucuriscan-inline-alert-info,.sucuriscan-inline-alert-updated,.sucuriscan-inline-alert-warning{background:#fff;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:0;border-left:4px solid #ddd}.sucuriscan-inline-alert-error>p,.sucuriscan-inline-alert-info>p,.sucuriscan-inline-alert-updated>p,.sucuriscan-inline-alert-warning>p,.sucuriscan-inline-alert>p{margin:0;padding:8px 12px;border:1px solid #ddd;border-left:0}.sucuriscan-inline-alert,.sucuriscan-inline-alert-error,.sucuriscan-inline-alert-info,.sucuriscan-inline-alert-updated,.sucuriscan-inline-alert-warning{margin-bottom:10px}.postbox .inside .sucuriscan-inline-alert-error:last-child,.postbox .inside .sucuriscan-inline-alert-info:last-child,.postbox .inside .sucuriscan-inline-alert-updated:last-child,.postbox .inside .sucuriscan-inline-alert-warning:last-child,.postbox .inside .sucuriscan-inline-alert:last-child,.sucuriscan-tabs>ul li{margin-bottom:0}.sucuriscan-inline-alert-updated{border-left-color:#7ad03a}.sucuriscan-inline-alert-warning{border-left-color:#ffba00}.sucuriscan-inline-alert-error{border-left-color:#dd3d36}.sucuriscan-inline-alert-info{border-left-color:#2ea2cc}.sucuriscan-tabs>ul{margin:0}.sucuriscan-tabs>ul li,.sucuriscan-tabs>ul li>a{display:inline-block}.sucuriscan-tabs>ul li>a{background:#e5e5e5;font-size:13px;font-weight:700;color:#333;line-height:38px;text-decoration:none;padding:0 10px}.sucuriscan-tabs>ul li>a.sucuriscan-tab-active{background:#fff;border:1px solid #e1e1e1;border-bottom:0}.sucuriscan-tabs>ul li.sucuriscan-red-tab a{background:#ff8a83;color:#fff}.sucuriscan-tabs>ul li.sucuriscan-red-tab a.sucuriscan-tab-active{background:#dd3d36;border-color:#dd3d36}.sucuriscan-maincontent .sucuriscan-tab-containers>div>#poststuff,.sucuriscan-maincontent .sucuriscan-tab-containers>div>table,.sucuriscan-panelstuff{margin-top:0}.sucuriscan-getapi-div{background:#fff;margin:0 0 20px;border:1px solid #e5e5e5;border-radius:3px}.sucuriscan-getapi-div p{margin:0;padding:10px}.sucuriscan-getapi-form button.button-primary{width:100%;height:initial;line-height:30px;margin:0 0 -1px;padding:0;border-radius:0 0 3px 3px}.sucuriscan-malwarescan-message{margin-bottom:20px!important}.sucuriscan-loading{background:#fff;text-align:center;padding:30px 30px 15px;border:1px solid #ddd;border-radius:4px}.sucuriscan-loading h3,.sucuriscan-loading p{margin:0;padding:0}.sucuriscan-loading .title{font-size:28px;margin-bottom:10px}.sucuriscan-loading .description{font-size:16px}.sucuriscan-sitelogo{width:190px;height:100px;background:url(https://sitecheck.sucuri.net/images/sucuri-sprite.png) no-repeat;margin:0 auto}.sucuriscan-sitecheck-form{margin:20px 0 0}.sucuriscan-sitecheck-form .button.button-hero{padding:0 46px}.sucuriscan-loading .sucuriscan-sitecheck-disclaimer{text-align:justify;padding-top:20px;border-top:1px solid #ddd}.sucuriscan-auditlogs .sucuriscan-maxper-page,.sucuriscan-scanner-results .sucuriscan-malware-link{text-align:right}.sucuriscan-loading .sucuriscan-sitecheck-disclaimer p{font-size:10px}.sucuriscan-maincontent .sucuriscan-border{border:0;border-left:4px solid #ddd}.sucuriscan-maincontent .sucuriscan-border>.inside,.sucuriscan-maincontent .sucuriscan-border>h3{border-top:1px solid #e5e5e5;border-right:1px solid #e5e5e5}.sucuriscan-maincontent .sucuriscan-border>h3{border-bottom:0}.sucuriscan-maincontent .sucuriscan-border>.inside{margin-top:0!important;border-bottom:1px solid #ddd}.sucuriscan-maincontent .sucuriscan-border-good,.sucuriscan-maincontent .sucuriscan-border-success{border-left-color:#7ad03a}.sucuriscan-maincontent .sucuriscan-border-bad,.sucuriscan-maincontent .sucuriscan-border-danger{border-left-color:#dd3d36}.sucuriscan-maincontent .sucuriscan-border-info{border-left-color:#2ea2cc}.sucuriscan-maincontent .sucuriscan-cleanup-btn{margin:20px 0 0}.sucuriscan-scanner-results .sucuriscan-scanner-details tr:nth-child(even),.sucuriscan-scanner-results .sucuriscan-scanner-links tr:nth-child(even){background:#f5f5f5}.sucuriscan-scanner-results td.sucuriscan-border-bad{border-left-width:4px;border-left-style:solid}.sucuriscan-scanner-results .sucuriscan-malware-link a:hover{color:#fff}.sucuriscan-malware-payload{background:#f5f5f5;margin:-2px -15px -15px;padding:15px}.sucuriscan-maincontent .sucuriscan-auditlogs,.sucuriscan-maincontent .sucuriscan-corefiles,.sucuriscan-maincontent .sucuriscan-wordpress-outdated{margin-top:0;margin-bottom:20px}.sucuriscan-auditlogs .sucuriscan-list-as-table,.sucuriscan-maincontent .sucuriscan-auditlogs{margin-bottom:0}.sucuriscan-auditlogs .sucuriscan-pagination-loading{line-height:32px;color:#666}.sucuriscan-auditlogs .sucuriscan-label{display:inline-block;width:18px;text-transform:uppercase;line-height:13px;cursor:pointer;border-radius:50%}.sucuriscan-auditlogs .sucuriscan-auditlog-success,.sucuriscan-label-added{background:#5cb85c}.sucuriscan-auditlogs .sucuriscan-auditlog-debug{background:#c690ec}.sucuriscan-auditlogs .sucuriscan-auditlog-info{background:#5bc0de}.sucuriscan-auditlogs .sucuriscan-auditlog-notice{background:#428bca}.sucuriscan-auditlogs .sucuriscan-auditlog-warning,.sucuriscan-label-modified{background:#f0ad4e}.sucuriscan-auditlogs .sucuriscan-auditlog-error,.sucuriscan-label-removed{background:#f27d7d}.sucuriscan-auditlogs .sucuriscan-auditlog-critical{background:#000}.sucuriscan-maincontent .sucuriscan-audit-report{border-left-width:1px}.sucuriscan-audit-report .sucuriscan-report-row{margin-bottom:10px}.sucuriscan-audit-report .sucuriscan-report-row:last-child,.sucuriscan-maincontent .sucuriscan-corefiles{margin-bottom:0}.sucuriscan-audit-report .sucuriscan-report-chart{width:49%;border:1px solid #ddd}.sucuriscan-audit-report .sucuriscan-report-chart h4,.sucuriscan-audit-report .sucuriscan-report-chart h5{font-weight:400;text-align:center;margin:0}.sucuriscan-firewall-accesslog .sucuriscan-accesslog-label,.sucuriscan-request-summary tr td:first-child{font-weight:700}.sucuriscan-audit-report .sucuriscan-report-chart h4{font-size:18px;margin-top:10px}.sucuriscan-audit-report .sucuriscan-report-chart h5{font-size:12px;margin-top:5px}.sucuriscan-firewall-auditlogs .sucuriscan-denial-type,.sucuriscan-request-summary td{font-size:14px}.sucuriscan-maincontent .sucuriscan-audit-report .sucuriscan-inline-alert-info{margin-top:10px}.sucuriscan-status-type{display:inline-block;width:20px;background:#ddd;text-align:center;text-transform:uppercase;margin-right:10px;padding:0 3px;border:1px solid transparent;border-radius:3px}.sucuriscan-maincontent .sucuriscan-corefiles .sucuriscan-label{text-transform:capitalize}.sucuriscan-maincontent .sucuriscan-ignoredfiles{margin-top:0}.sucuriscan-maincontent .sucuriscan-modifiedfiles .sucuriscan-ellipsis{width:100px}.sucuriscan-maincontent .sucuriscan-firewall-apikey{margin-bottom:10px}.sucuriscan-firewall-settings .sucuriscan-list-as-table{margin-top:4px;margin-bottom:4px}.sucuriscan-firewall-auditlogs .thead-with-button .button{width:65px}.sucuriscan-firewall-auditlogs .thead-with-button .input-text,.sucuriscan-firewall-auditlogs .thead-with-button select{width:250px}.sucuriscan-firewall-auditlogs .sucuriscan-denial-type-date{font-style:italic;color:#999}.sucuriscan-firewall-auditlogs .sucuriscan-alert,.wrap .sucuriscan-firewall-auditlogs .error,.wrap .sucuriscan-firewall-auditlogs .updated{background:#eee;border:1px solid #ddd;border-left-width:4px;margin:10px}.sucuriscan-firewall-accesslog .sucuriscan-accesslog-origin img{margin-right:6px}.sucuriscan-firewall-accesslog .sucuriscan-accesslog-datetime,.sucuriscan-firewall-accesslog .sucuriscan-accesslog-origin,.sucuriscan-firewall-accesslog .sucuriscan-accesslog-referer,.sucuriscan-firewall-accesslog .sucuriscan-accesslog-request,.sucuriscan-firewall-accesslog .sucuriscan-accesslog-signature,.sucuriscan-firewall-accesslog .sucuriscan-accesslog-target,.sucuriscan-firewall-accesslog .sucuriscan-accesslog-useragent{display:block;padding-left:30px}.sucuriscan-firewall-accesslog .sucuriscan-accesslog-origin{padding-left:0}.sucuriscan-request-summary{margin:-3px -15px -15px}.sucuriscan-hstatus{position:relative;margin:0 -12px;padding:10px 12px;border:1px solid transparent}.sucuriscan-hstatus-0{background-color:#f2dede;color:#a94442;border-color:#ebccd1}.sucuriscan-hstatus-1{background-color:#dff0d8;color:#3c763d;border-color:#d6e9c6}.sucuriscan-hstatus-2{background-color:#dee4f2;color:#4263a9;border-color:#ccd0eb}.sucuriscan-hstatus .button-primary,.sucuriscan-hstatus .button-secondary{position:absolute;top:5px;right:5px}.sucuriscan-hardening-whitelist form{margin-top:15px}.sucuriscan-hardening-whitelist form label{line-height:29px;font-size:12px;background-color:#eee;padding:0 10px;display:inline-block;border:1px solid #ddd;border-right:0}.sucuriscan-hardening-whitelist form input[type=text]{margin:0;padding:5px}.sucuriscan-hardening-whitelist form select{height:initial;padding:4px;margin:0}.sucuriscan-hardening-whitelist form .button,.sucuriscan-hardening-whitelist form input[type=text],.sucuriscan-hardening-whitelist form select{margin-right:5px}.sucuriscan-maincontent .sucuriscan-table.sucuriscan-hardening-whitelist-table{margin-top:0}.sucuriscan-lastlogin-outof{font-style:italic;color:#999;margin-right:10px}.sucuriscan-admins-lastlogins .sucuriscan-ellipsis{width:170px}.sucuriscan-admins-lastlogins td{padding:4px 8px}.sucuriscan-pattern-search-inputbox{margin-top:12px}.sucuriscan-pattern-search-inputbox .input-text{width:84.7777%;line-height:30px;margin:0 6px 0 0}.sucuriscan-pattern-search-inputbox .input-button{width:14%;height:initial;line-height:35px}.sucuriscan-pattern-search .sucuriscan-cleanup-btn{margin-top:12px}.sucuriscan-pattern-search table label{color:#999}.sucuriscan-pattern-search .sucuriscan-grep-text em{color:#ea3838}.sucuriscan-updates .dashicons-before:before{margin-right:10px}.sucuriscan-updates .dashicons-admin-plugins{color:#32373c}.sucuriscan-updates .dashicons-admin-appearance{color:#d54e21}.sucuriscan-about ul{margin-left:20px}.sucuriscan-about ul li{list-style:outside}.sucuriscan-about li label{font-weight:700;vertical-align:initial}.sucuriscan-apikey-registered .sucuriscan-pull-right{width:400px}.sucuriscan-apikey-registered .sucuriscan-sitelogo{background-position:0 -17px;height:83px}.sucuriscan-setup-instructions .form-table{margin-top:15px}.sucuriscan-setup-instructions .form-table td{padding:0 0 12px}.sucuriscan-setup-instructions .form-table select{max-width:400px}.sucuriscan-pagination{display:inline-block;margin:0;padding:0;border-radius:4px}.sucuriscan-pagination>li{display:inline}.c3-tooltip td>span,.sucuriscan-maincontent .sucuriscan-settings form{display:inline-block}.sucuriscan-pagination>li>a,.sucuriscan-pagination>li>span{position:relative;background:#fff;color:#428bca;line-height:1.42857143;text-decoration:none;float:left;margin-left:-1px;padding:6px 12px;border:1px solid #ddd}.sucuriscan-pagination>li:first-child>a,.sucuriscan-pagination>li:first-child>span{margin-left:0;border-radius:4px 0 0 4px}.sucuriscan-pagination>li:last-child>a,.sucuriscan-pagination>li:last-child>span{border-radius:0 4px 4px 0}.sucuriscan-pagination>li>a.sucuriscan-pagination-active,.sucuriscan-pagination>li>a:hover{background:#0074a2;color:#fff}.sucuriscan_wpconfig_keys_updated textarea{width:100%;height:250px;background:#f5f5f5;font-size:12px;resize:vertical;margin:20px 0 0}.sucuriscan-maincontent .sucuriscan-last-logins,.sucuriscan-maincontent .sucuriscan-settings{margin-top:0}.sucuriscan-maincontent .sucuriscan-last-logins .sucuriscan-ellipsis{width:150px;line-height:inherit}.sucuriscan-maincontent .sucuriscan-full-textarea{width:100%;height:400px;line-height:normal;resize:vertical;padding:10px}.sucuriscan-maincontent .sucuriscan-settings .input-text,.sucuriscan-maincontent .sucuriscan-settings select{width:220px;margin:0}.sucuriscan-maincontent .sucuriscan-infosys-htaccess .inside .sucuriscan-inline-alert-updated,.sucuriscan-maincontent .sucuriscan-monitor-fpath{margin-bottom:10px}.sucuriscan-maincontent .sucuriscan-recipient-form{margin-top:10px}.sucuriscan-maincontent .sucuriscan-settings-ignorescanning,.sucuriscan-maincontent .sucuriscan-settings-notifications,.sucuriscan-maincontent .sucuriscan-settings-trustip,.sucuriscan-maincontent .sucuriscan-wpcron-list{margin-top:0}.sucuriscan-maincontent .sucuriscan-settings-notifications .dashicons-before:before{margin-right:5px}.sucuriscan-maincontent .sucuriscan-infosys-htaccess .inside{border-bottom:1px solid #ddd!important}.sucuriscan-maincontent .sucuriscan-errorlogs .inside .sucuriscan-inline-alert-error{margin-top:10px}.sucuriscan-maincontent .sucuriscan-subject-formats{margin:0}.sucuriscan-maincontent .sucuriscan-subject-formats input[type=text]{width:40%;margin-left:10px}.sucuriscan-flag{width:16px;height:11px;background:url(../images/flags.sprite.png) no-repeat}.sucuriscan-flag-ad{background-position:-16px 0}.sucuriscan-flag-ae{background-position:-32px 0}.sucuriscan-flag-af{background-position:-48px 0}.sucuriscan-flag-ag{background-position:-64px 0}.sucuriscan-flag-ai{background-position:-80px 0}.sucuriscan-flag-al{background-position:-96px 0}.sucuriscan-flag-am{background-position:-112px 0}.sucuriscan-flag-an{background-position:-128px 0}.sucuriscan-flag-ao{background-position:-144px 0}.sucuriscan-flag-ar{background-position:-160px 0}.sucuriscan-flag-as{background-position:-176px 0}.sucuriscan-flag-at{background-position:-192px 0}.sucuriscan-flag-au{background-position:-208px 0}.sucuriscan-flag-aw{background-position:-224px 0}.sucuriscan-flag-az{background-position:-240px 0}.sucuriscan-flag-ba{background-position:0 -11px}.sucuriscan-flag-bb{background-position:-16px -11px}.sucuriscan-flag-bd{background-position:-32px -11px}.sucuriscan-flag-be{background-position:-48px -11px}.sucuriscan-flag-bf{background-position:-64px -11px}.sucuriscan-flag-bg{background-position:-80px -11px}.sucuriscan-flag-bh{background-position:-96px -11px}.sucuriscan-flag-bi{background-position:-112px -11px}.sucuriscan-flag-bj{background-position:-128px -11px}.sucuriscan-flag-bm{background-position:-144px -11px}.sucuriscan-flag-bn{background-position:-160px -11px}.sucuriscan-flag-bo{background-position:-176px -11px}.sucuriscan-flag-br{background-position:-192px -11px}.sucuriscan-flag-bs{background-position:-208px -11px}.sucuriscan-flag-bt{background-position:-224px -11px}.sucuriscan-flag-bv{background-position:-240px -11px}.sucuriscan-flag-bw{background-position:0 -22px}.sucuriscan-flag-by{background-position:-16px -22px}.sucuriscan-flag-bz{background-position:-32px -22px}.sucuriscan-flag-ca{background-position:-48px -22px}.sucuriscan-flag-catalonia{background-position:-64px -22px}.sucuriscan-flag-cd{background-position:-80px -22px}.sucuriscan-flag-cf{background-position:-96px -22px}.sucuriscan-flag-cg{background-position:-112px -22px}.sucuriscan-flag-ch{background-position:-128px -22px}.sucuriscan-flag-ci{background-position:-144px -22px}.sucuriscan-flag-ck{background-position:-160px -22px}.sucuriscan-flag-cl{background-position:-176px -22px}.sucuriscan-flag-cm{background-position:-192px -22px}.sucuriscan-flag-cn{background-position:-208px -22px}.sucuriscan-flag-co{background-position:-224px -22px}.sucuriscan-flag-cr{background-position:-240px -22px}.sucuriscan-flag-cu{background-position:0 -33px}.sucuriscan-flag-cv{background-position:-16px -33px}.sucuriscan-flag-cw{background-position:-32px -33px}.sucuriscan-flag-cy{background-position:-48px -33px}.sucuriscan-flag-cz{background-position:-64px -33px}.sucuriscan-flag-de{background-position:-80px -33px}.sucuriscan-flag-dj{background-position:-96px -33px}.sucuriscan-flag-dk{background-position:-112px -33px}.sucuriscan-flag-dm{background-position:-128px -33px}.sucuriscan-flag-do{background-position:-144px -33px}.sucuriscan-flag-dz{background-position:-160px -33px}.sucuriscan-flag-ec{background-position:-176px -33px}.sucuriscan-flag-ee{background-position:-192px -33px}.sucuriscan-flag-eg{background-position:-208px -33px}.sucuriscan-flag-eh{background-position:-224px -33px}.sucuriscan-flag-england{background-position:-240px -33px}.sucuriscan-flag-er{background-position:0 -44px}.sucuriscan-flag-es{background-position:-16px -44px}.sucuriscan-flag-et{background-position:-32px -44px}.sucuriscan-flag-eu{background-position:-48px -44px}.sucuriscan-flag-fi{background-position:-64px -44px}.sucuriscan-flag-fj{background-position:-80px -44px}.sucuriscan-flag-fk{background-position:-96px -44px}.sucuriscan-flag-fm{background-position:-112px -44px}.sucuriscan-flag-fo{background-position:-128px -44px}.sucuriscan-flag-fr{background-position:-144px -44px}.sucuriscan-flag-ga{background-position:-160px -44px}.sucuriscan-flag-gb{background-position:-176px -44px}.sucuriscan-flag-gd{background-position:-192px -44px}.sucuriscan-flag-ge{background-position:-208px -44px}.sucuriscan-flag-gf{background-position:-224px -44px}.sucuriscan-flag-gg{background-position:-240px -44px}.sucuriscan-flag-gh{background-position:0 -55px}.sucuriscan-flag-gi{background-position:-16px -55px}.sucuriscan-flag-gl{background-position:-32px -55px}.sucuriscan-flag-gm{background-position:-48px -55px}.sucuriscan-flag-gn{background-position:-64px -55px}.sucuriscan-flag-gp{background-position:-80px -55px}.sucuriscan-flag-gq{background-position:-96px -55px}.sucuriscan-flag-gr{background-position:-112px -55px}.sucuriscan-flag-gs{background-position:-128px -55px}.sucuriscan-flag-gt{background-position:-144px -55px}.sucuriscan-flag-gu{background-position:-160px -55px}.sucuriscan-flag-gw{background-position:-176px -55px}.sucuriscan-flag-gy{background-position:-192px -55px}.sucuriscan-flag-hk{background-position:-208px -55px}.sucuriscan-flag-hm{background-position:-224px -55px}.sucuriscan-flag-hn{background-position:-240px -55px}.sucuriscan-flag-hr{background-position:0 -66px}.sucuriscan-flag-ht{background-position:-16px -66px}.sucuriscan-flag-hu{background-position:-32px -66px}.sucuriscan-flag-ic{background-position:-48px -66px}.sucuriscan-flag-id{background-position:-64px -66px}.sucuriscan-flag-ie{background-position:-80px -66px}.sucuriscan-flag-il{background-position:-96px -66px}.sucuriscan-flag-im{background-position:-112px -66px}.sucuriscan-flag-in{background-position:-128px -66px}.sucuriscan-flag-io{background-position:-144px -66px}.sucuriscan-flag-iq{background-position:-160px -66px}.sucuriscan-flag-ir{background-position:-176px -66px}.sucuriscan-flag-is{background-position:-192px -66px}.sucuriscan-flag-it{background-position:-208px -66px}.sucuriscan-flag-je{background-position:-224px -66px}.sucuriscan-flag-jm{background-position:-240px -66px}.sucuriscan-flag-jo{background-position:0 -77px}.sucuriscan-flag-jp{background-position:-16px -77px}.sucuriscan-flag-ke{background-position:-32px -77px}.sucuriscan-flag-kg{background-position:-48px -77px}.sucuriscan-flag-kh{background-position:-64px -77px}.sucuriscan-flag-ki{background-position:-80px -77px}.sucuriscan-flag-km{background-position:-96px -77px}.sucuriscan-flag-kn{background-position:-112px -77px}.sucuriscan-flag-kp{background-position:-128px -77px}.sucuriscan-flag-kr{background-position:-144px -77px}.sucuriscan-flag-kurdistan{background-position:-160px -77px}.sucuriscan-flag-kw{background-position:-176px -77px}.sucuriscan-flag-ky{background-position:-192px -77px}.sucuriscan-flag-kz{background-position:-208px -77px}.sucuriscan-flag-la{background-position:-224px -77px}.sucuriscan-flag-lb{background-position:-240px -77px}.sucuriscan-flag-lc{background-position:0 -88px}.sucuriscan-flag-li{background-position:-16px -88px}.sucuriscan-flag-lk{background-position:-32px -88px}.sucuriscan-flag-lr{background-position:-48px -88px}.sucuriscan-flag-ls{background-position:-64px -88px}.sucuriscan-flag-lt{background-position:-80px -88px}.sucuriscan-flag-lu{background-position:-96px -88px}.sucuriscan-flag-lv{background-position:-112px -88px}.sucuriscan-flag-ly{background-position:-128px -88px}.sucuriscan-flag-ma{background-position:-144px -88px}.sucuriscan-flag-mc{background-position:-160px -88px}.sucuriscan-flag-md{background-position:-176px -88px}.sucuriscan-flag-me{background-position:-192px -88px}.sucuriscan-flag-mg{background-position:-208px -88px}.sucuriscan-flag-mh{background-position:-224px -88px}.sucuriscan-flag-mk{background-position:-240px -88px}.sucuriscan-flag-ml{background-position:0 -99px}.sucuriscan-flag-mm{background-position:-16px -99px}.sucuriscan-flag-mn{background-position:-32px -99px}.sucuriscan-flag-mo{background-position:-48px -99px}.sucuriscan-flag-mp{background-position:-64px -99px}.sucuriscan-flag-mq{background-position:-80px -99px}.sucuriscan-flag-mr{background-position:-96px -99px}.sucuriscan-flag-ms{background-position:-112px -99px}.sucuriscan-flag-mt{background-position:-128px -99px}.sucuriscan-flag-mu{background-position:-144px -99px}.sucuriscan-flag-mv{background-position:-160px -99px}.sucuriscan-flag-mw{background-position:-176px -99px}.sucuriscan-flag-mx{background-position:-192px -99px}.sucuriscan-flag-my{background-position:-208px -99px}.sucuriscan-flag-mz{background-position:-224px -99px}.sucuriscan-flag-na{background-position:-240px -99px}.sucuriscan-flag-nc{background-position:0 -110px}.sucuriscan-flag-ne{background-position:-16px -110px}.sucuriscan-flag-nf{background-position:-32px -110px}.sucuriscan-flag-ng{background-position:-48px -110px}.sucuriscan-flag-ni{background-position:-64px -110px}.sucuriscan-flag-nl{background-position:-80px -110px}.sucuriscan-flag-no{background-position:-96px -110px}.sucuriscan-flag-np{background-position:-112px -110px}.sucuriscan-flag-nr{background-position:-128px -110px}.sucuriscan-flag-nu{background-position:-144px -110px}.sucuriscan-flag-nz{background-position:-160px -110px}.sucuriscan-flag-om{background-position:-176px -110px}.sucuriscan-flag-pa{background-position:-192px -110px}.sucuriscan-flag-pe{background-position:-208px -110px}.sucuriscan-flag-pf{background-position:-224px -110px}.sucuriscan-flag-pg{background-position:-240px -110px}.sucuriscan-flag-ph{background-position:0 -121px}.sucuriscan-flag-pk{background-position:-16px -121px}.sucuriscan-flag-pl{background-position:-32px -121px}.sucuriscan-flag-pm{background-position:-48px -121px}.sucuriscan-flag-pn{background-position:-64px -121px}.sucuriscan-flag-pr{background-position:-80px -121px}.sucuriscan-flag-ps{background-position:-96px -121px}.sucuriscan-flag-pt{background-position:-112px -121px}.sucuriscan-flag-pw{background-position:-128px -121px}.sucuriscan-flag-py{background-position:-144px -121px}.sucuriscan-flag-qa{background-position:-160px -121px}.sucuriscan-flag-re{background-position:-176px -121px}.sucuriscan-flag-ro{background-position:-192px -121px}.sucuriscan-flag-rs{background-position:-208px -121px}.sucuriscan-flag-ru{background-position:-224px -121px}.sucuriscan-flag-rw{background-position:-240px -121px}.sucuriscan-flag-sa{background-position:0 -132px}.sucuriscan-flag-sb{background-position:-16px -132px}.sucuriscan-flag-sc{background-position:-32px -132px}.sucuriscan-flag-scotland{background-position:-48px -132px}.sucuriscan-flag-sd{background-position:-64px -132px}.sucuriscan-flag-se{background-position:-80px -132px}.sucuriscan-flag-sg{background-position:-96px -132px}.sucuriscan-flag-sh{background-position:-112px -132px}.sucuriscan-flag-si{background-position:-128px -132px}.sucuriscan-flag-sk{background-position:-144px -132px}.sucuriscan-flag-sl{background-position:-160px -132px}.sucuriscan-flag-sm{background-position:-176px -132px}.sucuriscan-flag-sn{background-position:-192px -132px}.sucuriscan-flag-so{background-position:-208px -132px}.sucuriscan-flag-somaliland{background-position:-224px -132px}.sucuriscan-flag-sr{background-position:-240px -132px}.sucuriscan-flag-ss{background-position:0 -143px}.sucuriscan-flag-st{background-position:-16px -143px}.sucuriscan-flag-sv{background-position:-32px -143px}.sucuriscan-flag-sx{background-position:-48px -143px}.sucuriscan-flag-sy{background-position:-64px -143px}.sucuriscan-flag-sz{background-position:-80px -143px}.sucuriscan-flag-tc{background-position:-96px -143px}.sucuriscan-flag-td{background-position:-112px -143px}.sucuriscan-flag-tf{background-position:-128px -143px}.sucuriscan-flag-tg{background-position:-144px -143px}.sucuriscan-flag-th{background-position:-160px -143px}.sucuriscan-flag-tj{background-position:-176px -143px}.sucuriscan-flag-tk{background-position:-192px -143px}.sucuriscan-flag-tl{background-position:-208px -143px}.sucuriscan-flag-tm{background-position:-224px -143px}.sucuriscan-flag-tn{background-position:-240px -143px}.sucuriscan-flag-to{background-position:0 -154px}.sucuriscan-flag-tr{background-position:-16px -154px}.sucuriscan-flag-tt{background-position:-32px -154px}.sucuriscan-flag-tv{background-position:-48px -154px}.sucuriscan-flag-tw{background-position:-64px -154px}.sucuriscan-flag-tz{background-position:-80px -154px}.sucuriscan-flag-ua{background-position:-96px -154px}.sucuriscan-flag-ug{background-position:-112px -154px}.sucuriscan-flag-um{background-position:-128px -154px}.sucuriscan-flag-us{background-position:-144px -154px}.sucuriscan-flag-uy{background-position:-160px -154px}.sucuriscan-flag-uz{background-position:-176px -154px}.sucuriscan-flag-va{background-position:-192px -154px}.sucuriscan-flag-vc{background-position:-208px -154px}.sucuriscan-flag-ve{background-position:-224px -154px}.sucuriscan-flag-vg{background-position:-240px -154px}.sucuriscan-flag-vi{background-position:0 -165px}.sucuriscan-flag-vn{background-position:-16px -165px}.sucuriscan-flag-vu{background-position:-32px -165px}.sucuriscan-flag-wales{background-position:-48px -165px}.sucuriscan-flag-wf{background-position:-64px -165px}.sucuriscan-flag-ws{background-position:-80px -165px}.sucuriscan-flag-ye{background-position:-96px -165px}.sucuriscan-flag-yt{background-position:-112px -165px}.sucuriscan-flag-za{background-position:-128px -165px}.sucuriscan-flag-zanzibar{background-position:-144px -165px}.sucuriscan-flag-zm{background-position:-160px -165px}.sucuriscan-flag-zw{background-position:-176px -165px}.c3 svg{font:10px sans-serif}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:gray;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:.75}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777}.c3-tooltip tr{border:1px solid #CCC}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#FFF}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max,.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}@media (max-width:510px){.wp-core-ui .button.sucuriscan-review-hero,.wp-core-ui .sucuriscan-review-hero{display:none}}@media (max-width:620px){.sucuriscan-tabs>ul li,.sucuriscan-tabs>ul li>a{display:block}.sucuriscan-getapi-form button.button-primary{line-height:40px}}@media (max-width:768px){.sucuriscan-wrap .sucuriscan-footer .sucuriscan-help,.sucuriscan-wrap .sucuriscan-footer .sucuriscan-logo,.sucuriscan-wrap .sucuriscan-leftside,.sucuriscan-wrap .sucuriscan-sidebar{float:none}.sucuriscan-wrap .sucuriscan-leftside,.sucuriscan-wrap .sucuriscan-sidebar{width:100%}.sucuriscan-wrap .sucuriscan-sidebar{margin-top:20px}.sucuriscan-wrap .sucuriscan-footer .sucuriscan-logo{display:table;margin:0 auto}}@media (max-width:920px){.sucuriscan-wrap .sucuriscan-navbar{padding-left:0;padding-right:0}.sucuriscan-wrap .sucuriscan-navbar .nav-tab{display:block;line-height:20px;margin:0}.sucuriscan-wrap .sucuriscan-navbar .nav-tab:last-child{border-bottom:1px solid #ccc}}@media (max-width:1170px){.sucuriscan-modal{width:76%;left:10%}}@media (min-width:600px) and (max-width:1060px){.sucuriscan-wrap .sucuriscan-leftside,.sucuriscan-wrap .sucuriscan-sidebar{width:initial;float:none}.sucuriscan-wrap .sucuriscan-sidebar{margin-top:20px}.sucuriscan-wrap .sucuriscan-sidebar>div{width:49%;float:left;min-height:339px}.sucuriscan-wrap .sucuriscan-sidebar .sucuriscan-ad-antivirus{margin-left:2%}.sucuriscan-wrap .sucuriscan-scanner-video{height:450px}}.sucuriscan-maincontent #poststuff,.sucuriscan-panelstuff{min-width:initial;padding-top:0}.sucuriscan-maincontent .widefat tbody th.check-column{padding:6px 0 3px}.sucuriscan-maincontent .hardening-box .primary-secondary{margin:0 0 0 10px}.sucuriscan-maincontent hr{border:none;border-top:1px solid #999}.sucuriscan-maincontent table td>table{background:#fff}.sucuriscan-maincontent table td>table th{padding:4px 8px}
 
inc/images/antivirus-logo-x42.png DELETED
Binary file
inc/images/checkcross.png ADDED
Binary file
inc/images/checkinfo.png ADDED
Binary file
inc/images/checkmark.png ADDED
Binary file
inc/images/checknotice.png ADDED
Binary file
inc/images/checkwarn.png ADDED
Binary file
inc/images/cloudproxy-logo-x42.png DELETED
Binary file
inc/images/flags.sprite.png CHANGED
Binary file
inc/images/logo.png DELETED
Binary file
inc/images/main-logo.png DELETED
Binary file
inc/images/mainlogo.png ADDED
Binary file
inc/images/menu-icon.png DELETED
Binary file
inc/images/menuicon.png ADDED
Binary file
inc/images/pluginlogo.png ADDED
Binary file
inc/images/sucuri-website.png DELETED
Binary file
inc/js/c3.min.js CHANGED
@@ -1,5 +1,6 @@
1
- !function(a){"use strict";function b(a){var b=this.internal=new c(this);b.loadConfig(a),b.init(),function d(a,b,c){Object.keys(a).forEach(function(e){b[e]=a[e].bind(c),Object.keys(a[e]).length>0&&d(a[e],b[e],c)})}(e,this,this)}function c(b){var c=this;c.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}function d(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+t)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,m);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=o.copy();return b.isCategory&&(a=o.domain(),c.domain([a[0],a[1]-1])),c}function h(a){return l?l(a):a}function i(a){if(w)return w;var b={h:11.5,w:5.5};return a.select("text").text(h).each(function(a){var c=this.getBoundingClientRect(),d=h(a),e=c.height,f=d?c.width/d.length:void 0;e&&f&&(b.h=e,b.w=f)}).text(""),w=b,b}function j(j){j.each(function(){function j(a,c){function d(a,b){f=void 0;for(var h=1;h<b.length;h++)if(" "===b.charAt(h)&&(f=h),e=b.substr(0,h+1),g=O.w*e.length,g>c)return d(a.concat(b.substr(0,f?f:h)),b.slice(f?f+1:h));return a.concat(b)}var e,f,g,i=h(a),j=[];return"[object Array]"===Object.prototype.toString.call(i)?i:((!c||0>=c)&&(c=R?95:b.isCategory?Math.ceil(z(A[1])-z(A[0]))-12:110),d(j,i+""))}function l(a,b){var c=O.h;return 0===b&&(c="left"===p||"right"===p?-((P[a.index]-1)*(O.h/2)-3):".71em"),c}function m(a){var b=o(a)+(n?0:t);return F[0]<b&&b<F[1]?q:0}var u,v,w,x=a.select(this),y=this.__chart__||o,z=this.__chart__=g(),A=s?s:f(z),B=x.selectAll(".tick").data(A,z),C=B.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),D=B.exit().remove(),E=a.transition(B).style("opacity",1),F=o.rangeExtent?o.rangeExtent():e(o.range()),G=x.selectAll(".domain").data([0]),H=(G.enter().append("path").attr("class","domain"),a.transition(G));C.append("line"),C.append("text");var I=C.select("line"),J=E.select("line"),K=C.select("text"),L=E.select("text");b.isCategory?(t=Math.ceil((z(1)-z(0))/2),v=n?0:t,w=n?t:0):t=v=0;var M,N,O=i(x.select(".tick")),P=[],Q=Math.max(q,0)+r,R="left"===p||"right"===p;switch(M=B.select("text"),N=M.selectAll("tspan").data(function(a,c){var d=b.tickMultiline?j(a,b.tickWidth):[].concat(h(a));return P[c]=d.length,d.map(function(a){return{index:c,splitted:a}})}),N.enter().append("tspan"),N.exit().remove(),N.text(function(a){return a.splitted}),p){case"bottom":u=c,I.attr("y2",q),K.attr("y",Q),J.attr("x1",v).attr("x2",v).attr("y2",m),L.attr("x",0).attr("y",Q),M.style("text-anchor","middle"),N.attr("x",0).attr("dy",l),H.attr("d","M"+F[0]+","+k+"V0H"+F[1]+"V"+k);break;case"top":u=c,I.attr("y2",-q),K.attr("y",-Q),J.attr("x2",0).attr("y2",-q),L.attr("x",0).attr("y",-Q),M.style("text-anchor","middle"),N.attr("x",0).attr("dy","0em"),H.attr("d","M"+F[0]+","+-k+"V0H"+F[1]+"V"+-k);break;case"left":u=d,I.attr("x2",-q),K.attr("x",-Q),J.attr("x2",-q).attr("y1",w).attr("y2",w),L.attr("x",-Q).attr("y",t),M.style("text-anchor","end"),N.attr("x",-Q).attr("dy",l),H.attr("d","M"+-k+","+F[0]+"H0V"+F[1]+"H"+-k);break;case"right":u=d,I.attr("x2",q),K.attr("x",Q),J.attr("x2",q).attr("y2",0),L.attr("x",Q).attr("y",0),M.style("text-anchor","start"),N.attr("x",Q).attr("dy",l),H.attr("d","M"+k+","+F[0]+"H0V"+F[1]+"H"+k)}if(z.rangeBand){var S=z,T=S.rangeBand()/2;y=z=function(a){return S(a)+T}}else y.rangeBand?y=z:D.call(u,z);C.call(u,y),E.call(u,z)})}var k,l,m,n,o=a.scale.linear(),p="bottom",q=6,r=3,s=null,t=0,u=!0;return b=b||{},k=b.withOuterTick?6:0,j.scale=function(a){return arguments.length?(o=a,j):o},j.orient=function(a){return arguments.length?(p=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",j):p},j.tickFormat=function(a){return arguments.length?(l=a,j):l},j.tickCentered=function(a){return arguments.length?(n=a,j):n},j.tickOffset=function(){return t},j.ticks=function(){return arguments.length?(m=arguments,j):m},j.tickCulling=function(a){return arguments.length?(u=a,j):u},j.tickValues=function(a){if("function"==typeof a)s=function(){return a(o.domain())};else{if(!arguments.length)return s;s=a}return j},j}var e,f,g={version:"0.4.8"};g.generate=function(a){return new b(a)},g.chart={fn:b.prototype,internal:{fn:c.prototype}},e=g.chart.fn,f=g.chart.internal.fn,f.init=function(){var a=this,b=a.config;if(a.initParams(),b.data_url)a.convertUrlToData(b.data_url,b.data_mimeType,b.data_keys,a.initWithData);else if(b.data_json)a.initWithData(a.convertJsonToData(b.data_json,b.data_keys));else if(b.data_rows)a.initWithData(a.convertRowsToData(b.data_rows));else{if(!b.data_columns)throw Error("url or json or rows or columns is required.");a.initWithData(a.convertColumnsToData(b.data_columns))}},f.initParams=function(){var a=this,b=a.d3,c=a.config;a.clipId="c3-"+ +new Date+"-clip",a.clipIdForXAxis=a.clipId+"-xaxis",a.clipIdForYAxis=a.clipId+"-yaxis",a.clipIdForGrid=a.clipId+"-grid",a.clipIdForSubchart=a.clipId+"-subchart",a.clipPath=a.getClipPath(a.clipId),a.clipPathForXAxis=a.getClipPath(a.clipIdForXAxis),a.clipPathForYAxis=a.getClipPath(a.clipIdForYAxis),a.clipPathForGrid=a.getClipPath(a.clipIdForGrid),a.clipPathForSubchart=a.getClipPath(a.clipIdForSubchart),a.dragStart=null,a.dragging=!1,a.flowing=!1,a.cancelClick=!1,a.mouseover=!1,a.transiting=!1,a.color=a.generateColor(),a.levelColor=a.generateLevelColor(),a.dataTimeFormat=c.data_xLocaltime?b.time.format:b.time.format.utc,a.axisTimeFormat=c.axis_x_localtime?b.time.format:b.time.format.utc,a.defaultAxisTimeFormat=a.axisTimeFormat.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),a.hiddenTargetIds=[],a.hiddenLegendIds=[],a.focusedTargetIds=[],a.defocusedTargetIds=[],a.xOrient=c.axis_rotated?"left":"bottom",a.yOrient=c.axis_rotated?c.axis_y_inner?"top":"bottom":c.axis_y_inner?"right":"left",a.y2Orient=c.axis_rotated?c.axis_y2_inner?"bottom":"top":c.axis_y2_inner?"left":"right",a.subXOrient=c.axis_rotated?"left":"bottom",a.isLegendRight="right"===c.legend_position,a.isLegendInset="inset"===c.legend_position,a.isLegendTop="top-left"===c.legend_inset_anchor||"top-right"===c.legend_inset_anchor,a.isLegendLeft="top-left"===c.legend_inset_anchor||"bottom-left"===c.legend_inset_anchor,a.legendStep=0,a.legendItemWidth=0,a.legendItemHeight=0,a.currentMaxTickWidths={x:0,y:0,y2:0},a.rotated_padding_left=30,a.rotated_padding_right=c.axis_rotated&&!c.axis_x_show?0:30,a.rotated_padding_top=5,a.withoutFadeIn={},a.intervalForObserveInserted=void 0,a.axes.subx=b.selectAll([])},f.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},f.initWithData=function(b){var c,d,e=this,f=e.d3,g=e.config,h=!0;e.initPie&&e.initPie(),e.initBrush&&e.initBrush(),e.initZoom&&e.initZoom(),e.selectChart="function"==typeof g.bindto.node?g.bindto:f.select(g.bindto),e.selectChart.empty()&&(e.selectChart=f.select(document.createElement("div")).style("opacity",0),e.observeInserted(e.selectChart),h=!1),e.selectChart.html("").classed("c3",!0),e.data.xs={},e.data.targets=e.convertDataToTargets(b),g.data_filter&&(e.data.targets=e.data.targets.filter(g.data_filter)),g.data_hide&&e.addHiddenTargetIds(g.data_hide===!0?e.mapToIds(e.data.targets):g.data_hide),g.legend_hide&&e.addHiddenLegendIds(g.legend_hide===!0?e.mapToIds(e.data.targets):g.legend_hide),e.hasType("gauge")&&(g.legend_show=!1),e.updateSizes(),e.updateScales(),e.x.domain(f.extent(e.getXDomain(e.data.targets))),e.y.domain(e.getYDomain(e.data.targets,"y")),e.y2.domain(e.getYDomain(e.data.targets,"y2")),e.subX.domain(e.x.domain()),e.subY.domain(e.y.domain()),e.subY2.domain(e.y2.domain()),e.orgXDomain=e.x.domain(),e.brush&&e.brush.scale(e.subX),g.zoom_enabled&&e.zoom.scale(e.x),e.svg=e.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return g.onmouseover.call(e)}).on("mouseleave",function(){return g.onmouseout.call(e)}),c=e.svg.append("defs"),e.clipChart=e.appendClip(c,e.clipId),e.clipXAxis=e.appendClip(c,e.clipIdForXAxis),e.clipYAxis=e.appendClip(c,e.clipIdForYAxis),e.clipGrid=e.appendClip(c,e.clipIdForGrid),e.clipSubchart=e.appendClip(c,e.clipIdForSubchart),e.updateSvgSize(),d=e.main=e.svg.append("g").attr("transform",e.getTranslate("main")),e.initSubchart&&e.initSubchart(),e.initTooltip&&e.initTooltip(),e.initLegend&&e.initLegend(),d.append("text").attr("class",i.text+" "+i.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),e.initRegion(),e.initGrid(),d.append("g").attr("clip-path",e.clipPath).attr("class",i.chart),g.grid_lines_front&&e.initGridLines(),e.initEventRect(),e.initChartElements(),d.insert("rect",g.zoom_privileged?null:"g."+i.regions).attr("class",i.zoomRect).attr("width",e.width).attr("height",e.height).style("opacity",0).on("dblclick.zoom",null),g.axis_x_extent&&e.brush.extent(e.getDefaultExtent()),e.initAxis(),e.updateTargets(e.data.targets),h&&(e.updateDimension(),e.config.oninit.call(e),e.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),null==a.onresize&&(a.onresize=e.generateResize()),a.onresize.add&&(a.onresize.add(function(){g.onresize.call(e)}),a.onresize.add(function(){e.api.flush()}),a.onresize.add(function(){g.onresized.call(e)})),e.api.element=e.selectChart.node()},f.smoothLines=function(a,b){var c=this;"grid"===b&&a.each(function(){var a=c.d3.select(this),b=a.attr("x1"),d=a.attr("x2"),e=a.attr("y1"),f=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(d),y1:Math.ceil(e),y2:Math.ceil(f)})})},f.updateSizes=function(){var a=this,b=a.config,c=a.legend?a.getLegendHeight():0,d=a.legend?a.getLegendWidth():0,e=a.isLegendRight||a.isLegendInset?0:c,f=a.hasArcType(),g=b.axis_rotated||f?0:a.getHorizontalAxisHeight("x"),h=b.subchart_show&&!f?b.subchart_size_height+g:0;a.currentWidth=a.getCurrentWidth(),a.currentHeight=a.getCurrentHeight(),a.margin=b.axis_rotated?{top:a.getHorizontalAxisHeight("y2")+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:a.getHorizontalAxisHeight("y")+e+a.getCurrentPaddingBottom(),left:h+(f?0:a.getCurrentPaddingLeft())}:{top:4+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:g+h+e+a.getCurrentPaddingBottom(),left:f?0:a.getCurrentPaddingLeft()},a.margin2=b.axis_rotated?{top:a.margin.top,right:0/0,bottom:20+e,left:a.rotated_padding_left}:{top:a.currentHeight-h-e,right:0/0,bottom:g+e,left:a.margin.left},a.margin3={top:0,right:0/0,bottom:0,left:0},a.updateSizeForLegend&&a.updateSizeForLegend(c,d),a.width=a.currentWidth-a.margin.left-a.margin.right,a.height=a.currentHeight-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=b.axis_rotated?a.margin.left-a.rotated_padding_left-a.rotated_padding_right:a.width,a.height2=b.axis_rotated?a.height:a.currentHeight-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0),a.arcWidth=a.width-(a.isLegendRight?d+10:0),a.arcHeight=a.height-(a.isLegendRight?0:10),a.hasType("gauge")&&(a.arcHeight+=a.height-a.getGaugeLabelHeight()),a.updateRadius&&a.updateRadius(),a.isLegendRight&&f&&(a.margin3.left=a.arcWidth/2+1.1*a.radiusExpanded)},f.updateTargets=function(a){var b=this,c=b.config;b.updateTargetsForText(a),b.updateTargetsForBar(a),b.updateTargetsForLine(a),b.updateTargetsForArc&&b.updateTargetsForArc(a),b.updateTargetsForSubchart&&b.updateTargetsForSubchart(a),b.svg.selectAll("."+i.target).filter(function(a){return b.isTargetToShow(a.id)}).transition().duration(c.transition_duration).style("opacity",1)},f.redraw=function(a,b){var c,d,e,f,g,h,j,k,l,m,n,o,p,q,r,s,u,v,w,x,y,z,A,B,C,D,E,F,G,H=this,I=H.main,J=H.d3,K=H.config,L=H.getShapeIndices(H.isAreaType),M=H.getShapeIndices(H.isBarType),N=H.getShapeIndices(H.isLineType),O=H.hasArcType(),P=H.filterTargetsToShow(H.data.targets),Q=H.xv.bind(H);if(a=a||{},c=t(a,"withY",!0),d=t(a,"withSubchart",!0),e=t(a,"withTransition",!0),h=t(a,"withTransform",!1),j=t(a,"withUpdateXDomain",!1),k=t(a,"withUpdateOrgXDomain",!1),l=t(a,"withTrimXDomain",!0),p=t(a,"withUpdateXAxis",j),m=t(a,"withLegend",!1),n=t(a,"withEventRect",!0),o=t(a,"withDimension",!0),f=t(a,"withTransitionForExit",e),g=t(a,"withTransitionForAxis",e),w=e?K.transition_duration:0,x=f?w:0,y=g?w:0,b=b||H.generateAxisTransitions(y),m&&K.legend_show?H.updateLegend(H.mapToIds(H.data.targets),a,b):o&&H.updateDimension(!0),H.isCategorized()&&0===P.length&&H.x.domain([0,H.axes.x.selectAll(".tick").size()]),P.length?(H.updateXDomain(P,j,k,l),K.axis_x_tick_values||(B=K.axis_x_tick_fit||K.axis_x_tick_count?H.generateTickValues(H.mapTargetsToUniqueXs(P),K.axis_x_tick_count,H.isTimeSeries()):void 0,H.xAxis.tickValues(B),H.subXAxis.tickValues(B))):(H.xAxis.tickValues([]),H.subXAxis.tickValues([])),K.zoom_rescale&&!a.flow&&(E=H.x.orgDomain()),H.y.domain(H.getYDomain(P,"y",E)),H.y2.domain(H.getYDomain(P,"y2",E)),!K.axis_y_tick_values&&K.axis_y_tick_count&&H.yAxis.tickValues(H.generateTickValues(H.y.domain(),K.axis_y_tick_count)),!K.axis_y2_tick_values&&K.axis_y2_tick_count&&H.y2Axis.tickValues(H.generateTickValues(H.y2.domain(),K.axis_y2_tick_count)),H.redrawAxis(b,O),H.updateAxisLabels(e),(j||p)&&P.length)if(K.axis_x_tick_culling&&B){for(C=1;C<B.length;C++)if(B.length/C<K.axis_x_tick_culling_max){D=C;break}H.svg.selectAll("."+i.axisX+" .tick text").each(function(a){var b=B.indexOf(a);b>=0&&J.select(this).style("display",b%D?"none":"block")})}else H.svg.selectAll("."+i.axisX+" .tick text").style("display","block");q=H.generateDrawArea?H.generateDrawArea(L,!1):void 0,r=H.generateDrawBar?H.generateDrawBar(M):void 0,s=H.generateDrawLine?H.generateDrawLine(N,!1):void 0,u=H.generateXYForText(L,M,N,!0),v=H.generateXYForText(L,M,N,!1),c&&(H.subY.domain(H.getYDomain(P,"y")),H.subY2.domain(H.getYDomain(P,"y2"))),H.tooltip.style("display","none"),H.updateXgridFocus(),I.select("text."+i.text+"."+i.empty).attr("x",H.width/2).attr("y",H.height/2).text(K.data_empty_label_text).transition().style("opacity",P.length?0:1),H.redrawGrid(w),H.redrawRegion(w),H.redrawBar(x),H.redrawLine(x),H.redrawArea(x),H.redrawCircle(),H.hasDataLabel()&&H.redrawText(x),H.redrawArc&&H.redrawArc(w,x,h),H.redrawSubchart&&H.redrawSubchart(d,b,w,x,L,M,N),I.selectAll("."+i.selectedCircles).filter(H.isBarType.bind(H)).selectAll("circle").remove(),K.interaction_enabled&&!a.flow&&n&&(H.redrawEventRect(),H.updateZoom&&H.updateZoom()),H.updateCircleY(),F=(H.config.axis_rotated?H.circleY:H.circleX).bind(H),G=(H.config.axis_rotated?H.circleX:H.circleY).bind(H),J.transition().duration(w).each(function(){var b=[];H.addTransitionForBar(b,r),H.addTransitionForLine(b,s),H.addTransitionForArea(b,q),H.addTransitionForCircle(b,F,G),H.addTransitionForText(b,u,v,a.flow),H.addTransitionForRegion(b),H.addTransitionForGrid(b),a.flow&&(z=H.generateWait(),b.forEach(function(a){z.add(a)}),A=H.generateFlow({targets:P,flow:a.flow,duration:w,drawBar:r,drawLine:s,drawArea:q,cx:F,cy:G,xv:Q,xForText:u,yForText:v}))}).call(z||function(){},A||function(){}),H.mapToIds(H.data.targets).forEach(function(a){H.withoutFadeIn[a]=!0})},f.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=t(a,"withTransition",!0),a.withTransform=t(a,"withTransform",!1),a.withLegend=t(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=t(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d.legend_show||(b=c.generateAxisTransitions(a.withTransitionForAxis?d.transition_duration:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},f.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},f.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},f.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},f.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b.data_x||s(b.data_xs))},f.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},f.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=p(d.margin.left),c=p(d.margin.top)):"context"===a?(b=p(d.margin2.left),c=p(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e.axis_rotated?0:d.height):"y"===a?(b=0,c=e.axis_rotated?d.height:0):"y2"===a?(b=e.axis_rotated?0:d.width,c=e.axis_rotated?1:0):"subx"===a?(b=0,c=e.axis_rotated?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},f.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},f.initialOpacityForCircle=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?this.opacityForCircle(a):0},f.opacityForCircle=function(a){var b=this.config.point_show?1:0;return j(a.value)?this.isScatterType(a)?.5:b:0},f.opacityForText=function(){return this.hasDataLabel()?1:0},f.xx=function(a){return a?this.x(a.x):null},f.xv=function(a){var b=this,c=a.value;return b.isTimeSeries()?c=b.parseDate(a.value):b.isCategorized()&&"string"==typeof a.value&&(c=b.config.axis_x_categories.indexOf(a.value)),Math.ceil(b.x(c))},f.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},f.subxx=function(a){return a?this.subX(a.x):null},f.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+i.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+i.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+i.axisY2),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+i.chartArcs).attr("transform",f.getTranslate("arc"))},f.transformAll=function(a,b){var c=this;c.transformMain(a,b),c.config.subchart_show&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},f.updateSvgSize=function(){var a=this,b=a.svg.select(".c3-brush .background");a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.selectAll(["#"+a.clipId,"#"+a.clipIdForGrid]).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",a.getXAxisClipX.bind(a)).attr("y",a.getXAxisClipY.bind(a)).attr("width",a.getXAxisClipWidth.bind(a)).attr("height",a.getXAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",a.getYAxisClipX.bind(a)).attr("y",a.getYAxisClipY.bind(a)).attr("width",a.getYAxisClipWidth.bind(a)).attr("height",a.getYAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForSubchart).select("rect").attr("width",a.width).attr("height",b.size()?b.attr("height"):0),a.svg.select("."+i.zoomRect).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},f.updateDimension=function(a){var b=this;a||(b.config.axis_rotated?(b.axes.x.call(b.xAxis),b.axes.subx.call(b.subXAxis)):(b.axes.y.call(b.yAxis),b.axes.y2.call(b.y2Axis))),b.updateSizes(),b.updateScales(),b.updateSvgSize(),b.transformAll(!1)},f.observeInserted=function(b){var c=this,d=new MutationObserver(function(e){e.forEach(function(e){"childList"===e.type&&e.previousSibling&&(d.disconnect(),c.intervalForObserveInserted=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(c.intervalForObserveInserted),c.updateDimension(),c.config.oninit.call(c),c.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10))})});d.observe(b.node(),{attributes:!0,childList:!0,characterData:!0})},f.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a},f.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},f.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},f.parseDate=function(b){var c,d=this;return c=b instanceof Date?b:"number"!=typeof b&&isNaN(b)?d.dataTimeFormat(d.config.data_xFormat).parse(b):new Date(+b),(!c||isNaN(+c))&&a.console.error("Failed to parse x '"+b+"' to Date object"),c},f.getDefaultConfig=function(){var a={bindto:"#chart",size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(a){return a},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_ondragstart:function(){},data_ondragend:function(){},data_url:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_expand:!0,gauge_label_show:!0,gauge_label_format:void 0,gauge_expand:!0,gauge_min:0,gauge_max:100,gauge_units:void 0,gauge_width:void 0,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_width:void 0,donut_expand:!0,donut_title:"",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_contents:function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,b,c,d):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"}};return Object.keys(this.additionalConfig).forEach(function(b){a[b]=this.additionalConfig[b]},this),a},f.additionalConfig={},f.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&"object"==typeof c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),n(e)&&(f[g]=e)})},f.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},f.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},f.getY=function(a,b,c){var d=this.getScale(a,b,this.isTimeSeriesY());return c&&d.domain(c),d},f.getYScale=function(a){return"y2"===this.getAxisId(a)?this.y2:this.y},f.getSubYScale=function(a){return"y2"===this.getAxisId(a)?this.subY2:this.subY},f.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b.axis_rotated?1:0,a.xMax=b.axis_rotated?a.height:a.width,a.yMin=b.axis_rotated?0:a.height,a.yMax=b.axis_rotated?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b.axis_rotated?0:a.height2,a.subYMax=b.axis_rotated?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?b.axis_y_default:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?b.axis_y2_default:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?b.axis_y_default:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?b.axis_y2_default:a.subY2.domain()),a.xAxisTickFormat=a.getXAxisTickFormat(),a.xAxisTickValues=a.getXAxisTickValues(),a.yAxisTickValues=a.getYAxisTickValues(),a.y2AxisTickValues=a.getY2AxisTickValues(),a.xAxis=a.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.subXAxis=a.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.yAxis=a.getYAxis(a.y,a.yOrient,b.axis_y_tick_format,a.yAxisTickValues,b.axis_y_tick_outer),a.y2Axis=a.getYAxis(a.y2,a.y2Orient,b.axis_y2_tick_format,a.y2AxisTickValues,b.axis_y2_tick_outer),c||(a.brush&&a.brush.scale(a.subX),b.zoom_enabled&&a.zoom.scale(a.x)),a.updateArc&&a.updateArc()},f.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.getAxisId(f)!==h.getAxisId(d)||!k[d]||g&&+a>0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},f.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.getAxisId(f)!==h.getAxisId(d)||!k[d]||g&&0>+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},f.getYDomain=function(a,b,c){var d,e,f,g,h,i,k,l,m,n,o=this,p=o.config,r=a.filter(function(a){return o.getAxisId(a.id)===b}),t=c?o.filterByXDomain(r,c):r,u="y2"===b?p.axis_y2_min:p.axis_y_min,v="y2"===b?p.axis_y2_max:p.axis_y_max,w=j(u)?u:o.getYDomainMin(t),x=j(v)?v:o.getYDomainMax(t),y="y2"===b?p.axis_y2_center:p.axis_y_center,z=o.hasType("bar",t)&&p.bar_zerobased||o.hasType("area",t)&&p.area_zerobased,A=o.hasDataLabel()&&p.axis_rotated,B=o.hasDataLabel()&&!p.axis_rotated;return w>x&&(j(u)?x=w+10:w=x-10),0===t.length?"y2"===b?o.y2.domain():o.y.domain():(isNaN(w)&&(w=0),isNaN(x)&&(x=w),w===x&&(0>w?x=0:w=0),m=w>=0&&x>=0,n=0>=w&&0>=x,(j(u)&&m||j(v)&&n)&&(z=!1),z&&(m&&(w=0),n&&(x=0)),d=Math.abs(x-w),e=f=g=.1*d,"undefined"!=typeof y&&(h=Math.max(Math.abs(w),Math.abs(x)),x=y+h,w=y-h),A?(i=o.getDataLabelLength(w,x,b,"width"),k=q(o.y.range()),l=[i[0]/k,i[1]/k],f+=d*(l[1]/(1-l[0]-l[1])),g+=d*(l[0]/(1-l[0]-l[1]))):B&&(i=o.getDataLabelLength(w,x,b,"height"),f+=this.convertPixelsToAxisPadding(i[1],d),g+=this.convertPixelsToAxisPadding(i[0],d)),"y"===b&&s(p.axis_y_padding)&&(f=o.getAxisPadding(p.axis_y_padding,"top",f,d),g=o.getAxisPadding(p.axis_y_padding,"bottom",g,d)),"y2"===b&&s(p.axis_y2_padding)&&(f=o.getAxisPadding(p.axis_y2_padding,"top",f,d),g=o.getAxisPadding(p.axis_y2_padding,"bottom",g,d)),z&&(m&&(g=w),n&&(f=-x)),[w-g,x+f])},f.getXDomainMin=function(a){var b=this,c=b.config;return n(c.axis_x_min)?b.isTimeSeries()?this.parseDate(c.axis_x_min):c.axis_x_min:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},f.getXDomainMax=function(a){var b=this,c=b.config;return n(c.axis_x_max)?b.isTimeSeries()?this.parseDate(c.axis_x_max):c.axis_x_max:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},f.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=a[1]-a[0];return f.isCategorized()?c=0:f.hasType("bar")?(b=f.getMaxDataCount(),c=b>1?h/(b-1)/2:.5):c=.01*h,"object"==typeof g.axis_x_padding&&s(g.axis_x_padding)?(d=j(g.axis_x_padding.left)?g.axis_x_padding.left:c,e=j(g.axis_x_padding.right)?g.axis_x_padding.right:c):d=e="number"==typeof g.axis_x_padding?g.axis_x_padding:c,{left:d,right:e}},f.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(c),g=0,h=0;return d-e!==0||b.isCategorized()||(b.isTimeSeries()?(d=new Date(.5*d.getTime()),e=new Date(1.5*e.getTime())):(d=0===d?1:.5*d,e=0===e?-1:1.5*e)),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]},f.updateXDomain=function(a,b,c,d,e){var f=this,g=f.config;return c&&(f.x.domain(e?e:f.d3.extent(f.getXDomain(a))),f.orgXDomain=f.x.domain(),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent(),f.subX.domain(f.x.domain()),f.brush&&f.brush.scale(f.subX)),b&&(f.x.domain(e?e:!f.brush||f.brush.empty()?f.orgXDomain:f.brush.extent()),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent()),d&&f.x.domain(f.trimXDomain(f.x.orgDomain())),f.x.domain()},f.trimXDomain=function(a){var b=this;return a[0]<=b.orgXDomain[0]&&(a[1]=+a[1]+(b.orgXDomain[0]-a[0]),a[0]=b.orgXDomain[0]),b.orgXDomain[1]<=a[1]&&(a[0]=+a[0]-(a[1]-b.orgXDomain[1]),a[1]=b.orgXDomain[1]),a},f.isX=function(a){var b=this,c=b.config;return c.data_x&&a===c.data_x||s(c.data_xs)&&u(c.data_xs,a)},f.isNotX=function(a){return!this.isX(a)},f.getXKey=function(a){var b=this,c=b.config;return c.data_x?c.data_x:s(c.data_xs)?c.data_xs[a]:null},f.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&s(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},f.getIndexByX=function(a){var b=this,c=b.filterByX(b.data.targets,a);return c.length?c[0].index:null},f.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&j(c.data.xs[a][b])?c.data.xs[a][b]:b
2
- },f.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},f.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a<b.length?b[a]:null},f.addXs=function(a){var b=this;Object.keys(a).forEach(function(c){b.config.data_xs[c]=a[c]})},f.hasMultipleX=function(a){return this.d3.set(Object.keys(a).map(function(b){return a[b]})).size()>1},f.isMultipleX=function(){return s(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},f.addName=function(a){var b,c=this;return a&&(b=c.config.data_names[a.id],a.name=b?b:a.id),a},f.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},f.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},f.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},f.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?e.parseDate(a?a:e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?j(a)?+a:e.getXValue(b,c):c},f.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},f.updateXs=function(){var a=this;a.data.targets.length&&(a.xs=[],a.data.targets[0].values.forEach(function(b){a.xs[b.index]=b.x}))},f.getPrevX=function(a){var b=this.xs[a-1];return"undefined"!=typeof b?b:null},f.getNextX=function(a){var b=this.xs[a+1];return"undefined"!=typeof b?b:null},f.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},f.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},f.getEdgeX=function(a){var b=this;return a.length?[b.d3.min(a,function(a){return a.values[0].x}),b.d3.max(a,function(a){return a.values[a.values.length-1].x})]:[0,0]},f.mapToIds=function(a){return a.map(function(a){return a.id})},f.mapToTargetIds=function(a){var b=this;return a?l(a)?[a]:a:b.mapToIds(b.data.targets)},f.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1},f.isTargetToShow=function(a){return this.hiddenTargetIds.indexOf(a)<0},f.isLegendToShow=function(a){return this.hiddenLegendIds.indexOf(a)<0},f.filterTargetsToShow=function(a){var b=this;return a.filter(function(a){return b.isTargetToShow(a.id)})},f.mapTargetsToUniqueXs=function(a){var b=this,c=b.d3.set(b.d3.merge(a.map(function(a){return a.values.map(function(a){return+a.x})}))).values();return c.map(b.isTimeSeries()?function(a){return new Date(+a)}:function(a){return+a})},f.addHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.concat(a)},f.removeHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(b){return a.indexOf(b)<0})},f.addHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.concat(a)},f.removeHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(b){return a.indexOf(b)<0})},f.getValuesAsIdKeyed=function(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b},f.checkValueInTargets=function(a,b){var c,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1},f.hasNegativeValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return 0>a})},f.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},f.isOrderDesc=function(){var a=this.config;return"string"==typeof a.data_order&&"desc"===a.data_order.toLowerCase()},f.isOrderAsc=function(){var a=this.config;return"string"==typeof a.data_order&&"asc"===a.data_order.toLowerCase()},f.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):k(c.data_order)&&a.sort(c.data_order),a},f.filterByX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},f.filterRemoveNull=function(a){return a.filter(function(a){return j(a.value)})},f.filterByXDomain=function(a,b){return a.map(function(a){return{id:a.id,id_org:a.id_org,values:a.values.filter(function(a){return b[0]<=a.x&&a.x<=b[1]})}})},f.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a.data_labels&&a.data_labels?!0:"object"==typeof a.data_labels&&s(a.data_labels)?!0:!1},f.getDataLabelLength=function(a,b,c,d){var e=this,f=[0,0],g=1.3;return e.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return e.formatByAxisId(c)(a)}).each(function(a,b){f[b]=this.getBoundingClientRect()[d]*g}).remove(),f},f.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},f.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},f.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);return e},f.findClosestFromTargets=function(a,b){var c,d=this;return c=a.map(function(a){return d.findClosest(a.values,b)}),d.findClosest(c,b)},f.findClosest=function(a,b){var c,d=this,e=100;return a.filter(function(a){return a&&d.isBarType(a.id)}).forEach(function(a){var b=d.main.select("."+i.bars+d.getTargetSelectorSuffix(a.id)+" ."+i.bar+"-"+a.index).node();!c&&d.isWithinBar(b)&&(c=a)}),a.filter(function(a){return a&&!d.isBarType(a.id)}).forEach(function(a){var f=d.dist(a,b);e>f&&(e=f,c=a)}),c},f.dist=function(a,b){var c=this,d=c.config,e=d.axis_rotated?1:0,f=d.axis_rotated?0:1,g=c.circleY(a,a.index),h=c.x(a.x);return Math.pow(h-b[e],2)+Math.pow(g-b[f],2)},f.convertValuesToStep=function(a){var b,c=[].concat(a);if(!this.isCategorized())return a;for(b=a.length+1;b>0;b--)c[b]=c[b-1];return c[0]={x:c[0].x-1,value:c[0].value,id:c[0].id},c[a.length+1]={x:c[a.length].x+1,value:c[a.length].value,id:c[a.length].id},c},f.updateDataAttributes=function(a,b){var c=this,d=c.config,e=d["data_"+a];return"undefined"==typeof b?e:(Object.keys(b).forEach(function(a){e[a]=b[a]}),c.redraw({withLegend:!0}),e)},f.convertUrlToData=function(a,b,c,d){var e=this,f=b?b:"csv";e.d3.xhr(a,function(a,b){var g;g="json"===f?e.convertJsonToData(JSON.parse(b.response),c):"tsv"===f?e.convertTsvToData(b.response):e.convertCsvToData(b.response),d.call(e,g)})},f.convertXsvToData=function(a,b){var c,d=b.parseRows(a);return 1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=b.parse(a),c},f.convertCsvToData=function(a){return this.convertXsvToData(a,this.d3.csv)},f.convertTsvToData=function(a){return this.convertXsvToData(a,this.d3.tsv)},f.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(c=b.value,b.x&&(c.push(b.x),e.config.data_x=b.x),f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=m(a[c])?null:a[c];b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},f.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++){if(m(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[d[c]]=a[b][c]}f.push(e)}return f},f.convertColumnsToData=function(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(d=a[b][0],c=1;c<a[b].length;c++){if(m(e[c-1])&&(e[c-1]={}),m(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[c-1][d]=a[b][c]}return e},f.convertDataToTargets=function(a,b){var c,d=this,e=d.config,f=d.d3.keys(a[0]).filter(d.isNotX,d),g=d.d3.keys(a[0]).filter(d.isX,d);return f.forEach(function(c){var f=d.getXKey(c);d.isCustomX()||d.isTimeSeries()?g.indexOf(f)>=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(j).map(function(a,b){return d.generateTargetX(a,c,b)})):e.data_x?d.data.xs[c]=d.getOtherTargetXs():s(e.data_xs)&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e.data_idConverter(b);return{id:f,id_org:b,values:a.map(function(a,g){var h=d.getXKey(b),i=a[h],j=d.generateTargetX(i,b,g);return d.isCustomX()&&d.isCategorized()&&0===c&&i&&(0===g&&(e.axis_x_categories=[]),e.axis_x_categories.push(i)),(m(a[b])||d.data.xs[b].length<=g)&&(j=void 0),{x:j,value:null===a[b]||isNaN(a[b])?null:+a[b],id:f}}).filter(function(a){return n(a.x)})}}),c.forEach(function(a){var b;e.data_xSort&&(a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d})),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),e.data_type&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e.data_types)}),e.data_type),c.forEach(function(a){d.addCache(a.id_org,a)}),c},f.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){c.setTargetType(a.id,b.types?b.types[a.id]:b.type)}),c.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),c.data.targets=c.data.targets.concat(a)),c.updateTargets(c.data.targets),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),b.done&&b.done()},f.loadFromArgs=function(a){var b=this;a.data?b.load(b.convertDataToTargets(a.data),a):a.url?b.convertUrlToData(a.url,a.mimeType,a.keys,function(c){b.load(b.convertDataToTargets(c),a)}):a.json?b.load(b.convertDataToTargets(b.convertJsonToData(a.json,a.keys)),a):a.rows?b.load(b.convertDataToTargets(b.convertRowsToData(a.rows)),a):a.columns?b.load(b.convertDataToTargets(b.convertColumnsToData(a.columns)),a):b.load(null,a)},f.unload=function(a,b){var c=this;return b||(b=function(){}),a=a.filter(function(a){return c.hasTarget(c.data.targets,a)}),a&&0!==a.length?(c.svg.selectAll(a.map(function(a){return c.selectorTarget(a)})).transition().style("opacity",0).remove().call(c.endall,b),void a.forEach(function(a){c.withoutFadeIn[a]=!1,c.legend&&c.legend.selectAll("."+i.legendItem+c.getTargetSelectorSuffix(a)).remove(),c.data.targets=c.data.targets.filter(function(b){return b.id!==a})})):void b()},f.categoryName=function(a){var b=this.config;return a<b.axis_x_categories.length?b.axis_x_categories[a]:a},f.initEventRect=function(){var a=this;a.main.select("."+i.chart).append("g").attr("class",i.eventRects).style("fill-opacity",0)},f.redrawEventRect=function(){var a,b,c=this,d=c.config,e=c.isMultipleX(),f=c.main.select("."+i.eventRects).style("cursor",d.zoom_enabled?d.axis_rotated?"ns-resize":"ew-resize":null).classed(i.eventRectsMultiple,e).classed(i.eventRectsSingle,!e);f.selectAll("."+i.eventRect).remove(),c.eventRect=f.selectAll("."+i.eventRect),e?(a=c.eventRect.data([0]),c.generateEventRectsForMultipleXs(a.enter()),c.updateEventRect(a)):(b=c.getMaxDataCountTarget(c.data.targets),f.datum(b?b.values:[]),c.eventRect=f.selectAll("."+i.eventRect),a=c.eventRect.data(function(a){return a}),c.generateEventRectsForSingleX(a.enter()),c.updateEventRect(a),a.exit().remove())},f.updateEventRect=function(a){var b,c,d,e,f,g,h=this,i=h.config;a=a||h.eventRect.data(function(a){return a}),h.isMultipleX()?(b=0,c=0,d=h.width,e=h.height):(!h.isCustomX()&&!h.isTimeSeries()||h.isCategorized()?(f=h.getEventRectWidth(),g=function(a){return h.x(a.x)-f/2}):(h.updateXs(),f=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index);return null===b&&null===c?i.axis_rotated?h.height:h.width:(null===b&&(b=h.x.domain()[0]),null===c&&(c=h.x.domain()[1]),Math.max(0,(h.x(c)-h.x(b))/2))},g=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index),d=h.data.xs[a.id][a.index];return null===b&&null===c?0:(null===b&&(b=h.x.domain()[0]),(h.x(d)+h.x(b))/2)}),b=i.axis_rotated?0:g,c=i.axis_rotated?g:0,d=i.axis_rotated?h.width:f,e=i.axis_rotated?f:h.height),a.attr("class",h.classEvent.bind(h)).attr("x",b).attr("y",c).attr("width",d).attr("height",e)},f.generateEventRectsForSingleX=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("class",b.classEvent.bind(b)).style("cursor",d.data_selection_enabled&&d.data_selection_grouped?"pointer":null).on("mouseover",function(a){var c,e,f=a.index;b.dragging||b.flowing||b.hasArcType()||(c=b.data.targets.map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),e=[],Object.keys(d.data_names).forEach(function(a){for(var b=0;b<c.length;b++)if(c[b]&&c[b].id===a){e.push(c[b]),c.shift(b);break}}),c=e.concat(c),d.point_focus_expand_enabled&&b.expandCircles(f,null,!0),b.expandBars(f,null,!0),b.main.selectAll("."+i.shape+"-"+f).each(function(a){d.data_onmouseover.call(b.api,a)}))}).on("mouseout",function(a){var c=a.index;b.hasArcType()||(b.hideXGridFocus(),b.hideTooltip(),b.unexpandCircles(),b.unexpandBars(),b.main.selectAll("."+i.shape+"-"+c).each(function(a){d.data_onmouseout.call(b.api,a)}))}).on("mousemove",function(a){var e,f=a.index,g=b.svg.select("."+i.eventRect+"-"+f);b.dragging||b.flowing||b.hasArcType()||(b.isStepType(a)&&"step-after"===b.config.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,f))&&(f-=1),e=b.filterTargetsToShow(b.data.targets).map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),d.tooltip_grouped&&(b.showTooltip(e,c.mouse(this)),b.showXGridFocus(e)),(!d.tooltip_grouped||d.data_selection_enabled&&!d.data_selection_grouped)&&b.main.selectAll("."+i.shape+"-"+f).each(function(){c.select(this).classed(i.EXPANDED,!0),d.data_selection_enabled&&g.style("cursor",d.data_selection_grouped?"pointer":null),d.tooltip_grouped||(b.hideXGridFocus(),b.hideTooltip(),d.data_selection_grouped||(b.unexpandCircles(f),b.unexpandBars(f)))}).filter(function(a){return b.isWithinShape(this,a)}).each(function(a){d.data_selection_enabled&&(d.data_selection_grouped||d.data_selection_isselectable(a))&&g.style("cursor","pointer"),d.tooltip_grouped||(b.showTooltip([a],c.mouse(this)),b.showXGridFocus([a]),d.point_focus_expand_enabled&&b.expandCircles(f,a.id,!0),b.expandBars(f,a.id,!0))}))}).on("click",function(a){var e=a.index;if(!b.hasArcType()&&b.toggleShape){if(b.cancelClick)return void(b.cancelClick=!1);b.isStepType(a)&&"step-after"===d.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,e))&&(e-=1),b.main.selectAll("."+i.shape+"-"+e).each(function(a){(d.data_selection_grouped||b.isWithinShape(this,a))&&(b.toggleShape(this,a,e),b.config.data_onclick.call(b.api,a,this))})}}).call(c.behavior.drag().origin(Object).on("drag",function(){b.drag(c.mouse(this))}).on("dragstart",function(){b.dragstart(c.mouse(this))}).on("dragend",function(){b.dragend()}))},f.generateEventRectsForMultipleXs=function(a){function b(){c.svg.select("."+i.eventRect).style("cursor",null),c.hideXGridFocus(),c.hideTooltip(),c.unexpandCircles(),c.unexpandBars()}var c=this,d=c.d3,e=c.config;a.append("rect").attr("x",0).attr("y",0).attr("width",c.width).attr("height",c.height).attr("class",i.eventRect).on("mouseout",function(){c.hasArcType()||b()}).on("mousemove",function(){var a,f,g,h,j=c.filterTargetsToShow(c.data.targets);if(!c.dragging&&!c.hasArcType(j)){if(a=d.mouse(this),f=c.findClosestFromTargets(j,a),!c.mouseover||f&&f.id===c.mouseover.id||(e.data_onmouseout.call(c.api,c.mouseover),c.mouseover=void 0),!f)return void b();g=c.isScatterType(f)||!e.tooltip_grouped?[f]:c.filterByX(j,f.x),h=g.map(function(a){return c.addName(a)}),c.showTooltip(h,a),e.point_focus_expand_enabled&&c.expandCircles(f.index,f.id,!0),c.expandBars(f.index,f.id,!0),c.showXGridFocus(h),(c.isBarType(f.id)||c.dist(f,a)<100)&&(c.svg.select("."+i.eventRect).style("cursor","pointer"),c.mouseover||(e.data_onmouseover.call(c.api,f),c.mouseover=f))}}).on("click",function(){var a,b,f=c.filterTargetsToShow(c.data.targets);c.hasArcType(f)||(a=d.mouse(this),b=c.findClosestFromTargets(f,a),b&&(c.isBarType(b.id)||c.dist(b,a)<100)&&c.main.selectAll("."+i.shapes+c.getTargetSelectorSuffix(b.id)).select("."+i.shape+"-"+b.index).each(function(){(e.data_selection_grouped||c.isWithinShape(this,b))&&(c.toggleShape(this,b,b.index),c.config.data_onclick.call(c.api,b,this))}))}).call(d.behavior.drag().origin(Object).on("drag",function(){c.drag(d.mouse(this))}).on("dragstart",function(){c.dragstart(d.mouse(this))}).on("dragend",function(){c.dragend()}))},f.dispatchEvent=function(b,c,d){var e=this,f="."+i.eventRect+(e.isMultipleX()?"":"-"+c),g=e.main.select(f).node(),h=g.getBoundingClientRect(),j=h.left+(d?d[0]:0),k=h.top+(d?d[1]:0),l=document.createEvent("MouseEvents");l.initMouseEvent(b,!0,!0,a,0,j,k,j,k,!1,!1,!1,!1,0,null),g.dispatchEvent(l)},f.getCurrentWidth=function(){var a=this,b=a.config;return b.size_width?b.size_width:a.getParentWidth()},f.getCurrentHeight=function(){var a=this,b=a.config,c=b.size_height?b.size_height:a.getParentHeight();return c>0?c:320/(a.hasType("gauge")?2:1)},f.getCurrentPaddingTop=function(){var a=this.config;return j(a.padding_top)?a.padding_top:0},f.getCurrentPaddingBottom=function(){var a=this.config;return j(a.padding_bottom)?a.padding_bottom:0},f.getCurrentPaddingLeft=function(a){var b=this,c=b.config;return j(c.padding_left)?c.padding_left:c.axis_rotated?c.axis_x_show?Math.max(o(b.getAxisWidthByAxisId("x",a)),40):1:!c.axis_y_show||c.axis_y_inner?b.getYAxisLabelPosition().isOuter?30:1:o(b.getAxisWidthByAxisId("y",a))},f.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return j(b.padding_right)?b.padding_right+1:b.axis_rotated?c+d:!b.axis_y2_show||b.axis_y2_inner?2+d+(a.getY2AxisLabelPosition().isOuter?20:0):o(a.getAxisWidthByAxisId("y2"))+d},f.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b},f.getParentWidth=function(){return this.getParentRectValue("width")},f.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},f.getSvgLeft=function(a){var b=this,c=b.config,d=c.axis_rotated||!c.axis_rotated&&!c.axis_y_inner,e=c.axis_rotated?i.axisX:i.axisY,f=b.main.select("."+e).node(),g=f&&d?f.getBoundingClientRect():{right:0},h=b.selectChart.node().getBoundingClientRect(),j=b.hasArcType(),k=g.right-h.left-(j?0:b.getCurrentPaddingLeft(a));return k>0?k:0},f.getAxisWidthByAxisId=function(a,b){var c=this,d=c.getAxisLabelPositionById(a);return c.getMaxTickWidth(a,b)+(d.isInner?20:40)},f.getHorizontalAxisHeight=function(a){var b=this,c=b.config,d=30;return"x"!==a||c.axis_x_show?"x"===a&&c.axis_x_height?c.axis_x_height:"y"!==a||c.axis_y_show?"y2"!==a||c.axis_y2_show?("x"===a&&!c.axis_rotated&&c.axis_x_tick_rotate&&(d=b.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_x_tick_rotate)/180)),d+(b.getAxisLabelPositionById(a).isInner?0:10)+("y2"===a?-10:0)):b.rotated_padding_top:!c.legend_show||b.isLegendRight||b.isLegendInset?1:10:8},f.getEventRectWidth=function(){var a,b,c,d,e,f,g=this,h=g.getMaxDataCountTarget(g.data.targets);return h?(a=h.values[0],b=h.values[h.values.length-1],c=g.x(b.x)-g.x(a.x),0===c?g.config.axis_rotated?g.height:g.width:(d=g.getMaxDataCount(),e=g.hasType("bar")?(d-(g.isCategorized()?.25:1))/d:1,f=d>1?c*e/(d-1):c,1>f?1:f)):0},f.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b<e.data_groups.length;b++)if(!(e.data_groups[b].indexOf(a.id)<0))for(c=0;c<e.data_groups[b].length;c++)if(e.data_groups[b][c]in f){f[a.id]=f[e.data_groups[b][c]];break}m(f[a.id])&&(f[a.id]=g++)}),f.__max__=g-1,f},f.getShapeX=function(a,b,c,d){var e=this,f=d?e.subX:e.x;return function(d){var e=d.id in c?c[d.id]:0;return d.x||0===d.x?f(d.x)-a*(b/2-e):0}},f.getShapeY=function(a){var b=this;return function(c){var d=a?b.getSubYScale(c.id):b.getYScale(c.id);return d(c.value)}},f.getShapeOffset=function(a,b,c){var d=this,e=d.orderTargets(d.filterTargetsToShow(d.data.targets.filter(a,d))),f=e.map(function(a){return a.id});return function(a,g){var h=c?d.getSubYScale(a.id):d.getYScale(a.id),i=h(0),j=i;return e.forEach(function(c){var e=d.isStepType(a)?d.convertValuesToStep(c.values):c.values;c.id!==a.id&&b[c.id]===b[a.id]&&f.indexOf(c.id)<f.indexOf(a.id)&&e[g].value*a.value>=0&&(j+=h(e[g].value)-i)}),j}},f.isWithinShape=function(a,b){var c,d=this,e=d.d3.select(a);return d.isTargetToShow(b.id)?"circle"===a.nodeName?c=d.isStepType(b)?d.isWithinStep(a,d.getYScale(b.id)(b.value)):d.isWithinCircle(a,1.5*d.pointSelectR(b)):"path"===a.nodeName&&(c=e.classed(i.bar)?d.isWithinBar(a):!0):c=!1,c},f.getInterpolate=function(a){var b=this;return b.isSplineType(a)?"cardinal":b.isStepType(a)?b.config.line_step_type:"linear"},f.initLine=function(){var a=this;a.main.select("."+i.chart).append("g").attr("class",i.chartLines)},f.updateTargetsForLine=function(a){var b,c,d=this,e=d.config,f=d.classChartLine.bind(d),g=d.classLines.bind(d),h=d.classAreas.bind(d),j=d.classCircles.bind(d),k=d.classFocus.bind(d);b=d.main.select("."+i.chartLines).selectAll("."+i.chartLine).data(a).attr("class",function(a){return f(a)+k(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g),c.append("g").attr("class",h),c.append("g").attr("class",function(a){return d.generateClass(i.selectedCircles,a.id)}),c.append("g").attr("class",j).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null}),a.forEach(function(a){d.main.selectAll("."+i.selectedCircles+d.getTargetSelectorSuffix(a.id)).selectAll("."+i.selectedCircle).each(function(b){b.value=a.values[b.index].value})})},f.redrawLine=function(a){var b=this;b.mainLine=b.main.selectAll("."+i.lines).selectAll("."+i.line).data(b.lineData.bind(b)),b.mainLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.mainLine.style("opacity",b.initialOpacity.bind(b)).style("shape-rendering",function(a){return b.isStepType(a)?"crispEdges":""}).attr("transform",null),b.mainLine.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForLine=function(a,b){var c=this;a.push(c.mainLine.transition().attr("d",b).style("stroke",c.color).style("opacity",1))},f.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x(i).y(h):e.x(h).y(i),d.line_connectNull||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d.line_connectNull?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?d.data_regions[a.id]?f=c.lineWithRegions(h,i,j,d.data_regions[a.id]):(c.isStepType(a)&&(h=c.convertValuesToStep(h)),f=e.interpolate(c.getInterpolate(a))(h)):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d.axis_rotated?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},f.generateGetLinePoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)]]}},f.lineWithRegions=function(a,b,c,d){function e(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}var f,g,h,i,j,k,l,o,p,q,r,s,t=this,u=t.config,v=-1,w="M",x=[];if(n(d))for(f=0;f<d.length;f++)x[f]={},x[f].start=m(d[f].start)?a[0].x:t.isTimeSeries()?t.parseDate(d[f].start):d[f].start,x[f].end=m(d[f].end)?a[a.length-1].x:t.isTimeSeries()?t.parseDate(d[f].end):d[f].end;for(r=u.axis_rotated?function(a){return c(a.value)}:function(a){return b(a.x)},s=u.axis_rotated?function(a){return b(a.x)}:function(a){return c(a.value)},h=t.isTimeSeries()?function(a,d,e,f){var g=a.x.getTime(),h=d.x-a.x,i=new Date(g+h*e),k=new Date(g+h*(e+f));return"M"+b(i)+" "+c(j(e))+" "+b(k)+" "+c(j(e+f))}:function(a,d,e,f){return"M"+b(i(e),!0)+" "+c(j(e))+" "+b(i(e+f),!0)+" "+c(j(e+f))},f=0;f<a.length;f++){if(m(x)||!e(a[f].x,x))w+=" "+r(a[f])+" "+s(a[f]);else for(i=t.getScale(a[f-1].x,a[f].x,t.isTimeSeries()),j=t.getScale(a[f-1].value,a[f].value),k=b(a[f].x)-b(a[f-1].x),l=c(a[f].value)-c(a[f-1].value),o=Math.sqrt(Math.pow(k,2)+Math.pow(l,2)),p=2/o,q=2*p,g=p;1>=g;g+=q)w+=h(a[f-1],a[f],g,p);v=a[f].x}return w},f.redrawArea=function(a){var b=this,c=b.d3;b.mainArea=b.main.selectAll("."+i.areas).selectAll("."+i.area).data(b.lineData.bind(b)),b.mainArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.mainArea.style("opacity",b.orgAreaOpacity),b.mainArea.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForArea=function(a,b){var c=this;a.push(c.mainArea.transition().attr("d",b).style("fill",c.color).style("opacity",c.orgAreaOpacity))},f.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(0)},j=function(a,b){return d.data_groups.length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x0(i).x1(j).y(h):e.x(h).y0(i).y1(j),d.line_connectNull||(e=e.defined(function(a){return null!==a.value})),function(a){var b,f=d.line_connectNull?c.filterRemoveNull(a.values):a.values,g=0,h=0;return c.isAreaType(a)?(c.isStepType(a)&&(f=c.convertValuesToStep(f)),b=e.interpolate(c.getInterpolate(a))(f)):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d.axis_rotated?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},f.generateGetAreaPoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)],[k,l-(e-j)],[k,j]]}},f.redrawCircle=function(){var a=this;a.mainCircle=a.main.selectAll("."+i.circles).selectAll("."+i.circle).data(a.lineOrScatterData.bind(a)),a.mainCircle.enter().append("circle").attr("class",a.classCircle.bind(a)).attr("r",a.pointR.bind(a)).style("fill",a.color),a.mainCircle.style("opacity",a.initialOpacityForCircle.bind(a)),a.mainCircle.exit().remove()},f.addTransitionForCircle=function(a,b,c){var d=this;a.push(d.mainCircle.transition().style("opacity",d.opacityForCircle.bind(d)).style("fill",d.color).attr("cx",b).attr("cy",c)),a.push(d.main.selectAll("."+i.selectedCircle).transition().attr("cx",b).attr("cy",c))},f.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},f.updateCircleY=function(){var a,b,c=this;c.config.data_groups.length>0?(a=c.getShapeIndices(c.isLineType),b=c.generateGetLinePoints(a),c.circleY=function(a,c){return b(a,c)[0][1]}):c.circleY=function(a){return c.getYScale(a.id)(a.value)}},f.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+i.circles+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+i.circle+(j(a)?"-"+a:""))},f.expandCircles=function(a,b,c){var d=this,e=d.pointExpandedR.bind(d);c&&d.unexpandCircles(),d.getCircles(a,b).classed(i.EXPANDED,!0).attr("r",e)},f.unexpandCircles=function(a){var b=this,c=b.pointR.bind(b);b.getCircles(a).filter(function(){return b.d3.select(this).classed(i.EXPANDED)}).classed(i.EXPANDED,!1).attr("r",c)},f.pointR=function(a){var b=this,c=b.config;return b.isStepType(a)?0:k(c.point_r)?c.point_r(a):c.point_r},f.pointExpandedR=function(a){var b=this,c=b.config;return c.point_focus_expand_enabled?c.point_focus_expand_r?c.point_focus_expand_r:1.75*b.pointR(a):b.pointR(a)},f.pointSelectR=function(a){var b=this,c=b.config;return c.point_select_r?c.point_select_r:4*b.pointR(a)},f.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=+e.attr("cx"),g=+e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))<b},f.isWithinStep=function(a,b){return Math.abs(b-this.d3.mouse(a)[1])<30},f.initBar=function(){var a=this;a.main.select("."+i.chart).append("g").attr("class",i.chartBars)},f.updateTargetsForBar=function(a){var b,c,d=this,e=d.config,f=d.classChartBar.bind(d),g=d.classBars.bind(d),h=d.classFocus.bind(d);b=d.main.select("."+i.chartBars).selectAll("."+i.chartBar).data(a).attr("class",function(a){return f(a)+h(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null})},f.redrawBar=function(a){var b=this,c=b.barData.bind(b),d=b.classBar.bind(b),e=b.initialOpacity.bind(b),f=function(a){return b.color(a.id)};b.mainBar=b.main.selectAll("."+i.bars).selectAll("."+i.bar).data(c),b.mainBar.enter().append("path").attr("class",d).style("stroke",f).style("fill",f),b.mainBar.style("opacity",e),b.mainBar.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForBar=function(a,b){var c=this;a.push(c.mainBar.transition().attr("d",b).style("fill",c.color).style("opacity",1))},f.getBarW=function(a,b){var c=this,d=c.config,e="number"==typeof d.bar_width?d.bar_width:b?2*a.tickOffset()*d.bar_width_ratio/b:0;return d.bar_width_max&&e>d.bar_width_max?d.bar_width_max:e},f.getBars=function(a,b){var c=this;return(b?c.main.selectAll("."+i.bars+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+i.bar+(j(a)?"-"+a:""))},f.expandBars=function(a,b,c){var d=this;c&&d.unexpandBars(),d.getBars(a,b).classed(i.EXPANDED,!0)},f.unexpandBars=function(a){var b=this;b.getBars(a).classed(i.EXPANDED,!1)},f.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d.axis_rotated?1:0,g=d.axis_rotated?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},f.generateGetBarPoints=function(a,b){var c=this,d=b?c.subXAxis:c.xAxis,e=a.__max__+1,f=c.getBarW(d,e),g=c.getShapeX(f,e,a,!!b),h=c.getShapeY(!!b),i=c.getShapeOffset(c.isBarType,a,!!b),j=b?c.getSubYScale:c.getYScale;return function(a,b){var d=j.call(c,a.id)(0),e=i(a,b)||d,k=g(a),l=h(a);return c.config.axis_rotated&&(0<a.value&&d>l||a.value<0&&l>d)&&(l=d),[[k,e],[k,l-(d-e)],[k+f,l-(d-e)],[k+f,e]]}},f.isWithinBar=function(a){var b=this.d3.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=Math.min(d.x,e.x),g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;return k<b[0]&&b[0]<l&&n<b[1]&&b[1]<m},f.initText=function(){var a=this;a.main.select("."+i.chart).append("g").attr("class",i.chartTexts),a.mainText=a.d3.selectAll([])},f.updateTargetsForText=function(a){var b,c,d=this,e=d.classChartText.bind(d),f=d.classTexts.bind(d),g=d.classFocus.bind(d);b=d.main.select("."+i.chartTexts).selectAll("."+i.chartText).data(a).attr("class",function(a){return e(a)+g(a)}),c=b.enter().append("g").attr("class",e).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",f)},f.redrawText=function(a){var b=this,c=b.config,d=b.barOrLineData.bind(b),e=b.classText.bind(b);b.mainText=b.main.selectAll("."+i.texts).selectAll("."+i.text).data(d),b.mainText.enter().append("text").attr("class",e).attr("text-anchor",function(a){return c.axis_rotated?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(a){return b.color(a)}).style("fill-opacity",0),b.mainText.text(function(a,c,d){return b.formatByAxisId(b.getAxisId(a.id))(a.value,a.id,c,d)}),b.mainText.exit().transition().duration(a).style("fill-opacity",0).remove()},f.addTransitionForText=function(a,b,c,d){var e=this,f=d?0:e.opacityForText.bind(e);a.push(e.mainText.transition().attr("x",b).attr("y",c).style("fill",e.color).style("fill-opacity",f))
3
- },f.getTextRect=function(a,b){var c,d=this.d3.select("body").classed("c3",!0),e=d.append("svg").style("visibility","hidden");return e.selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).text(a).each(function(){c=this.getBoundingClientRect()}),e.remove(),d.classed("c3",!1),c},f.generateXYForText=function(a,b,c,d){var e=this,f=e.generateGetAreaPoints(b,!1),g=e.generateGetBarPoints(b,!1),h=e.generateGetLinePoints(c,!1),i=d?e.getXForText:e.getYForText;return function(a,b){var c=e.isAreaType(a)?f:e.isBarType(a)?g:h;return i.call(e,c(a,b),a,this)}},f.getXForText=function(a,b,c){var d,e,f=this,g=c.getBoundingClientRect();return f.config.axis_rotated?(e=f.isBarType(b)?4:6,d=a[2][1]+e*(b.value<0?-1:1)):d=f.hasType("bar")?(a[2][0]+a[0][0])/2:a[0][0],null===b.value&&(d>f.width?d=f.width-g.width:0>d&&(d=4)),d},f.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return d=e.config.axis_rotated?(a[0][0]+a[2][0]+.6*f.height)/2:a[2][1]+(b.value<0?f.height:e.isBarType(b)?-3:-6),null!==b.value||e.config.axis_rotated||(d<f.height?d=f.height:d>this.height&&(d=this.height-4)),d},f.setTargetType=function(a,b){var c=this,d=c.config;c.mapToTargetIds(a).forEach(function(a){c.withoutFadeIn[a]=b===d.data_types[a],d.data_types[a]=b}),a||(d.data_type=b)},f.hasType=function(a,b){var c=this,d=c.config.data_types,e=!1;return b=b||c.data.targets,b&&b.length?b.forEach(function(b){var c=d[b.id];(c&&c.indexOf(a)>=0||!c&&"line"===a)&&(e=!0)}):Object.keys(d).length?Object.keys(d).forEach(function(b){d[b]===a&&(e=!0)}):e=c.config.data_type===a,e},f.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},f.isLineType=function(a){var b=this.config,c=l(a)?a:a.id;return!b.data_types[c]||["line","spline","area","area-spline","step","area-step"].indexOf(b.data_types[c])>=0},f.isStepType=function(a){var b=l(a)?a:a.id;return["step","area-step"].indexOf(this.config.data_types[b])>=0},f.isSplineType=function(a){var b=l(a)?a:a.id;return["spline","area-spline"].indexOf(this.config.data_types[b])>=0},f.isAreaType=function(a){var b=l(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[b])>=0},f.isBarType=function(a){var b=l(a)?a:a.id;return"bar"===this.config.data_types[b]},f.isScatterType=function(a){var b=l(a)?a:a.id;return"scatter"===this.config.data_types[b]},f.isPieType=function(a){var b=l(a)?a:a.id;return"pie"===this.config.data_types[b]},f.isGaugeType=function(a){var b=l(a)?a:a.id;return"gauge"===this.config.data_types[b]},f.isDonutType=function(a){var b=l(a)?a:a.id;return"donut"===this.config.data_types[b]},f.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},f.lineData=function(a){return this.isLineType(a)?[a]:[]},f.arcData=function(a){return this.isArcType(a.data)?[a]:[]},f.barData=function(a){return this.isBarType(a)?a.values:[]},f.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},f.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},f.initGrid=function(){var a=this,b=a.config,c=a.d3;a.grid=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",i.grid),b.grid_x_show&&a.grid.append("g").attr("class",i.xgrids),b.grid_y_show&&a.grid.append("g").attr("class",i.ygrids),b.grid_focus_show&&a.grid.append("g").attr("class",i.xgridFocus).append("line").attr("class",i.xgridFocus),a.xgrid=c.selectAll([]),b.grid_lines_front||a.initGridLines()},f.initGridLines=function(){var a=this,b=a.d3;a.gridLines=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",i.grid+" "+i.gridLines),a.gridLines.append("g").attr("class",i.xgridLines),a.gridLines.append("g").attr("class",i.ygridLines),a.xgridLines=b.selectAll([])},f.updateXGrid=function(a){var b=this,c=b.config,d=b.d3,e=b.generateGridData(c.grid_x_type,b.x),f=b.isCategorized()?b.xAxis.tickOffset():0;b.xgridAttr=c.axis_rotated?{x1:0,x2:b.width,y1:function(a){return b.x(a)-f},y2:function(a){return b.x(a)-f}}:{x1:function(a){return b.x(a)+f},x2:function(a){return b.x(a)+f},y1:0,y2:b.height},b.xgrid=b.main.select("."+i.xgrids).selectAll("."+i.xgrid).data(e),b.xgrid.enter().append("line").attr("class",i.xgrid),a||b.xgrid.attr(b.xgridAttr).style("opacity",function(){return+d.select(this).attr(c.axis_rotated?"y1":"x1")===(c.axis_rotated?b.height:0)?0:1}),b.xgrid.exit().remove()},f.updateYGrid=function(){var a=this,b=a.config,c=a.yAxis.tickValues()||a.y.ticks(b.grid_y_ticks);a.ygrid=a.main.select("."+i.ygrids).selectAll("."+i.ygrid).data(c),a.ygrid.enter().append("line").attr("class",i.ygrid),a.ygrid.attr("x1",b.axis_rotated?a.y:0).attr("x2",b.axis_rotated?a.y:a.width).attr("y1",b.axis_rotated?0:a.y).attr("y2",b.axis_rotated?a.height:a.y),a.ygrid.exit().remove(),a.smoothLines(a.ygrid,"grid")},f.redrawGrid=function(a){var b,c,d,e=this,f=e.main,g=e.config;e.grid.style("visibility",e.hasArcType()?"hidden":"visible"),f.select("line."+i.xgridFocus).style("visibility","hidden"),g.grid_x_show&&e.updateXGrid(),e.xgridLines=f.select("."+i.xgridLines).selectAll("."+i.xgridLine).data(g.grid_x_lines),b=e.xgridLines.enter().append("g").attr("class",function(a){return i.xgridLine+(a["class"]?" "+a["class"]:"")}),b.append("line").style("opacity",0),b.append("text").attr("text-anchor","end").attr("transform",g.axis_rotated?"":"rotate(-90)").attr("dx",g.axis_rotated?0:-e.margin.top).attr("dy",-5).style("opacity",0),e.xgridLines.exit().transition().duration(a).style("opacity",0).remove(),g.grid_y_show&&e.updateYGrid(),e.ygridLines=f.select("."+i.ygridLines).selectAll("."+i.ygridLine).data(g.grid_y_lines),c=e.ygridLines.enter().append("g").attr("class",function(a){return i.ygridLine+(a["class"]?" "+a["class"]:"")}),c.append("line").style("opacity",0),c.append("text").attr("text-anchor","end").attr("transform",g.axis_rotated?"rotate(-90)":"").attr("dx",g.axis_rotated?0:-e.margin.top).attr("dy",-5).style("opacity",0),d=e.yv.bind(e),e.ygridLines.select("line").transition().duration(a).attr("x1",g.axis_rotated?d:0).attr("x2",g.axis_rotated?d:e.width).attr("y1",g.axis_rotated?0:d).attr("y2",g.axis_rotated?e.height:d).style("opacity",1),e.ygridLines.select("text").transition().duration(a).attr("x",g.axis_rotated?0:e.width).attr("y",d).text(function(a){return a.text}).style("opacity",1),e.ygridLines.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForGrid=function(a){var b=this,c=b.config,d=b.xv.bind(b);a.push(b.xgridLines.select("line").transition().attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?b.width:d).attr("y1",c.axis_rotated?d:b.margin.top).attr("y2",c.axis_rotated?d:b.height).style("opacity",1)),a.push(b.xgridLines.select("text").transition().attr("x",c.axis_rotated?b.width:0).attr("y",d).text(function(a){return a.text}).style("opacity",1))},f.showXGridFocus=function(a){var b=this,c=b.config,d=a.filter(function(a){return a&&j(a.value)}),e=b.main.selectAll("line."+i.xgridFocus),f=b.xx.bind(b);c.tooltip_show&&(b.hasType("scatter")||b.hasArcType()||(e.style("visibility","visible").data([d[0]]).attr(c.axis_rotated?"y1":"x1",f).attr(c.axis_rotated?"y2":"x2",f),b.smoothLines(e,"grid")))},f.hideXGridFocus=function(){this.main.select("line."+i.xgridFocus).style("visibility","hidden")},f.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+i.xgridFocus).attr("x1",b.axis_rotated?0:-10).attr("x2",b.axis_rotated?a.width:-10).attr("y1",b.axis_rotated?-10:0).attr("y2",b.axis_rotated?-10:a.height)},f.generateGridData=function(a,b){var c,d,e,f,g=this,h=[],j=g.main.select("."+i.axisX).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>j&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h},f.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(a){("value"in a&&b.value===a.value||"class"in a&&b["class"]===a["class"])&&(c=!0)}),c}:function(){return!0}},f.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?i.xgridLines:i.ygridLines,h=b?i.xgridLine:i.ygridLine;c.main.select("."+g).selectAll("."+h).filter(e).transition().duration(d.transition_duration).style("opacity",0).remove(),b?d.grid_x_lines=d.grid_x_lines.filter(f):d.grid_y_lines=d.grid_y_lines.filter(f)},f.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").attr("class",i.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),c.tooltip_init_show){if(b.isTimeSeries()&&l(c.tooltip_init_x)){for(c.tooltip_init_x=b.parseDate(c.tooltip_init_x),a=0;a<b.data.targets[0].values.length&&b.data.targets[0].values[a].x-c.tooltip_init_x!==0;a++);c.tooltip_init_x=a}b.tooltip.html(c.tooltip_contents.call(b,b.data.targets.map(function(a){return b.addName(a.values[c.tooltip_init_x])}),b.getXAxisTickFormat(),b.getYFormat(b.hasArcType()),b.color)),b.tooltip.style("top",c.tooltip_init_position.top).style("left",c.tooltip_init_position.left).style("display","block")}},f.getTooltipContent=function(a,b,c,d){var e,f,g,h,j,k,l=this,m=l.config,n=m.tooltip_format_title||b,o=m.tooltip_format_name||function(a){return a},p=m.tooltip_format_value||c;for(f=0;f<a.length;f++)a[f]&&(a[f].value||0===a[f].value)&&(e||(g=n?n(a[f].x):a[f].x,e="<table class='"+i.tooltip+"'>"+(g||0===g?"<tr><th colspan='2'>"+g+"</th></tr>":"")),j=o(a[f].name,a[f].ratio,a[f].id,a[f].index),h=p(a[f].value,a[f].ratio,a[f].id,a[f].index),k=l.levelColor?l.levelColor(a[f].value):d(a[f].id),e+="<tr class='"+i.tooltipName+"-"+a[f].id+"'>",e+="<td class='name'><span style='background-color:"+k+"'></span>"+j+"</td>",e+="<td class='value'>"+h+"</td>",e+="</tr>");return e+"</table>"},f.showTooltip=function(a,b){var c,d,e,f,g,h,i,k=this,l=k.config,m=k.hasArcType(),n=a.filter(function(a){return a&&j(a.value)});0!==n.length&&l.tooltip_show&&(k.tooltip.html(l.tooltip_contents.call(k,a,k.getXAxisTickFormat(),k.getYFormat(m),k.color)).style("display","block"),c=k.tooltip.property("offsetWidth"),d=k.tooltip.property("offsetHeight"),m?(f=k.width/2+b[0],h=k.height/2+b[1]+20):(e=k.getSvgLeft(!0),l.axis_rotated?(f=e+b[0]+100,g=f+c,i=k.currentWidth-k.getCurrentPaddingRight(),h=k.x(n[0].x)+20):(f=e+k.getCurrentPaddingLeft(!0)+k.x(n[0].x)+20,g=f+c,i=e+k.currentWidth-k.getCurrentPaddingRight(),h=b[1]+15),g>i&&(f-=g-i),h+d>k.currentHeight&&(h-=d+30)),0>h&&(h=0),k.tooltip.style("top",h+"px").style("left",f+"px"))},f.hideTooltip=function(){this.tooltip.style("display","none")},f.initLegend=function(){var a=this;return a.legendHasRendered=!1,a.legend=a.svg.append("g").attr("transform",a.getTranslate("legend")),a.config.legend_show?void a.updateLegendWithDefaults():(a.legend.style("visibility","hidden"),void(a.hiddenLegendIds=a.mapToIds(a.data.targets)))},f.updateLegendWithDefaults=function(){var a=this;a.updateLegend(a.mapToIds(a.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},f.updateSizeForLegend=function(a,b){var c=this,d=c.config,e={top:c.isLegendTop?c.getCurrentPaddingTop()+d.legend_inset_y+5.5:c.currentHeight-a-c.getCurrentPaddingBottom()-d.legend_inset_y,left:c.isLegendLeft?c.getCurrentPaddingLeft()+d.legend_inset_x+.5:c.currentWidth-b-c.getCurrentPaddingRight()-d.legend_inset_x+.5};c.margin3={top:c.isLegendRight?0:c.isLegendInset?e.top:c.currentHeight-a,right:0/0,bottom:0,left:c.isLegendRight?c.currentWidth-b:c.isLegendInset?e.left:0}},f.transformLegend=function(a){var b=this;(a?b.legend.transition():b.legend).attr("transform",b.getTranslate("legend"))},f.updateLegendStep=function(a){this.legendStep=a},f.updateLegendItemWidth=function(a){this.legendItemWidth=a},f.updateLegendItemHeight=function(a){this.legendItemHeight=a},f.getLegendWidth=function(){var a=this;return a.config.legend_show?a.isLegendRight||a.isLegendInset?a.legendItemWidth*(a.legendStep+1):a.currentWidth:0},f.getLegendHeight=function(){var a=this,b=0;return a.config.legend_show&&(b=a.isLegendRight?a.currentHeight:Math.max(20,a.legendItemHeight)*(a.legendStep+1)),b},f.opacityForLegend=function(a){return a.classed(i.legendItemHidden)?null:1},f.opacityForUnfocusedLegend=function(a){return a.classed(i.legendItemHidden)?null:.3},f.toggleFocusLegend=function(a,b){var c=this;a=c.mapToTargetIds(a),c.legend.selectAll("."+i.legendItem).filter(function(b){return a.indexOf(b)>=0}).classed(i.legendItemFocused,b).transition().duration(100).style("opacity",function(){var a=b?c.opacityForLegend:c.opacityForUnfocusedLegend;return a.call(c,c.d3.select(this))})},f.revertLegend=function(){var a=this,b=a.d3;a.legend.selectAll("."+i.legendItem).classed(i.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return a.opacityForLegend(b.select(this))})},f.showLegend=function(a){var b=this,c=b.config;c.legend_show||(c.legend_show=!0,b.legend.style("visibility","visible"),b.legendHasRendered||b.updateLegendWithDefaults()),b.removeHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("visibility","visible").transition().style("opacity",function(){return b.opacityForLegend(b.d3.select(this))})},f.hideLegend=function(a){var b=this,c=b.config;c.legend_show&&r(a)&&(c.legend_show=!1,b.legend.style("visibility","hidden")),b.addHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("opacity",0).style("visibility","hidden")};var h={};f.clearLegendItemTextBoxCache=function(){h={}},f.updateLegend=function(a,b,c){function d(a,b){return h[b]||(h[b]=w.getTextRect(a.textContent,i.legendItem)),h[b]}function e(b,c,e){function f(a,b){b||(g=(o-E-n)/2,C>g&&(g=(o-n)/2,E=0,K++)),J[a]=K,I[K]=w.isLegendInset?10:g,F[a]=E,E+=n}var g,h,i=0===e,j=e===a.length-1,k=d(b,c),l=k.width+D+(!j||w.isLegendRight||w.isLegendInset?z:0),m=k.height+y,n=w.isLegendRight||w.isLegendInset?m:l,o=w.isLegendRight||w.isLegendInset?w.getLegendHeight():w.getLegendWidth();return i&&(E=0,K=0,A=0,B=0),x.legend_show&&!w.isLegendToShow(c)?void(G[c]=H[c]=J[c]=F[c]=0):(G[c]=l,H[c]=m,(!A||l>=A)&&(A=l),(!B||m>=B)&&(B=m),h=w.isLegendRight||w.isLegendInset?B:A,void(x.legend_equally?(Object.keys(G).forEach(function(a){G[a]=A}),Object.keys(H).forEach(function(a){H[a]=B}),g=(o-h*a.length)/2,C>g?(E=0,K=0,a.forEach(function(a){f(a)})):f(c,!0)):f(c)))}var f,g,j,k,l,m,o,p,q,r,s,u,v,w=this,x=w.config,y=4,z=10,A=0,B=0,C=10,D=15,E=0,F={},G={},H={},I=[0],J={},K=0,L=w.legend.selectAll("."+i.legendItemFocused).size();b=b||{},p=t(b,"withTransition",!0),q=t(b,"withTransitionForTransform",!0),w.isLegendInset&&(K=x.legend_inset_step?x.legend_inset_step:a.length,w.updateLegendStep(K)),w.isLegendRight?(f=function(a){return A*J[a]},k=function(a){return I[J[a]]+F[a]}):w.isLegendInset?(f=function(a){return A*J[a]+10},k=function(a){return I[J[a]]+F[a]}):(f=function(a){return I[J[a]]+F[a]},k=function(a){return B*J[a]}),g=function(a,b){return f(a,b)+14},l=function(a,b){return k(a,b)+9},j=function(a,b){return f(a,b)},m=function(a,b){return k(a,b)-5},o=w.legend.selectAll("."+i.legendItem).data(a).enter().append("g").attr("class",function(a){return w.generateClass(i.legendItem,a)}).style("visibility",function(a){return w.isLegendToShow(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){x.legend_item_onclick?x.legend_item_onclick.call(w,a):w.d3.event.altKey?(w.api.hide(),w.api.show(a)):(w.api.toggle(a),w.isTargetToShow(a)?w.api.focus(a):w.api.revert())}).on("mouseover",function(a){w.d3.select(this).classed(i.legendItemFocused,!0),!w.transiting&&w.isTargetToShow(a)&&w.api.focus(a),x.legend_item_onmouseover&&x.legend_item_onmouseover.call(w,a)}).on("mouseout",function(a){w.d3.select(this).classed(i.legendItemFocused,!1),w.api.revert(),x.legend_item_onmouseout&&x.legend_item_onmouseout.call(w,a)}),o.append("text").text(function(a){return n(x.data_names[a])?x.data_names[a]:a}).each(function(a,b){e(this,a,b)}).style("pointer-events","none").attr("x",w.isLegendRight||w.isLegendInset?g:-200).attr("y",w.isLegendRight||w.isLegendInset?-200:l),o.append("rect").attr("class",i.legendItemEvent).style("fill-opacity",0).attr("x",w.isLegendRight||w.isLegendInset?j:-200).attr("y",w.isLegendRight||w.isLegendInset?-200:m),o.append("rect").attr("class",i.legendItemTile).style("pointer-events","none").style("fill",w.color).attr("x",w.isLegendRight||w.isLegendInset?g:-200).attr("y",w.isLegendRight||w.isLegendInset?-200:k).attr("width",10).attr("height",10),v=w.legend.select("."+i.legendBackground+" rect"),w.isLegendInset&&A>0&&0===v.size()&&(v=w.legend.insert("g","."+i.legendItem).attr("class",i.legendBackground).append("rect")),r=w.legend.selectAll("text").data(a).text(function(a){return n(x.data_names[a])?x.data_names[a]:a}).each(function(a,b){e(this,a,b)}),(p?r.transition():r).attr("x",g).attr("y",l),s=w.legend.selectAll("rect."+i.legendItemEvent).data(a),(p?s.transition():s).attr("width",function(a){return G[a]}).attr("height",function(a){return H[a]}).attr("x",j).attr("y",m),u=w.legend.selectAll("rect."+i.legendItemTile).data(a),(p?u.transition():u).style("fill",w.color).attr("x",f).attr("y",k),v&&(p?v.transition():v).attr("height",w.getLegendHeight()-12).attr("width",A*(K+1)+10),w.legend.selectAll("."+i.legendItem).classed(i.legendItemHidden,function(a){return!w.isTargetToShow(a)}).transition().style("opacity",function(a){var b=w.d3.select(this);return w.isTargetToShow(a)?!L||b.classed(i.legendItemFocused)?w.opacityForLegend(b):w.opacityForUnfocusedLegend(b):null}),w.updateLegendItemWidth(A),w.updateLegendItemHeight(B),w.updateLegendStep(K),w.updateSizes(),w.updateScales(),w.updateSvgSize(),w.transformAll(q,c),w.legendHasRendered=!0},f.initAxis=function(){var a=this,b=a.config,c=a.main;a.axes.x=c.append("g").attr("class",i.axis+" "+i.axisX).attr("clip-path",a.clipPathForXAxis).attr("transform",a.getTranslate("x")).style("visibility",b.axis_x_show?"visible":"hidden"),a.axes.x.append("text").attr("class",i.axisXLabel).attr("transform",b.axis_rotated?"rotate(-90)":"").style("text-anchor",a.textAnchorForXAxisLabel.bind(a)),a.axes.y=c.append("g").attr("class",i.axis+" "+i.axisY).attr("clip-path",b.axis_y_inner?"":a.clipPathForYAxis).attr("transform",a.getTranslate("y")).style("visibility",b.axis_y_show?"visible":"hidden"),a.axes.y.append("text").attr("class",i.axisYLabel).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",a.textAnchorForYAxisLabel.bind(a)),a.axes.y2=c.append("g").attr("class",i.axis+" "+i.axisY2).attr("transform",a.getTranslate("y2")).style("visibility",b.axis_y2_show?"visible":"hidden"),a.axes.y2.append("text").attr("class",i.axisY2Label).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",a.textAnchorForY2AxisLabel.bind(a))},f.getXAxis=function(a,b,c,e,f){var g=this,h=g.config,i={isCategory:g.isCategorized(),withOuterTick:f,tickMultiline:h.axis_x_tick_multiline,tickWidth:h.axis_x_tick_width},j=d(g.d3,i).scale(a).orient(b);return g.isTimeSeries()&&e&&(e=e.map(function(a){return g.parseDate(a)})),j.tickFormat(c).tickValues(e),g.isCategorized()?(j.tickCentered(h.axis_x_tick_centered),r(h.axis_x_tick_culling)&&(h.axis_x_tick_culling=!1)):j.tickOffset=function(){var a=this.scale(),b=g.getEdgeX(g.data.targets),c=a(b[1])-a(b[0]),d=c?c:h.axis_rotated?g.height:g.width;return d/g.getMaxDataCount()/2},j},f.getYAxis=function(a,b,c,e,f){var g={withOuterTick:f},h=d(this.d3,g).scale(a).orient(b).tickFormat(c);return this.isTimeSeriesY()?h.ticks(this.d3.time[this.config.axis_y_tick_time_value],this.config.axis_y_tick_time_interval):h.tickValues(e),h},f.getAxisId=function(a){var b=this.config;return a in b.data_axes?b.data_axes[a]:"y"},f.getXAxisTickFormat=function(){var a=this,b=a.config,c=a.isTimeSeries()?a.defaultAxisTimeFormat:a.isCategorized()?a.categoryName:function(a){return 0>a?a.toFixed(0):a};return b.axis_x_tick_format&&(k(b.axis_x_tick_format)?c=b.axis_x_tick_format:a.isTimeSeries()&&(c=function(c){return c?a.axisTimeFormat(b.axis_x_tick_format)(c):""})),k(c)?function(b){return c.call(a,b)}:c},f.getAxisTickValues=function(a,b){return a?a:b?b.tickValues():void 0},f.getXAxisTickValues=function(){return this.getAxisTickValues(this.config.axis_x_tick_values,this.xAxis)},f.getYAxisTickValues=function(){return this.getAxisTickValues(this.config.axis_y_tick_values,this.yAxis)},f.getY2AxisTickValues=function(){return this.getAxisTickValues(this.config.axis_y2_tick_values,this.y2Axis)},f.getAxisLabelOptionByAxisId=function(a){var b,c=this,d=c.config;return"y"===a?b=d.axis_y_label:"y2"===a?b=d.axis_y2_label:"x"===a&&(b=d.axis_x_label),b},f.getAxisLabelText=function(a){var b=this.getAxisLabelOptionByAxisId(a);return l(b)?b:b?b.text:null},f.setAxisLabelText=function(a,b){var c=this,d=c.config,e=c.getAxisLabelOptionByAxisId(a);l(e)?"y"===a?d.axis_y_label=b:"y2"===a?d.axis_y2_label=b:"x"===a&&(d.axis_x_label=b):e&&(e.text=b)},f.getAxisLabelPosition=function(a,b){var c=this.getAxisLabelOptionByAxisId(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}},f.getXAxisLabelPosition=function(){return this.getAxisLabelPosition("x",this.config.axis_rotated?"inner-top":"inner-right")},f.getYAxisLabelPosition=function(){return this.getAxisLabelPosition("y",this.config.axis_rotated?"inner-right":"inner-top")},f.getY2AxisLabelPosition=function(){return this.getAxisLabelPosition("y2",this.config.axis_rotated?"inner-right":"inner-top")},f.getAxisLabelPositionById=function(a){return"y2"===a?this.getY2AxisLabelPosition():"y"===a?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.textForXAxisLabel=function(){return this.getAxisLabelText("x")},f.textForYAxisLabel=function(){return this.getAxisLabelText("y")},f.textForY2AxisLabel=function(){return this.getAxisLabelText("y2")},f.xForAxisLabel=function(a,b){var c=this;return a?b.isLeft?0:b.isCenter?c.width/2:c.width:b.isBottom?-c.height:b.isMiddle?-c.height/2:0},f.dxForAxisLabel=function(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"},f.textAnchorForAxisLabel=function(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"},f.xForXAxisLabel=function(){return this.xForAxisLabel(!this.config.axis_rotated,this.getXAxisLabelPosition())},f.xForYAxisLabel=function(){return this.xForAxisLabel(this.config.axis_rotated,this.getYAxisLabelPosition())},f.xForY2AxisLabel=function(){return this.xForAxisLabel(this.config.axis_rotated,this.getY2AxisLabelPosition())},f.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.config.axis_rotated,this.getXAxisLabelPosition())},f.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.config.axis_rotated,this.getYAxisLabelPosition())},f.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.config.axis_rotated,this.getY2AxisLabelPosition())},f.dyForXAxisLabel=function(){var a=this,b=a.config,c=a.getXAxisLabelPosition();return b.axis_rotated?c.isInner?"1.2em":-25-a.getMaxTickWidth("x"):c.isInner?"-0.5em":b.axis_x_height?b.axis_x_height-10:"3em"},f.dyForYAxisLabel=function(){var a=this,b=a.getYAxisLabelPosition();return a.config.axis_rotated?b.isInner?"-0.5em":"3em":b.isInner?"1.2em":-10-(a.config.axis_y_inner?0:a.getMaxTickWidth("y")+10)},f.dyForY2AxisLabel=function(){var a=this,b=a.getY2AxisLabelPosition();return a.config.axis_rotated?b.isInner?"1.2em":"-2.2em":b.isInner?"-0.5em":15+(a.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.textAnchorForXAxisLabel=function(){var a=this;return a.textAnchorForAxisLabel(!a.config.axis_rotated,a.getXAxisLabelPosition())},f.textAnchorForYAxisLabel=function(){var a=this;return a.textAnchorForAxisLabel(a.config.axis_rotated,a.getYAxisLabelPosition())},f.textAnchorForY2AxisLabel=function(){var a=this;return a.textAnchorForAxisLabel(a.config.axis_rotated,a.getY2AxisLabelPosition())},f.xForRotatedTickText=function(a){return 8*Math.sin(Math.PI*(a/180))},f.yForRotatedTickText=function(a){return 11.5-2.5*(a/15)*(a>0?1:-1)},f.rotateTickText=function(a,b,c){a.selectAll(".tick text").style("text-anchor",c>0?"start":"end"),b.selectAll(".tick text").attr("y",this.yForRotatedTickText(c)).attr("transform","rotate("+c+")").selectAll("tspan").attr("dx",this.xForRotatedTickText(c))},f.getMaxTickWidth=function(a,b){var c,d,e,f=this,g=f.config,h=0;return b&&f.currentMaxTickWidths[a]?f.currentMaxTickWidths[a]:(f.svg&&(c=f.filterTargetsToShow(f.data.targets),"y"===a?(d=f.y.copy().domain(f.getYDomain(c,"y")),e=f.getYAxis(d,f.yOrient,g.axis_y_tick_format,f.yAxisTickValues)):"y2"===a?(d=f.y2.copy().domain(f.getYDomain(c,"y2")),e=f.getYAxis(d,f.y2Orient,g.axis_y2_tick_format,f.y2AxisTickValues)):(d=f.x.copy().domain(f.getXDomain(c)),e=f.getXAxis(d,f.xOrient,f.xAxisTickFormat,f.xAxisTickValues)),f.d3.select("body").append("g").style("visibility","hidden").call(e).each(function(){f.d3.select(this).selectAll("text tspan").each(function(){var a=this.getBoundingClientRect();a.left>0&&h<a.width&&(h=a.width)})}).remove()),f.currentMaxTickWidths[a]=0>=h?f.currentMaxTickWidths[a]:h,f.currentMaxTickWidths[a])},f.updateAxisLabels=function(a){var b=this,c=b.main.select("."+i.axisX+" ."+i.axisXLabel),d=b.main.select("."+i.axisY+" ."+i.axisYLabel),e=b.main.select("."+i.axisY2+" ."+i.axisY2Label);(a?c.transition():c).attr("x",b.xForXAxisLabel.bind(b)).attr("dx",b.dxForXAxisLabel.bind(b)).attr("dy",b.dyForXAxisLabel.bind(b)).text(b.textForXAxisLabel.bind(b)),(a?d.transition():d).attr("x",b.xForYAxisLabel.bind(b)).attr("dx",b.dxForYAxisLabel.bind(b)).attr("dy",b.dyForYAxisLabel.bind(b)).text(b.textForYAxisLabel.bind(b)),(a?e.transition():e).attr("x",b.xForY2AxisLabel.bind(b)).attr("dx",b.dxForY2AxisLabel.bind(b)).attr("dy",b.dyForY2AxisLabel.bind(b)).text(b.textForY2AxisLabel.bind(b))},f.getAxisPadding=function(a,b,c,d){return j(a[b])?"ratio"===a.unit?a[b]*d:this.convertPixelsToAxisPadding(a[b],d):c},f.convertPixelsToAxisPadding=function(a,b){var c=this.config.axis_rotated?this.width:this.height;return b*(a/c)},f.generateTickValues=function(a,b,c){var d,e,f,g,h,i,j,l=a;if(b)if(d=k(b)?b():b,1===d)l=[a[0]];else if(2===d)l=[a[0],a[a.length-1]];else if(d>2){for(g=d-2,e=a[0],f=a[a.length-1],h=(f-e)/(g+1),l=[e],i=0;g>i;i++)j=+e+h*(i+1),l.push(c?new Date(j):j);l.push(f)}return c||(l=l.sort(function(a,b){return a-b})),l},f.generateAxisTransitions=function(a){var b=this,c=b.axes;return{axisX:a?c.x.transition().duration(a):c.x,axisY:a?c.y.transition().duration(a):c.y,axisY2:a?c.y2.transition().duration(a):c.y2,axisSubX:a?c.subx.transition().duration(a):c.subx}},f.redrawAxis=function(a,b){var c=this,d=c.config;c.axes.x.style("opacity",b?0:1),c.axes.y.style("opacity",b?0:1),c.axes.y2.style("opacity",b?0:1),c.axes.subx.style("opacity",b?0:1),a.axisX.call(c.xAxis),a.axisY.call(c.yAxis),a.axisY2.call(c.y2Axis),a.axisSubX.call(c.subXAxis),!d.axis_rotated&&d.axis_x_tick_rotate&&(c.rotateTickText(c.axes.x,a.axisX,d.axis_x_tick_rotate),c.rotateTickText(c.axes.subx,a.axisSubX,d.axis_x_tick_rotate))},f.getClipPath=function(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"},f.appendClip=function(a,b){return a.append("clipPath").attr("id",b).append("rect")},f.getAxisClipX=function(a){var b=Math.max(30,this.margin.left);return a?-(1+b):-(b-1)},f.getAxisClipY=function(a){return a?-20:-this.margin.top},f.getXAxisClipX=function(){var a=this;return a.getAxisClipX(!a.config.axis_rotated)},f.getXAxisClipY=function(){var a=this;return a.getAxisClipY(!a.config.axis_rotated)},f.getYAxisClipX=function(){var a=this;return a.config.axis_y_inner?-1:a.getAxisClipX(a.config.axis_rotated)},f.getYAxisClipY=function(){var a=this;return a.getAxisClipY(a.config.axis_rotated)},f.getAxisClipWidth=function(a){var b=this,c=Math.max(30,b.margin.left),d=Math.max(30,b.margin.right);return a?b.width+2+c+d:b.margin.left+20},f.getAxisClipHeight=function(a){return(a?this.margin.bottom:this.margin.top+this.height)+20},f.getXAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(!a.config.axis_rotated)},f.getXAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(!a.config.axis_rotated)},f.getYAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(a.config.axis_rotated)+(a.config.axis_y_inner?20:0)},f.getYAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(a.config.axis_rotated)},f.initPie=function(){var a=this,b=a.d3,c=a.config;a.pie=b.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),c.data_order||a.pie.sort(null)},f.updateRadius=function(){var a=this,b=a.config,c=b.gauge_width||b.donut_width;a.radiusExpanded=Math.min(a.arcWidth,a.arcHeight)/2,a.radius=.95*a.radiusExpanded,a.innerRadiusRatio=c?(a.radius-c)/a.radius:.6,a.innerRadius=a.hasType("donut")||a.hasType("gauge")?a.radius*a.innerRadiusRatio:0},f.updateArc=function(){var a=this;a.svgArc=a.getSvgArc(),a.svgArcExpanded=a.getSvgArcExpanded(),a.svgArcExpandedSub=a.getSvgArcExpanded(.98)},f.updateAngle=function(a){var b,c,d=this,e=d.config,f=!1,g=0,h=e.gauge_min,i=e.gauge_max;return d.pie(d.filterTargetsToShow(d.data.targets)).forEach(function(b){f||b.data.id!==a.data.id||(f=!0,a=b,a.index=g),g++}),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),d.isGaugeType(a.data)&&(b=Math.PI/(i-h),c=a.value<h?0:a.value<i?a.value-h:i-h,a.startAngle=-1*(Math.PI/2),a.endAngle=a.startAngle+b*c),f?a:null},f.getSvgArc=function(){var a=this,b=a.d3.svg.arc().outerRadius(a.radius).innerRadius(a.innerRadius),c=function(c,d){var e;return d?b(c):(e=a.updateAngle(c),e?b(e):"M 0 0")};return c.centroid=b.centroid,c},f.getSvgArcExpanded=function(a){var b=this,c=b.d3.svg.arc().outerRadius(b.radiusExpanded*(a?a:1)).innerRadius(b.innerRadius);return function(a){var d=b.updateAngle(a);return d?c(d):"M 0 0"}},f.getArc=function(a,b,c){return c||this.isArcType(a.data)?this.svgArc(a,b):"M 0 0"},f.transformForArcLabel=function(a){var b,c,d,e,f,g=this,h=g.updateAngle(a),i="";return h&&!g.hasType("gauge")&&(b=this.svgArc.centroid(h),c=isNaN(b[0])?0:b[0],d=isNaN(b[1])?0:b[1],e=Math.sqrt(c*c+d*d),f=g.radius&&e?(36/g.radius>.375?1.175-36/g.radius:.8)*g.radius/e:0,i="translate("+c*f+","+d*f+")"),i},f.getArcRatio=function(a){var b=this,c=b.hasType("gauge")?Math.PI:2*Math.PI;return a?(a.endAngle-a.startAngle)/c:null},f.convertToArcData=function(a){return this.addName({id:a.data.id,value:a.value,ratio:this.getArcRatio(a),index:a.index})},f.textForArcLabel=function(a){var b,c,d,e,f,g=this;return g.shouldShowArcLabel()?(b=g.updateAngle(a),c=b?b.value:null,d=g.getArcRatio(b),e=a.data.id,g.hasType("gauge")||g.meetsArcLabelThreshold(d)?(f=g.getArcLabelFormat(),f?f(c,d,e):g.defaultArcValueFormat(c,d)):""):""},f.expandArc=function(b){var c,d=this;return d.transiting?void(c=a.setInterval(function(){d.transiting||(a.clearInterval(c),d.legend.selectAll(".c3-legend-item-focused").size()>0&&d.expandArc(b))},10)):(b=d.mapToTargetIds(b),void d.svg.selectAll(d.selectorTargets(b,"."+i.chartArc)).each(function(a){d.shouldExpand(a.data.id)&&d.d3.select(this).selectAll("path").transition().duration(50).attr("d",d.svgArcExpanded).transition().duration(100).attr("d",d.svgArcExpandedSub).each(function(a){d.isDonutType(a.data)})}))},f.unexpandArc=function(a){var b=this;b.transiting||(a=b.mapToTargetIds(a),b.svg.selectAll(b.selectorTargets(a,"."+i.chartArc)).selectAll("path").transition().duration(50).attr("d",b.svgArc),b.svg.selectAll("."+i.arc).style("opacity",1))},f.shouldExpand=function(a){var b=this,c=b.config;return b.isDonutType(a)&&c.donut_expand||b.isGaugeType(a)&&c.gauge_expand||b.isPieType(a)&&c.pie_expand},f.shouldShowArcLabel=function(){var a=this,b=a.config,c=!0;return a.hasType("donut")?c=b.donut_label_show:a.hasType("pie")&&(c=b.pie_label_show),c},f.meetsArcLabelThreshold=function(a){var b=this,c=b.config,d=b.hasType("donut")?c.donut_label_threshold:c.pie_label_threshold;
4
- return a>=d},f.getArcLabelFormat=function(){var a=this,b=a.config,c=b.pie_label_format;return a.hasType("gauge")?c=b.gauge_label_format:a.hasType("donut")&&(c=b.donut_label_format),c},f.getArcTitle=function(){var a=this;return a.hasType("donut")?a.config.donut_title:""},f.updateTargetsForArc=function(a){var b,c,d=this,e=d.main,f=d.classChartArc.bind(d),g=d.classArcs.bind(d),h=d.classFocus.bind(d);b=e.select("."+i.chartArcs).selectAll("."+i.chartArc).data(d.pie(a)).attr("class",function(a){return f(a)+h(a.data)}),c=b.enter().append("g").attr("class",f),c.append("g").attr("class",g),c.append("text").attr("dy",d.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},f.initArc=function(){var a=this;a.arcs=a.main.select("."+i.chart).append("g").attr("class",i.chartArcs).attr("transform",a.getTranslate("arc")),a.arcs.append("text").attr("class",i.chartArcsTitle).style("text-anchor","middle").text(a.getArcTitle())},f.redrawArc=function(a,b,c){var d,e=this,f=e.d3,g=e.config,h=e.main;d=h.selectAll("."+i.arcs).selectAll("."+i.arc).data(e.arcData.bind(e)),d.enter().append("path").attr("class",e.classArc.bind(e)).style("fill",function(a){return e.color(a.data)}).style("cursor",function(a){return g.interaction_enabled&&g.data_selection_isselectable(a)?"pointer":null}).style("opacity",0).each(function(a){e.isGaugeType(a.data)&&(a.startAngle=a.endAngle=-1*(Math.PI/2)),this._current=a}),d.attr("transform",function(a){return!e.isGaugeType(a.data)&&c?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).on("mouseover",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),c=e.convertToArcData(b),e.expandArc(b.data.id),e.api.focus(b.data.id),e.toggleFocusLegend(b.data.id,!0),e.config.data_onmouseover(c,this))}:null).on("mousemove",g.interaction_enabled?function(a){var b=e.updateAngle(a),c=e.convertToArcData(b),d=[c];e.showTooltip(d,f.mouse(this))}:null).on("mouseout",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),c=e.convertToArcData(b),e.unexpandArc(b.data.id),e.api.revert(),e.revertLegend(),e.hideTooltip(),e.config.data_onmouseout(c,this))}:null).on("click",g.interaction_enabled?function(a,b){var c=e.updateAngle(a),d=e.convertToArcData(c);e.toggleShape&&e.toggleShape(this,d,b),e.config.data_onclick.call(e.api,d,this)}:null).each(function(){e.transiting=!0}).transition().duration(a).attrTween("d",function(a){var b,c=e.updateAngle(a);return c?(isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=f.interpolate(this._current,c),this._current=b(0),function(c){var d=b(c);return d.data=a.data,e.getArc(d,!0)}):function(){return"M 0 0"}}).attr("transform",c?"scale(1)":"").style("fill",function(a){return e.levelColor?e.levelColor(a.data.values[0].value):e.color(a.data.id)}).style("opacity",1).call(e.endall,function(){e.transiting=!1}),d.exit().transition().duration(b).style("opacity",0).remove(),h.selectAll("."+i.chartArc).select("text").style("opacity",0).attr("class",function(a){return e.isGaugeType(a.data)?i.gaugeValue:""}).text(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(a){return e.isGaugeType(a.data)?Math.round(e.radius/5)+"px":""}).transition().duration(a).style("opacity",function(a){return e.isTargetToShow(a.data.id)&&e.isArcType(a.data)?1:0}),h.select("."+i.chartArcsTitle).style("opacity",e.hasType("donut")||e.hasType("gauge")?1:0),e.hasType("gauge")&&(e.arcs.select("."+i.chartArcsBackground).attr("d",function(){var a={data:[{value:g.gauge_max}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return e.getArc(a,!0,!0)}),e.arcs.select("."+i.chartArcsGaugeUnit).attr("dy",".75em").text(g.gauge_label_show?g.gauge_units:""),e.arcs.select("."+i.chartArcsGaugeMin).attr("dx",-1*(e.innerRadius+(e.radius-e.innerRadius)/2)+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_min:""),e.arcs.select("."+i.chartArcsGaugeMax).attr("dx",e.innerRadius+(e.radius-e.innerRadius)/2+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_max:""))},f.initGauge=function(){var a=this.arcs;this.hasType("gauge")&&(a.append("path").attr("class",i.chartArcsBackground),a.append("text").attr("class",i.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",i.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",i.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},f.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},f.initRegion=function(){var a=this;a.region=a.main.append("g").attr("clip-path",a.clipPath).attr("class",i.regions)},f.redrawRegion=function(a){var b=this,c=b.config;b.region.style("visibility",b.hasArcType()?"hidden":"visible"),b.mainRegion=b.main.select("."+i.regions).selectAll("."+i.region).data(c.regions),b.mainRegion.enter().append("g").attr("class",b.classRegion.bind(b)).append("rect").style("fill-opacity",0),b.mainRegion.exit().transition().duration(a).style("opacity",0).remove()},f.addTransitionForRegion=function(a){var b=this,c=b.regionX.bind(b),d=b.regionY.bind(b),e=b.regionWidth.bind(b),f=b.regionHeight.bind(b);a.push(b.mainRegion.selectAll("rect").transition().attr("x",c).attr("y",d).attr("width",e).attr("height",f).style("fill-opacity",function(a){return j(a.opacity)?a.opacity:.1}))},f.regionX=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"start"in a?e(a.start):0:d.axis_rotated?0:"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},f.regionY=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?0:"end"in a?e(a.end):0:d.axis_rotated&&"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},f.regionWidth=function(a){var b,c=this,d=c.config,e=c.regionX(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"end"in a?f(a.end):c.width:d.axis_rotated?c.width:"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.width,e>b?0:b-e},f.regionHeight=function(a){var b,c=this,d=c.config,e=this.regionY(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?c.height:"start"in a?f(a.start):c.height:d.axis_rotated&&"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.height,e>b?0:b-e},f.isRegionOnX=function(a){return!a.axis||"x"===a.axis},f.drag=function(a){var b,c,d,e,f,g,h,j,k=this,l=k.config,m=k.main,n=k.d3;k.hasArcType()||l.data_selection_enabled&&(!l.zoom_enabled||k.zoom.altDomain)&&l.data_selection_multiple&&(b=k.dragStart[0],c=k.dragStart[1],d=a[0],e=a[1],f=Math.min(b,d),g=Math.max(b,d),h=l.data_selection_grouped?k.margin.top:Math.min(c,e),j=l.data_selection_grouped?k.height:Math.max(c,e),m.select("."+i.dragarea).attr("x",f).attr("y",h).attr("width",g-f).attr("height",j-h),m.selectAll("."+i.shapes).selectAll("."+i.shape).filter(function(a){return l.data_selection_isselectable(a)}).each(function(a,b){var c,d,e,l,m,o,p=n.select(this),q=p.classed(i.SELECTED),r=p.classed(i.INCLUDED),s=!1;if(p.classed(i.circle))c=1*p.attr("cx"),d=1*p.attr("cy"),m=k.togglePoint,s=c>f&&g>c&&d>h&&j>d;else{if(!p.classed(i.bar))return;o=v(this),c=o.x,d=o.y,e=o.width,l=o.height,m=k.togglePath,s=!(c>g||f>c+e||d>j||h>d+l)}s^r&&(p.classed(i.INCLUDED,!r),p.classed(i.SELECTED,!q),m.call(k,!q,p,a,b))}))},f.dragstart=function(a){var b=this,c=b.config;b.hasArcType()||c.data_selection_enabled&&(b.dragStart=a,b.main.select("."+i.chart).append("rect").attr("class",i.dragarea).style("opacity",.1),b.dragging=!0,b.config.data_ondragstart.call(b.api))},f.dragend=function(){var a=this,b=a.config;a.hasArcType()||b.data_selection_enabled&&(a.main.select("."+i.dragarea).transition().duration(100).style("opacity",0).remove(),a.main.selectAll("."+i.shape).classed(i.INCLUDED,!1),a.dragging=!1,a.config.data_ondragend.call(a.api))},f.selectPoint=function(a,b,c){var d=this,e=d.config,f=(e.axis_rotated?d.circleY:d.circleX).bind(d),g=(e.axis_rotated?d.circleX:d.circleY).bind(d),h=d.pointSelectR.bind(d);e.data_onselected.call(d.api,b,a.node()),d.main.select("."+i.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+i.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return d.generateClass(i.selectedCircle,c)}).attr("cx",f).attr("cy",g).attr("stroke",function(){return d.color(b)}).attr("r",function(a){return 1.4*d.pointSelectR(a)}).transition().duration(100).attr("r",h)},f.unselectPoint=function(a,b,c){var d=this;d.config.data_onunselected(b,a.node()),d.main.select("."+i.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+i.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()},f.togglePoint=function(a,b,c,d){a?this.selectPoint(b,c,d):this.unselectPoint(b,c,d)},f.selectPath=function(a,b){var c=this;c.config.data_onselected.call(c,b,a.node()),a.transition().duration(100).style("fill",function(){return c.d3.rgb(c.color(b)).brighter(.75)})},f.unselectPath=function(a,b){var c=this;c.config.data_onunselected.call(c,b,a.node()),a.transition().duration(100).style("fill",function(){return c.color(b)})},f.togglePath=function(a,b,c,d){a?this.selectPath(b,c,d):this.unselectPath(b,c,d)},f.getToggle=function(a,b){var c,d=this;return"circle"===a.nodeName?c=d.isStepType(b)?function(){}:d.togglePoint:"path"===a.nodeName&&(c=d.togglePath),c},f.toggleShape=function(a,b,c){var d=this,e=d.d3,f=d.config,g=e.select(a),h=g.classed(i.SELECTED),j=d.getToggle(a,b).bind(d);f.data_selection_enabled&&f.data_selection_isselectable(b)&&(f.data_selection_multiple||d.main.selectAll("."+i.shapes+(f.data_selection_grouped?d.getTargetSelectorSuffix(b.id):"")).selectAll("."+i.shape).each(function(a,b){var c=e.select(this);c.classed(i.SELECTED)&&j(!1,c.classed(i.SELECTED,!1),a,b)}),g.classed(i.SELECTED,!h),j(!h,g,b,c))},f.initBrush=function(){var a=this,b=a.d3;a.brush=b.svg.brush().on("brush",function(){a.redrawForBrush()}),a.brush.update=function(){return a.context&&a.context.select("."+i.brush).call(this),this},a.brush.scale=function(b){return a.config.axis_rotated?this.y(b):this.x(b)}},f.initSubchart=function(){var a=this,b=a.config,c=a.context=a.svg.append("g").attr("transform",a.getTranslate("context"));b.subchart_show||c.style("visibility","hidden"),c.append("g").attr("clip-path",a.clipPathForSubchart).attr("class",i.chart),c.select("."+i.chart).append("g").attr("class",i.chartBars),c.select("."+i.chart).append("g").attr("class",i.chartLines),c.append("g").attr("clip-path",a.clipPath).attr("class",i.brush).call(a.brush).selectAll("rect").attr(b.axis_rotated?"width":"height",b.axis_rotated?a.width2:a.height2),a.axes.subx=c.append("g").attr("class",i.axisX).attr("transform",a.getTranslate("subx")).attr("clip-path",b.axis_rotated?"":a.clipPathForXAxis)},f.updateTargetsForSubchart=function(a){var b,c,d,e,f=this,g=f.context,h=f.config,j=f.classChartBar.bind(f),k=f.classBars.bind(f),l=f.classChartLine.bind(f),m=f.classLines.bind(f),n=f.classAreas.bind(f);h.subchart_show&&(e=g.select("."+i.chartBars).selectAll("."+i.chartBar).data(a).attr("class",j),d=e.enter().append("g").style("opacity",0).attr("class",j),d.append("g").attr("class",k),c=g.select("."+i.chartLines).selectAll("."+i.chartLine).data(a).attr("class",l),b=c.enter().append("g").style("opacity",0).attr("class",l),b.append("g").attr("class",m),b.append("g").attr("class",n))},f.redrawSubchart=function(a,b,c,d,e,f,g){var h,j,k,l,m,n,o=this,p=o.d3,q=o.context,r=o.config,s=o.barData.bind(o),t=o.lineData.bind(o),u=o.classBar.bind(o),v=o.classLine.bind(o),w=o.classArea.bind(o),x=o.initialOpacity.bind(o);r.subchart_show&&(p.event&&"zoom"===p.event.type&&o.brush.extent(o.x.orgDomain()).update(),a&&(o.brush.empty()||o.brush.extent(o.x.orgDomain()).update(),l=o.generateDrawArea(e,!0),m=o.generateDrawBar(f,!0),n=o.generateDrawLine(g,!0),k=q.selectAll("."+i.bars).selectAll("."+i.bar).data(s),k.enter().append("path").attr("class",u).style("stroke","none").style("fill",o.color),k.style("opacity",x).transition().duration(c).attr("d",m).style("opacity",1),k.exit().transition().duration(c).style("opacity",0).remove(),h=q.selectAll("."+i.lines).selectAll("."+i.line).data(t),h.enter().append("path").attr("class",v).style("stroke",o.color),h.style("opacity",x).transition().duration(c).attr("d",n).style("opacity",1),h.exit().transition().duration(c).style("opacity",0).remove(),j=q.selectAll("."+i.areas).selectAll("."+i.area).data(t),j.enter().append("path").attr("class",w).style("fill",o.color).style("opacity",function(){return o.orgAreaOpacity=+p.select(this).style("opacity"),0}),j.style("opacity",0).transition().duration(c).attr("d",l).style("fill",o.color).style("opacity",o.orgAreaOpacity),j.exit().transition().duration(d).style("opacity",0).remove()))},f.redrawForBrush=function(){var a=this,b=a.x;a.redraw({withTransition:!1,withY:a.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),a.config.subchart_onbrush.call(a.api,b.orgDomain())},f.transformContext=function(a,b){var c,d=this;b&&b.axisSubX?c=b.axisSubX:(c=d.context.select("."+i.axisX),a&&(c=c.transition())),d.context.attr("transform",d.getTranslate("context")),c.attr("transform",d.getTranslate("subx"))},f.getDefaultExtent=function(){var a=this,b=a.config,c=k(b.axis_x_extent)?b.axis_x_extent(a.getXDomain(a.data.targets)):b.axis_x_extent;return a.isTimeSeries()&&(c=[a.parseDate(c[0]),a.parseDate(c[1])]),c},f.initZoom=function(){var a,b=this,c=b.d3,d=b.config;b.zoom=c.behavior.zoom().on("zoomstart",function(){a=c.event.sourceEvent,b.zoom.altDomain=c.event.sourceEvent.altKey?b.x.orgDomain():null,d.zoom_onzoomstart.call(b.api,c.event.sourceEvent)}).on("zoom",function(){b.redrawForZoom.call(b)}).on("zoomend",function(){var e=c.event.sourceEvent;e&&a.clientX===e.clientX&&a.clientY===e.clientY||(b.redrawEventRect(),b.updateZoom(),d.zoom_onzoomend.call(b.api,b.x.orgDomain()))}),b.zoom.scale=function(a){return d.axis_rotated?this.y(a):this.x(a)},b.zoom.orgScaleExtent=function(){var a=d.zoom_extent?d.zoom_extent:[1,10];return[a[0],Math.max(b.getMaxDataCount()/a[1],a[1])]},b.zoom.updateScaleExtent=function(){var a=q(b.x.orgDomain())/q(b.orgXDomain),c=this.orgScaleExtent();return this.scaleExtent([c[0]*a,c[1]*a]),this}},f.updateZoom=function(){var a=this,b=a.config.zoom_enabled?a.zoom:function(){};a.main.select("."+i.zoomRect).call(b).on("dblclick.zoom",null),a.main.selectAll("."+i.eventRect).call(b).on("dblclick.zoom",null)},f.redrawForZoom=function(){var a=this,b=a.d3,c=a.config,d=a.zoom,e=a.x;if(c.zoom_enabled&&0!==a.filterTargetsToShow(a.data.targets).length){if("mousemove"===b.event.sourceEvent.type&&d.altDomain)return e.domain(d.altDomain),void d.scale(e).updateScaleExtent();a.isCategorized()&&e.orgDomain()[0]===a.orgXDomain[0]&&e.domain([a.orgXDomain[0]-1e-10,e.orgDomain()[1]]),a.redraw({withTransition:!1,withY:c.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===b.event.sourceEvent.type&&(a.cancelClick=!0),c.zoom_onzoom.call(a.api,e.orgDomain())}},f.generateColor=function(){var a=this,b=a.config,c=a.d3,d=b.data_colors,e=s(b.color_pattern)?b.color_pattern:c.scale.category10().range(),f=b.data_color,g=[];return function(a){var b,c=a.id||a;return d[c]instanceof Function?b=d[c](a):d[c]?b=d[c]:(g.indexOf(c)<0&&g.push(c),b=e[g.indexOf(c)%e.length],d[c]=b),f instanceof Function?f(b,a):b}},f.generateLevelColor=function(){var a=this,b=a.config,c=b.color_pattern,d=b.color_threshold,e="value"===d.unit,f=d.values&&d.values.length?d.values:[],g=d.max||100;return s(b.color_threshold)?function(a){var b,d,h=c[c.length-1];for(b=0;b<f.length;b++)if(d=e?a:100*a/g,d<f[b]){h=c[b];break}return h}:null},f.getYFormat=function(a){var b=this,c=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.yFormat,d=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.y2Format;return function(a,e,f){var g="y2"===b.getAxisId(f)?d:c;return g.call(b,a,e)}},f.yFormat=function(a){var b=this,c=b.config,d=c.axis_y_tick_format?c.axis_y_tick_format:b.defaultValueFormat;return d(a)},f.y2Format=function(a){var b=this,c=b.config,d=c.axis_y2_tick_format?c.axis_y2_tick_format:b.defaultValueFormat;return d(a)},f.defaultValueFormat=function(a){return j(a)?+a:""},f.defaultArcValueFormat=function(a,b){return(100*b).toFixed(1)+"%"},f.formatByAxisId=function(a){var b=this,c=b.config.data_labels,d=function(a){return j(a)?+a:""};return"function"==typeof c.format?d=c.format:"object"==typeof c.format&&c.format[a]&&(d=c.format[a]),d},f.hasCaches=function(a){for(var b=0;b<a.length;b++)if(!(a[b]in this.cache))return!1;return!0},f.addCache=function(a,b){this.cache[a]=this.cloneTarget(b)},f.getCaches=function(a){var b,c=[];for(b=0;b<a.length;b++)a[b]in this.cache&&c.push(this.cloneTarget(this.cache[a[b]]));return c};var i=f.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};f.generateClass=function(a,b){return" "+a+" "+a+this.getTargetSelectorSuffix(b)},f.classText=function(a){return this.generateClass(i.text,a.index)},f.classTexts=function(a){return this.generateClass(i.texts,a.id)},f.classShape=function(a){return this.generateClass(i.shape,a.index)},f.classShapes=function(a){return this.generateClass(i.shapes,a.id)},f.classLine=function(a){return this.classShape(a)+this.generateClass(i.line,a.id)},f.classLines=function(a){return this.classShapes(a)+this.generateClass(i.lines,a.id)},f.classCircle=function(a){return this.classShape(a)+this.generateClass(i.circle,a.index)},f.classCircles=function(a){return this.classShapes(a)+this.generateClass(i.circles,a.id)},f.classBar=function(a){return this.classShape(a)+this.generateClass(i.bar,a.index)},f.classBars=function(a){return this.classShapes(a)+this.generateClass(i.bars,a.id)},f.classArc=function(a){return this.classShape(a.data)+this.generateClass(i.arc,a.data.id)},f.classArcs=function(a){return this.classShapes(a.data)+this.generateClass(i.arcs,a.data.id)},f.classArea=function(a){return this.classShape(a)+this.generateClass(i.area,a.id)},f.classAreas=function(a){return this.classShapes(a)+this.generateClass(i.areas,a.id)},f.classRegion=function(a,b){return this.generateClass(i.region,b)+" "+("class"in a?a["class"]:"")},f.classEvent=function(a){return this.generateClass(i.eventRect,a.index)},f.classTarget=function(a){var b=this,c=b.config.data_classes[a],d="";return c&&(d=" "+i.target+"-"+c),b.generateClass(i.target,a)+d},f.classFocus=function(a){return this.classFocused(a)+this.classDefocused(a)},f.classFocused=function(a){return" "+(this.focusedTargetIds.indexOf(a.id)>=0?i.focused:"")},f.classDefocused=function(a){return" "+(this.defocusedTargetIds.indexOf(a.id)>=0?i.defocused:"")},f.classChartText=function(a){return i.chartText+this.classTarget(a.id)},f.classChartLine=function(a){return i.chartLine+this.classTarget(a.id)},f.classChartBar=function(a){return i.chartBar+this.classTarget(a.id)},f.classChartArc=function(a){return i.chartArc+this.classTarget(a.data.id)},f.getTargetSelectorSuffix=function(a){return a||0===a?("-"+a).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},f.selectorTarget=function(a,b){return(b||"")+"."+i.target+this.getTargetSelectorSuffix(a)},f.selectorTargets=function(a,b){var c=this;return a=a||[],a.length?a.map(function(a){return c.selectorTarget(a,b)}):null},f.selectorLegend=function(a){return"."+i.legendItem+this.getTargetSelectorSuffix(a)},f.selectorLegends=function(a){var b=this;return a&&a.length?a.map(function(a){return b.selectorLegend(a)}):null};var j=f.isValue=function(a){return a||0===a},k=f.isFunction=function(a){return"function"==typeof a},l=f.isString=function(a){return"string"==typeof a},m=f.isUndefined=function(a){return"undefined"==typeof a},n=f.isDefined=function(a){return"undefined"!=typeof a},o=f.ceil10=function(a){return 10*Math.ceil(a/10)},p=f.asHalfPixel=function(a){return Math.ceil(a)+.5},q=f.diffDomain=function(a){return a[1]-a[0]},r=f.isEmpty=function(a){return!a||l(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length},s=f.notEmpty=function(a){return Object.keys(a).length>0},t=f.getOption=function(a,b,c){return n(a[b])?a[b]:c},u=f.hasValue=function(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c},v=f.getPathBox=function(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}};e.focus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),this.revert(),this.defocus(),b.classed(i.focused,!0).classed(i.defocused,!1),c.hasArcType()&&c.expandArc(a),c.toggleFocusLegend(a,!0),c.focusedTargetIds=a,c.defocusedTargetIds=c.defocusedTargetIds.filter(function(b){return a.indexOf(b)<0})},e.defocus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),this.revert(),b.classed(i.focused,!1).classed(i.defocused,!0),c.hasArcType()&&c.unexpandArc(a),c.toggleFocusLegend(a,!1),c.focusedTargetIds=c.focusedTargetIds.filter(function(b){return a.indexOf(b)<0}),c.defocusedTargetIds=a},e.revert=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a)),b.classed(i.focused,!1).classed(i.defocused,!1),c.hasArcType()&&c.unexpandArc(a),c.config.legend_show&&c.showLegend(a.filter(c.isLegendToShow.bind(c))),c.focusedTargetIds=[],c.defocusedTargetIds=[]},e.show=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.removeHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",1,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",1)}),b.withLegend&&d.showLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.hide=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.addHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",0,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",0)}),b.withLegend&&d.hideLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},e.toggle=function(a){var b=this,c=this.internal;c.mapToTargetIds(a).forEach(function(a){c.isTargetToShow(a)?b.hide(a):b.show(a)})},e.zoom=function(a){var b=this.internal;return a&&(b.isTimeSeries()&&(a=a.map(function(a){return b.parseDate(a)})),b.brush.extent(a),b.redraw({withUpdateXDomain:!0,withY:b.config.zoom_rescale}),b.config.zoom_onzoom.call(this,b.x.orgDomain())),b.brush.extent()},e.zoom.enable=function(a){var b=this.internal;b.config.zoom_enabled=a,b.updateAndRedraw()},e.unzoom=function(){var a=this.internal;a.brush.clear().update(),a.redraw({withUpdateXDomain:!0})},e.load=function(a){var b=this.internal,c=b.config;return a.xs&&b.addXs(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){c.data_classes[b]=a.classes[b]}),"categories"in a&&b.isCategorized()&&(c.axis_x_categories=a.categories),"axes"in a&&Object.keys(a.axes).forEach(function(b){c.data_axes[b]=a.axes[b]}),"cacheIds"in a&&b.hasCaches(a.cacheIds)?void b.load(b.getCaches(a.cacheIds),a.done):void("unload"in a?b.unload(b.mapToTargetIds("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){b.loadFromArgs(a)}):b.loadFromArgs(a))},e.unload=function(a){var b=this.internal;a=a||{},a instanceof Array?a={ids:a}:"string"==typeof a&&(a={ids:[a]}),b.unload(b.mapToTargetIds(a.ids),function(){b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.done&&a.done()})},e.flow=function(a){var b,c,d,e,f,g,h,i,k=this.internal,l=[],m=k.getMaxDataCount(),o=0,p=0;if(a.json)c=k.convertJsonToData(a.json,a.keys);else if(a.rows)c=k.convertRowsToData(a.rows);else{if(!a.columns)return;c=k.convertColumnsToData(a.columns)}b=k.convertDataToTargets(c,!0),k.data.targets.forEach(function(a){var c,d,e=!1;for(c=0;c<b.length;c++)if(a.id===b[c].id){for(e=!0,a.values[a.values.length-1]&&(p=a.values[a.values.length-1].index+1),o=b[c].values.length,d=0;o>d;d++)b[c].values[d].index=p+d,k.isTimeSeries()||(b[c].values[d].x=p+d);a.values=a.values.concat(b[c].values),b.splice(c,1);break}e||l.push(a.id)}),k.data.targets.forEach(function(a){var b,c;for(b=0;b<l.length;b++)if(a.id===l[b])for(p=a.values[a.values.length-1].index+1,c=0;o>c;c++)a.values.push({id:a.id,index:p+c,x:k.isTimeSeries()?k.getOtherTargetX(p+c):p+c,value:null})}),k.data.targets.length&&b.forEach(function(a){var b,c=[];for(b=k.data.targets[0].values[0].index;p>b;b++)c.push({id:a.id,index:b,x:k.isTimeSeries()?k.getOtherTargetX(b):b,value:null});a.values.forEach(function(a){a.index+=p,k.isTimeSeries()||(a.x+=p)}),a.values=c.concat(a.values)}),k.data.targets=k.data.targets.concat(b),d=k.getMaxDataCount(),f=k.data.targets[0],g=f.values[0],n(a.to)?(o=0,i=k.isTimeSeries()?k.parseDate(a.to):a.to,f.values.forEach(function(a){a.x<i&&o++})):n(a.length)&&(o=a.length),m?1===m&&k.isTimeSeries()&&(h=(f.values[f.values.length-1].x-g.x)/2,e=[new Date(+g.x-h),new Date(+g.x+h)],k.updateXDomain(null,!0,!0,!1,e)):(h=k.isTimeSeries()?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-k.getXDomain(k.data.targets)[0]:1,e=[g.x-h,g.x],k.updateXDomain(null,!0,!0,!1,e)),k.updateTargets(k.data.targets),k.redraw({flow:{index:g.index,length:o,duration:j(a.duration)?a.duration:k.config.transition_duration,done:a.done,orgDataCount:m},withLegend:!0,withTransition:m>1,withTrimXDomain:!1,withUpdateXAxis:!0})},f.generateFlow=function(a){var b=this,c=b.config,d=b.d3;return function(){var e,f,g,h=a.targets,j=a.flow,k=a.drawBar,l=a.drawLine,m=a.drawArea,n=a.cx,o=a.cy,p=a.xv,r=a.xForText,s=a.yForText,t=a.duration,u=1,v=j.index,w=j.length,x=b.getValueOnIndex(b.data.targets[0].values,v),y=b.getValueOnIndex(b.data.targets[0].values,v+w),z=b.x.domain(),A=j.duration||t,B=j.done||function(){},C=b.generateWait(),D=b.xgrid||d.selectAll([]),E=b.xgridLines||d.selectAll([]),F=b.mainRegion||d.selectAll([]),G=b.mainText||d.selectAll([]),H=b.mainBar||d.selectAll([]),I=b.mainLine||d.selectAll([]),J=b.mainArea||d.selectAll([]),K=b.mainCircle||d.selectAll([]);b.flowing=!0,b.data.targets.forEach(function(a){a.values.splice(0,w)}),g=b.updateXDomain(h,!0,!0),b.updateXGrid&&b.updateXGrid(!0),j.orgDataCount?e=1===j.orgDataCount||x.x===y.x?b.x(z[0])-b.x(g[0]):b.isTimeSeries()?b.x(z[0])-b.x(g[0]):b.x(x.x)-b.x(y.x):1!==b.data.targets[0].values.length?e=b.x(z[0])-b.x(g[0]):b.isTimeSeries()?(x=b.getValueOnIndex(b.data.targets[0].values,0),y=b.getValueOnIndex(b.data.targets[0].values,b.data.targets[0].values.length-1),e=b.x(x.x)-b.x(y.x)):e=q(g)/2,u=q(z)/q(g),f="translate("+e+",0) scale("+u+",1)",b.hideXGridFocus(),b.hideTooltip(),d.transition().ease("linear").duration(A).each(function(){C.add(b.axes.x.transition().call(b.xAxis)),C.add(H.transition().attr("transform",f)),C.add(I.transition().attr("transform",f)),C.add(J.transition().attr("transform",f)),C.add(K.transition().attr("transform",f)),C.add(G.transition().attr("transform",f)),C.add(F.filter(b.isRegionOnX).transition().attr("transform",f)),C.add(D.transition().attr("transform",f)),C.add(E.transition().attr("transform",f))}).call(C,function(){var a,d=[],e=[],f=[];if(w){for(a=0;w>a;a++)d.push("."+i.shape+"-"+(v+a)),e.push("."+i.text+"-"+(v+a)),f.push("."+i.eventRect+"-"+(v+a));b.svg.selectAll("."+i.shapes).selectAll(d).remove(),b.svg.selectAll("."+i.texts).selectAll(e).remove(),b.svg.selectAll("."+i.eventRects).selectAll(f).remove(),b.svg.select("."+i.xgrid).remove()}D.attr("transform",null).attr(b.xgridAttr),E.attr("transform",null),E.select("line").attr("x1",c.axis_rotated?0:p).attr("x2",c.axis_rotated?b.width:p),E.select("text").attr("x",c.axis_rotated?b.width:0).attr("y",p),H.attr("transform",null).attr("d",k),I.attr("transform",null).attr("d",l),J.attr("transform",null).attr("d",m),K.attr("transform",null).attr("cx",n).attr("cy",o),G.attr("transform",null).attr("x",r).attr("y",s).style("fill-opacity",b.opacityForText.bind(b)),F.attr("transform",null),F.select("rect").filter(b.isRegionOnX).attr("x",b.regionX.bind(b)).attr("width",b.regionWidth.bind(b)),c.interaction_enabled&&b.redrawEventRect(),B(),b.flowing=!1})}},e.selected=function(a){var b=this.internal,c=b.d3;return c.merge(b.main.selectAll("."+i.shapes+b.getTargetSelectorSuffix(a)).selectAll("."+i.shape).filter(function(){return c.select(this).classed(i.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},e.select=function(a,b,c){var d=this.internal,e=d.d3,f=d.config;f.data_selection_enabled&&d.main.selectAll("."+i.shapes).selectAll("."+i.shape).each(function(g,h){var j=e.select(this),k=g.data?g.data.id:g.id,l=d.getToggle(this,g).bind(d),m=f.data_selection_grouped||!a||a.indexOf(k)>=0,o=!b||b.indexOf(h)>=0,p=j.classed(i.SELECTED);j.classed(i.line)||j.classed(i.area)||(m&&o?f.data_selection_isselectable(g)&&!p&&l(!0,j.classed(i.SELECTED,!0),g,h):n(c)&&c&&p&&l(!1,j.classed(i.SELECTED,!1),g,h))})},e.unselect=function(a,b){var c=this.internal,d=c.d3,e=c.config;e.data_selection_enabled&&c.main.selectAll("."+i.shapes).selectAll("."+i.shape).each(function(f,g){var h=d.select(this),j=f.data?f.data.id:f.id,k=c.getToggle(this,f).bind(c),l=e.data_selection_grouped||!a||a.indexOf(j)>=0,m=!b||b.indexOf(g)>=0,n=h.classed(i.SELECTED);h.classed(i.line)||h.classed(i.area)||l&&m&&e.data_selection_isselectable(f)&&n&&k(!1,h.classed(i.SELECTED,!1),f,g)})},e.transform=function(a,b){var c=this.internal,d=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;c.transformTo(b,a,d)},f.transformTo=function(a,b,c){var d=this,e=!d.hasArcType(),f=c||{withTransitionForAxis:e};f.withTransitionForTransform=!1,d.transiting=!1,d.setTargetType(a,b),d.updateAndRedraw(f)},e.groups=function(a){var b=this.internal,c=b.config;return m(a)?c.data_groups:(c.data_groups=a,b.redraw(),c.data_groups)},e.xgrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_x_lines=a,b.redrawWithoutRescale(),c.grid_x_lines):c.grid_x_lines},e.xgrids.add=function(a){var b=this.internal;return this.xgrids(b.config.grid_x_lines.concat(a?a:[]))},e.xgrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!0)},e.ygrids=function(a){var b=this.internal,c=b.config;
5
- return a?(c.grid_y_lines=a,b.redrawWithoutRescale(),c.grid_y_lines):c.grid_y_lines},e.ygrids.add=function(a){var b=this.internal;return this.ygrids(b.config.grid_y_lines.concat(a?a:[]))},e.ygrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!1)},e.regions=function(a){var b=this.internal,c=b.config;return a?(c.regions=a,b.redrawWithoutRescale(),c.regions):c.regions},e.regions.add=function(a){var b=this.internal,c=b.config;return a?(c.regions=c.regions.concat(a),b.redrawWithoutRescale(),c.regions):c.regions},e.regions.remove=function(a){var b,c,d,e=this.internal,f=e.config;return a=a||{},b=e.getOption(a,"duration",f.transition_duration),c=e.getOption(a,"classes",[i.region]),d=e.main.select("."+i.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),f.regions=f.regions.filter(function(a){var b=!1;return a["class"]?(a["class"].split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0}),f.regions},e.data=function(a){var b=this.internal.data.targets;return"undefined"==typeof a?b:b.filter(function(b){return[].concat(a).indexOf(b.id)>=0})},e.data.shown=function(a){return this.internal.filterTargetsToShow(this.data(a))},e.data.values=function(a){var b,c=null;return a&&(b=this.data(a),c=b[0]?b[0].values.map(function(a){return a.value}):null),c},e.data.names=function(a){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",a)},e.data.colors=function(a){return this.internal.updateDataAttributes("colors",a)},e.data.axes=function(a){return this.internal.updateDataAttributes("axes",a)},e.category=function(a,b){var c=this.internal,d=c.config;return arguments.length>1&&(d.axis_x_categories[a]=b,c.redraw()),d.axis_x_categories[a]},e.categories=function(a){var b=this.internal,c=b.config;return arguments.length?(c.axis_x_categories=a,b.redraw(),c.axis_x_categories):c.axis_x_categories},e.color=function(a){var b=this.internal;return b.color(a)},e.x=function(a){var b=this.internal;return arguments.length&&(b.updateTargetX(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},e.xs=function(a){var b=this.internal;return arguments.length&&(b.updateTargetXs(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},e.axis=function(){},e.axis.labels=function(a){var b=this.internal;arguments.length&&(Object.keys(a).forEach(function(c){b.setAxisLabelText(c,a[c])}),b.updateAxisLabels())},e.axis.max=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(j(a.x)&&(c.axis_x_max=a.x),j(a.y)&&(c.axis_y_max=a.y),j(a.y2)&&(c.axis_y2_max=a.y2)):c.axis_y_max=c.axis_y2_max=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_max,y:c.axis_y_max,y2:c.axis_y2_max}},e.axis.min=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(j(a.x)&&(c.axis_x_min=a.x),j(a.y)&&(c.axis_y_min=a.y),j(a.y2)&&(c.axis_y2_min=a.y2)):c.axis_y_min=c.axis_y2_min=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_min,y:c.axis_y_min,y2:c.axis_y2_min}},e.axis.range=function(a){return arguments.length?(n(a.max)&&this.axis.max(a.max),void(n(a.min)&&this.axis.min(a.min))):{max:this.axis.max(),min:this.axis.min()}},e.legend=function(){},e.legend.show=function(a){var b=this.internal;b.showLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},e.legend.hide=function(a){var b=this.internal;b.hideLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},e.resize=function(a){var b=this.internal,c=b.config;c.size_width=a?a.width:null,c.size_height=a?a.height:null,this.flush()},e.flush=function(){var a=this.internal;a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},e.destroy=function(){var b=this.internal;b.data.targets=void 0,b.data.xs={},b.selectChart.classed("c3",!1).html(""),a.clearInterval(b.intervalForObserveInserted),a.onresize=null},e.tooltip=function(){},e.tooltip.show=function(a){var b,c,d=this.internal;a.mouse&&(c=a.mouse),a.data?d.isMultipleX()?(c=[d.x(a.data.x),d.getYScale(a.data.id)(a.data.value)],b=null):b=j(a.data.index)?a.data.index:d.getIndexByX(a.data.x):"undefined"!=typeof a.x?b=d.getIndexByX(a.x):"undefined"!=typeof a.index&&(b=a.index),d.dispatchEvent("mouseover",b,c),d.dispatchEvent("mousemove",b,c)},e.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0)};var w;"function"==typeof define&&define.amd?define("c3",["d3"],g):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=g:a.c3=g}(window);
 
1
+ !function(a){"use strict";function b(a){this.owner=a}function c(a,b){if(Object.create)b.prototype=Object.create(a.prototype);else{var c=function(){};c.prototype=a.prototype,b.prototype=new c}return b.prototype.constructor=b,b}function d(a){var b=this.internal=new e(this);b.loadConfig(a),b.beforeInit(a),b.init(),b.afterInit(a),function c(a,b,d){Object.keys(a).forEach(function(e){b[e]=a[e].bind(d),Object.keys(a[e]).length>0&&c(a[e],b[e],d)})}(h,this,this)}function e(b){var c=this;c.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}function f(a){b.call(this,a)}function g(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+u)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,n);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=p.copy();return b.isCategory&&(a=p.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var b=m?m(a):a;return"undefined"!=typeof b?b:""}function i(a){if(A)return A;var b={h:11.5,w:5.5};return a.select("text").text(h).each(function(a){var c=this.getBoundingClientRect(),d=h(a),e=c.height,f=d?c.width/d.length:void 0;e&&f&&(b.h=e,b.w=f)}).text(""),A=b,b}function j(c){return b.withoutTransition?c:a.transition(c)}function k(m){m.each(function(){function m(a,c){function d(a,b){f=void 0;for(var h=1;h<b.length;h++)if(" "===b.charAt(h)&&(f=h),e=b.substr(0,h+1),g=U.w*e.length,g>c)return d(a.concat(b.substr(0,f?f:h)),b.slice(f?f+1:h));return a.concat(b)}var e,f,g,i=h(a),j=[];return"[object Array]"===Object.prototype.toString.call(i)?i:((!c||0>=c)&&(c=X?95:b.isCategory?Math.ceil(F(G[1])-F(G[0]))-12:110),d(j,i+""))}function n(a,b){var c=U.h;return 0===b&&(c="left"===q||"right"===q?-((V[a.index]-1)*(U.h/2)-3):".71em"),c}function v(a){var b=p(a)+(o?0:u);return L[0]<b&&b<L[1]?r:0}function w(a){return a?a>0?"start":"end":"middle"}function x(a){return a?"rotate("+a+")":""}function y(a){return a?8*Math.sin(Math.PI*(a/180)):0}function z(a){return a?11.5-2.5*(a/15)*(a>0?1:-1):W}var A,B,C,D=k.g=a.select(this),E=this.__chart__||p,F=this.__chart__=g(),G=t?t:f(F),H=D.selectAll(".tick").data(G,F),I=H.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),J=H.exit().remove(),K=j(H).style("opacity",1),L=p.rangeExtent?p.rangeExtent():e(p.range()),M=D.selectAll(".domain").data([0]),N=(M.enter().append("path").attr("class","domain"),j(M));I.append("line"),I.append("text");var O=I.select("line"),P=K.select("line"),Q=I.select("text"),R=K.select("text");b.isCategory?(u=Math.ceil((F(1)-F(0))/2),B=o?0:u,C=o?u:0):u=B=0;var S,T,U=i(D.select(".tick")),V=[],W=Math.max(r,0)+s,X="left"===q||"right"===q;S=H.select("text"),T=S.selectAll("tspan").data(function(a,c){var d=b.tickMultiline?m(a,b.tickWidth):[].concat(h(a));return V[c]=d.length,d.map(function(a){return{index:c,splitted:a}})}),T.enter().append("tspan"),T.exit().remove(),T.text(function(a){return a.splitted});var Y=b.tickTextRotate;switch(q){case"bottom":A=c,O.attr("y2",r),Q.attr("y",W),P.attr("x1",B).attr("x2",B).attr("y2",v),R.attr("x",0).attr("y",z(Y)).style("text-anchor",w(Y)).attr("transform",x(Y)),T.attr("x",0).attr("dy",n).attr("dx",y(Y)),N.attr("d","M"+L[0]+","+l+"V0H"+L[1]+"V"+l);break;case"top":A=c,O.attr("y2",-r),Q.attr("y",-W),P.attr("x2",0).attr("y2",-r),R.attr("x",0).attr("y",-W),S.style("text-anchor","middle"),T.attr("x",0).attr("dy","0em"),N.attr("d","M"+L[0]+","+-l+"V0H"+L[1]+"V"+-l);break;case"left":A=d,O.attr("x2",-r),Q.attr("x",-W),P.attr("x2",-r).attr("y1",C).attr("y2",C),R.attr("x",-W).attr("y",u),S.style("text-anchor","end"),T.attr("x",-W).attr("dy",n),N.attr("d","M"+-l+","+L[0]+"H0V"+L[1]+"H"+-l);break;case"right":A=d,O.attr("x2",r),Q.attr("x",W),P.attr("x2",r).attr("y2",0),R.attr("x",W).attr("y",0),S.style("text-anchor","start"),T.attr("x",W).attr("dy",n),N.attr("d","M"+l+","+L[0]+"H0V"+L[1]+"H"+l)}if(F.rangeBand){var Z=F,$=Z.rangeBand()/2;E=F=function(a){return Z(a)+$}}else E.rangeBand?E=F:J.call(A,F);I.call(A,E),K.call(A,F)})}var l,m,n,o,p=a.scale.linear(),q="bottom",r=6,s=3,t=null,u=0,v=!0;return b=b||{},l=b.withOuterTick?6:0,k.scale=function(a){return arguments.length?(p=a,k):p},k.orient=function(a){return arguments.length?(q=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",k):q},k.tickFormat=function(a){return arguments.length?(m=a,k):m},k.tickCentered=function(a){return arguments.length?(o=a,k):o},k.tickOffset=function(){return u},k.tickInterval=function(){var a,c;return b.isCategory?a=2*u:(c=k.g.select("path.domain").node().getTotalLength()-2*l,a=c/k.g.selectAll("line").size()),a===1/0?0:a},k.ticks=function(){return arguments.length?(n=arguments,k):n},k.tickCulling=function(a){return arguments.length?(v=a,k):v},k.tickValues=function(a){if("function"==typeof a)t=function(){return a(p.domain())};else{if(!arguments.length)return t;t=a}return k},k}var h,i,j,k={version:"0.4.11"};k.generate=function(a){return new d(a)},k.chart={fn:d.prototype,internal:{fn:e.prototype,axis:{fn:f.prototype}}},h=k.chart.fn,i=k.chart.internal.fn,j=k.chart.internal.axis.fn,i.beforeInit=function(){},i.afterInit=function(){},i.init=function(){var a=this,b=a.config;if(a.initParams(),b.data_url)a.convertUrlToData(b.data_url,b.data_mimeType,b.data_headers,b.data_keys,a.initWithData);else if(b.data_json)a.initWithData(a.convertJsonToData(b.data_json,b.data_keys));else if(b.data_rows)a.initWithData(a.convertRowsToData(b.data_rows));else{if(!b.data_columns)throw Error("url or json or rows or columns is required.");a.initWithData(a.convertColumnsToData(b.data_columns))}},i.initParams=function(){var a=this,b=a.d3,c=a.config;a.clipId="c3-"+ +new Date+"-clip",a.clipIdForXAxis=a.clipId+"-xaxis",a.clipIdForYAxis=a.clipId+"-yaxis",a.clipIdForGrid=a.clipId+"-grid",a.clipIdForSubchart=a.clipId+"-subchart",a.clipPath=a.getClipPath(a.clipId),a.clipPathForXAxis=a.getClipPath(a.clipIdForXAxis),a.clipPathForYAxis=a.getClipPath(a.clipIdForYAxis),a.clipPathForGrid=a.getClipPath(a.clipIdForGrid),a.clipPathForSubchart=a.getClipPath(a.clipIdForSubchart),a.dragStart=null,a.dragging=!1,a.flowing=!1,a.cancelClick=!1,a.mouseover=!1,a.transiting=!1,a.color=a.generateColor(),a.levelColor=a.generateLevelColor(),a.dataTimeFormat=c.data_xLocaltime?b.time.format:b.time.format.utc,a.axisTimeFormat=c.axis_x_localtime?b.time.format:b.time.format.utc,a.defaultAxisTimeFormat=a.axisTimeFormat.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),a.hiddenTargetIds=[],a.hiddenLegendIds=[],a.focusedTargetIds=[],a.defocusedTargetIds=[],a.xOrient=c.axis_rotated?"left":"bottom",a.yOrient=c.axis_rotated?c.axis_y_inner?"top":"bottom":c.axis_y_inner?"right":"left",a.y2Orient=c.axis_rotated?c.axis_y2_inner?"bottom":"top":c.axis_y2_inner?"left":"right",a.subXOrient=c.axis_rotated?"left":"bottom",a.isLegendRight="right"===c.legend_position,a.isLegendInset="inset"===c.legend_position,a.isLegendTop="top-left"===c.legend_inset_anchor||"top-right"===c.legend_inset_anchor,a.isLegendLeft="top-left"===c.legend_inset_anchor||"bottom-left"===c.legend_inset_anchor,a.legendStep=0,a.legendItemWidth=0,a.legendItemHeight=0,a.currentMaxTickWidths={x:0,y:0,y2:0},a.rotated_padding_left=30,a.rotated_padding_right=c.axis_rotated&&!c.axis_x_show?0:30,a.rotated_padding_top=5,a.withoutFadeIn={},a.intervalForObserveInserted=void 0,a.axes.subx=b.selectAll([])},i.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},i.initWithData=function(a){var b,c,d=this,e=d.d3,g=d.config,h=!0;d.axis=new f(d),d.initPie&&d.initPie(),d.initBrush&&d.initBrush(),d.initZoom&&d.initZoom(),g.bindto?"function"==typeof g.bindto.node?d.selectChart=g.bindto:d.selectChart=e.select(g.bindto):d.selectChart=e.selectAll([]),d.selectChart.empty()&&(d.selectChart=e.select(document.createElement("div")).style("opacity",0),d.observeInserted(d.selectChart),h=!1),d.selectChart.html("").classed("c3",!0),d.data.xs={},d.data.targets=d.convertDataToTargets(a),g.data_filter&&(d.data.targets=d.data.targets.filter(g.data_filter)),g.data_hide&&d.addHiddenTargetIds(g.data_hide===!0?d.mapToIds(d.data.targets):g.data_hide),g.legend_hide&&d.addHiddenLegendIds(g.legend_hide===!0?d.mapToIds(d.data.targets):g.legend_hide),d.hasType("gauge")&&(g.legend_show=!1),d.updateSizes(),d.updateScales(),d.x.domain(e.extent(d.getXDomain(d.data.targets))),d.y.domain(d.getYDomain(d.data.targets,"y")),d.y2.domain(d.getYDomain(d.data.targets,"y2")),d.subX.domain(d.x.domain()),d.subY.domain(d.y.domain()),d.subY2.domain(d.y2.domain()),d.orgXDomain=d.x.domain(),d.brush&&d.brush.scale(d.subX),g.zoom_enabled&&d.zoom.scale(d.x),d.svg=d.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return g.onmouseover.call(d)}).on("mouseleave",function(){return g.onmouseout.call(d)}),d.config.svg_classname&&d.svg.attr("class",d.config.svg_classname),b=d.svg.append("defs"),d.clipChart=d.appendClip(b,d.clipId),d.clipXAxis=d.appendClip(b,d.clipIdForXAxis),d.clipYAxis=d.appendClip(b,d.clipIdForYAxis),d.clipGrid=d.appendClip(b,d.clipIdForGrid),d.clipSubchart=d.appendClip(b,d.clipIdForSubchart),d.updateSvgSize(),c=d.main=d.svg.append("g").attr("transform",d.getTranslate("main")),d.initSubchart&&d.initSubchart(),d.initTooltip&&d.initTooltip(),d.initLegend&&d.initLegend(),d.initTitle&&d.initTitle(),c.append("text").attr("class",l.text+" "+l.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),d.initRegion(),d.initGrid(),c.append("g").attr("clip-path",d.clipPath).attr("class",l.chart),g.grid_lines_front&&d.initGridLines(),d.initEventRect(),d.initChartElements(),c.insert("rect",g.zoom_privileged?null:"g."+l.regions).attr("class",l.zoomRect).attr("width",d.width).attr("height",d.height).style("opacity",0).on("dblclick.zoom",null),g.axis_x_extent&&d.brush.extent(d.getDefaultExtent()),d.axis.init(),d.updateTargets(d.data.targets),h&&(d.updateDimension(),d.config.oninit.call(d),d.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),d.bindResize(),d.api.element=d.selectChart.node()},i.smoothLines=function(a,b){var c=this;"grid"===b&&a.each(function(){var a=c.d3.select(this),b=a.attr("x1"),d=a.attr("x2"),e=a.attr("y1"),f=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(d),y1:Math.ceil(e),y2:Math.ceil(f)})})},i.updateSizes=function(){var a=this,b=a.config,c=a.legend?a.getLegendHeight():0,d=a.legend?a.getLegendWidth():0,e=a.isLegendRight||a.isLegendInset?0:c,f=a.hasArcType(),g=b.axis_rotated||f?0:a.getHorizontalAxisHeight("x"),h=b.subchart_show&&!f?b.subchart_size_height+g:0;a.currentWidth=a.getCurrentWidth(),a.currentHeight=a.getCurrentHeight(),a.margin=b.axis_rotated?{top:a.getHorizontalAxisHeight("y2")+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:a.getHorizontalAxisHeight("y")+e+a.getCurrentPaddingBottom(),left:h+(f?0:a.getCurrentPaddingLeft())}:{top:4+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:g+h+e+a.getCurrentPaddingBottom(),left:f?0:a.getCurrentPaddingLeft()},a.margin2=b.axis_rotated?{top:a.margin.top,right:NaN,bottom:20+e,left:a.rotated_padding_left}:{top:a.currentHeight-h-e,right:NaN,bottom:g+e,left:a.margin.left},a.margin3={top:0,right:NaN,bottom:0,left:0},a.updateSizeForLegend&&a.updateSizeForLegend(c,d),a.width=a.currentWidth-a.margin.left-a.margin.right,a.height=a.currentHeight-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=b.axis_rotated?a.margin.left-a.rotated_padding_left-a.rotated_padding_right:a.width,a.height2=b.axis_rotated?a.height:a.currentHeight-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0),a.arcWidth=a.width-(a.isLegendRight?d+10:0),a.arcHeight=a.height-(a.isLegendRight?0:10),a.hasType("gauge")&&!b.gauge_fullCircle&&(a.arcHeight+=a.height-a.getGaugeLabelHeight()),a.updateRadius&&a.updateRadius(),a.isLegendRight&&f&&(a.margin3.left=a.arcWidth/2+1.1*a.radiusExpanded)},i.updateTargets=function(a){var b=this;b.updateTargetsForText(a),b.updateTargetsForBar(a),b.updateTargetsForLine(a),b.hasArcType()&&b.updateTargetsForArc&&b.updateTargetsForArc(a),b.updateTargetsForSubchart&&b.updateTargetsForSubchart(a),b.showTargets()},i.showTargets=function(){var a=this;a.svg.selectAll("."+l.target).filter(function(b){return a.isTargetToShow(b.id)}).transition().duration(a.config.transition_duration).style("opacity",1)},i.redraw=function(a,b){var c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,v,x,y,z,A,B,C,D,E,F,G,H=this,I=H.main,J=H.d3,K=H.config,L=H.getShapeIndices(H.isAreaType),M=H.getShapeIndices(H.isBarType),N=H.getShapeIndices(H.isLineType),O=H.hasArcType(),P=H.filterTargetsToShow(H.data.targets),Q=H.xv.bind(H);if(a=a||{},c=w(a,"withY",!0),d=w(a,"withSubchart",!0),e=w(a,"withTransition",!0),h=w(a,"withTransform",!1),i=w(a,"withUpdateXDomain",!1),j=w(a,"withUpdateOrgXDomain",!1),k=w(a,"withTrimXDomain",!0),p=w(a,"withUpdateXAxis",i),m=w(a,"withLegend",!1),n=w(a,"withEventRect",!0),o=w(a,"withDimension",!0),f=w(a,"withTransitionForExit",e),g=w(a,"withTransitionForAxis",e),v=e?K.transition_duration:0,x=f?v:0,y=g?v:0,b=b||H.axis.generateTransitions(y),m&&K.legend_show?H.updateLegend(H.mapToIds(H.data.targets),a,b):o&&H.updateDimension(!0),H.isCategorized()&&0===P.length&&H.x.domain([0,H.axes.x.selectAll(".tick").size()]),P.length?(H.updateXDomain(P,i,j,k),K.axis_x_tick_values||(B=H.axis.updateXAxisTickValues(P))):(H.xAxis.tickValues([]),H.subXAxis.tickValues([])),K.zoom_rescale&&!a.flow&&(E=H.x.orgDomain()),H.y.domain(H.getYDomain(P,"y",E)),H.y2.domain(H.getYDomain(P,"y2",E)),!K.axis_y_tick_values&&K.axis_y_tick_count&&H.yAxis.tickValues(H.axis.generateTickValues(H.y.domain(),K.axis_y_tick_count)),!K.axis_y2_tick_values&&K.axis_y2_tick_count&&H.y2Axis.tickValues(H.axis.generateTickValues(H.y2.domain(),K.axis_y2_tick_count)),H.axis.redraw(b,O),H.axis.updateLabels(e),(i||p)&&P.length)if(K.axis_x_tick_culling&&B){for(C=1;C<B.length;C++)if(B.length/C<K.axis_x_tick_culling_max){D=C;break}H.svg.selectAll("."+l.axisX+" .tick text").each(function(a){var b=B.indexOf(a);b>=0&&J.select(this).style("display",b%D?"none":"block")})}else H.svg.selectAll("."+l.axisX+" .tick text").style("display","block");q=H.generateDrawArea?H.generateDrawArea(L,!1):void 0,r=H.generateDrawBar?H.generateDrawBar(M):void 0,s=H.generateDrawLine?H.generateDrawLine(N,!1):void 0,t=H.generateXYForText(L,M,N,!0),u=H.generateXYForText(L,M,N,!1),c&&(H.subY.domain(H.getYDomain(P,"y")),H.subY2.domain(H.getYDomain(P,"y2"))),H.updateXgridFocus(),I.select("text."+l.text+"."+l.empty).attr("x",H.width/2).attr("y",H.height/2).text(K.data_empty_label_text).transition().style("opacity",P.length?0:1),H.updateGrid(v),H.updateRegion(v),H.updateBar(x),H.updateLine(x),H.updateArea(x),H.updateCircle(),H.hasDataLabel()&&H.updateText(x),H.redrawTitle&&H.redrawTitle(),H.redrawArc&&H.redrawArc(v,x,h),H.redrawSubchart&&H.redrawSubchart(d,b,v,x,L,M,N),I.selectAll("."+l.selectedCircles).filter(H.isBarType.bind(H)).selectAll("circle").remove(),K.interaction_enabled&&!a.flow&&n&&(H.redrawEventRect(),H.updateZoom&&H.updateZoom()),H.updateCircleY(),F=(H.config.axis_rotated?H.circleY:H.circleX).bind(H),G=(H.config.axis_rotated?H.circleX:H.circleY).bind(H),a.flow&&(A=H.generateFlow({targets:P,flow:a.flow,duration:a.flow.duration,drawBar:r,drawLine:s,drawArea:q,cx:F,cy:G,xv:Q,xForText:t,yForText:u})),(v||A)&&H.isTabVisible()?J.transition().duration(v).each(function(){var b=[];[H.redrawBar(r,!0),H.redrawLine(s,!0),H.redrawArea(q,!0),H.redrawCircle(F,G,!0),H.redrawText(t,u,a.flow,!0),H.redrawRegion(!0),H.redrawGrid(!0)].forEach(function(a){a.forEach(function(a){b.push(a)})}),z=H.generateWait(),b.forEach(function(a){z.add(a)})}).call(z,function(){A&&A(),K.onrendered&&K.onrendered.call(H)}):(H.redrawBar(r),H.redrawLine(s),H.redrawArea(q),H.redrawCircle(F,G),H.redrawText(t,u,a.flow),H.redrawRegion(),H.redrawGrid(),K.onrendered&&K.onrendered.call(H)),H.mapToIds(H.data.targets).forEach(function(a){H.withoutFadeIn[a]=!0})},i.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=w(a,"withTransition",!0),a.withTransform=w(a,"withTransform",!1),a.withLegend=w(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=w(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d.legend_show||(b=c.axis.generateTransitions(a.withTransitionForAxis?d.transition_duration:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},i.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},i.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},i.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},i.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b.data_x||v(b.data_xs))},i.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},i.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=s(d.margin.left),c=s(d.margin.top)):"context"===a?(b=s(d.margin2.left),c=s(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e.axis_rotated?0:d.height):"y"===a?(b=0,c=e.axis_rotated?d.height:0):"y2"===a?(b=e.axis_rotated?0:d.width,c=e.axis_rotated?1:0):"subx"===a?(b=0,c=e.axis_rotated?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},i.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},i.initialOpacityForCircle=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?this.opacityForCircle(a):0},i.opacityForCircle=function(a){var b=this.config.point_show?1:0;return m(a.value)?this.isScatterType(a)?.5:b:0},i.opacityForText=function(){return this.hasDataLabel()?1:0},i.xx=function(a){return a?this.x(a.x):null},i.xv=function(a){var b=this,c=a.value;return b.isTimeSeries()?c=b.parseDate(a.value):b.isCategorized()&&"string"==typeof a.value&&(c=b.config.axis_x_categories.indexOf(a.value)),Math.ceil(b.x(c))},i.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},i.subxx=function(a){return a?this.subX(a.x):null},i.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+l.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+l.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+l.axisY2),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+l.chartArcs).attr("transform",f.getTranslate("arc"))},i.transformAll=function(a,b){var c=this;c.transformMain(a,b),c.config.subchart_show&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},i.updateSvgSize=function(){var a=this,b=a.svg.select(".c3-brush .background");a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.selectAll(["#"+a.clipId,"#"+a.clipIdForGrid]).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",a.getXAxisClipX.bind(a)).attr("y",a.getXAxisClipY.bind(a)).attr("width",a.getXAxisClipWidth.bind(a)).attr("height",a.getXAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",a.getYAxisClipX.bind(a)).attr("y",a.getYAxisClipY.bind(a)).attr("width",a.getYAxisClipWidth.bind(a)).attr("height",a.getYAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForSubchart).select("rect").attr("width",a.width).attr("height",b.size()?b.attr("height"):0),a.svg.select("."+l.zoomRect).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},i.updateDimension=function(a){var b=this;a||(b.config.axis_rotated?(b.axes.x.call(b.xAxis),b.axes.subx.call(b.subXAxis)):(b.axes.y.call(b.yAxis),b.axes.y2.call(b.y2Axis))),b.updateSizes(),b.updateScales(),b.updateSvgSize(),b.transformAll(!1)},i.observeInserted=function(b){var c,d=this;return"undefined"==typeof MutationObserver?void a.console.error("MutationObserver not defined."):(c=new MutationObserver(function(e){e.forEach(function(e){"childList"===e.type&&e.previousSibling&&(c.disconnect(),d.intervalForObserveInserted=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(d.intervalForObserveInserted),d.updateDimension(),d.brush&&d.brush.update(),d.config.oninit.call(d),d.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10))})}),void c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0}))},i.bindResize=function(){var b=this,c=b.config;if(b.resizeFunction=b.generateResize(),b.resizeFunction.add(function(){c.onresize.call(b)}),c.resize_auto&&b.resizeFunction.add(function(){void 0!==b.resizeTimeout&&a.clearTimeout(b.resizeTimeout),b.resizeTimeout=a.setTimeout(function(){delete b.resizeTimeout,b.api.flush()},100)}),b.resizeFunction.add(function(){c.onresized.call(b)}),a.attachEvent)a.attachEvent("onresize",b.resizeFunction);else if(a.addEventListener)a.addEventListener("resize",b.resizeFunction,!1);else{var d=a.onresize;d?d.add&&d.remove||(d=b.generateResize(),d.add(a.onresize)):d=b.generateResize(),d.add(b.resizeFunction),a.onresize=d}},i.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a.remove=function(a){for(var c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}},a},i.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},i.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},i.parseDate=function(b){var c,d=this;return b instanceof Date?c=b:"string"==typeof b?c=d.dataTimeFormat(d.config.data_xFormat).parse(b):"number"!=typeof b||isNaN(b)||(c=new Date(+b)),c&&!isNaN(+c)||a.console.error("Failed to parse x '"+b+"' to Date object"),c},i.isTabVisible=function(){var a;return"undefined"!=typeof document.hidden?a="hidden":"undefined"!=typeof document.mozHidden?a="mozHidden":"undefined"!=typeof document.msHidden?a="msHidden":"undefined"!=typeof document.webkitHidden&&(a="webkitHidden"),!document[a]},i.getDefaultConfig=function(){var a={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(a){return a},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_units:void 0,gauge_width:void 0,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,b,c,d):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(b){a[b]=this.additionalConfig[b]},this),a},i.additionalConfig={},i.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&"object"==typeof c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),q(e)&&(f[g]=e)})},i.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},i.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},i.getY=function(a,b,c){var d=this.getScale(a,b,this.isTimeSeriesY());return c&&d.domain(c),d},i.getYScale=function(a){return"y2"===this.axis.getId(a)?this.y2:this.y},i.getSubYScale=function(a){return"y2"===this.axis.getId(a)?this.subY2:this.subY},i.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b.axis_rotated?1:0,a.xMax=b.axis_rotated?a.height:a.width,a.yMin=b.axis_rotated?0:a.height,a.yMax=b.axis_rotated?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b.axis_rotated?0:a.height2,a.subYMax=b.axis_rotated?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?b.axis_y_default:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?b.axis_y2_default:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?b.axis_y_default:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?b.axis_y2_default:a.subY2.domain()),a.xAxisTickFormat=a.axis.getXAxisTickFormat(),a.xAxisTickValues=a.axis.getXAxisTickValues(),a.yAxisTickValues=a.axis.getYAxisTickValues(),a.y2AxisTickValues=a.axis.getY2AxisTickValues(),a.xAxis=a.axis.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.subXAxis=a.axis.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.yAxis=a.axis.getYAxis(a.y,a.yOrient,b.axis_y_tick_format,a.yAxisTickValues,b.axis_y_tick_outer),a.y2Axis=a.axis.getYAxis(a.y2,a.y2Orient,b.axis_y2_tick_format,a.y2AxisTickValues,b.axis_y2_tick_outer),c||(a.brush&&a.brush.scale(a.subX),b.zoom_enabled&&a.zoom.scale(a.x)),a.updateArc&&a.updateArc()},i.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.axis.getId(f)!==h.axis.getId(d)||!k[d]||g&&+a>0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},i.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.axis.getId(f)!==h.axis.getId(d)||!k[d]||g&&0>+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},i.getYDomain=function(a,b,c){var d,e,f,g,h,i,j,k,l,n,o,p=this,q=p.config,r=a.filter(function(a){return p.axis.getId(a.id)===b}),s=c?p.filterByXDomain(r,c):r,u="y2"===b?q.axis_y2_min:q.axis_y_min,w="y2"===b?q.axis_y2_max:q.axis_y_max,x=p.getYDomainMin(s),y=p.getYDomainMax(s),z="y2"===b?q.axis_y2_center:q.axis_y_center,A=p.hasType("bar",s)&&q.bar_zerobased||p.hasType("area",s)&&q.area_zerobased,B="y2"===b?q.axis_y2_inverted:q.axis_y_inverted,C=p.hasDataLabel()&&q.axis_rotated,D=p.hasDataLabel()&&!q.axis_rotated;return x=m(u)?u:m(w)?w>x?x:w-10:x,y=m(w)?w:m(u)?y>u?y:u+10:y,0===s.length?"y2"===b?p.y2.domain():p.y.domain():(isNaN(x)&&(x=0),isNaN(y)&&(y=x),x===y&&(0>x?y=0:x=0),n=x>=0&&y>=0,o=0>=x&&0>=y,(m(u)&&n||m(w)&&o)&&(A=!1),A&&(n&&(x=0),o&&(y=0)),e=Math.abs(y-x),f=g=h=.1*e,"undefined"!=typeof z&&(i=Math.max(Math.abs(x),Math.abs(y)),y=z+i,x=z-i),C?(j=p.getDataLabelLength(x,y,"width"),k=t(p.y.range()),l=[j[0]/k,j[1]/k],
2
+ g+=e*(l[1]/(1-l[0]-l[1])),h+=e*(l[0]/(1-l[0]-l[1]))):D&&(j=p.getDataLabelLength(x,y,"height"),g+=p.axis.convertPixelsToAxisPadding(j[1],e),h+=p.axis.convertPixelsToAxisPadding(j[0],e)),"y"===b&&v(q.axis_y_padding)&&(g=p.axis.getPadding(q.axis_y_padding,"top",g,e),h=p.axis.getPadding(q.axis_y_padding,"bottom",h,e)),"y2"===b&&v(q.axis_y2_padding)&&(g=p.axis.getPadding(q.axis_y2_padding,"top",g,e),h=p.axis.getPadding(q.axis_y2_padding,"bottom",h,e)),A&&(n&&(h=x),o&&(g=-y)),d=[x-h,y+g],B?d.reverse():d)},i.getXDomainMin=function(a){var b=this,c=b.config;return q(c.axis_x_min)?b.isTimeSeries()?this.parseDate(c.axis_x_min):c.axis_x_min:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},i.getXDomainMax=function(a){var b=this,c=b.config;return q(c.axis_x_max)?b.isTimeSeries()?this.parseDate(c.axis_x_max):c.axis_x_max:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},i.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=a[1]-a[0];return f.isCategorized()?c=0:f.hasType("bar")?(b=f.getMaxDataCount(),c=b>1?h/(b-1)/2:.5):c=.01*h,"object"==typeof g.axis_x_padding&&v(g.axis_x_padding)?(d=m(g.axis_x_padding.left)?g.axis_x_padding.left:c,e=m(g.axis_x_padding.right)?g.axis_x_padding.right:c):d=e="number"==typeof g.axis_x_padding?g.axis_x_padding:c,{left:d,right:e}},i.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(c),g=0,h=0;return d-e!==0||b.isCategorized()||(b.isTimeSeries()?(d=new Date(.5*d.getTime()),e=new Date(1.5*e.getTime())):(d=0===d?1:.5*d,e=0===e?-1:1.5*e)),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]},i.updateXDomain=function(a,b,c,d,e){var f=this,g=f.config;return c&&(f.x.domain(e?e:f.d3.extent(f.getXDomain(a))),f.orgXDomain=f.x.domain(),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent(),f.subX.domain(f.x.domain()),f.brush&&f.brush.scale(f.subX)),b&&(f.x.domain(e?e:!f.brush||f.brush.empty()?f.orgXDomain:f.brush.extent()),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent()),d&&f.x.domain(f.trimXDomain(f.x.orgDomain())),f.x.domain()},i.trimXDomain=function(a){var b=this.getZoomDomain(),c=b[0],d=b[1];return a[0]<=c&&(a[1]=+a[1]+(c-a[0]),a[0]=c),d<=a[1]&&(a[0]=+a[0]-(a[1]-d),a[1]=d),a},i.isX=function(a){var b=this,c=b.config;return c.data_x&&a===c.data_x||v(c.data_xs)&&x(c.data_xs,a)},i.isNotX=function(a){return!this.isX(a)},i.getXKey=function(a){var b=this,c=b.config;return c.data_x?c.data_x:v(c.data_xs)?c.data_xs[a]:null},i.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&v(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},i.getIndexByX=function(a){var b=this,c=b.filterByX(b.data.targets,a);return c.length?c[0].index:null},i.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&m(c.data.xs[a][b])?c.data.xs[a][b]:b},i.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},i.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a<b.length?b[a]:null},i.addXs=function(a){var b=this;Object.keys(a).forEach(function(c){b.config.data_xs[c]=a[c]})},i.hasMultipleX=function(a){return this.d3.set(Object.keys(a).map(function(b){return a[b]})).size()>1},i.isMultipleX=function(){return v(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},i.addName=function(a){var b,c=this;return a&&(b=c.config.data_names[a.id],a.name=void 0!==b?b:a.id),a},i.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},i.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},i.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},i.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?a?e.parseDate(a):e.parseDate(e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?m(a)?+a:e.getXValue(b,c):c},i.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},i.updateXs=function(){var a=this;a.data.targets.length&&(a.xs=[],a.data.targets[0].values.forEach(function(b){a.xs[b.index]=b.x}))},i.getPrevX=function(a){var b=this.xs[a-1];return"undefined"!=typeof b?b:null},i.getNextX=function(a){var b=this.xs[a+1];return"undefined"!=typeof b?b:null},i.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},i.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},i.getEdgeX=function(a){var b=this;return a.length?[b.d3.min(a,function(a){return a.values[0].x}),b.d3.max(a,function(a){return a.values[a.values.length-1].x})]:[0,0]},i.mapToIds=function(a){return a.map(function(a){return a.id})},i.mapToTargetIds=function(a){var b=this;return a?[].concat(a):b.mapToIds(b.data.targets)},i.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1},i.isTargetToShow=function(a){return this.hiddenTargetIds.indexOf(a)<0},i.isLegendToShow=function(a){return this.hiddenLegendIds.indexOf(a)<0},i.filterTargetsToShow=function(a){var b=this;return a.filter(function(a){return b.isTargetToShow(a.id)})},i.mapTargetsToUniqueXs=function(a){var b=this,c=b.d3.set(b.d3.merge(a.map(function(a){return a.values.map(function(a){return+a.x})}))).values();return c=b.isTimeSeries()?c.map(function(a){return new Date(+a)}):c.map(function(a){return+a}),c.sort(function(a,b){return b>a?-1:a>b?1:a>=b?0:NaN})},i.addHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.concat(a)},i.removeHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(b){return a.indexOf(b)<0})},i.addHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.concat(a)},i.removeHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(b){return a.indexOf(b)<0})},i.getValuesAsIdKeyed=function(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b},i.checkValueInTargets=function(a,b){var c,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1},i.hasNegativeValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return 0>a})},i.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},i.isOrderDesc=function(){var a=this.config;return"string"==typeof a.data_order&&"desc"===a.data_order.toLowerCase()},i.isOrderAsc=function(){var a=this.config;return"string"==typeof a.data_order&&"asc"===a.data_order.toLowerCase()},i.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):n(c.data_order)&&a.sort(c.data_order),a},i.filterByX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},i.filterRemoveNull=function(a){return a.filter(function(a){return m(a.value)})},i.filterByXDomain=function(a,b){return a.map(function(a){return{id:a.id,id_org:a.id_org,values:a.values.filter(function(a){return b[0]<=a.x&&a.x<=b[1]})}})},i.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a.data_labels&&a.data_labels?!0:!("object"!=typeof a.data_labels||!v(a.data_labels))},i.getDataLabelLength=function(a,b,c){var d=this,e=[0,0],f=1.3;return d.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return d.dataLabelFormat(a.id)(a)}).each(function(a,b){e[b]=this.getBoundingClientRect()[c]*f}).remove(),e},i.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},i.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},i.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);return e},i.findClosestFromTargets=function(a,b){var c,d=this;return c=a.map(function(a){return d.findClosest(a.values,b)}),d.findClosest(c,b)},i.findClosest=function(a,b){var c,d=this,e=d.config.point_sensitivity;return a.filter(function(a){return a&&d.isBarType(a.id)}).forEach(function(a){var b=d.main.select("."+l.bars+d.getTargetSelectorSuffix(a.id)+" ."+l.bar+"-"+a.index).node();!c&&d.isWithinBar(b)&&(c=a)}),a.filter(function(a){return a&&!d.isBarType(a.id)}).forEach(function(a){var f=d.dist(a,b);e>f&&(e=f,c=a)}),c},i.dist=function(a,b){var c=this,d=c.config,e=d.axis_rotated?1:0,f=d.axis_rotated?0:1,g=c.circleY(a,a.index),h=c.x(a.x);return Math.sqrt(Math.pow(h-b[e],2)+Math.pow(g-b[f],2))},i.convertValuesToStep=function(a){var b,c=[].concat(a);if(!this.isCategorized())return a;for(b=a.length+1;b>0;b--)c[b]=c[b-1];return c[0]={x:c[0].x-1,value:c[0].value,id:c[0].id},c[a.length+1]={x:c[a.length].x+1,value:c[a.length].value,id:c[a.length].id},c},i.updateDataAttributes=function(a,b){var c=this,d=c.config,e=d["data_"+a];return"undefined"==typeof b?e:(Object.keys(b).forEach(function(a){e[a]=b[a]}),c.redraw({withLegend:!0}),e)},i.convertUrlToData=function(a,b,c,d,e){var f=this,g=b?b:"csv",h=f.d3.xhr(a);c&&Object.keys(c).forEach(function(a){h.header(a,c[a])}),h.get(function(a,b){var c;if(!b)throw new Error(a.responseURL+" "+a.status+" ("+a.statusText+")");c="json"===g?f.convertJsonToData(JSON.parse(b.response),d):"tsv"===g?f.convertTsvToData(b.response):f.convertCsvToData(b.response),e.call(f,c)})},i.convertXsvToData=function(a,b){var c,d=b.parseRows(a);return 1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=b.parse(a),c},i.convertCsvToData=function(a){return this.convertXsvToData(a,this.d3.csv)},i.convertTsvToData=function(a){return this.convertXsvToData(a,this.d3.tsv)},i.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(b.x?(c=b.value.concat(b.x),e.config.data_x=b.x):c=b.value,f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=e.findValueInJson(a,c);p(d)&&(d=null),b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},i.findValueInJson=function(a,b){b=b.replace(/\[(\w+)\]/g,".$1"),b=b.replace(/^\./,"");for(var c=b.split("."),d=0;d<c.length;++d){var e=c[d];if(!(e in a))return;a=a[e]}return a},i.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++){if(p(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[d[c]]=a[b][c]}f.push(e)}return f},i.convertColumnsToData=function(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(d=a[b][0],c=1;c<a[b].length;c++){if(p(e[c-1])&&(e[c-1]={}),p(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[c-1][d]=a[b][c]}return e},i.convertDataToTargets=function(a,b){var c,d=this,e=d.config,f=d.d3.keys(a[0]).filter(d.isNotX,d),g=d.d3.keys(a[0]).filter(d.isX,d);return f.forEach(function(c){var f=d.getXKey(c);d.isCustomX()||d.isTimeSeries()?g.indexOf(f)>=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(m).map(function(a,b){return d.generateTargetX(a,c,b)})):e.data_x?d.data.xs[c]=d.getOtherTargetXs():v(e.data_xs)&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e.data_idConverter(b);return{id:f,id_org:b,values:a.map(function(a,g){var h,i=d.getXKey(b),j=a[i],k=null===a[b]||isNaN(a[b])?null:+a[b];return d.isCustomX()&&d.isCategorized()&&0===c&&!p(j)?(0===c&&0===g&&(e.axis_x_categories=[]),h=e.axis_x_categories.indexOf(j),-1===h&&(h=e.axis_x_categories.length,e.axis_x_categories.push(j))):h=d.generateTargetX(j,b,g),(p(a[b])||d.data.xs[b].length<=g)&&(h=void 0),{x:h,value:k,id:f}}).filter(function(a){return q(a.x)})}}),c.forEach(function(a){var b;e.data_xSort&&(a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d})),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),d.hasNegativeValue=d.hasNegativeValueInTargets(c),d.hasPositiveValue=d.hasPositiveValueInTargets(c),e.data_type&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e.data_types)}),e.data_type),c.forEach(function(a){d.addCache(a.id_org,a)}),c},i.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){var d=b.types&&b.types[a.id]?b.types[a.id]:b.type;c.setTargetType(a.id,d)}),c.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),c.data.targets=c.data.targets.concat(a)),c.updateTargets(c.data.targets),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),b.done&&b.done()},i.loadFromArgs=function(a){var b=this;a.data?b.load(b.convertDataToTargets(a.data),a):a.url?b.convertUrlToData(a.url,a.mimeType,a.headers,a.keys,function(c){b.load(b.convertDataToTargets(c),a)}):a.json?b.load(b.convertDataToTargets(b.convertJsonToData(a.json,a.keys)),a):a.rows?b.load(b.convertDataToTargets(b.convertRowsToData(a.rows)),a):a.columns?b.load(b.convertDataToTargets(b.convertColumnsToData(a.columns)),a):b.load(null,a)},i.unload=function(a,b){var c=this;return b||(b=function(){}),a=a.filter(function(a){return c.hasTarget(c.data.targets,a)}),a&&0!==a.length?(c.svg.selectAll(a.map(function(a){return c.selectorTarget(a)})).transition().style("opacity",0).remove().call(c.endall,b),void a.forEach(function(a){c.withoutFadeIn[a]=!1,c.legend&&c.legend.selectAll("."+l.legendItem+c.getTargetSelectorSuffix(a)).remove(),c.data.targets=c.data.targets.filter(function(b){return b.id!==a})})):void b()},i.categoryName=function(a){var b=this.config;return a<b.axis_x_categories.length?b.axis_x_categories[a]:a},i.initEventRect=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.eventRects).style("fill-opacity",0)},i.redrawEventRect=function(){var a,b,c=this,d=c.config,e=c.isMultipleX(),f=c.main.select("."+l.eventRects).style("cursor",d.zoom_enabled?d.axis_rotated?"ns-resize":"ew-resize":null).classed(l.eventRectsMultiple,e).classed(l.eventRectsSingle,!e);f.selectAll("."+l.eventRect).remove(),c.eventRect=f.selectAll("."+l.eventRect),e?(a=c.eventRect.data([0]),c.generateEventRectsForMultipleXs(a.enter()),c.updateEventRect(a)):(b=c.getMaxDataCountTarget(c.data.targets),f.datum(b?b.values:[]),c.eventRect=f.selectAll("."+l.eventRect),a=c.eventRect.data(function(a){return a}),c.generateEventRectsForSingleX(a.enter()),c.updateEventRect(a),a.exit().remove())},i.updateEventRect=function(a){var b,c,d,e,f,g,h=this,i=h.config;a=a||h.eventRect.data(function(a){return a}),h.isMultipleX()?(b=0,c=0,d=h.width,e=h.height):(!h.isCustomX()&&!h.isTimeSeries()||h.isCategorized()?(f=h.getEventRectWidth(),g=function(a){return h.x(a.x)-f/2}):(h.updateXs(),f=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index);return null===b&&null===c?i.axis_rotated?h.height:h.width:(null===b&&(b=h.x.domain()[0]),null===c&&(c=h.x.domain()[1]),Math.max(0,(h.x(c)-h.x(b))/2))},g=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index),d=h.data.xs[a.id][a.index];return null===b&&null===c?0:(null===b&&(b=h.x.domain()[0]),(h.x(d)+h.x(b))/2)}),b=i.axis_rotated?0:g,c=i.axis_rotated?g:0,d=i.axis_rotated?h.width:f,e=i.axis_rotated?f:h.height),a.attr("class",h.classEvent.bind(h)).attr("x",b).attr("y",c).attr("width",d).attr("height",e)},i.generateEventRectsForSingleX=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("class",b.classEvent.bind(b)).style("cursor",d.data_selection_enabled&&d.data_selection_grouped?"pointer":null).on("mouseover",function(a){var c=a.index;b.dragging||b.flowing||b.hasArcType()||(d.point_focus_expand_enabled&&b.expandCircles(c,null,!0),b.expandBars(c,null,!0),b.main.selectAll("."+l.shape+"-"+c).each(function(a){d.data_onmouseover.call(b.api,a)}))}).on("mouseout",function(a){var c=a.index;b.config&&(b.hasArcType()||(b.hideXGridFocus(),b.hideTooltip(),b.unexpandCircles(),b.unexpandBars(),b.main.selectAll("."+l.shape+"-"+c).each(function(a){d.data_onmouseout.call(b.api,a)})))}).on("mousemove",function(a){var e,f=a.index,g=b.svg.select("."+l.eventRect+"-"+f);b.dragging||b.flowing||b.hasArcType()||(b.isStepType(a)&&"step-after"===b.config.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,f))&&(f-=1),e=b.filterTargetsToShow(b.data.targets).map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),d.tooltip_grouped&&(b.showTooltip(e,this),b.showXGridFocus(e)),(!d.tooltip_grouped||d.data_selection_enabled&&!d.data_selection_grouped)&&b.main.selectAll("."+l.shape+"-"+f).each(function(){c.select(this).classed(l.EXPANDED,!0),d.data_selection_enabled&&g.style("cursor",d.data_selection_grouped?"pointer":null),d.tooltip_grouped||(b.hideXGridFocus(),b.hideTooltip(),d.data_selection_grouped||(b.unexpandCircles(f),b.unexpandBars(f)))}).filter(function(a){return b.isWithinShape(this,a)}).each(function(a){d.data_selection_enabled&&(d.data_selection_grouped||d.data_selection_isselectable(a))&&g.style("cursor","pointer"),d.tooltip_grouped||(b.showTooltip([a],this),b.showXGridFocus([a]),d.point_focus_expand_enabled&&b.expandCircles(f,a.id,!0),b.expandBars(f,a.id,!0))}))}).on("click",function(a){var e=a.index;if(!b.hasArcType()&&b.toggleShape){if(b.cancelClick)return void(b.cancelClick=!1);b.isStepType(a)&&"step-after"===d.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,e))&&(e-=1),b.main.selectAll("."+l.shape+"-"+e).each(function(a){(d.data_selection_grouped||b.isWithinShape(this,a))&&(b.toggleShape(this,a,e),b.config.data_onclick.call(b.api,a,this))})}}).call(d.data_selection_draggable&&b.drag?c.behavior.drag().origin(Object).on("drag",function(){b.drag(c.mouse(this))}).on("dragstart",function(){b.dragstart(c.mouse(this))}).on("dragend",function(){b.dragend()}):function(){})},i.generateEventRectsForMultipleXs=function(a){function b(){c.svg.select("."+l.eventRect).style("cursor",null),c.hideXGridFocus(),c.hideTooltip(),c.unexpandCircles(),c.unexpandBars()}var c=this,d=c.d3,e=c.config;a.append("rect").attr("x",0).attr("y",0).attr("width",c.width).attr("height",c.height).attr("class",l.eventRect).on("mouseout",function(){c.config&&(c.hasArcType()||b())}).on("mousemove",function(){var a,f,g,h,i=c.filterTargetsToShow(c.data.targets);if(!c.dragging&&!c.hasArcType(i)){if(a=d.mouse(this),f=c.findClosestFromTargets(i,a),!c.mouseover||f&&f.id===c.mouseover.id||(e.data_onmouseout.call(c.api,c.mouseover),c.mouseover=void 0),!f)return void b();g=c.isScatterType(f)||!e.tooltip_grouped?[f]:c.filterByX(i,f.x),h=g.map(function(a){return c.addName(a)}),c.showTooltip(h,this),e.point_focus_expand_enabled&&c.expandCircles(f.index,f.id,!0),c.expandBars(f.index,f.id,!0),c.showXGridFocus(h),(c.isBarType(f.id)||c.dist(f,a)<e.point_sensitivity)&&(c.svg.select("."+l.eventRect).style("cursor","pointer"),c.mouseover||(e.data_onmouseover.call(c.api,f),c.mouseover=f))}}).on("click",function(){var a,b,f=c.filterTargetsToShow(c.data.targets);c.hasArcType(f)||(a=d.mouse(this),b=c.findClosestFromTargets(f,a),b&&(c.isBarType(b.id)||c.dist(b,a)<e.point_sensitivity)&&c.main.selectAll("."+l.shapes+c.getTargetSelectorSuffix(b.id)).selectAll("."+l.shape+"-"+b.index).each(function(){(e.data_selection_grouped||c.isWithinShape(this,b))&&(c.toggleShape(this,b,b.index),c.config.data_onclick.call(c.api,b,this))}))}).call(e.data_selection_draggable&&c.drag?d.behavior.drag().origin(Object).on("drag",function(){c.drag(d.mouse(this))}).on("dragstart",function(){c.dragstart(d.mouse(this))}).on("dragend",function(){c.dragend()}):function(){})},i.dispatchEvent=function(b,c,d){var e=this,f="."+l.eventRect+(e.isMultipleX()?"":"-"+c),g=e.main.select(f).node(),h=g.getBoundingClientRect(),i=h.left+(d?d[0]:0),j=h.top+(d?d[1]:0),k=document.createEvent("MouseEvents");k.initMouseEvent(b,!0,!0,a,0,i,j,i,j,!1,!1,!1,!1,0,null),g.dispatchEvent(k)},i.getCurrentWidth=function(){var a=this,b=a.config;return b.size_width?b.size_width:a.getParentWidth()},i.getCurrentHeight=function(){var a=this,b=a.config,c=b.size_height?b.size_height:a.getParentHeight();return c>0?c:320/(a.hasType("gauge")&&!b.gauge_fullCircle?2:1)},i.getCurrentPaddingTop=function(){var a=this,b=a.config,c=m(b.padding_top)?b.padding_top:0;return a.title&&a.title.node()&&(c+=a.getTitlePadding()),c},i.getCurrentPaddingBottom=function(){var a=this.config;return m(a.padding_bottom)?a.padding_bottom:0},i.getCurrentPaddingLeft=function(a){var b=this,c=b.config;return m(c.padding_left)?c.padding_left:c.axis_rotated?c.axis_x_show?Math.max(r(b.getAxisWidthByAxisId("x",a)),40):1:!c.axis_y_show||c.axis_y_inner?b.axis.getYAxisLabelPosition().isOuter?30:1:r(b.getAxisWidthByAxisId("y",a))},i.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return m(b.padding_right)?b.padding_right+1:b.axis_rotated?c+d:!b.axis_y2_show||b.axis_y2_inner?2+d+(a.axis.getY2AxisLabelPosition().isOuter?20:0):r(a.getAxisWidthByAxisId("y2"))+d},i.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName;){try{b=c.getBoundingClientRect()[a]}catch(d){"width"===a&&(b=c.offsetWidth)}if(b)break;c=c.parentNode}return b},i.getParentWidth=function(){return this.getParentRectValue("width")},i.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},i.getSvgLeft=function(a){var b=this,c=b.config,d=c.axis_rotated||!c.axis_rotated&&!c.axis_y_inner,e=c.axis_rotated?l.axisX:l.axisY,f=b.main.select("."+e).node(),g=f&&d?f.getBoundingClientRect():{right:0},h=b.selectChart.node().getBoundingClientRect(),i=b.hasArcType(),j=g.right-h.left-(i?0:b.getCurrentPaddingLeft(a));return j>0?j:0},i.getAxisWidthByAxisId=function(a,b){var c=this,d=c.axis.getLabelPositionById(a);return c.axis.getMaxTickWidth(a,b)+(d.isInner?20:40)},i.getHorizontalAxisHeight=function(a){var b=this,c=b.config,d=30;return"x"!==a||c.axis_x_show?"x"===a&&c.axis_x_height?c.axis_x_height:"y"!==a||c.axis_y_show?"y2"!==a||c.axis_y2_show?("x"===a&&!c.axis_rotated&&c.axis_x_tick_rotate&&(d=30+b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_x_tick_rotate)/180)),"y"===a&&c.axis_rotated&&c.axis_y_tick_rotate&&(d=30+b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_y_tick_rotate)/180)),d+(b.axis.getLabelPositionById(a).isInner?0:10)+("y2"===a?-10:0)):b.rotated_padding_top:!c.legend_show||b.isLegendRight||b.isLegendInset?1:10:8},i.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},i.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b<e.data_groups.length;b++)if(!(e.data_groups[b].indexOf(a.id)<0))for(c=0;c<e.data_groups[b].length;c++)if(e.data_groups[b][c]in f){f[a.id]=f[e.data_groups[b][c]];break}p(f[a.id])&&(f[a.id]=g++)}),f.__max__=g-1,f},i.getShapeX=function(a,b,c,d){var e=this,f=d?e.subX:e.x;return function(d){var e=d.id in c?c[d.id]:0;return d.x||0===d.x?f(d.x)-a*(b/2-e):0}},i.getShapeY=function(a){var b=this;return function(c){var d=a?b.getSubYScale(c.id):b.getYScale(c.id);return d(c.value)}},i.getShapeOffset=function(a,b,c){var d=this,e=d.orderTargets(d.filterTargetsToShow(d.data.targets.filter(a,d))),f=e.map(function(a){return a.id});return function(a,g){var h=c?d.getSubYScale(a.id):d.getYScale(a.id),i=h(0),j=i;return e.forEach(function(c){var e=d.isStepType(a)?d.convertValuesToStep(c.values):c.values;c.id!==a.id&&b[c.id]===b[a.id]&&f.indexOf(c.id)<f.indexOf(a.id)&&("undefined"!=typeof e[g]&&+e[g].x===+a.x||(g=-1,e.forEach(function(b,c){b.x===a.x&&(g=c)})),g in e&&e[g].value*a.value>=0&&(j+=h(e[g].value)-i))}),j}},i.isWithinShape=function(a,b){var c,d=this,e=d.d3.select(a);return d.isTargetToShow(b.id)?"circle"===a.nodeName?c=d.isStepType(b)?d.isWithinStep(a,d.getYScale(b.id)(b.value)):d.isWithinCircle(a,1.5*d.pointSelectR(b)):"path"===a.nodeName&&(c=e.classed(l.bar)?d.isWithinBar(a):!0):c=!1,c},i.getInterpolate=function(a){var b=this,c=b.isInterpolationType(b.config.spline_interpolation_type)?b.config.spline_interpolation_type:"cardinal";return b.isSplineType(a)?c:b.isStepType(a)?b.config.line_step_type:"linear"},i.initLine=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartLines)},i.updateTargetsForLine=function(a){var b,c,d=this,e=d.config,f=d.classChartLine.bind(d),g=d.classLines.bind(d),h=d.classAreas.bind(d),i=d.classCircles.bind(d),j=d.classFocus.bind(d);b=d.main.select("."+l.chartLines).selectAll("."+l.chartLine).data(a).attr("class",function(a){return f(a)+j(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g),c.append("g").attr("class",h),c.append("g").attr("class",function(a){return d.generateClass(l.selectedCircles,a.id)}),c.append("g").attr("class",i).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null}),a.forEach(function(a){d.main.selectAll("."+l.selectedCircles+d.getTargetSelectorSuffix(a.id)).selectAll("."+l.selectedCircle).each(function(b){b.value=a.values[b.index].value})})},i.updateLine=function(a){var b=this;b.mainLine=b.main.selectAll("."+l.lines).selectAll("."+l.line).data(b.lineData.bind(b)),b.mainLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.mainLine.style("opacity",b.initialOpacity.bind(b)).style("shape-rendering",function(a){return b.isStepType(a)?"crispEdges":""}).attr("transform",null),b.mainLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLine=function(a,b){return[(b?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",a).style("stroke",this.color).style("opacity",1)]},i.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x(i).y(h):e.x(h).y(i),d.line_connectNull||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d.line_connectNull?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?d.data_regions[a.id]?f=c.lineWithRegions(h,i,j,d.data_regions[a.id]):(c.isStepType(a)&&(h=c.convertValuesToStep(h)),f=e.interpolate(c.getInterpolate(a))(h)):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d.axis_rotated?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},i.generateGetLinePoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)]]}},i.lineWithRegions=function(a,b,c,d){function e(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}function f(a){return"M"+a[0][0]+" "+a[0][1]+" "+a[1][0]+" "+a[1][1]}var g,h,i,j,k,l,m,n,o,r,s,t,u=this,v=u.config,w=-1,x="M",y=u.isCategorized()?.5:0,z=[];if(q(d))for(g=0;g<d.length;g++)z[g]={},p(d[g].start)?z[g].start=a[0].x:z[g].start=u.isTimeSeries()?u.parseDate(d[g].start):d[g].start,p(d[g].end)?z[g].end=a[a.length-1].x:z[g].end=u.isTimeSeries()?u.parseDate(d[g].end):d[g].end;for(s=v.axis_rotated?function(a){return c(a.value)}:function(a){return b(a.x)},t=v.axis_rotated?function(a){return b(a.x)}:function(a){return c(a.value)},i=u.isTimeSeries()?function(a,d,e,g){var h,i=a.x.getTime(),j=d.x-a.x,l=new Date(i+j*e),m=new Date(i+j*(e+g));return h=v.axis_rotated?[[c(k(e)),b(l)],[c(k(e+g)),b(m)]]:[[b(l),c(k(e))],[b(m),c(k(e+g))]],f(h)}:function(a,d,e,g){var h;return h=v.axis_rotated?[[c(k(e),!0),b(j(e))],[c(k(e+g),!0),b(j(e+g))]]:[[b(j(e),!0),c(k(e))],[b(j(e+g),!0),c(k(e+g))]],f(h)},g=0;g<a.length;g++){if(p(z)||!e(a[g].x,z))x+=" "+s(a[g])+" "+t(a[g]);else for(j=u.getScale(a[g-1].x+y,a[g].x+y,u.isTimeSeries()),k=u.getScale(a[g-1].value,a[g].value),l=b(a[g].x)-b(a[g-1].x),m=c(a[g].value)-c(a[g-1].value),n=Math.sqrt(Math.pow(l,2)+Math.pow(m,2)),o=2/n,r=2*o,h=o;1>=h;h+=r)x+=i(a[g-1],a[g],h,o);w=a[g].x}return x},i.updateArea=function(a){var b=this,c=b.d3;b.mainArea=b.main.selectAll("."+l.areas).selectAll("."+l.area).data(b.lineData.bind(b)),b.mainArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.mainArea.style("opacity",b.orgAreaOpacity),b.mainArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawArea=function(a,b){return[(b?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},i.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(c.getAreaBaseValue(a.id))},j=function(a,b){return d.data_groups.length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x0(i).x1(j).y(h):e.x(h).y0(d.area_above?0:i).y1(j),d.line_connectNull||(e=e.defined(function(a){return null!==a.value})),function(a){var b,f=d.line_connectNull?c.filterRemoveNull(a.values):a.values,g=0,h=0;return c.isAreaType(a)?(c.isStepType(a)&&(f=c.convertValuesToStep(f)),b=e.interpolate(c.getInterpolate(a))(f)):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d.axis_rotated?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},i.getAreaBaseValue=function(){return 0},i.generateGetAreaPoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)],[k,l-(e-j)],[k,j]]}},i.updateCircle=function(){var a=this;a.mainCircle=a.main.selectAll("."+l.circles).selectAll("."+l.circle).data(a.lineOrScatterData.bind(a)),a.mainCircle.enter().append("circle").attr("class",a.classCircle.bind(a)).attr("r",a.pointR.bind(a)).style("fill",a.color),a.mainCircle.style("opacity",a.initialOpacityForCircle.bind(a)),a.mainCircle.exit().remove()},i.redrawCircle=function(a,b,c){var d=this.main.selectAll("."+l.selectedCircle);return[(c?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",a).attr("cy",b),(c?d.transition(Math.random().toString()):d).attr("cx",a).attr("cy",b)]},i.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},i.updateCircleY=function(){var a,b,c=this;c.config.data_groups.length>0?(a=c.getShapeIndices(c.isLineType),b=c.generateGetLinePoints(a),c.circleY=function(a,c){return b(a,c)[0][1]}):c.circleY=function(a){return c.getYScale(a.id)(a.value)}},i.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+l.circles+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+l.circle+(m(a)?"-"+a:""))},i.expandCircles=function(a,b,c){var d=this,e=d.pointExpandedR.bind(d);c&&d.unexpandCircles(),d.getCircles(a,b).classed(l.EXPANDED,!0).attr("r",e)},i.unexpandCircles=function(a){var b=this,c=b.pointR.bind(b);b.getCircles(a).filter(function(){return b.d3.select(this).classed(l.EXPANDED)}).classed(l.EXPANDED,!1).attr("r",c)},i.pointR=function(a){var b=this,c=b.config;return b.isStepType(a)?0:n(c.point_r)?c.point_r(a):c.point_r;
3
+ },i.pointExpandedR=function(a){var b=this,c=b.config;return c.point_focus_expand_enabled?c.point_focus_expand_r?c.point_focus_expand_r:1.75*b.pointR(a):b.pointR(a)},i.pointSelectR=function(a){var b=this,c=b.config;return n(c.point_select_r)?c.point_select_r(a):c.point_select_r?c.point_select_r:4*b.pointR(a)},i.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=+e.attr("cx"),g=+e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))<b},i.isWithinStep=function(a,b){return Math.abs(b-this.d3.mouse(a)[1])<30},i.initBar=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartBars)},i.updateTargetsForBar=function(a){var b,c,d=this,e=d.config,f=d.classChartBar.bind(d),g=d.classBars.bind(d),h=d.classFocus.bind(d);b=d.main.select("."+l.chartBars).selectAll("."+l.chartBar).data(a).attr("class",function(a){return f(a)+h(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null})},i.updateBar=function(a){var b=this,c=b.barData.bind(b),d=b.classBar.bind(b),e=b.initialOpacity.bind(b),f=function(a){return b.color(a.id)};b.mainBar=b.main.selectAll("."+l.bars).selectAll("."+l.bar).data(c),b.mainBar.enter().append("path").attr("class",d).style("stroke",f).style("fill",f),b.mainBar.style("opacity",e),b.mainBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBar=function(a,b){return[(b?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",a).style("fill",this.color).style("opacity",1)]},i.getBarW=function(a,b){var c=this,d=c.config,e="number"==typeof d.bar_width?d.bar_width:b?a.tickInterval()*d.bar_width_ratio/b:0;return d.bar_width_max&&e>d.bar_width_max?d.bar_width_max:e},i.getBars=function(a,b){var c=this;return(b?c.main.selectAll("."+l.bars+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+l.bar+(m(a)?"-"+a:""))},i.expandBars=function(a,b,c){var d=this;c&&d.unexpandBars(),d.getBars(a,b).classed(l.EXPANDED,!0)},i.unexpandBars=function(a){var b=this;b.getBars(a).classed(l.EXPANDED,!1)},i.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d.axis_rotated?1:0,g=d.axis_rotated?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},i.generateGetBarPoints=function(a,b){var c=this,d=b?c.subXAxis:c.xAxis,e=a.__max__+1,f=c.getBarW(d,e),g=c.getShapeX(f,e,a,!!b),h=c.getShapeY(!!b),i=c.getShapeOffset(c.isBarType,a,!!b),j=b?c.getSubYScale:c.getYScale;return function(a,b){var d=j.call(c,a.id)(0),e=i(a,b)||d,k=g(a),l=h(a);return c.config.axis_rotated&&(0<a.value&&d>l||a.value<0&&l>d)&&(l=d),[[k,e],[k,l-(d-e)],[k+f,l-(d-e)],[k+f,e]]}},i.isWithinBar=function(a){var b=this.d3.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=Math.min(d.x,e.x),g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;return k<b[0]&&b[0]<l&&n<b[1]&&b[1]<m},i.initText=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartTexts),a.mainText=a.d3.selectAll([])},i.updateTargetsForText=function(a){var b,c,d=this,e=d.classChartText.bind(d),f=d.classTexts.bind(d),g=d.classFocus.bind(d);b=d.main.select("."+l.chartTexts).selectAll("."+l.chartText).data(a).attr("class",function(a){return e(a)+g(a)}),c=b.enter().append("g").attr("class",e).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",f)},i.updateText=function(a){var b=this,c=b.config,d=b.barOrLineData.bind(b),e=b.classText.bind(b);b.mainText=b.main.selectAll("."+l.texts).selectAll("."+l.text).data(d),b.mainText.enter().append("text").attr("class",e).attr("text-anchor",function(a){return c.axis_rotated?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(a){return b.color(a)}).style("fill-opacity",0),b.mainText.text(function(a,c,d){return b.dataLabelFormat(a.id)(a.value,a.id,c,d)}),b.mainText.exit().transition().duration(a).style("fill-opacity",0).remove()},i.redrawText=function(a,b,c,d){return[(d?this.mainText.transition():this.mainText).attr("x",a).attr("y",b).style("fill",this.color).style("fill-opacity",c?0:this.opacityForText.bind(this))]},i.getTextRect=function(a,b,c){var d,e=this.d3.select("body").append("div").classed("c3",!0),f=e.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),g=this.d3.select(c).style("font");return f.selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).style("font",g).text(a).each(function(){d=this.getBoundingClientRect()}),e.remove(),d},i.generateXYForText=function(a,b,c,d){var e=this,f=e.generateGetAreaPoints(a,!1),g=e.generateGetBarPoints(b,!1),h=e.generateGetLinePoints(c,!1),i=d?e.getXForText:e.getYForText;return function(a,b){var c=e.isAreaType(a)?f:e.isBarType(a)?g:h;return i.call(e,c(a,b),a,this)}},i.getXForText=function(a,b,c){var d,e,f=this,g=c.getBoundingClientRect();return f.config.axis_rotated?(e=f.isBarType(b)?4:6,d=a[2][1]+e*(b.value<0?-1:1)):d=f.hasType("bar")?(a[2][0]+a[0][0])/2:a[0][0],null===b.value&&(d>f.width?d=f.width-g.width:0>d&&(d=4)),d},i.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return e.config.axis_rotated?d=(a[0][0]+a[2][0]+.6*f.height)/2:(d=a[2][1],b.value<0||0===b.value&&!e.hasPositiveValue?(d+=f.height,e.isBarType(b)&&e.isSafari()?d-=3:!e.isBarType(b)&&e.isChrome()&&(d+=3)):d+=e.isBarType(b)?-3:-6),null!==b.value||e.config.axis_rotated||(d<f.height?d=f.height:d>this.height&&(d=this.height-4)),d},i.setTargetType=function(a,b){var c=this,d=c.config;c.mapToTargetIds(a).forEach(function(a){c.withoutFadeIn[a]=b===d.data_types[a],d.data_types[a]=b}),a||(d.data_type=b)},i.hasType=function(a,b){var c=this,d=c.config.data_types,e=!1;return b=b||c.data.targets,b&&b.length?b.forEach(function(b){var c=d[b.id];(c&&c.indexOf(a)>=0||!c&&"line"===a)&&(e=!0)}):Object.keys(d).length?Object.keys(d).forEach(function(b){d[b]===a&&(e=!0)}):e=c.config.data_type===a,e},i.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},i.isLineType=function(a){var b=this.config,c=o(a)?a:a.id;return!b.data_types[c]||["line","spline","area","area-spline","step","area-step"].indexOf(b.data_types[c])>=0},i.isStepType=function(a){var b=o(a)?a:a.id;return["step","area-step"].indexOf(this.config.data_types[b])>=0},i.isSplineType=function(a){var b=o(a)?a:a.id;return["spline","area-spline"].indexOf(this.config.data_types[b])>=0},i.isAreaType=function(a){var b=o(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[b])>=0},i.isBarType=function(a){var b=o(a)?a:a.id;return"bar"===this.config.data_types[b]},i.isScatterType=function(a){var b=o(a)?a:a.id;return"scatter"===this.config.data_types[b]},i.isPieType=function(a){var b=o(a)?a:a.id;return"pie"===this.config.data_types[b]},i.isGaugeType=function(a){var b=o(a)?a:a.id;return"gauge"===this.config.data_types[b]},i.isDonutType=function(a){var b=o(a)?a:a.id;return"donut"===this.config.data_types[b]},i.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},i.lineData=function(a){return this.isLineType(a)?[a]:[]},i.arcData=function(a){return this.isArcType(a.data)?[a]:[]},i.barData=function(a){return this.isBarType(a)?a.values:[]},i.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},i.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},i.isInterpolationType=function(a){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(a)>=0},i.initGrid=function(){var a=this,b=a.config,c=a.d3;a.grid=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",l.grid),b.grid_x_show&&a.grid.append("g").attr("class",l.xgrids),b.grid_y_show&&a.grid.append("g").attr("class",l.ygrids),b.grid_focus_show&&a.grid.append("g").attr("class",l.xgridFocus).append("line").attr("class",l.xgridFocus),a.xgrid=c.selectAll([]),b.grid_lines_front||a.initGridLines()},i.initGridLines=function(){var a=this,b=a.d3;a.gridLines=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",l.grid+" "+l.gridLines),a.gridLines.append("g").attr("class",l.xgridLines),a.gridLines.append("g").attr("class",l.ygridLines),a.xgridLines=b.selectAll([])},i.updateXGrid=function(a){var b=this,c=b.config,d=b.d3,e=b.generateGridData(c.grid_x_type,b.x),f=b.isCategorized()?b.xAxis.tickOffset():0;b.xgridAttr=c.axis_rotated?{x1:0,x2:b.width,y1:function(a){return b.x(a)-f},y2:function(a){return b.x(a)-f}}:{x1:function(a){return b.x(a)+f},x2:function(a){return b.x(a)+f},y1:0,y2:b.height},b.xgrid=b.main.select("."+l.xgrids).selectAll("."+l.xgrid).data(e),b.xgrid.enter().append("line").attr("class",l.xgrid),a||b.xgrid.attr(b.xgridAttr).style("opacity",function(){return+d.select(this).attr(c.axis_rotated?"y1":"x1")===(c.axis_rotated?b.height:0)?0:1}),b.xgrid.exit().remove()},i.updateYGrid=function(){var a=this,b=a.config,c=a.yAxis.tickValues()||a.y.ticks(b.grid_y_ticks);a.ygrid=a.main.select("."+l.ygrids).selectAll("."+l.ygrid).data(c),a.ygrid.enter().append("line").attr("class",l.ygrid),a.ygrid.attr("x1",b.axis_rotated?a.y:0).attr("x2",b.axis_rotated?a.y:a.width).attr("y1",b.axis_rotated?0:a.y).attr("y2",b.axis_rotated?a.height:a.y),a.ygrid.exit().remove(),a.smoothLines(a.ygrid,"grid")},i.gridTextAnchor=function(a){return a.position?a.position:"end"},i.gridTextDx=function(a){return"start"===a.position?4:"middle"===a.position?0:-4},i.xGridTextX=function(a){return"start"===a.position?-this.height:"middle"===a.position?-this.height/2:0},i.yGridTextX=function(a){return"start"===a.position?0:"middle"===a.position?this.width/2:this.width},i.updateGrid=function(a){var b,c,d,e=this,f=e.main,g=e.config;e.grid.style("visibility",e.hasArcType()?"hidden":"visible"),f.select("line."+l.xgridFocus).style("visibility","hidden"),g.grid_x_show&&e.updateXGrid(),e.xgridLines=f.select("."+l.xgridLines).selectAll("."+l.xgridLine).data(g.grid_x_lines),b=e.xgridLines.enter().append("g").attr("class",function(a){return l.xgridLine+(a["class"]?" "+a["class"]:"")}),b.append("line").style("opacity",0),b.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"":"rotate(-90)").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),e.xgridLines.exit().transition().duration(a).style("opacity",0).remove(),g.grid_y_show&&e.updateYGrid(),e.ygridLines=f.select("."+l.ygridLines).selectAll("."+l.ygridLine).data(g.grid_y_lines),c=e.ygridLines.enter().append("g").attr("class",function(a){return l.ygridLine+(a["class"]?" "+a["class"]:"")}),c.append("line").style("opacity",0),c.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"rotate(-90)":"").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),d=e.yv.bind(e),e.ygridLines.select("line").transition().duration(a).attr("x1",g.axis_rotated?d:0).attr("x2",g.axis_rotated?d:e.width).attr("y1",g.axis_rotated?0:d).attr("y2",g.axis_rotated?e.height:d).style("opacity",1),e.ygridLines.select("text").transition().duration(a).attr("x",g.axis_rotated?e.xGridTextX.bind(e):e.yGridTextX.bind(e)).attr("y",d).text(function(a){return a.text}).style("opacity",1),e.ygridLines.exit().transition().duration(a).style("opacity",0).remove()},i.redrawGrid=function(a){var b=this,c=b.config,d=b.xv.bind(b),e=b.xgridLines.select("line"),f=b.xgridLines.select("text");return[(a?e.transition():e).attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?b.width:d).attr("y1",c.axis_rotated?d:0).attr("y2",c.axis_rotated?d:b.height).style("opacity",1),(a?f.transition():f).attr("x",c.axis_rotated?b.yGridTextX.bind(b):b.xGridTextX.bind(b)).attr("y",d).text(function(a){return a.text}).style("opacity",1)]},i.showXGridFocus=function(a){var b=this,c=b.config,d=a.filter(function(a){return a&&m(a.value)}),e=b.main.selectAll("line."+l.xgridFocus),f=b.xx.bind(b);c.tooltip_show&&(b.hasType("scatter")||b.hasArcType()||(e.style("visibility","visible").data([d[0]]).attr(c.axis_rotated?"y1":"x1",f).attr(c.axis_rotated?"y2":"x2",f),b.smoothLines(e,"grid")))},i.hideXGridFocus=function(){this.main.select("line."+l.xgridFocus).style("visibility","hidden")},i.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+l.xgridFocus).attr("x1",b.axis_rotated?0:-10).attr("x2",b.axis_rotated?a.width:-10).attr("y1",b.axis_rotated?-10:0).attr("y2",b.axis_rotated?-10:a.height)},i.generateGridData=function(a,b){var c,d,e,f,g=this,h=[],i=g.main.select("."+l.axisX).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h},i.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(a){("value"in a&&b.value===a.value||"class"in a&&b["class"]===a["class"])&&(c=!0)}),c}:function(){return!0}},i.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?l.xgridLines:l.ygridLines,h=b?l.xgridLine:l.ygridLine;c.main.select("."+g).selectAll("."+h).filter(e).transition().duration(d.transition_duration).style("opacity",0).remove(),b?d.grid_x_lines=d.grid_x_lines.filter(f):d.grid_y_lines=d.grid_y_lines.filter(f)},i.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").attr("class",l.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),c.tooltip_init_show){if(b.isTimeSeries()&&o(c.tooltip_init_x)){for(c.tooltip_init_x=b.parseDate(c.tooltip_init_x),a=0;a<b.data.targets[0].values.length&&b.data.targets[0].values[a].x-c.tooltip_init_x!==0;a++);c.tooltip_init_x=a}b.tooltip.html(c.tooltip_contents.call(b,b.data.targets.map(function(a){return b.addName(a.values[c.tooltip_init_x])}),b.axis.getXAxisTickFormat(),b.getYFormat(b.hasArcType()),b.color)),b.tooltip.style("top",c.tooltip_init_position.top).style("left",c.tooltip_init_position.left).style("display","block")}},i.getTooltipContent=function(a,b,c,d){var e,f,g,h,i,j,k=this,l=k.config,m=l.tooltip_format_title||b,n=l.tooltip_format_name||function(a){return a},o=l.tooltip_format_value||c,p=k.isOrderAsc();if(0===l.data_groups.length)a.sort(function(a,b){var c=a?a.value:null,d=b?b.value:null;return p?c-d:d-c});else{var q=k.orderTargets(k.data.targets).map(function(a){return a.id});a.sort(function(a,b){var c=a?a.value:null,d=b?b.value:null;return c>0&&d>0&&(c=a?q.indexOf(a.id):null,d=b?q.indexOf(b.id):null),p?c-d:d-c})}for(f=0;f<a.length;f++)if(a[f]&&(a[f].value||0===a[f].value)&&(e||(g=y(m?m(a[f].x):a[f].x),e="<table class='"+k.CLASS.tooltip+"'>"+(g||0===g?"<tr><th colspan='2'>"+g+"</th></tr>":"")),h=y(o(a[f].value,a[f].ratio,a[f].id,a[f].index,a)),void 0!==h)){if(null===a[f].name)continue;i=y(n(a[f].name,a[f].ratio,a[f].id,a[f].index)),j=k.levelColor?k.levelColor(a[f].value):d(a[f].id),e+="<tr class='"+k.CLASS.tooltipName+"-"+k.getTargetSelectorSuffix(a[f].id)+"'>",e+="<td class='name'><span style='background-color:"+j+"'></span>"+i+"</td>",e+="<td class='value'>"+h+"</td>",e+="</tr>"}return e+"</table>"},i.tooltipPosition=function(a,b,c,d){var e,f,g,h,i,j=this,k=j.config,l=j.d3,m=j.hasArcType(),n=l.mouse(d);return m?(f=(j.width-(j.isLegendRight?j.getLegendWidth():0))/2+n[0],h=j.height/2+n[1]+20):(e=j.getSvgLeft(!0),k.axis_rotated?(f=e+n[0]+100,g=f+b,i=j.currentWidth-j.getCurrentPaddingRight(),h=j.x(a[0].x)+20):(f=e+j.getCurrentPaddingLeft(!0)+j.x(a[0].x)+20,g=f+b,i=e+j.currentWidth-j.getCurrentPaddingRight(),h=n[1]+15),g>i&&(f-=g-i+20),h+c>j.currentHeight&&(h-=c+30)),0>h&&(h=0),{top:h,left:f}},i.showTooltip=function(a,b){var c,d,e,f=this,g=f.config,h=f.hasArcType(),j=a.filter(function(a){return a&&m(a.value)}),k=g.tooltip_position||i.tooltipPosition;0!==j.length&&g.tooltip_show&&(f.tooltip.html(g.tooltip_contents.call(f,a,f.axis.getXAxisTickFormat(),f.getYFormat(h),f.color)).style("display","block"),c=f.tooltip.property("offsetWidth"),d=f.tooltip.property("offsetHeight"),e=k.call(this,j,c,d,b),f.tooltip.style("top",e.top+"px").style("left",e.left+"px"))},i.hideTooltip=function(){this.tooltip.style("display","none")},i.initLegend=function(){var a=this;return a.legendItemTextBox={},a.legendHasRendered=!1,a.legend=a.svg.append("g").attr("transform",a.getTranslate("legend")),a.config.legend_show?void a.updateLegendWithDefaults():(a.legend.style("visibility","hidden"),void(a.hiddenLegendIds=a.mapToIds(a.data.targets)))},i.updateLegendWithDefaults=function(){var a=this;a.updateLegend(a.mapToIds(a.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},i.updateSizeForLegend=function(a,b){var c=this,d=c.config,e={top:c.isLegendTop?c.getCurrentPaddingTop()+d.legend_inset_y+5.5:c.currentHeight-a-c.getCurrentPaddingBottom()-d.legend_inset_y,left:c.isLegendLeft?c.getCurrentPaddingLeft()+d.legend_inset_x+.5:c.currentWidth-b-c.getCurrentPaddingRight()-d.legend_inset_x+.5};c.margin3={top:c.isLegendRight?0:c.isLegendInset?e.top:c.currentHeight-a,right:NaN,bottom:0,left:c.isLegendRight?c.currentWidth-b:c.isLegendInset?e.left:0}},i.transformLegend=function(a){var b=this;(a?b.legend.transition():b.legend).attr("transform",b.getTranslate("legend"))},i.updateLegendStep=function(a){this.legendStep=a},i.updateLegendItemWidth=function(a){this.legendItemWidth=a},i.updateLegendItemHeight=function(a){this.legendItemHeight=a},i.getLegendWidth=function(){var a=this;return a.config.legend_show?a.isLegendRight||a.isLegendInset?a.legendItemWidth*(a.legendStep+1):a.currentWidth:0},i.getLegendHeight=function(){var a=this,b=0;return a.config.legend_show&&(b=a.isLegendRight?a.currentHeight:Math.max(20,a.legendItemHeight)*(a.legendStep+1)),b},i.opacityForLegend=function(a){return a.classed(l.legendItemHidden)?null:1},i.opacityForUnfocusedLegend=function(a){return a.classed(l.legendItemHidden)?null:.3},i.toggleFocusLegend=function(a,b){var c=this;a=c.mapToTargetIds(a),c.legend.selectAll("."+l.legendItem).filter(function(b){return a.indexOf(b)>=0}).classed(l.legendItemFocused,b).transition().duration(100).style("opacity",function(){var a=b?c.opacityForLegend:c.opacityForUnfocusedLegend;return a.call(c,c.d3.select(this))})},i.revertLegend=function(){var a=this,b=a.d3;a.legend.selectAll("."+l.legendItem).classed(l.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return a.opacityForLegend(b.select(this))})},i.showLegend=function(a){var b=this,c=b.config;c.legend_show||(c.legend_show=!0,b.legend.style("visibility","visible"),b.legendHasRendered||b.updateLegendWithDefaults()),b.removeHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("visibility","visible").transition().style("opacity",function(){return b.opacityForLegend(b.d3.select(this))})},i.hideLegend=function(a){var b=this,c=b.config;c.legend_show&&u(a)&&(c.legend_show=!1,b.legend.style("visibility","hidden")),b.addHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("opacity",0).style("visibility","hidden")},i.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},i.updateLegend=function(a,b,c){function d(a,b){return y.legendItemTextBox[b]||(y.legendItemTextBox[b]=y.getTextRect(a.textContent,l.legendItem,a)),y.legendItemTextBox[b]}function e(b,c,e){function f(a,b){b||(g=(o-G-n)/2,E>g&&(g=(o-n)/2,G=0,M++)),L[a]=M,K[M]=y.isLegendInset?10:g,H[a]=G,G+=n}var g,h,i=0===e,j=e===a.length-1,k=d(b,c),l=k.width+F+(!j||y.isLegendRight||y.isLegendInset?B:0)+z.legend_padding,m=k.height+A,n=y.isLegendRight||y.isLegendInset?m:l,o=y.isLegendRight||y.isLegendInset?y.getLegendHeight():y.getLegendWidth();return i&&(G=0,M=0,C=0,D=0),z.legend_show&&!y.isLegendToShow(c)?void(I[c]=J[c]=L[c]=H[c]=0):(I[c]=l,J[c]=m,(!C||l>=C)&&(C=l),(!D||m>=D)&&(D=m),h=y.isLegendRight||y.isLegendInset?D:C,void(z.legend_equally?(Object.keys(I).forEach(function(a){I[a]=C}),Object.keys(J).forEach(function(a){J[a]=D}),g=(o-h*a.length)/2,E>g?(G=0,M=0,a.forEach(function(a){f(a)})):f(c,!0)):f(c)))}var f,g,h,i,j,k,m,n,o,p,r,s,t,u,v,x,y=this,z=y.config,A=4,B=10,C=0,D=0,E=10,F=z.legend_item_tile_width+5,G=0,H={},I={},J={},K=[0],L={},M=0;a=a.filter(function(a){return!q(z.data_names[a])||null!==z.data_names[a]}),b=b||{},r=w(b,"withTransition",!0),s=w(b,"withTransitionForTransform",!0),y.isLegendInset&&(M=z.legend_inset_step?z.legend_inset_step:a.length,y.updateLegendStep(M)),y.isLegendRight?(f=function(a){return C*L[a]},i=function(a){return K[L[a]]+H[a]}):y.isLegendInset?(f=function(a){return C*L[a]+10},i=function(a){return K[L[a]]+H[a]}):(f=function(a){return K[L[a]]+H[a]},i=function(a){return D*L[a]}),g=function(a,b){return f(a,b)+4+z.legend_item_tile_width},j=function(a,b){return i(a,b)+9},h=function(a,b){return f(a,b)},k=function(a,b){return i(a,b)-5},m=function(a,b){return f(a,b)-2},n=function(a,b){return f(a,b)-2+z.legend_item_tile_width},o=function(a,b){return i(a,b)+4},p=y.legend.selectAll("."+l.legendItem).data(a).enter().append("g").attr("class",function(a){return y.generateClass(l.legendItem,a)}).style("visibility",function(a){return y.isLegendToShow(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){z.legend_item_onclick?z.legend_item_onclick.call(y,a):y.d3.event.altKey?(y.api.hide(),y.api.show(a)):(y.api.toggle(a),y.isTargetToShow(a)?y.api.focus(a):y.api.revert())}).on("mouseover",function(a){z.legend_item_onmouseover?z.legend_item_onmouseover.call(y,a):(y.d3.select(this).classed(l.legendItemFocused,!0),!y.transiting&&y.isTargetToShow(a)&&y.api.focus(a))}).on("mouseout",function(a){z.legend_item_onmouseout?z.legend_item_onmouseout.call(y,a):(y.d3.select(this).classed(l.legendItemFocused,!1),y.api.revert())}),p.append("text").text(function(a){return q(z.data_names[a])?z.data_names[a]:a}).each(function(a,b){e(this,a,b)}).style("pointer-events","none").attr("x",y.isLegendRight||y.isLegendInset?g:-200).attr("y",y.isLegendRight||y.isLegendInset?-200:j),p.append("rect").attr("class",l.legendItemEvent).style("fill-opacity",0).attr("x",y.isLegendRight||y.isLegendInset?h:-200).attr("y",y.isLegendRight||y.isLegendInset?-200:k),p.append("line").attr("class",l.legendItemTile).style("stroke",y.color).style("pointer-events","none").attr("x1",y.isLegendRight||y.isLegendInset?m:-200).attr("y1",y.isLegendRight||y.isLegendInset?-200:o).attr("x2",y.isLegendRight||y.isLegendInset?n:-200).attr("y2",y.isLegendRight||y.isLegendInset?-200:o).attr("stroke-width",z.legend_item_tile_height),x=y.legend.select("."+l.legendBackground+" rect"),y.isLegendInset&&C>0&&0===x.size()&&(x=y.legend.insert("g","."+l.legendItem).attr("class",l.legendBackground).append("rect")),t=y.legend.selectAll("text").data(a).text(function(a){return q(z.data_names[a])?z.data_names[a]:a}).each(function(a,b){e(this,a,b)}),(r?t.transition():t).attr("x",g).attr("y",j),u=y.legend.selectAll("rect."+l.legendItemEvent).data(a),(r?u.transition():u).attr("width",function(a){return I[a]}).attr("height",function(a){return J[a]}).attr("x",h).attr("y",k),v=y.legend.selectAll("line."+l.legendItemTile).data(a),(r?v.transition():v).style("stroke",y.color).attr("x1",m).attr("y1",o).attr("x2",n).attr("y2",o),x&&(r?x.transition():x).attr("height",y.getLegendHeight()-12).attr("width",C*(M+1)+10),y.legend.selectAll("."+l.legendItem).classed(l.legendItemHidden,function(a){return!y.isTargetToShow(a)}),y.updateLegendItemWidth(C),y.updateLegendItemHeight(D),y.updateLegendStep(M),y.updateSizes(),y.updateScales(),y.updateSvgSize(),y.transformAll(s,c),y.legendHasRendered=!0},i.initTitle=function(){var a=this;a.title=a.svg.append("text").text(a.config.title_text).attr("class",a.CLASS.title)},i.redrawTitle=function(){var a=this;a.title.attr("x",a.xForTitle.bind(a)).attr("y",a.yForTitle.bind(a))},i.xForTitle=function(){var a,b=this,c=b.config,d=c.title_position||"left";return a=d.indexOf("right")>=0?b.currentWidth-b.getTextRect(b.title.node().textContent,b.CLASS.title,b.title.node()).width-c.title_padding.right:d.indexOf("center")>=0?(b.currentWidth-b.getTextRect(b.title.node().textContent,b.CLASS.title,b.title.node()).width)/2:c.title_padding.left},i.yForTitle=function(){var a=this;return a.config.title_padding.top+a.getTextRect(a.title.node().textContent,a.CLASS.title,a.title.node()).height},i.getTitlePadding=function(){var a=this;return a.yForTitle()+a.config.title_padding.bottom},c(b,f),f.prototype.init=function(){var a=this.owner,b=a.config,c=a.main;a.axes.x=c.append("g").attr("class",l.axis+" "+l.axisX).attr("clip-path",a.clipPathForXAxis).attr("transform",a.getTranslate("x")).style("visibility",b.axis_x_show?"visible":"hidden"),a.axes.x.append("text").attr("class",l.axisXLabel).attr("transform",b.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),a.axes.y=c.append("g").attr("class",l.axis+" "+l.axisY).attr("clip-path",b.axis_y_inner?"":a.clipPathForYAxis).attr("transform",a.getTranslate("y")).style("visibility",b.axis_y_show?"visible":"hidden"),a.axes.y.append("text").attr("class",l.axisYLabel).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),a.axes.y2=c.append("g").attr("class",l.axis+" "+l.axisY2).attr("transform",a.getTranslate("y2")).style("visibility",b.axis_y2_show?"visible":"hidden"),a.axes.y2.append("text").attr("class",l.axisY2Label).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(a,b,c,d,e,f,h){var i=this.owner,j=i.config,k={isCategory:i.isCategorized(),withOuterTick:e,tickMultiline:j.axis_x_tick_multiline,tickWidth:j.axis_x_tick_width,tickTextRotate:h?0:j.axis_x_tick_rotate,withoutTransition:f},l=g(i.d3,k).scale(a).orient(b);return i.isTimeSeries()&&d&&"function"!=typeof d&&(d=d.map(function(a){return i.parseDate(a)})),l.tickFormat(c).tickValues(d),i.isCategorized()&&(l.tickCentered(j.axis_x_tick_centered),u(j.axis_x_tick_culling)&&(j.axis_x_tick_culling=!1)),l},f.prototype.updateXAxisTickValues=function(a,b){var c,d=this.owner,e=d.config;return(e.axis_x_tick_fit||e.axis_x_tick_count)&&(c=this.generateTickValues(d.mapTargetsToUniqueXs(a),e.axis_x_tick_count,d.isTimeSeries())),b?b.tickValues(c):(d.xAxis.tickValues(c),d.subXAxis.tickValues(c)),c},f.prototype.getYAxis=function(a,b,c,d,e,f,h){var i=this.owner,j=i.config,k={withOuterTick:e,withoutTransition:f,tickTextRotate:h?0:j.axis_y_tick_rotate},l=g(i.d3,k).scale(a).orient(b).tickFormat(c);return i.isTimeSeriesY()?l.ticks(i.d3.time[j.axis_y_tick_time_value],j.axis_y_tick_time_interval):l.tickValues(d),l},f.prototype.getId=function(a){var b=this.owner.config;return a in b.data_axes?b.data_axes[a]:"y"},f.prototype.getXAxisTickFormat=function(){var a=this.owner,b=a.config,c=a.isTimeSeries()?a.defaultAxisTimeFormat:a.isCategorized()?a.categoryName:function(a){return 0>a?a.toFixed(0):a};return b.axis_x_tick_format&&(n(b.axis_x_tick_format)?c=b.axis_x_tick_format:a.isTimeSeries()&&(c=function(c){return c?a.axisTimeFormat(b.axis_x_tick_format)(c):""})),n(c)?function(b){return c.call(a,b)}:c},f.prototype.getTickValues=function(a,b){return a?a:b?b.tickValues():void 0},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(a){var b,c=this.owner,d=c.config;return"y"===a?b=d.axis_y_label:"y2"===a?b=d.axis_y2_label:"x"===a&&(b=d.axis_x_label),b},f.prototype.getLabelText=function(a){var b=this.getLabelOptionByAxisId(a);return o(b)?b:b?b.text:null},f.prototype.setLabelText=function(a,b){var c=this.owner,d=c.config,e=this.getLabelOptionByAxisId(a);o(e)?"y"===a?d.axis_y_label=b:"y2"===a?d.axis_y2_label=b:"x"===a&&(d.axis_x_label=b):e&&(e.text=b)},f.prototype.getLabelPosition=function(a,b){var c=this.getLabelOptionByAxisId(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(a){return"y2"===a?this.getY2AxisLabelPosition():"y"===a?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(a,b){var c=this.owner;return a?b.isLeft?0:b.isCenter?c.width/2:c.width:b.isBottom?-c.height:b.isMiddle?-c.height/2:0},f.prototype.dxForAxisLabel=function(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var a=this.owner,b=a.config,c=this.getXAxisLabelPosition();return b.axis_rotated?c.isInner?"1.2em":-25-this.getMaxTickWidth("x"):c.isInner?"-0.5em":b.axis_x_height?b.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var a=this.owner,b=this.getYAxisLabelPosition();return a.config.axis_rotated?b.isInner?"-0.5em":"3em":b.isInner?"1.2em":-10-(a.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var a=this.owner,b=this.getY2AxisLabelPosition();return a.config.axis_rotated?b.isInner?"1.2em":"-2.2em":b.isInner?"-0.5em":15+(a.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(!a.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.getMaxTickWidth=function(a,b){var c,d,e,f,g,h=this.owner,i=h.config,j=0;return b&&h.currentMaxTickWidths[a]?h.currentMaxTickWidths[a]:(h.svg&&(c=h.filterTargetsToShow(h.data.targets),"y"===a?(d=h.y.copy().domain(h.getYDomain(c,"y")),e=this.getYAxis(d,h.yOrient,i.axis_y_tick_format,h.yAxisTickValues,!1,!0,!0)):"y2"===a?(d=h.y2.copy().domain(h.getYDomain(c,"y2")),
4
+ e=this.getYAxis(d,h.y2Orient,i.axis_y2_tick_format,h.y2AxisTickValues,!1,!0,!0)):(d=h.x.copy().domain(h.getXDomain(c)),e=this.getXAxis(d,h.xOrient,h.xAxisTickFormat,h.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(c,e)),f=h.d3.select("body").append("div").classed("c3",!0),g=f.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),g.append("g").call(e).each(function(){h.d3.select(this).selectAll("text").each(function(){var a=this.getBoundingClientRect();j<a.width&&(j=a.width)}),f.remove()})),h.currentMaxTickWidths[a]=0>=j?h.currentMaxTickWidths[a]:j,h.currentMaxTickWidths[a])},f.prototype.updateLabels=function(a){var b=this.owner,c=b.main.select("."+l.axisX+" ."+l.axisXLabel),d=b.main.select("."+l.axisY+" ."+l.axisYLabel),e=b.main.select("."+l.axisY2+" ."+l.axisY2Label);(a?c.transition():c).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(a?d.transition():d).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(a?e.transition():e).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(a,b,c,d){var e="number"==typeof a?a:a[b];return m(e)?"ratio"===a.unit?a[b]*d:this.convertPixelsToAxisPadding(e,d):c},f.prototype.convertPixelsToAxisPadding=function(a,b){var c=this.owner,d=c.config.axis_rotated?c.width:c.height;return b*(a/d)},f.prototype.generateTickValues=function(a,b,c){var d,e,f,g,h,i,j,k=a;if(b)if(d=n(b)?b():b,1===d)k=[a[0]];else if(2===d)k=[a[0],a[a.length-1]];else if(d>2){for(g=d-2,e=a[0],f=a[a.length-1],h=(f-e)/(g+1),k=[e],i=0;g>i;i++)j=+e+h*(i+1),k.push(c?new Date(j):j);k.push(f)}return c||(k=k.sort(function(a,b){return a-b})),k},f.prototype.generateTransitions=function(a){var b=this.owner,c=b.axes;return{axisX:a?c.x.transition().duration(a):c.x,axisY:a?c.y.transition().duration(a):c.y,axisY2:a?c.y2.transition().duration(a):c.y2,axisSubX:a?c.subx.transition().duration(a):c.subx}},f.prototype.redraw=function(a,b){var c=this.owner;c.axes.x.style("opacity",b?0:1),c.axes.y.style("opacity",b?0:1),c.axes.y2.style("opacity",b?0:1),c.axes.subx.style("opacity",b?0:1),a.axisX.call(c.xAxis),a.axisY.call(c.yAxis),a.axisY2.call(c.y2Axis),a.axisSubX.call(c.subXAxis)},i.getClipPath=function(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"},i.appendClip=function(a,b){return a.append("clipPath").attr("id",b).append("rect")},i.getAxisClipX=function(a){var b=Math.max(30,this.margin.left);return a?-(1+b):-(b-1)},i.getAxisClipY=function(a){return a?-20:-this.margin.top},i.getXAxisClipX=function(){var a=this;return a.getAxisClipX(!a.config.axis_rotated)},i.getXAxisClipY=function(){var a=this;return a.getAxisClipY(!a.config.axis_rotated)},i.getYAxisClipX=function(){var a=this;return a.config.axis_y_inner?-1:a.getAxisClipX(a.config.axis_rotated)},i.getYAxisClipY=function(){var a=this;return a.getAxisClipY(a.config.axis_rotated)},i.getAxisClipWidth=function(a){var b=this,c=Math.max(30,b.margin.left),d=Math.max(30,b.margin.right);return a?b.width+2+c+d:b.margin.left+20},i.getAxisClipHeight=function(a){return(a?this.margin.bottom:this.margin.top+this.height)+20},i.getXAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(!a.config.axis_rotated)},i.getXAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(!a.config.axis_rotated)},i.getYAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(a.config.axis_rotated)+(a.config.axis_y_inner?20:0)},i.getYAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(a.config.axis_rotated)},i.initPie=function(){var a=this,b=a.d3,c=a.config;a.pie=b.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),c.data_order||a.pie.sort(null)},i.updateRadius=function(){var a=this,b=a.config,c=b.gauge_width||b.donut_width;a.radiusExpanded=Math.min(a.arcWidth,a.arcHeight)/2,a.radius=.95*a.radiusExpanded,a.innerRadiusRatio=c?(a.radius-c)/a.radius:.6,a.innerRadius=a.hasType("donut")||a.hasType("gauge")?a.radius*a.innerRadiusRatio:0},i.updateArc=function(){var a=this;a.svgArc=a.getSvgArc(),a.svgArcExpanded=a.getSvgArcExpanded(),a.svgArcExpandedSub=a.getSvgArcExpanded(.98)},i.updateAngle=function(a){var b,c,d,e,f=this,g=f.config,h=!1,i=0;return g?(f.pie(f.filterTargetsToShow(f.data.targets)).forEach(function(b){h||b.data.id!==a.data.id||(h=!0,a=b,a.index=i),i++}),isNaN(a.startAngle)&&(a.startAngle=0),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),f.isGaugeType(a.data)&&(b=g.gauge_min,c=g.gauge_max,d=Math.PI*(g.gauge_fullCircle?2:1)/(c-b),e=a.value<b?0:a.value<c?a.value-b:c-b,a.startAngle=g.gauge_startingAngle,a.endAngle=a.startAngle+d*e),h?a:null):null},i.getSvgArc=function(){var a=this,b=a.d3.svg.arc().outerRadius(a.radius).innerRadius(a.innerRadius),c=function(c,d){var e;return d?b(c):(e=a.updateAngle(c),e?b(e):"M 0 0")};return c.centroid=b.centroid,c},i.getSvgArcExpanded=function(a){var b=this,c=b.d3.svg.arc().outerRadius(b.radiusExpanded*(a?a:1)).innerRadius(b.innerRadius);return function(a){var d=b.updateAngle(a);return d?c(d):"M 0 0"}},i.getArc=function(a,b,c){return c||this.isArcType(a.data)?this.svgArc(a,b):"M 0 0"},i.transformForArcLabel=function(a){var b,c,d,e,f,g=this,h=g.config,i=g.updateAngle(a),j="";return i&&!g.hasType("gauge")&&(b=this.svgArc.centroid(i),c=isNaN(b[0])?0:b[0],d=isNaN(b[1])?0:b[1],e=Math.sqrt(c*c+d*d),f=g.hasType("donut")&&h.donut_label_ratio?n(h.donut_label_ratio)?h.donut_label_ratio(a,g.radius,e):h.donut_label_ratio:g.hasType("pie")&&h.pie_label_ratio?n(h.pie_label_ratio)?h.pie_label_ratio(a,g.radius,e):h.pie_label_ratio:g.radius&&e?(36/g.radius>.375?1.175-36/g.radius:.8)*g.radius/e:0,j="translate("+c*f+","+d*f+")"),j},i.getArcRatio=function(a){var b=this,c=b.config,d=Math.PI*(b.hasType("gauge")&&!c.gauge_fullCircle?1:2);return a?(a.endAngle-a.startAngle)/d:null},i.convertToArcData=function(a){return this.addName({id:a.data.id,value:a.value,ratio:this.getArcRatio(a),index:a.index})},i.textForArcLabel=function(a){var b,c,d,e,f,g=this;return g.shouldShowArcLabel()?(b=g.updateAngle(a),c=b?b.value:null,d=g.getArcRatio(b),e=a.data.id,g.hasType("gauge")||g.meetsArcLabelThreshold(d)?(f=g.getArcLabelFormat(),f?f(c,d,e):g.defaultArcValueFormat(c,d)):""):""},i.expandArc=function(b){var c,d=this;return d.transiting?void(c=a.setInterval(function(){d.transiting||(a.clearInterval(c),d.legend.selectAll(".c3-legend-item-focused").size()>0&&d.expandArc(b))},10)):(b=d.mapToTargetIds(b),void d.svg.selectAll(d.selectorTargets(b,"."+l.chartArc)).each(function(a){d.shouldExpand(a.data.id)&&d.d3.select(this).selectAll("path").transition().duration(d.expandDuration(a.data.id)).attr("d",d.svgArcExpanded).transition().duration(2*d.expandDuration(a.data.id)).attr("d",d.svgArcExpandedSub).each(function(a){d.isDonutType(a.data)})}))},i.unexpandArc=function(a){var b=this;b.transiting||(a=b.mapToTargetIds(a),b.svg.selectAll(b.selectorTargets(a,"."+l.chartArc)).selectAll("path").transition().duration(function(a){return b.expandDuration(a.data.id)}).attr("d",b.svgArc),b.svg.selectAll("."+l.arc).style("opacity",1))},i.expandDuration=function(a){var b=this,c=b.config;return b.isDonutType(a)?c.donut_expand_duration:b.isGaugeType(a)?c.gauge_expand_duration:b.isPieType(a)?c.pie_expand_duration:50},i.shouldExpand=function(a){var b=this,c=b.config;return b.isDonutType(a)&&c.donut_expand||b.isGaugeType(a)&&c.gauge_expand||b.isPieType(a)&&c.pie_expand},i.shouldShowArcLabel=function(){var a=this,b=a.config,c=!0;return a.hasType("donut")?c=b.donut_label_show:a.hasType("pie")&&(c=b.pie_label_show),c},i.meetsArcLabelThreshold=function(a){var b=this,c=b.config,d=b.hasType("donut")?c.donut_label_threshold:c.pie_label_threshold;return a>=d},i.getArcLabelFormat=function(){var a=this,b=a.config,c=b.pie_label_format;return a.hasType("gauge")?c=b.gauge_label_format:a.hasType("donut")&&(c=b.donut_label_format),c},i.getArcTitle=function(){var a=this;return a.hasType("donut")?a.config.donut_title:""},i.updateTargetsForArc=function(a){var b,c,d=this,e=d.main,f=d.classChartArc.bind(d),g=d.classArcs.bind(d),h=d.classFocus.bind(d);b=e.select("."+l.chartArcs).selectAll("."+l.chartArc).data(d.pie(a)).attr("class",function(a){return f(a)+h(a.data)}),c=b.enter().append("g").attr("class",f),c.append("g").attr("class",g),c.append("text").attr("dy",d.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},i.initArc=function(){var a=this;a.arcs=a.main.select("."+l.chart).append("g").attr("class",l.chartArcs).attr("transform",a.getTranslate("arc")),a.arcs.append("text").attr("class",l.chartArcsTitle).style("text-anchor","middle").text(a.getArcTitle())},i.redrawArc=function(a,b,c){var d,e=this,f=e.d3,g=e.config,h=e.main;d=h.selectAll("."+l.arcs).selectAll("."+l.arc).data(e.arcData.bind(e)),d.enter().append("path").attr("class",e.classArc.bind(e)).style("fill",function(a){return e.color(a.data)}).style("cursor",function(a){return g.interaction_enabled&&g.data_selection_isselectable(a)?"pointer":null}).style("opacity",0).each(function(a){e.isGaugeType(a.data)&&(a.startAngle=a.endAngle=g.gauge_startingAngle),this._current=a}),d.attr("transform",function(a){return!e.isGaugeType(a.data)&&c?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).on("mouseover",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),b&&(c=e.convertToArcData(b),e.expandArc(b.data.id),e.api.focus(b.data.id),e.toggleFocusLegend(b.data.id,!0),e.config.data_onmouseover(c,this)))}:null).on("mousemove",g.interaction_enabled?function(a){var b,c,d=e.updateAngle(a);d&&(b=e.convertToArcData(d),c=[b],e.showTooltip(c,this))}:null).on("mouseout",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),b&&(c=e.convertToArcData(b),e.unexpandArc(b.data.id),e.api.revert(),e.revertLegend(),e.hideTooltip(),e.config.data_onmouseout(c,this)))}:null).on("click",g.interaction_enabled?function(a,b){var c,d=e.updateAngle(a);d&&(c=e.convertToArcData(d),e.toggleShape&&e.toggleShape(this,c,b),e.config.data_onclick.call(e.api,c,this))}:null).each(function(){e.transiting=!0}).transition().duration(a).attrTween("d",function(a){var b,c=e.updateAngle(a);return c?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=f.interpolate(this._current,c),this._current=b(0),function(c){var d=b(c);return d.data=a.data,e.getArc(d,!0)}):function(){return"M 0 0"}}).attr("transform",c?"scale(1)":"").style("fill",function(a){return e.levelColor?e.levelColor(a.data.values[0].value):e.color(a.data.id)}).style("opacity",1).call(e.endall,function(){e.transiting=!1}),d.exit().transition().duration(b).style("opacity",0).remove(),h.selectAll("."+l.chartArc).select("text").style("opacity",0).attr("class",function(a){return e.isGaugeType(a.data)?l.gaugeValue:""}).text(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(a){return e.isGaugeType(a.data)?Math.round(e.radius/5)+"px":""}).transition().duration(a).style("opacity",function(a){return e.isTargetToShow(a.data.id)&&e.isArcType(a.data)?1:0}),h.select("."+l.chartArcsTitle).style("opacity",e.hasType("donut")||e.hasType("gauge")?1:0),e.hasType("gauge")&&(e.arcs.select("."+l.chartArcsBackground).attr("d",function(){var a={data:[{value:g.gauge_max}],startAngle:g.gauge_startingAngle,endAngle:-1*g.gauge_startingAngle};return e.getArc(a,!0,!0)}),e.arcs.select("."+l.chartArcsGaugeUnit).attr("dy",".75em").text(g.gauge_label_show?g.gauge_units:""),e.arcs.select("."+l.chartArcsGaugeMin).attr("dx",-1*(e.innerRadius+(e.radius-e.innerRadius)/(g.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_min:""),e.arcs.select("."+l.chartArcsGaugeMax).attr("dx",e.innerRadius+(e.radius-e.innerRadius)/(g.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_max:""))},i.initGauge=function(){var a=this.arcs;this.hasType("gauge")&&(a.append("path").attr("class",l.chartArcsBackground),a.append("text").attr("class",l.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",l.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",l.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},i.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},i.initRegion=function(){var a=this;a.region=a.main.append("g").attr("clip-path",a.clipPath).attr("class",l.regions)},i.updateRegion=function(a){var b=this,c=b.config;b.region.style("visibility",b.hasArcType()?"hidden":"visible"),b.mainRegion=b.main.select("."+l.regions).selectAll("."+l.region).data(c.regions),b.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),b.mainRegion.attr("class",b.classRegion.bind(b)),b.mainRegion.exit().transition().duration(a).style("opacity",0).remove()},i.redrawRegion=function(a){var b=this,c=b.mainRegion.selectAll("rect").each(function(){var a=b.d3.select(this.parentNode).datum();b.d3.select(this).datum(a)}),d=b.regionX.bind(b),e=b.regionY.bind(b),f=b.regionWidth.bind(b),g=b.regionHeight.bind(b);return[(a?c.transition():c).attr("x",d).attr("y",e).attr("width",f).attr("height",g).style("fill-opacity",function(a){return m(a.opacity)?a.opacity:.1})]},i.regionX=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"start"in a?e(a.start):0:d.axis_rotated?0:"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionY=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?0:"end"in a?e(a.end):0:d.axis_rotated&&"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionWidth=function(a){var b,c=this,d=c.config,e=c.regionX(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"end"in a?f(a.end):c.width:d.axis_rotated?c.width:"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.width,e>b?0:b-e},i.regionHeight=function(a){var b,c=this,d=c.config,e=this.regionY(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?c.height:"start"in a?f(a.start):c.height:d.axis_rotated&&"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.height,e>b?0:b-e},i.isRegionOnX=function(a){return!a.axis||"x"===a.axis},i.drag=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.config,m=j.main,n=j.d3;j.hasArcType()||k.data_selection_enabled&&(k.zoom_enabled&&!j.zoom.altDomain||k.data_selection_multiple&&(b=j.dragStart[0],c=j.dragStart[1],d=a[0],e=a[1],f=Math.min(b,d),g=Math.max(b,d),h=k.data_selection_grouped?j.margin.top:Math.min(c,e),i=k.data_selection_grouped?j.height:Math.max(c,e),m.select("."+l.dragarea).attr("x",f).attr("y",h).attr("width",g-f).attr("height",i-h),m.selectAll("."+l.shapes).selectAll("."+l.shape).filter(function(a){return k.data_selection_isselectable(a)}).each(function(a,b){var c,d,e,k,m,o,p=n.select(this),q=p.classed(l.SELECTED),r=p.classed(l.INCLUDED),s=!1;if(p.classed(l.circle))c=1*p.attr("cx"),d=1*p.attr("cy"),m=j.togglePoint,s=c>f&&g>c&&d>h&&i>d;else{if(!p.classed(l.bar))return;o=z(this),c=o.x,d=o.y,e=o.width,k=o.height,m=j.togglePath,s=!(c>g||f>c+e||d>i||h>d+k)}s^r&&(p.classed(l.INCLUDED,!r),p.classed(l.SELECTED,!q),m.call(j,!q,p,a,b))})))},i.dragstart=function(a){var b=this,c=b.config;b.hasArcType()||c.data_selection_enabled&&(b.dragStart=a,b.main.select("."+l.chart).append("rect").attr("class",l.dragarea).style("opacity",.1),b.dragging=!0)},i.dragend=function(){var a=this,b=a.config;a.hasArcType()||b.data_selection_enabled&&(a.main.select("."+l.dragarea).transition().duration(100).style("opacity",0).remove(),a.main.selectAll("."+l.shape).classed(l.INCLUDED,!1),a.dragging=!1)},i.selectPoint=function(a,b,c){var d=this,e=d.config,f=(e.axis_rotated?d.circleY:d.circleX).bind(d),g=(e.axis_rotated?d.circleX:d.circleY).bind(d),h=d.pointSelectR.bind(d);e.data_onselected.call(d.api,b,a.node()),d.main.select("."+l.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+l.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return d.generateClass(l.selectedCircle,c)}).attr("cx",f).attr("cy",g).attr("stroke",function(){return d.color(b)}).attr("r",function(a){return 1.4*d.pointSelectR(a)}).transition().duration(100).attr("r",h)},i.unselectPoint=function(a,b,c){var d=this;d.config.data_onunselected.call(d.api,b,a.node()),d.main.select("."+l.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+l.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()},i.togglePoint=function(a,b,c,d){a?this.selectPoint(b,c,d):this.unselectPoint(b,c,d)},i.selectPath=function(a,b){var c=this;c.config.data_onselected.call(c,b,a.node()),c.config.interaction_brighten&&a.transition().duration(100).style("fill",function(){return c.d3.rgb(c.color(b)).brighter(.75)})},i.unselectPath=function(a,b){var c=this;c.config.data_onunselected.call(c,b,a.node()),c.config.interaction_brighten&&a.transition().duration(100).style("fill",function(){return c.color(b)})},i.togglePath=function(a,b,c,d){a?this.selectPath(b,c,d):this.unselectPath(b,c,d)},i.getToggle=function(a,b){var c,d=this;return"circle"===a.nodeName?c=d.isStepType(b)?function(){}:d.togglePoint:"path"===a.nodeName&&(c=d.togglePath),c},i.toggleShape=function(a,b,c){var d=this,e=d.d3,f=d.config,g=e.select(a),h=g.classed(l.SELECTED),i=d.getToggle(a,b).bind(d);f.data_selection_enabled&&f.data_selection_isselectable(b)&&(f.data_selection_multiple||d.main.selectAll("."+l.shapes+(f.data_selection_grouped?d.getTargetSelectorSuffix(b.id):"")).selectAll("."+l.shape).each(function(a,b){var c=e.select(this);c.classed(l.SELECTED)&&i(!1,c.classed(l.SELECTED,!1),a,b)}),g.classed(l.SELECTED,!h),i(!h,g,b,c))},i.initBrush=function(){var a=this,b=a.d3;a.brush=b.svg.brush().on("brush",function(){a.redrawForBrush()}),a.brush.update=function(){return a.context&&a.context.select("."+l.brush).call(this),this},a.brush.scale=function(b){return a.config.axis_rotated?this.y(b):this.x(b)}},i.initSubchart=function(){var a=this,b=a.config,c=a.context=a.svg.append("g").attr("transform",a.getTranslate("context")),d=b.subchart_show?"visible":"hidden";c.style("visibility",d),c.append("g").attr("clip-path",a.clipPathForSubchart).attr("class",l.chart),c.select("."+l.chart).append("g").attr("class",l.chartBars),c.select("."+l.chart).append("g").attr("class",l.chartLines),c.append("g").attr("clip-path",a.clipPath).attr("class",l.brush).call(a.brush),a.axes.subx=c.append("g").attr("class",l.axisX).attr("transform",a.getTranslate("subx")).attr("clip-path",b.axis_rotated?"":a.clipPathForXAxis).style("visibility",b.subchart_axis_x_show?d:"hidden")},i.updateTargetsForSubchart=function(a){var b,c,d,e,f=this,g=f.context,h=f.config,i=f.classChartBar.bind(f),j=f.classBars.bind(f),k=f.classChartLine.bind(f),m=f.classLines.bind(f),n=f.classAreas.bind(f);h.subchart_show&&(e=g.select("."+l.chartBars).selectAll("."+l.chartBar).data(a).attr("class",i),d=e.enter().append("g").style("opacity",0).attr("class",i),d.append("g").attr("class",j),c=g.select("."+l.chartLines).selectAll("."+l.chartLine).data(a).attr("class",k),b=c.enter().append("g").style("opacity",0).attr("class",k),b.append("g").attr("class",m),b.append("g").attr("class",n),g.selectAll("."+l.brush+" rect").attr(h.axis_rotated?"width":"height",h.axis_rotated?f.width2:f.height2))},i.updateBarForSubchart=function(a){var b=this;b.contextBar=b.context.selectAll("."+l.bars).selectAll("."+l.bar).data(b.barData.bind(b)),b.contextBar.enter().append("path").attr("class",b.classBar.bind(b)).style("stroke","none").style("fill",b.color),b.contextBar.style("opacity",b.initialOpacity.bind(b)),b.contextBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBarForSubchart=function(a,b,c){(b?this.contextBar.transition(Math.random().toString()).duration(c):this.contextBar).attr("d",a).style("opacity",1)},i.updateLineForSubchart=function(a){var b=this;b.contextLine=b.context.selectAll("."+l.lines).selectAll("."+l.line).data(b.lineData.bind(b)),b.contextLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.contextLine.style("opacity",b.initialOpacity.bind(b)),b.contextLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLineForSubchart=function(a,b,c){(b?this.contextLine.transition(Math.random().toString()).duration(c):this.contextLine).attr("d",a).style("opacity",1)},i.updateAreaForSubchart=function(a){var b=this,c=b.d3;b.contextArea=b.context.selectAll("."+l.areas).selectAll("."+l.area).data(b.lineData.bind(b)),b.contextArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.contextArea.style("opacity",0),b.contextArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawAreaForSubchart=function(a,b,c){(b?this.contextArea.transition(Math.random().toString()).duration(c):this.contextArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)},i.redrawSubchart=function(a,b,c,d,e,f,g){var h,i,j,k=this,l=k.d3,m=k.config;k.context.style("visibility",m.subchart_show?"visible":"hidden"),m.subchart_show&&(l.event&&"zoom"===l.event.type&&k.brush.extent(k.x.orgDomain()).update(),a&&(k.brush.empty()||k.brush.extent(k.x.orgDomain()).update(),h=k.generateDrawArea(e,!0),i=k.generateDrawBar(f,!0),j=k.generateDrawLine(g,!0),k.updateBarForSubchart(c),k.updateLineForSubchart(c),k.updateAreaForSubchart(c),k.redrawBarForSubchart(i,c,c),k.redrawLineForSubchart(j,c,c),k.redrawAreaForSubchart(h,c,c)))},i.redrawForBrush=function(){var a=this,b=a.x;a.redraw({withTransition:!1,withY:a.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),a.config.subchart_onbrush.call(a.api,b.orgDomain())},i.transformContext=function(a,b){var c,d=this;b&&b.axisSubX?c=b.axisSubX:(c=d.context.select("."+l.axisX),a&&(c=c.transition())),d.context.attr("transform",d.getTranslate("context")),c.attr("transform",d.getTranslate("subx"))},i.getDefaultExtent=function(){var a=this,b=a.config,c=n(b.axis_x_extent)?b.axis_x_extent(a.getXDomain(a.data.targets)):b.axis_x_extent;return a.isTimeSeries()&&(c=[a.parseDate(c[0]),a.parseDate(c[1])]),c},i.initZoom=function(){var a,b=this,c=b.d3,d=b.config;b.zoom=c.behavior.zoom().on("zoomstart",function(){a=c.event.sourceEvent,b.zoom.altDomain=c.event.sourceEvent.altKey?b.x.orgDomain():null,d.zoom_onzoomstart.call(b.api,c.event.sourceEvent)}).on("zoom",function(){b.redrawForZoom.call(b)}).on("zoomend",function(){var e=c.event.sourceEvent;e&&a.clientX===e.clientX&&a.clientY===e.clientY||(b.redrawEventRect(),b.updateZoom(),d.zoom_onzoomend.call(b.api,b.x.orgDomain()))}),b.zoom.scale=function(a){return d.axis_rotated?this.y(a):this.x(a)},b.zoom.orgScaleExtent=function(){var a=d.zoom_extent?d.zoom_extent:[1,10];return[a[0],Math.max(b.getMaxDataCount()/a[1],a[1])]},b.zoom.updateScaleExtent=function(){var a=t(b.x.orgDomain())/t(b.getZoomDomain()),c=this.orgScaleExtent();return this.scaleExtent([c[0]*a,c[1]*a]),this}},i.getZoomDomain=function(){var a=this,b=a.config,c=a.d3,d=c.min([a.orgXDomain[0],b.zoom_x_min]),e=c.max([a.orgXDomain[1],b.zoom_x_max]);return[d,e]},i.updateZoom=function(){var a=this,b=a.config.zoom_enabled?a.zoom:function(){};a.main.select("."+l.zoomRect).call(b).on("dblclick.zoom",null),a.main.selectAll("."+l.eventRect).call(b).on("dblclick.zoom",null)},i.redrawForZoom=function(){var a=this,b=a.d3,c=a.config,d=a.zoom,e=a.x;if(c.zoom_enabled&&0!==a.filterTargetsToShow(a.data.targets).length){if("mousemove"===b.event.sourceEvent.type&&d.altDomain)return e.domain(d.altDomain),void d.scale(e).updateScaleExtent();a.isCategorized()&&e.orgDomain()[0]===a.orgXDomain[0]&&e.domain([a.orgXDomain[0]-1e-10,e.orgDomain()[1]]),a.redraw({withTransition:!1,withY:c.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===b.event.sourceEvent.type&&(a.cancelClick=!0),c.zoom_onzoom.call(a.api,e.orgDomain())}},i.generateColor=function(){var a=this,b=a.config,c=a.d3,d=b.data_colors,e=v(b.color_pattern)?b.color_pattern:c.scale.category10().range(),f=b.data_color,g=[];return function(a){var b,c=a.id||a.data&&a.data.id||a;return d[c]instanceof Function?b=d[c](a):d[c]?b=d[c]:(g.indexOf(c)<0&&g.push(c),b=e[g.indexOf(c)%e.length],d[c]=b),f instanceof Function?f(b,a):b}},i.generateLevelColor=function(){var a=this,b=a.config,c=b.color_pattern,d=b.color_threshold,e="value"===d.unit,f=d.values&&d.values.length?d.values:[],g=d.max||100;return v(b.color_threshold)?function(a){var b,d,h=c[c.length-1];for(b=0;b<f.length;b++)if(d=e?a:100*a/g,d<f[b]){h=c[b];break}return h}:null},i.getYFormat=function(a){var b=this,c=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.yFormat,d=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.y2Format;return function(a,e,f){var g="y2"===b.axis.getId(f)?d:c;return g.call(b,a,e)}},i.yFormat=function(a){var b=this,c=b.config,d=c.axis_y_tick_format?c.axis_y_tick_format:b.defaultValueFormat;return d(a)},i.y2Format=function(a){var b=this,c=b.config,d=c.axis_y2_tick_format?c.axis_y2_tick_format:b.defaultValueFormat;return d(a)},i.defaultValueFormat=function(a){return m(a)?+a:""},i.defaultArcValueFormat=function(a,b){return(100*b).toFixed(1)+"%"},i.dataLabelFormat=function(a){var b,c=this,d=c.config.data_labels,e=function(a){return m(a)?+a:""};return b="function"==typeof d.format?d.format:"object"==typeof d.format?d.format[a]?d.format[a]===!0?e:d.format[a]:function(){return""}:e},i.hasCaches=function(a){for(var b=0;b<a.length;b++)if(!(a[b]in this.cache))return!1;return!0},i.addCache=function(a,b){this.cache[a]=this.cloneTarget(b)},i.getCaches=function(a){var b,c=[];for(b=0;b<a.length;b++)a[b]in this.cache&&c.push(this.cloneTarget(this.cache[a[b]]));return c};var l=i.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};i.generateClass=function(a,b){return" "+a+" "+a+this.getTargetSelectorSuffix(b)},i.classText=function(a){return this.generateClass(l.text,a.index)},i.classTexts=function(a){return this.generateClass(l.texts,a.id)},i.classShape=function(a){return this.generateClass(l.shape,a.index)},i.classShapes=function(a){return this.generateClass(l.shapes,a.id)},i.classLine=function(a){return this.classShape(a)+this.generateClass(l.line,a.id)},i.classLines=function(a){return this.classShapes(a)+this.generateClass(l.lines,a.id)},i.classCircle=function(a){return this.classShape(a)+this.generateClass(l.circle,a.index)},i.classCircles=function(a){return this.classShapes(a)+this.generateClass(l.circles,a.id)},i.classBar=function(a){return this.classShape(a)+this.generateClass(l.bar,a.index)},i.classBars=function(a){return this.classShapes(a)+this.generateClass(l.bars,a.id)},i.classArc=function(a){return this.classShape(a.data)+this.generateClass(l.arc,a.data.id)},i.classArcs=function(a){return this.classShapes(a.data)+this.generateClass(l.arcs,a.data.id)},i.classArea=function(a){return this.classShape(a)+this.generateClass(l.area,a.id)},i.classAreas=function(a){return this.classShapes(a)+this.generateClass(l.areas,a.id)},i.classRegion=function(a,b){return this.generateClass(l.region,b)+" "+("class"in a?a["class"]:"")},i.classEvent=function(a){return this.generateClass(l.eventRect,a.index)},i.classTarget=function(a){var b=this,c=b.config.data_classes[a],d="";return c&&(d=" "+l.target+"-"+c),b.generateClass(l.target,a)+d},i.classFocus=function(a){return this.classFocused(a)+this.classDefocused(a)},i.classFocused=function(a){return" "+(this.focusedTargetIds.indexOf(a.id)>=0?l.focused:"")},i.classDefocused=function(a){return" "+(this.defocusedTargetIds.indexOf(a.id)>=0?l.defocused:"")},i.classChartText=function(a){return l.chartText+this.classTarget(a.id)},i.classChartLine=function(a){return l.chartLine+this.classTarget(a.id)},i.classChartBar=function(a){return l.chartBar+this.classTarget(a.id)},i.classChartArc=function(a){return l.chartArc+this.classTarget(a.data.id)},i.getTargetSelectorSuffix=function(a){return a||0===a?("-"+a).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},i.selectorTarget=function(a,b){return(b||"")+"."+l.target+this.getTargetSelectorSuffix(a)},i.selectorTargets=function(a,b){var c=this;return a=a||[],a.length?a.map(function(a){return c.selectorTarget(a,b)}):null},i.selectorLegend=function(a){return"."+l.legendItem+this.getTargetSelectorSuffix(a)},i.selectorLegends=function(a){var b=this;return a&&a.length?a.map(function(a){return b.selectorLegend(a)}):null};var m=i.isValue=function(a){return a||0===a},n=i.isFunction=function(a){return"function"==typeof a},o=i.isString=function(a){return"string"==typeof a},p=i.isUndefined=function(a){return"undefined"==typeof a},q=i.isDefined=function(a){return"undefined"!=typeof a},r=i.ceil10=function(a){return 10*Math.ceil(a/10)},s=i.asHalfPixel=function(a){return Math.ceil(a)+.5},t=i.diffDomain=function(a){return a[1]-a[0]},u=i.isEmpty=function(a){return"undefined"==typeof a||null===a||o(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length},v=i.notEmpty=function(a){return!i.isEmpty(a)},w=i.getOption=function(a,b,c){return q(a[b])?a[b]:c},x=i.hasValue=function(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c},y=i.sanitise=function(a){return"string"==typeof a?a.replace(/</g,"&lt;").replace(/>/g,"&gt;"):a},z=i.getPathBox=function(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}};h.focus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),this.revert(),this.defocus(),b.classed(l.focused,!0).classed(l.defocused,!1),
5
+ c.hasArcType()&&c.expandArc(a),c.toggleFocusLegend(a,!0),c.focusedTargetIds=a,c.defocusedTargetIds=c.defocusedTargetIds.filter(function(b){return a.indexOf(b)<0})},h.defocus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),b.classed(l.focused,!1).classed(l.defocused,!0),c.hasArcType()&&c.unexpandArc(a),c.toggleFocusLegend(a,!1),c.focusedTargetIds=c.focusedTargetIds.filter(function(b){return a.indexOf(b)<0}),c.defocusedTargetIds=a},h.revert=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a)),b.classed(l.focused,!1).classed(l.defocused,!1),c.hasArcType()&&c.unexpandArc(a),c.config.legend_show&&(c.showLegend(a.filter(c.isLegendToShow.bind(c))),c.legend.selectAll(c.selectorLegends(a)).filter(function(){return c.d3.select(this).classed(l.legendItemFocused)}).classed(l.legendItemFocused,!1)),c.focusedTargetIds=[],c.defocusedTargetIds=[]},h.show=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.removeHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",1,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",1)}),b.withLegend&&d.showLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.hide=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.addHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",0,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",0)}),b.withLegend&&d.hideLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.toggle=function(a,b){var c=this,d=this.internal;d.mapToTargetIds(a).forEach(function(a){d.isTargetToShow(a)?c.hide(a,b):c.show(a,b)})},h.zoom=function(a){var b=this.internal;return a&&(b.isTimeSeries()&&(a=a.map(function(a){return b.parseDate(a)})),b.brush.extent(a),b.redraw({withUpdateXDomain:!0,withY:b.config.zoom_rescale}),b.config.zoom_onzoom.call(this,b.x.orgDomain())),b.brush.extent()},h.zoom.enable=function(a){var b=this.internal;b.config.zoom_enabled=a,b.updateAndRedraw()},h.unzoom=function(){var a=this.internal;a.brush.clear().update(),a.redraw({withUpdateXDomain:!0})},h.zoom.max=function(a){var b=this.internal,c=b.config,d=b.d3;return 0===a||a?void(c.zoom_x_max=d.max([b.orgXDomain[1],a])):c.zoom_x_max},h.zoom.min=function(a){var b=this.internal,c=b.config,d=b.d3;return 0===a||a?void(c.zoom_x_min=d.min([b.orgXDomain[0],a])):c.zoom_x_min},h.zoom.range=function(a){return arguments.length?(q(a.max)&&this.domain.max(a.max),void(q(a.min)&&this.domain.min(a.min))):{max:this.domain.max(),min:this.domain.min()}},h.load=function(a){var b=this.internal,c=b.config;return a.xs&&b.addXs(a.xs),"names"in a&&h.data.names.bind(this)(a.names),"classes"in a&&Object.keys(a.classes).forEach(function(b){c.data_classes[b]=a.classes[b]}),"categories"in a&&b.isCategorized()&&(c.axis_x_categories=a.categories),"axes"in a&&Object.keys(a.axes).forEach(function(b){c.data_axes[b]=a.axes[b]}),"colors"in a&&Object.keys(a.colors).forEach(function(b){c.data_colors[b]=a.colors[b]}),"cacheIds"in a&&b.hasCaches(a.cacheIds)?void b.load(b.getCaches(a.cacheIds),a.done):void("unload"in a?b.unload(b.mapToTargetIds("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){b.loadFromArgs(a)}):b.loadFromArgs(a))},h.unload=function(a){var b=this.internal;a=a||{},a instanceof Array?a={ids:a}:"string"==typeof a&&(a={ids:[a]}),b.unload(b.mapToTargetIds(a.ids),function(){b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.done&&a.done()})},h.flow=function(a){var b,c,d,e,f,g,h,i,j=this.internal,k=[],l=j.getMaxDataCount(),n=0,o=0;if(a.json)c=j.convertJsonToData(a.json,a.keys);else if(a.rows)c=j.convertRowsToData(a.rows);else{if(!a.columns)return;c=j.convertColumnsToData(a.columns)}b=j.convertDataToTargets(c,!0),j.data.targets.forEach(function(a){var c,d,e=!1;for(c=0;c<b.length;c++)if(a.id===b[c].id){for(e=!0,a.values[a.values.length-1]&&(o=a.values[a.values.length-1].index+1),n=b[c].values.length,d=0;n>d;d++)b[c].values[d].index=o+d,j.isTimeSeries()||(b[c].values[d].x=o+d);a.values=a.values.concat(b[c].values),b.splice(c,1);break}e||k.push(a.id)}),j.data.targets.forEach(function(a){var b,c;for(b=0;b<k.length;b++)if(a.id===k[b])for(o=a.values[a.values.length-1].index+1,c=0;n>c;c++)a.values.push({id:a.id,index:o+c,x:j.isTimeSeries()?j.getOtherTargetX(o+c):o+c,value:null})}),j.data.targets.length&&b.forEach(function(a){var b,c=[];for(b=j.data.targets[0].values[0].index;o>b;b++)c.push({id:a.id,index:b,x:j.isTimeSeries()?j.getOtherTargetX(b):b,value:null});a.values.forEach(function(a){a.index+=o,j.isTimeSeries()||(a.x+=o)}),a.values=c.concat(a.values)}),j.data.targets=j.data.targets.concat(b),d=j.getMaxDataCount(),f=j.data.targets[0],g=f.values[0],q(a.to)?(n=0,i=j.isTimeSeries()?j.parseDate(a.to):a.to,f.values.forEach(function(a){a.x<i&&n++})):q(a.length)&&(n=a.length),l?1===l&&j.isTimeSeries()&&(h=(f.values[f.values.length-1].x-g.x)/2,e=[new Date(+g.x-h),new Date(+g.x+h)],j.updateXDomain(null,!0,!0,!1,e)):(h=j.isTimeSeries()?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-j.getXDomain(j.data.targets)[0]:1,e=[g.x-h,g.x],j.updateXDomain(null,!0,!0,!1,e)),j.updateTargets(j.data.targets),j.redraw({flow:{index:g.index,length:n,duration:m(a.duration)?a.duration:j.config.transition_duration,done:a.done,orgDataCount:l},withLegend:!0,withTransition:l>1,withTrimXDomain:!1,withUpdateXAxis:!0})},i.generateFlow=function(a){var b=this,c=b.config,d=b.d3;return function(){var e,f,g,h=a.targets,i=a.flow,j=a.drawBar,k=a.drawLine,m=a.drawArea,n=a.cx,o=a.cy,p=a.xv,q=a.xForText,r=a.yForText,s=a.duration,u=1,v=i.index,w=i.length,x=b.getValueOnIndex(b.data.targets[0].values,v),y=b.getValueOnIndex(b.data.targets[0].values,v+w),z=b.x.domain(),A=i.duration||s,B=i.done||function(){},C=b.generateWait(),D=b.xgrid||d.selectAll([]),E=b.xgridLines||d.selectAll([]),F=b.mainRegion||d.selectAll([]),G=b.mainText||d.selectAll([]),H=b.mainBar||d.selectAll([]),I=b.mainLine||d.selectAll([]),J=b.mainArea||d.selectAll([]),K=b.mainCircle||d.selectAll([]);b.flowing=!0,b.data.targets.forEach(function(a){a.values.splice(0,w)}),g=b.updateXDomain(h,!0,!0),b.updateXGrid&&b.updateXGrid(!0),i.orgDataCount?e=1===i.orgDataCount||(x&&x.x)===(y&&y.x)?b.x(z[0])-b.x(g[0]):b.isTimeSeries()?b.x(z[0])-b.x(g[0]):b.x(x.x)-b.x(y.x):1!==b.data.targets[0].values.length?e=b.x(z[0])-b.x(g[0]):b.isTimeSeries()?(x=b.getValueOnIndex(b.data.targets[0].values,0),y=b.getValueOnIndex(b.data.targets[0].values,b.data.targets[0].values.length-1),e=b.x(x.x)-b.x(y.x)):e=t(g)/2,u=t(z)/t(g),f="translate("+e+",0) scale("+u+",1)",b.hideXGridFocus(),d.transition().ease("linear").duration(A).each(function(){C.add(b.axes.x.transition().call(b.xAxis)),C.add(H.transition().attr("transform",f)),C.add(I.transition().attr("transform",f)),C.add(J.transition().attr("transform",f)),C.add(K.transition().attr("transform",f)),C.add(G.transition().attr("transform",f)),C.add(F.filter(b.isRegionOnX).transition().attr("transform",f)),C.add(D.transition().attr("transform",f)),C.add(E.transition().attr("transform",f))}).call(C,function(){var a,d=[],e=[],f=[];if(w){for(a=0;w>a;a++)d.push("."+l.shape+"-"+(v+a)),e.push("."+l.text+"-"+(v+a)),f.push("."+l.eventRect+"-"+(v+a));b.svg.selectAll("."+l.shapes).selectAll(d).remove(),b.svg.selectAll("."+l.texts).selectAll(e).remove(),b.svg.selectAll("."+l.eventRects).selectAll(f).remove(),b.svg.select("."+l.xgrid).remove()}D.attr("transform",null).attr(b.xgridAttr),E.attr("transform",null),E.select("line").attr("x1",c.axis_rotated?0:p).attr("x2",c.axis_rotated?b.width:p),E.select("text").attr("x",c.axis_rotated?b.width:0).attr("y",p),H.attr("transform",null).attr("d",j),I.attr("transform",null).attr("d",k),J.attr("transform",null).attr("d",m),K.attr("transform",null).attr("cx",n).attr("cy",o),G.attr("transform",null).attr("x",q).attr("y",r).style("fill-opacity",b.opacityForText.bind(b)),F.attr("transform",null),F.select("rect").filter(b.isRegionOnX).attr("x",b.regionX.bind(b)).attr("width",b.regionWidth.bind(b)),c.interaction_enabled&&b.redrawEventRect(),B(),b.flowing=!1})}},h.selected=function(a){var b=this.internal,c=b.d3;return c.merge(b.main.selectAll("."+l.shapes+b.getTargetSelectorSuffix(a)).selectAll("."+l.shape).filter(function(){return c.select(this).classed(l.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},h.select=function(a,b,c){var d=this.internal,e=d.d3,f=d.config;f.data_selection_enabled&&d.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(g,h){var i=e.select(this),j=g.data?g.data.id:g.id,k=d.getToggle(this,g).bind(d),m=f.data_selection_grouped||!a||a.indexOf(j)>=0,n=!b||b.indexOf(h)>=0,o=i.classed(l.SELECTED);i.classed(l.line)||i.classed(l.area)||(m&&n?f.data_selection_isselectable(g)&&!o&&k(!0,i.classed(l.SELECTED,!0),g,h):q(c)&&c&&o&&k(!1,i.classed(l.SELECTED,!1),g,h))})},h.unselect=function(a,b){var c=this.internal,d=c.d3,e=c.config;e.data_selection_enabled&&c.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(f,g){var h=d.select(this),i=f.data?f.data.id:f.id,j=c.getToggle(this,f).bind(c),k=e.data_selection_grouped||!a||a.indexOf(i)>=0,m=!b||b.indexOf(g)>=0,n=h.classed(l.SELECTED);h.classed(l.line)||h.classed(l.area)||k&&m&&e.data_selection_isselectable(f)&&n&&j(!1,h.classed(l.SELECTED,!1),f,g)})},h.transform=function(a,b){var c=this.internal,d=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;c.transformTo(b,a,d)},i.transformTo=function(a,b,c){var d=this,e=!d.hasArcType(),f=c||{withTransitionForAxis:e};f.withTransitionForTransform=!1,d.transiting=!1,d.setTargetType(a,b),d.updateTargets(d.data.targets),d.updateAndRedraw(f)},h.groups=function(a){var b=this.internal,c=b.config;return p(a)?c.data_groups:(c.data_groups=a,b.redraw(),c.data_groups)},h.xgrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_x_lines=a,b.redrawWithoutRescale(),c.grid_x_lines):c.grid_x_lines},h.xgrids.add=function(a){var b=this.internal;return this.xgrids(b.config.grid_x_lines.concat(a?a:[]))},h.xgrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!0)},h.ygrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_y_lines=a,b.redrawWithoutRescale(),c.grid_y_lines):c.grid_y_lines},h.ygrids.add=function(a){var b=this.internal;return this.ygrids(b.config.grid_y_lines.concat(a?a:[]))},h.ygrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!1)},h.regions=function(a){var b=this.internal,c=b.config;return a?(c.regions=a,b.redrawWithoutRescale(),c.regions):c.regions},h.regions.add=function(a){var b=this.internal,c=b.config;return a?(c.regions=c.regions.concat(a),b.redrawWithoutRescale(),c.regions):c.regions},h.regions.remove=function(a){var b,c,d,e=this.internal,f=e.config;return a=a||{},b=e.getOption(a,"duration",f.transition_duration),c=e.getOption(a,"classes",[l.region]),d=e.main.select("."+l.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),f.regions=f.regions.filter(function(a){var b=!1;return a["class"]?(a["class"].split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0}),f.regions},h.data=function(a){var b=this.internal.data.targets;return"undefined"==typeof a?b:b.filter(function(b){return[].concat(a).indexOf(b.id)>=0})},h.data.shown=function(a){return this.internal.filterTargetsToShow(this.data(a))},h.data.values=function(a){var b,c=null;return a&&(b=this.data(a),c=b[0]?b[0].values.map(function(a){return a.value}):null),c},h.data.names=function(a){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",a)},h.data.colors=function(a){return this.internal.updateDataAttributes("colors",a)},h.data.axes=function(a){return this.internal.updateDataAttributes("axes",a)},h.category=function(a,b){var c=this.internal,d=c.config;return arguments.length>1&&(d.axis_x_categories[a]=b,c.redraw()),d.axis_x_categories[a]},h.categories=function(a){var b=this.internal,c=b.config;return arguments.length?(c.axis_x_categories=a,b.redraw(),c.axis_x_categories):c.axis_x_categories},h.color=function(a){var b=this.internal;return b.color(a)},h.x=function(a){var b=this.internal;return arguments.length&&(b.updateTargetX(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.xs=function(a){var b=this.internal;return arguments.length&&(b.updateTargetXs(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.axis=function(){},h.axis.labels=function(a){var b=this.internal;arguments.length&&(Object.keys(a).forEach(function(c){b.axis.setLabelText(c,a[c])}),b.axis.updateLabels())},h.axis.max=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(m(a.x)&&(c.axis_x_max=a.x),m(a.y)&&(c.axis_y_max=a.y),m(a.y2)&&(c.axis_y2_max=a.y2)):c.axis_y_max=c.axis_y2_max=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_max,y:c.axis_y_max,y2:c.axis_y2_max}},h.axis.min=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(m(a.x)&&(c.axis_x_min=a.x),m(a.y)&&(c.axis_y_min=a.y),m(a.y2)&&(c.axis_y2_min=a.y2)):c.axis_y_min=c.axis_y2_min=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_min,y:c.axis_y_min,y2:c.axis_y2_min}},h.axis.range=function(a){return arguments.length?(q(a.max)&&this.axis.max(a.max),void(q(a.min)&&this.axis.min(a.min))):{max:this.axis.max(),min:this.axis.min()}},h.legend=function(){},h.legend.show=function(a){var b=this.internal;b.showLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.legend.hide=function(a){var b=this.internal;b.hideLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.resize=function(a){var b=this.internal,c=b.config;c.size_width=a?a.width:null,c.size_height=a?a.height:null,this.flush()},h.flush=function(){var a=this.internal;a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},h.destroy=function(){var b=this.internal;if(a.clearInterval(b.intervalForObserveInserted),void 0!==b.resizeTimeout&&a.clearTimeout(b.resizeTimeout),a.detachEvent)a.detachEvent("onresize",b.resizeFunction);else if(a.removeEventListener)a.removeEventListener("resize",b.resizeFunction);else{var c=a.onresize;c&&c.add&&c.remove&&c.remove(b.resizeFunction)}return b.selectChart.classed("c3",!1).html(""),Object.keys(b).forEach(function(a){b[a]=null}),null},h.tooltip=function(){},h.tooltip.show=function(a){var b,c,d=this.internal;a.mouse&&(c=a.mouse),a.data?d.isMultipleX()?(c=[d.x(a.data.x),d.getYScale(a.data.id)(a.data.value)],b=null):b=m(a.data.index)?a.data.index:d.getIndexByX(a.data.x):"undefined"!=typeof a.x?b=d.getIndexByX(a.x):"undefined"!=typeof a.index&&(b=a.index),d.dispatchEvent("mouseover",b,c),d.dispatchEvent("mousemove",b,c),d.config.tooltip_onshow.call(d,a.data)},h.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)};var A;i.isSafari=function(){var b=a.navigator.userAgent;return b.indexOf("Safari")>=0&&b.indexOf("Chrome")<0},i.isChrome=function(){var b=a.navigator.userAgent;return b.indexOf("Chrome")>=0},Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),function(){"SVGPathSeg"in a||(a.SVGPathSeg=function(a,b,c){this.pathSegType=a,this.pathSegTypeAsLetter=b,this._owningPathSegList=c},SVGPathSeg.PATHSEG_UNKNOWN=0,SVGPathSeg.PATHSEG_CLOSEPATH=1,SVGPathSeg.PATHSEG_MOVETO_ABS=2,SVGPathSeg.PATHSEG_MOVETO_REL=3,SVGPathSeg.PATHSEG_LINETO_ABS=4,SVGPathSeg.PATHSEG_LINETO_REL=5,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,SVGPathSeg.PATHSEG_ARC_ABS=10,SVGPathSeg.PATHSEG_ARC_REL=11,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},a.SVGPathSegClosePath=function(a){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CLOSEPATH,"z",a)},SVGPathSegClosePath.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},SVGPathSegClosePath.prototype.clone=function(){return new SVGPathSegClosePath(void 0)},a.SVGPathSegMovetoAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_ABS,"M",a),this._x=b,this._y=c},SVGPathSegMovetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoAbs.prototype.clone=function(){return new SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegMovetoRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_REL,"m",a),this._x=b,this._y=c},SVGPathSegMovetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoRel.prototype.clone=function(){return new SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_ABS,"L",a),this._x=b,this._y=c},SVGPathSegLinetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoAbs.prototype.clone=function(){return new SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_REL,"l",a),this._x=b,this._y=c},SVGPathSegLinetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoRel.prototype.clone=function(){return new SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicAbs=function(a,b,c,d,e,f,g){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",a),this._x=b,this._y=c,this._x1=d,this._y1=e,this._x2=f,this._y2=g},SVGPathSegCurvetoCubicAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicRel=function(a,b,c,d,e,f,g){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",a),this._x=b,this._y=c,this._x1=d,this._y1=e,this._x2=f,this._y2=g},SVGPathSegCurvetoCubicRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticAbs=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",a),this._x=b,this._y=c,this._x1=d,this._y1=e},SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticRel=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",a),this._x=b,this._y=c,this._x1=d,this._y1=e},SVGPathSegCurvetoQuadraticRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegArcAbs=function(a,b,c,d,e,f,g,h){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_ABS,"A",a),this._x=b,this._y=c,this._r1=d,this._r2=e,this._angle=f,this._largeArcFlag=g,this._sweepFlag=h},SVGPathSegArcAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcAbs.prototype.clone=function(){return new SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegArcRel=function(a,b,c,d,e,f,g,h){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_REL,"a",a),this._x=b,this._y=c,this._r1=d,this._r2=e,this._angle=f,this._largeArcFlag=g,this._sweepFlag=h},SVGPathSegArcRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcRel.prototype.clone=function(){return new SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoHorizontalAbs=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",a),this._x=b},SVGPathSegLinetoHorizontalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoHorizontalRel=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",a),this._x=b},SVGPathSegLinetoHorizontalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoVerticalAbs=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",a),this._y=b},SVGPathSegLinetoVerticalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoVerticalRel=function(a,b){
6
+ SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",a),this._y=b},SVGPathSegLinetoVerticalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicSmoothAbs=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",a),this._x=b,this._y=c,this._x2=d,this._y2=e},SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicSmoothRel=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",a),this._x=b,this._y=c,this._x2=d,this._y2=e},SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticSmoothAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",a),this._x=b,this._y=c},SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticSmoothRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",a),this._x=b,this._y=c},SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new SVGPathSegClosePath(void 0)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(a,b){return new SVGPathSegMovetoAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(a,b){return new SVGPathSegMovetoRel(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(a,b){return new SVGPathSegLinetoAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(a,b){return new SVGPathSegLinetoRel(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(a,b,c,d,e,f){return new SVGPathSegCurvetoCubicAbs(void 0,a,b,c,d,e,f)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(a,b,c,d,e,f){return new SVGPathSegCurvetoCubicRel(void 0,a,b,c,d,e,f)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(a,b,c,d){return new SVGPathSegCurvetoQuadraticAbs(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(a,b,c,d){return new SVGPathSegCurvetoQuadraticRel(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(a,b,c,d,e,f,g){return new SVGPathSegArcAbs(void 0,a,b,c,d,e,f,g)},SVGPathElement.prototype.createSVGPathSegArcRel=function(a,b,c,d,e,f,g){return new SVGPathSegArcRel(void 0,a,b,c,d,e,f,g)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(a){return new SVGPathSegLinetoHorizontalAbs(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(a){return new SVGPathSegLinetoHorizontalRel(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(a){return new SVGPathSegLinetoVerticalAbs(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(a){return new SVGPathSegLinetoVerticalRel(void 0,a)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(a,b,c,d){return new SVGPathSegCurvetoCubicSmoothAbs(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(a,b,c,d){return new SVGPathSegCurvetoCubicSmoothRel(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(a,b){return new SVGPathSegCurvetoQuadraticSmoothAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(a,b){return new SVGPathSegCurvetoQuadraticSmoothRel(void 0,a,b)}),"SVGPathSegList"in a||(a.SVGPathSegList=function(a){this._pathElement=a,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},Object.defineProperty(SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},SVGPathSegList.prototype._updateListFromPathMutations=function(a){if(this._pathElement){var b=!1;a.forEach(function(a){"d"==a.attributeName&&(b=!0)}),b&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},SVGPathSegList.prototype.segmentChanged=function(a){this._writeListToPath()},SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(a){a._owningPathSegList=null}),this._list=[],this._writeListToPath()},SVGPathSegList.prototype.initialize=function(a){return this._checkPathSynchronizedToList(),this._list=[a],a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype._checkValidIndex=function(a){if(isNaN(a)||0>a||a>=this.numberOfItems)throw"INDEX_SIZE_ERR"},SVGPathSegList.prototype.getItem=function(a){return this._checkPathSynchronizedToList(),this._checkValidIndex(a),this._list[a]},SVGPathSegList.prototype.insertItemBefore=function(a,b){return this._checkPathSynchronizedToList(),b>this.numberOfItems&&(b=this.numberOfItems),a._owningPathSegList&&(a=a.clone()),this._list.splice(b,0,a),a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype.replaceItem=function(a,b){return this._checkPathSynchronizedToList(),a._owningPathSegList&&(a=a.clone()),this._checkValidIndex(b),this._list[b]=a,a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype.removeItem=function(a){this._checkPathSynchronizedToList(),this._checkValidIndex(a);var b=this._list[a];return this._list.splice(a,1),this._writeListToPath(),b},SVGPathSegList.prototype.appendItem=function(a){return this._checkPathSynchronizedToList(),a._owningPathSegList&&(a=a.clone()),this._list.push(a),a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList._pathSegArrayAsString=function(a){var b="",c=!0;return a.forEach(function(a){c?(c=!1,b+=a._asPathString()):b+=" "+a._asPathString()}),b},SVGPathSegList.prototype._parsePath=function(a){if(!a||0==a.length)return[];var b=this,c=function(){this.pathSegList=[]};c.prototype.appendSegment=function(a){this.pathSegList.push(a)};var d=function(a){this._string=a,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};d.prototype._isCurrentSpace=function(){var a=this._string[this._currentIndex];return" ">=a&&(" "==a||"\n"==a||" "==a||"\r"==a||"\f"==a)},d.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},d.prototype._skipOptionalSpacesOrDelimiter=function(){return this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex)?!1:(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},d.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},d.prototype.peekSegmentType=function(){var a=this._string[this._currentIndex];return this._pathSegTypeFromChar(a)},d.prototype._pathSegTypeFromChar=function(a){switch(a){case"Z":case"z":return SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return SVGPathSeg.PATHSEG_LINETO_REL;case"C":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return SVGPathSeg.PATHSEG_ARC_ABS;case"a":return SVGPathSeg.PATHSEG_ARC_REL;case"H":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return SVGPathSeg.PATHSEG_UNKNOWN}},d.prototype._nextCommandHelper=function(a,b){return("+"==a||"-"==a||"."==a||a>="0"&&"9">=a)&&b!=SVGPathSeg.PATHSEG_CLOSEPATH?b==SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:b==SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:b:SVGPathSeg.PATHSEG_UNKNOWN},d.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var a=this.peekSegmentType();return a==SVGPathSeg.PATHSEG_MOVETO_ABS||a==SVGPathSeg.PATHSEG_MOVETO_REL},d.prototype._parseNumber=function(){var a=0,b=0,c=1,d=0,e=1,f=1,g=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,e=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var h=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=h)for(var i=this._currentIndex-1,j=1;i>=h;)b+=j*(this._string.charAt(i--)-"0"),j*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)d+=(this._string.charAt(this._currentIndex++)-"0")*(c*=.1)}if(this._currentIndex!=g&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,f=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)a*=10,a+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var k=b+d;if(k*=e,a&&(k*=Math.pow(10,f*a)),g!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),k}},d.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var a=!1,b=this._string.charAt(this._currentIndex++);if("0"==b)a=!1;else{if("1"!=b)return;a=!0}return this._skipOptionalSpacesOrDelimiter(),a}},d.prototype.parseSegment=function(){var a=this._string[this._currentIndex],c=this._pathSegTypeFromChar(a);if(c==SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==SVGPathSeg.PATHSEG_UNKNOWN)return null;if(c=this._nextCommandHelper(a,this._previousCommand),c==SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=c,c){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(b,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(b);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(b,d.x,d.y,d.x1,d.y1,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(b,d.x,d.y,d.x1,d.y1,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var d={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(b,d.x,d.y,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var d={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(b,d.x,d.y,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(b,d.x,d.y,d.x1,d.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(b,d.x,d.y,d.x1,d.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(b,d.x,d.y,d.x1,d.y1,d.arcAngle,d.arcLarge,d.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(b,d.x,d.y,d.x1,d.y1,d.arcAngle,d.arcLarge,d.arcSweep);default:throw"Unknown path seg type."}};var e=new c,f=new d(a);if(!f.initialCommandIsMoveTo())return[];for(;f.hasMoreData();){var g=f.parseSegment();if(!g)return[];e.appendSegment(g)}return e.pathSegList})}(),"function"==typeof define&&define.amd?define("c3",["d3"],function(){return k}):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=k:a.c3=k}(window);
inc/js/d3.min.js CHANGED
@@ -1,5 +1,5 @@
1
- !function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=da.length;r>e;++e){var u=da[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new l;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){ta.event.preventDefault()}function k(){for(var n,t=ta.event;n=t.sourceEvent;)t=n;return t}function E(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ta.event;u.target=n,ta.event=u,t[u.type].apply(e,r)}finally{ta.event=i}}},t}function A(n){return ya(n,_a),n}function N(n){return"function"==typeof n?n:function(){return Ma(n,this)}}function C(n){return"function"==typeof n?n:function(){return xa(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ta.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function q(n){return n.trim().replace(/\s+/g," ")}function L(n){return new RegExp("(?:^|\\s+)"+ta.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=L(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",q(u+" "+n))):e.setAttribute("class",q(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ta.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return ba(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function Z(n){return ya(n,Sa),n}function V(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,ra(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+ta.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=$;a>0&&(n=n.slice(0,a));var l=ka.get(n);return l&&(n=l,c=B),a?t?u:r:t?b:i}function $(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Aa,u="click"+r,i=ta.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ea&&(Ea="onselectstart"in e?!1:x(e.style,"userSelect")),Ea){var o=n(e).style,a=o[Ea];o[Ea]="none"}return function(n){if(i.on(r,null),Ea&&(o[Ea]=a),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Na){var i=t(n);if(i.scrollX||i.scrollY){r=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Na=!(o.f||o.e),r.remove()}}return Na?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ta.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?qa:Math.acos(n)}function tt(n){return n>1?Ra:-1>n?-Ra:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Da)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Xa,r=pt(r)*$a,i=pt(i)*Ba,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Pa,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,n>>8&255,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=Ga.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Xa),u=vt((.2126729*n+.7151522*t+.072175*e)/$a),i=vt((.0193339*n+.119192*t+.9503041*e)/Ba);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Nt(t,e,n,r)}}function Nt(n,t,e,r){function u(){var n,t=c.status;if(!t&&zt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return void o.error.call(i,r)}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(Ct(r))}function Ct(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function zt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qt(){var n=Lt(),t=Tt()-n;t>24?(isFinite(t)&&(clearTimeout(tc),tc=setTimeout(qt,t)),nc=0):(nc=1,rc(qt))}function Lt(){var n=Date.now();for(ec=Ka;ec;)n>=ec.t&&(ec.f=ec.c(n-ec.t)),ec=ec.n;return n}function Tt(){for(var n,t=Ka,e=1/0;t;)t.f?t=n?n.n=t.n:Ka=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Qa=n,e}function Rt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Dt(n,t){var e=Math.pow(10,3*ga(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Pt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=ic.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=oc.get(g)||Ut;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Ut(n){return n+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ft(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new cc(e-1)),1),e}function i(n,e){return t(n=new cc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{cc=jt;var r=new jt;return r._=n,o(r,t,e)}finally{cc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ht(n);return c.floor=c,c.round=Ht(r),c.ceil=Ht(u),c.offset=Ht(i),c.range=a,n}function Ht(n){return function(t,e){try{cc=jt;var r=new jt;return r._=t,n(r,e)._}finally{cc=Date}}}function Ot(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(c,a)),null!=(u=sc[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=N[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.slice(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&cc!==jt,o=new(i?jt:cc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in sc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{cc=jt;var t=new cc;return t._=n,r(t)}finally{cc=Date}}var r=t(n);return e.parse=function(n){try{cc=jt;var t=r.parse(n);return t&&t._}finally{cc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ae;var M=ta.map(),x=Yt(v),b=Zt(v),_=Yt(d),w=Zt(d),S=Yt(m),k=Zt(m),E=Yt(y),A=Zt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+ac.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(ac.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(ac.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:Qt,e:Qt,H:te,I:te,j:ne,L:ue,m:Kt,M:ee,p:s,S:re,U:Xt,w:Vt,W:$t,x:c,X:l,y:Wt,Y:Bt,Z:Jt,"%":oe};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Yt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Zt(n){for(var t=new l,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Vt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Xt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function $t(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Bt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Wt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.y=Gt(+r[0]),e+r[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n){return n+(n>68?1900:2e3)}function Kt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Qt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function ne(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function te(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ee(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function re(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ue(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=ga(t)/60|0,u=ga(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function oe(n,t,e){hc.lastIndex=0;var r=hc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ae(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ce(){}function le(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function se(n,t){n&&dc.hasOwnProperty(n.type)&&dc[n.type](n,t)}function fe(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function he(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)fe(n[e],t,1);t.polygonEnd()}function ge(){function n(n,t){n*=Da,t=t*Da/2+qa/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);yc.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;Mc.point=function(o,a){Mc.point=n,r=(t=o)*Da,u=Math.cos(a=(e=a)*Da/2+qa/4),i=Math.sin(a)},Mc.lineEnd=function(){n(t,e)}}function pe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function ve(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function de(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function me(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ye(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Me(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function xe(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function be(n,t){return ga(n[0]-t[0])<Ca&&ga(n[1]-t[1])<Ca}function _e(n,t){n*=Da;var e=Math.cos(t*=Da);we(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function we(n,t,e){++xc,_c+=(n-_c)/xc,wc+=(t-wc)/xc,Sc+=(e-Sc)/xc}function Se(){function n(n,u){n*=Da;var i=Math.cos(u*=Da),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);bc+=l,kc+=l*(t+(t=o)),Ec+=l*(e+(e=a)),Ac+=l*(r+(r=c)),we(t,e,r)}var t,e,r;qc.point=function(u,i){u*=Da;var o=Math.cos(i*=Da);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),qc.point=n,we(t,e,r)}}function ke(){qc.point=_e}function Ee(){function n(n,t){n*=Da;var e=Math.cos(t*=Da),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-nt(g)/h,v=Math.atan2(h,g);Nc+=p*l,Cc+=p*s,zc+=p*f,bc+=v,kc+=v*(r+(r=o)),Ec+=v*(u+(u=a)),Ac+=v*(i+(i=c)),we(r,u,i)}var t,e,r,u,i;qc.point=function(o,a){t=o,e=a,qc.point=n,o*=Da;var c=Math.cos(a*=Da);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),we(r,u,i)},qc.lineEnd=function(){n(t,e),qc.lineEnd=ke,qc.point=_e}}function Ae(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ne(){return!0}function Ce(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(be(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return void u.lineEnd()}var c=new qe(e,n,null,!0),l=new qe(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new qe(r,n,null,!1),l=new qe(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),ze(i),ze(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ze(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function qe(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Le(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function l(){y.point=o,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Te))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=Fe(m,p);g.length?(b||(i.polygonStart(),b=!0),Ce(g,De,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Re(),x=t(M),b=!1;return y}}function Te(n){return n.length>1}function Re(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function De(n,t){return((n=n.x)[0]<0?n[1]-Ra-Ca:Ra-n[1])-((t=t.x)[0]<0?t[1]-Ra-Ca:Ra-t[1])}function Pe(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?qa:-qa,c=ga(i-e);ga(c-qa)<Ca?(n.point(e,r=(r+o)/2>0?Ra:-Ra),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=qa&&(ga(e-u)<Ca&&(e-=u*Ca),ga(i-a)<Ca&&(i-=a*Ca),r=Ue(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function Ue(n,t,e,r){var u,i,o=Math.sin(n-e);return ga(o)>Ca?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function je(n,t,e,r){var u;if(null==n)u=e*Ra,r.point(-qa,u),r.point(0,u),r.point(qa,u),r.point(qa,0),r.point(qa,-u),r.point(0,-u),r.point(-qa,-u),r.point(-qa,0),r.point(-qa,u);else if(ga(n[0]-t[0])>Ca){var i=n[0]<t[0]?qa:-qa;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function Fe(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;yc.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+qa/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+qa/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>qa,k=p*M;if(yc.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*La:b,S^h>=e^m>=e){var E=de(pe(f),pe(n));Me(E);var A=de(u,E);Me(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ca>i||Ca>i&&0>yc)^1&o}function He(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?qa:-qa),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(be(e,g)||be(p,g))&&(p[0]+=Ca,p[1]+=Ca,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&be(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=pe(n),u=pe(t),o=[1,0,0],a=de(r,u),c=ve(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=de(o,a),p=ye(o,f),v=ye(a,h);me(p,v);var d=g,m=ve(p,d),y=ve(d,d),M=m*m-y*(ve(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=ye(d,(-m-x)/y);if(me(b,p),b=xe(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=ga(A-qa)<Ca,C=N||Ca>A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(ga(b[0]-w)<Ca?k:E):k<=b[1]&&b[1]<=E:A>qa^(w<=b[0]&&b[0]<=S)){var z=ye(d,(-m+x)/y);return me(z,p),[b,xe(z)]}}}function u(t,e){var r=o?n:qa-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ga(i)>Ca,c=gr(n,6*Da);return Le(t,e,c,o?[0,-n]:[-qa,n-qa])}function Oe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return ga(r[0]-n)<Ca?u>0?0:3:ga(r[0]-e)<Ca?u>0?2:1:ga(r[1]-t)<Ca?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Tc,Math.min(Tc,n)),t=Math.max(-Tc,Math.min(Tc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=Re(),N=Oe(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&Ce(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ye(n){var t=0,e=qa/3,r=ir(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*qa/180,e=n[1]*qa/180):[t/qa*180,e/qa*180]},u}function Ze(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Ve(){function n(n,t){Dc+=u*n-r*t,r=n,u=t}var t,e,r,u;Hc.point=function(i,o){Hc.point=n,t=r=i,e=u=o},Hc.lineEnd=function(){n(t,e)}}function Xe(n,t){Pc>n&&(Pc=n),n>jc&&(jc=n),Uc>t&&(Uc=t),t>Fc&&(Fc=t)}function $e(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Be(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Be(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Be(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function We(n,t){_c+=n,wc+=t,++Sc}function Je(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);kc+=o*(t+n)/2,Ec+=o*(e+r)/2,Ac+=o,We(t=n,e=r)}var t,e;Ic.point=function(r,u){Ic.point=n,We(t=r,e=u)}}function Ge(){Ic.point=We}function Ke(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);kc+=o*(r+n)/2,Ec+=o*(u+t)/2,Ac+=o,o=u*n-r*t,Nc+=o*(r+n),Cc+=o*(u+t),zc+=3*o,We(r=n,u=t)}var t,e,r,u;Ic.point=function(i,o){Ic.point=n,We(t=r=i,e=u=o)},Ic.lineEnd=function(){n(t,e)}}function Qe(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,La)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function nr(n){function t(n){return(a?r:e)(n)}function e(t){return rr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=pe([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c
2
- },polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=ga(ga(w)-1)<Ca||ga(r-h)<Ca?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,q=C-e,L=M*z-y*q;(L*L/x>i||ga((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Da),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function tr(n){var t=nr(function(t,e){return n([t*Pa,e*Pa])});return function(n){return or(t(n))}}function er(n){this.stream=n}function rr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ur(n){return ir(function(){return n})()}function ir(n){function t(n){return n=a(n[0]*Da,n[1]*Da),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Pa,n[1]*Pa]}function r(){a=Ae(o=lr(m,M,x),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=nr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Lc,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=or(b(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Lc):He((w=+n)*Da),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Da,d=n[1]%360*Da,r()):[v*Pa,d*Pa]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Da,M=n[1]%360*Da,x=n.length>2?n[2]%360*Da:0,r()):[m*Pa,M*Pa,x*Pa]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function or(n){return rr(n,function(t,e){n.point(t*Da,e*Da)})}function ar(n,t){return[n,t]}function cr(n,t){return[n>qa?n-La:-qa>n?n+La:n,t]}function lr(n,t,e){return n?t||e?Ae(fr(n),hr(t,e)):fr(n):t||e?hr(t,e):cr}function sr(n){return function(t,e){return t+=n,[t>qa?t-La:-qa>t?t+La:t,e]}}function fr(n){var t=sr(n);return t.invert=sr(-n),t}function hr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function gr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=pr(e,u),i=pr(e,i),(o>0?i>u:u>i)&&(u+=o*La)):(u=n+o*La,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=xe([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function pr(n,t){var e=pe(t);e[0]-=n,Me(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ca)%(2*Math.PI)}function vr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function dr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function mr(n){return n.source}function yr(n){return n.target}function Mr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Pa,Math.atan2(o,Math.sqrt(r*r+u*u))*Pa]}:function(){return[n*Pa,t*Pa]};return p.distance=h,p}function xr(){function n(n,u){var i=Math.sin(u*=Da),o=Math.cos(u),a=ga((n*=Da)-t),c=Math.cos(a);Yc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Zc.point=function(u,i){t=u*Da,e=Math.sin(i*=Da),r=Math.cos(i),Zc.point=n},Zc.lineEnd=function(){Zc.point=Zc.lineEnd=b}}function br(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function _r(n,t){function e(n,t){o>0?-Ra+Ca>t&&(t=-Ra+Ca):t>Ra-Ca&&(t=Ra-Ca);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(qa/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Ra]},e):Sr}function wr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ga(u)<Ca?ar:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function Sr(n,t){return[n,Math.log(Math.tan(qa/4+t/2))]}function kr(n){var t,e=ur(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=qa*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Er(n,t){return[Math.log(Math.tan(qa/4+t/2)),-n]}function Ar(n){return n[0]}function Nr(n){return n[1]}function Cr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function zr(n,t){return n[0]-t[0]||n[1]-t[1]}function qr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Lr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Tr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Rr(){tu(this),this.edge=this.site=this.circle=null}function Dr(n){var t=el.pop()||new Rr;return t.site=n,t}function Pr(n){Xr(n),Qc.remove(n),el.push(n),tu(n)}function Ur(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Pr(n);for(var c=i;c.circle&&ga(e-c.circle.x)<Ca&&ga(r-c.circle.cy)<Ca;)i=c.P,a.unshift(c),Pr(c),c=i;a.unshift(c),Xr(c);for(var l=o;l.circle&&ga(e-l.circle.x)<Ca&&ga(r-l.circle.cy)<Ca;)o=l.N,a.push(l),Pr(l),l=o;a.push(l),Xr(l);var s,f=a.length;for(s=1;f>s;++s)l=a[s],c=a[s-1],Kr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Jr(c.site,l.site,null,u),Vr(c),Vr(l)}function jr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Qc._;a;)if(r=Fr(a,o)-i,r>Ca)a=a.L;else{if(u=i-Hr(a,o),!(u>Ca)){r>-Ca?(t=a.P,e=a):u>-Ca?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Dr(n);if(Qc.insert(t,c),t||e){if(t===e)return Xr(t),e=Dr(t.site),Qc.insert(c,e),c.edge=e.edge=Jr(t.site,c.site),Vr(t),void Vr(e);if(!e)return void(c.edge=Jr(t.site,c.site));Xr(t),Xr(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Kr(e.edge,l,p,x),c.edge=Jr(l,n,null,x),e.edge=Jr(n,p,null,x),Vr(t),Vr(e)}}function Fr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Hr(n,t){var e=n.N;if(e)return Fr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Or(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Kc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(ga(r-t)>Ca||ga(u-e)>Ca)&&(a.splice(o,0,new Qr(Gr(i.site,s,ga(r-f)<Ca&&p-u>Ca?{x:f,y:ga(t-f)<Ca?e:p}:ga(u-p)<Ca&&h-r>Ca?{x:ga(e-p)<Ca?t:h,y:p}:ga(r-h)<Ca&&u-g>Ca?{x:h,y:ga(t-h)<Ca?e:g}:ga(u-g)<Ca&&r-f>Ca?{x:ga(e-g)<Ca?t:f,y:g}:null),i.site,null)),++c)}function Yr(n,t){return t.angle-n.angle}function Zr(){tu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vr(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,l=r.y-a,s=i.x-o,f=i.y-a,h=2*(c*f-l*s);if(!(h>=-za)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=rl.pop()||new Zr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=tl._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}tl.insert(y,m),y||(nl=m)}}}}function Xr(n){var t=n.circle;t&&(t.P||(nl=t.N),tl.remove(t),rl.push(t),tu(t),n.circle=null)}function $r(n){for(var t,e=Gc,r=Oe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Br(t,n)||!r(t)||ga(t.a.x-t.b.x)<Ca&&ga(t.a.y-t.b.y)<Ca)&&(t.a=t.b=null,e.splice(u,1))}function Br(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],l=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.y<c)return}else i={x:d,y:l};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.y<c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Wr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Jr(n,t,e,r){var u=new Wr(n,t);return Gc.push(u),e&&Kr(u,n,t,e),r&&Kr(u,t,n,r),Kc[n.i].edges.push(new Qr(u,n,t)),Kc[t.i].edges.push(new Qr(u,t,n)),u}function Gr(n,t,e){var r=new Wr(n,null);return r.a=t,r.b=e,Gc.push(r),r}function Kr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Qr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function nu(){this._=null}function tu(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function eu(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ru(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function uu(n){for(;n.L;)n=n.L;return n}function iu(n,t){var e,r,u,i=n.sort(ou).pop();for(Gc=[],Kc=new Array(n.length),Qc=new nu,tl=new nu;;)if(u=nl,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Kc[i.i]=new Or(i),jr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;Ur(u.arc)}t&&($r(t),Ir(t));var o={cells:Kc,edges:Gc};return Qc=tl=Gc=Kc=null,o}function ou(n,t){return t.y-n.y||t.x-n.x}function au(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function cu(n){return n.x}function lu(n){return n.y}function su(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function fu(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&fu(n,c[0],e,r,o,a),c[1]&&fu(n,c[1],o,r,u,a),c[2]&&fu(n,c[2],e,a,o,i),c[3]&&fu(n,c[3],o,a,u,i)}}function hu(n,t,e,r,u,i,o){var a,c=1/0;return function l(n,s,f,h,g){if(!(s>i||f>o||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function gu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function pu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=mu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function vu(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function du(n,t){var e,r,u,i=il.lastIndex=ol.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=il.exec(n))&&(r=ol.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:vu(e,r)})),i=ol.lastIndex;return i<t.length&&(u=t.slice(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function mu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function yu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(mu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Mu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function xu(n){return function(t){return 1-n(1-t)}}function bu(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function _u(n){return n*n}function wu(n){return n*n*n}function Su(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function ku(n){return function(t){return Math.pow(t,n)}}function Eu(n){return 1-Math.cos(n*Ra)}function Au(n){return Math.pow(2,10*(n-1))}function Nu(n){return 1-Math.sqrt(1-n*n)}function Cu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/La*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*La/t)}}function zu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function qu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Lu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Tu(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Pu(n){var t=[n.a,n.b],e=[n.c,n.d],r=ju(t),u=Uu(t,e),i=ju(Fu(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Pa,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Pa:0}function Uu(n,t){return n[0]*t[0]+n[1]*t[1]}function ju(n){var t=Math.sqrt(Uu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Fu(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Hu(n,t){var e,r=[],u=[],i=ta.transform(n),o=ta.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:vu(a[0],c[0])},{i:3,x:vu(a[1],c[1])})):r.push(c[0]||c[1]?"translate("+c+")":""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:vu(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:vu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:vu(g[0],p[0])},{i:e-2,x:vu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Ou(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Iu(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Yu(n){for(var t=n.source,e=n.target,r=Vu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Zu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Vu(n,t){if(n===t)return n;for(var e=Zu(n),r=Zu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Xu(n){n.fixed|=2}function $u(n){n.fixed&=-7}function Bu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Wu(n){n.fixed&=-5}function Ju(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Ju(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Gu(n,t){return ta.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=ri,n}function Ku(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Qu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function ni(n){return n.children}function ti(n){return n.value}function ei(n,t){return t.value-n.value}function ri(n){return ta.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ui(n){return n.x}function ii(n){return n.y}function oi(n,t,e){n.y0=t,n.y=e}function ai(n){return ta.range(n.length)}function ci(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function li(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function si(n){return n.reduce(fi,0)}function fi(n,t){return n+t[1]}function hi(n,t){return gi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function gi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function pi(n){return[ta.min(n),ta.max(n)]}function vi(n,t){return n.value-t.value}function di(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function mi(n,t){n._pack_next=t,t._pack_prev=n}function yi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Mi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(xi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],wi(r,u,i),t(i),di(r,i),r._pack_prev=i,di(i,u),u=r._pack_next,o=3;l>o;o++){wi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(yi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!yi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?mi(r,u=a):mi(r=c,u),o--):(di(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(bi)}}function xi(n){n._pack_next=n._pack_prev=n}function bi(n){delete n._pack_next,delete n._pack_prev}function _i(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)_i(u[i],t,e,r)}function wi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function Si(n,t){return n.parent==t.parent?1:2}function ki(n){var t=n.children;return t.length?t[0]:n.t}function Ei(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ai(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Ni(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Ci(n,t,e){return n.a.parent===t.parent?n.a:e}function zi(n){return 1+ta.max(n,function(n){return n.y})}function qi(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Li(n){var t=n.children;return t&&t.length?Li(t[0]):n}function Ti(n){var t,e=n.children;return e&&(t=e.length)?Ti(e[t-1]):n}function Ri(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Di(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Pi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ui(n){return n.rangeExtent?n.rangeExtent():Pi(n.range())}function ji(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Fi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Hi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ml}function Oi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=ta.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ii(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Oi:ji,c=r?Iu:Ou;return o=u(n,t,c,e),a=u(t,n,c,mu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Du)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Xi(n,t)},i.tickFormat=function(t,e){return $i(n,t,e)},i.nice=function(t){return Zi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Yi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Zi(n,t){return Fi(n,Hi(Vi(n,t)[2]))}function Vi(n,t){null==t&&(t=10);var e=Pi(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Xi(n,t){return ta.range.apply(ta,Vi(n,t))}function $i(n,t,e){var r=Vi(n,t);if(e){var u=ic.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(ga(r[0]),ga(r[1])));return u[7]||(u[7]="."+Bi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Wi(u[8],r)),e=u.join("")}else e=",."+Bi(r[2])+"f";return ta.format(e)}function Bi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Wi(n,t){var e=Bi(t[2]);return n in yl?Math.abs(e-Bi(Math.max(ga(t[0]),ga(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Ji(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Fi(r.map(u),e?Math:xl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Pi(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Ml;arguments.length<2?t=Ml:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Ji(n.copy(),t,e,r)},Yi(o,n)}function Gi(n,t,e){function r(t){return n(u(t))}var u=Ki(t),i=Ki(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Xi(e,n)},r.tickFormat=function(n,t){return $i(e,n,t)},r.nice=function(n){return r.domain(Zi(e,n))},r.exponent=function(o){return arguments.length?(u=Ki(t=o),i=Ki(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Gi(n.copy(),t,e)},Yi(r,n)}function Ki(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Qi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new l;for(var i,o=-1,a=r.length;++o<a;)u.has(i=r[o])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,o=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=(c+l)/2,0):(l-c)/(n.length-1+a);return i=r(c+s*a/2,s),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=l=Math.round((c+l)/2),0):(l-c)/(n.length-1+a)|0;return i=r(c+Math.round(s*a/2+(l-c-(n.length-1+a)*s)/2),s),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-a+2*c);return i=r(s+h*c,h),l&&i.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-a+2*c));return i=r(s+Math.round((f-s-(n.length-a)*h)/2),h),l&&i.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Pi(t.a[0])},e.copy=function(){return Qi(n,t)},e.domain(n)}function no(n,t){function i(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ta.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ta.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(u).sort(e),i()):n},o.range=function(n){return arguments.length?(t=n,i()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[0/0,0/0]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return no(n,t)},i()}function to(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return to(n,t,e)},u()}function eo(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return eo(n,t)},e}function ro(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Xi(n,t)},t.tickFormat=function(t,e){return $i(n,t,e)},t.copy=function(){return ro(n)},t}function uo(){return 0}function io(n){return n.innerRadius}function oo(n){return n.outerRadius}function ao(n){return n.startAngle}function co(n){return n.endAngle}function lo(n){return n&&n.padAngle}function so(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function fo(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function ho(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Ar,r=Nr,u=Ne,i=go,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=El.get(n)||go).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function go(n){return n.join("L")}function po(n){return go(n)+"Z"}function vo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function yo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function Mo(n,t){return n.length<4?go(n):n[1]+_o(n.slice(1,-1),wo(n,t))}function xo(n,t){return n.length<3?go(n):n[0]+_o((n.push(n[0]),n),wo([n[n.length-2]].concat(n,[n[1]]),t))}function bo(n,t){return n.length<3?go(n):n[0]+_o(n,wo(n,t))}function _o(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return go(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function wo(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function So(n){if(n.length<3)return go(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",No(Cl,o),",",No(Cl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Co(c,o,a);return n.pop(),c.push("L",r),c.join("")}function ko(n){if(n.length<4)return go(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(No(Cl,i)+","+No(Cl,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Co(e,i,o);return e.join("")}function Eo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[No(Cl,o),",",No(Cl,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Co(t,o,a);return t.join("")}function Ao(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return So(n)}function No(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Co(n,t,e){n.push("C",No(Al,t),",",No(Al,e),",",No(Nl,t),",",No(Nl,e),",",No(Cl,t),",",No(Cl,e))}function zo(n,t){return(t[1]-n[1])/(t[0]-n[0])}function qo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=zo(u,i);++t<e;)r[t]=(o+(o=zo(u=i,i=n[t+1])))/2;return r[t]=o,r}function Lo(n){for(var t,e,r,u,i=[],o=qo(n),a=-1,c=n.length-1;++a<c;)t=zo(n[a],n[a+1]),ga(t)<Ca?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function To(n){return n.length<3?go(n):n[0]+_o(n,Lo(n))}function Ro(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-Ra,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Do(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=Ar,r=Ar,u=0,i=Nr,o=Ne,a=go,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r
3
- },t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=El.get(n)||go).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Po(n){return n.radius}function Uo(n){return[n.x,n.y]}function jo(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ra;return[e*Math.cos(r),e*Math.sin(r)]}}function Fo(){return 64}function Ho(){return"circle"}function Oo(n){var t=Math.sqrt(n/qa);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Io(n){return function(){var t,e;(t=this[n])&&(e=t[t.active])&&(--t.count?delete t[t.active]:delete this[n],t.active+=.5,e.event&&e.event.interrupt.call(this,this.__data__,e.index))}}function Yo(n,t,e){return ya(n,Pl),n.namespace=t,n.id=e,n}function Zo(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Vo(n){return null==n&&(n=""),function(){this.textContent=n}}function Xo(n){return null==n?"__transition__":"__transition_"+n+"__"}function $o(n,t,e,r,u){var i=n[e]||(n[e]={active:0,count:0}),o=i[r];if(!o){var a=u.time;o=i[r]={tween:new l,time:a,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++i.count,ta.timer(function(u){function c(e){if(i.active>r)return s();var u=i[i.active];u&&(--i.count,delete i[i.active],u.event&&u.event.interrupt.call(n,n.__data__,u.index)),i.active=r,o.event&&o.event.start.call(n,n.__data__,t),o.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&v.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return p.c=l(e||1)?Ne:l,1},0,a)}function l(e){if(i.active!==r)return 1;for(var u=e/f,a=h(u),c=v.length;c>0;)v[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,n.__data__,t),s()):void 0}function s(){return--i.count?delete i[r]:delete n[e],1}var f,h,g=o.delay,p=ec,v=[];return p.t=g+a,u>=g?c(u-g):void(p.c=c)},0,a)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Vl,u);return i==Vl.length?[t.year,Vi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Vl[i-1]<Vl[i]/u?i-1:i]:[Bl,Vi(n,e)[2]]}return r.invert=function(t){return Ko(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Ko)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Ko(+e+1),t).length}var i=r.domain(),o=Pi(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Fi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Pi(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Yi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.6"},ea=[].slice,ra=function(n){return ea.call(n)},ua=this.document;if(ua)try{ra(ua.documentElement.childNodes)[0].nodeType}catch(ia){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),ua)try{ua.createElement("DIV").style.setProperty("opacity",0,"")}catch(oa){var aa=this.Element.prototype,ca=aa.setAttribute,la=aa.setAttributeNS,sa=this.CSSStyleDeclaration.prototype,fa=sa.setProperty;aa.setAttribute=function(n,t){ca.call(this,n,t+"")},aa.setAttributeNS=function(n,t,e){la.call(this,n,t,e+"")},sa.setProperty=function(n,t,e){fa.call(this,n,t+"",e)}}ta.ascending=e,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var e,r=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)u(e=+n[o])&&(r+=e);else for(;++o<i;)u(e=+t.call(n,n[o],o))&&(r+=e);return r},ta.mean=function(n,t){var e,i=0,o=n.length,a=-1,c=o;if(1===arguments.length)for(;++a<o;)u(e=r(n[a]))?i+=e:--c;else for(;++a<o;)u(e=r(t.call(n,n[a],a)))?i+=e:--c;return c?i/c:void 0},ta.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},ta.median=function(n,t){var i,o=[],a=n.length,c=-1;if(1===arguments.length)for(;++c<a;)u(i=r(n[c]))&&o.push(i);else for(;++c<a;)u(i=r(t.call(n,n[c],c)))&&o.push(i);return o.length?ta.quantile(o.sort(e),.5):void 0},ta.variance=function(n,t){var e,i,o=n.length,a=0,c=0,l=-1,s=0;if(1===arguments.length)for(;++l<o;)u(e=r(n[l]))&&(i=e-a,a+=i/++s,c+=i*(e-a));else for(;++l<o;)u(e=r(t.call(n,n[l],l)))&&(i=e-a,a+=i/++s,c+=i*(e-a));return s>1?c/(s-1):void 0},ta.deviation=function(){var n=ta.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ha=i(e);ta.bisectLeft=ha.left,ta.bisect=ta.bisectRight=ha.right,ta.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,o),e=new Array(t);++n<t;)for(var r,u=-1,i=e[n]=new Array(r);++u<r;)i[u]=arguments[u][n];return e},ta.transpose=function(n){return ta.zip.apply(ta,n)},ta.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ta.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ta.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ta.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ga=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=a(ga(e)),o=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++o)>t;)u.push(r/i);else for(;(r=n+e*++o)<t;)u.push(r/i);return u},ta.map=function(n,t){var e=new l;if(n instanceof l)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var o in n)e.set(o,n[o]);return e};var pa="__proto__",va="\x00";c(l,{has:h,get:function(n){return this._[s(n)]},set:function(n,t){return this._[s(n)]=t},remove:g,keys:p,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:f(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t),this._[t])}}),ta.nest=function(){function n(t,o,a){if(a>=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var c,s,f,h,g=-1,p=o.length,v=i[a++],d=new l;++g<p;)(h=d.get(c=v(s=o[g])))?h.push(s):d.set(c,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,a))}):(s={},f=function(e,r){s[e]=n(t,r,a)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},c(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=M(n,t,t[e]);return n};var da=["webkit","ms","moz","Moz","o","O"];ta.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(ma,"\\$&")};var ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ya={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ma=function(n,t){return t.querySelector(n)},xa=function(n,t){return t.querySelectorAll(n)},ba=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(ba=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Ma=function(n,t){return Sizzle(n,t)[0]||null},xa=Sizzle,ba=Sizzle.matchesSelector),ta.selection=function(){return ta.select(ua.documentElement)};var _a=ta.selection.prototype=[];_a.select=function(n){var t,e,r,u,i=[];n=N(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return A(i)},_a.selectAll=function(n){var t,e,r=[];n=C(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=ra(n.call(e,e.__data__,a,u))),t.parentNode=e);return A(r)};var wa={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ta.ns={prefix:wa,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.slice(0,t),n=n.slice(t+1)),wa.hasOwnProperty(e)?{space:wa[e],local:n}:n}},_a.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},_a.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!L(n[u]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},_a.style=function(n,e,r){var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},_a.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},_a.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},_a.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},_a.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},_a.insert=function(n,t){return n=j(n),t=N(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},_a.remove=function(){return this.each(F)},_a.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new l,y=new Array(o);for(r=-1;++r<o;)m.has(d=t.call(u=n[r],u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d;for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=H(i),m.set(d,!0);for(r=-1;++r<o;)m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=H(i);for(;f>r;++r)p[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,a.push(p),c.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++i<o;)(u=r[i])&&(n[i]=u.__data__);return n}var a=Z([]),c=A([]),s=A([]);if("function"==typeof n)for(;++i<o;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<o;)e(r=this[i],n);return c.enter=function(){return a},c.exit=function(){return s},c},_a.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},_a.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return A(u)},_a.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},_a.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},_a.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},_a.call=function(n){var t=ra(arguments);return n.apply(t[0]=this,t),this},_a.empty=function(){return!this.node()},_a.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},_a.size=function(){var n=0;return Y(this,function(){++n}),n};var Sa=[];ta.selection.enter=Z,ta.selection.enter.prototype=Sa,Sa.append=_a.append,Sa.empty=_a.empty,Sa.node=_a.node,Sa.call=_a.call,Sa.size=_a.size,Sa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return A(o)},Sa.insert=function(n,t){return arguments.length<2&&(t=V(this)),_a.insert.call(this,n,t)},ta.select=function(t){var e;return"string"==typeof t?(e=[Ma(t,ua)],e.parentNode=ua.documentElement):(e=[t],e.parentNode=n(t)),A([e])},ta.selectAll=function(n){var t;return"string"==typeof n?(t=ra(xa(n,ua)),t.parentNode=ua.documentElement):(t=n,t.parentNode=null),A([t])},_a.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var ka=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});ua&&ka.forEach(function(n){"on"+n in ua&&ka.remove(n)});var Ea,Aa=0;ta.mouse=function(n){return J(n,k())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function e(n,t,e,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(e(f)).on(i+d,a).on(o+d,c),y=W(f),M=t(h,v);u?(l=u.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var r=E(n,"drag","dragstart","dragend"),u=null,i=e(b,ta.mouse,t,"mousemove","mouseup"),o=e(G,ta.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},ta.rebind(n,r,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ra(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Ca=1e-6,za=Ca*Ca,qa=Math.PI,La=2*qa,Ta=La-Ca,Ra=qa/2,Da=qa/180,Pa=180/qa,Ua=Math.SQRT2,ja=2,Fa=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(ja*h)*(e*ut(Ua*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Ua*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Ua*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Fa*f)/(2*i*ja*h),p=(c*c-i*i-Fa*f)/(2*c*ja*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Ua;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(q,f).on(Oa+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(N[0],Math.min(N[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,o)),i(d=e,r),t=ta.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function c(n){z++||n({type:"zoomstart"})}function l(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){f=1,i(ta.mouse(u),g),l(a)}function r(){h.on(L,null).on(T,null),p(f&&ta.event.target===o),s(a)}var u=this,o=ta.event.target,a=D.of(u,arguments),f=0,h=ta.select(t(u)).on(L,n).on(T,r),g=e(ta.mouse(u)),p=W(u);Dl.call(u),c(a)}function h(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ta.event.target;ta.select(t).on(x,r).on(b,a),_.push(t);for(var e=ta.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var c=n(),l=Date.now();if(1===c.length){if(500>l-M){var s=c[0];o(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=l}else if(c.length>1){var s=c[0],f=c[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,o=ta.touches(p);Dl.call(p);for(var a=0,c=o.length;c>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),l(v)}function a(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(_).on(y,null),w.on(q,f).on(R,h),E(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=ta.select(p),E=W(p);t(),c(v),w.on(q,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Dl.call(this),v=e(d=m||ta.mouse(this)),c(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Ha())*k.k),i(d,v),l(n)}function p(){var n=ta.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ta.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},A=[960,500],N=Ia,C=250,z=0,q="mousedown.zoom",L="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=E(n,"zoomstart","zoom","zoomend");return Oa||(Oa="onwheel"in ua?(Ha=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Ha=function(){return ta.event.wheelDelta},"mousewheel"):(Ha=function(){return-ta.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Tl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},c(n)}).tween("zoom:zoom",function(){var e=A[0],r=A[1],u=d?d[0]:e/2,i=d?d[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},l(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,c(n),l(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(N=null==t?Ia:[+t[0],+t[1]],n):N},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(A=t&&[+t[0],+t[1]],n):A},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ta.rebind(n,D,"on")};var Ha,Oa,Ia=[0,1/0];ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var Ya=at.prototype=new ot;Ya.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},Ya.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Za=lt.prototype=new ot;Za.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Va*(arguments.length?n:1)))},Za.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Va*(arguments.length?n:1)))},Za.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Va=18,Xa=.95047,$a=1,Ba=1.08883,Wa=ft.prototype=new ot;Wa.brighter=function(n){return new ft(Math.min(100,this.l+Va*(arguments.length?n:1)),this.a,this.b)},Wa.darker=function(n){return new ft(Math.max(0,this.l-Va*(arguments.length?n:1)),this.a,this.b)},Wa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var Ja=mt.prototype=new ot;Ja.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},Ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},Ja.hsl=function(){return _t(this.r,this.g,this.b)},Ja.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ga=ta.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ga.forEach(function(n,t){Ga.set(n,yt(t))}),ta.functor=Et,ta.xhr=At(y),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Nt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<l;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;l>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv(" ","text/tab-separated-values");var Ka,Qa,nc,tc,ec,rc=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Qa?Qa.n=i:Ka=i,Qa=i,nc||(tc=clearTimeout(tc),nc=1,rc(qt))},ta.timer.flush=function(){Lt(),Tt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var uc=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Dt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Rt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),uc[8+e/3]};var ic=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Rt(n,t))).toFixed(Math.max(0,Math.min(20,Rt(n*(1+1e-15),t))))}}),ac=ta.time={},cc=Date;jt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lc.setUTCDate.apply(this._,arguments)},setDay:function(){lc.setUTCDay.apply(this._,arguments)},setFullYear:function(){lc.setUTCFullYear.apply(this._,arguments)},setHours:function(){lc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lc.setUTCSeconds.apply(this._,arguments)},setTime:function(){lc.setTime.apply(this._,arguments)}};var lc=Date.prototype;ac.year=Ft(function(n){return n=ac.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ac.years=ac.year.range,ac.years.utc=ac.year.utc.range,ac.day=Ft(function(n){var t=new cc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ac.days=ac.day.range,ac.days.utc=ac.day.utc.range,ac.dayOfYear=function(n){var t=ac.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ac[n]=Ft(function(n){return(n=ac.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ac[n+"s"]=e.range,ac[n+"s"].utc=e.utc.range,ac[n+"OfYear"]=function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)}}),ac.week=ac.sunday,ac.weeks=ac.sunday.range,ac.weeks.utc=ac.sunday.utc.range,ac.weekOfYear=ac.sundayOfYear;var sc={"-":"",_:" ",0:"0"},fc=/^\s*\d+/,hc=/^%/;ta.locale=function(n){return{numberFormat:Pt(n),timeFormat:Ot(n)}};var gc=ta.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ta.format=gc.numberFormat,ta.geo={},ce.prototype={s:0,t:0,add:function(n){le(n,this.t,pc),le(pc.s,this.s,this),this.s?this.t+=pc.t:this.s=pc.t
4
- },reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pc=new ce;ta.geo.stream=function(n,t){n&&vc.hasOwnProperty(n.type)?vc[n.type](n,t):se(n,t)};var vc={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)se(e[r].geometry,t)}},dc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){fe(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)fe(e[r],t,0)},Polygon:function(n,t){he(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)se(e[r],t)}};ta.geo.area=function(n){return mc=0,ta.geo.stream(n,Mc),mc};var mc,yc=new ce,Mc={sphere:function(){mc+=4*qa},point:b,lineStart:b,lineEnd:b,polygonStart:function(){yc.reset(),Mc.lineStart=ge},polygonEnd:function(){var n=2*yc;mc+=0>n?4*qa+n:n,Mc.lineStart=Mc.lineEnd=Mc.point=b}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=pe([t*Da,e*Da]);if(m){var u=de(m,r),i=[u[1],-u[0],0],o=de(i,u);Me(o),o=xe(o);var c=t-p,l=c>0?1:-1,v=o[0]*Pa*l,d=ga(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Pa;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Pa;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ga(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Mc.point(n,e),t(n,e)}function i(){Mc.lineStart()}function o(){u(v,d),Mc.lineEnd(),ga(y)>Ca&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,Mc.polygonStart()},polygonEnd:function(){Mc.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>yc?(s=-(h=180),f=-(g=90)):y>Ca?g=90:-Ca>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){xc=bc=_c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,qc);var t=Nc,e=Cc,r=zc,u=t*t+e*e+r*r;return za>u&&(t=kc,e=Ec,r=Ac,Ca>bc&&(t=_c,e=wc,r=Sc),u=t*t+e*e+r*r,za>u)?[0/0,0/0]:[Math.atan2(e,t)*Pa,tt(r/Math.sqrt(u))*Pa]};var xc,bc,_c,wc,Sc,kc,Ec,Ac,Nc,Cc,zc,qc={sphere:b,point:_e,lineStart:Se,lineEnd:ke,polygonStart:function(){qc.lineStart=Ee},polygonEnd:function(){qc.lineStart=Se}},Lc=Le(Ne,Pe,je,[-qa,-qa/2]),Tc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ye(Ze)}).raw=Ze,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ca,f+.12*l+Ca],[s-.214*l-Ca,f+.234*l-Ca]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ca,f+.166*l+Ca],[s-.115*l-Ca,f+.234*l-Ca]]).stream(c).point,n},n.scale(1070)};var Rc,Dc,Pc,Uc,jc,Fc,Hc={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Dc=0,Hc.lineStart=Ve},polygonEnd:function(){Hc.lineStart=Hc.lineEnd=Hc.point=b,Rc+=ga(Dc/2)}},Oc={point:Xe,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ic={point:We,lineStart:Je,lineEnd:Ge,polygonStart:function(){Ic.lineStart=Ke},polygonEnd:function(){Ic.point=We,Ic.lineStart=Je,Ic.lineEnd=Ge}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Rc=0,ta.geo.stream(n,u(Hc)),Rc},n.centroid=function(n){return _c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,u(Ic)),zc?[Nc/zc,Cc/zc]:Ac?[kc/Ac,Ec/Ac]:Sc?[_c/Sc,wc/Sc]:[0/0,0/0]},n.bounds=function(n){return jc=Fc=-(Pc=Uc=1/0),ta.geo.stream(n,u(Oc)),[[Pc,Uc],[jc,Fc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||tr(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new $e:new Qe(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new er(t);for(var r in n)e[r]=n[r];return e}}},er.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ta.geo.projection=ur,ta.geo.projectionMutator=ir,(ta.geo.equirectangular=function(){return ur(ar)}).raw=ar.invert=ar,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t}return n=lr(n[0]%360*Da,n[1]*Da,n.length>2?n[2]*Da:0),t.invert=function(t){return t=n.invert(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t},t},cr.invert=ar,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=lr(-n[0]*Da,-n[1]*Da,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Pa,n[1]*=Pa}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=gr((t=+r)*Da,u*Da),n):t},n.precision=function(r){return arguments.length?(e=gr(t*Da,(u=+r)*Da),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Da,u=n[1]*Da,i=t[1]*Da,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ga(n%d)>Ca}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ga(n%m)>Ca}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=vr(a,o,90),f=dr(r,e,y),h=vr(l,c,90),g=dr(i,u,y),n):y},n.majorExtent([[-180,-90+Ca],[180,90-Ca]]).minorExtent([[-180,-80-Ca],[180,80+Ca]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=mr,u=yr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return Mr(n[0]*Da,n[1]*Da,t[0]*Da,t[1]*Da)},ta.geo.length=function(n){return Yc=0,ta.geo.stream(n,Zc),Yc};var Yc,Zc={sphere:b,point:b,lineStart:xr,lineEnd:b,polygonStart:b,polygonEnd:b},Vc=br(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ur(Vc)}).raw=Vc;var Xc=br(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(ta.geo.azimuthalEquidistant=function(){return ur(Xc)}).raw=Xc,(ta.geo.conicConformal=function(){return Ye(_r)}).raw=_r,(ta.geo.conicEquidistant=function(){return Ye(wr)}).raw=wr;var $c=br(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ur($c)}).raw=$c,Sr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ra]},(ta.geo.mercator=function(){return kr(Sr)}).raw=Sr;var Bc=br(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ur(Bc)}).raw=Bc;var Wc=br(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ur(Wc)}).raw=Wc,Er.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ra]},(ta.geo.transverseMercator=function(){var n=kr(Er),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Er,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(zr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=Cr(a),s=Cr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[a[s[t]][2]]);return g}var e=Ar,r=Nr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ta.geom.polygon=function(n){return ya(n,Jc),n};var Jc=ta.geom.polygon.prototype=[];Jc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Jc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Jc.clip=function(n){for(var t,e,r,u,i,o,a=Tr(n),c=-1,l=this.length-Tr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],qr(o,s,u)?(qr(i,s,u)||n.push(Lr(i,o,s,u)),n.push(o)):qr(i,s,u)&&n.push(Lr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n};var Gc,Kc,Qc,nl,tl,el=[],rl=[];Or.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Yr),t.length},Qr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nu.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=uu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(eu(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ru(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(ru(this,e),n=e,e=n.U),e.C=!1,r.C=!0,eu(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?uu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,eu(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ru(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,eu(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,ru(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,eu(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,ru(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},ta.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return iu(e(n),a).cells.forEach(function(e,a){var c=e.edges,l=e.site,s=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):l.x>=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ca)*Ca,y:Math.round(o(n,t)/Ca)*Ca,i:t}})}var r=Ar,u=Nr,i=r,o=u,a=ul;return n?t(n):(t.links=function(n){return iu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return iu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Yr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c<l;)u=s,i=f,s=a[c].edge,f=s.l===o?s.r:s.l,r<i.i&&r<f.i&&au(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=Et(r=n),t):r},t.y=function(n){return arguments.length?(o=Et(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?ul:n,t):a===ul?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===ul?null:a&&a[1]},t)};var ul=[[-1e6,-1e6],[1e6,1e6]];ta.geom.delaunay=function(n){return ta.geom.voronoi().triangles(n)},ta.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(ga(c-e)+ga(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=su()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=su();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){fu(n,k,v,d,m,y)},k.find=function(n){return hu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var o,a=Ar,c=Nr;return(o=arguments.length)?(a=cu,c=lu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},ta.interpolateRgb=gu,ta.interpolateObject=pu,ta.interpolateNumber=vu,ta.interpolateString=du;var il=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ol=new RegExp(il.source,"g");ta.interpolate=mu,ta.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ga.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?gu:du:t instanceof ot?gu:Array.isArray(t)?yu:"object"===e&&isNaN(t)?pu:vu)(n,t)}],ta.interpolateArray=yu;var al=function(){return y},cl=ta.map({linear:al,poly:ku,quad:function(){return _u},cubic:function(){return wu},sin:function(){return Eu},exp:function(){return Au},circle:function(){return Nu},elastic:Cu,back:zu,bounce:function(){return qu}}),ll=ta.map({"in":y,out:xu,"in-out":bu,"out-in":function(n){return bu(xu(n))}});ta.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=cl.get(e)||al,r=ll.get(r)||y,Mu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Lu,ta.interpolateHsl=Tu,ta.interpolateLab=Ru,ta.interpolateRound=Du,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Pu(e?e.matrix:sl)})(n)},Pu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Hu,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Yu(n[e]));return t}},ta.layout.chord=function(){function n(){var n,l,f,h,g,p={},v=[],d=ta.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];v.push(l),m.push(ta.range(i)),n+=l}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(La-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},ta.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=fl,h=hl,g=-30,p=gl,v=.1,d=.64,m=[],M=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,y,x,b=m.length,_=M.length;for(e=0;_>e;++e)a=M[e],f=a.source,h=a.target,y=h.x-f.x,x=h.y-f.y,(p=y*y+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,y*=p,x*=p,h.x-=y*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=y*(d=1-d),f.y+=x*d);if((d=r*v)&&(y=l[0]/2,x=l[1]/2,e=-1,d))for(;++e<b;)a=m[e],a.x+=(y-a.x)*d,a.y+=(x-a.y)*d;if(g)for(Ju(t=ta.geom.quadtree(m),r,o),e=-1;++e<b;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(M=n,a):M},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=M[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++a<l;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,s=M.length,p=l[0],v=l[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=M[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,M[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,M[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(y).on("dragstart.force",Xu).on("drag.force",t).on("dragend.force",$u)),arguments.length?void this.on("mouseover.force",Bu).on("mouseout.force",Wu).call(e):e},ta.rebind(a,c,"on")};var fl=20,hl=1,gl=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ei,e=ni,r=ti;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ku(t,function(n){n.children&&(n.value=0)}),Qu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=ta.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Gu(e,r)},ta.layout.pie=function(){function n(o){var a,c=o.length,l=o.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===pl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=pl,r=0,u=La,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var pl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=y,e=ai,r=ci,u=oi,i=ui,o=ii;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:vl.get(t)||ai,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:dl.get(t)||ci,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var vl=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(li),i=n.map(si),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ai}),dl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ci});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=pi,u=hi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return gi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Qu(a,function(n){n.r=+s(n.value)}),Qu(a,Mi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Qu(a,function(n){n.r+=f}),Qu(a,Mi),Qu(a,function(n){n.r-=f})}return _i(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(vi),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Gu(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(Qu(h,e),h.parent.m=-h.z,Ku(h,r),l)Ku(f,i);else{var g=f,p=f,v=f;Ku(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Ku(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ni(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ei(o),u=ki(u),o&&u;)c=ki(c),i=Ei(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ai(Ci(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ei(i)&&(i.t=o,i.m+=f-s),u&&!ki(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=Si,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Gu(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Qu(c,function(n){var t=n.children;t&&t.length?(n.x=qi(t),n.y=zi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Li(c),f=Ti(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Qu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=Si,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Gu(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ta.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Ri,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));
5
- return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ri(t):Di(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Di(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Ri:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Gu(i,a)},ta.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var ml={floor:y,ceil:y};ta.scale.linear=function(){return Ii([0,1],[0,1],mu,!1)};var yl={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Ji(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var Ml=ta.format(".0e"),xl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Gi(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return Qi([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(bl)},ta.scale.category20=function(){return ta.scale.ordinal().range(_l)},ta.scale.category20b=function(){return ta.scale.ordinal().range(wl)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Sl)};var bl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),_l=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),wl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return no([],[])},ta.scale.quantize=function(){return to(0,1,[0,1])},ta.scale.threshold=function(){return eo([.5],[0,1])},ta.scale.identity=function(){return ro([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-Ra,f=a.apply(this,arguments)-Ra,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ta)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===kl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=qa?0:1;if(A&&so(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=qa?0:1;if(E&&so(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Lr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=fo(null==S?[_,w]:[S,k],[y,M],l,H,g),I=fo([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^so(O[1][0],O[1][1],I[1][0],I[1][1]),",",g," ",I[1],"A",H,",",H," 0 0,",v," ",I[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",I[0])}else N.push("M",y,",",M);if(null!=S){var Y=Math.min(p,(n-F)/(j-1)),Z=fo([y,M],[S,k],n,-Y,g),V=fo([_,w],null==x?[y,M]:[x,b],n,-Y,g);p===Y?N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^so(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",Y,",",Y," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=io,r=oo,u=uo,i=kl,o=ao,a=co,c=lo;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==kl?kl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ra;return[Math.cos(t)*n,Math.sin(t)*n]},n};var kl="auto";ta.svg.line=function(){return ho(y)};var El=ta.map({linear:go,"linear-closed":po,step:vo,"step-before":mo,"step-after":yo,basis:So,"basis-open":ko,"basis-closed":Eo,bundle:Ao,cardinal:bo,"cardinal-open":Mo,"cardinal-closed":xo,monotone:To});El.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],Cl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=ho(Ro);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},mo.reverse=yo,yo.reverse=mo,ta.svg.area=function(){return Do(y)},ta.svg.area.radial=function(){var n=Do(Ro);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-Ra,s=l.call(n,u,r)-Ra;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>qa)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=mr,o=yr,a=Po,c=ao,l=co;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=mr,e=yr,r=Uo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=Uo,e=n.projection;return n.projection=function(n){return arguments.length?e(jo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(zl.get(t.call(this,n,r))||Oo)(e.call(this,n,r))}var t=Ho,e=Fo;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var zl=ta.map({circle:Oo,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ll)),e=t*Ll;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=zl.keys();var ql=Math.sqrt(3),Ll=Math.tan(30*Da);_a.transition=function(n){for(var t,e,r=Tl||++Ul,u=Xo(n),i=[],o=Rl||{time:Date.now(),ease:Su,delay:0,duration:250},a=-1,c=this.length;++a<c;){i.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(e=l[s])&&$o(e,s,u,r,o),t.push(e)}return Yo(i,u,r)},_a.interrupt=function(n){return this.each(null==n?Dl:Io(Xo(n)))};var Tl,Rl,Dl=Io(Xo()),Pl=[],Ul=0;Pl.call=_a.call,Pl.empty=_a.empty,Pl.node=_a.node,Pl.size=_a.size,ta.transition=function(n,t){return n&&n.transition?Tl?n.transition(t):n:ta.selection().transition(n)},ta.transition.prototype=Pl,Pl.select=function(n){var t,e,r,u=this.id,i=this.namespace,o=[];n=N(n);for(var a=-1,c=this.length;++a<c;){o.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(r=l[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),$o(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Yo(o,i,u)},Pl.selectAll=function(n){var t,e,r,u,i,o=this.id,a=this.namespace,c=[];n=C(n);for(var l=-1,s=this.length;++l<s;)for(var f=this[l],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[a][o],e=n.call(r,r.__data__,h,l),c.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&$o(u,p,a,o,i),t.push(u)}return Yo(c,a,o)},Pl.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Yo(u,this.namespace,this.id)},Pl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Pl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Hu:mu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Pl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Pl.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=mu(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Zo(this,"style."+n,e,i)},Pl.styleTween=function(n,e,r){function u(u,i){var o=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Pl.text=function(n){return Zo(this,"text",n,Vo)},Pl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Pl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),Y(this,function(r){r[e][t].ease=n}))},Pl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Pl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Pl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Rl,i=Tl;try{Tl=e,Y(this,function(t,u,i){Rl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Rl=u,Tl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Pl.transition=function(){for(var n,t,e,r,u=this.id,i=++Ul,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Yo(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):y:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ca),d=ta.transition(p.exit()).style("opacity",Ca).remove(),m=ta.transition(p.order()).style("opacity",1),M=Math.max(u,0)+o,x=Ui(f),b=l.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ta.transition(b));v.append("line"),v.append("text");var w,S,k,E,A=v.select("line"),N=m.select("line"),C=p.select("text").text(g),z=v.select("text"),q=m.select("text"),L="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,w="x",k="y",S="x2",E="y2",C.attr("dy",0>L?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+L*i+"V0H"+x[1]+"V"+L*i)):(n=Wo,w="y",k="x",S="y2",E="x2",C.attr("dy",".32em").style("text-anchor",0>L?"end":"start"),_.attr("d","M"+L*i+","+x[0]+"H0V"+x[1]+"H"+L*i)),A.attr(E,L*u),z.attr(k,L*M),N.attr(S,0).attr(E,L*u),q.attr(w,0).attr(k,L*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=jl,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Fl?t+"":jl,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var jl="bottom",Fl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(t){t.each(function(){var t=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,y);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Hl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var c,f=ta.transition(t),h=ta.transition(o);l&&(c=Ui(l),h.attr("x",c[0]).attr("width",c[1]-c[0]),r(f)),s&&(c=Ui(s),h.attr("y",c[0]).attr("height",c[1]-c[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ta.event.keyCode&&(C||(M=null,q[0]-=f[1],q[1]-=h[1],C=2),S())}function v(){32==ta.event.keyCode&&2==C&&(q[0]+=f[1],q[1]+=h[1],C=0,S())}function d(){var n=ta.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ta.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),q[0]=f[+(n[0]<M[0])],q[1]=h[+(n[1]<M[1])]):M=null),A&&m(n,l,0)&&(r(k),t=!0),N&&m(n,s,1)&&(u(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function m(n,t,e){var r,u,i=Ui(t),c=i[0],l=i[1],s=q[e],v=e?h:f,d=v[1]-v[0];return C&&(c-=s,l-=d+s),r=(e?p:g)?Math.max(c,Math.min(l,n[e])):n[e],C?u=(r+=s)+d:(M&&(s=Math.max(c,Math.min(l,2*M[e]-r))),r>s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?a=null:o=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ta.select(ta.event.target),w=c.of(b,arguments),k=ta.select(b),E=_.datum(),A=!/^(n|s)$/.test(E)&&l,N=!/^(e|w)$/.test(E)&&s,C=_.classed("extent"),z=W(b),q=ta.mouse(b),L=ta.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(ta.event.changedTouches?L.on("touchmove.brush",d).on("touchend.brush",y):L.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)q[0]=f[0]-q[0],q[1]=h[0]-q[1];else if(E){var T=+/w$/.test(E),R=+/^n/.test(E);x=[f[1-T]-q[0],h[1-R]-q[1]],q[0]=f[T],q[1]=h[R]}else ta.event.altKey&&(M=q.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,c=E(n,"brushstart","brush","brushend"),l=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=Ol[0];return n.event=function(n){n.each(function(){var n=c.of(this,arguments),t={x:f,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Tl?ta.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=yu(f,t.x),r=yu(h,t.y);return o=a=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(l=t,v=Ol[!l<<1|!s],n):l},n.y=function(t){return arguments.length?(s=t,v=Ol[!l<<1|!s],n):s},n.clamp=function(t){return arguments.length?(l&&s?(g=!!t[0],p=!!t[1]):l?g=!!t:s&&(p=!!t),n):l&&s?[g,p]:l?g:s?p:null},n.extent=function(t){var e,r,u,i,c;return arguments.length?(l&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),o=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(c=e,e=r,r=c),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],l&&(u=u[1],i=i[1]),a=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(c=u,u=i,i=c),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(l&&(o?(e=o[0],r=o[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(c=e,e=r,r=c))),s&&(a?(u=a[0],i=a[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(c=u,u=i,i=c))),l&&s?[[e,u],[r,i]]:l?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!l&&f[0]==f[1]||!!s&&h[0]==h[1]},ta.rebind(n,c,"on")};var Hl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ol=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Il=ac.format=gc.timeFormat,Yl=Il.utc,Zl=Yl("%Y-%m-%dT%H:%M:%S.%LZ");Il.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:Zl,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=Zl.toString,ac.second=Ft(function(n){return new cc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ac.seconds=ac.second.range,ac.seconds.utc=ac.second.utc.range,ac.minute=Ft(function(n){return new cc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ac.minutes=ac.minute.range,ac.minutes.utc=ac.minute.utc.range,ac.hour=Ft(function(n){var t=n.getTimezoneOffset()/60;return new cc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ac.hours=ac.hour.range,ac.hours.utc=ac.hour.utc.range,ac.month=Ft(function(n){return n=ac.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ac.months=ac.month.range,ac.months.utc=ac.month.utc.range;var Vl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ac.second,1],[ac.second,5],[ac.second,15],[ac.second,30],[ac.minute,1],[ac.minute,5],[ac.minute,15],[ac.minute,30],[ac.hour,1],[ac.hour,3],[ac.hour,6],[ac.hour,12],[ac.day,1],[ac.day,2],[ac.week,1],[ac.month,1],[ac.month,3],[ac.year,1]],$l=Il.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ne]]),Bl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:y,ceil:y};Xl.year=ac.year,ac.scale=function(){return Go(ta.scale.linear(),Xl,$l)};var Wl=Xl.map(function(n){return[n[0].utc,n[1]]}),Jl=Yl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ne]]);Wl.year=ac.year.utc,ac.scale.utc=function(){return Go(ta.scale.linear(),Wl,Jl)},ta.text=At(function(n){return n.responseText}),ta.json=function(n,t){return Nt(n,"application/json",Qo,t)},ta.html=function(n,t){return Nt(n,"text/html",na,t)},ta.xml=At(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();
1
+ !function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function i(n){return!isNaN(n)}function u(n){return{left:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)<0?r=u+1:i=u}return r},right:function(t,e,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);i>r;){var u=r+i>>>1;n(t[u],e)>0?i=u:r=u+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function f(n){return(n+="")===bo||n[0]===_o?_o+n:n}function s(n){return(n+="")[0]===_o?n.slice(1):n}function h(n){return f(n)in this._}function p(n){return(n=f(n))in this._&&delete this._[n]}function g(){var n=[];for(var t in this._)n.push(s(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function y(){this._=Object.create(null)}function m(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=wo.length;r>e;++e){var i=wo[e]+t;if(i in n)return i}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,i=-1,u=r.length;++i<u;)(t=r[i].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,i){var u,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,u=e.indexOf(o)).concat(e.slice(u+1)),r.remove(t)),i&&e.push(r.set(t,{on:i})),n)},t}function S(){ao.event.preventDefault()}function k(){for(var n,t=ao.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(i){try{var u=i.sourceEvent=ao.event;i.target=n,ao.event=i,t[i.type].apply(e,r)}finally{ao.event=u}}},t}function E(n){return ko(n,Co),n}function A(n){return"function"==typeof n?n:function(){return No(n,this)}}function C(n){return"function"==typeof n?n:function(){return Eo(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function i(){this.setAttribute(n,t)}function u(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ao.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?u:i}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+ao.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<i;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<i;)n[e](this,r)}n=T(n).map(D);var i=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(i=e.classList)return r?i.add(n):i.remove(n);var i=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||e.setAttribute("class",L(i+" "+n))):e.setAttribute("class",L(i.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function i(){this.style.setProperty(n,t,e)}function u(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?u:i}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function i(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?i:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e===zo&&t.documentElement.namespaceURI===zo?t.createElement(n):t.createElementNS(e,n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ao.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ao(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var i,u=n[e],o=0,a=u.length;a>o;o++)(i=u[o])&&t(i,o,e);return n}function Z(n){return ko(n,qo),n}function V(n){var t,e;return function(r,i,u){var o,a=n[u].update,l=a.length;for(u!=e&&(e=u,t=0),i>=t&&(t=i+1);!(o=a[t])&&++t<l;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function i(){var i=l(t,co(arguments));r.call(this),this.addEventListener(n,this[o]=i,i.$=e),i._=t}function u(){var t,e=new RegExp("^__on([^.]+)"+ao.requote(n)+"$");for(var r in this)if(t=r.match(e)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),l=$;a>0&&(n=n.slice(0,a));var c=To.get(n);return c&&(n=c,l=B),a?t?i:r:t?b:u}function $(n,t){return function(e){var r=ao.event;ao.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ao.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Do,i="click"+r,u=ao.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ro&&(Ro="onselectstart"in e?!1:x(e.style,"userSelect")),Ro){var o=n(e).style,a=o[Ro];o[Ro]="none"}return function(n){if(u.on(r,null),Ro&&(o[Ro]=a),n){var t=function(){u.on(i,null)};u.on(i,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Po){var u=t(n);if(u.scrollX||u.scrollY){r=ao.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Po=!(o.f||o.e),r.remove()}}return Po?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ao.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?Fo:Math.acos(n)}function tn(n){return n>1?Io:-1>n?-Io:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function on(n){return(n=Math.sin(n/2))*n}function an(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?u+(o-u)*n/60:180>n?o:240>n?u+(o-u)*(240-n)/60:u}function i(n){return Math.round(255*r(n))}var u,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,u=2*e-o,new mn(i(n+120),i(n),i(n-120))}function fn(n,t,e){return this instanceof fn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof fn?new fn(n.h,n.c,n.l):n instanceof hn?gn(n.l,n.a,n.b):gn((n=Sn((n=ao.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new fn(n,t,e)}function sn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Yo)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof fn?sn(n.h,n.c,n.l):Sn((n=mn(n)).r,n.g,n.b):new hn(n,t,e)}function pn(n,t,e){var r=(n+16)/116,i=r+t/500,u=r-e/200;return i=vn(i)*na,r=vn(r)*ta,u=vn(u)*ea,new mn(yn(3.2404542*i-1.5371385*r-.4985314*u),yn(-.969266*i+1.8760108*r+.041556*u),yn(.0556434*i-.2040259*r+1.0572252*u))}function gn(n,t,e){return n>0?new fn(Math.atan2(e,t)*Zo,Math.sqrt(t*t+e*e),n):new fn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function yn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mn(n,t,e){return this instanceof mn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mn?new mn(n.r,n.g,n.b):_n(""+n,mn,cn):new mn(n,t,e)}function Mn(n){return new mn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,i,u,o=0,a=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return e(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(Nn(i[0]),Nn(i[1]),Nn(i[2]))}return(u=ua.get(n))?t(u.r,u.g,u.b):(null==n||"#"!==n.charAt(0)||isNaN(u=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&u)>>4,o=o>>4|o,a=240&u,a=a>>4|a,l=15&u,l=l<<4|l):7===n.length&&(o=(16711680&u)>>16,a=(65280&u)>>8,l=255&u)),t(o,a,l))}function wn(n,t,e){var r,i,u=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-u,l=(o+u)/2;return a?(i=.5>l?a/(o+u):a/(2-o-u),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=NaN,i=l>0&&1>l?0:r),new ln(r,i,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/na),i=dn((.2126729*n+.7151522*t+.072175*e)/ta),u=dn((.0193339*n+.119192*t+.9503041*e)/ea);return hn(116*i-16,500*(r-i),200*(i-u))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function i(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(u,l)}catch(r){return void o.error.call(u,r)}o.load.call(u,n)}else o.error.call(u,l)}var u={},o=ao.dispatch("beforesend","progress","load","error"),a={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(n){var t=ao.event;ao.event=n;try{o.progress.call(u,l)}finally{ao.event=t}},u.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",u)},u.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",u):t},u.responseType=function(n){return arguments.length?(c=n,u):c},u.response=function(n){return e=n,u},["get","post"].forEach(function(n){u[n]=function(){return u.send.apply(u,[n].concat(co(arguments)))}}),u.send=function(e,r,i){if(2===arguments.length&&"function"==typeof r&&(i=r,r=null),l.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),l.setRequestHeader)for(var f in a)l.setRequestHeader(f,a[f]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=i&&u.on("error",i).on("load",function(n){i(null,n)}),o.beforesend.call(u,l),l.send(null==r?null:r),u},u.abort=function(){return l.abort(),u},ao.rebind(u,o,"on"),null==r?u:u.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var i=e+t,u={c:n,t:i,n:null};return aa?aa.n=u:oa=u,aa=u,la||(ca=clearTimeout(ca),la=1,fa(Tn)),u}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(ca),ca=setTimeout(Tn,t)),la=0):(la=1,fa(Tn))}function Rn(){for(var n=Date.now(),t=oa;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=oa,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:oa=t.n;return aa=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Un(n,t){var e=Math.pow(10,3*xo(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,i=n.currency,u=r&&e?function(n,t){for(var i=n.length,u=[],o=0,a=r[0],l=0;i>0&&a>0&&(l+a+1>t&&(a=Math.max(1,t-l)),u.push(n.substring(i-=a,i+a)),!((l+=a+1)>t));)a=r[o=(o+1)%r.length];return u.reverse().join(e)}:m;return function(n){var e=ha.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",l=e[4]||"",c=e[5],f=+e[6],s=e[7],h=e[8],p=e[9],g=1,v="",d="",y=!1,m=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===o)&&(c=r="0",o="="),p){case"n":s=!0,p="g";break;case"%":g=100,d="%",p="f";break;case"p":g=100,d="%",p="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+p.toLowerCase());case"c":m=!1;case"d":y=!0,h=0;break;case"s":g=-1,p="r"}"$"===l&&(v=i[0],d=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):"e"!=p&&"f"!=p||(h=Math.max(0,Math.min(20,h)))),p=pa.get(p)||Fn;var M=c&&s;return function(n){var e=d;if(y&&n%1)return"";var i=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>g){var l=ao.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=g;n=p(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=m?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&s&&(x=u(x,1/0));var S=v.length+x.length+b.length+(M?0:i.length),k=f>S?new Array(S=f-S+1).join(r):"";return M&&(x=u(k+x,k.length?f-b.length:1/0)),i+=v,n=x+b,("<"===o?i+n+k:">"===o?k+i+n:"^"===o?k.substring(0,S>>=1)+i+n+k.substring(S):i+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=u(e,1);return r-t>t-e?e:r}function i(e){return t(e=n(new va(e-1)),1),e}function u(n,e){return t(n=new va(+n),e),n}function o(n,r,u){var o=i(n),a=[];if(u>1)for(;r>o;)e(o)%u||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{va=Hn;var r=new Hn;return r._=n,o(r,t,e)}finally{va=Date}}n.floor=n,n.round=r,n.ceil=i,n.offset=u,n.range=o;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(i),l.offset=In(u),l.range=a,n}function In(n){return function(t,e){try{va=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{va=Date}}}function Yn(n){function t(n){function t(t){for(var e,i,u,o=[],a=-1,l=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(l,a)),null!=(i=ya[e=n.charAt(++a)])&&(e=n.charAt(++a)),(u=A[e])&&(e=u(t,null==i?"e"===e?" ":"0":i)),o.push(e),l=a+1);return o.push(n.slice(l,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=e(r,n,t,0);if(i!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var u=null!=r.Z&&va!==Hn,o=new(u?Hn:va);return"j"in r?o.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),u?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var i,u,o,a=0,l=t.length,c=e.length;l>a;){if(r>=c)return-1;if(i=t.charCodeAt(a++),37===i){if(o=t.charAt(a++),u=C[o in ya?t.charAt(a++):o],!u||(r=u(n,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function f(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var s=n.dateTime,h=n.date,p=n.time,g=n.periods,v=n.days,d=n.shortDays,y=n.months,m=n.shortMonths;t.utc=function(n){function e(n){try{va=Hn;var t=new va;return t._=n,r(t)}finally{va=Date}}var r=t(n);return e.parse=function(n){try{va=Hn;var t=r.parse(n);return t&&t._}finally{va=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=ao.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(y),k=Xn(y),N=Vn(m),E=Xn(m);g.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return m[n.getMonth()]},B:function(n){return y[n.getMonth()]},c:t(s),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ga.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return g[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ga.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ga.mondayOfYear(n),t,2)},x:t(h),X:t(p),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:at,"%":function(){return"%"}},C={a:r,A:i,b:u,B:o,c:a,d:tt,e:tt,H:rt,I:rt,j:et,L:ot,m:nt,M:it,p:f,S:ut,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",i=(r?-n:n)+"",u=i.length;return r+(e>u?new Array(e-u+1).join(t)+i:i)}function Vn(n){return new RegExp("^(?:"+n.map(ao.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function it(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ut(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ot(n,t,e){ma.lastIndex=0;var r=ma.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function at(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=xo(t)/60|0,i=xo(t)%60;return e+Zn(r,"0",2)+Zn(i,"0",2)}function lt(n,t,e){Ma.lastIndex=0;var r=Ma.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ft(){}function st(n,t,e){var r=e.s=n+t,i=r-n,u=r-i;e.t=n-u+(t-i)}function ht(n,t){n&&wa.hasOwnProperty(n.type)&&wa[n.type](n,t)}function pt(n,t,e){var r,i=-1,u=n.length-e;for(t.lineStart();++i<u;)r=n[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function gt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)pt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Yo,t=t*Yo/2+Fo/4;var e=n-r,o=e>=0?1:-1,a=o*e,l=Math.cos(t),c=Math.sin(t),f=u*c,s=i*l+f*Math.cos(a),h=f*o*Math.sin(a);ka.add(Math.atan2(h,s)),r=n,i=l,u=c}var t,e,r,i,u;Na.point=function(o,a){Na.point=n,r=(t=o)*Yo,i=Math.cos(a=(e=a)*Yo/2+Fo/4),u=Math.sin(a)},Na.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function yt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function mt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return xo(n[0]-t[0])<Uo&&xo(n[1]-t[1])<Uo}function St(n,t){n*=Yo;var e=Math.cos(t*=Yo);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++Ea,Ca+=(n-Ca)/Ea,za+=(t-za)/Ea,La+=(e-La)/Ea}function Nt(){function n(n,i){n*=Yo;var u=Math.cos(i*=Yo),o=u*Math.cos(n),a=u*Math.sin(n),l=Math.sin(i),c=Math.atan2(Math.sqrt((c=e*l-r*a)*c+(c=r*o-t*l)*c+(c=t*a-e*o)*c),t*o+e*a+r*l);Aa+=c,qa+=c*(t+(t=o)),Ta+=c*(e+(e=a)),Ra+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;ja.point=function(i,u){i*=Yo;var o=Math.cos(u*=Yo);t=o*Math.cos(i),e=o*Math.sin(i),r=Math.sin(u),ja.point=n,kt(t,e,r)}}function Et(){ja.point=St}function At(){function n(n,t){n*=Yo;var e=Math.cos(t*=Yo),o=e*Math.cos(n),a=e*Math.sin(n),l=Math.sin(t),c=i*l-u*a,f=u*o-r*l,s=r*a-i*o,h=Math.sqrt(c*c+f*f+s*s),p=r*o+i*a+u*l,g=h&&-nn(p)/h,v=Math.atan2(h,p);Da+=g*c,Pa+=g*f,Ua+=g*s,Aa+=v,qa+=v*(r+(r=o)),Ta+=v*(i+(i=a)),Ra+=v*(u+(u=l)),kt(r,i,u)}var t,e,r,i,u;ja.point=function(o,a){t=o,e=a,ja.point=n,o*=Yo;var l=Math.cos(a*=Yo);r=l*Math.cos(o),i=l*Math.sin(o),u=Math.sin(a),kt(r,i,u)},ja.lineEnd=function(){n(t,e),ja.lineEnd=Et,ja.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,i){var u=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){i.lineStart();for(var a=0;t>a;++a)i.point((e=n[a])[0],e[1]);return void i.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,u.push(l),o.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,u.push(l),o.push(c)}}),o.sort(t),qt(u),qt(o),u.length){for(var a=0,l=e,c=o.length;c>a;++a)o[a].e=l=!l;for(var f,s,h=u[0];;){for(var p=h,g=!0;p.v;)if((p=p.n)===h)return;f=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(g)for(var a=0,c=f.length;c>a;++a)i.point((s=f[a])[0],s[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(g){f=p.p.z;for(var a=f.length-1;a>=0;--a)i.point((s=f[a])[0],s[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,f=p.z,g=!g}while(!p.v);i.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,i=n[0];++r<t;)i.n=e=n[r],e.p=i,i=e;i.n=e=n[0],e.p=i}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(i,u){function o(t,e){var r=i(t,e);n(t=r[0],e=r[1])&&u.point(t,e)}function a(n,t){var e=i(n,t);d.point(e[0],e[1])}function l(){m.point=a,d.lineStart()}function c(){m.point=o,d.lineEnd()}function f(n,t){v.push([n,t]);var e=i(n,t);x.point(e[0],e[1])}function s(){x.lineStart(),v=[]}function h(){f(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),g.push(v),v=null,r)if(1&t){n=e[0];var i,r=n.length-1,o=-1;if(r>0){for(b||(u.polygonStart(),b=!0),u.lineStart();++o<r;)u.point((i=n[o])[0],i[1]);u.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),p.push(e.filter(Dt))}var p,g,v,d=t(u),y=i.invert(r[0],r[1]),m={point:o,lineStart:l,lineEnd:c,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=h,p=[],g=[]},polygonEnd:function(){m.point=o,m.lineStart=l,m.lineEnd=c,p=ao.merge(p);var n=Ot(y,g);p.length?(b||(u.polygonStart(),b=!0),Lt(p,Ut,n,e,u)):n&&(b||(u.polygonStart(),b=!0),u.lineStart(),e(null,null,1,u),u.lineEnd()),b&&(u.polygonEnd(),b=!1),p=g=null},sphere:function(){u.polygonStart(),u.lineStart(),e(null,null,1,u),u.lineEnd(),u.polygonEnd()}},M=Pt(),x=t(M),b=!1;return m}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Io-Uo:Io-n[1])-((t=t.x)[0]<0?t[1]-Io-Uo:Io-t[1])}function jt(n){var t,e=NaN,r=NaN,i=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(u,o){var a=u>0?Fo:-Fo,l=xo(u-e);xo(l-Fo)<Uo?(n.point(e,r=(r+o)/2>0?Io:-Io),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(u,r),t=0):i!==a&&l>=Fo&&(xo(e-i)<Uo&&(e-=i*Uo),xo(u-a)<Uo&&(u-=a*Uo),r=Ft(e,r,u,o),n.point(i,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=u,r=o),i=a},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var i,u,o=Math.sin(n-e);return xo(o)>Uo?Math.atan((Math.sin(t)*(u=Math.cos(r))*Math.sin(e)-Math.sin(r)*(i=Math.cos(t))*Math.sin(n))/(i*u*o)):(t+r)/2}function Ht(n,t,e,r){var i;if(null==n)i=e*Io,r.point(-Fo,i),r.point(0,i),r.point(Fo,i),r.point(Fo,0),r.point(Fo,-i),r.point(0,-i),r.point(-Fo,-i),r.point(-Fo,0),r.point(-Fo,i);else if(xo(n[0]-t[0])>Uo){var u=n[0]<t[0]?Fo:-Fo;i=e*u/2,r.point(-u,i),r.point(0,i),r.point(u,i)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],i=[Math.sin(e),-Math.cos(e),0],u=0,o=0;ka.reset();for(var a=0,l=t.length;l>a;++a){var c=t[a],f=c.length;if(f)for(var s=c[0],h=s[0],p=s[1]/2+Fo/4,g=Math.sin(p),v=Math.cos(p),d=1;;){d===f&&(d=0),n=c[d];var y=n[0],m=n[1]/2+Fo/4,M=Math.sin(m),x=Math.cos(m),b=y-h,_=b>=0?1:-1,w=_*b,S=w>Fo,k=g*M;if(ka.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),u+=S?b+_*Ho:b,S^h>=e^y>=e){var N=mt(dt(s),dt(n));bt(N);var E=mt(i,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=y,g=M,v=x,s=n}}return(-Uo>u||Uo>u&&-Uo>ka)^1&o}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>u}function e(n){var e,u,l,c,f;return{lineStart:function(){c=l=!1,f=1},point:function(s,h){var p,g=[s,h],v=t(s,h),d=o?v?0:i(s,h):v?i(s+(0>s?Fo:-Fo),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(p=r(e,g),(wt(e,p)||wt(g,p))&&(g[0]+=Uo,g[1]+=Uo,v=t(g[0],g[1]))),v!==l)f=0,v?(n.lineStart(),p=r(g,e),n.point(p[0],p[1])):(p=r(e,g),n.point(p[0],p[1]),n.lineEnd()),e=p;else if(a&&e&&o^v){var y;d&u||!(y=r(g,e,!0))||(f=0,o?(n.lineStart(),n.point(y[0][0],y[0][1]),n.point(y[1][0],y[1][1]),n.lineEnd()):(n.point(y[1][0],y[1][1]),n.lineEnd(),n.lineStart(),n.point(y[0][0],y[0][1])))}!v||e&&wt(e,g)||n.point(g[0],g[1]),e=g,l=v,u=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return f|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),i=dt(t),o=[1,0,0],a=mt(r,i),l=yt(a,a),c=a[0],f=l-c*c;if(!f)return!e&&n;var s=u*l/f,h=-u*c/f,p=mt(o,a),g=xt(o,s),v=xt(a,h);Mt(g,v);var d=p,y=yt(g,d),m=yt(d,d),M=y*y-m*(yt(g,g)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-y-x)/m);if(Mt(b,g),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=xo(E-Fo)<Uo,C=A||Uo>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(xo(b[0]-w)<Uo?k:N):k<=b[1]&&b[1]<=N:E>Fo^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-y+x)/m);return Mt(z,g),[b,_t(z)]}}}function i(t,e){var r=o?n:Fo-n,i=0;return-r>t?i|=1:t>r&&(i|=2),-r>e?i|=4:e>r&&(i|=8),i}var u=Math.cos(n),o=u>0,a=xo(u)>Uo,l=ve(n,6*Yo);return Rt(t,e,l,o?[0,-n]:[-Fo,n-Fo])}function Yt(n,t,e,r){return function(i){var u,o=i.a,a=i.b,l=o.x,c=o.y,f=a.x,s=a.y,h=0,p=1,g=f-l,v=s-c;if(u=n-l,g||!(u>0)){if(u/=g,0>g){if(h>u)return;p>u&&(p=u)}else if(g>0){if(u>p)return;u>h&&(h=u)}if(u=e-l,g||!(0>u)){if(u/=g,0>g){if(u>p)return;u>h&&(h=u)}else if(g>0){if(h>u)return;p>u&&(p=u)}if(u=t-c,v||!(u>0)){if(u/=v,0>v){if(h>u)return;p>u&&(p=u)}else if(v>0){if(u>p)return;u>h&&(h=u)}if(u=r-c,v||!(0>u)){if(u/=v,0>v){if(u>p)return;u>h&&(h=u)}else if(v>0){if(h>u)return;p>u&&(p=u)}return h>0&&(i.a={x:l+h*g,y:c+h*v}),1>p&&(i.b={x:l+p*g,y:c+p*v}),i}}}}}}function Zt(n,t,e,r){function i(r,i){return xo(r[0]-n)<Uo?i>0?0:3:xo(r[0]-e)<Uo?i>0?2:1:xo(r[1]-t)<Uo?i>0?1:0:i>0?3:2}function u(n,t){return o(n.x,t.x)}function o(n,t){var e=i(n,1),r=i(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function l(n){for(var t=0,e=d.length,r=n[1],i=0;e>i;++i)for(var u,o=1,a=d[i],l=a.length,c=a[0];l>o;++o)u=a[o],c[1]<=r?u[1]>r&&Q(c,u,n)>0&&++t:u[1]<=r&&Q(c,u,n)<0&&--t,c=u;return 0!==t}function c(u,a,l,c){var f=0,s=0;if(null==u||(f=i(u,l))!==(s=i(a,l))||o(u,a)<0^l>0){do c.point(0===f||3===f?n:e,f>1?r:t);while((f=(f+l+4)%4)!==s)}else c.point(a[0],a[1])}function f(i,u){return i>=n&&e>=i&&u>=t&&r>=u}function s(n,t){f(n,t)&&a.point(n,t)}function h(){C.point=g,d&&d.push(y=[]),S=!0,w=!1,b=_=NaN}function p(){v&&(g(m,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=s,w&&a.lineEnd()}function g(n,t){n=Math.max(-Ha,Math.min(Ha,n)),t=Math.max(-Ha,Math.min(Ha,t));var e=f(n,t);if(d&&y.push([n,t]),S)m=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,y,m,M,x,b,_,w,S,k,N=a,E=Pt(),A=Yt(n,t,e,r),C={point:s,lineStart:h,lineEnd:p,polygonStart:function(){a=E,v=[],d=[],k=!0},polygonEnd:function(){a=N,v=ao.merge(v);var t=l([n,r]),e=k&&t,i=v.length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),c(null,null,1,a),a.lineEnd()),i&&Lt(v,u,t,c,a),a.polygonEnd()),v=d=y=null}};return C}}function Vt(n){var t=0,e=Fo/3,r=ae(n),i=r(t,e);return i.parallels=function(n){return arguments.length?r(t=n[0]*Fo/180,e=n[1]*Fo/180):[t/Fo*180,e/Fo*180]},i}function Xt(n,t){function e(n,t){var e=Math.sqrt(u-2*i*Math.sin(t))/i;return[e*Math.sin(n*=i),o-e*Math.cos(n)]}var r=Math.sin(n),i=(r+Math.sin(t))/2,u=1+r*(2*i-r),o=Math.sqrt(u)/i;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/i,tn((u-(n*n+e*e)*i*i)/(2*i))]},e}function $t(){function n(n,t){Ia+=i*n-r*t,r=n,i=t}var t,e,r,i;$a.point=function(u,o){$a.point=n,t=r=u,e=i=o},$a.lineEnd=function(){n(t,e)}}function Bt(n,t){Ya>n&&(Ya=n),n>Va&&(Va=n),Za>t&&(Za=t),t>Xa&&(Xa=t)}function Wt(){function n(n,t){o.push("M",n,",",t,u)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function i(){o.push("Z")}var u=Jt(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return u=Jt(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ca+=n,za+=t,++La}function Kt(){function n(n,r){var i=n-t,u=r-e,o=Math.sqrt(i*i+u*u);qa+=o*(t+n)/2,Ta+=o*(e+r)/2,Ra+=o,Gt(t=n,e=r)}var t,e;Wa.point=function(r,i){Wa.point=n,Gt(t=r,e=i)}}function Qt(){Wa.point=Gt}function ne(){function n(n,t){var e=n-r,u=t-i,o=Math.sqrt(e*e+u*u);qa+=o*(r+n)/2,Ta+=o*(i+t)/2,Ra+=o,o=i*n-r*t,Da+=o*(r+n),Pa+=o*(i+t),Ua+=3*o,Gt(r=n,i=t)}var t,e,r,i;Wa.point=function(u,o){Wa.point=n,Gt(t=r=u,e=i=o)},Wa.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Ho)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function i(){a.point=t}function u(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:i,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=i,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function ee(n){function t(n){return(a?r:e)(n)}function e(t){return ue(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=u,t.lineStart()}function u(e,r){var u=dt([e,r]),o=n(e,r);i(M,x,m,b,_,w,M=o[0],x=o[1],m=e,b=u[0],_=u[1],w=u[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function l(){
2
+ r(),S.point=c,S.lineEnd=f}function c(n,t){u(s=n,h=t),p=M,g=x,v=b,d=_,y=w,S.point=u}function f(){i(M,x,m,b,_,w,p,g,s,v,d,y,a,t),S.lineEnd=o,o()}var s,h,p,g,v,d,y,m,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function i(t,e,r,a,l,c,f,s,h,p,g,v,d,y){var m=f-t,M=s-e,x=m*m+M*M;if(x>4*u&&d--){var b=a+p,_=l+g,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=xo(xo(w)-1)<Uo||xo(r-h)<Uo?(r+h)/2:Math.atan2(_,b),E=n(N,k),A=E[0],C=E[1],z=A-t,L=C-e,q=M*z-m*L;(q*q/x>u||xo((m*z+M*L)/x-.5)>.3||o>a*p+l*g+c*v)&&(i(t,e,r,a,l,c,A,C,N,b/=S,_/=S,w,d,y),y.point(A,C),i(A,C,N,b,_,w,f,s,h,p,g,v,d,y))}}var u=.5,o=Math.cos(30*Yo),a=16;return t.precision=function(n){return arguments.length?(a=(u=n*n)>0&&16,t):Math.sqrt(u)},t}function re(n){var t=ee(function(t,e){return n([t*Zo,e*Zo])});return function(n){return le(t(n))}}function ie(n){this.stream=n}function ue(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function oe(n){return ae(function(){return n})()}function ae(n){function t(n){return n=a(n[0]*Yo,n[1]*Yo),[n[0]*h+l,c-n[1]*h]}function e(n){return n=a.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Zo,n[1]*Zo]}function r(){a=Ct(o=se(y,M,x),u);var n=u(v,d);return l=p-n[0]*h,c=g+n[1]*h,i()}function i(){return f&&(f.valid=!1,f=null),t}var u,o,a,l,c,f,s=ee(function(n,t){return n=u(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,p=480,g=250,v=0,d=0,y=0,M=0,x=0,b=Fa,_=m,w=null,S=null;return t.stream=function(n){return f&&(f.valid=!1),f=le(b(o,s(_(n)))),f.valid=!0,f},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fa):It((w=+n)*Yo),i()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):m,i()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(p=+n[0],g=+n[1],r()):[p,g]},t.center=function(n){return arguments.length?(v=n[0]%360*Yo,d=n[1]%360*Yo,r()):[v*Zo,d*Zo]},t.rotate=function(n){return arguments.length?(y=n[0]%360*Yo,M=n[1]%360*Yo,x=n.length>2?n[2]%360*Yo:0,r()):[y*Zo,M*Zo,x*Zo]},ao.rebind(t,s,"precision"),function(){return u=n.apply(this,arguments),t.invert=u.invert&&e,r()}}function le(n){return ue(n,function(t,e){n.point(t*Yo,e*Yo)})}function ce(n,t){return[n,t]}function fe(n,t){return[n>Fo?n-Ho:-Fo>n?n+Ho:n,t]}function se(n,t,e){return n?t||e?Ct(pe(n),ge(t,e)):pe(n):t||e?ge(t,e):fe}function he(n){return function(t,e){return t+=n,[t>Fo?t-Ho:-Fo>t?t+Ho:t,e]}}function pe(n){var t=he(n);return t.invert=he(-n),t}function ge(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*r+a*i;return[Math.atan2(l*u-f*o,a*r-c*i),tn(f*u+l*o)]}var r=Math.cos(n),i=Math.sin(n),u=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),f=c*u-l*o;return[Math.atan2(l*u+c*o,a*r+f*i),tn(f*r-a*i)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(i,u,o,a){var l=o*t;null!=i?(i=de(e,i),u=de(e,u),(o>0?u>i:i>u)&&(i+=o*Ho)):(i=n+o*Ho,u=n-.5*l);for(var c,f=i;o>0?f>u:u>f;f-=l)a.point((c=_t([e,-r*Math.cos(f),-r*Math.sin(f)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Uo)%(2*Math.PI)}function ye(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function me(n,t,e){var r=ao.range(n,t-Uo,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var i=Math.cos(t),u=Math.sin(t),o=Math.cos(r),a=Math.sin(r),l=i*Math.cos(n),c=i*Math.sin(n),f=o*Math.cos(e),s=o*Math.sin(e),h=2*Math.asin(Math.sqrt(on(r-t)+i*o*on(e-n))),p=1/Math.sin(h),g=h?function(n){var t=Math.sin(n*=h)*p,e=Math.sin(h-n)*p,r=e*l+t*f,i=e*c+t*s,o=e*u+t*a;return[Math.atan2(i,r)*Zo,Math.atan2(o,Math.sqrt(r*r+i*i))*Zo]}:function(){return[n*Zo,t*Zo]};return g.distance=h,g}function _e(){function n(n,i){var u=Math.sin(i*=Yo),o=Math.cos(i),a=xo((n*=Yo)-t),l=Math.cos(a);Ja+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*u-e*o*l)*a),e*u+r*o*l),t=n,e=u,r=o}var t,e,r;Ga.point=function(i,u){t=i*Yo,e=Math.sin(u*=Yo),r=Math.cos(u),Ga.point=n},Ga.lineEnd=function(){Ga.point=Ga.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),i=Math.cos(e),u=n(r*i);return[u*i*Math.sin(t),u*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),i=t(r),u=Math.sin(i),o=Math.cos(i);return[Math.atan2(n*u,r*o),Math.asin(r&&e*u/r)]},e}function Se(n,t){function e(n,t){o>0?-Io+Uo>t&&(t=-Io+Uo):t>Io-Uo&&(t=Io-Uo);var e=o/Math.pow(i(t),u);return[e*Math.sin(u*n),o-e*Math.cos(u*n)]}var r=Math.cos(n),i=function(n){return Math.tan(Fo/4+n/2)},u=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(i(t)/i(n)),o=r*Math.pow(i(n),u)/u;return u?(e.invert=function(n,t){var e=o-t,r=K(u)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/u,2*Math.atan(Math.pow(o/r,1/u))-Io]},e):Ne}function ke(n,t){function e(n,t){var e=u-t;return[e*Math.sin(i*n),u-e*Math.cos(i*n)]}var r=Math.cos(n),i=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),u=r/i+n;return xo(i)<Uo?ce:(e.invert=function(n,t){var e=u-t;return[Math.atan2(n,e)/i,u-K(i)*Math.sqrt(n*n+e*e)]},e)}function Ne(n,t){return[n,Math.log(Math.tan(Fo/4+t/2))]}function Ee(n){var t,e=oe(n),r=e.scale,i=e.translate,u=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=i.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=u.apply(e,arguments);if(o===e){if(t=null==n){var a=Fo*r(),l=i();u([[l[0]-a,l[1]-a],[l[0]+a,l[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ae(n,t){return[Math.log(Math.tan(Fo/4+t/2)),-n]}function Ce(n){return n[0]}function ze(n){return n[1]}function Le(n){for(var t=n.length,e=[0,1],r=2,i=2;t>i;i++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[i])<=0;)--r;e[r++]=i}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var i=n[0],u=e[0],o=t[0]-i,a=r[0]-u,l=n[1],c=e[1],f=t[1]-l,s=r[1]-c,h=(a*(l-c)-s*(i-u))/(s*o-a*f);return[i+h*o,l+h*f]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),ol.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,i={x:e,y:r},u=n.P,o=n.N,a=[n];je(n);for(var l=u;l.circle&&xo(e-l.circle.x)<Uo&&xo(r-l.circle.cy)<Uo;)u=l.P,a.unshift(l),je(l),l=u;a.unshift(l),Be(l);for(var c=o;c.circle&&xo(e-c.circle.x)<Uo&&xo(r-c.circle.cy)<Uo;)o=c.N,a.push(c),je(c),c=o;a.push(c),Be(c);var f,s=a.length;for(f=1;s>f;++f)c=a[f],l=a[f-1],nr(c.edge,l.site,c.site,i);l=a[0],c=a[s-1],c.edge=Ke(l.site,c.site,null,i),$e(l),$e(c)}function He(n){for(var t,e,r,i,u=n.x,o=n.y,a=ol._;a;)if(r=Oe(a,o)-u,r>Uo)a=a.L;else{if(i=u-Ie(a,o),!(i>Uo)){r>-Uo?(t=a.P,e=a):i>-Uo?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var l=Ue(n);if(ol.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),ol.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,f=c.x,s=c.y,h=n.x-f,p=n.y-s,g=e.site,v=g.x-f,d=g.y-s,y=2*(h*d-p*v),m=h*h+p*p,M=v*v+d*d,x={x:(d*m-p*M)/y+f,y:(h*M-v*m)/y+s};nr(e.edge,c,g,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,g,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,i=e.y,u=i-t;if(!u)return r;var o=n.P;if(!o)return-(1/0);e=o.site;var a=e.x,l=e.y,c=l-t;if(!c)return a;var f=a-r,s=1/u-1/c,h=f/c;return s?(-h+Math.sqrt(h*h-2*s*(f*f/(-2*c)-l+c/2+i-u/2)))/s+r:(r+a)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,i,u,o,a,l,c,f,s=n[0][0],h=n[1][0],p=n[0][1],g=n[1][1],v=ul,d=v.length;d--;)if(u=v[d],u&&u.prepare())for(a=u.edges,l=a.length,o=0;l>o;)f=a[o].end(),r=f.x,i=f.y,c=a[++o%l].start(),t=c.x,e=c.y,(xo(r-t)>Uo||xo(i-e)>Uo)&&(a.splice(o,0,new tr(Qe(u.site,f,xo(r-s)<Uo&&g-i>Uo?{x:s,y:xo(t-s)<Uo?e:g}:xo(i-g)<Uo&&h-r>Uo?{x:xo(e-g)<Uo?t:h,y:g}:xo(r-h)<Uo&&i-p>Uo?{x:h,y:xo(t-h)<Uo?e:p}:xo(i-p)<Uo&&r-s>Uo?{x:xo(e-p)<Uo?t:s,y:p}:null),u.site,null)),++l)}function Ve(n,t){return t.angle-n.angle}function Xe(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,i=n.site,u=e.site;if(r!==u){var o=i.x,a=i.y,l=r.x-o,c=r.y-a,f=u.x-o,s=u.y-a,h=2*(l*s-c*f);if(!(h>=-jo)){var p=l*l+c*c,g=f*f+s*s,v=(s*p-c*g)/h,d=(l*g-f*p)/h,s=d+a,y=fl.pop()||new Xe;y.arc=n,y.site=i,y.x=v+o,y.y=s+Math.sqrt(v*v+d*d),y.cy=s,n.circle=y;for(var m=null,M=ll._;M;)if(y.y<M.y||y.y===M.y&&y.x<=M.x){if(!M.L){m=M.P;break}M=M.L}else{if(!M.R){m=M;break}M=M.R}ll.insert(m,y),m||(al=y)}}}}function Be(n){var t=n.circle;t&&(t.P||(al=t.N),ll.remove(t),fl.push(t),rr(t),n.circle=null)}function We(n){for(var t,e=il,r=Yt(n[0][0],n[0][1],n[1][0],n[1][1]),i=e.length;i--;)t=e[i],(!Je(t,n)||!r(t)||xo(t.a.x-t.b.x)<Uo&&xo(t.a.y-t.b.y)<Uo)&&(t.a=t.b=null,e.splice(i,1))}function Je(n,t){var e=n.b;if(e)return!0;var r,i,u=n.a,o=t[0][0],a=t[1][0],l=t[0][1],c=t[1][1],f=n.l,s=n.r,h=f.x,p=f.y,g=s.x,v=s.y,d=(h+g)/2,y=(p+v)/2;if(v===p){if(o>d||d>=a)return;if(h>g){if(u){if(u.y>=c)return}else u={x:d,y:l};e={x:d,y:c}}else{if(u){if(u.y<l)return}else u={x:d,y:c};e={x:d,y:l}}}else if(r=(h-g)/(v-p),i=y-r*d,-1>r||r>1)if(h>g){if(u){if(u.y>=c)return}else u={x:(l-i)/r,y:l};e={x:(c-i)/r,y:c}}else{if(u){if(u.y<l)return}else u={x:(c-i)/r,y:c};e={x:(l-i)/r,y:l}}else if(v>p){if(u){if(u.x>=a)return}else u={x:o,y:r*o+i};e={x:a,y:r*a+i}}else{if(u){if(u.x<o)return}else u={x:a,y:r*a+i};e={x:o,y:r*o+i}}return n.a=u,n.b=e,!0}function Ge(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ke(n,t,e,r){var i=new Ge(n,t);return il.push(i),e&&nr(i,n,t,e),r&&nr(i,t,n,r),ul[n.i].edges.push(new tr(i,n,t)),ul[t.i].edges.push(new tr(i,t,n)),i}function Qe(n,t,e){var r=new Ge(n,null);return r.a=t,r.b=e,il.push(r),r}function nr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function tr(n,t,e){var r=n.a,i=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function er(){this._=null}function rr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ir(n,t){var e=t,r=t.R,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ur(n,t){var e=t,r=t.L,i=e.U;i?i.L===e?i.L=r:i.R=r:n._=r,r.U=i,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function or(n){for(;n.L;)n=n.L;return n}function ar(n,t){var e,r,i,u=n.sort(lr).pop();for(il=[],ul=new Array(n.length),ol=new er,ll=new er;;)if(i=al,u&&(!i||u.y<i.y||u.y===i.y&&u.x<i.x))u.x===e&&u.y===r||(ul[u.i]=new Ye(u),He(u),e=u.x,r=u.y),u=n.pop();else{if(!i)break;Fe(i.arc)}t&&(We(t),Ze(t));var o={cells:ul,edges:il};return ol=ll=il=ul=null,o}function lr(n,t){return t.y-n.y||t.x-n.x}function cr(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function fr(n){return n.x}function sr(n){return n.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pr(n,t,e,r,i,u){if(!n(t,e,r,i,u)){var o=.5*(e+i),a=.5*(r+u),l=t.nodes;l[0]&&pr(n,l[0],e,r,o,a),l[1]&&pr(n,l[1],o,r,i,a),l[2]&&pr(n,l[2],e,a,o,u),l[3]&&pr(n,l[3],o,a,i,u)}}function gr(n,t,e,r,i,u,o){var a,l=1/0;return function c(n,f,s,h,p){if(!(f>u||s>o||r>h||i>p)){if(g=n.point){var g,v=t-n.x,d=e-n.y,y=v*v+d*d;if(l>y){var m=Math.sqrt(l=y);r=t-m,i=e-m,u=t+m,o=e+m,a=g}}for(var M=n.nodes,x=.5*(f+h),b=.5*(s+p),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,f,s,x,b);break;case 1:c(n,x,s,h,b);break;case 2:c(n,f,b,x,p);break;case 3:c(n,x,b,h,p)}}}(n,r,i,u,o),a}function vr(n,t){n=ao.rgb(n),t=ao.rgb(t);var e=n.r,r=n.g,i=n.b,u=t.r-e,o=t.g-r,a=t.b-i;return function(n){return"#"+bn(Math.round(e+u*n))+bn(Math.round(r+o*n))+bn(Math.round(i+a*n))}}function dr(n,t){var e,r={},i={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):i[e]=n[e];for(e in t)e in n||(i[e]=t[e]);return function(n){for(e in r)i[e]=r[e](n);return i}}function yr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mr(n,t){var e,r,i,u=hl.lastIndex=pl.lastIndex=0,o=-1,a=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=pl.exec(t));)(i=r.index)>u&&(i=t.slice(u,i),a[o]?a[o]+=i:a[++o]=i),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,l.push({i:o,x:yr(e,r)})),u=pl.lastIndex;return u<t.length&&(i=t.slice(u),a[o]?a[o]+=i:a[++o]=i),a.length<2?l[0]?(t=l[0].x,function(n){return t(n)+""}):function(){return t}:(t=l.length,function(n){for(var e,r=0;t>r;++r)a[(e=l[r]).i]=e.x(n);return a.join("")})}function Mr(n,t){for(var e,r=ao.interpolators.length;--r>=0&&!(e=ao.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],i=[],u=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(Mr(n[e],t[e]));for(;u>e;++e)i[e]=n[e];for(;o>e;++e)i[e]=t[e];return function(n){for(e=0;a>e;++e)i[e]=r[e](n);return i}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Io)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ho*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ho/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=ao.hcl(n),t=ao.hcl(t);var e=n.h,r=n.c,i=n.l,u=t.h-e,o=t.c-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return sn(e+u*n,r+o*n,i+a*n)+""}}function Dr(n,t){n=ao.hsl(n),t=ao.hsl(t);var e=n.h,r=n.s,i=n.l,u=t.h-e,o=t.s-r,a=t.l-i;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(u)?(u=0,e=isNaN(e)?t.h:e):u>180?u-=360:-180>u&&(u+=360),function(n){return cn(e+u*n,r+o*n,i+a*n)+""}}function Pr(n,t){n=ao.lab(n),t=ao.lab(t);var e=n.l,r=n.a,i=n.b,u=t.l-e,o=t.a-r,a=t.b-i;return function(n){return pn(e+u*n,r+o*n,i+a*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),i=Fr(t,e),u=Hr(Or(e,t,-i))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Zo,this.translate=[n.e,n.f],this.scale=[r,u],this.skew=u?Math.atan2(i,u)*Zo:0}function Fr(n,t){return n[0]*t[0]+n[1]*t[1]}function Hr(n){var t=Math.sqrt(Fr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Or(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ir(n){return n.length?n.pop()+",":""}function Yr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push("translate(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}function Zr(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:yr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:yr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var i=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:i-4,x:yr(n[0],t[0])},{i:i-2,x:yr(n[1],t[1])})}else 1===t[0]&&1===t[1]||e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=ao.transform(n),t=ao.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,i=-1,u=r.length;++i<u;)e[(t=r[i]).i]=t.x(n);return e.join("")}}function Br(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Wr(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),i=[t];t!==r;)t=t.parent,i.push(t);for(var u=i.length;e!==r;)i.splice(u,0,e),e=e.parent;return i}function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),i=e.pop(),u=r.pop(),o=null;i===u;)o=i,i=e.pop(),u=r.pop();return o}function Qr(n){n.fixed|=2}function ni(n){n.fixed&=-7}function ti(n){n.fixed|=4,n.px=n.x,n.py=n.y}function ei(n){n.fixed&=-5}function ri(n,t,e){var r=0,i=0;if(n.charge=0,!n.leaf)for(var u,o=n.nodes,a=o.length,l=-1;++l<a;)u=o[l],null!=u&&(ri(u,t,e),n.charge+=u.charge,r+=u.charge*u.cx,i+=u.charge*u.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var c=t*e[n.point.index];n.charge+=n.pointCharge=c,r+=c*n.point.x,i+=c*n.point.y}n.cx=r/n.charge,n.cy=i/n.charge}function ii(n,t){return ao.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=fi,n}function ui(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(i=n.children)&&(r=i.length))for(var r,i;--r>=0;)e.push(i[r])}function oi(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(u=n.children)&&(i=u.length))for(var i,u,o=-1;++o<i;)e.push(u[o]);for(;null!=(n=r.pop());)t(n)}function ai(n){return n.children}function li(n){return n.value}function ci(n,t){return t.value-n.value}function fi(n){return ao.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function si(n){return n.x}function hi(n){return n.y}function pi(n,t,e){n.y0=t,n.y=e}function gi(n){return ao.range(n.length)}function vi(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function di(n){for(var t,e=1,r=0,i=n[0][1],u=n.length;u>e;++e)(t=n[e][1])>i&&(r=e,i=t);return r}function yi(n){return n.reduce(mi,0)}function mi(n,t){return n+t[1]}function Mi(n,t){return xi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xi(n,t){for(var e=-1,r=+n[0],i=(n[1]-r)/t,u=[];++e<=t;)u[e]=i*e+r;return u}function bi(n){return[ao.min(n),ao.max(n)]}function _i(n,t){return n.value-t.value}function wi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Si(n,t){n._pack_next=t,t._pack_prev=n}function ki(n,t){var e=t.x-n.x,r=t.y-n.y,i=n.r+t.r;return.999*i*i>e*e+r*r}function Ni(n){function t(n){f=Math.min(n.x-n.r,f),s=Math.max(n.x+n.r,s),h=Math.min(n.y-n.r,h),p=Math.max(n.y+n.r,p)}if((e=n.children)&&(c=e.length)){var e,r,i,u,o,a,l,c,f=1/0,s=-(1/0),h=1/0,p=-(1/0);if(e.forEach(Ei),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(i=e[1],i.x=i.r,i.y=0,t(i),c>2))for(u=e[2],zi(r,i,u),t(u),wi(r,u),r._pack_prev=u,wi(u,i),i=r._pack_next,o=3;c>o;o++){zi(r,i,u=e[o]);var g=0,v=1,d=1;for(a=i._pack_next;a!==i;a=a._pack_next,v++)if(ki(a,u)){g=1;break}if(1==g)for(l=r._pack_prev;l!==a._pack_prev&&!ki(l,u);l=l._pack_prev,d++);g?(d>v||v==d&&i.r<r.r?Si(r,i=a):Si(r=l,i),o--):(wi(r,u),i=u,t(u))}var y=(f+s)/2,m=(h+p)/2,M=0;for(o=0;c>o;o++)u=e[o],u.x-=y,u.y-=m,M=Math.max(M,u.r+Math.sqrt(u.x*u.x+u.y*u.y));n.r=M,e.forEach(Ai)}}function Ei(n){n._pack_next=n._pack_prev=n}function Ai(n){delete n._pack_next,delete n._pack_prev}function Ci(n,t,e,r){var i=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,i)for(var u=-1,o=i.length;++u<o;)Ci(i[u],t,e,r)}function zi(n,t,e){var r=n.r+e.r,i=t.x-n.x,u=t.y-n.y;if(r&&(i||u)){var o=t.r+e.r,a=i*i+u*u;o*=o,r*=r;var l=.5+(r-o)/(2*a),c=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+l*i+c*u,e.y=n.y+l*u-c*i}else e.x=n.x+r,e.y=n.y}function Li(n,t){return n.parent==t.parent?1:2}function qi(n){var t=n.children;return t.length?t[0]:n.t}function Ti(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ri(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Di(n){for(var t,e=0,r=0,i=n.children,u=i.length;--u>=0;)t=i[u],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pi(n,t,e){return n.a.parent===t.parent?n.a:e}function Ui(n){return 1+ao.max(n,function(n){return n.y})}function ji(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fi(n){var t=n.children;return t&&t.length?Fi(t[0]):n}function Hi(n){var t,e=n.children;return e&&(t=e.length)?Hi(e[t-1]):n}function Oi(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Ii(n,t){var e=n.x+t[3],r=n.y+t[0],i=n.dx-t[1]-t[3],u=n.dy-t[0]-t[2];return 0>i&&(e+=i/2,i=0),0>u&&(r+=u/2,u=0),{x:e,y:r,dx:i,dy:u}}function Yi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zi(n){return n.rangeExtent?n.rangeExtent():Yi(n.range())}function Vi(n,t,e,r){var i=e(n[0],n[1]),u=r(t[0],t[1]);return function(n){return u(i(n))}}function Xi(n,t){var e,r=0,i=n.length-1,u=n[r],o=n[i];return u>o&&(e=r,r=i,i=e,e=u,u=o,o=e),n[r]=t.floor(u),n[i]=t.ceil(o),n}function $i(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bi(n,t,e,r){var i=[],u=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)i.push(e(n[o-1],n[o])),u.push(r(t[o-1],t[o]));return function(t){var e=ao.bisect(n,t,1,a)-1;return u[e](i[e](t))}}function Wi(n,t,e,r){function i(){var i=Math.min(n.length,t.length)>2?Bi:Vi,l=r?Wr:Br;return o=i(n,t,l,e),a=i(t,n,l,Mr),u}function u(n){return o(n)}var o,a;return u.invert=function(n){return a(n)},u.domain=function(t){return arguments.length?(n=t.map(Number),i()):n},u.range=function(n){return arguments.length?(t=n,i()):t},u.rangeRound=function(n){return u.range(n).interpolate(Ur)},u.clamp=function(n){return arguments.length?(r=n,i()):r},u.interpolate=function(n){return arguments.length?(e=n,i()):e},u.ticks=function(t){return Qi(n,t)},u.tickFormat=function(t,e){return nu(n,t,e)},u.nice=function(t){return Gi(n,t),i()},u.copy=function(){return Wi(n,t,e,r)},i()}function Ji(n,t){return ao.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gi(n,t){return Xi(n,$i(Ki(n,t)[2])),Xi(n,$i(Ki(n,t)[2])),n}function Ki(n,t){null==t&&(t=10);var e=Yi(n),r=e[1]-e[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),u=t/r*i;return.15>=u?i*=10:.35>=u?i*=5:.75>=u&&(i*=2),e[0]=Math.ceil(e[0]/i)*i,e[1]=Math.floor(e[1]/i)*i+.5*i,e[2]=i,e}function Qi(n,t){return ao.range.apply(ao,Ki(n,t))}function nu(n,t,e){var r=Ki(n,t);if(e){var i=ha.exec(e);if(i.shift(),"s"===i[8]){var u=ao.formatPrefix(Math.max(xo(r[0]),xo(r[1])));return i[7]||(i[7]="."+tu(u.scale(r[2]))),i[8]="f",e=ao.format(i.join("")),function(n){return e(u.scale(n))+u.symbol}}i[7]||(i[7]="."+eu(i[8],r)),e=i.join("")}else e=",."+tu(r[2])+"f";return ao.format(e)}function tu(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function eu(n,t){var e=tu(t[2]);return n in kl?Math.abs(e-tu(Math.max(xo(t[0]),xo(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ru(n,t,e,r){function i(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function u(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(i(t))}return o.invert=function(t){return u(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(i)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(i)),o):t},o.nice=function(){var t=Xi(r.map(i),e?Math:El);return n.domain(t),r=t.map(u),o},o.ticks=function(){var n=Yi(r),o=[],a=n[0],l=n[1],c=Math.floor(i(a)),f=Math.ceil(i(l)),s=t%1?2:t;if(isFinite(f-c)){if(e){for(;f>c;c++)for(var h=1;s>h;h++)o.push(u(c)*h);o.push(u(c))}else for(o.push(u(c));c++<f;)for(var h=s-1;h>0;h--)o.push(u(c)*h);for(c=0;o[c]<a;c++);for(f=o.length;o[f-1]>l;f--);o=o.slice(c,f)}return o},o.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=ao.format(e));var r=Math.max(1,t*n/o.ticks().length);return function(n){var o=n/u(Math.round(i(n)));return t-.5>o*t&&(o*=t),r>=o?e(n):""}},o.copy=function(){return ru(n.copy(),t,e,r)},Ji(o,n)}function iu(n,t,e){function r(t){return n(i(t))}var i=uu(t),u=uu(1/t);return r.invert=function(t){return u(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(i)),r):e},r.ticks=function(n){return Qi(e,n)},r.tickFormat=function(n,t){return nu(e,n,t)},r.nice=function(n){return r.domain(Gi(e,n))},r.exponent=function(o){return arguments.length?(i=uu(t=o),u=uu(1/t),n.domain(e.map(i)),r):t},r.copy=function(){return iu(n.copy(),t,e)},Ji(r,n)}function uu(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ou(n,t){function e(e){return u[((i.get(e)||("range"===t.t?i.set(e,n.push(e)):NaN))-1)%u.length]}function r(t,e){return ao.range(n.length).map(function(n){return t+e*n})}var i,u,o;return e.domain=function(r){if(!arguments.length)return n;n=[],i=new c;for(var u,o=-1,a=r.length;++o<a;)i.has(u=r[o])||i.set(u,n.push(u));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(u=n,o=0,t={t:"range",a:arguments},e):u},e.rangePoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=(l+c)/2,0):(c-l)/(n.length-1+a);return u=r(l+f*a/2,f),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(i,a){arguments.length<2&&(a=0);var l=i[0],c=i[1],f=n.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(n.length-1+a)|0;return u=r(l+Math.round(f*a/2+(c-l-(n.length-1+a)*f)/2),f),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=(s-f)/(n.length-a+2*l);return u=r(f+h*l,h),c&&u.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(i,a,l){arguments.length<2&&(a=0),arguments.length<3&&(l=a);var c=i[1]<i[0],f=i[c-0],s=i[1-c],h=Math.floor((s-f)/(n.length-a+2*l));return u=r(f+Math.round((s-f-(n.length-a)*h)/2),h),c&&u.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Yi(t.a[0])},e.copy=function(){return ou(n,t)},e.domain(n)}function au(n,t){function u(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ao.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ao.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(i).sort(e),u()):n},o.range=function(n){return arguments.length?(t=n,u()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[NaN,NaN]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return au(n,t)},u()}function lu(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(u*(t-n))))]}function i(){return u=e.length/(t-n),o=e.length-1,r}var u,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],i()):[n,t]},r.range=function(n){return arguments.length?(e=n,i()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?NaN:t/u+n,[t,t+1/u]},r.copy=function(){return lu(n,t,e)},i()}function cu(n,t){function e(e){return e>=e?t[ao.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return cu(n,t)},e}function fu(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qi(n,t)},t.tickFormat=function(t,e){return nu(n,t,e)},t.copy=function(){return fu(n)},t}function su(){return 0}function hu(n){return n.innerRadius}function pu(n){return n.outerRadius}function gu(n){return n.startAngle}function vu(n){return n.endAngle}function du(n){return n&&n.padAngle}function yu(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function mu(n,t,e,r,i){var u=n[0]-t[0],o=n[1]-t[1],a=(i?r:-r)/Math.sqrt(u*u+o*o),l=a*o,c=-a*u,f=n[0]+l,s=n[1]+c,h=t[0]+l,p=t[1]+c,g=(f+h)/2,v=(s+p)/2,d=h-f,y=p-s,m=d*d+y*y,M=e-r,x=f*p-h*s,b=(0>y?-1:1)*Math.sqrt(Math.max(0,M*M*m-x*x)),_=(x*y-d*b)/m,w=(-x*d-y*b)/m,S=(x*y+d*b)/m,k=(-x*d+y*b)/m,N=_-g,E=w-v,A=S-g,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mu(n){function t(t){function o(){c.push("M",u(n(f),a))}for(var l,c=[],f=[],s=-1,h=t.length,p=En(e),g=En(r);++s<h;)i.call(this,l=t[s],s)?f.push([+p.call(this,l,s),+g.call(this,l,s)]):f.length&&(o(),f=[]);return f.length&&o(),c.length?c.join(""):null}var e=Ce,r=ze,i=zt,u=xu,o=u.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(i=n,t):i},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?u=n:(u=Tl.get(n)||xu).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function xu(n){return n.length>1?n.join("L"):n+"Z"}function bu(n){return n.join("L")+"Z"}function _u(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&i.push("H",r[0]),i.join("")}function wu(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("V",(r=n[t])[1],"H",r[0]);return i.join("")}function Su(n){for(var t=0,e=n.length,r=n[0],i=[r[0],",",r[1]];++t<e;)i.push("H",(r=n[t])[0],"V",r[1]);return i.join("")}function ku(n,t){return n.length<4?xu(n):n[1]+Au(n.slice(1,-1),Cu(n,t))}function Nu(n,t){return n.length<3?bu(n):n[0]+Au((n.push(n[0]),n),Cu([n[n.length-2]].concat(n,[n[1]]),t))}function Eu(n,t){return n.length<3?xu(n):n[0]+Au(n,Cu(n,t))}function Au(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return xu(n);var e=n.length!=t.length,r="",i=n[0],u=n[1],o=t[0],a=o,l=1;if(e&&(r+="Q"+(u[0]-2*o[0]/3)+","+(u[1]-2*o[1]/3)+","+u[0]+","+u[1],i=n[1],l=2),t.length>1){a=t[1],u=n[l],l++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1];for(var c=2;c<t.length;c++,l++)u=n[l],a=t[c],r+="S"+(u[0]-a[0])+","+(u[1]-a[1])+","+u[0]+","+u[1]}if(e){var f=n[l];r+="Q"+(u[0]+2*a[0]/3)+","+(u[1]+2*a[1]/3)+","+f[0]+","+f[1]}return r}function Cu(n,t){for(var e,r=[],i=(1-t)/2,u=n[0],o=n[1],a=1,l=n.length;++a<l;)e=u,u=o,o=n[a],r.push([i*(o[0]-e[0]),i*(o[1]-e[1])]);return r}function zu(n){if(n.length<3)return xu(n);var t=1,e=n.length,r=n[0],i=r[0],u=r[1],o=[i,i,i,(r=n[1])[0]],a=[u,u,u,r[1]],l=[i,",",u,"L",Ru(Pl,o),",",Ru(Pl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Du(l,o,a);return n.pop(),l.push("L",r),l.join("")}function Lu(n){if(n.length<4)return xu(n);for(var t,e=[],r=-1,i=n.length,u=[0],o=[0];++r<3;)t=n[r],u.push(t[0]),o.push(t[1]);for(e.push(Ru(Pl,u)+","+Ru(Pl,o)),--r;++r<i;)t=n[r],u.shift(),u.push(t[0]),o.shift(),o.push(t[1]),Du(e,u,o);return e.join("")}function qu(n){for(var t,e,r=-1,i=n.length,u=i+4,o=[],a=[];++r<4;)e=n[r%i],o.push(e[0]),a.push(e[1]);for(t=[Ru(Pl,o),",",Ru(Pl,a)],--r;++r<u;)e=n[r%i],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Du(t,o,a);return t.join("")}function Tu(n,t){var e=n.length-1;if(e)for(var r,i,u=n[0][0],o=n[0][1],a=n[e][0]-u,l=n[e][1]-o,c=-1;++c<=e;)r=n[c],i=c/e,r[0]=t*r[0]+(1-t)*(u+i*a),r[1]=t*r[1]+(1-t)*(o+i*l);return zu(n)}function Ru(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Du(n,t,e){n.push("C",Ru(Rl,t),",",Ru(Rl,e),",",Ru(Dl,t),",",Ru(Dl,e),",",Ru(Pl,t),",",Ru(Pl,e))}function Pu(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Uu(n){for(var t=0,e=n.length-1,r=[],i=n[0],u=n[1],o=r[0]=Pu(i,u);++t<e;)r[t]=(o+(o=Pu(i=u,u=n[t+1])))/2;return r[t]=o,r}function ju(n){for(var t,e,r,i,u=[],o=Uu(n),a=-1,l=n.length-1;++a<l;)t=Pu(n[a],n[a+1]),xo(t)<Uo?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,i=e*e+r*r,i>9&&(i=3*t/Math.sqrt(i),o[a]=i*e,o[a+1]=i*r));for(a=-1;++a<=l;)i=(n[Math.min(l,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),u.push([i||0,o[a]*i||0]);return u}function Fu(n){return n.length<3?xu(n):n[0]+Au(n,ju(n))}function Hu(n){for(var t,e,r,i=-1,u=n.length;++i<u;)t=n[i],e=t[0],r=t[1]-Io,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Ou(n){function t(t){function l(){v.push("M",a(n(y),s),f,c(n(d.reverse()),s),"Z")}for(var h,p,g,v=[],d=[],y=[],m=-1,M=t.length,x=En(e),b=En(i),_=e===r?function(){
3
+ return p}:En(r),w=i===u?function(){return g}:En(u);++m<M;)o.call(this,h=t[m],m)?(d.push([p=+x.call(this,h,m),g=+b.call(this,h,m)]),y.push([+_.call(this,h,m),+w.call(this,h,m)])):d.length&&(l(),d=[],y=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,i=0,u=ze,o=zt,a=xu,l=a.key,c=a,f="L",s=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(i=u=n,t):u},t.y0=function(n){return arguments.length?(i=n,t):i},t.y1=function(n){return arguments.length?(u=n,t):u},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?a=n:(a=Tl.get(n)||xu).key,c=a.reverse||a,f=a.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(s=n,t):s},t}function Iu(n){return n.radius}function Yu(n){return[n.x,n.y]}function Zu(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Io;return[e*Math.cos(r),e*Math.sin(r)]}}function Vu(){return 64}function Xu(){return"circle"}function $u(n){var t=Math.sqrt(n/Fo);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bu(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wu(n,t,e){return ko(n,Yl),n.namespace=t,n.id=e,n}function Ju(n,t,e,r){var i=n.id,u=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[u][i].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[u][i].tween.set(t,e)}))}function Gu(n){return null==n&&(n=""),function(){this.textContent=n}}function Ku(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qu(n,t,e,r,i){function u(n){var t=v.delay;return f.t=t+l,n>=t?o(n-t):void(f.c=o)}function o(e){var i=g.active,u=g[i];u&&(u.timer.c=null,u.timer.t=NaN,--g.count,delete g[i],u.event&&u.event.interrupt.call(n,n.__data__,u.index));for(var o in g)if(r>+o){var c=g[o];c.timer.c=null,c.timer.t=NaN,--g.count,delete g[o]}f.c=a,qn(function(){return f.c&&a(e||1)&&(f.c=null,f.t=NaN),1},0,l),g.active=r,v.event&&v.event.start.call(n,n.__data__,t),p=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&p.push(r)}),h=v.ease,s=v.duration}function a(i){for(var u=i/s,o=h(u),a=p.length;a>0;)p[--a].call(n,o);return u>=1?(v.event&&v.event.end.call(n,n.__data__,t),--g.count?delete g[r]:delete n[e],1):void 0}var l,f,s,h,p,g=n[e]||(n[e]={active:0,count:0}),v=g[r];v||(l=i.time,f=qn(u,0,l),v=g[r]={tween:new c,time:l,timer:f,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++g.count)}function no(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function to(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function eo(n){return n.toISOString()}function ro(n,t,e){function r(t){return n(t)}function i(n,e){var r=n[1]-n[0],i=r/e,u=ao.bisect(Kl,i);return u==Kl.length?[t.year,Ki(n.map(function(n){return n/31536e6}),e)[2]]:u?t[i/Kl[u-1]<Kl[u]/i?u-1:u]:[tc,Ki(n,e)[2]]}return r.invert=function(t){return io(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(io)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,io(+e+1),t).length}var u=r.domain(),o=Yi(u),a=null==n?i(o,10):"number"==typeof n&&i(o,n);return a&&(n=a[0],t=a[1]),r.domain(Xi(u,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=io(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=io(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yi(r.domain()),u=null==n?i(e,10):"number"==typeof n?i(e,n):!n.range&&[{range:n},t];return u&&(n=u[0],t=u[1]),n.range(e[0],io(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ro(n.copy(),t,e)},Ji(r,n)}function io(n){return new Date(n)}function uo(n){return JSON.parse(n.responseText)}function oo(n){var t=fo.createRange();return t.selectNode(fo.body),t.createContextualFragment(n.responseText)}var ao={version:"3.5.17"},lo=[].slice,co=function(n){return lo.call(n)},fo=this.document;if(fo)try{co(fo.documentElement.childNodes)[0].nodeType}catch(so){co=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),fo)try{fo.createElement("DIV").style.setProperty("opacity",0,"")}catch(ho){var po=this.Element.prototype,go=po.setAttribute,vo=po.setAttributeNS,yo=this.CSSStyleDeclaration.prototype,mo=yo.setProperty;po.setAttribute=function(n,t){go.call(this,n,t+"")},po.setAttributeNS=function(n,t,e){vo.call(this,n,t,e+"")},yo.setProperty=function(n,t,e){mo.call(this,n,t+"",e)}}ao.ascending=e,ao.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},ao.min=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&e>r&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&e>r&&(e=r)}return e},ao.max=function(n,t){var e,r,i=-1,u=n.length;if(1===arguments.length){for(;++i<u;)if(null!=(r=n[i])&&r>=r){e=r;break}for(;++i<u;)null!=(r=n[i])&&r>e&&(e=r)}else{for(;++i<u;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=r;break}for(;++i<u;)null!=(r=t.call(n,n[i],i))&&r>e&&(e=r)}return e},ao.extent=function(n,t){var e,r,i,u=-1,o=n.length;if(1===arguments.length){for(;++u<o;)if(null!=(r=n[u])&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=n[u])&&(e>r&&(e=r),r>i&&(i=r))}else{for(;++u<o;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=i=r;break}for(;++u<o;)null!=(r=t.call(n,n[u],u))&&(e>r&&(e=r),r>i&&(i=r))}return[e,i]},ao.sum=function(n,t){var e,r=0,u=n.length,o=-1;if(1===arguments.length)for(;++o<u;)i(e=+n[o])&&(r+=e);else for(;++o<u;)i(e=+t.call(n,n[o],o))&&(r+=e);return r},ao.mean=function(n,t){var e,u=0,o=n.length,a=-1,l=o;if(1===arguments.length)for(;++a<o;)i(e=r(n[a]))?u+=e:--l;else for(;++a<o;)i(e=r(t.call(n,n[a],a)))?u+=e:--l;return l?u/l:void 0},ao.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),i=+n[r-1],u=e-r;return u?i+u*(n[r]-i):i},ao.median=function(n,t){var u,o=[],a=n.length,l=-1;if(1===arguments.length)for(;++l<a;)i(u=r(n[l]))&&o.push(u);else for(;++l<a;)i(u=r(t.call(n,n[l],l)))&&o.push(u);return o.length?ao.quantile(o.sort(e),.5):void 0},ao.variance=function(n,t){var e,u,o=n.length,a=0,l=0,c=-1,f=0;if(1===arguments.length)for(;++c<o;)i(e=r(n[c]))&&(u=e-a,a+=u/++f,l+=u*(e-a));else for(;++c<o;)i(e=r(t.call(n,n[c],c)))&&(u=e-a,a+=u/++f,l+=u*(e-a));return f>1?l/(f-1):void 0},ao.deviation=function(){var n=ao.variance.apply(this,arguments);return n?Math.sqrt(n):n};var Mo=u(e);ao.bisectLeft=Mo.left,ao.bisect=ao.bisectRight=Mo.right,ao.bisector=function(n){return u(1===n.length?function(t,r){return e(n(t),r)}:n)},ao.shuffle=function(n,t,e){(u=arguments.length)<3&&(e=n.length,2>u&&(t=0));for(var r,i,u=e-t;u;)i=Math.random()*u--|0,r=n[u+t],n[u+t]=n[i+t],n[i+t]=r;return n},ao.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ao.pairs=function(n){for(var t,e=0,r=n.length-1,i=n[0],u=new Array(0>r?0:r);r>e;)u[e]=[t=i,i=n[++e]];return u},ao.transpose=function(n){if(!(i=n.length))return[];for(var t=-1,e=ao.min(n,o),r=new Array(e);++t<e;)for(var i,u=-1,a=r[t]=new Array(i);++u<i;)a[u]=n[u][t];return r},ao.zip=function(){return ao.transpose(arguments)},ao.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ao.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ao.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ao.merge=function(n){for(var t,e,r,i=n.length,u=-1,o=0;++u<i;)o+=n[u].length;for(e=new Array(o);--i>=0;)for(r=n[i],t=r.length;--t>=0;)e[--o]=r[t];return e};var xo=Math.abs;ao.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,i=[],u=a(xo(e)),o=-1;if(n*=u,t*=u,e*=u,0>e)for(;(r=n+e*++o)>t;)i.push(r/u);else for(;(r=n+e*++o)<t;)i.push(r/u);return i},ao.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,i=-1,u=n.length;if(1===arguments.length)for(;++i<u;)e.set(i,n[i]);else for(;++i<u;)e.set(t.call(n,r=n[i],i),r)}else for(var o in n)e.set(o,n[o]);return e};var bo="__proto__",_o="\x00";l(c,{has:h,get:function(n){return this._[f(n)]},set:function(n,t){return this._[f(n)]=t},remove:p,keys:g,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:s(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t),this._[t])}}),ao.nest=function(){function n(t,o,a){if(a>=u.length)return r?r.call(i,o):e?o.sort(e):o;for(var l,f,s,h,p=-1,g=o.length,v=u[a++],d=new c;++p<g;)(h=d.get(l=v(f=o[p])))?h.push(f):d.set(l,[f]);return t?(f=t(),s=function(e,r){f.set(e,n(t,r,a))}):(f={},s=function(e,r){f[e]=n(t,r,a)}),d.forEach(s),f}function t(n,e){if(e>=u.length)return n;var r=[],i=o[e++];return n.forEach(function(n,i){r.push({key:n,values:t(i,e)})}),i?r.sort(function(n,t){return i(n.key,t.key)}):r}var e,r,i={},u=[],o=[];return i.map=function(t,e){return n(e,t,0)},i.entries=function(e){return t(n(ao.map,e,0),0)},i.key=function(n){return u.push(n),i},i.sortKeys=function(n){return o[u.length-1]=n,i},i.sortValues=function(n){return e=n,i},i.rollup=function(n){return r=n,i},i},ao.set=function(n){var t=new y;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(y,{has:h,add:function(n){return this._[f(n+="")]=!0,n},remove:p,values:g,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,s(t))}}),ao.behavior={},ao.rebind=function(n,t){for(var e,r=1,i=arguments.length;++r<i;)n[e=arguments[r]]=M(n,t,t[e]);return n};var wo=["webkit","ms","moz","Moz","o","O"];ao.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ao.event=null,ao.requote=function(n){return n.replace(So,"\\$&")};var So=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},No=function(n,t){return t.querySelector(n)},Eo=function(n,t){return t.querySelectorAll(n)},Ao=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ao=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(No=function(n,t){return Sizzle(n,t)[0]||null},Eo=Sizzle,Ao=Sizzle.matchesSelector),ao.selection=function(){return ao.select(fo.documentElement)};var Co=ao.selection.prototype=[];Co.select=function(n){var t,e,r,i,u=[];n=A(n);for(var o=-1,a=this.length;++o<a;){u.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var l=-1,c=r.length;++l<c;)(i=r[l])?(t.push(e=n.call(i,i.__data__,l,o)),e&&"__data__"in i&&(e.__data__=i.__data__)):t.push(null)}return E(u)},Co.selectAll=function(n){var t,e,r=[];n=C(n);for(var i=-1,u=this.length;++i<u;)for(var o=this[i],a=-1,l=o.length;++a<l;)(e=o[a])&&(r.push(t=co(n.call(e,e.__data__,a,i))),t.parentNode=e);return E(r)};var zo="http://www.w3.org/1999/xhtml",Lo={svg:"http://www.w3.org/2000/svg",xhtml:zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ao.ns={prefix:Lo,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Lo.hasOwnProperty(e)?{space:Lo[e],local:n}:n}},Co.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ao.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Co.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,i=-1;if(t=e.classList){for(;++i<r;)if(!t.contains(n[i]))return!1}else for(t=e.getAttribute("class");++i<r;)if(!q(n[i]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Co.style=function(n,e,r){var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>i){var u=this.node();return t(u).getComputedStyle(u,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Co.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Co.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Co.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Co.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Co.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Co.remove=function(){return this.each(F)},Co.data=function(n,t){function e(n,e){var r,i,u,o=n.length,s=e.length,h=Math.min(o,s),p=new Array(s),g=new Array(s),v=new Array(o);if(t){var d,y=new c,m=new Array(o);for(r=-1;++r<o;)(i=n[r])&&(y.has(d=t.call(i,i.__data__,r))?v[r]=i:y.set(d,i),m[r]=d);for(r=-1;++r<s;)(i=y.get(d=t.call(e,u=e[r],r)))?i!==!0&&(p[r]=i,i.__data__=u):g[r]=H(u),y.set(d,!0);for(r=-1;++r<o;)r in m&&y.get(m[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)i=n[r],u=e[r],i?(i.__data__=u,p[r]=i):g[r]=H(u);for(;s>r;++r)g[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}g.update=p,g.parentNode=p.parentNode=v.parentNode=n.parentNode,a.push(g),l.push(p),f.push(v)}var r,i,u=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++u<o;)(i=r[u])&&(n[u]=i.__data__);return n}var a=Z([]),l=E([]),f=E([]);if("function"==typeof n)for(;++u<o;)e(r=this[u],n.call(r,r.parentNode.__data__,u));else for(;++u<o;)e(r=this[u],n);return l.enter=function(){return a},l.exit=function(){return f},l},Co.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Co.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]),t.parentNode=(e=this[u]).parentNode;for(var a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return E(i)},Co.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],i=r.length-1,u=r[i];--i>=0;)(e=r[i])&&(u&&u!==e.nextSibling&&u.parentNode.insertBefore(e,u),u=e);return this},Co.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Co.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Co.call=function(n){var t=co(arguments);return n.apply(t[0]=this,t),this},Co.empty=function(){return!this.node()},Co.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,i=e.length;i>r;r++){var u=e[r];if(u)return u}return null},Co.size=function(){var n=0;return Y(this,function(){++n}),n};var qo=[];ao.selection.enter=Z,ao.selection.enter.prototype=qo,qo.append=Co.append,qo.empty=Co.empty,qo.node=Co.node,qo.call=Co.call,qo.size=Co.size,qo.select=function(n){for(var t,e,r,i,u,o=[],a=-1,l=this.length;++a<l;){r=(i=this[a]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,f=i.length;++c<f;)(u=i[c])?(t.push(r[c]=e=n.call(i.parentNode,u.__data__,c,a)),e.__data__=u.__data__):t.push(null)}return E(o)},qo.insert=function(n,t){return arguments.length<2&&(t=V(this)),Co.insert.call(this,n,t)},ao.select=function(t){var e;return"string"==typeof t?(e=[No(t,fo)],e.parentNode=fo.documentElement):(e=[t],e.parentNode=n(t)),E([e])},ao.selectAll=function(n){var t;return"string"==typeof n?(t=co(Eo(n,fo)),t.parentNode=fo.documentElement):(t=co(n),t.parentNode=null),E([t])},Co.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var To=ao.map({mouseenter:"mouseover",mouseleave:"mouseout"});fo&&To.forEach(function(n){"on"+n in fo&&To.remove(n)});var Ro,Do=0;ao.mouse=function(n){return J(n,k())};var Po=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ao.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,i=0,u=t.length;u>i;++i)if((r=t[i]).identifier===e)return J(n,r)},ao.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",o)}function e(n,t,e,u,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],g|=n|e,M=r,p({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(y.on(u+d,null).on(o+d,null),m(g),p({type:"dragend"}))}var c,f=this,s=ao.event.target.correspondingElement||ao.event.target,h=f.parentNode,p=r.of(f,arguments),g=0,v=n(),d=".drag"+(null==v?"":"-"+v),y=ao.select(e(s)).on(u+d,a).on(o+d,l),m=W(s),M=t(h,v);i?(c=i.apply(f,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],p({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),i=null,u=e(b,ao.mouse,t,"mousemove","mouseup"),o=e(G,ao.touch,m,"touchmove","touchend");return n.origin=function(t){return arguments.length?(i=t,n):i},ao.rebind(n,r,"on")},ao.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?co(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Uo=1e-6,jo=Uo*Uo,Fo=Math.PI,Ho=2*Fo,Oo=Ho-Uo,Io=Fo/2,Yo=Fo/180,Zo=180/Fo,Vo=Math.SQRT2,Xo=2,$o=4;ao.interpolateZoom=function(n,t){var e,r,i=n[0],u=n[1],o=n[2],a=t[0],l=t[1],c=t[2],f=a-i,s=l-u,h=f*f+s*s;if(jo>h)r=Math.log(c/o)/Vo,e=function(n){return[i+n*f,u+n*s,o*Math.exp(Vo*n*r)]};else{var p=Math.sqrt(h),g=(c*c-o*o+$o*h)/(2*o*Xo*p),v=(c*c-o*o-$o*h)/(2*c*Xo*p),d=Math.log(Math.sqrt(g*g+1)-g),y=Math.log(Math.sqrt(v*v+1)-v);r=(y-d)/Vo,e=function(n){var t=n*r,e=rn(d),a=o/(Xo*p)*(e*un(Vo*t+d)-en(d));return[i+a*f,u+a*s,o*e/rn(Vo*t+d)]}}return e.duration=1e3*r,e},ao.behavior.zoom=function(){function n(n){n.on(L,s).on(Wo+".zoom",p).on("dblclick.zoom",g).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function i(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,o)),u(d=e,r),t=ao.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function f(n){--z||(n({type:"zoomend"}),d=null)}function s(){function n(){a=1,u(ao.mouse(i),h),c(o)}function r(){s.on(q,null).on(T,null),p(a),f(o)}var i=this,o=D.of(i,arguments),a=0,s=ao.select(t(i)).on(q,n).on(T,r),h=e(ao.mouse(i)),p=W(i);Il.call(i),l(o)}function h(){function n(){var n=ao.touches(g);return p=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ao.event.target;ao.select(t).on(x,r).on(b,a),_.push(t);for(var e=ao.event.changedTouches,i=0,u=e.length;u>i;++i)d[e[i].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var f=l[0];o(g,f,d[f.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var f=l[0],s=l[1],h=f[0]-s[0],p=f[1]-s[1];y=h*h+p*p}}function r(){var n,t,e,r,o=ao.touches(g);Il.call(g);for(var a=0,l=o.length;l>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var f=(f=e[0]-n[0])*f+(f=e[1]-n[1])*f,s=y&&Math.sqrt(f/y);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],i(s*p)}M=null,u(n,t),c(v)}function a(){if(ao.event.touches.length){for(var t=ao.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var i in d)return void n()}ao.selectAll(_).on(m,null),w.on(L,s).on(R,h),N(),f(v)}var p,g=this,v=D.of(g,arguments),d={},y=0,m=".zoom-"+ao.event.changedTouches[0].identifier,x="touchmove"+m,b="touchend"+m,_=[],w=ao.select(g),N=W(g);t(),l(v),w.on(L,null).on(R,t)}function p(){var n=D.of(this,arguments);m?clearTimeout(m):(Il.call(this),v=e(d=y||ao.mouse(this)),l(n)),m=setTimeout(function(){m=null,f(n)},50),S(),i(Math.pow(2,.002*Bo())*k.k),u(d,v),c(n)}function g(){var n=ao.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ao.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,y,m,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Jo,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Wo||(Wo="onwheel"in fo?(Bo=function(){return-ao.event.deltaY*(ao.event.deltaMode?120:1)},"wheel"):"onmousewheel"in fo?(Bo=function(){return ao.event.wheelDelta},"mousewheel"):(Bo=function(){return-ao.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?ao.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],i=d?d[0]:e/2,u=d?d[1]:r/2,o=ao.interpolateZoom([(i-k.x)/k.k,(u-k.y)/k.k,e/k.k],[(i-t.x)/t.k,(u-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:i-r[0]*a,y:u-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){f(n)}).each("end.zoom",function(){f(n)}):(this.__chart__=k,l(n),c(n),f(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},i(+t),a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Jo:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(y=t&&[+t[0],+t[1]],n):y},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ao.rebind(n,D,"on")};var Bo,Wo,Jo=[0,1/0];ao.color=an,an.prototype.toString=function(){return this.rgb()+""},ao.hsl=ln;var Go=ln.prototype=new an;Go.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Go.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Go.rgb=function(){return cn(this.h,this.s,this.l)},ao.hcl=fn;var Ko=fn.prototype=new an;Ko.brighter=function(n){return new fn(this.h,this.c,Math.min(100,this.l+Qo*(arguments.length?n:1)))},Ko.darker=function(n){return new fn(this.h,this.c,Math.max(0,this.l-Qo*(arguments.length?n:1)))},Ko.rgb=function(){return sn(this.h,this.c,this.l).rgb()},ao.lab=hn;var Qo=18,na=.95047,ta=1,ea=1.08883,ra=hn.prototype=new an;ra.brighter=function(n){return new hn(Math.min(100,this.l+Qo*(arguments.length?n:1)),this.a,this.b)},ra.darker=function(n){return new hn(Math.max(0,this.l-Qo*(arguments.length?n:1)),this.a,this.b)},ra.rgb=function(){return pn(this.l,this.a,this.b)},ao.rgb=mn;var ia=mn.prototype=new an;ia.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,i=30;return t||e||r?(t&&i>t&&(t=i),e&&i>e&&(e=i),r&&i>r&&(r=i),new mn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mn(i,i,i)},ia.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mn(n*this.r,n*this.g,n*this.b)},ia.hsl=function(){return wn(this.r,this.g,this.b)},ia.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ua=ao.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ua.forEach(function(n,t){ua.set(n,Mn(t))}),ao.functor=En,ao.xhr=An(m),ao.dsv=function(n,t){function e(n,e,u){arguments.length<3&&(u=e,e=null);var o=Cn(n,t,null==e?r:i(e),u);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:i(n)):e},o}function r(n){return e.parse(n.responseText)}function i(n){return function(t){return e.parse(t.responseText,n)}}function u(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var i=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(i(n),e)}:i})},e.parseRows=function(n,t){function e(){if(f>=c)return o;if(i)return i=!1,u;var t=f;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}f=e+2;var r=n.charCodeAt(e+1);return 13===r?(i=!0,10===n.charCodeAt(e+2)&&++f):10===r&&(i=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>f;){var r=n.charCodeAt(f++),a=1;if(10===r)i=!0;else if(13===r)i=!0,10===n.charCodeAt(f)&&(++f,++a);else if(r!==l)continue;return n.slice(t,f-a)}return n.slice(t)}for(var r,i,u={},o={},a=[],c=n.length,f=0,s=0;(r=e())!==o;){for(var h=[];r!==u&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,s++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new y,i=[];return t.forEach(function(n){for(var t in n)r.has(t)||i.push(r.add(t))}),[i.map(o).join(n)].concat(t.map(function(t){return i.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(u).join("\n")},e},ao.csv=ao.dsv(",","text/csv"),ao.tsv=ao.dsv(" ","text/tab-separated-values");var oa,aa,la,ca,fa=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ao.timer=function(){qn.apply(this,arguments)},ao.timer.flush=function(){Rn(),Dn()},ao.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var sa=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);ao.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=ao.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),sa[8+e/3]};var ha=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,pa=ao.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ao.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ga=ao.time={},va=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){da.setUTCDate.apply(this._,arguments)},setDay:function(){da.setUTCDay.apply(this._,arguments)},setFullYear:function(){da.setUTCFullYear.apply(this._,arguments)},setHours:function(){da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){da.setUTCSeconds.apply(this._,arguments)},setTime:function(){da.setTime.apply(this._,arguments)}};var da=Date.prototype;ga.year=On(function(n){return n=ga.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ga.years=ga.year.range,ga.years.utc=ga.year.utc.range,ga.day=On(function(n){var t=new va(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ga.days=ga.day.range,ga.days.utc=ga.day.utc.range,ga.dayOfYear=function(n){var t=ga.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ga[n]=On(function(n){return(n=ga.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ga[n+"s"]=e.range,ga[n+"s"].utc=e.utc.range,ga[n+"OfYear"]=function(n){var e=ga.year(n).getDay();return Math.floor((ga.dayOfYear(n)+(e+t)%7)/7)}}),ga.week=ga.sunday,ga.weeks=ga.sunday.range,ga.weeks.utc=ga.sunday.utc.range,ga.weekOfYear=ga.sundayOfYear;var ya={"-":"",_:" ",0:"0"},ma=/^\s*\d+/,Ma=/^%/;ao.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xa=ao.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
4
+ shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ao.format=xa.numberFormat,ao.geo={},ft.prototype={s:0,t:0,add:function(n){st(n,this.t,ba),st(ba.s,this.s,this),this.s?this.t+=ba.t:this.s=ba.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var ba=new ft;ao.geo.stream=function(n,t){n&&_a.hasOwnProperty(n.type)?_a[n.type](n,t):ht(n,t)};var _a={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,i=e.length;++r<i;)ht(e[r].geometry,t)}},wa={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){pt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)pt(e[r],t,0)},Polygon:function(n,t){gt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,i=e.length;++r<i;)gt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,i=e.length;++r<i;)ht(e[r],t)}};ao.geo.area=function(n){return Sa=0,ao.geo.stream(n,Na),Sa};var Sa,ka=new ft,Na={sphere:function(){Sa+=4*Fo},point:b,lineStart:b,lineEnd:b,polygonStart:function(){ka.reset(),Na.lineStart=vt},polygonEnd:function(){var n=2*ka;Sa+=0>n?4*Fo+n:n,Na.lineStart=Na.lineEnd=Na.point=b}};ao.geo.bounds=function(){function n(n,t){M.push(x=[f=n,h=n]),s>t&&(s=t),t>p&&(p=t)}function t(t,e){var r=dt([t*Yo,e*Yo]);if(y){var i=mt(y,r),u=[i[1],-i[0],0],o=mt(u,i);bt(o),o=_t(o);var l=t-g,c=l>0?1:-1,v=o[0]*Zo*c,d=xo(l)>180;if(d^(v>c*g&&c*t>v)){var m=o[1]*Zo;m>p&&(p=m)}else if(v=(v+360)%360-180,d^(v>c*g&&c*t>v)){var m=-o[1]*Zo;s>m&&(s=m)}else s>e&&(s=e),e>p&&(p=e);d?g>t?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t):h>=f?(f>t&&(f=t),t>h&&(h=t)):t>g?a(f,t)>a(f,h)&&(h=t):a(t,h)>a(f,h)&&(f=t)}else n(t,e);y=r,g=t}function e(){b.point=t}function r(){x[0]=f,x[1]=h,b.point=n,y=null}function i(n,e){if(y){var r=n-g;m+=xo(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Na.point(n,e),t(n,e)}function u(){Na.lineStart()}function o(){i(v,d),Na.lineEnd(),xo(m)>Uo&&(f=-(h=180)),x[0]=f,x[1]=h,y=null}function a(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var f,s,h,p,g,v,d,y,m,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=i,b.lineStart=u,b.lineEnd=o,m=0,Na.polygonStart()},polygonEnd:function(){Na.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>ka?(f=-(h=180),s=-(p=90)):m>Uo?p=90:-Uo>m&&(s=-90),x[0]=f,x[1]=h}};return function(n){p=h=-(f=s=1/0),M=[],ao.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,i=M[0],u=[i];t>r;++r)e=M[r],c(e[0],i)||c(e[1],i)?(a(i[0],e[1])>a(i[0],i[1])&&(i[1]=e[1]),a(e[0],i[1])>a(i[0],i[1])&&(i[0]=e[0])):u.push(i=e);for(var o,e,g=-(1/0),t=u.length-1,r=0,i=u[t];t>=r;i=e,++r)e=u[r],(o=a(i[1],e[0]))>g&&(g=o,f=e[0],h=i[1])}return M=x=null,f===1/0||s===1/0?[[NaN,NaN],[NaN,NaN]]:[[f,s],[h,p]]}}(),ao.geo.centroid=function(n){Ea=Aa=Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,ja);var t=Da,e=Pa,r=Ua,i=t*t+e*e+r*r;return jo>i&&(t=qa,e=Ta,r=Ra,Uo>Aa&&(t=Ca,e=za,r=La),i=t*t+e*e+r*r,jo>i)?[NaN,NaN]:[Math.atan2(e,t)*Zo,tn(r/Math.sqrt(i))*Zo]};var Ea,Aa,Ca,za,La,qa,Ta,Ra,Da,Pa,Ua,ja={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){ja.lineStart=At},polygonEnd:function(){ja.lineStart=Nt}},Fa=Rt(zt,jt,Ht,[-Fo,-Fo/2]),Ha=1e9;ao.geo.clipExtent=function(){var n,t,e,r,i,u,o={stream:function(n){return i&&(i.valid=!1),i=u(n),i.valid=!0,i},extent:function(a){return arguments.length?(u=Zt(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),i&&(i.valid=!1,i=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ao.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,ao.geo.albers=function(){return ao.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ao.geo.albersUsa=function(){function n(n){var u=n[0],o=n[1];return t=null,e(u,o),t||(r(u,o),t)||i(u,o),t}var t,e,r,i,u=ao.geo.albers(),o=ao.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ao.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=u.scale(),e=u.translate(),r=(n[0]-e[0])/t,i=(n[1]-e[1])/t;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?o:i>=.166&&.234>i&&r>=-.214&&-.115>r?a:u).invert(n)},n.stream=function(n){var t=u.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,i){t.point(n,i),e.point(n,i),r.point(n,i)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(u.precision(t),o.precision(t),a.precision(t),n):u.precision()},n.scale=function(t){return arguments.length?(u.scale(t),o.scale(.35*t),a.scale(t),n.translate(u.translate())):u.scale()},n.translate=function(t){if(!arguments.length)return u.translate();var c=u.scale(),f=+t[0],s=+t[1];return e=u.translate(t).clipExtent([[f-.455*c,s-.238*c],[f+.455*c,s+.238*c]]).stream(l).point,r=o.translate([f-.307*c,s+.201*c]).clipExtent([[f-.425*c+Uo,s+.12*c+Uo],[f-.214*c-Uo,s+.234*c-Uo]]).stream(l).point,i=a.translate([f-.205*c,s+.212*c]).clipExtent([[f-.214*c+Uo,s+.166*c+Uo],[f-.115*c-Uo,s+.234*c-Uo]]).stream(l).point,n},n.scale(1070)};var Oa,Ia,Ya,Za,Va,Xa,$a={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Ia=0,$a.lineStart=$t},polygonEnd:function(){$a.lineStart=$a.lineEnd=$a.point=b,Oa+=xo(Ia/2)}},Ba={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wa={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wa.lineStart=ne},polygonEnd:function(){Wa.point=Gt,Wa.lineStart=Kt,Wa.lineEnd=Qt}};ao.geo.path=function(){function n(n){return n&&("function"==typeof a&&u.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=i(u)),ao.geo.stream(n,o)),u.result()}function t(){return o=null,n}var e,r,i,u,o,a=4.5;return n.area=function(n){return Oa=0,ao.geo.stream(n,i($a)),Oa},n.centroid=function(n){return Ca=za=La=qa=Ta=Ra=Da=Pa=Ua=0,ao.geo.stream(n,i(Wa)),Ua?[Da/Ua,Pa/Ua]:Ra?[qa/Ra,Ta/Ra]:La?[Ca/La,za/La]:[NaN,NaN]},n.bounds=function(n){return Va=Xa=-(Ya=Za=1/0),ao.geo.stream(n,i(Ba)),[[Ya,Za],[Va,Xa]]},n.projection=function(n){return arguments.length?(i=(e=n)?n.stream||re(n):m,t()):e},n.context=function(n){return arguments.length?(u=null==(r=n)?new Wt:new te(n),"function"!=typeof a&&u.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(u.pointRadius(+t),+t),n):a},n.projection(ao.geo.albersUsa()).context(null)},ao.geo.transform=function(n){return{stream:function(t){var e=new ie(t);for(var r in n)e[r]=n[r];return e}}},ie.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ao.geo.projection=oe,ao.geo.projectionMutator=ae,(ao.geo.equirectangular=function(){return oe(ce)}).raw=ce.invert=ce,ao.geo.rotation=function(n){function t(t){return t=n(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t}return n=se(n[0]%360*Yo,n[1]*Yo,n.length>2?n[2]*Yo:0),t.invert=function(t){return t=n.invert(t[0]*Yo,t[1]*Yo),t[0]*=Zo,t[1]*=Zo,t},t},fe.invert=ce,ao.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=se(-n[0]*Yo,-n[1]*Yo,0).invert,i=[];return e(null,null,1,{point:function(n,e){i.push(n=t(n,e)),n[0]*=Zo,n[1]*=Zo}}),{type:"Polygon",coordinates:[i]}}var t,e,r=[0,0],i=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Yo,i*Yo),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Yo,(i=+r)*Yo),n):i},n.angle(90)},ao.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Yo,i=n[1]*Yo,u=t[1]*Yo,o=Math.sin(r),a=Math.cos(r),l=Math.sin(i),c=Math.cos(i),f=Math.sin(u),s=Math.cos(u);return Math.atan2(Math.sqrt((e=s*o)*e+(e=c*f-l*s*a)*e),l*f+c*s*a)},ao.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ao.range(Math.ceil(u/d)*d,i,d).map(h).concat(ao.range(Math.ceil(c/y)*y,l,y).map(p)).concat(ao.range(Math.ceil(r/g)*g,e,g).filter(function(n){return xo(n%d)>Uo}).map(f)).concat(ao.range(Math.ceil(a/v)*v,o,v).filter(function(n){return xo(n%y)>Uo}).map(s))}var e,r,i,u,o,a,l,c,f,s,h,p,g=10,v=g,d=90,y=360,m=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(p(l).slice(1),h(i).reverse().slice(1),p(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(u=+t[0][0],i=+t[1][0],c=+t[0][1],l=+t[1][1],u>i&&(t=u,u=i,i=t),c>l&&(t=c,c=l,l=t),n.precision(m)):[[u,c],[i,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(m)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],y=+t[1],n):[d,y]},n.minorStep=function(t){return arguments.length?(g=+t[0],v=+t[1],n):[g,v]},n.precision=function(t){return arguments.length?(m=+t,f=ye(a,o,90),s=me(r,e,m),h=ye(c,l,90),p=me(u,i,m),n):m},n.majorExtent([[-180,-90+Uo],[180,90-Uo]]).minorExtent([[-180,-80-Uo],[180,80+Uo]])},ao.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||i.apply(this,arguments)]}}var t,e,r=Me,i=xe;return n.distance=function(){return ao.geo.distance(t||r.apply(this,arguments),e||i.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(i=t,e="function"==typeof t?null:t,n):i},n.precision=function(){return arguments.length?n:0},n},ao.geo.interpolate=function(n,t){return be(n[0]*Yo,n[1]*Yo,t[0]*Yo,t[1]*Yo)},ao.geo.length=function(n){return Ja=0,ao.geo.stream(n,Ga),Ja};var Ja,Ga={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ka=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ao.geo.azimuthalEqualArea=function(){return oe(Ka)}).raw=Ka;var Qa=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},m);(ao.geo.azimuthalEquidistant=function(){return oe(Qa)}).raw=Qa,(ao.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(ao.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(ao.geo.gnomonic=function(){return oe(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Io]},(ao.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(ao.geo.orthographic=function(){return oe(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ao.geo.stereographic=function(){return oe(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Io]},(ao.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,ao.geom={},ao.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,i=En(e),u=En(r),o=n.length,a=[],l=[];for(t=0;o>t;t++)a.push([+i.call(this,n[t],t),+u.call(this,n[t],t),t]);for(a.sort(qe),t=0;o>t;t++)l.push([a[t][0],-a[t][1]]);var c=Le(a),f=Le(l),s=f[0]===c[0],h=f[f.length-1]===c[c.length-1],p=[];for(t=c.length-1;t>=0;--t)p.push(n[a[c[t]][2]]);for(t=+s;t<f.length-h;++t)p.push(n[a[f[t]][2]]);return p}var e=Ce,r=ze;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ao.geom.polygon=function(n){return ko(n,rl),n};var rl=ao.geom.polygon.prototype=[];rl.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],i=0;++t<e;)n=r,r=this[t],i+=n[1]*r[0]-n[0]*r[1];return.5*i},rl.centroid=function(n){var t,e,r=-1,i=this.length,u=0,o=0,a=this[i-1];for(arguments.length||(n=-1/(6*this.area()));++r<i;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],u+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[u*n,o*n]},rl.clip=function(n){for(var t,e,r,i,u,o,a=De(n),l=-1,c=this.length-De(this),f=this[c-1];++l<c;){for(t=n.slice(),n.length=0,i=this[l],u=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Te(o,f,i)?(Te(u,f,i)||n.push(Re(u,o,f,i)),n.push(o)):Te(u,f,i)&&n.push(Re(u,o,f,i)),u=o;a&&n.push(n[0]),f=i}return n};var il,ul,ol,al,ll,cl=[],fl=[];Ye.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Ve),t.length},tr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(n,t){var e,r,i;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=or(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(i=r.R,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.R&&(ir(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ur(this,r))):(i=r.L,i&&i.C?(e.C=i.C=!1,r.C=!0,n=r):(n===e.L&&(ur(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ir(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,i=n.U,u=n.L,o=n.R;if(e=u?o?or(o):u:o,i?i.L===n?i.L=e:i.R=e:this._=e,u&&o?(r=e.C,e.C=n.C,e.L=u,u.U=e,e!==o?(i=e.U,e.U=n.U,n=e.R,i.L=n,e.R=o,o.U=e):(e.U=i,i=e,n=e.R)):(r=n.C,n=e),n&&(n.U=i),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===i.L){if(t=i.R,t.C&&(t.C=!1,i.C=!0,ir(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ur(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,ir(this,i),n=this._;break}}else if(t=i.L,t.C&&(t.C=!1,i.C=!0,ur(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ur(this,i),n=this._;break}t.C=!0,n=i,i=i.U}while(!n.C);n&&(n.C=!1)}}},ao.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],i=a[0][1],u=a[1][0],o=a[1][1];return ar(e(n),a).cells.forEach(function(e,a){var l=e.edges,c=e.site,f=t[a]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=r&&c.x<=u&&c.y>=i&&c.y<=o?[[r,o],[u,o],[u,i],[r,i]]:[];f.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(u(n,t)/Uo)*Uo,y:Math.round(o(n,t)/Uo)*Uo,i:t}})}var r=Ce,i=ze,u=r,o=i,a=sl;return n?t(n):(t.links=function(n){return ar(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ar(e(n)).cells.forEach(function(e,r){for(var i,u,o=e.site,a=e.edges.sort(Ve),l=-1,c=a.length,f=a[c-1].edge,s=f.l===o?f.r:f.l;++l<c;)i=f,u=s,f=a[l].edge,s=f.l===o?f.r:f.l,r<u.i&&r<s.i&&cr(o,u,s)<0&&t.push([n[r],n[u.i],n[s.i]])}),t},t.x=function(n){return arguments.length?(u=En(r=n),t):r},t.y=function(n){return arguments.length?(o=En(i=n),t):i},t.clipExtent=function(n){return arguments.length?(a=null==n?sl:n,t):a===sl?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===sl?null:a&&a[1]},t)};var sl=[[-1e6,-1e6],[1e6,1e6]];ao.geom.delaunay=function(n){return ao.geom.voronoi().triangles(n)},ao.geom.quadtree=function(n,t,e,r,i){function u(n){function u(n,t,e,r,i,u,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,f=n.y;if(null!=l)if(xo(l-e)+xo(f-r)<.01)c(n,t,e,r,i,u,o,a);else{var s=n.point;n.x=n.y=n.point=null,c(n,s,l,f,i,u,o,a),c(n,t,e,r,i,u,o,a)}else n.x=e,n.y=r,n.point=t}else c(n,t,e,r,i,u,o,a)}function c(n,t,e,r,i,o,a,l){var c=.5*(i+a),f=.5*(o+l),s=e>=c,h=r>=f,p=h<<1|s;n.leaf=!1,n=n.nodes[p]||(n.nodes[p]=hr()),s?i=c:a=c,h?o=f:l=f,u(n,t,e,r,i,o,a,l)}var f,s,h,p,g,v,d,y,m,M=En(a),x=En(l);if(null!=t)v=t,d=e,y=r,m=i;else if(y=m=-(v=d=1/0),s=[],h=[],g=n.length,o)for(p=0;g>p;++p)f=n[p],f.x<v&&(v=f.x),f.y<d&&(d=f.y),f.x>y&&(y=f.x),f.y>m&&(m=f.y),s.push(f.x),h.push(f.y);else for(p=0;g>p;++p){var b=+M(f=n[p],p),_=+x(f,p);v>b&&(v=b),d>_&&(d=_),b>y&&(y=b),_>m&&(m=_),s.push(b),h.push(_)}var w=y-v,S=m-d;w>S?m=d+w:y=v+S;var k=hr();if(k.add=function(n){u(k,n,+M(n,++p),+x(n,p),v,d,y,m)},k.visit=function(n){pr(n,k,v,d,y,m)},k.find=function(n){return gr(k,n[0],n[1],v,d,y,m)},p=-1,null==t){for(;++p<g;)u(k,n[p],s[p],h[p],v,d,y,m);--p}else n.forEach(k.add);return s=h=n=f=null,k}var o,a=Ce,l=ze;return(o=arguments.length)?(a=fr,l=sr,3===o&&(i=e,r=t,e=t=0),u(n)):(u.x=function(n){return arguments.length?(a=n,u):a},u.y=function(n){return arguments.length?(l=n,u):l},u.extent=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],i=+n[1][1]),u):null==t?null:[[t,e],[r,i]]},u.size=function(n){return arguments.length?(null==n?t=e=r=i=null:(t=e=0,r=+n[0],i=+n[1]),u):null==t?null:[r-t,i-e]},u)},ao.interpolateRgb=vr,ao.interpolateObject=dr,ao.interpolateNumber=yr,ao.interpolateString=mr;var hl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pl=new RegExp(hl.source,"g");ao.interpolate=Mr,ao.interpolators=[function(n,t){var e=typeof t;return("string"===e?ua.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?vr:mr:t instanceof an?vr:Array.isArray(t)?xr:"object"===e&&isNaN(t)?dr:yr)(n,t)}],ao.interpolateArray=xr;var gl=function(){return m},vl=ao.map({linear:gl,poly:Er,quad:function(){return Sr},cubic:function(){return kr},sin:function(){return Ar},exp:function(){return Cr},circle:function(){return zr},elastic:Lr,back:qr,bounce:function(){return Tr}}),dl=ao.map({"in":m,out:_r,"in-out":wr,"out-in":function(n){return wr(_r(n))}});ao.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||gl,r=dl.get(r)||m,br(r(e.apply(null,lo.call(arguments,1))))},ao.interpolateHcl=Rr,ao.interpolateHsl=Dr,ao.interpolateLab=Pr,ao.interpolateRound=Ur,ao.transform=function(n){var t=fo.createElementNS(ao.ns.prefix.svg,"g");return(ao.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:yl)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var yl={a:1,b:0,c:0,d:1,e:0,f:0};ao.interpolateTransform=$r,ao.layout={},ao.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},ao.layout.chord=function(){function n(){var n,c,s,h,p,g={},v=[],d=ao.range(u),y=[];for(e=[],r=[],n=0,h=-1;++h<u;){for(c=0,p=-1;++p<u;)c+=i[h][p];v.push(c),y.push(ao.range(u)),n+=c}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&y.forEach(function(n,t){n.sort(function(n,e){return a(i[t][n],i[t][e])})}),n=(Ho-f*u)/n,c=0,h=-1;++h<u;){for(s=c,p=-1;++p<u;){var m=d[h],M=y[m][p],x=i[m][M],b=c,_=c+=x*n;g[m+"-"+M]={index:m,subindex:M,startAngle:b,endAngle:_,value:x}}r[m]={index:m,startAngle:s,endAngle:c,value:v[m]},c+=f}for(h=-1;++h<u;)for(p=h-1;++p<u;){var w=g[h+"-"+p],S=g[p+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}l&&t()}function t(){e.sort(function(n,t){return l((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,i,u,o,a,l,c={},f=0;return c.matrix=function(n){return arguments.length?(u=(i=n)&&i.length,e=r=null,c):i},c.padding=function(n){return arguments.length?(f=n,e=r=null,c):f},c.sortGroups=function(n){return arguments.length?(o=n,e=r=null,c):o},c.sortSubgroups=function(n){return arguments.length?(a=n,e=null,c):a},c.sortChords=function(n){return arguments.length?(l=n,e&&t(),c):l},c.chords=function(){return e||n(),e},c.groups=function(){return r||n(),r},c},ao.layout.force=function(){function n(n){return function(t,e,r,i){if(t.point!==n){var u=t.cx-n.x,o=t.cy-n.y,a=i-e,l=u*u+o*o;if(l>a*a/y){if(v>l){var c=t.charge/l;n.px-=u*c,n.py-=o*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=u*c,n.py-=o*c}}return!t.charge}}function t(n){n.px=ao.event.x,n.py=ao.event.y,l.resume()}var e,r,i,u,o,a,l={},c=ao.dispatch("start","tick","end"),f=[1,1],s=.9,h=ml,p=Ml,g=-30,v=xl,d=.1,y=.64,M=[],x=[];return l.tick=function(){if((i*=.99)<.005)return e=null,c.end({type:"end",alpha:i=0}),!0;var t,r,l,h,p,v,y,m,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,p=l.target,m=p.x-h.x,b=p.y-h.y,(v=m*m+b*b)&&(v=i*o[r]*((v=Math.sqrt(v))-u[r])/v,m*=v,b*=v,p.x-=m*(y=h.weight+p.weight?h.weight/(h.weight+p.weight):.5),p.y-=b*y,h.x+=m*(y=1-y),h.y+=b*y);if((y=i*d)&&(m=f[0]/2,b=f[1]/2,r=-1,y))for(;++r<_;)l=M[r],l.x+=(m-l.x)*y,l.y+=(b-l.y)*y;if(g)for(ri(t=ao.geom.quadtree(M),i,a),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*s,l.y-=(l.py-(l.py=l.y))*s);c.tick({type:"tick",alpha:i})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(f=n,l):f},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.friction=function(n){return arguments.length?(s=+n,l):s},l.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(y=n*n,l):Math.sqrt(y)},l.alpha=function(n){return arguments.length?(n=+n,i?n>0?i=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:i=0})):n>0&&(c.start({type:"start",alpha:i=n}),e=qn(l.tick)),l):i},l.start=function(){function n(n,r){if(!e){for(e=new Array(i),l=0;i>l;++l)e[l]=[];for(l=0;c>l;++l){var u=x[l];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var o,a=e[t],l=-1,f=a.length;++l<f;)if(!isNaN(o=a[l][n]))return o;return Math.random()*r}var t,e,r,i=M.length,c=x.length,s=f[0],v=f[1];for(t=0;i>t;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;i>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",s)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof h)for(t=0;c>t;++t)u[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)u[t]=h;if(o=[],"function"==typeof p)for(t=0;c>t;++t)o[t]=+p.call(this,x[t],t);else for(t=0;c>t;++t)o[t]=p;if(a=[],"function"==typeof g)for(t=0;i>t;++t)a[t]=+g.call(this,M[t],t);else for(t=0;i>t;++t)a[t]=g;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=ao.behavior.drag().origin(m).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",ni)),arguments.length?void this.on("mouseover.force",ti).on("mouseout.force",ei).call(r):r},ao.rebind(l,c,"on")};var ml=20,Ml=1,xl=1/0;ao.layout.hierarchy=function(){function n(i){var u,o=[i],a=[];for(i.depth=0;null!=(u=o.pop());)if(a.push(u),(c=e.call(n,u,u.depth))&&(l=c.length)){for(var l,c,f;--l>=0;)o.push(f=c[l]),f.parent=u,f.depth=u.depth+1;r&&(u.value=0),u.children=c}else r&&(u.value=+r.call(n,u,u.depth)||0),delete u.children;return oi(i,function(n){var e,i;t&&(e=n.children)&&e.sort(t),r&&(i=n.parent)&&(i.value+=n.value)}),a}var t=ci,e=ai,r=li;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(ui(t,function(n){n.children&&(n.value=0)}),oi(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ao.layout.partition=function(){function n(t,e,r,i){var u=t.children;if(t.x=e,t.y=t.depth*i,t.dx=r,t.dy=i,u&&(o=u.length)){var o,a,l,c=-1;for(r=t.value?r/t.value:0;++c<o;)n(a=u[c],e,l=a.value*r,i),e+=l}}function t(n){var e=n.children,r=0;if(e&&(i=e.length))for(var i,u=-1;++u<i;)r=Math.max(r,t(e[u]));return 1+r}function e(e,u){var o=r.call(this,e,u);return n(o[0],0,i[0],i[1]/t(o[0])),o}var r=ao.layout.hierarchy(),i=[1,1];return e.size=function(n){return arguments.length?(i=n,e):i},ii(e,r)},ao.layout.pie=function(){function n(o){var a,l=o.length,c=o.map(function(e,r){return+t.call(n,e,r)}),f=+("function"==typeof r?r.apply(this,arguments):r),s=("function"==typeof i?i.apply(this,arguments):i)-f,h=Math.min(Math.abs(s)/l,+("function"==typeof u?u.apply(this,arguments):u)),p=h*(0>s?-1:1),g=ao.sum(c),v=g?(s-l*p)/g:0,d=ao.range(l),y=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(o[n],o[t])}),d.forEach(function(n){y[n]={data:o[n],value:a=c[n],startAngle:f,endAngle:f+=a*v+p,padAngle:h}}),y}var t=Number,e=bl,r=0,i=Ho,u=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(i=t,n):i},n.padAngle=function(t){return arguments.length?(u=t,n):u},n};var bl={};ao.layout.stack=function(){function n(a,l){if(!(h=a.length))return a;var c=a.map(function(e,r){return t.call(n,e,r)}),f=c.map(function(t){return t.map(function(t,e){return[u.call(n,t,e),o.call(n,t,e)]})}),s=e.call(n,f,l);c=ao.permute(c,s),f=ao.permute(f,s);var h,p,g,v,d=r.call(n,f,l),y=c[0].length;for(g=0;y>g;++g)for(i.call(n,c[0][g],v=d[g],f[0][g][1]),p=1;h>p;++p)i.call(n,c[p][g],v+=f[p-1][g][1],f[p][g][1]);return a}var t=m,e=gi,r=vi,i=pi,u=si,o=hi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||gi,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vi,n):r},n.x=function(t){return arguments.length?(u=t,n):u},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(i=t,n):i},n};var _l=ao.map({"inside-out":function(n){var t,e,r=n.length,i=n.map(di),u=n.map(yi),o=ao.range(r).sort(function(n,t){return i[n]-i[t]}),a=0,l=0,c=[],f=[];for(t=0;r>t;++t)e=o[t],l>a?(a+=u[e],c.push(e)):(l+=u[e],f.push(e));return f.reverse().concat(c)},reverse:function(n){return ao.range(n.length).reverse()},"default":gi}),wl=ao.map({silhouette:function(n){var t,e,r,i=n.length,u=n[0].length,o=[],a=0,l=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;u>e;++e)l[e]=(a-o[e])/2;return l},wiggle:function(n){var t,e,r,i,u,o,a,l,c,f=n.length,s=n[0],h=s.length,p=[];for(p[0]=l=c=0,e=1;h>e;++e){for(t=0,i=0;f>t;++t)i+=n[t][e][1];for(t=0,u=0,a=s[e][0]-s[e-1][0];f>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;u+=o*n[t][e][1]}p[e]=l-=i?u/i*a:0,c>l&&(c=l)}for(e=0;h>e;++e)p[e]-=c;return p},expand:function(n){var t,e,r,i=n.length,u=n[0].length,o=1/i,a=[];for(e=0;u>e;++e){for(t=0,r=0;i>t;t++)r+=n[t][e][1];if(r)for(t=0;i>t;t++)n[t][e][1]/=r;else for(t=0;i>t;t++)n[t][e][1]=o}for(e=0;u>e;++e)a[e]=0;return a},zero:vi});ao.layout.histogram=function(){function n(n,u){for(var o,a,l=[],c=n.map(e,this),f=r.call(this,c,u),s=i.call(this,f,c,u),u=-1,h=c.length,p=s.length-1,g=t?1:1/h;++u<p;)o=l[u]=[],o.dx=s[u+1]-(o.x=s[u]),o.y=0;if(p>0)for(u=-1;++u<h;)a=c[u],a>=f[0]&&a<=f[1]&&(o=l[ao.bisect(s,a,1,p)-1],o.y+=g,o.push(n[u]));return l}var t=!0,e=Number,r=bi,i=Mi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(i="number"==typeof t?function(n){return xi(n,t)}:En(t),n):i},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ao.layout.pack=function(){function n(n,u){var o=e.call(this,n,u),a=o[0],l=i[0],c=i[1],f=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,oi(a,function(n){n.r=+f(n.value)}),oi(a,Ni),r){var s=r*(t?1:Math.max(2*a.r/l,2*a.r/c))/2;oi(a,function(n){n.r+=s}),oi(a,Ni),oi(a,function(n){n.r-=s})}return Ci(a,l/2,c/2,t?1:1/Math.max(2*a.r/l,2*a.r/c)),o}var t,e=ao.layout.hierarchy().sort(_i),r=0,i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},ii(n,e)},ao.layout.tree=function(){function n(n,i){var f=o.call(this,n,i),s=f[0],h=t(s);if(oi(h,e),h.parent.m=-h.z,ui(h,r),c)ui(s,u);else{var p=s,g=s,v=s;ui(s,function(n){n.x<p.x&&(p=n),n.x>g.x&&(g=n),n.depth>v.depth&&(v=n)});var d=a(p,g)/2-p.x,y=l[0]/(g.x+a(g,p)/2+d),m=l[1]/(v.depth||1);ui(s,function(n){n.x=(n.x+d)*y,n.y=n.depth*m})}return f}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var i,u=t.children,o=0,a=u.length;a>o;++o)r.push((u[o]=i={_:u[o],parent:t,children:(i=u[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Di(n);var u=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-u):n.z=u}else r&&(n.z=r.z+a(n._,r._));n.parent.A=i(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function i(n,t,e){if(t){for(var r,i=n,u=n,o=t,l=i.parent.children[0],c=i.m,f=u.m,s=o.m,h=l.m;o=Ti(o),i=qi(i),o&&i;)l=qi(l),u=Ti(u),u.a=n,r=o.z+s-i.z-c+a(o._,i._),r>0&&(Ri(Pi(o,n,e),n,r),c+=r,f+=r),s+=o.m,c+=i.m,h+=l.m,f+=u.m;o&&!Ti(u)&&(u.t=o,u.m+=s-f),i&&!qi(l)&&(l.t=i,l.m+=c-h,e=n)}return e}function u(n){n.x*=l[0],n.y=n.depth*l[1]}var o=ao.layout.hierarchy().sort(null).value(null),a=Li,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(c=null==(l=t)?u:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:u,n):c?l:null},ii(n,o)},ao.layout.cluster=function(){function n(n,u){var o,a=t.call(this,n,u),l=a[0],c=0;oi(l,function(n){var t=n.children;t&&t.length?(n.x=ji(t),n.y=Ui(t)):(n.x=o?c+=e(n,o):0,n.y=0,o=n)});var f=Fi(l),s=Hi(l),h=f.x-e(f,s)/2,p=s.x+e(s,f)/2;return oi(l,i?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(p-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),a}var t=ao.layout.hierarchy().sort(null).value(null),e=Li,r=[1,1],i=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(i=null==(r=t),n):i?null:r},n.nodeSize=function(t){return arguments.length?(i=null!=(r=t),n):i?r:null},ii(n,t)},ao.layout.treemap=function(){function n(n,t){for(var e,r,i=-1,u=n.length;++i<u;)r=(e=n[i]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var u=e.children;if(u&&u.length){var o,a,l,c=s(e),f=[],h=u.slice(),g=1/0,v="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),f.area=0;(l=h.length)>0;)f.push(o=h[l-1]),f.area+=o.area,"squarify"!==p||(a=r(f,v))<=g?(h.pop(),g=a):(f.area-=f.pop().area,i(f,v,c,!1),v=Math.min(c.dx,c.dy),f.length=f.area=0,g=1/0);f.length&&(i(f,v,c,!0),f.length=f.area=0),u.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var u,o=s(t),a=r.slice(),l=[];for(n(a,o.dx*o.dy/t.value),l.area=0;u=a.pop();)l.push(u),l.area+=u.area,null!=u.z&&(i(l,u.z?o.dx:o.dy,o,!a.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,i=0,u=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(u>e&&(u=e),e>i&&(i=e));return r*=r,t*=t,r?Math.max(t*i*g/r,r/(t*u*g)):1/0}function i(n,t,e,r){var i,u=-1,o=n.length,a=e.x,c=e.y,f=t?l(n.area/t):0;
5
+ if(t==e.dx){for((r||f>e.dy)&&(f=e.dy);++u<o;)i=n[u],i.x=a,i.y=c,i.dy=f,a+=i.dx=Math.min(e.x+e.dx-a,f?l(i.area/f):0);i.z=!0,i.dx+=e.x+e.dx-a,e.y+=f,e.dy-=f}else{for((r||f>e.dx)&&(f=e.dx);++u<o;)i=n[u],i.x=a,i.y=c,i.dx=f,c+=i.dy=Math.min(e.y+e.dy-c,f?l(i.area/f):0);i.z=!1,i.dy+=e.y+e.dy-c,e.x+=f,e.dx-=f}}function u(r){var i=o||a(r),u=i[0];return u.x=u.y=0,u.value?(u.dx=c[0],u.dy=c[1]):u.dx=u.dy=0,o&&a.revalue(u),n([u],u.dx*u.dy/u.value),(o?e:t)(u),h&&(o=i),i}var o,a=ao.layout.hierarchy(),l=Math.round,c=[1,1],f=null,s=Oi,h=!1,p="squarify",g=.5*(1+Math.sqrt(5));return u.size=function(n){return arguments.length?(c=n,u):c},u.padding=function(n){function t(t){var e=n.call(u,t,t.depth);return null==e?Oi(t):Ii(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Ii(t,n)}if(!arguments.length)return f;var r;return s=null==(f=n)?Oi:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,u},u.round=function(n){return arguments.length?(l=n?Math.round:Number,u):l!=Number},u.sticky=function(n){return arguments.length?(h=n,o=null,u):h},u.ratio=function(n){return arguments.length?(g=n,u):g},u.mode=function(n){return arguments.length?(p=n+"",u):p},ii(u,a)},ao.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,i;do e=2*Math.random()-1,r=2*Math.random()-1,i=e*e+r*r;while(!i||i>1);return n+t*e*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var n=ao.random.normal.apply(ao,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ao.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ao.scale={};var Sl={floor:m,ceil:m};ao.scale.linear=function(){return Wi([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};ao.scale.log=function(){return ru(ao.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=ao.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ao.scale.pow=function(){return iu(ao.scale.linear(),1,[0,1])},ao.scale.sqrt=function(){return ao.scale.pow().exponent(.5)},ao.scale.ordinal=function(){return ou([],{t:"range",a:[[]]})},ao.scale.category10=function(){return ao.scale.ordinal().range(Al)},ao.scale.category20=function(){return ao.scale.ordinal().range(Cl)},ao.scale.category20b=function(){return ao.scale.ordinal().range(zl)},ao.scale.category20c=function(){return ao.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);ao.scale.quantile=function(){return au([],[])},ao.scale.quantize=function(){return lu(0,1,[0,1])},ao.scale.threshold=function(){return cu([.5],[0,1])},ao.scale.identity=function(){return fu([0,1])},ao.svg={},ao.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),f=o.apply(this,arguments)-Io,s=a.apply(this,arguments)-Io,h=Math.abs(s-f),p=f>s?0:1;if(n>c&&(g=c,c=n,n=g),h>=Oo)return t(c,p)+(n?t(n,1-p):"")+"Z";var g,v,d,y,m,M,x,b,_,w,S,k,N=0,E=0,A=[];if((y=(+l.apply(this,arguments)||0)/2)&&(d=u===ql?Math.sqrt(n*n+c*c):+u.apply(this,arguments),p||(E*=-1),c&&(E=tn(d/c*Math.sin(y))),n&&(N=tn(d/n*Math.sin(y)))),c){m=c*Math.cos(f+E),M=c*Math.sin(f+E),x=c*Math.cos(s-E),b=c*Math.sin(s-E);var C=Math.abs(s-f-2*E)<=Fo?0:1;if(E&&yu(m,M,x,b)===p^C){var z=(f+s)/2;m=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else m=M=0;if(n){_=n*Math.cos(s-N),w=n*Math.sin(s-N),S=n*Math.cos(f+N),k=n*Math.sin(f+N);var L=Math.abs(f-s+2*N)<=Fo?0:1;if(N&&yu(_,w,S,k)===1-p^L){var q=(f+s)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Uo&&(g=Math.min(Math.abs(c-n)/2,+i.apply(this,arguments)))>.001){v=c>n^p?0:1;var T=g,R=g;if(Fo>h){var D=null==S?[_,w]:null==x?[m,M]:Re([m,M],[S,k],[x,b],[_,w]),P=m-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(g,(n-O)/(H-1)),T=Math.min(g,(c-O)/(H+1))}if(null!=x){var I=mu(null==S?[_,w]:[S,k],[m,M],c,T,p),Y=mu([x,b],[_,w],c,T,p);g===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-p^yu(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",p," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",m,",",M);if(null!=S){var Z=mu([m,M],[S,k],n,-R,p),V=mu([_,w],null==x?[m,M]:[x,b],n,-R,p);g===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",p^yu(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-p," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",m,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",p," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-p," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hu,r=pu,i=su,u=ql,o=gu,a=vu,l=du;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(i=En(t),n):i},n.padRadius=function(t){return arguments.length?(u=t==ql?ql:En(t),n):u},n.startAngle=function(t){return arguments.length?(o=En(t),n):o},n.endAngle=function(t){return arguments.length?(a=En(t),n):a},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Io;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";ao.svg.line=function(){return Mu(m)};var Tl=ao.map({linear:xu,"linear-closed":bu,step:_u,"step-before":wu,"step-after":Su,basis:zu,"basis-open":Lu,"basis-closed":qu,bundle:Tu,cardinal:Eu,"cardinal-open":ku,"cardinal-closed":Nu,monotone:Fu});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];ao.svg.line.radial=function(){var n=Mu(Hu);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wu.reverse=Su,Su.reverse=wu,ao.svg.area=function(){return Ou(m)},ao.svg.area.radial=function(){var n=Ou(Hu);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ao.svg.chord=function(){function n(n,a){var l=t(this,u,n,a),c=t(this,o,n,a);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?i(l.r,l.p1,l.r,l.p0):i(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+i(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var i=t.call(n,e,r),u=a.call(n,i,r),o=l.call(n,i,r)-Io,f=c.call(n,i,r)-Io;return{r:u,a0:o,a1:f,p0:[u*Math.cos(o),u*Math.sin(o)],p1:[u*Math.cos(f),u*Math.sin(f)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Fo)+",1 "+t}function i(n,t,e,r){return"Q 0,0 "+r}var u=Me,o=xe,a=Iu,l=gu,c=vu;return n.radius=function(t){return arguments.length?(a=En(t),n):a},n.source=function(t){return arguments.length?(u=En(t),n):u},n.target=function(t){return arguments.length?(o=En(t),n):o},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},ao.svg.diagonal=function(){function n(n,i){var u=t.call(this,n,i),o=e.call(this,n,i),a=(u.y+o.y)/2,l=[u,{x:u.x,y:a},{x:o.x,y:a},o];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yu;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ao.svg.diagonal.radial=function(){var n=ao.svg.diagonal(),t=Yu,e=n.projection;return n.projection=function(n){return arguments.length?e(Zu(t=n)):t},n},ao.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$u)(e.call(this,n,r))}var t=Xu,e=Vu;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=ao.map({circle:$u,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ao.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Yo);Co.transition=function(n){for(var t,e,r=Hl||++Zl,i=Ku(n),u=[],o=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},a=-1,l=this.length;++a<l;){u.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(e=c[f])&&Qu(e,f,i,r,o),t.push(e)}return Wu(u,i,r)},Co.interrupt=function(n){return this.each(null==n?Il:Bu(Ku(n)))};var Hl,Ol,Il=Bu(Ku()),Yl=[],Zl=0;Yl.call=Co.call,Yl.empty=Co.empty,Yl.node=Co.node,Yl.size=Co.size,ao.transition=function(n,t){return n&&n.transition?Hl?n.transition(t):n:ao.selection().transition(n)},ao.transition.prototype=Yl,Yl.select=function(n){var t,e,r,i=this.id,u=this.namespace,o=[];n=A(n);for(var a=-1,l=this.length;++a<l;){o.push(t=[]);for(var c=this[a],f=-1,s=c.length;++f<s;)(r=c[f])&&(e=n.call(r,r.__data__,f,a))?("__data__"in r&&(e.__data__=r.__data__),Qu(e,f,u,i,r[u][i]),t.push(e)):t.push(null)}return Wu(o,u,i)},Yl.selectAll=function(n){var t,e,r,i,u,o=this.id,a=this.namespace,l=[];n=C(n);for(var c=-1,f=this.length;++c<f;)for(var s=this[c],h=-1,p=s.length;++h<p;)if(r=s[h]){u=r[a][o],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var g=-1,v=e.length;++g<v;)(i=e[g])&&Qu(i,g,a,o,u),t.push(i)}return Wu(l,a,o)},Yl.filter=function(n){var t,e,r,i=[];"function"!=typeof n&&(n=O(n));for(var u=0,o=this.length;o>u;u++){i.push(t=[]);for(var e=this[u],a=0,l=e.length;l>a;a++)(r=e[a])&&n.call(r,r.__data__,a,u)&&t.push(r)}return Wu(i,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(i){i[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function i(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function u(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?$r:Mr,a=ao.ns.qualify(n);return Ju(this,"attr."+n,t,a.local?u:i)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(i));return r&&function(n){this.setAttribute(i,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(i.space,i.local));return r&&function(n){this.setAttributeNS(i.space,i.local,r(n))}}var i=ao.ns.qualify(n);return this.tween("attr."+n,i.local?r:e)},Yl.style=function(n,e,r){function i(){this.style.removeProperty(n)}function u(e){return null==e?i:(e+="",function(){var i,u=t(this).getComputedStyle(this,null).getPropertyValue(n);return u!==e&&(i=Mr(u,e),function(t){this.style.setProperty(n,i(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ju(this,"style."+n,e,u)},Yl.styleTween=function(n,e,r){function i(i,u){var o=e.call(this,i,u,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,i)},Yl.text=function(n){return Ju(this,"text",n,Gu)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ao.ease.apply(ao,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,i,u){r[e][t].delay=+n.call(r,r.__data__,i,u)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,i,u){r[e][t].duration=Math.max(1,n.call(r,r.__data__,i,u))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var i=Ol,u=Hl;try{Hl=e,Y(this,function(t,i,u){Ol=t[r][e],n.call(t,t.__data__,i,u)})}finally{Ol=i,Hl=u}}else Y(this,function(i){var u=i[r][e];(u.event||(u.event=ao.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,i=this.id,u=++Zl,o=this.namespace,a=[],l=0,c=this.length;c>l;l++){a.push(n=[]);for(var t=this[l],f=0,s=t.length;s>f;f++)(e=t[f])&&(r=e[o][i],Qu(e,f,o,u,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wu(a,o,u)},ao.svg.axis=function(){function n(n){n.each(function(){var n,c=ao.select(this),f=this.__chart__||e,s=this.__chart__=e.copy(),h=null==l?s.ticks?s.ticks.apply(s,a):s.domain():l,p=null==t?s.tickFormat?s.tickFormat.apply(s,a):m:t,g=c.selectAll(".tick").data(h,s),v=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Uo),d=ao.transition(g.exit()).style("opacity",Uo).remove(),y=ao.transition(g.order()).style("opacity",1),M=Math.max(i,0)+o,x=Zi(s),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ao.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=y.select("line"),C=g.select("text").text(p),z=v.select("text"),L=y.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=no,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*u+"V0H"+x[1]+"V"+q*u)):(n=to,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*u+","+x[0]+"H0V"+x[1]+"H"+q*u)),E.attr(N,q*i),z.attr(k,q*M),A.attr(S,0).attr(N,q*i),L.attr(w,0).attr(k,q*M),s.rangeBand){var T=s,R=T.rangeBand()/2;f=s=function(n){return T(n)+R}}else f.rangeBand?f=s:d.call(n,s,f);v.call(n,f,s),y.call(n,s,s)})}var t,e=ao.scale.linear(),r=Vl,i=6,u=6,o=3,a=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(a=co(arguments),n):a},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(i=+t,u=+arguments[e-1],n):i},n.innerTickSize=function(t){return arguments.length?(i=+t,n):i},n.outerTickSize=function(t){return arguments.length?(u=+t,n):u},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};ao.svg.brush=function(){function n(t){t.each(function(){var t=ao.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,m);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,s=ao.transition(t),h=ao.transition(o);c&&(l=Zi(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(s)),f&&(l=Zi(f),h.attr("y",l[0]).attr("height",l[1]-l[0]),i(s)),e(s)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function i(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function u(){function u(){32==ao.event.keyCode&&(C||(M=null,L[0]-=s[1],L[1]-=h[1],C=2),S())}function v(){32==ao.event.keyCode&&2==C&&(L[0]+=s[1],L[1]+=h[1],C=0,S())}function d(){var n=ao.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ao.event.altKey?(M||(M=[(s[0]+s[1])/2,(h[0]+h[1])/2]),L[0]=s[+(n[0]<M[0])],L[1]=h[+(n[1]<M[1])]):M=null),E&&y(n,c,0)&&(r(k),t=!0),A&&y(n,f,1)&&(i(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function y(n,t,e){var r,i,u=Zi(t),l=u[0],c=u[1],f=L[e],v=e?h:s,d=v[1]-v[0];return C&&(l-=f,c-=d+f),r=(e?g:p)?Math.max(l,Math.min(c,n[e])):n[e],C?i=(r+=f)+d:(M&&(f=Math.max(l,Math.min(c,2*M[e]-r))),r>f?(i=r,r=f):i=f),v[0]!=r||v[1]!=i?(e?a=null:o=null,v[0]=r,v[1]=i,!0):void 0}function m(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ao.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ao.select(ao.event.target),w=l.of(b,arguments),k=ao.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&f,C=_.classed("extent"),z=W(b),L=ao.mouse(b),q=ao.select(t(b)).on("keydown.brush",u).on("keyup.brush",v);if(ao.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",m):q.on("mousemove.brush",d).on("mouseup.brush",m),k.interrupt().selectAll("*").interrupt(),C)L[0]=s[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[s[1-T]-L[0],h[1-R]-L[1]],L[0]=s[T],L[1]=h[R]}else ao.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ao.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,l=N(n,"brushstart","brush","brushend"),c=null,f=null,s=[0,0],h=[0,0],p=!0,g=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:s,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Hl?ao.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,s=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(s,t.x),r=xr(h,t.y);return o=a=null,function(i){s=t.x=e(i),h=t.y=r(i),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!f],n):c},n.y=function(t){return arguments.length?(f=t,v=Bl[!c<<1|!f],n):f},n.clamp=function(t){return arguments.length?(c&&f?(p=!!t[0],g=!!t[1]):c?p=!!t:f&&(g=!!t),n):c&&f?[p,g]:c?p:f?g:null},n.extent=function(t){var e,r,i,u,l;return arguments.length?(c&&(e=t[0],r=t[1],f&&(e=e[0],r=r[0]),o=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),e==s[0]&&r==s[1]||(s=[e,r])),f&&(i=t[0],u=t[1],c&&(i=i[1],u=u[1]),a=[i,u],f.invert&&(i=f(i),u=f(u)),i>u&&(l=i,i=u,u=l),i==h[0]&&u==h[1]||(h=[i,u])),n):(c&&(o?(e=o[0],r=o[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),f&&(a?(i=a[0],u=a[1]):(i=h[0],u=h[1],f.invert&&(i=f.invert(i),u=f.invert(u)),i>u&&(l=i,i=u,u=l))),c&&f?[[e,i],[r,u]]:c?[e,r]:f&&[i,u])},n.clear=function(){return n.empty()||(s=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!f&&h[0]==h[1]},ao.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=ga.format=xa.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?eo:Gl,eo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},eo.toString=Gl.toString,ga.second=On(function(n){return new va(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ga.seconds=ga.second.range,ga.seconds.utc=ga.second.utc.range,ga.minute=On(function(n){return new va(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ga.minutes=ga.minute.range,ga.minutes.utc=ga.minute.utc.range,ga.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new va(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ga.hours=ga.hour.range,ga.hours.utc=ga.hour.utc.range,ga.month=On(function(n){return n=ga.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ga.months=ga.month.range,ga.months.utc=ga.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[ga.second,1],[ga.second,5],[ga.second,15],[ga.second,30],[ga.minute,1],[ga.minute,5],[ga.minute,15],[ga.minute,30],[ga.hour,1],[ga.hour,3],[ga.hour,6],[ga.hour,12],[ga.day,1],[ga.day,2],[ga.week,1],[ga.month,1],[ga.month,3],[ga.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return ao.range(Math.ceil(n/e)*e,+t,e).map(io)},floor:m,ceil:m};Ql.year=ga.year,ga.scale=function(){return ro(ao.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=ga.year.utc,ga.scale.utc=function(){return ro(ao.scale.linear(),ec,rc)},ao.text=An(function(n){return n.responseText}),ao.json=function(n,t){return Cn(n,"application/json",uo,t)},ao.html=function(n,t){return Cn(n,"text/html",oo,t)},ao.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=ao,define(ao)):"object"==typeof module&&module.exports?module.exports=ao:this.d3=ao}();
inc/js/scripts.js ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* global jQuery */
2
+ /* jshint unused:false */
3
+
4
+ function sucuriscanAlertClose (id) {
5
+ var element = document.getElementById('sucuriscan-alert-' + id);
6
+ element.parentNode.removeChild(element);
7
+ }
8
+
9
+ jQuery(document).ready(function ($) {
10
+ $('.sucuriscan-container').on('click', '.sucuriscan-modal-button', function (event) {
11
+ event.preventDefault();
12
+ var modalid = $(this).data('modalid');
13
+ $('div.' + modalid + '-modal').removeClass('sucuriscan-hidden');
14
+ });
15
+
16
+ $('.sucuriscan-container').on('click', '.sucuriscan-overlay, .sucuriscan-modal-close', function (event) {
17
+ event.preventDefault();
18
+ $('.sucuriscan-overlay').addClass('sucuriscan-hidden');
19
+ $('.sucuriscan-modal').addClass('sucuriscan-hidden');
20
+ });
21
+
22
+ $('.sucuriscan-container').on('click', '.sucuriscan-show-more', function (event) {
23
+ event.preventDefault();
24
+ var button = $(this);
25
+ var target = button.attr('data-target');
26
+ var status = button.attr('data-status');
27
+ if (status === 'more') {
28
+ button.attr('data-status', 'less');
29
+ $(target).removeClass('sucuriscan-hidden');
30
+ button.find('.sucuriscan-show-more-title').html('Show Less Info');
31
+ } else {
32
+ button.attr('data-status', 'more');
33
+ $(target).addClass('sucuriscan-hidden');
34
+ button.find('.sucuriscan-show-more-title').html('Show More Info');
35
+ }
36
+ });
37
+
38
+ if ($('.sucuriscan-tabs').length) {
39
+ var hiddenState = 'sucuriscan-hidden';
40
+ var visibleState = 'sucuriscan-visible';
41
+ var activeState = 'sucuriscan-tab-active';
42
+ var locationHash = location.href.split('#')[1];
43
+
44
+ $('.sucuriscan-container').on('click', '.sucuriscan-tabs-buttons a', function (event) {
45
+ event.preventDefault();
46
+
47
+ var button = $(this);
48
+ var uniqueid = button.attr('href').split('#')[1];
49
+
50
+ if (uniqueid !== undefined) {
51
+ var container = $('.sucuriscan-tabs-containers > #sucuriscan-tabs-' + uniqueid);
52
+
53
+ if (container.length) {
54
+ var rawurl = location.href.replace(location.hash, '');
55
+ var newurl = rawurl + '#' + uniqueid;
56
+
57
+ window.history.pushState({}, document.title, newurl);
58
+
59
+ $('.sucuriscan-tabs-buttons a').removeClass(activeState);
60
+ $('.sucuriscan-tabs-containers > div').addClass(hiddenState);
61
+
62
+ button.addClass(activeState);
63
+ container.addClass(visibleState);
64
+ container.removeClass(hiddenState);
65
+ }
66
+ }
67
+ });
68
+
69
+ $('.sucuriscan-tabs-containers > div').addClass(hiddenState);
70
+
71
+ if (locationHash !== undefined) {
72
+ $('.sucuriscan-tabs-buttons a').each(function (e, button) {
73
+ if ($(button).attr('href').split('#')[1] === locationHash) {
74
+ $(button).trigger('click');
75
+ }
76
+ });
77
+ } else {
78
+ $('.sucuriscan-tabs-buttons li:first-child a').trigger('click');
79
+ }
80
+ }
81
+
82
+ $('.sucuriscan-container').on('mouseover', '.sucuriscan-tooltip', function (event) {
83
+ var element = $(this);
84
+ var content = element.attr('content');
85
+ var tooltip = $('<div>', { 'class': 'sucuriscan-tooltip-object' });
86
+
87
+ tooltip.text(content);
88
+ element.append(tooltip);
89
+ var arrowHeight = 10; /* border width */
90
+ var tooltipHeight = tooltip.outerHeight();
91
+ tooltip.css('top', (tooltipHeight + arrowHeight) * -1);
92
+
93
+ var positionLeft = 0;
94
+ var elementWidth = element.outerWidth();
95
+ var tooltipWidth = tooltip.outerWidth();
96
+
97
+ if (elementWidth === tooltipWidth) {
98
+ tooltip.css('left', 0);
99
+ } else if (elementWidth > tooltipWidth) {
100
+ tooltip.css('left', (elementWidth - tooltipWidth) / 2);
101
+ } else if (elementWidth < tooltipWidth) {
102
+ tooltip.css('left', ((tooltipWidth - elementWidth) / 2) * -1);
103
+ }
104
+ });
105
+
106
+ $('.sucuriscan-container').on('mouseout', '.sucuriscan-tooltip', function (event) {
107
+ $(this).find('.sucuriscan-tooltip-object').remove();
108
+ });
109
+ });
inc/js/sucuri-scanner.min.js DELETED
@@ -1 +0,0 @@
1
- function sucuriscan_alert_close(c){var b=document.getElementById("sucuriscan-alert-"+c);b.parentNode.removeChild(b)}jQuery(document).ready(function(f){f(".sucuriscan-modal-btn").on("click",function(a){a.preventDefault();var b=f(this).data("modalid");f("div."+b).removeClass("sucuriscan-hidden")});f(".sucuriscan-overlay, .sucuriscan-modal-close").on("click",function(a){a.preventDefault();f(".sucuriscan-overlay").addClass("sucuriscan-hidden");f(".sucuriscan-modal").addClass("sucuriscan-hidden")});if(f(".sucuriscan-tabs").length){var g="sucuriscan-hidden";var c="sucuriscan-tab-active";var e=location.href.split("#")[1];f(".sucuriscan-tabs > ul a").on("click",function(h){h.preventDefault();var a=f(this);var k=a.data("tabname");var j=f(".sucuriscan-tab-containers > #sucuriscan-"+k);if(j.length){var d=location.href.replace(location.hash,"");var b=d+"#"+k;window.history.pushState({},document.title,b);f(".sucuriscan-tabs > ul a").removeClass(c);f(".sucuriscan-tab-containers > div").addClass(g);a.addClass(c);j.removeClass(g)}});f(".sucuriscan-tab-containers > div").addClass(g);if(e!==undefined){f(".sucuriscan-tabs > ul li a").each(function(b,a){if(f(a).data("tabname")===e){f(a).trigger("click")}})}else{f(".sucuriscan-tabs > ul li:first-child a").trigger("click")}}f("body").on("click",".sucuriscan-reveal",function(a){a.preventDefault();var b=f(this).attr("data-target");f(".sucuriscan-"+b).removeClass("sucuriscan-hidden")});f("body").on("click",".sucuriscan-corefiles .manage-column :checkbox",function(){f(".sucuriscan-corefiles tbody :checkbox").each(function(b,a){var d=f(a).is(":checked");f(a).attr("checked",!d)})})});
 
inc/tpl/auditlogs-report.html.tpl ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <script type="text/javascript">
3
+ /* global c3 */
4
+ /* global jQuery */
5
+ /* jshint camelcase:false */
6
+ jQuery(function ($) {
7
+ var sucuriscanPieChart = function (element, series, colors) {
8
+ c3.generate({
9
+ bindto: element,
10
+ size: { height: 250 },
11
+ padding: { top: 10, bottom: 10 },
12
+ color: { pattern: colors },
13
+ legend: { position: 'right' },
14
+ data: { type: 'pie', labels: true, columns: series },
15
+ });
16
+ };
17
+
18
+ var sucuriscanBarChart = function (element, categories, series) {
19
+ c3.generate({
20
+ bindto: element,
21
+ size: { height: 320 },
22
+ padding: { top: 10, bottom: 0 },
23
+ tooltip: { show: false },
24
+ legend: { show: false },
25
+ data: { type: 'bar', labels: true, columns: [ series ] },
26
+ axis: {
27
+ rotated: true,
28
+ x: { type: 'category', categories: categories },
29
+ },
30
+ });
31
+ };
32
+
33
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
34
+ action: 'sucuriscan_ajax',
35
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
36
+ form_action: 'get_audit_logs_report',
37
+ }, function (data) {
38
+ $('#sucuriscan-audit-report-response').html(data.message);
39
+
40
+ if (data.status) {
41
+ $('.sucuriscan-report-chart').removeClass('sucuriscan-hidden');
42
+
43
+ /* Pie-chart with number of audit logs per event type. */
44
+ sucuriscanPieChart(
45
+ '#sucuriscan-report-events-per-type',
46
+ data.eventsPerTypePoints,
47
+ data.eventsPerTypeColors
48
+ );
49
+
50
+ /* Column-chart with number of audit logs per event login. */
51
+ sucuriscanPieChart(
52
+ '#sucuriscan-report-events-per-login',
53
+ data.eventsPerLogin,
54
+ [ '#5cb85c', '#f27d7d' ]
55
+ );
56
+
57
+ /* Bar-chart with number of audit logs per user account. */
58
+ sucuriscanBarChart(
59
+ '#sucuriscan-report-events-per-user',
60
+ data.eventsPerUserCategories,
61
+ data.eventsPerUserSeries
62
+ );
63
+
64
+ /* Bar-chart with number of audit logs per remote address. */
65
+ sucuriscanBarChart(
66
+ '#sucuriscan-report-events-per-ipaddress',
67
+ data.eventsPerIPAddressCategories,
68
+ data.eventsPerIPAddressSeries
69
+ );
70
+ }
71
+ });
72
+ });
73
+ </script>
74
+
75
+ <div class="sucuriscan-audit-report">
76
+ <div class="sucuriscan-inline-alert-info">
77
+ <p>
78
+ The data used to generate these charts comes from the last
79
+ <strong>%%SUCURI.AuditReport.Logs4Report%% audit logs</strong>, you can
80
+ configure this number from the plugin settings page, you can also disable
81
+ and enable this panel from there at any time.
82
+ </p>
83
+ </div>
84
+
85
+ <div id="sucuriscan-audit-report-response">
86
+ <p>Loading...</p>
87
+ </div>
88
+
89
+ <div class="sucuriscan-report-chart sucuriscan-hidden">
90
+ <h4>Audit Logs per Event</h4>
91
+ <div id="sucuriscan-report-events-per-type"></div>
92
+ </div>
93
+
94
+ <div class="sucuriscan-report-chart sucuriscan-hidden">
95
+ <h4>Successful/Failed Logins</h4>
96
+ <div id="sucuriscan-report-events-per-login"></div>
97
+ </div>
98
+
99
+ <div class="sucuriscan-report-chart sucuriscan-hidden">
100
+ <h4>Audit Logs per User</h4>
101
+ <div id="sucuriscan-report-events-per-user"></div>
102
+ </div>
103
+
104
+ <div class="sucuriscan-report-chart sucuriscan-hidden">
105
+ <h4>Audit Logs per IP Address</h4>
106
+ <div id="sucuriscan-report-events-per-ipaddress"></div>
107
+ </div>
108
+ </div>
inc/tpl/auditlogs.html.tpl ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <script type="text/javascript">
3
+ /* global jQuery */
4
+ /* jshint camelcase:false */
5
+ jQuery(function ($) {
6
+ var sucuriscanLoadAuditLogs = function (page, reset) {
7
+ var url = '%%SUCURI.AjaxURL.Dashboard%%';
8
+
9
+ if (page !== undefined && page > 0) {
10
+ url += '&paged=' + page;
11
+ }
12
+
13
+ if (reset === true) {
14
+ $('.sucuriscan-auditlog-response').html('<em>Loading...</em>');
15
+ }
16
+
17
+ $('.sucuriscan-pagination-loading').html('Loading...');
18
+
19
+ $.post(url, {
20
+ action: 'sucuriscan_ajax',
21
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
22
+ form_action: 'get_audit_logs',
23
+ }, function (data) {
24
+ $('.sucuriscan-pagination-loading').html('');
25
+
26
+ if (data.content !== undefined) {
27
+ $('.sucuriscan-auditlog-response').html(data.content);
28
+
29
+ if (data.selfhosting) {
30
+ $('#sucuriscan-auditlog-selfhosting').removeClass('sucuriscan-hidden');
31
+ }
32
+
33
+ if (data.pagination !== '') {
34
+ $('.sucuriscan-auditlog-table .sucuriscan-pagination').html(data.pagination);
35
+ }
36
+ } else if (typeof data === 'object') {
37
+ $('.sucuriscan-auditlog-response').html(
38
+ '<textarea class="sucuriscan-full-textarea">' +
39
+ JSON.stringify(data) + '</textarea>');
40
+ $('.sucuriscan-auditlog-table .sucuriscan-pagination').html('');
41
+ } else {
42
+ $('.sucuriscan-auditlog-response').html(data);
43
+ $('.sucuriscan-auditlog-table .sucuriscan-pagination').html('');
44
+ }
45
+ });
46
+ }
47
+
48
+ setTimeout(function () {
49
+ sucuriscanLoadAuditLogs(0, true);
50
+ }, 100);
51
+
52
+ $('.sucuriscan-auditlog-table').on('click', '.sucuriscan-pagination-link', function (event) {
53
+ event.preventDefault();
54
+ sucuriscanLoadAuditLogs($(this).attr('data-page'));
55
+ });
56
+
57
+ $('.sucuriscan-auditlog-table').on('click', '.sucuriscan-reset-auditlogs', function (event) {
58
+ event.preventDefault();
59
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
60
+ action: 'sucuriscan_ajax',
61
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
62
+ form_action: 'reset_auditlogs_cache',
63
+ }, function (data) {
64
+ console.log(data);
65
+ sucuriscanLoadAuditLogs(0, true);
66
+ });
67
+ });
68
+ });
69
+ </script>
70
+
71
+ <div class="sucuriscan-auditlog-table">
72
+ <div id="sucuriscan-auditlog-selfhosting" class="sucuriscan-inline-alert-info sucuriscan-hidden">
73
+ <p>
74
+ You don't have a valid API key to communicate with the remote API
75
+ service. However, the self-hosting monitor is enabled, the plugin
76
+ will read the logs from that file and display the data here. Notice
77
+ that only the latest logs will be processed to keep a low memory
78
+ footprint. Consider to generate a free API key to get a better
79
+ coverage of the activity in your website.
80
+ </p>
81
+ </div>
82
+
83
+ <div class="sucuriscan-auditlog-response">
84
+ <em>Loading...</em>
85
+ </div>
86
+
87
+ <div>
88
+ <small>
89
+ This data is cached for %%SUCURI.AuditLogs.Lifetime%% seconds
90
+ &mdash; <a href="#" class="sucuriscan-reset-auditlogs">refresh</a>
91
+ </small>
92
+ </div>
93
+
94
+ <div class="sucuriscan-clearfix">
95
+ <ul class="sucuriscan-pull-left sucuriscan-pagination">
96
+ <!-- Populated via JavaScript -->
97
+ </ul>
98
+
99
+ <div class="sucuriscan-pull-right sucuriscan-pagination-loading">
100
+ <!-- Populated via JavaScript -->
101
+ </div>
102
+ </div>
103
+ </div>
inc/tpl/auditlogs.snippet.tpl ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ %%%SUCURI.AuditLog.Date%%%
3
+
4
+ <div class="sucuriscan-clearfix sucuriscan-auditlog-entry">
5
+ <div class="sucuriscan-pull-left sucuriscan-auditlog-entry-time">
6
+ <span>%%SUCURI.AuditLog.Time%%</span>
7
+ </div>
8
+
9
+ <div class="sucuriscan-pull-left sucuriscan-auditlog-entry-event">
10
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15.5px" height="18.5px" class="sucuriscan-pull-left sucuriscan-auditlog-%%SUCURI.AuditLog.Event%%"">
11
+ <path fill-rule="evenodd" stroke="rgb(0, 0, 0)" stroke-width="1px" stroke-linecap="butt" stroke-linejoin="miter" d="M9.845,4.505 L14.481,7.098 L13.639,11.471 L8.498,11.503 L9.845,4.505 Z" />
12
+ <path fill-rule="evenodd" stroke="rgb(0, 0, 0)" stroke-width="1px" stroke-linecap="butt" stroke-linejoin="miter" d="M3.500,1.500 L10.500,3.750 L10.500,9.375 L3.500,10.500 L3.500,1.500 Z" />
13
+ <path class="flag-bar" fill-rule="evenodd" stroke="rgb(0, 0, 0)" stroke-width="1px" stroke-linecap="butt" stroke-linejoin="miter" fill="rgb(255, 255, 255)" d="M1.500,1.500 L3.500,1.500 L3.500,16.500 L1.500,16.500 L1.500,1.500 Z" />
14
+ </svg>
15
+ </div>
16
+
17
+ <div class="sucuriscan-pull-left sucuriscan-auditlog-entry-message">
18
+ <div class="sucuriscan-auditlog-entry-title">
19
+ <strong>%%SUCURI.AuditLog.Username%%</strong>
20
+ <span>%%SUCURI.AuditLog.Message%%</span>
21
+ </div>
22
+
23
+ <div class="sucuriscan-auditlog-entry-extra">
24
+ %%%SUCURI.AuditLog.Extra%%%
25
+ </div>
26
+ </div>
27
+
28
+ <div class="sucuriscan-pull-right sucuriscan-auditlog-entry-address">
29
+ <span>IP: %%SUCURI.AuditLog.Address%%</span>
30
+ </div>
31
+ </div>
inc/tpl/base.html.tpl CHANGED
@@ -1,43 +1,43 @@
1
 
2
- <div class="wrap sucuriscan-wrap">
 
 
 
3
 
4
- <h2 id="warnings_hook"></h2>
5
 
6
  <div class="sucuriscan-header sucuriscan-clearfix">
7
- <a href="https://sucuri.net/signup" target="_blank" title="Sucuri Security" class="sucuriscan-logo">
8
- <img src="%%SUCURI.SucuriURL%%/inc/images/logo.png" alt="Sucuri Security" />
9
- </a>
10
- <h2>Sucuri Security %%SUCURI.PageTitle%%</h2>
11
- <a class="button button-hero button-primary sucuriscan-review-hero"
12
- href="https://goo.gl/aByqP5" target="_blank">Review Plugin</a>
13
- </div>
14
 
15
- <h2 class="nav-tab-wrapper sucuriscan-navbar">
16
- %%%SUCURI.Navbar%%%
17
- </h2>
18
 
19
- <div class="sucuriscan-maincontent sucuriscan-clearfix">
 
 
 
20
 
21
- <div class="sucuriscan-leftside sucuriscan-%%SUCURI.LayoutType%% sucuriscan-%%SUCURI.PageStyleClass%%">
22
 
23
- %%%SUCURI.PageContent%%%
24
 
 
 
25
  </div>
 
26
 
27
- %%%SUCURI.PageSidebarContent%%%
28
-
29
  </div>
30
 
31
- <div class="sucuriscan-footer sucuriscan-clearfix">
32
- <a href="https://sucuri.net/signup" target="_blank" title="Sucuri Security" class="sucuriscan-logo">
33
- <img src="%%SUCURI.SucuriURL%%/inc/images/logo.png" alt="Sucuri Security" />
34
- </a>
35
- <div class="sucuriscan-help">
36
- <p>
37
- If you have any questions about these checks or this plugin, contact us at
38
- <a href="mailto:info@sucuri.net">info@sucuri.net</a> or visit
39
- <a href="https://sucuri.net/" target="_blank">sucuri.net</a>
40
- </p>
41
- </div>
42
  </div>
43
  </div>
1
 
2
+ <div class="wrap sucuriscan-container">
3
+ <h2 id="warnings_hook">
4
+ <!-- Dynamically populated via JavaScript -->
5
+ </h2>
6
 
7
+ %%%SUCURI.GenerateAPIKey.Modal%%%
8
 
9
  <div class="sucuriscan-header sucuriscan-clearfix">
10
+ <div class="sucuriscan-pull-left">
11
+ <a href="https://sucuri.net/signup" target="_blank" title="Sucuri Security" class="sucuriscan-logo">
12
+ <img src="%%SUCURI.SucuriURL%%/inc/images/pluginlogo.png" alt="Sucuri Inc." />
13
+ </a>
14
+ <span class="sucuriscan-subtitle">WP Plugin</span>
15
+ <span class="sucuriscan-version">v%%SUCURI.PluginVersion%%</span>
16
+ </div>
17
 
18
+ <div class="sucuriscan-pull-right sucuriscan-navbar">
19
+ <ul>
20
+ <li><a href="https://goo.gl/aByqP5" target="_blank" rel="noopener" class="button button-secondary">@@SUCURI.Review@@</a></li>
21
 
22
+ <li class="sucuriscan-%%SUCURI.GenerateAPIKey.Visibility%%">
23
+ <a href="#" class="button button-primary sucuriscan-modal-button sucuriscan-register-site-button"
24
+ data-modalid="sucuriscan-register-site">@@SUCURI.GenerateAPIKey@@</a>
25
+ </li>
26
 
27
+ <li><a href="%%SUCURI.URL.Dashboard%%" class="button button-primary">@@SUCURI.Dashboard@@</a></li>
28
 
29
+ <li><a href="%%SUCURI.URL.Firewall%%" class="button button-primary">@@SUCURI.Firewall@@</a></li>
30
 
31
+ <li><a href="%%SUCURI.URL.Settings%%" class="button button-primary">@@SUCURI.Settings@@</a></li>
32
+ </ul>
33
  </div>
34
+ </div>
35
 
36
+ <div class="sucuriscan-clearfix sucuriscan-content sucuriscan-%%SUCURI.PageStyleClass%%">
37
+ %%%SUCURI.PageContent%%%
38
  </div>
39
 
40
+ <div class="sucuriscan-clearfix sucuriscan-footer">
41
+ <div>@@SUCURI.Copyright@@</div>
 
 
 
 
 
 
 
 
 
42
  </div>
43
  </div>
inc/tpl/bsidebar.html.tpl DELETED
@@ -1,67 +0,0 @@
1
-
2
- <div class="sucuriscan-sidebar sucuriscan-%%SUCURI.AdsVisibility%%">
3
-
4
- <div class="sucuriscan-ad sucuriscan-ad-firewall">
5
- <div class="sucuriscan-clearfix">
6
- <div class="sucuriscan-pull-left">
7
- <h3>Do you want to</h3>
8
- <h4>Stop Hackers?</h4>
9
- </div>
10
- <div class="sucuriscan-pull-right">
11
- <img src="%%SUCURI.SucuriURL%%/inc/images/cloudproxy-logo-x42.png" alt="CloudProxy WAF" />
12
- </div>
13
- </div>
14
-
15
- <a href="https://sucuri.net/lp/plugin/wp-pn-protect-wordpress" target="_blank" class="sucuriscan-ad-btn">Protect Your Website Today</a>
16
-
17
- <div class="sucuriscan-ad-footer">
18
- <ul>
19
- <li>Sucuri Firewall</li>
20
- <li>Protection . Performance . Security</li>
21
- <li class="featured">Cloud-based WAF + DDoS Protection</li>
22
- <li>Virtual Website Patching</li>
23
- <li>Anycast CDN + Website Accelerator</li>
24
- <li>All in one security for your site.</li>
25
- </ul>
26
- </div>
27
- </div>
28
-
29
- <div class="sucuriscan-ad sucuriscan-ad-antivirus">
30
- <div class="sucuriscan-clearfix">
31
- <h3>Have you been hacked?</h3>
32
- <h4>Blacklisted by Google?</h4>
33
- </div>
34
-
35
- <a href="https://sucuri.net/lp/plugin/wp-pn-clean-wordpress-hack" target="_blank" class="sucuriscan-ad-btn">Get Clean Today</a>
36
-
37
- <div class="sucuriscan-ad-footer sucuriscan-clearfix">
38
- <div class="sucuriscan-pull-left">
39
- <ul>
40
- <li>Sucuri Antivirus</li>
41
- <li class="featured">Servicing 250k+ domains</li>
42
- <li class="featured">Cleaning 300+ websites a day</li>
43
- </ul>
44
- </div>
45
- <div class="sucuriscan-pull-right">
46
- <img src="%%SUCURI.SucuriURL%%/inc/images/antivirus-logo-x42.png" alt="Sucuri Antivirus" />
47
- </div>
48
- </div>
49
-
50
- <a href="https://sucuri.net/" target="_blank" class="sucuriscan-ad-website">
51
- <img src="%%SUCURI.SucuriURL%%/inc/images/sucuri-website.png" alt="Sucuri Website" />
52
- </a>
53
- </div>
54
-
55
- <a href="https://wordpress.org/support/plugin/sucuri-scanner" target="_blank"
56
- class="button button-primary sucuriscan-supportbtn">Visit Support Forum</a>
57
-
58
- <div class="sucuriscan-hide-ads">
59
- <button class="button-link sucuriscan-reveal"
60
- data-target="hide-ads-instructions">Hide this column</button>
61
- <div class="sucuriscan-hidden sucuriscan-hide-ads-instructions">
62
- Add this to your wp-config.php file:<br>
63
- <code>define('SUCURISCAN_HIDE_ADS', true);</code>
64
- </div>
65
- </div>
66
-
67
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/corefiles-page.html.tpl DELETED
@@ -1,39 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Core Integrity</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- Every WordPress release comes with a set of files that are part of the standard
8
- installation process of each version, none of these files should be modified as
9
- they are overwritten on each upgrade, it is not advised that web developers
10
- modify the core files and instead extend the base functionality with themes or
11
- plugins. Only three directories are scanned: admin, includes, and the document
12
- root where the configuration and startup files are located.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-info">
16
- <p>
17
- Use a <a href="https://sucuri.net/website-antivirus/" target="_blank"> server
18
- side scanner</a> or a <a href="https://sitecheck.sucuri.net/" target="_blank">
19
- web scanner</a> to find the source of the infection and broken pages respectively.
20
- </p>
21
- </div>
22
-
23
- <div id="sucuriscan-corefiles-response">
24
- <em>Loading...</em>
25
- </div>
26
-
27
- <script type="text/javascript">
28
- jQuery(function($){
29
- $.post('%%SUCURI.AjaxURL.Home%%', {
30
- action: 'sucuriscan_ajax',
31
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
32
- form_action: 'get_core_files',
33
- }, function(data){
34
- $('#sucuriscan-corefiles-response').html(data);
35
- });
36
- });
37
- </script>
38
- </div>
39
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/corefiles.html.tpl DELETED
@@ -1,88 +0,0 @@
1
-
2
- <div class="sucuriscan-inline-alert-updated sucuriscan-%%SUCURI.CoreFiles.GoodVisibility%%">
3
- <p>
4
- Your WordPress core files are clean and were not modified.
5
- </p>
6
- </div>
7
-
8
- <div class="sucuriscan-inline-alert-warning sucuriscan-%%SUCURI.CoreFiles.NotFixableVisibility%%">
9
- <p>
10
- Files marked with the text <em>"not fixable"</em> are files without write
11
- permissions, you have to fix them manually.
12
- </p>
13
- </div>
14
-
15
- <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.CoreFiles.DisabledVisibility%%">
16
- <p>
17
- The file scanner to check the integrity of the project is disabled.
18
- </p>
19
- </div>
20
-
21
- <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.CoreFiles.FailureVisibility%%">
22
- <p>
23
- Error retrieving the <a href="%%SUCURI.CoreFiles.RemoteChecksumsURL%%" target="_blank">
24
- WordPress core hashes</a>. The information used by the plugin to determine the
25
- integrity of the core files is retrieved and controlled by WordPress. Any error
26
- message related with this tool is likely related with a modification in their
27
- API service that is not supported yet. It is also possible that your website is
28
- not able to communicate with this server due to a missing HTTP transport tool.
29
- </p>
30
- </div>
31
-
32
- <form action="%%SUCURI.URL.Home%%" method="post">
33
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
34
-
35
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-corefiles sucuriscan-%%SUCURI.CoreFiles.BadVisibility%%">
36
- <thead>
37
- <tr>
38
- <th colspan="5">Core Integrity (%%SUCURI.CoreFiles.ListCount%% files)</th>
39
- </tr>
40
-
41
- <tr>
42
- <th class="manage-column column-cb check-column">
43
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
44
- <input id="cb-select-all-1" type="checkbox">
45
- </th>
46
- <th width="80" class="manage-column">Status</th>
47
- <th width="100" class="manage-column">File Size</th>
48
- <th width="200" class="manage-column">Modified At</th>
49
- <th class="manage-column">File Path</th>
50
- </tr>
51
- </thead>
52
-
53
- <tbody>
54
- %%%SUCURI.CoreFiles.List%%%
55
- </tbody>
56
- </table>
57
-
58
- <div class="sucuriscan-%%SUCURI.CoreFiles.BadVisibility%%">
59
- <p>
60
- Marking one or more files as fixed will force the plugin to ignore them during
61
- the next scan, very useful when you find false positives. Additionally you can
62
- restore the original content of the core files that appear as modified or deleted,
63
- this will tell the plugin to download a copy of the original files from the official
64
- <a href="https://core.svn.wordpress.org/tags/" target="_blank">WordPress repository</a>.
65
- Deleting a file is an irreversible action, be careful.
66
- </p>
67
-
68
- <div class="sucuriscan-recipient-form">
69
- <p>
70
- <label>
71
- <input type="hidden" name="sucuriscan_process_form" value="0" />
72
- <input type="checkbox" name="sucuriscan_process_form" value="1" />
73
- <span>I understand that this operation can not be reverted.</span>
74
- </label>
75
- </p>
76
-
77
- <span class="sucuriscan-input-group">
78
- <label>Choose Action:</label>
79
- <select name="sucuriscan_integrity_action">
80
- <option value="fixed">Mark as fixed</option>
81
- <option value="restore">Restore source</option>
82
- <option value="delete">Delete file</option>
83
- </select>
84
- </span>
85
- <button type="submit" class="button button-primary">Proceed</button>
86
- </div>
87
- </div>
88
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/corefiles.snippet.tpl DELETED
@@ -1,14 +0,0 @@
1
-
2
- <tr class="%%SUCURI.CoreFiles.CssClass%%">
3
- <td class="check-column">
4
- <input type="checkbox" name="sucuriscan_corefiles[]"
5
- value="%%SUCURI.CoreFiles.StatusType%%@%%SUCURI.CoreFiles.FilePath%%" />
6
- </td>
7
- <td><span class="sucuriscan-label sucuriscan-label-%%SUCURI.CoreFiles.StatusType%%">%%SUCURI.CoreFiles.StatusType%%</span></td>
8
- <td><em title="%%SUCURI.CoreFiles.FileSizeNumber%% bytes">~%%SUCURI.CoreFiles.FileSizeHuman%%</em></td>
9
- <td>%%SUCURI.CoreFiles.ModifiedAt%%</td>
10
- <td>
11
- <span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.CoreFiles.FilePath%%</span>
12
- <em>%%SUCURI.CoreFiles.IsNotFixable%%</em>
13
- </td>
14
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/dashboard.html.tpl ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ %%%SUCURI.Integrity%%%
3
+
4
+ <script type="text/javascript">
5
+ /* global jQuery */
6
+ /* jshint camelcase: false */
7
+ jQuery(function ($) {
8
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
9
+ action: 'sucuriscan_ajax',
10
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
11
+ form_action: 'malware_scan',
12
+ }, function (data) {
13
+ $('#sucuriscan-title-iframes').html(data.iframes.title);
14
+ $('#sucuriscan-title-links').html(data.links.title);
15
+ $('#sucuriscan-title-scripts').html(data.scripts.title);
16
+
17
+ $('#sucuriscan-tabs-iframes').html(data.iframes.content);
18
+ $('#sucuriscan-tabs-links').html(data.links.content);
19
+ $('#sucuriscan-tabs-scripts').html(data.scripts.content);
20
+
21
+ $('#sucuriscan-malware').html(data.malware);
22
+ $('#sucuriscan-blacklist').html(data.blacklist);
23
+ $('#sucuriscan-recommendations').html(data.recommendations);
24
+ });
25
+ });
26
+ </script>
27
+
28
+ <div class="sucuriscan-clearfix">
29
+ <div class="sucuriscan-pull-left sucuriscan-dashboard-left">
30
+ <div class="sucuriscan-panel">
31
+ <div class="sucuriscan-tabs">
32
+ <ul class="sucuriscan-clearfix sucuriscan-tabs-buttons">
33
+ <li><a href="%%SUCURI.URL.Dashboard%%#auditlogs">Audit Logs</a></li>
34
+ <li><a href="%%SUCURI.URL.Dashboard%%#stats">Statistics</a></li>
35
+ <li><a href="%%SUCURI.URL.Dashboard%%#iframes" id="sucuriscan-title-iframes">%%SUCURI.SiteCheck.iFramesTitle%%</a></li>
36
+ <li><a href="%%SUCURI.URL.Dashboard%%#links" id="sucuriscan-title-links">%%SUCURI.SiteCheck.LinksTitle%%</a></li>
37
+ <li><a href="%%SUCURI.URL.Dashboard%%#scripts" id="sucuriscan-title-scripts">%%SUCURI.SiteCheck.ScriptsTitle%%</a></li>
38
+ </ul>
39
+
40
+ <div class="sucuriscan-tabs-containers">
41
+ <div id="sucuriscan-tabs-auditlogs">
42
+ %%%SUCURI.AuditLogs%%%
43
+ </div>
44
+
45
+ <div id="sucuriscan-tabs-stats">
46
+ %%%SUCURI.AuditLogsReport%%%
47
+ </div>
48
+
49
+ <div id="sucuriscan-tabs-iframes">
50
+ %%%SUCURI.SiteCheck.iFramesContent%%%
51
+ </div>
52
+
53
+ <div id="sucuriscan-tabs-links">
54
+ %%%SUCURI.SiteCheck.LinksContent%%%
55
+ </div>
56
+
57
+ <div id="sucuriscan-tabs-scripts">
58
+ %%%SUCURI.SiteCheck.ScriptsContent%%%
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </div>
63
+ </div>
64
+
65
+ <div class="sucuriscan-pull-right sucuriscan-dashboard-right">
66
+ %%%SUCURI.SiteCheck.Malware%%%
67
+
68
+ %%%SUCURI.SiteCheck.Blacklist%%%
69
+
70
+ %%%SUCURI.SiteCheck.Recommendations%%%
71
+ </div>
72
+ </div>
inc/tpl/firewall-auditlogs.html.tpl CHANGED
@@ -1,59 +1,65 @@
1
 
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox">
4
- <h3>Firewall Audit Logs</h3>
5
 
6
- <div class="inside">
7
- <p>
8
- CloudProxy logs every request involved in an attack and separates them from the
9
- legitimate requests. You can analyze the data from the latest entries in the
10
- logs using this tool and take action either enabling the advanced features of
11
- the IDS <em>(Intrusion Detection System)</em> from the <a target="_blank"
12
- href="https://waf.sucuri.net/?settings">CloudProxy Dashboard</a> and/or blocking
13
- IP addresses and URL paths directly from the <a href="https://waf.sucuri.net/?audit"
14
- target="_blank">CloudProxy Audit Trails</a> page.
15
- </p>
 
16
 
17
- <div class="sucuriscan-inline-alert-info">
18
- <p>Note that non-blocked requests are hidden from the logs, this is intentional.</p>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- <div>
22
- <form action="%%SUCURI.URL.Firewall%%#auditlogs" method="post">
23
- <span class="sucuriscan-input-group">
24
- <label>Query:</label>
25
- <input type="text" id="sucuriscan_firewall_query" class="input-text" />
26
- <select id="sucuriscan_firewall_day">%%%SUCURI.AuditLogs.DateDays%%%</select>
27
- <select id="sucuriscan_firewall_month">%%%SUCURI.AuditLogs.DateMonths%%%</select>
28
- <select id="sucuriscan_firewall_year">%%%SUCURI.AuditLogs.DateYears%%%</select>
29
- </span>
30
- <button id="sucuriscan-firewall-auditlogs-button" class="button button-primary">Retrieve Logs</button>
31
- </form>
32
- </div>
33
 
34
- <script type="text/javascript">
35
- jQuery(function($){
36
- $('#sucuriscan-firewall-auditlogs-button').on('click', function(ev){
37
- ev.preventDefault();
38
- $('.sucuriscan-firewall-auditlogs tbody').html(
39
- '<tr><td><em>Loading...</em></td></tr>'
40
- );
41
- var params = {
42
- action: 'sucuriscan_firewall_ajax',
43
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
44
- form_action: 'get_audit_logs',
45
- };
46
- params.sucuriscan_query = $('#sucuriscan_firewall_query').val();
47
- params.sucuriscan_month = $('#sucuriscan_firewall_month').val();
48
- params.sucuriscan_year = $('#sucuriscan_firewall_year').val();
49
- params.sucuriscan_day = $('#sucuriscan_firewall_day').val();
50
- $.post('%%SUCURI.AjaxURL.Firewall%%', params, function(data){
51
- $('.sucuriscan-firewall-auditlogs tbody').html(data);
52
- });
53
  });
54
- $('#sucuriscan-firewall-auditlogs-button').click();
55
  });
56
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
58
  <table class="wp-list-table widefat sucuriscan-table sucuriscan-firewall-auditlogs">
59
  <thead>
@@ -68,6 +74,6 @@
68
  </tr>
69
  </tbody>
70
  </table>
71
- </div>
72
  </div>
73
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Firewall Audit Logs</h3>
 
4
 
5
+ <div class="inside">
6
+ <p>
7
+ The firewall logs every request involved in an attack and separates
8
+ them from the legitimate requests. You can analyze the data from the
9
+ latest entries in the logs using this tool and take action either
10
+ enabling the advanced features of the IDS <em>(Intrusion Detection
11
+ System)</em> from the <a target="_blank" href="https://waf.sucuri.net/?settings">
12
+ Firewall Dashboard</a> and/or blocking IP addresses and URL paths
13
+ directly from the <a href="https://waf.sucuri.net/?audit" target="_blank">
14
+ Firewall Audit Trails</a> page.
15
+ </p>
16
 
17
+ <div class="sucuriscan-inline-alert-info">
18
+ <p>Note that non-blocked requests are hidden from the logs, this is intentional.</p>
19
+ </div>
20
+
21
+ <script type="text/javascript">
22
+ /* global jQuery */
23
+ /* jshint camelcase: false */
24
+ jQuery(function ($) {
25
+ $('#sucuriscan-firewall-auditlogs-button').on('click', function (event) {
26
+ event.preventDefault();
27
+
28
+ var params = {};
29
+
30
+ $('.sucuriscan-firewall-auditlogs tbody')
31
+ .html('<tr><td><em>Loading...</em></td></tr>');
32
 
33
+ params.action = 'sucuriscan_ajax';
34
+ params.form_action = 'get_firewall_logs';
35
+ params.sucuriscan_page_nonce = '%%SUCURI.PageNonce%%';
36
+ params.sucuriscan_query = $('#sucuriscan_firewall_query').val();
37
+ params.sucuriscan_month = $('#sucuriscan_firewall_month').val();
38
+ params.sucuriscan_year = $('#sucuriscan_firewall_year').val();
39
+ params.sucuriscan_day = $('#sucuriscan_firewall_day').val();
 
 
 
 
 
40
 
41
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', params, function (data) {
42
+ if (data.match(/sucuriscan-alert/)) {
43
+ data = '<tr><td>' + data + '</td></tr>';
44
+ }
45
+
46
+ $('.sucuriscan-firewall-auditlogs tbody').html(data);
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  });
 
48
  });
49
+
50
+ $('#sucuriscan-firewall-auditlogs-button').click();
51
+ });
52
+ </script>
53
+
54
+ <form action="%%SUCURI.URL.Firewall%%#auditlogs" method="post">
55
+ <fieldset class="sucuriscan-clearfix">
56
+ <label>Filter Audit Logs:</label>
57
+ <input type="text" id="sucuriscan_firewall_query" />
58
+ <select id="sucuriscan_firewall_day">%%%SUCURI.AuditLogs.DateDays%%%</select>
59
+ <select id="sucuriscan_firewall_month">%%%SUCURI.AuditLogs.DateMonths%%%</select>
60
+ <select id="sucuriscan_firewall_year">%%%SUCURI.AuditLogs.DateYears%%%</select>
61
+ <button id="sucuriscan-firewall-auditlogs-button" class="button button-primary">Retrieve Logs</button>
62
+ </fieldset>
63
 
64
  <table class="wp-list-table widefat sucuriscan-table sucuriscan-firewall-auditlogs">
65
  <thead>
74
  </tr>
75
  </tbody>
76
  </table>
77
+ </form>
78
  </div>
79
  </div>
inc/tpl/firewall-auditlogs.snippet.tpl CHANGED
@@ -1,5 +1,5 @@
1
 
2
- <tr class="%%SUCURI.AccessLog.CssClass%%">
3
  <td>
4
  <div class="sucuriscan-firewall-accesslog sucuriscan-monospace">
5
  <div class="sucuriscan-accesslog-origin">
@@ -38,6 +38,6 @@
38
  <span class="sucuriscan-accesslog-label">Referer:</span>
39
  <span>%%SUCURI.AccessLog.HttpReferer%%</span>
40
  </div>
41
- </span>
42
  </td>
43
  </tr>
1
 
2
+ <tr>
3
  <td>
4
  <div class="sucuriscan-firewall-accesslog sucuriscan-monospace">
5
  <div class="sucuriscan-accesslog-origin">
38
  <span class="sucuriscan-accesslog-label">Referer:</span>
39
  <span>%%SUCURI.AccessLog.HttpReferer%%</span>
40
  </div>
41
+ </div>
42
  </td>
43
  </tr>
inc/tpl/firewall-clearcache.html.tpl CHANGED
@@ -1,59 +1,59 @@
1
 
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox">
4
- <h3>Clear Cache</h3>
5
 
6
- <div class="inside">
7
- <p>
8
- CloudProxy offers multiple options to configure the cache level applied to your
9
- website. You can either enable the full cache functionality which is the
10
- recommended setting, or you can set the cache level to minimal which will keep
11
- the pages static for a couple of minutes, or force the usage of the website
12
- headers <em>(only for advanced users)</em>, or in extreme cases where you do not
13
- need the cache you can simply disable it. You can find more information about it
14
- in the <a href="https://kb.sucuri.net/cloudproxy/Performance/caching-options"
15
- target="_blank">Sucuri Knowledge Base</a> website.
16
- </p>
17
-
18
- <div class="sucuriscan-inline-alert-info">
19
- <p>
20
- Note that CloudProxy has <a href="https://kb.sucuri.net/cloudproxy/Performance/cache-exceptions"
21
- target="_blank">special caching rules</a> for Images, Cascading Style Sheets,
22
- JavaScript, PDF, TXT, media files and a few more extensions that are stored on
23
- our <a href="https://en.wikipedia.org/wiki/Edge_device" target="_blank">edge</a>.
24
- The only way to flush the cache for these files is by clearing CloudProxy's cache
25
- completely <em>(for the whole website)</em>.
26
- </p>
27
- </div>
28
-
29
- <div class="sucuriscan-inline-alert-warning">
30
- <p>
31
- Due to our caching of JavaScript and CSS files, often, as is best practice, the
32
- use of versioning during development will ensure updates going live as expected.
33
- This is done by adding a query string such as <code>?ver=1.2.3</code> and
34
- incrementing on each update.
35
- </p>
36
- </div>
37
 
 
38
  <p>
39
- A web cache (or HTTP cache) is an information technology for the temporary
40
- storage (caching) of web documents, such as HTML pages and images, to reduce
41
- bandwidth usage, server load, and perceived lag. A web cache system stores
42
- copies of documents passing through it; subsequent requests may be satisfied
43
- from the cache if certain conditions are met. A web cache system can refer
44
- either to an appliance, or to a computer program.
 
45
  </p>
 
46
 
 
47
  <p>
48
- More info at <a href="https://en.wikipedia.org/wiki/Web_cache" target="_blank">
49
- WikiPedia - Web Cache</a>
 
 
50
  </p>
51
-
52
- <form action="%%SUCURI.URL.Firewall%%#clearcache" method="post">
53
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
54
- <input type="hidden" name="sucuriscan_clear_cache" value="1" />
55
- <input type="submit" value="Clear Cache" class="button button-primary" />
56
- </form>
57
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  </div>
59
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Clear Cache</h3>
 
4
 
5
+ <div class="inside">
6
+ <p>
7
+ The firewall offers multiple options to configure the cache level
8
+ applied to your website. You can either enable the full cache which
9
+ is the recommended setting, or you can set the cache level to minimal
10
+ which will keep the pages static for a couple of minutes, or force
11
+ the usage of the website headers <em>(only for advanced users)</em>,
12
+ or in extreme cases where you do not need the cache you can simply
13
+ disable it. Find more information about it in the <a target="_blank"
14
+ href="https://kb.sucuri.net/cloudproxy/Performance/caching-options">
15
+ Sucuri Knowledge Base</a> website.
16
+ </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
+ <div class="sucuriscan-inline-alert-info">
19
  <p>
20
+ Note that the firewall has <a href="https://kb.sucuri.net/cloudproxy/Performance/cache-exceptions"
21
+ target="_blank">special caching rules</a> for Images, CSS, PDF,
22
+ TXT, JavaScript, media files and a few more extensions that are
23
+ stored on our <a href="https://en.wikipedia.org/wiki/Edge_device"
24
+ target="_blank" rel="noopener">edge</a>. The only way to flush the cache for
25
+ these files is by clearing the firewall's cache completely
26
+ <em>(for the whole website)</em>.
27
  </p>
28
+ </div>
29
 
30
+ <div class="sucuriscan-inline-alert-error">
31
  <p>
32
+ Due to our caching of JavaScript and CSS files, often, as is best practice, the
33
+ use of versioning during development will ensure updates going live as expected.
34
+ This is done by adding a query string such as <code>?ver=1.2.3</code> and
35
+ incrementing on each update.
36
  </p>
 
 
 
 
 
 
37
  </div>
38
+
39
+ <p>
40
+ A web cache (or HTTP cache) is an information technology for the temporary
41
+ storage (caching) of web documents, such as HTML pages and images, to reduce
42
+ bandwidth usage, server load, and perceived lag. A web cache system stores
43
+ copies of documents passing through it; subsequent requests may be satisfied
44
+ from the cache if certain conditions are met. A web cache system can refer
45
+ either to an appliance, or to a computer program.
46
+ </p>
47
+
48
+ <p>
49
+ More info at <a href="https://en.wikipedia.org/wiki/Web_cache" target="_blank" rel="noopener">
50
+ WikiPedia - Web Cache</a>
51
+ </p>
52
+
53
+ <form action="%%SUCURI.URL.Firewall%%#clearcache" method="post">
54
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
55
+ <input type="hidden" name="sucuriscan_clear_cache" value="1" />
56
+ <input type="submit" value="Clear Cache" class="button button-primary" />
57
+ </form>
58
  </div>
59
  </div>
inc/tpl/firewall-settings.html.tpl CHANGED
@@ -1,65 +1,63 @@
1
 
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox">
4
- <h3>Firewall Settings</h3>
5
-
6
- <div class="inside">
 
 
 
 
 
 
 
 
 
 
7
  <p>
8
- A powerful <b>WAF</b> <em>(Web Application Firewall)</em> and <b>Intrusion
9
- Prevention</b> system for any WordPress user and many other platforms. This page
10
- will help you to configure and monitor your site through <strong>Sucuri
11
- CloudProxy</strong>. Once enabled, our firewall will act as a shield, protecting
12
- your site from attacks and preventing malware infections and reinfections. It
13
- will block SQL injection attempts, brute force attacks, XSS, RFI, backdoors and
14
- many other threats against your site.
15
  </p>
 
16
 
17
- <div class="sucuriscan-inline-alert-info sucuriscan-%%SUCURI.Firewall.APIKeyFormVisibility%%">
18
- <p>
19
- Add your <a href="https://waf.sucuri.net/?settings&panel=api" target="_blank">
20
- CloudProxy API key</a> in the form below to start communicating with the firewall
21
- API service.
22
- </p>
23
- </div>
24
-
25
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-firewall-apikey sucuriscan-%%SUCURI.Firewall.APIKeyVisibility%%">
26
- <span class="sucuriscan-monospace">%%SUCURI.Firewall.APIKey%%</span>
27
- <form action="%%SUCURI.URL.Firewall%%" method="post">
28
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
29
- <button type="submit" name="sucuriscan_delete_wafkey" class="button-primary button-danger">Delete</button>
30
- </form>
31
- </div>
32
-
33
- <form action="%%SUCURI.URL.Firewall%%" method="post" class="sucuriscan-%%SUCURI.Firewall.APIKeyFormVisibility%%">
34
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
35
- <span class="sucuriscan-input-group">
36
- <label>CloudProxy API Key:</label>
37
- <input type="text" name="sucuriscan_cloudproxy_apikey" class="input-text" />
38
- </span>
39
- <button type="submit" class="button-primary">Save</button>
40
  </form>
41
-
42
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-firewall-settings sucuriscan-%%SUCURI.Firewall.SettingsVisibility%%">
43
- <thead>
44
- <tr>
45
- <th>Setting Name</th>
46
- <th>Setting Value</th>
47
- </tr>
48
- </thead>
49
-
50
- <tbody>
51
- %%%SUCURI.Firewall.SettingOptions%%%
52
- </tbody>
53
- </table>
54
-
55
- <p>
56
- <em>[1]</em> More information about <a href="https://sucuri.net/website-firewall/"
57
- target="_blank">CloudProxy</a>, features and pricing.<br>
58
- <em>[2]</em> Instructions and videos in the official <a href="https://kb.sucuri.net/cloudproxy"
59
- target="_blank">Knowledge Base</a> site.<br>
60
- <em>[3]</em> <a href="https://login.sucuri.net/signup2/create?CloudProxy" target="_blank">
61
- Sign up</a> for a new account and start protecting your site with CloudProxy.
62
- </p>
63
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Firewall Settings</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ A powerful Web Application Firewall and <b>Intrusion Detection System</b>
8
+ for any WordPress user and many other platforms. This page will help you
9
+ to configure and monitor your site through the <b>Sucuri Firewall</b>.
10
+ Once enabled, our firewall will act as a shield, protecting your site
11
+ from attacks and preventing malware infections and reinfections. It
12
+ will block SQL injection attempts, brute force attacks, XSS, RFI,
13
+ backdoors and many other threats against your site.
14
+ </p>
15
+
16
+ <div class="sucuriscan-inline-alert-info sucuriscan-%%SUCURI.Firewall.APIKeyFormVisibility%%">
17
  <p>
18
+ Add your <a href="https://waf.sucuri.net/?settings&panel=api"
19
+ target="_blank">Firewall API key</a> in the form below to start
20
+ communicating with the firewall API service.
 
 
 
 
21
  </p>
22
+ </div>
23
 
24
+ <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-firewall-apikey sucuriscan-%%SUCURI.Firewall.APIKeyVisibility%%">
25
+ <span class="sucuriscan-monospace">%%SUCURI.Firewall.APIKey%%</span>
26
+ <form action="%%SUCURI.URL.Firewall%%" method="post">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
28
+ <button type="submit" name="sucuriscan_delete_wafkey" class="button button-primary">Delete</button>
 
 
 
 
29
  </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  </div>
31
+
32
+ <form action="%%SUCURI.URL.Firewall%%" method="post" class="sucuriscan-%%SUCURI.Firewall.APIKeyFormVisibility%%">
33
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
34
+ <fieldset class="sucuriscan-clearfix">
35
+ <label>Firewall API Key:</label>
36
+ <input type="text" name="sucuriscan_cloudproxy_apikey" />
37
+ <button type="submit" class="button button-primary">Save</button>
38
+ </fieldset>
39
+ </form>
40
+
41
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-firewall-settings sucuriscan-%%SUCURI.Firewall.SettingsVisibility%%">
42
+ <thead>
43
+ <tr>
44
+ <th>Setting Name</th>
45
+ <th>Setting Value</th>
46
+ </tr>
47
+ </thead>
48
+
49
+ <tbody>
50
+ %%%SUCURI.Firewall.SettingOptions%%%
51
+ </tbody>
52
+ </table>
53
+
54
+ <p>
55
+ <em>[1]</em> More information about the <a href="https://sucuri.net/website-firewall/"
56
+ target="_blank">Sucuri Firewall</a>, features and pricing.<br>
57
+ <em>[2]</em> Instructions and videos in the official <a href="https://kb.sucuri.net/cloudproxy"
58
+ target="_blank">Knowledge Base</a> site.<br>
59
+ <em>[3]</em> <a href="https://login.sucuri.net/signup2/create?CloudProxy" target="_blank">
60
+ Sign up</a> for a new account and start protecting your site.
61
+ </p>
62
  </div>
63
  </div>
inc/tpl/firewall-settings.snippet.tpl CHANGED
@@ -1,5 +1,5 @@
1
 
2
- <tr class="%%SUCURI.Firewall.OptionCssClass%%">
3
  <td><label>%%SUCURI.Firewall.OptionName%%</label></td>
4
  <td><span class="sucuriscan-monospace">%%%SUCURI.Firewall.OptionValue%%%</span></td>
5
  </tr>
1
 
2
+ <tr>
3
  <td><label>%%SUCURI.Firewall.OptionName%%</label></td>
4
  <td><span class="sucuriscan-monospace">%%%SUCURI.Firewall.OptionValue%%%</span></td>
5
  </tr>
inc/tpl/firewall.html.tpl CHANGED
@@ -1,27 +1,21 @@
1
 
2
  <div class="sucuriscan-tabs">
3
- <ul>
4
- <li>
5
- <a href="#settings" data-tabname="settings">Settings</a>
6
- </li>
7
- <li>
8
- <a href="#auditlogs" data-tabname="auditlogs">Audit Logs</a>
9
- </li>
10
- <li>
11
- <a href="#clearcache" data-tabname="clearcache">Clear Cache</a>
12
- </li>
13
  </ul>
14
 
15
- <div class="sucuriscan-tab-containers">
16
- <div id="sucuriscan-settings">
17
  %%%SUCURI.Firewall.Settings%%%
18
  </div>
19
 
20
- <div id="sucuriscan-auditlogs">
21
  %%%SUCURI.Firewall.AuditLogs%%%
22
  </div>
23
 
24
- <div id="sucuriscan-clearcache">
25
  %%%SUCURI.Firewall.ClearCache%%%
26
  </div>
27
  </div>
1
 
2
  <div class="sucuriscan-tabs">
3
+ <ul class="sucuriscan-clearfix sucuriscan-tabs-buttons">
4
+ <li><a href="%%SUCURI.URL.Firewall%%#settings">Settings</a></li>
5
+ <li><a href="%%SUCURI.URL.Firewall%%#auditlogs">Audit Logs</a></li>
6
+ <li><a href="%%SUCURI.URL.Firewall%%#clearcache">Clear Cache</a></li>
 
 
 
 
 
 
7
  </ul>
8
 
9
+ <div class="sucuriscan-tabs-containers">
10
+ <div id="sucuriscan-tabs-settings" class="sucuriscan-hidden">
11
  %%%SUCURI.Firewall.Settings%%%
12
  </div>
13
 
14
+ <div id="sucuriscan-tabs-auditlogs" class="sucuriscan-hidden">
15
  %%%SUCURI.Firewall.AuditLogs%%%
16
  </div>
17
 
18
+ <div id="sucuriscan-tabs-clearcache" class="sucuriscan-hidden">
19
  %%%SUCURI.Firewall.ClearCache%%%
20
  </div>
21
  </div>
inc/tpl/hardening-panel.html.tpl DELETED
@@ -1,35 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-hardening-boxes">
3
- <form method="post">
4
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
5
- <input type="hidden" name="sucuriscan_run_hardening" value="1" />
6
-
7
- %%%SUCURI.Hardening.CloudProxy%%%
8
-
9
- %%%SUCURI.Hardening.Version%%%
10
-
11
- %%%SUCURI.Hardening.PhpVersion%%%
12
-
13
- %%%SUCURI.Hardening.RemoveGenerator%%%
14
-
15
- %%%SUCURI.Hardening.NginxPhpFpm%%%
16
-
17
- %%%SUCURI.Hardening.Upload%%%
18
-
19
- %%%SUCURI.Hardening.WpContent%%%
20
-
21
- %%%SUCURI.Hardening.WpIncludes%%%
22
-
23
- %%%SUCURI.Hardening.SecretKeys%%%
24
-
25
- %%%SUCURI.Hardening.Readme%%%
26
-
27
- %%%SUCURI.Hardening.AdminUser%%%
28
-
29
- %%%SUCURI.Hardening.FileEditor%%%
30
-
31
- %%%SUCURI.Hardening.DBTables%%%
32
-
33
- %%%SUCURI.Hardening.ErrorLog%%%
34
- </form>
35
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/hardening-whitelist.html.tpl DELETED
@@ -1,96 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-hardening-whitelist">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Whitelist Blocked PHP Files</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- After you apply the hardening in either the includes, content, and/or upload
9
- directories the plugin will add a rule in the access control file to deny access
10
- to any PHP file located in these folders, this is a good precaution in case that
11
- an attacker is able to upload a shell script; with a few exceptions the
12
- <em>"index.php"</em> is the only one that should be publicly accessible, however
13
- many theme/plugin developers decide to use these folders to process some
14
- operations, in this case applying the hardening <strong>may break</strong> their
15
- functionality.
16
- </p>
17
-
18
- <div class="sucuriscan-inline-alert-info">
19
- <p>
20
- Note that whitelisted files are global inside the selected directory, this means
21
- that if you whitelist a file named <em>"thumbnail.php"</em> it will match every
22
- file with the same name in all the sub-folders. If you want something more
23
- specific read the <a href="https://httpd.apache.org/docs/2.4/mod/core.html"
24
- target="_blank">official documentation</a>.
25
- </p>
26
- </div>
27
-
28
- <div class="sucuriscan-inline-alert-warning">
29
- <p>
30
- Be warned that whitelisting a PHP file with vulnerabilities will open security
31
- holes in your website that can be exploited by malicious users. If you do not
32
- fully understand the purpose of this form and/or do not know what whitelisting
33
- a PHP file means then ask for support in the <a target="_blank"
34
- href="https://wordpress.org/support/plugin/sucuri-scanner">forums</a>.
35
- </p>
36
- </div>
37
-
38
- <form action="%%SUCURI.URL.Hardening%%#whitelist" method="post">
39
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
40
-
41
- <div class="sucuriscan-clearfix">
42
- <div class="sucuriscan-pull-left">
43
- <label>Whitelist PHP file:</label>
44
- </div>
45
- <div class="sucuriscan-pull-left">
46
- <input type="text" name="sucuriscan_hardening_whitelist" placeholder="e.g. wp-tinymce.php" />
47
- </div>
48
- <div class="sucuriscan-pull-left">
49
- <select name="sucuriscan_hardening_folder">
50
- <option value="wp-includes">wp-includes</option>
51
- <option value="wp-content">wp-content</option>
52
- <option value="wp-content/uploads">wp-content/uploads</option>
53
- </select>
54
- </div>
55
- <div class="sucuriscan-pull-left">
56
- <button type="submit" class="button button-primary">Proceed</button>
57
- </div>
58
- </div>
59
- </form>
60
- </div>
61
- </div>
62
- </div>
63
-
64
- <form action="%%SUCURI.URL.Hardening%%#whitelist" method="post">
65
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
66
-
67
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-hardening-whitelist-table">
68
- <thead>
69
- <th class="manage-column column-cb check-column">
70
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
71
- <input id="cb-select-all-1" type="checkbox">
72
- </th>
73
- <th class="manage-column">Filename</th>
74
- <th class="manage-column">Base Directory</th>
75
- <th class="manage-column">Regular Expression</th>
76
- </thead>
77
-
78
- <tbody>
79
- %%%SUCURI.HardeningWhitelist.List%%%
80
-
81
- <tr class="sucuriscan-%%SUCURI.HardeningWhitelist.NoItemsVisibility%%">
82
- <td colspan="4">
83
- <em>List is empty.</em>
84
- </td>
85
- </tr>
86
- </tbody>
87
-
88
- <tfoot>
89
- <tr>
90
- <td colspan="4">
91
- <button type="submit" class="button button-primary">Delete</button>
92
- </td>
93
- </tr>
94
- </tfoot>
95
- </table>
96
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/hardening.html.tpl DELETED
@@ -1,37 +0,0 @@
1
-
2
- <div class="sucuriscan-tabs">
3
- <script type="text/javascript">
4
- jQuery(document).ready(function ($) {
5
- var total = $('.sucuriscan-hardening-boxes .postbox').length;
6
- var applied = $('.sucuriscan-hardening-boxes .postbox .sucuriscan-hstatus-1').length;
7
-
8
- $('#sucuriscan-hardening-stats').html(
9
- '({{APPLIED}}/{{TOTAL}})'
10
- .replace('{{TOTAL}}', total)
11
- .replace('{{APPLIED}}', applied)
12
- );
13
- });
14
- </script>
15
-
16
- <ul>
17
- <li>
18
- <a href="#hardening" data-tabname="hardening">
19
- <span>Hardening Options</span>
20
- <em id="sucuriscan-hardening-stats">(Loading...)</em>
21
- </a>
22
- </li>
23
- <li>
24
- <a href="#whitelist" data-tabname="whitelist">Whitelist Blocked PHP Files</a>
25
- </li>
26
- </ul>
27
-
28
- <div class="sucuriscan-tab-containers">
29
- <div id="sucuriscan-hardening">
30
- %%%SUCURI.Hardening.Panel%%%
31
- </div>
32
-
33
- <div id="sucuriscan-whitelist">
34
- %%%SUCURI.Hardening.Whitelist%%%
35
- </div>
36
- </div>
37
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/hardening.snippet.tpl DELETED
@@ -1,19 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>%%SUCURI.Hardening.Title%%</h3>
4
-
5
- <div class="inside">
6
- %%%SUCURI.Hardening.Description%%%
7
-
8
- <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.Hardening.Status%% sucuriscan-%%SUCURI.Hardening.StatusVisibility%%">
9
- <input type="submit" name="%%SUCURI.Hardening.FieldName%%"
10
- value="%%SUCURI.Hardening.FieldValue%%"
11
- %%SUCURI.Hardening.FieldAttributes%%
12
- class="button-secondary" />
13
-
14
- <span>%%%SUCURI.Hardening.Information%%%</span>
15
- </div>
16
-
17
- %%%SUCURI.Hardening.UpdateMessage%%%
18
- </div>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-cronjobs.html.tpl DELETED
@@ -1,62 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Scheduled Tasks (%%SUCURI.Cronjobs.Total%% tasks)</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- <strong>Scheduled Tasks</strong> are rules registered in your database by a
9
- plugin, theme, or the base system itself; they are used to automatically execute
10
- actions defined in the code every certain amount of time. A good use of these
11
- rules is to generate backup files of your site, execute a security scanner, or
12
- remove unused elements like drafts.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-warning">
16
- <p>
17
- Note that there are some scheduled tasks <em>(registered by the base
18
- system)</em> that can not be removed permanently using this tool, tasks such as
19
- the <strong>addon update</strong> and <strong>version checker</strong> are
20
- required by the site to work correctly.
21
- </p>
22
- </div>
23
-
24
- <form action="%%SUCURI.URL.Infosys%%#wordpress-cronjobs" method="post">
25
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
26
-
27
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-wpcron-list">
28
- <thead>
29
- <tr>
30
- <th class="manage-column column-cb check-column">
31
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
32
- <input id="cb-select-all-1" type="checkbox">
33
- </th>
34
- <th>Task</th>
35
- <th>Schedule</th>
36
- <th>Next due</th>
37
- <th>Arguments</th>
38
- </tr>
39
- </thead>
40
-
41
- <tbody>
42
- %%%SUCURI.Cronjobs.List%%%
43
- </tbody>
44
- </table>
45
-
46
- <div class="sucuriscan-recipient-form">
47
- <label>
48
- <select name="sucuriscan_cronjob_action">
49
- <option value="">Choose action</option>
50
- <option value="runnow">Execute now</option>
51
- <option value="hourly">Re-schedule to hourly</option>
52
- <option value="twicedaily">Re-schedule to twicedaily</option>
53
- <option value="daily">Re-schedule to daily</option>
54
- <option value="remove">Remove</option>
55
- </select>
56
- </label>
57
- <button type="submit" class="button button-primary">Send action</button>
58
- </div>
59
- </form>
60
- </div>
61
- </div>
62
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-errorlogs-flimit.html.tpl DELETED
@@ -1,24 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Error Logs - File Limit</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- If you are a developer, you may want to check the latest errors encountered by
8
- the server before delete the log file, that way you can see where the application
9
- is failing and fix the errors. Note that a log file may have thousand of lines,
10
- so to prevent an overflow in the memory of the PHP interpreter the plugin limits
11
- the process to the <strong>latest %%SUCURI.ErrorLogs.LogsLimit%% lines</strong>
12
- inserted in the log file.
13
- </p>
14
-
15
- <form action="%%SUCURI.URL.Infosys%%#error-logs" method="post">
16
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
17
- <span class="sucuriscan-input-group">
18
- <label>Error Logs - File Limit:</label>
19
- <input type="text" name="sucuriscan_errorlogs_limit" class="input-text" placeholder="e.g. 30" />
20
- </span>
21
- <button type="submit" class="button-primary">Save</button>
22
- </form>
23
- </div>
24
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-errorlogs-freader.html.tpl DELETED
@@ -1,61 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Error Logs - File Reader</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- Note that if the log file is not empty but the table is, it means that the
8
- format of the logs used by the web server is not supported by the scanner,
9
- you can try to increase the number of lines processed or ask your hosting
10
- provider to change the format of the PHP error log generator.
11
- </p>
12
-
13
- <div class="sucuriscan-inline-alert-warning">
14
- <p>
15
- Note that only the main error log file <em>(usually located in the document
16
- root)</em> will be read, parsed, and listed below, if there are more log files
17
- in sub-directories they will be ignored.
18
- </p>
19
- </div>
20
-
21
- <script type="text/javascript">
22
- jQuery(function($){
23
- $('.sucuriscan-errorlogs-list tbody').html(
24
- '<tr><td colspan="5"><span>Loading <em>(may take '
25
- + 'several seconds)</em>...</span></td></tr>'
26
- );
27
- $.post('%%SUCURI.AjaxURL.Settings%%', {
28
- action: 'sucuriscan_infosys_ajax',
29
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
30
- form_action: 'get_error_logs',
31
- }, function(data){
32
- $('.sucuriscan-errorlogs-list tbody').html(data);
33
- });
34
- });
35
- </script>
36
-
37
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-errorlogs-list">
38
- <thead>
39
- <tr>
40
- <th width="100">Date Time</th>
41
- <th width="50">Type</th>
42
- <th>Error Message</th>
43
- <th width="300">File</th>
44
- <th width="50">Line</th>
45
- </tr>
46
- </thead>
47
-
48
- <tbody>
49
- </tbody>
50
- </table>
51
-
52
- <div class="sucuriscan-recipient-form">
53
- <form action="%%SUCURI.URL.Hardening%%" method="post">
54
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
55
- <input type="hidden" name="sucuriscan_run_hardening" value="1" />
56
- <input type="hidden" name="sucuriscan_harden_errorlog" value="Harden" />
57
- <button type="submit" class="button-primary">Delete Logs</button>
58
- </form>
59
- </div>
60
- </div>
61
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-errorlogs-status.html.tpl DELETED
@@ -1,23 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Error Logs</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- Web servers like Apache, Nginx and others use files to record errors encountered
8
- during the execution of a dynamic language or the server processes. Depending on
9
- the configuration of the server, these files may be accessible from the web
10
- opening a hole in your site to allow an attacker to gather sensitive information
11
- of your project, so it is highly recommended to delete them.
12
- </p>
13
-
14
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
15
- <span>Ignore Scanning is %%SUCURI.ErrorLogs.Status%%</span>
16
- <form action="%%SUCURI.URL.Infosys%%#error-logs" method="post">
17
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
18
- <input type="hidden" name="sucuriscan_parse_errorlogs" value="%%SUCURI.ErrorLogs.SwitchValue%%" />
19
- <button type="submit" class="button-primary %%SUCURI.ErrorLogs.SwitchCssClass%%">%%SUCURI.ErrorLogs.SwitchText%%</button>
20
- </form>
21
- </div>
22
- </div>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-errorlogs.html.tpl DELETED
@@ -1,8 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-general-errorlogs">
3
- %%%SUCURI.ErrorLogs.Status%%%
4
-
5
- %%%SUCURI.ErrorLogs.FileLimit%%%
6
-
7
- %%%SUCURI.ErrorLogs.FileReader%%%
8
- </div>
 
 
 
 
 
 
 
 
inc/tpl/infosys-errorlogs.snippet.tpl DELETED
@@ -1,8 +0,0 @@
1
-
2
- <tr class="%%SUCURI.ErrorLog.CssClass%%">
3
- <td>%%SUCURI.ErrorLog.DateTime%%</td>
4
- <td><a href="#" title="%%SUCURI.ErrorLog.ErrorType%%" class="sucuriscan-label-%%SUCURI.ErrorLog.ErrorCode%%">%%SUCURI.ErrorLog.ErrorAbbr%%</a></td>
5
- <td><span class="sucuriscan-wraptext">%%SUCURI.ErrorLog.ErrorMessage%%</span></td>
6
- <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.ErrorLog.FilePath%%</span></td>
7
- <td><span class="sucuriscan-monospace">%%SUCURI.ErrorLog.LineNumber%%</span></td>
8
- </tr>
 
 
 
 
 
 
 
 
inc/tpl/infosys-htaccess.html.tpl DELETED
@@ -1,41 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-infosys-htaccess">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Access File Integrity</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- The <code>.htaccess</code> is a distributed configuration file, and is how the
9
- Apache web server handles configuration changes on a per-directory basis.
10
- WordPress uses this file to manipulate how Apache serves files from its root
11
- directory and subdirectories thereof; most notably, it modifies this file to be
12
- able to handle pretty permalinks.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-updated sucuriscan-%%SUCURI.HTAccess.FoundVisible%%">
16
- <p>HTAccess file found in this path <code>%%SUCURI.HTAccess.Fpath%%</code></p>
17
- </div>
18
-
19
- <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.HTAccess.NotFoundVisible%%">
20
- <p>Your website has no <code>.htaccess</code> file or it was not found in the default location.</p>
21
- </div>
22
-
23
- <div class="sucuriscan-inline-alert-info sucuriscan-%%SUCURI.HTAccess.StandardVisible%%">
24
- <p>
25
- The main <code>.htaccess</code> file in your site has the standard rules for a
26
- WordPress installation. You can customize it to improve the performance and
27
- change the behaviour of the redirections for pages and posts in your site. To
28
- get more information visit the official documentation at <a target="_blank"
29
- href="https://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29">
30
- Codex WordPrexx - Creating and editing (.htaccess)</a>
31
- </p>
32
- </div>
33
-
34
- <textarea class="sucuriscan-full-textarea sucuriscan-monospace %%SUCURI.HTAccess.TextareaVisible%%">%%SUCURI.HTAccess.Content%%</textarea>
35
-
36
- <p>
37
- <small>Source <a href="https://codex.wordpress.org/htaccess" target="_blank">Codex WordPress HTAccess</a></small>
38
- </p>
39
- </div>
40
- </div>
41
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-serverinfo.html.tpl DELETED
@@ -1,6 +0,0 @@
1
-
2
- <table class="wp-list-table widefat sucuriscan-server-info">
3
- <tbody>
4
- %%%SUCURI.ServerInfo.Variables%%%
5
- </tbody>
6
- </table>
 
 
 
 
 
 
inc/tpl/infosys-wpconfig.html.tpl DELETED
@@ -1,13 +0,0 @@
1
-
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-wpconfig-rules">
3
- <thead>
4
- <tr>
5
- <th>Variable</th>
6
- <th>Value</th>
7
- </tr>
8
- </thead>
9
-
10
- <tbody>
11
- %%%SUCURI.WordpressConfig.Rules%%%
12
- </tbody>
13
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/infosys-wpconfig.snippet.tpl DELETED
@@ -1,5 +0,0 @@
1
-
2
- <tr class="%%SUCURI.WordpressConfig.CssClass%%">
3
- <td><span class="sucuriscan-monospace">%%SUCURI.WordpressConfig.VariableName%%</span></td>
4
- <td><span class="sucuriscan-wraptext %%SUCURI.WordpressConfig.VariableCssClass%%">%%SUCURI.WordpressConfig.VariableValue%%</span></td>
5
- </tr>
 
 
 
 
 
inc/tpl/infosys.html.tpl DELETED
@@ -1,42 +0,0 @@
1
-
2
- <div class="sucuriscan-tabs">
3
- <ul>
4
- <li>
5
- <a href="#server-info" data-tabname="server-info">Plugin &amp; Server Info</a>
6
- </li>
7
- <li>
8
- <a href="#wordpress-cronjobs" data-tabname="wordpress-cronjobs">Scheduled Tasks</a>
9
- </li>
10
- <li>
11
- <a href="#htaccess-integrity" data-tabname="htaccess-integrity">Access File Integrity</a>
12
- </li>
13
- <li>
14
- <a href="#wpconfig-vars" data-tabname="wpconfig-vars">Config. Variables</a>
15
- </li>
16
- <li>
17
- <a href="#error-logs" data-tabname="error-logs">Error Logs</a>
18
- </li>
19
- </ul>
20
-
21
- <div class="sucuriscan-tab-containers">
22
- <div id="sucuriscan-server-info">
23
- %%%SUCURI.ServerInfo%%%
24
- </div>
25
-
26
- <div id="sucuriscan-wordpress-cronjobs">
27
- %%%SUCURI.Cronjobs%%%
28
- </div>
29
-
30
- <div id="sucuriscan-htaccess-integrity">
31
- %%%SUCURI.HTAccessIntegrity%%%
32
- </div>
33
-
34
- <div id="sucuriscan-wpconfig-vars">
35
- %%%SUCURI.WordpressConfig%%%
36
- </div>
37
-
38
- <div id="sucuriscan-error-logs">
39
- %%%SUCURI.ErrorLogs%%%
40
- </div>
41
- </div>
42
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/integrity-auditlogs.html.tpl DELETED
@@ -1,102 +0,0 @@
1
-
2
- <script type="text/javascript">
3
- jQuery(function ($) {
4
- var sucuriscanLoadAuditLogs = function (page, reset) {
5
- var url = '%%SUCURI.AjaxURL.Home%%';
6
-
7
- if (page !== undefined && page > 0) {
8
- url += '&paged=' + page;
9
- }
10
-
11
- if (reset === true) {
12
- var loading = '<tr><td colspan="5"><em>Loading...</em></td></tr>';
13
- $('.sucuriscan-auditlogs tbody').html(loading);
14
- }
15
-
16
- $('.sucuriscan-pagination-loading').html('Loading...');
17
-
18
- $.post(url, {
19
- action: 'sucuriscan_ajax',
20
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
21
- form_action: 'get_audit_logs',
22
- }, function (data) {
23
- if (data.content) {
24
- $('.sucuriscan-auditlogs tbody').html(data.content);
25
- $('.sucuriscan-pagination-loading').html('');
26
- $('.sucuriscan-auditlogs-count').html('(' + data.count + ' latest logs)');
27
-
28
- if (data.pagination !== '') {
29
- $('.sucuriscan-auditlogs .sucuriscan-pagination').html(data.pagination);
30
- }
31
-
32
- if (data.enable_report) {
33
- $('.sucuriscan-audit-report').removeClass('sucuriscan-hidden');
34
- }
35
- } else if (typeof data === 'object') {
36
- $('.sucuriscan-auditlogs tbody').html(
37
- '<tr><td colspan="5">Unrecoverable error</td></tr>');
38
- } else {
39
- $('.sucuriscan-auditlogs tbody').html(
40
- '<tr><td colspan="5">' + data + '</td></tr>');
41
- }
42
- });
43
- }
44
-
45
- setTimeout(function () {
46
- sucuriscanLoadAuditLogs(0, true);
47
- }, 100);
48
-
49
- $('.sucuriscan-auditlogs').on('click', '.sucuriscan-pagination-link', function (event) {
50
- event.preventDefault();
51
- sucuriscanLoadAuditLogs($(this).attr('data-page'));
52
- });
53
- });
54
- </script>
55
-
56
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-table-double-title sucuriscan-auditlogs">
57
- <thead>
58
- <tr>
59
- <th colspan="5" class="thead-with-button">
60
- <span>Audit Logs</span>
61
- <span class="sucuriscan-auditlogs-count">(Loading...)</span>
62
-
63
- <form action="%%SUCURI.URL.Settings%%" method="post"
64
- class="thead-topright-action sucuriscan-hidden sucuriscan-audit-report">
65
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
66
- <input type="hidden" name="sucuriscan_audit_report" value="enable" />
67
- <button type="submit" class="button-primary">Enable Audit Report</button>
68
- </form>
69
- </th>
70
- </tr>
71
-
72
- <tr>
73
- <th>&nbsp;</th>
74
- <th width="200">Date</th>
75
- <th>Username</th>
76
- <th>IP Address</th>
77
- <th>Event Message</th>
78
- </tr>
79
- </thead>
80
-
81
- <tbody>
82
- <tr>
83
- <td colspan="5">
84
- <em>Loading...</em>
85
- </td>
86
- </tr>
87
- </tbody>
88
-
89
- <tfoot>
90
- <td colspan="5">
91
- <div class="sucuriscan-clearfix">
92
- <ul class="sucuriscan-pull-left sucuriscan-pagination">
93
- <!-- Populated via JavaScript -->
94
- </ul>
95
-
96
- <div class="sucuriscan-pull-right sucuriscan-pagination-loading">
97
- <!-- Populated via JavaScript -->
98
- </div>
99
- </div>
100
- </td>
101
- </tfoot>
102
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/integrity-auditlogs.snippet.tpl DELETED
@@ -1,15 +0,0 @@
1
-
2
- <tr class="%%SUCURI.AuditLog.CssClass%%">
3
- <td>
4
- <span class="sucuriscan-label sucuriscan-auditlog-%%SUCURI.AuditLog.Event%%"
5
- title="%%SUCURI.AuditLog.EventTitle%%">&nbsp;</span>
6
- </td>
7
- <td>%%SUCURI.AuditLog.DateTime%%</td>
8
- <td><span class="sucuriscan-monospace">%%SUCURI.AuditLog.Username%%</span></td>
9
- <td><span class="sucuriscan-monospace">%%SUCURI.AuditLog.RemoteAddress%%</span></td>
10
- <td>
11
- <span>%%SUCURI.AuditLog.Message%%</span>
12
-
13
- %%%SUCURI.AuditLog.Extra%%%
14
- </td>
15
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/integrity-auditreport.html.tpl DELETED
@@ -1,109 +0,0 @@
1
-
2
- <div class="postbox sucuriscan-audit-report sucuriscan-border">
3
- <h3>Audit Report</h3>
4
-
5
- <div class="inside">
6
-
7
- <div class="sucuriscan-inline-alert-info">
8
- <p>
9
- The data used to generate these charts comes from the last
10
- <strong>%%SUCURI.AuditReport.Logs4Report%% audit logs</strong>, you can
11
- configure this number from the plugin settings page, you can also disable
12
- and enable this panel from there at any time.
13
- </p>
14
- </div>
15
-
16
- <div class="sucuriscan-clearfix sucuriscan-report-row">
17
-
18
- <div class="sucuriscan-pull-left sucuriscan-report-chart">
19
- <h4>Audit Logs per Event</h4>
20
- <h5>source https://sucuri.net/</h5>
21
- <div id="sucuriscan-report-events-per-type"></div>
22
- </div>
23
-
24
- <div class="sucuriscan-pull-right sucuriscan-report-chart">
25
- <h4>Successful/Failed Logins</h4>
26
- <h5>source https://sucuri.net/</h5>
27
- <div id="sucuriscan-report-events-per-login"></div>
28
- </div>
29
-
30
- </div>
31
-
32
- <div class="sucuriscan-clearfix sucuriscan-report-row">
33
-
34
- <div class="sucuriscan-pull-left sucuriscan-report-chart">
35
- <h4>Audit Logs per User</h4>
36
- <h5>source https://sucuri.net/</h5>
37
- <div id="sucuriscan-report-events-per-user"></div>
38
- </div>
39
-
40
- <div class="sucuriscan-pull-right sucuriscan-report-chart">
41
- <h4>Audit Logs per IP Address</h4>
42
- <h5>source https://sucuri.net/</h5>
43
- <div id="sucuriscan-report-events-per-ipaddress"></div>
44
- </div>
45
-
46
- </div>
47
-
48
- </div>
49
- </div>
50
-
51
- <script type="text/javascript">
52
- jQuery(document).ready(function($){
53
-
54
- var sucuriscan_pie_chart = function( element, series, colors ){
55
- c3.generate({
56
- bindto: element,
57
- size: { height: 250 },
58
- padding: { top: 10, bottom: 10 },
59
- color: { pattern: colors },
60
- legend: { position: 'right' },
61
- data: { type: 'pie', labels: true, columns: series },
62
- });
63
- };
64
-
65
- var sucuriscan_bar_chart = function( element, categories, series ){
66
- c3.generate({
67
- bindto: element,
68
- size: { height: 320 },
69
- padding: { top: 10, bottom: 0 },
70
- tooltip: { show: false },
71
- legend: { show: false },
72
- data: { type: 'bar', labels: true, columns: [ series ] },
73
- axis: {
74
- rotated: true,
75
- x: { type: 'category', categories: categories },
76
- },
77
- });
78
- };
79
-
80
- /* Pie-chart with number of audit logs per event type. */
81
- sucuriscan_pie_chart(
82
- '#sucuriscan-report-events-per-type',
83
- [ %%%SUCURI.AuditReport.EventsPerType%%% ],
84
- [ %%%SUCURI.AuditReport.EventColors%%% ]
85
- );
86
-
87
- /* Column-chart with number of audit logs per event login. */
88
- sucuriscan_pie_chart(
89
- '#sucuriscan-report-events-per-login',
90
- [ %%%SUCURI.AuditReport.EventsPerLogin%%% ],
91
- [ '#5cb85c', '#f27d7d' ]
92
- );
93
-
94
- /* Bar-chart with number of audit logs per user account. */
95
- sucuriscan_bar_chart(
96
- '#sucuriscan-report-events-per-user',
97
- [ %%%SUCURI.AuditReport.EventsPerUserCategories%%% ],
98
- [ 'data', %%%SUCURI.AuditReport.EventsPerUserSeries%%% ]
99
- );
100
-
101
- /* Bar-chart with number of audit logs per remote address. */
102
- sucuriscan_bar_chart(
103
- '#sucuriscan-report-events-per-ipaddress',
104
- [ %%%SUCURI.AuditReport.EventsPerIPAddressCategories%%% ],
105
- [ 'data', %%%SUCURI.AuditReport.EventsPerIPAddressSeries%%% ]
106
- );
107
-
108
- });
109
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/integrity-correct.html.tpl ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel sucuriscan-integrity sucuriscan-integrity-correct">
3
+ <div class="sucuriscan-clearfix">
4
+ <div class="sucuriscan-pull-left sucuriscan-integrity-left">
5
+ <h2 class="sucuriscan-title">WordPress Integrity</h2>
6
+
7
+ <p>
8
+ We inspect your WordPress installation and look for modifications
9
+ on the core files as provided by WordPress.org. Files located in
10
+ the root directory, wp-admin and wp-includes will be compared against
11
+ the files distributed with v%%SUCURI.WordPressVersion%%; all files with
12
+ inconsistencies will be listed here. Any changes might indicate a hack.
13
+ </p>
14
+ </div>
15
+
16
+ <div class="sucuriscan-pull-right sucuriscan-integrity-right">
17
+ <h2 class="sucuriscan-subtitle">All Core WordPress Files Are Correct</h2>
18
+
19
+ <p>
20
+ We have not identified additional files, deleted files, or relevant
21
+ changes to the core files in your WordPress installation. If you are
22
+ experiencing other malware issues, please use a <a target="_blank"
23
+ href="https://sucuri.net/website-security/malware-removal">Server
24
+ Side Scanner</a>.
25
+ </p>
26
+
27
+ <p><a href="%%SUCURI.URL.Settings%%#scanner">Review False/Positives</a></p>
28
+ </div>
29
+ </div>
30
+
31
+ %%%SUCURI.SiteCheck.Details%%%
32
+ </div>
inc/tpl/integrity-diff-utility.html.tpl ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-integrity-diff-utility">
3
+ <div class="sucuriscan-inline-alert-info">
4
+ <p>
5
+ The Unix Diff Utility is enabled. You can click the files marked
6
+ as modified <em>(the ones with the purple flag)</em> to see the
7
+ differences detected by the scanner. If you consider the differences
8
+ to be harmless you can mark the file as fixed, otherwise it is adviced
9
+ to restore the original content immediately.
10
+ </p>
11
+ </div>
12
+
13
+ <div class="sucuriscan-hidden sucuriscan-diff-instructions">
14
+ <p>
15
+ Lines with a <b>minus</b> sign as the prefix <em>(here in red)</em>
16
+ show the original code. Lines with a <b>plus</b> sign as the prefix
17
+ <em>(here in green)</em> show the modified code. You can read more
18
+ about the DIFF format from the WikiPedia article about the <a target="_blank"
19
+ href="https://en.wikipedia.org/wiki/Diff_utility" rel="noopener">Unix Diff Utility</a>.
20
+ </p>
21
+ </div>
22
+
23
+ %%%SUCURI.DiffUtility.Modal%%%
24
+
25
+ <script type="text/javascript">
26
+ /* global jQuery */
27
+ /* jshint camelcase: false */
28
+ jQuery(function ($) {
29
+ $('.sucuriscan-integrity-table .sucuriscan-integrity-filepath').on('click', function (event) {
30
+ event.preventDefault();
31
+
32
+ window.scrollTo(0, 0);
33
+ var filepath = $(this).attr('data-filepath');
34
+ $('.sucuriscan-diff-utility-modal').removeClass('sucuriscan-hidden');
35
+ $('.sucuriscan-diff-utility-modal .sucuriscan-modal-inside').html('Loading...');
36
+
37
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
38
+ action: 'sucuriscan_ajax',
39
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
40
+ form_action: 'integrity_diff_utility',
41
+ filepath: filepath,
42
+ }, function (data) {
43
+ var instructions = $('.sucuriscan-diff-instructions').html();
44
+ $('.sucuriscan-diff-utility-modal .sucuriscan-modal-inside').html(data);
45
+ $('.sucuriscan-diff-content').before(instructions);
46
+ });
47
+ });
48
+ });
49
+ </script>
50
+ </div>
inc/tpl/integrity-incorrect.html.tpl ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel sucuriscan-integrity sucuriscan-integrity-incorrect">
3
+ <div class="sucuriscan-clearfix">
4
+ <div class="sucuriscan-pull-left sucuriscan-integrity-left">
5
+ <h2 class="sucuriscan-title">WordPress Integrity</h2>
6
+
7
+ <p>
8
+ We inspect your WordPress installation and look for modifications
9
+ on the core files as provided by WordPress.org. Files located in
10
+ the root directory, wp-admin and wp-includes will be compared against
11
+ the files distributed with v%%SUCURI.WordPressVersion%%; all files with
12
+ inconsistencies will be listed here. Any changes might indicate a hack.
13
+ </p>
14
+ </div>
15
+
16
+ <div class="sucuriscan-pull-right sucuriscan-integrity-right">
17
+ <h2 class="sucuriscan-subtitle">Core WordPress Files Were Modified</h2>
18
+
19
+ <p>
20
+ We identified that some of your WordPress core files were modified.
21
+ That might indicate a hack or a broken file on your installation.
22
+ If you are experiencing other malware issues, please use a
23
+ <a href="https://sucuri.net/website-security/malware-removal"
24
+ target="_blank">Server Side Scanner</a>.
25
+ </p>
26
+
27
+ <p><a href="%%SUCURI.URL.Settings%%#scanner">Review False/Positives</a></p>
28
+ </div>
29
+ </div>
30
+
31
+ %%%SUCURI.SiteCheck.Details%%%
32
+
33
+ %%%SUCURI.Integrity.DiffUtility%%%
34
+
35
+ <form action="%%SUCURI.URL.Dashboard%%" method="post" class="sucuriscan-%%SUCURI.Integrity.BadVisibility%%">
36
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
37
+
38
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-integrity-table">
39
+ <thead>
40
+ <tr>
41
+ <th colspan="5">WordPress Integrity (%%SUCURI.Integrity.ListCount%% files)</th>
42
+ </tr>
43
+
44
+ <tr>
45
+ <td id="cb" class="manage-column column-cb check-column">
46
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
47
+ <input id="cb-select-all-1" type="checkbox">
48
+ </td>
49
+ <th width="20" class="manage-column">&nbsp;</th>
50
+ <th width="100" class="manage-column">File Size</th>
51
+ <th width="200" class="manage-column">Modified At</th>
52
+ <th class="manage-column">File Path</th>
53
+ </tr>
54
+ </thead>
55
+
56
+ <tbody>
57
+ %%%SUCURI.Integrity.List%%%
58
+ </tbody>
59
+ </table>
60
+
61
+ <div class="sucuriscan-inline-alert-info">
62
+ <p>
63
+ Marking one or more files as fixed will force the plugin to ignore them during
64
+ the next scan, very useful when you find false positives. Additionally you can
65
+ restore the original content of the core files that appear as modified or deleted,
66
+ this will tell the plugin to download a copy of the original files from the official
67
+ <a href="https://core.svn.wordpress.org/tags/" target="_blank" rel="noopener">WordPress repository</a>.
68
+ Deleting a file is an irreversible action, be careful.
69
+ </p>
70
+ </div>
71
+
72
+ <p>
73
+ <label>
74
+ <input type="hidden" name="sucuriscan_process_form" value="0" />
75
+ <input type="checkbox" name="sucuriscan_process_form" value="1" />
76
+ <span>I understand that this operation can not be reverted.</span>
77
+ </label>
78
+ </p>
79
+
80
+ <fieldset class="sucuriscan-clearfix">
81
+ <label>Integrity Action:</label>
82
+ <select name="sucuriscan_integrity_action">
83
+ <option value="fixed">Mark as Fixed</option>
84
+ <option value="restore">Restore File</option>
85
+ <option value="delete">Delete File</option>
86
+ </select>
87
+ <button type="submit" class="button button-primary">Proceed</button>
88
+ </fieldset>
89
+ </form>
90
+ </div>
inc/tpl/integrity-incorrect.snippet.tpl ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <tr>
3
+ <th class="check-column">
4
+ <input type="checkbox" name="sucuriscan_integrity[]" value="%%SUCURI.Integrity.StatusType%%@%%SUCURI.Integrity.FilePath%%" />
5
+ </th>
6
+
7
+ <td>
8
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15.5px" height="18.5px" class="sucuriscan-integrity-%%SUCURI.Integrity.StatusType%%">
9
+ <path fill-rule="evenodd" stroke="rgb(0, 0, 0)" stroke-width="1px" stroke-linecap="butt" stroke-linejoin="miter" d="M9.845,4.505 L14.481,7.098 L13.639,11.471 L8.498,11.503 L9.845,4.505 Z" />
10
+ <path fill-rule="evenodd" stroke="rgb(0, 0, 0)" stroke-width="1px" stroke-linecap="butt" stroke-linejoin="miter" d="M3.500,1.500 L10.500,3.750 L10.500,9.375 L3.500,10.500 L3.500,1.500 Z" />
11
+ <path class="flag-bar" fill-rule="evenodd" stroke="rgb(0, 0, 0)" stroke-width="1px" stroke-linecap="butt" stroke-linejoin="miter" fill="rgb(255, 255, 255)" d="M1.500,1.500 L3.500,1.500 L3.500,16.500 L1.500,16.500 L1.500,1.500 Z" />
12
+ </svg>
13
+
14
+ <span class="sucuriscan-hidden">%%SUCURI.Integrity.StatusType%%</span>
15
+ </td>
16
+
17
+ <td><span title="%%SUCURI.Integrity.FileSizeNumber%% bytes">%%SUCURI.Integrity.FileSizeHuman%%</span></td>
18
+
19
+ <td>%%SUCURI.Integrity.ModifiedAt%%</td>
20
+
21
+ <td class="sucuriscan-integrity-filepath" data-filepath="%%SUCURI.Integrity.FilePath%%">
22
+ <span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.Integrity.FilePath%%</span>
23
+
24
+ <span class="sucuriscan-tooltip sucuriscan-%%SUCURI.Integrity.ErrorVisibility%%" content="%%SUCURI.Integrity.ErrorMessage%%">
25
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">
26
+ <path fill="#dd3d36" d="m6.998315,0.033333c-3.846307,0 -6.964982,
27
+ 3.118675 -6.964982,6.964982s3.118675,6.965574 6.964982,6.965574s6.965574,
28
+ -3.119267 6.965574,-6.965574s-3.119267,-6.964982 -6.965574,-6.964982zm1.449957,
29
+ 10.794779c-0.358509,0.141517 -0.643901,0.248833 -0.857945,0.32313c-0.213455,
30
+ 0.074296 -0.461699,0.111444 -0.744143,0.111444c-0.433985,0 -0.771855,
31
+ -0.106137 -1.012434,-0.317823s-0.360279,-0.479978 -0.360279,-0.806055c0,
32
+ -0.126776 0.008845,-0.256499 0.026534,-0.388581c0.018281,-0.132082 0.047174,
33
+ -0.280675 0.086679,-0.447547l0.448727,-1.584988c0.039507,-0.152131 0.073707,
34
+ -0.296596 0.100831,-0.431036c0.027123,-0.135621 0.040097,-0.260037 0.040097,
35
+ -0.37325c0,-0.201661 -0.041865,-0.343178 -0.125008,-0.422782c-0.08432,
36
+ -0.079603 -0.242937,-0.11852 -0.479388,-0.11852c-0.115572,0 -0.234682,
37
+ 0.0171 -0.35674,0.05307c-0.120879,0.037148 -0.225837,0.070758 -0.311926,
38
+ 0.103779l0.118521,-0.488235c0.293647,-0.119699 0.574911,-0.222299 0.843204,
39
+ -0.307209c0.268291,-0.086089 0.521842,-0.128543 0.760652,-0.128543c0.431036,
40
+ 0 0.7636,0.104959 0.997693,0.312517c0.232913,0.208147 0.350253,0.478797 0.350253,
41
+ 0.811363c0,0.068989 -0.008255,0.190458 -0.024174,0.363815c-0.015921,
42
+ 0.173947 -0.045994,0.332565 -0.089628,0.478209l-0.446368,1.580269c-0.036558,
43
+ 0.126776 -0.068988,0.271831 -0.098472,0.433985c-0.028893,0.162156 -0.043043,
44
+ 0.285983 -0.043043,0.369123c0,0.209916 0.046582,0.353202 0.140926,
45
+ 0.429268c0.093164,0.076064 0.256498,0.114392 0.487643,0.114392c0.109086,
46
+ 0 0.231144,-0.019459 0.369124,-0.057197c0.136799,-0.037737 0.23586,
47
+ -0.071349 0.298364,-0.100241l-0.119699,0.487643zm-0.079014,-6.414247c-0.208148,
48
+ 0.193407 -0.45875,0.290109 -0.751808,0.290109c-0.292469,0 -0.54484,
49
+ -0.096702 -0.754756,-0.290109c-0.208737,-0.193406 -0.314285,-0.428678 -0.314285,
50
+ -0.703457c0,-0.274188 0.106138,-0.51005 0.314285,-0.705225c0.208148,
51
+ -0.195175 0.462287,-0.293058 0.754756,-0.293058c0.293058,0 0.54425,
52
+ 0.097293 0.751808,0.293058c0.208146,0.195175 0.312516,0.431036 0.312516,
53
+ 0.705225c0,0.275368 -0.10437,0.510051 -0.312516,0.703457z">
54
+ </path>
55
+ </svg>
56
+ </span>
57
+ </td>
58
+ </tr>
inc/tpl/integrity-modifiedfiles.html.tpl DELETED
@@ -1,88 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Modified Files</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- The scanner searches the WordPress content directory for files that were
9
- modified during the number of days specified by the user in the request. If your
10
- site was recently attacked, you can see which files were modified to assist with
11
- any investigation. Other WordPress core directories are scanned automatically
12
- with the core integrity checker, if you want to scan other directories that are
13
- not part of the official WordPress packages you have to ask for assistance to
14
- your hosting provider.
15
- </p>
16
-
17
- <div class="sucuriscan-inline-alert-info">
18
- <p>
19
- Note that in most Unix file systems, a file is considered modified when its
20
- inode data is changed; that is, when the permissions, owner, group, or other
21
- metadata from the inode is updated. Considering this it may be possible to have
22
- false-positives in the result.
23
- </p>
24
- </div>
25
-
26
- <div class="sucuriscan-inline-alert-warning">
27
- <p>
28
- Depending on the number of files stored in your website this operation may fail
29
- due to limitations set by your hosting provider to keep the memory assignation
30
- of the PHP scripts in certain numbers. If you have issues executing this tool
31
- ask your hosting provider to assist you in the configuration of your website to
32
- allow the execution of this script.
33
- </p>
34
- </div>
35
-
36
- <form action="%%SUCURI.URL.Scanner%%" method="post" id="sucuriscan-modfiles-form">
37
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
38
- <span class="sucuriscan-input-group">
39
- <label>Search Files Modified</label>
40
- <select id="sucuriscan_back_days">
41
- %%%SUCURI.ModifiedFiles.SelectOptions%%%
42
- </select>
43
- </span>
44
- <button id="sucuriscan-modfiles-button" class="button-primary">Proceed</button>
45
- </form>
46
- </div>
47
-
48
- <script type="text/javascript">
49
- jQuery(function($){
50
- $('#sucuriscan-modfiles-button').on('click', function(ev){
51
- ev.preventDefault();
52
- $('.sucuriscan-modifiedfiles tbody').html(
53
- '<tr><td colspan="3"><span>Loading <em>(may take '
54
- + 'several seconds)</em>...</span></td></tr>'
55
- );
56
- $.post('%%SUCURI.AjaxURL.Scanner%%', {
57
- action: 'sucuriscan_scanner_ajax',
58
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
59
- form_action: 'get_modfiles',
60
- }, function(data){
61
- $('.sucuriscan-modifiedfiles tbody').html(data);
62
- });
63
- });
64
- $('#sucuriscan-modfiles-button').click();
65
- });
66
- </script>
67
- </div>
68
- </div>
69
-
70
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-table-double-title sucuriscan-modifiedfiles">
71
- <thead>
72
- <tr>
73
- <th colspan="3" class="sucuriscan-clearfix thead-with-button">
74
- <span>Modified files <em>(inside the content directory)</em></span>
75
- <span class="thead-topright-action">&nbsp;</span>
76
- </th>
77
- </tr>
78
-
79
- <tr>
80
- <th width="200">Modification</th>
81
- <th width="100">File Size</th>
82
- <th>File Path</th>
83
- </tr>
84
- </thead>
85
-
86
- <tbody>
87
- </tbody>
88
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/integrity-modifiedfiles.snippet.tpl DELETED
@@ -1,6 +0,0 @@
1
-
2
- <tr class="sucuriscan-wraptext %%SUCURI.ModifiedFiles.CssClass%%">
3
- <td>%%SUCURI.ModifiedFiles.DateTime%%</td>
4
- <td><em title="%%SUCURI.ModifiedFiles.FileSizeNumber%% bytes">~%%SUCURI.ModifiedFiles.FileSizeHuman%%</em></td>
5
- <td><span class="sucuriscan-monospace">%%SUCURI.ModifiedFiles.FilePath%%</span></td>
6
- </tr>
 
 
 
 
 
 
inc/tpl/{corefiles-notification.html.tpl → integrity-notification.html.tpl} RENAMED
@@ -12,7 +12,7 @@
12
  <thead>
13
  <tr>
14
  <th colspan="5">
15
- Core integrity (%%SUCURI.CoreFiles.ListCount%% files)
16
  </th>
17
  </tr>
18
 
@@ -26,7 +26,7 @@
26
  </thead>
27
 
28
  <tbody>
29
- %%%SUCURI.CoreFiles.List%%%
30
  </tbody>
31
 
32
  <tfoot>
@@ -38,7 +38,7 @@
38
  <a href="%%SUCURI.URL.Scanner%%">malware scan</a> tool. If you see the
39
  text <em>"must be fixed manually"</em> in any of these files that means
40
  that they do not have write permissions so you can not fix them using
41
- this tool. Access the <a href="%%SUCURI.URL.Home%%">admin area</a> of
42
  your website to fix these files.
43
  </p>
44
 
12
  <thead>
13
  <tr>
14
  <th colspan="5">
15
+ Core integrity (%%SUCURI.Integrity.ListCount%% files)
16
  </th>
17
  </tr>
18
 
26
  </thead>
27
 
28
  <tbody>
29
+ %%%SUCURI.Integrity.List%%%
30
  </tbody>
31
 
32
  <tfoot>
38
  <a href="%%SUCURI.URL.Scanner%%">malware scan</a> tool. If you see the
39
  text <em>"must be fixed manually"</em> in any of these files that means
40
  that they do not have write permissions so you can not fix them using
41
+ this tool. Access the <a href="%%SUCURI.URL.Dashboard%%">admin area</a> of
42
  your website to fix these files.
43
  </p>
44
 
inc/tpl/integrity-wpoutdate.html.tpl DELETED
@@ -1,10 +0,0 @@
1
-
2
- <div class="sucuriscan-wordpress-outdated sucuriscan-%%SUCURI.WordPress.UpdateVisibility%%">
3
- <a href="%%SUCURI.WordPress.UpdateURL%%" target="_blank"
4
- class="button button-primary button-danger button-hero sucuriscan-btnblock">
5
- WordPress %%SUCURI.WordPress.Version%% is Outdated
6
- &nbsp;-&nbsp;
7
- Install New Version %%SUCURI.WordPress.NewVersion%%
8
- <em>(%%SUCURI.WordPress.NewLocale%%)</em>
9
- </a>
10
- </div>
 
 
 
 
 
 
 
 
 
 
inc/tpl/integrity.html.tpl CHANGED
@@ -1,10 +1,42 @@
1
 
2
- <div class="sucuriscan-panelstuff">
3
- %%%SUCURI.WordpressVersion%%%
 
 
 
 
 
 
 
 
 
 
 
4
 
5
- %%%SUCURI.CoreFiles%%%
 
6
 
7
- %%%SUCURI.AuditReports%%%
 
 
 
8
 
9
- %%%SUCURI.AuditLogs%%%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  </div>
1
 
2
+ <script type="text/javascript">
3
+ /* global jQuery */
4
+ /* jshint camelcase: false */
5
+ jQuery(function ($) {
6
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
7
+ action: 'sucuriscan_ajax',
8
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
9
+ form_action: 'check_wordpress_integrity',
10
+ }, function (data) {
11
+ $('#sucuriscan-integrity-response').html(data);
12
+ });
13
+ });
14
+ </script>
15
 
16
+ <div id="sucuriscan-integrity-response">
17
+ <!-- Populated by JavaScript -->
18
 
19
+ <div class="sucuriscan-panel sucuriscan-integrity sucuriscan-integrity-loading">
20
+ <div class="sucuriscan-clearfix">
21
+ <div class="sucuriscan-pull-left sucuriscan-integrity-left">
22
+ <h2 class="sucuriscan-title">WordPress Integrity</h2>
23
 
24
+ <p>
25
+ We inspect your WordPress installation and look for modifications
26
+ on the core files as provided by WordPress.org. Files located in
27
+ the root directory, wp-admin and wp-includes will be compared against
28
+ the files distributed with v%%SUCURI.WordPressVersion%%; all files with
29
+ inconsistencies will be listed here. Any changes might indicate a hack.
30
+ </p>
31
+ </div>
32
+
33
+ <div class="sucuriscan-pull-right sucuriscan-integrity-right">
34
+ <div class="sucuriscan-integrity-missing">
35
+ <!-- Missing data; display loading message -->
36
+ </div>
37
+ </div>
38
+ </div>
39
+
40
+ <p>Loading...</p>
41
+ </div>
42
  </div>
inc/tpl/lastlogins-admins-lastlogin.snippet.tpl CHANGED
@@ -1,5 +1,6 @@
1
 
2
- <tr class="%%SUCURI.AdminUsers.CssClass%%">
3
  <td><span class="sucuriscan-monospace sucuriscan-ellipsis">%%SUCURI.AdminUsers.RemoteAddr%%</span></td>
 
4
  <td><span class="sucuriscan-monospace">%%SUCURI.AdminUsers.Datetime%%</span></td>
5
  </tr>
1
 
2
+ <tr>
3
  <td><span class="sucuriscan-monospace sucuriscan-ellipsis">%%SUCURI.AdminUsers.RemoteAddr%%</span></td>
4
+
5
  <td><span class="sucuriscan-monospace">%%SUCURI.AdminUsers.Datetime%%</span></td>
6
  </tr>
inc/tpl/lastlogins-admins.html.tpl CHANGED
@@ -1,15 +1,25 @@
1
 
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-table-double-title sucuriscan-adminusers">
3
- <thead>
4
- <tr>
5
- <th class="manage-column">User</th>
6
- <th class="manage-column">Registration</th>
7
- <th class="manage-column">Last Logins (newest to oldest)</th>
8
- <th class="manage-column">&nbsp;</th>
9
- </tr>
10
- </thead>
11
-
12
- <tbody>
13
- %%%SUCURI.AdminUsers.List%%%
14
- </tbody>
15
- </table>
 
 
 
 
 
 
 
 
 
 
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Successful Logins (admins)</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ Here you can see a list of all the successful logins of accounts with admin privileges.
8
+ </p>
9
+
10
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-table-double-title sucuriscan-adminusers">
11
+ <thead>
12
+ <tr>
13
+ <th class="manage-column">User</th>
14
+ <th class="manage-column">Registration</th>
15
+ <th class="manage-column">Last Logins (newest to oldest)</th>
16
+ <th class="manage-column">&nbsp;</th>
17
+ </tr>
18
+ </thead>
19
+
20
+ <tbody>
21
+ %%%SUCURI.AdminUsers.List%%%
22
+ </tbody>
23
+ </table>
24
+ </div>
25
+ </div>
inc/tpl/lastlogins-admins.snippet.tpl CHANGED
@@ -1,7 +1,9 @@
1
 
2
  <tr>
3
  <td><a href="mailto:%%SUCURI.AdminUsers.Email%%">%%SUCURI.AdminUsers.Username%%</a></td>
 
4
  <td>%%SUCURI.AdminUsers.RegisteredAt%%</td>
 
5
  <td class="adminusers-lastlogin">
6
  <div class="sucuriscan-%%SUCURI.AdminUsers.NoLastLogins%%">
7
  <i>No data available.</i>
@@ -14,12 +16,14 @@
14
  <th>Date &amp; Time</th>
15
  </tr>
16
  </thead>
 
17
  <tbody>
18
  %%%SUCURI.AdminUsers.LastLogins%%%
19
  </tbody>
20
  </table>
21
  </td>
 
22
  <td>
23
- <a href="%%SUCURI.AdminUsers.UserURL%%" target="_blank" class="button-primary">Edit</a>
24
  </td>
25
  </tr>
1
 
2
  <tr>
3
  <td><a href="mailto:%%SUCURI.AdminUsers.Email%%">%%SUCURI.AdminUsers.Username%%</a></td>
4
+
5
  <td>%%SUCURI.AdminUsers.RegisteredAt%%</td>
6
+
7
  <td class="adminusers-lastlogin">
8
  <div class="sucuriscan-%%SUCURI.AdminUsers.NoLastLogins%%">
9
  <i>No data available.</i>
16
  <th>Date &amp; Time</th>
17
  </tr>
18
  </thead>
19
+
20
  <tbody>
21
  %%%SUCURI.AdminUsers.LastLogins%%%
22
  </tbody>
23
  </table>
24
  </td>
25
+
26
  <td>
27
+ <a href="%%SUCURI.AdminUsers.UserURL%%" target="_blank" class="button button-primary">Edit</a>
28
  </td>
29
  </tr>
inc/tpl/lastlogins-all.html.tpl CHANGED
@@ -1,42 +1,44 @@
1
 
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-table-double-title sucuriscan-last-logins">
3
- <thead>
4
- <tr>
5
- <th colspan="6" class="thead-with-button">
6
- <span>User last logins (%%SUCURI.UserList.Total%%)</span>
7
- <span class="thead-topright-action">
8
- <form action="%%SUCURI.URL.Lastlogins%%" method="post">
9
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
10
- <button type="submit" name="sucuriscan_reset_lastlogins" class="button button-primary">Reset logs</button>
11
- </form>
12
- </span>
13
- </th>
14
- </tr>
15
- <tr>
16
- <th class="manage-column">&nbsp;</th>
17
- <th class="manage-column">User</th>
18
- <th class="manage-column">IP Address</th>
19
- <th class="manage-column">Hostname</th>
20
- <th class="manage-column">Date/Time</th>
21
- <th class="manage-column">&nbsp;</th>
22
- </tr>
23
- </thead>
24
 
25
- <tbody>
26
- %%%SUCURI.UserList%%%
 
 
27
 
28
- <tr class="sucuriscan-%%SUCURI.UserList.NoItemsVisibility%%">
29
- <td colspan="6">
30
- <em>No logs so far.</em>
31
- </td>
32
- </tr>
33
 
34
- <tr class="sucuriscan-%%SUCURI.UserList.PaginationVisibility%%">
35
- <td colspan="6">
36
- <ul class="sucuriscan-pagination">
37
- %%%SUCURI.UserList.Pagination%%%
38
- </ul>
39
- </td>
40
- </tr>
41
- </tbody>
42
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Successful Logins (all)</h3>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ <div class="inside">
6
+ <p>
7
+ Here you can see a list of all the successful user logins.
8
+ </p>
9
 
10
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-table-double-title sucuriscan-last-logins">
11
+ <thead>
12
+ <tr>
13
+ <th colspan="5">User Last Logins (%%SUCURI.UserList.Total%%)</th>
14
+ </tr>
15
 
16
+ <tr>
17
+ <th class="manage-column">User</th>
18
+ <th class="manage-column">IP Address</th>
19
+ <th class="manage-column">Hostname</th>
20
+ <th class="manage-column">Date/Time</th>
21
+ <th class="manage-column">&nbsp;</th>
22
+ </tr>
23
+ </thead>
24
+
25
+ <tbody>
26
+ %%%SUCURI.UserList%%%
27
+
28
+ <tr class="sucuriscan-%%SUCURI.UserList.NoItemsVisibility%%">
29
+ <td colspan="5">
30
+ <em>No logs so far.</em>
31
+ </td>
32
+ </tr>
33
+
34
+ <tr class="sucuriscan-%%SUCURI.UserList.PaginationVisibility%%">
35
+ <td colspan="5">
36
+ <ul class="sucuriscan-pagination">
37
+ %%%SUCURI.UserList.Pagination%%%
38
+ </ul>
39
+ </td>
40
+ </tr>
41
+ </tbody>
42
+ </table>
43
+ </div>
44
+ </div>
inc/tpl/lastlogins-all.snippet.tpl CHANGED
@@ -1,9 +1,12 @@
1
 
2
- <tr class="%%SUCURI.UserList.CssClass%%">
3
- <td>%%SUCURI.UserList.Number%%</td>
4
  <td>%%SUCURI.UserList.Displayname%% (%%SUCURI.UserList.Username%%)</td>
 
5
  <td><span class="sucuriscan-monospace">%%SUCURI.UserList.RemoteAddr%%</span></td>
 
6
  <td><span class="sucuriscan-ellipsis" title="%%SUCURI.UserList.Hostname%%">%%SUCURI.UserList.Hostname%%</span></td>
 
7
  <td><span title="%%SUCURI.UserList.Datetime%%">%%SUCURI.UserList.TimeAgo%%</span></td>
 
8
  <td><a href="%%SUCURI.UserList.UserURL%%" target="_blank">Edit</a></td>
9
  </tr>
1
 
2
+ <tr>
 
3
  <td>%%SUCURI.UserList.Displayname%% (%%SUCURI.UserList.Username%%)</td>
4
+
5
  <td><span class="sucuriscan-monospace">%%SUCURI.UserList.RemoteAddr%%</span></td>
6
+
7
  <td><span class="sucuriscan-ellipsis" title="%%SUCURI.UserList.Hostname%%">%%SUCURI.UserList.Hostname%%</span></td>
8
+
9
  <td><span title="%%SUCURI.UserList.Datetime%%">%%SUCURI.UserList.TimeAgo%%</span></td>
10
+
11
  <td><a href="%%SUCURI.UserList.UserURL%%" target="_blank">Edit</a></td>
12
  </tr>
inc/tpl/lastlogins-blockedusers.html.tpl CHANGED
@@ -1,65 +1,62 @@
1
 
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Blocked Users</h3>
5
-
6
- <div class="inside">
 
 
 
 
 
 
 
 
7
  <p>
8
- Any user login passing accross the built-in mechanism that WordPress provides to
9
- authentication the session will be intercepted by the plugin and analyzed to see
10
- if the username is in the list of blocked accounts, if yes then the request will
11
- be stopped. No logs will be registered and no alerts will be sent to your email.
 
 
 
 
12
  </p>
 
13
 
14
- <div class="sucuriscan-inline-alert-info">
15
- <p>
16
- Take in consideration that this is not a 100% bulletproof mechanism
17
- to block unwanted user authentications from malicious users. Depending
18
- on the configuration of your website, installed plugins, installed
19
- themes, and even the version of WordPress there might still be weak
20
- points that automated tools can take advantage of to brute force the
21
- user accounts registered in your website. <a target="_blank"
22
- href="https://sucuri.net/website-firewall/?wp=bu">Install a firewall</a>
23
- to have full protection and mitigate this and a myriad of other attacks.
24
- </p>
25
- </div>
26
-
27
- <div class="sucuriscan-inline-alert-warning">
28
- <p>Do not block existent accounts, they will lose access forever.</p>
29
- </div>
30
-
31
- <form method="post">
32
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
33
-
34
- <table class="wp-list-table widefat sucuriscan-table">
35
- <thead>
36
- <tr>
37
- <th class="manage-column column-cb check-column">
38
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
39
- <input id="cb-select-all-1" type="checkbox">
40
- </th>
41
- <th class="manage-column">Username</th>
42
- <th class="manage-column">Blocked At</th>
43
- <th class="manage-column">First Attempt</th>
44
- <th class="manage-column">Last Attempt</th>
45
- </tr>
46
- </thead>
47
-
48
- <tbody>
49
- %%%SUCURI.BlockedUsers.List%%%
50
-
51
- <tr class="sucuriscan-%%SUCURI.BlockedUsers.NoItemsVisibility%%">
52
- <td colspan="5">
53
- <em>The table is empty.</em>
54
- </td>
55
- </tr>
56
- </tbody>
57
- </table>
58
-
59
- <div class="sucuriscan-recipient-form">
60
- <button type="submit" class="button button-primary">Unblock User</button>
61
- </div>
62
- </form>
63
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  </div>
65
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Blocked Users</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ Any user login passing accross the built-in mechanism that WordPress
8
+ provides to authentication the session will be intercepted by the
9
+ plugin and analyzed to see if the username is in the list of blocked
10
+ accounts, if yes then the request will be stopped. No logs will be
11
+ registered and no alerts will be sent to your email.
12
+ </p>
13
+
14
+ <div class="sucuriscan-inline-alert-info">
15
  <p>
16
+ Take in consideration that this is not a 100% bulletproof mechanism
17
+ to block unwanted user authentications from malicious users. Depending
18
+ on the configuration of your website, installed plugins, installed
19
+ themes, and even the version of WordPress there might still be weak
20
+ points that automated tools can take advantage of to brute force the
21
+ user accounts registered in your website. <a target="_blank"
22
+ href="https://sucuri.net/website-firewall/?wp=bu">Install a firewall</a>
23
+ to have full protection and mitigate this and a myriad of other attacks.
24
  </p>
25
+ </div>
26
 
27
+ <div class="sucuriscan-inline-alert-error">
28
+ <p>Do not block existent accounts, they will lose access forever.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  </div>
30
+
31
+ <form action="%%SUCURI.URL.Lastlogins%%#blocked" method="post">
32
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
33
+
34
+ <table class="wp-list-table widefat sucuriscan-table">
35
+ <thead>
36
+ <tr>
37
+ <td id="cb" class="manage-column column-cb check-column">
38
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
39
+ <input id="cb-select-all-1" type="checkbox">
40
+ </td>
41
+ <th class="manage-column">Username</th>
42
+ <th class="manage-column">Blocked At</th>
43
+ <th class="manage-column">First Attempt</th>
44
+ <th class="manage-column">Last Attempt</th>
45
+ </tr>
46
+ </thead>
47
+
48
+ <tbody>
49
+ %%%SUCURI.BlockedUsers.List%%%
50
+
51
+ <tr class="sucuriscan-%%SUCURI.BlockedUsers.NoItemsVisibility%%">
52
+ <td colspan="5">
53
+ <em>The table is empty.</em>
54
+ </td>
55
+ </tr>
56
+ </tbody>
57
+ </table>
58
+
59
+ <button type="submit" class="button button-primary">Unblock User</button>
60
+ </form>
61
  </div>
62
  </div>
inc/tpl/lastlogins-blockedusers.snippet.tpl CHANGED
@@ -1,10 +1,14 @@
1
 
2
- <tr class="%%SUCURI.BlockedUsers.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_unblock_user[]" value="%%SUCURI.BlockedUsers.Username%%">
5
- </td>
 
6
  <td><span class="sucuriscan-monospace">%%SUCURI.BlockedUsers.Username%%</span></td>
 
7
  <td><em>%%SUCURI.BlockedUsers.BlockedAt%%</em></td>
 
8
  <td><em>%%SUCURI.BlockedUsers.FirstAttempt%%</em></td>
 
9
  <td><em>%%SUCURI.BlockedUsers.LastAttempt%%</em></td>
10
  </tr>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_unblock_user[]" value="%%SUCURI.BlockedUsers.Username%%">
5
+ </th>
6
+
7
  <td><span class="sucuriscan-monospace">%%SUCURI.BlockedUsers.Username%%</span></td>
8
+
9
  <td><em>%%SUCURI.BlockedUsers.BlockedAt%%</em></td>
10
+
11
  <td><em>%%SUCURI.BlockedUsers.FirstAttempt%%</em></td>
12
+
13
  <td><em>%%SUCURI.BlockedUsers.LastAttempt%%</em></td>
14
  </tr>
inc/tpl/lastlogins-failedlogins.html.tpl CHANGED
@@ -1,93 +1,70 @@
1
 
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3 class="thead-with-button">
5
- <span>Failed logins</span>
6
- <span class="thead-topright-action">
7
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
8
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
9
- <input type="hidden" name="sucuriscan_reset_logfile" value="failedlogins" />
10
- <button type="submit" class="button button-primary">Reset logs</button>
11
- </form>
12
- </span>
13
- </h3>
14
 
15
- <div class="inside">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  <p>
17
- This information will be used to determine if your site is being victim of
18
- <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
19
- target="_blank">Password Guessing Brute Force Attacks</a>. These logs will be
20
- accumulated and the plugin will send a report via email if there are more than
21
- <code>%%SUCURI.FailedLogins.MaxFailedLogins%%</code> failed login attempts during
22
- the same hour, you can change this number from <a href="%%SUCURI.URL.Settings%%#general">here</a>.
23
- <strong>Note.</strong> Some <em>"Two-Factor Authentication"</em> plugins do not
24
- follow the same rules that WordPress have to report failed login attempts, so
25
- you may not see all the attempts in this panel if you have one of these plugins
26
- installed.
27
  </p>
 
28
 
29
- <div class="sucuriscan-inline-alert-warning sucuriscan-%%SUCURI.FailedLogins.WarningVisibility%%">
30
- <p>
31
- The option to alert possible <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
32
- target="_blank">Password Guessing Brute Force Attacks</a> is disabled, you will
33
- not receive email reports with the attempts collected during the attacks, but
34
- you will continue receiving the alerts of failed logins if you have enabled that
35
- option. Go to the <a href="%%SUCURI.URL.Settings%%#notifications">alert
36
- settings</a> panel to change this configuration.
37
- </p>
38
- </div>
39
-
40
- <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.FailedLogins.CollectPasswordsVisibility%%">
41
- <p>
42
- If you mistype your password the plugin will log the username and password in
43
- the security logs. If someone get access to your API key, or your server fails
44
- to process the PHP files (which is not usual but may happen) then an attacker
45
- may steal your credentials and get access to your site. Change this from the <a
46
- href="%%SUCURI.URL.Settings%%#general">general settings</a>
47
- </p>
48
- </div>
49
-
50
- <form method="post">
51
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
52
 
53
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-lastlogins-failed">
54
- <thead>
55
- <tr>
56
- <th class="manage-column column-cb check-column">
57
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
58
- <input id="cb-select-all-1" type="checkbox">
59
- </th>
60
- <th class="manage-column">User</th>
61
- <th class="manage-column">Password</th>
62
- <th class="manage-column">IP Address</th>
63
- <th class="manage-column">Date/Time</th>
64
- <th class="manage-column" width="300">User-Agent</th>
65
- </tr>
66
- </thead>
67
 
68
- <tbody>
69
- %%%SUCURI.FailedLogins.List%%%
70
 
71
- <tr class="sucuriscan-%%SUCURI.FailedLogins.NoItemsVisibility%%">
72
- <td colspan="6">
73
- <em>No logs so far.</em>
74
- </td>
75
- </tr>
76
 
77
- <tr class="sucuriscan-%%SUCURI.FailedLogins.PaginationVisibility%%">
78
- <td colspan="6">
79
- <ul class="sucuriscan-pagination">
80
- %%%SUCURI.FailedLogins.PaginationLinks%%%
81
- </ul>
82
- </td>
83
- </tr>
84
- </tbody>
85
- </table>
86
 
87
- <div class="sucuriscan-recipient-form">
88
- <button type="submit" class="button button-primary">Block Selected Users</button>
89
- </div>
90
- </form>
91
- </div>
92
  </div>
93
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Failed logins</h3>
 
 
 
 
 
 
 
 
 
 
4
 
5
+ <div class="inside">
6
+ <p>
7
+ This information will be used to determine if your site is being victim of
8
+ <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
9
+ target="_blank">Password Guessing Brute Force Attacks</a>. These logs will be
10
+ accumulated and the plugin will send a report via email if there are more than
11
+ <code>%%SUCURI.FailedLogins.MaxFailedLogins%%</code> failed login attempts during
12
+ the same hour, you can change this number from <a href="%%SUCURI.URL.Settings%%#general">here</a>.
13
+ <strong>Note.</strong> Some <em>"Two-Factor Authentication"</em> plugins do not
14
+ follow the same rules that WordPress have to report failed login attempts, so
15
+ you may not see all the attempts in this panel if you have one of these plugins
16
+ installed.
17
+ </p>
18
+
19
+ <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.FailedLogins.WarningVisibility%%">
20
  <p>
21
+ The option to alert possible <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
22
+ target="_blank">Password Guessing Brute Force Attacks</a> is disabled, you will
23
+ not receive email reports with the attempts collected during the attacks, but
24
+ you will continue receiving the alerts of failed logins if you have enabled that
25
+ option. Go to the <a href="%%SUCURI.URL.Settings%%#alerts">alert
26
+ settings</a> panel to change this configuration.
 
 
 
 
27
  </p>
28
+ </div>
29
 
30
+ <form action="%%SUCURI.URL.Lastlogins%%#blocked" method="post">
31
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-lastlogins-failed">
34
+ <thead>
35
+ <tr>
36
+ <td id="cb" class="manage-column column-cb check-column">
37
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
38
+ <input id="cb-select-all-1" type="checkbox">
39
+ </td>
40
+ <th class="manage-column">User</th>
41
+ <th class="manage-column">Password</th>
42
+ <th class="manage-column">IP Address</th>
43
+ <th class="manage-column">Date/Time</th>
44
+ <th class="manage-column" width="300">User-Agent</th>
45
+ </tr>
46
+ </thead>
47
 
48
+ <tbody>
49
+ %%%SUCURI.FailedLogins.List%%%
50
 
51
+ <tr class="sucuriscan-%%SUCURI.FailedLogins.NoItemsVisibility%%">
52
+ <td colspan="6">
53
+ <em>No logs so far.</em>
54
+ </td>
55
+ </tr>
56
 
57
+ <tr class="sucuriscan-%%SUCURI.FailedLogins.PaginationVisibility%%">
58
+ <td colspan="6">
59
+ <ul class="sucuriscan-pagination">
60
+ %%%SUCURI.FailedLogins.PaginationLinks%%%
61
+ </ul>
62
+ </td>
63
+ </tr>
64
+ </tbody>
65
+ </table>
66
 
67
+ <button type="submit" class="button button-primary">Block Selected Users</button>
68
+ </form>
 
 
 
69
  </div>
70
  </div>
inc/tpl/lastlogins-failedlogins.snippet.tpl CHANGED
@@ -1,11 +1,16 @@
1
 
2
- <tr class="%%SUCURI.FailedLogins.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_block_user[]" value="%%SUCURI.FailedLogins.Username%%">
5
- </td>
 
6
  <td><span class="sucuriscan-monospace">%%SUCURI.FailedLogins.Username%%</span></td>
7
- <td><span class="sucuriscan-label-%%SUCURI.FailedLogins.PasswordColor%%">%%SUCURI.FailedLogins.Password%%</span></td>
 
 
8
  <td><span class="sucuriscan-monospace">%%SUCURI.FailedLogins.RemoteAddr%%</span></td>
 
9
  <td><em>%%SUCURI.FailedLogins.Datetime%%</em></td>
 
10
  <td><div class="sucuriscan-wraptext">%%SUCURI.FailedLogins.UserAgent%%</div></td>
11
  </tr>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_block_user[]" value="%%SUCURI.FailedLogins.Username%%">
5
+ </th>
6
+
7
  <td><span class="sucuriscan-monospace">%%SUCURI.FailedLogins.Username%%</span></td>
8
+
9
+ <td><span class="sucuriscan-monospace">%%SUCURI.FailedLogins.Password%%</span></td>
10
+
11
  <td><span class="sucuriscan-monospace">%%SUCURI.FailedLogins.RemoteAddr%%</span></td>
12
+
13
  <td><em>%%SUCURI.FailedLogins.Datetime%%</em></td>
14
+
15
  <td><div class="sucuriscan-wraptext">%%SUCURI.FailedLogins.UserAgent%%</div></td>
16
  </tr>
inc/tpl/lastlogins-loggedin.html.tpl CHANGED
@@ -1,20 +1,31 @@
1
 
2
- <table class="wp-list-table widefat sucuriscan-loggedin-users">
3
- <thead>
4
- <tr>
5
- <th colspan="6">Logged in users (%%SUCURI.LoggedInUsers.Total%% users)</th>
6
- </tr>
7
- <tr>
8
- <th>ID</th>
9
- <th>Username</th>
10
- <th>Last Activity</th>
11
- <th>Registered</th>
12
- <th>IP Address</th>
13
- <th>&nbsp;</th>
14
- </tr>
15
- </thead>
16
 
17
- <tbody>
18
- %%%SUCURI.LoggedInUsers.List%%%
19
- </tbody>
20
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Logged-in Users</h3>
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
+ <div class="inside">
6
+ <p>
7
+ Here you can see a list of the users that are currently logged-in.
8
+ </p>
9
+
10
+ <table class="wp-list-table widefat sucuriscan-loggedin-users">
11
+ <thead>
12
+ <tr>
13
+ <th colspan="6">Logged-in Users (%%SUCURI.LoggedInUsers.Total%% users)</th>
14
+ </tr>
15
+
16
+ <tr>
17
+ <th>ID</th>
18
+ <th>Username</th>
19
+ <th>Last Activity</th>
20
+ <th>Registered</th>
21
+ <th>IP Address</th>
22
+ <th>&nbsp;</th>
23
+ </tr>
24
+ </thead>
25
+
26
+ <tbody>
27
+ %%%SUCURI.LoggedInUsers.List%%%
28
+ </tbody>
29
+ </table>
30
+ </div>
31
+ </div>
inc/tpl/lastlogins-loggedin.snippet.tpl CHANGED
@@ -1,11 +1,14 @@
1
 
2
- <tr class="%%SUCURI.LoggedInUsers.CssClass%%">
3
  <td>%%SUCURI.LoggedInUsers.Id%%</td>
 
4
  <td><a href="mailto:%%SUCURI.LoggedInUsers.UserEmail%%">%%SUCURI.LoggedInUsers.UserLogin%%</a></td>
 
5
  <td class="sucuriscan-monospace">%%SUCURI.LoggedInUsers.LastActivity%%</td>
 
6
  <td class="sucuriscan-monospace">%%SUCURI.LoggedInUsers.Registered%%</td>
 
7
  <td class="sucuriscan-monospace">%%SUCURI.LoggedInUsers.RemoveAddr%%</td>
8
- <td>
9
- <a href="%%SUCURI.LoggedInUsers.UserURL%%" target="_blank">Edit</a>
10
- </td>
11
  </tr>
1
 
2
+ <tr>
3
  <td>%%SUCURI.LoggedInUsers.Id%%</td>
4
+
5
  <td><a href="mailto:%%SUCURI.LoggedInUsers.UserEmail%%">%%SUCURI.LoggedInUsers.UserLogin%%</a></td>
6
+
7
  <td class="sucuriscan-monospace">%%SUCURI.LoggedInUsers.LastActivity%%</td>
8
+
9
  <td class="sucuriscan-monospace">%%SUCURI.LoggedInUsers.Registered%%</td>
10
+
11
  <td class="sucuriscan-monospace">%%SUCURI.LoggedInUsers.RemoveAddr%%</td>
12
+
13
+ <td><a href="%%SUCURI.LoggedInUsers.UserURL%%" target="_blank">Edit</a></td>
 
14
  </tr>
inc/tpl/lastlogins.html.tpl CHANGED
@@ -1,41 +1,31 @@
1
 
2
  <div class="sucuriscan-tabs">
3
- <ul>
4
- <li>
5
- <a href="#lastlogins-allusers" data-tabname="lastlogins-allusers">All Users</a>
6
- </li>
7
- <li>
8
- <a href="#lastlogins-admins" data-tabname="lastlogins-admins">Admin Users</a>
9
- </li>
10
- <li>
11
- <a href="#loggedin-users" data-tabname="loggedin-users">Logged In Users</a>
12
- </li>
13
- <li>
14
- <a href="#failed-logins" data-tabname="failed-logins">Failed Logins</a>
15
- </li>
16
- <li>
17
- <a href="#blocked-users" data-tabname="blocked-users">Blocked Users</a>
18
- </li>
19
  </ul>
20
 
21
- <div class="sucuriscan-tab-containers">
22
- <div id="sucuriscan-lastlogins-allusers">
23
  %%%SUCURI.LastLogins.AllUsers%%%
24
  </div>
25
 
26
- <div id="sucuriscan-lastlogins-admins">
27
  %%%SUCURI.LastLogins.Admins%%%
28
  </div>
29
 
30
- <div id="sucuriscan-loggedin-users">
31
  %%%SUCURI.LoggedInUsers%%%
32
  </div>
33
 
34
- <div id="sucuriscan-failed-logins">
35
  %%%SUCURI.FailedLogins%%%
36
  </div>
37
 
38
- <div id="sucuriscan-blocked-users">
39
  %%%SUCURI.BlockedUsers%%%
40
  </div>
41
  </div>
1
 
2
  <div class="sucuriscan-tabs">
3
+ <ul class="sucuriscan-clearfix sucuriscan-tabs-buttons">
4
+ <li><a href="%%SUCURI.URL.Lastlogins%%#allusers">All Users</a></li>
5
+ <li><a href="%%SUCURI.URL.Lastlogins%%#admins">Admin Users</a></li>
6
+ <li><a href="%%SUCURI.URL.Lastlogins%%#loggedin">Logged-in Users</a></li>
7
+ <li><a href="%%SUCURI.URL.Lastlogins%%#failed">Failed Logins</a></li>
8
+ <li><a href="%%SUCURI.URL.Lastlogins%%#blocked">Blocked Users</a></li>
 
 
 
 
 
 
 
 
 
 
9
  </ul>
10
 
11
+ <div class="sucuriscan-tabs-containers">
12
+ <div id="sucuriscan-tabs-allusers">
13
  %%%SUCURI.LastLogins.AllUsers%%%
14
  </div>
15
 
16
+ <div id="sucuriscan-tabs-admins">
17
  %%%SUCURI.LastLogins.Admins%%%
18
  </div>
19
 
20
+ <div id="sucuriscan-tabs-loggedin">
21
  %%%SUCURI.LoggedInUsers%%%
22
  </div>
23
 
24
+ <div id="sucuriscan-tabs-failed">
25
  %%%SUCURI.FailedLogins%%%
26
  </div>
27
 
28
+ <div id="sucuriscan-tabs-blocked">
29
  %%%SUCURI.BlockedUsers%%%
30
  </div>
31
  </div>
inc/tpl/malwarescan-appdetail.snippet.tpl DELETED
@@ -1,5 +0,0 @@
1
-
2
- <tr>
3
- <td>%%SUCURI.InformationTitle%%</td>
4
- <td><span class="sucuriscan-monospace">%%SUCURI.InformationValue%%</span></td>
5
- </tr>
 
 
 
 
 
inc/tpl/malwarescan-outdated.snippet.tpl DELETED
@@ -1,8 +0,0 @@
1
-
2
- <tr>
3
- <td colspan="2" class="sucuriscan-border-bad">
4
- <strong>%%SUCURI.OutdatedSoftwareTitle%%</strong>
5
- <em>(%%SUCURI.OutdatedSoftwareUrl%%)</em>
6
- <span>%%SUCURI.OutdatedSoftwareValue%%</span>
7
- </td>
8
- </tr>
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-recommendation.snippet.tpl DELETED
@@ -1,11 +0,0 @@
1
-
2
- <tr>
3
- <td colspan="2" class="sucuriscan-border-bad">
4
- <strong>%%SUCURI.RecommendationTitle%%</strong><br>
5
- <span>%%SUCURI.RecommendationValue%%</span><br>
6
-
7
- <a href="%%SUCURI.RecommendationUrl%%" target="_blank">
8
- %%SUCURI.RecommendationUrlTitle%%
9
- </a>
10
- </td>
11
- </tr>
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-resblacklist.html.tpl DELETED
@@ -1,14 +0,0 @@
1
-
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-scanner-details">
3
- <thead>
4
- <tr>
5
- <th colspan="3" class="thead-with-button">
6
- <span>%%SUCURI.BlacklistStatusTitle%%</span>
7
- </th>
8
- </tr>
9
- </thead>
10
-
11
- <tbody>
12
- %%%SUCURI.BlacklistStatusList%%%
13
- </tbody>
14
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-resblacklist.snippet.tpl DELETED
@@ -1,12 +0,0 @@
1
-
2
- <tr>
3
- <td>
4
- <span class="sucuriscan-label sucuriscan-label-%%SUCURI.BlacklistStatusCssClass%%">
5
- %%SUCURI.BlacklistStatusGroupTitle%%
6
- </span>
7
- </td>
8
- <td>%%SUCURI.BlacklistStatusReporterName%%</td>
9
- <td>
10
- <a href="%%SUCURI.BlacklistStatusReporterUrl%%" target="_blank">More details</a>
11
- </td>
12
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-resmalware.html.tpl DELETED
@@ -1,114 +0,0 @@
1
-
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-scanner-details">
3
- <thead>
4
- <tr>
5
- <th colspan="3" class="thead-with-button">
6
- <span>%%SUCURI.WebsiteStatus%%</span>
7
- <a href="https://sucuri.net/website-antivirus/" target="_blank"
8
- class="thead-topright-action button-primary sucuriscan-%%SUCURI.FixButtonVisibility%%">
9
- Request Malware Cleanup</a>
10
- </th>
11
- </tr>
12
- </thead>
13
-
14
- <tbody>
15
- <tr>
16
- <td colspan="3">
17
- <p>
18
- To reduce the bandwidth consumption and the amount of HTTP requests sent by your
19
- website to the SiteCheck API service this plugin will cache the results of every
20
- scan for <strong>%%SUCURI.CacheLifeTime%% seconds</strong>. If you want to get
21
- fresh results after modifications suggested by the scanner then go to the <a
22
- href="%%SUCURI.URL.Settings%%#scanner">scanner settings</a> page and
23
- click the button in front of the label <em>"Reset sitecheck logs"</em>, then
24
- come back to this page and run a new malware scan. Note that SiteCheck may cache
25
- the results of the scan as well in its own server and there is no way you can
26
- refresh that information from this plugin, in this case you have to be patient.
27
- </p>
28
- </td>
29
- </tr>
30
-
31
- %%%SUCURI.MalwarePayloadList%%%
32
-
33
- <tr class="sucuriscan-%%SUCURI.NoMalwareRowVisibility%%">
34
- <td><span class="sucuriscan-label sucuriscan-label-success">CLEAN</span></td>
35
- <td colspan="3">Malware</td>
36
- </tr>
37
-
38
- <tr class="sucuriscan-%%SUCURI.NoMalwareRowVisibility%%">
39
- <td><span class="sucuriscan-label sucuriscan-label-success">CLEAN</span></td>
40
- <td width="220">
41
- <a href="https://kb.sucuri.net/malware/encoded-javascript" target="_blank">
42
- Malicious javascript
43
- </a>
44
- </td>
45
- <td>
46
- <div>
47
- JavaScript is a language (code) that can be executed directly by the browser and
48
- many other applications that support it (PDF, email readers, etc). Because it is
49
- a full programming language executed by the browser, attackers use it heavily to
50
- run malicious code from the compromised sites.
51
- </div>
52
- </td>
53
- </tr>
54
-
55
- <tr class="sucuriscan-%%SUCURI.NoMalwareRowVisibility%%">
56
- <td><span class="sucuriscan-label sucuriscan-label-success">CLEAN</span></td>
57
- <td width="220">
58
- <a href="https://kb.sucuri.net/malware/malicious-iframes" target="_blank">
59
- Malicious iframes
60
- </a>
61
- </td>
62
- <td>
63
- <div>
64
- An inline frame (iframe) is used to embed another document within the current
65
- HTML document. Because as the definition implies, it allows you to insert
66
- another document inside the current HTML page. And the attackers use that
67
- feature to insert malicious content into the compromised sites (to redirect to
68
- spam, exploit kits, Fake AV, phishing, etc).
69
- </div>
70
- </td>
71
- </tr>
72
-
73
- <tr class="sucuriscan-%%SUCURI.NoMalwareRowVisibility%%">
74
- <td><span class="sucuriscan-label sucuriscan-label-success">CLEAN</span></td>
75
- <td width="220">
76
- <a href="https://kb.sucuri.net/malware/conditional-redirections" target="_blank">
77
- Suspicious redirections (htaccess)
78
- </a>
79
- </td>
80
- <td>
81
- <div>
82
- Conditional redirections are classified differently than the iframe/javascript
83
- ones, because they are generally done though the HTTP headers (via .htaccess) to
84
- redirect users from certain browsers or locations to malware/malicious
85
- locations.
86
- </div>
87
- </td>
88
- </tr>
89
-
90
- <tr class="sucuriscan-%%SUCURI.NoMalwareRowVisibility%%">
91
- <td><span class="sucuriscan-label sucuriscan-label-success">CLEAN</span></td>
92
- <td colspan="3">Blackhat SEO Spam</td>
93
- </tr>
94
-
95
- <tr class="sucuriscan-%%SUCURI.NoMalwareRowVisibility%%">
96
- <td><span class="sucuriscan-label sucuriscan-label-success">CLEAN</span></td>
97
- <td colspan="3">Anomaly detection</td>
98
- </tr>
99
-
100
- <tr>
101
- <td colspan="3">
102
- <hr>
103
- <em>
104
- More details at <a href="https://sitecheck.sucuri.net/results/%%SUCURI.ScannedDomainName%%"
105
- target="_blank">SiteCheck/%%SUCURI.ScannedDomainName%%</a>. If our free scanner
106
- did not detect any issue, you may have a more complicated and hidden problem.
107
- You can <a href="https://sucuri.net/signup" target="_blank">sign up</a> with
108
- Sucuri for a complete and in depth scan+cleanup <strong>(not included in the
109
- free checks)</strong>.
110
- </em>
111
- </td>
112
- </tr>
113
- </tbody>
114
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-resmalware.snippet.tpl DELETED
@@ -1,25 +0,0 @@
1
-
2
- <tr>
3
- <td>
4
- <a href="%%SUCURI.MalwareDocs%%" target="_blank">%%SUCURI.AlertMessage%%</a>
5
- </td>
6
-
7
- <td>
8
- <span class="sucuriscan-monospace">%%SUCURI.MalwareType%%</span>
9
- </td>
10
-
11
- <td>
12
- <div class="sucuriscan-malware-link">
13
- <a href="%%SUCURI.InfectedUrl%%" target="_blank"
14
- class="sucuriscan-label sucuriscan-label-warning">View infected URL</a>
15
-
16
- <a href="#TB_inline?width=600&height=500&inlineId=sucuriscan-malware-%%SUCURI.MalwareKey%%"
17
- title="SiteCheck: Malware Payload" class="thickbox sucuriscan-label sucuriscan-label-danger">
18
- View malware</a>
19
- </div>
20
-
21
- <div id="sucuriscan-malware-%%SUCURI.MalwareKey%%" style="display:none">
22
- <div class="sucuriscan-malware-payload sucuriscan-monospace">%%SUCURI.MalwarePayload%%</div>
23
- </div>
24
- </td>
25
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-results.html.tpl DELETED
@@ -1,49 +0,0 @@
1
-
2
- <div class="sucuriscan-tabs">
3
- <ul>
4
- <li class="%%SUCURI.ScannerResults.CssClass%%">
5
- <a href="#sitecheck-results" data-tabname="sitecheck-results">Remote Scanner Results</a>
6
- </li>
7
- <li class="%%SUCURI.WebsiteDetails.CssClass%%">
8
- <a href="#website-details" data-tabname="website-details">Website Details</a>
9
- </li>
10
- <li class="%%SUCURI.WebsiteLinks.CssClass%%">
11
- <a href="#website-links" data-tabname="website-links">IFrames / Links / Scripts</a>
12
- </li>
13
- <li class="%%SUCURI.BlacklistStatus.CssClass%%">
14
- <a href="#blacklist-status" data-tabname="blacklist-status">Blacklist Status</a>
15
- </li>
16
- <li class="%%SUCURI.ModifiedFiles.CssClass%%">
17
- <a href="#modified-files" data-tabname="modified-files">Modified Files</a>
18
- </li>
19
- </ul>
20
-
21
- <div class="sucuriscan-tab-containers">
22
- <div id="sucuriscan-sitecheck-results">
23
- %%%SUCURI.ScannerResults.Content%%%
24
- </div>
25
-
26
- <div id="sucuriscan-website-details">
27
- %%%SUCURI.WebsiteDetails.Content%%%
28
- </div>
29
-
30
- <div id="sucuriscan-website-links">
31
- %%%SUCURI.WebsiteLinks.Content%%%
32
- </div>
33
-
34
- <div id="sucuriscan-blacklist-status">
35
- %%%SUCURI.BlacklistStatus.Content%%%
36
- </div>
37
-
38
- <div id="sucuriscan-modified-files">
39
- %%%SUCURI.ModifiedFiles.Content%%%
40
- </div>
41
- </div>
42
- </div>
43
-
44
- <div>
45
- <a href="https://sucuri.net/signup/" target="_blank"
46
- class="button button-primary button-hero sucuriscan-cleanup-btn
47
- sucuriscan-btnblock sucuriscan-%%SUCURI.SignupButtonVisibility%%">
48
- Get your site protected with Sucuri</a>
49
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-reswebdetails.html.tpl DELETED
@@ -1,45 +0,0 @@
1
-
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-scanner-details">
3
- <thead>
4
- <tr>
5
- <th colspan="2" class="thead-with-button">
6
- <span>System information</span>
7
-
8
- <a href="%%SUCURI.AdminUrlForUpdates%%"
9
- class="button button-primary thead-topright-action
10
- sucuriscan-%%SUCURI.UpdateWebsiteButtonVisibility%%">
11
- Update to %%SUCURI.VersionNumberOfTheUpdate%%
12
- </a>
13
- </th>
14
- </tr>
15
- </thead>
16
-
17
- <tbody>
18
- <!-- List of generic information from the site. -->
19
- %%%SUCURI.GenericInformationList%%%
20
-
21
- <!-- List of application details from the site. -->
22
- <tr>
23
- <th colspan="2">Web application details</th>
24
- </tr>
25
-
26
- %%%SUCURI.ApplicationDetailsList%%%
27
-
28
- %%%SUCURI.SystemNoticeList%%%
29
-
30
- <tr class="sucuriscan-%%SUCURI.NoAppDetailsVisibility%%">
31
- <td colspan="2"><em>No more information was found.</em></td>
32
- </tr>
33
-
34
- <!-- Possible recommendations or outdated software on the site. -->
35
- <tr class="sucuriscan-%%SUCURI.HasRecommendationsVisibility%%">
36
- <th colspan="2">Recommendations for the site</th>
37
- </tr>
38
-
39
- <!-- Possible outdated software on the site. -->
40
- %%%SUCURI.OutdatedSoftwareList%%%
41
-
42
- <!-- Possible recommendations for the site. -->
43
- %%%SUCURI.SecurityRecomendationList%%%
44
- </tbody>
45
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-resweblinks.html.tpl DELETED
@@ -1,10 +0,0 @@
1
-
2
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-scanner-links">
3
- <tbody>
4
- %%%SUCURI.WebsiteLinksAllList%%%
5
-
6
- <tr class="sucuriscan-%%SUCURI.NoLinksVisibility%%">
7
- <td><em>No iFrames, links, or script files were found.</em></td>
8
- </tr>
9
- </tbody>
10
- </table>
 
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan-sysnotice.snippet.tpl DELETED
@@ -1,6 +0,0 @@
1
-
2
- <tr>
3
- <td colspan="2">
4
- <span class="sucuriscan-monospace">%%SUCURI.SystemNotice%%</span>
5
- </td>
6
- </tr>
 
 
 
 
 
 
inc/tpl/malwarescan-weblinkitems.snippet.tpl DELETED
@@ -1,6 +0,0 @@
1
-
2
- <tr>
3
- <td colspan="2">
4
- <span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.WebsiteLinksItemTitle%%</span>
5
- </td>
6
- </tr>
 
 
 
 
 
 
inc/tpl/malwarescan-weblinktitle.snippet.tpl DELETED
@@ -1,9 +0,0 @@
1
-
2
- <tr>
3
- <th colspan="2">
4
- %%SUCURI.WebsiteLinksSectionTitle%%
5
- (%%SUCURI.WebsiteLinksSectionTotal%% found)
6
- </th>
7
- </tr>
8
-
9
- %%%SUCURI.WebsiteLinksSectionItems%%%
 
 
 
 
 
 
 
 
 
inc/tpl/malwarescan.html.tpl DELETED
@@ -1,37 +0,0 @@
1
-
2
- <div class="sucuriscan-loading">
3
- <h3 class="title">Website Security Scans by Sucuri Sitecheck</h3>
4
-
5
- <p class="description">Visit our <a href="https://sucuri.net/signup?fromloader" target="_blank">coverage &amp; pricing</a> page for details on how Sucuri can help you.</p>
6
-
7
- <form action="%%SUCURI.URL.Scanner%%" method="post" class="sucuriscan-sitecheck-form">
8
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
9
- <input type="hidden" name="sucuriscan_malware_scan" value="1" />
10
- <input type="submit" value="Scan Website" class="button button-hero button-primary input-button" />
11
- </form>
12
-
13
- <script type="text/javascript">
14
- jQuery(function($){
15
- $('.sucuriscan-sitecheck-form .input-button').click(function(){
16
- $('.sucuriscan-sitecheck-form .input-button')
17
- .val('Scanning Website...')
18
- .addClass('disabled');
19
- });
20
- });
21
- </script>
22
-
23
- <div class="sucuriscan-sitelogo">&nbsp;</div>
24
-
25
- <div class="sucuriscan-sitecheck-disclaimer">
26
- <p>
27
- The malware scanner is a free tool powered by <a href="https://sitecheck.sucuri.net/" target="_blank">
28
- Sucuri SiteCheck</a>, it will check your website for known malware, blacklisting
29
- status, website errors, and out-of-date software. Although we do our best to
30
- provide the best results, 100% accuracy is not realistic, and not guaranteed.
31
- You can also <a href="%%SUCURI.URL.Settings%%#scanner">disable this
32
- feature</a> from the settings page if you do not want to allow any of your
33
- registered users to use it.
34
- </p>
35
- </div>
36
-
37
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/modalwindow.html.tpl CHANGED
@@ -2,12 +2,8 @@
2
  <div class="sucuriscan-overlay %%SUCURI.Visibility%% %%SUCURI.Identifier%%"></div>
3
 
4
  <div class="sucuriscan-modal %%SUCURI.Visibility%% %%SUCURI.Identifier%%">
5
- <div class="sucuriscan-modal-outside %%SUCURI.CssClass%%">
6
-
7
  <div class="sucuriscan-modal-header sucuriscan-clearfix">
8
- <a href="https://sucuri.net/" target="_blank" class="sucuriscan-modal-logo">
9
- <img src="%%SUCURI.SucuriURL%%/inc/images/antivirus-logo-x42.png" />
10
- </a>
11
  <h3 class="sucuriscan-modal-title">%%SUCURI.Title%%</h3>
12
  <a href="#" class="sucuriscan-modal-close">&times;</a>
13
  </div>
2
  <div class="sucuriscan-overlay %%SUCURI.Visibility%% %%SUCURI.Identifier%%"></div>
3
 
4
  <div class="sucuriscan-modal %%SUCURI.Visibility%% %%SUCURI.Identifier%%">
5
+ <div class="sucuriscan-modal-outside">
 
6
  <div class="sucuriscan-modal-header sucuriscan-clearfix">
 
 
 
7
  <h3 class="sucuriscan-modal-title">%%SUCURI.Title%%</h3>
8
  <a href="#" class="sucuriscan-modal-close">&times;</a>
9
  </div>
inc/tpl/notification-admin.html.tpl CHANGED
@@ -1,5 +1,5 @@
1
 
2
  <div id="sucuriscan-alert-%%SUCURI.AlertUnique%%" class="%%SUCURI.AlertType%% sucuriscan-alert sucuriscan-alert-%%SUCURI.AlertType%%">
3
- <a href="javascript:void(0)" class="close" onclick="sucuriscan_alert_close('%%SUCURI.AlertUnique%%')">&times;</a>
4
  <p>%%%SUCURI.AlertMessage%%%</p>
5
  </div>
1
 
2
  <div id="sucuriscan-alert-%%SUCURI.AlertUnique%%" class="%%SUCURI.AlertType%% sucuriscan-alert sucuriscan-alert-%%SUCURI.AlertType%%">
3
+ <a href="javascript:void(0)" class="close" onclick="sucuriscanAlertClose('%%SUCURI.AlertUnique%%')">&times;</a>
4
  <p>%%%SUCURI.AlertMessage%%%</p>
5
  </div>
inc/tpl/notification-pretty.html.tpl CHANGED
@@ -1,31 +1,29 @@
1
 
2
- <table class="sucuriscan-template" style="width:90%;background:#fff;font-family:Arial,Helvetica,sans-serif;border-spacing:0">
3
- <thead sytle="border-bottom:1px solid #ccc">
4
- <tr style="background-color:#4b4b4b;background-image:-moz-linear-gradient(top, #555555, #3b3b3b);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#3b3b3b));background-image:-webkit-linear-gradient(top, #555555, #3b3b3b);background-image:-o-linear-gradient(top, #555555, #3b3b3b);background-image:linear-gradient(to bottom, #555555, #3b3b3b);background-repeat:repeat-x">
5
- <td sytle="font-size:20px;font-weight:normal;color:#ffffff;padding:10px;border-right:1px solid #2f2f2f;border-left:1px solid #6f6f6f;-webkit-box-shadow:inset 0 1px 0 #888888;-moz-box-shadow:inset 0 1px 0 #888888;box-shadow:inset 0 1px 0 #888888;text-shadow:1px 1px 2px rgba(0, 0, 0, 0.5)">
6
- <a href="https://sucuri.net/" style="text-decoration:none;display:inline-block;margin:8px 0 5px 20px">
7
- <img src="%%SUCURI.SucuriURL%%/inc/images/main-logo.png" alt="Sucuri, Inc." style="border:none" />
8
- </a>
9
- <span style="display:inline-block;line-height:46px;margin:0 20px 0 0;float:right;color:#ffffff">%%SUCURI.TemplateTitle%%</span>
10
- </td>
11
- </tr>
12
- </thead>
13
- <tbody>
14
- <tr>
15
- <td style="padding:20px 20px 10px 20px;border:1px solid #ccc;border-top:none">
16
- <h4 style="margin:0">Information:</h4>
17
- <p style="margin:0 0 10px 0">
18
- Alert Time: %%SUCURI.Time%%<br>
19
- %%SUCURI.User%%
20
- </p>
21
- <h4 style="text-transform:uppercase;margin:0">Website Information:</h4>
22
- <p style="margin:0 0 10px 0">
23
- Site: <a href="%%SUCURI.Website%%">%%SUCURI.Website%%</a><br>
24
- IP Address: %%SUCURI.RemoteAddress%%<br>
25
- </p>
26
- <h4 style="text-transform:uppercase;margin:0">Notification Message:</h4>
27
- <p style="margin:0 0 10px 0">%%%SUCURI.Message%%%</p>
28
- </td>
29
- </tr>
30
- </tbody>
31
- </table>
1
 
2
+ <table class="sucuriscan-template" style="width:90%;background:#fff;font-family:Arial,Helvetica,sans-serif;border-spacing:0">
3
+ <thead sytle="border-bottom:1px solid #ccc">
4
+ <tr style="background-color:#4b4b4b;background-image:-moz-linear-gradient(top, #555555, #3b3b3b);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#3b3b3b));background-image:-webkit-linear-gradient(top, #555555, #3b3b3b);background-image:-o-linear-gradient(top, #555555, #3b3b3b);background-image:linear-gradient(to bottom, #555555, #3b3b3b);background-repeat:repeat-x">
5
+ <td sytle="font-size:20px;font-weight:normal;color:#ffffff;padding:10px;border-right:1px solid #2f2f2f;border-left:1px solid #6f6f6f;-webkit-box-shadow:inset 0 1px 0 #888888;-moz-box-shadow:inset 0 1px 0 #888888;box-shadow:inset 0 1px 0 #888888;text-shadow:1px 1px 2px rgba(0, 0, 0, 0.5)">
6
+ <a href="https://sucuri.net/" style="text-decoration:none;display:inline-block;margin:8px 0 5px 20px">
7
+ <img src="%%SUCURI.SucuriURL%%/inc/images/mainlogo.png" alt="Sucuri, Inc." style="border:none" />
8
+ </a>
9
+ <span style="display:inline-block;line-height:46px;margin:0 20px 0 0;float:right;color:#ffffff">%%SUCURI.TemplateTitle%%</span>
10
+ </td>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <tr>
16
+ <td style="padding:20px 20px 10px 20px;border:1px solid #ccc;border-top:none">
17
+ <h4 style="text-transform:uppercase;margin:0">Information:</h4>
18
+ <p style="margin:0 0 10px 0">
19
+ Website: <a href="http://%%SUCURI.Website%%">%%SUCURI.Website%%</a><br>
20
+ IP Address: %%SUCURI.RemoteAddress%%<br>
21
+ Alert Time: %%SUCURI.Time%%<br>
22
+ %%SUCURI.User%%
23
+ </p>
24
+ <h4 style="text-transform:uppercase;margin:0">Notification Message:</h4>
25
+ <p style="margin:0 0 10px 0">%%%SUCURI.Message%%%</p>
26
+ </td>
27
+ </tr>
28
+ </tbody>
29
+ </table>
 
 
inc/tpl/notification-resetpwd.html.tpl DELETED
@@ -1,11 +0,0 @@
1
-
2
- Your password for <strong>%%SUCURI.ResetPassword.UserName%%</strong>
3
- <em>(%%SUCURI.ResetPassword.DisplayName%%)</em> at <a target="_blank"
4
- href="http://%%SUCURI.ResetPassword.Website%%">%%SUCURI.ResetPassword.Website%%</a>
5
- has been reset for security reasons.<br>
6
-
7
- You can use this temporary password to log in:
8
- <span style="display:inline-block;background:#f5f5f5;padding:2px 6px;
9
- font-family:Menlo, Monaco, monospace, serif;border:1px solid #ddd">
10
- %%%SUCURI.ResetPassword.Password%%%</span><br>
11
- Please change your password after you log in.
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/notification-simple.html.tpl CHANGED
@@ -1,12 +1,8 @@
1
- Subject: %%SUCURI.Subject%%
2
 
3
- Login Info:
4
- Time: %%SUCURI.Time%%
5
- %%SUCURI.User%%
6
-
7
- Website Info:
8
- Site: %%SUCURI.Website%%
9
  IP Address: %%SUCURI.RemoteAddress%%
 
 
10
 
11
- Notification:
12
- %%SUCURI.Message%%
 
1
 
2
+ Event: %%SUCURI.Subject%%
3
+ Website: http://%%SUCURI.Website%%
 
 
 
 
4
  IP Address: %%SUCURI.RemoteAddress%%
5
+ Alert Time: %%SUCURI.Time%%
6
+ %%SUCURI.User%%
7
 
8
+ Notification: %%SUCURI.Message%%
 
inc/tpl/posthack-resetpassword.html.tpl DELETED
@@ -1,63 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-reset-users-password">
3
- <div class="postbox">
4
- <div class="inside">
5
- <form method="post">
6
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
7
- <input type="hidden" name="sucuriscan_reset_password" value="1" />
8
-
9
- <p>
10
- You can generate a new random password for the user accounts that you select
11
- from the list. An email with the new password will be sent to the email address
12
- of each chosen users.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-warning">
16
- <p>
17
- If you choose to change the password of your own user, then your current session
18
- will expire immediately. You will need to log into the admin panel with the new
19
- password that will be sent to your email. If you are unsure of this, do not
20
- select your account from the list.
21
- </p>
22
- </div>
23
-
24
- <table class="wp-list-table widefat sucuriscan-table">
25
- <thead>
26
- <tr>
27
- <th class="manage-column column-cb check-column">
28
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
29
- <input id="cb-select-all-1" type="checkbox">
30
- </th>
31
- <th class="manage-column">User</th>
32
- <th class="manage-column">Email address</th>
33
- <th class="manage-column">Registered</th>
34
- <th class="manage-column">Roles</th>
35
- </tr>
36
- </thead>
37
-
38
- <tbody>
39
- %%%SUCURI.ResetPassword.UserList%%%
40
-
41
- <tr class="sucuriscan-%%SUCURI.ResetPassword.PaginationVisibility%%">
42
- <td colspan="4">
43
- <ul class="sucuriscan-pagination">
44
- %%%SUCURI.ResetPassword.PaginationLinks%%%
45
- </ul>
46
- </td>
47
- </tr>
48
- </tbody>
49
- </table>
50
-
51
- <p>
52
- <label>
53
- <input type="hidden" name="sucuriscan_process_form" value="0" />
54
- <input type="checkbox" name="sucuriscan_process_form" value="1" />
55
- <span>I understand that this operation can not be reverted.</span>
56
- </label>
57
- </p>
58
-
59
- <input type="submit" value="Reset User Password" class="button button-primary" />
60
- </form>
61
- </div>
62
- </div>
63
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/posthack-resetpassword.snippet.tpl DELETED
@@ -1,10 +0,0 @@
1
-
2
- <tr class="%%SUCURI.ResetPassword.CssClass%%">
3
- <td class="check-column">
4
- <input type="checkbox" name="user_ids[]" value="%%SUCURI.ResetPassword.UserId%%" />
5
- </td>
6
- <td>%%SUCURI.ResetPassword.DisplayUsername%%</td>
7
- <td><a href="mailto:%%SUCURI.ResetPassword.Email%%">%%SUCURI.ResetPassword.Email%%</a></td>
8
- <td>%%SUCURI.ResetPassword.Registered%%</td>
9
- <td>%%SUCURI.ResetPassword.Roles%%</td>
10
- </tr>
 
 
 
 
 
 
 
 
 
 
inc/tpl/posthack-resetplugins.html.tpl DELETED
@@ -1,74 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-reset-plugins">
3
- <div class="postbox">
4
- <div class="inside">
5
- <form action="%%SUCURI.URL.Posthack%%#reset-plugins" method="post">
6
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
7
- <input type="hidden" name="sucuriscan_reset_plugins" value="1" />
8
-
9
- <p>
10
- In case that you suspect of an infection in your site, or even after you got rid
11
- of a malicious code, it would be better if you <strong>re-install</strong> all
12
- the plugins installed in your site, including the ones you are not using
13
- <em>(aka. deactivated)</em>. Select from the list bellow the plugins you want to
14
- reset <em>(it is recommended to select them all)</em>, be aware that
15
- <strong>premium plugins will not be re-installed</strong>.
16
- </p>
17
-
18
- <div class="sucuriscan-inline-alert-info">
19
- <p>
20
- The information shown here is cache for %%SUCURI.ResetPlugin.CacheLifeTime%%
21
- seconds, this is necessary to reduce the quantity of HTTP requests sent to the
22
- WordPress servers and the bandwidth of your site. Currently there is no option
23
- to recreate this cache so you have to wait until it resets itself.
24
- </p>
25
- </div>
26
-
27
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-reset-plugins-table">
28
- <thead>
29
- <tr>
30
- <th class="manage-column column-cb check-column">
31
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
32
- <input id="cb-select-all-1" type="checkbox">
33
- </th>
34
- <th class="manage-column">Plugin</th>
35
- <th class="manage-column">Version</th>
36
- <th class="manage-column">Type</th>
37
- <th class="manage-column">Status</th>
38
- </tr>
39
- </thead>
40
-
41
- <tbody>
42
- <tr>
43
- <td colspan="5">
44
- <span>Loading <em>(may take several seconds)</em>...</span>
45
- </td>
46
- </tr>
47
- </tbody>
48
- </table>
49
-
50
- <p>
51
- <label>
52
- <input type="hidden" name="sucuriscan_process_form" value="0" />
53
- <input type="checkbox" name="sucuriscan_process_form" value="1" />
54
- <span>I understand that this operation can not be reverted.</span>
55
- </label>
56
- </p>
57
-
58
- <input type="submit" value="Process selected items" class="button button-primary" />
59
- </form>
60
-
61
- <script type="text/javascript">
62
- jQuery(function($){
63
- $.post('%%SUCURI.AjaxURL.Posthack%%', {
64
- action: 'sucuriscan_posthack_ajax',
65
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
66
- form_action: 'get_plugins_data',
67
- }, function(data){
68
- $('.sucuriscan-reset-plugins-table tbody').html( data );
69
- });
70
- });
71
- </script>
72
- </div>
73
- </div>
74
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/posthack-resetplugins.snippet.tpl DELETED
@@ -1,12 +0,0 @@
1
-
2
- <tr class="%%SUCURI.ResetPlugin.CssClass%%">
3
- <td class="check-column">
4
- <input type="checkbox" name="plugin_path[]" value="%%SUCURI.ResetPlugin.PluginPath%%" %%SUCURI.ResetPlugin.Disabled%% />
5
- </td>
6
- <td>
7
- <a href="%%SUCURI.ResetPlugin.Repository%%" target="_blank">%%SUCURI.ResetPlugin.Plugin%%</a>
8
- </td>
9
- <td><span class="sucuriscan-monospace">%%SUCURI.ResetPlugin.Version%%</span></td>
10
- <td><span class="sucuriscan-label-%%SUCURI.ResetPlugin.TypeClass%%">%%SUCURI.ResetPlugin.Type%%</span></td>
11
- <td><span class="sucuriscan-label-%%SUCURI.ResetPlugin.StatusClass%%">%%SUCURI.ResetPlugin.Status%%</span></td>
12
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/posthack-updates.html.tpl DELETED
@@ -1,46 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-updates">
3
- <div class="postbox">
4
- <div class="inside">
5
- <p>
6
- WordPress has a big user base in the public Internet, this brings interest to
7
- malicious people to find vulnerabilities in the code code, 3rd-party extensions,
8
- and themes that other companies develop. You should keep every piece of code
9
- installed in your website update to prevent attacks as soon as disclosed
10
- vulnerabilities are patched.
11
- </p>
12
-
13
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-updates-table">
14
- <thead>
15
- <tr>
16
- <th class="manage-column">Extension</th>
17
- <th class="manage-column">Installed</th>
18
- <th class="manage-column">Available</th>
19
- <th class="manage-column">Tested With</th>
20
- <th class="manage-column">&nbsp;</th>
21
- </tr>
22
- </thead>
23
-
24
- <tbody>
25
- <tr>
26
- <td colspan="5">
27
- <span>Loading <em>(may take several seconds)</em>...</span>
28
- </td>
29
- </tr>
30
- </tbody>
31
- </table>
32
-
33
- <script type="text/javascript">
34
- jQuery(function($){
35
- $.post('%%SUCURI.AjaxURL.Posthack%%', {
36
- action: 'sucuriscan_posthack_ajax',
37
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
38
- form_action: 'get_available_updates',
39
- }, function(data){
40
- $('.sucuriscan-updates-table tbody').html(data);
41
- });
42
- });
43
- </script>
44
- </div>
45
- </div>
46
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/posthack-updatesecretkeys.html.tpl DELETED
@@ -1,53 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-update-security-keys">
3
- <div class="postbox">
4
- <div class="inside">
5
- <p>
6
- The secret or security keys are a list of constants added to your site to ensure
7
- better encryption of information stored in the user's cookies. A secret key
8
- makes your site harder to hack and access by adding random elements to the
9
- password. You do not have to remember the keys, just write a random,
10
- complicated, and long string in the <code>wp-config.php</code> file. You can
11
- change these keys at any point in time to invalidate all existing cookies,
12
- forcing all users to login again.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-warning">
16
- <p>Your session will expire immediately after the security keys are changed.</p>
17
- </div>
18
-
19
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-security-keys-table">
20
- <thead>
21
- <tr>
22
- <th>Key</th>
23
- <th>Value</th>
24
- <th>Status</th>
25
- </tr>
26
- </thead>
27
-
28
- <tbody>
29
- %%%SUCURI.SecurityKeys.List%%%
30
- </tbody>
31
- </table>
32
-
33
- <form method="post">
34
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
35
- <input type="hidden" name="sucuriscan_update_wpconfig" value="1" />
36
-
37
- <p>
38
- <label>
39
- <input type="hidden" name="sucuriscan_process_form" value="0" />
40
- <input type="checkbox" name="sucuriscan_process_form" value="1" />
41
- <span>I understand that this operation can not be reverted.</span>
42
- </label>
43
- </p>
44
-
45
- <input type="submit" value="Generate New Security Keys" class="button button-primary" />
46
- </form>
47
-
48
- <div class="sucuriscan_wpconfig_keys_updated sucuriscan-monospace sucuriscan-%%SUCURI.WPConfigUpdate.Visibility%%">
49
- <textarea>%%SUCURI.WPConfigUpdate.NewConfig%%</textarea>
50
- </div>
51
- </div>
52
- </div>
53
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/posthack.html.tpl DELETED
@@ -1,35 +0,0 @@
1
-
2
- <div class="sucuriscan-tabs">
3
- <ul>
4
- <li>
5
- <a href="#update-security-keys" data-tabname="update-security-keys">Security Keys</a>
6
- </li>
7
- <li>
8
- <a href="#reset-users-password" data-tabname="reset-users-password">Reset User's Password</a>
9
- </li>
10
- <li>
11
- <a href="#reset-plugins" data-tabname="reset-plugins">Reset Plugins</a>
12
- </li>
13
- <li>
14
- <a href="#updates" data-tabname="updates">Available Updates</a>
15
- </li>
16
- </ul>
17
-
18
- <div class="sucuriscan-tab-containers">
19
- <div id="sucuriscan-update-security-keys">
20
- %%%SUCURI.UpdateSecretKeys%%%
21
- </div>
22
-
23
- <div id="sucuriscan-reset-users-password">
24
- %%%SUCURI.ResetPassword%%%
25
- </div>
26
-
27
- <div id="sucuriscan-reset-plugins">
28
- %%%SUCURI.ResetPlugins%%%
29
- </div>
30
-
31
- <div id="sucuriscan-updates">
32
- %%%SUCURI.AvailableUpdates%%%
33
- </div>
34
- </div>
35
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/register-site.html.tpl ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <p>
3
+ An API key is required to activate some additional tools available in this
4
+ plugin, the keys are free and you can virtually generate an unlimited number of
5
+ them as long as the domain name and email address are different. The key is used
6
+ to authenticate the HTTP requests sent by the plugin to a public API service
7
+ managed by Sucuri Inc. Do not generate the key if you disagree with this.
8
+ </p>
9
+
10
+ <div class="sucuriscan-inline-alert-info">
11
+ <p>
12
+ If you experience issues generating the API key you can request one sending the
13
+ domain name and email address that you want to use to <a href="mailto:info@sucuri.net">
14
+ info@sucuri.net</a>. Note that setting a key in a development environment does
15
+ not makes sense, if you are trying to do that in a local or stage environment
16
+ please consider to dismiss this alert.
17
+ </p>
18
+ </div>
19
+
20
+ <form action="%%SUCURI.URL.Settings%%" method="post">
21
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
22
+ <input type="hidden" name="sucuriscan_plugin_api_key" value="1" />
23
+
24
+ <fieldset class="sucuriscan-clearfix">
25
+ <label>Website:</label>
26
+ <input type="text" value="%%SUCURI.CleanDomain%%" readonly="readonly">
27
+ </fieldset>
28
+
29
+ <fieldset class="sucuriscan-clearfix">
30
+ <label>E-mail Address:</label>
31
+ <select name="sucuriscan_setup_user">
32
+ %%%SUCURI.AdminEmails%%%
33
+ </select>
34
+ </fieldset>
35
+
36
+ <fieldset class="sucuriscan-clearfix">
37
+ <label>DNS Lookups</label>
38
+ <input type="hidden" name="sucuriscan_dns_lookups" value="disable" />
39
+ <input type="checkbox" name="sucuriscan_dns_lookups" value="enable" checked="checked" />
40
+ <span class="sucuriscan-tooltip" content="Check the box if your website is
41
+ behind a known firewall service, this guarantees that the IP address of
42
+ your visitors will be detected correctly for the security logs. You can
43
+ change this later from the settings.">Enable DNS Lookups On Startup</span>
44
+ </fieldset>
45
+
46
+ <div class="sucuriscan-clearfix">
47
+ <div class="sucuriscan-pull-left">
48
+ <button type="submit" class="button button-primary">Proceed</button>
49
+ </div>
50
+ </div>
51
+ </form>
inc/tpl/settings-alert-subject.snippet.tpl DELETED
@@ -1,8 +0,0 @@
1
-
2
- <li>
3
- <label>
4
- <input type="radio" name="sucuriscan_email_subject"
5
- value="%%SUCURI.EmailSubject.Value%%" %%SUCURI.EmailSubject.Checked%% />
6
- <span>%%SUCURI.EmailSubject.Name%%</span>
7
- </label>
8
- </li>
 
 
 
 
 
 
 
 
inc/tpl/settings-alert.html.tpl DELETED
@@ -1,12 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- %%%SUCURI.AlertSettings.Recipients%%%
4
-
5
- %%%SUCURI.AlertSettings.Subject%%%
6
-
7
- %%%SUCURI.AlertSettings.PerHour%%%
8
-
9
- %%%SUCURI.AlertSettings.BruteForce%%%
10
-
11
- %%%SUCURI.AlertSettings.Events%%%
12
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/{settings-alert-bruteforce.html.tpl → settings-alerts-bruteforce.html.tpl} RENAMED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Password Guessing Brute Force Attacks</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -12,24 +12,24 @@
12
  they want.
13
  </p>
14
 
15
- <div class="sucuriscan-inline-alert-warning">
 
 
 
 
 
16
  <p>This option overrides the <em>"Alerts Per Hour"</em> setting.</p>
17
  </div>
18
 
19
- <form action="%%SUCURI.URL.Settings%%#notifications" method="post">
20
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
21
- <span class="sucuriscan-input-group">
22
  <label>Consider Brute-Force Attack After:</label>
23
  <select name="sucuriscan_maximum_failed_logins">
24
- %%%SUCURI.AlertSettings.BruteForce%%%
25
  </select>
26
- </span>
27
- <button type="submit" class="button-primary">Save</button>
28
  </form>
29
-
30
- <p>
31
- More info at <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
32
- target="_blank">Sucuri KB - Password Guessing Brute Force Attacks</a>.
33
- </p>
34
  </div>
35
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Password Guessing Brute Force Attacks</h3>
4
 
5
  <div class="inside">
6
  <p>
12
  they want.
13
  </p>
14
 
15
+ <p>
16
+ More info at <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
17
+ target="_blank">Sucuri KB - Password Guessing Brute Force Attacks</a>.
18
+ </p>
19
+
20
+ <div class="sucuriscan-inline-alert-error">
21
  <p>This option overrides the <em>"Alerts Per Hour"</em> setting.</p>
22
  </div>
23
 
24
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
25
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
26
+ <fieldset class="sucuriscan-clearfix">
27
  <label>Consider Brute-Force Attack After:</label>
28
  <select name="sucuriscan_maximum_failed_logins">
29
+ %%%SUCURI.Alerts.BruteForce%%%
30
  </select>
31
+ <button type="submit" class="button button-primary">Save</button>
32
+ </fieldset>
33
  </form>
 
 
 
 
 
34
  </div>
35
  </div>
inc/tpl/{settings-alert-events.html.tpl → settings-alerts-events.html.tpl} RENAMED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Alert Events</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -10,7 +10,7 @@
10
  of these options revert them to their original state.
11
  </p>
12
 
13
- <div class="sucuriscan-inline-alert-warning">
14
  <p>
15
  Enabling the alerts for failed login attempts may become an indirect mail spam
16
  attack as you will receive tons of emails if your website is victim of a brute
@@ -19,27 +19,27 @@
19
  </p>
20
  </div>
21
 
22
- <form action="%%SUCURI.URL.Settings%%#notifications" method="post">
23
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
24
 
25
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings-notifications">
26
  <thead>
27
  <tr>
28
- <th class="manage-column column-cb check-column">
29
  <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
30
  <input id="cb-select-all-1" type="checkbox">
31
- </th>
32
  <th class="manage-column">Event Description</th>
33
  </tr>
34
  </thead>
35
 
36
  <tbody>
37
- %%%SUCURI.AlertSettings.Events%%%
38
  </tbody>
39
  </table>
40
 
41
  <div class="sucuriscan-recipient-form">
42
- <button type="submit" name="sucuriscan_save_alert_events" class="button-primary">Save</button>
43
  </div>
44
  </form>
45
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Alert Events</h3>
4
 
5
  <div class="inside">
6
  <p>
10
  of these options revert them to their original state.
11
  </p>
12
 
13
+ <div class="sucuriscan-inline-alert-error">
14
  <p>
15
  Enabling the alerts for failed login attempts may become an indirect mail spam
16
  attack as you will receive tons of emails if your website is victim of a brute
19
  </p>
20
  </div>
21
 
22
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
23
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
24
 
25
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings-alerts">
26
  <thead>
27
  <tr>
28
+ <td id="cb" class="manage-column column-cb check-column">
29
  <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
30
  <input id="cb-select-all-1" type="checkbox">
31
+ </td>
32
  <th class="manage-column">Event Description</th>
33
  </tr>
34
  </thead>
35
 
36
  <tbody>
37
+ %%%SUCURI.Alerts.Events%%%
38
  </tbody>
39
  </table>
40
 
41
  <div class="sucuriscan-recipient-form">
42
+ <button type="submit" name="sucuriscan_save_alert_events" class="button button-primary">Save</button>
43
  </div>
44
  </form>
45
  </div>
inc/tpl/{settings-alert-events.snippet.tpl → settings-alerts-events.snippet.tpl} RENAMED
@@ -1,9 +1,10 @@
1
 
2
- <tr class="%%SUCURI.Event.CssClass%%">
3
- <td class="check-column">
4
  <input type="hidden" name="%%SUCURI.Event.Name%%" value="0" />
5
  <input type="checkbox" name="%%SUCURI.Event.Name%%" value="1" %%SUCURI.Event.Checked%% />
6
- </td>
 
7
  <td>
8
  <span class="%%SUCURI.Event.LabelIcon%%">%%%SUCURI.Event.Label%%%</span>
9
  </td>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="hidden" name="%%SUCURI.Event.Name%%" value="0" />
5
  <input type="checkbox" name="%%SUCURI.Event.Name%%" value="1" %%SUCURI.Event.Checked%% />
6
+ </th>
7
+
8
  <td>
9
  <span class="%%SUCURI.Event.LabelIcon%%">%%%SUCURI.Event.Label%%%</span>
10
  </td>
inc/tpl/settings-alerts-ignore-posts.html.tpl ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Ignore Post Changes</h3>
4
+
5
+ <div class="inside">
6
+ <p class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.IgnoreRules.MessageVisibility%%">
7
+ It seems that you disabled the email alerts for <b>new site
8
+ content</b>, this panel is intended to provide a way to ignore
9
+ specific events in your site and with that the alerts reported to
10
+ your email. Since you have deactivated the <b>new site content</b>
11
+ alerts, this panel will be disabled too.
12
+ </p>
13
+
14
+ <p>
15
+ This is a list of registered <a href="https://codex.wordpress.org/Post_Types"
16
+ target="_blank" rel="noopener">Post Types</a>. You will receive an email alert when
17
+ a custom page or post associated to any of these types is created or
18
+ updated. Some of these are created by WordPress but the majority are
19
+ created by 3rd-party plugins and themes to extend functionality from
20
+ WordPress. If you don't want to receive alerts for certain posts you
21
+ can stop them from here.
22
+ </p>
23
+
24
+ <p>
25
+ If you are receiving alerts for post types that are not listed here it
26
+ may be because the theme or plugin that is making these changes is
27
+ registering the custom post-type on runtime, in this case our plugin
28
+ will not be able to detect these changes and consequently you will
29
+ not be able to ignore those alerts. However, if you know the unique
30
+ identifier of the post-type you can type it in the form bellow and
31
+ our plugin will do its best to skip the alerts associated to that.
32
+ </p>
33
+
34
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
35
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
36
+ <input type="hidden" name="sucuriscan_ignorerule_action" value="add">
37
+
38
+ <fieldset class="sucuriscan-clearfix">
39
+ <label>Stop Alerts For This Post-Type:</label>
40
+ <input type="text" name="sucuriscan_ignorerule" placeholder="e.g. unique_post_type_id" />
41
+ <button type="submit" class="button button-primary">Proceed</button>
42
+ </fieldset>
43
+ </form>
44
+
45
+ <hr>
46
+
47
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings-ignorerules">
48
+ <thead>
49
+ <tr>
50
+ <th>Ignored At</th>
51
+ <th>Ignored</th>
52
+ <th>Post Type</th>
53
+ <th>&nbsp;</th>
54
+ </tr>
55
+ </thead>
56
+
57
+ <tbody>
58
+ %%%SUCURI.IgnoreRules.PostTypes%%%
59
+ </tbody>
60
+ </table>
61
+ </div>
62
+ </div>
inc/tpl/{settings-ignorerules.snippet.tpl → settings-alerts-ignore-posts.snippet.tpl} RENAMED
@@ -1,15 +1,17 @@
1
 
2
- <tr class="%%SUCURI.IgnoreRules.CssClass%%">
3
- <td>%%SUCURI.IgnoreRules.Num%%</td>
4
- <td>%%SUCURI.IgnoreRules.PostTypeTitle%%</td>
5
- <td><span class="sucuriscan-label-%%SUCURI.IgnoreRules.IsIgnoredClass%%">%%SUCURI.IgnoreRules.IsIgnored%%</span></td>
6
  <td><em class="sucuriscan-monospace">%%SUCURI.IgnoreRules.WasIgnoredAt%%</em></td>
 
 
 
 
 
7
  <td class="td-with-button">
8
- <form action="%%SUCURI.URL.Settings%%#ignorerules" method="post">
9
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
10
  <input type="hidden" name="sucuriscan_ignorerule" value="%%SUCURI.IgnoreRules.PostType%%" />
11
  <input type="hidden" name="sucuriscan_ignorerule_action" value="%%SUCURI.IgnoreRules.Action%%" />
12
- <button type="submit" class="%%SUCURI.IgnoreRules.ButtonClass%%">%%SUCURI.IgnoreRules.ButtonText%%</button>
13
  </form>
14
  </td>
15
  </tr>
1
 
2
+ <tr>
 
 
 
3
  <td><em class="sucuriscan-monospace">%%SUCURI.IgnoreRules.WasIgnoredAt%%</em></td>
4
+
5
+ <td><span class="sucuriscan-label-%%SUCURI.IgnoreRules.IsIgnoredClass%%">%%SUCURI.IgnoreRules.IsIgnored%%</span></td>
6
+
7
+ <td>%%SUCURI.IgnoreRules.PostTypeTitle%%</td>
8
+
9
  <td class="td-with-button">
10
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
11
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
12
  <input type="hidden" name="sucuriscan_ignorerule" value="%%SUCURI.IgnoreRules.PostType%%" />
13
  <input type="hidden" name="sucuriscan_ignorerule_action" value="%%SUCURI.IgnoreRules.Action%%" />
14
+ <button type="submit" class="button button-secondary">%%SUCURI.IgnoreRules.ButtonText%%</button>
15
  </form>
16
  </td>
17
  </tr>
inc/tpl/{settings-alert-perhour.html.tpl → settings-alerts-perhour.html.tpl} RENAMED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Alerts Per Hour</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -11,7 +11,7 @@
11
  alerts to receive during the same hour.
12
  </p>
13
 
14
- <div class="sucuriscan-inline-alert-warning">
15
  <p>
16
  If you have enabled the alerts for <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
17
  target="_blank">password guessing brute force attacks</a> and lowered the number
@@ -21,15 +21,15 @@
21
  </p>
22
  </div>
23
 
24
- <form action="%%SUCURI.URL.Settings%%#notifications" method="post">
25
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
26
- <span class="sucuriscan-input-group">
27
  <label>Maximum Alerts Per Hour:</label>
28
  <select name="sucuriscan_emails_per_hour">
29
- %%%SUCURI.AlertSettings.PerHour%%%
30
  </select>
31
- </span>
32
- <button type="submit" class="button-primary">Save</button>
33
  </form>
34
  </div>
35
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Alerts Per Hour</h3>
4
 
5
  <div class="inside">
6
  <p>
11
  alerts to receive during the same hour.
12
  </p>
13
 
14
+ <div class="sucuriscan-inline-alert-error">
15
  <p>
16
  If you have enabled the alerts for <a href="https://kb.sucuri.net/definitions/attacks/brute-force/password-guessing"
17
  target="_blank">password guessing brute force attacks</a> and lowered the number
21
  </p>
22
  </div>
23
 
24
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
25
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
26
+ <fieldset class="sucuriscan-clearfix">
27
  <label>Maximum Alerts Per Hour:</label>
28
  <select name="sucuriscan_emails_per_hour">
29
+ %%%SUCURI.Alerts.PerHour%%%
30
  </select>
31
+ <button type="submit" class="button button-primary">Save</button>
32
+ </fieldset>
33
  </form>
34
  </div>
35
  </div>
inc/tpl/{settings-alert-recipients.html.tpl → settings-alerts-recipients.html.tpl} RENAMED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Alert Recipients</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -22,37 +22,33 @@
22
  </p>
23
  </div>
24
 
25
- <form action="%%SUCURI.URL.Settings%%#notifications" method="post">
26
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
27
 
 
 
 
 
 
 
28
  <table class="wp-list-table widefat sucuriscan-table">
29
  <thead>
30
  <tr>
31
- <th class="manage-column column-cb check-column">
32
  <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
33
  <input id="cb-select-all-1" type="checkbox">
34
- </th>
35
  <th class="manage-column">E-mail Address</th>
36
  </tr>
37
  </thead>
38
 
39
  <tbody>
40
- %%%SUCURI.AlertSettings.Recipients%%%
41
  </tbody>
42
  </table>
43
 
44
- <div class="sucuriscan-recipient-form">
45
- <span class="sucuriscan-input-group">
46
- <label>E-mail Address:</label>
47
- <input type="text" name="sucuriscan_recipient" class="input-text" placeholder="e.g. user@example.com" />
48
- </span>
49
- <button type="submit" name="sucuriscan_save_recipient" class="button-primary">Add Recipient</button>
50
- </div>
51
-
52
- <div class="sucuriscan-recipient-form">
53
- <button type="submit" name="sucuriscan_delete_recipients" class="button-primary button-danger">Delete Selected</button>
54
- <button type="submit" name="sucuriscan_debug_email" value="1" class="button-primary">Test Alert Delivery</button>
55
- </div>
56
  </form>
57
  </div>
58
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Alert Recipients</h3>
4
 
5
  <div class="inside">
6
  <p>
22
  </p>
23
  </div>
24
 
25
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
26
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
27
 
28
+ <fieldset class="sucuriscan-clearfix">
29
+ <label>E-mail Address:</label>
30
+ <input type="text" name="sucuriscan_recipient" placeholder="e.g. user@example.com" />
31
+ <button type="submit" name="sucuriscan_save_recipient" class="button button-primary">Add Recipient</button>
32
+ </fieldset>
33
+
34
  <table class="wp-list-table widefat sucuriscan-table">
35
  <thead>
36
  <tr>
37
+ <td id="cb" class="manage-column column-cb check-column">
38
  <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
39
  <input id="cb-select-all-1" type="checkbox">
40
+ </td>
41
  <th class="manage-column">E-mail Address</th>
42
  </tr>
43
  </thead>
44
 
45
  <tbody>
46
+ %%%SUCURI.Alerts.Recipients%%%
47
  </tbody>
48
  </table>
49
 
50
+ <button type="submit" name="sucuriscan_delete_recipients" class="button button-primary">Delete Selected</button>
51
+ <button type="submit" name="sucuriscan_debug_email" value="1" class="button button-primary">Test Alert Delivery</button>
 
 
 
 
 
 
 
 
 
 
52
  </form>
53
  </div>
54
  </div>
inc/tpl/{settings-alert-recipients.snippet.tpl → settings-alerts-recipients.snippet.tpl} RENAMED
@@ -1,8 +1,9 @@
1
 
2
- <tr class="%%SUCURI.Recipient.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_recipients[]" value="%%SUCURI.Recipient.Email%%" />
5
- </td>
 
6
  <td>
7
  <a href="mailto:%%SUCURI.Recipient.Email%%">%%SUCURI.Recipient.Email%%</a>
8
  </td>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_recipients[]" value="%%SUCURI.Recipient.Email%%" />
5
+ </th>
6
+
7
  <td>
8
  <a href="mailto:%%SUCURI.Recipient.Email%%">%%SUCURI.Recipient.Email%%</a>
9
  </td>
inc/tpl/{settings-alert-subject.html.tpl → settings-alerts-subject.html.tpl} RENAMED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Alert Subject</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -11,23 +11,23 @@
11
  email subject using the pseudo-tags shown below.
12
  </p>
13
 
14
- <form action="%%SUCURI.URL.Settings%%#notifications" method="post">
15
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
16
 
17
  <ul class="sucuriscan-subject-formats">
18
- %%%SUCURI.AlertSettings.Subject%%%
19
 
20
  <li>
21
  <label>
22
- <input type="radio" name="sucuriscan_email_subject" value="custom" %%SUCURI.AlertSettings.CustomChecked%% />
23
  <span>Custom format</span>
24
- <input type="text" name="sucuriscan_custom_email_subject" value="%%SUCURI.AlertSettings.CustomValue%%" />
25
  </label>
26
  </li>
27
  </ul>
28
 
29
  <div class="sucuriscan-recipient-form">
30
- <button type="submit" class="button-primary">Save</button>
31
  </div>
32
  </form>
33
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Alert Subject</h3>
4
 
5
  <div class="inside">
6
  <p>
11
  email subject using the pseudo-tags shown below.
12
  </p>
13
 
14
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
15
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
16
 
17
  <ul class="sucuriscan-subject-formats">
18
+ %%%SUCURI.Alerts.Subject%%%
19
 
20
  <li>
21
  <label>
22
+ <input type="radio" name="sucuriscan_email_subject" value="custom" %%SUCURI.Alerts.CustomChecked%% />
23
  <span>Custom format</span>
24
+ <input type="text" name="sucuriscan_custom_email_subject" value="%%SUCURI.Alerts.CustomValue%%" />
25
  </label>
26
  </li>
27
  </ul>
28
 
29
  <div class="sucuriscan-recipient-form">
30
+ <button type="submit" class="button button-primary">Save</button>
31
  </div>
32
  </form>
33
  </div>
inc/tpl/settings-alerts-subject.snippet.tpl ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+
2
+ <li>
3
+ <label>
4
+ <input type="radio" name="sucuriscan_email_subject" value="%%SUCURI.EmailSubject.Value%%" %%SUCURI.EmailSubject.Checked%% />
5
+ <span>%%SUCURI.EmailSubject.Name%%</span>
6
+ </label>
7
+ </li>
inc/tpl/settings-alerts-trustedips.html.tpl ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Trusted IP Addresses</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ If you are working in a LAN <em>(Local Area Network)</em> you may want to
8
+ include the IP addresses of all the nodes in the subnet, this will force the
9
+ plugin to stop sending email alerts about actions executed from trusted
10
+ IP addresses. Use the CIDR <em>(Classless Inter Domain Routing)</em> format to
11
+ specify ranges of IP addresses <em>(only 8, 16, and 24)</em>.
12
+ </p>
13
+
14
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="POST">
15
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
16
+
17
+ <fieldset class="sucuriscan-clearfix">
18
+ <label>Trust New IP Address:</label>
19
+ <input type="text" name="sucuriscan_trust_ip" placeholder="e.g. 182.120.56.0/24" />
20
+ <input type="submit" value="Add Entry" class="button button-primary" />
21
+ </fieldset>
22
+ </form>
23
+
24
+ <hr>
25
+
26
+ <form action="%%SUCURI.URL.Settings%%#alerts" method="post">
27
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
28
+
29
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings-trustip">
30
+ <thead>
31
+ <tr>
32
+ <td id="cb" class="manage-column column-cb check-column">
33
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
34
+ <input id="cb-select-all-1" type="checkbox">
35
+ </td>
36
+ <th class="manage-column">IP Address</th>
37
+ <th class="manage-column">CIDR Format</th>
38
+ <th class="manage-column">Added At</th>
39
+ </tr>
40
+ </thead>
41
+
42
+ <tbody>
43
+ %%%SUCURI.TrustedIPs.List%%%
44
+
45
+ <tr class="sucuriscan-%%SUCURI.TrustedIPs.NoItems.Visibility%%">
46
+ <td colspan="4">
47
+ <em>List is empty.</em>
48
+ </td>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+
53
+ <button type="submit" class="button button-primary">Remove Trusted IP Addresses</button>
54
+ </form>
55
+ </div>
56
+ </div>
inc/tpl/{settings-trustip.snippet.tpl → settings-alerts-trustedips.snippet.tpl} RENAMED
@@ -1,9 +1,12 @@
1
 
2
- <tr class="%%SUCURI.TrustIP.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_del_trust_ip[]" value="%%SUCURI.TrustIP.CacheKey%%" />
5
- </td>
 
6
  <td><span class="sucuriscan-monospace">%%SUCURI.TrustIP.RemoteAddr%%</span></td>
 
7
  <td><span class="sucuriscan-monospace">%%SUCURI.TrustIP.CIDRFormat%%</span></td>
 
8
  <td><span class="sucuriscan-monospace">%%SUCURI.TrustIP.AddedAt%%</span></td>
9
  </tr>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_del_trust_ip[]" value="%%SUCURI.TrustIP.CacheKey%%" />
5
+ </th>
6
+
7
  <td><span class="sucuriscan-monospace">%%SUCURI.TrustIP.RemoteAddr%%</span></td>
8
+
9
  <td><span class="sucuriscan-monospace">%%SUCURI.TrustIP.CIDRFormat%%</span></td>
10
+
11
  <td><span class="sucuriscan-monospace">%%SUCURI.TrustIP.AddedAt%%</span></td>
12
  </tr>
inc/tpl/settings-apirecovery.html.tpl CHANGED
@@ -20,10 +20,10 @@
20
 
21
  <form action="%%SUCURI.URL.Settings%%" method="post">
22
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
23
- <span class="sucuriscan-input-group">
24
  <label>Plugin API Key:</label>
25
- <input type="text" name="sucuriscan_manual_api_key" class="input-text" />
26
- </span>
27
- <button type="submit" class="button-primary">Proceed</button>
28
  </form>
29
  </div>
20
 
21
  <form action="%%SUCURI.URL.Settings%%" method="post">
22
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
23
+ <fieldset class="sucuriscan-clearfix">
24
  <label>Plugin API Key:</label>
25
+ <input type="text" name="sucuriscan_manual_api_key" />
26
+ <button type="submit" class="button button-primary">Proceed</button>
27
+ </fieldset>
28
  </form>
29
  </div>
inc/tpl/settings-apiregistered.html.tpl CHANGED
@@ -10,16 +10,18 @@
10
  and better posture, all with the intent of reducing risk.
11
  </p>
12
 
13
- <div class="sucuriscan-inline-alert-warning">
14
  <p>
15
- <b>WARNING:</b> It is very important that you go to the settings page and
16
- configure the plugin to work in certain way following the configuration of the
17
- server where your website is being hosted; do not ignore this or else you may
18
- end up affecting the performance of your website.
 
 
19
  </p>
20
  </div>
21
 
22
- <a href="%%SUCURI.URL.Home%%" class="button button-primary">Dashboard</a>
23
  <a href="%%SUCURI.URL.Settings%%" class="button button-primary">Settings</a>
24
  </div>
25
  </div>
10
  and better posture, all with the intent of reducing risk.
11
  </p>
12
 
13
+ <div class="sucuriscan-inline-alert-success">
14
  <p>
15
+ Your website has been granted a new API key and it was
16
+ associated to the email address that you chose during the
17
+ registration process. You can use the same email to recover the
18
+ key if you happen to lose it sometime. We encourage you to check
19
+ the rest of the settings page and configure the plugin to your
20
+ own needs.
21
  </p>
22
  </div>
23
 
24
+ <a href="%%SUCURI.URL.Dashboard%%" class="button button-primary">Dashboard</a>
25
  <a href="%%SUCURI.URL.Settings%%" class="button button-primary">Settings</a>
26
  </div>
27
  </div>
inc/tpl/settings-apiservice-handler.html.tpl DELETED
@@ -1,25 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>API Request Handler</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- Select which interface will be used to send the HTTP requests to the
8
- external API services, the plugin will try to use the best option
9
- automatically and rescue the requests when any of the options is not
10
- available. Be sure to understand the purpose of this option before
11
- you try to modify it.
12
- </p>
13
-
14
- <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
15
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
16
- <span class="sucuriscan-input-group">
17
- <label>HTTP Request Handler:</label>
18
- <select name="sucuriscan_api_handler">
19
- %%%SUCURI.ApiHandlerOptions%%%
20
- </select>
21
- </span>
22
- <button type="submit" class="button-primary">Proceed</button>
23
- </form>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-apiservice-protocol.html.tpl DELETED
@@ -1,105 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>API Communication Protocol</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- HTTPS is a protocol for secure communication over a computer network which is
8
- widely used on the Internet. HTTPS consists of communication over Hypertext
9
- Transfer Protocol (HTTP) within a connection encrypted by Transport Layer
10
- Security or its predecessor, Secure Sockets Layer. The main motivation for HTTPS
11
- is authentication of the visited website and protection of the privacy and
12
- integrity of the exchanged data.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-info">
16
- <p>
17
- HTTPS provides authentication of the website and associated web server with
18
- which one is communicating, which protects against <a target="_blank"
19
- href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack">man-in-the-middle
20
- attacks</a>. Additionally, it provides bidirectional encryption of communications
21
- between a client and server, which protects against eavesdropping and tampering
22
- with and/or forging the contents of the communication. In practice, this provides
23
- a reasonable guarantee that one is communicating with precisely the website that
24
- one intended to communicate with (as opposed to an impostor), as well as ensuring
25
- that the contents of communications between the user and site cannot be read or
26
- forged by any third party.
27
- </p>
28
- </div>
29
-
30
- <p>
31
- More info at <a href="https://en.wikipedia.org/wiki/HTTPS" target="_blank">WikiPedia HTTPS</a>
32
- </p>
33
-
34
- <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.ApiProtocol.StatusNum%%">
35
- <span>API Communication via HTTPS is %%SUCURI.ApiProtocol.Status%%</span>
36
- <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
37
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
38
- <input type="hidden" name="sucuriscan_api_protocol" value="%%SUCURI.ApiProtocol.SwitchValue%%" />
39
- <button type="submit" class="button-primary %%SUCURI.ApiProtocol.SwitchCssClass%%">%%SUCURI.ApiProtocol.SwitchText%%</button>
40
- </form>
41
- </div>
42
-
43
- <script type="text/javascript">
44
- jQuery(function ($) {
45
- $('body').on('click', '#sucuriscan-debug-api-calls button', function (ev) {
46
- ev.preventDefault();
47
- var apiUnique;
48
- var testedUrls = 0;
49
- var button = $(this);
50
- var apiUrls = $('#sucuriscan-debug-api-calls tbody :checkbox:checked');
51
- var totalApiUrls = apiUrls.length;
52
-
53
- button.attr('disabled', true);
54
- button.html('Test API Calls &mdash; Loading...');
55
- $('#sucuriscan-debug-api-calls tbody td > div').html('');
56
-
57
- apiUrls.each(function (key, el) {
58
- apiUnique = $(el).val();
59
- $('#sucuriscan-api-' + apiUnique).html('Loading...');
60
-
61
- $.post('%%SUCURI.AjaxURL.Settings%%', {
62
- action: 'sucuriscan_settings_ajax',
63
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
64
- form_action: 'debug_api_call',
65
- api_unique: apiUnique
66
- }, function (data) {
67
- testedUrls++;
68
- $('#sucuriscan-api-' + data.unique).html(data.output);
69
-
70
- if (testedUrls === totalApiUrls) {
71
- button.attr('disabled', false);
72
- button.html('Test API Calls');
73
- }
74
- });
75
- });
76
- });
77
- });
78
- </script>
79
-
80
- <form id="sucuriscan-debug-api-calls" action="%%SUCURI.URL.Settings%%#apiservice" method="post">
81
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
82
-
83
- <table class="wp-list-table widefat sucuriscan-table">
84
- <thead>
85
- <tr>
86
- <th class="manage-column column-cb check-column">
87
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
88
- <input id="cb-select-all-1" type="checkbox">
89
- </th>
90
- <th class="manage-column" colspan="2">API URL <em>(URLs affected by this setting)</em></th>
91
- </tr>
92
- </thead>
93
-
94
- <tbody>
95
- %%%SUCURI.ApiProtocol.AffectedUrls%%%
96
- </tbody>
97
- </table>
98
-
99
- <div class="sucuriscan-recipient-form">
100
- <button type="submit" name="sucuriscan_debug_api_calls"
101
- value="1" class="button-primary">Test API Calls</button>
102
- </div>
103
- </form>
104
- </div>
105
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-apiservice-protocol.snippet.tpl DELETED
@@ -1,8 +0,0 @@
1
-
2
- <tr class="%%SUCURI.ApiProtocol.CssClass%%">
3
- <td class="check-column">
4
- <input type="checkbox" name="sucuriscan_api_ids[]" value="%%SUCURI.ApiProtocol.ID%%" />
5
- </td>
6
- <td><span class="sucuriscan-monospace">%%SUCURI.ApiProtocol.URL%%</span></td>
7
- <td><div id="sucuriscan-api-%%SUCURI.ApiProtocol.ID%%">&nbsp;</div></td>
8
- </tr>
 
 
 
 
 
 
 
 
inc/tpl/settings-apiservice-proxy.html.tpl CHANGED
@@ -1,16 +1,17 @@
1
 
2
- <div class="postbox">
3
- <h3>API Communication via Proxy</h3>
4
 
5
  <div class="inside">
6
  <p>
7
- All the HTTP requests used to communicate with the API service are being sent
8
- using the WordPress built-in functions, so <em>(almost)</em> all its official
9
- features are inherited, this is useful if you need to pass these HTTP requests
10
- through a proxy. According to the <a href="https://codex.wordpress.org/HTTP_API"
11
- target="_blank">official documentation</a> you have to add some constants to the
12
- main configuration file: <em>WP_PROXY_HOST, WP_PROXY_PORT, WP_PROXY_USERNAME,
13
- WP_PROXY_PASSWORD</em>.
 
14
  </p>
15
 
16
  <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-monospace">
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">API Communication via Proxy</h3>
4
 
5
  <div class="inside">
6
  <p>
7
+ All the HTTP requests used to communicate with the API service are
8
+ being sent using the WordPress built-in functions, so (almost) all
9
+ its official features are inherited, this is useful if you need to
10
+ pass these HTTP requests through a proxy. According to the
11
+ <a href="https://developer.wordpress.org/reference/classes/wp_http_proxy/"
12
+ target="_blank" rel="noopener">official documentation</a> you have to add some
13
+ constants to the main configuration file: <em>WP_PROXY_HOST,
14
+ WP_PROXY_PORT, WP_PROXY_USERNAME, WP_PROXY_PASSWORD</em>.
15
  </p>
16
 
17
  <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-monospace">
inc/tpl/settings-apiservice-ssl.html.tpl DELETED
@@ -1,38 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>API Request and SSL</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- SSL is a cryptographic protocols designed to provide communications security
8
- over a computer network. The primary goal of the TLS protocol <em>(and its
9
- predecessor SSL - Secure Sockets Layer)</em> is to provide privacy and data
10
- integrity between two communicating computer applications. When you have this
11
- option enabled <em>(by default)</em> it forces the plugin to send the HTTP
12
- requests to the API service via TLS.
13
- </p>
14
-
15
- <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.VerifySSLCertCssClass%%">
16
- <span>%%SUCURI.VerifySSLCert%%</span>
17
- </div>
18
-
19
- <p>
20
- Either because the SSL certificate of the API service has expired or because the
21
- HTTP transport protocol offered by your hosting provider does not supports SSL
22
- you may want to deactivate this option, but be aware that <a target="_blank"
23
- href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack">MITM attacks</a>
24
- can take advantage of this to steal information from your website.
25
- </p>
26
-
27
- <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
28
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
29
- <span class="sucuriscan-input-group">
30
- <label>SSL Certificate Verification:</label>
31
- <select name="sucuriscan_verify_ssl_cert">
32
- %%%SUCURI.VerifySSLCertOptions%%%
33
- </select>
34
- </span>
35
- <button type="submit" class="button-primary">Proceed</button>
36
- </form>
37
- </div>
38
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-apiservice-status.html.tpl CHANGED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>API Service Communication</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -12,7 +12,7 @@
12
  malicious person was able to gain access to the website.
13
  </p>
14
 
15
- <div class="sucuriscan-inline-alert-warning sucuriscan-%%SUCURI.ApiStatus.WarningVisibility%%">
16
  <p>
17
  The latency of the HTTP requests may slow down the website depending on the
18
  location of the server that is hosting it. Additionally, if the API goes down
@@ -25,7 +25,7 @@
25
  <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.ApiStatus.ErrorVisibility%%">
26
  <p>
27
  Disabling the API service communication will stop the event monitoring, consider
28
- to enable the <a href="%%SUCURI.URL.Settings%%#selfhosting">Log Exporter</a> to
29
  keep the monitoring working while the HTTP requests are ignored, otherwise an
30
  attacker may execute an action that will not be registered in the security logs
31
  and you will not have a way to investigate the attack in the future.
@@ -34,10 +34,12 @@
34
 
35
  <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.ApiStatus.StatusNum%%">
36
  <span>API Service Communication is %%SUCURI.ApiStatus.Status%%</span>
 
 
37
  <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
38
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
39
  <input type="hidden" name="sucuriscan_api_service" value="%%SUCURI.ApiStatus.SwitchValue%%" />
40
- <button type="submit" class="button-primary %%SUCURI.ApiStatus.SwitchCssClass%%">%%SUCURI.ApiStatus.SwitchText%%</button>
41
  </form>
42
  </div>
43
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">API Service Communication</h3>
4
 
5
  <div class="inside">
6
  <p>
12
  malicious person was able to gain access to the website.
13
  </p>
14
 
15
+ <div class="sucuriscan-inline-alert-info sucuriscan-%%SUCURI.ApiStatus.WarningVisibility%%">
16
  <p>
17
  The latency of the HTTP requests may slow down the website depending on the
18
  location of the server that is hosting it. Additionally, if the API goes down
25
  <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.ApiStatus.ErrorVisibility%%">
26
  <p>
27
  Disabling the API service communication will stop the event monitoring, consider
28
+ to enable the <a href="%%SUCURI.URL.Settings%%#general">Log Exporter</a> to
29
  keep the monitoring working while the HTTP requests are ignored, otherwise an
30
  attacker may execute an action that will not be registered in the security logs
31
  and you will not have a way to investigate the attack in the future.
34
 
35
  <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.ApiStatus.StatusNum%%">
36
  <span>API Service Communication is %%SUCURI.ApiStatus.Status%%</span>
37
+ &mdash;
38
+ <span class="sucuriscan-monospace">%%SUCURI.ApiStatus.ServiceURL%%</span>
39
  <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
40
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
41
  <input type="hidden" name="sucuriscan_api_service" value="%%SUCURI.ApiStatus.SwitchValue%%" />
42
+ <button type="submit" class="button button-primary">%%SUCURI.ApiStatus.SwitchText%%</button>
43
  </form>
44
  </div>
45
  </div>
inc/tpl/settings-apiservice-timeout.html.tpl CHANGED
@@ -1,13 +1,13 @@
1
 
2
- <div class="postbox">
3
- <h3>API Request Timeout</h3>
4
 
5
  <div class="inside">
6
  <p>
7
  The plugin sends the data associated to the events triggered by WordPress when
8
  it considers the action is suspicious, it sends this information via HTTP requests
9
  using the HTTP transport protocol available in the system and the <a target="_blank"
10
- href="https://developer.wordpress.org/reference/functions/wp_remote_post/">built-in
11
  functions</a> provided by WordPress, then it waits for the response.
12
  </p>
13
 
@@ -30,11 +30,11 @@
30
 
31
  <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
32
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
33
- <span class="sucuriscan-input-group">
34
  <label>HTTP Request Timeout (in secs)</label>
35
- <input type="text" name="sucuriscan_request_timeout" class="input-text" />
36
- </span>
37
- <button type="submit" class="button-primary">Proceed</button>
38
  </form>
39
  </div>
40
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">API Request Timeout</h3>
4
 
5
  <div class="inside">
6
  <p>
7
  The plugin sends the data associated to the events triggered by WordPress when
8
  it considers the action is suspicious, it sends this information via HTTP requests
9
  using the HTTP transport protocol available in the system and the <a target="_blank"
10
+ href="https://developer.wordpress.org/reference/functions/wp_remote_post/" rel="noopener">built-in
11
  functions</a> provided by WordPress, then it waits for the response.
12
  </p>
13
 
30
 
31
  <form action="%%SUCURI.URL.Settings%%#apiservice" method="post">
32
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
33
+ <fieldset class="sucuriscan-clearfix">
34
  <label>HTTP Request Timeout (in secs)</label>
35
+ <input type="text" name="sucuriscan_request_timeout" />
36
+ <button type="submit" class="button button-primary">Proceed</button>
37
+ </fieldset>
38
  </form>
39
  </div>
40
  </div>
inc/tpl/settings-apiservice.html.tpl DELETED
@@ -1,14 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-general-apiservice">
3
- %%%SUCURI.SettingsSection.ApiStatus%%%
4
-
5
- %%%SUCURI.SettingsSection.ApiProxy%%%
6
-
7
- %%%SUCURI.SettingsSection.ApiSSL%%%
8
-
9
- %%%SUCURI.SettingsSection.ApiHandler%%%
10
-
11
- %%%SUCURI.SettingsSection.ApiTimeout%%%
12
-
13
- %%%SUCURI.SettingsSection.ApiProtocol%%%
14
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-corefiles-cache.html.tpl DELETED
@@ -1,42 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Core Integrity Checks - Marked As Fixed</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- The scanner is prone to inconsistencies due to the diversity of configurations
8
- that a hosting provider may have in their servers, many of them add files in the
9
- document root of the websites with information associated to 3rd-party services
10
- that they offer or programs that they are running in their system. These files
11
- will be flagged by the plugin as <em>"added"</em> because they are not part of
12
- the official WordPress packages, but it is clear that they are false/positives.
13
- Some of these files are being ignored by the plugin to reduce the noise in the
14
- integrity checks, but there are many others that are not, you will have to
15
- select them and mark them as fixed if you believe they are harmless, this action
16
- will force the plugin to ignore them in future scans.
17
- </p>
18
-
19
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
20
- <span>Core Files Marked As Fixed: %%SUCURI.CoreFiles.CacheSize%% of data</span>
21
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
22
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
23
- <input type="hidden" name="sucuriscan_corefiles_cache" value="1" />
24
- <button type="submit" class="button-primary">Reset Cache</button>
25
- </form>
26
- </div>
27
-
28
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-%%SUCURI.CoreFiles.TableVisibility%%">
29
- <thead>
30
- <tr>
31
- <th>Reason</th>
32
- <th>Ignored At</th>
33
- <th>Line</th>
34
- </tr>
35
- </thead>
36
-
37
- <tbody>
38
- %%%SUCURI.CoreFiles.IgnoredFiles%%%
39
- </tbody>
40
- </table>
41
- </div>
42
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-corefiles-cache.snippet.tpl DELETED
@@ -1,6 +0,0 @@
1
-
2
- <tr class="%%SUCURI.IgnoredFile.CssClass%% sucuriscan-corefiles-%%SUCURI.IgnoredFile.UniqueId%%">
3
- <td><span class="sucuriscan-label sucuriscan-label-%%SUCURI.IgnoredFile.StatusType%%">%%SUCURI.IgnoredFile.StatusType%%</span></td>
4
- <td>%%SUCURI.IgnoredFile.IgnoredAt%%</td>
5
- <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.IgnoredFile.FilePath%%</span></td>
6
- </tr>
 
 
 
 
 
 
inc/tpl/settings-corefiles-language.html.tpl DELETED
@@ -1,40 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Core Integrity Checks - Language</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- The information necessary to check the integrity of the core files is obtained
8
- from the official <a href="http://codex.wordpress.org/WordPress.org_API"
9
- target="_blank">WordPress API</a> using an endpoint that returns the checksums
10
- of all the files associated to a version number. By default the API returns the
11
- checksums for the English installation, and there is an optional parameter named
12
- locale that accepts a valid abbreviation for a supported language. If your website
13
- was not installed using the English package please choose the appropriate language
14
- below.
15
- </p>
16
-
17
- <p>
18
- <strong>Note:</strong> Not all the international language codes are supported by
19
- WordPress's API, you must expect incompatibilities with the results of the core
20
- integrity checks, if you see files that are being flagged as added even when they
21
- are part of the official releases, files that are being flagged as deleted even
22
- when they are part of the official releases, and/or files that are being flagged
23
- as modified even when their content has not been modified please consider to
24
- select the English locale, if the false positives are persistent then fill a
25
- ticket reporting the issue.
26
- </p>
27
-
28
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
29
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
30
- <span class="sucuriscan-input-group">
31
- <label>WordPress Locale:</label>
32
- <select name="sucuriscan_set_language">
33
- %%%SUCURI.Integrity.LanguageDropdown%%%
34
- </select>
35
- </span>
36
- <button type="submit" class="button-primary">Proceed</button>
37
- <em>(WordPress Locale %%SUCURI.Integrity.WordPressLocale%%)</em>
38
- </form>
39
- </div>
40
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-corefiles-status.html.tpl DELETED
@@ -1,42 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Core Integrity Checks</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- This tool allows you to scan the core directories searching for added, modified,
8
- and deleted files, there is no need to touch any of these core files so any
9
- inconsistency notified after the scan must be considered as a high severity
10
- warning as it may be a sign that a malicious person got access to the website
11
- and was able to add malicious code, modify files to inject malware, and/or delete
12
- important parts of the project.
13
- </p>
14
-
15
- <div class="sucuriscan-inline-alert-info">
16
- <p>
17
- Note that this tool does not checks for malicious code, for that you have to
18
- use the <a href="%%SUCURI.URL.Scanner%%">Malware Scanner</a> instead.
19
- </p>
20
- </div>
21
-
22
- <p>
23
- This tool detects changes in the project core files using a list of checksums
24
- that WordPress provides via their official API service, if a file in the website
25
- has a different checksum then the plugin displays a warning saying that the file
26
- was modified. If the file is listed in the data provided by WordPress but does
27
- not exists in the website then the plugin displays a warning saying that the
28
- file was deleted. If the plugin finds a file in one of the core directories that
29
- is not listed in the checksums then it displays a warning saying that the file
30
- was added.
31
- </p>
32
-
33
- <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.Integrity.StatusNum%%">
34
- <span>Core Integrity Checks are %%SUCURI.Integrity.Status%%</span>
35
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
36
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
37
- <input type="hidden" name="sucuriscan_scan_checksums" value="%%SUCURI.Integrity.SwitchValue%%" />
38
- <button type="submit" class="button-primary %%SUCURI.Integrity.SwitchCssClass%%">%%SUCURI.Integrity.SwitchText%%</button>
39
- </form>
40
- </div>
41
- </div>
42
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-datastorage-files.snippet.tpl DELETED
@@ -1,11 +0,0 @@
1
-
2
- <tr class="%%SUCURI.DataStorage.CssClass%%">
3
- <td class="check-column">
4
- <input type="checkbox" name="sucuriscan_fnames[]"
5
- %%SUCURI.DataStorage.DisabledInput%%
6
- value="%%SUCURI.DataStorage.Fname%%" />
7
- </td>
8
- <td><span class="sucuriscan-monospace">%%SUCURI.DataStorage.Fpath%%</span></td>
9
- <td><span class="sucuriscan-monospace">%%SUCURI.DataStorage.Exists%%</span></td>
10
- <td><span class="sucuriscan-monospace">%%SUCURI.DataStorage.IsWritable%%</span></td>
11
- </tr>
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-general-apikey.html.tpl CHANGED
@@ -3,8 +3,8 @@
3
 
4
  %%%SUCURI.ModalForApiKeyRecovery%%%
5
 
6
- <div class="postbox">
7
- <h3>Plugin API Key</h3>
8
 
9
  <div class="inside">
10
  <p>
@@ -30,7 +30,7 @@
30
  </p>
31
  </div>
32
 
33
- <div class="sucuriscan-inline-alert-warning sucuriscan-%%SUCURI.InvalidDomainVisibility%%">
34
  <p>
35
  Your domain <code>%%SUCURI.CleanDomain%%</code> does not seems to have a DNS
36
  <code>A</code> record so it will be considered as <em>invalid</em> by the API
@@ -45,7 +45,7 @@
45
  <div class="sucuriscan-monospace">Plugin API Key: %%SUCURI.APIKey%%</div>
46
  <form action="%%SUCURI.URL.Settings%%" method="post">
47
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
48
- <button type="submit" name="sucuriscan_recover_key" class="button-primary">Recover Via E-mail</button>
49
  </form>
50
  </div>
51
 
@@ -62,7 +62,7 @@
62
  <div class="sucuriscan-monospace">Plugin API Key: %%SUCURI.APIKey%%</div>
63
  <form action="%%SUCURI.URL.Settings%%" method="post">
64
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
65
- <button type="submit" name="sucuriscan_remove_api_key" class="button-primary button-danger">Remove</button>
66
  </form>
67
  </div>
68
  </div>
3
 
4
  %%%SUCURI.ModalForApiKeyRecovery%%%
5
 
6
+ <div class="sucuriscan-panel">
7
+ <h3 class="sucuriscan-title">Plugin API Key</h3>
8
 
9
  <div class="inside">
10
  <p>
30
  </p>
31
  </div>
32
 
33
+ <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.InvalidDomainVisibility%%">
34
  <p>
35
  Your domain <code>%%SUCURI.CleanDomain%%</code> does not seems to have a DNS
36
  <code>A</code> record so it will be considered as <em>invalid</em> by the API
45
  <div class="sucuriscan-monospace">Plugin API Key: %%SUCURI.APIKey%%</div>
46
  <form action="%%SUCURI.URL.Settings%%" method="post">
47
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
48
+ <button type="submit" name="sucuriscan_recover_key" class="button button-primary">Recover Via E-mail</button>
49
  </form>
50
  </div>
51
 
62
  <div class="sucuriscan-monospace">Plugin API Key: %%SUCURI.APIKey%%</div>
63
  <form action="%%SUCURI.URL.Settings%%" method="post">
64
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
65
+ <button type="submit" name="sucuriscan_remove_api_key" class="button button-primary">Remove</button>
66
  </form>
67
  </div>
68
  </div>
inc/tpl/settings-general-auditlogstats.html.tpl CHANGED
@@ -1,40 +1,30 @@
1
 
2
- <div class="postbox">
3
- <h3>Audit Log Statistics</h3>
4
 
5
  <div class="inside">
6
  <p>
7
- Enabling this option allows you to have a quick view of the range of the
8
- activity of your users and/or the attacks directed against your website. By
9
- default, the plugin uses the <strong>latest %%SUCURI.AuditLogStats.Limit%%
10
- entries</strong> in the audit logs and uses that information to draw bar and
11
- pie charts in the dashboard.
12
  </p>
13
 
14
- <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.AuditLogStats.StatusNum%%">
15
- <span>Audit Log Statistics are %%SUCURI.AuditLogStats.Status%%</span>
16
- <form action="%%SUCURI.URL.Settings%%" method="post">
17
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
18
- <input type="hidden" name="sucuriscan_audit_report" value="%%SUCURI.AuditLogStats.SwitchValue%%" />
19
- <button type="submit" class="button-primary %%SUCURI.AuditLogStats.SwitchCssClass%%">%%SUCURI.AuditLogStats.SwitchText%%</button>
20
- </form>
21
- </div>
22
-
23
  <p>
24
- The statistic charts are generated with a limited number of logs stored in the
25
- remote API server, you can increase the number to draw the charts with more data
26
- and represent the activity during a wider range of days, but you must consider
27
- that the bigger the number the slower the plugin dashboard will be because it
28
- will take more time to read more logs.
29
  </p>
30
 
31
  <form action="%%SUCURI.URL.Settings%%" method="post">
32
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
33
- <span class="sucuriscan-input-group">
34
  <label>Audit Logs Limit:</label>
35
- <input type="text" name="sucuriscan_logs4report" class="input-text" placeholder="e.g. 500" />
36
- </span>
37
- <button type="submit" class="button-primary">Save</button>
38
  </form>
39
  </div>
40
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Audit Log Statistics</h3>
4
 
5
  <div class="inside">
6
  <p>
7
+ Enabling this option allows you to have a quick view of the range of
8
+ the activity of your users and/or the attacks directed against your
9
+ website. By default, the plugin uses the latest entries in the audit
10
+ logs and uses that information to draw bar and pie charts in the
11
+ dashboard.
12
  </p>
13
 
 
 
 
 
 
 
 
 
 
14
  <p>
15
+ The statistic are generated with a limited number of logs to reduce
16
+ the memory consumption of the parser. You can increase the limit at
17
+ your own discretion considering the amount of memory and maximum
18
+ execution time that your PHP installation is allowed to use.
 
19
  </p>
20
 
21
  <form action="%%SUCURI.URL.Settings%%" method="post">
22
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
23
+ <fieldset class="sucuriscan-clearfix">
24
  <label>Audit Logs Limit:</label>
25
+ <input type="text" name="sucuriscan_logs4report" value="%%SUCURI.AuditLogStats.Limit%%" placeholder="e.g. 500" />
26
+ <button type="submit" class="button button-primary">Save</button>
27
+ </fieldset>
28
  </form>
29
  </div>
30
  </div>
inc/tpl/settings-general-commentmonitor.html.tpl CHANGED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>User Comment Monitor</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -15,13 +15,11 @@
15
  usually falls under the category of not approved, and the message itself.
16
  </p>
17
 
18
- <div class="sucuriscan-inline-alert-info">
19
- <p>
20
- We also use this information in an anonymous way to generate <a target="_blank"
21
- href="https://sucuri.net/security-reports/brute-force/">statistics</a> of usage
22
- that help us improve our service.
23
- </p>
24
- </div>
25
 
26
  <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
27
  <span>User Comment Monitor is %%SUCURI.CommentMonitorStatus%%</span>
@@ -29,9 +27,7 @@
29
  <form action="%%SUCURI.URL.Settings%%" method="post">
30
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
31
  <input type="hidden" name="sucuriscan_comment_monitor" value="%%SUCURI.CommentMonitorSwitchValue%%" />
32
- <button type="submit" class="button-primary %%SUCURI.CommentMonitorSwitchCssClass%%">
33
- %%SUCURI.CommentMonitorSwitchText%%
34
- </button>
35
  </form>
36
  </div>
37
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">User Comment Monitor</h3>
4
 
5
  <div class="inside">
6
  <p>
15
  usually falls under the category of not approved, and the message itself.
16
  </p>
17
 
18
+ <p>
19
+ We also use this information in an anonymous way to generate <a target="_blank"
20
+ href="https://sucuri.net/security-reports/brute-force/">statistics</a> of usage
21
+ that help us improve our service.
22
+ </p>
 
 
23
 
24
  <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
25
  <span>User Comment Monitor is %%SUCURI.CommentMonitorStatus%%</span>
27
  <form action="%%SUCURI.URL.Settings%%" method="post">
28
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
29
  <input type="hidden" name="sucuriscan_comment_monitor" value="%%SUCURI.CommentMonitorSwitchValue%%" />
30
+ <button type="submit" class="button button-primary">%%SUCURI.CommentMonitorSwitchText%%</button>
 
 
31
  </form>
32
  </div>
33
  </div>
inc/tpl/settings-general-cronjobs.html.tpl ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Scheduled Tasks (%%SUCURI.Cronjobs.Total%% tasks)</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ <strong>Scheduled Tasks</strong> are rules registered in your database by a
8
+ plugin, theme, or the base system itself; they are used to automatically execute
9
+ actions defined in the code every certain amount of time. A good use of these
10
+ rules is to generate backup files of your site, execute a security scanner, or
11
+ remove unused elements like drafts.
12
+ </p>
13
+
14
+ <div class="sucuriscan-inline-alert-error">
15
+ <p>
16
+ Note that there are some scheduled tasks <em>(registered by the base
17
+ system)</em> that can not be removed permanently using this tool, tasks such as
18
+ the <strong>addon update</strong> and <strong>version checker</strong> are
19
+ required by the site to work correctly.
20
+ </p>
21
+ </div>
22
+
23
+ <form action="%%SUCURI.URL.Settings%%#general" method="post">
24
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
25
+
26
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-wpcron-list">
27
+ <thead>
28
+ <tr>
29
+ <td id="cb" class="manage-column column-cb check-column">
30
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
31
+ <input id="cb-select-all-1" type="checkbox">
32
+ </td>
33
+ <th>Task</th>
34
+ <th>Schedule</th>
35
+ <th>Next due</th>
36
+ <th>Arguments</th>
37
+ </tr>
38
+ </thead>
39
+
40
+ <tbody>
41
+ %%%SUCURI.Cronjobs.List%%%
42
+ </tbody>
43
+ </table>
44
+
45
+ <fieldset class="sucuriscan-clearfix">
46
+ <label>Choose Action:</label>
47
+ <select name="sucuriscan_cronjob_action">
48
+ %%%SUCURI.Cronjob.Schedules%%%
49
+ </select>
50
+ <button type="submit" class="button button-primary">Send action</button>
51
+ </fieldset>
52
+ </form>
53
+ </div>
54
+ </div>
inc/tpl/{infosys-cronjobs.snippet.tpl → settings-general-cronjobs.snippet.tpl} RENAMED
@@ -1,10 +1,14 @@
1
 
2
- <tr class="%%SUCURI.Cronjob.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_cronjobs[]" value="%%SUCURI.Cronjob.Hook%%" />
5
- </td>
 
6
  <td><span class="sucuriscan-monospace">%%SUCURI.Cronjob.Hook%%</span></td>
 
7
  <td>%%SUCURI.Cronjob.Schedule%%</td>
 
8
  <td>%%SUCURI.Cronjob.NextTime%%</td>
 
9
  <td>%%SUCURI.Cronjob.Arguments%%</td>
10
  </tr>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_cronjobs[]" value="%%SUCURI.Cronjob.Hook%%" />
5
+ </th>
6
+
7
  <td><span class="sucuriscan-monospace">%%SUCURI.Cronjob.Hook%%</span></td>
8
+
9
  <td>%%SUCURI.Cronjob.Schedule%%</td>
10
+
11
  <td>%%SUCURI.Cronjob.NextTime%%</td>
12
+
13
  <td>%%SUCURI.Cronjob.Arguments%%</td>
14
  </tr>
inc/tpl/settings-general-datastorage.html.tpl CHANGED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Data Storage Path</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -12,7 +12,7 @@
12
  to prevent the content to be printed.
13
  </p>
14
 
15
- <div class="sucuriscan-inline-alert-warning">
16
  <p>
17
  The plugin requires write permissions in this directory as well
18
  as the files contained in it. If you prefer to keep these files
@@ -24,7 +24,7 @@
24
  </div>
25
 
26
  <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
27
- <span class="sucuriscan-monospace">%%SUCURI.DatastorePath%%</span>
28
  </div>
29
 
30
  <p>
@@ -37,32 +37,32 @@
37
  remain in the database until the user grants write permissions.
38
  </p>
39
 
40
- <div class="sucuriscan-inline-alert-info">
41
- <p>
42
- Add this <code>define('SUCURI_SETTINGS_IN', 'database');</code>
43
- in the configuration file if you want to keep using the database.
44
- However, we encourage you to keep using the plain text files as
45
- this guarantees that the automated tests will cover all the code
46
- that powers the plugin.
47
- </p>
48
- </div>
 
 
 
 
 
 
 
 
49
 
50
- <table class="wp-list-table widefat sucuriscan-table">
51
- <thead>
52
- <tr>
53
- <th class="manage-column column-cb check-column">
54
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
55
- <input id="cb-select-all-1" type="checkbox">
56
- </th>
57
- <th class="manage-column">File</th>
58
- <th width="70" class="manage-column">Exists?</th>
59
- <th width="90" class="manage-column">Writable?</th>
60
- </tr>
61
- </thead>
62
 
63
- <tbody>
64
- %%%SUCURI.DataStorage.Files%%%
65
- </tbody>
66
- </table>
67
  </div>
68
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Data Storage Path</h3>
4
 
5
  <div class="inside">
6
  <p>
12
  to prevent the content to be printed.
13
  </p>
14
 
15
+ <div class="sucuriscan-inline-alert-info">
16
  <p>
17
  The plugin requires write permissions in this directory as well
18
  as the files contained in it. If you prefer to keep these files
24
  </div>
25
 
26
  <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
27
+ <span class="sucuriscan-monospace">%%SUCURI.Storage.Path%%</span>
28
  </div>
29
 
30
  <p>
37
  remain in the database until the user grants write permissions.
38
  </p>
39
 
40
+ <form action="%%SUCURI.URL.Settings%%#general" method="post">
41
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
42
+ <input type="hidden" name="sucuriscan_reset_storage" value="1" />
43
+
44
+ <table class="wp-list-table widefat sucuriscan-table">
45
+ <thead>
46
+ <tr>
47
+ <td id="cb" class="manage-column column-cb check-column">
48
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
49
+ <input id="cb-select-all-1" type="checkbox">
50
+ </td>
51
+ <th class="manage-column">File</th>
52
+ <th class="manage-column">Size</th>
53
+ <th class="manage-column">Existence</th>
54
+ <th class="manage-column">Write Permission</th>
55
+ </tr>
56
+ </thead>
57
 
58
+ <tbody>
59
+ %%%SUCURI.Storage.Files%%%
60
+ </tbody>
61
+ </table>
 
 
 
 
 
 
 
 
62
 
63
+ <p>
64
+ <button type="submit" class="button button-primary">Reset Files</button>
65
+ </p>
66
+ </form>
67
  </div>
68
  </div>
inc/tpl/settings-general-datastorage.snippet.tpl ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <tr>
3
+ <th class="check-column">
4
+ <input type="checkbox" name="sucuriscan_filename[]" %%SUCURI.Storage.DisabledInput%% value="%%SUCURI.Storage.Filename%%" />
5
+ </th>
6
+
7
+ <td>
8
+ <span class="sucuriscan-monospace">%%SUCURI.Storage.Filepath%%</span>
9
+ </td>
10
+
11
+ <td>
12
+ <span class="sucuriscan-monospace">%%SUCURI.Storage.Filesize%%</span>
13
+ </td>
14
+
15
+ <td>
16
+ <span class="sucuriscan-label-%%SUCURI.Storage.Existence%%">%%SUCURI.Storage.Exists%%</span>
17
+ </td>
18
+
19
+ <td>
20
+ <span class="sucuriscan-label-%%SUCURI.Storage.Writability%%">%%SUCURI.Storage.IsWritable%%</span>
21
+ </td>
22
+ </tr>
inc/tpl/settings-general-datetime.html.tpl DELETED
@@ -1,21 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Date &amp; Time</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- The plugin uses built-in WordPress functions to retrieve the current date and
8
- time, as well to translate timestamps to human readable text. Below is shown the
9
- data returned by the main three functions used by this plugin to get the date
10
- for the logs and email alerts, if you notice an inconsistency with any of these
11
- values please change the timezone settings.
12
- </p>
13
-
14
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
15
- <span>Current Date &amp; Time is</span>
16
- <strong>%%SUCURI.Datetime.HumanReadable%%</strong>
17
- <em>(%%SUCURI.Datetime.Timezone%% - %%SUCURI.Datetime.Timestamp%%)</em>
18
- <a href="%%SUCURI.Datetime.AdminURL%%" target="_blank" class="button-primary">Change</a>
19
- </div>
20
- </div>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-general-importexport.html.tpl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Import &amp; Export Settings</h3>
4
+
5
+ <div class="inside">
6
+ <form action="%%SUCURI.URL.Settings%%" method="post">
7
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
8
+
9
+ <p>
10
+ Copy the JSON-encoded data from the box below, go to your other
11
+ websites and click the <em>"Import"</em> button in the settings
12
+ page. The plugin will start using the same settings from this
13
+ website. Notice that some options are omitted as they contain values
14
+ specific to this website.
15
+ </p>
16
+
17
+ <textarea name="sucuriscan_settings" class="sucuriscan-full-textarea sucuriscan-monospace">%%SUCURI.Export%%</textarea>
18
+
19
+ <p>
20
+ To import the settings from another website into this one, replace
21
+ the JSON-encoded data in the box above with the JSON-encoded data
22
+ exported from the other website, then click the button
23
+ <em>"Import"</em>. Notice that some options will not be imported to
24
+ reduce the security risk of writing arbitrary data into the disk.
25
+ </p>
26
+
27
+ <p>
28
+ <label>
29
+ <input type="hidden" name="sucuriscan_process_form" value="0" />
30
+ <input type="checkbox" name="sucuriscan_process_form" value="1" />
31
+ <span>I understand that this operation can not be reverted.</span>
32
+ </label>
33
+ </p>
34
+
35
+ <button type="submit" name="sucuriscan_import" class="button button-primary">Import</button>
36
+ </form>
37
+ </div>
38
+ </div>
inc/tpl/settings-general-ipdiscoverer.html.tpl CHANGED
@@ -1,19 +1,21 @@
1
 
2
- <div class="postbox">
3
- <h3>IP Address Discoverer</h3>
4
 
5
  <div class="inside">
6
  <p>
7
- The IP address discoverer will use DNS lookups to automatically detect if the
8
- website is behind <a href="https://sucuri.net/website-firewall/"
9
- target="_blank">CloudProxy</a> in which case will modify the global server
10
- variable <em>Remote-Addr</em> to set the real IP of the website's visitors. This
11
- check runs on every WordPress init action and that is why it may slow down your
12
- website as some hosting providers rely on slow DNS servers which makes the
13
- operation take more time than it should.
 
 
14
  </p>
15
 
16
- <div class="sucuriscan-inline-alert-warning">
17
  <p>
18
  <b>IMPORTANT:</b> This option <em>(if enabled)</em> may slow down your website.
19
  </p>
@@ -25,9 +27,7 @@
25
  <form action="%%SUCURI.URL.Settings%%" method="post">
26
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
27
  <input type="hidden" name="sucuriscan_dns_lookups" value="%%SUCURI.DnsLookupsSwitchValue%%" />
28
- <button type="submit" class="button-primary %%SUCURI.DnsLookupsSwitchCssClass%%">
29
- %%SUCURI.DnsLookupsSwitchText%%
30
- </button>
31
  </form>
32
  </div>
33
 
@@ -43,31 +43,23 @@
43
 
44
  <form action="%%SUCURI.URL.Settings%%" method="post">
45
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
46
- <span class="sucuriscan-input-group">
 
47
  <label>Main IP HTTP Header:</label>
48
  <select name="sucuriscan_addr_header">
49
  %%%SUCURI.AddrHeaderOptions%%%
50
  </select>
51
- </span>
52
- <button type="submit" class="button-primary">Proceed</button>
53
- </form>
54
-
55
- <p>
56
- If you are experiencing issues with the automatic detection of IP address of
57
- your visitors, with the security logs, or with the response time of your website
58
- please send an email to <a href="mailto:info@sucuri.net">info@sucuri.net</a>
59
- explaining the situation and attach the information displayed below, this may
60
- help to troubleshoot the issue more easily; alternatively you may also ask for
61
- help in the forums.
62
- </p>
63
 
64
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-monospace">
65
- <div>CloudProxy is %%SUCURI.IsUsingCloudProxy%%</div>
66
- <div>Website URL: %%SUCURI.WebsiteURL%%</div>
67
- <div>Top Level Domain: %%SUCURI.TopLevelDomain%%</div>
68
- <div>Website Hostname: %%SUCURI.WebsiteHostName%%</div>
69
- <div>Website Host Address: %%SUCURI.WebsiteHostAddress%%</div>
70
- <div>IP Address: %%SUCURI.RemoteAddress%% (%%SUCURI.RemoteAddressHeader%%)</div>
71
- </div>
 
72
  </div>
73
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">IP Address Discoverer</h3>
4
 
5
  <div class="inside">
6
  <p>
7
+ IP address discoverer will use DNS lookups to automatically detect if
8
+ the website is behind the <a href="https://sucuri.net/website-firewall/"
9
+ target="_blank">Sucuri Firewall</a> in which case will modify the global
10
+ server variable <em>Remote-Addr</em> to set the real IP of the website's
11
+ visitors. This check runs on every WordPress init action and that is
12
+ why it may slow down your website as some hosting providers rely on
13
+ slow DNS servers which makes the operation take more time than it
14
+ should.
15
+
16
  </p>
17
 
18
+ <div class="sucuriscan-inline-alert-error">
19
  <p>
20
  <b>IMPORTANT:</b> This option <em>(if enabled)</em> may slow down your website.
21
  </p>
27
  <form action="%%SUCURI.URL.Settings%%" method="post">
28
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
29
  <input type="hidden" name="sucuriscan_dns_lookups" value="%%SUCURI.DnsLookupsSwitchValue%%" />
30
+ <button type="submit" class="button button-primary">%%SUCURI.DnsLookupsSwitchText%%</button>
 
 
31
  </form>
32
  </div>
33
 
43
 
44
  <form action="%%SUCURI.URL.Settings%%" method="post">
45
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
46
+
47
+ <fieldset class="sucuriscan-clearfix">
48
  <label>Main IP HTTP Header:</label>
49
  <select name="sucuriscan_addr_header">
50
  %%%SUCURI.AddrHeaderOptions%%%
51
  </select>
52
+ <button type="submit" class="button button-primary">Proceed</button>
53
+ </fieldset>
 
 
 
 
 
 
 
 
 
 
54
 
55
+ <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-monospace">
56
+ <div>Sucuri Firewall is %%SUCURI.IsUsingFirewall%%</div>
57
+ <div>Website URL: %%SUCURI.WebsiteURL%%</div>
58
+ <div>Top Level Domain: %%SUCURI.TopLevelDomain%%</div>
59
+ <div>Website Hostname: %%SUCURI.WebsiteHostName%%</div>
60
+ <div>Website Host Address: %%SUCURI.WebsiteHostAddress%%</div>
61
+ <div>IP Address: %%SUCURI.RemoteAddress%% (%%SUCURI.RemoteAddressHeader%%)</div>
62
+ </div>
63
+ </form>
64
  </div>
65
  </div>
inc/tpl/settings-general-pwdcollector.html.tpl DELETED
@@ -1,39 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Failed Login Password Collector</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- <b>Please do not enable this option</b> unless you understand the consequences.
8
- The plugin monitors all the user login attempts, when an user authentication
9
- succeeds it logs the event and sends an alert to the administrator if the option
10
- is enabled. Same thing happens for failed login attempts with two extra features:
11
- you can opt to send a summary of all the failed logins occured during the same
12
- hour and/or force the plugin to collect the password used in every authentication
13
- attempt to see if the attackers are getting close to your real password or not.
14
- </p>
15
-
16
- <div class="sucuriscan-inline-alert-warning">
17
- <p>
18
- You must be careful with this option as it will also log the attempts that you
19
- <em>(as a legitimate user)</em> send, if by mistake you mistype a character in
20
- the password the plugin will log this and it will be sent to the Sucuri servers.
21
- If a malicious user gets access to your API key or your security logs he/she will
22
- know the mistyped password and will use it to improve his attacks against your
23
- website.
24
- </p>
25
- </div>
26
-
27
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
28
- <span>Failed Login Password Collector is %%SUCURI.PwdCollectorStatus%%</span>
29
-
30
- <form action="%%SUCURI.URL.Settings%%" method="post">
31
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
32
- <input type="hidden" name="sucuriscan_collect_wrong_passwords" value="%%SUCURI.PwdCollectorSwitchValue%%" />
33
- <button type="submit" class="button-primary %%SUCURI.PwdCollectorSwitchCssClass%%">
34
- %%SUCURI.PwdCollectorSwitchText%%
35
- </button>
36
- </form>
37
- </div>
38
- </div>
39
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-general-resetoptions.html.tpl CHANGED
@@ -1,26 +1,15 @@
1
 
2
- <div class="postbox">
3
- <h3>Reset Options</h3>
4
 
5
  <div class="inside">
6
  <p>
7
- This action will delete all the entries inserted by the plugin in the options
8
- table of the current database, including the API key. Make sure that you
9
- understand the consequences of this operation before you proceed, this can not
10
- be reverted and you may lose access to the data that was already collected by
11
- the plugin. This will also revert the hardening applied in the WordPress core
12
- directories, but not the hardening applied to other parts of the site as they
13
- can not be easily reverted, refer to the hardening page for more information.
14
- </p>
15
-
16
- <p>
17
- The information stored in the security logs will be deleted as well, but the
18
- information that was previously sent to the API service will remain untouched
19
- as there is no easy way to guarantee that this action is not being requested
20
- by a malicious user looking for a way to hide his fingerprints after an attack.
21
- If you are the real owner of this website and want to delete the information
22
- stored in the Sucuri servers then send an email to our support team and we may
23
- consider the case.
24
  </p>
25
 
26
  <form action="%%SUCURI.URL.Settings%%" method="post">
@@ -32,7 +21,7 @@
32
  <span>I understand that this operation can not be reverted.</span>
33
  </label>
34
  </p>
35
- <button type="submit" name="sucuriscan_reset_options" class="button-primary button-danger">Reset Everything</button>
36
  </form>
37
  </div>
38
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Reset Security Logs, Hardening and Settings</h3>
4
 
5
  <div class="inside">
6
  <p>
7
+ This action will trigger the deactivation / uninstallation process
8
+ of the plugin. All local security logs, hardening and settings will
9
+ be deleted. Notice that the security logs stored in the API service
10
+ will not be deleted, this is to prevent tampering from a malicious
11
+ user. You can request a new API key if you want to start from
12
+ scratch.
 
 
 
 
 
 
 
 
 
 
 
13
  </p>
14
 
15
  <form action="%%SUCURI.URL.Settings%%" method="post">
21
  <span>I understand that this operation can not be reverted.</span>
22
  </label>
23
  </p>
24
+ <button type="submit" name="sucuriscan_reset_options" class="button button-primary">Reset Everything</button>
25
  </form>
26
  </div>
27
  </div>
inc/tpl/settings-general-reverseproxy.html.tpl CHANGED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Reverse Proxy and IP Address</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -13,16 +13,16 @@
13
  </p>
14
 
15
  <p>
16
- Services like <a href="https://sucuri.net/website-firewall/" target="_blank">
17
- CloudProxy</a> once active forces the network traffic to pass through them to
18
- filter any security threat that may affect the original server. A side effect
19
- of this is that the real IP address is no longer available in the global server
20
- variable <em>Remote-Addr</em> but in a custom HTTP header with a name provided
21
- by the service. CloudProxy uses <em>"X-Sucuri-ClientIP"</em>, CloudFlare uses
22
- <em>"CF-Connecting-IP"</em>, others use <em>"X-Forwarded-For"</em>.
23
  </p>
24
 
25
- <div class="sucuriscan-inline-alert-warning">
26
  <p>
27
  When this option is enabled the plugin will go through a list of common HTTP
28
  headers to retrieve the real IP address of the origin of the requests. Note
@@ -38,9 +38,7 @@
38
  <form action="%%SUCURI.URL.Settings%%" method="post">
39
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
40
  <input type="hidden" name="sucuriscan_revproxy" value="%%SUCURI.ReverseProxySwitchValue%%" />
41
- <button type="submit" class="button-primary %%SUCURI.ReverseProxySwitchCssClass%%">
42
- %%SUCURI.ReverseProxySwitchText%%
43
- </button>
44
  </form>
45
  </div>
46
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Reverse Proxy and IP Address</h3>
4
 
5
  <div class="inside">
6
  <p>
13
  </p>
14
 
15
  <p>
16
+ Services like the <a href="https://sucuri.net/website-firewall/"
17
+ target="_blank">Sucuri Firewall</a> &mdash; once active &mdash; forces
18
+ the network traffic to pass through them to filter any security threat
19
+ that may affect the original server. A side effect of this is that the
20
+ real IP address is no longer available in the global server variable
21
+ <em>REMOTE-ADDR</em> but in a custom HTTP header with a name provided
22
+ by the service.
23
  </p>
24
 
25
+ <div class="sucuriscan-inline-alert-info">
26
  <p>
27
  When this option is enabled the plugin will go through a list of common HTTP
28
  headers to retrieve the real IP address of the origin of the requests. Note
38
  <form action="%%SUCURI.URL.Settings%%" method="post">
39
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
40
  <input type="hidden" name="sucuriscan_revproxy" value="%%SUCURI.ReverseProxySwitchValue%%" />
41
+ <button type="submit" class="button button-primary">%%SUCURI.ReverseProxySwitchText%%</button>
 
 
42
  </form>
43
  </div>
44
  </div>
inc/tpl/{settings-selfhosting-monitor.html.tpl → settings-general-selfhosting.html.tpl} RENAMED
@@ -1,6 +1,6 @@
1
 
2
- <div class="postbox">
3
- <h3>Log Exporter</h3>
4
 
5
  <div class="inside">
6
  <p>
@@ -10,17 +10,16 @@
10
  monitoring infrastructure.
11
  </p>
12
 
13
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-%%SUCURI.SelfHostingMonitor.DisabledVisibility%%">
14
- <span>Log Exporter is %%SUCURI.SelfHostingMonitor.Status%%</span>
15
  </div>
16
 
17
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-monitor-fpath sucuriscan-%%SUCURI.SelfHostingMonitor.FpathVisibility%%">
18
- <span class="sucuriscan-monospace">%%SUCURI.SelfHostingMonitor.Fpath%%</span>
19
- <form action="%%SUCURI.URL.Settings%%#selfhosting" method="post">
20
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
21
- <input type="hidden" name="sucuriscan_selfhosting_fpath" class="input-text" />
22
- <button type="submit" class="button-primary %%SUCURI.SelfHostingMonitor.SwitchCssClass%%">
23
- %%SUCURI.SelfHostingMonitor.SwitchText%%</button>
24
  </form>
25
  </div>
26
 
@@ -34,7 +33,7 @@
34
  settings of your website.
35
  </p>
36
 
37
- <div class="sucuriscan-inline-alert-warning">
38
  <p>
39
  Do not use a public location to store the logs, you will end up leaking
40
  sensitive information about your website and the activity of your users. If you
@@ -44,13 +43,13 @@
44
  </p>
45
  </div>
46
 
47
- <form action="%%SUCURI.URL.Settings%%#selfhosting" method="post" class="sucuriscan-%%SUCURI.SelfHostingMonitor.DisabledVisibility%%">
48
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
49
- <span class="sucuriscan-input-group">
50
  <label>Absolute File Path:</label>
51
- <input type="text" name="sucuriscan_selfhosting_fpath" class="input-text" />
52
- </span>
53
- <button type="submit" class="button-primary">Save</button>
54
  </form>
55
  </div>
56
  </div>
1
 
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Log Exporter</h3>
4
 
5
  <div class="inside">
6
  <p>
10
  monitoring infrastructure.
11
  </p>
12
 
13
+ <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-%%SUCURI.SelfHosting.DisabledVisibility%%">
14
+ <span>Log Exporter is %%SUCURI.SelfHosting.Status%%</span>
15
  </div>
16
 
17
+ <div class="sucuriscan-hstatus sucuriscan-hstatus-2 sucuriscan-monitor-fpath sucuriscan-%%SUCURI.SelfHosting.FpathVisibility%%">
18
+ <span class="sucuriscan-monospace">%%SUCURI.SelfHosting.Fpath%%</span>
19
+ <form action="%%SUCURI.URL.Settings%%#general" method="post">
20
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
21
+ <input type="hidden" name="sucuriscan_selfhosting_fpath" />
22
+ <button type="submit" class="button button-primary">%%SUCURI.SelfHosting.SwitchText%%</button>
 
23
  </form>
24
  </div>
25
 
33
  settings of your website.
34
  </p>
35
 
36
+ <div class="sucuriscan-inline-alert-error">
37
  <p>
38
  Do not use a public location to store the logs, you will end up leaking
39
  sensitive information about your website and the activity of your users. If you
43
  </p>
44
  </div>
45
 
46
+ <form action="%%SUCURI.URL.Settings%%#general" method="post">
47
  <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
48
+ <fieldset class="sucuriscan-clearfix">
49
  <label>Absolute File Path:</label>
50
+ <input type="text" name="sucuriscan_selfhosting_fpath" />
51
+ <button type="submit" class="button button-primary">Save</button>
52
+ </fieldset>
53
  </form>
54
  </div>
55
  </div>
inc/tpl/settings-general-xhrmonitor.html.tpl DELETED
@@ -1,45 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>XML HTTP Request Monitor</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- Ajax <em>(also known as XHR)</em> is a set of web development techniques
8
- utilizing many web technologies used on the client-side to create asynchronous
9
- Web applications. With Ajax, web applications can send data to and retrieve from
10
- a server asynchronously <em>(in the background)</em> without interfering with
11
- the display and behavior of the existing page. Data can be retrieved using the
12
- <em>XMLHttpRequest</em> object.
13
- </p>
14
-
15
- <p>
16
- Ajax requests can be vulnerable to CSRF and many other attacks depending on the
17
- way the code is written, many web developers use this technique to offer a non-
18
- blocking interface in their themes and extensions which are later distributed on
19
- the Internet, their code is not audited and people end up installing things in
20
- their websites with security holes which are later exploited by malicious users.
21
- </p>
22
-
23
- <div class="sucuriscan-inline-alert-warning">
24
- <p>
25
- It is possible that the response time of your website gets affected after the
26
- activation of this option, this is due to the way Ajax works and how WordPress
27
- processes the requests. Keep this option disabled if you experience issues
28
- related with the load time of the external pages or the administration
29
- dashboard.
30
- </p>
31
- </div>
32
-
33
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
34
- <span>XML HTTP Request Monitor is %%SUCURI.XhrMonitorStatus%%</span>
35
-
36
- <form action="%%SUCURI.URL.Settings%%" method="post">
37
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
38
- <input type="hidden" name="sucuriscan_xhr_monitor" value="%%SUCURI.XhrMonitorSwitchValue%%" />
39
- <button type="submit" class="button-primary %%SUCURI.XhrMonitorSwitchCssClass%%">
40
- %%SUCURI.XhrMonitorSwitchText%%
41
- </button>
42
- </form>
43
- </div>
44
- </div>
45
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-general.html.tpl DELETED
@@ -1,22 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-general-settings">
3
- %%%SUCURI.SettingsSection.ApiKey%%%
4
-
5
- %%%SUCURI.SettingsSection.DataStorage%%%
6
-
7
- %%%SUCURI.SettingsSection.ReverseProxy%%%
8
-
9
- %%%SUCURI.SettingsSection.IPDiscoverer%%%
10
-
11
- %%%SUCURI.SettingsSection.PasswordCollector%%%
12
-
13
- %%%SUCURI.SettingsSection.CommentMonitor%%%
14
-
15
- %%%SUCURI.SettingsSection.XhrMonitor%%%
16
-
17
- %%%SUCURI.SettingsSection.AuditLogStats%%%
18
-
19
- %%%SUCURI.SettingsSection.Datetime%%%
20
-
21
- %%%SUCURI.SettingsSection.ResetOptions%%%
22
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-hardening-options.snippet.tpl ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-hardening-option sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.Hardening.Status%%">
3
+ <span>%%SUCURI.Hardening.Title%%</span>
4
+
5
+ <form action="%%SUCURI.URL.Settings%%#hardening" method="post">
6
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
7
+
8
+ <span class="sucuriscan-tooltip sucuriscan-hardening-help" content="%%SUCURI.Hardening.Description%%">
9
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="14" height="14">
10
+ <path fill="#000" d="m6.998315,0.033333c-3.846307,0 -6.964982,
11
+ 3.118675 -6.964982,6.964982s3.118675,6.965574 6.964982,6.965574s6.965574,
12
+ -3.119267 6.965574,-6.965574s-3.119267,-6.964982 -6.965574,-6.964982zm1.449957,
13
+ 10.794779c-0.358509,0.141517 -0.643901,0.248833 -0.857945,0.32313c-0.213455,
14
+ 0.074296 -0.461699,0.111444 -0.744143,0.111444c-0.433985,0 -0.771855,
15
+ -0.106137 -1.012434,-0.317823s-0.360279,-0.479978 -0.360279,-0.806055c0,
16
+ -0.126776 0.008845,-0.256499 0.026534,-0.388581c0.018281,-0.132082 0.047174,
17
+ -0.280675 0.086679,-0.447547l0.448727,-1.584988c0.039507,-0.152131 0.073707,
18
+ -0.296596 0.100831,-0.431036c0.027123,-0.135621 0.040097,-0.260037 0.040097,
19
+ -0.37325c0,-0.201661 -0.041865,-0.343178 -0.125008,-0.422782c-0.08432,
20
+ -0.079603 -0.242937,-0.11852 -0.479388,-0.11852c-0.115572,0 -0.234682,
21
+ 0.0171 -0.35674,0.05307c-0.120879,0.037148 -0.225837,0.070758 -0.311926,
22
+ 0.103779l0.118521,-0.488235c0.293647,-0.119699 0.574911,-0.222299 0.843204,
23
+ -0.307209c0.268291,-0.086089 0.521842,-0.128543 0.760652,-0.128543c0.431036,
24
+ 0 0.7636,0.104959 0.997693,0.312517c0.232913,0.208147 0.350253,0.478797 0.350253,
25
+ 0.811363c0,0.068989 -0.008255,0.190458 -0.024174,0.363815c-0.015921,
26
+ 0.173947 -0.045994,0.332565 -0.089628,0.478209l-0.446368,1.580269c-0.036558,
27
+ 0.126776 -0.068988,0.271831 -0.098472,0.433985c-0.028893,0.162156 -0.043043,
28
+ 0.285983 -0.043043,0.369123c0,0.209916 0.046582,0.353202 0.140926,
29
+ 0.429268c0.093164,0.076064 0.256498,0.114392 0.487643,0.114392c0.109086,
30
+ 0 0.231144,-0.019459 0.369124,-0.057197c0.136799,-0.037737 0.23586,
31
+ -0.071349 0.298364,-0.100241l-0.119699,0.487643zm-0.079014,-6.414247c-0.208148,
32
+ 0.193407 -0.45875,0.290109 -0.751808,0.290109c-0.292469,0 -0.54484,
33
+ -0.096702 -0.754756,-0.290109c-0.208737,-0.193406 -0.314285,-0.428678 -0.314285,
34
+ -0.703457c0,-0.274188 0.106138,-0.51005 0.314285,-0.705225c0.208148,
35
+ -0.195175 0.462287,-0.293058 0.754756,-0.293058c0.293058,0 0.54425,
36
+ 0.097293 0.751808,0.293058c0.208146,0.195175 0.312516,0.431036 0.312516,
37
+ 0.705225c0,0.275368 -0.10437,0.510051 -0.312516,0.703457z">
38
+ </path>
39
+ </svg>
40
+ </span>
41
+
42
+ <input type="submit" name="%%SUCURI.Hardening.FieldName%%" value="%%SUCURI.Hardening.FieldText%%" %%SUCURI.Hardening.FieldAttrs%% class="button button-primary" />
43
+ </form>
44
+ </div>
inc/tpl/settings-hardening-whitelist-phpfiles.html.tpl ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Whitelist Blocked PHP Files</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ After you apply the hardening in either the includes, content, and/or upload
8
+ directories the plugin will add a rule in the access control file to deny access
9
+ to any PHP file located in these folders, this is a good precaution in case that
10
+ an attacker is able to upload a shell script; with a few exceptions the
11
+ <em>"index.php"</em> is the only one that should be publicly accessible, however
12
+ many theme/plugin developers decide to use these folders to process some
13
+ operations, in this case applying the hardening <strong>may break</strong> their
14
+ functionality.
15
+ </p>
16
+
17
+ <div class="sucuriscan-inline-alert-info">
18
+ <p>
19
+ Note that whitelisted files are global inside the selected directory, this means
20
+ that if you whitelist a file named <em>"thumbnail.php"</em> it will match every
21
+ file with the same name in all the sub-folders. If you want something more
22
+ specific read the <a href="https://httpd.apache.org/docs/2.4/mod/core.html"
23
+ target="_blank" rel="noopener">official documentation</a>.
24
+ </p>
25
+ </div>
26
+
27
+ <div class="sucuriscan-inline-alert-error">
28
+ <p>
29
+ Be warned that whitelisting a PHP file with vulnerabilities will open security
30
+ holes in your website that can be exploited by malicious users. If you do not
31
+ fully understand the purpose of this form and/or do not know what whitelisting
32
+ a PHP file means then ask for support in the <a target="_blank"
33
+ href="https://wordpress.org/support/plugin/sucuri-scanner" rel="noopener">forums</a>.
34
+ </p>
35
+ </div>
36
+
37
+ <form action="%%SUCURI.URL.Settings%%#hardening" method="post">
38
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
39
+ <fieldset class="sucuriscan-clearfix">
40
+ <label>Whitelist PHP Filename:</label>
41
+ <input type="text" name="sucuriscan_hardening_whitelist" placeholder="e.g. wp-tinymce.php" />
42
+ <select name="sucuriscan_hardening_folder">
43
+ <option value="wp-includes">wp-includes</option>
44
+ <option value="wp-content">wp-content</option>
45
+ <option value="wp-content/uploads">wp-content/uploads</option>
46
+ </select>
47
+ <button type="submit" class="button button-primary">Proceed</button>
48
+ </fieldset>
49
+ </form>
50
+
51
+ <hr>
52
+
53
+ <form action="%%SUCURI.URL.Settings%%#hardening" method="post">
54
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
55
+
56
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-hardening-whitelist-table">
57
+ <thead>
58
+ <td id="cb" class="manage-column column-cb check-column">
59
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
60
+ <input id="cb-select-all-1" type="checkbox">
61
+ </td>
62
+ <th class="manage-column">Filename</th>
63
+ <th class="manage-column">Base Directory</th>
64
+ <th class="manage-column">Regular Expression</th>
65
+ </thead>
66
+
67
+ <tbody>
68
+ %%%SUCURI.HardeningWhitelist.List%%%
69
+
70
+ <tr class="sucuriscan-%%SUCURI.HardeningWhitelist.NoItemsVisibility%%">
71
+ <td colspan="4">
72
+ <em>List is empty.</em>
73
+ </td>
74
+ </tr>
75
+ </tbody>
76
+ </table>
77
+
78
+ <button type="submit" class="button button-primary">Delete</button>
79
+ </form>
80
+ </div>
81
+ </div>
inc/tpl/{hardening-whitelist.snippet.tpl → settings-hardening-whitelist-phpfiles.snippet.tpl} RENAMED
@@ -1,9 +1,12 @@
1
 
2
- <tr class="%%SUCURI.HardeningWhitelist.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_hardening_rmfwhite[]" value="%%SUCURI.HardeningWhitelist.Regexp%%" />
5
- </td>
 
6
  <td>%%SUCURI.HardeningWhitelist.File%%</td>
 
7
  <td>%%SUCURI.HardeningWhitelist.Folder%%</td>
 
8
  <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.HardeningWhitelist.Regexp%%</span></td>
9
  </tr>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_hardening_rmfwhite[]" value="%%SUCURI.HardeningWhitelist.Regexp%%" />
5
+ </th>
6
+
7
  <td>%%SUCURI.HardeningWhitelist.File%%</td>
8
+
9
  <td>%%SUCURI.HardeningWhitelist.Folder%%</td>
10
+
11
  <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.HardeningWhitelist.Regexp%%</span></td>
12
  </tr>
inc/tpl/settings-heartbeat.html.tpl DELETED
@@ -1,84 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Heartbeat</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- The purpose of the <a href="https://core.trac.wordpress.org/ticket/23216"
9
- target="_blank">Heartbeat API</a> is to simulate bidirectional connection
10
- between the browser and the server. Initially it was used for autosave, post
11
- locking and log-in expiration warning while a user is writing or editing. The
12
- idea was to have an API that sends XHR <em>(XML HTTP Request)</em> requests to
13
- the server every fifteen seconds and triggers events <em>(or callbacks)</em> on
14
- receiving data.
15
- </p>
16
- </div>
17
- </div>
18
- </div>
19
-
20
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings sucuriscan-settings-heartbeat">
21
- <thead>
22
- <tr>
23
- <th>Option</th>
24
- <th>Value</th>
25
- <th>&nbsp;</th>
26
- </tr>
27
- </thead>
28
-
29
- <tbody>
30
- <tr>
31
- <td>Heartbeat status</td>
32
- <td>%%SUCURI.HeartbeatStatus%%</td>
33
- <td class="td-with-button">
34
- <form action="%%SUCURI.URL.Settings%%#heartbeat" method="post">
35
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
36
- <select name="sucuriscan_heartbeat_status">
37
- %%%SUCURI.HeartbeatStatusOptions%%%
38
- </select>
39
- <button type="submit" class="button-primary">Change</button>
40
- </form>
41
- </td>
42
- </tr>
43
-
44
- <tr class="alternate">
45
- <td>Pulse interval</td>
46
- <td>%%SUCURI.HeartbeatPulse%%</td>
47
- <td class="td-with-button">
48
- <form action="%%SUCURI.URL.Settings%%#heartbeat" method="post">
49
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
50
- <select name="sucuriscan_heartbeat_pulse">
51
- %%%SUCURI.HeartbeatPulseOptions%%%
52
- </select>
53
- <button type="submit" class="button-primary">Change</button>
54
- </form>
55
- </td>
56
- </tr>
57
-
58
- <tr>
59
- <td>Interval speed</td>
60
- <td>%%SUCURI.HeartbeatInterval%%</td>
61
- <td class="td-with-button">
62
- <form action="%%SUCURI.URL.Settings%%#heartbeat" method="post">
63
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
64
- <select name="sucuriscan_heartbeat_interval">
65
- %%%SUCURI.HeartbeatIntervalOptions%%%
66
- </select>
67
- <button type="submit" class="button-primary">Change</button>
68
- </form>
69
- </td>
70
- </tr>
71
-
72
- <tr class="alternate">
73
- <td>Auto-start</td>
74
- <td>%%SUCURI.HeartbeatAutostart%%</td>
75
- <td class="td-with-button">
76
- <form action="%%SUCURI.URL.Settings%%#heartbeat" method="post">
77
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
78
- <input type="hidden" name="sucuriscan_heartbeat_autostart" value="%%SUCURI.HeartbeatAutostartSwitchValue%%" />
79
- <button type="submit" class="button-primary %%SUCURI.HeartbeatAutostartSwitchCssClass%%">%%SUCURI.HeartbeatAutostartSwitchText%%</button>
80
- </form>
81
- </td>
82
- </tr>
83
- </tbody>
84
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-ignorerules.html.tpl DELETED
@@ -1,49 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-border-bad sucuriscan-%%SUCURI.IgnoreRules.MessageVisibility%%">
4
- <h3>Ignore Alerts</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- It seems that you disabled the email notifications for <strong>new site
9
- content</strong>, this panel is intended to provide a way to ignore specific
10
- events in your site and with that the alerts reported to your email. Since you
11
- have deactivated the <strong>new site content</strong> alerts, this panel will
12
- be disabled too.
13
- </p>
14
- </div>
15
- </div>
16
- </div>
17
-
18
- <div class="sucuriscan-panelstuff">
19
- <div class="postbox sucuriscan-border sucuriscan-table-description sucuriscan-%%SUCURI.IgnoreRules.TableVisibility%%">
20
- <h3>Ignore Alerts</h3>
21
-
22
- <div class="inside">
23
- <p>
24
- This is a list of registered <a href="https://codex.wordpress.org/Post_Types"
25
- target="_blank">Post Types</a>, since you have enabled the <strong>email alerts
26
- for new or modified content</strong>, we will send you an alert if any of these
27
- <code>post-types</code> are created and/or updated. You may want to ignore some
28
- of them as some 3rd-party extensions create temporary data in the posts table
29
- to track changes in their own tools.
30
- </p>
31
- </div>
32
- </div>
33
- </div>
34
-
35
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings-ignorerules sucuriscan-%%SUCURI.IgnoreRules.TableVisibility%%">
36
- <thead>
37
- <tr>
38
- <th>&nbsp;</th>
39
- <th>Post Type</th>
40
- <th width="50">Ignored</th>
41
- <th>Ignored At</th>
42
- <th>&nbsp;</th>
43
- </tr>
44
- </thead>
45
-
46
- <tbody>
47
- %%%SUCURI.IgnoreRules.PostTypes%%%
48
- </tbody>
49
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-ignorescan-files.html.tpl DELETED
@@ -1,20 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Ignore Scanning for Files</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- By default the file system scanner ignore the directories listed here. You can
8
- use this panel to insert individual files or symbolic links in the list using
9
- their absolute path. By aware that the form only accepts valid file paths,
10
- wildcards are not allowed to prevent the misuse of this tool.
11
- </p>
12
-
13
- <form action="%%SUCURI.URL.Settings%%#ignorescanning" method="post">
14
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
15
- <input type="hidden" name="sucuriscan_ignorescanning_action" value="ignore" />
16
- <input type="text" name="sucuriscan_ignorescanning_file" placeholder="e.g. /private/cert.crt" />
17
- <button type="submit" class="button button-primary">Proceed</button>
18
- </form>
19
- </div>
20
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-ignorescan-folders.html.tpl DELETED
@@ -1,59 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Ignore Scanning for Folders</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- Selecting one or more directories from the list will force the plugin to ignore
8
- the monitoring of the sub-folders and files inside these directories during the
9
- execution of any of the file system scanners. This will applies to all the scanners
10
- <em>(general scanner, modified files, integrity checks, error logs)</em>.
11
- </p>
12
-
13
- <script type="text/javascript">
14
- jQuery(function($){
15
- $('.sucuriscan-ignorescanning tbody').html(
16
- '<tr><td colspan="3"><span>Loading <em>(may take '
17
- + 'several seconds)</em>...</span></td></tr>'
18
- );
19
- $.post('%%SUCURI.AjaxURL.Settings%%', {
20
- action: 'sucuriscan_settings_ajax',
21
- sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
22
- form_action: 'get_ignored_files',
23
- }, function(data){
24
- $('.sucuriscan-ignorescanning tbody').html(data);
25
- });
26
- });
27
- </script>
28
-
29
- <form action="%%SUCURI.URL.Settings%%#ignorescanning" method="post">
30
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
31
-
32
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-ignorescanning">
33
- <thead>
34
- <th class="manage-column column-cb check-column">
35
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
36
- <input id="cb-select-all-1" type="checkbox">
37
- </th>
38
- <th class="manage-column">Directory or File Path</th>
39
- <th class="manage-column">Status</th>
40
- </thead>
41
-
42
- <tbody>
43
- </tbody>
44
- </table>
45
-
46
- <div class="sucuriscan-recipient-form">
47
- <label>
48
- <select name="sucuriscan_ignorescanning_action">
49
- <option value="">Choose action</option>
50
- <option value="ignore">Ignore items</option>
51
- <option value="unignore">Un-ignore items</option>
52
- </select>
53
- </label>
54
-
55
- <button type="submit" class="button button-primary">Proceed</button>
56
- </div>
57
- </form>
58
- </div>
59
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-ignorescan-status.html.tpl DELETED
@@ -1,25 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Ignore Scanning</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- If your project has too many directories and/or files it may cause the file
8
- system scanners to fail, you may want to increase the maximum execution time of
9
- the PHP scripts and the memory limit to allow the functions executed during the
10
- file system scans to finish successfully. If you do not want or do not have
11
- sufficient privileges to increase these values then you may want to skip some
12
- directories, this will force the plugin to ignore the files inside these
13
- folders.
14
- </p>
15
-
16
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
17
- <span>Ignore Scanning is %%SUCURI.IgnoreScan.Status%%</span>
18
- <form action="%%SUCURI.URL.Settings%%#ignorescanning" method="post">
19
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
20
- <input type="hidden" name="sucuriscan_ignore_scanning" value="%%SUCURI.IgnoreScan.SwitchValue%%" />
21
- <button type="submit" class="button-primary %%SUCURI.IgnoreScan.SwitchCssClass%%">%%SUCURI.IgnoreScan.SwitchText%%</button>
22
- </form>
23
- </div>
24
- </div>
25
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-ignorescan.html.tpl DELETED
@@ -1,8 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff sucuriscan-general-scanner">
3
- %%%SUCURI.SettingsSection.IgnoreScanStatus%%%
4
-
5
- %%%SUCURI.SettingsSection.IgnoreScanFiles%%%
6
-
7
- %%%SUCURI.SettingsSection.IgnoreScanFolders%%%
8
- </div>
 
 
 
 
 
 
 
 
inc/tpl/{posthack-updates-notification.html.tpl → settings-posthack-available-updates-alert.html.tpl} RENAMED
@@ -26,9 +26,10 @@
26
  <tr>
27
  <td colspan="5">
28
  <p>
29
- Update all extensions from your website's <a href="%%SUCURI.URL.Home%%">
30
- admin panel</a>, and/or disable the email notifications for available
31
- updates from the <a href="%%SUCURI.URL.Settings%%">settings</a> page.
 
32
  </p>
33
  </td>
34
  </tr>
26
  <tr>
27
  <td colspan="5">
28
  <p>
29
+ Update all extensions from your website's <a target="_blank"
30
+ href="%%SUCURI.URL.Dashboard%%">admin panel</a>, and/or disable
31
+ the email alerts for available updates from the <a target="_blank"
32
+ href="%%SUCURI.URL.Settings%%#alerts">settings</a> page.
33
  </p>
34
  </td>
35
  </tr>
inc/tpl/settings-posthack-available-updates.html.tpl ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Available Plugin and Theme Updates</h3>
4
+
5
+ <script type="text/javascript">
6
+ /* global jQuery */
7
+ /* jshint camelcase: false */
8
+ jQuery(function ($) {
9
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
10
+ action: 'sucuriscan_ajax',
11
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
12
+ form_action: 'get_available_updates',
13
+ }, function (data) {
14
+ $('.sucuriscan-available-updates-table tbody').html(data);
15
+ });
16
+ });
17
+ </script>
18
+
19
+ <div class="inside">
20
+ <p>
21
+ WordPress has a big user base in the public Internet, this brings
22
+ interest to malicious people to find vulnerabilities in the code,
23
+ 3rd-party extensions, and themes that other companies develop. You
24
+ should keep every piece of code installed in your website update
25
+ to prevent attacks as soon as disclosed vulnerabilities are patched.
26
+ </p>
27
+
28
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-available-updates-table">
29
+ <thead>
30
+ <tr>
31
+ <th class="manage-column">Extension</th>
32
+ <th class="manage-column">Installed</th>
33
+ <th class="manage-column">Available</th>
34
+ <th class="manage-column">Tested With</th>
35
+ <th class="manage-column">&nbsp;</th>
36
+ </tr>
37
+ </thead>
38
+
39
+ <tbody>
40
+ <tr>
41
+ <td colspan="5">
42
+ <span>Loading <em>(may take several seconds)</em>...</span>
43
+ </td>
44
+ </tr>
45
+ </tbody>
46
+ </table>
47
+ </div>
48
+ </div>
inc/tpl/{posthack-updates.snippet.tpl → settings-posthack-available-updates.snippet.tpl} RENAMED
@@ -1,12 +1,16 @@
1
 
2
- <tr class="%%SUCURI.Update.CssClass%%">
3
  <td>
4
  <span class="dashicons-before dashicons-admin-%%SUCURI.Update.IconType%%">
5
  <a href="%%SUCURI.Update.MarketUrl%%" target="_blank">%%SUCURI.Update.Extension%%</a>
6
  </span>
7
  </td>
 
8
  <td><span class="sucuriscan-monospace">%%SUCURI.Update.Version%%</span></td>
 
9
  <td><span class="sucuriscan-monospace">%%SUCURI.Update.NewVersion%%</span></td>
 
10
  <td>%%SUCURI.Update.TestedWith%%</td>
 
11
  <td><a href="%%SUCURI.Update.ArchiveUrl%%" target="_blank">download</a></td>
12
  </tr>
1
 
2
+ <tr>
3
  <td>
4
  <span class="dashicons-before dashicons-admin-%%SUCURI.Update.IconType%%">
5
  <a href="%%SUCURI.Update.MarketUrl%%" target="_blank">%%SUCURI.Update.Extension%%</a>
6
  </span>
7
  </td>
8
+
9
  <td><span class="sucuriscan-monospace">%%SUCURI.Update.Version%%</span></td>
10
+
11
  <td><span class="sucuriscan-monospace">%%SUCURI.Update.NewVersion%%</span></td>
12
+
13
  <td>%%SUCURI.Update.TestedWith%%</td>
14
+
15
  <td><a href="%%SUCURI.Update.ArchiveUrl%%" target="_blank">download</a></td>
16
  </tr>
inc/tpl/settings-posthack-reset-password-alert.html.tpl ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+
2
+ WordPress has generated a new (random) password for your account <strong>%%SUCURI.ResetPassword.UserName%%</strong> at <a target="_blank" href="http://%%SUCURI.ResetPassword.Website%%">%%SUCURI.ResetPassword.Website%%</a>.<br>
3
+
4
+ The change has been requested by one of the admins in this website for security reasons.<br>
5
+
6
+ Your new password is &mdash; <span style="font-family:Menlo, Monaco, monospace, serif;font-weight:700">%%%SUCURI.ResetPassword.Password%%%</span> &mdash; please change it as soon as possible.<br>
inc/tpl/settings-posthack-reset-password.html.tpl ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Reset User Password</h3>
4
+
5
+ <script type="text/javascript">
6
+ /* global jQuery */
7
+ /* jshint camelcase: false */
8
+ jQuery(function ($) {
9
+ $('#sucuriscan-reset-password-button').on('click', function (event) {
10
+ event.preventDefault();
11
+ $('.sucuriscan-reset-password-table :checkbox:checked').each(function (key, el) {
12
+ var user_id = $(el).val();
13
+
14
+ $('#sucuriscan-userid-' + user_id)
15
+ .find('.sucuriscan-response')
16
+ .html('(Loading...)');
17
+
18
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
19
+ action: 'sucuriscan_ajax',
20
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
21
+ form_action: 'reset_user_password',
22
+ user_id: user_id,
23
+ }, function (data) {
24
+ $('#sucuriscan-userid-' + user_id)
25
+ .find('.sucuriscan-response')
26
+ .html('(' + data + ')');
27
+ });
28
+ });
29
+ });
30
+ });
31
+ </script>
32
+
33
+ <div class="inside">
34
+ <p>
35
+ You can generate a new random password for the user accounts that
36
+ you select from the list. An email with the new password will be
37
+ sent to the email address of each chosen users.
38
+ </p>
39
+
40
+ <div class="sucuriscan-inline-alert-error">
41
+ <p>
42
+ If you choose to change the password of your own user, then your
43
+ current session will expire immediately. You will need to log
44
+ into the admin panel with the new password that will be sent to
45
+ your email. If you are unsure of this, do not select your
46
+ account from the list.
47
+ </p>
48
+ </div>
49
+
50
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-reset-password-table">
51
+ <thead>
52
+ <tr>
53
+ <td id="cb" class="manage-column column-cb check-column">
54
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
55
+ <input id="cb-select-all-1" type="checkbox">
56
+ </td>
57
+ <th class="manage-column">User</th>
58
+ <th class="manage-column">Email address</th>
59
+ <th class="manage-column">Registered</th>
60
+ <th class="manage-column">Roles</th>
61
+ </tr>
62
+ </thead>
63
+
64
+ <tbody>
65
+ %%%SUCURI.ResetPassword.UserList%%%
66
+
67
+ <tr class="sucuriscan-%%SUCURI.ResetPassword.PaginationVisibility%%">
68
+ <td colspan="4">
69
+ <ul class="sucuriscan-pagination">
70
+ %%%SUCURI.ResetPassword.PaginationLinks%%%
71
+ </ul>
72
+ </td>
73
+ </tr>
74
+ </tbody>
75
+ </table>
76
+
77
+ <button type="button" id="sucuriscan-reset-password-button"
78
+ class="button button-primary">Reset User Password</button>
79
+ </div>
80
+ </div>
inc/tpl/settings-posthack-reset-password.snippet.tpl ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <tr id="sucuriscan-userid-%%SUCURI.ResetPassword.UserID%%">
3
+ <th class="check-column">
4
+ <input type="checkbox" name="user_ids[]" value="%%SUCURI.ResetPassword.UserID%%" %%SUCURI.ResetPassword.Disabled%% />
5
+ </th>
6
+
7
+ <td>
8
+ <span class="sucuriscan-monospace">%%SUCURI.ResetPassword.Username%%</span>
9
+ <em class="sucuriscan-response"></em>
10
+ </td>
11
+
12
+ <td><a href="mailto:%%SUCURI.ResetPassword.Email%%">%%SUCURI.ResetPassword.Email%%</a></td>
13
+
14
+ <td>%%SUCURI.ResetPassword.Registered%%</td>
15
+
16
+ <td>%%SUCURI.ResetPassword.Roles%%</td>
17
+ </tr>
inc/tpl/settings-posthack-reset-plugins.html.tpl ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Reset Installed Plugins</h3>
4
+
5
+ <script type="text/javascript">
6
+ /* global jQuery */
7
+ /* jshint camelcase:false */
8
+ jQuery(function ($) {
9
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
10
+ action: 'sucuriscan_ajax',
11
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
12
+ form_action: 'get_plugins_data',
13
+ }, function (data) {
14
+ $('.sucuriscan-reset-plugins-table tbody').html( data );
15
+ });
16
+
17
+ $('#sucuriscan_reset_plugins').on('click', function (event) {
18
+ event.preventDefault();
19
+ $('.sucuriscan-reset-plugins-table .check-column :checkbox:checked').each(function (key, el) {
20
+ var pluginName = $(el).val();
21
+ var unique = $(el).attr('data-unique');
22
+
23
+ $('#sucuriscan-plugin-' + unique)
24
+ .find('.sucuriscan-reset-plugin-response')
25
+ .html('Loading...');
26
+
27
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
28
+ action: 'sucuriscan_ajax',
29
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
30
+ sucuriscan_plugin_name: pluginName,
31
+ form_action: 'reset_plugin',
32
+ }, function (data) {
33
+ $('#sucuriscan-plugin-' + unique)
34
+ .find('.sucuriscan-reset-plugin-response')
35
+ .html(data);
36
+ });
37
+ });
38
+ });
39
+ });
40
+ </script>
41
+
42
+ <div class="inside">
43
+ <p>
44
+ In case that you suspect of an infection in your site, or even after
45
+ you got rid of a malicious code, it would be better if you reinstall
46
+ all the plugins installed in your site, including the ones you are
47
+ not using. Notice that premium plugins will not be reinstalled to
48
+ prevent backward compatibility issues and problems with licenses.
49
+ </p>
50
+
51
+ <div class="sucuriscan-inline-alert-info">
52
+ <p>
53
+ The information shown here is cache for
54
+ %%SUCURI.ResetPlugin.CacheLifeTime%% seconds, this is necessary
55
+ to reduce the quantity of HTTP requests sent to the WordPress
56
+ servers and the bandwidth of your site. Currently there is no
57
+ option to recreate this cache so you have to wait until it
58
+ resets itself.
59
+ </p>
60
+ </div>
61
+
62
+ <div class="sucuriscan-inline-alert-error">
63
+ <p>
64
+ <b>WARNING!</b> This procedure can break your website. The reset
65
+ will not affect the database nor the settings of each plugin but
66
+ depending on how they were written the reset action might break
67
+ them. Be sure to create a backup of the plugins directory before
68
+ the execution of this tool.
69
+ </p>
70
+ </div>
71
+
72
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-reset-plugins-table">
73
+ <thead>
74
+ <tr>
75
+ <td id="cb" class="manage-column column-cb check-column">
76
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
77
+ <input id="cb-select-all-1" type="checkbox">
78
+ </td>
79
+ <th class="manage-column">Plugin</th>
80
+ <th class="manage-column">Version</th>
81
+ <th class="manage-column">Type</th>
82
+ <th class="manage-column">Status</th>
83
+ </tr>
84
+ </thead>
85
+
86
+ <tbody>
87
+ <tr>
88
+ <td colspan="5">
89
+ <span>Loading <em>(may take several seconds)</em>...</span>
90
+ </td>
91
+ </tr>
92
+ </tbody>
93
+ </table>
94
+
95
+ <button type="button" id="sucuriscan_reset_plugins" class="button button-primary">Proceed</button>
96
+ </div>
97
+ </div>
inc/tpl/settings-posthack-reset-plugins.snippet.tpl ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <tr id="sucuriscan-plugin-%%SUCURI.ResetPlugin.Unique%%">
3
+ <th class="check-column">
4
+ <input type="checkbox" name="plugin_path[]" value="%%SUCURI.ResetPlugin.Path%%" data-unique="%%SUCURI.ResetPlugin.Unique%%" %%SUCURI.ResetPlugin.Disabled%% />
5
+ </th>
6
+
7
+ <td>
8
+ <a href="%%SUCURI.ResetPlugin.Repository%%" target="_blank">%%SUCURI.ResetPlugin.Plugin%%</a>
9
+ </td>
10
+
11
+ <td class="sucuriscan-reset-plugin-response">
12
+ <span class="sucuriscan-monospace">%%SUCURI.ResetPlugin.Version%%</span>
13
+ </td>
14
+
15
+ <td>
16
+ <span class="sucuriscan-label-%%SUCURI.ResetPlugin.TypeClass%%">%%SUCURI.ResetPlugin.Type%%</span>
17
+ </td>
18
+
19
+ <td>
20
+ <span class="sucuriscan-label-%%SUCURI.ResetPlugin.StatusClass%%">%%SUCURI.ResetPlugin.Status%%</span>
21
+ </td>
22
+ </tr>
inc/tpl/settings-posthack-security-keys.html.tpl ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Update Security Keys</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ The secret or security keys are a list of constants added to your site to ensure
8
+ better encryption of information stored in the user's cookies. A secret key
9
+ makes your site harder to hack and access by adding random elements to the
10
+ password. You do not have to remember the keys, just write a random,
11
+ complicated, and long string in the <code>wp-config.php</code> file. You can
12
+ change these keys at any point in time to invalidate all existing cookies,
13
+ forcing all users to login again.
14
+ </p>
15
+
16
+ <div class="sucuriscan-inline-alert-error">
17
+ <p>Your session will expire immediately after the security keys are changed.</p>
18
+ </div>
19
+
20
+ <div class="sucuriscan_wpconfig_keys_updated sucuriscan-monospace sucuriscan-%%SUCURI.WPConfigUpdate.Visibility%%">
21
+ <textarea class="sucuriscan-full-textarea" style="height:405px">%%SUCURI.WPConfigUpdate.NewConfig%%</textarea>
22
+ </div>
23
+
24
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-security-keys-table">
25
+ <thead>
26
+ <tr>
27
+ <th>Status</th>
28
+ <th>Constant</th>
29
+ <th>Value</th>
30
+ </tr>
31
+ </thead>
32
+
33
+ <tbody>
34
+ %%%SUCURI.SecurityKeys.List%%%
35
+ </tbody>
36
+ </table>
37
+
38
+ <form action="%%SUCURI.URL.Settings%%#posthack" method="post">
39
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
40
+ <input type="hidden" name="sucuriscan_update_wpconfig" value="1" />
41
+
42
+ <p>
43
+ <label>
44
+ <input type="hidden" name="sucuriscan_process_form" value="0" />
45
+ <input type="checkbox" name="sucuriscan_process_form" value="1" />
46
+ <span>I understand that this operation can not be reverted.</span>
47
+ </label>
48
+ </p>
49
+
50
+ <input type="submit" value="Generate New Security Keys" class="button button-primary" />
51
+ </form>
52
+ </div>
53
+ </div>
inc/tpl/{posthack-updatesecretkeys.snippet.tpl → settings-posthack-security-keys.snippet.tpl} RENAMED
@@ -1,6 +1,8 @@
1
 
2
- <tr class="%%SUCURI.SecurityKey.CssClass%%">
 
 
3
  <td><span class="sucuriscan-monospace">%%SUCURI.SecurityKey.KeyName%%</span></td>
 
4
  <td><span class="sucuriscan-monospace">%%SUCURI.SecurityKey.KeyValue%%</span></td>
5
- <td><span class="sucuriscan-label-%%SUCURI.SecurityKey.KeyStatusCssClass%%">%%SUCURI.SecurityKey.KeyStatusText%%</span></td>
6
  </tr>
1
 
2
+ <tr>
3
+ <td>%%SUCURI.SecurityKey.KeyStatusText%%</td>
4
+
5
  <td><span class="sucuriscan-monospace">%%SUCURI.SecurityKey.KeyName%%</span></td>
6
+
7
  <td><span class="sucuriscan-monospace">%%SUCURI.SecurityKey.KeyValue%%</span></td>
 
8
  </tr>
inc/tpl/settings-scanner-ignore-folders.html.tpl ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Ignore Files And Folders During The Scans</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ Use this tool to select the files and/or folders that are too heavy
8
+ for the scanner to process. These are usually folders with images,
9
+ media files like videos and audios, backups and &mdash; in general
10
+ &mdash; anything that is not code-related. Ignoring these files or
11
+ folders will reduce the memory consumption of the PHP script.
12
+ </p>
13
+
14
+ <script type="text/javascript">
15
+ /* global jQuery */
16
+ /* jshint camelcase: false */
17
+ jQuery(function ($) {
18
+ $('.sucuriscan-ignorescanning tbody').html(
19
+ '<tr><td colspan="3"><span>Loading <em>(may take' +
20
+ ' several seconds)</em>...</span></td></tr>'
21
+ );
22
+ $.post('%%SUCURI.AjaxURL.Dashboard%%', {
23
+ action: 'sucuriscan_ajax',
24
+ sucuriscan_page_nonce: '%%SUCURI.PageNonce%%',
25
+ form_action: 'get_ignored_files',
26
+ }, function (data) {
27
+ $('.sucuriscan-ignorescanning tbody').html(data);
28
+ });
29
+ });
30
+ </script>
31
+
32
+ <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
33
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
34
+ <input type="hidden" name="sucuriscan_ignorescanning_action" value="ignore" />
35
+
36
+ <fieldset class="sucuriscan-clearfix">
37
+ <label>Ignore One Single File:</label>
38
+ <input type="text" name="sucuriscan_ignorescanning_file" placeholder="e.g. /private/cert.crt" />
39
+ <button type="submit" class="button button-primary">Proceed</button>
40
+ </fieldset>
41
+ </form>
42
+
43
+ <hr>
44
+
45
+ <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
46
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
47
+
48
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-ignorescanning">
49
+ <thead>
50
+ <td id="cb" class="manage-column column-cb check-column">
51
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
52
+ <input id="cb-select-all-1" type="checkbox">
53
+ </td>
54
+ <th class="manage-column">Directory or File Path</th>
55
+ <th class="manage-column">Status</th>
56
+ </thead>
57
+
58
+ <tbody>
59
+ </tbody>
60
+ </table>
61
+
62
+ <div class="sucuriscan-recipient-form">
63
+ <label>
64
+ <select name="sucuriscan_ignorescanning_action">
65
+ <option value="">Choose Action</option>
66
+ <option value="ignore">Ignore Selected Files And Folders</option>
67
+ <option value="unignore">Scan Selected Files And Folders</option>
68
+ </select>
69
+ </label>
70
+
71
+ <button type="submit" class="button button-primary">Proceed</button>
72
+ </div>
73
+ </form>
74
+ </div>
75
+ </div>
inc/tpl/{settings-ignorescan.snippet.tpl → settings-scanner-ignore-folders.snippet.tpl} RENAMED
@@ -1,8 +1,10 @@
1
 
2
- <tr class="%%SUCURI.IgnoreScan.CssClass%%">
3
- <td class="check-column">
4
  <input type="checkbox" name="sucuriscan_ignorescanning_dirs[]" value="%%SUCURI.IgnoreScan.DirectoryPath%%" />
5
- </td>
 
6
  <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.IgnoreScan.DirectoryPath%%</span></td>
7
- <td><span class="sucuriscan-label-%%SUCURI.IgnoreScan.IgnoredCssClass%%">%%SUCURI.IgnoreScan.IgnoredAtText%%</span></td>
 
8
  </tr>
1
 
2
+ <tr>
3
+ <th class="check-column">
4
  <input type="checkbox" name="sucuriscan_ignorescanning_dirs[]" value="%%SUCURI.IgnoreScan.DirectoryPath%%" />
5
+ </th>
6
+
7
  <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.IgnoreScan.DirectoryPath%%</span></td>
8
+
9
+ <td>%%SUCURI.IgnoreScan.IgnoredAtText%%</td>
10
  </tr>
inc/tpl/settings-scanner-integrity-cache.html.tpl ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">WordPress Integrity (False/Positives)</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ Since the scanner doesn't reads the files during the execution of the
8
+ integrity check, it is possible to find false/positives. The scanner
9
+ compares a hash generated from the file content but not the content
10
+ in itself. If you include, for example, a new empty line in any of
11
+ the core WordPress files the scanner will flag that file even if the
12
+ modification is harmless. If a file is marked as <em>"added"</em> and
13
+ after a manual check of its content you verify that the file is legit,
14
+ you can mark it as fixed and the scanner will skip that file the next
15
+ time it runs.
16
+ </p>
17
+
18
+ <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
19
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
20
+ <input type="hidden" name="sucuriscan_reset_integrity_cache" value="1" />
21
+
22
+ <table class="wp-list-table widefat sucuriscan-table">
23
+ <thead>
24
+ <tr>
25
+ <td id="cb" class="manage-column column-cb check-column">
26
+ <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
27
+ <input id="cb-select-all-1" type="checkbox">
28
+ </td>
29
+ <th>Reason</th>
30
+ <th>Ignored At</th>
31
+ <th>Line</th>
32
+ </tr>
33
+ </thead>
34
+
35
+ <tbody>
36
+ %%%SUCURI.IgnoredFiles%%%
37
+
38
+ <tr class="sucuriscan-%%SUCURI.NoFilesVisibility%%">
39
+ <td colspan="4">
40
+ <em>No files are being ignored.</em>
41
+ </td>
42
+ </tr>
43
+ </tbody>
44
+ </table>
45
+
46
+ <p>
47
+ <button type="submit" class="button button-primary">Stop Ignoring the Selected Files</button>
48
+ </p>
49
+ </form>
50
+ </div>
51
+ </div>
inc/tpl/settings-scanner-integrity-cache.snippet.tpl ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <tr class="sucuriscan-integrity-%%SUCURI.UniqueId%%">
3
+ <th class="check-column">
4
+ <input type="checkbox" name="sucuriscan_corefile_path[]" value="%%SUCURI.FilePath%%" />
5
+ </th>
6
+
7
+ <td>
8
+ <span class="sucuriscan-label sucuriscan-label-%%SUCURI.StatusType%%">%%SUCURI.StatusType%%</span>
9
+ </td>
10
+
11
+ <td>
12
+ <span>%%SUCURI.IgnoredAt%%</span>
13
+ </td>
14
+
15
+ <td>
16
+ <span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.FilePath%%</span>
17
+ </td>
18
+ </tr>
inc/tpl/settings-scanner-integrity-diff-utility.html.tpl ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">WordPress Integrity (Diff Utility)</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ Since the scanner doesn't reads the files during the execution of the
8
+ integrity check, it is possible to find false/positives. The scanner
9
+ compares a hash generated from the file content but not the content
10
+ in itself. If you include, for example, a new empty line in any of
11
+ the core WordPress files the scanner will flag that file even if the
12
+ modification is harmless.
13
+ </p>
14
+
15
+ <p>
16
+ However, if your server allows the execution of system commands, you
17
+ can configure the plugin to use the <a href="https://en.wikipedia.org/wiki/Diff_utility"
18
+ target="_blank" rel="noopener">Unix Diff Utility</a> to compare the actual content
19
+ of the file installed in the website and the original file provided
20
+ by WordPress. This will show the differences between both files and
21
+ then you can act upon the information provided.
22
+ </p>
23
+
24
+ <div class="sucuriscan-hstatus sucuriscan-hstatus-%%SUCURI.DiffUtility.StatusNum%%">
25
+ <span>WordPress Integrity using the Unix Diff Utility is %%SUCURI.DiffUtility.Status%%</span>
26
+
27
+ <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
28
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
29
+ <input type="hidden" name="sucuriscan_diff_utility" value="%%SUCURI.DiffUtility.SwitchValue%%" />
30
+ <button type="submit" class="button button-primary">%%SUCURI.DiffUtility.SwitchText%%</button>
31
+ </form>
32
+ </div>
33
+ </div>
34
+ </div>
inc/tpl/settings-scanner-integrity-language.html.tpl ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">WordPress Integrity (Language)</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ The information necessary to check the WordPress integrity uses data
8
+ obtained from the <a href="http://codex.wordpress.org/WordPress.org_API"
9
+ target="_blank" rel="noopener">WordPress API</a>. It compares this data with the
10
+ content of the files installed in your website. By default the API
11
+ returns this data for the English version of WordPress. If your
12
+ website is using a non-English version of the code you will have to
13
+ specify the language to reduce the amount of false/positives.
14
+ </p>
15
+
16
+ <div class="sucuriscan-inline-alert-info">
17
+ <p>
18
+ <b>NOTE:</b> Not all the languages are supported. If you notice
19
+ a high amount of false/positives please consider to switch the
20
+ option back to English and then mark the files that you consider
21
+ are clean as such, they will be ignored by the scanner the next
22
+ time it runs.
23
+ </p>
24
+ </div>
25
+
26
+ <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
27
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
28
+ <fieldset class="sucuriscan-clearfix">
29
+ <label>WordPress Locale:</label>
30
+ <select name="sucuriscan_set_language">
31
+ %%%SUCURI.Integrity.LanguageDropdown%%%
32
+ </select>
33
+ <button type="submit" class="button button-primary">Proceed</button>
34
+ <span><em>(WordPress Locale %%SUCURI.Integrity.WordPressLocale%%)</em></span>
35
+ </fieldset>
36
+ </form>
37
+ </div>
38
+ </div>
inc/tpl/settings-scanner-options.html.tpl ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Scanner Settings</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ The plugin scans your entire website looking for changes which are
8
+ later reported via the API in the audit logs page. This scanner runs
9
+ twice-daily by default but you can change the frequency to meet your
10
+ own requirements. Notice that scanning your project files too frequently
11
+ will affect the performance of your website. Be sure to have enough
12
+ server resources before changing this option. The memory limit and
13
+ maximum execution time are two of the PHP options that your server
14
+ will set to stop your website from consuming too much resources.
15
+ </p>
16
+
17
+ <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.NoSPL.Visibility%%">
18
+ <p>
19
+ The scanner uses the <a href="http://php.net/manual/en/class.splfileobject.php"
20
+ target="_blank" rel="noopener">PHP SPL library</a> and the <a target="_blank"
21
+ href="http://php.net/manual/en/class.filesystemiterator.php" rel="noopener">
22
+ Filesystem Iterator</a> class to scan the directory tree where
23
+ your website is located in the server. This library is only
24
+ available on PHP 5 >= 5.3.0 &mdash; OR &mdash; PHP 7; if you have
25
+ an older version of PHP the plugin will not work as expected.
26
+ Please ask your hosting provider to advice you on this matter.
27
+ </p>
28
+ </div>
29
+
30
+ <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
31
+ <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
32
+
33
+ <fieldset class="sucuriscan-clearfix">
34
+ <label>Scanning Frequency</label>
35
+ <select name="sucuriscan_scan_frequency">
36
+ %%%SUCURI.ScanningFrequencyOptions%%%
37
+ </select>
38
+ <button type="submit" class="button button-primary">Change</button>
39
+ </fieldset>
40
+ </form>
41
+ </div>
42
+ </div>
inc/tpl/settings-scanner.html.tpl DELETED
@@ -1,145 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description">
4
- <h3>Scanner Settings</h3>
5
-
6
- <div class="inside">
7
-
8
- <p>
9
- There are multiple scanners implemented in the code of the plugin, all of them
10
- are enabled by default and you can deactivate them separately without affect the
11
- others. You may want to disable a scanner because your site has too many
12
- directories and/or files to scan, or because the maximum quantity of memory
13
- allowed for your project is not enough to execute one these functions. You can
14
- enable and disable any of the scanners anything you want.
15
- </p>
16
-
17
- <div class="sucuriscan-inline-alert-info">
18
- <p>
19
- The <em>"Scanning Algorithm"</em> is the method that will be used to read the
20
- diretories and files contained in the project when any of the file system
21
- scanners are executed. The best option is SPL <em>(Standard PHP Library)</em>
22
- but it is not available in all versions of the PHP interpreter. We recommend to
23
- upgrade the version of PHP installed in the server, but if you can not do this
24
- then choose a different algorithm.
25
- </p>
26
- </div>
27
-
28
- </div>
29
- </div>
30
- </div>
31
-
32
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings sucuriscan-settings-scanner">
33
- <thead>
34
- <tr>
35
- <th>Option</th>
36
- <th>Value</th>
37
- <th>&nbsp;</th>
38
- </tr>
39
- </thead>
40
-
41
- <tbody>
42
-
43
- <tr>
44
- <td>Last background scan</td>
45
- <td><span class="sucuriscan-monospace">%%SUCURI.ScanningRuntimeHuman%%</span></td>
46
- <td class="td-with-button">
47
- <form action="%%SUCURI.URL.Home%%" method="post">
48
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
49
- <button type="submit" name="sucuriscan_force_scan" class="button-primary">Force scan</button>
50
- </form>
51
- </td>
52
- </tr>
53
-
54
- <tr class="alternate">
55
- <td>Scanning algorithm</td>
56
- <td>%%SUCURI.ScanningInterface%%</td>
57
- <td class="td-with-button">
58
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
59
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
60
- <select name="sucuriscan_scan_interface">
61
- %%%SUCURI.ScanningInterfaceOptions%%%
62
- </select>
63
- <button type="submit" class="button-primary">Change</button>
64
- </form>
65
- </td>
66
- </tr>
67
-
68
- <tr>
69
- <td>Scanning frequency</td>
70
- <td>%%SUCURI.ScanningFrequency%%</td>
71
- <td class="td-with-button">
72
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
73
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
74
- <select name="sucuriscan_scan_frequency">
75
- %%%SUCURI.ScanningFrequencyOptions%%%
76
- </select>
77
- <button type="submit" class="button-primary">Change</button>
78
- </form>
79
- </td>
80
- </tr>
81
-
82
- <tr class="alternate">
83
- <td>Main <abbr title="File System Scanner">FS Scanner</abbr></td>
84
- <td>%%SUCURI.FsScannerStatus%%</td>
85
- <td class="td-with-button">
86
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
87
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
88
- <input type="hidden" name="sucuriscan_fs_scanner" value="%%SUCURI.FsScannerSwitchValue%%" />
89
- <button type="submit" class="button-primary %%SUCURI.FsScannerSwitchCssClass%%">%%SUCURI.FsScannerSwitchText%%</button>
90
- </form>
91
- </td>
92
- </tr>
93
-
94
- <tr class="alternate">
95
- <td>FS Scanner, Error log files</td>
96
- <td>%%SUCURI.ScanErrorlogsStatus%%</td>
97
- <td class="td-with-button">
98
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
99
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
100
- <input type="hidden" name="sucuriscan_scan_errorlogs" value="%%SUCURI.ScanErrorlogsSwitchValue%%" />
101
- <button type="submit" class="button-primary %%SUCURI.ScanErrorlogsSwitchCssClass%%">%%SUCURI.ScanErrorlogsSwitchText%%</button>
102
- </form>
103
- </td>
104
- </tr>
105
-
106
- <tr class="alternate">
107
- <td>Reset last login logs</td>
108
- <td><span class="sucuriscan-monospace">%%SUCURI.LastLoginLogLife%% of data</span></td>
109
- <td class="td-with-button">
110
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
111
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
112
- <input type="hidden" name="sucuriscan_reset_logfile" value="lastlogins" />
113
- <button type="submit" class="button-primary">Reset logs</button>
114
- </form>
115
- </td>
116
- </tr>
117
-
118
- <tr>
119
- <td>Reset failed login logs</td>
120
- <td><span class="sucuriscan-monospace">%%SUCURI.FailedLoginLogLife%% of data</span></td>
121
- <td class="td-with-button">
122
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
123
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
124
- <input type="hidden" name="sucuriscan_reset_logfile" value="failedlogins" />
125
- <button type="submit" class="button-primary">Reset logs</button>
126
- </form>
127
- </td>
128
- </tr>
129
-
130
- </tbody>
131
- </table>
132
-
133
- <div class="sucuriscan-panelstuff sucuriscan-general-scanner">
134
- %%%SUCURI.Settings.CoreFilesStatus%%%
135
-
136
- %%%SUCURI.Settings.CoreFilesLanguage%%%
137
-
138
- %%%SUCURI.Settings.CoreFilesCache%%%
139
-
140
- %%%SUCURI.Settings.SiteCheckStatus%%%
141
-
142
- %%%SUCURI.Settings.SiteCheckCache%%%
143
-
144
- %%%SUCURI.Settings.SiteCheckTimeout%%%
145
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-selfhosting.html.tpl DELETED
@@ -1,4 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- %%%SUCURI.SelfHosting.Monitor%%%
4
- </div>
 
 
 
 
inc/tpl/settings-sitecheck-cache.html.tpl DELETED
@@ -1,23 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Malware Scanner Cache</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- SiteCheck caches by default the results of every scan to reduce the bandwidth
8
- consumption and to make the subsequent scans faster, if you make modifications
9
- to your website and want to execute a fresh scan you will have to wait
10
- <strong>%%SUCURI.SiteCheck.CacheLifeTime%% seconds</strong>. Alternatively, you
11
- can reset the cache and request a fresh scan immediately.
12
- </p>
13
-
14
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
15
- <span>Malware Scanner Cache: %%SUCURI.SiteCheck.CacheSize%% of data</span>
16
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
17
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
18
- <input type="hidden" name="sucuriscan_sitecheck_cache" value="1" />
19
- <button type="submit" class="button-primary">Reset Cache</button>
20
- </form>
21
- </div>
22
- </div>
23
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-sitecheck-status.html.tpl DELETED
@@ -1,56 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Malware Scanner</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- The malware scanner is a free tool powered by <a href="https://sitecheck.sucuri.net/"
8
- target="_blank">Sucuri SiteCheck</a>, it will check your website for
9
- known malware, blacklisting status, website errors, and out-of-date
10
- software. Although we do our best to provide the best results, 100%
11
- accuracy is not realistic, and not guaranteed. The remote website
12
- scanner tries to identify if the provided site is infected with any
13
- type of malware including SPAM or if it has been blacklisted or defaced.
14
- Sounds simple, but being able to identify these issues remotely <em>
15
- (without server access)</em> is a very complicated task, and that is
16
- why we do not guarantee 100% accuracy. If you see a positive result
17
- in the scan results, it just means that when we scanned we could not
18
- see anything malicious.
19
- </p>
20
-
21
- <div class="sucuriscan-inline-alert-info">
22
- <p>
23
- More information at <a href="https://blog.sucuri.net/2012/10/ask-sucuri-how-does-sitecheck-work.html"
24
- target="_blank">Ask Sucuri: How does SiteCheck works?</a>
25
- </p>
26
- </div>
27
-
28
- <div class="sucuriscan-%%SUCURI.SiteCheck.IfEnabled%%">
29
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
30
- <span>Malware Scanner is Enabled; used %%SUCURI.SiteCheck.Counter%% times</span>
31
-
32
- <form action="%%SUCURI.URL.Scanner%%" method="post">
33
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
34
- <input type="hidden" name="sucuriscan_malware_scan" value="1" />
35
- <button type="submit" class="button-primary">Scan Now</button>
36
- </form>
37
- </div>
38
-
39
- <p>
40
- You can disable this scanner adding this constant in your configuration
41
- file: <code>define('SUCURISCAN_NO_SITECHECK', true);</code>
42
- </p>
43
- </div>
44
-
45
- <div class="sucuriscan-%%SUCURI.SiteCheck.IfDisabled%%">
46
- <div class="sucuriscan-hstatus sucuriscan-hstatus-0">
47
- <span>Malware Scanner is Disabled</span>
48
- </div>
49
-
50
- <p>
51
- Enable this scanner by removing the constant <em>"SUCURISCAN_NO_SITECHECK"
52
- </em> from the configuration file.
53
- </p>
54
- </div>
55
- </div>
56
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-sitecheck-timeout.html.tpl DELETED
@@ -1,43 +0,0 @@
1
-
2
- <div class="postbox">
3
- <h3>Malware Scanner Timeout</h3>
4
-
5
- <div class="inside">
6
- <p>
7
- <a href="https://sitecheck.sucuri.net/" target="_blank">SiteCheck</a> is a web
8
- application scanner that reads the source code of a website to determine if it
9
- is serving malicious code, it scans the home page and linked sub-pages, then
10
- compares the results with a list of signatures as well as a list of blacklist
11
- services to see if other malware scanners have flagged the website before. This
12
- operation may take a couple of seconds, around twenty seconds in most cases; be
13
- sure to set enough timeout for the operation to finish, otherwise the scanner
14
- will return innacurate information.
15
- </p>
16
-
17
- <div class="sucuriscan-inline-alert-info">
18
- <p>
19
- You can set up to %%SUCURI.MaxRequestTimeout%% seconds for the timeout, more than that is not allowed.
20
- </p>
21
- </div>
22
-
23
- <div class="sucuriscan-hstatus sucuriscan-hstatus-2">
24
- <span>Wait <b>%%SUCURI.RequestTimeout%%</b> before timeout</span>
25
- </div>
26
-
27
- <p>
28
- If you start experiencing issues related with the timeout of the requests
29
- you may consider to increase the number of seconds to wait for the response.
30
- You may also want to check with your hosting provider to see if there is
31
- something in the server blocking the connection.
32
- </p>
33
-
34
- <form action="%%SUCURI.URL.Settings%%#scanner" method="post">
35
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
36
- <span class="sucuriscan-input-group">
37
- <label>HTTP Request Timeout (in secs)</label>
38
- <input type="text" name="sucuriscan_sitecheck_timeout" class="input-text" />
39
- </span>
40
- <button type="submit" class="button-primary">Proceed</button>
41
- </form>
42
- </div>
43
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-trustip.html.tpl DELETED
@@ -1,58 +0,0 @@
1
-
2
- <div class="sucuriscan-panelstuff">
3
- <div class="postbox sucuriscan-border sucuriscan-table-description sucuriscan-trustip-form">
4
- <h3>Trust IP Address</h3>
5
-
6
- <div class="inside">
7
- <p>
8
- If you are working in a LAN <em>(Local Area Network)</em> you may want to
9
- include the IP addresses of all the nodes in the subnet, this will force the
10
- plugin to stop sending email notifications about actions executed from trusted
11
- IP addresses. Use the CIDR <em>(Classless Inter Domain Routing)</em> format to
12
- specify ranges of IP addresses <em>(only 8, 16, and 24)</em>.
13
- </p>
14
-
15
- <form action="%%SUCURI.URL.Settings%%#trustip" method="POST">
16
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
17
- <input type="text" name="sucuriscan_trust_ip" placeholder="e.g. 182.120.56.0/24" />
18
- <input type="submit" value="Add Entry" class="button button-primary" />
19
- </form>
20
- </div>
21
- </div>
22
- </div>
23
-
24
- <form action="%%SUCURI.URL.Settings%%#trustip" method="post">
25
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
26
-
27
- <table class="wp-list-table widefat sucuriscan-table sucuriscan-settings-trustip">
28
- <thead>
29
- <tr>
30
- <th class="manage-column column-cb check-column">
31
- <label class="screen-reader-text" for="cb-select-all-1">Select All</label>
32
- <input id="cb-select-all-1" type="checkbox">
33
- </th>
34
- <th class="manage-column">IP Address</th>
35
- <th class="manage-column">CIDR Format</th>
36
- <th class="manage-column">Added At</th>
37
- </tr>
38
- </thead>
39
-
40
- <tbody>
41
- %%%SUCURI.TrustedIPs.List%%%
42
-
43
- <tr class="sucuriscan-%%SUCURI.TrustedIPs.NoItems.Visibility%%">
44
- <td colspan="4">
45
- <em>List is empty.</em>
46
- </td>
47
- </tr>
48
- </tbody>
49
-
50
- <tfoot>
51
- <tr>
52
- <td colspan="4">
53
- <button type="submit" class="button button-primary">Remove selected</button>
54
- </td>
55
- </tr>
56
- </tfoot>
57
- </table>
58
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/settings-webinfo-details.html.tpl ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Website Environment Variables</h3>
4
+
5
+ <div class="inside">
6
+ <table class="wp-list-table widefat sucuriscan-table sucuriscan-server-info">
7
+ <tbody>
8
+ %%%SUCURI.ServerInfo.Variables%%%
9
+ </tbody>
10
+ </table>
11
+ </div>
12
+ </div>
inc/tpl/{infosys-serverinfo.snippet.tpl → settings-webinfo-details.snippet.tpl} RENAMED
@@ -1,5 +1,6 @@
1
 
2
- <tr class="%%SUCURI.ServerInfo.CssClass%%">
3
  <td>%%SUCURI.ServerInfo.Title%%</td>
 
4
  <td><span class="sucuriscan-monospace">%%SUCURI.ServerInfo.Value%%</span></td>
5
  </tr>
1
 
2
+ <tr>
3
  <td>%%SUCURI.ServerInfo.Title%%</td>
4
+
5
  <td><span class="sucuriscan-monospace">%%SUCURI.ServerInfo.Value%%</span></td>
6
  </tr>
inc/tpl/settings-webinfo-htaccess.html.tpl ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">Access File Integrity</h3>
4
+
5
+ <div class="inside">
6
+ <p>
7
+ The <code>.htaccess</code> is a distributed configuration file, and is how the
8
+ Apache web server handles configuration changes on a per-directory basis.
9
+ WordPress uses this file to manipulate how Apache serves files from its root
10
+ directory and subdirectories thereof; most notably, it modifies this file to be
11
+ able to handle pretty permalinks.
12
+ </p>
13
+
14
+ <div class="sucuriscan-inline-alert-success sucuriscan-%%SUCURI.HTAccess.FoundVisible%%">
15
+ <p>HTAccess file found in this path <code>%%SUCURI.HTAccess.Fpath%%</code></p>
16
+ </div>
17
+
18
+ <div class="sucuriscan-inline-alert-error sucuriscan-%%SUCURI.HTAccess.NotFoundVisible%%">
19
+ <p>Your website has no <code>.htaccess</code> file or it was not found in the default location.</p>
20
+ </div>
21
+
22
+ <div class="sucuriscan-inline-alert-info sucuriscan-%%SUCURI.HTAccess.StandardVisible%%">
23
+ <p>
24
+ The main <code>.htaccess</code> file in your site has the standard rules for a
25
+ WordPress installation. You can customize it to improve the performance and
26
+ change the behaviour of the redirections for pages and posts in your site. To
27
+ get more information visit the official documentation at <a target="_blank" rel="noopener"
28
+ href="https://codex.wordpress.org/Using_Permalinks#Creating_and_editing_.28.htaccess.29">
29
+ Codex WordPress - Creating and editing (.htaccess)</a>
30
+ </p>
31
+ </div>
32
+
33
+ <textarea readonly class="sucuriscan-full-textarea sucuriscan-monospace %%SUCURI.HTAccess.TextareaVisible%%">%%SUCURI.HTAccess.Content%%</textarea>
34
+
35
+ <p>
36
+ <small>Source <a href="https://codex.wordpress.org/htaccess" target="_blank" rel="noopener">Codex WordPress HTAccess</a></small>
37
+ </p>
38
+ </div>
39
+ </div>
inc/tpl/settings-webinfo-wpconfig.html.tpl ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ <div class="sucuriscan-panel">
3
+ <h3 class="sucuriscan-title">WordPress Configuration Variables</h3>
4
+
5
+ <div class="inside">
6
+ <table class="wp-list-table widefat sucuriscan-table">
7
+ <thead>
8
+ <tr>
9
+ <th>Variable</th>
10
+ <th>Value</th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ %%%SUCURI.WordpressConfig.Rules%%%
16
+ </tbody>
17
+ </table>
18
+ </div>
19
+ </div>
inc/tpl/settings-webinfo-wpconfig.snippet.tpl ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+
2
+ <tr>
3
+ <td><span class="sucuriscan-monospace">%%SUCURI.WordpressConfig.VariableName%%</span></td>
4
+
5
+ <td><span class="sucuriscan-monospace sucuriscan-wraptext">%%SUCURI.WordpressConfig.VariableValue%%</span></td>
6
+ </tr>
inc/tpl/settings.html.tpl CHANGED
@@ -1,70 +1,122 @@
1
 
2
  <div class="sucuriscan-tabs">
3
- <ul>
4
- <li>
5
- <a href="#general" data-tabname="general">General</a>
6
- </li>
7
- <li>
8
- <a href="#scanner" data-tabname="scanner">Scanner</a>
9
- </li>
10
- <li>
11
- <a href="#notifications" data-tabname="notifications">Alerts</a>
12
- </li>
13
- <li>
14
- <a href="#apiservice" data-tabname="apiservice">API Service</a>
15
- </li>
16
- <li>
17
- <a href="#selfhosting" data-tabname="selfhosting">Log Exporter</a>
18
- </li>
19
- <li>
20
- <a href="#ignorescanning" data-tabname="ignorescanning">Ignore Scanning</a>
21
- </li>
22
- <li>
23
- <a href="#ignorerules" data-tabname="ignorerules">Ignore Alerts</a>
24
- </li>
25
- <li>
26
- <a href="#trustip" data-tabname="trustip">Trust IP</a>
27
- </li>
28
- <li>
29
- <a href="#heartbeat" data-tabname="heartbeat">Heartbeat</a>
30
- </li>
31
  </ul>
32
 
33
- <div class="sucuriscan-tab-containers">
34
- <div id="sucuriscan-general">
35
- %%%SUCURI.Settings.General%%%
36
- </div>
37
 
38
- <div id="sucuriscan-scanner">
39
- %%%SUCURI.Settings.Scanner%%%
40
- </div>
 
 
 
 
41
 
42
- <div id="sucuriscan-notifications">
43
- %%%SUCURI.Settings.Alerts%%%
 
 
 
 
 
 
 
44
  </div>
45
 
46
- <div id="sucuriscan-apiservice">
47
- %%%SUCURI.Settings.ApiService%%%
 
 
 
 
 
 
 
 
48
  </div>
49
 
50
- <div id="sucuriscan-selfhosting">
51
- %%%SUCURI.Settings.SelfHosting%%%
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  </div>
53
 
54
- <div id="sucuriscan-ignorescanning">
55
- %%%SUCURI.Settings.IgnoreScanning%%%
 
 
 
 
 
 
56
  </div>
57
 
58
- <div id="sucuriscan-ignorerules">
59
- %%%SUCURI.Settings.IgnoreRules%%%
 
 
 
 
 
 
 
 
 
 
 
 
60
  </div>
61
 
62
- <div id="sucuriscan-trustip">
63
- %%%SUCURI.Settings.TrustIP%%%
 
 
 
 
64
  </div>
65
 
66
- <div id="sucuriscan-heartbeat">
67
- %%%SUCURI.Settings.Heartbeat%%%
 
 
 
 
68
  </div>
69
  </div>
70
  </div>
1
 
2
  <div class="sucuriscan-tabs">
3
+ <ul class="sucuriscan-clearfix sucuriscan-tabs-buttons">
4
+ <li><a href="%%SUCURI.URL.Settings%%#general">General</a></li>
5
+ <li><a href="%%SUCURI.URL.Settings%%#scanner">Scanner</a></li>
6
+ <li><a href="%%SUCURI.URL.Settings%%#hardening">Hardening</a></li>
7
+ <li><a href="%%SUCURI.URL.Settings%%#posthack">Post-Hack</a></li>
8
+ <li><a href="%%SUCURI.URL.Settings%%#alerts">Alerts</a></li>
9
+ <li><a href="%%SUCURI.URL.Settings%%#apiservice">API Service</a></li>
10
+ <li><a href="%%SUCURI.URL.Settings%%#webinfo">Website Info</a></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  </ul>
12
 
13
+ <div class="sucuriscan-tabs-containers">
14
+ <div id="sucuriscan-tabs-general">
15
+ %%%SUCURI.Settings.General.ApiKey%%%
 
16
 
17
+ %%%SUCURI.Settings.General.DataStorage%%%
18
+
19
+ %%%SUCURI.Settings.General.SelfHosting%%%
20
+
21
+ %%%SUCURI.Settings.General.Cronjobs%%%
22
+
23
+ %%%SUCURI.Settings.General.ReverseProxy%%%
24
 
25
+ %%%SUCURI.Settings.General.IPDiscoverer%%%
26
+
27
+ %%%SUCURI.Settings.General.CommentMonitor%%%
28
+
29
+ %%%SUCURI.Settings.General.AuditLogStats%%%
30
+
31
+ %%%SUCURI.Settings.General.ImportExport%%%
32
+
33
+ %%%SUCURI.Settings.General.ResetOptions%%%
34
  </div>
35
 
36
+ <div id="sucuriscan-tabs-scanner">
37
+ %%%SUCURI.Settings.Scanner.Options%%%
38
+
39
+ %%%SUCURI.Settings.Scanner.IntegrityDiffUtility%%%
40
+
41
+ %%%SUCURI.Settings.Scanner.IntegrityLanguage%%%
42
+
43
+ %%%SUCURI.Settings.Scanner.IntegrityCache%%%
44
+
45
+ %%%SUCURI.Settings.Scanner.IgnoreFolders%%%
46
  </div>
47
 
48
+ <div id="sucuriscan-tabs-hardening">
49
+ <div class="sucuriscan-panel">
50
+ <h3 class="sucuriscan-title">Hardening Options</h3>
51
+
52
+ <div class="inside">
53
+ %%%SUCURI.Settings.Hardening.Firewall%%%
54
+
55
+ %%%SUCURI.Settings.Hardening.WPVersion%%%
56
+
57
+ %%%SUCURI.Settings.Hardening.PHPVersion%%%
58
+
59
+ %%%SUCURI.Settings.Hardening.RemoveGenerator%%%
60
+
61
+ %%%SUCURI.Settings.Hardening.NginxPHPFPM%%%
62
+
63
+ %%%SUCURI.Settings.Hardening.WPUploads%%%
64
+
65
+ %%%SUCURI.Settings.Hardening.WPContent%%%
66
+
67
+ %%%SUCURI.Settings.Hardening.WPIncludes%%%
68
+
69
+ %%%SUCURI.Settings.Hardening.Readme%%%
70
+
71
+ %%%SUCURI.Settings.Hardening.AdminUser%%%
72
+
73
+ %%%SUCURI.Settings.Hardening.FileEditor%%%
74
+ </div>
75
+ </div>
76
+
77
+ %%%SUCURI.Settings.Hardening.WhitelistPHPFiles%%%
78
  </div>
79
 
80
+ <div id="sucuriscan-tabs-posthack">
81
+ %%%SUCURI.Settings.Posthack.SecurityKeys%%%
82
+
83
+ %%%SUCURI.Settings.Posthack.ResetPassword%%%
84
+
85
+ %%%SUCURI.Settings.Posthack.ResetPlugins%%%
86
+
87
+ %%%SUCURI.Settings.Posthack.AvailableUpdates%%%
88
  </div>
89
 
90
+ <div id="sucuriscan-tabs-alerts">
91
+ %%%SUCURI.Settings.Alerts.Recipients%%%
92
+
93
+ %%%SUCURI.Settings.Alerts.TrustedIPs%%%
94
+
95
+ %%%SUCURI.Settings.Alerts.Subject%%%
96
+
97
+ %%%SUCURI.Settings.Alerts.PerHour%%%
98
+
99
+ %%%SUCURI.Settings.Alerts.BruteForce%%%
100
+
101
+ %%%SUCURI.Settings.Alerts.Events%%%
102
+
103
+ %%%SUCURI.Settings.Alerts.IgnorePosts%%%
104
  </div>
105
 
106
+ <div id="sucuriscan-tabs-apiservice">
107
+ %%%SUCURI.Settings.APIService.Status%%%
108
+
109
+ %%%SUCURI.Settings.APIService.Timeout%%%
110
+
111
+ %%%SUCURI.Settings.APIService.Proxy%%%
112
  </div>
113
 
114
+ <div id="sucuriscan-tabs-webinfo">
115
+ %%%SUCURI.Settings.Webinfo.Details%%%
116
+
117
+ %%%SUCURI.Settings.Webinfo.WPConfig%%%
118
+
119
+ %%%SUCURI.Settings.Webinfo.HTAccess%%%
120
  </div>
121
  </div>
122
  </div>
inc/tpl/setup-form.html.tpl DELETED
@@ -1,70 +0,0 @@
1
-
2
- <p>
3
- An API key is required to activate some additional tools available in this
4
- plugin, the keys are free and you can virtually generate an unlimited number of
5
- them as long as the domain name and email address are different. The key is used
6
- to authenticate the HTTP requests sent by the plugin to a public API service
7
- managed by Sucuri Inc. Do not generate the key if you disagree with this.
8
- </p>
9
-
10
- <div class="sucuriscan-inline-alert-info">
11
- <p>
12
- If you experience issues generating the API key you can request one sending the
13
- domain name and email address that you want to use to <a href="mailto:info@sucuri.net">
14
- info@sucuri.net</a>. Note that setting a key in a development environment does
15
- not makes sense, if you are trying to do that in a local or stage environment
16
- please consider to dismiss this alert.
17
- </p>
18
- </div>
19
-
20
- <form action="%%SUCURI.URL.Settings%%" method="post">
21
- <input type="hidden" name="sucuriscan_page_nonce" value="%%SUCURI.PageNonce%%" />
22
- <input type="hidden" name="sucuriscan_plugin_api_key" value="1" />
23
-
24
- <table class="form-table sucuriscan-table-setup">
25
- <tbody>
26
- <tr>
27
- <td width="150">Domain Name:</td>
28
- <td width=""><span>%%SUCURI.CleanDomain%%</span></td>
29
- </tr>
30
-
31
- <tr>
32
- <td>E-mail Address:</td>
33
- <td>
34
- <select name="sucuriscan_setup_user">
35
- %%%SUCURI.AdminEmails%%%
36
- </select>
37
- </td>
38
- </tr>
39
-
40
- <tr>
41
- <td>DNS Lookups:</td>
42
- <td>
43
- <label>
44
- <input type="hidden" name="sucuriscan_dns_lookups" value="disable" />
45
- <input type="checkbox" name="sucuriscan_dns_lookups" value="enable" checked="checked" />
46
- <span>Enable DNS lookups on startup</span>
47
- </label>
48
-
49
- <p class="sucuriscan-description">
50
- DNS lookups are only necessary if you are planning to use a reverse proxy or
51
- firewall <em>(like CloudProxy)</em>, this is used to set the correct IP address
52
- when the firewall/proxy filters the requests. If you are not planning to use any
53
- of these is better to disable this option, otherwise the load time of your site
54
- may be affected.
55
- </p>
56
- </td>
57
- </tr>
58
- </tbody>
59
- </table>
60
-
61
- <div class="sucuriscan-clearfix">
62
- <div class="sucuriscan-pull-left">
63
- <button type="submit" class="button button-primary">Proceed</button>
64
- </div>
65
- <div class="sucuriscan-pull-right">
66
- <a href="%%SUCURI.URL.Home%%&sucuriscan_dismiss_setup"
67
- class="sucuriscan-dismiss-setup">Do not show this again</a>
68
- </div>
69
- </div>
70
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/setup-notice.html.tpl DELETED
@@ -1,20 +0,0 @@
1
-
2
- <div class="updated sucuriscan-setup-notice sucuriscan-clearfix">
3
- <a href="https://sucuri.net/" target="_blank" class="sucuriscan-pull-left sucuriscan-setup-image">
4
- <img src="%%SUCURI.SucuriURL%%/inc/images/logo.png" alt="Sucuri Scanner" />
5
- </a>
6
-
7
- <div class="sucuriscan-pull-left">
8
- <p>
9
- Plugin not fully activated yet. Please generate the free API key to<br>
10
- enable audit logging, integrity checking, email alerts and other tools.
11
- </p>
12
- </div>
13
-
14
- <div class="sucuriscan-pull-right sucuriscan-setup-form">
15
- <a href="#" data-modalid="sucuriscan-setup-form-modal"
16
- class="button button-primary button-hero sucuriscan-modal-btn">
17
- <span class="sucuriscan-button-title">Generate API Key</span>
18
- </a>
19
- </div>
20
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/tpl/sitecheck-blacklist.html.tpl ADDED
@@ -0,0 +1,10 @@
 
 
1
+
2
+ <div class="sucuriscan-panel sucuriscan-sitecheck-list sucuriscan-sitecheck-blacklist